/* * Copyright (C) 2007-2016 Apple Inc. All rights reserved. * Copyright (C) 2008 Matt Lilek. All rights reserved. * Copyright (C) 2008-2009 Anthony Ricaud * Copyright (C) 2009-2010 Joseph Pecoraro. All rights reserved. * Copyright (C) 2009-2011 Google Inc. All rights reserved. * Copyright (C) 2009 280 North Inc. All Rights Reserved. * Copyright (C) 2010 Nikita Vasilyev. All rights reserved. * Copyright (C) 2011 Brian Grinstead All rights reserved. * Copyright (C) 2013 Matt Holden * Copyright (C) 2013 Samsung Electronics. All rights reserved. * Copyright (C) 2013 Seokju Kwon (seokju.kwon@gmail.com) * Copyright (C) 2013 Adobe Systems Inc. All rights reserved. * Copyright (C) 2013-2015 University of Washington. All rights reserved. * Copyright (C) 2014-2015 Saam Barati * Copyright (C) 2014 Antoine Quint * Copyright (C) 2015 Tobias Reiss * Copyright (C) 2015-2016 Devin Rousso . All rights reserved. * Copyright (C) 2017 Sony Interactive Entertainment Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ var WebInspector={};WebInspector.Platform={name:InspectorFrontendHost.platform(),isNightlyBuild:!1,version:{base:0,release:0,name:""}},function(){var u=/ AppleWebKit\/([^ ]+)/.exec(navigator.userAgent);u&&-1!==u[1].indexOf("+")&&10>document.styleSheets.length&&(WebInspector.Platform.isNightlyBuild=!0);var _=/ Mac OS X (\d+)_(\d+)/.exec(navigator.appVersion);if(_&&"10"===_[1])switch(WebInspector.Platform.version.base=10,WebInspector.Platform.version.release=parseInt(_[2]),_[2]){case"12":WebInspector.Platform.version.name="sierra";break;case"11":WebInspector.Platform.version.name="el-capitan";break;case"10":WebInspector.Platform.version.name="yosemite";break;default:WebInspector.Platform.version.name="unknown-mac";}}();class LinkedList{constructor(){this.head=new LinkedListNode,this.head.next=this.head.prev=this.head,this.length=0}clear(){this.head.next=this.head.prev=this.head,this.length=0}get last(){return this.head.prev}push(u){let _=new LinkedListNode(u),S=this.last,C=this.head;return S.next=_,_.next=C,C.prev=_,_.prev=S,this.length++,_}remove(u){return!!u&&(u.prev.next=u.next,u.next.prev=u.prev,this.length--,!0)}forEach(u){let _=this.head;for(let S=0,C=this.length;SS.resolve(C)),S.promise}static hasEventListeners(_){if(!this._listeners)return!1;let S=this._listeners.get(_);return S&&0{let T=WebInspector.ContextMenu.createFromEvent(f);WebInspector.appendContextMenuItemsForDOMNode(T,u,S)}),_};function createSVGElement(u){return document.createElementNS("http://www.w3.org/2000/svg",u)}WebInspector.cssPath=function(u){if(u.nodeType()!==Node.ELEMENT_NODE)return"";let _="";u.isPseudoElement()&&(_="::"+u.pseudoType(),u=u.parentNode);let S=[];for(;u;){let C=WebInspector.cssPathComponent(u);if(!C)break;if(S.push(C),C.done)break;u=u.parentNode}return S.reverse(),S.map(C=>C.value).join(" > ")+_},WebInspector.cssPathComponent=function(u){function _(D){let M=D.getAttribute("class");return M?M.trim().split(/\s+/):[]}if(u.nodeType()!==Node.ELEMENT_NODE)return null;let S=u.nodeNameInCorrectCase(),C=u.nodeName().toLowerCase();if("body"===C||"head"===C||"html"===C)return{value:S,done:!0};let f=u.getAttribute("id");if(f)return{value:u.escapedIdSelector,done:!0};if(!u.parentNode||u.parentNode.nodeType()===Node.DOCUMENT_NODE)return{value:S,done:!0};let T=-1,E=!0,I=new Set(_(u)),R=u.parentNode.children,N=0;for(let D of R)if(D.nodeType()===Node.ELEMENT_NODE){if(N++,D===u){T=N;continue}if(D.nodeNameInCorrectCase()===S&&(E=!1),I.size){let O=_(D);for(let F of O)I.delete(F)}}let L=S;return"input"===C&&u.getAttribute("type")&&!I.size&&(L+=`[type="${u.getAttribute("type")}"]`),E||(I.size?L+=u.escapedClassSelector:L+=`:nth-child(${T})`),{value:L,done:!1}},WebInspector.xpath=function(u){if(u.nodeType()===Node.DOCUMENT_NODE)return"/";let _=[];for(;u;){let C=WebInspector.xpathComponent(u);if(!C)break;if(_.push(C),C.done)break;u=u.parentNode}_.reverse();let S=_.length&&_[0].done?"":"/";return S+_.map(C=>C.value).join("/")},WebInspector.xpathComponent=function(u){let _=WebInspector.xpathIndex(u);if(-1===_)return null;let S;switch(u.nodeType()){case Node.DOCUMENT_NODE:return{value:"",done:!0};case Node.ELEMENT_NODE:var C=u.getAttribute("id");if(C)return{value:`//*[@id="${C}"]`,done:!0};S=u.localName();break;case Node.ATTRIBUTE_NODE:S=`@${u.nodeName()}`;break;case Node.TEXT_NODE:case Node.CDATA_SECTION_NODE:S="text()";break;case Node.COMMENT_NODE:S="comment()";break;case Node.PROCESSING_INSTRUCTION_NODE:S="processing-instruction()";break;default:S="";}return 0<_&&(S+=`[${_}]`),{value:S,done:!1}},WebInspector.xpathIndex=function(u){function _(E,I){if(E===I)return!0;let R=E.nodeType(),N=I.nodeType();return R===Node.ELEMENT_NODE&&N===Node.ELEMENT_NODE?E.localName()===I.localName():R===Node.CDATA_SECTION_NODE?R===Node.TEXT_NODE:N===Node.CDATA_SECTION_NODE?N===Node.TEXT_NODE:R===N}if(!u.parentNode)return 0;let S=u.parentNode.children;if(1>=S.length)return 0;let C=!0,f=-1,T=1;for(let E of S)if(_(u,E)){if(u===E){if(f=T,!C)return f;}else if(C=!1,-1!=f)return f;T++}return C?0:f},WebInspector.EventListener=class{constructor(_,S){this._thisObject=_,this._emitter=null,this._callback=null,this._fireOnce=S}connect(_,S,C,f){var T=_&&(_ instanceof WebInspector.Object||_ instanceof Node||"function"==typeof _.addEventListener);if(T&&S&&C){if(this._emitter=_,this._type=S,this._usesCapture=!!f,_ instanceof Node&&(C=C.bind(this._thisObject)),this._fireOnce){var E=this;this._callback=function(){E.disconnect(),C.apply(this,arguments)}}else this._callback=C;this._emitter instanceof Node?this._emitter.addEventListener(this._type,this._callback,this._usesCapture):this._emitter.addEventListener(this._type,this._callback,this._thisObject)}}disconnect(){this._emitter&&this._callback&&(this._emitter instanceof Node?this._emitter.removeEventListener(this._type,this._callback,this._usesCapture):this._emitter.removeEventListener(this._type,this._callback,this._thisObject),this._fireOnce&&delete this._thisObject,delete this._emitter,delete this._type,delete this._callback)}},WebInspector.EventListenerSet=class{constructor(_,S){this.name=S,this._defaultThisObject=_,this._listeners=[],this._installed=!1}register(_,S,C,f,T){var E=_&&(_ instanceof WebInspector.Object||_ instanceof Node||"function"==typeof _.addEventListener);E&&S&&C&&this._listeners.push({listener:new WebInspector.EventListener(f||this._defaultThisObject),emitter:_,type:S,callback:C,usesCapture:T})}unregister(){this._installed&&this.uninstall(),this._listeners=[]}install(){if(!this._installed){this._installed=!0;for(var _ of this._listeners)_.listener.connect(_.emitter,_.type,_.callback,_.usesCapture)}}uninstall(_){if(this._installed){this._installed=!1;for(var S of this._listeners)S.listener.disconnect();_&&(this._listeners=[])}}};function useSVGSymbol(u,_,S){const C="http://www.w3.org/2000/svg";let T=document.createElementNS(C,"svg");T.style.width="100%",T.style.height="100%",u.includes("#")||(u+="#root");let E=document.createElementNS(C,"use");E.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u),T.appendChild(E);let I=document.createElement("div");return I.appendChild(T),_&&(I.className=_),S&&(I.title=S),I}(function(){if(!WebInspector.dontLocalizeUserInterface){let u=InspectorFrontendHost.localizedStringsURL();u&&document.write("")}})(),WebInspector.unlocalizedString=function(u){return u},WebInspector.UIString=function(u){return WebInspector.dontLocalizeUserInterface?u:window.localizedStrings&&u in window.localizedStrings?window.localizedStrings[u]:(window.localizedStrings||console.error(`Attempted to load localized string "${u}" before localizedStrings was initialized.`),this._missingLocalizedStrings||(this._missingLocalizedStrings={}),u in this._missingLocalizedStrings||(console.error("Localized string \""+u+"\" was not found."),this._missingLocalizedStrings[u]=!0),"LOCALIZED STRING NOT FOUND")},WebInspector.fileExtensionForURL=function(u){var _=parseURL(u).lastPathComponent;if(!_)return"";var S=_.indexOf(".");return-1===S?"":_.substr(S+1)},WebInspector.mimeTypeForFileExtension=function(u){return{html:"text/html",xhtml:"application/xhtml+xml",xml:"text/xml",js:"text/javascript",json:"application/json",clj:"text/x-clojure",coffee:"text/x-coffeescript",ls:"text/x-livescript",ts:"text/typescript",css:"text/css",less:"text/x-less",sass:"text/x-sass",scss:"text/x-scss",bmp:"image/bmp",gif:"image/gif",jpeg:"image/jpeg",jpg:"image/jpeg",pdf:"application/pdf",png:"image/png",tif:"image/tiff",tiff:"image/tiff",svg:"image/svg+xml",txt:"text/plain",xsl:"text/xsl"}[u]||null},WebInspector.fileExtensionForMIMEType=function(u){let S={"text/html":"html","application/xhtml+xml":"xhtml","text/xml":"xml","text/javascript":"js","application/json":"json","text/x-clojure":"clj","text/x-coffeescript":"coffee","text/x-livescript":"ls","text/typescript":"ts","text/css":"css","text/x-less":"less","text/x-sass":"sass","text/x-scss":"scss","image/bmp":"bmp","image/gif":"gif","image/jpeg":"jpg","application/pdf":"pdf","image/png":"png","image/tiff":"tiff","image/svg+xml":"svg","text/plain":"txt","text/xsl":"xsl"}[u];return S?`.${S}`:null},WebInspector.rangeForNextCSSNameOrValue=function(u,_=0){let S=0,C=0,f=u.indexOf(":");_>1,S=u-_-1;return this.substr(0,_)+ellipsis+this.substr(this.length-S,S)}}),Object.defineProperty(String.prototype,"trimEnd",{value:function(u){return this.length<=u?this:this.substr(0,u-1)+ellipsis}}),Object.defineProperty(String.prototype,"truncate",{value:function(u){"use strict";if(this.length<=u)return this;let _=this.slice(0,u),S=_.search(/\s\S*$/);return S>Math.floor(u/2)&&(_=_.slice(0,S-1)),_+ellipsis}}),Object.defineProperty(String.prototype,"collapseWhitespace",{value:function(){return this.replace(/[\s\xA0]+/g," ")}}),Object.defineProperty(String.prototype,"removeWhitespace",{value:function(){return this.replace(/[\s\xA0]+/g,"")}}),Object.defineProperty(String.prototype,"escapeCharacters",{value:function(u){for(var _=!1,S=0;S>11,S=null}return null!==S&&(_+=S,_^=_<<11,_+=_>>17),_^=_<<3,_+=_>>5,_^=_<<2,_+=_>>15,_^=_<<10,(4294967295+_+1).toString(36)}}),Object.defineProperty(String,"standardFormatters",{value:{d:function(u){return parseInt(u).toLocaleString()},f:function(u,_){let S=parseFloat(u);if(isNaN(S))return NaN;let C={minimumFractionDigits:_.precision,maximumFractionDigits:_.precision,useGrouping:!1};return S.toLocaleString(void 0,C)},s:function(u){return u}}}),Object.defineProperty(String,"format",{value:function(u,_,S,C,f){function T(){return"String.format(\""+u+"\", \""+Array.from(_).join("\", \"")+"\")"}function E(O){console.warn(T()+": "+O)}function I(O){console.error(T()+": "+O)}if(!u||!_||!_.length)return{formattedResult:f(C,u),unusedSubstitutions:_};for(var R=C,N=String.tokenizeFormatString(u),L={},D=0,M;D=_.length){I("not enough substitution arguments. Had "+_.length+" but needed "+(M.substitutionIndex+1)+", so substitution was skipped."),R=f(R,"%"+(-1_.toUpperCase())}}),Object.defineProperty(String.prototype,"hasMatchingEscapedQuotes",{value:function(){return /^\"(?:[^\"\\]|\\.)*\"$/.test(this)||/^\'(?:[^\'\\]|\\.)*\'$/.test(this)}}),Object.defineProperty(Math,"roundTo",{value:function(u,_){return Math.round(u/_)*_}}),Object.defineProperty(Number,"constrain",{value:function(u,_,S){return S<_?_:(u<_?u=_:u>S&&(u=S),u)}}),Object.defineProperty(Number,"percentageString",{value:function(u,_=1){return u.toLocaleString(void 0,{minimumFractionDigits:_,style:"percent"})}}),Object.defineProperty(Number,"secondsToMillisecondsString",{value:function(u,_){let S=1e3*u;return _?WebInspector.UIString("%.2fms").format(S):WebInspector.UIString("%.1fms").format(S)}}),Object.defineProperty(Number,"secondsToString",{value:function(u,_){let S=1e3*u;if(!S)return WebInspector.UIString("%.0fms").format(0);if(10>Math.abs(S))return _?WebInspector.UIString("%.3fms").format(S):WebInspector.UIString("%.2fms").format(S);if(100>Math.abs(S))return _?WebInspector.UIString("%.2fms").format(S):WebInspector.UIString("%.1fms").format(S);if(1e3>Math.abs(S))return _?WebInspector.UIString("%.1fms").format(S):WebInspector.UIString("%.0fms").format(S);if(_||60>Math.abs(u))return WebInspector.UIString("%.2fs").format(u);let C=u/60;if(60>Math.abs(C))return WebInspector.UIString("%.1fmin").format(C);let f=C/60;if(24>Math.abs(f))return WebInspector.UIString("%.1fhrs").format(f);return WebInspector.UIString("%.1f days").format(f/24)}}),Object.defineProperty(Number,"bytesToString",{value:function(u,_){if(void 0===_&&(_=!0),1024>Math.abs(u))return WebInspector.UIString("%.0f B").format(u);let S=u/1024;if(1024>Math.abs(S))return _||10>Math.abs(S)?WebInspector.UIString("%.2f KB").format(S):WebInspector.UIString("%.1f KB").format(S);let C=S/1024;if(1024>Math.abs(C))return _||10>Math.abs(C)?WebInspector.UIString("%.2f MB").format(C):WebInspector.UIString("%.1f MB").format(C);let f=C/1024;return _||10>Math.abs(f)?WebInspector.UIString("%.2f GB").format(f):WebInspector.UIString("%.1f GB").format(f)}}),Object.defineProperty(Number,"abbreviate",{value:function(u){return 1e3>u?u.toLocaleString():1e6>u?WebInspector.UIString("%.1fK").format(Math.round(u/100)/10):1e9>u?WebInspector.UIString("%.1fM").format(Math.round(u/1e5)/10):WebInspector.UIString("%.1fB").format(Math.round(u/1e8)/10)}}),Object.defineProperty(Number.prototype,"maxDecimals",{value(u){let _=10**u;return Math.round(this*_)/_}}),Object.defineProperty(Uint32Array,"isLittleEndian",{value:function(){if("_isLittleEndian"in this)return this._isLittleEndian;var u=new ArrayBuffer(4),_=new Uint32Array(u),S=new Uint8Array(u);return _[0]=168496141,this._isLittleEndian=13===S[0]&&12===S[1]&&11===S[2]&&10===S[3],this._isLittleEndian}});function isEmptyObject(u){for(var _ in u)return!1;return!0}function isEnterKey(u){return 229!==u.keyCode&&"Enter"===u.keyIdentifier}function resolveDotsInPath(u){if(!u)return u;if(-1===u.indexOf("./"))return u;for(var _=[],S=u.split("/"),C=0,f;C>1,0<_(u,this[T])?C=T+1:f=T;return f}}),Object.defineProperty(Array.prototype,"upperBound",{value:function(u,_){_=_||function(E,I){return E-I};for(var C=0,f=this.length,T;C>1,0<=_(u,this[T])?C=T+1:f=T;return f}}),Object.defineProperty(Array.prototype,"binaryIndexOf",{value:function(u,_){var S=this.lowerBound(u,_);return S{let N=T[E];N[u]&&clearTimeout(N[u]);N[u]=setTimeout(()=>{N[u]=void 0,N.apply(T,R)},f)}}})}}),Object.defineProperty(Function.prototype,"cancelDebounce",{value:function(){this[u]&&(clearTimeout(this[u]),this[u]=void 0)}});const S=Symbol("peform-on-animation-frame"),C=Symbol("perform-on-animation-frame-proxy");Object.defineProperty(Object.prototype,"onNextFrame",{get:function(){return this[C]||(this[C]=new Proxy(this,{get(f,T){return(...I)=>{let R=f[T];if(!R[S]){R[S]=requestAnimationFrame(()=>{R[S]=void 0,R.apply(f,I)})}}}})),this[C]}})}();function appendWebInspectorSourceURL(u){return u.includes("//# sourceURL")?u:"\n//# sourceURL=__WebInspectorInternal__\n"+u}function appendWebInspectorConsoleEvaluationSourceURL(u){return u.includes("//# sourceURL")?u:"\n//# sourceURL=__WebInspectorConsoleEvaluation__\n"+u}function isWebInspectorInternalScript(u){return"__WebInspectorInternal__"===u}function isWebInspectorConsoleEvaluationScript(u){return"__WebInspectorConsoleEvaluation__"===u}function isWebKitInjectedScript(u){return u&&u.startsWith("__InjectedScript_")&&u.endsWith(".js")}function isWebKitInternalScript(u){return!isWebInspectorConsoleEvaluationScript(u)&&(!!isWebKitInjectedScript(u)||u&&u.startsWith("__Web")&&u.endsWith("__"))}function isFunctionStringNativeCode(u){return u.endsWith("{\n [native code]\n}")}function isTextLikelyMinified(u){let C=0,f=Math.min(5e3,u.length);for(let E=0,I;Ethis._workInterval){let E=C.slice();C=[],this._willYield(E,T),yield,S=Date.now()}}C.length&&this._willYield(C,Date.now()-S)}.call(this),this._processPendingItems())}cancel(){this._processing&&(this._cancelled=!0)}_processPendingItems(){return this._cancelled?void 0:this._pendingItemsIterator.next().done?void this._didFinish():void(this._idleTimeoutIdentifier=setTimeout(()=>{this._processPendingItems()},this._idleInterval))}_willYield(_,S){"function"==typeof this._delegate.yieldableTaskDidYield&&this._delegate.yieldableTaskDidYield(this,_,S)}_didFinish(){this._processing=!1,this._pendingItemsIterator=null,this._idleTimeoutIdentifier&&(clearTimeout(this._idleTimeoutIdentifier),this._idleTimeoutIdentifier=void 0),"function"==typeof this._delegate.yieldableTaskDidFinish&&this._delegate.yieldableTaskDidFinish(this)}},WebInspector.ProtocolTracer=class extends WebInspector.Object{logStarted(){}logFrontendException(){}logProtocolError(){}logFrontendRequest(){}logWillHandleResponse(){}logDidHandleResponse(S=null){}logWillHandleEvent(){}logDidHandleEvent(S=null){}logFinished(){}},WebInspector.LoggingProtocolTracer=class extends WebInspector.ProtocolTracer{constructor(){super(),this._dumpMessagesToConsole=!1,this._dumpTimingDataToConsole=!1,this._logToConsole=window.InspectorTest?InspectorFrontendHost.unbufferedLog.bind(InspectorFrontendHost):console.log.bind(console)}set dumpMessagesToConsole(_){this._dumpMessagesToConsole=!!_}get dumpMessagesToConsole(){return this._dumpMessagesToConsole}set dumpTimingDataToConsole(_){this._dumpTimingDataToConsole=!!_}get dumpTimingDataToConsole(){return this._dumpTimingDataToConsole}logFrontendException(_,S){this._processEntry({type:"exception",message:_,exception:S})}logProtocolError(_,S){this._processEntry({type:"error",message:_,error:S})}logFrontendRequest(_){this._processEntry({type:"request",message:_})}logWillHandleResponse(_){this._processEntry({type:"response",message:_})}logDidHandleResponse(_,S=null){let C={type:"response",message:_};S&&(C.timings=Object.shallowCopy(S)),this._processEntry(C)}logWillHandleEvent(_){this._processEntry({type:"event",message:_})}logDidHandleEvent(_,S=null){let C={type:"event",message:_};S&&(C.timings=Object.shallowCopy(S)),this._processEntry(C)}_processEntry(_){this._dumpTimingDataToConsole&&_.timings?_.timings.rtt&&_.timings.dispatch?this._logToConsole(`time-stats: Handling: ${_.timings.dispatch||NaN}ms; RTT: ${_.timings.rtt}ms`):_.timings.dispatch&&this._logToConsole(`time-stats: Handling: ${_.timings.dispatch||NaN}ms`):this._dumpMessagesToConsole&&!_.timings&&(this._logToConsole(`${_.type}: ${JSON.stringify(_.message)}`),_.exception&&(this._logToConsole(_.exception),_.exception.stack&&this._logToConsole(_.exception.stack)))}},InspectorBackendClass=class{constructor(){this._agents={},this._customTracer=null,this._defaultTracer=new WebInspector.LoggingProtocolTracer,this._activeTracers=[this._defaultTracer],this._workerSupportedDomains=[],WebInspector.settings.autoLogProtocolMessages.addEventListener(WebInspector.Setting.Event.Changed,this._startOrStopAutomaticTracing,this),WebInspector.settings.autoLogTimeStats.addEventListener(WebInspector.Setting.Event.Changed,this._startOrStopAutomaticTracing,this),this._startOrStopAutomaticTracing(),this.currentDispatchState={event:null,request:null,response:null}}get workerSupportedDomains(){return this._workerSupportedDomains}set dumpInspectorProtocolMessages(_){WebInspector.settings.autoLogProtocolMessages.value=_,this._defaultTracer.dumpMessagesToConsole=_}get dumpInspectorProtocolMessages(){return WebInspector.settings.autoLogProtocolMessages.value}set dumpInspectorTimeStats(_){WebInspector.settings.autoLogTimeStats.value=_,this.dumpInspectorProtocolMessages||(this.dumpInspectorProtocolMessages=!0),this._defaultTracer.dumpTimingDataToConsole=_}get dumpInspectorTimeStats(){return WebInspector.settings.autoLogTimeStats.value}set customTracer(_){(_||this._customTracer)&&_!==this._customTracer&&_!==this._defaultTracer&&(this._customTracer&&this._customTracer.logFinished(),this._customTracer=_,this._activeTracers=[this._defaultTracer],this._customTracer&&(this._customTracer.logStarted(),this._activeTracers.push(this._customTracer)))}get activeTracers(){return this._activeTracers}registerCommand(_,S,C){var[f,T]=_.split("."),E=this._agentForDomain(f);E.addCommand(InspectorBackend.Command.create(E,_,S,C))}registerEnum(_,S){var[C,f]=_.split("."),T=this._agentForDomain(C);T.addEnum(f,S)}registerEvent(_,S){var[C,f]=_.split("."),T=this._agentForDomain(C);T.addEvent(new InspectorBackend.Event(f,S))}registerDomainDispatcher(_,S){var C=this._agentForDomain(_);C.dispatcher=S}dispatch(_){InspectorBackend.mainConnection.dispatch(_)}runAfterPendingDispatches(_){InspectorBackend.mainConnection.runAfterPendingDispatches(_)}activateDomain(_,S){if(!S||InspectorFrontendHost.debuggableType()===S){var C=this._agents[_];return C.activate(),C}return null}workerSupportedDomain(_){this._workerSupportedDomains.push(_)}_startOrStopAutomaticTracing(){this._defaultTracer.dumpMessagesToConsole=this.dumpInspectorProtocolMessages,this._defaultTracer.dumpTimingDataToConsole=this.dumpTimingDataToConsole}_agentForDomain(_){if(this._agents[_])return this._agents[_];var S=new InspectorBackend.Agent(_);return this._agents[_]=S,S}},InspectorBackend=new InspectorBackendClass,InspectorBackend.Agent=class{constructor(_){this._domainName=_,this._connection=InspectorBackend.mainConnection,this._dispatcher=null,this._active=!1,this._events={}}get domainName(){return this._domainName}get active(){return this._active}get connection(){return this._connection}set connection(_){this._connection=_}get dispatcher(){return this._dispatcher}set dispatcher(_){this._dispatcher=_}addEnum(_,S){this[_]=S}addCommand(_){this[_.commandName]=_}addEvent(_){this._events[_.eventName]=_}getEvent(_){return this._events[_]}hasEvent(_){return _ in this._events}hasEventParameter(_,S){let C=this._events[_];return C&&C.parameterNames.includes(S)}activate(){this._active=!0,window[this._domainName+"Agent"]=this}dispatchEvent(_,S){return _ in this._dispatcher?(this._dispatcher[_].apply(this._dispatcher,S),!0):(console.error("Protocol Error: Attempted to dispatch an unimplemented method '"+this._domainName+"."+_+"'"),!1)}},InspectorBackend.Command=function(u,_,S,C){"use strict";this._agent=u,this._instance=this;let[f,T]=_.split(".");this._qualifiedName=_,this._commandName=T,this._callSignature=S||[],this._replySignature=C||[]},InspectorBackend.Command.create=function(u,_,S,C){"use strict";function f(){return T._invokeWithArguments.call(T,this,Array.from(arguments))}let T=new InspectorBackend.Command(u,_,S,C);return f._instance=T,Object.setPrototypeOf(f,InspectorBackend.Command.prototype),f},InspectorBackend.Command.prototype={__proto__:Function.prototype,get qualifiedName(){return this._instance._qualifiedName},get commandName(){return this._instance._commandName},get callSignature(){return this._instance._callSignature},get replySignature(){return this._instance._replySignature},invoke(u,_,S){"use strict";return S=S||this._instance._agent,"function"==typeof _?void S._connection._sendCommandToBackendWithCallback(this._instance,u,_):S._connection._sendCommandToBackendExpectingPromise(this._instance,u)},supports(u){"use strict";return this._instance.callSignature.some(_=>_.name===u)},_invokeWithArguments(u,_){"use strict";function S(E){return console.error(`Protocol Error: ${E}`),f?void setTimeout(f.bind(null,E),0):Promise.reject(new Error(E))}let C=this._instance,f="function"==typeof _.lastValue?_.pop():null,T={};for(let E of C.callSignature){let I=E.name,R=E.type,N=E.optional;if(!_.length&&!N)return S(`Invalid number of arguments for command '${C.qualifiedName}'.`);let L=_.shift();if(!(N&&L===void 0)){if(typeof L!==R)return S(`Invalid type of argument '${I}' for command '${C.qualifiedName}' call. It must be '${R}' but it is '${typeof L}'.`);T[I]=L}}return f||1!==_.length||void 0===_[0]?f?void u._connection._sendCommandToBackendWithCallback(C,T,f):u._connection._sendCommandToBackendExpectingPromise(C,T):S(`Protocol Error: Optional callback argument for command '${C.qualifiedName}' call must be a function but its type is '${typeof _[0]}'.`)}},InspectorBackend.Event=class{constructor(_,S){this.eventName=_,this.parameterNames=S}},InspectorBackend.Connection=class{constructor(){this._lastSequenceId=1,this._pendingResponses=new Map,this._agents={},this._deferredScripts=[],this._target=null}get target(){return this._target}set target(_){for(let S in this._target=_,this._agents){let C=this._agents[S].dispatcher;C&&(C.target=_)}}dispatch(_){let S="string"==typeof _?JSON.parse(_):_;"id"in S?this._dispatchResponse(S):this._dispatchEvent(S)}runAfterPendingDispatches(_){this._pendingResponses.size?this._deferredScripts.push(_):_.call(this)}sendMessageToBackend(){throw new Error("Should be implemented by a InspectorBackend.Connection subclass")}_dispatchResponse(_){_.error&&-32000!==_.error.code&&console.error("Request with id = "+_.id+" failed. "+JSON.stringify(_.error));let S=_.id,C=this._pendingResponses.take(S)||{},{request:f,command:T,callback:E,promise:I}=C,R=timestamp();for(let D of InspectorBackend.activeTracers)D.logWillHandleResponse(_);InspectorBackend.currentDispatchState.request=f,InspectorBackend.currentDispatchState.response=_,"function"==typeof E?this._dispatchResponseToCallback(T,f,_,E):"object"==typeof I?this._dispatchResponseToPromise(T,_,I):console.error("Received a command response without a corresponding callback or promise.",_,T),InspectorBackend.currentDispatchState.request=null,InspectorBackend.currentDispatchState.response=null;let N=(timestamp()-R).toFixed(3),L=(R-C.sendRequestTimestamp).toFixed(3);for(let D of InspectorBackend.activeTracers)D.logDidHandleResponse(_,{rtt:L,dispatch:N});this._deferredScripts.length&&!this._pendingResponses.size&&this._flushPendingScripts()}_dispatchResponseToCallback(_,S,C,f){let T=[C.error?C.error.message:null];if(C.result)for(let E of _.replySignature)T.push(C.result[E]);try{f.apply(null,T)}catch(E){WebInspector.reportInternalError(E,{cause:`An uncaught exception was thrown while dispatching response callback for command ${_.qualifiedName}.`})}}_dispatchResponseToPromise(_,S,C){let{resolve:f,reject:T}=C;S.error?T(new Error(S.error.message)):f(S.result)}_dispatchEvent(_){let S=_.method,[C,f]=S.split(".");if(!(C in this._agents))return void console.error("Protocol Error: Attempted to dispatch method '"+f+"' for non-existing domain '"+C+"'");let T=this._agents[C];if(!T.active)return void console.error("Protocol Error: Attempted to dispatch method for domain '"+C+"' which exists but is not active.");let E=T.getEvent(f);if(!E)return void console.error("Protocol Error: Attempted to dispatch an unspecified method '"+S+"'");let I=[];_.params&&(I=E.parameterNames.map(L=>_.params[L]));let R=timestamp();for(let L of InspectorBackend.activeTracers)L.logWillHandleEvent(_);InspectorBackend.currentDispatchState.event=_;try{T.dispatchEvent(f,I)}catch(L){for(let D of InspectorBackend.activeTracers)D.logFrontendException(_,L);WebInspector.reportInternalError(L,{cause:`An uncaught exception was thrown while handling event: ${S}`})}InspectorBackend.currentDispatchState.event=null;let N=(timestamp()-R).toFixed(3);for(let L of InspectorBackend.activeTracers)L.logDidHandleEvent(_,{dispatch:N})}_sendCommandToBackendWithCallback(_,S,C){let f=this._lastSequenceId++,T={id:f,method:_.qualifiedName};isEmptyObject(S)||(T.params=S);let E={command:_,request:T,callback:C};InspectorBackend.activeTracer&&(E.sendRequestTimestamp=timestamp()),this._pendingResponses.set(f,E),this._sendMessageToBackend(T)}_sendCommandToBackendExpectingPromise(_,S){let C=this._lastSequenceId++,f={id:C,method:_.qualifiedName};isEmptyObject(S)||(f.params=S);let T={command:_,request:f};InspectorBackend.activeTracer&&(T.sendRequestTimestamp=timestamp());let E=new Promise(function(I,R){T.promise={resolve:I,reject:R}});return this._pendingResponses.set(C,T),this._sendMessageToBackend(f),E}_sendMessageToBackend(_){for(let S of InspectorBackend.activeTracers)S.logFrontendRequest(_);this.sendMessageToBackend(JSON.stringify(_))}_flushPendingScripts(){let _=this._deferredScripts;this._deferredScripts=[];for(let S of _)S.call(this)}},InspectorBackend.MainConnection=class extends InspectorBackend.Connection{constructor(){super(),this._agents=InspectorBackend._agents}sendMessageToBackend(_){InspectorFrontendHost.sendMessageToBackend(_)}},InspectorBackend.WorkerConnection=class extends InspectorBackend.Connection{constructor(_){super(),this._workerId=_;const S=InspectorBackend.workerSupportedDomains;for(let C of S){let f=InspectorBackend._agents[C],T=Object.create(InspectorBackend._agents[C]);T.connection=this,T.dispatcher=new f.dispatcher.constructor,this._agents[C]=T}}sendMessageToBackend(_){WorkerAgent.sendMessageToWorker(this._workerId,_)}},InspectorBackend.mainConnection=new InspectorBackend.MainConnection,InspectorFrontendAPI={_loaded:!1,_pendingCommands:[],savedURL:function(){},appendedToURL:function(){},isTimelineProfilingEnabled:function(){return WebInspector.timelineManager.isCapturing()},setTimelineProfilingEnabled:function(u){WebInspector.timelineManager.isCapturing()===u||(u?WebInspector.timelineManager.startCapturing():WebInspector.timelineManager.stopCapturing())},setElementSelectionEnabled:function(u){WebInspector.domTreeManager.inspectModeEnabled=u},setDockingUnavailable:function(u){WebInspector.updateDockingAvailability(!u)},setDockSide:function(u){WebInspector.updateDockedState(u)},setIsVisible:function(u){WebInspector.updateVisibilityState(u)},showConsole:function(){WebInspector.showConsoleTab(),WebInspector.quickConsole.prompt.focus(),"complete"!==document.readyState&&document.addEventListener("readystatechange",this),"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",this)},handleEvent:function(){"complete"===document.readyState&&"visible"===document.visibilityState&&(WebInspector.quickConsole.prompt.focus(),document.removeEventListener("readystatechange",this),document.removeEventListener("visibilitychange",this))},showResources:function(){WebInspector.showResourcesTab()},showTimelines:function(){WebInspector.showTimelineTab()},showMainResourceForFrame:function(u){WebInspector.showSourceCodeForFrame(u,{ignoreNetworkTab:!0,ignoreSearchTab:!0})},contextMenuItemSelected:function(u){try{WebInspector.ContextMenu.contextMenuItemSelected(u)}catch(_){console.error("Uncaught exception in inspector page under contextMenuItemSelected",_)}},contextMenuCleared:function(){WebInspector.ContextMenu.contextMenuCleared()},dispatchMessageAsync:function(u){WebInspector.dispatchMessageFromBackend(u)},dispatchMessage:function(u){InspectorBackend.dispatch(u)},dispatch:function(u){if(!InspectorFrontendAPI._loaded)return InspectorFrontendAPI._pendingCommands.push(u),null;var _=u.shift();return InspectorFrontendAPI[_]?InspectorFrontendAPI[_].apply(InspectorFrontendAPI,u):null},loadCompleted:function(){InspectorFrontendAPI._loaded=!0;for(var u=0;u")}(),WebInspector._messagesToDispatch=[],WebInspector.dispatchNextQueuedMessageFromBackend=function(){const u=WebInspector._messagesToDispatch.length,_=timestamp();let C=0;for(;C10);++C)InspectorBackend.dispatch(WebInspector._messagesToDispatch[C]);if(C===WebInspector._messagesToDispatch.length?(WebInspector._messagesToDispatch=[],WebInspector._dispatchTimeout=null):(WebInspector._messagesToDispatch=WebInspector._messagesToDispatch.slice(C),WebInspector._dispatchTimeout=setTimeout(WebInspector.dispatchNextQueuedMessageFromBackend,0)),InspectorBackend.dumpInspectorTimeStats){let f=(timestamp()-_).toFixed(3),T=u-WebInspector._messagesToDispatch.length,E=WebInspector._messagesToDispatch.length;console.log(`time-stats: --- RunLoop duration: ${f}ms; dispatched: ${T}; remaining: ${E}`)}},WebInspector.dispatchMessageFromBackend=function(u){this._messagesToDispatch.push(u);window.__uncaughtExceptions&&window.__uncaughtExceptions.length||this._dispatchTimeout||(this._dispatchTimeout=setTimeout(this.dispatchNextQueuedMessageFromBackend,0))},WebInspector.RemoteObject=class{constructor(_,S,C,f,T,E,I,R,N,L){this._target=_||WebInspector.mainTarget,this._type=C,this._subtype=f,S?(this._objectId=S,this._description=E||"",this._hasChildren="symbol"!==C,this._size=I,this._classPrototype=R,this._preview=L,"class"===f&&(this._functionDescription=this._description,this._description="class "+N)):(this._description=E||T+"",this._hasChildren=!1,this._value=T)}static createFakeRemoteObject(){return new WebInspector.RemoteObject(void 0,WebInspector.RemoteObject.FakeRemoteObjectId,"object")}static fromPrimitiveValue(_){return new WebInspector.RemoteObject(void 0,void 0,typeof _,void 0,_,void 0,void 0,void 0,void 0)}static fromPayload(_,S){if("array"===_.subtype){var C=_.description.match(/\[(\d+)\]$/);C&&(_.size=parseInt(C[1]),_.description=_.description.replace(/\[\d+\]$/,""))}return _.classPrototype&&(_.classPrototype=WebInspector.RemoteObject.fromPayload(_.classPrototype,S)),_.preview&&(!_.preview.type&&(_.preview.type=_.type,_.preview.subtype=_.subtype,_.preview.description=_.description,_.preview.size=_.size),_.preview=WebInspector.ObjectPreview.fromPayload(_.preview)),new WebInspector.RemoteObject(S,_.objectId,_.type,_.subtype,_.value,_.description,_.size,_.classPrototype,_.className,_.preview)}static createCallArgument(_){return _ instanceof WebInspector.RemoteObject?_.objectId?{objectId:_.objectId}:{value:_.value}:{value:_}}static resolveNode(_,S,C){DOMAgent.resolveNode(_.id,S,function(f,T){C&&(f||!T?C(null):C(WebInspector.RemoteObject.fromPayload(T,WebInspector.mainTarget)))})}static resolveWebSocket(_,S,C){NetworkAgent.resolveWebSocket(_.requestIdentifier,S,(f,T)=>{f||!T?C(null):C(WebInspector.RemoteObject.fromPayload(T,_.target))})}static resolveCanvasContext(_,S,C){CanvasAgent.resolveCanvasContext(_.identifier,S,(f,T)=>{f||!T?C(null):C(WebInspector.RemoteObject.fromPayload(T,WebInspector.mainTarget))})}static type(_){if(null===_)return"null";var S=typeof _;return"object"!=S&&"function"!=S?S:_.type}get target(){return this._target}get objectId(){return this._objectId}get type(){return this._type}get subtype(){return this._subtype}get description(){return this._description}get functionDescription(){return this._functionDescription||this._description}get hasChildren(){return this._hasChildren}get value(){return this._value}get size(){return this._size||0}get classPrototype(){return this._classPrototype}get preview(){return this._preview}hasSize(){return this.isArray()||this.isCollectionType()}hasValue(){return"_value"in this}canLoadPreview(){return!this._failedToLoadPreview&&!("object"!==this._type)&&(!this._objectId||this._isSymbol()||this._isFakeObject()?!1:!0)}updatePreview(_){return this.canLoadPreview()?RuntimeAgent.getPreview?void this._target.RuntimeAgent.getPreview(this._objectId,(S,C)=>{return S?(this._failedToLoadPreview=!0,void _(null)):void(this._preview=WebInspector.ObjectPreview.fromPayload(C),_(this._preview))}):(this._failedToLoadPreview=!0,void _(null)):void _(null)}getOwnPropertyDescriptors(_){this._getPropertyDescriptors(!0,_)}getAllPropertyDescriptors(_){this._getPropertyDescriptors(!1,_)}getDisplayablePropertyDescriptors(_){return!this._objectId||this._isSymbol()||this._isFakeObject()?void _([]):RuntimeAgent.getDisplayableProperties?void this._target.RuntimeAgent.getDisplayableProperties(this._objectId,!0,this._getPropertyDescriptorsResolver.bind(this,_)):void this._target.RuntimeAgent.getProperties(this._objectId,function(S,C){var f=[];if(C)for(var T of C)if(T.isOwn||"__proto__"===T.name)f.push(T);else if(T.value&&T.name!==T.name.toUpperCase()){var E=T.value.type;E&&"function"!==E&&"constructor"!==T.name&&f.push(T)}this._getPropertyDescriptorsResolver(_,S,f)}.bind(this))}deprecatedGetOwnProperties(_){this._deprecatedGetProperties(!0,_)}deprecatedGetAllProperties(_){this._deprecatedGetProperties(!1,_)}deprecatedGetDisplayableProperties(_){return!this._objectId||this._isSymbol()||this._isFakeObject()?void _([]):RuntimeAgent.getDisplayableProperties?void this._target.RuntimeAgent.getDisplayableProperties(this._objectId,this._deprecatedGetPropertiesResolver.bind(this,_)):void this._target.RuntimeAgent.getProperties(this._objectId,function(S,C){var f=[];if(C)for(var T of C)if(T.isOwn||T.get||"__proto__"===T.name)f.push(T);else if(T.value&&T.name!==T.name.toUpperCase()){var E=T.value.type;E&&"function"!==E&&"constructor"!==T.name&&f.push(T)}this._deprecatedGetPropertiesResolver(_,S,f)}.bind(this))}setPropertyValue(_,S,C){function T(E,I,R){return E||R?void C(E||I.description):void C()}return!this._objectId||this._isSymbol()||this._isFakeObject()?void C("Can't set a property of non-object."):void this._target.RuntimeAgent.evaluate.invoke({expression:appendWebInspectorSourceURL(S),doNotPauseOnExceptionsAndMuteConsole:!0},function(E,I,R){return E||R?void C(E||I.description):void(delete I.description,this._target.RuntimeAgent.callFunctionOn(this._objectId,appendWebInspectorSourceURL(function(L,D){this[L]=D}.toString()),[{value:_},I],!0,void 0,T.bind(this)),I._objectId&&this._target.RuntimeAgent.releaseObject(I._objectId))}.bind(this),this._target.RuntimeAgent)}isUndefined(){return"undefined"===this._type}isNode(){return"node"===this._subtype}isArray(){return"array"===this._subtype}isClass(){return"class"===this._subtype}isCollectionType(){return"map"===this._subtype||"set"===this._subtype||"weakmap"===this._subtype||"weakset"===this._subtype}isWeakCollection(){return"weakmap"===this._subtype||"weakset"===this._subtype}getCollectionEntries(_,S,C){_="number"==typeof _?_:0,S="number"==typeof S?S:100;let f=this.isWeakCollection()?this._weakCollectionObjectGroup():"";this._target.RuntimeAgent.getCollectionEntries(this._objectId,f,_,S,(T,E)=>{E=E.map(I=>WebInspector.CollectionEntry.fromPayload(I,this._target)),C(E)})}releaseWeakCollectionEntries(){this._target.RuntimeAgent.releaseObjectGroup(this._weakCollectionObjectGroup())}pushNodeToFrontend(_){this._objectId?WebInspector.domTreeManager.pushNodeToFrontend(this._objectId,_):_(0)}getProperty(_,S){this.callFunction(function(f){return this[f]},[_],!0,S)}callFunction(_,S,C,f){S&&(S=S.map(WebInspector.RemoteObject.createCallArgument)),this._target.RuntimeAgent.callFunctionOn(this._objectId,appendWebInspectorSourceURL(_.toString()),S,!0,void 0,!!C,function(E,I,R){I=I?WebInspector.RemoteObject.fromPayload(I,this._target):null,f&&"function"==typeof f&&f(E,I,R)}.bind(this))}callFunctionJSON(_,S,C){this._target.RuntimeAgent.callFunctionOn(this._objectId,appendWebInspectorSourceURL(_.toString()),S,!0,!0,function(T,E,I){C(T||I?null:E.value)})}invokeGetter(_,S){this.callFunction(function(f){return f?f.call(this):void 0},[_],!0,S)}getOwnPropertyDescriptor(_,S){this.callFunction(function(T){return this[T]},[_],!1,function(T,E,I){if(T||I||!(E instanceof WebInspector.RemoteObject))return void S(null);var N=new WebInspector.PropertyDescriptor({name:_,value:E,writable:!0,configurable:!0,enumerable:!1},null,!0,!1,!1,!1);S(N)}.bind(this))}release(){this._objectId&&!this._isFakeObject()&&this._target.RuntimeAgent.releaseObject(this._objectId)}arrayLength(){if("array"!==this._subtype)return 0;var _=this._description.match(/\[([0-9]+)\]/);return _?parseInt(_[1],10):0}asCallArgument(){return WebInspector.RemoteObject.createCallArgument(this)}findFunctionSourceCodeLocation(){var _=new WebInspector.WrappedPromise;return this._isFunction()&&this._objectId?(this._target.DebuggerAgent.getFunctionDetails(this._objectId,(S,C)=>{if(S)return void _.reject(S);var f=C.location,T=WebInspector.debuggerManager.scriptForIdentifier(f.scriptId,this._target);if(!T||!WebInspector.isDebugUIEnabled()&&isWebKitInternalScript(T.sourceURL))return void _.resolve(WebInspector.RemoteObject.SourceCodeLocationPromise.NoSourceFound);var E=T.createSourceCodeLocation(f.lineNumber,f.columnNumber||0);_.resolve(E)}),_.promise):(_.resolve(WebInspector.RemoteObject.SourceCodeLocationPromise.MissingObjectId),_.promise)}_isFakeObject(){return this._objectId===WebInspector.RemoteObject.FakeRemoteObjectId}_isSymbol(){return"symbol"===this._type}_isFunction(){return"function"===this._type}_weakCollectionObjectGroup(){return JSON.stringify(this._objectId)+"-"+this._subtype}_getPropertyDescriptors(_,S){return!this._objectId||this._isSymbol()||this._isFakeObject()?void S([]):void this._target.RuntimeAgent.getProperties(this._objectId,_,!0,this._getPropertyDescriptorsResolver.bind(this,S))}getOwnPropertyDescriptorsAsObject(_){this.getOwnPropertyDescriptors(function(S){var C={},f={};for(var T of S){var E=T.isInternalProperty?f:C;E[T.name]=T}_(C,f)})}_getPropertyDescriptorsResolver(_,S,C,f){if(S)return void _(null);let T=C.map(E=>{return WebInspector.PropertyDescriptor.fromPayload(E,!1,this._target)});f&&(T=T.concat(f.map(E=>{return WebInspector.PropertyDescriptor.fromPayload(E,!0,this._target)}))),_(T)}_deprecatedGetProperties(_,S){return!this._objectId||this._isSymbol()||this._isFakeObject()?void S([]):void this._target.RuntimeAgent.getProperties(this._objectId,_,this._deprecatedGetPropertiesResolver.bind(this,S))}_deprecatedGetPropertiesResolver(_,S,C,f){if(S)return void _(null);f&&(C=C.concat(f.map(function(R){return R.writable=!1,R.configurable=!1,R.enumerable=!1,R.isOwn=!0,R})));for(var T=[],E=0,I;C&&E{let I=WebInspector.HeapSnapshotProxy.deserialize(T,E);WebInspector.timelineManager.heapSnapshotAdded(_,I)})}},WebInspector.DOMObserver=class{documentUpdated(){WebInspector.domTreeManager._documentUpdated()}setChildNodes(_,S){WebInspector.domTreeManager._setChildNodes(_,S)}attributeModified(_,S,C){WebInspector.domTreeManager._attributeModified(_,S,C)}attributeRemoved(_,S){WebInspector.domTreeManager._attributeRemoved(_,S)}inlineStyleInvalidated(_){WebInspector.domTreeManager._inlineStyleInvalidated(_)}characterDataModified(_,S){WebInspector.domTreeManager._characterDataModified(_,S)}childNodeCountUpdated(_,S){WebInspector.domTreeManager._childNodeCountUpdated(_,S)}childNodeInserted(_,S,C){WebInspector.domTreeManager._childNodeInserted(_,S,C)}childNodeRemoved(_,S){WebInspector.domTreeManager._childNodeRemoved(_,S)}shadowRootPushed(_,S){WebInspector.domTreeManager._childNodeInserted(_,0,S)}shadowRootPopped(_,S){WebInspector.domTreeManager._childNodeRemoved(_,S)}customElementStateChanged(_,S){WebInspector.domTreeManager._customElementStateChanged(_,S)}pseudoElementAdded(_,S){WebInspector.domTreeManager._pseudoElementAdded(_,S)}pseudoElementRemoved(_,S){WebInspector.domTreeManager._pseudoElementRemoved(_,S)}},WebInspector.DOMStorageObserver=class{domStorageItemsCleared(_){WebInspector.storageManager.itemsCleared(_)}domStorageItemRemoved(_,S){WebInspector.storageManager.itemRemoved(_,S)}domStorageItemAdded(_,S,C){WebInspector.storageManager.itemAdded(_,S,C)}domStorageItemUpdated(_,S,C,f){WebInspector.storageManager.itemUpdated(_,S,C,f)}},WebInspector.DatabaseObserver=class{addDatabase(_){WebInspector.storageManager.databaseWasAdded(_.id,_.domain,_.name,_.version)}},WebInspector.DebuggerObserver=class{constructor(){this._legacyScriptParsed=DebuggerAgent.hasEventParameter("scriptParsed","hasSourceURL")}globalObjectCleared(){WebInspector.debuggerManager.reset()}scriptParsed(_,S,C,f,T,E,I,R,N,L){if(this._legacyScriptParsed){let D=arguments[7],M=arguments[8],P=M?S:void 0;return void WebInspector.debuggerManager.scriptDidParse(this.target,_,S,C,f,T,E,L,I,P,D)}WebInspector.debuggerManager.scriptDidParse(this.target,_,S,C,f,T,E,L,I,R,N)}scriptFailedToParse(){}breakpointResolved(_,S){WebInspector.debuggerManager.breakpointResolved(this.target,_,S)}paused(_,S,C,f){WebInspector.debuggerManager.debuggerDidPause(this.target,_,S,C,f)}resumed(){WebInspector.debuggerManager.debuggerDidResume(this.target)}playBreakpointActionSound(_){WebInspector.debuggerManager.playBreakpointActionSound(_)}didSampleProbe(_){WebInspector.probeManager.didSampleProbe(this.target,_)}},WebInspector.HeapObserver=class{garbageCollected(_){WebInspector.heapManager.garbageCollected(this.target,_)}trackingStart(_,S){let C=WebInspector.HeapSnapshotWorkerProxy.singleton();C.createSnapshot(S,({objectId:f,snapshot:T})=>{let E=WebInspector.HeapSnapshotProxy.deserialize(f,T);WebInspector.timelineManager.heapTrackingStarted(_,E)})}trackingComplete(_,S){let C=WebInspector.HeapSnapshotWorkerProxy.singleton();C.createSnapshot(S,({objectId:f,snapshot:T})=>{let E=WebInspector.HeapSnapshotProxy.deserialize(f,T);WebInspector.timelineManager.heapTrackingCompleted(_,E)})}},WebInspector.InspectorObserver=class{evaluateForTestInFrontend(_){InspectorFrontendHost.isUnderTest()&&InspectorBackend.runAfterPendingDispatches(function(){window.eval(_)})}inspect(_,S){var C=WebInspector.RemoteObject.fromPayload(_,WebInspector.mainTarget);return"node"===C.subtype?void WebInspector.domTreeManager.inspectNodeObject(C):void(S.databaseId?WebInspector.storageManager.inspectDatabase(S.databaseId):S.domStorageId&&WebInspector.storageManager.inspectDOMStorage(S.domStorageId),C.release())}activateExtraDomains(_){WebInspector.activateExtraDomains(_)}},WebInspector.LayerTreeObserver=class{layerTreeDidChange(){WebInspector.layerTreeManager.supported&&WebInspector.layerTreeManager.layerTreeDidChange()}},WebInspector.MemoryObserver=class{memoryPressure(_,S){WebInspector.memoryManager.memoryPressure(_,S)}trackingStart(_){WebInspector.timelineManager.memoryTrackingStart(_)}trackingUpdate(_){WebInspector.timelineManager.memoryTrackingUpdate(_)}trackingComplete(){WebInspector.timelineManager.memoryTrackingComplete()}},WebInspector.NetworkObserver=class{requestWillBeSent(_,S,C,f,T,E,I,R,N,L){WebInspector.frameResourceManager.resourceRequestWillBeSent(_,S,C,T,N,R,E,I,L)}requestServedFromCache(_){WebInspector.frameResourceManager.markResourceRequestAsServedFromMemoryCache(_)}responseReceived(_,S,C,f,T,E){WebInspector.frameResourceManager.resourceRequestDidReceiveResponse(_,S,C,T,E,f)}dataReceived(_,S,C,f){WebInspector.frameResourceManager.resourceRequestDidReceiveData(_,C,f,S)}loadingFinished(_,S,C,f){WebInspector.frameResourceManager.resourceRequestDidFinishLoading(_,S,C,f)}loadingFailed(_,S,C,f){WebInspector.frameResourceManager.resourceRequestDidFailLoading(_,f,S,C)}requestServedFromMemoryCache(_,S,C,f,T,E,I){WebInspector.frameResourceManager.resourceRequestWasServedFromMemoryCache(_,S,C,I,T,E)}webSocketCreated(_,S){WebInspector.frameResourceManager.webSocketCreated(_,S)}webSocketWillSendHandshakeRequest(_,S,C,f){WebInspector.frameResourceManager.webSocketWillSendHandshakeRequest(_,S,C,f)}webSocketHandshakeResponseReceived(_,S,C){WebInspector.frameResourceManager.webSocketHandshakeResponseReceived(_,S,C)}webSocketClosed(_,S){WebInspector.frameResourceManager.webSocketClosed(_,S)}webSocketFrameReceived(_,S,C){WebInspector.frameResourceManager.webSocketFrameReceived(_,S,C)}webSocketFrameSent(_,S,C){WebInspector.frameResourceManager.webSocketFrameSent(_,S,C)}webSocketFrameError(){}},WebInspector.PageObserver=class{domContentEventFired(_){WebInspector.timelineManager.pageDOMContentLoadedEventFired(_)}loadEventFired(_){WebInspector.timelineManager.pageLoadEventFired(_)}frameNavigated(_,S){WebInspector.frameResourceManager.frameDidNavigate(_,S)}frameDetached(_){WebInspector.frameResourceManager.frameDidDetach(_)}frameStartedLoading(){}frameStoppedLoading(){}frameScheduledNavigation(){}frameClearedScheduledNavigation(){}javascriptDialogOpening(){}javascriptDialogClosed(){}scriptsEnabled(){}},WebInspector.RuntimeObserver=class{executionContextCreated(_){WebInspector.frameResourceManager.executionContextCreated(_)}},WebInspector.ScriptProfilerObserver=class{trackingStart(_){WebInspector.timelineManager.scriptProfilerTrackingStarted(_)}trackingUpdate(_){WebInspector.timelineManager.scriptProfilerTrackingUpdated(_)}trackingComplete(_){WebInspector.timelineManager.scriptProfilerTrackingCompleted(_)}programmaticCaptureStarted(){WebInspector.timelineManager.scriptProfilerProgrammaticCaptureStarted()}programmaticCaptureStopped(){WebInspector.timelineManager.scriptProfilerProgrammaticCaptureStopped()}},WebInspector.TimelineObserver=class{eventRecorded(_){WebInspector.timelineManager.eventRecorded(_)}recordingStarted(_){WebInspector.timelineManager.capturingStarted(_)}recordingStopped(_){WebInspector.timelineManager.capturingStopped(_)}autoCaptureStarted(){WebInspector.timelineManager.autoCaptureStarted()}programmaticCaptureStarted(){WebInspector.timelineManager.programmaticCaptureStarted()}programmaticCaptureStopped(){WebInspector.timelineManager.programmaticCaptureStopped()}},WebInspector.WorkerObserver=class{workerCreated(_,S){WebInspector.workerManager.workerCreated(_,S)}workerTerminated(_){WebInspector.workerManager.workerTerminated(_)}dispatchMessageFromWorker(_,S){WebInspector.workerManager.dispatchMessageFromWorker(_,S)}},WebInspector.BreakpointAction=class extends WebInspector.Object{constructor(_,S,C){super(),this._breakpoint=_,"string"==typeof S?(this._type=S,this._data=C||null):"object"==typeof S?(this._type=S.type,this._data=S.data||null):console.error("Unexpected type passed to WebInspector.BreakpointAction"),this._id=WebInspector.debuggerManager.nextBreakpointActionIdentifier()}get breakpoint(){return this._breakpoint}get id(){return this._id}get type(){return this._type}get data(){return this._data}set data(_){this._data===_||(this._data=_,this._breakpoint.breakpointActionDidChange(this))}get info(){var _={type:this._type,id:this._id};return this._data&&(_.data=this._data),_}},WebInspector.BreakpointAction.Type={Log:"log",Evaluate:"evaluate",Sound:"sound",Probe:"probe"},WebInspector.ConsoleMessage=class extends WebInspector.Object{constructor(_,S,C,f,T,E,I,R,N,L,D,M){super(),this._target=_,this._source=S,this._level=C,this._messageText=f,this._type=T||WebInspector.ConsoleMessage.MessageType.Log,this._url=E||null,this._line=I||0,this._column=R||0,this._sourceCodeLocation=void 0,this._repeatCount=N||0,this._parameters=L,D=D||[],this._stackTrace=WebInspector.StackTrace.fromPayload(this._target,{callFrames:D}),this._request=M}get target(){return this._target}get source(){return this._source}get level(){return this._level}get messageText(){return this._messageText}get type(){return this._type}get url(){return this._url}get line(){return this._line}get column(){return this._column}get repeatCount(){return this._repeatCount}get parameters(){return this._parameters}get stackTrace(){return this._stackTrace}get request(){return this._request}get sourceCodeLocation(){if(void 0!==this._sourceCodeLocation)return this._sourceCodeLocation;let _=this._stackTrace.callFrames[0];if(_&&_.sourceCodeLocation)return this._sourceCodeLocation=_.sourceCodeLocation,this._sourceCodeLocation;if(this._url&&"undefined"!==this._url){let S=WebInspector.frameResourceManager.resourceForURL(this._url);if(S){let C=0{E.call(this,!1)})}setSourceCode(_){_===this._sourceCode||this._makeChangeAndDispatchChangeEventIfNeeded(function(){this._sourceCode&&(this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded,this._sourceCodeSourceMapAdded,this),this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.FormatterDidChange,this._sourceCodeFormatterDidChange,this)),this._sourceCode=_,this._sourceCode&&(this._sourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded,this._sourceCodeSourceMapAdded,this),this._sourceCode.addEventListener(WebInspector.SourceCode.Event.FormatterDidChange,this._sourceCodeFormatterDidChange,this))})}resolveMappedLocation(){if(!this._mappedLocationIsResolved&&(this._mappedLocationIsResolved=!0,!!this._sourceCode)){var _=this._sourceCode.sourceMaps;if(_.length)for(var S=0;S<_.length;++S){var C=_[S],f=C.findEntry(this._lineNumber,this._columnNumber);if(f&&2!==f.length){var T=f[2],E=C.resourceForURL(T);return E?(this._mappedResource=E,this._mappedLineNumber=f[3],void(this._mappedColumnNumber=f[4])):void 0}}}}_locationString(_,S,C,f,T,E){if(!_)return"";f=f||WebInspector.SourceCodeLocation.ColumnStyle.OnlyIfLarge,T=T||WebInspector.SourceCodeLocation.NameStyle.Short,E=E||"";let I=S+1;switch(f===WebInspector.SourceCodeLocation.ColumnStyle.Shown&&0WebInspector.SourceCodeLocation.LargeColumnNumber?I+=":"+(C+1):f===WebInspector.SourceCodeLocation.ColumnStyle.Hidden&&(I=""),T){case WebInspector.SourceCodeLocation.NameStyle.None:return E+I;case WebInspector.SourceCodeLocation.NameStyle.Short:case WebInspector.SourceCodeLocation.NameStyle.Full:var R=_.displayURL,N=T===WebInspector.SourceCodeLocation.NameStyle.Full&&R?R:_.displayName;if(f===WebInspector.SourceCodeLocation.ColumnStyle.Hidden)return E+N;var L=R?":"+I:WebInspector.UIString(" (line %s)").format(I);return E+N+L;default:return console.error("Unknown nameStyle: "+T),E+I;}}_resetMappedLocation(){this._mappedLocationIsResolved=!1,this._mappedResource=null,this._mappedLineNumber=NaN,this._mappedColumnNumber=NaN}_setMappedLocation(_,S,C){this._mappedLocationIsResolved=!0,this._mappedResource=_,this._mappedLineNumber=S,this._mappedColumnNumber=C}_resolveFormattedLocation(){if(this._sourceCode&&this._sourceCode.formatterSourceMap){var _=this._sourceCode.formatterSourceMap.originalToFormatted(this._lineNumber,this._columnNumber);this._formattedLineNumber=_.lineNumber,this._formattedColumnNumber=_.columnNumber}else this._formattedLineNumber=this._lineNumber,this._formattedColumnNumber=this._columnNumber}_makeChangeAndDispatchChangeEventIfNeeded(_){var S=this._sourceCode,C=this._lineNumber,f=this._columnNumber,T=this._formattedLineNumber,E=this._formattedColumnNumber,I=this.displaySourceCode,R=this.displayLineNumber,N=this.displayColumnNumber;this._resetMappedLocation(),_&&_.call(this),this.resolveMappedLocation(),this._resolveFormattedLocation();var L=!1,D=this.displaySourceCode;I===D?D&&(R!==this.displayLineNumber||N!==this.displayColumnNumber)&&(L=!0):L=!0;var M=!1;if(L?M=!0:S===this._sourceCode?this._sourceCode&&(C!==this._lineNumber||f!==this._columnNumber)?M=!0:this._sourceCode&&(T!==this._formattedLineNumber||E!==this._formattedColumnNumber)&&(M=!0):M=!0,L||M){var P={oldSourceCode:S,oldLineNumber:C,oldColumnNumber:f,oldFormattedLineNumber:T,oldFormattedColumnNumber:E,oldDisplaySourceCode:I,oldDisplayLineNumber:R,oldDisplayColumnNumber:N};L&&this.dispatchEventToListeners(WebInspector.SourceCodeLocation.Event.DisplayLocationChanged,P),M&&this.dispatchEventToListeners(WebInspector.SourceCodeLocation.Event.LocationChanged,P)}}_sourceCodeSourceMapAdded(){this._makeChangeAndDispatchChangeEventIfNeeded(null)}_sourceCodeFormatterDidChange(){this._makeChangeAndDispatchChangeEventIfNeeded(null)}},WebInspector.SourceCodeLocation.DisplayLocationClassName="display-location",WebInspector.SourceCodeLocation.LargeColumnNumber=80,WebInspector.SourceCodeLocation.NameStyle={None:"none",Short:"short",Full:"full"},WebInspector.SourceCodeLocation.ColumnStyle={Hidden:"hidden",OnlyIfLarge:"only-if-large",Shown:"shown"},WebInspector.SourceCodeLocation.Event={LocationChanged:"source-code-location-location-changed",DisplayLocationChanged:"source-code-location-display-location-changed"},WebInspector.Timeline=class extends WebInspector.Object{constructor(_){super(),this._type=_,this.reset(!0)}static create(_){return _===WebInspector.TimelineRecord.Type.Network?new WebInspector.NetworkTimeline(_):_===WebInspector.TimelineRecord.Type.Memory?new WebInspector.MemoryTimeline(_):new WebInspector.Timeline(_)}get type(){return this._type}get startTime(){return this._startTime}get endTime(){return this._endTime}get records(){return this._records}reset(_){this._records=[],this._startTime=NaN,this._endTime=NaN,_||(this.dispatchEventToListeners(WebInspector.Timeline.Event.TimesUpdated),this.dispatchEventToListeners(WebInspector.Timeline.Event.Reset))}addRecord(_){_.updatesDynamically&&_.addEventListener(WebInspector.TimelineRecord.Event.Updated,this._recordUpdated,this),this._tryInsertingRecordInSortedOrder(_),this._updateTimesIfNeeded(_),this.dispatchEventToListeners(WebInspector.Timeline.Event.RecordAdded,{record:_})}saveIdentityToCookie(_){_[WebInspector.Timeline.TimelineTypeCookieKey]=this._type}refresh(){this.dispatchEventToListeners(WebInspector.Timeline.Event.Refreshed)}recordsInTimeRange(_,S,C){let f=this._records.lowerBound(_,(E,I)=>E-I.timestamp),T=this._records.upperBound(S,(E,I)=>E-I.timestamp);return C&&0=f;--T)if(this._records[T].startTime<_.startTime)return void this._records.insertAtIndex(_,T+1);this._records.push(_)}},WebInspector.Timeline.Event={Reset:"timeline-reset",RecordAdded:"timeline-record-added",TimesUpdated:"timeline-times-updated",Refreshed:"timeline-refreshed"},WebInspector.Timeline.TimelineTypeCookieKey="timeline-type",WebInspector.TimelineRange=class extends WebInspector.Object{constructor(_,S){super(),this._startValue=_,this._endValue=S}get startValue(){return this._startValue}set startValue(_){this._startValue=_}get endValue(){return this._endValue}set endValue(_){this._endValue=_}},WebInspector.TimelineRecord=class extends WebInspector.Object{constructor(_,S,C,f,T){super(),_ in WebInspector.TimelineRecord.Type&&(_=WebInspector.TimelineRecord.Type[_]),this._type=_,this._startTime=S||NaN,this._endTime=C||NaN,this._callFrames=f||null,this._sourceCodeLocation=T||null,this._children=[]}get type(){return this._type}get startTime(){return this._startTime}get activeStartTime(){return this._startTime}get endTime(){return this._endTime}get duration(){return this.endTime-this.startTime}get inactiveDuration(){return this.activeStartTime-this.startTime}get activeDuration(){return this.endTime-this.activeStartTime}get updatesDynamically(){return!1}get usesActiveStartTime(){return!1}get callFrames(){return this._callFrames}get initiatorCallFrame(){if(!this._callFrames||!this._callFrames.length)return null;for(var _=0;__||this._ignoreCount===_||(this._ignoreCount=_,this.dispatchEventToListeners(WebInspector.Breakpoint.Event.IgnoreCountDidChange))}get autoContinue(){return this._autoContinue}set autoContinue(_){this._autoContinue===_||(this._autoContinue=_,this.dispatchEventToListeners(WebInspector.Breakpoint.Event.AutoContinueDidChange))}get actions(){return this._actions}get options(){return{condition:this._condition,ignoreCount:this._ignoreCount,actions:this._serializableActions(),autoContinue:this._autoContinue}}get info(){return{contentIdentifier:this._contentIdentifier,lineNumber:this._sourceCodeLocation.lineNumber,columnNumber:this._sourceCodeLocation.columnNumber,disabled:this._disabled,condition:this._condition,ignoreCount:this._ignoreCount,actions:this._serializableActions(),autoContinue:this._autoContinue}}get probeActions(){return this._actions.filter(function(_){return _.type===WebInspector.BreakpointAction.Type.Probe})}cycleToNextMode(){return this.disabled?(this.autoContinue=!1,void(this.disabled=!1)):this.autoContinue?void(this.disabled=!0):this.actions.length?void(this.autoContinue=!0):void(this.disabled=!0)}createAction(_,S,C){var f=new WebInspector.BreakpointAction(this,_,C||null);if(!S)this._actions.push(f);else{var T=this._actions.indexOf(S);-1===T?this._actions.push(f):this._actions.splice(T+1,0,f)}return this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange),f}recreateAction(_,S){var C=new WebInspector.BreakpointAction(this,_,null),f=this._actions.indexOf(S);return-1===f?null:(this._actions[f]=C,this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange),C)}removeAction(_){var S=this._actions.indexOf(_);-1===S||(this._actions.splice(S,1),!this._actions.length&&(this.autoContinue=!1),this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange))}clearActions(_){this._actions=_?this._actions.filter(function(S){return S.type!==_}):[],this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange)}saveIdentityToCookie(_){_[WebInspector.Breakpoint.ContentIdentifierCookieKey]=this.contentIdentifier,_[WebInspector.Breakpoint.LineNumberCookieKey]=this.sourceCodeLocation.lineNumber,_[WebInspector.Breakpoint.ColumnNumberCookieKey]=this.sourceCodeLocation.columnNumber}breakpointActionDidChange(_){var S=this._actions.indexOf(_);-1===S||this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange)}_serializableActions(){for(var _=[],S=0;S",null),this._totalNumberOfSamples=0}totalDurationInTimeRange(_,S){return this._root.filteredTimestampsAndDuration(_,S).duration}updateTreeWithStackTrace({timestamp:_,stackFrames:S},C){this._totalNumberOfSamples++;let f=this._root;switch(f.addTimestampAndExpressionLocation(_,C,null),this._type){case WebInspector.CallingContextTree.Type.TopDown:for(let T=S.length,E;T--;)E=S[T],f=f.findOrMakeChild(E),f.addTimestampAndExpressionLocation(_,C,E.expressionLocation||null,0===T);break;case WebInspector.CallingContextTree.Type.BottomUp:for(let T=0,E;T{E.hasStackTraceInTimeRange(_,S)&&f.push(E.toCPUProfileNode(T,_,S))}),C.rootNodes=f,C}forEachChild(_){this._root.forEachChild(_)}forEachNode(_){this._root.forEachNode(_)}static __test_makeTreeFromProtocolMessageObject(_){let S=new WebInspector.CallingContextTree,C=_.params.samples.stackTraces;for(let f=0;fS)return!1;let C=this._timestamps,f=C.length;if(!f)return!1;let T=C.lowerBound(_);if(T===f)return!1;let E=C[T]<=S;return E}filteredTimestampsAndDuration(_,S){let C=this._timestamps.lowerBound(_),f=this._timestamps.upperBound(S),T=0;for(let E=C;E{N.hasStackTraceInTimeRange(S,C)&&f.push(N.toCPUProfileNode(_,S,C))});let T={id:this._uid,functionName:this._name,url:this._url,lineNumber:this._line,columnNumber:this._column,children:f},E=[],I=Number.MAX_VALUE,R=Number.MIN_VALUE;for(let N=0,L;N{f.__test_buildLeafLinkedLists(C,S)}):S.push(C)}},WebInspector.CallingContextTreeNode.__uid=0,WebInspector.CSSCompletions=class{constructor(_,S){if(this._values=[],this._longhands={},this._shorthands={},_.length&&"string"==typeof _[0])this._values=this._values.concat(_);else for(var C of _){var f=C.name;this._values.push(f);var T=C.longhands;if(T){this._longhands[f]=T;for(var E=0;E>1;if(this._values[T].startsWith(_)){f=T;break}this._values[T]<_?C=T+1:S=T-1}while(C<=S);if(f===void 0)return-1;for(;f&&this._values[f-1].startsWith(_);)f--;return f}keySet(){return this._keySet||(this._keySet=this._values.keySet()),this._keySet}next(_,S){return this._closest(_,S,1)}previous(_,S){return this._closest(_,S,-1)}_closest(_,S,C){if(!_)return"";var f=this._values.indexOf(_);if(-1===f)return"";if(!S)return f=(f+this._values.length+C)%this._values.length,this._values[f];var T=this.startsWith(S),E=T.indexOf(_);return E=(E+T.length+C)%T.length,T[E]}isShorthandPropertyName(_){return _ in this._longhands}shorthandsForLonghand(_){return this._shorthands[_]||[]}isValidPropertyName(_){return this._values.includes(_)}propertyRequiresWebkitPrefix(_){return this._values.includes("-webkit-"+_)&&!this._values.includes(_)}getClosestPropertyName(_){var S=[{distance:Infinity,name:null}];for(var C of this._values){var f=_.levenshteinDistance(C);fS.length)&&S[0].name}},WebInspector.CSSCompletions.cssNameCompletions=null,WebInspector.CSSKeywordCompletions={},WebInspector.CSSKeywordCompletions.forProperty=function(u){let _=["initial","unset","revert","var()"],S="-"!==u.charAt(0);return u in WebInspector.CSSKeywordCompletions._propertyKeywordMap?_=_.concat(WebInspector.CSSKeywordCompletions._propertyKeywordMap[u]):S&&"-webkit-"+u in WebInspector.CSSKeywordCompletions._propertyKeywordMap&&(_=_.concat(WebInspector.CSSKeywordCompletions._propertyKeywordMap["-webkit-"+u])),u in WebInspector.CSSKeywordCompletions._colorAwareProperties?_=_.concat(WebInspector.CSSKeywordCompletions._colors):S&&"-webkit-"+u in WebInspector.CSSKeywordCompletions._colorAwareProperties?_=_.concat(WebInspector.CSSKeywordCompletions._colors):u.endsWith("color")&&(_=_.concat(WebInspector.CSSKeywordCompletions._colors)),u in WebInspector.CSSKeywordCompletions.InheritedProperties?_.push("inherit"):S&&"-webkit-"+u in WebInspector.CSSKeywordCompletions.InheritedProperties&&_.push("inherit"),_.includes(WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder)&&WebInspector.CSSCompletions.cssNameCompletions&&(_.remove(WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder),_=_.concat(WebInspector.CSSCompletions.cssNameCompletions.values)),new WebInspector.CSSCompletions(_,!0)},WebInspector.CSSKeywordCompletions.forFunction=function(u){let _=["var()"];return"var"===u?_=[]:"env"==u?_=_.concat(["safe-area-inset-top","safe-area-inset-right","safe-area-inset-bottom","safe-area-inset-left"]):"image-set"===u?_.push("url()"):"repeat"===u?_=_.concat(["auto","auto-fill","auto-fit","min-content","max-content"]):u.endsWith("gradient")&&(_=_.concat(["to","left","right","top","bottom"]),_=_.concat(WebInspector.CSSKeywordCompletions._colors)),new WebInspector.CSSCompletions(_,!0)},WebInspector.CSSKeywordCompletions.addCustomCompletions=function(u){for(var _ of u)_.values&&WebInspector.CSSKeywordCompletions.addPropertyCompletionValues(_.name,_.values)},WebInspector.CSSKeywordCompletions.addPropertyCompletionValues=function(u,_){var S=WebInspector.CSSKeywordCompletions._propertyKeywordMap[u];if(!S)return void(WebInspector.CSSKeywordCompletions._propertyKeywordMap[u]=_);var C=new Set;for(var f of S)C.add(f);for(var f of _)C.add(f);WebInspector.CSSKeywordCompletions._propertyKeywordMap[u]=[...C.values()]},WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder="__all-properties__",WebInspector.CSSKeywordCompletions.InheritedProperties=["azimuth","border-collapse","border-spacing","caption-side","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","elevation","empty-cells","fill","fill-opacity","fill-rule","font","font-family","font-size","font-style","font-variant","font-variant-numeric","font-weight","font-optical-sizing","glyph-orientation-horizontal","glyph-orientation-vertical","hanging-punctuation","image-rendering","kerning","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","marker","marker-end","marker-mid","marker-start","orphans","pitch","pitch-range","pointer-events","quotes","resize","richness","shape-rendering","speak","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","text-align","text-anchor","text-decoration","text-indent","text-rendering","text-shadow","text-transform","visibility","voice-family","volume","white-space","widows","word-break","word-spacing","word-wrap","writing-mode","-webkit-aspect-ratio","-webkit-border-horizontal-spacing","-webkit-border-vertical-spacing","-webkit-box-direction","-webkit-color-correction","font-feature-settings","-webkit-font-kerning","-webkit-font-smoothing","-webkit-font-variant-ligatures","-webkit-hyphenate-character","-webkit-hyphenate-limit-after","-webkit-hyphenate-limit-before","-webkit-hyphenate-limit-lines","-webkit-hyphens","-webkit-line-align","-webkit-line-box-contain","-webkit-line-break","-webkit-line-grid","-webkit-line-snap","-webkit-locale","-webkit-nbsp-mode","-webkit-print-color-adjust","-webkit-rtl-ordering","-webkit-text-combine","-webkit-text-decorations-in-effect","-webkit-text-emphasis","-webkit-text-emphasis-color","-webkit-text-emphasis-position","-webkit-text-emphasis-style","-webkit-text-fill-color","-webkit-text-orientation","-webkit-text-security","-webkit-text-size-adjust","-webkit-text-stroke","-webkit-text-stroke-color","-webkit-text-stroke-width","-webkit-user-modify","-webkit-user-select","-webkit-writing-mode","-webkit-cursor-visibility","image-orientation","image-resolution","overflow-wrap","-webkit-text-align-last","-webkit-text-justify","-webkit-ruby-position","-webkit-text-decoration-line","font-synthesis","-webkit-overflow-scrolling","-webkit-touch-callout","-webkit-tap-highlight-color"].keySet(),WebInspector.CSSKeywordCompletions._colors=["aqua","black","blue","fuchsia","gray","green","lime","maroon","navy","olive","orange","purple","red","silver","teal","white","yellow","transparent","currentcolor","grey","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","rgb()","rgba()","hsl()","hsla()"],WebInspector.CSSKeywordCompletions._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-line-through","text-line-through-color","text-overline","text-overline-color","text-shadow","text-underline","text-underline-color","-webkit-box-shadow","-webkit-column-rule","-webkit-column-rule-color","-webkit-text-emphasis","-webkit-text-emphasis-color","-webkit-text-fill-color","-webkit-text-stroke","-webkit-text-stroke-color","-webkit-text-decoration-color","-webkit-tap-highlight-color"].keySet(),WebInspector.CSSKeywordCompletions._propertyKeywordMap={"table-layout":["auto","fixed"],visibility:["hidden","visible","collapse"],"text-underline":["none","dotted","dashed","solid","double","dot-dash","dot-dot-dash","wave"],content:["list-item","close-quote","no-close-quote","no-open-quote","open-quote","attr()","counter()","counters()","url()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()","-webkit-canvas()","cross-fade()","image-set()"],"list-style-image":["none","url()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()","-webkit-canvas()","cross-fade()","image-set()"],clear:["none","left","right","both"],"fill-rule":["nonzero","evenodd"],"stroke-linecap":["butt","round","square"],"stroke-linejoin":["round","miter","bevel"],"baseline-shift":["baseline","sub","super"],"border-bottom-width":["medium","thick","thin","calc()"],"margin-top-collapse":["collapse","separate","discard"],"-webkit-box-orient":["horizontal","vertical","inline-axis","block-axis"],"font-stretch":["normal","wider","narrower","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"],"font-optical-sizing":["auto","none"],"-webkit-color-correction":["default","srgb"],"border-left-width":["medium","thick","thin","calc()"],"-webkit-writing-mode":["lr","rl","tb","lr-tb","rl-tb","tb-rl","horizontal-tb","vertical-rl","vertical-lr","horizontal-bt"],"text-line-through-mode":["continuous","skip-white-space"],"text-overline-mode":["continuous","skip-white-space"],"text-underline-mode":["continuous","skip-white-space"],"text-line-through-style":["none","dotted","dashed","solid","double","dot-dash","dot-dot-dash","wave"],"text-overline-style":["none","dotted","dashed","solid","double","dot-dash","dot-dot-dash","wave"],"text-underline-style":["none","dotted","dashed","solid","double","dot-dash","dot-dot-dash","wave"],"border-collapse":["collapse","separate"],"border-top-width":["medium","thick","thin","calc()"],"outline-color":["invert","-webkit-focus-ring-color"],"outline-style":["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double","auto"],cursor:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","grab","grabbing","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","-webkit-grab","-webkit-grabbing","-webkit-zoom-in","-webkit-zoom-out","url()","image-set()"],"border-width":["medium","thick","thin","calc()"],size:["a3","a4","a5","b4","b5","landscape","ledger","legal","letter","portrait"],background:["none","url()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()","-webkit-canvas()","cross-fade()","image-set()","repeat","repeat-x","repeat-y","no-repeat","space","round","scroll","fixed","local","auto","contain","cover","top","right","left","bottom","center","border-box","padding-box","content-box"],"background-image":["none","url()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()","-webkit-canvas()","cross-fade()","image-set()"],"background-size":["auto","contain","cover"],"background-attachment":["scroll","fixed","local"],"background-repeat":["repeat","repeat-x","repeat-y","no-repeat","space","round"],"background-blend-mode":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],"background-position":["top","right","left","bottom","center"],"background-origin":["border-box","padding-box","content-box"],"background-clip":["border-box","padding-box","content-box"],direction:["ltr","rtl"],"enable-background":["accumulate","new"],float:["none","left","right"],"hanging-punctuation":["none","first","last","allow-end","force-end"],"overflow-x":["hidden","auto","visible","overlay","scroll","marquee"],"overflow-y":["hidden","auto","visible","overlay","scroll","marquee","-webkit-paged-x","-webkit-paged-y"],overflow:["hidden","auto","visible","overlay","scroll","marquee","-webkit-paged-x","-webkit-paged-y"],"margin-bottom-collapse":["collapse","separate","discard"],"-webkit-box-reflect":["none","left","right","above","below"],"text-rendering":["auto","optimizeSpeed","optimizeLegibility","geometricPrecision"],"text-align":["-webkit-auto","left","right","center","justify","-webkit-left","-webkit-right","-webkit-center","-webkit-match-parent","start","end"],"list-style-position":["outside","inside"],"margin-bottom":["auto"],"color-interpolation":["linearrgb"],"word-wrap":["normal","break-word"],"font-weight":["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"],"font-synthesis":["none","weight","style"],"margin-before-collapse":["collapse","separate","discard"],"text-overline-width":["normal","medium","auto","thick","thin","calc()"],"text-transform":["none","capitalize","uppercase","lowercase"],"border-right-style":["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"],"border-left-style":["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"],"font-style":["italic","oblique","normal"],speak:["none","normal","spell-out","digits","literal-punctuation","no-punctuation"],"text-line-through":["none","dotted","dashed","solid","double","dot-dash","dot-dot-dash","wave","continuous","skip-white-space"],"color-rendering":["auto","optimizeSpeed","optimizeQuality"],"list-style-type":["none","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"],"-webkit-text-combine":["none","horizontal"],outline:["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"],font:["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","-apple-system","-apple-system-headline","-apple-system-body","-apple-system-subheadline","-apple-system-footnote","-apple-system-caption1","-apple-system-caption2","-apple-system-short-headline","-apple-system-short-body","-apple-system-short-subheadline","-apple-system-short-footnote","-apple-system-short-caption1","-apple-system-tall-body","-apple-system-title0","-apple-system-title1","-apple-system-title2","-apple-system-title3","-apple-system-title4","system-ui"],"dominant-baseline":["middle","auto","central","text-before-edge","text-after-edge","ideographic","alphabetic","hanging","mathematical","use-script","no-change","reset-size"],display:["none","inline","block","list-item","compact","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","-wap-marquee","flex","inline-flex","grid","inline-grid"],"image-rendering":["auto","optimizeSpeed","optimizeQuality","-webkit-crisp-edges","-webkit-optimize-contrast","crisp-edges","pixelated"],"alignment-baseline":["baseline","middle","auto","before-edge","after-edge","central","text-before-edge","text-after-edge","ideographic","alphabetic","hanging","mathematical"],"outline-width":["medium","thick","thin","calc()"],"text-line-through-width":["normal","medium","auto","thick","thin"],"box-align":["baseline","center","stretch","start","end"],"box-shadow":["none"],"text-shadow":["none"],"-webkit-box-shadow":["none"],"border-right-width":["medium","thick","thin"],"border-top-style":["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"],"line-height":["normal"],"counter-increment":["none"],"counter-reset":["none"],"text-overflow":["clip","ellipsis"],"-webkit-box-direction":["normal","reverse"],"margin-after-collapse":["collapse","separate","discard"],"break-after":["left","right","recto","verso","auto","avoid","page","column","region","avoid-page","avoid-column","avoid-region"],"break-before":["left","right","recto","verso","auto","avoid","page","column","region","avoid-page","avoid-column","avoid-region"],"break-inside":["auto","avoid","avoid-page","avoid-column","avoid-region"],"page-break-after":["left","right","auto","always","avoid"],"page-break-before":["left","right","auto","always","avoid"],"page-break-inside":["auto","avoid"],"-webkit-column-break-after":["left","right","auto","always","avoid"],"-webkit-column-break-before":["left","right","auto","always","avoid"],"-webkit-column-break-inside":["auto","avoid"],"-webkit-hyphens":["none","auto","manual"],"border-image":["repeat","stretch","url()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()","-webkit-canvas()","cross-fade()","image-set()"],"border-image-repeat":["repeat","stretch","space","round"],"-webkit-mask-box-image-repeat":["repeat","stretch","space","round"],position:["absolute","fixed","relative","static","-webkit-sticky"],"font-family":["serif","sans-serif","cursive","fantasy","monospace","-webkit-body","-webkit-pictograph","-apple-system","-apple-system-headline","-apple-system-body","-apple-system-subheadline","-apple-system-footnote","-apple-system-caption1","-apple-system-caption2","-apple-system-short-headline","-apple-system-short-body","-apple-system-short-subheadline","-apple-system-short-footnote","-apple-system-short-caption1","-apple-system-tall-body","-apple-system-title0","-apple-system-title1","-apple-system-title2","-apple-system-title3","-apple-system-title4","system-ui"],"text-overflow-mode":["clip","ellipsis"],"border-bottom-style":["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"],"unicode-bidi":["normal","bidi-override","embed","plaintext","isolate","isolate-override"],"clip-rule":["nonzero","evenodd"],"margin-left":["auto"],"margin-top":["auto"],zoom:["normal","document","reset"],"z-index":["auto"],width:["intrinsic","min-intrinsic","-webkit-min-content","-webkit-max-content","-webkit-fill-available","-webkit-fit-content","calc()"],height:["intrinsic","min-intrinsic","calc()"],"max-width":["none","intrinsic","min-intrinsic","-webkit-min-content","-webkit-max-content","-webkit-fill-available","-webkit-fit-content","calc()"],"min-width":["intrinsic","min-intrinsic","-webkit-min-content","-webkit-max-content","-webkit-fill-available","-webkit-fit-content","calc()"],"max-height":["none","intrinsic","min-intrinsic","calc()"],"min-height":["intrinsic","min-intrinsic","calc()"],"-webkit-logical-width":["intrinsic","min-intrinsic","-webkit-min-content","-webkit-max-content","-webkit-fill-available","-webkit-fit-content","calc()"],"-webkit-logical-height":["intrinsic","min-intrinsic","calc()"],"-webkit-max-logical-width":["none","intrinsic","min-intrinsic","-webkit-min-content","-webkit-max-content","-webkit-fill-available","-webkit-fit-content","calc()"],"-webkit-min-logical-width":["intrinsic","min-intrinsic","-webkit-min-content","-webkit-max-content","-webkit-fill-available","-webkit-fit-content","calc()"],"-webkit-max-logical-height":["none","intrinsic","min-intrinsic","calc()"],"-webkit-min-logical-height":["intrinsic","min-intrinsic","calc()"],"empty-cells":["hide","show"],"pointer-events":["none","all","auto","visible","visiblepainted","visiblefill","visiblestroke","painted","fill","stroke"],"letter-spacing":["normal","calc()"],"word-spacing":["normal","calc()"],"-webkit-font-kerning":["auto","normal","none"],"-webkit-font-smoothing":["none","auto","antialiased","subpixel-antialiased"],border:["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"],"font-size":["xx-small","x-small","small","medium","large","x-large","xx-large","-webkit-xxx-large","smaller","larger"],"font-variant":["small-caps","normal"],"font-variant-numeric":["normal","ordinal","slashed-zero","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions"],"vertical-align":["baseline","middle","sub","super","text-top","text-bottom","top","bottom","-webkit-baseline-middle"],"white-space":["normal","nowrap","pre","pre-line","pre-wrap"],"word-break":["normal","break-all","break-word"],"text-underline-width":["normal","medium","auto","thick","thin","calc()"],"text-indent":["-webkit-each-line","-webkit-hanging"],"-webkit-box-lines":["single","multiple"],clip:["auto","rect()"],"clip-path":["none","url()","circle()","ellipse()","inset()","polygon()","margin-box","border-box","padding-box","content-box"],"shape-outside":["none","url()","circle()","ellipse()","inset()","polygon()","margin-box","border-box","padding-box","content-box"],orphans:["auto"],widows:["auto"],margin:["auto"],page:["auto"],perspective:["none"],"perspective-origin":["none","left","right","bottom","top","center"],"-webkit-marquee-increment":["small","large","medium"],"-webkit-marquee-direction":["left","right","auto","reverse","forwards","backwards","ahead","up","down"],"-webkit-marquee-style":["none","scroll","slide","alternate"],"-webkit-marquee-repetition":["infinite"],"-webkit-marquee-speed":["normal","slow","fast"],"margin-right":["auto"],"marquee-speed":["normal","slow","fast"],"-webkit-text-emphasis":["circle","filled","open","dot","double-circle","triangle","sesame"],"-webkit-text-emphasis-style":["circle","filled","open","dot","double-circle","triangle","sesame"],"-webkit-text-emphasis-position":["over","under","left","right"],transform:["none","scale()","scaleX()","scaleY()","scale3d()","rotate()","rotateX()","rotateY()","rotateZ()","rotate3d()","skew()","skewX()","skewY()","translate()","translateX()","translateY()","translateZ()","translate3d()","matrix()","matrix3d()","perspective()"],"transform-style":["flat","preserve-3d"],"-webkit-cursor-visibility":["auto","auto-hide"],"text-decoration":["none","underline","overline","line-through","blink"],"-webkit-text-decorations-in-effect":["none","underline","overline","line-through","blink"],"-webkit-text-decoration-line":["none","underline","overline","line-through","blink"],"-webkit-text-decoration-style":["solid","double","dotted","dashed","wavy"],"-webkit-text-decoration-skip":["auto","none","objects","ink"],"-webkit-text-underline-position":["auto","alphabetic","under"],"image-resolution":["from-image","snap"],"-webkit-blend-mode":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","plus-darker","plus-lighter","hue","saturation","color","luminosity"],"mix-blend-mode":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","plus-darker","plus-lighter","hue","saturation","color","luminosity"],mix:["auto","normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","plus-darker","plus-lighter","hue","saturation","color","luminosity","clear","copy","destination","source-over","destination-over","source-in","destination-in","source-out","destination-out","source-atop","destination-atop","xor"],geometry:["detached","attached","grid()"],"overflow-wrap":["normal","break-word"],transition:["none","ease","linear","ease-in","ease-out","ease-in-out","step-start","step-end","steps()","cubic-bezier()","spring()","all",WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder],"transition-timing-function":["ease","linear","ease-in","ease-out","ease-in-out","step-start","step-end","steps()","cubic-bezier()","spring()"],"transition-property":["all","none",WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder],"-webkit-column-progression":["normal","reverse"],"-webkit-box-decoration-break":["slice","clone"],"align-content":["auto","baseline","last-baseline","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end","left","right","true","safe"],"justify-content":["auto","baseline","last-baseline","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end","left","right","true","safe"],"align-items":["auto","stretch","baseline","last-baseline","center","start","end","self-start","self-end","flex-start","flex-end","left","right","true","safe"],"align-self":["auto","stretch","baseline","last-baseline","center","start","end","self-start","self-end","flex-start","flex-end","left","right","true","safe"],"justify-items":["auto","stretch","baseline","last-baseline","center","start","end","self-start","self-end","flex-start","flex-end","left","right","true","safe"],"justify-self":["auto","stretch","baseline","last-baseline","center","start","end","self-start","self-end","flex-start","flex-end","left","right","true","safe"],"flex-direction":["row","row-reverse","column","column-reverse"],"flex-wrap":["nowrap","wrap","wrap-reverse"],"flex-flow":["row","row-reverse","column","column-reverse","nowrap","wrap","wrap-reverse"],flex:["none"],"flex-basis":["auto"],grid:["none"],"grid-area":["auto"],"grid-auto-columns":["auto","-webkit-max-content","-webkit-min-content","minmax()"],"grid-auto-flow":["row","column","dense"],"grid-auto-rows":["auto","-webkit-max-content","-webkit-min-content","minmax()"],"grid-column":["auto"],"grid-column-start":["auto"],"grid-column-end":["auto"],"grid-row":["auto"],"grid-row-start":["auto"],"grid-row-end":["auto"],"grid-template":["none"],"grid-template-areas":["none"],"grid-template-columns":["none","auto","-webkit-max-content","-webkit-min-content","minmax()","repeat()"],"grid-template-rows":["none","auto","-webkit-max-content","-webkit-min-content","minmax()","repeat()"],"-webkit-ruby-position":["after","before","inter-character"],"-webkit-text-align-last":["auto","start","end","left","right","center","justify"],"-webkit-text-justify":["auto","none","inter-word","inter-ideograph","inter-cluster","distribute","kashida"],"max-zoom":["auto"],"min-zoom":["auto"],orientation:["auto","portait","landscape"],"scroll-snap-align":["none","start","center","end"],"scroll-snap-type":["none","mandatory","proximity","x","y","inline","block","both"],"user-zoom":["zoom","fixed"],"-webkit-app-region":["drag","no-drag"],"-webkit-line-break":["auto","loose","normal","strict","after-white-space"],"-webkit-background-composite":["clear","copy","source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","xor","plus-darker","plus-lighter"],"-webkit-mask-composite":["clear","copy","source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","xor","plus-darker","plus-lighter"],"-webkit-animation-direction":["normal","alternate","reverse","alternate-reverse"],"-webkit-animation-fill-mode":["none","forwards","backwards","both"],"-webkit-animation-iteration-count":["infinite"],"-webkit-animation-play-state":["paused","running"],"-webkit-animation-timing-function":["ease","linear","ease-in","ease-out","ease-in-out","step-start","step-end","steps()","cubic-bezier()","spring()"],"-webkit-column-span":["all","none","calc()"],"-webkit-region-break-after":["auto","always","avoid","left","right"],"-webkit-region-break-before":["auto","always","avoid","left","right"],"-webkit-region-break-inside":["auto","avoid"],"-webkit-region-overflow":["auto","break"],"-webkit-backface-visibility":["visible","hidden"],resize:["none","both","horizontal","vertical","auto"],"caption-side":["top","bottom","left","right"],"box-sizing":["border-box","content-box"],"-webkit-alt":["attr()"],"-webkit-border-fit":["border","lines"],"-webkit-line-align":["none","edges"],"-webkit-line-snap":["none","baseline","contain"],"-webkit-nbsp-mode":["normal","space"],"-webkit-print-color-adjust":["exact","economy"],"-webkit-rtl-ordering":["logical","visual"],"-webkit-text-security":["disc","circle","square","none"],"-webkit-user-drag":["auto","none","element"],"-webkit-user-modify":["read-only","read-write","read-write-plaintext-only"],"-webkit-user-select":["auto","none","text","all"],"-webkit-text-stroke-width":["medium","thick","thin","calc()"],"-webkit-border-start-width":["medium","thick","thin","calc()"],"-webkit-border-end-width":["medium","thick","thin","calc()"],"-webkit-border-before-width":["medium","thick","thin","calc()"],"-webkit-border-after-width":["medium","thick","thin","calc()"],"-webkit-column-rule-width":["medium","thick","thin","calc()"],"-webkit-aspect-ratio":["auto","from-dimensions","from-intrinsic","/"],filter:["none","grayscale()","sepia()","saturate()","hue-rotate()","invert()","opacity()","brightness()","contrast()","blur()","drop-shadow()","custom()"],"-webkit-backdrop-filter":["none","grayscale()","sepia()","saturate()","hue-rotate()","invert()","opacity()","brightness()","contrast()","blur()","drop-shadow()","custom()"],"-webkit-column-count":["auto","calc()"],"-webkit-column-gap":["normal","calc()"],"-webkit-column-axis":["horizontal","vertical","auto"],"-webkit-column-width":["auto","calc()"],"-webkit-column-fill":["auto","balance"],"-webkit-hyphenate-character":["none"],"-webkit-hyphenate-limit-after":["auto"],"-webkit-hyphenate-limit-before":["auto"],"-webkit-hyphenate-limit-lines":["no-limit"],"-webkit-line-grid":["none"],"-webkit-locale":["auto"],"-webkit-text-orientation":["sideways","sideways-right","vertical-right","upright"],"-webkit-line-box-contain":["block","inline","font","glyphs","replaced","inline-box","none"],"font-feature-settings":["normal"],"-webkit-font-variant-ligatures":["normal","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures"],"-webkit-animation-trigger":["auto","container-scroll()"],"-webkit-text-size-adjust":["none","auto"],"-webkit-touch-callout":["default","none"],"-webkit-overflow-scrolling":["auto","touch"]},WebInspector.CSSMedia=class extends WebInspector.Object{constructor(_,S,C){super(),this._type=_||null,this._text=S||"",this._sourceCodeLocation=C||null}get type(){return this._type}get text(){return this._text}get sourceCodeLocation(){return this._sourceCodeLocation}},WebInspector.CSSMedia.Type={MediaRule:"css-media-type-media-rule",ImportRule:"css-media-type-import-rule",LinkedStyleSheet:"css-media-type-linked-stylesheet",InlineStyleSheet:"css-media-type-inline-stylesheet"},WebInspector.CSSProperty=class extends WebInspector.Object{constructor(_,S,C,f,T,E,I,R,N,L,D){super(),this._ownerStyle=null,this._index=_,this.update(S,C,f,T,E,I,R,N,L,D,!0)}static isInheritedPropertyName(_){return!!(_ in WebInspector.CSSKeywordCompletions.InheritedProperties)||_.startsWith("--")}get ownerStyle(){return this._ownerStyle}set ownerStyle(_){this._ownerStyle=_||null}get index(){return this._index}set index(_){this._index=_}update(_,S,C,f,T,E,I,R,N,L,D){_=_||"",S=S||"",C=C||"",f=f||"",T=T||!1,E=E||!1,I=I||!1,R=R||!1,N=N||!1;var M=!1;D||(M=this._name!==S||this._value!==C||this._priority!==f||this._enabled!==T||this._implicit!==I||this._anonymous!==R||this._valid!==N),D?this._overridden=E:this.overridden=E,this._text=_,this._name=S,this._value=C,this._priority=f,this._enabled=T,this._implicit=I,this._anonymous=R,this._inherited=WebInspector.CSSProperty.isInheritedPropertyName(S),this._valid=N,this._variable=S.startsWith("--"),this._styleSheetTextRange=L||null,this._relatedShorthandProperty=null,this._relatedLonghandProperties=[],delete this._styleDeclarationTextRange,delete this._canonicalName,delete this._hasOtherVendorNameOrKeyword,M&&this.dispatchEventToListeners(WebInspector.CSSProperty.Event.Changed)}get synthesizedText(){var _=this.name;if(!_)return"";var S=this.priority;return _+": "+this.value.trim()+(S?" !"+S:"")+";"}get text(){return this._text||this.synthesizedText}get name(){return this._name}get canonicalName(){return this._canonicalName?this._canonicalName:(this._canonicalName=WebInspector.cssStyleManager.canonicalNameForPropertyName(this.name),this._canonicalName)}get value(){return this._value}get important(){return"important"===this.priority}get priority(){return this._priority}get enabled(){return this._enabled&&this._ownerStyle&&(!isNaN(this._index)||this._ownerStyle.type===WebInspector.CSSStyleDeclaration.Type.Computed)}get overridden(){return this._overridden}set overridden(_){function S(){delete this._overriddenStatusChangedTimeout,this._overridden===C||this.dispatchEventToListeners(WebInspector.CSSProperty.Event.OverriddenStatusChanged)}if(_=_||!1,this._overridden!==_){var C=this._overridden;this._overridden=_,this._overriddenStatusChangedTimeout||(this._overriddenStatusChangedTimeout=setTimeout(S.bind(this),0))}}get implicit(){return this._implicit}set implicit(_){this._implicit=_}get anonymous(){return this._anonymous}get inherited(){return this._inherited}get valid(){return this._valid}get variable(){return this._variable}get styleSheetTextRange(){return this._styleSheetTextRange}get styleDeclarationTextRange(){if("_styleDeclarationTextRange"in this)return this._styleDeclarationTextRange;if(!this._ownerStyle||!this._styleSheetTextRange)return null;var _=this._ownerStyle.styleSheetTextRange;if(!_)return null;var S=this._styleSheetTextRange.startLine-_.startLine,C=this._styleSheetTextRange.endLine-_.startLine,f=this._styleSheetTextRange.startColumn;S||(f-=_.startColumn);var T=this._styleSheetTextRange.endColumn;return C||(T-=_.startColumn),this._styleDeclarationTextRange=new WebInspector.TextRange(S,f,C,T),this._styleDeclarationTextRange}get relatedShorthandProperty(){return this._relatedShorthandProperty}set relatedShorthandProperty(_){this._relatedShorthandProperty=_||null}get relatedLonghandProperties(){return this._relatedLonghandProperties}addRelatedLonghandProperty(_){this._relatedLonghandProperties.push(_)}clearRelatedLonghandProperties(){this._relatedLonghandProperties=[]}hasOtherVendorNameOrKeyword(){return"_hasOtherVendorNameOrKeyword"in this?this._hasOtherVendorNameOrKeyword:(this._hasOtherVendorNameOrKeyword=WebInspector.cssStyleManager.propertyNameHasOtherVendorPrefix(this.name)||WebInspector.cssStyleManager.propertyValueHasOtherVendorKeyword(this.value),this._hasOtherVendorNameOrKeyword)}},WebInspector.CSSProperty.Event={Changed:"css-property-changed",OverriddenStatusChanged:"css-property-overridden-status-changed"},WebInspector.CSSRule=class extends WebInspector.Object{constructor(_,S,C,f,T,E,I,R,N,L){super(),this._nodeStyles=_,this._ownerStyleSheet=S||null,this._id=C||null,this._type=f||null,this.update(T,E,I,R,N,L,!0)}get id(){return this._id}get ownerStyleSheet(){return this._ownerStyleSheet}get editable(){return!!this._id&&(this._type===WebInspector.CSSStyleSheet.Type.Author||this._type===WebInspector.CSSStyleSheet.Type.Inspector)}update(_,S,C,f,T,E,I){_=_||null,S=S||"",C=C||[],f=f||[],T=T||null,E=E||[];var R=!1;I||(R=this._selectorText!==S||!Array.shallowEqual(this._selectors,C)||!Array.shallowEqual(this._matchedSelectorIndices,f)||this._style!==T||!!this._sourceCodeLocation!=!!_||this._mediaList.length!==E.length),this._style&&(this._style.ownerRule=null),this._sourceCodeLocation=_,this._selectorText=S,this._selectors=C,this._matchedSelectorIndices=f,this._mostSpecificSelector=null,this._style=T,this._mediaList=E,this._matchedSelectors=null,this._matchedSelectorText=null,this._style&&(this._style.ownerRule=this),R&&this.dispatchEventToListeners(WebInspector.CSSRule.Event.Changed)}get type(){return this._type}get sourceCodeLocation(){return this._sourceCodeLocation}get selectorText(){return this._selectorText}set selectorText(_){return this.editable?this._selectorText===_?void this._selectorResolved(!0):void this._nodeStyles.changeRuleSelector(this,_).then(this._selectorResolved.bind(this),this._selectorRejected.bind(this)):void 0}get selectors(){return this._selectors}get matchedSelectorIndices(){return this._matchedSelectorIndices}get matchedSelectors(){return this._matchedSelectors?this._matchedSelectors:(this._matchedSelectors=this._selectors.filter(function(_,S){return this._matchedSelectorIndices.includes(S)},this),this._matchedSelectors)}get matchedSelectorText(){return"_matchedSelectorText"in this?this._matchedSelectorText:(this._matchedSelectorText=this.matchedSelectors.map(function(_){return _.text}).join(", "),this._matchedSelectorText)}hasMatchedPseudoElementSelector(){return this.nodeStyles&&this.nodeStyles.node&&this.nodeStyles.node.isPseudoElement()||this.matchedSelectors.some(_=>_.isPseudoElementSelector())}get style(){return this._style}get mediaList(){return this._mediaList}get mediaText(){if(!this._mediaList.length)return"";let _="";for(let S of this._mediaList)_+=S.text;return _}isEqualTo(_){return!!_&&Object.shallowEqual(this._id,_.id)}get mostSpecificSelector(){return this._mostSpecificSelector||(this._mostSpecificSelector=this._determineMostSpecificSelector()),this._mostSpecificSelector}selectorIsGreater(_){var S=this.mostSpecificSelector;return!!S&&S.isGreaterThan(_)}get nodeStyles(){return this._nodeStyles}_determineMostSpecificSelector(){if(!this._selectors||!this._selectors.length)return null;var _=this.matchedSelectors;_.length||(_=this._selectors);var S=_[0];for(var C of _)C.isGreaterThan(S)&&(S=C);return S}_selectorRejected(_){this.dispatchEventToListeners(WebInspector.CSSRule.Event.SelectorChanged,{valid:!_})}_selectorResolved(_){this.dispatchEventToListeners(WebInspector.CSSRule.Event.SelectorChanged,{valid:!!_})}},WebInspector.CSSRule.Event={Changed:"css-rule-changed",SelectorChanged:"css-rule-invalid-selector"},WebInspector.CSSSelector=class extends WebInspector.Object{constructor(_,S,C){super(),this._text=_,this._specificity=S||null,this._dynamic=C||!1}get text(){return this._text}get specificity(){return this._specificity}get dynamic(){return this._dynamic}isGreaterThan(_){if(!_||!_.specificity)return!0;for(var S=0;S_.specificity[S];return!1}isPseudoElementSelector(){return WebInspector.CSSStyleManager.PseudoElementNames.some(_=>this._text.includes(`:${_}`))}},WebInspector.CSSStyleDeclaration=class extends WebInspector.Object{constructor(_,S,C,f,T,E,I,R,N){super(),this._nodeStyles=_,this._ownerRule=null,this._ownerStyleSheet=S||null,this._id=C||null,this._type=f||null,this._node=T||null,this._inherited=E||!1,this._pendingProperties=[],this._propertyNameMap={},this._initialText=I,this._hasModifiedInitialText=!1,this.update(I,R,N,!0)}get id(){return this._id}get ownerStyleSheet(){return this._ownerStyleSheet}get type(){return this._type}get inherited(){return this._inherited}get node(){return this._node}get editable(){return!!this._id&&(this._type===WebInspector.CSSStyleDeclaration.Type.Rule?this._ownerRule&&this._ownerRule.editable:!(this._type!==WebInspector.CSSStyleDeclaration.Type.Inline)&&!this._node.isInUserAgentShadowTree())}update(_,S,C,f){function T(){this.dispatchEventToListeners(WebInspector.CSSStyleDeclaration.Event.PropertiesChanged,{addedProperties:P,removedProperties:D})}_=_||"",S=S||[];var E=this._properties||[],I=this._text;this._text=_,this._properties=S,this._styleSheetTextRange=C,this._propertyNameMap={},delete this._visibleProperties;for(var R=this.editable,N=0,L;N{return S?void _(null):void(this._domNode=WebInspector.domTreeManager.nodeForId(C),_(this._domNode))}))}requestContent(_){CanvasAgent.requestContent(this._identifier,(S,C)=>{return S?void _(null):void _(C)})}requestCSSCanvasClientNodes(_){return this._cssCanvasName?this._cssCanvasClientNodes?void _(this._cssCanvasClientNodes):void(WebInspector.domTreeManager.ensureDocument(),CanvasAgent.requestCSSCanvasClientNodes(this._identifier,(S,C)=>{return S?void _([]):void(C=Array.isArray(C)?C:[],this._cssCanvasClientNodes=C.map(f=>WebInspector.domTreeManager.nodeForId(f)),_(this._cssCanvasClientNodes))})):void _([])}saveIdentityToCookie(_){_[WebInspector.Canvas.FrameURLCookieKey]=this._frame.url.hash,this._cssCanvasName?_[WebInspector.Canvas.CSSCanvasNameCookieKey]=this._cssCanvasName:this._domNode&&(_[WebInspector.Canvas.NodePathCookieKey]=this._domNode.path)}cssCanvasClientNodesChanged(){this._cssCanvasName&&(this._cssCanvasClientNodes=null,this.dispatchEventToListeners(WebInspector.Canvas.Event.CSSCanvasClientNodesChanged))}},WebInspector.Canvas._nextUniqueDisplayNameNumber=1,WebInspector.Canvas.FrameURLCookieKey="canvas-frame-url",WebInspector.Canvas.CSSCanvasNameCookieKey="canvas-css-canvas-name",WebInspector.Canvas.ContextType={Canvas2D:"canvas-2d",WebGL:"webgl",WebGL2:"webgl2",WebGPU:"webgpu"},WebInspector.Canvas.ResourceSidebarType="resource-type-canvas",WebInspector.Canvas.Event={MemoryChanged:"canvas-memory-changed",CSSCanvasClientNodesChanged:"canvas-css-canvas-client-nodes-changed"},WebInspector.Collection=class extends WebInspector.Object{constructor(_){super(),this._items=new Set,this._typeVerifier=_||WebInspector.Collection.TypeVerifier.Any}get items(){return this._items}get typeVerifier(){return this._typeVerifier}add(_){let S=this._typeVerifier(_);S&&(this._items.add(_),this.itemAdded(_),this.dispatchEventToListeners(WebInspector.Collection.Event.ItemAdded,{item:_}))}remove(_){this._items.delete(_);this.itemRemoved(_),this.dispatchEventToListeners(WebInspector.Collection.Event.ItemRemoved,{item:_})}clear(){let _=new Set(this._items);this._items.clear(),this.itemsCleared(_);for(let S of _)this.dispatchEventToListeners(WebInspector.Collection.Event.ItemRemoved,{item:S})}toArray(){return Array.from(this._items)}toJSON(){return this.toArray()}itemAdded(){}itemRemoved(){}itemsCleared(){}},WebInspector.Collection.Event={ItemAdded:"collection-item-added",ItemRemoved:"collection-item-removed"},WebInspector.Collection.TypeVerifier={Any:()=>!0,ContentFlow:u=>u instanceof WebInspector.ContentFlow,Frame:u=>u instanceof WebInspector.Frame,Resource:u=>u instanceof WebInspector.Resource,Script:u=>u instanceof WebInspector.Script,CSSStyleSheet:u=>u instanceof WebInspector.CSSStyleSheet,Canvas:u=>u instanceof WebInspector.Canvas},WebInspector.CollectionEntry=class extends WebInspector.Object{constructor(_,S){super(),this._key=_,this._value=S}static fromPayload(_,S){return _.key&&(_.key=WebInspector.RemoteObject.fromPayload(_.key,S)),_.value&&(_.value=WebInspector.RemoteObject.fromPayload(_.value,S)),new WebInspector.CollectionEntry(_.key,_.value)}get key(){return this._key}get value(){return this._value}},WebInspector.CollectionEntryPreview=class extends WebInspector.Object{constructor(_,S){super(),this._key=_,this._value=S}static fromPayload(_){return _.key&&(_.key=WebInspector.ObjectPreview.fromPayload(_.key)),_.value&&(_.value=WebInspector.ObjectPreview.fromPayload(_.value)),new WebInspector.CollectionEntryPreview(_.key,_.value)}get keyPreview(){return this._key}get valuePreview(){return this._value}},WebInspector.Color=class{constructor(_,S){this.format=_,_===WebInspector.Color.Format.HSL||_===WebInspector.Color.Format.HSLA?this._hsla=S:this._rgba=S,this.valid=!S.some(isNaN)}static fromString(_){let S=_.toLowerCase().replace(/%|\s+/g,"");if(["transparent","rgba(0,0,0,0)","hsla(0,0,0,0)"].includes(S)){let I=new WebInspector.Color(WebInspector.Color.Format.Keyword,[0,0,0,0]);return I.keyword="transparent",I.original=_,I}let f=/^(?:#([0-9a-f]{3,8})|rgb\(([^)]+)\)|(\w+)|hsl\(([^)]+)\))$/i,T=_.match(f);if(T){if(T[1]){let I=T[1].toUpperCase(),R=I.length;return 3===R?new WebInspector.Color(WebInspector.Color.Format.ShortHEX,[parseInt(I.charAt(0)+I.charAt(0),16),parseInt(I.charAt(1)+I.charAt(1),16),parseInt(I.charAt(2)+I.charAt(2),16),1]):6===R?new WebInspector.Color(WebInspector.Color.Format.HEX,[parseInt(I.substring(0,2),16),parseInt(I.substring(2,4),16),parseInt(I.substring(4,6),16),1]):4===R?new WebInspector.Color(WebInspector.Color.Format.ShortHEXAlpha,[parseInt(I.charAt(0)+I.charAt(0),16),parseInt(I.charAt(1)+I.charAt(1),16),parseInt(I.charAt(2)+I.charAt(2),16),parseInt(I.charAt(3)+I.charAt(3),16)/255]):8===R?new WebInspector.Color(WebInspector.Color.Format.HEXAlpha,[parseInt(I.substring(0,2),16),parseInt(I.substring(2,4),16),parseInt(I.substring(4,6),16),parseInt(I.substring(6,8),16)/255]):null}if(T[2]){let I=T[2].split(/\s*,\s*/);return 3===I.length?new WebInspector.Color(WebInspector.Color.Format.RGB,[parseInt(I[0]),parseInt(I[1]),parseInt(I[2]),1]):null}if(T[3]){let I=T[3].toLowerCase();if(!WebInspector.Color.Keywords.hasOwnProperty(I))return null;let R=new WebInspector.Color(WebInspector.Color.Format.Keyword,WebInspector.Color.Keywords[I].concat(1));return R.keyword=I,R.original=_,R}if(T[4]){let I=T[4].replace(/%/g,"").split(/\s*,\s*/);return 3===I.length?new WebInspector.Color(WebInspector.Color.Format.HSL,[parseInt(I[0]),parseInt(I[1]),parseInt(I[2]),1]):null}}let E=/^(?:rgba\(([^)]+)\)|hsla\(([^)]+)\))$/i;if(T=_.match(E),T){if(T[1]){let I=T[1].split(/\s*,\s*/);return 4===I.length?new WebInspector.Color(WebInspector.Color.Format.RGBA,[parseInt(I[0]),parseInt(I[1]),parseInt(I[2]),Number.constrain(parseFloat(I[3]),0,1)]):null}if(T[2]){let I=T[2].replace(/%/g,"").split(/\s*,\s*/);return 4===I.length?new WebInspector.Color(WebInspector.Color.Format.HSLA,[parseInt(I[0]),parseInt(I[1]),parseInt(I[2]),Number.constrain(parseFloat(I[3]),0,1)]):null}}return null}static rgb2hsv(_,S,C){_/=255,S/=255,C/=255;let f=Math.min(Math.min(_,S),C),T=Math.max(Math.max(_,S),C),E=T-f,I,R;return 0==E?I=0:T===_?I=60*((S-C)/E)%360:T===S?I=60*((C-_)/E)+120:T===C&&(I=60*((_-S)/E)+240),0>I&&(I+=360),R=0===T?0:1-f/T,[I,R,T]}static hsv2rgb(_,S,C){if(0===S)return[C,C,C];_/=60;let f=Math.floor(_),T=[C*(1-S),C*(1-S*(_-f)),C*(1-S*(1-(_-f)))],E;switch(f){case 0:E=[C,T[2],T[0]];break;case 1:E=[T[1],C,T[0]];break;case 2:E=[T[0],C,T[2]];break;case 3:E=[T[0],T[1],C];break;case 4:E=[T[2],T[0],C];break;default:E=[C,T[0],T[1]];}return E}nextFormat(_){return _=_||this.format,_===WebInspector.Color.Format.Original||_===WebInspector.Color.Format.HEX||_===WebInspector.Color.Format.HEXAlpha?this.simple?WebInspector.Color.Format.RGB:WebInspector.Color.Format.RGBA:_===WebInspector.Color.Format.RGB||_===WebInspector.Color.Format.RGBA?this.simple?WebInspector.Color.Format.HSL:WebInspector.Color.Format.HSLA:_===WebInspector.Color.Format.HSL||_===WebInspector.Color.Format.HSLA?this.isKeyword()?WebInspector.Color.Format.Keyword:this.simple?this.canBeSerializedAsShortHEX()?WebInspector.Color.Format.ShortHEX:WebInspector.Color.Format.HEX:this.canBeSerializedAsShortHEX()?WebInspector.Color.Format.ShortHEXAlpha:WebInspector.Color.Format.HEXAlpha:_===WebInspector.Color.Format.ShortHEX?WebInspector.Color.Format.HEX:_===WebInspector.Color.Format.ShortHEXAlpha?WebInspector.Color.Format.HEXAlpha:_===WebInspector.Color.Format.Keyword?this.simple?this.canBeSerializedAsShortHEX()?WebInspector.Color.Format.ShortHEX:WebInspector.Color.Format.HEX:this.canBeSerializedAsShortHEX()?WebInspector.Color.Format.ShortHEXAlpha:WebInspector.Color.Format.HEXAlpha:(console.error("Unknown color format."),null)}get alpha(){return this._rgba?this._rgba[3]:this._hsla[3]}get simple(){return 1===this.alpha}get rgb(){let _=this.rgba.slice();return _.pop(),_}get hsl(){let _=this.hsla.slice();return _.pop(),_}get rgba(){return this._rgba||(this._rgba=this._hslaToRGBA(this._hsla)),this._rgba}get hsla(){return this._hsla||(this._hsla=this._rgbaToHSLA(this.rgba)),this._hsla}copy(){switch(this.format){case WebInspector.Color.Format.RGB:case WebInspector.Color.Format.HEX:case WebInspector.Color.Format.ShortHEX:case WebInspector.Color.Format.HEXAlpha:case WebInspector.Color.Format.ShortHEXAlpha:case WebInspector.Color.Format.Keyword:case WebInspector.Color.Format.RGBA:return new WebInspector.Color(this.format,this.rgba);case WebInspector.Color.Format.HSL:case WebInspector.Color.Format.HSLA:return new WebInspector.Color(this.format,this.hsla);}}toString(_){switch(_||(_=this.format),_){case WebInspector.Color.Format.Original:return this._toOriginalString();case WebInspector.Color.Format.RGB:return this._toRGBString();case WebInspector.Color.Format.RGBA:return this._toRGBAString();case WebInspector.Color.Format.HSL:return this._toHSLString();case WebInspector.Color.Format.HSLA:return this._toHSLAString();case WebInspector.Color.Format.HEX:return this._toHEXString();case WebInspector.Color.Format.ShortHEX:return this._toShortHEXString();case WebInspector.Color.Format.HEXAlpha:return this._toHEXAlphaString();case WebInspector.Color.Format.ShortHEXAlpha:return this._toShortHEXAlphaString();case WebInspector.Color.Format.Keyword:return this._toKeywordString();}throw"invalid color format"}isKeyword(){if(this.keyword)return!0;if(!this.simple)return Array.shallowEqual(this._rgba,[0,0,0,0])||Array.shallowEqual(this._hsla,[0,0,0,0]);let _=this._rgba&&this._rgba.slice(0,3)||this._hslToRGB(this._hsla);return Object.keys(WebInspector.Color.Keywords).some(S=>Array.shallowEqual(WebInspector.Color.Keywords[S],_))}canBeSerializedAsShortHEX(){let _=this.rgba||this._hslaToRGBA(this._hsla),S=this._componentToHexValue(_[0]);if(S[0]!==S[1])return!1;let C=this._componentToHexValue(_[1]);if(C[0]!==C[1])return!1;let f=this._componentToHexValue(_[2]);if(f[0]!==f[1])return!1;if(!this.simple){let T=this._componentToHexValue(Math.round(255*_[3]));if(T[0]!==T[1])return!1}return!0}_toOriginalString(){return this.original||this._toKeywordString()}_toKeywordString(){if(this.keyword)return this.keyword;let _=this.rgba;if(!this.simple)return 0===_[0]&&0===_[1]&&0===_[2]&&0===_[3]?"transparent":this._toRGBAString();let S=WebInspector.Color.Keywords;for(let C in S)if(S.hasOwnProperty(C)){let U=S[C];if(U[0]===_[0]&&U[1]===_[1]&&U[2]===_[2])return C}return this._toRGBString()}_toShortHEXString(){if(!this.simple)return this._toRGBAString();let _=this.rgba,S=this._componentToHexValue(_[0]),C=this._componentToHexValue(_[1]),f=this._componentToHexValue(_[2]);return S[0]===S[1]&&C[0]===C[1]&&f[0]===f[1]?"#"+S[0]+C[0]+f[0]:"#"+S+C+f}_toHEXString(){if(!this.simple)return this._toRGBAString();let _=this.rgba,S=this._componentToHexValue(_[0]),C=this._componentToHexValue(_[1]),f=this._componentToHexValue(_[2]);return"#"+S+C+f}_toShortHEXAlphaString(){let _=this.rgba,S=this._componentToHexValue(_[0]),C=this._componentToHexValue(_[1]),f=this._componentToHexValue(_[2]),T=this._componentToHexValue(Math.round(255*_[3]));return S[0]===S[1]&&C[0]===C[1]&&f[0]===f[1]&&T[0]===T[1]?"#"+S[0]+C[0]+f[0]+T[0]:"#"+S+C+f+T}_toHEXAlphaString(){let _=this.rgba,S=this._componentToHexValue(_[0]),C=this._componentToHexValue(_[1]),f=this._componentToHexValue(_[2]),T=this._componentToHexValue(Math.round(255*_[3]));return"#"+S+C+f+T}_toRGBString(){if(!this.simple)return this._toRGBAString();let _=this.rgba.slice(0,-1);return _=_.map(S=>S.maxDecimals(2)),"rgb("+_.join(", ")+")"}_toRGBAString(){let _=this.rgba;return _=_.map(S=>S.maxDecimals(2)),"rgba("+_.join(", ")+")"}_toHSLString(){if(!this.simple)return this._toHSLAString();let _=this.hsla;return _=_.map(S=>S.maxDecimals(2)),"hsl("+_[0]+", "+_[1]+"%, "+_[2]+"%)"}_toHSLAString(){let _=this.hsla;return _=_.map(S=>S.maxDecimals(2)),"hsla("+_[0]+", "+_[1]+"%, "+_[2]+"%, "+_[3]+")"}_componentToNumber(_){return Number.constrain(_,0,255)}_componentToHexValue(_){let S=this._componentToNumber(_).toString(16);return 1===S.length&&(S="0"+S),S}_rgbToHSL(_){let S=this._componentToNumber(_[0])/255,C=this._componentToNumber(_[1])/255,f=this._componentToNumber(_[2])/255,T=Math.max(S,C,f),E=Math.min(S,C,f),I=T-E,R=T+E,D=0.5*R,N,L;return N=E===T?0:S===T?(60*(C-f)/I+360)%360:C===T?60*(f-S)/I+120:60*(S-C)/I+240,L=0==D?0:1==D?1:0.5>=D?I/R:I/(2-R),[Math.round(N),Math.round(100*L),Math.round(100*D)]}_hslToRGB(_){let S=parseFloat(_[0])/360,C=parseFloat(_[1])/100,f=parseFloat(_[2])/100;S*=6;let T=[f+=C*=.5>f?f:1-f,f-2*(S%1*C),f-=C*=2,f,f+S%1*C,f+C];return[Math.round(255*T[~~S%6]),Math.round(255*T[(16|S)%6]),Math.round(255*T[(8|S)%6])]}_rgbaToHSLA(_){let S=this._rgbToHSL(_);return S.push(_[3]),S}_hslaToRGBA(_){let S=this._hslToRGB(_);return S.push(_[3]),S}},WebInspector.Color.Format={Original:"color-format-original",Keyword:"color-format-keyword",HEX:"color-format-hex",ShortHEX:"color-format-short-hex",HEXAlpha:"color-format-hex-alpha",ShortHEXAlpha:"color-format-short-hex-alpha",RGB:"color-format-rgb",RGBA:"color-format-rgba",HSL:"color-format-hsl",HSLA:"color-format-hsla"},WebInspector.Color.Keywords={aliceblue:[240,248,255],antiquewhite:[250,235,215],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,164,61],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],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],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],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],lightgray:[211,211,211],lightgreen:[144,238,144],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]},WebInspector.ConsoleCommandResultMessage=class extends WebInspector.ConsoleMessage{constructor(_,S,C,f,T=!0){let E=WebInspector.ConsoleMessage.MessageSource.JS,I=C?WebInspector.ConsoleMessage.MessageLevel.Error:WebInspector.ConsoleMessage.MessageLevel.Log,R=WebInspector.ConsoleMessage.MessageType.Result;super(_,E,I,"",R,void 0,void 0,void 0,0,[S],void 0,void 0),this._savedResultIndex=f,this._shouldRevealConsole=T,this._savedResultIndex&&this._savedResultIndex>WebInspector.ConsoleCommandResultMessage.maximumSavedResultIndex&&(WebInspector.ConsoleCommandResultMessage.maximumSavedResultIndex=this._savedResultIndex)}static clearMaximumSavedResultIndex(){WebInspector.ConsoleCommandResultMessage.maximumSavedResultIndex=0}get savedResultIndex(){return this._savedResultIndex}get shouldRevealConsole(){return this._shouldRevealConsole}},WebInspector.ConsoleCommandResultMessage.maximumSavedResultIndex=0,WebInspector.ContentFlow=class extends WebInspector.Object{constructor(_,S,C,f){super(),this._documentNodeIdentifier=_,this._name=S,this._overset=C,this._contentNodes=f}get id(){return this._documentNodeIdentifier+":"+this._name}get documentNodeIdentifier(){return this._documentNodeIdentifier}get name(){return this._name}get overset(){return this._overset}set overset(_){this._overset===_||(this._overset=_,this.dispatchEventToListeners(WebInspector.ContentFlow.Event.FlowOversetWasChanged))}get contentNodes(){return this._contentNodes}insertContentNodeBefore(_,S){var C=this._contentNodes.indexOf(S);this._contentNodes.splice(C,0,_),this.dispatchEventToListeners(WebInspector.ContentFlow.Event.ContentNodeWasAdded,{node:_,before:S})}appendContentNode(_){this._contentNodes.push(_),this.dispatchEventToListeners(WebInspector.ContentFlow.Event.ContentNodeWasAdded,{node:_})}removeContentNode(_){var S=this._contentNodes.indexOf(_);this._contentNodes.splice(S,1),this.dispatchEventToListeners(WebInspector.ContentFlow.Event.ContentNodeWasRemoved,{node:_})}},WebInspector.ContentFlow.Event={OversetWasChanged:"content-flow-overset-was-changed",ContentNodeWasAdded:"content-flow-content-node-was-added",ContentNodeWasRemoved:"content-flow-content-node-was-removed"},WebInspector.CookieStorageObject=class{constructor(_){this._host=_}static cookieMatchesResourceURL(_,S){var C=parseURL(S);return C&&WebInspector.CookieStorageObject.cookieDomainMatchesResourceDomain(_.domain,C.host)&&C.path.startsWith(_.path)&&(!_.port||C.port===_.port)&&(!_.secure||"https"===C.scheme)}static cookieDomainMatchesResourceDomain(_,S){return"."===_.charAt(0)?!!S.match(new RegExp("^(?:[^\\.]+\\.)*"+_.substring(1).escapeForRegExp()+"$"),"i"):S===_}get host(){return this._host}saveIdentityToCookie(_){_[WebInspector.CookieStorageObject.CookieHostCookieKey]=this.host}},WebInspector.CookieStorageObject.TypeIdentifier="cookie-storage",WebInspector.CookieStorageObject.CookieHostCookieKey="cookie-storage-host",WebInspector.DOMBreakpoint=class extends WebInspector.Object{constructor(_,S,C){super(),_ instanceof WebInspector.DOMNode?(this._domNodeIdentifier=_.id,this._path=_.path(),this._url=WebInspector.frameResourceManager.mainFrame.url):_&&"object"==typeof _&&(this._domNodeIdentifier=null,this._path=_.path,this._url=_.url),this._type=S,this._disabled=C||!1}get type(){return this._type}get url(){return this._url}get path(){return this._path}get disabled(){return this._disabled}set disabled(_){this._disabled===_||(this._disabled=_,this.dispatchEventToListeners(WebInspector.DOMBreakpoint.Event.DisabledStateDidChange))}get domNodeIdentifier(){return this._domNodeIdentifier}set domNodeIdentifier(_){if(this._domNodeIdentifier!==_){let S={};_||(S.oldNodeIdentifier=this._domNodeIdentifier),this._domNodeIdentifier=_,this.dispatchEventToListeners(WebInspector.DOMBreakpoint.Event.ResolvedStateDidChange,S)}}get serializableInfo(){let _={url:this._url,path:this._path,type:this._type};return this._disabled&&(_.disabled=!0),_}saveIdentityToCookie(_){_[WebInspector.DOMBreakpoint.DocumentURLCookieKey]=this.url,_[WebInspector.DOMBreakpoint.NodePathCookieKey]=this.path,_[WebInspector.DOMBreakpoint.TypeCookieKey]=this.type}},WebInspector.DOMBreakpoint.DocumentURLCookieKey="dom-breakpoint-document-url",WebInspector.DOMBreakpoint.NodePathCookieKey="dom-breakpoint-node-path",WebInspector.DOMBreakpoint.TypeCookieKey="dom-breakpoint-type",WebInspector.DOMBreakpoint.Type={SubtreeModified:"subtree-modified",AttributeModified:"attribute-modified",NodeRemoved:"node-removed"},WebInspector.DOMBreakpoint.Event={DisabledStateDidChange:"dom-breakpoint-disabled-state-did-change",ResolvedStateDidChange:"dom-breakpoint-resolved-state-did-change"},WebInspector.DOMNode=class extends WebInspector.Object{constructor(_,S,C,f){if(super(),this._domTreeManager=_,this._isInShadowTree=C,this.id=f.nodeId,this._domTreeManager._idToDOMNode[this.id]=this,this._nodeType=f.nodeType,this._nodeName=f.nodeName,this._localName=f.localName,this._nodeValue=f.nodeValue,this._pseudoType=f.pseudoType,this._shadowRootType=f.shadowRootType,this._computedRole=f.role,this._contentSecurityPolicyHash=f.contentSecurityPolicyHash,this.ownerDocument=this._nodeType===Node.DOCUMENT_NODE?this:S,this._attributes=[],this._attributesMap=new Map,f.attributes&&this._setAttributesPayload(f.attributes),this._childNodeCount=f.childNodeCount,this._children=null,this._filteredChildren=null,this._filteredChildrenNeedsUpdating=!0,this._nextSibling=null,this._previousSibling=null,this.parentNode=null,this._enabledPseudoClasses=[],this._shadowRoots=[],f.shadowRoots)for(var T=0;T{return!f.length||S.has(f)?C:(S.add(f),`${C}.${CSS.escape(f)}`)},"")}get displayName(){return this.nodeNameInCorrectCase()+this.escapedIdSelector+this.escapedClassSelector}appropriateSelectorFor(_){if(this.isPseudoElement())return this.parentNode.appropriateSelectorFor()+"::"+this._pseudoType;let S=this.localName()||this.nodeName().toLowerCase(),C=this.escapedIdSelector;if(C.length)return _?C:S+C;let f=this.escapedClassSelector;return f.length?_?f:S+f:"input"===S&&this.getAttribute("type")?S+"[type=\""+this.getAttribute("type")+"\"]":S}isAncestor(_){if(!_)return!1;for(var S=_.parentNode;S;){if(this===S)return!0;S=S.parentNode}return!1}isDescendant(_){return null!==_&&_.isAncestor(this)}get ownerSVGElement(){return"svg"===this._nodeName?this:this.parentNode?this.parentNode.ownerSVGElement:null}isSVGElement(){return!!this.ownerSVGElement}_setAttributesPayload(_){this._attributes=[],this._attributesMap=new Map;for(var S=0;S<_.length;S+=2)this._addAttribute(_[S],_[S+1])}_insertChild(_,S){var C=new WebInspector.DOMNode(this._domTreeManager,this.ownerDocument,this._isInShadowTree,S);return _?this._children.splice(this._children.indexOf(_)+1,0,C):this._children?this._children.unshift(C):this._children=this._shadowRoots.concat([C]),this._renumber(),C}_removeChild(_){_.isPseudoElement()?(this._pseudoElements.delete(_.pseudoType()),_.parentNode=null):(this._children.splice(this._children.indexOf(_),1),_.parentNode=null,this._renumber())}_setChildrenPayload(_){if(!this._contentDocument){this._children=this._shadowRoots.slice();for(var S=0,C;S<_.length;++S)C=new WebInspector.DOMNode(this._domTreeManager,this.ownerDocument,this._isInShadowTree,_[S]),this._children.push(C);this._renumber()}}_renumber(){this._filteredChildrenNeedsUpdating=!0;var _=this._children.length;if(0!==_)for(var S=0,C;S<_;++S)C=this._children[S],C.index=S,C._nextSibling=S+1<_?this._children[S+1]:null,C._previousSibling=0<=S-1?this._children[S-1]:null,C.parentNode=this}_addAttribute(_,S){let C={name:_,value:S,_node:this};this._attributesMap.set(_,C),this._attributes.push(C)}_setAttribute(_,S){let C=this._attributesMap.get(_);C?C.value=S:this._addAttribute(_,S)}_removeAttribute(_){let S=this._attributesMap.get(_);S&&(this._attributes.remove(S),this._attributesMap.delete(_))}moveTo(_,S,C){DOMAgent.moveTo(this.id,_.id,S?S.id:void 0,this._makeUndoableCallback(C))}isXMLNode(){return!!this.ownerDocument&&!!this.ownerDocument.xmlVersion}get enabledPseudoClasses(){return this._enabledPseudoClasses}setPseudoClassEnabled(_,S){var f=this._enabledPseudoClasses;if(S){if(f.includes(_))return;f.push(_)}else{if(!f.includes(_))return;f.remove(_)}CSSAgent.forcePseudoState(this.id,f,function(T){T||this.dispatchEventToListeners(WebInspector.DOMNode.Event.EnabledPseudoClassesChanged)}.bind(this))}_makeUndoableCallback(_){return function(S){S||DOMAgent.markUndoableState(),_&&_.apply(null,arguments)}}},WebInspector.DOMNode.Event={EnabledPseudoClassesChanged:"dom-node-enabled-pseudo-classes-did-change",AttributeModified:"dom-node-attribute-modified",AttributeRemoved:"dom-node-attribute-removed"},WebInspector.DOMNode.PseudoElementType={Before:"before",After:"after"},WebInspector.DOMNode.ShadowRootType={UserAgent:"user-agent",Closed:"closed",Open:"open"},WebInspector.DOMNode.CustomElementState={Builtin:"builtin",Custom:"custom",Waiting:"waiting",Failed:"failed"},WebInspector.DOMNodeStyles=class extends WebInspector.Object{constructor(_){super(),this._node=_||null,this._rulesMap={},this._styleDeclarationsMap={},this._matchedRules=[],this._inheritedRules=[],this._pseudoElements={},this._inlineStyle=null,this._attributesStyle=null,this._computedStyle=null,this._orderedStyles=[],this._propertyNameToEffectivePropertyMap={},this._pendingRefreshTask=null,this.refresh()}get node(){return this._node}get needsRefresh(){return this._pendingRefreshTask||this._needsRefresh}refreshIfNeeded(){this._needsRefresh&&this.refresh()}refresh(){function _(N,L){return(...D)=>{try{N.apply(this,D)}catch(M){console.error(M),L.resolve()}}}function S(N,L,D){for(var M=[],P={},O=N.length-1,F;0<=O;--O)F=this._parseRulePayload(N[O].rule,N[O].matchingSelectors,L,D,P),F&&M.push(F);return M}if(this._pendingRefreshTask)return this._pendingRefreshTask;this._needsRefresh=!1;let E=new WebInspector.WrappedPromise,I=new WebInspector.WrappedPromise,R=new WebInspector.WrappedPromise;return WebInspector.cssStyleManager.fetchStyleSheetsIfNeeded(),CSSAgent.getMatchedStylesForNode.invoke({nodeId:this._node.id,includePseudo:!0,includeInherited:!0},_.call(this,function(N,L,D,M){L=L||[],D=D||[],M=M||[],this._previousRulesMap=this._rulesMap,this._previousStyleDeclarationsMap=this._styleDeclarationsMap,this._rulesMap={},this._styleDeclarationsMap={},this._matchedRules=S.call(this,L,this._node),this._pseudoElements={};for(var P of D){var O=S.call(this,P.matches,this._node);this._pseudoElements[P.pseudoId]={matchedRules:O}}this._inheritedRules=[];for(var F=0,V=this._node.parentNode;V&&F{this._pendingRefreshTask=null}),this._pendingRefreshTask}addRule(_,S,C){function f(){DOMAgent.markUndoableState(),this.refresh()}function T(R){R||f.call(this)}function E(R,N){return R?void 0:S&&S.length?void CSSAgent.setStyleText(N.style.styleId,S,T.bind(this)):void f.call(this)}function I(R){R&&CSSAgent.addRule(R.id,_,E.bind(this))}return _=_||this._node.appropriateSelectorFor(!0),CSSAgent.createStyleSheet?void(C?I.call(this,WebInspector.cssStyleManager.styleSheetForIdentifier(C)):WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(this._node.frame,I.bind(this))):void CSSAgent.addRule.invoke({contextNodeId:this._node.id,selector:_},E.bind(this))}rulesForSelector(_){function S(f){return!f.mediaList.length&&f.selectorText===_}_=_||this._node.appropriateSelectorFor(!0);let C=this._matchedRules.filter(S);for(let f in this._pseudoElements)C=C.concat(this._pseudoElements[f].matchedRules.filter(S));return C}get matchedRules(){return this._matchedRules}get inheritedRules(){return this._inheritedRules}get inlineStyle(){return this._inlineStyle}get attributesStyle(){return this._attributesStyle}get pseudoElements(){return this._pseudoElements}get computedStyle(){return this._computedStyle}get orderedStyles(){return this._orderedStyles}effectivePropertyForName(_){let S=this._propertyNameToEffectivePropertyMap[_];if(S)return S;let C=WebInspector.cssStyleManager.canonicalNameForPropertyName(_);return this._propertyNameToEffectivePropertyMap[C]||null}mediaQueryResultDidChange(){this._markAsNeedsRefresh()}pseudoClassesDidChange(){this._includeUserAgentRulesOnNextRefresh=!0,this._markAsNeedsRefresh()}attributeDidChange(){this._markAsNeedsRefresh()}changeRule(_,S,C){function f(){DOMAgent.markUndoableState(),this.refresh()}function T(R){R||f.call(this)}function E(R){return C&&C.length?void CSSAgent.setStyleText(R,C,T.bind(this)):void f.call(this)}_&&(S=S||"",this._needsRefresh=!0,this._ignoreNextContentDidChangeForStyleSheet=_.ownerStyleSheet,CSSAgent.setRuleSelector(_.id,S,function(R,N){R||E.call(this,N.style.styleId)}.bind(this)))}changeRuleSelector(_,S){S=S||"";let f=new WebInspector.WrappedPromise;return this._needsRefresh=!0,this._ignoreNextContentDidChangeForStyleSheet=_.ownerStyleSheet,CSSAgent.setRuleSelector(_.id,S,function(T,E){return T?void f.reject(T):void(DOMAgent.markUndoableState(),this.refresh().then(()=>{f.resolve(E)}))}.bind(this)),f.promise}changeStyleText(_,S){_.ownerStyleSheet&&_.styleSheetTextRange&&(S=S||"",CSSAgent.setStyleText(_.id,S,function(f){f||this.refresh()}.bind(this)))}_createSourceCodeLocation(_,S,C){if(!_)return null;var f;if(this._node.ownerDocument){var T=WebInspector.frameResourceManager.resourceForURL(this._node.ownerDocument.documentURL);if(T){var E=T.parentFrame;f=E.resourceForURL(_)}}return f||(f=WebInspector.frameResourceManager.resourceForURL(_)),f?f.createSourceCodeLocation(S||0,C||0):null}_parseSourceRangePayload(_){return _?new WebInspector.TextRange(_.startLine,_.startColumn,_.endLine,_.endColumn):null}_parseStylePropertyPayload(_,S,C){var T=_.text||"",E=_.name,I=(_.value||"").replace(/\s*!important\s*$/,""),R=_.priority||"",N=!0,L=!1,D=_.implicit||!1,M=!1,P=!("parsedOk"in _)||_.parsedOk;switch(_.status||"style"){case"active":N=!0;break;case"inactive":L=!0,N=!0;break;case"disabled":N=!1;break;case"style":M=!0;}var O=this._parseSourceRangePayload(_.range);if(C){var F=isNaN(S)?C.propertyForName(E,!0):C.properties[S];if(F&&F.name===E&&(F.index===S||isNaN(F.index)&&isNaN(S)))return F.update(T,E,I,R,N,L,D,M,P,O),F;for(var V=C.pendingProperties,U=0,G;U{return S.properties.some(C=>C.name===_)})}},WebInspector.DOMNodeStyles.Event={NeedsRefresh:"dom-node-styles-needs-refresh",Refreshed:"dom-node-styles-refreshed"},WebInspector.DOMSearchMatchObject=class extends WebInspector.Object{constructor(_,S,C,f,T){super(),this._resource=_,this._domNode=S,this._title=C,this._searchTerm=f,this._sourceCodeTextRange=_.createSourceCodeTextRange(T)}static titleForDOMNode(_){switch(_.nodeType()){case Node.ELEMENT_NODE:var S="<"+_.nodeNameInCorrectCase();for(var C of _.attributes())S+=" "+C.name,C.value.length&&(S+="=\""+C.value+"\"");return S+">";case Node.TEXT_NODE:return"\""+_.nodeValue()+"\"";case Node.COMMENT_NODE:return"";case Node.DOCUMENT_TYPE_NODE:var S="";case Node.CDATA_SECTION_NODE:return"";case Node.PROCESSING_INSTRUCTION_NODE:var f=_.nodeValue(),T=f.length?" "+f:"",S="";return S;default:return console.error("Unknown DOM node type: ",_.nodeType()),_.nodeNameInCorrectCase();}}get resource(){return this._resource}get domNode(){return this._domNode}get title(){return this._title}get className(){return this._className||(this._className=this._generateClassName()),this._className}get searchTerm(){return this._searchTerm}get sourceCodeTextRange(){return this._sourceCodeTextRange}saveIdentityToCookie(_){_[WebInspector.DOMSearchMatchObject.URLCookieKey]=this._resource.url.hash,_[WebInspector.DOMSearchMatchObject.TitleKey]=this._title;var S=this._sourceCodeTextRange.textRange;_[WebInspector.DOMSearchMatchObject.TextRangeKey]=[S.startLine,S.startColumn,S.endLine,S.endColumn].join()}_generateClassName(){switch(this._domNode.nodeType()){case Node.ELEMENT_NODE:return WebInspector.DOMSearchMatchObject.DOMMatchElementIconStyleClassName;case Node.TEXT_NODE:return WebInspector.DOMSearchMatchObject.DOMMatchTextNodeIconStyleClassName;case Node.COMMENT_NODE:return WebInspector.DOMSearchMatchObject.DOMMatchCommentIconStyleClassName;case Node.DOCUMENT_TYPE_NODE:return WebInspector.DOMSearchMatchObject.DOMMatchDocumentTypeIconStyleClassName;case Node.CDATA_SECTION_NODE:return WebInspector.DOMSearchMatchObject.DOMMatchCharacterDataIconStyleClassName;case Node.PROCESSING_INSTRUCTION_NODE:return WebInspector.DOMSearchMatchObject.DOMMatchDocumentTypeIconStyleClassName;default:return console.error("Unknown DOM node type: ",this._domNode.nodeType()),WebInspector.DOMSearchMatchObject.DOMMatchNodeIconStyleClassName;}}},WebInspector.DOMSearchMatchObject.DOMMatchElementIconStyleClassName="dom-match-element-icon",WebInspector.DOMSearchMatchObject.DOMMatchTextNodeIconStyleClassName="dom-match-text-node-icon",WebInspector.DOMSearchMatchObject.DOMMatchCommentIconStyleClassName="dom-match-comment-icon",WebInspector.DOMSearchMatchObject.DOMMatchDocumentTypeIconStyleClassName="dom-match-document-type-icon",WebInspector.DOMSearchMatchObject.DOMMatchCharacterDataIconStyleClassName="dom-match-character-data-icon",WebInspector.DOMSearchMatchObject.DOMMatchNodeIconStyleClassName="dom-match-node-icon",WebInspector.DOMSearchMatchObject.TypeIdentifier="dom-search-match-object",WebInspector.DOMSearchMatchObject.URLCookieKey="resource-url",WebInspector.DOMSearchMatchObject.TitleKey="title",WebInspector.DOMSearchMatchObject.TextRangeKey="text-range",WebInspector.DOMStorageObject=class extends WebInspector.Object{constructor(_,S,C){super(),this._id=_,this._host=S,this._isLocalStorage=C,this._entries=new Map}get id(){return this._id}get host(){return this._host}get entries(){return this._entries}saveIdentityToCookie(_){_[WebInspector.DOMStorageObject.HostCookieKey]=this.host,_[WebInspector.DOMStorageObject.LocalStorageCookieKey]=this.isLocalStorage()}isLocalStorage(){return this._isLocalStorage}getEntries(_){DOMStorageAgent.getDOMStorageItems(this._id,function(C,f){if(!C){for(let[T,E]of f)T&&E&&this._entries.set(T,E);_(C,f)}}.bind(this))}removeItem(_){DOMStorageAgent.removeDOMStorageItem(this._id,_)}setItem(_,S){DOMStorageAgent.setDOMStorageItem(this._id,_,S)}itemsCleared(){this._entries.clear(),this.dispatchEventToListeners(WebInspector.DOMStorageObject.Event.ItemsCleared)}itemRemoved(_){this._entries.delete(_),this.dispatchEventToListeners(WebInspector.DOMStorageObject.Event.ItemRemoved,{key:_})}itemAdded(_,S){this._entries.set(_,S),this.dispatchEventToListeners(WebInspector.DOMStorageObject.Event.ItemAdded,{key:_,value:S})}itemUpdated(_,S,C){this._entries.set(_,C),this.dispatchEventToListeners(WebInspector.DOMStorageObject.Event.ItemUpdated,{key:_,oldValue:S,value:C})}},WebInspector.DOMStorageObject.TypeIdentifier="dom-storage",WebInspector.DOMStorageObject.HostCookieKey="dom-storage-object-host",WebInspector.DOMStorageObject.LocalStorageCookieKey="dom-storage-object-local-storage",WebInspector.DOMStorageObject.Event={ItemsCleared:"dom-storage-object-items-cleared",ItemAdded:"dom-storage-object-item-added",ItemRemoved:"dom-storage-object-item-removed",ItemUpdated:"dom-storage-object-updated"},WebInspector.DOMTree=class extends WebInspector.Object{constructor(_){super(),this._frame=_,this._rootDOMNode=null,this._requestIdentifier=0,this._contentFlowCollection=new WebInspector.Collection(WebInspector.Collection.TypeVerifier.ContentFlow),this._frame.addEventListener(WebInspector.Frame.Event.PageExecutionContextChanged,this._framePageExecutionContextChanged,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.DocumentUpdated,this._documentUpdated,this),this._frame.isMainFrame()||(WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeRemoved,this._nodeRemoved,this),this._frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange,this._frameMainResourceDidChange,this)),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.ContentFlowListWasUpdated,this._contentFlowListWasUpdated,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.ContentFlowWasAdded,this._contentFlowWasAdded,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.ContentFlowWasRemoved,this._contentFlowWasRemoved,this)}get frame(){return this._frame}get contentFlowCollection(){return this._contentFlowCollection}disconnect(){WebInspector.domTreeManager.removeEventListener(null,null,this),this._frame.removeEventListener(null,null,this)}invalidate(){this._rootDOMNode=null,this._pendingRootDOMNodeRequests=null;this._invalidateTimeoutIdentifier||(this._invalidateTimeoutIdentifier=setTimeout(function(){this._invalidateTimeoutIdentifier=void 0,this.dispatchEventToListeners(WebInspector.DOMTree.Event.RootDOMNodeInvalidated)}.bind(this),0))}requestRootDOMNode(_){return"function"==typeof _?this._rootDOMNode?void _(this._rootDOMNode):this._frame.isMainFrame()||this._frame.pageExecutionContext?this._pendingRootDOMNodeRequests?void this._pendingRootDOMNodeRequests.push(_):void(this._pendingRootDOMNodeRequests=[_],this._requestRootDOMNode()):(this._rootDOMNodeRequestWaitingForExecutionContext=!0,this._pendingRootDOMNodeRequests||(this._pendingRootDOMNodeRequests=[]),void this._pendingRootDOMNodeRequests.push(_)):void 0}requestContentFlowList(){this.requestRootDOMNode(function(_){WebInspector.domTreeManager.getNamedFlowCollection(_.id)})}_requestRootDOMNode(){function _(I,R){if(this._pendingRootDOMNodeRequests&&T===this._requestIdentifier){if(I)return console.error(JSON.stringify(I)),this._rootDOMNode=null,void f.call(this);var N=WebInspector.RemoteObject.fromPayload(R);N.pushNodeToFrontend(S.bind(this,N))}}function S(I,R){if(I.release(),this._pendingRootDOMNodeRequests&&T===this._requestIdentifier)return R?(this._rootDOMNode=WebInspector.domTreeManager.nodeForId(R),this._rootDOMNode?void this._rootDOMNode.getChildNodes(f.bind(this)):void f.call(this)):(this._rootDOMNode=null,void f.call(this))}function f(){if(this._pendingRootDOMNodeRequests&&T===this._requestIdentifier){for(var I=0;IC)return WebInspector.Rect.ZERO_RECT;var f=new WebInspector.Rect;f.origin.x=S,f.size.width=C-S;var T=Math.max(this.minY(),_.minY()),E=Math.min(this.maxY(),_.maxY());return T>E?WebInspector.Rect.ZERO_RECT:(f.origin.y=T,f.size.height=E-T,f)}unionWithRect(_){var S=Math.min(this.minX(),_.minX()),C=Math.min(this.minY(),_.minY()),f=Math.max(this.maxX(),_.maxX())-S,T=Math.max(this.maxY(),_.maxY())-C;return new WebInspector.Rect(S,C,f,T)}round(){return new WebInspector.Rect(Math.floor(this.origin.x),Math.floor(this.origin.y),Math.ceil(this.size.width),Math.ceil(this.size.height))}},WebInspector.Rect.ZERO_RECT=new WebInspector.Rect(0,0,0,0),WebInspector.EdgeInsets=class{constructor(_,S,C,f){1===arguments.length?(this.top=_,this.right=_,this.bottom=_,this.left=_):4===arguments.length&&(this.top=_,this.right=S,this.bottom=C,this.left=f)}equals(_){return this.top===_.top&&this.right===_.right&&this.bottom===_.bottom&&this.left===_.left}copy(){return new WebInspector.EdgeInsets(this.top,this.right,this.bottom,this.left)}},WebInspector.RectEdge={MIN_X:0,MIN_Y:1,MAX_X:2,MAX_Y:3},WebInspector.Quad=class{constructor(_){this.points=[new WebInspector.Point(_[0],_[1]),new WebInspector.Point(_[2],_[3]),new WebInspector.Point(_[4],_[5]),new WebInspector.Point(_[6],_[7])],this.width=Math.round(Math.sqrt(Math.pow(_[0]-_[2],2)+Math.pow(_[1]-_[3],2))),this.height=Math.round(Math.sqrt(Math.pow(_[0]-_[6],2)+Math.pow(_[1]-_[7],2)))}toProtocol(){return[this.points[0].x,this.points[0].y,this.points[1].x,this.points[1].y,this.points[2].x,this.points[2].y,this.points[3].x,this.points[3].y]}},WebInspector.Polygon=class{constructor(_){this.points=_}bounds(){var _=Number.MAX_VALUE,S=Number.MAX_VALUE,C=-Number.MAX_VALUE,f=-Number.MAX_VALUE;for(var T of this.points)_=Math.min(_,T.x),C=Math.max(C,T.x),S=Math.min(S,T.y),f=Math.max(f,T.y);return new WebInspector.Rect(_,S,C-_,f-S)}},WebInspector.CubicBezier=class{constructor(_,S,C,f){this._inPoint=new WebInspector.Point(_,S),this._outPoint=new WebInspector.Point(C,f),this._curveInfo={x:{c:3*_},y:{c:3*S}},this._curveInfo.x.b=3*(C-_)-this._curveInfo.x.c,this._curveInfo.x.a=1-this._curveInfo.x.c-this._curveInfo.x.b,this._curveInfo.y.b=3*(f-S)-this._curveInfo.y.c,this._curveInfo.y.a=1-this._curveInfo.y.c-this._curveInfo.y.b}static fromCoordinates(_){return!_||4>_.length?null:(_=_.map(Number),_.includes(NaN)?null:new WebInspector.CubicBezier(_[0],_[1],_[2],_[3]))}static fromString(_){if(!_||!_.length)return null;var S=_.toLowerCase().replace(/\s/g,"");if(!S.length)return null;if(Object.keys(WebInspector.CubicBezier.keywordValues).includes(S))return WebInspector.CubicBezier.fromCoordinates(WebInspector.CubicBezier.keywordValues[S]);var C=S.match(/^cubic-bezier\(([-\d.]+),([-\d.]+),([-\d.]+),([-\d.]+)\)$/);return C?(C.splice(0,1),WebInspector.CubicBezier.fromCoordinates(C)):null}get inPoint(){return this._inPoint}get outPoint(){return this._outPoint}copy(){return new WebInspector.CubicBezier(this._inPoint.x,this._inPoint.y,this._outPoint.x,this._outPoint.y)}toString(){var _=[this._inPoint.x,this._inPoint.y,this._outPoint.x,this._outPoint.y];for(var S in WebInspector.CubicBezier.keywordValues)if(Array.shallowEqual(WebInspector.CubicBezier.keywordValues[S],_))return S;return"cubic-bezier("+_.join(", ")+")"}solve(_,S){return this._sampleCurveY(this._solveCurveX(_,S))}_sampleCurveX(_){return((this._curveInfo.x.a*_+this._curveInfo.x.b)*_+this._curveInfo.x.c)*_}_sampleCurveY(_){return((this._curveInfo.y.a*_+this._curveInfo.y.b)*_+this._curveInfo.y.c)*_}_sampleCurveDerivativeX(_){return(3*this._curveInfo.x.a*_+2*this._curveInfo.x.b)*_+this._curveInfo.x.c}_solveCurveX(_,S){var C,f,T,E,I,R;for(T=_,R=0;8>R;R++){if(E=this._sampleCurveX(T)-_,Math.abs(E)Math.abs(I))break;T-=E/I}if(C=0,f=1,T=_,Tf)return f;for(;CE?C=T:f=T,T=0.5*(f-C)+C}return T}},WebInspector.CubicBezier.keywordValues={ease:[0.25,0.1,0.25,1],"ease-in":[0.42,0,1,1],"ease-out":[0,0,0.58,1],"ease-in-out":[0.42,0,0.58,1],linear:[0,0,1,1]},WebInspector.Spring=class{constructor(_,S,C,f){this.mass=Math.max(1,_),this.stiffness=Math.max(1,S),this.damping=Math.max(0,C),this.initialVelocity=f}static fromValues(_){return!_||4>_.length?null:(_=_.map(Number),_.includes(NaN)?null:new WebInspector.Spring(..._))}static fromString(_){if(!_||!_.length)return null;let S=_.toLowerCase().trim();if(!S.length)return null;let C=S.match(/^spring\(([\d.]+)\s+([\d.]+)\s+([\d.]+)\s+([-\d.]+)\)$/);return C?WebInspector.Spring.fromValues(C.slice(1)):null}copy(){return new WebInspector.Spring(this.mass,this.stiffness,this.damping,this.initialVelocity)}toString(){return`spring(${this.mass} ${this.stiffness} ${this.damping} ${this.initialVelocity})`}solve(_){let S=Math.sqrt(this.stiffness/this.mass),C=this.damping/(2*Math.sqrt(this.stiffness*this.mass)),f=0,T=1,E=-this.initialVelocity+S;return 1>C&&(f=S*Math.sqrt(1-C*C),T=1,E=(C*S+-this.initialVelocity)/f),_=1>C?Math.exp(-_*C*S)*(T*Math.cos(f*_)+E*Math.sin(f*_)):(T+E*_)*Math.exp(-_*S),1-_}calculateDuration(_){_=_||1e-4;let S=0,C=0,f=Number.POSITIVE_INFINITY;for(;C>=_||f>=_;)C=Math.abs(1-this.solve(S)),f<_&&C>=_?f=Number.POSITIVE_INFINITY:C{let I=WebInspector.HeapSnapshotProxy.deserialize(T,E);WebInspector.timelineManager.heapSnapshotAdded(S,I)})})}},WebInspector.HeapAllocationsTimelineRecord=class extends WebInspector.TimelineRecord{constructor(_,S){super(WebInspector.TimelineRecord.Type.HeapAllocations,_,_),this._timestamp=_,this._heapSnapshot=S}get timestamp(){return this._timestamp}get heapSnapshot(){return this._heapSnapshot}},WebInspector.HeapSnapshotRootPath=class extends WebInspector.Object{constructor(_,S,C,f){super(),this._node=_||null,this._parent=C||null,this._pathComponent="string"==typeof S?S:null,this._isGlobalScope=f||!1,this._parent&&this._parent.isEmpty()&&(this._parent=null)}static emptyPath(){return new WebInspector.HeapSnapshotRootPath(null)}static pathComponentForIndividualEdge(_){switch(_.type){case WebInspector.HeapSnapshotEdgeProxy.EdgeType.Internal:return null;case WebInspector.HeapSnapshotEdgeProxy.EdgeType.Index:return"["+_.data+"]";case WebInspector.HeapSnapshotEdgeProxy.EdgeType.Property:case WebInspector.HeapSnapshotEdgeProxy.EdgeType.Variable:return WebInspector.HeapSnapshotRootPath.canPropertyNameBeDotAccess(_.data)?_.data:"["+doubleQuotedString(_.data)+"]";}}static canPropertyNameBeDotAccess(_){return /^(?![0-9])\w+$/.test(_)}get node(){return this._node}get parent(){return this._parent}get pathComponent(){return this._pathComponent}get rootNode(){return this._parent?this._parent.rootNode:this._node}get fullPath(){let _=[];for(let S=this;S&&S.pathComponent;S=S.parent)_.push(S.pathComponent);return _.reverse(),_.join("")}isRoot(){return!this._parent}isEmpty(){return!this._node}isGlobalScope(){return this._isGlobalScope}isPathComponentImpossible(){return this._pathComponent&&this._pathComponent.startsWith("@")}isFullPathImpossible(){return!!this.isEmpty()||!!this.isPathComponentImpossible()||!!this._parent&&this._parent.isFullPathImpossible()}appendInternal(_){return new WebInspector.HeapSnapshotRootPath(_,WebInspector.HeapSnapshotRootPath.SpecialPathComponent.InternalPropertyName,this)}appendArrayIndex(_,S){return new WebInspector.HeapSnapshotRootPath(_,"["+S+"]",this)}appendPropertyName(_,S){let C=WebInspector.HeapSnapshotRootPath.canPropertyNameBeDotAccess(S)?"."+S:"["+doubleQuotedString(S)+"]";return new WebInspector.HeapSnapshotRootPath(_,C,this)}appendVariableName(_,S){return this._isGlobalScope?this.appendPropertyName(_,S):new WebInspector.HeapSnapshotRootPath(_,S,this)}appendGlobalScopeName(_,S){return new WebInspector.HeapSnapshotRootPath(_,S,this,!0)}appendEdge(_){switch(_.type){case WebInspector.HeapSnapshotEdgeProxy.EdgeType.Internal:return this.appendInternal(_.to);case WebInspector.HeapSnapshotEdgeProxy.EdgeType.Index:return this.appendArrayIndex(_.to,_.data);case WebInspector.HeapSnapshotEdgeProxy.EdgeType.Property:return this.appendPropertyName(_.to,_.data);case WebInspector.HeapSnapshotEdgeProxy.EdgeType.Variable:return this.appendVariableName(_.to,_.data);}console.error("Unexpected edge type",_.type)}},WebInspector.HeapSnapshotRootPath.SpecialPathComponent={InternalPropertyName:"@internal"},WebInspector.IndexedDatabase=class extends WebInspector.Object{constructor(_,S,C,f){super(),this._name=_,this._securityOrigin=S,this._host=parseSecurityOrigin(S).host,this._version=C,this._objectStores=f||[];for(var T of this._objectStores)T.establishRelationship(this)}get name(){return this._name}get securityOrigin(){return this._securityOrigin}get host(){return this._host}get version(){return this._version}get objectStores(){return this._objectStores}saveIdentityToCookie(_){_[WebInspector.IndexedDatabase.NameCookieKey]=this._name,_[WebInspector.IndexedDatabase.HostCookieKey]=this._host}},WebInspector.IndexedDatabase.TypeIdentifier="indexed-database",WebInspector.IndexedDatabase.NameCookieKey="indexed-database-name",WebInspector.IndexedDatabase.HostCookieKey="indexed-database-host",WebInspector.IndexedDatabaseObjectStore=class extends WebInspector.Object{constructor(_,S,C,f){super(),this._name=_,this._keyPath=S,this._autoIncrement=C||!1,this._indexes=f||[],this._parentDatabase=null;for(var T of this._indexes)T.establishRelationship(this)}get name(){return this._name}get keyPath(){return this._keyPath}get autoIncrement(){return this._autoIncrement}get parentDatabase(){return this._parentDatabase}get indexes(){return this._indexes}saveIdentityToCookie(_){_[WebInspector.IndexedDatabaseObjectStore.NameCookieKey]=this._name,_[WebInspector.IndexedDatabaseObjectStore.KeyPathCookieKey]=this._keyPath}establishRelationship(_){this._parentDatabase=_||null}},WebInspector.IndexedDatabaseObjectStore.TypeIdentifier="indexed-database-object-store",WebInspector.IndexedDatabaseObjectStore.NameCookieKey="indexed-database-object-store-name",WebInspector.IndexedDatabaseObjectStore.KeyPathCookieKey="indexed-database-object-store-key-path",WebInspector.IndexedDatabaseObjectStoreIndex=class extends WebInspector.Object{constructor(_,S,C,f){super(),this._name=_,this._keyPath=S,this._unique=C||!1,this._multiEntry=f||!1,this._parentObjectStore=null}get name(){return this._name}get keyPath(){return this._keyPath}get unique(){return this._unique}get multiEntry(){return this._multiEntry}get parentObjectStore(){return this._parentObjectStore}saveIdentityToCookie(_){_[WebInspector.IndexedDatabaseObjectStoreIndex.NameCookieKey]=this._name,_[WebInspector.IndexedDatabaseObjectStoreIndex.KeyPathCookieKey]=this._keyPath}establishRelationship(_){this._parentObjectStore=_||null}},WebInspector.IndexedDatabaseObjectStoreIndex.TypeIdentifier="indexed-database-object-store-index",WebInspector.IndexedDatabaseObjectStoreIndex.NameCookieKey="indexed-database-object-store-index-name",WebInspector.IndexedDatabaseObjectStoreIndex.KeyPathCookieKey="indexed-database-object-store-index-key-path",WebInspector.IssueMessage=class extends WebInspector.Object{constructor(_){switch(super(),this._consoleMessage=_,this._text=this._issueText(),this._consoleMessage.source){case"javascript":var S=/^([^:]+): (?:DOM Exception \d+: )?/,C=S.exec(this._text);C&&C[1]in WebInspector.IssueMessage.Type._prefixTypeMap?(this._type=WebInspector.IssueMessage.Type._prefixTypeMap[C[1]],this._text=this._text.substring(C[0].length)):this._type=WebInspector.IssueMessage.Type.OtherIssue;break;case"css":case"xml":this._type=WebInspector.IssueMessage.Type.PageIssue;break;case"network":this._type=WebInspector.IssueMessage.Type.NetworkIssue;break;case"security":this._type=WebInspector.IssueMessage.Type.SecurityIssue;break;case"console-api":case"storage":case"appcache":case"rendering":case"other":this._type=WebInspector.IssueMessage.Type.OtherIssue;break;default:console.error("Unknown issue source:",this._consoleMessage.source),this._type=WebInspector.IssueMessage.Type.OtherIssue;}this._sourceCodeLocation=_.sourceCodeLocation,this._sourceCodeLocation&&this._sourceCodeLocation.addEventListener(WebInspector.SourceCodeLocation.Event.DisplayLocationChanged,this._sourceCodeLocationDisplayLocationChanged,this)}static displayName(_){return _===WebInspector.IssueMessage.Type.SemanticIssue?WebInspector.UIString("Semantic Issue"):_===WebInspector.IssueMessage.Type.RangeIssue?WebInspector.UIString("Range Issue"):_===WebInspector.IssueMessage.Type.ReferenceIssue?WebInspector.UIString("Reference Issue"):_===WebInspector.IssueMessage.Type.TypeIssue?WebInspector.UIString("Type Issue"):_===WebInspector.IssueMessage.Type.PageIssue?WebInspector.UIString("Page Issue"):_===WebInspector.IssueMessage.Type.NetworkIssue?WebInspector.UIString("Network Issue"):_===WebInspector.IssueMessage.Type.SecurityIssue?WebInspector.UIString("Security Issue"):_===WebInspector.IssueMessage.Type.OtherIssue?WebInspector.UIString("Other Issue"):(console.error("Unknown issue message type:",_),WebInspector.UIString("Other Issue"))}get text(){return this._text}get type(){return this._type}get level(){return this._consoleMessage.level}get source(){return this._consoleMessage.source}get url(){return this._consoleMessage.url}get sourceCodeLocation(){return this._sourceCodeLocation}saveIdentityToCookie(_){_[WebInspector.IssueMessage.URLCookieKey]=this.url,_[WebInspector.IssueMessage.LineNumberCookieKey]=this._sourceCodeLocation?this._sourceCodeLocation.lineNumber:0,_[WebInspector.IssueMessage.ColumnNumberCookieKey]=this._sourceCodeLocation?this._sourceCodeLocation.columnNumber:0}_issueText(){function _(I){return I.description}let C=this._consoleMessage.parameters;if(!C)return this._consoleMessage.messageText;if("string"!==WebInspector.RemoteObject.type(C[0]))return this._consoleMessage.messageText;let T=String.format(C[0].description,C.slice(1),{o:_,s:_,f:_,i:_,d:_},"",function(I,R){return I+=R,I}),E=T.formattedResult;for(let I=0;IO.endTime||Sthis._selfTime&&(this._selfTime=0)}return{callCount:this._callCount,startTime:this._startTime,endTime:this._endTime,selfTime:this._selfTime,totalTime:this._totalTime,averageTime:this._selfTime/this._callCount}}var E=!0,I=0,R=Math.max(_,this._calls[0].startTime),N=Math.min(this._calls.lastValue.endTime,S),L=this._calls.reduce(C,0);E=!1;var f=0;for(var T of this._childNodes)f+=T.calls.reduce(C,0);var D=L-f,M=D/I;return{startTime:R,endTime:N,totalTime:L,selfTime:D,callCount:I,averageTime:M}}traverseNextProfileNode(_){var S=this._childNodes[0];if(S)return S;if(this===_)return null;if(S=this._nextSibling,S)return S;for(S=this;S&&!S.nextSibling&&S.parentNode!==_;)S=S.parentNode;return S?S.nextSibling:null}saveIdentityToCookie(_){_[WebInspector.ProfileNode.TypeCookieKey]=this._type||null,_[WebInspector.ProfileNode.FunctionNameCookieKey]=this._functionName||null,_[WebInspector.ProfileNode.SourceCodeURLCookieKey]=this._sourceCodeLocation?this._sourceCodeLocation.sourceCode.url?this._sourceCodeLocation.sourceCode.url.hash:null:null,_[WebInspector.ProfileNode.SourceCodeLocationLineCookieKey]=this._sourceCodeLocation?this._sourceCodeLocation.lineNumber:null,_[WebInspector.ProfileNode.SourceCodeLocationColumnCookieKey]=this._sourceCodeLocation?this._sourceCodeLocation.columnNumber:null}establishRelationships(_,S,C){this._parentNode=_||null,this._previousSibling=S||null,this._nextSibling=C||null}_computeTotalTimesIfNeeded(){if(!this._computedTotalTimes){this._computedTotalTimes=!0;var _=this.computeCallInfoForTimeRange(0,Infinity);this._startTime=_.startTime,this._endTime=_.endTime,this._selfTime=_.selfTime,this._totalTime=_.totalTime}}},WebInspector.ProfileNode.Type={Function:"profile-node-type-function",Program:"profile-node-type-program"},WebInspector.ProfileNode.TypeIdentifier="profile-node",WebInspector.ProfileNode.TypeCookieKey="profile-node-type",WebInspector.ProfileNode.FunctionNameCookieKey="profile-node-function-name",WebInspector.ProfileNode.SourceCodeURLCookieKey="profile-node-source-code-url",WebInspector.ProfileNode.SourceCodeLocationLineCookieKey="profile-node-source-code-location-line",WebInspector.ProfileNode.SourceCodeLocationColumnCookieKey="profile-node-source-code-location-column",WebInspector.ProfileNodeCall=class extends WebInspector.Object{constructor(_,S){super(),this._startTime=_,this._totalTime=S||0,this._parentNode=null,this._previousSibling=null,this._nextSibling=null}get startTime(){return this._startTime}get totalTime(){return this._totalTime}get endTime(){return this._startTime+this._totalTime}establishRelationships(_,S,C){this._parentNode=_||null,this._previousSibling=S||null,this._nextSibling=C||null}},WebInspector.PropertyDescriptor=class extends WebInspector.Object{constructor(_,S,C,f,T,E){super(),this._name=_.name,this._value=_.value,this._hasValue="value"in _,this._get=_.get,this._set=_.set,this._symbol=S,this._writable=_.writable||!1,this._configurable=_.configurable||!1,this._enumerable=_.enumerable||!1,this._own=C||!1,this._wasThrown=f||!1,this._nativeGetterValue=T||!1,this._internal=E||!1}static fromPayload(_,S,C){return _.value&&(_.value=WebInspector.RemoteObject.fromPayload(_.value,C)),_.get&&(_.get=WebInspector.RemoteObject.fromPayload(_.get,C)),_.set&&(_.set=WebInspector.RemoteObject.fromPayload(_.set,C)),_.symbol&&(_.symbol=WebInspector.RemoteObject.fromPayload(_.symbol,C)),S&&(_.writable=_.configurable=_.enumerable=!1,_.isOwn=!0),new WebInspector.PropertyDescriptor(_,_.symbol,_.isOwn,_.wasThrown,_.nativeGetter,S)}get name(){return this._name}get value(){return this._value}get get(){return this._get}get set(){return this._set}get writable(){return this._writable}get configurable(){return this._configurable}get enumerable(){return this._enumerable}get symbol(){return this._symbol}get isOwnProperty(){return this._own}get wasThrown(){return this._wasThrown}get nativeGetter(){return this._nativeGetterValue}get isInternalProperty(){return this._internal}hasValue(){return this._hasValue}hasGetter(){return this._get&&"function"===this._get.type}hasSetter(){return this._set&&"function"===this._set.type}isIndexProperty(){return!isNaN(+this._name)}isSymbolProperty(){return!!this._symbol}},WebInspector.PropertyPath=class extends WebInspector.Object{constructor(_,S,C,f){if(super(),C&&!C.object)throw new Error("Attempted to append to a PropertyPath with null object.");this._object=_,this._pathComponent="string"==typeof S?S:null,this._parent=C||null,this._isPrototype=f||!1}static emptyPropertyPathForScope(_){return new WebInspector.PropertyPath(_,WebInspector.PropertyPath.SpecialPathComponent.EmptyPathComponentForScope)}get object(){return this._object}get parent(){return this._parent}get isPrototype(){return this._isPrototype}get pathComponent(){return this._pathComponent}get rootObject(){return this._parent?this._parent.rootObject:this._object}get lastNonPrototypeObject(){if(!this._parent)return this._object;for(var _=this._parent;_&&!!_.isPrototype;){if(!_.parent)break;_=_.parent}return _.object}get fullPath(){for(var _=[],S=this;S&&S.pathComponent;S=S.parent)_.push(S.pathComponent);return _.reverse(),_.join("")}get reducedPath(){for(var _=[],S=this;S&&S.isPrototype;S=S.parent)_.push(S.pathComponent);for(;S&&S.pathComponent;S=S.parent)S.isPrototype||_.push(S.pathComponent);return _.reverse(),_.join("")}displayPath(_){return _===WebInspector.PropertyPath.Type.Value?this.reducedPath:this.fullPath}isRoot(){return!this._parent}isScope(){return this._pathComponent===WebInspector.PropertyPath.SpecialPathComponent.EmptyPathComponentForScope}isPathComponentImpossible(){return this._pathComponent&&this._pathComponent.startsWith("@")}isFullPathImpossible(){return!!this.isPathComponentImpossible()||!!this._parent&&this._parent.isFullPathImpossible()}appendPropertyName(_,S){var C="__proto__"===S;if(this.isScope())return new WebInspector.PropertyPath(_,S,this,C);var f=this._canPropertyNameBeDotAccess(S)?"."+S:"["+doubleQuotedString(S)+"]";return new WebInspector.PropertyPath(_,f,this,C)}appendPropertySymbol(_,S){var C=WebInspector.PropertyPath.SpecialPathComponent.SymbolPropertyName+(S.length?"("+S+")":"");return new WebInspector.PropertyPath(_,C,this)}appendInternalPropertyName(_,S){var C=WebInspector.PropertyPath.SpecialPathComponent.InternalPropertyName+"["+S+"]";return new WebInspector.PropertyPath(_,C,this)}appendGetterPropertyName(_,S){var C=".__lookupGetter__("+doubleQuotedString(S)+")";return new WebInspector.PropertyPath(_,C,this)}appendSetterPropertyName(_,S){var C=".__lookupSetter__("+doubleQuotedString(S)+")";return new WebInspector.PropertyPath(_,C,this)}appendArrayIndex(_,S){return new WebInspector.PropertyPath(_,"["+S+"]",this)}appendMapKey(_){var S=WebInspector.PropertyPath.SpecialPathComponent.MapKey;return new WebInspector.PropertyPath(_,S,this)}appendMapValue(_,S){if(S&&S.hasValue()){if("string"===S.type){var C=".get("+doubleQuotedString(S.description)+")";return new WebInspector.PropertyPath(_,C,this)}var C=".get("+S.description+")";return new WebInspector.PropertyPath(_,C,this)}var C=WebInspector.PropertyPath.SpecialPathComponent.MapValue;return new WebInspector.PropertyPath(_,C,this)}appendSetIndex(_){var S=WebInspector.PropertyPath.SpecialPathComponent.SetIndex;return new WebInspector.PropertyPath(_,S,this)}appendSymbolProperty(_){var S=WebInspector.PropertyPath.SpecialPathComponent.SymbolPropertyName;return new WebInspector.PropertyPath(_,S,this)}appendPropertyDescriptor(_,S,C){return S.isInternalProperty?this.appendInternalPropertyName(_,S.name):S.symbol?this.appendSymbolProperty(_):C===WebInspector.PropertyPath.Type.Getter?this.appendGetterPropertyName(_,S.name):C===WebInspector.PropertyPath.Type.Setter?this.appendSetterPropertyName(_,S.name):"array"!==this._object.subtype||isNaN(parseInt(S.name))?this.appendPropertyName(_,S.name):this.appendArrayIndex(_,S.name)}_canPropertyNameBeDotAccess(_){return /^(?![0-9])\w+$/.test(_)}},WebInspector.PropertyPath.SpecialPathComponent={InternalPropertyName:"@internal",SymbolPropertyName:"@symbol",MapKey:"@mapkey",MapValue:"@mapvalue",SetIndex:"@setindex",EmptyPathComponentForScope:""},WebInspector.PropertyPath.Type={Value:"value",Getter:"getter",Setter:"setter"},WebInspector.PropertyPreview=class extends WebInspector.Object{constructor(_,S,C,f,T,E){super(),this._name=_,this._type=S,this._subtype=C,this._value=f,this._valuePreview=T,this._internal=E}static fromPayload(_){return _.valuePreview&&(_.valuePreview=WebInspector.ObjectPreview.fromPayload(_.valuePreview)),new WebInspector.PropertyPreview(_.name,_.type,_.subtype,_.value,_.valuePreview,_.internal)}get name(){return this._name}get type(){return this._type}get subtype(){return this._subtype}get value(){return this._value}get valuePreview(){return this._valuePreview}get internal(){return this._internal}},WebInspector.RenderingFrameTimelineRecord=class extends WebInspector.TimelineRecord{constructor(_,S){super(WebInspector.TimelineRecord.Type.RenderingFrame,_,S),this._durationByTaskType=new Map,this._frameIndex=-1}static resetFrameIndex(){WebInspector.RenderingFrameTimelineRecord._nextFrameIndex=0}static displayNameForTaskType(_){return _===WebInspector.RenderingFrameTimelineRecord.TaskType.Script?WebInspector.UIString("Script"):_===WebInspector.RenderingFrameTimelineRecord.TaskType.Layout?WebInspector.UIString("Layout"):_===WebInspector.RenderingFrameTimelineRecord.TaskType.Paint?WebInspector.UIString("Paint"):_===WebInspector.RenderingFrameTimelineRecord.TaskType.Other?WebInspector.UIString("Other"):void 0}static taskTypeForTimelineRecord(_){switch(_.type){case WebInspector.TimelineRecord.Type.Script:return WebInspector.RenderingFrameTimelineRecord.TaskType.Script;case WebInspector.TimelineRecord.Type.Layout:return _.eventType===WebInspector.LayoutTimelineRecord.EventType.Paint||_.eventType===WebInspector.LayoutTimelineRecord.EventType.Composite?WebInspector.RenderingFrameTimelineRecord.TaskType.Paint:WebInspector.RenderingFrameTimelineRecord.TaskType.Layout;default:return console.error("Unsupported timeline record type: "+_.type),null;}}get frameIndex(){return this._frameIndex}get frameNumber(){return this._frameIndex+1}setupFrameIndex(){0<=this._frameIndex||(this._frameIndex=WebInspector.RenderingFrameTimelineRecord._nextFrameIndex++)}durationForTask(_){if(this._durationByTaskType.has(_))return this._durationByTaskType.get(_);var S;return _===WebInspector.RenderingFrameTimelineRecord.TaskType.Other?S=this._calculateDurationRemainder():(S=this.children.reduce(function(C,f){if(_!==WebInspector.RenderingFrameTimelineRecord.taskTypeForTimelineRecord(f))return C;var T=f.duration;return f.usesActiveStartTime&&(T-=f.inactiveDuration),C+T},0),_===WebInspector.RenderingFrameTimelineRecord.TaskType.Script&&(S-=this.children.reduce(function(C,f){return f.type===WebInspector.TimelineRecord.Type.Layout&&(f.sourceCodeLocation||f.callFrames)?C+f.duration:C},0))),this._durationByTaskType.set(_,S),S}_calculateDurationRemainder(){return Object.keys(WebInspector.RenderingFrameTimelineRecord.TaskType).reduce((_,S)=>{let C=WebInspector.RenderingFrameTimelineRecord.TaskType[S];return C===WebInspector.RenderingFrameTimelineRecord.TaskType.Other?_:_-this.durationForTask(C)},this.duration)}},WebInspector.RenderingFrameTimelineRecord.TaskType={Script:"rendering-frame-timeline-record-script",Layout:"rendering-frame-timeline-record-layout",Paint:"rendering-frame-timeline-record-paint",Other:"rendering-frame-timeline-record-other"},WebInspector.RenderingFrameTimelineRecord.TypeIdentifier="rendering-frame-timeline-record",WebInspector.RenderingFrameTimelineRecord._nextFrameIndex=0,WebInspector.Resource=class extends WebInspector.SourceCode{constructor(_,S,C,f,T,E,I,R,N,L,D,M){super(),C in WebInspector.Resource.Type&&(C=WebInspector.Resource.Type[C]),this._url=_,this._urlComponents=null,this._mimeType=S,this._mimeTypeComponents=null,this._type=C||WebInspector.Resource.typeFromMIMEType(S),this._loaderIdentifier=f||null,this._requestIdentifier=E||null,this._requestMethod=I||null,this._requestData=N||null,this._requestHeaders=R||{},this._responseHeaders={},this._parentFrame=null,this._initiatorSourceCodeLocation=D||null,this._initiatedResources=[],this._originalRequestWillBeSentTimestamp=M||null,this._requestSentTimestamp=L||NaN,this._responseReceivedTimestamp=NaN,this._lastRedirectReceivedTimestamp=NaN,this._lastDataReceivedTimestamp=NaN,this._finishedOrFailedTimestamp=NaN,this._finishThenRequestContentPromise=null,this._statusCode=NaN,this._statusText=null,this._cached=!1,this._canceled=!1,this._failed=!1,this._failureReasonText=null,this._receivedNetworkLoadMetrics=!1,this._responseSource=WebInspector.Resource.ResponseSource.Unknown,this._timingData=new WebInspector.ResourceTimingData(this),this._protocol=null,this._priority=WebInspector.Resource.NetworkPriority.Unknown,this._remoteAddress=null,this._connectionIdentifier=null,this._target=T?WebInspector.targetManager.targetForIdentifier(T):WebInspector.mainTarget,this._requestHeadersTransferSize=NaN,this._requestBodyTransferSize=NaN,this._responseHeadersTransferSize=NaN,this._responseBodyTransferSize=NaN,this._responseBodySize=NaN,this._cachedResponseBodySize=NaN,this._estimatedSize=NaN,this._estimatedTransferSize=NaN,this._estimatedResponseHeadersSize=NaN,this._initiatorSourceCodeLocation&&this._initiatorSourceCodeLocation.sourceCode instanceof WebInspector.Resource&&this._initiatorSourceCodeLocation.sourceCode.addInitiatedResource(this)}static typeFromMIMEType(_){return _?(_=parseMIMEType(_).type,_ in WebInspector.Resource._mimeTypeMap?WebInspector.Resource._mimeTypeMap[_]:_.startsWith("image/")?WebInspector.Resource.Type.Image:_.startsWith("font/")?WebInspector.Resource.Type.Font:WebInspector.Resource.Type.Other):WebInspector.Resource.Type.Other}static displayNameForType(_,S){return _===WebInspector.Resource.Type.Document?S?WebInspector.UIString("Documents"):WebInspector.UIString("Document"):_===WebInspector.Resource.Type.Stylesheet?S?WebInspector.UIString("Stylesheets"):WebInspector.UIString("Stylesheet"):_===WebInspector.Resource.Type.Image?S?WebInspector.UIString("Images"):WebInspector.UIString("Image"):_===WebInspector.Resource.Type.Font?S?WebInspector.UIString("Fonts"):WebInspector.UIString("Font"):_===WebInspector.Resource.Type.Script?S?WebInspector.UIString("Scripts"):WebInspector.UIString("Script"):_===WebInspector.Resource.Type.XHR?S?WebInspector.UIString("XHRs"):WebInspector.UIString("XHR"):_===WebInspector.Resource.Type.Fetch?S?WebInspector.UIString("Fetches"):WebInspector.UIString("Fetch"):_===WebInspector.Resource.Type.WebSocket?S?WebInspector.UIString("Sockets"):WebInspector.UIString("Socket"):_===WebInspector.Resource.Type.Other?WebInspector.UIString("Other"):(console.error("Unknown resource type",_),null)}static displayNameForProtocol(_){return"h2"===_?"HTTP/2":"http/1.0"===_?"HTTP/1.0":"http/1.1"===_?"HTTP/1.1":"spdy/2"===_?"SPDY/2":"spdy/3"===_?"SPDY/3":"spdy/3.1"===_?"SPDY/3.1":null}static comparePriority(_,S){const C={[WebInspector.Resource.NetworkPriority.Unknown]:0,[WebInspector.Resource.NetworkPriority.Low]:1,[WebInspector.Resource.NetworkPriority.Medium]:2,[WebInspector.Resource.NetworkPriority.High]:3};let f=C[_]||0,T=C[S]||0;return f-T}static displayNameForPriority(_){return _===WebInspector.Resource.NetworkPriority.Low?WebInspector.UIString("Low"):_===WebInspector.Resource.NetworkPriority.Medium?WebInspector.UIString("Medium"):_===WebInspector.Resource.NetworkPriority.High?WebInspector.UIString("High"):null}static responseSourceFromPayload(_){if(!_)return WebInspector.Resource.ResponseSource.Unknown;return _===NetworkAgent.ResponseSource.Unknown?WebInspector.Resource.ResponseSource.Unknown:_===NetworkAgent.ResponseSource.Network?WebInspector.Resource.ResponseSource.Network:_===NetworkAgent.ResponseSource.MemoryCache?WebInspector.Resource.ResponseSource.MemoryCache:_===NetworkAgent.ResponseSource.DiskCache?WebInspector.Resource.ResponseSource.DiskCache:(console.error("Unknown response source type",_),WebInspector.Resource.ResponseSource.Unknown)}static networkPriorityFromPayload(_){return _===NetworkAgent.MetricsPriority.Low?WebInspector.Resource.NetworkPriority.Low:_===NetworkAgent.MetricsPriority.Medium?WebInspector.Resource.NetworkPriority.Medium:_===NetworkAgent.MetricsPriority.High?WebInspector.Resource.NetworkPriority.High:(console.error("Unknown metrics priority",_),WebInspector.Resource.NetworkPriority.Unknown)}static connectionIdentifierFromPayload(_){WebInspector.Resource.connectionIdentifierMap||(WebInspector.Resource.connectionIdentifierMap=new Map,WebInspector.Resource.nextConnectionIdentifier=1);let S=WebInspector.Resource.connectionIdentifierMap.get(_);return S?S:(S=WebInspector.Resource.nextConnectionIdentifier++,WebInspector.Resource.connectionIdentifierMap.set(_,S),S)}get target(){return this._target}get type(){return this._type}get loaderIdentifier(){return this._loaderIdentifier}get requestIdentifier(){return this._requestIdentifier}get requestMethod(){return this._requestMethod}get requestData(){return this._requestData}get statusCode(){return this._statusCode}get statusText(){return this._statusText}get responseSource(){return this._responseSource}get timingData(){return this._timingData}get protocol(){return this._protocol}get priority(){return this._priority}get remoteAddress(){return this._remoteAddress}get connectionIdentifier(){return this._connectionIdentifier}get url(){return this._url}get urlComponents(){return this._urlComponents||(this._urlComponents=parseURL(this._url)),this._urlComponents}get displayName(){return WebInspector.displayNameForURL(this._url,this.urlComponents)}get displayURL(){return WebInspector.truncateURL(this._url,!0,64)}get initiatorSourceCodeLocation(){return this._initiatorSourceCodeLocation}get initiatedResources(){return this._initiatedResources}get originalRequestWillBeSentTimestamp(){return this._originalRequestWillBeSentTimestamp}get mimeType(){return this._mimeType}get mimeTypeComponents(){return this._mimeTypeComponents||(this._mimeTypeComponents=parseMIMEType(this._mimeType)),this._mimeTypeComponents}get syntheticMIMEType(){if(this._type===WebInspector.Resource.typeFromMIMEType(this._mimeType))return this._mimeType;switch(this._type){case WebInspector.Resource.Type.Stylesheet:return"text/css";case WebInspector.Resource.Type.Script:return"text/javascript";}return this._mimeType}createObjectURL(){let _=this.content;return _?_ instanceof Blob?URL.createObjectURL(_):null:this._url}isMainResource(){return!!this._parentFrame&&this._parentFrame.mainResource===this}addInitiatedResource(_){_ instanceof WebInspector.Resource&&(this._initiatedResources.push(_),this.dispatchEventToListeners(WebInspector.Resource.Event.InitiatedResourcesDidChange))}get parentFrame(){return this._parentFrame}get finished(){return this._finished}get failed(){return this._failed}get canceled(){return this._canceled}get failureReasonText(){return this._failureReasonText}get requestDataContentType(){return this._requestHeaders.valueForCaseInsensitiveKey("Content-Type")||null}get requestHeaders(){return this._requestHeaders}get responseHeaders(){return this._responseHeaders}get requestSentTimestamp(){return this._requestSentTimestamp}get lastRedirectReceivedTimestamp(){return this._lastRedirectReceivedTimestamp}get responseReceivedTimestamp(){return this._responseReceivedTimestamp}get lastDataReceivedTimestamp(){return this._lastDataReceivedTimestamp}get finishedOrFailedTimestamp(){return this._finishedOrFailedTimestamp}get firstTimestamp(){return this.timingData.startTime||this.lastRedirectReceivedTimestamp||this.responseReceivedTimestamp||this.lastDataReceivedTimestamp||this.finishedOrFailedTimestamp}get lastTimestamp(){return this.timingData.responseEnd||this.lastDataReceivedTimestamp||this.responseReceivedTimestamp||this.lastRedirectReceivedTimestamp||this.requestSentTimestamp}get duration(){return this.timingData.responseEnd-this.timingData.requestStart}get latency(){return this.timingData.responseStart-this.timingData.requestStart}get receiveDuration(){return this.timingData.responseEnd-this.timingData.responseStart}get cached(){return this._cached}get requestHeadersTransferSize(){return this._requestHeadersTransferSize}get requestBodyTransferSize(){return this._requestBodyTransferSize}get responseHeadersTransferSize(){return this._responseHeadersTransferSize}get responseBodyTransferSize(){return this._responseBodyTransferSize}get cachedResponseBodySize(){return this._cachedResponseBodySize}get size(){return isNaN(this._cachedResponseBodySize)?isNaN(this._responseBodySize)||0===this._responseBodySize?this._estimatedSize:this._responseBodySize:this._cachedResponseBodySize}get networkEncodedSize(){return this._responseBodyTransferSize}get networkDecodedSize(){return this._responseBodySize}get networkTotalTransferSize(){return this._responseHeadersTransferSize+this._responseBodyTransferSize}get estimatedNetworkEncodedSize(){let _=this.networkEncodedSize;if(!isNaN(_))return _;if(this._cached)return 0;if("mac"===WebInspector.Platform.name){let S=+this._responseHeaders.valueForCaseInsensitiveKey("Content-Length");if(!isNaN(S))return S}return isNaN(this._estimatedTransferSize)?+(this._responseHeaders.valueForCaseInsensitiveKey("Content-Length")||this._estimatedSize):this._estimatedTransferSize}get estimatedTotalTransferSize(){let _=this.networkTotalTransferSize;return isNaN(_)?304===this.statusCode?this._estimatedResponseHeadersSize:this._cached?0:this._estimatedResponseHeadersSize+this.estimatedNetworkEncodedSize:_}get compressed(){let _=this._responseHeaders.valueForCaseInsensitiveKey("Content-Encoding");return!!(_&&/\b(?:gzip|deflate)\b/.test(_))}get scripts(){return this._scripts||[]}scriptForLocation(_){if(_.sourceCode!==this)return null;for(var S=_.lineNumber,C=_.columnNumber,f=0,T;f=S){if(T.range.startLine===S&&CT.range.endColumn)continue;return T}return null}updateForRedirectResponse(_,S,C){var f=this._url;this._url=_,this._requestHeaders=S||{},this._lastRedirectReceivedTimestamp=C||NaN,f!==_&&(this._urlComponents=null,this.dispatchEventToListeners(WebInspector.Resource.Event.URLDidChange,{oldURL:f})),this.dispatchEventToListeners(WebInspector.Resource.Event.RequestHeadersDidChange),this.dispatchEventToListeners(WebInspector.Resource.Event.TimestampsDidChange)}hasResponse(){return!isNaN(this._statusCode)}updateForResponse(_,S,C,f,T,E,I,R,N){let L=this._url,D=this._mimeType,M=this._type;C in WebInspector.Resource.Type&&(C=WebInspector.Resource.Type[C]),this._url=_,this._mimeType=S,this._type=C||WebInspector.Resource.typeFromMIMEType(S),this._statusCode=T,this._statusText=E,this._responseHeaders=f||{},this._responseReceivedTimestamp=I||NaN,this._timingData=WebInspector.ResourceTimingData.fromPayload(R,this),N&&(this._responseSource=WebInspector.Resource.responseSourceFromPayload(N));for(let F in this._estimatedResponseHeadersSize=(this._statusCode+"").length+this._statusText.length+12,this._responseHeaders)this._estimatedResponseHeadersSize+=F.length+this._responseHeaders[F].length+4;this._cached||304!==T&&this._responseSource!==WebInspector.Resource.ResponseSource.MemoryCache&&this._responseSource!==WebInspector.Resource.ResponseSource.DiskCache||this.markAsCached(),L!==_&&(this._urlComponents=null,this.dispatchEventToListeners(WebInspector.Resource.Event.URLDidChange,{oldURL:L})),D!==S&&(this._mimeTypeComponents=null,this.dispatchEventToListeners(WebInspector.Resource.Event.MIMETypeDidChange,{oldMIMEType:D})),M!==C&&this.dispatchEventToListeners(WebInspector.Resource.Event.TypeDidChange,{oldType:M}),(304===T||this._responseHeaders.valueForCaseInsensitiveKey("Content-Length"))&&this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange),this.dispatchEventToListeners(WebInspector.Resource.Event.ResponseReceived),this.dispatchEventToListeners(WebInspector.Resource.Event.TimestampsDidChange)}updateWithMetrics(_){this._receivedNetworkLoadMetrics=!0,_.protocol&&(this._protocol=_.protocol),_.priority&&(this._priority=WebInspector.Resource.networkPriorityFromPayload(_.priority)),_.remoteAddress&&(this._remoteAddress=_.remoteAddress),_.connectionIdentifier&&(this._connectionIdentifier=WebInspector.Resource.connectionIdentifierFromPayload(_.connectionIdentifier)),_.requestHeaders&&(this._requestHeaders=_.requestHeaders,this.dispatchEventToListeners(WebInspector.Resource.Event.RequestHeadersDidChange)),"requestHeaderBytesSent"in _&&(this._requestHeadersTransferSize=_.requestHeaderBytesSent,this._requestBodyTransferSize=_.requestBodyBytesSent,this._responseHeadersTransferSize=_.responseHeaderBytesReceived,this._responseBodyTransferSize=_.responseBodyBytesReceived,this._responseBodySize=_.responseBodyDecodedSize,this.dispatchEventToListeners(WebInspector.Resource.Event.SizeDidChange,{previousSize:this._estimatedSize}),this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange))}setCachedResponseBodySize(_){this._cachedResponseBodySize=_}requestContentFromBackend(){return this._requestIdentifier?NetworkAgent.getResponseBody(this._requestIdentifier):this._parentFrame?PageAgent.getResourceContent(this._parentFrame.id,this._url):Promise.reject(new Error("Content request failed."))}increaseSize(_,S){isNaN(this._estimatedSize)&&(this._estimatedSize=0);let C=this._estimatedSize;this._estimatedSize+=_,this._lastDataReceivedTimestamp=S||NaN,this.dispatchEventToListeners(WebInspector.Resource.Event.SizeDidChange,{previousSize:C}),isNaN(this._estimatedTransferSize)&&304!==this._statusCode&&!this._responseHeaders.valueForCaseInsensitiveKey("Content-Length")&&this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange)}increaseTransferSize(_){isNaN(this._estimatedTransferSize)&&(this._estimatedTransferSize=0),this._estimatedTransferSize+=_,this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange)}markAsCached(){this._cached=!0,this.dispatchEventToListeners(WebInspector.Resource.Event.CacheStatusDidChange),304!==this._statusCode&&this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange)}markAsFinished(_){this._finished=!0,this._finishedOrFailedTimestamp=_||NaN,this._timingData.markResponseEndTime(_||NaN),this._finishThenRequestContentPromise&&(this._finishThenRequestContentPromise=null),this.dispatchEventToListeners(WebInspector.Resource.Event.LoadingDidFinish),this.dispatchEventToListeners(WebInspector.Resource.Event.TimestampsDidChange)}markAsFailed(_,S,C){this._failed=!0,this._canceled=_,this._finishedOrFailedTimestamp=S||NaN,this._failureReasonText||(this._failureReasonText=C||null),this.dispatchEventToListeners(WebInspector.Resource.Event.LoadingDidFail),this.dispatchEventToListeners(WebInspector.Resource.Event.TimestampsDidChange)}revertMarkAsFinished(){this._finished=!1,this._finishedOrFailedTimestamp=NaN}legacyMarkServedFromMemoryCache(){this._responseSource=WebInspector.Resource.ResponseSource.MemoryCache,this.markAsCached()}legacyMarkServedFromDiskCache(){this._responseSource=WebInspector.Resource.ResponseSource.DiskCache,this.markAsCached()}hadLoadingError(){return this._failed||this._canceled||400<=this._statusCode}getImageSize(_){function C(){this._imageSize=null,_(this._imageSize)}if(this.type!==WebInspector.Resource.Type.Image)throw"Resource is not an image.";if(void 0!==this._imageSize)return void _(this._imageSize);var f=null,T=new Image;T.addEventListener("load",function(){URL.revokeObjectURL(f),this._imageSize={width:T.width,height:T.height},_(this._imageSize)}.bind(this),!1),this.requestContent().then(E=>{f=T.src=E.sourceCode.createObjectURL(),f||C.call(this)},C.bind(this))}requestContent(){return this._finished?super.requestContent():this._failed?Promise.resolve({error:WebInspector.UIString("An error occurred trying to load the resource.")}):(this._finishThenRequestContentPromise||(this._finishThenRequestContentPromise=new Promise((_,S)=>{this.addEventListener(WebInspector.Resource.Event.LoadingDidFinish,_),this.addEventListener(WebInspector.Resource.Event.LoadingDidFail,S)}).then(WebInspector.SourceCode.prototype.requestContent.bind(this))),this._finishThenRequestContentPromise)}associateWithScript(_){if(this._scripts||(this._scripts=[]),this._scripts.push(_),this._type===WebInspector.Resource.Type.Other||this._type===WebInspector.Resource.Type.XHR){let S=this._type;this._type=WebInspector.Resource.Type.Script,this.dispatchEventToListeners(WebInspector.Resource.Event.TypeDidChange,{oldType:S})}}saveIdentityToCookie(_){_[WebInspector.Resource.URLCookieKey]=this.url.hash,_[WebInspector.Resource.MainResourceCookieKey]=this.isMainResource()}generateCURLCommand(){function _(f){return /[^\x20-\x7E]|'/.test(f)?"$'"+f.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/!/g,"\\041").replace(/[^\x20-\x7E]/g,function(E){let I=E.charCodeAt(0),R=I.toString(16);return 256>I?"\\x"+R.padStart(2,"0"):"\\u"+R.padStart(4,"0")})+"'":`'${f}'`}let S=["curl "+_(this.url).replace(/[[{}\]]/g,"\\$&"),`-X${this.requestMethod}`];for(let f in this.requestHeaders)S.push("-H "+_(`${f}: ${this.requestHeaders[f]}`));this.requestDataContentType&&"GET"!==this.requestMethod&&this.requestData&&(this.requestDataContentType.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)?S.push("--data "+_(this.requestData)):S.push("--data-binary "+_(this.requestData)));let C=S.join(" \\\n");return InspectorFrontendHost.copyText(C),C}},WebInspector.Resource.TypeIdentifier="resource",WebInspector.Resource.URLCookieKey="resource-url",WebInspector.Resource.MainResourceCookieKey="resource-is-main-resource",WebInspector.Resource.Event={URLDidChange:"resource-url-did-change",MIMETypeDidChange:"resource-mime-type-did-change",TypeDidChange:"resource-type-did-change",RequestHeadersDidChange:"resource-request-headers-did-change",ResponseReceived:"resource-response-received",LoadingDidFinish:"resource-loading-did-finish",LoadingDidFail:"resource-loading-did-fail",TimestampsDidChange:"resource-timestamps-did-change",SizeDidChange:"resource-size-did-change",TransferSizeDidChange:"resource-transfer-size-did-change",CacheStatusDidChange:"resource-cached-did-change",InitiatedResourcesDidChange:"resource-initiated-resources-did-change"},WebInspector.Resource.Type={Document:"resource-type-document",Stylesheet:"resource-type-stylesheet",Image:"resource-type-image",Font:"resource-type-font",Script:"resource-type-script",XHR:"resource-type-xhr",Fetch:"resource-type-fetch",WebSocket:"resource-type-websocket",Other:"resource-type-other"},WebInspector.Resource.ResponseSource={Unknown:Symbol("unknown"),Network:Symbol("network"),MemoryCache:Symbol("memory-cache"),DiskCache:Symbol("disk-cache")},WebInspector.Resource.NetworkPriority={Unknown:Symbol("unknown"),Low:Symbol("low"),Medium:Symbol("medium"),High:Symbol("high")},WebInspector.Resource._mimeTypeMap={"text/html":WebInspector.Resource.Type.Document,"text/xml":WebInspector.Resource.Type.Document,"text/plain":WebInspector.Resource.Type.Document,"application/xhtml+xml":WebInspector.Resource.Type.Document,"image/svg+xml":WebInspector.Resource.Type.Document,"text/css":WebInspector.Resource.Type.Stylesheet,"text/xsl":WebInspector.Resource.Type.Stylesheet,"text/x-less":WebInspector.Resource.Type.Stylesheet,"text/x-sass":WebInspector.Resource.Type.Stylesheet,"text/x-scss":WebInspector.Resource.Type.Stylesheet,"application/pdf":WebInspector.Resource.Type.Image,"application/x-font-type1":WebInspector.Resource.Type.Font,"application/x-font-ttf":WebInspector.Resource.Type.Font,"application/x-font-woff":WebInspector.Resource.Type.Font,"application/x-truetype-font":WebInspector.Resource.Type.Font,"text/javascript":WebInspector.Resource.Type.Script,"text/ecmascript":WebInspector.Resource.Type.Script,"application/javascript":WebInspector.Resource.Type.Script,"application/ecmascript":WebInspector.Resource.Type.Script,"application/x-javascript":WebInspector.Resource.Type.Script,"application/json":WebInspector.Resource.Type.Script,"application/x-json":WebInspector.Resource.Type.Script,"text/x-javascript":WebInspector.Resource.Type.Script,"text/x-json":WebInspector.Resource.Type.Script,"text/javascript1.1":WebInspector.Resource.Type.Script,"text/javascript1.2":WebInspector.Resource.Type.Script,"text/javascript1.3":WebInspector.Resource.Type.Script,"text/jscript":WebInspector.Resource.Type.Script,"text/livescript":WebInspector.Resource.Type.Script,"text/x-livescript":WebInspector.Resource.Type.Script,"text/typescript":WebInspector.Resource.Type.Script,"text/x-clojure":WebInspector.Resource.Type.Script,"text/x-coffeescript":WebInspector.Resource.Type.Script},WebInspector.ResourceCollection=class extends WebInspector.Collection{constructor(_){super(WebInspector.ResourceCollection.verifierForType(_)),this._resourceType=_||null,this._resourceURLMap=new Map,this._resourcesTypeMap=new Map}static verifierForType(_){return _===WebInspector.Resource.Type.Document?WebInspector.ResourceCollection.TypeVerifier.Document:_===WebInspector.Resource.Type.Stylesheet?WebInspector.ResourceCollection.TypeVerifier.Stylesheet:_===WebInspector.Resource.Type.Image?WebInspector.ResourceCollection.TypeVerifier.Image:_===WebInspector.Resource.Type.Font?WebInspector.ResourceCollection.TypeVerifier.Font:_===WebInspector.Resource.Type.Script?WebInspector.ResourceCollection.TypeVerifier.Script:_===WebInspector.Resource.Type.XHR?WebInspector.ResourceCollection.TypeVerifier.XHR:_===WebInspector.Resource.Type.Fetch?WebInspector.ResourceCollection.TypeVerifier.Fetch:_===WebInspector.Resource.Type.WebSocket?WebInspector.ResourceCollection.TypeVerifier.WebSocket:_===WebInspector.Resource.Type.Other?WebInspector.ResourceCollection.TypeVerifier.Other:WebInspector.Collection.TypeVerifier.Resource}resourceForURL(_){return this._resourceURLMap.get(_)||null}resourceCollectionForType(_){if(this._resourceType)return this;let S=this._resourcesTypeMap.get(_);return S||(S=new WebInspector.ResourceCollection(_),this._resourcesTypeMap.set(_,S)),S}clear(){super.clear(),this._resourceURLMap.clear(),this._resourceType||this._resourcesTypeMap.clear()}itemAdded(_){this._associateWithResource(_)}itemRemoved(_){this._disassociateWithResource(_)}itemsCleared(_){for(let C of _)this._disassociateWithResource(C,!0)}_associateWithResource(_){if(this._resourceURLMap.set(_.url,_),!this._resourceType){let S=this.resourceCollectionForType(_.type);S.add(_)}_.addEventListener(WebInspector.Resource.Event.URLDidChange,this._resourceURLDidChange,this),_.addEventListener(WebInspector.Resource.Event.TypeDidChange,this._resourceTypeDidChange,this)}_disassociateWithResource(_,S){if(_.removeEventListener(WebInspector.Resource.Event.URLDidChange,this._resourceURLDidChange,this),_.removeEventListener(WebInspector.Resource.Event.TypeDidChange,this._resourceTypeDidChange,this),!S){if(!this._resourceType){let C=this.resourceCollectionForType(_.type);C.remove(_)}this._resourceURLMap.delete(_.url)}}_resourceURLDidChange(_){let S=_.target;if(S instanceof WebInspector.Resource){let C=_.data.oldURL;C&&(this._resourceURLMap.set(S.url,S),this._resourceURLMap.delete(C))}}_resourceTypeDidChange(_){let S=_.target;if(S instanceof WebInspector.Resource){if(this._resourceType)return void this.remove(S);let C=this.resourceCollectionForType(S.type);C.add(S)}}},WebInspector.ResourceCollection.TypeVerifier={Document:u=>WebInspector.Collection.TypeVerifier.Resource(u)&&u.type===WebInspector.Resource.Type.Document,Stylesheet:u=>{return!!WebInspector.Collection.TypeVerifier.CSSStyleSheet(u)||WebInspector.Collection.TypeVerifier.Resource(u)&&u.type===WebInspector.Resource.Type.Stylesheet},Image:u=>WebInspector.Collection.TypeVerifier.Resource(u)&&u.type===WebInspector.Resource.Type.Image,Font:u=>WebInspector.Collection.TypeVerifier.Resource(u)&&u.type===WebInspector.Resource.Type.Font,Script:u=>WebInspector.Collection.TypeVerifier.Resource(u)&&u.type===WebInspector.Resource.Type.Script,XHR:u=>WebInspector.Collection.TypeVerifier.Resource(u)&&u.type===WebInspector.Resource.Type.XHR,Fetch:u=>WebInspector.Collection.TypeVerifier.Resource(u)&&u.type===WebInspector.Resource.Type.Fetch,WebSocket:u=>WebInspector.Collection.TypeVerifier.Resource(u)&&u.type===WebInspector.Resource.Type.WebSocket,Other:u=>WebInspector.Collection.TypeVerifier.Resource(u)&&u.type===WebInspector.Resource.Type.Other},WebInspector.ResourceQueryMatch=class extends WebInspector.Object{constructor(_,S,C){super(),this._type=_,this._index=S,this._queryIndex=C,this._rank=void 0}get type(){return this._type}get index(){return this._index}get queryIndex(){return this._queryIndex}},WebInspector.ResourceQueryMatch.Type={Normal:Symbol("normal"),Special:Symbol("special")},WebInspector.ResourceQueryResult=class extends WebInspector.Object{constructor(_,S,C){super(),this._resource=_,this._matches=S,this._cookie=C||null}get resource(){return this._resource}get cookie(){return this._cookie}get rank(){return void 0===this._rank&&this._calculateRank(),this._rank}get matchingTextRanges(){return this._matchingTextRanges||(this._matchingTextRanges=this._createMatchingTextRanges()),this._matchingTextRanges}_calculateRank(){function _(I){return I.type===WebInspector.ResourceQueryMatch.Type.Special?5:1}this._rank=0;let T=null,E=null;for(let I of this._matches){this._rank+=10*_(I);let R=T&&T.index===I.index-1;R?(!E&&(E=T),this._rank+=5*_(E)*(I.index-E.index)):E&&(E=null),T=I,R||(this._rank-=I.index*_(I))}}_createMatchingTextRanges(){if(!this._matches.length)return[];let _=[],S=this._matches[0].index,C=S;for(let f=1,T;f=this._domainLookupEnd&&(this._domainLookupStart=this._domainLookupEnd=NaN),this._connectStart>=this._connectEnd&&(this._connectStart=this._connectEnd=NaN)}static fromPayload(_,S){function C(T){return 0{_(this._scriptSyntaxTree)},0);var S=f=>{this._makeSyntaxTree(f),_(this._scriptSyntaxTree)},C=this.content;return!C&&this._resource&&this._resource.type===WebInspector.Resource.Type.Script&&this._resource.finished&&(C=this._resource.content),C?void setTimeout(S,0,C):void this.requestContent().then(function(f){S(f.sourceCode.content)}).catch(function(){S(null)})}_resolveResource(){if(!this._url)return null;let _=WebInspector.frameResourceManager;this._target!==WebInspector.mainTarget&&(_=this._target.resourceCollection);try{let S=_.resourceForURL(this._url);if(S)return S;let C=decodeURI(this._url);if(C!==this._url&&(S=_.resourceForURL(C),S))return S;let f=removeURLFragment(this._url);if(f!==this._url&&(S=_.resourceForURL(f),S))return S;let T=removeURLFragment(C);if(T!==C&&(S=_.resourceForURL(T),S))return S}catch(S){}return null}_makeSyntaxTree(_){this._scriptSyntaxTree||!_||(this._scriptSyntaxTree=new WebInspector.ScriptSyntaxTree(_,this))}},WebInspector.Script.SourceType={Program:"script-source-type-program",Module:"script-source-type-module"},WebInspector.Script.TypeIdentifier="script",WebInspector.Script.URLCookieKey="script-url",WebInspector.Script.DisplayNameCookieKey="script-display-name",WebInspector.Script._nextUniqueDisplayNameNumber=1,WebInspector.Script._nextUniqueConsoleDisplayNameNumber=1,WebInspector.ScriptInstrument=class extends WebInspector.Instrument{get timelineRecordType(){return WebInspector.TimelineRecord.Type.Script}startInstrumentation(_){if(!window.ScriptProfilerAgent)return void super.startInstrumentation();_||ScriptProfilerAgent.startTracking(!0)}stopInstrumentation(_){return window.ScriptProfilerAgent?void(!_&&ScriptProfilerAgent.stopTracking()):void super.stopInstrumentation()}},WebInspector.ScriptSyntaxTree=class extends WebInspector.Object{constructor(_,S){super(),this._script=S;try{let C=this._script.sourceType===WebInspector.Script.SourceType.Module?"module":"script",f=esprima.parse(_,{range:!0,sourceType:C});this._syntaxTree=this._createInternalSyntaxTree(f),this._parsedSuccessfully=!0}catch(C){this._parsedSuccessfully=!1,this._syntaxTree=null,console.error("Couldn't parse JavaScript File: "+S.url,C)}}get parsedSuccessfully(){return this._parsedSuccessfully}forEachNode(_){this._parsedSuccessfully&&this._recurse(this._syntaxTree,_,this._defaultParserState())}filter(_,S){if(!this._parsedSuccessfully)return[];var f=[];return this._recurse(S,function(T,E){_(T)?f.push(T):E.skipChildNodes=!0},this._defaultParserState()),f}containersOfOffset(_){if(!this._parsedSuccessfully)return[];let S=[];const C=0,f=1;return this.forEachNode((T,E)=>{T.range[f]<_&&(E.skipChildNodes=!0),T.range[C]>_&&(E.shouldStopEarly=!0),T.range[C]<=_&&T.range[f]>=_&&S.push(T)}),S}filterByRange(_,S){if(!this._parsedSuccessfully)return[];var f=[],T=0;return this.forEachNode(function(I,R){I.range[1]<_&&(R.skipChildNodes=!0),_<=I.range[T]&&I.range[T]<=S&&f.push(I),I.range[T]>S&&(R.shouldStopEarly=!0)}),f}containsNonEmptyReturnStatement(_){if(!this._parsedSuccessfully)return!1;if(void 0!==_.attachments._hasNonEmptyReturnStatement)return _.attachments._hasNonEmptyReturnStatement;var C=this.filter(function(I){return I.type!==WebInspector.ScriptSyntaxTree.NodeType.FunctionExpression&&I.type!==WebInspector.ScriptSyntaxTree.NodeType.FunctionDeclaration&&I.type!==WebInspector.ScriptSyntaxTree.NodeType.ArrowFunctionExpression},_),f=!1,T=WebInspector.ScriptSyntaxTree.NodeType.ReturnStatement;for(var E of C)if(E.type===T&&E.argument){f=!0;break}return _.attachments._hasNonEmptyReturnStatement=f,f}static functionReturnDivot(_){return DOMAgent.hasEvent("pseudoElementAdded")?_.typeProfilingReturnDivot:_.body.range[0]}updateTypes(_,S){function C(L,D){if(!L){for(var M=0;M>1,E=C+T,I=this._mappings[E];_>=1,T?-S:S}},WebInspector.SourceMap.VLQ_BASE_SHIFT=5,WebInspector.SourceMap.VLQ_BASE_MASK=31,WebInspector.SourceMap.VLQ_CONTINUATION_MASK=32,WebInspector.SourceMap.StringCharIterator=class{constructor(_){this._string=_,this._position=0}next(){return this._string.charAt(this._position++)}peek(){return this._string.charAt(this._position)}hasNext(){return this._positionWebInspector.CallFrame.fromPayload(_,I)),E=new WebInspector.StackTrace(T,S.topCallFrameIsBoundary,S.truncated);C||(C=E),f&&(f._parentStackTrace=E),f=E,S=S.parentStackTrace}return C}static fromString(_,S){let C=WebInspector.StackTrace._parseStackTrace(S);return WebInspector.StackTrace.fromPayload(_,{callFrames:C})}static isLikelyStackTrace(_){const S="http://a.bc/:9:1".length;if(_.length<2*S.length)return!1;if(_.length>5e3)return!1;if(/^[^a-z$_]/i.test(_[0]))return!1;const E=`(.{1,${500}}:\\d+:\\d+|eval code|.{1,${120}}@\\[native code\\])`,I=/^(.{1,500}:\d+:\d+|eval code|.{1,120}@\[native code\])(\n(.{1,500}:\d+:\d+|eval code|.{1,120}@\[native code\]))*$/g;return I.test(_)}static _parseStackTrace(_){var S=_.split(/\n/g),C=[];for(var f of S){var T="",I=0,R=0,N=f.indexOf("@");-1===N?f.includes("/")?({url:R,lineNumber:I,columnNumber:R}=WebInspector.StackTrace._parseLocation(f)):T=f:(T=f.slice(0,N),({url:R,lineNumber:I,columnNumber:R}=WebInspector.StackTrace._parseLocation(f.slice(N+1)))),C.push({functionName:T,url:"",lineNumber:I,columnNumber:R})}return C}static _parseLocation(_){var S={url:"",lineNumber:0,columnNumber:0},C=/(.+?)(?::(\d+)(?::(\d+))?)?$/,f=_.match(C);return f?(S.url=f[1],f[2]&&(S.lineNumber=parseInt(f[2])),f[3]&&(S.columnNumber=parseInt(f[3])),S):S}get callFrames(){return this._callFrames}get firstNonNativeCallFrame(){for(let _ of this._callFrames)if(!_.nativeCode)return _;return null}get firstNonNativeNonAnonymousCallFrame(){for(let _ of this._callFrames)if(!_.nativeCode){if(_.sourceCodeLocation){let G=_.sourceCodeLocation.sourceCode;if(G instanceof WebInspector.Script&&G.anonymous)continue}return _}return null}get topCallFrameIsBoundary(){return this._topCallFrameIsBoundary}get truncated(){return this._truncated}get parentStackTrace(){return this._parentStackTrace}},WebInspector.StructureDescription=class extends WebInspector.Object{constructor(_,S,C,f,T){super(),this._fields=_||null,this._optionalFields=S||null,this._constructorName=C||"",this._prototypeStructure=f||null,this._imprecise=T||!1}static fromPayload(_){return _.prototypeStructure&&(_.prototypeStructure=WebInspector.StructureDescription.fromPayload(_.prototypeStructure)),new WebInspector.StructureDescription(_.fields,_.optionalFields,_.constructorName,_.prototypeStructure,_.imprecise)}get fields(){return this._fields}get optionalFields(){return this._optionalFields}get constructorName(){return this._constructorName}get prototypeStructure(){return this._prototypeStructure}get imprecise(){return this._imprecise}},WebInspector.TextMarker=class extends WebInspector.Object{constructor(_,S){super(),this._codeMirrorTextMarker=_,_.__webInspectorTextMarker=this,this._type=S||WebInspector.TextMarker.Type.Plain}static textMarkerForCodeMirrorTextMarker(_){return _.__webInspectorTextMarker||new WebInspector.TextMarker(_)}get codeMirrorTextMarker(){return this._codeMirrorTextMarker}get type(){return this._type}get range(){var _=this._codeMirrorTextMarker.find();return _?new WebInspector.TextRange(_.from.line,_.from.ch,_.to.line,_.to.ch):null}get rects(){var _=this._codeMirrorTextMarker.find();return _?this._codeMirrorTextMarker.doc.cm.rectsForRange({start:_.from,end:_.to}):WebInspector.Rect.ZERO_RECT}clear(){this._codeMirrorTextMarker.clear()}},WebInspector.TextMarker.Type={Color:"text-marker-type-color",Gradient:"text-marker-type-gradient",Plain:"text-marker-type-plain",CubicBezier:"text-marker-type-cubic-bezier",Spring:"text-marker-type-spring",Variable:"text-marker-type-variable"},WebInspector.TextRange=class extends WebInspector.Object{constructor(_,S,C,f){super(),4===arguments.length?(this._startLine="number"==typeof _?_:NaN,this._startColumn="number"==typeof S?S:NaN,this._endLine="number"==typeof C?C:NaN,this._endColumn="number"==typeof f?f:NaN,this._startOffset=NaN,this._endOffset=NaN):2===arguments.length&&(this._startOffset="number"==typeof _?_:NaN,this._endOffset="number"==typeof S?S:NaN,this._startLine=NaN,this._startColumn=NaN,this._endLine=NaN,this._endColumn=NaN)}get startLine(){return this._startLine}get startColumn(){return this._startColumn}get endLine(){return this._endLine}get endColumn(){return this._endColumn}get startOffset(){return this._startOffset}get endOffset(){return this._endOffset}startPosition(){return new WebInspector.SourceCodePosition(this._startLine,this._startColumn)}endPosition(){return new WebInspector.SourceCodePosition(this._endLine,this._endColumn)}resolveOffsets(_){if("string"==typeof _&&!(isNaN(this._startLine)||isNaN(this._startColumn)||isNaN(this._endLine)||isNaN(this._endColumn))){for(var S=0,C=0;Cthis._endLine?!1:_===this._startLine&&Sthis._endColumn?!1:!0}},WebInspector.TimelineMarker=class extends WebInspector.Object{constructor(_,S,C){super(),this._time=_||0,this._type=S,this._details=C||null}get time(){return this._time}set time(_){_=_||0;this._time===_||(this._time=_,this.dispatchEventToListeners(WebInspector.TimelineMarker.Event.TimeChanged))}get type(){return this._type}get details(){return this._details}},WebInspector.TimelineMarker.Event={TimeChanged:"timeline-marker-time-changed"},WebInspector.TimelineMarker.Type={CurrentTime:"current-time",LoadEvent:"load-event",DOMContentEvent:"dom-content-event",TimeStamp:"timestamp"},WebInspector.TimelineRecording=class extends WebInspector.Object{constructor(_,S,C){super(),this._identifier=_,this._timelines=new Map,this._displayName=S,this._capturing=!1,this._readonly=!1,this._instruments=C||[],this._topDownCallingContextTree=new WebInspector.CallingContextTree(WebInspector.CallingContextTree.Type.TopDown),this._bottomUpCallingContextTree=new WebInspector.CallingContextTree(WebInspector.CallingContextTree.Type.BottomUp),this._topFunctionsTopDownCallingContextTree=new WebInspector.CallingContextTree(WebInspector.CallingContextTree.Type.TopFunctionsTopDown),this._topFunctionsBottomUpCallingContextTree=new WebInspector.CallingContextTree(WebInspector.CallingContextTree.Type.TopFunctionsBottomUp);for(let f of WebInspector.TimelineManager.availableTimelineTypes()){let T=WebInspector.Timeline.create(f);this._timelines.set(f,T),T.addEventListener(WebInspector.Timeline.Event.TimesUpdated,this._timelineTimesUpdated,this)}this._legacyFirstRecordedTimestamp=NaN,this.reset(!0)}static sourceCodeTimelinesSupported(){return WebInspector.debuggableType===WebInspector.DebuggableType.Web}get displayName(){return this._displayName}get identifier(){return this._identifier}get timelines(){return this._timelines}get instruments(){return this._instruments}get readonly(){return this._readonly}get startTime(){return this._startTime}get endTime(){return this._endTime}get topDownCallingContextTree(){return this._topDownCallingContextTree}get bottomUpCallingContextTree(){return this._bottomUpCallingContextTree}get topFunctionsTopDownCallingContextTree(){return this._topFunctionsTopDownCallingContextTree}get topFunctionsBottomUpCallingContextTree(){return this._topFunctionsBottomUpCallingContextTree}start(_){this._capturing=!0;for(let S of this._instruments)S.startInstrumentation(_)}stop(_){this._capturing=!1;for(let S of this._instruments)S.stopInstrumentation(_)}saveIdentityToCookie(){}isEmpty(){for(var _ of this._timelines.values())if(_.records.length)return!1;return!0}unloaded(){this._readonly=!0,this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.Unloaded)}reset(_){this._sourceCodeTimelinesMap=new Map,this._eventMarkers=[],this._startTime=NaN,this._endTime=NaN,this._discontinuities=[],this._topDownCallingContextTree.reset(),this._bottomUpCallingContextTree.reset(),this._topFunctionsTopDownCallingContextTree.reset(),this._topFunctionsBottomUpCallingContextTree.reset();for(var S of this._timelines.values())S.reset(_);WebInspector.RenderingFrameTimelineRecord.resetFrameIndex(),_||(this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.Reset),this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.TimesUpdated))}sourceCodeTimelinesForSourceCode(_){var S=this._sourceCodeTimelinesMap.get(_);return S?[...S.values()]:[]}timelineForInstrument(_){return this._timelines.get(_.timelineRecordType)}instrumentForTimeline(_){return this._instruments.find(S=>S.timelineRecordType===_.type)}timelineForRecordType(_){return this._timelines.get(_)}addInstrument(_){this._instruments.push(_),this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.InstrumentAdded,{instrument:_})}removeInstrument(_){this._instruments.remove(_),this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.InstrumentRemoved,{instrument:_})}addEventMarker(_){this._capturing&&(this._eventMarkers.push(_),this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.MarkerAdded,{marker:_}))}addRecord(_){var S=this._timelines.get(_.type);if(S&&(S.addRecord(_),_.type!==WebInspector.TimelineRecord.Type.Network&&_.type!==WebInspector.TimelineRecord.Type.RenderingFrame&&_.type!==WebInspector.TimelineRecord.Type.Memory&&_.type!==WebInspector.TimelineRecord.Type.HeapAllocations)&&WebInspector.TimelineRecording.sourceCodeTimelinesSupported()){var C=WebInspector.frameResourceManager.mainFrame.provisionalMainResource||WebInspector.frameResourceManager.mainFrame.mainResource,f=_.sourceCodeLocation?_.sourceCodeLocation.sourceCode:C,T=this._sourceCodeTimelinesMap.get(f);T||(T=new Map,this._sourceCodeTimelinesMap.set(f,T));var E=!1,I=this._keyForRecord(_),R=T.get(I);R||(R=new WebInspector.SourceCodeTimeline(f,_.sourceCodeLocation,_.type,_.eventType),T.set(I,R),E=!0),R.addRecord(_),E&&this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.SourceCodeTimelineAdded,{sourceCodeTimeline:R})}}addMemoryPressureEvent(_){let S=this._timelines.get(WebInspector.TimelineRecord.Type.Memory);S&&S.addMemoryPressureEvent(_)}addDiscontinuity(_,S){this._discontinuities.push({startTime:_,endTime:S})}discontinuitiesInTimeRange(_,S){return this._discontinuities.filter(C=>C.startTime_)}addScriptInstrumentForProgrammaticCapture(){for(let S of this._instruments)if(S instanceof WebInspector.ScriptInstrument)return;this.addInstrument(new WebInspector.ScriptInstrument);let _=this._instruments.map(S=>S.timelineRecordType);WebInspector.timelineManager.enabledTimelineTypes=_}computeElapsedTime(_){return!_||isNaN(_)?NaN:(void 0===WebInspector.TimelineRecording.isLegacy&&(WebInspector.TimelineRecording.isLegacy=_>WebInspector.TimelineRecording.TimestampThresholdForLegacyRecordConversion),!WebInspector.TimelineRecording.isLegacy)?_:(_{if(this._resolveCallback=S,this._rejectCallback=C,_&&"function"==typeof _)return _(this.resolve.bind(this),this.reject.bind(this))})}get settled(){return this._settled}get promise(){return this._promise}resolve(_){if(this._settled)throw new Error("Promise is already settled, cannot call resolve().");this._settled=!0,this._resolveCallback(_)}reject(_){if(this._settled)throw new Error("Promise is already settled, cannot call reject().");this._settled=!0,this._rejectCallback(_)}},WebInspector.XHRBreakpoint=class extends WebInspector.Object{constructor(_,S,C){super(),this._type=_||WebInspector.XHRBreakpoint.Type.Text,this._url=S||"",this._disabled=C||!1}get type(){return this._type}get url(){return this._url}get disabled(){return this._disabled}set disabled(_){this._disabled===_||(this._disabled=_,this.dispatchEventToListeners(WebInspector.XHRBreakpoint.Event.DisabledStateDidChange))}get serializableInfo(){let _={type:this._type,url:this._url};return this._disabled&&(_.disabled=!0),_}saveIdentityToCookie(_){_[WebInspector.XHRBreakpoint.URLCookieKey]=this._url}},WebInspector.XHRBreakpoint.URLCookieKey="xhr-breakpoint-url",WebInspector.XHRBreakpoint.Event={DisabledStateDidChange:"xhr-breakpoint-disabled-state-did-change",ResolvedStateDidChange:"xhr-breakpoint-resolved-state-did-change"},WebInspector.XHRBreakpoint.Type={Text:"text",RegularExpression:"regex"},WebInspector.FormatterWorkerProxy=class u extends WebInspector.Object{constructor(){super(),this._formatterWorker=new Worker("Workers/Formatter/FormatterWorker.js"),this._formatterWorker.addEventListener("message",this._handleMessage.bind(this)),this._nextCallId=1,this._callbacks=new Map}static singleton(){return u.instance||(u.instance=new u),u.instance}formatJavaScript(){this.performAction("formatJavaScript",...arguments)}performAction(_){let S=this._nextCallId++,C=arguments[arguments.length-1],f=Array.prototype.slice.call(arguments,1,arguments.length-1);this._callbacks.set(S,C),this._postMessage({callId:S,actionName:_,actionArguments:f})}_postMessage(){this._formatterWorker.postMessage(...arguments)}_handleMessage(_){let S=_.data;if(S.callId){let C=this._callbacks.get(S.callId);return this._callbacks.delete(S.callId),void C(S.result)}console.error("Unexpected FormatterWorker message",S)}},WebInspector.HeapSnapshotDiffProxy=class extends WebInspector.Object{constructor(_,S,C,f,T,E){super(),this._proxyObjectId=_,this._snapshot1=S,this._snapshot2=C,this._totalSize=f,this._totalObjectCount=T,this._categories=Map.fromObject(E)}static deserialize(_,S){let{snapshot1:C,snapshot2:f,totalSize:T,totalObjectCount:E,categories:I}=S,R=WebInspector.HeapSnapshotProxy.deserialize(_,C),N=WebInspector.HeapSnapshotProxy.deserialize(_,f);return new WebInspector.HeapSnapshotDiffProxy(_,R,N,T,E,I)}get snapshot1(){return this._snapshot1}get snapshot2(){return this._snapshot2}get totalSize(){return this._totalSize}get totalObjectCount(){return this._totalObjectCount}get categories(){return this._categories}get invalid(){return this._snapshot1.invalid||this._snapshot2.invalid}updateForCollectionEvent(_){_.data.affectedSnapshots.includes(this._snapshot2._identifier)&&this.update(()=>{this.dispatchEventToListeners(WebInspector.HeapSnapshotProxy.Event.CollectedNodes,_.data)})}allocationBucketCounts(_,S){WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId,"allocationBucketCounts",_,S)}instancesWithClassName(_,S){WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId,"instancesWithClassName",_,C=>{S(C.map(WebInspector.HeapSnapshotNodeProxy.deserialize.bind(null,this._proxyObjectId)))})}update(_){WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId,"update",({liveSize:S,categories:C})=>{this._categories=Map.fromObject(C),_()})}nodeWithIdentifier(_,S){WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId,"nodeWithIdentifier",_,C=>{S(WebInspector.HeapSnapshotNodeProxy.deserialize(this._proxyObjectId,C))})}},WebInspector.HeapSnapshotEdgeProxy=class{constructor(_,S,C,f,T){this._proxyObjectId=_,this.fromIdentifier=S,this.toIdentifier=C,this.type=f,this.data=T,this.from=null,this.to=null}isPrivateSymbol(){return!WebInspector.isDebugUIEnabled()&&"string"==typeof this.data&&this.data.startsWith("PrivateSymbol")}static deserialize(_,S){let{from:C,to:f,type:T,data:E}=S;return new WebInspector.HeapSnapshotEdgeProxy(_,C,f,T,E)}},WebInspector.HeapSnapshotEdgeProxy.EdgeType={Internal:"Internal",Property:"Property",Index:"Index",Variable:"Variable"},WebInspector.HeapSnapshotNodeProxy=class{constructor(_,S,C,f,T,E,I,R,N,L){this._proxyObjectId=_,this.id=S,this.className=C,this.size=f,this.retainedSize=T,this.internal=E,this.gcRoot=I,this.dead=R,this.dominatorNodeIdentifier=N,this.hasChildren=L}static deserialize(_,S){let{id:C,className:f,size:T,retainedSize:E,internal:I,gcRoot:R,dead:N,dominatorNodeIdentifier:L,hasChildren:D}=S;return new WebInspector.HeapSnapshotNodeProxy(_,C,f,T,E,I,R,N,L,D)}shortestGCRootPath(_){WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId,"shortestGCRootPath",this.id,S=>{let C=!1,f=S.map(T=>{return C=!C,C?WebInspector.HeapSnapshotNodeProxy.deserialize(this._proxyObjectId,T):WebInspector.HeapSnapshotEdgeProxy.deserialize(this._proxyObjectId,T)});for(let T=1,E;T{_(S.map(WebInspector.HeapSnapshotNodeProxy.deserialize.bind(null,this._proxyObjectId)))})}retainedNodes(_){WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId,"retainedNodes",this.id,({retainedNodes:S,edges:C})=>{let f=S.map(WebInspector.HeapSnapshotNodeProxy.deserialize.bind(null,this._proxyObjectId)),T=C.map(WebInspector.HeapSnapshotEdgeProxy.deserialize.bind(null,this._proxyObjectId));_(f,T)})}retainers(_){WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId,"retainers",this.id,({retainers:S,edges:C})=>{let f=S.map(WebInspector.HeapSnapshotNodeProxy.deserialize.bind(null,this._proxyObjectId)),T=C.map(WebInspector.HeapSnapshotEdgeProxy.deserialize.bind(null,this._proxyObjectId));_(f,T)})}},WebInspector.HeapSnapshotProxy=class extends WebInspector.Object{constructor(_,S,C,f,T,E,I){super(),this._proxyObjectId=_,this._identifier=S,this._title=C,this._totalSize=f,this._totalObjectCount=T,this._liveSize=E,this._categories=Map.fromObject(I),WebInspector.HeapSnapshotProxy.ValidSnapshotProxies||(WebInspector.HeapSnapshotProxy.ValidSnapshotProxies=[]),WebInspector.HeapSnapshotProxy.ValidSnapshotProxies.push(this)}static deserialize(_,S){let{identifier:C,title:f,totalSize:T,totalObjectCount:E,liveSize:I,categories:R}=S;return new WebInspector.HeapSnapshotProxy(_,C,f,T,E,I,R)}static invalidateSnapshotProxies(){if(WebInspector.HeapSnapshotProxy.ValidSnapshotProxies){for(let _ of WebInspector.HeapSnapshotProxy.ValidSnapshotProxies)_._invalidate();WebInspector.HeapSnapshotProxy.ValidSnapshotProxies=null}}get proxyObjectId(){return this._proxyObjectId}get identifier(){return this._identifier}get title(){return this._title}get totalSize(){return this._totalSize}get totalObjectCount(){return this._totalObjectCount}get liveSize(){return this._liveSize}get categories(){return this._categories}get invalid(){return 0===this._proxyObjectId}updateForCollectionEvent(_){_.data.affectedSnapshots.includes(this._identifier)&&this.update(()=>{this.dispatchEventToListeners(WebInspector.HeapSnapshotProxy.Event.CollectedNodes,_.data)})}allocationBucketCounts(_,S){WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId,"allocationBucketCounts",_,S)}instancesWithClassName(_,S){WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId,"instancesWithClassName",_,C=>{S(C.map(WebInspector.HeapSnapshotNodeProxy.deserialize.bind(null,this._proxyObjectId)))})}update(_){WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId,"update",({liveSize:S,categories:C})=>{this._liveSize=S,this._categories=Map.fromObject(C),_()})}nodeWithIdentifier(_,S){WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId,"nodeWithIdentifier",_,C=>{S(WebInspector.HeapSnapshotNodeProxy.deserialize(this._proxyObjectId,C))})}_invalidate(){this._proxyObjectId=0,this._liveSize=0,this.dispatchEventToListeners(WebInspector.HeapSnapshotProxy.Event.Invalidated)}},WebInspector.HeapSnapshotProxy.Event={CollectedNodes:"heap-snapshot-proxy-collected-nodes",Invalidated:"heap-snapshot-proxy-invalidated"},WebInspector.HeapSnapshotWorkerProxy=class u extends WebInspector.Object{constructor(){super(),this._heapSnapshotWorker=new Worker("Workers/HeapSnapshot/HeapSnapshotWorker.js"),this._heapSnapshotWorker.addEventListener("message",this._handleMessage.bind(this)),this._nextCallId=1,this._callbacks=new Map,WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange,this._mainResourceDidChange,this)}static singleton(){return u.instance||(u.instance=new u),u.instance}clearSnapshots(_){this.performAction("clearSnapshots",_)}createSnapshot(){this.performAction("createSnapshot",...arguments)}createSnapshotDiff(){this.performAction("createSnapshotDiff",...arguments)}performAction(_){let S=this._nextCallId++,C=arguments[arguments.length-1],f=Array.prototype.slice.call(arguments,1,arguments.length-1);this._callbacks.set(S,C),this._postMessage({callId:S,actionName:_,actionArguments:f})}callMethod(_,S){let C=this._nextCallId++,f=arguments[arguments.length-1],T=Array.prototype.slice.call(arguments,2,arguments.length-1);this._callbacks.set(C,f),this._postMessage({callId:C,objectId:_,methodName:S,methodArguments:T})}_mainResourceDidChange(_){_.target.isMainFrame()&&this.clearSnapshots(()=>{WebInspector.HeapSnapshotProxy.invalidateSnapshotProxies()})}_postMessage(){this._heapSnapshotWorker.postMessage(...arguments)}_handleMessage(_){let S=_.data;if(S.error)return void this._callbacks.delete(S.callId);if(S.eventName)return void this.dispatchEventToListeners(S.eventName,S.eventData);if(S.callId){let C=this._callbacks.get(S.callId);return this._callbacks.delete(S.callId),void C(S.result)}console.error("Unexpected HeapSnapshotWorker message",S)}},WebInspector.View=class extends WebInspector.Object{constructor(_){super(),this._element=_||document.createElement("div"),this._element.__view=this,this._parentView=null,this._subviews=[],this._dirty=!1,this._dirtyDescendantsCount=0,this._needsLayoutWhenAttachedToRoot=!1,this._isAttachedToRoot=!1,this._layoutReason=null,this._didInitialLayout=!1}static rootView(){return WebInspector.View._rootView||(WebInspector.View._rootView=new WebInspector.View(document.body)),WebInspector.View._rootView}get element(){return this._element}get layoutPending(){return this._dirty}get parentView(){return this._parentView}get subviews(){return this._subviews}isDescendantOf(_){for(let S=this._parentView;S;){if(S===_)return!0;S=S.parentView}return!1}addSubview(_){this.insertSubviewBefore(_,null)}insertSubviewBefore(_,S){if(!this._subviews.includes(_)){const C=S?this._subviews.indexOf(S):this._subviews.length;-1===C||(this._subviews.insertAtIndex(_,C),!_.element.parentNode&&this._element.insertBefore(_.element,S?S.element:null),_.didMoveToParent(this))}}removeSubview(_){this._subviews.includes(_)&&(this._subviews.remove(_,!0),this._element.removeChild(_.element),_.didMoveToParent(null))}replaceSubview(_,S){this.insertSubviewBefore(S,_),this.removeSubview(_)}updateLayout(_){this.cancelLayout(),this._setLayoutReason(_),this._layoutSubtree()}updateLayoutIfNeeded(_){!this._dirty&&this._didInitialLayout||this.updateLayout(_)}needsLayout(_){this._setLayoutReason(_);this._dirty||WebInspector.View._scheduleLayoutForView(this)}cancelLayout(){WebInspector.View._cancelScheduledLayoutForView(this)}get layoutReason(){return this._layoutReason}didMoveToWindow(_){this._isAttachedToRoot=_,this._isAttachedToRoot&&this._needsLayoutWhenAttachedToRoot&&(WebInspector.View._scheduleLayoutForView(this),this._needsLayoutWhenAttachedToRoot=!1);for(let S of this._subviews)S.didMoveToWindow(_)}didMoveToParent(_){this._parentView=_;let S=this.isDescendantOf(WebInspector.View._rootView);if(this.didMoveToWindow(S),!!this._parentView){let C=this._dirtyDescendantsCount;this._dirty&&C++;for(let f=this._parentView;f;)f._dirtyDescendantsCount+=C,f=f.parentView}}initialLayout(){}layout(){}sizeDidChange(){}_layoutSubtree(){this._dirty=!1,this._dirtyDescendantsCount=0,this._didInitialLayout||(this.initialLayout(),this._didInitialLayout=!0),this._layoutReason===WebInspector.View.LayoutReason.Resize&&this.sizeDidChange(),this.layout();for(let _ of this._subviews)_._setLayoutReason(this._layoutReason),_._layoutSubtree();this._layoutReason=null}_setLayoutReason(_){this._layoutReason===WebInspector.View.LayoutReason.Resize||(this._layoutReason=_||WebInspector.View.LayoutReason.Dirty)}static _scheduleLayoutForView(_){_._dirty=!0;for(let S=_.parentView;S;)S._dirtyDescendantsCount++,S=S.parentView;return _._isAttachedToRoot?void(WebInspector.View._scheduledLayoutUpdateIdentifier||(WebInspector.View._scheduledLayoutUpdateIdentifier=requestAnimationFrame(WebInspector.View._visitViewTreeForLayout))):void(_._needsLayoutWhenAttachedToRoot=!0)}static _cancelScheduledLayoutForView(_){let S=_._dirtyDescendantsCount;_.layoutPending&&S++;for(let C=_.parentView;C;)C._dirtyDescendantsCount=Math.max(0,C._dirtyDescendantsCount-S),C=C.parentView;if(WebInspector.View._scheduledLayoutUpdateIdentifier){let f=WebInspector.View._rootView;!f||f._dirtyDescendantsCount||(cancelAnimationFrame(WebInspector.View._scheduledLayoutUpdateIdentifier),WebInspector.View._scheduledLayoutUpdateIdentifier=void 0)}}static _visitViewTreeForLayout(){WebInspector.View._scheduledLayoutUpdateIdentifier=void 0;for(let _=[WebInspector.View._rootView],S;_.length;)S=_.shift(),S.layoutPending?S._layoutSubtree():S._dirtyDescendantsCount&&(_=_.concat(S.subviews),S._dirtyDescendantsCount=0)}},WebInspector.View.LayoutReason={Dirty:Symbol("layout-reason-dirty"),Resize:Symbol("layout-reason-resize")},WebInspector.View._rootView=null,WebInspector.View._scheduledLayoutUpdateIdentifier=void 0,WebInspector.ConsoleCommandView=class extends WebInspector.Object{constructor(_,S){super(),this._commandText=_,this._className=S||""}render(){this._element=document.createElement("div"),this._element.classList.add("console-user-command"),this._element.setAttribute("data-labelprefix",WebInspector.UIString("Input: ")),this._className&&this._element.classList.add(this._className),this._formattedCommandElement=this._element.appendChild(document.createElement("span")),this._formattedCommandElement.classList.add("console-message-text"),this._formattedCommandElement.textContent=this._commandText,this._element.__commandView=this}get element(){return this._element}get commandText(){return this._commandText}toClipboardString(_){return(_?"":"> ")+this._commandText.removeWordBreakCharacters()}},WebInspector.ConsoleMessageView=class extends WebInspector.Object{constructor(_){super(),this._message=_,this._expandable=!1,this._repeatCount=_._repeatCount||0,this._extraParameters=_.parameters}render(){switch(this._element=document.createElement("div"),this._element.classList.add("console-message"),this._element.__message=this._message,this._element.__messageView=this,this._message.type===WebInspector.ConsoleMessage.MessageType.Result?(this._element.classList.add("console-user-command-result"),this._element.setAttribute("data-labelprefix",WebInspector.UIString("Output: "))):(this._message.type===WebInspector.ConsoleMessage.MessageType.StartGroup||this._message.type===WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)&&this._element.classList.add("console-group-title"),this._message.level){case WebInspector.ConsoleMessage.MessageLevel.Log:this._element.classList.add("console-log-level"),this._element.setAttribute("data-labelprefix",WebInspector.UIString("Log: "));break;case WebInspector.ConsoleMessage.MessageLevel.Info:this._element.classList.add("console-info-level"),this._element.setAttribute("data-labelprefix",WebInspector.UIString("Info: "));break;case WebInspector.ConsoleMessage.MessageLevel.Debug:this._element.classList.add("console-debug-level"),this._element.setAttribute("data-labelprefix",WebInspector.UIString("Debug: "));break;case WebInspector.ConsoleMessage.MessageLevel.Warning:this._element.classList.add("console-warning-level"),this._element.setAttribute("data-labelprefix",WebInspector.UIString("Warning: "));break;case WebInspector.ConsoleMessage.MessageLevel.Error:this._element.classList.add("console-error-level"),this._element.setAttribute("data-labelprefix",WebInspector.UIString("Error: "));}this._appendLocationLink(),this._messageTextElement=this._element.appendChild(document.createElement("span")),this._messageTextElement.classList.add("console-top-level-message"),this._messageTextElement.classList.add("console-message-text"),this._appendMessageTextAndArguments(this._messageTextElement),this._appendSavedResultIndex(),this._appendExtraParameters(),this._appendStackTrace(),this._renderRepeatCount()}get element(){return this._element}get message(){return this._message}get repeatCount(){return this._repeatCount}set repeatCount(_){this._repeatCount===_||(this._repeatCount=_,this._element&&this._renderRepeatCount())}_renderRepeatCount(){let _=this._repeatCount;return 1>=_?void(this._repeatCountElement&&(this._repeatCountElement.remove(),this._repeatCountElement=null)):void(!this._repeatCountElement&&(this._repeatCountElement=document.createElement("span"),this._repeatCountElement.classList.add("repeat-count"),this._element.insertBefore(this._repeatCountElement,this._element.firstChild)),this._repeatCountElement.textContent=Number.abbreviate(_))}get expandable(){return!!this._expandable||!!this._objectTree}expand(){this._expandable&&this._element.classList.add("expanded"),this._objectTree&&this._message.type!==WebInspector.ConsoleMessage.MessageType.Trace&&(!this._extraParameters||1>=this._extraParameters.length)&&this._objectTree.expand()}collapse(){this._expandable&&this._element.classList.remove("expanded"),this._objectTree&&(!this._extraParameters||1>=this._extraParameters.length)&&this._objectTree.collapse()}toggle(){this._element.classList.contains("expanded")?this.collapse():this.expand()}toClipboardString(_){let S=this._messageTextElement.innerText.removeWordBreakCharacters();this._message.savedResultIndex&&(S=S.replace(/\s*=\s*(\$\d+)$/,""));let C=this._shouldShowStackTrace();if(!C){let f=1C||S.slice(0,C).includes("\n");return!f}return"object"!==_.type||"null"===_.subtype||"regexp"===_.subtype}_formatParameter(_,S){var C=S?"object":_ instanceof WebInspector.RemoteObject?_.subtype||_.type:typeof _;var f={object:this._formatParameterAsObject,error:this._formatParameterAsError,map:this._formatParameterAsObject,set:this._formatParameterAsObject,weakmap:this._formatParameterAsObject,weakset:this._formatParameterAsObject,iterator:this._formatParameterAsObject,"class":this._formatParameterAsObject,proxy:this._formatParameterAsObject,array:this._formatParameterAsArray,node:this._formatParameterAsNode,string:this._formatParameterAsString},T=f[C]||this._formatParameterAsValue;const E=document.createDocumentFragment();return T.call(this,_,E,S),E}_formatParameterAsValue(_,S){S.appendChild(WebInspector.FormattedValue.createElementForRemoteObject(_))}_formatParameterAsString(_,S){if(this._isStackTrace(_)){let C=WebInspector.StackTrace.fromString(this._message.target,_.description);if(C.callFrames.length){let f=new WebInspector.StackTraceView(C);return void S.appendChild(f.element)}}S.appendChild(WebInspector.FormattedValue.createLinkifiedElementString(_.description))}_formatParameterAsNode(_,S){S.appendChild(WebInspector.FormattedValue.createElementForNode(_))}_formatParameterAsObject(_,S,C){this._objectTree=new WebInspector.ObjectTreeView(_,null,this._rootPropertyPathForObject(_),C),S.appendChild(this._objectTree.element)}_formatParameterAsError(_,S){this._objectTree=new WebInspector.ErrorObjectView(_),S.appendChild(this._objectTree.element)}_formatParameterAsArray(_,S){this._objectTree=new WebInspector.ObjectTreeView(_,WebInspector.ObjectTreeView.Mode.Properties,this._rootPropertyPathForObject(_)),S.appendChild(this._objectTree.element)}_rootPropertyPathForObject(_){return this._message.savedResultIndex?new WebInspector.PropertyPath(_,"$"+this._message.savedResultIndex):null}_formatWithSubstitutionString(_,S){function C(M,P){return this._formatParameter(P,M)}function E(M){let P="number"==typeof M.value?M.value:M.description;return String.standardFormatters.d(P)}function R(M){for(var P of["background","border","color","font","line","margin","padding","text"])if(M.startsWith(P)||M.startsWith("-webkit-"+P))return!0;return!1}var L=null,D={};return D.o=C.bind(this,!1),D.s=function(M){return M.description},D.f=function(M,P){let O="number"==typeof M.value?M.value:M.description;return String.standardFormatters.f(O,P)},D.i=E,D.d=E,D.c=function(M){L={};var P=document.createElement("span");P.setAttribute("style",M.description);for(var O=0,F;O{this.goBack()},I=()=>{this.goForward()},R=T?WebInspector.KeyboardShortcut.Key.Right:WebInspector.KeyboardShortcut.Key.Left,N=T?WebInspector.KeyboardShortcut.Key.Left:WebInspector.KeyboardShortcut.Key.Right;this._backKeyboardShortcut=new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl|WebInspector.KeyboardShortcut.Modifier.Control,R,E,this.element),this._forwardKeyboardShortcut=new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl|WebInspector.KeyboardShortcut.Modifier.Control,N,I,this.element);let L="Images/BackForwardArrows.svg#left-arrow-mask",D="Images/BackForwardArrows.svg#right-arrow-mask",M=T?D:L,P=T?L:D;this._backNavigationItem=new WebInspector.ButtonNavigationItem("back",WebInspector.UIString("Back (%s)").format(this._backKeyboardShortcut.displayName),M,8,13),this._backNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,E),this._backNavigationItem.enabled=!1,this._navigationBar.addNavigationItem(this._backNavigationItem),this._forwardNavigationItem=new WebInspector.ButtonNavigationItem("forward",WebInspector.UIString("Forward (%s)").format(this._forwardKeyboardShortcut.displayName),P,8,13),this._forwardNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,I),this._forwardNavigationItem.enabled=!1,this._navigationBar.addNavigationItem(this._forwardNavigationItem),this._navigationBar.addNavigationItem(new WebInspector.DividerNavigationItem)}f||(this._findBanner=new WebInspector.FindBanner(this),this._findBanner.addEventListener(WebInspector.FindBanner.Event.DidShow,this._findBannerDidShow,this),this._findBanner.addEventListener(WebInspector.FindBanner.Event.DidHide,this._findBannerDidHide,this)),this._hierarchicalPathNavigationItem=new WebInspector.HierarchicalPathNavigationItem,this._hierarchicalPathNavigationItem.addEventListener(WebInspector.HierarchicalPathNavigationItem.Event.PathComponentWasSelected,this._hierarchicalPathComponentWasSelected,this),this._navigationBar.addNavigationItem(this._hierarchicalPathNavigationItem),this._contentViewSelectionPathNavigationItem=new WebInspector.HierarchicalPathNavigationItem,this._dividingFlexibleSpaceNavigationItem=new WebInspector.FlexibleSpaceNavigationItem,this._navigationBar.addNavigationItem(this._dividingFlexibleSpaceNavigationItem),WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SelectionPathComponentsDidChange,this._contentViewSelectionPathComponentDidChange,this),WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange,this._contentViewSupplementalRepresentedObjectsDidChange,this),WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange,this._contentViewNumberOfSearchResultsDidChange,this),WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.NavigationItemsDidChange,this._contentViewNavigationItemsDidChange,this),this._delegate=S||null,this._currentContentViewNavigationItems=[]}get navigationBar(){return this._navigationBar}get contentViewContainer(){return this._contentViewContainer}get delegate(){return this._delegate}set delegate(_){this._delegate=_||null}get currentContentView(){return this._contentViewContainer.currentContentView}get currentRepresentedObjects(){var _=[],S=this._hierarchicalPathNavigationItem.lastComponent;S&&S.representedObject&&_.push(S.representedObject),S=this._contentViewSelectionPathNavigationItem.lastComponent,S&&S.representedObject&&_.push(S.representedObject);var C=this.currentContentView;if(C){var f=C.supplementalRepresentedObjects;f&&f.length&&(_=_.concat(f))}return _}showContentViewForRepresentedObject(_,S,C){var f=this.contentViewForRepresentedObject(_,!1,C);return this._contentViewContainer.showContentView(f,S)}showContentView(_,S){return this._contentViewContainer.showContentView(_,S)}contentViewForRepresentedObject(_,S,C){return this._contentViewContainer.contentViewForRepresentedObject(_,S,C)}updateHierarchicalPathForCurrentContentView(){var _=this.currentContentView;this._updateHierarchicalPathNavigationItem(_?_.representedObject:null)}canGoBack(){var _=this.currentContentView;return _&&_.canGoBack()||this._contentViewContainer.canGoBack()}canGoForward(){var _=this.currentContentView;return _&&_.canGoForward()||this._contentViewContainer.canGoForward()}goBack(){var _=this.currentContentView;return _&&_.canGoBack()?(_.goBack(),void this._updateBackForwardButtons()):void this._contentViewContainer.goBack()}goForward(){var _=this.currentContentView;return _&&_.canGoForward()?(_.goForward(),void this._updateBackForwardButtons()):void this._contentViewContainer.goForward()}showFindBanner(){if(this._findBanner){var _=this.currentContentView;return _&&_.supportsSearch?_.supportsCustomFindBanner?void _.showCustomFindBanner():void this._findBanner.show():void 0}}findBannerPerformSearch(_,S){var C=this.currentContentView;C&&C.supportsSearch&&C.performSearch(S)}findBannerSearchCleared(){var S=this.currentContentView;S&&S.supportsSearch&&S.searchCleared()}findBannerSearchQueryForSelection(){var S=this.currentContentView;return S&&S.supportsSearch?S.searchQueryWithSelection():null}findBannerRevealPreviousResult(_){var S=this.currentContentView;S&&S.supportsSearch&&S.revealPreviousSearchResult(!_.showing)}findBannerRevealNextResult(_){var S=this.currentContentView;S&&S.supportsSearch&&S.revealNextSearchResult(!_.showing)}shown(){this._contentViewContainer.shown(),this._findBanner&&this._findBanner.enableKeyboardShortcuts()}hidden(){this._contentViewContainer.hidden(),this._findBanner&&this._findBanner.disableKeyboardShortcuts()}_findBannerDidShow(){var S=this.currentContentView;S&&S.supportsSearch&&(S.automaticallyRevealFirstSearchResult=!0,""!==this._findBanner.searchQuery&&S.performSearch(this._findBanner.searchQuery))}_findBannerDidHide(){var S=this.currentContentView;S&&S.supportsSearch&&(S.automaticallyRevealFirstSearchResult=!1,S.searchCleared())}_contentViewNumberOfSearchResultsDidChange(_){this._findBanner&&_.target===this.currentContentView&&(this._findBanner.numberOfResults=this.currentContentView.numberOfSearchResults)}_updateHierarchicalPathNavigationItem(_){if(this.delegate&&"function"==typeof this.delegate.contentBrowserTreeElementForRepresentedObject){for(var S=_?this.delegate.contentBrowserTreeElementForRepresentedObject(this,_):null,C=[],f;S&&!S.root;)f=new WebInspector.GeneralTreeElementPathComponent(S),C.unshift(f),S=S.parent;this._hierarchicalPathNavigationItem.components=C}}_updateContentViewSelectionPathNavigationItem(_){var S=_?_.selectionPathComponents||[]:[];if(this._contentViewSelectionPathNavigationItem.components=S,!S.length)return this._hierarchicalPathNavigationItem.alwaysShowLastPathComponentSeparator=!1,void this._navigationBar.removeNavigationItem(this._contentViewSelectionPathNavigationItem);if(!this._navigationBar.navigationItems.includes(this._contentViewSelectionPathNavigationItem)){var C=this._navigationBar.navigationItems.indexOf(this._hierarchicalPathNavigationItem);this._navigationBar.insertNavigationItem(this._contentViewSelectionPathNavigationItem,C+1),this._hierarchicalPathNavigationItem.alwaysShowLastPathComponentSeparator=!0}}_updateBackForwardButtons(){this._backNavigationItem&&this._forwardNavigationItem&&(this._backNavigationItem.enabled=this.canGoBack(),this._forwardNavigationItem.enabled=this.canGoForward())}_updateContentViewNavigationItems(_){let S=this.currentContentView;if(!S)return this._removeAllNavigationItems(),void(this._currentContentViewNavigationItems=[]);if(S.parentContainer===this._contentViewContainer){if(!_){let E=this._currentContentViewNavigationItems.filter(R=>!(R instanceof WebInspector.DividerNavigationItem)),I=Array.shallowEqual(E,S.navigationItems);if(I)return}this._removeAllNavigationItems();let C=this.navigationBar,f=C.navigationItems.indexOf(this._dividingFlexibleSpaceNavigationItem)+1,T=[];S.navigationItems.forEach(function(E,I){if(0!==I||E instanceof WebInspector.ButtonNavigationItem){let R=new WebInspector.DividerNavigationItem;C.insertNavigationItem(R,f++),T.push(R)}C.insertNavigationItem(E,f++),T.push(E)}),this._currentContentViewNavigationItems=T}}_removeAllNavigationItems(){for(let _ of this._currentContentViewNavigationItems)_.parentNavigationBar&&_.parentNavigationBar.removeNavigationItem(_)}_updateFindBanner(_){return this._findBanner?_?void(this._findBanner.targetElement=_.element,this._findBanner.numberOfResults=_.hasPerformedSearch?_.numberOfSearchResults:null,_.supportsSearch&&this._findBanner.searchQuery&&(_.automaticallyRevealFirstSearchResult=this._findBanner.showing,_.performSearch(this._findBanner.searchQuery))):(this._findBanner.targetElement=null,void(this._findBanner.numberOfResults=null)):void 0}_dispatchCurrentRepresentedObjectsDidChangeEvent(){this._dispatchCurrentRepresentedObjectsDidChangeEvent.cancelDebounce(),this.dispatchEventToListeners(WebInspector.ContentBrowser.Event.CurrentRepresentedObjectsDidChange)}_contentViewSelectionPathComponentDidChange(_){_.target!==this.currentContentView||(this._updateContentViewSelectionPathNavigationItem(_.target),this._updateBackForwardButtons(),this._updateContentViewNavigationItems(),this._navigationBar.needsLayout(),this.soon._dispatchCurrentRepresentedObjectsDidChangeEvent())}_contentViewSupplementalRepresentedObjectsDidChange(_){_.target!==this.currentContentView||this.soon._dispatchCurrentRepresentedObjectsDidChangeEvent()}_currentContentViewDidChange(){var S=this.currentContentView;this._updateHierarchicalPathNavigationItem(S?S.representedObject:null),this._updateContentViewSelectionPathNavigationItem(S),this._updateBackForwardButtons(),this._updateContentViewNavigationItems(),this._updateFindBanner(S),this._navigationBar.needsLayout(),this.dispatchEventToListeners(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange),this._dispatchCurrentRepresentedObjectsDidChangeEvent()}_contentViewNavigationItemsDidChange(_){if(_.target===this.currentContentView){this._updateContentViewNavigationItems(!0),this._navigationBar.needsLayout()}}_hierarchicalPathComponentWasSelected(_){for(var S=_.data.pathComponent.generalTreeElement,C=S;S&&!WebInspector.ContentView.isViewable(S.representedObject);)S=S.traverseNextTreeElement(!1,C,!1);S&&S.revealAndSelect()}},WebInspector.ContentBrowser.Event={CurrentRepresentedObjectsDidChange:"content-browser-current-represented-objects-did-change",CurrentContentViewDidChange:"content-browser-current-content-view-did-change"},WebInspector.ContentView=class extends WebInspector.View{constructor(_){super(),this._representedObject=_,this.element.classList.add("content-view"),this._parentContainer=null}static createFromRepresentedObject(_,S){if(_ instanceof WebInspector.Frame)return new WebInspector.ResourceClusterContentView(_.mainResource,S);if(_ instanceof WebInspector.Resource)return new WebInspector.ResourceClusterContentView(_,S);if(_ instanceof WebInspector.Script)return new WebInspector.ScriptContentView(_,S);if(_ instanceof WebInspector.CSSStyleSheet)return new WebInspector.TextResourceContentView(_,S);if(_ instanceof WebInspector.Canvas)return new WebInspector.CanvasContentView(_,S);if(_ instanceof WebInspector.TimelineRecording)return new WebInspector.TimelineRecordingContentView(_,S);if(_ instanceof WebInspector.Timeline){var C=_.type;if(C===WebInspector.TimelineRecord.Type.Network)return new WebInspector.NetworkTimelineView(_,S);if(C===WebInspector.TimelineRecord.Type.Layout)return new WebInspector.LayoutTimelineView(_,S);if(C===WebInspector.TimelineRecord.Type.Script)return new WebInspector.ScriptClusterTimelineView(_,S);if(C===WebInspector.TimelineRecord.Type.RenderingFrame)return new WebInspector.RenderingFrameTimelineView(_,S);if(C===WebInspector.TimelineRecord.Type.Memory)return new WebInspector.MemoryTimelineView(_,S);if(C===WebInspector.TimelineRecord.Type.HeapAllocations)return new WebInspector.HeapAllocationsTimelineView(_,S)}if((_ instanceof WebInspector.Breakpoint||_ instanceof WebInspector.IssueMessage)&&_.sourceCodeLocation)return WebInspector.ContentView.createFromRepresentedObject(_.sourceCodeLocation.displaySourceCode,S);if(_ instanceof WebInspector.DOMStorageObject)return new WebInspector.DOMStorageContentView(_,S);if(_ instanceof WebInspector.CookieStorageObject)return new WebInspector.CookieStorageContentView(_,S);if(_ instanceof WebInspector.DatabaseTableObject)return new WebInspector.DatabaseTableContentView(_,S);if(_ instanceof WebInspector.DatabaseObject)return new WebInspector.DatabaseContentView(_,S);if(_ instanceof WebInspector.IndexedDatabase)return new WebInspector.IndexedDatabaseContentView(_,S);if(_ instanceof WebInspector.IndexedDatabaseObjectStore)return new WebInspector.IndexedDatabaseObjectStoreContentView(_,S);if(_ instanceof WebInspector.IndexedDatabaseObjectStoreIndex)return new WebInspector.IndexedDatabaseObjectStoreContentView(_,S);if(_ instanceof WebInspector.ApplicationCacheFrame)return new WebInspector.ApplicationCacheFrameContentView(_,S);if(_ instanceof WebInspector.DOMTree)return new WebInspector.FrameDOMTreeContentView(_,S);if(_ instanceof WebInspector.DOMSearchMatchObject){var f=new WebInspector.FrameDOMTreeContentView(WebInspector.frameResourceManager.mainFrame.domTree,S);return f.restoreFromCookie({nodeToSelect:_.domNode}),f}if(_ instanceof WebInspector.DOMNode&&_.frame){let I=WebInspector.ContentView.createFromRepresentedObject(_.frame,S);return I.restoreFromCookie({nodeToSelect:_}),I}if(_ instanceof WebInspector.SourceCodeSearchMatchObject){var f;_.sourceCode instanceof WebInspector.Resource?f=new WebInspector.ResourceClusterContentView(_.sourceCode,S):_.sourceCode instanceof WebInspector.Script?f=new WebInspector.ScriptContentView(_.sourceCode,S):console.error("Unknown SourceCode",_.sourceCode);var T=_.sourceCodeTextRange.formattedTextRange,E=T.startPosition();return f.restoreFromCookie({lineNumber:E.lineNumber,columnNumber:E.columnNumber}),f}if(_ instanceof WebInspector.LogObject)return new WebInspector.LogContentView(_,S);if(_ instanceof WebInspector.ContentFlow)return new WebInspector.ContentFlowDOMTreeContentView(_,S);if(_ instanceof WebInspector.CallingContextTree)return new WebInspector.ProfileView(_,S);if(_ instanceof WebInspector.HeapSnapshotProxy||_ instanceof WebInspector.HeapSnapshotDiffProxy)return new WebInspector.HeapSnapshotClusterContentView(_,S);if(_ instanceof WebInspector.Collection)return new WebInspector.CollectionContentView(_,S);if("string"==typeof _||_ instanceof String)return new WebInspector.TextContentView(_,S);throw new Error("Can't make a ContentView for an unknown representedObject of type: "+_.constructor.name)}static contentViewForRepresentedObject(_,S,C){let f=WebInspector.ContentView.resolvedRepresentedObjectForRepresentedObject(_);if(!f)return null;let T=f[WebInspector.ContentView.ContentViewForRepresentedObjectSymbol];if(T)return T;if(S)return null;let E=WebInspector.ContentView.createFromRepresentedObject(_,C);return E?(E.representedObject[WebInspector.ContentView.ContentViewForRepresentedObjectSymbol]=E,E):null}static closedContentViewForRepresentedObject(_){let S=WebInspector.ContentView.resolvedRepresentedObjectForRepresentedObject(_);S[WebInspector.ContentView.ContentViewForRepresentedObjectSymbol]=null}static resolvedRepresentedObjectForRepresentedObject(_){return _ instanceof WebInspector.Frame?_.mainResource:(_ instanceof WebInspector.Breakpoint||_ instanceof WebInspector.IssueMessage)&&_.sourceCodeLocation?_.sourceCodeLocation.displaySourceCode:_ instanceof WebInspector.DOMBreakpoint&&_.domNode?WebInspector.ContentView.resolvedRepresentedObjectForRepresentedObject(_.domNode):_ instanceof WebInspector.DOMNode&&_.frame?WebInspector.ContentView.resolvedRepresentedObjectForRepresentedObject(_.frame):_ instanceof WebInspector.DOMSearchMatchObject?WebInspector.frameResourceManager.mainFrame.domTree:_ instanceof WebInspector.SourceCodeSearchMatchObject?_.sourceCode:_}static isViewable(_){return!!(_ instanceof WebInspector.Frame)||!!(_ instanceof WebInspector.Resource)||!!(_ instanceof WebInspector.Script)||!!(_ instanceof WebInspector.CSSStyleSheet)||!!(_ instanceof WebInspector.Canvas)||!!(_ instanceof WebInspector.TimelineRecording)||!!(_ instanceof WebInspector.Timeline)||(_ instanceof WebInspector.Breakpoint||_ instanceof WebInspector.IssueMessage?_.sourceCodeLocation:!!(_ instanceof WebInspector.DOMStorageObject)||!!(_ instanceof WebInspector.CookieStorageObject)||!!(_ instanceof WebInspector.DatabaseTableObject)||!!(_ instanceof WebInspector.DatabaseObject)||!!(_ instanceof WebInspector.IndexedDatabase)||!!(_ instanceof WebInspector.IndexedDatabaseObjectStore)||!!(_ instanceof WebInspector.IndexedDatabaseObjectStoreIndex)||!!(_ instanceof WebInspector.ApplicationCacheFrame)||!!(_ instanceof WebInspector.DOMTree)||!!(_ instanceof WebInspector.DOMSearchMatchObject)||!!(_ instanceof WebInspector.SourceCodeSearchMatchObject)||!!(_ instanceof WebInspector.LogObject)||!!(_ instanceof WebInspector.ContentFlow)||!!(_ instanceof WebInspector.CallingContextTree)||_ instanceof WebInspector.HeapSnapshotProxy||_ instanceof WebInspector.HeapSnapshotDiffProxy||!!(_ instanceof WebInspector.Collection)||"string"==typeof _||_ instanceof String)}get representedObject(){return this._representedObject}get navigationItems(){return[]}get parentContainer(){return this._parentContainer}get visible(){return this._visible}set visible(_){this._visible=_}get scrollableElements(){return[]}get shouldKeepElementsScrolledToBottom(){return!1}get selectionPathComponents(){return[]}get supplementalRepresentedObjects(){return[]}get supportsSplitContentBrowser(){return WebInspector.dockedConfigurationSupportsSplitContentBrowser()}shown(){}hidden(){}closed(){}saveToCookie(){}restoreFromCookie(){}canGoBack(){return!1}canGoForward(){return!1}goBack(){}goForward(){}get supportsSearch(){return!1}get supportsCustomFindBanner(){return!1}showCustomFindBanner(){}get numberOfSearchResults(){return null}get hasPerformedSearch(){return!1}set automaticallyRevealFirstSearchResult(_){}performSearch(){}searchCleared(){}searchQueryWithSelection(){return null}revealPreviousSearchResult(){}revealNextSearchResult(){}},WebInspector.ContentView.Event={SelectionPathComponentsDidChange:"content-view-selection-path-components-did-change",SupplementalRepresentedObjectsDidChange:"content-view-supplemental-represented-objects-did-change",NumberOfSearchResultsDidChange:"content-view-number-of-search-results-did-change",NavigationItemsDidChange:"content-view-navigation-items-did-change"},WebInspector.ContentView.ContentViewForRepresentedObjectSymbol=Symbol("content-view-for-represented-object"),WebInspector.DataGrid=class extends WebInspector.View{constructor(_,S,C,f){if(super(),this.columns=new Map,this.orderedColumns=[],this._settingsIdentifier=null,this._sortColumnIdentifier=null,this._sortColumnIdentifierSetting=null,this._sortOrder=WebInspector.DataGrid.SortOrder.Indeterminate,this._sortOrderSetting=null,this._columnVisibilitySetting=null,this._columnChooserEnabled=!1,this._headerVisible=!0,this._rows=[],this.children=[],this.selectedNode=null,this.expandNodesWhenArrowing=!1,this.root=!0,this.hasChildren=!1,this.expanded=!0,this.revealed=!0,this.selected=!1,this.dataGrid=this,this.indentWidth=15,this.rowHeight=20,this.resizers=[],this._columnWidthsInitialized=!1,this._scrollbarWidth=0,this._cachedScrollTop=NaN,this._cachedScrollableOffsetHeight=NaN,this._previousRevealedRowCount=NaN,this._topDataTableMarginHeight=NaN,this._bottomDataTableMarginHeight=NaN,this._filterText="",this._filterDelegate=null,this._filterDidModifyNodeWhileProcessingItems=!1,this.element.className="data-grid",this.element.tabIndex=0,this.element.addEventListener("keydown",this._keyDown.bind(this),!1),this.element.copyHandler=this,this._headerWrapperElement=document.createElement("div"),this._headerWrapperElement.classList.add("header-wrapper"),this._headerTableElement=document.createElement("table"),this._headerTableElement.className="header",this._headerWrapperElement.appendChild(this._headerTableElement),this._headerTableColumnGroupElement=this._headerTableElement.createChild("colgroup"),this._headerTableBodyElement=this._headerTableElement.createChild("tbody"),this._headerTableRowElement=this._headerTableBodyElement.createChild("tr"),this._headerTableRowElement.addEventListener("contextmenu",this._contextMenuInHeader.bind(this),!0),this._headerTableCellElements=new Map,this._scrollContainerElement=document.createElement("div"),this._scrollContainerElement.className="data-container",this._scrollListener=()=>this._noteScrollPositionChanged(),this._updateScrollListeners(),this._topDataTableMarginElement=this._scrollContainerElement.createChild("div"),this._dataTableElement=this._scrollContainerElement.createChild("table","data"),this._bottomDataTableMarginElement=this._scrollContainerElement.createChild("div"),this._dataTableElement.addEventListener("mousedown",this._mouseDownInDataTable.bind(this)),this._dataTableElement.addEventListener("click",this._clickInDataTable.bind(this)),this._dataTableElement.addEventListener("contextmenu",this._contextMenuInDataTable.bind(this),!0),S&&(this._dataTableElement.addEventListener("dblclick",this._ondblclick.bind(this),!1),this._editCallback=S),C&&(this._deleteCallback=C),this._dataTableColumnGroupElement=this._headerTableColumnGroupElement.cloneNode(!0),this._dataTableElement.appendChild(this._dataTableColumnGroupElement),this.dataTableBodyElement=this._dataTableElement.createChild("tbody"),this._fillerRowElement=this.dataTableBodyElement.createChild("tr","filler"),this.element.appendChild(this._headerWrapperElement),this.element.appendChild(this._scrollContainerElement),f)for(var T of f)this.insertColumn(T,_[T]);else for(var T in _)this.insertColumn(T,_[T]);this._updateScrollbarPadding(),this._copyTextDelimiter="\t"}_updateScrollbarPadding(){if(!this._inline){let _=this._scrollContainerElement.offsetWidth-this._scrollContainerElement.scrollWidth;this._scrollbarWidth===_||(WebInspector.resolvedLayoutDirection()===WebInspector.LayoutDirection.RTL?this._headerWrapperElement.style.setProperty("padding-left",`${_}px`):this._headerWrapperElement.style.setProperty("padding-right",`${_}px`),this._scrollbarWidth=_)}}static createSortableDataGrid(_,S){var f=_.length;if(!f)return null;var T={};for(var E of _)T[E]={width:E.length,title:E,sortable:!0};for(var I=new WebInspector.DataGrid(T,void 0,void 0,_),R=0,N;Rq?1:0}else z=HW?1:0;return z})},this),I.sortOrder=WebInspector.DataGrid.SortOrder.Ascending,I.sortColumnIdentifier=_[0],I}get headerVisible(){return this._headerVisible}set headerVisible(_){_===this._headerVisible||(this._headerVisible=_,this.element.classList.toggle("no-header",!this._headerVisible))}get columnChooserEnabled(){return this._columnChooserEnabled}set columnChooserEnabled(_){this._columnChooserEnabled=_}get refreshCallback(){return this._refreshCallback}set refreshCallback(_){this._refreshCallback=_}get sortOrder(){return this._sortOrder}set sortOrder(_){if(_&&_!==this._sortOrder&&(this._sortOrder=_,this._sortOrderSetting&&(this._sortOrderSetting.value=this._sortOrder),!!this._sortColumnIdentifier)){var S=this._headerTableCellElements.get(this._sortColumnIdentifier);S.classList.toggle(WebInspector.DataGrid.SortColumnAscendingStyleClassName,this._sortOrder===WebInspector.DataGrid.SortOrder.Ascending),S.classList.toggle(WebInspector.DataGrid.SortColumnDescendingStyleClassName,this._sortOrder===WebInspector.DataGrid.SortOrder.Descending),this.dispatchEventToListeners(WebInspector.DataGrid.Event.SortChanged)}}get sortColumnIdentifier(){return this._sortColumnIdentifier}set sortColumnIdentifier(_){if(this._sortColumnIdentifier!==_){let S=this._sortColumnIdentifier;this._sortColumnIdentifier=_,this._updateSortedColumn(S)}}get inline(){return this._inline}set inline(_){this._inline===_||(this._inline=_||!1,this._element.classList.toggle("inline",this._inline),this._updateScrollListeners())}get variableHeightRows(){return this._variableHeightRows}set variableHeightRows(_){this._variableHeightRows===_||(this._variableHeightRows=_||!1,this._element.classList.toggle("variable-height-rows",this._variableHeightRows),this._updateScrollListeners())}get filterText(){return this._filterText}set filterText(_){this._filterText===_||(this._filterText=_,this.filterDidChange())}get filterDelegate(){return this._filterDelegate}set filterDelegate(_){this._filterDelegate=_,this.filterDidChange()}filterDidChange(){this._scheduledFilterUpdateIdentifier||(this._applyFilterToNodesTask&&(this._applyFilterToNodesTask.cancel(),this._applyFilterToNodesTask=null),this._scheduledFilterUpdateIdentifier=requestAnimationFrame(this._updateFilter.bind(this)))}hasFilters(){return this._textFilterRegex||this._hasFilterDelegate()}matchNodeAgainstCustomFilters(_){return!this._hasFilterDelegate()||this._filterDelegate.dataGridMatchNodeAgainstCustomFilters(_)}createSettings(_){if(this._settingsIdentifier!==_&&(this._settingsIdentifier=_,this._sortColumnIdentifierSetting=new WebInspector.Setting(this._settingsIdentifier+"-sort",this._sortColumnIdentifier),this._sortOrderSetting=new WebInspector.Setting(this._settingsIdentifier+"-sort-order",this._sortOrder),this._columnVisibilitySetting=new WebInspector.Setting(this._settingsIdentifier+"-column-visibility",{}),!!this.columns)){this._sortColumnIdentifierSetting.value&&(this.sortColumnIdentifier=this._sortColumnIdentifierSetting.value,this.sortOrder=this._sortOrderSetting.value);let S=this._columnVisibilitySetting.value;for(let C in S){let f=S[C];this.setColumnVisible(C,f)}}}_updateScrollListeners(){this._inline||this._variableHeightRows?(this._scrollContainerElement.removeEventListener("scroll",this._scrollListener),this._scrollContainerElement.removeEventListener("mousewheel",this._scrollListener)):(this._scrollContainerElement.addEventListener("scroll",this._scrollListener),this._scrollContainerElement.addEventListener("mousewheel",this._scrollListener))}_applyFiltersToNodeAndDispatchEvent(_){const S=_.hidden;return this._applyFiltersToNode(_),S!==_.hidden&&this.dispatchEventToListeners(WebInspector.DataGrid.Event.NodeWasFiltered,{node:_}),S!==_.hidden}_applyFiltersToNode(_){if(!this.hasFilters())return _.hidden=!1,void(_.expanded&&_[WebInspector.DataGrid.WasExpandedDuringFilteringSymbol]&&(_[WebInspector.DataGrid.WasExpandedDuringFilteringSymbol]=!1,_.collapse()));let f=_.filterableData||[],T={expandNode:!1},E=this._textFilterRegex;return function(){return f.length&&E?!!f.some(I=>E.test(I))&&(T.expandNode=!0,!0):!0}()&&this.matchNodeAgainstCustomFilters(_)?(function(){_.hidden=!1;for(let I=_.parent;I&&!I.root;)I.hidden=!1,T.expandNode&&!I.expanded&&(I[WebInspector.DataGrid.WasExpandedDuringFilteringSymbol]=!0,I.expand()),I=I.parent}(),void(!T.expandNode&&_.expanded&&_[WebInspector.DataGrid.WasExpandedDuringFilteringSymbol]&&(_[WebInspector.DataGrid.WasExpandedDuringFilteringSymbol]=!1,_.collapse()))):void(_.hidden=!0)}_updateSortedColumn(_){if(this._sortColumnIdentifierSetting&&(this._sortColumnIdentifierSetting.value=this._sortColumnIdentifier),_){let S=this._headerTableCellElements.get(_);S.classList.remove(WebInspector.DataGrid.SortColumnAscendingStyleClassName),S.classList.remove(WebInspector.DataGrid.SortColumnDescendingStyleClassName)}if(this._sortColumnIdentifier){let S=this._headerTableCellElements.get(this._sortColumnIdentifier);S.classList.toggle(WebInspector.DataGrid.SortColumnAscendingStyleClassName,this._sortOrder===WebInspector.DataGrid.SortOrder.Ascending),S.classList.toggle(WebInspector.DataGrid.SortColumnDescendingStyleClassName,this._sortOrder===WebInspector.DataGrid.SortOrder.Descending)}this.dispatchEventToListeners(WebInspector.DataGrid.Event.SortChanged)}_hasFilterDelegate(){return this._filterDelegate&&"function"==typeof this._filterDelegate.dataGridMatchNodeAgainstCustomFilters}_ondblclick(_){this._editing||this._editingNode||this._startEditing(_.target)}_startEditingNodeAtColumnIndex(_,S){this._editing=!0,this._editingNode=_,this._editingNode.select();var C=this._editingNode._element.children[S];WebInspector.startEditing(C,this._startEditingConfig(C)),window.getSelection().setBaseAndExtent(C,0,C,1)}_startEditing(_){var S=_.enclosingNodeOrSelfWithNodeName("td");if(S){if(this._editingNode=this.dataGridNodeFromNode(_),!this._editingNode){if(!this.placeholderNode)return;this._editingNode=this.placeholderNode}return this._editingNode.isPlaceholderNode?this._startEditingNodeAtColumnIndex(this._editingNode,0):void(this._editing=!0,WebInspector.startEditing(S,this._startEditingConfig(S)),window.getSelection().setBaseAndExtent(S,0,S,1))}}_startEditingConfig(_){return new WebInspector.EditingConfig(this._editingCommitted.bind(this),this._editingCancelled.bind(this),_.textContent)}_editingCommitted(_,S,C,f,T){function E(){if("forward"===T){if(Nf[T]&&(f[T]=N.length)}var L=0;for(var T of this.columns.keys())L+=f[T];var D=0;for(var T of this.columns.keys()){var M=Math.round(100*f[T]/L);_&&M<_?(D+=_-M,M=_):S&&M>S&&(D-=M-S,M=S),f[T]=M}for(;_&&0_&&(--f[T],--D,!D))break;for(;S&&0>D;)for(var T of this.columns.keys())if(f[T]=C&&(I.ordinal=R+1)}this.columns.set(_,T),T.disclosure&&(this.disclosureColumnIdentifier=_);var N=document.createElement("col");T.width&&(N.style.width=T.width),T.element=N;var L=this._headerTableColumnGroupElement.children[C];this._headerTableColumnGroupElement.insertBefore(N,L);var D=document.createElement("th");D.className=_+"-column",D.columnIdentifier=_,T.aligned&&D.classList.add(T.aligned),this._headerTableCellElements.set(_,D);var L=this._headerTableRowElement.children[C];if(this._headerTableRowElement.insertBefore(D,L),T.headerView){let F=T.headerView;D.appendChild(F.element),this.addSubview(F)}else{let F=D.createChild("div");T.titleDOMFragment?F.appendChild(T.titleDOMFragment):F.textContent=T.title||""}if(T.sortable&&(f.register(D,"click",this._headerCellClicked),D.classList.add(WebInspector.DataGrid.SortableColumnStyleClassName)),T.group&&D.classList.add("column-group-"+T.group),T.tooltip&&(D.title=T.tooltip),T.collapsesGroup){D.createChild("div","divider");var M=D.createChild("div","collapser-button");M.title=this._collapserButtonCollapseColumnsToolTip(),f.register(M,"mouseover",this._mouseoverColumnCollapser),f.register(M,"mouseout",this._mouseoutColumnCollapser),f.register(M,"click",this._clickInColumnCollapser),D.collapsesGroup=T.collapsesGroup,D.classList.add("collapser")}this._headerTableColumnGroupElement.span=this.orderedColumns.length;var P=N.cloneNode(),L=this._dataTableColumnGroupElement.children[C];this._dataTableColumnGroupElement.insertBefore(P,L),T.bodyElement=P;var O=document.createElement("td");O.className=_+"-column",O.__columnIdentifier=_,T.group&&O.classList.add("column-group-"+T.group);var L=this._fillerRowElement.children[C];this._fillerRowElement.insertBefore(O,L),f.install(),this.setColumnVisible(_,!T.hidden)}removeColumn(_){var S=this.columns.get(_);this.columns.delete(_),this.orderedColumns.splice(this.orderedColumns.indexOf(_),1);var C=S.ordinal;for(var[f,T]of this.columns){var E=T.ordinal;E>C&&(T.ordinal=E-1)}S.listeners.uninstall(!0),S.disclosure&&(this.disclosureColumnIdentifier=void 0),this.sortColumnIdentifier===_&&(this.sortColumnIdentifier=null),this._headerTableCellElements.delete(_),this._headerTableRowElement.children[C].remove(),this._headerTableColumnGroupElement.children[C].remove(),this._dataTableColumnGroupElement.children[C].remove(),this._fillerRowElement.children[C].remove(),this._headerTableColumnGroupElement.span=this.orderedColumns.length;for(var I of this.children)I.refresh()}_enumerateChildren(_,S,C){if(_.root||S.push(_),!!C){for(var f=0;f<_.children.length;++f)this._enumerateChildren(_.children[f],S,C-1);return S}}layout(){if(!this._columnWidthsInitialized&&this.element.offsetWidth){let _=this._headerTableColumnGroupElement.children,S=this._dataTableElement.offsetWidth,C=_.length,f=this._headerTableBodyElement.rows[0].cells,T=[];for(let E=0,I;EI+S)&&(!R||f+TU.revealed&&!U.hidden);this._previousRevealedRowCount=M.length;let P=Math.max(0,Math.floor((f-C)/_)),O=Math.max(0,this._previousRevealedRowCount-P-E),F=P*_,V=O*_;this._topDataTableMarginHeight!==F&&(this._topDataTableMarginHeight=F,this._topDataTableMarginElement.style.height=F+"px"),this._bottomDataTableMarginElement!==V&&(this._bottomDataTableMarginHeight=V,this._bottomDataTableMarginElement.style.height=V+"px"),this._dataTableElement.classList.toggle("odd-first-zebra-stripe",!!(P%2)),this.dataTableBodyElement.removeChildren();for(let U=P,G;U=this.children.length&&(this.hasChildren=!1))}removeChildren(){for(var _=0,S;_{this._selectSortColumnAndSetOrder(f,WebInspector.DataGrid.SortOrder.Ascending)}),(this.sortColumnIdentifier!==f||this.sortOrder!==WebInspector.DataGrid.SortOrder.Descending)&&S.appendItem(WebInspector.UIString("Sort Descending"),()=>{this._selectSortColumnAndSetOrder(f,WebInspector.DataGrid.SortOrder.Descending)})),this._columnChooserEnabled)){let E=!1;for(let[I,R]of this.columns)R.locked||(E||(S.appendSeparator(),E=!0),S.appendCheckboxItem(R.title,()=>{this.setColumnVisible(I,!!R.hidden)},!R.hidden))}}}_contextMenuInDataTable(_){let S=WebInspector.ContextMenu.createFromEvent(_),C=this.dataGridNodeFromNode(_.target);if(C&&C.appendContextMenuItems(S),this.dataGrid._refreshCallback&&(!C||C!==this.placeholderNode)&&S.appendItem(WebInspector.UIString("Refresh"),this._refreshCallback.bind(this)),C){if(C.selectable&&C.copyable&&!C.isEventWithinDisclosureTriangle(_)){if(S.appendItem(WebInspector.UIString("Copy Row"),this._copyRow.bind(this,_.target)),S.appendItem(WebInspector.UIString("Copy Table"),this._copyTable.bind(this)),this.dataGrid._editCallback)if(C===this.placeholderNode)S.appendItem(WebInspector.UIString("Add New"),this._startEditing.bind(this,_.target));else{let f=_.target.enclosingNodeOrSelfWithNodeName("td"),T=f.__columnIdentifier,E=this.dataGrid.columns.get(T).title;S.appendItem(WebInspector.UIString("Edit \u201C%s\u201D").format(E),this._startEditing.bind(this,_.target))}this.dataGrid._deleteCallback&&C!==this.placeholderNode&&S.appendItem(WebInspector.UIString("Delete"),this._deleteCallback.bind(this,C))}(C.children.some(f=>f.hasChildren)||C.hasChildren&&!C.children.length)&&(S.appendSeparator(),S.appendItem(WebInspector.UIString("Expand All"),C.expandRecursively.bind(C)),S.appendItem(WebInspector.UIString("Collapse All"),C.collapseRecursively.bind(C)))}}_clickInDataTable(_){var S=this.dataGridNodeFromNode(_.target);S&&S.hasChildren&&S.isEventWithinDisclosureTriangle(_)&&(S.expanded?_.altKey?S.collapseRecursively():S.collapse():_.altKey?S.expandRecursively():S.expand())}textForDataGridNodeColumn(_,S){var C=_.data[S];return(C instanceof Node?C.textContent:C)||""}set copyTextDelimiter(_){this._copyTextDelimiter=_}_copyTextForDataGridNode(_){let S=_.dataGrid.orderedColumns.map(C=>this.textForDataGridNodeColumn(_,C));return S.join(this._copyTextDelimiter)}_copyTextForDataGridHeaders(){let _=this.orderedColumns.map(S=>this.headerTableHeader(S).textContent);return _.join(this._copyTextDelimiter)}handleBeforeCopyEvent(_){this.selectedNode&&window.getSelection().isCollapsed&&_.preventDefault()}handleCopyEvent(_){if(this.selectedNode&&window.getSelection().isCollapsed){var S=this._copyTextForDataGridNode(this.selectedNode);_.clipboardData.setData("text/plain",S),_.stopPropagation(),_.preventDefault()}}_copyRow(_){var S=this.dataGridNodeFromNode(_);if(S){var C=this._copyTextForDataGridNode(S);InspectorFrontendHost.copyText(C)}}_copyTable(){let _=[this._copyTextForDataGridHeaders()];for(let S of this.children)S.copyable&&_.push(this._copyTextForDataGridNode(S));InspectorFrontendHost.copyText(_.join("\n"))}_hasCopyableData(){let _=this.children[0];return _&&_.selectable&&_.copyable}get resizeMethod(){return this._resizeMethod?this._resizeMethod:WebInspector.DataGrid.ResizeMethod.Nearest}set resizeMethod(_){this._resizeMethod=_}resizerDragStarted(_){return!_[WebInspector.DataGrid.NextColumnOrdinalSymbol]||void(this._currentResizer=_)}resizerDragging(_,S){if(_===this._currentResizer){let C=WebInspector.resolvedLayoutDirection()===WebInspector.LayoutDirection.RTL;C&&(S*=-1);let f=0;f+=C?this.element.totalOffsetRight-_.initialPosition-S:_.initialPosition-this.element.totalOffsetLeft-S;var T=_[WebInspector.DataGrid.PreviousColumnOrdinalSymbol],E=_[WebInspector.DataGrid.NextColumnOrdinalSymbol],I=this._headerTableBodyElement.rows[0].cells;let R=0;for(let H=0;H_.refresh())}updateLayout(){}createCell(_){var S=document.createElement("td");S.className=_+"-column",S.__columnIdentifier=_;var C=S.createChild("div","cell-content"),f=this.createCellContent(_,S);C.append(f);let T=this.dataGrid.columns.get(_);if(T&&(T.aligned&&S.classList.add(T.aligned),T.group&&S.classList.add("column-group-"+T.group),T.icon)){let E=document.createElement("div");E.classList.add("icon"),C.insertBefore(E,C.firstChild)}return _===this.dataGrid.disclosureColumnIdentifier&&(S.classList.add("disclosure"),this.indentPadding&&(WebInspector.resolvedLayoutDirection()===WebInspector.LayoutDirection.RTL?S.style.setProperty("padding-right",`${this.indentPadding}px`):S.style.setProperty("padding-left",`${this.indentPadding}px`))),S}createCellContent(_){if(!(_ in this.data))return zeroWidthSpace;let S=this.data[_];return"number"==typeof S?S.maxDecimals(2).toLocaleString():S}elementWithColumnIdentifier(_){if(!this.dataGrid)return null;let S=this.dataGrid.orderedColumns.indexOf(_);return-1===S?null:this.element.children[S]}appendChild(){return WebInspector.DataGrid.prototype.appendChild.apply(this,arguments)}insertChild(){return WebInspector.DataGrid.prototype.insertChild.apply(this,arguments)}removeChild(){return WebInspector.DataGrid.prototype.removeChild.apply(this,arguments)}removeChildren(){return WebInspector.DataGrid.prototype.removeChildren.apply(this,arguments)}removeChildrenRecursive(){return WebInspector.DataGrid.prototype.removeChildrenRecursive.apply(this,arguments)}_recalculateSiblings(_){if(this.parent){var S=0<_?this.parent.children[_-1]:null;S?(S.nextSibling=this,this.previousSibling=S):this.previousSibling=null;var C=this.parent.children[_+1];C?(C.previousSibling=this,this.nextSibling=C):this.nextSibling=null}}collapse(){this._element&&this._element.classList.remove("expanded"),this._expanded=!1;for(var _=0;_=f&&_.pageX<=f+this.disclosureToggleWidth}_attach(){if(this.dataGrid&&!this._attached){this._attached=!0;let _=-1;if(!this.isPlaceholderNode){var S=this.traversePreviousNode(!0,!0);_=this.dataGrid._rows.indexOf(S),-1==_?_=0:_++}if(-1===_?this.dataGrid._rows.push(this):this.dataGrid._rows.insertAtIndex(this,_),this.dataGrid._noteRowsChanged(),this.expanded)for(var C=0;Cthis._truncatedDisplayNameLength&&(_=_.substring(0,this._truncatedDisplayNameLength)+ellipsis),this._element.title=this._displayName,this._titleContentElement.textContent=_}_updateSelectElement(){function _(f){let T=document.createElement("option"),E=130;return T.textContent=f.displayName.length<=E?f.displayName:f.displayName.substring(0,E)+ellipsis,T._pathComponent=f,T}this._selectElement.removeChildren();let S=0,C=this.previousSibling;for(;C;)this._selectElement.insertBefore(_(C),this._selectElement.firstChild),C=C.previousSibling,++S;for(this._selectElement.appendChild(_(this)),C=this.nextSibling;C;)this._selectElement.appendChild(_(C)),C=C.nextSibling;this._selectElement.selectedIndex=1===this._selectElement.options.length?-1:S}_selectElementMouseOver(){"function"==typeof this.mouseOver&&this.mouseOver()}_selectElementMouseOut(){"function"==typeof this.mouseOut&&this.mouseOut()}_selectElementMouseDown(){this._updateSelectElement()}_selectElementMouseUp(){this.dispatchEventToListeners(WebInspector.HierarchicalPathComponent.Event.Clicked,{pathComponent:this.selectedPathComponent})}_selectElementSelectionChanged(){this.dispatchEventToListeners(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected,{pathComponent:this.selectedPathComponent})}},WebInspector.HierarchicalPathComponent.MinimumWidth=32,WebInspector.HierarchicalPathComponent.MinimumWidthCollapsed=24,WebInspector.HierarchicalPathComponent.MinimumWidthForOneCharacterTruncatedTitle=54,WebInspector.HierarchicalPathComponent.SelectorArrowsWidth=12,WebInspector.HierarchicalPathComponent.Event={SiblingWasSelected:"hierarchical-path-component-sibling-was-selected",Clicked:"hierarchical-path-component-clicked"},WebInspector.NavigationItem=class extends WebInspector.Object{constructor(_,S,C){super(),this._identifier=_||null,this._element=document.createElement("div"),this._hidden=!1,this._parentNavigationBar=null,S&&this._element.setAttribute("role",S),C&&this._element.setAttribute("aria-label",C),this._element.classList.add(...this._classNames),this._element.navigationItem=this}get identifier(){return this._identifier}get element(){return this._element}get minimumWidth(){return this._element.realOffsetWidth}get parentNavigationBar(){return this._parentNavigationBar}updateLayout(){}get hidden(){return this._hidden}set hidden(_){this._hidden===_||(this._hidden=_,this._element.classList.toggle("hidden",_),this._parentNavigationBar&&this._parentNavigationBar.needsLayout())}get _classNames(){var _=["item"];return this._identifier&&_.push(this._identifier),this.additionalClassNames instanceof Array&&(_=_.concat(this.additionalClassNames)),_}},WebInspector.Popover=class extends WebInspector.Object{constructor(_){super(),this.delegate=_,this._edge=null,this._frame=new WebInspector.Rect,this._content=null,this._targetFrame=new WebInspector.Rect,this._anchorPoint=new WebInspector.Point,this._preferredEdges=null,this._resizeHandler=null,this._contentNeedsUpdate=!1,this._dismissing=!1,this._element=document.createElement("div"),this._element.className="popover",this._element.addEventListener("transitionend",this,!0),this._container=this._element.appendChild(document.createElement("div")),this._container.className="container"}get element(){return this._element}get frame(){return this._frame}get visible(){return this._element.parentNode===document.body&&!this._element.classList.contains(WebInspector.Popover.FadeOutClassName)}set frame(_){this._element.style.left=_.minX()+"px",this._element.style.top=_.minY()+"px",this._element.style.width=_.size.width+"px",this._element.style.height=_.size.height+"px",this._element.style.backgroundSize=_.size.width+"px "+_.size.height+"px",this._frame=_}set content(_){_===this._content||(this._content=_,this._contentNeedsUpdate=!0,this.visible&&this._update(!0))}set windowResizeHandler(_){this._resizeHandler=_}update(_=!0){if(this.visible){var S=document.activeElement;this._contentNeedsUpdate=!0,this._update(_),S&&S.focus()}}present(_,S){this._targetFrame=_,this._preferredEdges=S;this._content&&(this._addListenersIfNeeded(),this._update())}presentNewContentWithFrame(_,S,C){this._content=_,this._contentNeedsUpdate=!0,this._targetFrame=S,this._preferredEdges=C,this._addListenersIfNeeded();var f=this.visible;this._update(f)}dismiss(){this._dismissing||this._element.parentNode!==document.body||(this._dismissing=!0,this._isListeningForPopoverEvents=!1,window.removeEventListener("mousedown",this,!0),window.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this,!0),window.removeEventListener("keypress",this,!0),WebInspector.quickConsole.keyboardShortcutDisabled=!1,this._element.classList.add(WebInspector.Popover.FadeOutClassName),this.delegate&&"function"==typeof this.delegate.willDismissPopover&&this.delegate.willDismissPopover(this))}handleEvent(_){switch(_.type){case"mousedown":case"scroll":this._element.contains(_.target)||_.target.enclosingNodeOrSelfWithClass(WebInspector.Popover.IgnoreAutoDismissClassName)||_[WebInspector.Popover.EventPreventDismissSymbol]||this.dismiss();break;case"resize":this._resizeHandler&&this._resizeHandler();break;case"keypress":_.keyCode===WebInspector.KeyboardShortcut.Key.Escape.keyCode&&this.dismiss();break;case"transitionend":if(_.target===this._element){document.body.removeChild(this._element),this._element.classList.remove(WebInspector.Popover.FadeOutClassName),this._container.textContent="",this.delegate&&"function"==typeof this.delegate.didDismissPopover&&this.delegate.didDismissPopover(this),this._dismissing=!1;break}}}_update(_){function S(W){return W.width*W.height}if(_)var C=this._edge;var f=this._targetFrame,T=this._preferredEdges;if(this._element.parentNode===document.body?this._element.classList.remove(WebInspector.Popover.FadeOutClassName):document.body.appendChild(this._element),this._dismissing=!1,this._contentNeedsUpdate){this._element.style.removeProperty("left"),this._element.style.removeProperty("top"),this._element.style.removeProperty("width"),this._element.style.removeProperty("height"),null!==this._edge&&this._element.classList.remove(this._cssClassNameForEdge()),this._container.replaceWith(this._content);var E=this._element.getBoundingClientRect();this._preferredSize=new WebInspector.Size(Math.ceil(E.width),Math.ceil(E.height))}var I="mac"===WebInspector.Platform.name&&10<=WebInspector.Platform.version.release?22:0,R=new WebInspector.Rect(0,I,window.innerWidth,window.innerHeight-I);R=R.inset(WebInspector.Popover.ShadowEdgeInsets);var N=Array(T.length);for(var L in WebInspector.RectEdge){var D=WebInspector.RectEdge[L],M={edge:D,metrics:this._bestMetricsForEdge(this._preferredSize,f,R,D)},P=T.indexOf(D);-1===P?N.push(M):N[P]=M}for(var O=N[0].edge,F=N[0].metrics,V=1,U;VS(F.contentSize)&&(O=N[V].edge,F=U);var H=F.frame.round(),G;this._edge=O,H===WebInspector.Rect.ZERO_RECT?this.dismiss():(O===WebInspector.RectEdge.MIN_X?G=new WebInspector.Point(H.size.width-WebInspector.Popover.ShadowPadding,f.midY()-H.minY()):O===WebInspector.RectEdge.MAX_X?G=new WebInspector.Point(WebInspector.Popover.ShadowPadding,f.midY()-H.minY()):O===WebInspector.RectEdge.MIN_Y?G=new WebInspector.Point(f.midX()-H.minX(),H.size.height-WebInspector.Popover.ShadowPadding):O===WebInspector.RectEdge.MAX_Y?G=new WebInspector.Point(f.midX()-H.minX(),WebInspector.Popover.ShadowPadding):void 0,this._element.classList.add(this._cssClassNameForEdge()),_&&this._edge===C?this._animateFrame(H,G):(this.frame=H,this._setAnchorPoint(G),this._drawBackground()),this._preferredSize.widthD&&requestAnimationFrame(f.bind(this))}var T=Date.now(),E=350,R=new WebInspector.CubicBezier(0.25,0.1,0.25,1),N=this._frame.copy(),L=this._anchorPoint.copy();f.call(this)}_drawBackground(){var _=window.devicePixelRatio,S=this._frame.size.width,C=this._frame.size.height,f=S*_,T=C*_,E=document.createElement("canvas");E.width=f,E.height=T;var I=E.getContext("2d");I.scale(_,_);var R,N=WebInspector.Popover.AnchorSize.height;switch(this._edge){case WebInspector.RectEdge.MIN_X:R=new WebInspector.Rect(0,0,S-N,C);break;case WebInspector.RectEdge.MAX_X:R=new WebInspector.Rect(N,0,S-N,C);break;case WebInspector.RectEdge.MIN_Y:R=new WebInspector.Rect(0,0,S,C-N);break;case WebInspector.RectEdge.MAX_Y:R=new WebInspector.Rect(0,N,S,C-N);}R=R.inset(WebInspector.Popover.ShadowEdgeInsets),I.fillStyle="black",this._drawFrame(I,R,this._edge,this._anchorPoint),I.clip();var L=I.createLinearGradient(0,0,0,C);L.addColorStop(0,"rgba(255, 255, 255, 0.95)"),L.addColorStop(1,"rgba(235, 235, 235, 0.95)"),I.fillStyle=L,I.fillRect(0,0,S,C),I.strokeStyle="rgba(0, 0, 0, 0.25)",I.lineWidth=2,this._drawFrame(I,R,this._edge,this._anchorPoint),I.stroke();let D=document.getCSSCanvasContext("2d","popover",f,T);D.clearRect(0,0,f,T),D.shadowOffsetX=1,D.shadowOffsetY=1,D.shadowBlur=5,D.shadowColor="rgba(0, 0, 0, 0.5)",D.drawImage(E,0,0,f,T)}_bestMetricsForEdge(_,S,C,f){var I=_.width+2*WebInspector.Popover.ShadowPadding+2*WebInspector.Popover.ContentPadding,R=_.height+2*WebInspector.Popover.ShadowPadding+2*WebInspector.Popover.ContentPadding,N=WebInspector.Popover.AnchorSize.height,T,E;f===WebInspector.RectEdge.MIN_X?(I+=N,T=S.origin.x-I+WebInspector.Popover.ShadowPadding,E=S.origin.y-(R-S.size.height)/2):f===WebInspector.RectEdge.MAX_X?(I+=N,T=S.origin.x+S.size.width-WebInspector.Popover.ShadowPadding,E=S.origin.y-(R-S.size.height)/2):f===WebInspector.RectEdge.MIN_Y?(R+=N,T=S.origin.x-(I-S.size.width)/2,E=S.origin.y-R+WebInspector.Popover.ShadowPadding):f===WebInspector.RectEdge.MAX_Y?(R+=N,T=S.origin.x-(I-S.size.width)/2,E=S.origin.y+S.size.height-WebInspector.Popover.ShadowPadding):void 0,f===WebInspector.RectEdge.MIN_X||f===WebInspector.RectEdge.MAX_X?(EC.maxY()&&(E=C.maxY()-R)):(TC.maxX()&&(T=C.maxX()-I));var L=new WebInspector.Rect(T,E,I,R),D=L.intersectionWithRect(C);return I=D.size.width-2*WebInspector.Popover.ShadowPadding,R=D.size.height-2*WebInspector.Popover.ShadowPadding,(f===WebInspector.RectEdge.MIN_X||f===WebInspector.RectEdge.MAX_X?I-=N:f===WebInspector.RectEdge.MIN_Y||f===WebInspector.RectEdge.MAX_Y?R-=N:void 0,{frame:D,contentSize:new WebInspector.Size(I,R)})}_drawFrame(_,S,C){let f=WebInspector.Popover.CornerRadius,T=0.5*WebInspector.Popover.AnchorSize.width,E=this._anchorPoint,I=f+T;C===WebInspector.RectEdge.MIN_Y||C===WebInspector.RectEdge.MAX_Y?E.x=Number.constrain(E.x,S.minX()+I,S.maxX()-I):E.y=Number.constrain(E.y,S.minY()+I,S.maxY()-I),_.beginPath();C===WebInspector.RectEdge.MIN_X?(_.moveTo(S.maxX(),S.minY()+f),_.lineTo(S.maxX(),E.y-T),_.lineTo(E.x,E.y),_.lineTo(S.maxX(),E.y+T),_.arcTo(S.maxX(),S.maxY(),S.minX(),S.maxY(),f),_.arcTo(S.minX(),S.maxY(),S.minX(),S.minY(),f),_.arcTo(S.minX(),S.minY(),S.maxX(),S.minY(),f),_.arcTo(S.maxX(),S.minY(),S.maxX(),S.maxY(),f)):C===WebInspector.RectEdge.MAX_X?(_.moveTo(S.minX(),S.maxY()-f),_.lineTo(S.minX(),E.y+T),_.lineTo(E.x,E.y),_.lineTo(S.minX(),E.y-T),_.arcTo(S.minX(),S.minY(),S.maxX(),S.minY(),f),_.arcTo(S.maxX(),S.minY(),S.maxX(),S.maxY(),f),_.arcTo(S.maxX(),S.maxY(),S.minX(),S.maxY(),f),_.arcTo(S.minX(),S.maxY(),S.minX(),S.minY(),f)):C===WebInspector.RectEdge.MIN_Y?(_.moveTo(S.maxX()-f,S.maxY()),_.lineTo(E.x+T,S.maxY()),_.lineTo(E.x,E.y),_.lineTo(E.x-T,S.maxY()),_.arcTo(S.minX(),S.maxY(),S.minX(),S.minY(),f),_.arcTo(S.minX(),S.minY(),S.maxX(),S.minY(),f),_.arcTo(S.maxX(),S.minY(),S.maxX(),S.maxY(),f),_.arcTo(S.maxX(),S.maxY(),S.minX(),S.maxY(),f)):C===WebInspector.RectEdge.MAX_Y?(_.moveTo(S.minX()+f,S.minY()),_.lineTo(E.x-T,S.minY()),_.lineTo(E.x,E.y),_.lineTo(E.x+T,S.minY()),_.arcTo(S.maxX(),S.minY(),S.maxX(),S.maxY(),f),_.arcTo(S.maxX(),S.maxY(),S.minX(),S.maxY(),f),_.arcTo(S.minX(),S.maxY(),S.minX(),S.minY(),f),_.arcTo(S.minX(),S.minY(),S.maxX(),S.minY(),f)):void 0;_.closePath()}_addListenersIfNeeded(){this._isListeningForPopoverEvents||(this._isListeningForPopoverEvents=!0,window.addEventListener("mousedown",this,!0),window.addEventListener("scroll",this,!0),window.addEventListener("resize",this,!0),window.addEventListener("keypress",this,!0),WebInspector.quickConsole.keyboardShortcutDisabled=!0)}},WebInspector.Popover.FadeOutClassName="fade-out",WebInspector.Popover.CornerRadius=5,WebInspector.Popover.MinWidth=40,WebInspector.Popover.MinHeight=40,WebInspector.Popover.ShadowPadding=5,WebInspector.Popover.ContentPadding=5,WebInspector.Popover.AnchorSize=new WebInspector.Size(22,11),WebInspector.Popover.ShadowEdgeInsets=new WebInspector.EdgeInsets(WebInspector.Popover.ShadowPadding),WebInspector.Popover.IgnoreAutoDismissClassName="popover-ignore-auto-dismiss",WebInspector.Popover.EventPreventDismissSymbol=Symbol("popover-event-prevent-dismiss"),WebInspector.SidebarPanel=class extends WebInspector.View{constructor(_,S){super(),this._identifier=_,this._displayName=S,this._selected=!1,this._savedScrollPosition=0,this.element.classList.add("panel",_),this.element.setAttribute("role","group"),this.element.setAttribute("aria-label",S),this._contentView=new WebInspector.View,this._contentView.element.classList.add("content"),this.addSubview(this._contentView)}get identifier(){return this._identifier}get contentView(){return this._contentView}get displayName(){return this._displayName}get visible(){return this.selected&&this.parentSidebar&&!this.parentSidebar.collapsed}get selected(){return this._selected}set selected(_){_===this._selected||(this._selected=_||!1,this.element.classList.toggle("selected",this._selected))}get parentSidebar(){return this.parentView}get minimumWidth(){return 0}show(){this.parentSidebar&&(this.parentSidebar.collapsed=!1,this.parentSidebar.selectedSidebarPanel=this)}hide(){this.parentSidebar&&(this.parentSidebar.collapsed=!0,this.parentSidebar.selectedSidebarPanel=null)}added(){}removed(){}shown(){this._contentView.element.scrollTop=this._savedScrollPosition,this.updateLayoutIfNeeded()}hidden(){this._savedScrollPosition=this._contentView.element.scrollTop}visibilityDidChange(){}},WebInspector.StyleDetailsPanel=class extends WebInspector.View{constructor(_,S,C,f){super(),this._delegate=_||null,this.element.classList.add(S,"offset-sections"),this._navigationInfo={identifier:C,label:f},this._nodeStyles=null,this._visible=!1}get navigationInfo(){return this._navigationInfo}get nodeStyles(){return this._nodeStyles}shown(){this._visible||(this._visible=!0,this._refreshNodeStyles(),this.updateLayoutIfNeeded())}hidden(){this._visible=!1,this.cancelLayout()}markAsNeedsRefresh(_){if(_){if(!this._nodeStyles||this._nodeStyles.node!==_){if(this._nodeStyles&&(this._nodeStyles.removeEventListener(WebInspector.DOMNodeStyles.Event.Refreshed,this.nodeStylesRefreshed,this),this._nodeStyles.removeEventListener(WebInspector.DOMNodeStyles.Event.NeedsRefresh,this._nodeStylesNeedsRefreshed,this)),this._nodeStyles=WebInspector.cssStyleManager.stylesForNode(_),!this._nodeStyles)return;this._nodeStyles.addEventListener(WebInspector.DOMNodeStyles.Event.Refreshed,this.nodeStylesRefreshed,this),this._nodeStyles.addEventListener(WebInspector.DOMNodeStyles.Event.NeedsRefresh,this._nodeStylesNeedsRefreshed,this),this._forceSignificantChange=!0}this._visible&&this._refreshNodeStyles()}}refresh(){this.dispatchEventToListeners(WebInspector.StyleDetailsPanel.Event.Refreshed)}nodeStylesRefreshed(_){this._visible&&this._refreshPreservingScrollPosition(_.data.significantChange)}get _initialScrollOffset(){return WebInspector.cssStyleManager.canForcePseudoClasses()?this.nodeStyles.node.enabledPseudoClasses.length?0:WebInspector.CSSStyleDetailsSidebarPanel.NoForcedPseudoClassesScrollOffset:0}_refreshNodeStyles(){this._nodeStyles&&this._nodeStyles.refresh()}_refreshPreservingScrollPosition(_){_=this._forceSignificantChange||_||!1;var S=this._initialScrollOffset;this.element.parentNode&&this._previousRefreshNodeIdentifier===this._nodeStyles.node.id&&(S=this.element.parentNode.scrollTop),this.refresh(_),this._previousRefreshNodeIdentifier=this._nodeStyles.node.id,this.element.parentNode&&(this.element.parentNode.scrollTop=S),this._forceSignificantChange=!1}_nodeStylesNeedsRefreshed(){this._visible&&this._refreshNodeStyles()}},WebInspector.StyleDetailsPanel.Event={Refreshed:"style-details-panel-refreshed"},WebInspector.TabBar=class extends WebInspector.View{constructor(_,S){if(super(_),this.element.classList.add("tab-bar"),this.element.setAttribute("role","tablist"),this.element.addEventListener("mousedown",this._handleMouseDown.bind(this)),this.element.addEventListener("click",this._handleClick.bind(this)),this.element.addEventListener("mouseleave",this._handleMouseLeave.bind(this)),this.element.createChild("div","top-border"),this._tabBarItems=[],S)for(let C in S)this.addTabBarItem(C);this.addTabBarItem(WebInspector.settingsTabContentView.tabBarItem,{suppressAnimations:!0}),this._newTabTabBarItem=new WebInspector.PinnedTabBarItem("Images/NewTabPlus.svg",WebInspector.UIString("Create a new tab")),this._newTabTabBarItem.element.addEventListener("mouseenter",this._handleNewTabMouseEnter.bind(this)),this._newTabTabBarItem.element.addEventListener("click",this._handleNewTabClick.bind(this)),this.addTabBarItem(this._newTabTabBarItem,{suppressAnimations:!0})}get newTabTabBarItem(){return this._newTabTabBarItem}updateNewTabTabBarItemState(){let _=!WebInspector.isNewTabWithTypeAllowed(WebInspector.NewTabContentView.Type);this._newTabTabBarItem.disabled=_}addTabBarItem(_,S={}){return this.insertTabBarItem(_,this._tabBarItems.length,S)}insertTabBarItem(_,S,C={}){function f(){this.element.classList.add("animating"),this.element.classList.add("inserting-tab"),this._applyTabBarItemSizesAndPositions(N),this.element.addEventListener("webkitTransitionEnd",L)}function T(){this.element.classList.remove("static-layout"),this.element.classList.remove("animating"),this.element.classList.remove("inserting-tab"),_.element.classList.remove("being-inserted"),this._clearTabBarItemSizesAndPositions(),this.element.removeEventListener("webkitTransitionEnd",L)}if(!(_ instanceof WebInspector.TabBarItem))return null;if(_.parentTabBar===this)return null;if(this._tabAnimatedClosedSinceMouseEnter)return this._finishExpandingTabsAfterClose().then(()=>{this.insertTabBarItem(_,S,C)}),null;_.parentTabBar&&_.parentTabBar.removeTabBarItem(_),_.parentTabBar=this,S=Number.constrain(S,0,this.normalTabCount),this.element.classList.contains("animating")&&(requestAnimationFrame(T.bind(this)),C.suppressAnimations=!0);var E;C.suppressAnimations||(E=this._recordTabBarItemSizesAndPositions()),this._tabBarItems.splice(S,0,_);var I=this._tabBarItems[S+1];let R=I?I.element:this._tabBarItems.lastValue.element;if(this.element.isAncestor(R)?this.element.insertBefore(_.element,R):this.element.appendChild(_.element),this.element.classList.toggle("single-tab",!this._hasMoreThanOneNormalTab()),_.element.style.left=null,_.element.style.width=null,!C.suppressAnimations){var N=this._recordTabBarItemSizesAndPositions();this.updateLayout();let D=this._tabBarItemsFromLeftToRight(),M=D[D.indexOf(_)-1]||null,P=M?E.get(M):null;P?E.set(_,{left:P.left+P.width,width:0}):E.set(_,{left:0,width:0}),this.element.classList.add("static-layout"),_.element.classList.add("being-inserted"),this._applyTabBarItemSizesAndPositions(E);var L=T.bind(this);requestAnimationFrame(f.bind(this))}else this.needsLayout();return _ instanceof WebInspector.PinnedTabBarItem||this.updateNewTabTabBarItemState(),this.dispatchEventToListeners(WebInspector.TabBar.Event.TabBarItemAdded,{tabBarItem:_}),_}removeTabBarItem(_,S={}){function C(){this.element.classList.add("animating"),this.element.classList.add("closing-tab");let O=0;if(WebInspector.resolvedLayoutDirection()===WebInspector.LayoutDirection.RTL){O=this.element.getBoundingClientRect().width;for(let V of this._tabBarItemsFromLeftToRight())O-=V.element.getBoundingClientRect().width}let F=0;for(let V of this._tabBarItemsFromLeftToRight()){let U=R.get(V);V instanceof WebInspector.PinnedTabBarItem?F=U.left+U.width:(V.element.style.left=O+F+"px",F+=U.width,M=V)}this._selectedTabBarItem&&(this._selectedTabBarItem.element.style.width=parseFloat(this._selectedTabBarItem.element.style.width)+1+"px"),M!==this._selectedTabBarItem&&(M.element.style.width=parseFloat(M.element.style.width)+1+"px"),this.element.addEventListener("webkitTransitionEnd",P)}function f(){this._selectedTabBarItem&&this._selectedTabBarItem!==M&&(this._selectedTabBarItem.element.style.width=parseFloat(this._selectedTabBarItem.element.style.width)-1+"px"),this.element.classList.remove("animating"),this.element.classList.remove("closing-tab"),this.updateLayout(),this.element.removeEventListener("webkitTransitionEnd",P)}let T=this._findTabBarItem(_);if(!T||T instanceof WebInspector.PinnedTabBarItem)return null;if(T.parentTabBar=null,this._selectedTabBarItem===T){var E=this._tabBarItems.indexOf(T),I=this._tabBarItems[E+1];(!I||I instanceof WebInspector.PinnedTabBarItem)&&(I=this._tabBarItems[E-1]),this.selectedTabBarItem=I}this.element.classList.contains("animating")&&(requestAnimationFrame(f.bind(this)),S.suppressAnimations=!0);var R;S.suppressAnimations||(R=this._recordTabBarItemSizesAndPositions());let N=this._tabBarItems.indexOf(T)===this.normalTabCount-1;this._tabBarItems.remove(T),T.element.remove();var L=this._hasMoreThanOneNormalTab();this.element.classList.toggle("single-tab",!L);const D=!T.isDefaultTab&&!this.normalTabCount;if(D&&(S.suppressAnimations=!0),!L||N||!S.suppressExpansion)return S.suppressAnimations?this.needsLayout():(this._tabAnimatedClosedSinceMouseEnter=!0,this._finishExpandingTabsAfterClose(R)),this.updateNewTabTabBarItemState(),this.dispatchEventToListeners(WebInspector.TabBar.Event.TabBarItemRemoved,{tabBarItem:T}),D&&this._openDefaultTab(),T;var M;if(!S.suppressAnimations){this.element.classList.add("static-layout"),this._tabAnimatedClosedSinceMouseEnter=!0,this._applyTabBarItemSizesAndPositions(R);var P=f.bind(this);requestAnimationFrame(C.bind(this))}else this.needsLayout();return this.updateNewTabTabBarItemState(),this.dispatchEventToListeners(WebInspector.TabBar.Event.TabBarItemRemoved,{tabBarItem:T}),D&&this._openDefaultTab(),T}selectPreviousTab(){if(!(1>=this._tabBarItems.length)){var _=this._tabBarItems.indexOf(this._selectedTabBarItem),S=_;do if(0===S?S=this._tabBarItems.length-1:S--,!(this._tabBarItems[S]instanceof WebInspector.PinnedTabBarItem))break;while(S!==_);S===_||(this.selectedTabBarItem=this._tabBarItems[S])}}selectNextTab(){if(!(1>=this._tabBarItems.length)){var _=this._tabBarItems.indexOf(this._selectedTabBarItem),S=_;do if(S===this._tabBarItems.length-1?S=0:S++,!(this._tabBarItems[S]instanceof WebInspector.PinnedTabBarItem))break;while(S!==_);S===_||(this.selectedTabBarItem=this._tabBarItems[S])}}get selectedTabBarItem(){return this._selectedTabBarItem}set selectedTabBarItem(_){let S=this._findTabBarItem(_);S===this._newTabTabBarItem&&(S=this._tabBarItems[this.normalTabCount-1]);this._selectedTabBarItem===S||(this._selectedTabBarItem&&(this._selectedTabBarItem.selected=!1),this._selectedTabBarItem=S||null,this._selectedTabBarItem&&(this._selectedTabBarItem.selected=!0),this.dispatchEventToListeners(WebInspector.TabBar.Event.TabBarItemSelected))}get tabBarItems(){return this._tabBarItems}get normalTabCount(){return this._tabBarItems.filter(_=>!(_ instanceof WebInspector.PinnedTabBarItem)).length}layout(){if(!this.element.classList.contains("static-layout")){this.element.classList.remove("hide-titles"),this.element.classList.remove("collapsed");let _=null;for(let S of this._tabBarItems)if(!(S instanceof WebInspector.PinnedTabBarItem)){_=S;break}_&&(120<=_.element.offsetWidth||(this.element.classList.add("collapsed"),75<=_.element.offsetWidth||this.element.classList.add("hide-titles")))}}_tabBarItemsFromLeftToRight(){return WebInspector.resolvedLayoutDirection()===WebInspector.LayoutDirection.LTR?this._tabBarItems:this._tabBarItems.slice().reverse()}_findTabBarItem(_){return"number"==typeof _?this._tabBarItems[_]||null:_ instanceof WebInspector.TabBarItem&&this._tabBarItems.includes(_)?_:null}_hasMoreThanOneNormalTab(){let _=0;for(let S of this._tabBarItems)if(!(S instanceof WebInspector.PinnedTabBarItem)&&(++_,2<=_))return!0;return!1}_openDefaultTab(){this.dispatchEventToListeners(WebInspector.TabBar.Event.OpenDefaultTab)}_recordTabBarItemSizesAndPositions(){var _=new Map;const S=this.element.getBoundingClientRect();for(var C of this._tabBarItems){var f=C.element.getBoundingClientRect();_.set(C,{left:f.left-S.left,width:f.width})}return _}_applyTabBarItemSizesAndPositions(_,S){for(var[C,f]of _)S&&C===S||(C.element.style.left=f.left+"px",C.element.style.width=f.width+"px")}_clearTabBarItemSizesAndPositions(_){for(var S of this._tabBarItems)_&&S===_||(S.element.style.left=null,S.element.style.width=null)}_finishExpandingTabsAfterClose(_){return new Promise(function(S){this._tabAnimatedClosedSinceMouseEnter=!1,_||(_=this._recordTabBarItemSizesAndPositions()),this.element.classList.remove("static-layout"),this._clearTabBarItemSizesAndPositions();var E=this._recordTabBarItemSizesAndPositions();this._applyTabBarItemSizesAndPositions(_),this.element.classList.add("static-layout");var I=function(){this.element.classList.remove("static-layout"),this.element.classList.remove("animating"),this.element.classList.remove("expanding-tabs"),this._clearTabBarItemSizesAndPositions(),this.updateLayout(),this.element.removeEventListener("webkitTransitionEnd",I),S()}.bind(this);requestAnimationFrame(function(){this.element.classList.add("static-layout"),this.element.classList.add("animating"),this.element.classList.add("expanding-tabs"),this._applyTabBarItemSizesAndPositions(E),this.element.addEventListener("webkitTransitionEnd",I)}.bind(this))}.bind(this))}_handleMouseDown(_){if(!(0!==_.button||_.ctrlKey)){let S=_.target.enclosingNodeOrSelfWithClass(WebInspector.TabBarItem.StyleClassName);if(S){let C=S[WebInspector.TabBarItem.ElementReferenceSymbol];if(C&&!C.disabled&&C!==this._newTabTabBarItem){let f=_.target.enclosingNodeOrSelfWithClass(WebInspector.TabBarItem.CloseButtonStyleClassName);if(!f&&(this.selectedTabBarItem=C,!(C instanceof WebInspector.PinnedTabBarItem)&&this._hasMoreThanOneNormalTab())){this._firstNormalTabItemIndex=0;for(let T=0;TI.right)){E=this._tabBarItems.indexOf(D);break}}if(E=Number.constrain(E,this._firstNormalTabItemIndex,this.normalTabCount-1),T!==E){this._tabBarItems.splice(T,1),this._tabBarItems.splice(E,0,this._selectedTabBarItem);let R=this._tabBarItems[E+1],N=R?R.element:this._newTabTabBarItem.element;this.element.insertBefore(this._selectedTabBarItem.element,N);let L=0;for(let D of this._tabBarItemsFromLeftToRight())D!==this._selectedTabBarItem&&D!==this._newTabTabBarItem&&parseFloat(D.element.style.left)!==L&&(D.element.style.left=L+"px"),L+=parseFloat(D.element.style.width)}}}_handleMouseUp(_){if(this._mouseIsDown){if(this.element.classList.remove("dragging-tab"),!this._tabAnimatedClosedSinceMouseEnter)this.element.classList.remove("static-layout"),this._clearTabBarItemSizesAndPositions();else{let S=0;for(let C of this._tabBarItemsFromLeftToRight())C===this._selectedTabBarItem&&(C.element.style.left=S+"px"),S+=parseFloat(C.element.style.width)}this._mouseIsDown=!1,this._mouseOffset=void 0,document.removeEventListener("mousemove",this._mouseMovedEventListener,!0),document.removeEventListener("mouseup",this._mouseUpEventListener,!0),this._mouseMovedEventListener=null,this._mouseUpEventListener=null,_.preventDefault(),_.stopPropagation(),this.dispatchEventToListeners(WebInspector.TabBar.Event.TabBarItemsReordered)}}_handleMouseLeave(_){if(!this._mouseIsDown&&this._tabAnimatedClosedSinceMouseEnter&&this.element.classList.contains("static-layout")&&!this.element.classList.contains("animating")){const S=this.element.getBoundingClientRect(),C=this._newTabTabBarItem.element.getBoundingClientRect();_.pageY>S.top&&_.pageYS.left&&_.pageX<(C?C.right:S.right)||this._finishExpandingTabsAfterClose()}}_handleNewTabClick(){WebInspector.showNewTabTab()}_handleNewTabMouseEnter(){this._tabAnimatedClosedSinceMouseEnter&&this.element.classList.contains("static-layout")&&!this.element.classList.contains("animating")&&this._finishExpandingTabsAfterClose()}},WebInspector.TabBar.Event={TabBarItemSelected:"tab-bar-tab-bar-item-selected",TabBarItemAdded:"tab-bar-tab-bar-item-added",TabBarItemRemoved:"tab-bar-tab-bar-item-removed",TabBarItemsReordered:"tab-bar-tab-bar-items-reordered",OpenDefaultTab:"tab-bar-open-default-tab"},WebInspector.TabBarItem=class extends WebInspector.Object{constructor(_,S,C){super(),this._parentTabBar=null,this._element=document.createElement("div"),this._element.classList.add(WebInspector.TabBarItem.StyleClassName),this._element.setAttribute("role","tab"),this._element.tabIndex=0,this._element[WebInspector.TabBarItem.ElementReferenceSymbol]=this,this._element.createChild("div","flex-space"),this._iconElement=document.createElement("img"),this._iconElement.classList.add("icon"),this._element.appendChild(this._iconElement),this._element.createChild("div","flex-space"),this.title=S,this.image=_,this.representedObject=C}get element(){return this._element}get representedObject(){return this._representedObject}set representedObject(_){this._representedObject=_||null}get parentTabBar(){return this._parentTabBar}set parentTabBar(_){this._parentTabBar=_||null}get selected(){return this._element.classList.contains("selected")}set selected(_){this._element.classList.toggle("selected",_),_?this._element.setAttribute("aria-selected","true"):this._element.removeAttribute("aria-selected")}get disabled(){return this._element.classList.contains("disabled")}set disabled(_){this._element.classList.toggle("disabled",_)}get isDefaultTab(){return this._element.classList.contains("default-tab")}set isDefaultTab(_){this._element.classList.toggle("default-tab",_)}get image(){return this._iconElement.src}set image(_){this._iconElement.src=_||""}get title(){return this._element.title||""}set title(_){this._element.title=_||""}},WebInspector.TabBarItem.StyleClassName="item",WebInspector.TabBarItem.CloseButtonStyleClassName="close",WebInspector.TabBarItem.ElementReferenceSymbol=Symbol("tab-bar-item"),WebInspector.TabBrowser=class extends WebInspector.View{constructor(_,S,C,f){super(_),this.element.classList.add("tab-browser"),this._tabBar=S,this._navigationSidebar=C||null,this._detailsSidebar=f||null,this._navigationSidebar&&(this._navigationSidebar.addEventListener(WebInspector.Sidebar.Event.CollapsedStateDidChange,this._sidebarCollapsedStateDidChange,this),this._navigationSidebar.addEventListener(WebInspector.Sidebar.Event.WidthDidChange,this._sidebarWidthDidChange,this)),this._detailsSidebar&&(this._detailsSidebar.addEventListener(WebInspector.Sidebar.Event.CollapsedStateDidChange,this._sidebarCollapsedStateDidChange,this),this._detailsSidebar.addEventListener(WebInspector.Sidebar.Event.SidebarPanelSelected,this._sidebarPanelSelected,this),this._detailsSidebar.addEventListener(WebInspector.Sidebar.Event.WidthDidChange,this._sidebarWidthDidChange,this)),this._contentViewContainer=new WebInspector.ContentViewContainer,this.addSubview(this._contentViewContainer);let T=()=>{this._showNextTab()},E=()=>{this._showPreviousTab()},I=WebInspector.resolvedLayoutDirection()===WebInspector.LayoutDirection.RTL,R=I?WebInspector.KeyboardShortcut.Key.LeftCurlyBrace:WebInspector.KeyboardShortcut.Key.RightCurlyBrace,N=I?WebInspector.KeyboardShortcut.Key.RightCurlyBrace:WebInspector.KeyboardShortcut.Key.LeftCurlyBrace;this._showNextTabKeyboardShortcut1=new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl|WebInspector.KeyboardShortcut.Modifier.Shift,R,T),this._showPreviousTabKeyboardShortcut1=new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl|WebInspector.KeyboardShortcut.Modifier.Shift,N,E);let L=I?WebInspector.KeyboardShortcut.Modifier.Shift:0,D=I?0:WebInspector.KeyboardShortcut.Modifier.Shift;this._showNextTabKeyboardShortcut2=new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control|L,WebInspector.KeyboardShortcut.Key.Tab,T),this._showPreviousTabKeyboardShortcut2=new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control|D,WebInspector.KeyboardShortcut.Key.Tab,E);let M=I?WebInspector.KeyboardShortcut.Key.Right:WebInspector.KeyboardShortcut.Key.Left,P=I?WebInspector.KeyboardShortcut.Key.Left:WebInspector.KeyboardShortcut.Key.Right;this._previousTabKeyboardShortcut=new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl|WebInspector.KeyboardShortcut.Modifier.Shift,M,this._showPreviousTabCheckingForEditableField.bind(this)),this._previousTabKeyboardShortcut.implicitlyPreventsDefault=!1,this._nextTabKeyboardShortcut=new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl|WebInspector.KeyboardShortcut.Modifier.Shift,P,this._showNextTabCheckingForEditableField.bind(this)),this._nextTabKeyboardShortcut.implicitlyPreventsDefault=!1,this._tabBar.addEventListener(WebInspector.TabBar.Event.TabBarItemSelected,this._tabBarItemSelected,this),this._tabBar.addEventListener(WebInspector.TabBar.Event.TabBarItemAdded,this._tabBarItemAdded,this),this._tabBar.addEventListener(WebInspector.TabBar.Event.TabBarItemRemoved,this._tabBarItemRemoved,this),this._tabBar.newTabTabBarItem.addEventListener(WebInspector.PinnedTabBarItem.Event.ContextMenu,this._handleNewTabContextMenu,this),this._recentTabContentViews=[],this._closedTabClasses=new Set}get tabBar(){return this._tabBar}get navigationSidebar(){return this._navigationSidebar}get detailsSidebar(){return this._detailsSidebar}get selectedTabContentView(){return this._contentViewContainer.currentContentView}bestTabContentViewForClass(_){for(var S of this._recentTabContentViews)if(S instanceof _)return S;return null}bestTabContentViewForRepresentedObject(_,S={}){for(var C of this._recentTabContentViews)if(!(S.ignoreSearchTab&&C instanceof WebInspector.SearchTabContentView)&&!(S.ignoreNetworkTab&&C instanceof WebInspector.NetworkTabContentView)&&C.canShowRepresentedObject(_))return C;return null}addTabForContentView(_,S={}){if(!(_ instanceof WebInspector.TabContentView))return!1;let C=_.tabBarItem;return!!(C instanceof WebInspector.TabBarItem)&&(!(C.representedObject!==_&&(C.representedObject=_),_.parentTabBrowser=this,C.parentTabBar!==this._tabBar)||(this._recentTabContentViews.length&&this.selectedTabContentView?this._recentTabContentViews.splice(1,0,_):this._recentTabContentViews.push(_),"number"==typeof S.insertionIndex?this._tabBar.insertTabBarItem(C,S.insertionIndex,S):this._tabBar.addTabBarItem(C,S),!0))}showTabForContentView(_,S={}){return!!this.addTabForContentView(_,S)&&(S.suppressSelection||(this._tabBar.selectedTabBarItem=_.tabBarItem),this.needsLayout(),!0)}closeTabForContentView(_,S={}){return!!(_ instanceof WebInspector.TabContentView)&&!!(_.tabBarItem instanceof WebInspector.TabBarItem)&&!(_.tabBarItem.parentTabBar!==this._tabBar)&&(this._tabBar.removeTabBarItem(_.tabBarItem,S),!0)}layout(){if(this.layoutReason===WebInspector.View.LayoutReason.Resize)for(let _ of this._recentTabContentViews)_[WebInspector.TabBrowser.NeedsResizeLayoutSymbol]=_!==this.selectedTabContentView}_tabBarItemSelected(){let S=this._tabBar.selectedTabBarItem?this._tabBar.selectedTabBarItem.representedObject:null;if(S){let C=S instanceof WebInspector.SettingsTabContentView;C||(this._recentTabContentViews.remove(S),this._recentTabContentViews.unshift(S)),this._contentViewContainer.showContentView(S)}else this._contentViewContainer.closeAllContentViews();this._showNavigationSidebarPanelForTabContentView(S),this._showDetailsSidebarPanelsForTabContentView(S),S&&S[WebInspector.TabBrowser.NeedsResizeLayoutSymbol]&&(S[WebInspector.TabBrowser.NeedsResizeLayoutSymbol]=!1,S.updateLayout(WebInspector.View.LayoutReason.Resize)),this.dispatchEventToListeners(WebInspector.TabBrowser.Event.SelectedTabContentViewDidChange)}_tabBarItemAdded(_){let S=_.data.tabBarItem.representedObject;S&&this._closedTabClasses.delete(S.constructor)}_tabBarItemRemoved(_){let S=_.data.tabBarItem.representedObject;S&&(this._recentTabContentViews.remove(S),!S.constructor.isEphemeral()&&this._closedTabClasses.add(S.constructor),this._contentViewContainer.closeContentView(S),S.parentTabBrowser=null)}_handleNewTabContextMenu(_){let S=Array.from(this._closedTabClasses).reverse(),C=Array.from(WebInspector.knownTabClasses()),f=S.concat(C.filter(E=>{return!S.includes(E)&&!E.isEphemeral()&&WebInspector.isNewTabWithTypeAllowed(E.Type)}));if(f.length){let T=_.data.contextMenu;T.appendItem(WebInspector.UIString("Recently Closed Tabs"),null,!0);for(let E of f)T.appendItem(E.tabInfo().title,()=>{WebInspector.createNewTabWithType(E.Type,{shouldShowNewTab:!0})})}}_sidebarPanelSelected(){if(!this._ignoreSidebarEvents){var S=this.selectedTabContentView;if(S&&!S.managesDetailsSidebarPanels){var C=this._detailsSidebar.selectedSidebarPanel;S.detailsSidebarSelectedPanelSetting.value=C?C.identifier:null}}}_sidebarCollapsedStateDidChange(_){if(!this._ignoreSidebarEvents){var S=this.selectedTabContentView;S&&(_.target===this._navigationSidebar?S.navigationSidebarCollapsedSetting.value=this._navigationSidebar.collapsed:_.target===this._detailsSidebar&&!S.managesDetailsSidebarPanels&&(S.detailsSidebarCollapsedSetting.value=this._detailsSidebar.collapsed))}}_sidebarWidthDidChange(_){if(!this._ignoreSidebarEvents&&_.data){let S=this.selectedTabContentView;if(S)switch(_.target){case this._navigationSidebar:S.navigationSidebarWidthSetting.value=_.data.newWidth;break;case this._detailsSidebar:S.detailsSidebarWidthSetting.value=_.data.newWidth;}}}_showNavigationSidebarPanelForTabContentView(_){if(this._navigationSidebar){if(this._ignoreSidebarEvents=!0,this._navigationSidebar.removeSidebarPanel(0),!_)return void(this._ignoreSidebarEvents=!1);_.navigationSidebarWidthSetting.value&&(this._navigationSidebar.width=_.navigationSidebarWidthSetting.value);var S=_.navigationSidebarPanel;return S?void(this._navigationSidebar.addSidebarPanel(S),this._navigationSidebar.selectedSidebarPanel=S,this._navigationSidebar.collapsed=_.navigationSidebarCollapsedSetting.value,this._ignoreSidebarEvents=!1):(this._navigationSidebar.collapsed=!0,void(this._ignoreSidebarEvents=!1))}}_showDetailsSidebarPanelsForTabContentView(_){if(this._detailsSidebar){this._ignoreSidebarEvents=!0;for(var S=this._detailsSidebar.sidebarPanels.length-1;0<=S;--S)this._detailsSidebar.removeSidebarPanel(S);if(!_)return void(this._ignoreSidebarEvents=!1);if(_.detailsSidebarWidthSetting.value&&(this._detailsSidebar.width=_.detailsSidebarWidthSetting.value),_.managesDetailsSidebarPanels)return _.showDetailsSidebarPanels(),void(this._ignoreSidebarEvents=!1);var C=_.detailsSidebarPanels;if(!C)return this._detailsSidebar.collapsed=!0,void(this._ignoreSidebarEvents=!1);for(var f of C)this._detailsSidebar.addSidebarPanel(f);this._detailsSidebar.selectedSidebarPanel=_.detailsSidebarSelectedPanelSetting.value||C[0],this._detailsSidebar.collapsed=_.detailsSidebarCollapsedSetting.value||!C.length,this._ignoreSidebarEvents=!1}}_showPreviousTab(){this._tabBar.selectPreviousTab()}_showNextTab(){this._tabBar.selectNextTab()}_showNextTabCheckingForEditableField(_){WebInspector.isEventTargetAnEditableField(_)||(this._showNextTab(_),_.preventDefault())}_showPreviousTabCheckingForEditableField(_){WebInspector.isEventTargetAnEditableField(_)||(this._showPreviousTab(_),_.preventDefault())}},WebInspector.TabBrowser.NeedsResizeLayoutSymbol=Symbol("needs-resize-layout"),WebInspector.TabBrowser.Event={SelectedTabContentViewDidChange:"tab-browser-selected-tab-content-view-did-change"},WebInspector.TextEditor=class extends WebInspector.View{constructor(_,S,C){super(_),this.element.classList.add("text-editor",WebInspector.SyntaxHighlightedStyleClassName),this._codeMirror=WebInspector.CodeMirrorEditor.create(this.element,{readOnly:!0,indentWithTabs:WebInspector.settings.indentWithTabs.value,indentUnit:WebInspector.settings.indentUnit.value,tabSize:WebInspector.settings.tabSize.value,lineNumbers:!0,lineWrapping:WebInspector.settings.enableLineWrapping.value,matchBrackets:!0,autoCloseBrackets:!0,showWhitespaceCharacters:WebInspector.settings.showWhitespaceCharacters.value,styleSelectedText:!0}),WebInspector.settings.indentWithTabs.addEventListener(WebInspector.Setting.Event.Changed,()=>{this._codeMirror.setOption("indentWithTabs",WebInspector.settings.indentWithTabs.value)}),WebInspector.settings.indentUnit.addEventListener(WebInspector.Setting.Event.Changed,()=>{this._codeMirror.setOption("indentUnit",WebInspector.settings.indentUnit.value)}),WebInspector.settings.tabSize.addEventListener(WebInspector.Setting.Event.Changed,()=>{this._codeMirror.setOption("tabSize",WebInspector.settings.tabSize.value)}),WebInspector.settings.enableLineWrapping.addEventListener(WebInspector.Setting.Event.Changed,()=>{this._codeMirror.setOption("lineWrapping",WebInspector.settings.enableLineWrapping.value)}),WebInspector.settings.showWhitespaceCharacters.addEventListener(WebInspector.Setting.Event.Changed,()=>{this._codeMirror.setOption("showWhitespaceCharacters",WebInspector.settings.showWhitespaceCharacters.value)}),this._codeMirror.on("change",this._contentChanged.bind(this)),this._codeMirror.on("gutterClick",this._gutterMouseDown.bind(this)),this._codeMirror.on("gutterContextMenu",this._gutterContextMenu.bind(this)),this._codeMirror.getScrollerElement().addEventListener("click",this._openClickedLinks.bind(this),!0),this._completionController=new WebInspector.CodeMirrorCompletionController(this._codeMirror,this),this._tokenTrackingController=new WebInspector.CodeMirrorTokenTrackingController(this._codeMirror,this),this._initialStringNotSet=!0,this.mimeType=S,this._breakpoints={},this._executionLineNumber=NaN,this._executionColumnNumber=NaN,this._executionLineHandle=null,this._executionMultilineHandles=[],this._executionRangeHighlightMarker=null,this._searchQuery=null,this._searchResults=[],this._currentSearchResultIndex=-1,this._ignoreCodeMirrorContentDidChangeEvent=0,this._formatted=!1,this._formattingPromise=null,this._formatterSourceMap=null,this._deferReveal=!1,this._delegate=C||null}get visible(){return this._visible}get string(){return this._codeMirror.getValue()}set string(_){this._ignoreCodeMirrorContentDidChangeEvent++,this._codeMirror.operation(function(){for(var C in this._initialStringNotSet&&this._codeMirror.removeLineClass(0,"wrap"),this._codeMirror.getValue()===_?this.layout():this._codeMirror.setValue(_),this._initialStringNotSet&&(this._codeMirror.clearHistory(),this._codeMirror.markClean(),this._initialStringNotSet=!1),this._updateExecutionLine(),this._updateExecutionRangeHighlight(),this._breakpoints)this._setBreakpointStylesOnLine(C);this._revealPendingPositionIfPossible()}.bind(this)),this._ignoreCodeMirrorContentDidChangeEvent--}get readOnly(){return this._codeMirror.getOption("readOnly")||!1}set readOnly(_){this._codeMirror.setOption("readOnly",_)}get formatted(){return this._formatted}get hasModified(){let _=this._codeMirror.historySize().undo;return this._formatted&&_--,0<_}updateFormattedState(_){return this._format(_).catch(handlePromiseException)}hasFormatter(){let _=this._codeMirror.getMode().name;return"javascript"===_||"css"===_}canBeFormatted(){return this.hasFormatter()}canShowTypeAnnotations(){return!1}canShowCoverageHints(){return!1}get selectedTextRange(){var _=this._codeMirror.getCursor(!0),S=this._codeMirror.getCursor(!1);return this._textRangeFromCodeMirrorPosition(_,S)}set selectedTextRange(_){var S=this._codeMirrorPositionFromTextRange(_);this._codeMirror.setSelection(S.start,S.end)}get mimeType(){return this._mimeType}set mimeType(_){_=parseMIMEType(_).type,this._mimeType=_,this._codeMirror.setOption("mode",{name:_,globalVars:!0})}get executionLineNumber(){return this._executionLineNumber}get executionColumnNumber(){return this._executionColumnNumber}get formatterSourceMap(){return this._formatterSourceMap}get tokenTrackingController(){return this._tokenTrackingController}get delegate(){return this._delegate}set delegate(_){this._delegate=_||null}get numberOfSearchResults(){return this._searchResults.length}get currentSearchQuery(){return this._searchQuery}set automaticallyRevealFirstSearchResult(_){this._automaticallyRevealFirstSearchResult=_,this._automaticallyRevealFirstSearchResult&&0{setTimeout(this.revealPosition.bind(this),0,_,S)});let I=Number.constrain(_.lineNumber,0,this._codeMirror.lineCount()-1),R=this._codeMirror.getLineHandle(I);if(!S){let N=Number.constrain(_.columnNumber,0,this._codeMirror.getLine(I).length-1);S=new WebInspector.TextRange(I,N,I,N)}this._codeMirror.operation(E.bind(this))}}shown(){this._visible=!0,this._codeMirror.refresh(),this._revealPendingPositionIfPossible()}hidden(){this._visible=!1}close(){WebInspector.settings.indentWithTabs.removeEventListener(null,null,this),WebInspector.settings.indentUnit.removeEventListener(null,null,this),WebInspector.settings.tabSize.removeEventListener(null,null,this),WebInspector.settings.enableLineWrapping.removeEventListener(null,null,this),WebInspector.settings.showWhitespaceCharacters.removeEventListener(null,null,this)}setBreakpointInfoForLineAndColumn(_,S,C){this._ignoreSetBreakpointInfoCalls||(C?this._addBreakpointToLineAndColumnWithInfo(_,S,C):this._removeBreakpointFromLineAndColumn(_,S))}updateBreakpointLineAndColumn(_,S,C,f){if(this._breakpoints[_]&&this._breakpoints[_][S]){var T=this._breakpoints[_][S];this._removeBreakpointFromLineAndColumn(_,S),this._addBreakpointToLineAndColumnWithInfo(C,f,T)}}addStyleClassToLine(_,S){var C=this._codeMirror.getLineHandle(_);return C?this._codeMirror.addLineClass(C,"wrap",S):null}removeStyleClassFromLine(_,S){var C=this._codeMirror.getLineHandle(_);return C?this._codeMirror.removeLineClass(C,"wrap",S):null}toggleStyleClassForLine(_,S){var C=this._codeMirror.getLineHandle(_);return!!C&&this._codeMirror.toggleLineClass(C,"wrap",S)}createWidgetForLine(_){var S=this._codeMirror.getLineHandle(_);if(!S)return null;var C=document.createElement("div"),f=this._codeMirror.addLineWidget(S,C,{coverGutter:!1,noHScroll:!0});return new WebInspector.LineWidget(f,C)}get lineCount(){return this._codeMirror.lineCount()}focus(){this._codeMirror.focus()}contentDidChange(){}rectsForRange(_){return this._codeMirror.rectsForRange(_)}get markers(){return this._codeMirror.getAllMarks().map(WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker)}markersAtPosition(_){return this._codeMirror.findMarksAt(_).map(WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker)}createColorMarkers(_){return createCodeMirrorColorTextMarkers(this._codeMirror,_)}createGradientMarkers(_){return createCodeMirrorGradientTextMarkers(this._codeMirror,_)}createCubicBezierMarkers(_){return createCodeMirrorCubicBezierTextMarkers(this._codeMirror,_)}createSpringMarkers(_){return createCodeMirrorSpringTextMarkers(this._codeMirror,_)}editingControllerForMarker(_){switch(_.type){case WebInspector.TextMarker.Type.Color:return new WebInspector.CodeMirrorColorEditingController(this._codeMirror,_);case WebInspector.TextMarker.Type.Gradient:return new WebInspector.CodeMirrorGradientEditingController(this._codeMirror,_);case WebInspector.TextMarker.Type.CubicBezier:return new WebInspector.CodeMirrorBezierEditingController(this._codeMirror,_);case WebInspector.TextMarker.Type.Spring:return new WebInspector.CodeMirrorSpringEditingController(this._codeMirror,_);default:return new WebInspector.CodeMirrorEditingController(this._codeMirror,_);}}visibleRangeOffsets(){var _=null,S=null,C=this._codeMirror.getViewport();return this._formatterSourceMap?(_=this._formatterSourceMap.formattedToOriginalOffset(Math.max(C.from-1,0),0),S=this._formatterSourceMap.formattedToOriginalOffset(C.to-1,0)):(_=this._codeMirror.getDoc().indexFromPos({line:C.from,ch:0}),S=this._codeMirror.getDoc().indexFromPos({line:C.to,ch:0})),{startOffset:_,endOffset:S}}originalOffsetToCurrentPosition(_){var S=null;if(this._formatterSourceMap){var C=this._formatterSourceMap.originalPositionToFormatted(_);S={line:C.lineNumber,ch:C.columnNumber}}else S=this._codeMirror.getDoc().posFromIndex(_);return S}currentOffsetToCurrentPosition(_){return this._codeMirror.getDoc().posFromIndex(_)}currentPositionToOriginalOffset(_){let S=null;return S=this._formatterSourceMap?this._formatterSourceMap.formattedToOriginalOffset(_.line,_.ch):this._codeMirror.getDoc().indexFromPos(_),S}currentPositionToOriginalPosition(_){if(!this._formatterSourceMap)return _;let S=this._formatterSourceMap.formattedToOriginal(_.line,_.ch);return{line:S.lineNumber,ch:S.columnNumber}}currentPositionToCurrentOffset(_){return this._codeMirror.getDoc().indexFromPos(_)}setInlineWidget(_,S){return this._codeMirror.setUniqueBookmark(_,{widget:S})}addScrollHandler(_){this._codeMirror.on("scroll",_)}removeScrollHandler(_){this._codeMirror.off("scroll",_)}layout(){this._visible&&this._codeMirror.refresh()}_format(_){return this._formatted===_?Promise.resolve(this._formatted):_&&!this.canBeFormatted()?Promise.resolve(this._formatted):this._formattingPromise?this._formattingPromise:(this._ignoreCodeMirrorContentDidChangeEvent++,this._formattingPromise=this.prettyPrint(_).then(()=>{this._ignoreCodeMirrorContentDidChangeEvent--,this._formattingPromise=null;let S=this._formatted;return this._formatted=!!this._formatterSourceMap,this._formatted!==S&&this.dispatchEventToListeners(WebInspector.TextEditor.Event.FormattingDidChange),this._formatted}),this._formattingPromise)}prettyPrint(_){return new Promise(S=>{let f={selectionAnchor:this._codeMirror.getCursor("anchor"),selectionHead:this._codeMirror.getCursor("head")};_?this._canUseFormatterWorker()?this._startWorkerPrettyPrint(f,S):this._startCodeMirrorPrettyPrint(f,S):this._undoFormatting(f,S)})}_canUseFormatterWorker(){return"javascript"===this._codeMirror.getMode().name}_startWorkerPrettyPrint(_,S){let C=this._codeMirror.getValue(),f=WebInspector.indentString();let E=this._delegate?this._delegate.textEditorScriptSourceType(this):WebInspector.Script.SourceType.Program;const I=E===WebInspector.Script.SourceType.Module;let R=WebInspector.FormatterWorkerProxy.singleton();R.formatJavaScript(C,I,f,!0,({formattedText:N,sourceMapData:L})=>{return null===N?void S():void this._finishPrettyPrint(_,N,L,S)})}_startCodeMirrorPrettyPrint(_,S){let C=WebInspector.indentString(),T={line:this._codeMirror.lineCount()-1},E=new FormatterContentBuilder(C),I=new WebInspector.Formatter(this._codeMirror,E);I.format({line:0,ch:0},T);let R=E.formattedContent,N=E.sourceMapData;this._finishPrettyPrint(_,R,N,S)}_finishPrettyPrint(_,S,C,f){this._codeMirror.operation(()=>{this._formatterSourceMap=WebInspector.FormatterSourceMap.fromSourceMapData(C),this._codeMirror.setValue(S),this._updateAfterFormatting(!0,_)}),f()}_undoFormatting(_,S){this._codeMirror.operation(()=>{this._codeMirror.undo(),this._updateAfterFormatting(!1,_)}),S()}_updateAfterFormatting(_,S){let C=S.selectionAnchor,f=S.selectionHead,I=null,T,E;if(_){if(this._positionToReveal){let L=this._formatterSourceMap.originalToFormatted(this._positionToReveal.lineNumber,this._positionToReveal.columnNumber);this._positionToReveal=new WebInspector.SourceCodePosition(L.lineNumber,L.columnNumber)}if(this._textRangeToSelect){let L=this._formatterSourceMap.originalToFormatted(this._textRangeToSelect.startLine,this._textRangeToSelect.startColumn),D=this._formatterSourceMap.originalToFormatted(this._textRangeToSelect.endLine,this._textRangeToSelect.endColumn);this._textRangeToSelect=new WebInspector.TextRange(L.lineNumber,L.columnNumber,D.lineNumber,D.columnNumber)}isNaN(this._executionLineNumber)||(I=this._formatterSourceMap.originalToFormatted(this._executionLineNumber,this._executionColumnNumber));let R=this._formatterSourceMap.originalToFormatted(C.line,C.ch),N=this._formatterSourceMap.originalToFormatted(f.line,f.ch);T={line:R.lineNumber,ch:R.columnNumber},E={line:N.lineNumber,ch:N.columnNumber}}else{if(this._positionToReveal){let L=this._formatterSourceMap.formattedToOriginal(this._positionToReveal.lineNumber,this._positionToReveal.columnNumber);this._positionToReveal=new WebInspector.SourceCodePosition(L.lineNumber,L.columnNumber)}if(this._textRangeToSelect){let L=this._formatterSourceMap.formattedToOriginal(this._textRangeToSelect.startLine,this._textRangeToSelect.startColumn),D=this._formatterSourceMap.formattedToOriginal(this._textRangeToSelect.endLine,this._textRangeToSelect.endColumn);this._textRangeToSelect=new WebInspector.TextRange(L.lineNumber,L.columnNumber,D.lineNumber,D.columnNumber)}isNaN(this._executionLineNumber)||(I=this._formatterSourceMap.formattedToOriginal(this._executionLineNumber,this._executionColumnNumber));let R=this._formatterSourceMap.formattedToOriginal(C.line,C.ch),N=this._formatterSourceMap.formattedToOriginal(f.line,f.ch);T={line:R.lineNumber,ch:R.columnNumber},E={line:N.lineNumber,ch:N.columnNumber},this._formatterSourceMap=null}if(this._scrollIntoViewCentered(T),this._codeMirror.setSelection(T,E),I&&(this._executionLineHandle=null,this._executionMultilineHandles=[],this.setExecutionLineAndColumn(I.lineNumber,I.columnNumber)),this.currentSearchQuery){let R=this.currentSearchQuery;this.searchCleared(),setTimeout(()=>{this.performSearch(R)},0)}this._delegate&&"function"==typeof this._delegate.textEditorUpdatedFormatting&&this._delegate.textEditorUpdatedFormatting(this)}hasEdits(){return!this._codeMirror.isClean()}_contentChanged(_,S){if(!(0{this._bouncyHighlightElement&&this._bouncyHighlightElement.remove()};this.addScrollHandler(N),this._bouncyHighlightElement.addEventListener("animationend",function(){this._bouncyHighlightElement&&(this._bouncyHighlightElement.remove(),delete this._bouncyHighlightElement,this.removeScrollHandler(N))}.bind(this))}_binarySearchInsertionIndexInSearchResults(_,S){for(var C=this._searchResults,f=0,T=C.length-1;f<=T;){var E=f+T>>1,I=S(_,C[E]);if(null===I)return null;if(0I)T=E-1;else return E}return f-1}_revealFirstSearchResultBeforeCursor(_){var S=this._codeMirror.getCursor("start");if(0===S.line&&0===S.ch)return this._currentSearchResultIndex=this._searchResults.length-1,void this._revealSearchResult(this._searchResults[this._currentSearchResultIndex],_,-1);var C=this._binarySearchInsertionIndexInSearchResults(S,function(f,T){var E=T.find();return E?WebInspector.compareCodeMirrorPositions(f,E.from):null});return null===C?void this._revalidateSearchResults(-1):void(this._currentSearchResultIndex=C,this._revealSearchResult(this._searchResults[this._currentSearchResultIndex],_))}_revealFirstSearchResultAfterCursor(_){var S=this._codeMirror.getCursor("start");if(0===S.line&&0===S.ch)return this._currentSearchResultIndex=0,void this._revealSearchResult(this._searchResults[this._currentSearchResultIndex],_,1);var C=this._binarySearchInsertionIndexInSearchResults(S,function(f,T){var E=T.find();return E?WebInspector.compareCodeMirrorPositions(f,E.from):null});return null===C?void this._revalidateSearchResults(1):void(C+1{this._executionLineHandle&&(this._codeMirror.removeLineClass(this._executionLineHandle,"wrap",WebInspector.TextEditor.ExecutionLineStyleClassName),this._codeMirror.removeLineClass(this._executionLineHandle,"wrap","primary")),this._clearMultilineExecutionLineHighlights(),this._executionLineHandle=isNaN(this._executionLineNumber)?null:this._codeMirror.getLineHandle(this._executionLineNumber),this._executionLineHandle&&(this._codeMirror.addLineClass(this._executionLineHandle,"wrap",WebInspector.TextEditor.ExecutionLineStyleClassName),this._codeMirror.addLineClass(this._executionLineHandle,"wrap","primary"),this._codeMirror.removeLineClass(this._executionLineHandle,"wrap",WebInspector.TextEditor.HighlightedStyleClassName))})}_updateExecutionRangeHighlight(){if(this._executionRangeHighlightMarker&&(this._executionRangeHighlightMarker.clear(),this._executionRangeHighlightMarker=null),!isNaN(this._executionLineNumber)){let _={line:this._executionLineNumber,ch:this._executionColumnNumber},S=this.currentPositionToOriginalOffset(_),C=this.currentPositionToOriginalPosition(_),f=new WebInspector.SourceCodePosition(C.line,C.ch),T=this._codeMirror.getRange(_,{line:this._executionLineNumber,ch:this._executionColumnNumber+1});this._delegate.textEditorExecutionHighlightRange(S,f,T,E=>{let I,R;E?(I=this.originalOffsetToCurrentPosition(E[0]),R=this.originalOffsetToCurrentPosition(E[1])):(I={line:this._executionLineNumber,ch:this._executionColumnNumber},R={line:this._executionLineNumber}),this._executionRangeHighlightMarker&&(this._executionRangeHighlightMarker.clear(),this._executionRangeHighlightMarker=null);let N=this._codeMirror.getRange(I,R),L=N.match(/\s+$/);if(L&&(R.ch=Math.max(0,R.ch-L[0].length)),this._clearMultilineExecutionLineHighlights(),I.line!==R.line)for(let D=I.line,M;Df.right||_.pageYf.bottom)&&(C=null),C&&"line"in C&&(S=C.line),S!==this._lineNumberWithDraggedBreakpoint)&&(this._mouseDragged=!0,"_lineNumberWithDraggedBreakpoint"in this&&(this._previousColumnBreakpointInfo?this._setColumnBreakpointInfoForLine(this._lineNumberWithDraggedBreakpoint,this._previousColumnBreakpointInfo):this._removeBreakpointFromLineAndColumn(this._lineNumberWithDraggedBreakpoint,this._columnNumberWithDraggedBreakpoint),delete this._previousColumnBreakpointInfo,delete this._lineNumberWithDraggedBreakpoint,delete this._columnNumberWithDraggedBreakpoint),void 0!=S)){var T={},E=S===this._lineNumberWithMousedDownBreakpoint?this._columnNumberWithDraggedBreakpoint:0;T[E]=this._draggingBreakpointInfo,this._previousColumnBreakpointInfo=this._allColumnBreakpointInfoForLine(S),this._setColumnBreakpointInfoForLine(S,T),this._lineNumberWithDraggedBreakpoint=S,this._columnNumberWithDraggedBreakpoint=E}}}_documentMouseUp(_){if("_lineNumberWithMousedDownBreakpoint"in this){_.preventDefault(),document.removeEventListener("mousemove",this._documentMouseMovedEventListener,!0),document.removeEventListener("mouseup",this._documentMouseUpEventListener,!0);var S=this._delegate&&"function"==typeof this._delegate.textEditorBreakpointClicked,C=this._delegate&&"function"==typeof this._delegate.textEditorBreakpointRemoved,f=this._delegate&&"function"==typeof this._delegate.textEditorBreakpointMoved;if(!this._mouseDragged)this._lineNumberWithMousedDownBreakpoint in this._breakpoints&&this._columnNumberWithMousedDownBreakpoint in this._breakpoints[this._lineNumberWithMousedDownBreakpoint]&&S&&this._delegate.textEditorBreakpointClicked(this,this._lineNumberWithMousedDownBreakpoint,this._columnNumberWithMousedDownBreakpoint);else if(!("_lineNumberWithDraggedBreakpoint"in this))C&&(this._ignoreSetBreakpointInfoCalls=!0,this._delegate.textEditorBreakpointRemoved(this,this._lineNumberWithMousedDownBreakpoint,this._columnNumberWithMousedDownBreakpoint),delete this._ignoreSetBreakpointInfoCalls);else if(this._lineNumberWithMousedDownBreakpoint!==this._lineNumberWithDraggedBreakpoint){if(this._previousColumnBreakpointInfo&&C){for(var T in this._ignoreSetBreakpointInfoCalls=!0,this._previousColumnBreakpointInfo)this._delegate.textEditorBreakpointRemoved(this,this._lineNumberWithDraggedBreakpoint,T);delete this._ignoreSetBreakpointInfoCalls}f&&(this._ignoreSetBreakpointInfoCalls=!0,this._delegate.textEditorBreakpointMoved(this,this._lineNumberWithMousedDownBreakpoint,this._columnNumberWithMousedDownBreakpoint,this._lineNumberWithDraggedBreakpoint,this._columnNumberWithDraggedBreakpoint),delete this._ignoreSetBreakpointInfoCalls)}delete this._documentMouseMovedEventListener,delete this._documentMouseUpEventListener,delete this._lineNumberWithMousedDownBreakpoint,delete this._lineNumberWithDraggedBreakpoint,delete this._columnNumberWithMousedDownBreakpoint,delete this._columnNumberWithDraggedBreakpoint,delete this._previousColumnBreakpointInfo,delete this._mouseDragged}}_openClickedLinks(_){var S=this._codeMirror.coordsChar({left:_.pageX,top:_.pageY}),C=this._codeMirror.getTokenAt(S);if(C&&C.type&&C.string&&/\blink\b/.test(C.type)){var f=C.string,T="";this._delegate&&"function"==typeof this._delegate.textEditorBaseURL&&(T=this._delegate.textEditorBaseURL(this)),WebInspector.openURL(absoluteURL(f,T)),_.preventDefault(),_.stopPropagation()}}_isPositionVisible(_){var S=this._codeMirror.getScrollInfo(),C=S.top,f=C+S.clientHeight,T=this._codeMirror.charCoords(_,"local");return T.top>=C&&T.bottom<=f}_scrollIntoViewCentered(_){var S=this._codeMirror.getScrollInfo(),C=Math.ceil(this._codeMirror.defaultTextHeight()),f=Math.floor((S.clientHeight-C)/2);this._codeMirror.scrollIntoView(_,f)}},WebInspector.TextEditor.HighlightedStyleClassName="highlighted",WebInspector.TextEditor.SearchResultStyleClassName="search-result",WebInspector.TextEditor.HasBreakpointStyleClassName="has-breakpoint",WebInspector.TextEditor.BreakpointResolvedStyleClassName="breakpoint-resolved",WebInspector.TextEditor.BreakpointAutoContinueStyleClassName="breakpoint-auto-continue",WebInspector.TextEditor.BreakpointDisabledStyleClassName="breakpoint-disabled",WebInspector.TextEditor.MultipleBreakpointsStyleClassName="multiple-breakpoints",WebInspector.TextEditor.ExecutionLineStyleClassName="execution-line",WebInspector.TextEditor.BouncyHighlightStyleClassName="bouncy-highlight",WebInspector.TextEditor.NumberOfFindsPerSearchBatch=10,WebInspector.TextEditor.HighlightAnimationDuration=2e3,WebInspector.TextEditor.Event={ExecutionLineNumberDidChange:"text-editor-execution-line-number-did-change",NumberOfSearchResultsDidChange:"text-editor-number-of-search-results-did-change",ContentDidChange:"text-editor-content-did-change",FormattingDidChange:"text-editor-formatting-did-change"},WebInspector.TimelineOverviewGraph=class extends WebInspector.View{constructor(_){super(),this.element.classList.add("timeline-overview-graph"),this._zeroTime=0,this._startTime=0,this._endTime=5,this._currentTime=0,this._timelineOverview=_,this._selectedRecord=null,this._selectedRecordChanged=!1,this._scheduledSelectedRecordLayoutUpdateIdentifier=void 0,this._selected=!1,this._visible=!0}static createForTimeline(_,S){var C=_.type;if(C===WebInspector.TimelineRecord.Type.Network)return new WebInspector.NetworkTimelineOverviewGraph(_,S);if(C===WebInspector.TimelineRecord.Type.Layout)return new WebInspector.LayoutTimelineOverviewGraph(_,S);if(C===WebInspector.TimelineRecord.Type.Script)return new WebInspector.ScriptTimelineOverviewGraph(_,S);if(C===WebInspector.TimelineRecord.Type.RenderingFrame)return new WebInspector.RenderingFrameTimelineOverviewGraph(_,S);if(C===WebInspector.TimelineRecord.Type.Memory)return new WebInspector.MemoryTimelineOverviewGraph(_,S);if(C===WebInspector.TimelineRecord.Type.HeapAllocations)return new WebInspector.HeapAllocationsTimelineOverviewGraph(_,S);throw new Error("Can't make a graph for an unknown timeline.")}get zeroTime(){return this._zeroTime}set zeroTime(_){_=_||0;this._zeroTime===_||(this._zeroTime=_,this.needsLayout())}get startTime(){return this._startTime}set startTime(_){_=_||0;this._startTime===_||(this._startTime=_,this.needsLayout())}get endTime(){return this._endTime}set endTime(_){_=_||0;this._endTime===_||(this._endTime=_,this.needsLayout())}get currentTime(){return this._currentTime}set currentTime(_){if(_=_||0,this._currentTime!==_){let S=this._currentTime;this._currentTime=_,(this._startTime<=S&&S<=this._endTime||this._startTime<=this._currentTime&&this._currentTime<=this._endTime)&&this.needsLayout()}}get timelineOverview(){return this._timelineOverview}get secondsPerPixel(){return this._timelineOverview.secondsPerPixel}get visible(){return this._visible}get selectedRecord(){return this._selectedRecord}set selectedRecord(_){this._selectedRecord===_||(this._selectedRecord=_,this._selectedRecordChanged=!0,this._needsSelectedRecordLayout())}get height(){return 36}get selected(){return this._selected}set selected(_){this._selected===_||(this._selected=_,this.element.classList.toggle("selected",this._selected))}shown(){this._visible||(this._visible=!0,this.element.classList.toggle("hidden",!this._visible),this.updateLayout())}hidden(){this._visible&&(this._visible=!1,this.element.classList.toggle("hidden",!this._visible))}reset(){}recordWasFiltered(){}needsLayout(){this._visible&&super.needsLayout()}updateSelectedRecord(){}_needsSelectedRecordLayout(){this.layoutPending||this._scheduledSelectedRecordLayoutUpdateIdentifier||(this._scheduledSelectedRecordLayoutUpdateIdentifier=requestAnimationFrame(()=>{this._scheduledSelectedRecordLayoutUpdateIdentifier=void 0,this.updateSelectedRecord(),this.dispatchEventToListeners(WebInspector.TimelineOverviewGraph.Event.RecordSelected,{record:this.selectedRecord})}))}},WebInspector.TimelineOverviewGraph.Event={RecordSelected:"timeline-overview-graph-record-selected"},WebInspector.TimelineView=class extends WebInspector.ContentView{constructor(_){super(_),this.element.classList.add("timeline-view"),this._zeroTime=0,this._startTime=0,this._endTime=5,this._currentTime=0}get scrollableElements(){return this._timelineDataGrid?[this._timelineDataGrid.scrollContainer]:[]}get showsLiveRecordingData(){return!0}get showsFilterBar(){return!0}get navigationItems(){return this._scopeBar?[this._scopeBar]:[]}get selectionPathComponents(){return null}get zeroTime(){return this._zeroTime}set zeroTime(_){_=_||0;this._zeroTime===_||(this._zeroTime=_,this._timesDidChange())}get startTime(){return this._startTime}set startTime(_){_=_||0;this._startTime===_||(this._startTime=_,this._timesDidChange(),this._scheduleFilterDidChange())}get endTime(){return this._endTime}set endTime(_){_=_||0;this._endTime===_||(this._endTime=_,this._timesDidChange(),this._scheduleFilterDidChange())}get currentTime(){return this._currentTime}set currentTime(_){function S(f){const T=0.05;return this._startTime-T<=f&&f<=this._endTime+T}if(_=_||0,this._currentTime!==_){let C=this._currentTime;this._currentTime=_,(S.call(this,C)||S.call(this,this._currentTime))&&this._timesDidChange()}}get filterStartTime(){return this.startTime}get filterEndTime(){return this.endTime}setupDataGrid(_){this._timelineDataGrid&&(this._timelineDataGrid.filterDelegate=null,this._timelineDataGrid.removeEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged,this._timelineDataGridSelectedNodeChanged,this),this._timelineDataGrid.removeEventListener(WebInspector.DataGrid.Event.NodeWasFiltered,this._timelineDataGridNodeWasFiltered,this),this._timelineDataGrid.removeEventListener(WebInspector.DataGrid.Event.FilterDidChange,this.filterDidChange,this)),this._timelineDataGrid=_,this._timelineDataGrid.filterDelegate=this,this._timelineDataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged,this._timelineDataGridSelectedNodeChanged,this),this._timelineDataGrid.addEventListener(WebInspector.DataGrid.Event.NodeWasFiltered,this._timelineDataGridNodeWasFiltered,this),this._timelineDataGrid.addEventListener(WebInspector.DataGrid.Event.FilterDidChange,this.filterDidChange,this)}selectRecord(_){if(this._timelineDataGrid){let S=this._timelineDataGrid.selectedNode;if(!_)return void(S&&S.deselect());let C=this._timelineDataGrid.findNode(f=>f.record===_);!C||C.selected||S&&S.hasAncestor(C)||C.revealAndSelect()}}reset(){}updateFilter(_){this._timelineDataGrid&&(this._timelineDataGrid.filterText=_?_.text:"")}matchDataGridNodeAgainstCustomFilters(){return!0}needsLayout(){this.visible&&super.needsLayout()}dataGridMatchNodeAgainstCustomFilters(_){function S(E,I){return E=E||T,I=I||T,C<=I&&E<=f}if(!this.matchDataGridNodeAgainstCustomFilters(_))return!1;let C=this.filterStartTime,f=this.filterEndTime,T=this.currentTime;if(_ instanceof WebInspector.ResourceTimelineDataGridNode){let E=_.resource;return S(E.requestSentTimestamp,E.finishedOrFailedTimestamp)}if(_ instanceof WebInspector.SourceCodeTimelineTimelineDataGridNode){let E=_.sourceCodeTimeline;if(!S(E.startTime,E.endTime))return!1;for(let I of E.records)if(S(I.startTime,I.endTime))return!0;return!1}if(_ instanceof WebInspector.ProfileNodeDataGridNode){let E=_.profileNode;return!!S(E.startTime,E.endTime)}if(_ instanceof WebInspector.TimelineDataGridNode){let E=_.record;return S(E.startTime,E.endTime)}return _ instanceof WebInspector.ProfileDataGridNode?_.callingContextTreeNode.hasStackTraceInTimeRange(C,f):(console.error("Unknown DataGridNode, can't filter by time."),!0)}userSelectedRecordFromOverview(){}filterDidChange(){}_timelineDataGridSelectedNodeChanged(){this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange)}_timelineDataGridNodeWasFiltered(_){let S=_.data.node;S instanceof WebInspector.TimelineDataGridNode&&this.dispatchEventToListeners(WebInspector.TimelineView.Event.RecordWasFiltered,{record:S.record,filtered:S.hidden})}_timesDidChange(){(!WebInspector.timelineManager.isCapturing()||this.showsLiveRecordingData)&&this.needsLayout()}_scheduleFilterDidChange(){!this._timelineDataGrid||this._updateFilterTimeout||(this._updateFilterTimeout=setTimeout(()=>{this._updateFilterTimeout=void 0,this._timelineDataGrid.filterDidChange()},0))}},WebInspector.TimelineView.Event={RecordWasFiltered:"record-was-filtered"},WebInspector.TreeElement=class extends WebInspector.Object{constructor(_,S,C){super(),this._title=_,this.representedObject=S||{},this.representedObject.__treeElementIdentifier?this.identifier=this.representedObject.__treeElementIdentifier:(this.identifier=WebInspector.TreeOutline._knownTreeElementNextIdentifier++,this.representedObject.__treeElementIdentifier=this.identifier),this._hidden=!1,this._selectable=!0,this.expanded=!1,this.selected=!1,this.hasChildren=C,this.children=[],this.treeOutline=null,this.parent=null,this.previousSibling=null,this.nextSibling=null,this._listItemNode=null}appendChild(){return WebInspector.TreeOutline.prototype.appendChild.apply(this,arguments)}insertChild(){return WebInspector.TreeOutline.prototype.insertChild.apply(this,arguments)}removeChild(){return WebInspector.TreeOutline.prototype.removeChild.apply(this,arguments)}removeChildAtIndex(){return WebInspector.TreeOutline.prototype.removeChildAtIndex.apply(this,arguments)}removeChildren(){return WebInspector.TreeOutline.prototype.removeChildren.apply(this,arguments)}removeChildrenRecursive(){return WebInspector.TreeOutline.prototype.removeChildrenRecursive.apply(this,arguments)}selfOrDescendant(){return WebInspector.TreeOutline.prototype.selfOrDescendant.apply(this,arguments)}get arrowToggleWidth(){return 10}get selectable(){return!this._hidden&&this._selectable}set selectable(_){this._selectable=_}get listItemElement(){return this._listItemNode}get title(){return this._title}set title(_){this._title=_,this._setListItemNodeContent(),this.didChange()}get titleHTML(){return this._titleHTML}set titleHTML(_){this._titleHTML=_,this._setListItemNodeContent(),this.didChange()}get tooltip(){return this._tooltip}set tooltip(_){this._tooltip=_,this._listItemNode&&(this._listItemNode.title=_?_:"")}get hasChildren(){return this._hasChildren}set hasChildren(_){this._hasChildren!==_&&(this._hasChildren=_,this._listItemNode&&(_?this._listItemNode.classList.add("parent"):(this._listItemNode.classList.remove("parent"),this.collapse()),this.didChange()))}get hidden(){return this._hidden}set hidden(_){this._hidden===_||(this._hidden=_,this._listItemNode&&(this._listItemNode.hidden=this._hidden),this._childrenListNode&&(this._childrenListNode.hidden=this._hidden),this.treeOutline&&this.treeOutline.dispatchEventToListeners(WebInspector.TreeOutline.Event.ElementVisibilityDidChange,{element:this}))}get shouldRefreshChildren(){return this._shouldRefreshChildren}set shouldRefreshChildren(_){this._shouldRefreshChildren=_,_&&this.expanded&&this.expand()}_fireDidChange(){this.treeOutline&&this.treeOutline._treeElementDidChange(this)}didChange(){this.treeOutline&&this.onNextFrame._fireDidChange()}_setListItemNodeContent(){this._listItemNode&&(this._titleHTML||this._title?"string"==typeof this._titleHTML?this._listItemNode.innerHTML=this._titleHTML:"string"==typeof this._title?this._listItemNode.textContent=this._title:(this._listItemNode.removeChildren(),this._title.parentNode&&this._title.parentNode.removeChild(this._title),this._listItemNode.appendChild(this._title)):this._listItemNode.removeChildren())}_attach(){(!this._listItemNode||this.parent._shouldRefreshChildren)&&(this._listItemNode&&this._listItemNode.parentNode&&this._listItemNode.parentNode.removeChild(this._listItemNode),this._listItemNode=this.treeOutline._childrenListNode.ownerDocument.createElement("li"),this._listItemNode.treeElement=this,this._setListItemNodeContent(),this._listItemNode.title=this._tooltip?this._tooltip:"",this._listItemNode.hidden=this.hidden,this.hasChildren&&this._listItemNode.classList.add("parent"),this.expanded&&this._listItemNode.classList.add("expanded"),this.selected&&this._listItemNode.classList.add("selected"),this._listItemNode.addEventListener("mousedown",WebInspector.TreeElement.treeElementMouseDown),this._listItemNode.addEventListener("click",WebInspector.TreeElement.treeElementToggled),this._listItemNode.addEventListener("dblclick",WebInspector.TreeElement.treeElementDoubleClicked),this.onattach&&this.onattach(this));var _=null;this.nextSibling&&this.nextSibling._listItemNode&&this.nextSibling._listItemNode.parentNode===this.parent._childrenListNode&&(_=this.nextSibling._listItemNode),this.parent._childrenListNode.insertBefore(this._listItemNode,_),this._childrenListNode&&this.parent._childrenListNode.insertBefore(this._childrenListNode,this._listItemNode.nextSibling),this.selected&&this.select(),this.expanded&&this.expand()}_detach(){this.ondetach&&this.ondetach(this),this._listItemNode&&this._listItemNode.parentNode&&this._listItemNode.parentNode.removeChild(this._listItemNode),this._childrenListNode&&this._childrenListNode.parentNode&&this._childrenListNode.parentNode.removeChild(this._childrenListNode)}static treeElementMouseDown(_){var S=_.currentTarget;return S&&S.treeElement&&S.treeElement.selectable?S.treeElement.isEventWithinDisclosureTriangle(_)?void _.preventDefault():void S.treeElement.selectOnMouseDown(_):void 0}static treeElementToggled(_){var S=_.currentTarget;if(S&&S.treeElement){var C=S.treeElement.toggleOnClick&&!S.treeElement.selectable,f=S.treeElement.isEventWithinDisclosureTriangle(_);(C||f)&&(S.treeElement.expanded?_.altKey?S.treeElement.collapseRecursively():S.treeElement.collapse():_.altKey?S.treeElement.expandRecursively():S.treeElement.expand(),_.stopPropagation())}}static treeElementDoubleClicked(_){var S=_.currentTarget;!S||!S.treeElement||S.treeElement.isEventWithinDisclosureTriangle(_)||S.treeElement.dispatchEventToListeners(WebInspector.TreeElement.Event.DoubleClick)||(S.treeElement.ondblclick?S.treeElement.ondblclick.call(S.treeElement,_):S.treeElement.hasChildren&&!S.treeElement.expanded&&S.treeElement.expand())}collapse(){this._listItemNode&&this._listItemNode.classList.remove("expanded"),this._childrenListNode&&this._childrenListNode.classList.remove("expanded"),this.expanded=!1,this.treeOutline&&(this.treeOutline._treeElementsExpandedState[this.identifier]=!1),this.oncollapse&&this.oncollapse(this),this.treeOutline&&this.treeOutline.dispatchEventToListeners(WebInspector.TreeOutline.Event.ElementDisclosureDidChanged,{element:this})}collapseRecursively(){for(var _=this;_;)_.expanded&&_.collapse(),_=_.traverseNextTreeElement(!1,this,!0)}expand(){if(!(this.expanded&&!this._shouldRefreshChildren&&this._childrenListNode)&&(this.expanded=!0,this.treeOutline&&(this.treeOutline._treeElementsExpandedState[this.identifier]=!0),!!this.hasChildren)){if(this.treeOutline&&(!this._childrenListNode||this._shouldRefreshChildren)){this._childrenListNode&&this._childrenListNode.parentNode&&this._childrenListNode.parentNode.removeChild(this._childrenListNode),this._childrenListNode=this.treeOutline._childrenListNode.ownerDocument.createElement("ol"),this._childrenListNode.parentTreeElement=this,this._childrenListNode.classList.add("children"),this._childrenListNode.hidden=this.hidden,this.onpopulate(),this.expanded=!0;for(var _=0;_=_,C),f+=C.depthChange}hasAncestor(_){if(!_)return!1;for(var S=this.parent;S;){if(_===S)return!0;S=S.parent}return!1}reveal(){for(var _=this.parent;_&&!_.root;)_.expanded||_.expand(),_=_.parent;this.onreveal&&this.onreveal(this)}revealed(_){if(!_&&this.hidden)return!1;for(var S=this.parent;S&&!S.root;){if(!S.expanded)return!1;if(!_&&S.hidden)return!1;S=S.parent}return!0}selectOnMouseDown(){this.select(!1,!0)}select(_,S,C,f){if(this.treeOutline&&this.selectable&&(!this.selected||this.treeOutline.allowsRepeatSelection)){_||this.treeOutline._childrenListNode.focus();let T=this.treeOutline;if(T){T.processingSelectionChange=!0,C||(f=!0);let E=T.selectedTreeElement;this.selected||(T.selectedTreeElement&&T.selectedTreeElement.deselect(f),this.selected=!0,T.selectedTreeElement=this,this._listItemNode&&this._listItemNode.classList.add("selected")),C||(this.onselect&&this.onselect(this,S),T.dispatchEventToListeners(WebInspector.TreeOutline.Event.SelectionDidChange,{selectedElement:this,deselectedElement:E,selectedByUser:S})),T.processingSelectionChange=!1;let I=WebInspector.TreeOutlineGroup.groupForTreeOutline(T);I&&I.didSelectTreeElement(this)}}}revealAndSelect(_,S,C,f){this.reveal(),this.select(_,S,C,f)}deselect(_){return this.treeOutline&&this.treeOutline.selectedTreeElement===this&&this.selected&&(this.selected=!1,this.treeOutline.selectedTreeElement=null,this._listItemNode&&this._listItemNode.classList.remove("selected"),_||(this.ondeselect&&this.ondeselect(this),this.treeOutline.dispatchEventToListeners(WebInspector.TreeOutline.Event.SelectionDidChange,{deselectedElement:this})),!0)}onpopulate(){}traverseNextTreeElement(_,S,C,f){function T(R){return _&&!R.revealed(!0)}var E=0,I=this;C||I.onpopulate();do if(I.hasChildren&&I.children[0]&&(!_||I.expanded))I=I.children[0],E+=1;else{for(;I&&!I.nextSibling&&I.parent&&!I.parent.root&&I.parent!==S;)I=I.parent,E-=1;I&&(I=I.nextSibling)}while(I&&T(I));return f&&(f.depthChange=E),I}traversePreviousTreeElement(_,S){function C(T){return _&&!T.revealed(!0)}var f=this;do if(f.previousSibling)for(f=f.previousSibling;f&&f.hasChildren&&f.expanded&&!C(f);)S||f.onpopulate(),f=f.children.lastValue;else f=f.parent&&f.parent.root?null:f.parent;while(f&&C(f));return f}isEventWithinDisclosureTriangle(_){if(!document.contains(this._listItemNode))return!1;let S=window.getComputedStyle(this._listItemNode),C=0;return C+=WebInspector.resolvedLayoutDirection()===WebInspector.LayoutDirection.RTL?this._listItemNode.totalOffsetRight-S.getPropertyCSSValue("padding-right").getFloatValue(CSSPrimitiveValue.CSS_PX)-this.arrowToggleWidth:this._listItemNode.totalOffsetLeft+S.getPropertyCSSValue("padding-left").getFloatValue(CSSPrimitiveValue.CSS_PX),_.pageX>=C&&_.pageX<=C+this.arrowToggleWidth&&this.hasChildren}populateContextMenu(_){(this.children.some(C=>C.hasChildren)||this.hasChildren&&!this.children.length)&&(_.appendSeparator(),_.appendItem(WebInspector.UIString("Expand All"),this.expandRecursively.bind(this)),_.appendItem(WebInspector.UIString("Collapse All"),this.collapseRecursively.bind(this)))}},WebInspector.TreeElement.Event={DoubleClick:"tree-element-double-click"},WebInspector.TreeOutline=class extends WebInspector.Object{constructor(_){super(),this.element=_||document.createElement("ol"),this.element.classList.add(WebInspector.TreeOutline.ElementStyleClassName),this.element.addEventListener("contextmenu",this._handleContextmenu.bind(this)),this.children=[],this.selectedTreeElement=null,this._childrenListNode=this.element,this._childrenListNode.removeChildren(),this._knownTreeElements=[],this._treeElementsExpandedState=[],this.allowsRepeatSelection=!1,this.root=!0,this.hasChildren=!1,this.expanded=!0,this.selected=!1,this.treeOutline=this,this._hidden=!1,this._compact=!1,this._large=!1,this._disclosureButtons=!0,this._customIndent=!1,this._childrenListNode.tabIndex=0,this._childrenListNode.addEventListener("keydown",this._treeKeyDown.bind(this),!0),WebInspector.TreeOutline._generateStyleRulesIfNeeded()}get hidden(){return this._hidden}set hidden(_){this._hidden===_||(this._hidden=_,this.element.hidden=this._hidden)}get compact(){return this._compact}set compact(_){this._compact===_||(this._compact=_,this._compact&&(this.large=!1),this.element.classList.toggle("compact",this._compact))}get large(){return this._large}set large(_){this._large===_||(this._large=_,this._large&&(this.compact=!1),this.element.classList.toggle("large",this._large))}get disclosureButtons(){return this._disclosureButtons}set disclosureButtons(_){this._disclosureButtons===_||(this._disclosureButtons=_,this.element.classList.toggle("hide-disclosure-buttons",!this._disclosureButtons))}get customIndent(){return this._customIndent}set customIndent(_){this._customIndent===_||(this._customIndent=_,this.element.classList.toggle(WebInspector.TreeOutline.CustomIndentStyleClassName,this._customIndent))}appendChild(_){if(_){var S=this.children[this.children.length-1];S?(S.nextSibling=_,_.previousSibling=S):(_.previousSibling=null,_.nextSibling=null);var C=!this.children.length;this.children.push(_),this.hasChildren=!0,_.parent=this,_.treeOutline=this.treeOutline,_.treeOutline._rememberTreeElement(_);for(var f=_.children[0];f;)f.treeOutline=this.treeOutline,f.treeOutline._rememberTreeElement(f),f=f.traverseNextTreeElement(!1,_,!0);_.hasChildren&&void 0!==_.treeOutline._treeElementsExpandedState[_.identifier]&&(_.expanded=_.treeOutline._treeElementsExpandedState[_.identifier]),this._childrenListNode&&_._attach(),this.treeOutline&&this.treeOutline.dispatchEventToListeners(WebInspector.TreeOutline.Event.ElementAdded,{element:_}),C&&this.expanded&&this.expand()}}insertChild(_,S){if(_){var C=0_||_>=this.children.length)){let f=this.children[_];this.children.splice(_,1);let T=f.parent;f.deselect(S)&&(f.previousSibling&&!C?f.previousSibling.select(!0,!1):f.nextSibling&&!C?f.nextSibling.select(!0,!1):!C&&T.select(!0,!1)),f.previousSibling&&(f.previousSibling.nextSibling=f.nextSibling),f.nextSibling&&(f.nextSibling.previousSibling=f.previousSibling);let E=f.treeOutline;E&&(E._forgetTreeElement(f),E._forgetChildrenRecursive(f)),f._detach(),f.treeOutline=null,f.parent=null,f.nextSibling=null,f.previousSibling=null,E&&E.dispatchEventToListeners(WebInspector.TreeOutline.Event.ElementRemoved,{element:f})}}removeChild(_,S,C){if(_){var f=this.children.indexOf(_);-1===f||(this.removeChildAtIndex(f,S,C),!this.children.length&&(this._listItemNode&&this._listItemNode.classList.remove("parent"),this.hasChildren=!1))}}removeChildren(_){for(let S of this.children){S.deselect(_);let C=S.treeOutline;C&&(C._forgetTreeElement(S),C._forgetChildrenRecursive(S)),S._detach(),S.treeOutline=null,S.parent=null,S.nextSibling=null,S.previousSibling=null,C&&C.dispatchEventToListeners(WebInspector.TreeOutline.Event.ElementRemoved,{element:S})}this.children=[]}removeChildrenRecursive(_){let S=this.children,C=this.children[0];for(;C;)C.children.length&&(S=S.concat(C.children)),C=C.traverseNextTreeElement(!1,this,!0);for(let f of S){f.deselect(_);let T=f.treeOutline;T&&T._forgetTreeElement(f),f._detach(),f.children=[],f.treeOutline=null,f.parent=null,f.nextSibling=null,f.previousSibling=null,T&&T.dispatchEventToListeners(WebInspector.TreeOutline.Event.ElementRemoved,{element:f})}this.children=[]}reattachIfIndexChanged(_,S){if(this.children[S]!==_){let C=_.selected;_.parent===this&&this.removeChild(_),this.insertChild(_,S),C&&_.select()}}_rememberTreeElement(_){this._knownTreeElements[_.identifier]||(this._knownTreeElements[_.identifier]=[]);var S=this._knownTreeElements[_.identifier];-1!==S.indexOf(_)||S.push(_)}_forgetTreeElement(_){this.selectedTreeElement===_&&(_.deselect(!0),this.selectedTreeElement=null),this._knownTreeElements[_.identifier]&&this._knownTreeElements[_.identifier].remove(_,!0)}_forgetChildrenRecursive(_){for(var S=_.children[0];S;)this._forgetTreeElement(S),S=S.traverseNextTreeElement(!1,_,!0)}getCachedTreeElement(_){if(!_)return null;if(_.__treeElementIdentifier){var S=this._knownTreeElements[_.__treeElementIdentifier];if(S)for(var C=0;C .children",f+=`.${WebInspector.TreeOutline.ElementStyleClassName}:not(.${WebInspector.TreeOutline.CustomIndentStyleClassName})${T} > .item { `,f+=WebInspector.resolvedLayoutDirection()===WebInspector.LayoutDirection.RTL?"padding-right: ":"padding-left: ",f+=5+10*E+"px; }\n";WebInspector.TreeOutline._styleElement.textContent=f,document.head.appendChild(WebInspector.TreeOutline._styleElement)}}_handleContextmenu(_){let S=this.treeElementFromEvent(_);if(S){let C=WebInspector.ContextMenu.createFromEvent(_);this.populateContextMenu(C,_,S)}}},WebInspector.TreeOutline._styleElement=null,WebInspector.TreeOutline.ElementStyleClassName="tree-outline",WebInspector.TreeOutline.CustomIndentStyleClassName="custom-indent",WebInspector.TreeOutline.Event={ElementAdded:Symbol("element-added"),ElementDidChange:Symbol("element-did-change"),ElementRemoved:Symbol("element-removed"),ElementDisclosureDidChanged:Symbol("element-disclosure-did-change"),ElementVisibilityDidChange:Symbol("element-visbility-did-change"),SelectionDidChange:Symbol("selection-did-change")},WebInspector.TreeOutline._knownTreeElementNextIdentifier=1,WebInspector.TreeOutlineGroup=class extends WebInspector.Collection{constructor(){super(_=>_ instanceof WebInspector.TreeOutline)}static groupForTreeOutline(_){return _[WebInspector.TreeOutlineGroup.GroupForTreeOutlineSymbol]||null}get selectedTreeElement(){for(let _ of this.items)if(_.selectedTreeElement)return _.selectedTreeElement;return null}itemAdded(_){_[WebInspector.TreeOutlineGroup.GroupForTreeOutlineSymbol]=this,_.selectedTreeElement&&this._removeConflictingTreeSelections(_.selectedTreeElement)}itemRemoved(_){_[WebInspector.TreeOutlineGroup.GroupForTreeOutlineSymbol]=null}didSelectTreeElement(_){_&&this._removeConflictingTreeSelections(_)}_removeConflictingTreeSelections(_){let S=_.treeOutline;for(let C of this.items)S!==C&&C.selectedTreeElement&&C.selectedTreeElement.deselect()}},WebInspector.TreeOutlineGroup.GroupForTreeOutlineSymbol=Symbol("group-for-tree-outline"),WebInspector.ButtonNavigationItem=class extends WebInspector.NavigationItem{constructor(_,S,C,f,T,E,I){super(_),this.toolTip=S,this._element.addEventListener("click",this._mouseClicked.bind(this)),this._element.setAttribute("role",E||"button"),I&&this._element.setAttribute("aria-label",I),this._imageWidth=f||16,this._imageHeight=T||16,C?this.image=C:this.label=S}get toolTip(){return this._element.title}set toolTip(_){_&&(this._element.title=_)}get label(){return this._element.textContent}set label(_){this._element.classList.add(WebInspector.ButtonNavigationItem.TextOnlyClassName),this._element.textContent=_||"",this.parentNavigationBar&&this.parentNavigationBar.needsLayout()}get image(){return this._image}set image(_){return _?void(this._element.removeChildren(),this._element.classList.remove(WebInspector.ButtonNavigationItem.TextOnlyClassName),this._image=_,this._glyphElement=useSVGSymbol(this._image,"glyph"),this._glyphElement.style.width=this._imageWidth+"px",this._glyphElement.style.height=this._imageHeight+"px",this._element.appendChild(this._glyphElement)):void this._element.removeChildren()}get enabled(){return!this._element.classList.contains(WebInspector.ButtonNavigationItem.DisabledStyleClassName)}set enabled(_){_?this._element.classList.remove(WebInspector.ButtonNavigationItem.DisabledStyleClassName):this._element.classList.add(WebInspector.ButtonNavigationItem.DisabledStyleClassName)}get additionalClassNames(){return["button"]}_mouseClicked(){this.enabled&&this.dispatchEventToListeners(WebInspector.ButtonNavigationItem.Event.Clicked)}},WebInspector.ButtonNavigationItem.DisabledStyleClassName="disabled",WebInspector.ButtonNavigationItem.TextOnlyClassName="text-only",WebInspector.ButtonNavigationItem.Event={Clicked:"button-navigation-item-clicked"},WebInspector.DatabaseUserQueryViewBase=class extends WebInspector.View{constructor(_){super(),this.element.className="database-user-query";let S=document.createElement("span");S.className="database-query-text",S.textContent=_,this.element.appendChild(S),this._resultElement=document.createElement("div"),this._resultElement.className="database-query-result",this.element.appendChild(this._resultElement)}get resultElement(){return this._resultElement}},WebInspector.DatabaseUserQueryErrorView=class extends WebInspector.DatabaseUserQueryViewBase{constructor(_,S){super(_),this.resultElement.classList.add("error"),this.resultElement.textContent=S}},WebInspector.DatabaseUserQuerySuccessView=class extends WebInspector.DatabaseUserQueryViewBase{constructor(_,S,C){super(_),this._dataGrid=WebInspector.DataGrid.createSortableDataGrid(S,C),this._dataGrid?(this._dataGrid.inline=!0,this.resultElement.appendChild(this._dataGrid.element),this._dataGrid.updateLayoutIfNeeded()):(this.resultElement.classList.add("no-results"),this.resultElement.textContent=WebInspector.UIString("Query returned no results."))}get dataGrid(){return this._dataGrid}layout(){this._dataGrid&&this._dataGrid.updateLayout()}},WebInspector.DOMTreeContentView=class extends WebInspector.ContentView{constructor(_){super(_),this._compositingBordersButtonNavigationItem=new WebInspector.ActivateButtonNavigationItem("layer-borders",WebInspector.UIString("Show compositing borders"),WebInspector.UIString("Hide compositing borders"),"Images/LayerBorders.svg",13,13),this._compositingBordersButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._toggleCompositingBorders,this),this._compositingBordersButtonNavigationItem.enabled=!!PageAgent.getCompositingBordersVisible,WebInspector.showPaintRectsSetting.addEventListener(WebInspector.Setting.Event.Changed,this._showPaintRectsSettingChanged,this),this._paintFlashingButtonNavigationItem=new WebInspector.ActivateButtonNavigationItem("paint-flashing",WebInspector.UIString("Enable paint flashing"),WebInspector.UIString("Disable paint flashing"),"Images/PaintFlashing.svg",16,16),this._paintFlashingButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._togglePaintFlashing,this),this._paintFlashingButtonNavigationItem.enabled=!!PageAgent.setShowPaintRects,this._paintFlashingButtonNavigationItem.activated=PageAgent.setShowPaintRects&&WebInspector.showPaintRectsSetting.value,WebInspector.showShadowDOMSetting.addEventListener(WebInspector.Setting.Event.Changed,this._showShadowDOMSettingChanged,this),this._showsShadowDOMButtonNavigationItem=new WebInspector.ActivateButtonNavigationItem("shows-shadow-DOM",WebInspector.UIString("Show shadow DOM nodes"),WebInspector.UIString("Hide shadow DOM nodes"),"Images/ShadowDOM.svg",13,13),this._showsShadowDOMButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._toggleShowsShadowDOMSetting,this),this._showShadowDOMSettingChanged(),WebInspector.showPrintStylesSetting.addEventListener(WebInspector.Setting.Event.Changed,this._showPrintStylesSettingChanged,this),this._showPrintStylesButtonNavigationItem=new WebInspector.ActivateButtonNavigationItem("print-styles",WebInspector.UIString("Force Print Media Styles"),WebInspector.UIString("Use Default Media Styles"),"Images/Printer.svg",16,16),this._showPrintStylesButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._togglePrintStylesSetting,this),this._showPrintStylesSettingChanged(),this.element.classList.add("dom-tree"),this.element.addEventListener("click",this._mouseWasClicked.bind(this),!1),this._domTreeOutline=new WebInspector.DOMTreeOutline(!0,!0,!0),this._domTreeOutline.addEventListener(WebInspector.TreeOutline.Event.ElementAdded,this._domTreeElementAdded,this),this._domTreeOutline.addEventListener(WebInspector.DOMTreeOutline.Event.SelectedNodeChanged,this._selectedNodeDidChange,this),this._domTreeOutline.wireToDomAgent(),this._domTreeOutline.editable=!0,this.element.appendChild(this._domTreeOutline.element),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeModified,this._domNodeChanged,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeRemoved,this._domNodeChanged,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.CharacterDataModified,this._domNodeChanged,this),this._lastSelectedNodePathSetting=new WebInspector.Setting("last-selected-node-path",null),this._numberOfSearchResults=null,this._breakpointGutterEnabled=!1,this._pendingBreakpointNodeIdentifiers=new Set,WebInspector.domDebuggerManager.supported&&(WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointsEnabledDidChange,this._breakpointsEnabledDidChange,this),WebInspector.domDebuggerManager.addEventListener(WebInspector.DOMDebuggerManager.Event.DOMBreakpointAdded,this._domBreakpointAddedOrRemoved,this),WebInspector.domDebuggerManager.addEventListener(WebInspector.DOMDebuggerManager.Event.DOMBreakpointRemoved,this._domBreakpointAddedOrRemoved,this),WebInspector.DOMBreakpoint.addEventListener(WebInspector.DOMBreakpoint.Event.DisabledStateDidChange,this._domBreakpointDisabledStateDidChange,this),WebInspector.DOMBreakpoint.addEventListener(WebInspector.DOMBreakpoint.Event.ResolvedStateDidChange,this._domBreakpointResolvedStateDidChange,this),this._breakpointsEnabledDidChange())}get navigationItems(){return[this._showPrintStylesButtonNavigationItem,this._showsShadowDOMButtonNavigationItem,this._compositingBordersButtonNavigationItem,this._paintFlashingButtonNavigationItem]}get domTreeOutline(){return this._domTreeOutline}get scrollableElements(){return[this.element]}get breakpointGutterEnabled(){return this._breakpointGutterEnabled}set breakpointGutterEnabled(_){this._breakpointGutterEnabled===_||(this._breakpointGutterEnabled=_,this.element.classList.toggle("show-gutter",this._breakpointGutterEnabled))}shown(){super.shown(),this._domTreeOutline.setVisible(!0,WebInspector.isConsoleFocused()),this._updateCompositingBordersButtonToMatchPageSettings();this._domTreeOutline.rootDOMNode&&this._restoreBreakpointsAfterUpdate()}hidden(){super.hidden(),WebInspector.domTreeManager.hideDOMNodeHighlight(),this._domTreeOutline.setVisible(!1)}closed(){super.closed(),WebInspector.showPaintRectsSetting.removeEventListener(null,null,this),WebInspector.showShadowDOMSetting.removeEventListener(null,null,this),WebInspector.debuggerManager.removeEventListener(null,null,this),WebInspector.domTreeManager.removeEventListener(null,null,this),WebInspector.domDebuggerManager.removeEventListener(null,null,this),WebInspector.DOMBreakpoint.removeEventListener(null,null,this),this._domTreeOutline.close(),this._pendingBreakpointNodeIdentifiers.clear()}get selectionPathComponents(){for(var _=this._domTreeOutline.selectedTreeElement,S=[];_&&!_.root;){if(_.isCloseTag()){_=_.parent;continue}var C=new WebInspector.DOMTreeElementPathComponent(_,_.representedObject);C.addEventListener(WebInspector.HierarchicalPathComponent.Event.Clicked,this._pathComponentSelected,this),S.unshift(C),_=_.parent}return S}restoreFromCookie(_){_&&_.nodeToSelect&&(this.selectAndRevealDOMNode(_.nodeToSelect),_.nodeToSelect=void 0)}selectAndRevealDOMNode(_,S){this._domTreeOutline.selectDOMNode(_,!S)}handleCopyEvent(_){var S=this._domTreeOutline.selectedDOMNode();S&&(_.clipboardData.clearData(),_.preventDefault(),S.copyNode())}get supportsSave(){return WebInspector.canArchiveMainFrame()}get saveData(){return{customSaveHandler:function(){WebInspector.archiveMainFrame()}}}get supportsSearch(){return!0}get numberOfSearchResults(){return this._numberOfSearchResults}get hasPerformedSearch(){return null!==this._numberOfSearchResults}set automaticallyRevealFirstSearchResult(_){this._automaticallyRevealFirstSearchResult=_,this._automaticallyRevealFirstSearchResult&&0E.disabled);C.breakpointStatus=T?WebInspector.DOMTreeElement.BreakpointStatus.DisabledBreakpoint:WebInspector.DOMTreeElement.BreakpointStatus.Breakpoint}}_restoreBreakpointsAfterUpdate(){this._pendingBreakpointNodeIdentifiers.clear(),this.breakpointGutterEnabled=!1;let _=new Set;for(let S of WebInspector.domDebuggerManager.domBreakpoints)_.has(S.domNodeIdentifier)||this._updateBreakpointStatus(S.domNodeIdentifier)}_breakpointsEnabledDidChange(){this._domTreeOutline.element.classList.toggle("breakpoints-disabled",!WebInspector.debuggerManager.breakpointsEnabled)}},WebInspector.DetailsSidebarPanel=class extends WebInspector.SidebarPanel{constructor(_,S,C){super(_,S),this.element.classList.add("details"),C||(this._navigationItem=new WebInspector.RadioButtonNavigationItem(_,S))}get navigationItem(){return this._navigationItem}inspect(){return!1}},WebInspector.GeneralTabBarItem=class extends WebInspector.TabBarItem{constructor(_,S,C){super(_,S,C);let f=document.createElement("div");f.classList.add(WebInspector.TabBarItem.CloseButtonStyleClassName),f.title=WebInspector.UIString("Click to close this tab; Option-click to close all tabs except this one"),this.element.insertBefore(f,this.element.firstChild),this.element.addEventListener("contextmenu",this._handleContextMenuEvent.bind(this))}set title(_){if(_){this._titleElement=document.createElement("span"),this._titleElement.classList.add("title");let S=document.createElement("span");S.classList.add("content"),S.textContent=_,this._titleElement.appendChild(S),this.element.insertBefore(this._titleElement,this.element.lastChild)}else this._titleElement&&this._titleElement.remove(),this._titleElement=null;super.title=_}_handleContextMenuEvent(_){if(this._parentTabBar){let f=this._parentTabBar.tabBarItems.some(E=>E!==this&&!(E instanceof WebInspector.PinnedTabBarItem)),T=WebInspector.ContextMenu.createFromEvent(_);T.appendItem(WebInspector.UIString("Close Tab"),()=>{this._parentTabBar.removeTabBarItem(this)},this.isDefaultTab),T.appendItem(WebInspector.UIString("Close Other Tabs"),()=>{let E=this._parentTabBar.tabBarItems;for(let I=E.length-1,R;0<=I;--I)R=E[I],R===this||R instanceof WebInspector.PinnedTabBarItem||this._parentTabBar.removeTabBarItem(R)},!f)}}},WebInspector.GeneralTreeElement=class extends WebInspector.TreeElement{constructor(_,S,C,f,T){super("",f,T),this.classNames=_,this._tooltipHandledSeparately=!1,this._mainTitle=S||"",this._subtitle=C||"",this._status=""}get element(){return this._listItemNode}get iconElement(){return this._createElementsIfNeeded(),this._iconElement}get titlesElement(){return this._createElementsIfNeeded(),this._titlesElement}get mainTitleElement(){return this._createElementsIfNeeded(),this._mainTitleElement}get subtitleElement(){return this._createElementsIfNeeded(),this._createSubtitleElementIfNeeded(),this._subtitleElement}get classNames(){return this._classNames}set classNames(_){_=_||[],"string"==typeof _&&(_=[_]);Array.shallowEqual(this._classNames,_)||(this._listItemNode&&this._classNames&&this._listItemNode.classList.remove(...this._classNames),this._classNames=_,this._listItemNode&&this._listItemNode.classList.add(...this._classNames))}addClassName(_){this._classNames.includes(_)||(this._classNames.push(_),this._listItemNode&&this._listItemNode.classList.add(_))}removeClassName(_){this._classNames.includes(_)&&(this._classNames.remove(_),this._listItemNode&&this._listItemNode.classList.remove(_))}get mainTitle(){return this._mainTitle}set mainTitle(_){_=_||"";this._mainTitle===_||(this._mainTitle=_,this._updateTitleElements(),this.didChange(),this.dispatchEventToListeners(WebInspector.GeneralTreeElement.Event.MainTitleDidChange))}get subtitle(){return this._subtitle}set subtitle(_){_=_||"";this._subtitle===_||(this._subtitle=_,this._updateTitleElements(),this.didChange())}get status(){return this._status}set status(_){_=_||"";this._status===_||(!this._statusElement&&(this._statusElement=document.createElement("div"),this._statusElement.className=WebInspector.GeneralTreeElement.StatusElementStyleClassName),this._status=_,this._updateStatusElement())}get filterableData(){return{text:[this.mainTitle,this.subtitle]}}get tooltipHandledSeparately(){return this._tooltipHandledSeparately}set tooltipHandledSeparately(_){this._tooltipHandledSeparately=!!_}isEventWithinDisclosureTriangle(_){return _.target===this._disclosureButton}onattach(){this._createElementsIfNeeded(),this._updateTitleElements(),this._listItemNode.classList.add("item"),this._classNames&&this._listItemNode.classList.add(...this._classNames),this._listItemNode.appendChild(this._disclosureButton),this._listItemNode.appendChild(this._iconElement),this._statusElement&&this._listItemNode.appendChild(this._statusElement),this._listItemNode.appendChild(this._titlesElement)}ondetach(){}onreveal(){this._listItemNode&&this._listItemNode.scrollIntoViewIfNeeded(!1)}callFirstAncestorFunction(_,S){for(var C=this.parent;C;){if("function"==typeof C[_]){C[_].apply(C,S);break}C=C.parent}}_createElementsIfNeeded(){this._createdElements||(this._disclosureButton=document.createElement("button"),this._disclosureButton.className=WebInspector.GeneralTreeElement.DisclosureButtonStyleClassName,this._disclosureButton.tabIndex=-1,this._iconElement=document.createElement("img"),this._iconElement.className=WebInspector.GeneralTreeElement.IconElementStyleClassName,this._titlesElement=document.createElement("div"),this._titlesElement.className=WebInspector.GeneralTreeElement.TitlesElementStyleClassName,this._mainTitleElement=document.createElement("span"),this._mainTitleElement.className=WebInspector.GeneralTreeElement.MainTitleElementStyleClassName,this._titlesElement.appendChild(this._mainTitleElement),this._createdElements=!0)}_createSubtitleElementIfNeeded(){this._subtitleElement||(this._subtitleElement=document.createElement("span"),this._subtitleElement.className=WebInspector.GeneralTreeElement.SubtitleElementStyleClassName,this._titlesElement.appendChild(this._subtitleElement))}_updateTitleElements(){this._createdElements&&("string"==typeof this._mainTitle?this._mainTitleElement.textContent!==this._mainTitle&&(this._mainTitleElement.textContent=this._mainTitle):this._mainTitle instanceof Node&&(this._mainTitleElement.removeChildren(),this._mainTitleElement.appendChild(this._mainTitle)),"string"==typeof this._subtitle&&this._subtitle?(this._createSubtitleElementIfNeeded(),this._subtitleElement.textContent!==this._subtitle&&(this._subtitleElement.textContent=this._subtitle),this._titlesElement.classList.remove(WebInspector.GeneralTreeElement.NoSubtitleStyleClassName)):this._subtitle instanceof Node?(this._createSubtitleElementIfNeeded(),this._subtitleElement.removeChildren(),this._subtitleElement.appendChild(this._subtitle)):(this._subtitleElement&&(this._subtitleElement.textContent=""),this._titlesElement.classList.add(WebInspector.GeneralTreeElement.NoSubtitleStyleClassName)),!this.tooltip&&!this._tooltipHandledSeparately&&this._updateTitleTooltip())}_updateTitleTooltip(){if(this._listItemNode){let _=this._mainTitleElement.textContent,S=this._subtitleElement?this._subtitleElement.textContent:"",C=this.treeOutline&&this.treeOutline.large;this._listItemNode.title=_&&S?_+(C?"\n":" \u2014 ")+S:_?_:S}}_updateStatusElement(){this._statusElement&&(!this._statusElement.parentNode&&this._listItemNode&&this._listItemNode.insertBefore(this._statusElement,this._titlesElement),this._status instanceof Node?(this._statusElement.removeChildren(),this._statusElement.appendChild(this._status)):this._statusElement.textContent=this._status)}},WebInspector.GeneralTreeElement.DisclosureButtonStyleClassName="disclosure-button",WebInspector.GeneralTreeElement.IconElementStyleClassName="icon",WebInspector.GeneralTreeElement.StatusElementStyleClassName="status",WebInspector.GeneralTreeElement.TitlesElementStyleClassName="titles",WebInspector.GeneralTreeElement.MainTitleElementStyleClassName="title",WebInspector.GeneralTreeElement.SubtitleElementStyleClassName="subtitle",WebInspector.GeneralTreeElement.NoSubtitleStyleClassName="no-subtitle",WebInspector.GeneralTreeElement.Event={MainTitleDidChange:"general-tree-element-main-title-did-change"},WebInspector.NavigationSidebarPanel=class extends WebInspector.SidebarPanel{constructor(_,S,C){super(_,S),this.element.classList.add("navigation"),this.contentView.element.addEventListener("scroll",this.soon._updateContentOverflowShadowVisibility),this._contentTreeOutlineGroup=new WebInspector.TreeOutlineGroup,this._contentTreeOutline=this.createContentTreeOutline(),this._filterBar=new WebInspector.FilterBar,this._filterBar.addEventListener(WebInspector.FilterBar.Event.FilterDidChange,this._filterDidChange,this),this.element.appendChild(this._filterBar.element),this._bottomOverflowShadowElement=document.createElement("div"),this._bottomOverflowShadowElement.className=WebInspector.NavigationSidebarPanel.OverflowShadowElementStyleClassName,this.element.appendChild(this._bottomOverflowShadowElement),this._boundUpdateContentOverflowShadowVisibility=this.soon._updateContentOverflowShadowVisibility,window.addEventListener("resize",this._boundUpdateContentOverflowShadowVisibility),this._filtersSetting=new WebInspector.Setting(_+"-navigation-sidebar-filters",{}),this._filterBar.filters=this._filtersSetting.value,this._emptyContentPlaceholderElements=new Map,this._emptyFilterResults=new Map,this._shouldAutoPruneStaleTopLevelResourceTreeElements=C||!1,this._shouldAutoPruneStaleTopLevelResourceTreeElements&&(WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange,this._checkForStaleResources,this),WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ChildFrameWasRemoved,this._checkForStaleResources,this),WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasRemoved,this._checkForStaleResources,this)),this._pendingViewStateCookie=null,this._restoringState=!1}closed(){window.removeEventListener("resize",this._boundUpdateContentOverflowShadowVisibility),WebInspector.Frame.removeEventListener(null,null,this)}get contentBrowser(){return this._contentBrowser}set contentBrowser(_){this._contentBrowser=_||null}get contentTreeOutline(){return this._contentTreeOutline}get contentTreeOutlines(){return this._contentTreeOutlineGroup.items}get currentRepresentedObject(){return this._contentBrowser?this._contentBrowser.currentRepresentedObjects[0]||null:null}get filterBar(){return this._filterBar}get restoringState(){return this._restoringState}cancelRestoringState(){this._finalAttemptToRestoreViewStateTimeout&&(clearTimeout(this._finalAttemptToRestoreViewStateTimeout),this._finalAttemptToRestoreViewStateTimeout=void 0)}createContentTreeOutline(_){let S=new WebInspector.TreeOutline;return S.allowsRepeatSelection=!0,S.element.classList.add(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName),this._contentTreeOutlineGroup.add(S),this.contentView.element.appendChild(S.element),_||(S.addEventListener(WebInspector.TreeOutline.Event.ElementAdded,this._treeElementAddedOrChanged,this),S.addEventListener(WebInspector.TreeOutline.Event.ElementDidChange,this._treeElementAddedOrChanged,this),S.addEventListener(WebInspector.TreeOutline.Event.ElementDisclosureDidChanged,this._treeElementDisclosureDidChange,this)),S[WebInspector.NavigationSidebarPanel.SuppressFilteringSymbol]=_,S}suppressFilteringOnTreeElements(_){for(let S of _)S[WebInspector.NavigationSidebarPanel.SuppressFilteringSymbol]=!0;this._updateFilter()}treeElementForRepresentedObject(_){let S=null;for(let C of this.contentTreeOutlines)if(S=C.getCachedTreeElement(_),S)break;return S}showDefaultContentView(){}showDefaultContentViewForTreeElement(_){if(!_||!_.representedObject)return!1;if(!this.selected){let C=this.contentBrowser.contentViewForRepresentedObject(_.representedObject);if(C&&C.parentContainer&&C.parentContainer!==this.contentBrowser.contentViewContainer)return!1;let f=WebInspector.tabBrowser.selectedTabContentView;if(f&&f.contentBrowser!==this.contentBrowser)return!1}let S=this.contentBrowser.showContentViewForRepresentedObject(_.representedObject);return!!S&&(_.revealAndSelect(!0,!1,!0,!0),!0)}saveStateToCookie(_){if(this._contentBrowser){let S=this.currentRepresentedObject;if(S)return _[WebInspector.TypeIdentifierCookieKey]=S.constructor.TypeIdentifier,S.saveIdentityToCookie?void S.saveIdentityToCookie(_):void console.error("NavigationSidebarPanel representedObject is missing a saveIdentityToCookie implementation.",S)}}restoreStateFromCookie(_,S){this._pendingViewStateCookie=_,this._restoringState=!0,this._checkOutlinesForPendingViewStateCookie(),this._finalAttemptToRestoreViewStateTimeout&&clearTimeout(this._finalAttemptToRestoreViewStateTimeout);0===S||(this._finalAttemptToRestoreViewStateTimeout=setTimeout(function(){this._finalAttemptToRestoreViewStateTimeout=void 0,this._checkOutlinesForPendingViewStateCookie(!0),this._pendingViewStateCookie=null,this._restoringState=!1}.bind(this),S))}showEmptyContentPlaceholder(_,S){S=S||this._contentTreeOutline;let C=this._createEmptyContentPlaceholderIfNeeded(S);if(!(C.parentNode&&C.children[0].textContent===_)){C.children[0].textContent=_;let f=S.element.parentNode;f.appendChild(C),this._updateContentOverflowShadowVisibility()}}hideEmptyContentPlaceholder(_){_=_||this._contentTreeOutline;let S=this._emptyContentPlaceholderElements.get(_);S&&S.parentNode&&(S.remove(),this._updateContentOverflowShadowVisibility())}updateEmptyContentPlaceholder(_,S){S=S||this._contentTreeOutline,S.children.length?!this._emptyFilterResults.get(S)&&this.hideEmptyContentPlaceholder(S):this.showEmptyContentPlaceholder(_,S)}updateFilter(){this._updateFilter()}shouldFilterPopulate(){return this.hasCustomFilters()}hasCustomFilters(){return!1}matchTreeElementAgainstCustomFilters(){return!0}matchTreeElementAgainstFilterFunctions(_){if(!this._filterFunctions||!this._filterFunctions.length)return!0;for(var S of this._filterFunctions)if(S(_))return!0;return!1}applyFiltersToTreeElement(_){if(!this._filterBar.hasActiveFilters()&&!this.hasCustomFilters())return _.hidden=!1,void(_.expanded&&_[WebInspector.NavigationSidebarPanel.WasExpandedDuringFilteringSymbol]&&(_[WebInspector.NavigationSidebarPanel.WasExpandedDuringFilteringSymbol]=!1,_.collapse()));var f=_.filterableData||{},T={expandTreeElement:!1},E=this._textFilterRegex;let I=_[WebInspector.NavigationSidebarPanel.SuppressFilteringSymbol];return I||function(R){if(!R||!E)return!0;for(var N of R)if(N&&E.test(N))return T.expandTreeElement=!0,!0;return!1}(f.text)&&this.matchTreeElementAgainstFilterFunctions(_,T)&&this.matchTreeElementAgainstCustomFilters(_,T)?(function(){_.hidden=!1;for(var R=_.parent;R&&!R.root;)R.hidden=!1,T.expandTreeElement&&!R.expanded&&(R.__wasExpandedDuringFiltering=!0,R.expand()),R=R.parent}(),void(!T.expandTreeElement&&_.expanded&&_[WebInspector.NavigationSidebarPanel.WasExpandedDuringFilteringSymbol]&&(_[WebInspector.NavigationSidebarPanel.WasExpandedDuringFilteringSymbol]=!1,_.collapse()))):void(_.hidden=!0)}shown(){super.shown(),this._updateContentOverflowShadowVisibility()}pruneStaleResourceTreeElements(){this._checkForStaleResourcesTimeoutIdentifier&&(clearTimeout(this._checkForStaleResourcesTimeoutIdentifier),this._checkForStaleResourcesTimeoutIdentifier=void 0);for(let f of this.contentTreeOutlines)for(var _=f.children.length-1,S;0<=_;--_)if(S=f.children[_],S instanceof WebInspector.ResourceTreeElement){var C=S.resource;(!C.parentFrame||C.parentFrame.isDetached())&&f.removeChildAtIndex(_,!0,!0)}}treeElementAddedOrChanged(){}_updateContentOverflowShadowVisibility(){if(this.visible){this._updateContentOverflowShadowVisibility.cancelDebounce();let _=this.contentView.element.scrollHeight,S=this.contentView.element.offsetHeight;if(_N[D]===f[D])}if(this._pendingViewStateCookie){var f=this._pendingViewStateCookie,T=null;if(_.some(E=>{return!!C.call(this,E)&&(T=E,!0)}),T){let E=this.showDefaultContentViewForTreeElement(T);if(!E)return;this._pendingViewStateCookie=null,setTimeout(()=>{this._restoringState=!1},0),this._finalAttemptToRestoreViewStateTimeout&&(clearTimeout(this._finalAttemptToRestoreViewStateTimeout),this._finalAttemptToRestoreViewStateTimeout=void 0)}}}_createEmptyContentPlaceholderIfNeeded(_){let S=this._emptyContentPlaceholderElements.get(_);if(S)return S;S=document.createElement("div"),S.classList.add(WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderElementStyleClassName),this._emptyContentPlaceholderElements.set(_,S);let C=document.createElement("div");return C.className=WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderMessageElementStyleClassName,S.appendChild(C),S}_treeElementWasFiltered(_){if(!(_.selected||_.hidden)){let S=this.currentRepresentedObject;if(S&&_.representedObject===S){_.revealAndSelect(!0,!1,!0,!0)}}}},WebInspector.NavigationSidebarPanel.SuppressFilteringSymbol=Symbol("suppress-filtering"),WebInspector.NavigationSidebarPanel.WasExpandedDuringFilteringSymbol=Symbol("was-expanded-during-filtering"),WebInspector.NavigationSidebarPanel.OverflowShadowElementStyleClassName="overflow-shadow",WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName="navigation-sidebar-panel-content-tree-outline",WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderElementStyleClassName="empty-content-placeholder",WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderMessageElementStyleClassName="message",WebInspector.PinnedTabBarItem=class extends WebInspector.TabBarItem{constructor(_,S,C){super(_,S,C),this.element.classList.add("pinned"),this.element.addEventListener("contextmenu",this._handleContextMenuEvent.bind(this))}_handleContextMenuEvent(_){_.preventDefault();let S=WebInspector.ContextMenu.createFromEvent(_);this.dispatchEventToListeners(WebInspector.PinnedTabBarItem.Event.ContextMenu,{contextMenu:S})}},WebInspector.PinnedTabBarItem.Event={ContextMenu:"pinned-tab-bar-item-context-menu"},WebInspector.ResourceContentView=class extends WebInspector.ContentView{constructor(_,S){if(super(_),this._resource=_,this.element.classList.add(S,"resource"),this._spinnerTimeout=setTimeout(()=>{let T=new WebInspector.IndeterminateProgressSpinner;this.element.appendChild(T.element),this._spinnerTimeout=void 0},100),this.element.addEventListener("click",this._mouseWasClicked.bind(this),!1),_.requestContent().then(this._contentAvailable.bind(this)).catch(this.showGenericErrorMessage.bind(this)),!this.managesOwnIssues){WebInspector.issueManager.addEventListener(WebInspector.IssueManager.Event.IssueWasAdded,this._issueWasAdded,this);for(var C=WebInspector.issueManager.issuesForSourceCode(_),f=0;fWebInspector.instanceForClass(_))),this._detailsSidebarPanels}get detailsSidebarCollapsedSetting(){return this._detailsSidebarCollapsedSetting}get detailsSidebarSelectedPanelSetting(){return this._detailsSidebarSelectedPanelSetting}get detailsSidebarWidthSetting(){return this._detailsSidebarWidthSetting}},WebInspector.TimelineDataGrid=class extends WebInspector.DataGrid{constructor(_,S,C,f,T){super(_,f,T),S&&(this._treeOutlineDataGridSynchronizer=new WebInspector.TreeOutlineDataGridSynchronizer(S,this,C)),this.element.classList.add("timeline"),this._sortDelegate=null,this._scopeBarColumns=[];for(var[E,I]of this.columns){var R=I.scopeBar;R&&(this._scopeBarColumns.push(E),R.columnIdentifier=E,R.addEventListener(WebInspector.ScopeBar.Event.SelectionChanged,this._scopeBarSelectedItemsDidChange,this))}return 1X.value===q))return!1}}return!0}_refreshDirtyDataGridNodes(){if(this._scheduledDataGridNodeRefreshIdentifier&&(cancelAnimationFrame(this._scheduledDataGridNodeRefreshIdentifier),this._scheduledDataGridNodeRefreshIdentifier=void 0),!!this._dirtyDataGridNodes){let _=this.selectedNode,S=this._sortComparator.bind(this);this._treeOutlineDataGridSynchronizer&&(this._treeOutlineDataGridSynchronizer.enabled=!1);for(let C of this._dirtyDataGridNodes)if(C.refresh(),this.sortColumnIdentifier){C===_&&(this._ignoreSelectionEvent=!0),C.parent===this&&this.removeChild(C);let Y=insertionIndexForObjectInListSortedByFunction(C,this.children,S);if(this.insertChild(C,Y),C===_&&(_.revealAndSelect(),this._ignoreSelectionEvent=!1),this._treeOutlineDataGridSynchronizer){let Q=this._treeOutlineDataGridSynchronizer.treeOutline,J=this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(C);Q.reattachIfIndexChanged(J,Y),C.element.classList.toggle("hidden",J.hidden)}}this._treeOutlineDataGridSynchronizer&&(this._treeOutlineDataGridSynchronizer.enabled=!0),this._dirtyDataGridNodes=null}}_sort(){if(this.children.length){let _=this.sortColumnIdentifier;if(_){let S=this.selectedNode;this._ignoreSelectionEvent=!0;let C;this._treeOutlineDataGridSynchronizer&&(this._treeOutlineDataGridSynchronizer.enabled=!1,C=this._treeOutlineDataGridSynchronizer.treeOutline,C.selectedTreeElement&&C.selectedTreeElement.deselect(!0));let f=[this],T=this.children[0];for(;T;)T.children.length&&f.push(T),T=T.traverseNextNode(!1,null,!0);for(let E of f){let I=E.children.slice();E.removeChildren();let R;this._treeOutlineDataGridSynchronizer&&(R=E===this?C:this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(E),R.removeChildren()),I.sort(this._sortComparator.bind(this));for(let N of I){if(this._treeOutlineDataGridSynchronizer){let L=this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(N);R&&R.appendChild(L),N.element.classList.toggle("hidden",L.hidden)}E.appendChild(N)}}this._treeOutlineDataGridSynchronizer&&(this._treeOutlineDataGridSynchronizer.enabled=!0),S&&S.revealAndSelect(),this._ignoreSelectionEvent=!1}}}_sortComparator(_,S){var C=this.sortColumnIdentifier;if(!C)return 0;var f=this.sortOrder===WebInspector.DataGrid.SortOrder.Ascending?1:-1;if(this._sortDelegate&&"function"==typeof this._sortDelegate.dataGridSortComparator){let I=this._sortDelegate.dataGridSortComparator(C,f,_,S);if("number"==typeof I)return I}var T=_.data[C],E=S.data[C];return"number"==typeof T&&"number"==typeof E?isNaN(T)&&isNaN(E)?0:isNaN(T)?-f:isNaN(E)?f:(T-E)*f:"string"==typeof T&&"string"==typeof E?T.extendedLocaleCompare(E)*f:((T instanceof WebInspector.CallFrame||E instanceof WebInspector.CallFrame)&&(T=T&&T.functionName?T.functionName:T&&T.sourceCodeLocation?T.sourceCodeLocation.sourceCode:"",E=E&&E.functionName?E.functionName:E&&E.sourceCodeLocation?E.sourceCodeLocation.sourceCode:""),(T instanceof WebInspector.SourceCode||E instanceof WebInspector.SourceCode)&&(T=T?T.displayName||"":"",E=E?E.displayName||"":""),(T instanceof WebInspector.SourceCodeLocation||E instanceof WebInspector.SourceCodeLocation)&&(T=T?T.displayLocationString()||"":"",E=E?E.displayLocationString()||"":""),(TE?1:0)*f)}_scopeBarSelectedItemsDidChange(){this.filterDidChange()}_dataGridSelectedNodeChanged(){if(!this.selectedNode)return void this._hidePopover();var S=this.selectedNode.record;return S&&S.callFrames&&S.callFrames.length?void this._showPopoverForSelectedNodeSoon():void this._hidePopover()}_showPopoverForSelectedNodeSoon(){this._showPopoverTimeout||(this._showPopoverTimeout=setTimeout(()=>{this._popover||(this._popover=new WebInspector.Popover,this._popover.windowResizeHandler=()=>{this._updatePopoverForSelectedNode(!1)}),this._updatePopoverForSelectedNode(!0),this._showPopoverTimeout=void 0},WebInspector.TimelineDataGrid.DelayedPopoverShowTimeout))}_hidePopover(){this._showPopoverTimeout&&(clearTimeout(this._showPopoverTimeout),this._showPopoverTimeout=void 0),this._popover&&this._popover.dismiss(),this._hidePopoverContentClearTimeout&&clearTimeout(this._hidePopoverContentClearTimeout),this._hidePopoverContentClearTimeout=setTimeout(()=>{this._popoverCallStackTreeOutline&&this._popoverCallStackTreeOutline.removeChildren()},WebInspector.TimelineDataGrid.DelayedPopoverHideContentClearTimeout)}_updatePopoverForSelectedNode(_){if(this._popover&&this.selectedNode){let S=this.callFramePopoverAnchorElement();if(S){let C=WebInspector.Rect.rectFromClientRect(S.getBoundingClientRect());if(C.size.width||C.size.height){this._hidePopoverContentClearTimeout&&(clearTimeout(this._hidePopoverContentClearTimeout),this._hidePopoverContentClearTimeout=void 0);let f=C.pad(2),T=[WebInspector.RectEdge.MAX_Y,WebInspector.RectEdge.MIN_Y,WebInspector.RectEdge.MAX_X];_?this._popover.presentNewContentWithFrame(this._createPopoverContent(),f,T):this._popover.present(f,T)}}}}_createPopoverContent(){this._popoverCallStackTreeOutline?this._popoverCallStackTreeOutline.removeChildren():(this._popoverCallStackTreeOutline=new WebInspector.TreeOutline,this._popoverCallStackTreeOutline.disclosureButtons=!1,this._popoverCallStackTreeOutline.element.classList.add("timeline-data-grid"),this._popoverCallStackTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange,this._popoverCallStackTreeSelectionDidChange,this));for(var _=this.selectedNode.record.callFrames,S=0,C;S<_.length;++S)C=new WebInspector.CallFrameTreeElement(_[S]),this._popoverCallStackTreeOutline.appendChild(C);var f=document.createElement("div");return f.className="timeline-data-grid-popover",f.appendChild(this._popoverCallStackTreeOutline.element),f}_popoverCallStackTreeSelectionDidChange(_){let S=_.data.selectedElement;if(S){this._popover.dismiss();var C=S.callFrame;C.sourceCodeLocation&&WebInspector.showSourceCodeLocation(C.sourceCodeLocation,{ignoreNetworkTab:!0,ignoreSearchTab:!0})}}},WebInspector.TimelineDataGrid.HasNonDefaultFilterStyleClassName="has-non-default-filter",WebInspector.TimelineDataGrid.DelayedPopoverShowTimeout=250,WebInspector.TimelineDataGrid.DelayedPopoverHideContentClearTimeout=500,WebInspector.TimelineDataGridNode=class extends WebInspector.DataGridNode{constructor(_,S,C){super({},C),this.copyable=!1,this._includesGraph=_||!1,this._graphDataSource=S||null,S&&(this._graphContainerElement=document.createElement("div"),this._timelineRecordBars=[])}get record(){return this.records&&this.records.length?this.records[0]:null}get records(){return[]}get graphDataSource(){return this._graphDataSource}get data(){if(!this._graphDataSource)return{};var _=this.records||[];return{graph:_.length?_[0].startTime:0}}collapse(){super.collapse();this._graphDataSource&&this.revealed&&this.refreshGraph()}expand(){if(super.expand(),this._graphDataSource&&this.revealed){this.refreshGraph();for(var _=this.children[0];_;)_ instanceof WebInspector.TimelineDataGridNode&&_.refreshGraph(),_=_.traverseNextNode(!0,this)}}createCellContent(_,S){if("graph"===_&&this._graphDataSource)return this.needsGraphRefresh(),this._graphContainerElement;var C=this.data[_];if(!C)return emDash;const f={useGoToArrowButton:!0,ignoreNetworkTab:!0,ignoreSearchTab:!0};if(C instanceof WebInspector.SourceCodeLocation){C.sourceCode instanceof WebInspector.Resource?(S.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName),S.classList.add(C.sourceCode.type)):C.sourceCode instanceof WebInspector.Script?C.sourceCode.url?(S.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName),S.classList.add(WebInspector.Resource.Type.Script)):S.classList.add(WebInspector.ScriptTreeElement.AnonymousScriptIconStyleClassName):console.error("Unknown SourceCode subclass."),C.populateLiveDisplayLocationTooltip(S);var T=document.createDocumentFragment();T.appendChild(WebInspector.createSourceCodeLocationLink(C,f));var E=document.createElement("span");return C.populateLiveDisplayLocationString(E,"textContent"),T.appendChild(E),T}if(C instanceof WebInspector.CallFrame){var I=C,R=!1,N=I.functionName;N||(N=WebInspector.UIString("(anonymous function)"),R=!0),S.classList.add(WebInspector.CallFrameView.FunctionIconStyleClassName);var T=document.createDocumentFragment();if(I.sourceCodeLocation&&I.sourceCodeLocation.sourceCode){if(I.sourceCodeLocation.populateLiveDisplayLocationTooltip(S),T.appendChild(WebInspector.createSourceCodeLocationLink(I.sourceCodeLocation,f)),R){I.sourceCodeLocation.sourceCode instanceof WebInspector.Resource?(S.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName),S.classList.add(I.sourceCodeLocation.sourceCode.type)):I.sourceCodeLocation.sourceCode instanceof WebInspector.Script?I.sourceCodeLocation.sourceCode.url?(S.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName),S.classList.add(WebInspector.Resource.Type.Script)):S.classList.add(WebInspector.ScriptTreeElement.AnonymousScriptIconStyleClassName):console.error("Unknown SourceCode subclass.");var E=document.createElement("span");I.sourceCodeLocation.populateLiveDisplayLocationString(E,"textContent"),T.appendChild(E)}else{S.classList.add(WebInspector.CallFrameView.FunctionIconStyleClassName),T.append(N);var L=document.createElement("span");L.classList.add("subtitle"),I.sourceCodeLocation.populateLiveDisplayLocationString(L,"textContent"),T.appendChild(L)}return T}var D=document.createElement("div");return D.classList.add("icon"),T.append(D,N),T}return super.createCellContent(_,S)}refresh(){this._graphDataSource&&this._includesGraph&&this.needsGraphRefresh(),super.refresh()}refreshGraph(){function _(N,L){var D=this._timelineRecordBars[f];D?(D.renderMode=L,D.records=N):D=this._timelineRecordBars[f]=new WebInspector.TimelineRecordBar(N,L),D.refresh(this._graphDataSource),D.element.parentNode||(this._graphContainerElement.appendChild(D.element),this.didAddRecordBar(D)),++f}function S(N,L){for(var D of N){var M=L.get(D.type);M||(M=[],L.set(D.type,M)),M.push(D)}}if(this._graphDataSource&&(this._scheduledGraphRefreshIdentifier&&(cancelAnimationFrame(this._scheduledGraphRefreshIdentifier),this._scheduledGraphRefreshIdentifier=void 0),!!this.revealed)){let C=this._graphDataSource.secondsPerPixel;if(!isNaN(C)){var f=0,T=_.bind(this);if(this.expanded)WebInspector.TimelineRecordBar.createCombinedBars(this.records,C,this._graphDataSource,T);else{var E=new Map;S(this.records,E);for(var I=this.children[0];I;)I instanceof WebInspector.TimelineDataGridNode&&S(I.records,E),I=I.traverseNextNode(!1,this);for(var R of E.values())WebInspector.TimelineRecordBar.createCombinedBars(R,C,this._graphDataSource,T)}for(;fthis.graphDataSource.currentTime||_.startTime>this.graphDataSource.endTime?!1:!0)}filterableDataForColumn(_){let S=this.data[_];return S instanceof WebInspector.SourceCodeLocation?S.displayLocationString():S instanceof WebInspector.CallFrame?[S.functionName,S.sourceCodeLocation.displayLocationString()]:super.filterableDataForColumn(_)}didAddRecordBar(){}didRemoveRecordBar(){}didResizeColumn(_){"graph"!==_||this.needsGraphRefresh()}},WebInspector.ContentBrowserTabContentView=class extends WebInspector.TabContentView{constructor(_,S,C,f,T,E){"string"==typeof S&&(S=[S]),S.push("content-browser");var I=new WebInspector.ContentBrowser(null,null,E);if(super(_,S,C,f,T),this._contentBrowser=I,this._contentBrowser.delegate=this,this._lastSelectedDetailsSidebarPanelSetting=new WebInspector.Setting(_+"-last-selected-details-sidebar-panel",null),this._contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentRepresentedObjectsDidChange,this.showDetailsSidebarPanels,this),this._contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange,this._contentBrowserCurrentContentViewDidChange,this),this._contentBrowser.updateHierarchicalPathForCurrentContentView(),f){let R=WebInspector.UIString("Show the navigation sidebar (%s)").format(WebInspector.navigationSidebarKeyboardShortcut.displayName),N=WebInspector.UIString("Hide the navigation sidebar (%s)").format(WebInspector.navigationSidebarKeyboardShortcut.displayName),L=WebInspector.resolvedLayoutDirection()==WebInspector.LayoutDirection.RTL?"Images/ToggleRightSidebar.svg":"Images/ToggleLeftSidebar.svg";this._showNavigationSidebarItem=new WebInspector.ActivateButtonNavigationItem("toggle-navigation-sidebar",R,N,L,16,16),this._showNavigationSidebarItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,WebInspector.toggleNavigationSidebar,WebInspector),this._showNavigationSidebarItem.activated=!WebInspector.navigationSidebar.collapsed,this._contentBrowser.navigationBar.insertNavigationItem(this._showNavigationSidebarItem,0),this._contentBrowser.navigationBar.insertNavigationItem(new WebInspector.DividerNavigationItem,1),WebInspector.navigationSidebar.addEventListener(WebInspector.Sidebar.Event.CollapsedStateDidChange,this._navigationSidebarCollapsedStateDidChange,this)}if(T&&T.length){let R=WebInspector.UIString("Show the details sidebar (%s)").format(WebInspector.detailsSidebarKeyboardShortcut.displayName),N=WebInspector.UIString("Hide the details sidebar (%s)").format(WebInspector.detailsSidebarKeyboardShortcut.displayName),L=WebInspector.resolvedLayoutDirection()==WebInspector.LayoutDirection.RTL?"Images/ToggleLeftSidebar.svg":"Images/ToggleRightSidebar.svg";this._showDetailsSidebarItem=new WebInspector.ActivateButtonNavigationItem("toggle-details-sidebar",R,N,L,16,16),this._showDetailsSidebarItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,WebInspector.toggleDetailsSidebar,WebInspector),this._showDetailsSidebarItem.activated=!WebInspector.detailsSidebar.collapsed,this._showDetailsSidebarItem.enabled=!1,this._contentBrowser.navigationBar.addNavigationItem(new WebInspector.DividerNavigationItem),this._contentBrowser.navigationBar.addNavigationItem(this._showDetailsSidebarItem),WebInspector.detailsSidebar.addEventListener(WebInspector.Sidebar.Event.CollapsedStateDidChange,this._detailsSidebarCollapsedStateDidChange,this),WebInspector.detailsSidebar.addEventListener(WebInspector.Sidebar.Event.SidebarPanelSelected,this._detailsSidebarPanelSelected,this)}this.addSubview(this._contentBrowser)}get contentBrowser(){return this._contentBrowser}shown(){this.navigationSidebarPanel&&!this.navigationSidebarPanel.contentBrowser&&(this.navigationSidebarPanel.contentBrowser=this._contentBrowser),super.shown(),this._contentBrowser.shown(),this.navigationSidebarPanel&&!this._contentBrowser.currentContentView&&this.navigationSidebarPanel.showDefaultContentView()}hidden(){super.hidden(),this._contentBrowser.hidden()}closed(){super.closed(),WebInspector.navigationSidebar.removeEventListener(null,null,this),WebInspector.detailsSidebar.removeEventListener(null,null,this),this.navigationSidebarPanel&&"function"==typeof this.navigationSidebarPanel.closed&&this.navigationSidebarPanel.closed(),this._contentBrowser.contentViewContainer.closeAllContentViews()}get managesDetailsSidebarPanels(){return!0}showDetailsSidebarPanels(){if(this.visible){var _=this._contentBrowser.currentRepresentedObjects,S=WebInspector.detailsSidebar.sidebarPanels,C=!S.length;this._ignoreDetailsSidebarPanelSelectedEvent=!0,this._ignoreDetailsSidebarPanelCollapsedEvent=!0;let f=0;for(var T=0,E;T=WebInspector.FolderizedTreeElement.LargeChildCountThreshold?S||C||(f=!0,!1):E>=WebInspector.FolderizedTreeElement.MediumChildCountThreshold?++C>=WebInspector.FolderizedTreeElement.NumberOfMediumCategoriesThreshold:(++S,!1)))}if(this._groupedIntoFolders)return!0;var S=0,C=0,f=!1;for(var T of this._folderizeSettingsMap.values())if(_(T.representedObject.items.size))return!0;return!1}},WebInspector.FolderizedTreeElement.MediumChildCountThreshold=5,WebInspector.FolderizedTreeElement.LargeChildCountThreshold=15,WebInspector.FolderizedTreeElement.NumberOfMediumCategoriesThreshold=2,WebInspector.FolderizedTreeElement.NewChildQueueUpdateInterval=500,WebInspector.NetworkTabContentView=class extends WebInspector.ContentBrowserTabContentView{constructor(_){let{image:S,title:C}=WebInspector.NetworkTabContentView.tabInfo(),f=new WebInspector.GeneralTabBarItem(S,C),T=[WebInspector.ResourceDetailsSidebarPanel,WebInspector.ProbeDetailsSidebarPanel];super(_||"network","network",f,WebInspector.NetworkSidebarPanel,T)}static tabInfo(){return{image:"Images/Network.svg",title:WebInspector.UIString("Network")}}static isTabAllowed(){return!!window.NetworkAgent&&!!window.PageAgent}get type(){return WebInspector.NetworkTabContentView.Type}canShowRepresentedObject(_){return!!(_ instanceof WebInspector.Resource)&&!!this.navigationSidebarPanel.contentTreeOutline.getCachedTreeElement(_)}get supportsSplitContentBrowser(){return!1}},WebInspector.NetworkTabContentView.Type="network",WebInspector.NewTabContentView=class extends WebInspector.TabContentView{constructor(_){let{image:S,title:C}=WebInspector.NewTabContentView.tabInfo(),f=new WebInspector.GeneralTabBarItem(S,C);f.isDefaultTab=!0,super(_||"new-tab","new-tab",f),WebInspector.notifications.addEventListener(WebInspector.Notification.TabTypesChanged,this._updateShownTabs.bind(this)),this._tabElementsByTabClass=new Map,this._updateShownTabs()}static tabInfo(){return{image:"Images/NewTab.svg",title:WebInspector.UIString("New Tab")}}static isEphemeral(){return!0}static shouldSaveTab(){return!1}get type(){return WebInspector.NewTabContentView.Type}shown(){WebInspector.tabBrowser.tabBar.addEventListener(WebInspector.TabBar.Event.TabBarItemAdded,this._updateTabItems,this),WebInspector.tabBrowser.tabBar.addEventListener(WebInspector.TabBar.Event.TabBarItemRemoved,this._updateTabItems,this),this._updateTabItems()}hidden(){WebInspector.tabBrowser.tabBar.removeEventListener(null,null,this)}get supportsSplitContentBrowser(){return!1}layout(){this._tabElementsByTabClass.clear(),this.element.removeChildren();for(let _ of this._shownTabClasses){let S=document.createElement("div");S.classList.add("tab-item"),S.addEventListener("click",this._createNewTabWithType.bind(this,_.Type)),S[WebInspector.NewTabContentView.TypeSymbol]=_.Type;let C=S.appendChild(document.createElement("div"));C.classList.add("box");let f=_.tabInfo(),T=C.appendChild(document.createElement("img"));T.src=f.image;let E=S.appendChild(document.createElement("label"));E.textContent=f.title,this.element.appendChild(S),this._tabElementsByTabClass.set(_,S)}this._updateTabItems()}_createNewTabWithType(_){if(WebInspector.isNewTabWithTypeAllowed(_)){const C=1C.isTabAllowed()&&!C.isEphemeral());S.sort((C,f)=>C.tabInfo().title.extendedLocaleCompare(f.tabInfo().title));Array.shallowEqual(this._shownTabClasses,S)||(this._shownTabClasses=S,this.needsLayout())}_allowableTabTypes(){let _=this._shownTabClasses.map(S=>S.Type);return _.filter(S=>WebInspector.isNewTabWithTypeAllowed(S))}_updateTabItems(){for(let[_,S]of this._tabElementsByTabClass.entries()){let C=WebInspector.isNewTabWithTypeAllowed(_.Type);S.classList.toggle(WebInspector.NewTabContentView.DisabledStyleClassName,!C)}}},WebInspector.NewTabContentView.Type="new-tab",WebInspector.NewTabContentView.TypeSymbol=Symbol("type"),WebInspector.NewTabContentView.TabItemStyleClassName="tab-item",WebInspector.NewTabContentView.DisabledStyleClassName="disabled",WebInspector.ObjectTreeBaseTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_,S,C){super(null,null,null,_,!1),this._property=C,this._propertyPath=S,this.toggleOnClick=!0,this.selectable=!1,this.tooltipHandledSeparately=!0}get property(){return this._property}get propertyPath(){return this._propertyPath}resolvedValue(){return this._getterValue?this._getterValue:this._property.hasValue()?this._property.value:null}resolvedValuePropertyPath(){return this._getterValue?this._propertyPath.appendPropertyDescriptor(this._getterValue,this._property,WebInspector.PropertyPath.Type.Value):this._property.hasValue()?this._propertyPath.appendPropertyDescriptor(this._property.value,this._property,WebInspector.PropertyPath.Type.Value):null}thisPropertyPath(){return this._propertyPath.appendPropertyDescriptor(null,this._property,this.propertyPathType())}hadError(){return this._property.wasThrown||this._getterHadError}propertyPathType(){return this._getterValue||this._property.hasValue()?WebInspector.PropertyPath.Type.Value:this._property.hasGetter()?WebInspector.PropertyPath.Type.Getter:this._property.hasSetter()?WebInspector.PropertyPath.Type.Setter:WebInspector.PropertyPath.Type.Value}propertyPathString(_){return _.isFullPathImpossible()?WebInspector.UIString("Unable to determine path to property from root"):_.displayPath(this.propertyPathType())}createGetterElement(_){var S=document.createElement("img");return(S.className="getter",!_)?(S.classList.add("disabled"),S.title=WebInspector.UIString("Getter"),S):(S.title=WebInspector.UIString("Invoke getter"),S.addEventListener("click",C=>{C.stopPropagation();var f=this._propertyPath.lastNonPrototypeObject,T=this._property.get;f.invokeGetter(T,(E,I,R)=>{this._getterHadError=!!(E||R),this._getterValue=I,this.invokedGetter&&"function"==typeof this.invokedGetter&&this.invokedGetter()})}),S)}createSetterElement(_){var S=document.createElement("img");return S.className="setter",S.title=WebInspector.UIString("Setter"),_||S.classList.add("disabled"),S}populateContextMenu(_,S){if(!S.__addedObjectPreviewContextMenuItems&&!S.__addedObjectTreeContextMenuItems){S.__addedObjectTreeContextMenuItems=!0,"function"==typeof this.treeOutline.objectTreeElementAddContextMenuItems&&(this.treeOutline.objectTreeElementAddContextMenuItems(this,_),!_.isEmpty()&&_.appendSeparator());let C=this.resolvedValue();if(C){this._property&&this._property.symbol&&_.appendItem(WebInspector.UIString("Log Symbol"),this._logSymbolProperty.bind(this)),_.appendItem(WebInspector.UIString("Log Value"),this._logValue.bind(this));let f=this.resolvedValuePropertyPath();f&&!f.isFullPathImpossible()&&_.appendItem(WebInspector.UIString("Copy Path to Property"),()=>{InspectorFrontendHost.copyText(f.displayPath(WebInspector.PropertyPath.Type.Value))}),_.appendSeparator(),this._appendMenusItemsForObject(_,C),super.populateContextMenu(_,S)}}}_logSymbolProperty(){var _=this._property.symbol;if(_){var S=WebInspector.UIString("Selected Symbol");WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(S,_,!0)}}_logValue(_){var S=_||this.resolvedValue();if(S){var C=this.resolvedValuePropertyPath(),f=C.isFullPathImpossible(),T=f?WebInspector.UIString("Selected Value"):C.displayPath(this.propertyPathType());f||WebInspector.quickConsole.prompt.pushHistoryItem(T),WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(T,S,f)}}_appendMenusItemsForObject(_,S){return"function"===S.type?void(isFunctionStringNativeCode(S.description)||_.appendItem(WebInspector.UIString("Jump to Definition"),function(){S.target.DebuggerAgent.getFunctionDetails(S.objectId,function(C,f){if(!C){let T=f.location,E=WebInspector.debuggerManager.scriptForIdentifier(T.scriptId,S.target);if(E){let I=E.createSourceCodeLocation(T.lineNumber,T.columnNumber||0);WebInspector.showSourceCodeLocation(I,{ignoreNetworkTab:!0,ignoreSearchTab:!0})}}})})):"node"===S.subtype?(_.appendItem(WebInspector.UIString("Copy as HTML"),function(){S.pushNodeToFrontend(function(C){WebInspector.domTreeManager.nodeForId(C).copyNode()})}),_.appendItem(WebInspector.UIString("Scroll Into View"),function(){S.callFunction(function(){this.scrollIntoViewIfNeeded(!0)},void 0,!1,function(){})}),_.appendSeparator(),void _.appendItem(WebInspector.UIString("Reveal in DOM Tree"),function(){S.pushNodeToFrontend(function(C){WebInspector.domTreeManager.inspectElement(C)})})):void 0}},WebInspector.SourceCodeTreeElement=class extends WebInspector.FolderizedTreeElement{constructor(_,S,C,f,T,E){super(S,C,f,T||_,E),this._updateSourceCode(_)}updateSourceMapResources(){this.treeOutline&&this.treeOutline.includeSourceMapResourceChildren&&(this.hasChildren=!!this._sourceCode.sourceMaps.length,this.shouldRefreshChildren=this.hasChildren,!this.hasChildren&&this.removeChildren())}onattach(){super.onattach(),this.updateSourceMapResources()}onpopulate(){function _(D,M){for(var P=[],O=M;O!==D;O=O.parent)P.push(O.mainTitle);P.push(D.mainTitle);var F=P.reverse().join("/"),V=new WebInspector.FolderTreeElement(F),U=D.parent.children.indexOf(D);D.parent.insertChild(V,U),D.parent.removeChild(D);var G=M.children;M.removeChildren();for(var H=0;H=0.5*Math.abs(_.deltaY)){let I=new _.constructor(_.type,_);return I.__cloned=!0,void this._scrollContainerElement.dispatchEvent(I)}let S=_.pageX-this._graphsContainerView.element.totalOffsetLeft,C=this._currentSettings.scrollStartTime+S*this.secondsPerPixel,f=_.webkitDirectionInvertedFromDevice?1:-1,T=_.deltaY*(this.secondsPerPixel/WebInspector.TimelineOverview.ScrollDeltaDenominator)*f;this._pixelAlignDuration&&(0>T&&0<=this._mouseWheelDelta||0<=T&&0>this._mouseWheelDelta)&&(this._mouseWheelDelta=0);let E=this.secondsPerPixel;this._mouseWheelDelta+=T,this.secondsPerPixel+=this._mouseWheelDelta,this._mouseWheelDelta=this.secondsPerPixel===this._currentSettings.minimumDurationPerPixel&&0>T||this.secondsPerPixel===this._currentSettings.maximumDurationPerPixel&&0<=T?0:E+this._mouseWheelDelta-this.secondsPerPixel,this.scrollStartTime=C-S*this.secondsPerPixel,_.preventDefault(),_.stopPropagation()}}_handleGestureStart(_){if(!this._handlingGesture){let S=_.pageX-this._graphsContainerView.element.totalOffsetLeft,C=this._currentSettings.scrollStartTime+S*this.secondsPerPixel;this._handlingGesture=!0,this._gestureStartStartTime=C,this._gestureStartDurationPerPixel=this.secondsPerPixel,_.preventDefault(),_.stopPropagation()}}_handleGestureChange(_){let S=Math.max(1/5,_.scale),C=_.pageX-this._graphsContainerView.element.totalOffsetLeft,f=this._gestureStartDurationPerPixel/S;this.secondsPerPixel=f,this.scrollStartTime=this._gestureStartStartTime-C*this.secondsPerPixel,_.preventDefault(),_.stopPropagation()}_handleGestureEnd(){this._handlingGesture=!1,this._gestureStartStartTime=NaN,this._gestureStartDurationPerPixel=NaN}_instrumentAdded(_){let S=_ instanceof WebInspector.Instrument?_:_.data.instrument,C=this._recording.timelineForInstrument(S),f=new WebInspector.TimelineTreeElement(C),T=insertionIndexForObjectInListSortedByFunction(f,this._timelinesTreeOutline.children,this._compareTimelineTreeElements.bind(this));this._timelinesTreeOutline.insertChild(f,T),this._treeElementsByTypeMap.set(C.type,f);let E=WebInspector.TimelineOverviewGraph.createForTimeline(C,this);E.addEventListener(WebInspector.TimelineOverviewGraph.Event.RecordSelected,this._recordSelected,this),this._overviewGraphsByTypeMap.set(C.type,E),this._graphsContainerView.insertSubviewBefore(E,this._graphsContainerView.subviews[T]),f.element.style.height=E.height+"px",this._canShowTimelineType(C.type)||(E.hidden(),f.hidden=!0)}_instrumentRemoved(_){let S=_.data.instrument,C=this._recording.timelineForInstrument(S),f=this._overviewGraphsByTypeMap.get(C.type),T=this._treeElementsByTypeMap.get(C.type);this._timelinesTreeOutline.removeChild(T,!1,!0),f.removeEventListener(WebInspector.TimelineOverviewGraph.Event.RecordSelected,this._recordSelected,this),this._graphsContainerView.removeSubview(f),this._overviewGraphsByTypeMap.delete(C.type),this._treeElementsByTypeMap.delete(C.type)}_markerAdded(_){this._timelineRuler.addMarker(_.data.marker)}_timelineRulerMouseDown(){this._timelineRulerSelectionChanged=!1}_timelineRulerMouseClicked(_){if(!this._timelineRulerSelectionChanged)for(let S of this._overviewGraphsByTypeMap.values()){let C=S.element.getBoundingClientRect();if(_.pageX>=C.left&&_.pageX<=C.right&&_.pageY>=C.top&&_.pageY<=C.bottom){let Z=new _.constructor(_.type,_);return void S.element.dispatchEvent(Z)}}}_timeRangeSelectionChanged(){this._timelineRulerSelectionChanged=!0;let S=this._viewMode===WebInspector.TimelineOverview.ViewMode.Timelines?this._startTime:0;this._currentSettings.selectionStartValueSetting.value=this.selectionStartTime-S,this._currentSettings.selectionDurationSetting.value=this.selectionDuration,this.dispatchEventToListeners(WebInspector.TimelineOverview.Event.TimeRangeSelectionChanged)}_recordSelected(_){for(let[S,C]of this._overviewGraphsByTypeMap)if(C===_.target){let $=this._recording.timelines.get(S);return void this.dispatchEventToListeners(WebInspector.TimelineOverview.Event.RecordSelected,{timeline:$,record:_.data.record})}}_resetSelection(){function _(S){S.durationPerPixelSetting.reset(),S.selectionStartValueSetting.reset(),S.selectionDurationSetting.reset()}_(this._timelinesViewModeSettings),this._renderingFramesViewModeSettings&&_(this._renderingFramesViewModeSettings),this.secondsPerPixel=this._currentSettings.durationPerPixelSetting.value,this.selectionStartTime=this._currentSettings.selectionStartValueSetting.value,this.selectionDuration=this._currentSettings.selectionDurationSetting.value}_recordingReset(){this._timelineRuler.clearMarkers(),this._timelineRuler.addMarker(this._currentTimeMarker)}_canShowTimelineType(_){let S=WebInspector.TimelineOverview.ViewMode.Timelines;return _===WebInspector.TimelineRecord.Type.RenderingFrame&&(S=WebInspector.TimelineOverview.ViewMode.RenderingFrames),S===this._viewMode}_viewModeDidChange(){let _=0,S=this._viewMode===WebInspector.TimelineOverview.ViewMode.RenderingFrames;S?(this._timelineRuler.minimumSelectionDuration=1,this._timelineRuler.snapInterval=1,this._timelineRuler.formatLabelCallback=C=>C.maxDecimals(0).toLocaleString()):(this._timelineRuler.minimumSelectionDuration=0.01,this._timelineRuler.snapInterval=NaN,this._timelineRuler.formatLabelCallback=null,_=this._startTime),this.pixelAlignDuration=S,this.selectionStartTime=this._currentSettings.selectionStartValueSetting.value+_,this.selectionDuration=this._currentSettings.selectionDurationSetting.value;for(let[C,f]of this._overviewGraphsByTypeMap){let T=this._treeElementsByTypeMap.get(C);T.hidden=!this._canShowTimelineType(C),T.hidden?f.hidden():f.shown()}this.element.classList.toggle("frames",S),this.updateLayout(WebInspector.View.LayoutReason.Resize)}_createViewModeSettings(_,S,C,f,T,E){f=Math.min(C,Math.max(S,f));let I=new WebInspector.Setting(_+"-duration-per-pixel",f),R=new WebInspector.Setting(_+"-selection-start-value",T),N=new WebInspector.Setting(_+"-selection-duration",E);return{scrollStartTime:0,minimumDurationPerPixel:S,maximumDurationPerPixel:C,durationPerPixelSetting:I,selectionStartValueSetting:R,selectionDurationSetting:N}}get _currentSettings(){return this._viewMode===WebInspector.TimelineOverview.ViewMode.Timelines?this._timelinesViewModeSettings:this._renderingFramesViewModeSettings}_timelinesTreeSelectionDidChange(_){function S(E,I){let R=this._overviewGraphsByTypeMap.get(E.type);R.selected=I}let C=_.data.selectedElement,f=_.data.deselectedElement,T=null;C&&(T=C.representedObject,S.call(this,T,!0)),f&&S.call(this,f.representedObject,!1),this._selectedTimeline=T,this.dispatchEventToListeners(WebInspector.TimelineOverview.Event.TimelineSelected)}_toggleEditingInstruments(){this._editingInstruments?this._stopEditingInstruments():this._startEditingInstruments()}_editingInstrumentsDidChange(){this.element.classList.toggle(WebInspector.TimelineOverview.EditInstrumentsStyleClassName,this._editingInstruments),this._timelineRuler.enabled=!this._editingInstruments,this._updateWheelAndGestureHandlers(),this._updateEditInstrumentsButton(),this.dispatchEventToListeners(WebInspector.TimelineOverview.Event.EditingInstrumentsDidChange)}_updateEditInstrumentsButton(){let _=this._editingInstruments?WebInspector.UIString("Done"):WebInspector.UIString("Edit");this._editInstrumentsButton.label=_,this._editInstrumentsButton.activated=this._editingInstruments,this._editInstrumentsButton.enabled=!WebInspector.timelineManager.isCapturing()}_updateWheelAndGestureHandlers(){this._editingInstruments?(this.element.removeEventListener("wheel",this._handleWheelEventListener),this.element.removeEventListener("gesturestart",this._handleGestureStartEventListener),this.element.removeEventListener("gesturechange",this._handleGestureChangeEventListener),this.element.removeEventListener("gestureend",this._handleGestureEndEventListener),this._handleWheelEventListener=null,this._handleGestureStartEventListener=null,this._handleGestureChangeEventListener=null,this._handleGestureEndEventListener=null):(this._handleWheelEventListener=this._handleWheelEvent.bind(this),this._handleGestureStartEventListener=this._handleGestureStart.bind(this),this._handleGestureChangeEventListener=this._handleGestureChange.bind(this),this._handleGestureEndEventListener=this._handleGestureEnd.bind(this),this.element.addEventListener("wheel",this._handleWheelEventListener),this.element.addEventListener("gesturestart",this._handleGestureStartEventListener),this.element.addEventListener("gesturechange",this._handleGestureChangeEventListener),this.element.addEventListener("gestureend",this._handleGestureEndEventListener))}_startEditingInstruments(){if(!this._editingInstruments){this._editingInstruments=!0;for(let _ of this._instrumentTypes){let S=this._treeElementsByTypeMap.get(_);if(!S){let C=this._recording.timelines.get(_);S=new WebInspector.TimelineTreeElement(C,!0);let T=insertionIndexForObjectInListSortedByFunction(S,this._timelinesTreeOutline.children,this._compareTimelineTreeElements.bind(this));this._timelinesTreeOutline.insertChild(S,T);let E=new WebInspector.View;E.element.classList.add("timeline-overview-graph"),S[WebInspector.TimelineOverview.PlaceholderOverviewGraph]=E,this._graphsContainerView.insertSubviewBefore(E,this._graphsContainerView.subviews[T])}S.editing=!0,S.addEventListener(WebInspector.TimelineTreeElement.Event.EnabledDidChange,this._timelineTreeElementEnabledDidChange,this)}this._editingInstrumentsDidChange()}}_stopEditingInstruments(){if(this._editingInstruments){this._editingInstruments=!1;let _=this._recording.instruments;for(let f of this._treeElementsByTypeMap.values()){if(f.status.checked){f.editing=!1,f.removeEventListener(WebInspector.TimelineTreeElement.Event.EnabledDidChange,this._timelineTreeElementEnabledDidChange,this);continue}let T=_.find(E=>E.timelineRecordType===f.representedObject.type);this._recording.removeInstrument(T)}let S=this._timelinesTreeOutline.children.filter(f=>f.placeholder);for(let f of S){this._timelinesTreeOutline.removeChild(f);let T=f[WebInspector.TimelineOverview.PlaceholderOverviewGraph];if(this._graphsContainerView.removeSubview(T),f.status.checked){let E=WebInspector.Instrument.createForTimelineType(f.representedObject.type);this._recording.addInstrument(E)}}let C=_.map(f=>f.timelineRecordType);WebInspector.timelineManager.enabledTimelineTypes=C,this._editingInstrumentsDidChange()}}_capturingStarted(){this._editInstrumentsButton.enabled=!1,this._stopEditingInstruments()}_capturingStopped(){this._editInstrumentsButton.enabled=!0}_compareTimelineTreeElements(_,S){let C=_.representedObject.type,f=S.representedObject.type;if(C===WebInspector.TimelineRecord.Type.RenderingFrame)return 1;if(f===WebInspector.TimelineRecord.Type.RenderingFrame)return-1;if(_.placeholder!==S.placeholder)return _.placeholder?1:-1;let T=this._instrumentTypes.indexOf(C),E=this._instrumentTypes.indexOf(f);return T-E}_timelineTreeElementEnabledDidChange(){let S=this._timelinesTreeOutline.children.some(C=>{let f=C.representedObject.type;return this._canShowTimelineType(f)&&C.status.checked});this._editInstrumentsButton.enabled=S}},WebInspector.TimelineOverview.PlaceholderOverviewGraph=Symbol("placeholder-overview-graph"),WebInspector.TimelineOverview.ScrollDeltaDenominator=500,WebInspector.TimelineOverview.EditInstrumentsStyleClassName="edit-instruments",WebInspector.TimelineOverview.MinimumDurationPerPixel=1e-4,WebInspector.TimelineOverview.MaximumDurationPerPixel=60,WebInspector.TimelineOverview.ViewMode={Timelines:"timeline-overview-view-mode-timelines",RenderingFrames:"timeline-overview-view-mode-rendering-frames"},WebInspector.TimelineOverview.Event={EditingInstrumentsDidChange:"editing-instruments-did-change",RecordSelected:"timeline-overview-record-selected",TimelineSelected:"timeline-overview-timeline-selected",TimeRangeSelectionChanged:"timeline-overview-time-range-selection-changed"},WebInspector.TimelineRecordTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_,S,C,f,T){f=f||_.sourceCodeLocation||null;let E=null;if(C&&_.type===WebInspector.TimelineRecord.Type.Script&&_.eventType===WebInspector.ScriptTimelineRecord.EventType.TimerInstalled){let L=Number.secondsToString(_.details.timeout/1e3);E=document.createElement("span"),E.classList.add("alternate-subtitle"),E.textContent=_.details.repeating?WebInspector.UIString("%s interval").format(L):WebInspector.UIString("%s delay").format(L)}let I=null;f&&(I=document.createElement("span"),S===WebInspector.SourceCodeLocation.NameStyle.None?f.populateLiveDisplayLocationString(I,"textContent",null,WebInspector.SourceCodeLocation.NameStyle.None,WebInspector.UIString("line ")):f.populateLiveDisplayLocationString(I,"textContent",null,S));let R=WebInspector.TimelineTabContentView.iconClassNameForRecord(_),N=WebInspector.TimelineTabContentView.displayNameForRecord(_);super([R],N,I,T||_,!1),this._record=_,this._sourceCodeLocation=f,this._sourceCodeLocation&&(this.tooltipHandledSeparately=!0),E&&this.titlesElement.appendChild(E)}get record(){return this._record}get filterableData(){var _=this._sourceCodeLocation?this._sourceCodeLocation.sourceCode.url:"";return{text:[this.mainTitle,_||"",this._record.details||""]}}get sourceCodeLocation(){return this._sourceCodeLocation}onattach(){if(super.onattach(),!!this.tooltipHandledSeparately){var _=this.mainTitle+"\n";this._sourceCodeLocation.populateLiveDisplayLocationTooltip(this.element,_)}}},WebInspector.TimelineRecordTreeElement.StyleRecordIconStyleClass="style-record",WebInspector.TimelineRecordTreeElement.LayoutRecordIconStyleClass="layout-record",WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass="paint-record",WebInspector.TimelineRecordTreeElement.CompositeRecordIconStyleClass="composite-record",WebInspector.TimelineRecordTreeElement.RenderingFrameRecordIconStyleClass="rendering-frame-record",WebInspector.TimelineRecordTreeElement.APIRecordIconStyleClass="api-record",WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass="evaluated-record",WebInspector.TimelineRecordTreeElement.EventRecordIconStyleClass="event-record",WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass="timer-record",WebInspector.TimelineRecordTreeElement.AnimationRecordIconStyleClass="animation-record",WebInspector.TimelineRecordTreeElement.ProbeRecordIconStyleClass="probe-record",WebInspector.TimelineRecordTreeElement.ConsoleProfileIconStyleClass="console-profile-record",WebInspector.TimelineRecordTreeElement.GarbageCollectionIconStyleClass="garbage-collection-profile-record",WebInspector.TimelineTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_,S){let C=WebInspector.TimelineTabContentView.displayNameForTimelineType(_.type),f=WebInspector.TimelineTabContentView.iconClassNameForTimelineType(_.type),T=WebInspector.TimelineTabContentView.genericClassNameForTimelineType(_.type);super([f,T],C,"",_),this._placeholder=S||!1,this.editing=this._placeholder}get placeholder(){return this._placeholder}get editing(){return this._editing}set editing(_){this._editing===_||(this._editing=_,this.selectable=!this._editing,this._updateStatusButton())}onattach(){super.onattach(),this.listItemElement.addEventListener("click",this._clickHandler.bind(this))}_showCloseButton(){let _=WebInspector.UIString("Close %s timeline view").format(this.mainTitle),S=new WebInspector.TreeElementStatusButton(useSVGSymbol("Images/CloseLarge.svg","close-button",_));S.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked,()=>{this.deselect()}),this.status=S.element}_showCheckbox(){let _=document.createElement("input");_.type="checkbox",_.checked=!this._placeholder;new WebInspector.TreeElementStatusButton(_);_.addEventListener("change",()=>{this._dispatchEnabledDidChangeEvent()}),this.status=_}_updateStatusButton(){this._editing?this._showCheckbox():this._showCloseButton()}_clickHandler(){this._editing&&(this.status.checked=!this.status.checked,this._dispatchEnabledDidChangeEvent())}_dispatchEnabledDidChangeEvent(){this.dispatchEventToListeners(WebInspector.TimelineTreeElement.Event.EnabledDidChange)}},WebInspector.TimelineTreeElement.Event={EnabledDidChange:"timeline-tree-element-enabled-did-change"},WebInspector.ConsoleTabContentView=class extends WebInspector.ContentBrowserTabContentView{constructor(_){let{image:S,title:C}=WebInspector.ConsoleTabContentView.tabInfo(),f=new WebInspector.GeneralTabBarItem(S,C);super(_||"console","console",f,null,null,!0)}static tabInfo(){return{image:"Images/Console.svg",title:WebInspector.UIString("Console")}}get type(){return WebInspector.ConsoleTabContentView.Type}shown(){super.shown(),WebInspector.consoleContentView.prompt.focus();this.contentBrowser.currentContentView===WebInspector.consoleContentView||(WebInspector.consoleContentView.parentContainer&&WebInspector.consoleContentView.parentContainer.closeContentView(WebInspector.consoleContentView),this.contentBrowser.showContentView(WebInspector.consoleContentView))}showRepresentedObject(){}canShowRepresentedObject(_){return _ instanceof WebInspector.LogObject}get supportsSplitContentBrowser(){return!1}},WebInspector.ConsoleTabContentView.Type="console",WebInspector.DebuggerTabContentView=class extends WebInspector.ContentBrowserTabContentView{constructor(_){let{image:S,title:C}=WebInspector.DebuggerTabContentView.tabInfo(),f=new WebInspector.GeneralTabBarItem(S,C),T=[WebInspector.ScopeChainDetailsSidebarPanel,WebInspector.ResourceDetailsSidebarPanel,WebInspector.ProbeDetailsSidebarPanel];super(_||"debugger","debugger",f,WebInspector.DebuggerSidebarPanel,T)}static tabInfo(){return{image:"Images/Debugger.svg",title:WebInspector.UIString("Debugger")}}get type(){return WebInspector.DebuggerTabContentView.Type}get supportsSplitContentBrowser(){return!0}canShowRepresentedObject(_){return!!(_ instanceof WebInspector.Script)||!!(_ instanceof WebInspector.Resource)&&(_.type===WebInspector.Resource.Type.Document||_.type===WebInspector.Resource.Type.Script)}showDetailsSidebarPanels(){if(super.showDetailsSidebarPanels(),!!this._showScopeChainDetailsSidebarPanel){let _=WebInspector.instanceForClass(WebInspector.ScopeChainDetailsSidebarPanel);_.parentSidebar&&(_.show(),this._showScopeChainDetailsSidebarPanel=!1)}}showScopeChainDetailsSidebarPanel(){this._showScopeChainDetailsSidebarPanel=!0}revealAndSelectBreakpoint(_){var S=this.navigationSidebarPanel.treeElementForRepresentedObject(_);S&&S.revealAndSelect()}},WebInspector.DebuggerTabContentView.Type="debugger",WebInspector.ElementsTabContentView=class extends WebInspector.ContentBrowserTabContentView{constructor(_){let{image:S,title:C}=WebInspector.ElementsTabContentView.tabInfo(),f=new WebInspector.GeneralTabBarItem(S,C),T=[WebInspector.DOMNodeDetailsSidebarPanel,WebInspector.CSSStyleDetailsSidebarPanel];window.LayerTreeAgent&&T.push(WebInspector.LayerTreeDetailsSidebarPanel),super(_||"elements","elements",f,null,T,!0),WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange,this._mainFrameDidChange,this),WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange,this._mainResourceDidChange,this)}static tabInfo(){return{image:"Images/Elements.svg",title:WebInspector.UIString("Elements")}}static isTabAllowed(){return!!window.DOMAgent}get type(){return WebInspector.ElementsTabContentView.Type}get supportsSplitContentBrowser(){return!0}canShowRepresentedObject(_){return _ instanceof WebInspector.DOMTree}showRepresentedObject(_,S){if(this.contentBrowser.currentContentView||this._showDOMTreeContentView(),S&&S.nodeToSelect){let C=this.contentBrowser.currentContentView;C.selectAndRevealDOMNode(S.nodeToSelect),S.nodeToSelect=void 0}}shown(){super.shown(),this.contentBrowser.currentContentView||this._showDOMTreeContentView()}closed(){super.closed(),WebInspector.frameResourceManager.removeEventListener(null,null,this),WebInspector.Frame.removeEventListener(null,null,this)}_showDOMTreeContentView(){this.contentBrowser.contentViewContainer.closeAllContentViews();var _=WebInspector.frameResourceManager.mainFrame;_&&this.contentBrowser.showContentViewForRepresentedObject(_.domTree)}_mainFrameDidChange(){this._showDOMTreeContentView()}_mainResourceDidChange(_){_.target.isMainFrame()&&this._showDOMTreeContentView()}},WebInspector.ElementsTabContentView.Type="elements",WebInspector.ResourceTreeElement=class extends WebInspector.SourceCodeTreeElement{constructor(_,S){super(_,["resource",WebInspector.ResourceTreeElement.ResourceIconStyleClassName,_.type],"","",S||_,!1),this._updateResource(_)}static compareResourceTreeElements(_,S){var C=_.resource.type.extendedLocaleCompare(S.resource.type);return 0===C?_.resource.type===WebInspector.Resource.Type.XHR||_.resource.type===WebInspector.Resource.Type.Fetch||_.resource.type===WebInspector.Resource.Type.WebSocket?_.resource.firstTimestamp-S.resource.firstTimestamp||0:(C=_.subtitle.extendedLocaleCompare(S.subtitle),0===C?_.mainTitle.extendedLocaleCompare(S.mainTitle):C):C}static compareFolderAndResourceTreeElements(_,S){var C=_ instanceof WebInspector.FolderTreeElement,f=S instanceof WebInspector.FolderTreeElement;return C&&!f?-1:!C&&f?1:C&&f?_.mainTitle.extendedLocaleCompare(S.mainTitle):WebInspector.ResourceTreeElement.compareResourceTreeElements(_,S)}get resource(){return this._resource}get filterableData(){let _=this._resource.urlComponents;return{text:[_.lastPathComponent,_.path,this._resource.url]}}ondblclick(){this._resource.type===WebInspector.Resource.Type.WebSocket||InspectorFrontendHost.openInNewTab(this._resource.url)}_updateResource(_){this._resource&&(this._resource.removeEventListener(WebInspector.Resource.Event.URLDidChange,this._urlDidChange,this),this._resource.removeEventListener(WebInspector.Resource.Event.TypeDidChange,this._typeDidChange,this),this._resource.removeEventListener(WebInspector.Resource.Event.LoadingDidFinish,this._updateStatus,this),this._resource.removeEventListener(WebInspector.Resource.Event.LoadingDidFail,this._updateStatus,this)),this._updateSourceCode(_),this._resource=_,_.addEventListener(WebInspector.Resource.Event.URLDidChange,this._urlDidChange,this),_.addEventListener(WebInspector.Resource.Event.TypeDidChange,this._typeDidChange,this),_.addEventListener(WebInspector.Resource.Event.LoadingDidFinish,this._updateStatus,this),_.addEventListener(WebInspector.Resource.Event.LoadingDidFail,this._updateStatus,this),this._updateTitles(),this._updateStatus(),this._updateToolTip()}_updateTitles(){var _=this._resource.parentFrame,S=this._resource.target,C=this._resource.isMainResource(),f=S.mainResource?S.mainResource.urlComponents.host:null;C&&_?f=_.parentFrame?_.parentFrame.mainResource.urlComponents.host:null:_&&(f=_.mainResource.urlComponents.host);var T=this._resource.urlComponents,E=this.mainTitle;this.mainTitle=WebInspector.displayNameForURL(this._resource.url,T);var I=f!==T.host||_&&_.isMainFrame()&&C?WebInspector.displayNameForHost(T.host):null;this.subtitle=this.mainTitle===I?null:I,E!==this.mainTitle&&this.callFirstAncestorFunction("descendantResourceTreeElementMainTitleDidChange",[this,E])}populateContextMenu(_,S){WebInspector.appendContextMenuItemsForSourceCode(_,this._resource),super.populateContextMenu(_,S)}_updateStatus(){if(this._resource.hadLoadingError()?this.addClassName(WebInspector.ResourceTreeElement.FailedStyleClassName):this.removeClassName(WebInspector.ResourceTreeElement.FailedStyleClassName),this._resource.finished||this._resource.failed)this.status&&this.status[WebInspector.ResourceTreeElement.SpinnerSymbol]&&(this.status="");else{let _=new WebInspector.IndeterminateProgressSpinner;this.status=_.element,this.status[WebInspector.ResourceTreeElement.SpinnerSymbol]=!0}}_updateToolTip(){this.tooltip=this._resource.displayURL}_urlDidChange(){this._updateTitles(),this._updateToolTip()}_typeDidChange(_){this.removeClassName(_.data.oldType),this.addClassName(this._resource.type),this.callFirstAncestorFunction("descendantResourceTreeElementTypeDidChange",[this,_.data.oldType])}},WebInspector.ResourceTreeElement.ResourceIconStyleClassName="resource-icon",WebInspector.ResourceTreeElement.FailedStyleClassName="failed",WebInspector.ResourceTreeElement.SpinnerSymbol=Symbol("spinner"),WebInspector.ResourcesTabContentView=class extends WebInspector.ContentBrowserTabContentView{constructor(_){let{image:S,title:C}=WebInspector.ResourcesTabContentView.tabInfo(),f=new WebInspector.GeneralTabBarItem(S,C),T=[WebInspector.ResourceDetailsSidebarPanel,WebInspector.ProbeDetailsSidebarPanel];window.CanvasAgent&&WebInspector.settings.experimentalShowCanvasContextsInResources.value&&T.push(WebInspector.CanvasDetailsSidebarPanel),T=T.concat([WebInspector.DOMNodeDetailsSidebarPanel,WebInspector.CSSStyleDetailsSidebarPanel]),window.LayerTreeAgent&&T.push(WebInspector.LayerTreeDetailsSidebarPanel),super(_||"resources","resources",f,WebInspector.ResourceSidebarPanel,T)}static tabInfo(){return{image:"Images/Resources.svg",title:WebInspector.UIString("Resources")}}get type(){return WebInspector.ResourcesTabContentView.Type}get supportsSplitContentBrowser(){return!0}canShowRepresentedObject(_){return _ instanceof WebInspector.Frame||_ instanceof WebInspector.Resource||_ instanceof WebInspector.Script||_ instanceof WebInspector.CSSStyleSheet||_ instanceof WebInspector.ContentFlow||_ instanceof WebInspector.Canvas||_ instanceof WebInspector.Collection}},WebInspector.ResourcesTabContentView.Type="resources",WebInspector.SearchTabContentView=class extends WebInspector.ContentBrowserTabContentView{constructor(_){let{image:S,title:C}=WebInspector.SearchTabContentView.tabInfo(),f=new WebInspector.GeneralTabBarItem(S,C),T=[WebInspector.ResourceDetailsSidebarPanel,WebInspector.ProbeDetailsSidebarPanel,WebInspector.DOMNodeDetailsSidebarPanel,WebInspector.CSSStyleDetailsSidebarPanel];window.LayerTreeAgent&&T.push(WebInspector.LayerTreeDetailsSidebarPanel),super(_||"search","search",f,WebInspector.SearchSidebarPanel,T),this._forcePerformSearch=!1}static tabInfo(){return{image:"Images/SearchResults.svg",title:WebInspector.UIString("Search")}}static isEphemeral(){return!0}get type(){return WebInspector.SearchTabContentView.Type}shown(){super.shown(),setTimeout(this.focusSearchField.bind(this))}canShowRepresentedObject(_){return(_ instanceof WebInspector.Resource||_ instanceof WebInspector.Script||_ instanceof WebInspector.DOMTree)&&!!this.navigationSidebarPanel.contentTreeOutline.getCachedTreeElement(_)}focusSearchField(){this.navigationSidebarPanel.focusSearchField(this._forcePerformSearch),this._forcePerformSearch=!1}performSearch(_){this.navigationSidebarPanel.performSearch(_),this._forcePerformSearch=!1}handleCopyEvent(_){let S=this.navigationSidebarPanel.contentTreeOutline.selectedTreeElement;S&&(_.clipboardData.setData("text/plain",S.synthesizedTextValue),_.stopPropagation(),_.preventDefault())}initialLayout(){super.initialLayout(),this._forcePerformSearch=!0}},WebInspector.SearchTabContentView.Type="search",WebInspector.SettingsTabContentView=class extends WebInspector.TabContentView{constructor(_){let S=new WebInspector.PinnedTabBarItem("Images/Gear.svg",WebInspector.UIString("Open Settings"));super(_||"settings","settings",S),S.representedObject=this,this._selectedSettingsView=null,this._settingsViews=[]}static tabInfo(){return{image:"Images/Gear.svg",title:WebInspector.UIString("Settings")}}static isEphemeral(){return!0}static shouldSaveTab(){return!1}get type(){return WebInspector.SettingsTabContentView.Type}get selectedSettingsView(){return this._selectedSettingsView}set selectedSettingsView(_){if(this._selectedSettingsView!==_){this._selectedSettingsView?this.replaceSubview(this._selectedSettingsView,_):this.addSubview(_),this._selectedSettingsView=_,this._selectedSettingsView.updateLayout();let S=this._navigationBar.findNavigationItem(_.identifier);console.assert(S,"Missing navigation item for settings view.",_),S&&(this._navigationBar.selectedNavigationItem=S)}}addSettingsView(_){this._settingsViews.includes(_)||(this._settingsViews.push(_),this._navigationBar.addNavigationItem(new WebInspector.RadioButtonNavigationItem(_.identifier,_.displayName)),this._updateNavigationBarVisibility())}setSettingsViewVisible(_,S){let C=this._navigationBar.findNavigationItem(_.identifier);if(C&&C.hidden!==!S){if(C.hidden=!S,_.element.classList.toggle("hidden",!S),this._updateNavigationBarVisibility(),!this.selectedSettingsView)return void(S&&(this.selectedSettingsView=_));if(this.selectedSettingsView===_){let f=this._settingsViews.indexOf(_);if(console.assert(-1!==f,"SettingsView not found.",_),-1!==f){for(let T=f,I;0<=--T;)if(I=this._navigationBar.navigationItems[T],I&&!I.hidden)return void(this.selectedSettingsView=this._settingsViews[T]);for(let E=f,I;++E{WebInspector.settings.indentWithTabs.value=C.value===S[0]});const f=WebInspector.UIString("spaces"),T={min:1};_.addSetting(WebInspector.UIString("Tab width:"),WebInspector.settings.tabSize,f,T),_.addSetting(WebInspector.UIString("Indent width:"),WebInspector.settings.indentUnit,f,T),_.addSetting(WebInspector.UIString("Line wrapping:"),WebInspector.settings.enableLineWrapping,WebInspector.UIString("Wrap lines to editor width"));let E=_.addGroup(WebInspector.UIString("Show:"));E.addSetting(WebInspector.settings.showWhitespaceCharacters,WebInspector.UIString("Whitespace characters")),E.addSetting(WebInspector.settings.showInvalidCharacters,WebInspector.UIString("Invalid characters")),_.addSeparator();let I=_.addGroup(WebInspector.UIString("Styles Editing:"));I.addSetting(WebInspector.settings.stylesShowInlineWarnings,WebInspector.UIString("Show inline warnings")),I.addSetting(WebInspector.settings.stylesInsertNewline,WebInspector.UIString("Automatically insert newline")),I.addSetting(WebInspector.settings.stylesSelectOnFirstClick,WebInspector.UIString("Select text on first click")),_.addSeparator(),_.addSetting(WebInspector.UIString("Network:"),WebInspector.settings.clearNetworkOnNavigate,WebInspector.UIString("Clear when page navigates")),_.addSeparator(),_.addSetting(WebInspector.UIString("Console:"),WebInspector.settings.clearLogOnNavigate,WebInspector.UIString("Clear when page navigates")),_.addSeparator(),_.addSetting(WebInspector.UIString("Debugger:"),WebInspector.settings.showScopeChainOnPause,WebInspector.UIString("Show Scope Chain on pause")),_.addSeparator();const N=[0.6,0.8,1,1.2,1.4,1.6,1.8,2,2.2,2.4].map(D=>[D,Number.percentageString(D,0)]);let L=_.addGroupWithCustomSetting(WebInspector.UIString("Zoom:"),WebInspector.SettingEditor.Type.Select,{values:N});L.value=WebInspector.getZoomFactor(),L.addEventListener(WebInspector.SettingEditor.Event.ValueDidChange,()=>{WebInspector.setZoomFactor(L.value)}),WebInspector.settings.zoomFactor.addEventListener(WebInspector.Setting.Event.Changed,()=>{L.value=WebInspector.getZoomFactor().maxDecimals(2)}),this.addSettingsView(_)}_createDebugSettingsView(){if(!this._debugSettingsView){this._debugSettingsView=new WebInspector.SettingsView("debug",WebInspector.unlocalizedString("Debug"));let _=this._debugSettingsView.addGroup(WebInspector.unlocalizedString("Protocol Logging:")),S=_.addSetting(WebInspector.settings.autoLogProtocolMessages,WebInspector.unlocalizedString("Messages"));WebInspector.settings.autoLogProtocolMessages.addEventListener(WebInspector.Setting.Event.Changed,()=>{S.value=InspectorBackend.dumpInspectorProtocolMessages}),_.addSetting(WebInspector.settings.autoLogTimeStats,WebInspector.unlocalizedString("Time Stats")),this._debugSettingsView.addSeparator(),this._debugSettingsView.addSetting(WebInspector.unlocalizedString("Uncaught Exception Reporter:"),WebInspector.settings.enableUncaughtExceptionReporter,WebInspector.unlocalizedString("Enabled")),this._debugSettingsView.addSeparator();const C=[[WebInspector.LayoutDirection.System,WebInspector.unlocalizedString("System Default")],[WebInspector.LayoutDirection.LTR,WebInspector.unlocalizedString("Left to Right (LTR)")],[WebInspector.LayoutDirection.RTL,WebInspector.unlocalizedString("Right to Left (RTL)")]];let f=this._debugSettingsView.addGroupWithCustomSetting(WebInspector.unlocalizedString("Layout Direction:"),WebInspector.SettingEditor.Type.Select,{values:C});f.value=WebInspector.settings.layoutDirection.value,f.addEventListener(WebInspector.SettingEditor.Event.ValueDidChange,()=>{WebInspector.setLayoutDirection(f.value)}),window.CanvasAgent&&(this._debugSettingsView.addSeparator(),this._debugSettingsView.addSetting(WebInspector.UIString("Canvas:"),WebInspector.settings.experimentalShowCanvasContextsInResources,WebInspector.UIString("Show Contexts in Resources Tab"))),this.addSettingsView(this._debugSettingsView)}}_updateNavigationBarVisibility(){let _=0;for(let S of this._navigationBar.navigationItems)if(!S.hidden&&1<++_)return void this._navigationBar.element.classList.remove("invisible");this._navigationBar.element.classList.add("invisible")}_navigationItemSelected(_){let S=_.target.selectedNavigationItem;if(S){let C=this._settingsViews.find(f=>f.identifier===S.identifier);C&&(this.selectedSettingsView=C)}}_updateDebugSettingsViewVisibility(){WebInspector.isDebugUIEnabled()&&this._createDebugSettingsView();this._debugSettingsView&&(this.setSettingsViewVisible(this._debugSettingsView,WebInspector.isDebugUIEnabled()),this.needsLayout())}},WebInspector.SettingsTabContentView.Type="settings",WebInspector.StorageTabContentView=class extends WebInspector.ContentBrowserTabContentView{constructor(_){let{image:S,title:C}=WebInspector.StorageTabContentView.tabInfo(),f=new WebInspector.GeneralTabBarItem(S,C),T=[WebInspector.ApplicationCacheDetailsSidebarPanel,WebInspector.IndexedDatabaseDetailsSidebarPanel];super(_||"storage","storage",f,WebInspector.StorageSidebarPanel,T)}static tabInfo(){return{image:"Images/Storage.svg",title:WebInspector.UIString("Storage")}}static isTabAllowed(){return!!window.DOMStorageAgent||!!window.DatabaseAgent||!!window.IndexedDBAgent}get type(){return WebInspector.StorageTabContentView.Type}get supportsSplitContentBrowser(){return!0}canShowRepresentedObject(_){return _ instanceof WebInspector.DOMStorageObject||_ instanceof WebInspector.CookieStorageObject||_ instanceof WebInspector.DatabaseTableObject||_ instanceof WebInspector.DatabaseObject||_ instanceof WebInspector.ApplicationCacheFrame||_ instanceof WebInspector.IndexedDatabaseObjectStore||_ instanceof WebInspector.IndexedDatabase||_ instanceof WebInspector.IndexedDatabaseObjectStoreIndex}},WebInspector.StorageTabContentView.Type="storage",WebInspector.TimelineTabContentView=class extends WebInspector.ContentBrowserTabContentView{constructor(_){let{image:S,title:C}=WebInspector.TimelineTabContentView.tabInfo(),f=new WebInspector.GeneralTabBarItem(S,C),T=[WebInspector.ResourceDetailsSidebarPanel,WebInspector.ProbeDetailsSidebarPanel];super(_||"timeline","timeline",f,null,T),this._recordingTreeElementMap=new Map,this._recordingsTreeOutline=new WebInspector.TreeOutline,this._recordingsTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange,this._recordingsTreeSelectionDidChange,this),this._toggleRecordingShortcut=new WebInspector.KeyboardShortcut(null,WebInspector.KeyboardShortcut.Key.Space,this._toggleRecordingOnSpacebar.bind(this)),this._toggleRecordingShortcut.implicitlyPreventsDefault=!1,this._toggleRecordingShortcut.disabled=!0,this._toggleNewRecordingShortcut=new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Shift,WebInspector.KeyboardShortcut.Key.Space,this._toggleNewRecordingOnSpacebar.bind(this)),this._toggleNewRecordingShortcut.implicitlyPreventsDefault=!1,this._toggleNewRecordingShortcut.disabled=!0;let E=WebInspector.UIString("Start recording (%s)\nCreate new recording (%s)").format(this._toggleRecordingShortcut.displayName,this._toggleNewRecordingShortcut.displayName),I=WebInspector.UIString("Stop recording (%s)").format(this._toggleRecordingShortcut.displayName);if(this._recordButton=new WebInspector.ToggleButtonNavigationItem("record-start-stop",E,I,"Images/Record.svg","Images/Stop.svg",13,13),this._recordButton.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._recordButtonClicked,this),this.contentBrowser.navigationBar.insertNavigationItem(this._recordButton,0),WebInspector.FPSInstrument.supported()){let N=new WebInspector.RadioButtonNavigationItem(WebInspector.TimelineOverview.ViewMode.Timelines,WebInspector.UIString("Events")),L=new WebInspector.RadioButtonNavigationItem(WebInspector.TimelineOverview.ViewMode.RenderingFrames,WebInspector.UIString("Frames"));this.contentBrowser.navigationBar.insertNavigationItem(N,1),this.contentBrowser.navigationBar.insertNavigationItem(L,2),this.contentBrowser.navigationBar.addEventListener(WebInspector.NavigationBar.Event.NavigationItemSelected,this._viewModeSelected,this)}WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingCreated,this._recordingCreated,this),WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingLoaded,this._recordingLoaded,this),WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStarted,this._capturingStartedOrStopped,this),WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped,this._capturingStartedOrStopped,this),WebInspector.notifications.addEventListener(WebInspector.Notification.VisibilityStateDidChange,this._inspectorVisibilityChanged,this),this._displayedRecording=null,this._displayedContentView=null,this._viewMode=null,this._previousSelectedTimelineType=null;this._changeViewMode(WebInspector.TimelineOverview.ViewMode.Timelines,!1);for(let N of WebInspector.timelineManager.recordings)this._addRecording(N);this._recordingCountChanged(),this.contentBrowser.updateHierarchicalPathForCurrentContentView()}static tabInfo(){return{image:"Images/Timeline.svg",title:WebInspector.UIString("Timelines")}}static isTabAllowed(){return!!window.TimelineAgent||!!window.ScriptProfilerAgent}static displayNameForTimelineType(_){switch(_){case WebInspector.TimelineRecord.Type.Network:return WebInspector.UIString("Network Requests");case WebInspector.TimelineRecord.Type.Layout:return WebInspector.UIString("Layout & Rendering");case WebInspector.TimelineRecord.Type.Script:return WebInspector.UIString("JavaScript & Events");case WebInspector.TimelineRecord.Type.RenderingFrame:return WebInspector.UIString("Rendering Frames");case WebInspector.TimelineRecord.Type.Memory:return WebInspector.UIString("Memory");case WebInspector.TimelineRecord.Type.HeapAllocations:return WebInspector.UIString("JavaScript Allocations");default:console.error("Unknown Timeline type:",_);}return null}static iconClassNameForTimelineType(_){switch(_){case WebInspector.TimelineRecord.Type.Network:return"network-icon";case WebInspector.TimelineRecord.Type.Layout:return"layout-icon";case WebInspector.TimelineRecord.Type.Memory:return"memory-icon";case WebInspector.TimelineRecord.Type.HeapAllocations:return"heap-allocations-icon";case WebInspector.TimelineRecord.Type.Script:return"script-icon";case WebInspector.TimelineRecord.Type.RenderingFrame:return"rendering-frame-icon";default:console.error("Unknown Timeline type:",_);}return null}static genericClassNameForTimelineType(_){switch(_){case WebInspector.TimelineRecord.Type.Network:return"network";case WebInspector.TimelineRecord.Type.Layout:return"colors";case WebInspector.TimelineRecord.Type.Memory:return"memory";case WebInspector.TimelineRecord.Type.HeapAllocations:return"heap-allocations";case WebInspector.TimelineRecord.Type.Script:return"script";case WebInspector.TimelineRecord.Type.RenderingFrame:return"rendering-frame";default:console.error("Unknown Timeline type:",_);}return null}static iconClassNameForRecord(_){switch(_.type){case WebInspector.TimelineRecord.Type.Layout:switch(_.eventType){case WebInspector.LayoutTimelineRecord.EventType.InvalidateStyles:case WebInspector.LayoutTimelineRecord.EventType.RecalculateStyles:return WebInspector.TimelineRecordTreeElement.StyleRecordIconStyleClass;case WebInspector.LayoutTimelineRecord.EventType.InvalidateLayout:case WebInspector.LayoutTimelineRecord.EventType.ForcedLayout:case WebInspector.LayoutTimelineRecord.EventType.Layout:return WebInspector.TimelineRecordTreeElement.LayoutRecordIconStyleClass;case WebInspector.LayoutTimelineRecord.EventType.Paint:return WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass;case WebInspector.LayoutTimelineRecord.EventType.Composite:return WebInspector.TimelineRecordTreeElement.CompositeRecordIconStyleClass;default:console.error("Unknown LayoutTimelineRecord eventType: "+_.eventType,_);}break;case WebInspector.TimelineRecord.Type.Script:switch(_.eventType){case WebInspector.ScriptTimelineRecord.EventType.APIScriptEvaluated:return WebInspector.TimelineRecordTreeElement.APIRecordIconStyleClass;case WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated:return WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass;case WebInspector.ScriptTimelineRecord.EventType.MicrotaskDispatched:case WebInspector.ScriptTimelineRecord.EventType.EventDispatched:return WebInspector.TimelineRecordTreeElement.EventRecordIconStyleClass;case WebInspector.ScriptTimelineRecord.EventType.ProbeSampleRecorded:return WebInspector.TimelineRecordTreeElement.ProbeRecordIconStyleClass;case WebInspector.ScriptTimelineRecord.EventType.ConsoleProfileRecorded:return WebInspector.TimelineRecordTreeElement.ConsoleProfileIconStyleClass;case WebInspector.ScriptTimelineRecord.EventType.GarbageCollected:return WebInspector.TimelineRecordTreeElement.GarbageCollectionIconStyleClass;case WebInspector.ScriptTimelineRecord.EventType.TimerInstalled:return WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass;case WebInspector.ScriptTimelineRecord.EventType.TimerFired:case WebInspector.ScriptTimelineRecord.EventType.TimerRemoved:return WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass;case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameFired:case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameRequested:case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameCanceled:return WebInspector.TimelineRecordTreeElement.AnimationRecordIconStyleClass;default:console.error("Unknown ScriptTimelineRecord eventType: "+_.eventType,_);}break;case WebInspector.TimelineRecord.Type.RenderingFrame:return WebInspector.TimelineRecordTreeElement.RenderingFrameRecordIconStyleClass;case WebInspector.TimelineRecord.Type.HeapAllocations:return"heap-snapshot-record";case WebInspector.TimelineRecord.Type.Memory:default:console.error("Unknown TimelineRecord type: "+_.type,_);}return null}static displayNameForRecord(_,S){switch(_.type){case WebInspector.TimelineRecord.Type.Network:return WebInspector.displayNameForURL(_.resource.url,_.resource.urlComponents);case WebInspector.TimelineRecord.Type.Layout:return WebInspector.LayoutTimelineRecord.displayNameForEventType(_.eventType);case WebInspector.TimelineRecord.Type.Script:return WebInspector.ScriptTimelineRecord.EventType.displayName(_.eventType,_.details,S);case WebInspector.TimelineRecord.Type.RenderingFrame:return WebInspector.UIString("Frame %d").format(_.frameNumber);case WebInspector.TimelineRecord.Type.HeapAllocations:return _.heapSnapshot.title?WebInspector.UIString("Snapshot %d \u2014 %s").format(_.heapSnapshot.identifier,_.heapSnapshot.title):WebInspector.UIString("Snapshot %d").format(_.heapSnapshot.identifier);case WebInspector.TimelineRecord.Type.Memory:default:console.error("Unknown TimelineRecord type: "+_.type,_);}return null}get type(){return WebInspector.TimelineTabContentView.Type}shown(){super.shown(),this._toggleRecordingShortcut.disabled=!1,this._toggleNewRecordingShortcut.disabled=!1,WebInspector.visible&&(WebInspector.timelineManager.autoCaptureOnPageLoad=!0)}hidden(){super.hidden(),this._toggleRecordingShortcut.disabled=!0,this._toggleNewRecordingShortcut.disabled=!0,WebInspector.timelineManager.autoCaptureOnPageLoad=!1}closed(){super.closed(),WebInspector.FPSInstrument.supported()&&this.contentBrowser.navigationBar.removeEventListener(null,null,this),WebInspector.timelineManager.removeEventListener(null,null,this),WebInspector.notifications.removeEventListener(null,null,this)}canShowRepresentedObject(_){return _ instanceof WebInspector.TimelineRecording}restoreFromCookie(_){if(this._restoredShowingTimelineRecordingContentView=_[WebInspector.TimelineTabContentView.ShowingTimelineRecordingContentViewCookieKey],!this._restoredShowingTimelineRecordingContentView)return void(this.contentBrowser.currentContentView||(!this._displayedRecording&&WebInspector.timelineManager.activeRecording&&this._recordingLoaded(),this._showTimelineViewForType(WebInspector.TimelineTabContentView.OverviewTimelineIdentifierCookieValue)));let S=_[WebInspector.TimelineTabContentView.SelectedTimelineViewIdentifierCookieKey];S!==WebInspector.TimelineRecord.Type.RenderingFrame||WebInspector.FPSInstrument.supported()||(S=null),this._showTimelineViewForType(S),super.restoreFromCookie(_)}saveToCookie(_){if(_[WebInspector.TimelineTabContentView.ShowingTimelineRecordingContentViewCookieKey]=this.contentBrowser.currentContentView instanceof WebInspector.TimelineRecordingContentView,this._viewMode===WebInspector.TimelineOverview.ViewMode.RenderingFrames)_[WebInspector.TimelineTabContentView.SelectedTimelineViewIdentifierCookieKey]=WebInspector.TimelineRecord.Type.RenderingFrame;else{let S=this._getTimelineForCurrentContentView();_[WebInspector.TimelineTabContentView.SelectedTimelineViewIdentifierCookieKey]=S?S.type:WebInspector.TimelineTabContentView.OverviewTimelineIdentifierCookieValue}super.saveToCookie(_)}treeElementForRepresentedObject(_){return this._recordingTreeElementMap?_ instanceof WebInspector.TimelineRecording?this._recordingTreeElementMap.get(_):null:null}_capturingStartedOrStopped(){let S=WebInspector.timelineManager.isCapturing();this._recordButton.toggled=S}_inspectorVisibilityChanged(){WebInspector.timelineManager.autoCaptureOnPageLoad=!!this.visible&&!!WebInspector.visible}_toggleRecordingOnSpacebar(_){WebInspector.isEventTargetAnEditableField(_)||(this._toggleRecording(),_.preventDefault())}_toggleNewRecordingOnSpacebar(_){WebInspector.isEventTargetAnEditableField(_)||(this._toggleRecording(!0),_.preventDefault())}_toggleRecording(_){let S=WebInspector.timelineManager.isCapturing();this._recordButton.toggled=S,S?WebInspector.timelineManager.stopCapturing():(WebInspector.timelineManager.startCapturing(_),this._recordingLoaded())}_recordButtonClicked(){let S=!!window.event&&window.event.shiftKey;this._recordButton.toggled=!WebInspector.timelineManager.isCapturing(),this._toggleRecording(S)}_recordingsTreeSelectionDidChange(_){let S=_.data.selectedElement;S&&this._recordingSelected(S.representedObject)}_recordingCreated(_){this._addRecording(_.data.recording),this._recordingCountChanged()}_addRecording(_){let S=new WebInspector.GeneralTreeElement(WebInspector.TimelineTabContentView.StopwatchIconStyleClass,_.displayName,null,_);this._recordingTreeElementMap.set(_,S),this._recordingsTreeOutline.appendChild(S)}_recordingCountChanged(){let _=null;for(let S of this._recordingTreeElementMap.values())_&&(_.nextSibling=S,S.previousSibling=_),_=S}_recordingSelected(_){this._displayedRecording=_;let S={};this.saveToCookie(S),this._displayedContentView&&this._displayedContentView.removeEventListener(WebInspector.ContentView.Event.NavigationItemsDidChange,this._displayedContentViewNavigationItemsDidChange,this);let C=!0;if(this._displayedContentView=this.contentBrowser.contentViewForRepresentedObject(this._displayedRecording,C),this._displayedContentView){this._displayedContentView.addEventListener(WebInspector.ContentView.Event.NavigationItemsDidChange,this._displayedContentViewNavigationItemsDidChange,this);let f=this._displayedContentView.currentTimelineView,T=f&&f.representedObject instanceof WebInspector.Timeline?f.representedObject.type:null;return void this._showTimelineViewForType(T)}C=!1,this._displayedContentView=this.contentBrowser.contentViewForRepresentedObject(this._displayedRecording,C),this._displayedContentView&&this._displayedContentView.addEventListener(WebInspector.ContentView.Event.NavigationItemsDidChange,this._displayedContentViewNavigationItemsDidChange,this),this.restoreFromCookie(S)}_recordingLoaded(){this._recordingSelected(WebInspector.timelineManager.activeRecording)}_viewModeSelected(_){let S=_.target.selectedNavigationItem;if(S){this._changeViewMode(S.identifier,!0)}}_changeViewMode(_,S){if(this._viewMode!==_){let C=this.contentBrowser.navigationBar.findNavigationItem(_);if(C&&(this._viewMode=_,this.contentBrowser.navigationBar.selectedNavigationItem=C,!!S)){let f=this._previousSelectedTimelineType;if(this._viewMode===WebInspector.TimelineOverview.ViewMode.RenderingFrames){let T=this._getTimelineForCurrentContentView();this._previousSelectedTimelineType=T?T.type:null,f=WebInspector.TimelineRecord.Type.RenderingFrame}this._showTimelineViewForType(f)}}}_showTimelineViewForType(_){let S=_?this._displayedRecording.timelines.get(_):null;S?this._displayedContentView.showTimelineViewForTimeline(S):this._displayedContentView.showOverviewTimelineView(),this.contentBrowser.currentContentView!==this._displayedContentView&&this.contentBrowser.showContentView(this._displayedContentView)}_displayedContentViewNavigationItemsDidChange(){let S=this._getTimelineForCurrentContentView(),C=WebInspector.TimelineOverview.ViewMode.Timelines;S&&S.type===WebInspector.TimelineRecord.Type.RenderingFrame&&(C=WebInspector.TimelineOverview.ViewMode.RenderingFrames);this._changeViewMode(C,!1)}_getTimelineForCurrentContentView(){let _=this.contentBrowser.currentContentView;if(!(_ instanceof WebInspector.TimelineRecordingContentView))return null;let S=_.currentTimelineView;return S&&S.representedObject instanceof WebInspector.Timeline?S.representedObject:null}},WebInspector.TimelineTabContentView.Type="timeline",WebInspector.TimelineTabContentView.ShowingTimelineRecordingContentViewCookieKey="timeline-sidebar-panel-showing-timeline-recording-content-view",WebInspector.TimelineTabContentView.SelectedTimelineViewIdentifierCookieKey="timeline-sidebar-panel-selected-timeline-view-identifier",WebInspector.TimelineTabContentView.OverviewTimelineIdentifierCookieValue="overview",WebInspector.TimelineTabContentView.StopwatchIconStyleClass="stopwatch-icon",WebInspector.DetailsSection=class extends WebInspector.Object{constructor(_,S,C,f,T){super(),this._element=document.createElement("div"),this._element.classList.add(_,"details-section"),this._headerElement=document.createElement("div"),this._headerElement.addEventListener("click",this._headerElementClicked.bind(this)),this._headerElement.className="header",this._element.appendChild(this._headerElement),f instanceof HTMLElement&&(this._optionsElement=f,this._optionsElement.classList.add("options"),this._optionsElement.addEventListener("mousedown",this._optionsElementMouseDown.bind(this)),this._optionsElement.addEventListener("mouseup",this._optionsElementMouseUp.bind(this)),this._headerElement.appendChild(this._optionsElement)),this._titleElement=document.createElement("span"),this._headerElement.appendChild(this._titleElement),this._contentElement=document.createElement("div"),this._contentElement.className="content",this._element.appendChild(this._contentElement),this._identifier=_,this.title=S,this.groups=C||[new WebInspector.DetailsSectionGroup],this._collapsedSetting=new WebInspector.Setting(_+"-details-section-collapsed",!!T),this.collapsed=this._collapsedSetting.value,this._expandedByUser=!1}get element(){return this._element}get identifier(){return this._identifier}get title(){return this._titleElement.textContent}set title(_){this._titleElement.textContent=_}get titleElement(){return this._titleElement}set titleElement(_){this._headerElement.replaceChild(_,this._titleElement),this._titleElement=_}get collapsed(){return this._element.classList.contains(WebInspector.DetailsSection.CollapsedStyleClassName)}set collapsed(_){_?this._element.classList.add(WebInspector.DetailsSection.CollapsedStyleClassName):this._element.classList.remove(WebInspector.DetailsSection.CollapsedStyleClassName),this._collapsedSetting.value=_||!1,this.dispatchEventToListeners(WebInspector.DetailsSection.Event.CollapsedStateChanged,{collapsed:this._collapsedSetting.value})}get groups(){return this._groups}set groups(_){this._contentElement.removeChildren(),this._groups=_||[];for(var S=0;Sf.detail)){var T=window.getSelection();if(T){var E=T.getRangeAt(0);if(E&&E.startContainer!==E.endContainer){var I=document.createRange();I.selectNodeContents(f.currentTarget),T.removeAllRanges(),T.addRange(I)}}}}),this.label=_,this.value=S}get label(){return this._labelElement.textContent}set label(_){this._labelElement.textContent=_}get value(){return this._value}set value(_){this._value=_||"",this._value?(this.element.classList.remove(WebInspector.DetailsSectionSimpleRow.EmptyStyleClassName),/[\s\u200b]/.test(this._value)?this.element.classList.remove(WebInspector.DetailsSectionSimpleRow.DataStyleClassName):this.element.classList.add(WebInspector.DetailsSectionSimpleRow.DataStyleClassName)):(this.element.classList.add(WebInspector.DetailsSectionSimpleRow.EmptyStyleClassName),this.element.classList.remove(WebInspector.DetailsSectionSimpleRow.DataStyleClassName)),_ instanceof Node?(this._valueElement.removeChildren(),this._valueElement.appendChild(this._value)):this._valueElement.textContent=this._value}get tooltip(){return this._valueElement.title}set tooltip(_){this._valueElement.title=_}},WebInspector.DetailsSectionSimpleRow.DataStyleClassName="data",WebInspector.DetailsSectionSimpleRow.EmptyStyleClassName="empty",WebInspector.DetailsSectionTextRow=class extends WebInspector.DetailsSectionRow{constructor(_){super(),this.element.classList.add("text"),this.element.textContent=_}get text(){return this.element.textContent}set text(_){this.element.textContent=_}},WebInspector.SettingEditor=class extends WebInspector.Object{constructor(_,S,C){if(super(),this._type=_,this._label=S,this._value=null,this._editorElement=this._createEditorElement(C),this._element=document.createElement("div"),this._element.classList.add("editor"),this._element.append(this._editorElement),this._label){this._editorElement.id="setting-editor-"+WebInspector.SettingEditor._nextEditorIdentifier++;let f=document.createElement("label");f.setAttribute("for",this._editorElement.id),f.textContent=S,this._element.append(f)}}static createForSetting(_,S,C){let f;if("boolean"==typeof _.value?f=WebInspector.SettingEditor.Type.Checkbox:"number"==typeof _.value&&(f=WebInspector.SettingEditor.Type.Numeric),!f)return null;let T=new WebInspector.SettingEditor(f,S,C);return T.value=_.value,T.addEventListener(WebInspector.SettingEditor.Event.ValueDidChange,()=>{_.value=T.value}),T}get element(){return this._element}get type(){return this._type}get label(){return this._label}get value(){return this._value}set value(_){if(this._value!==_){let S=this._value;this._value=_,this._type==WebInspector.SettingEditor.Type.Checkbox?this._editorElement.checked=!!this._value:this._editorElement.value=this._value,this.dispatchEventToListeners(WebInspector.SettingEditor.Event.ValueDidChange,{oldValue:S})}}_createEditorElement(_){let S;switch(this._type){case WebInspector.SettingEditor.Type.Checkbox:S=document.createElement("input"),S.type="checkbox",S.addEventListener("change",f=>{this.value=f.target.checked});break;case WebInspector.SettingEditor.Type.Numeric:S=document.createElement("input"),S.type="number",_.min!==void 0&&(S.min=_.min),_.max!==void 0&&(S.max=_.max),S.addEventListener("change",f=>{let T=this._value,E=parseInt(f.target.value);this.value=isNaN(E)?T:E});break;case WebInspector.SettingEditor.Type.Select:S=document.createElement("select");var C=[];C=Array.isArray(_.values[0])?_.values:_.values.map(f=>[f,f]);for(let[f,T]of C){let E=S.appendChild(document.createElement("option"));E.value=f,E.textContent=T}S.addEventListener("change",f=>{this.value=f.target.value});break;default:console.error("Unknown editor type: "+this._type);}return S}},WebInspector.SettingEditor._nextEditorIdentifier=1,WebInspector.SettingEditor.Type={Checkbox:"setting-editor-type-checkbox",Numeric:"setting-editor-type-numeric",Select:"setting-editor-type-select"},WebInspector.SettingEditor.Event={ValueDidChange:"value-did-change"},WebInspector.SettingsGroup=class extends WebInspector.Object{constructor(_){super(),this._element=document.createElement("div"),this._element.classList.add("container");let S=this._element.appendChild(document.createElement("div"));S.classList.add("title"),S.textContent=_,this._editorGroupElement=this._element.appendChild(document.createElement("div")),this._editorGroupElement.classList.add("editor-group")}get element(){return this._element}addSetting(_,S,C){let f=WebInspector.SettingEditor.createForSetting(_,S,C);return f?(this._editorGroupElement.append(f.element),f):null}addCustomSetting(_,S){let C=new WebInspector.SettingEditor(_,S.label,S);return C?(this._editorGroupElement.append(C.element),C):null}},WebInspector.SettingsView=class extends WebInspector.View{constructor(_,S){super(),this._identifier=_,this._displayName=S,this.element.classList.add("settings-view",_)}get identifier(){return this._identifier}get displayName(){return this._displayName}addSetting(_,S,C,f){let T=this.addGroup(_);return T.addSetting(S,C,f)}addGroupWithCustomSetting(_,S,C){let f=this.addGroup(_);return f.addCustomSetting(S,C)}addGroup(_){let S=new WebInspector.SettingsGroup(_);return this.element.append(S.element),S}addSeparator(){if(!(this.element.lastChild&&this.element.lastChild.classList.contains("separator"))){let _=this.element.appendChild(document.createElement("div"));_.classList.add("separator")}}},WebInspector.SettingsView.EditorType={Checkbox:"settings-view-editor-type-checkbox",Numeric:"settings-view-editor-type-numeric",Select:"settings-view-editor-type-select"},WebInspector.ActivateButtonNavigationItem=class extends WebInspector.ButtonNavigationItem{constructor(_,S,C,f,T,E,I){super(_,S,f,T,E,I),this._defaultToolTip=S,this._activatedToolTip=C||S,this._role=I}get defaultToolTip(){return this._defaultToolTip}get activatedToolTip(){return this._activatedToolTip}get activated(){return this.element.classList.contains(WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName)}set activated(_){this.element.classList.toggle(WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName,_),_?(this.toolTip=this._activatedToolTip,"tab"===this._role&&this.element.setAttribute("aria-selected","true")):(this.toolTip=this._defaultToolTip,"tab"===this._role&&this.element.removeAttribute("aria-selected"))}get additionalClassNames(){return["activate","button"]}},WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName="activated",WebInspector.ActivateButtonToolbarItem=class extends WebInspector.ActivateButtonNavigationItem{constructor(_,S,C,f,T,E){super(_,S,C,T,16,16,E),"string"==typeof f&&(this._labelElement=document.createElement("div"),this._labelElement.className=WebInspector.ButtonToolbarItem.LabelStyleClassName,this._element.appendChild(this._labelElement),this.label=f)}get label(){return this._labelElement.textContent}set label(_){_&&this._labelElement&&(this._labelElement.textContent=_)}},WebInspector.ApplicationCacheDetailsSidebarPanel=class extends WebInspector.DetailsSidebarPanel{constructor(){super("application-cache-details",WebInspector.UIString("Storage")),this.element.classList.add("application-cache"),this._applicationCacheFrame=null}inspect(_){_ instanceof Array||(_=[_]);for(var S=null,C=0;C<_.length;++C)if(_[C]instanceof WebInspector.ApplicationCacheFrame){S=_[C];break}return this.applicationCacheFrame=S,!!this.applicationCacheFrame}get applicationCacheFrame(){return this._applicationCacheFrame}set applicationCacheFrame(_){this._applicationCacheFrame===_||(this._applicationCacheFrame=_,this.needsLayout())}initialLayout(){super.initialLayout(),this._locationManifestURLRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Manifest URL")),this._locationFrameURLRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Frame URL"));let _=new WebInspector.DetailsSectionGroup([this._locationManifestURLRow,this._locationFrameURLRow]),S=new WebInspector.DetailsSection("application-cache-location",WebInspector.UIString("Location"),[_]);this._onlineRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Online")),this._statusRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Status"));let C=new WebInspector.DetailsSectionGroup([this._onlineRow,this._statusRow]),f=new WebInspector.DetailsSection("application-cache-status",WebInspector.UIString("Status"),[C]);this.contentView.element.appendChild(S.element),this.contentView.element.appendChild(f.element),WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.NetworkStateUpdated,this._networkStateUpdated,this),WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestStatusChanged,this._frameManifestStatusChanged,this)}layout(){super.layout();this.applicationCacheFrame&&(this._locationFrameURLRow.value=this.applicationCacheFrame.frame.url,this._locationManifestURLRow.value=this.applicationCacheFrame.manifest.manifestURL,this._refreshOnlineRow(),this._refreshStatusRow())}_networkStateUpdated(){this.applicationCacheFrame&&this._refreshOnlineRow()}_frameManifestStatusChanged(_){this.applicationCacheFrame&&_.data.frameManifest===this.applicationCacheFrame&&this._refreshStatusRow()}_refreshOnlineRow(){this._onlineRow.value=WebInspector.applicationCacheManager.online?WebInspector.UIString("Yes"):WebInspector.UIString("No")}_refreshStatusRow(){this._statusRow.value=WebInspector.ApplicationCacheDetailsSidebarPanel.Status[this.applicationCacheFrame.status]}},WebInspector.ApplicationCacheDetailsSidebarPanel.Status={0:"Uncached",1:"Idle",2:"Checking",3:"Downloading",4:"UpdateReady",5:"Obsolete"},WebInspector.ApplicationCacheFrameContentView=class extends WebInspector.ContentView{constructor(_){super(_),this.element.classList.add("application-cache-frame"),this._frame=_.frame,this._emptyView=WebInspector.createMessageTextView(WebInspector.UIString("No Application Cache information available"),!1),this._emptyView.classList.add("hidden"),this.element.appendChild(this._emptyView),this._markDirty();var S=_.status;this.updateStatus(S),WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestStatusChanged,this._updateStatus,this)}shown(){super.shown(),this._maybeUpdate()}closed(){WebInspector.applicationCacheManager.removeEventListener(null,null,this),super.closed()}saveToCookie(_){_.type=WebInspector.ContentViewCookieType.ApplicationCache,_.frame=this.representedObject.frame.url,_.manifest=this.representedObject.manifest.manifestURL}get scrollableElements(){return this._dataGrid?[this._dataGrid.scrollContainer]:[]}_maybeUpdate(){this.visible&&this._viewDirty&&(this._update(),this._viewDirty=!1)}_markDirty(){this._viewDirty=!0}_updateStatus(_){var S=_.data.frameManifest;S!==this.representedObject||this.updateStatus(S.status)}updateStatus(_){var S=this._status;this._status=_,this.visible&&this._status===WebInspector.ApplicationCacheManager.Status.Idle&&(S===WebInspector.ApplicationCacheManager.Status.UpdateReady||!this._resources)&&this._markDirty(),this._maybeUpdate()}_update(){WebInspector.applicationCacheManager.requestApplicationCache(this._frame,this._updateCallback.bind(this))}_updateCallback(_){return _&&_.manifestURL?void(this._manifest=_.manifestURL,this._creationTime=_.creationTime,this._updateTime=_.updateTime,this._size=_.size,this._resources=_.resources,!this._dataGrid&&this._createDataGrid(),this._populateDataGrid(),this._dataGrid.autoSizeColumns(20,80),this._dataGrid.element.classList.remove("hidden"),this._emptyView.classList.add("hidden")):(delete this._manifest,delete this._creationTime,delete this._updateTime,delete this._size,delete this._resources,this._emptyView.classList.remove("hidden"),void(this._dataGrid&&this._dataGrid.element.classList.add("hidden")))}_createDataGrid(){var _={url:{},type:{},size:{}};_.url.title=WebInspector.UIString("Resource"),_.url.sortable=!0,_.type.title=WebInspector.UIString("Type"),_.type.sortable=!0,_.size.title=WebInspector.UIString("Size"),_.size.aligned="right",_.size.sortable=!0,this._dataGrid=new WebInspector.DataGrid(_),this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged,this._sortDataGrid,this),this._dataGrid.sortColumnIdentifier="url",this._dataGrid.sortOrder=WebInspector.DataGrid.SortOrder.Ascending,this._dataGrid.createSettings("application-cache-frame-content-view"),this.addSubview(this._dataGrid),this._dataGrid.updateLayout()}_sortDataGrid(){function _(f,T,E){return T.data[f]-E.data[f]}function S(f,T,E){return(T.data[f]+"").extendedLocaleCompare(E.data[f]+"")}var C;switch(this._dataGrid.sortColumnIdentifier){case"type":C=S.bind(this,"type");break;case"size":C=_.bind(this,"size");break;case"url":default:C=S.bind(this,"url");}this._dataGrid.sortNodes(C)}_populateDataGrid(){this._dataGrid.removeChildren();for(var _ of this._resources){var S={url:_.url,type:_.type,size:Number.bytesToString(_.size)},C=new WebInspector.DataGridNode(S);this._dataGrid.appendChild(C)}}_deleteButtonClicked(){this._dataGrid&&this._dataGrid.selectedNode&&this._deleteCallback(this._dataGrid.selectedNode)}_deleteCallback(){}},WebInspector.ApplicationCacheFrameTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_){super("application-cache-frame","","",_,!1),this.updateTitles()}updateTitles(){var _=this.representedObject.frame.url,S=parseURL(_);this.mainTitle=WebInspector.displayNameForURL(_,S);for(var C=WebInspector.displayNameForHost(S.host),f=null,T=this.parent;T&&!T.root;){if(T instanceof WebInspector.ApplicationCacheManifestTreeElement){f=T;break}T=T.parent}var E=C===this._mainTitle||f&&f.subtitle===C;this.subtitle=E?null:C}},WebInspector.ApplicationCacheManifestTreeElement=class extends WebInspector.StorageTreeElement{constructor(_){super("application-cache-manifest","",_),this.hasChildren=!0,this.expanded=!0}get name(){return this._name||this._generateTitles(),this._name}get secondaryName(){return this._secondaryName||this._generateTitles(),this._secondaryName}get categoryName(){return WebInspector.UIString("Application Cache")}_generateTitles(){var _=parseURL(this.representedObject.manifestURL);this._name=WebInspector.displayNameForURL(this.representedObject.manifestURL,_);var S=WebInspector.displayNameForHost(_.host);this._secondaryName=this._name===S?null:S}},WebInspector.BezierEditor=class extends WebInspector.Object{constructor(){function _(I,R){I+=this._controlHandleRadius,R+=this._controlHandleRadius;let N=T.appendChild(createSVGElement("line"));N.classList.add("control-line"),N.setAttribute("x1",I),N.setAttribute("y1",R),N.setAttribute("x2",I),N.setAttribute("y2",R);let L=T.appendChild(createSVGElement("circle"));return L.classList.add("control-handle"),{point:null,line:N,handle:L}}function S(I,{min:R,max:N}={}){let L="_bezier"+I+"Input";this[L]=this._numberInputContainer.createChild("input"),this[L].type="number",this[L].step=0.01,isNaN(R)||(this[L].min=R),isNaN(N)||(this[L].max=N),this[L].addEventListener("input",this.debounce(250)._handleNumberInputInput),this[L].addEventListener("keydown",this._handleNumberInputKeydown.bind(this))}super(),this._element=document.createElement("div"),this._element.classList.add("bezier-editor");var C=184,f=200;this._padding=25,this._controlHandleRadius=7,this._bezierWidth=C-2*this._controlHandleRadius,this._bezierHeight=f-2*this._controlHandleRadius-2*this._padding,this._bezierPreviewContainer=this._element.createChild("div","bezier-preview"),this._bezierPreviewContainer.title=WebInspector.UIString("Restart animation"),this._bezierPreviewContainer.addEventListener("mousedown",this._resetPreviewAnimation.bind(this)),this._bezierPreview=this._bezierPreviewContainer.createChild("div"),this._bezierPreviewTiming=this._element.createChild("div","bezier-preview-timing"),this._bezierContainer=this._element.appendChild(createSVGElement("svg")),this._bezierContainer.setAttribute("width",C),this._bezierContainer.setAttribute("height",f),this._bezierContainer.classList.add("bezier-container");let T=this._bezierContainer.appendChild(createSVGElement("g"));T.setAttribute("transform","translate(0, "+this._padding+")");let E=T.appendChild(createSVGElement("line"));E.classList.add("linear-curve"),E.setAttribute("x1",this._controlHandleRadius),E.setAttribute("y1",this._bezierHeight+this._controlHandleRadius),E.setAttribute("x2",this._bezierWidth+this._controlHandleRadius),E.setAttribute("y2",this._controlHandleRadius),this._bezierCurve=T.appendChild(createSVGElement("path")),this._bezierCurve.classList.add("bezier-curve"),this._inControl=_.call(this,0,this._bezierHeight),this._outControl=_.call(this,this._bezierWidth,0),this._numberInputContainer=this._element.createChild("div","number-input-container"),S.call(this,"InX",{min:0,max:1}),S.call(this,"InY"),S.call(this,"OutX",{min:0,max:1}),S.call(this,"OutY"),this._selectedControl=null,this._mouseDownPosition=null,this._bezierContainer.addEventListener("mousedown",this),WebInspector.addWindowKeydownListener(this)}get element(){return this._element}set bezier(_){if(_){var S=_ instanceof WebInspector.CubicBezier;S&&(this._bezier=_,this._updateBezierPreview())}}get bezier(){return this._bezier}removeListeners(){WebInspector.removeWindowKeydownListener(this)}handleEvent(_){switch(_.type){case"mousedown":this._handleMousedown(_);break;case"mousemove":this._handleMousemove(_);break;case"mouseup":this._handleMouseup(_);}}handleKeydownEvent(_){if(!this._selectedControl||!this._element.parentNode)return!1;let S=0,C=0;switch(_.keyCode){case WebInspector.KeyboardShortcut.Key.Up.keyCode:C=-1;break;case WebInspector.KeyboardShortcut.Key.Right.keyCode:S=1;break;case WebInspector.KeyboardShortcut.Key.Down.keyCode:C=1;break;case WebInspector.KeyboardShortcut.Key.Left.keyCode:S=-1;break;default:return!1;}return _.shiftKey&&(S*=10,C*=10),C*=this._bezierWidth/100,S*=this._bezierHeight/100,this._selectedControl.point.x=Number.constrain(this._selectedControl.point.x+S,0,this._bezierWidth),this._selectedControl.point.y+=C,this._updateControl(this._selectedControl),this._updateValue(),!0}_handleMousedown(_){0!==_.button||(window.addEventListener("mousemove",this,!0),window.addEventListener("mouseup",this,!0),this._bezierPreviewContainer.classList.remove("animate"),this._bezierPreviewTiming.classList.remove("animate"),this._updateControlPointsForMouseEvent(_,!0))}_handleMousemove(_){this._updateControlPointsForMouseEvent(_)}_handleMouseup(){this._selectedControl.handle.classList.remove("selected"),this._mouseDownPosition=null,this._triggerPreviewAnimation(),window.removeEventListener("mousemove",this,!0),window.removeEventListener("mouseup",this,!0)}_updateControlPointsForMouseEvent(_,S){var C=WebInspector.Point.fromEventInElement(_,this._bezierContainer);C.x=Number.constrain(C.x-this._controlHandleRadius,0,this._bezierWidth),C.y-=this._controlHandleRadius+this._padding,S&&(this._mouseDownPosition=C,this._selectedControl=this._inControl.point.distance(C)Math.abs(this._mouseDownPosition.y-C.y)?C.y=this._mouseDownPosition.y:C.x=this._mouseDownPosition.x),this._selectedControl.point=C,this._selectedControl.handle.classList.add("selected"),this._updateValue()}_updateValue(){function _(E){return Math.round(100*E)/100}var S=_(this._inControl.point.x/this._bezierWidth),C=_(1-this._inControl.point.y/this._bezierHeight),f=_(this._outControl.point.x/this._bezierWidth),T=_(1-this._outControl.point.y/this._bezierHeight);this._bezier=new WebInspector.CubicBezier(S,C,f,T),this._updateBezier(),this.dispatchEventToListeners(WebInspector.BezierEditor.Event.BezierChanged,{bezier:this._bezier})}_updateBezier(){var _=this._controlHandleRadius,S=this._inControl.point.x+_,C=this._inControl.point.y+_,f=this._outControl.point.x+_,T=this._outControl.point.y+_,E=`M ${_} ${this._bezierHeight+_} C ${S} ${C} ${f} ${T} ${this._bezierWidth+_} ${_}`;this._bezierCurve.setAttribute("d",E),this._updateControl(this._inControl),this._updateControl(this._outControl),this._bezierInXInput.value=this._bezier.inPoint.x,this._bezierInYInput.value=this._bezier.inPoint.y,this._bezierOutXInput.value=this._bezier.outPoint.x,this._bezierOutYInput.value=this._bezier.outPoint.y}_updateControl(_){_.handle.setAttribute("cx",_.point.x+this._controlHandleRadius),_.handle.setAttribute("cy",_.point.y+this._controlHandleRadius),_.line.setAttribute("x2",_.point.x+this._controlHandleRadius),_.line.setAttribute("y2",_.point.y+this._controlHandleRadius)}_updateBezierPreview(){this._inControl.point=new WebInspector.Point(this._bezier.inPoint.x*this._bezierWidth,(1-this._bezier.inPoint.y)*this._bezierHeight),this._outControl.point=new WebInspector.Point(this._bezier.outPoint.x*this._bezierWidth,(1-this._bezier.outPoint.y)*this._bezierHeight),this._updateBezier(),this._triggerPreviewAnimation()}_triggerPreviewAnimation(){this._bezierPreview.style.animationTimingFunction=this._bezier.toString(),this._bezierPreviewContainer.classList.add("animate"),this._bezierPreviewTiming.classList.add("animate")}_resetPreviewAnimation(){var _=this._bezierPreview.parentNode;_.removeChild(this._bezierPreview),_.appendChild(this._bezierPreview),this._element.removeChild(this._bezierPreviewTiming),this._element.appendChild(this._bezierPreviewTiming)}_handleNumberInputInput(_){this._changeBezierForInput(_.target,_.target.value)}_handleNumberInputKeydown(_){let S=0;"Up"===_.keyIdentifier?S=0.01:"Down"===_.keyIdentifier&&(S=-0.01);S&&(_.shiftKey&&(S*=10),_.preventDefault(),this._changeBezierForInput(_.target,parseFloat(_.target.value)+S))}_changeBezierForInput(_,S){switch(S=Math.round(100*S)/100,_){case this._bezierInXInput:this._bezier.inPoint.x=Number.constrain(S,0,1);break;case this._bezierInYInput:this._bezier.inPoint.y=S;break;case this._bezierOutXInput:this._bezier.outPoint.x=Number.constrain(S,0,1);break;case this._bezierOutYInput:this._bezier.outPoint.y=S;break;default:return;}this._updateBezierPreview(),this.dispatchEventToListeners(WebInspector.BezierEditor.Event.BezierChanged,{bezier:this._bezier})}},WebInspector.BezierEditor.Event={BezierChanged:"bezier-editor-bezier-changed"},WebInspector.BoxModelDetailsSectionRow=class extends WebInspector.DetailsSectionRow{constructor(){super(WebInspector.UIString("No Box Model Information")),this.element.classList.add("box-model"),this._nodeStyles=null}get nodeStyles(){return this._nodeStyles}set nodeStyles(_){this._nodeStyles&&this._nodeStyles.computedStyle&&this._nodeStyles.computedStyle.removeEventListener(WebInspector.CSSStyleDeclaration.Event.PropertiesChanged,this._refresh,this),this._nodeStyles=_,this._nodeStyles&&this._nodeStyles.computedStyle&&this._nodeStyles.computedStyle.addEventListener(WebInspector.CSSStyleDeclaration.Event.PropertiesChanged,this._refresh,this),this._refresh()}_refresh(){return this._ignoreNextRefresh?void(this._ignoreNextRefresh=!1):void this._updateMetrics()}_getPropertyValueAsPx(_,S){return+(_.propertyForName(S).value.replace(/px$/,"")||0)}_getBox(_,S){var C=this._getComponentSuffix(S),f=this._getPropertyValueAsPx(_,S+"-left"+C),T=this._getPropertyValueAsPx(_,S+"-top"+C),E=this._getPropertyValueAsPx(_,S+"-right"+C),I=this._getPropertyValueAsPx(_,S+"-bottom"+C);return{left:f,top:T,right:E,bottom:I}}_getComponentSuffix(_){return"border"===_?"-width":""}_highlightDOMNode(_,S,C){C.stopPropagation();var f=_?this.nodeStyles.node.id:0;if(f){if(this._highlightMode===S)return;this._highlightMode=S,WebInspector.domTreeManager.highlightDOMNode(f,S)}else this._highlightMode=null,WebInspector.domTreeManager.hideDOMNodeHighlight();for(var T=0,E;this._boxElements&&TO&&(O=0),D=M+O+P}if(D){var F=document.createTextNode(D);R.deleteContents(),R.insertNode(F);var V=document.createRange();V.setStart(F,0),V.setEnd(F,D.length),T.removeAllRanges(),T.addRange(V),C.handled=!0,C.preventDefault(),this._ignoreNextRefresh=!0,this._applyUserInput(f,D,I,_,!1)}}}}}_editingEnded(_,S){_.removeEventListener("keydown",S.keyDownHandler,!1),this._isEditingMetrics=!1}_editingCancelled(_,S){this._editingEnded(_,S),this._refresh()}_applyUserInput(_,S,C,f,T){if(T&&S===C)return void this._editingCancelled(_,f);"position"===f.box||S&&S!==figureDash?"position"===f.box&&(!S||S===figureDash)&&(S="auto"):S="0px",S=S.toLowerCase(),/^-?(?:\d+(?:\.\d+)?|\.\d+)$/.test(S)&&(S+="px");var I=f.styleProperty,R=this._nodeStyles.computedStyle;if("border-box"===R.propertyForName("box-sizing").value&&("width"===I||"height"===I)){if(!S.match(/px$/))return void console.error("For elements with box-sizing: border-box, only absolute content area dimensions can be applied");var N=this._getBox(R,"border"),L=this._getBox(R,"padding"),D=+S.replace(/px$/,"");if(isNaN(D))return;D+="width"===I?N.left+N.right+L.left+L.right:N.top+N.bottom+L.top+L.bottom,S=D+"px"}WebInspector.RemoteObject.resolveNode(this._nodeStyles.node,"",function(M){M&&(M.callFunction(function(F,V){this.style.setProperty(F,V,"important")},[I,S],!1,function(){this._nodeStyles.refresh()}.bind(this)),M.release())}.bind(this))}_editingCommitted(_,S,C,f){this._editingEnded(_,f),this._applyUserInput(_,S,C,f,!0)}},WebInspector.BreakpointActionView=class extends WebInspector.Object{constructor(_,S,C){super(),this._action=_,this._delegate=S,this._element=document.createElement("div"),this._element.className="breakpoint-action-block";var f=this._element.appendChild(document.createElement("div"));f.className="breakpoint-action-block-header";var T=f.appendChild(document.createElement("select"));for(var E in T.addEventListener("change",this._pickerChanged.bind(this)),WebInspector.BreakpointAction.Type){var I=WebInspector.BreakpointAction.Type[E],R=document.createElement("option");R.textContent=WebInspector.BreakpointActionView.displayStringForType(I),R.selected=this._action.type===I,R.value=I,T.add(R)}let N=f.appendChild(document.createElement("div"));N.classList.add("breakpoint-action-button-container");let L=N.appendChild(document.createElement("button"));L.className="breakpoint-action-append-button",L.addEventListener("click",this._appendActionButtonClicked.bind(this)),L.title=WebInspector.UIString("Add new breakpoint action after this action");let D=N.appendChild(document.createElement("button"));D.className="breakpoint-action-remove-button",D.addEventListener("click",this._removeAction.bind(this)),D.title=WebInspector.UIString("Remove this breakpoint action"),this._bodyElement=this._element.appendChild(document.createElement("div")),this._bodyElement.className="breakpoint-action-block-body",this._updateBody(C)}static displayStringForType(_){return _===WebInspector.BreakpointAction.Type.Log?WebInspector.UIString("Log Message"):_===WebInspector.BreakpointAction.Type.Evaluate?WebInspector.UIString("Evaluate JavaScript"):_===WebInspector.BreakpointAction.Type.Sound?WebInspector.UIString("Play Sound"):_===WebInspector.BreakpointAction.Type.Probe?WebInspector.UIString("Probe Expression"):""}get action(){return this._action}get element(){return this._element}_pickerChanged(_){var S=_.target.value;this._action=this._action.breakpoint.recreateAction(S,this._action),this._updateBody(),this._delegate.breakpointActionViewResized(this)}_appendActionButtonClicked(){var S=this._action.breakpoint.createAction(this._action.type,this._action);this._delegate.breakpointActionViewAppendActionView(this,S)}_removeAction(){this._action.breakpoint.removeAction(this._action),this._delegate.breakpointActionViewRemoveActionView(this)}_updateBody(_){switch(this._bodyElement.removeChildren(),this._action.type){case WebInspector.BreakpointAction.Type.Log:this._bodyElement.hidden=!1;var S=this._bodyElement.appendChild(document.createElement("input"));S.placeholder=WebInspector.UIString("Message"),S.addEventListener("change",this._logInputChanged.bind(this)),S.value=this._action.data||"",S.spellcheck=!1,_||setTimeout(function(){S.focus()},0);var C=this._bodyElement.appendChild(document.createElement("div"));C.classList.add("description"),C.setAttribute("dir","ltr"),C.textContent=WebInspector.UIString("${expr} = expression");break;case WebInspector.BreakpointAction.Type.Evaluate:case WebInspector.BreakpointAction.Type.Probe:this._bodyElement.hidden=!1;var f=this._bodyElement.appendChild(document.createElement("div"));f.classList.add("breakpoint-action-eval-editor"),f.classList.add(WebInspector.SyntaxHighlightedStyleClassName),this._codeMirror=WebInspector.CodeMirrorEditor.create(f,{lineWrapping:!0,mode:"text/javascript",indentWithTabs:!0,indentUnit:4,matchBrackets:!0,value:this._action.data||""}),this._codeMirror.on("viewportChange",this._codeMirrorViewportChanged.bind(this)),this._codeMirror.on("blur",this._codeMirrorBlurred.bind(this)),this._codeMirrorViewport={from:null,to:null};var T=new WebInspector.CodeMirrorCompletionController(this._codeMirror);T.addExtendedCompletionProvider("javascript",WebInspector.javaScriptRuntimeCompletionProvider),setTimeout(()=>{this._codeMirror.refresh(),_||this._codeMirror.focus()},0);break;case WebInspector.BreakpointAction.Type.Sound:this._bodyElement.hidden=!0;break;default:this._bodyElement.hidden=!0;}}_logInputChanged(_){this._action.data=_.target.value}_codeMirrorBlurred(){this._action.data=(this._codeMirror.getValue()||"").trim()}_codeMirrorViewportChanged(_,S,C){this._codeMirrorViewport.from===S&&this._codeMirrorViewport.to===C||(this._codeMirrorViewport.from=S,this._codeMirrorViewport.to=C,this._delegate.breakpointActionViewResized(this))}},WebInspector.BreakpointTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_,S,C){S||(S=WebInspector.BreakpointTreeElement.GenericLineIconStyleClassName),super(["breakpoint",S],C,null,_,!1),this._breakpoint=_,this._probeSet=null,this._listenerSet=new WebInspector.EventListenerSet(this,"BreakpointTreeElement listeners"),C||this._listenerSet.register(_,WebInspector.Breakpoint.Event.LocationDidChange,this._breakpointLocationDidChange),this._listenerSet.register(_,WebInspector.Breakpoint.Event.DisabledStateDidChange,this._updateStatus),this._listenerSet.register(_,WebInspector.Breakpoint.Event.AutoContinueDidChange,this._updateStatus),this._listenerSet.register(_,WebInspector.Breakpoint.Event.ResolvedStateDidChange,this._updateStatus),this._listenerSet.register(WebInspector.debuggerManager,WebInspector.DebuggerManager.Event.BreakpointsEnabledDidChange,this._updateStatus),this._listenerSet.register(WebInspector.probeManager,WebInspector.ProbeManager.Event.ProbeSetAdded,this._probeSetAdded),this._listenerSet.register(WebInspector.probeManager,WebInspector.ProbeManager.Event.ProbeSetRemoved,this._probeSetRemoved),this._statusImageElement=document.createElement("img"),this._statusImageElement.className=WebInspector.BreakpointTreeElement.StatusImageElementStyleClassName,this._listenerSet.register(this._statusImageElement,"mousedown",this._statusImageElementMouseDown),this._listenerSet.register(this._statusImageElement,"click",this._statusImageElementClicked),C||this._updateTitles(),this._updateStatus(),this.status=this._statusImageElement,this._iconAnimationLayerElement=document.createElement("span"),this.iconElement.appendChild(this._iconAnimationLayerElement)}get breakpoint(){return this._breakpoint}get filterableData(){return{text:[this.breakpoint.contentIdentifier]}}ondelete(){return!!WebInspector.debuggerManager.isBreakpointRemovable(this._breakpoint)&&(this.__deletedViaDeleteKeyboardShortcut=!0,WebInspector.debuggerManager.removeBreakpoint(this._breakpoint),!0)}onenter(){return this._breakpoint.cycleToNextMode(),!0}onspace(){return this._breakpoint.cycleToNextMode(),!0}onattach(){super.onattach(),this._listenerSet.install();for(var _ of WebInspector.probeManager.probeSets)_.breakpoint===this._breakpoint&&this._addProbeSet(_)}ondetach(){super.ondetach(),this._listenerSet.uninstall(),this._probeSet&&this._removeProbeSet(this._probeSet)}populateContextMenu(_,S){WebInspector.breakpointPopoverController.appendContextMenuItems(_,this._breakpoint,this._statusImageElement),super.populateContextMenu(_,S)}removeStatusImage(){this._statusImageElement.remove(),this._statusImageElement=null}_updateTitles(){var _=this._breakpoint.sourceCodeLocation,S=_.displayLineNumber,C=_.displayColumnNumber;this.mainTitle=0{this.element.classList.remove(WebInspector.BreakpointTreeElement.ProbeDataUpdatedStyleClassName)},WebInspector.BreakpointTreeElement.ProbeDataUpdatedAnimationDuration))}_breakpointLocationDidChange(_){_.data.oldDisplaySourceCode===this._breakpoint.displaySourceCode||this._updateTitles()}_statusImageElementMouseDown(_){_.stopPropagation()}_statusImageElementClicked(){this._breakpoint.cycleToNextMode()}},WebInspector.BreakpointTreeElement.GenericLineIconStyleClassName="breakpoint-generic-line-icon",WebInspector.BreakpointTreeElement.StatusImageElementStyleClassName="status-image",WebInspector.BreakpointTreeElement.StatusImageResolvedStyleClassName="resolved",WebInspector.BreakpointTreeElement.StatusImageAutoContinueStyleClassName="auto-continue",WebInspector.BreakpointTreeElement.StatusImageDisabledStyleClassName="disabled",WebInspector.BreakpointTreeElement.FormattedLocationStyleClassName="formatted-location",WebInspector.BreakpointTreeElement.ProbeDataUpdatedStyleClassName="data-updated",WebInspector.BreakpointTreeElement.ProbeDataUpdatedAnimationDuration=400,WebInspector.ButtonToolbarItem=class extends WebInspector.ButtonNavigationItem{constructor(_,S,C,f,T){super(_,S,f,16,16,T),"string"==typeof C&&(this._labelElement=document.createElement("div"),this._labelElement.className=WebInspector.ButtonToolbarItem.LabelStyleClassName,this._element.appendChild(this._labelElement),this.label=C)}get label(){return this._labelElement.textContent}set label(_){_&&this._labelElement&&(this._labelElement.textContent=_)}},WebInspector.ButtonToolbarItem.LabelStyleClassName="label",WebInspector.CSSStyleDeclarationSection=class extends WebInspector.Object{constructor(_,S){if(super(),this._delegate=_||null,this._style=S||null,this._selectorElements=[],this._ruleDisabled=!1,this._hasInvalidSelector=!1,this._element=document.createElement("div"),this._element.classList.add("style-declaration-section"),new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl,"S",this._save.bind(this),this._element),new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl|WebInspector.KeyboardShortcut.Modifier.Shift,"S",this._save.bind(this),this._element),this._headerElement=document.createElement("div"),this._headerElement.classList.add("header"),!S.editable){let f=this._headerElement.createChild("img","locked-icon"),T;T=S.ownerRule&&S.ownerRule.type===WebInspector.CSSStyleSheet.Type.UserAgent?WebInspector.UIString("User Agent Stylesheet"):WebInspector.UIString("Style rule"),f.title=WebInspector.UIString("%s cannot be modified").format(T)}this._iconElement=this._headerElement.createChild("img","icon"),this.selectorEditable&&(this._selectorInput=this._headerElement.createChild("textarea"),this._selectorInput.spellcheck=!1,this._selectorInput.dir="ltr",this._selectorInput.tabIndex=-1,this._selectorInput.addEventListener("mouseover",this._handleMouseOver.bind(this)),this._selectorInput.addEventListener("mousemove",this._handleMouseMove.bind(this)),this._selectorInput.addEventListener("mouseout",this._handleMouseOut.bind(this)),this._selectorInput.addEventListener("keydown",this._handleKeyDown.bind(this)),this._selectorInput.addEventListener("keypress",this._handleKeyPress.bind(this)),this._selectorInput.addEventListener("input",this._handleInput.bind(this)),this._selectorInput.addEventListener("paste",this._handleSelectorPaste.bind(this)),this._selectorInput.addEventListener("blur",this._handleBlur.bind(this))),this._selectorElement=this._headerElement.createChild("span","selector"),this.selectorEditable||(this._selectorElement.addEventListener("mouseover",this._handleMouseOver.bind(this)),this._selectorElement.addEventListener("mouseout",this._handleMouseOut.bind(this))),this._originElement=this._headerElement.createChild("span","origin"),this._propertiesElement=document.createElement("div"),this._propertiesElement.classList.add("properties"),this._editorActive=!1,this._propertiesTextEditor=new WebInspector.CSSStyleDeclarationTextEditor(this,S),this._propertiesTextEditor.addEventListener(WebInspector.CSSStyleDeclarationTextEditor.Event.ContentChanged,this._editorContentChanged.bind(this)),this._propertiesTextEditor.addEventListener(WebInspector.CSSStyleDeclarationTextEditor.Event.Blurred,this._editorBlurred.bind(this)),this._propertiesElement.appendChild(this._propertiesTextEditor.element),this._element.appendChild(this._headerElement),this._element.appendChild(this._propertiesElement);let C=null;switch(S.type){case WebInspector.CSSStyleDeclaration.Type.Rule:S.inherited?C=WebInspector.CSSStyleDeclarationSection.InheritedStyleRuleIconStyleClassName:S.ownerRule.type===WebInspector.CSSStyleSheet.Type.Author?C=WebInspector.CSSStyleDeclarationSection.AuthorStyleRuleIconStyleClassName:S.ownerRule.type===WebInspector.CSSStyleSheet.Type.User?C=WebInspector.CSSStyleDeclarationSection.UserStyleRuleIconStyleClassName:S.ownerRule.type===WebInspector.CSSStyleSheet.Type.UserAgent?C=WebInspector.CSSStyleDeclarationSection.UserAgentStyleRuleIconStyleClassName:S.ownerRule.type===WebInspector.CSSStyleSheet.Type.Inspector&&(C=WebInspector.CSSStyleDeclarationSection.InspectorStyleRuleIconStyleClassName);break;case WebInspector.CSSStyleDeclaration.Type.Inline:case WebInspector.CSSStyleDeclaration.Type.Attribute:C=S.inherited?WebInspector.CSSStyleDeclarationSection.InheritedElementStyleRuleIconStyleClassName:WebInspector.DOMTreeElementPathComponent.DOMElementIconStyleClassName;}S.editable&&(this._iconElement.classList.add("toggle-able"),this._iconElement.title=WebInspector.UIString("Comment All Properties"),this._iconElement.addEventListener("click",this._handleIconElementClicked.bind(this))),this._element.classList.add(C),S.editable?S.ownerRule?this._style.ownerRule.addEventListener(WebInspector.CSSRule.Event.SelectorChanged,this._updateSelectorIcon.bind(this)):this._element.classList.add(WebInspector.CSSStyleDeclarationSection.SelectorLockedStyleClassName):this._element.classList.add(WebInspector.CSSStyleDeclarationSection.LockedStyleClassName),this.refresh(),this._headerElement.addEventListener("contextmenu",this._handleContextMenuEvent.bind(this))}get element(){return this._element}get style(){return this._style}get lastInGroup(){return this._element.classList.contains(WebInspector.CSSStyleDeclarationSection.LastInGroupStyleClassName)}set lastInGroup(_){_?this._element.classList.add(WebInspector.CSSStyleDeclarationSection.LastInGroupStyleClassName):this._element.classList.remove(WebInspector.CSSStyleDeclarationSection.LastInGroupStyleClassName)}get focused(){return this._propertiesTextEditor.focused}focus(){this._propertiesTextEditor.focus()}refresh(){function _(C,f){let T=document.createElement("span");T.textContent=C.text,f&&T.classList.add(WebInspector.CSSStyleDeclarationSection.MatchedSelectorElementStyleClassName);let E=C.specificity;if(E){let I=WebInspector.UIString("Specificity: (%d, %d, %d)").format(E[0],E[1],E[2]);C.dynamic&&(I+="\n",I+=this._style.inherited?WebInspector.UIString("Dynamically calculated for the parent element"):WebInspector.UIString("Dynamically calculated for the selected element")),T.title=I}else if(C.dynamic){let I=WebInspector.UIString("Specificity: No value for selected element");I+="\n",I+=WebInspector.UIString("Dynamically calculated for the selected element and did not match"),T.title=I}this._selectorElement.appendChild(T),this._selectorElements.push(T)}function S(C){let f=document.createElement("span");f.textContent=C,f.classList.add(WebInspector.CSSStyleDeclarationSection.MatchedSelectorElementStyleClassName),this._selectorElement.appendChild(f)}switch(this._selectorElement.removeChildren(),this._originElement.removeChildren(),this._selectorElements=[],this._originElement.append(` ${emDash} `),this._style.type){case WebInspector.CSSStyleDeclaration.Type.Rule:let C=this._style.ownerRule.selectors,f=this._style.ownerRule.matchedSelectorIndices,T=!f.length;if(C.length){let E=!1;for(let I=0;I{InspectorFrontendHost.copyText(this._style.generateCSSRuleString())}),!this._style.inherited)&&(S.appendItem(WebInspector.UIString("Duplicate Selector"),()=>{if(this._delegate&&"function"==typeof this._delegate.focusEmptySectionWithStyle){let C=this._style.nodeStyles.rulesForSelector(this._currentSelectorText);for(let f of C)if(this._delegate.focusEmptySectionWithStyle(f.style))return}this._style.nodeStyles.addRule(this._currentSelectorText)}),!WebInspector.CSSStyleManager.PseudoElementNames.some(C=>this._style.selectorText.includes(":"+C)))){if(WebInspector.CSSStyleManager.ForceablePseudoClasses.every(C=>!this._style.selectorText.includes(":"+C))){S.appendSeparator();for(let C of WebInspector.CSSStyleManager.ForceablePseudoClasses)if("visited"!==C||"A"===this._style.node.nodeName()){let oe=":"+C;S.appendItem(WebInspector.UIString("Add %s Rule").format(oe),()=>{this._style.node.setPseudoClassEnabled(C,!0);let se;se=this._style.ownerRule?this._style.ownerRule.selectors.map(de=>de.text+oe).join(", "):this._currentSelectorText+oe,this._style.nodeStyles.addRule(se)})}}S.appendSeparator();for(let C of WebInspector.CSSStyleManager.PseudoElementNames){let f="::"+C;let E=null;if(this._delegate&&"function"==typeof this._delegate.sectionForStyle){let R=this._style.nodeStyles.rulesForSelector(this._currentSelectorText+f);R.length&&(E=this._delegate.sectionForStyle(R[0].style))}let I=E?WebInspector.UIString("Focus %s Rule"):WebInspector.UIString("Create %s Rule");S.appendItem(I.format(f),()=>{if(E)return void E.focus();let R;R=this._style.ownerRule?this._style.ownerRule.selectors.map(N=>N.text+f).join(", "):this._currentSelectorText+f,this._style.nodeStyles.addRule(R,"content: \"\";")})}}}}_handleIconElementClicked(){return this._hasInvalidSelector?void this.refresh():void(this._ruleDisabled=this._ruleDisabled?!this._propertiesTextEditor.uncommentAllProperties():this._propertiesTextEditor.commentAllProperties(),this._iconElement.title=this._ruleDisabled?WebInspector.UIString("Uncomment All Properties"):WebInspector.UIString("Comment All Properties"),this._element.classList.toggle("rule-disabled",this._ruleDisabled))}_highlightNodesWithSelector(){return this._style.ownerRule?void WebInspector.domTreeManager.highlightSelector(this._currentSelectorText,this._style.node.ownerDocument.frameIdentifier):void WebInspector.domTreeManager.highlightDOMNode(this._style.node.id)}_hideDOMNodeHighlight(){WebInspector.domTreeManager.hideDOMNodeHighlight()}_handleMouseOver(){this._highlightNodesWithSelector()}_handleMouseMove(_){if(!this._hasInvalidSelector){for(let S of this._selectorElements){let{top:C,right:f,bottom:T,left:E}=S.getBoundingClientRect();if(_.clientX>=E&&_.clientX<=f&&_.clientY>=C&&_.clientY<=T)return void(this._selectorInput.title=S.title)}this._selectorInput.title=""}}_handleMouseOut(){this._hideDOMNodeHighlight()}_save(_){if(_.preventDefault(),_.stopPropagation(),this._style.type!==WebInspector.CSSStyleDeclaration.Type.Rule)return void InspectorFrontendHost.beep();let S=this._style.ownerRule.sourceCodeLocation.sourceCode;if(S.type!==WebInspector.Resource.Type.Stylesheet)return void InspectorFrontendHost.beep();var C;if("data"===S.urlComponents.scheme){let T=WebInspector.frameResourceManager.mainFrame.mainResource,E=T.url.slice(0,-T.urlComponents.lastPathComponent.length);C=E+"base64.css"}else C=S.url;const f=_.shiftKey;WebInspector.saveDataToFile({url:C,content:S.content},f)}_handleKeyDown(_){return _.keyCode===WebInspector.KeyboardShortcut.Key.Enter.keyCode?(_.preventDefault(),void this.focus()):_.keyCode===WebInspector.KeyboardShortcut.Key.Tab.keyCode?_.shiftKey&&this._delegate&&"function"==typeof this._delegate.cssStyleDeclarationSectionEditorPreviousRule?(_.preventDefault(),void this._delegate.cssStyleDeclarationSectionEditorPreviousRule(this,!0)):_.metaKey?void 0:(_.preventDefault(),this.focus(),void this._propertiesTextEditor.selectFirstProperty()):void this._highlightNodesWithSelector()}_handleKeyPress(_){_.altGraphKey||_.altKey||_.ctrlKey||_.metaKey||this._selectorElement.append(String.fromCharCode(_.keyCode))}_handleInput(){this._selectorElement.textContent=this._selectorInput.value,this._highlightNodesWithSelector()}_handleBlur(_){this._hideDOMNodeHighlight();let S=this._currentSelectorText.trim();return S?void(_.relatedTarget&&_.relatedTarget.isDescendant(this.element)&&(this._editorActive=!0,this.focus()),this._style.ownerRule.selectorText=S):void this.refresh()}_updateSelectorIcon(_){if(this._style.ownerRule&&this._style.editable)return this._hasInvalidSelector=_&&_.data&&!_.data.valid,this._element.classList.toggle("invalid-selector",!!this._hasInvalidSelector),this._hasInvalidSelector?(this._iconElement.title=WebInspector.UIString("The selector \u201C%s\u201D is invalid.\nClick to revert to the previous selector.").format(this._selectorElement.textContent.trim()),void(this._selectorInput.title=WebInspector.UIString("Using previous selector \u201C%s\u201D").format(this._style.ownerRule.selectorText))):void(this._iconElement.title=this._ruleDisabled?WebInspector.UIString("Uncomment All Properties"):WebInspector.UIString("Comment All Properties"),this._selectorInput.title="")}_editorContentChanged(){this._editorActive=!0}_editorBlurred(){this._editorActive=!1,this.dispatchEventToListeners(WebInspector.CSSStyleDeclarationSection.Event.Blurred)}},WebInspector.CSSStyleDeclarationSection.Event={Blurred:"css-style-declaration-sections-blurred"},WebInspector.CSSStyleDeclarationSection.LockedStyleClassName="locked",WebInspector.CSSStyleDeclarationSection.SelectorLockedStyleClassName="selector-locked",WebInspector.CSSStyleDeclarationSection.LastInGroupStyleClassName="last-in-group",WebInspector.CSSStyleDeclarationSection.MatchedSelectorElementStyleClassName="matched",WebInspector.CSSStyleDeclarationSection.PseudoElementSelectorStyleClassName="pseudo-element-selector",WebInspector.CSSStyleDeclarationSection.AuthorStyleRuleIconStyleClassName="author-style-rule-icon",WebInspector.CSSStyleDeclarationSection.UserStyleRuleIconStyleClassName="user-style-rule-icon",WebInspector.CSSStyleDeclarationSection.UserAgentStyleRuleIconStyleClassName="user-agent-style-rule-icon",WebInspector.CSSStyleDeclarationSection.InspectorStyleRuleIconStyleClassName="inspector-style-rule-icon",WebInspector.CSSStyleDeclarationSection.InheritedStyleRuleIconStyleClassName="inherited-style-rule-icon",WebInspector.CSSStyleDeclarationSection.InheritedElementStyleRuleIconStyleClassName="inherited-element-style-rule-icon",WebInspector.CSSStyleDeclarationTextEditor=class extends WebInspector.View{constructor(_,S){super(),this.element.classList.add(WebInspector.CSSStyleDeclarationTextEditor.StyleClassName),this.element.classList.add(WebInspector.SyntaxHighlightedStyleClassName),this.element.addEventListener("mousedown",this._handleMouseDown.bind(this),!0),this.element.addEventListener("mouseup",this._handleMouseUp.bind(this)),this._mouseDownCursorPosition=null,this._propertyVisibilityMode=WebInspector.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.ShowAll,this._showsImplicitProperties=!0,this._alwaysShowPropertyNames={},this._filterResultPropertyNames=null,this._sortProperties=!1,this._hasActiveInlineSwatchEditor=!1,this._linePrefixWhitespace="",this._delegate=_||null,this._codeMirror=WebInspector.CodeMirrorEditor.create(this.element,{readOnly:!0,lineWrapping:!0,mode:"css-rule",electricChars:!1,indentWithTabs:!1,indentUnit:4,smartIndent:!1,matchBrackets:!0,autoCloseBrackets:!0}),this._codeMirror.addKeyMap({Enter:this._handleEnterKey.bind(this),"Shift-Enter":this._insertNewlineAfterCurrentLine.bind(this),"Shift-Tab":this._handleShiftTabKey.bind(this),Tab:this._handleTabKey.bind(this)}),this._completionController=new WebInspector.CodeMirrorCompletionController(this._codeMirror,this),this._tokenTrackingController=new WebInspector.CodeMirrorTokenTrackingController(this._codeMirror,this),this._completionController.noEndingSemicolon=!0,this._jumpToSymbolTrackingModeEnabled=!1,this._tokenTrackingController.classNameForHighlightedRange=WebInspector.CodeMirrorTokenTrackingController.JumpToSymbolHighlightStyleClassName,this._tokenTrackingController.mouseOverDelayDuration=0,this._tokenTrackingController.mouseOutReleaseDelayDuration=0,this._tokenTrackingController.mode=WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens,this._codeMirror.on("change",this._contentChanged.bind(this)),this._codeMirror.on("blur",this._editorBlured.bind(this)),this._codeMirror.on("beforeChange",this._handleBeforeChange.bind(this)),"function"==typeof this._delegate.cssStyleDeclarationTextEditorFocused&&this._codeMirror.on("focus",this._editorFocused.bind(this)),this.style=S,this._shownProperties=[],WebInspector.settings.stylesShowInlineWarnings.addEventListener(WebInspector.Setting.Event.Changed,this.refresh,this)}get delegate(){return this._delegate}set delegate(_){this._delegate=_||null}get style(){return this._style}set style(_){this._style===_||(this._style&&(this._style.removeEventListener(WebInspector.CSSStyleDeclaration.Event.PropertiesChanged,this._propertiesChanged,this),WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange,this._updateJumpToSymbolTrackingMode,this)),this._style=_||null,this._style&&(this._style.addEventListener(WebInspector.CSSStyleDeclaration.Event.PropertiesChanged,this._propertiesChanged,this),WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange,this._updateJumpToSymbolTrackingMode,this)),this._updateJumpToSymbolTrackingMode(),this._resetContent())}get shownProperties(){return this._shownProperties}get focused(){return this._codeMirror.getWrapperElement().classList.contains("CodeMirror-focused")}get alwaysShowPropertyNames(){return Object.keys(this._alwaysShowPropertyNames)}set alwaysShowPropertyNames(_){this._alwaysShowPropertyNames=(_||[]).keySet(),this._resetContent()}get propertyVisibilityMode(){return this._propertyVisibilityMode}set propertyVisibilityMode(_){this._propertyVisibilityMode===_||(this._propertyVisibilityMode=_,this._resetContent())}get showsImplicitProperties(){return this._showsImplicitProperties}set showsImplicitProperties(_){this._showsImplicitProperties===_||(this._showsImplicitProperties=_,this._resetContent())}get sortProperties(){return this._sortProperties}set sortProperties(_){this._sortProperties===_||(this._sortProperties=_,this._resetContent())}focus(){this._codeMirror.focus()}refresh(){this._resetContent()}highlightProperty(_){function S(E){return E.enabled&&!E.overridden&&(E.canonicalName===_.canonicalName||C(E))}function C(E){var I=E.relatedLonghandProperties;if(!I.length)return!1;for(var R of I)if(S(R))return!0;return!1}for(var f of this.style.properties)if(S(f)){var T=f.__propertyTextMarker.find();return this._codeMirror.setSelection(T.from,T.to),this.focus(),!0}return!1}clearSelection(){this._codeMirror.setCursor({line:0,ch:0})}findMatchingProperties(_){if(!_)return this.resetFilteredProperties(),!1;var S=this._style.visibleProperties.length?this._style.visibleProperties:this._style.properties,C=[];for(var f of S)C.push(f.text.includes(_));if(!C.includes(!0))return this.resetFilteredProperties(),!1;for(var T=0,f;TC||this._textAtCursorIsComment(this._codeMirror,f)?S.length:C})}selectLastProperty(){var _=this._codeMirror.lineCount()-1,S=this._codeMirror.getLine(_),C=S.trimRight(),f,T;if(this._textAtCursorIsComment(this._codeMirror,{line:_,ch:_.length}))f=0,T=_.length;else{var E=/(?::\s*)/.exec(S);f=E?E.index+E[0].length:0,T=C.length-C.endsWith(";")}this._codeMirror.setSelection({line:_,ch:f},{line:_,ch:T})}completionControllerCompletionsHidden(){var S=this._style.text,C=this._formattedContent();S===C?this._propertiesChanged():this._commitChanges()}completionControllerCompletionsNeeded(_,S,C){let I=this._style.nodeStyles.computedStyle.properties,R=I.filter(L=>L.variable&&L.name.startsWith(S)),N=R.map(L=>L.name);_.updateCompletions(C.concat(N))}layout(){this._codeMirror.refresh()}_textAtCursorIsComment(_,S){var C=_.getTokenTypeAt(S);return C&&C.includes("comment")}_highlightNextNameOrValue(_,S,C){let f=this._rangeForNextNameOrValue(_,S,C);_.setSelection(f.from,f.to)}_rangeForNextNameOrValue(_,S,C){let f=0,T=0;if(this._textAtCursorIsComment(_,S))T=C.length;else{let E=WebInspector.rangeForNextCSSNameOrValue(C,S.ch);f=E.from,T=E.to}return{from:{line:S.line,ch:f},to:{line:S.line,ch:T}}}_handleMouseDown(_){if(!this._codeMirror.options.readOnly){let S=this._codeMirror.coordsChar({left:_.x,top:_.y}),C=this._codeMirror.getLine(S.line);C.trim().length&&(this._mouseDownCursorPosition=S,this._mouseDownCursorPosition.previousRange={from:this._codeMirror.getCursor("from"),to:this._codeMirror.getCursor("to")})}}_handleMouseUp(_){if(!this._codeMirror.options.readOnly&&this._mouseDownCursorPosition){let S=this._codeMirror.coordsChar({left:_.x,top:_.y}),C=!1;for(let f of this._codeMirror.findMarksAt(S))if("bookmark"===f.type&&f.replacedWith===_.target){let le=f.find();if(le.line===S.line&&1>=Math.abs(le.ch-S.ch)){C=!0;break}}if(!C&&this._mouseDownCursorPosition.line===S.line&&this._mouseDownCursorPosition.ch===S.ch){let f=this._codeMirror.getLine(S.line);if(S.ch===f.trimRight().length){let T=this._codeMirror.getLine(S.line+1);if(WebInspector.settings.stylesInsertNewline.value&&S.line=this._mouseDownCursorPosition.previousRange.from.ch&&S.ch<=this._mouseDownCursorPosition.previousRange.to.ch,R=this._mouseDownCursorPosition.previousRange.from.ch>=T.from.ch&&this._mouseDownCursorPosition.previousRange.to.ch<=T.to.ch;this._codeMirror.hasFocus()&&!E&&(I||R)||this._codeMirror.setSelection(T.from,T.to)}}this._mouseDownCursorPosition=null}}_handleBeforeChange(_,S){if("+delete"!==S.origin||this._completionController.isShowingCompletions())return CodeMirror.Pass;if(!S.to.line&&!S.to.ch){if(1===_.lineCount())return CodeMirror.Pass;var C=_.getLine(S.to.line);return C&&C.trim().length?CodeMirror.Pass:void _.execCommand("deleteLine")}var f=_.findMarksAt(S.to);if(!f.length)return CodeMirror.Pass;for(var T of f)T.clear()}_handleEnterKey(_){var S=_.getCursor(),C=_.getLine(S.line),f=C.trimRight(),T=f.endsWith(";");if(!f.trimLeft().length)return CodeMirror.Pass;if(T&&S.ch===f.length-1&&++S.ch,S.ch===f.length){var E="\n";return T||this._textAtCursorIsComment(this._codeMirror,S)||(E=";"+E),void this._codeMirror.replaceRange(E,S)}return CodeMirror.Pass}_insertNewlineAfterCurrentLine(_){var S=_.getCursor(),C=_.getLine(S.line),f=C.trimRight();if(S.ch=f.length,S.ch){var T="\n";return f.endsWith(";")||this._textAtCursorIsComment(this._codeMirror,S)||(T=";"+T),void this._codeMirror.replaceRange(T,S)}return CodeMirror.Pass}_handleShiftTabKey(_){function S(){return this._delegate&&"function"==typeof this._delegate.cssStyleDeclarationTextEditorSwitchRule?void this._delegate.cssStyleDeclarationTextEditorSwitchRule(!0):CodeMirror.Pass}let C=_.getCursor(),f=_.getLine(C.line),T=_.getLine(C.line-1);if(!f&&!T&&!C.line)return S.call(this);let E=T?T.trimRight():"",I=0,R=f.length,N=this._textAtCursorIsComment(_,C);if(C.ch===f.indexOf(":")||0>f.indexOf(":")||N){if(T){if(--C.line,R=E.length,!this._textAtCursorIsComment(_,C)){let L=/(?::\s*)/.exec(T);I=L?L.index+L[0].length:0,E.includes(";")&&(R=E.lastIndexOf(";"))}return void _.setSelection({line:C.line,ch:I},{line:C.line,ch:R})}return C.line?void _.setCursor(C.line-1,0):S.call(this)}if(!N){let L=/(?:[^:;\s]\s*)+/.exec(f);I=L.index,R=I+L[0].length}_.setSelection({line:C.line,ch:I},{line:C.line,ch:R})}_handleTabKey(_){let C=_.getCursor(),f=_.getLine(C.line),T=f.trimRight(),E=C.line===_.lineCount()-1,I=_.getLine(C.line+1),R=I?I.trimRight():"";if(!T.trimLeft().length)return E?function(){return this._delegate&&"function"==typeof this._delegate.cssStyleDeclarationTextEditorSwitchRule?void this._delegate.cssStyleDeclarationTextEditorSwitchRule():CodeMirror.Pass}.call(this):R.trimLeft().length?(++C.line,void this._highlightNextNameOrValue(_,C,I)):void _.setCursor(C.line+1,0);if(T.endsWith(":"))return _.setCursor(C.line,f.length),void this._completionController._completeAtCurrentPosition(!0);let N=T.endsWith(";"),L=f.includes(";")&&C.ch>=f.lastIndexOf(";");return C.ch>=f.trimRight().length-N||L?void this._completionController.completeAtCurrentPositionIfNeeded().then(function(D){if(D===WebInspector.CodeMirrorCompletionController.UpdatePromise.NoCompletionsFound){let M="";return N||L||this._textAtCursorIsComment(_,C)||(M+=";"),E&&(M+="\n"),M.length&&_.replaceRange(M,{line:C.line,ch:T.length}),I?void this._highlightNextNameOrValue(_,{line:C.line+1,ch:0},I):void _.setCursor(C.line+1,0)}}.bind(this)):void this._highlightNextNameOrValue(_,C,f)}_clearRemoveEditingLineClassesTimeout(){this._removeEditingLineClassesTimeout&&(clearTimeout(this._removeEditingLineClassesTimeout),delete this._removeEditingLineClassesTimeout)}_removeEditingLineClasses(){this._clearRemoveEditingLineClassesTimeout(),this._codeMirror.operation(function(){for(var S=this._codeMirror.lineCount(),C=0;C{this._createCommentedCheckboxMarker(C)}),this._createInlineSwatches(!0),this._markLinesWithCheckboxPlaceholder()}_?S.call(this):this._codeMirror.operation(S.bind(this))}_createCommentedCheckboxMarker(_){var S=_.lineNo();if(S||!isNaN(S)){let C=/\/\*\s*[-\w]+\s*\:\s*(?:(?:\".*\"|url\(.+\)|[^;])\s*)+;?\s*\*\//g;var f=C.exec(_.text);if(f)for(;f;){var T=document.createElement("input");T.type="checkbox",T.checked=!1,T.addEventListener("change",this._propertyCommentCheckboxChanged.bind(this));var E={line:S,ch:f.index},I={line:S,ch:f.index+f[0].length},R=this._codeMirror.setUniqueBookmark(E,T);R.__propertyCheckbox=!0;var N=this._codeMirror.markText(E,I);T.__commentTextMarker=N,f=C.exec(_.text)}}}_createInlineSwatches(_,S){function C(T,E){T.addEventListener(WebInspector.InlineSwatch.Event.ValueChanged,this._inlineSwatchValueChanged,this),T.addEventListener(WebInspector.InlineSwatch.Event.Activated,this._inlineSwatchActivated,this),T.addEventListener(WebInspector.InlineSwatch.Event.Deactivated,this._inlineSwatchDeactivated,this);let N=E.codeMirrorTextMarker,L=N.find();this._codeMirror.setUniqueBookmark(L.from,T.element),T.__textMarker=N,T.__textMarkerRange=L}function f(){let T="number"==typeof S?new WebInspector.TextRange(S,0,S+1,0):null;createCodeMirrorColorTextMarkers(this._codeMirror,T,(E,I,R)=>{let N=new WebInspector.InlineSwatch(WebInspector.InlineSwatch.Type.Color,I,this._codeMirror.getOption("readOnly"));C.call(this,N,E,I,R)}),createCodeMirrorGradientTextMarkers(this._codeMirror,T,(E,I,R)=>{let N=new WebInspector.InlineSwatch(WebInspector.InlineSwatch.Type.Gradient,I,this._codeMirror.getOption("readOnly"));C.call(this,N,E,I,R)}),createCodeMirrorCubicBezierTextMarkers(this._codeMirror,T,(E,I,R)=>{let N=new WebInspector.InlineSwatch(WebInspector.InlineSwatch.Type.Bezier,I,this._codeMirror.getOption("readOnly"));C.call(this,N,E,I,R)}),createCodeMirrorSpringTextMarkers(this._codeMirror,T,(E,I,R)=>{let N=new WebInspector.InlineSwatch(WebInspector.InlineSwatch.Type.Spring,I,this._codeMirror.getOption("readOnly"));C.call(this,N,E,I,R)}),createCodeMirrorVariableTextMarkers(this._codeMirror,T,(E,I,R)=>{let L=this._style.nodeStyles.computedStyle.propertyForName(R,!0);if(!L){let P={line:E.range.startLine,ch:E.range.startColumn},O={line:E.range.endLine,ch:E.range.endColumn};if(this._codeMirror.markText(P,O,{className:"invalid"}),WebInspector.settings.stylesShowInlineWarnings.value){let F=document.createElement("button");F.classList.add("invalid-warning-marker","clickable"),F.title=WebInspector.UIString("The variable \u201C%s\u201D does not exist.\nClick to delete and open autocomplete.").format(R),F.addEventListener("click",()=>{this._codeMirror.replaceRange("",P,O),this._codeMirror.setCursor(P),this._completionController.completeAtCurrentPositionIfNeeded(!0)}),this._codeMirror.setBookmark(P,F)}return}let D=L.value.trim(),M=new WebInspector.InlineSwatch(WebInspector.InlineSwatch.Type.Variable,D,this._codeMirror.getOption("readOnly"));C.call(this,M,E,L,D)})}_?f.call(this):this._codeMirror.operation(f.bind(this))}_updateTextMarkerForPropertyIfNeeded(_){var S=_.__propertyTextMarker;if(S){var C=S.find();C&&this._createTextMarkerForPropertyIfNeeded(C.from,C.to,_)}}_createTextMarkerForPropertyIfNeeded(_,S,C){function T(z){var K=document.createElement("button");K.className="invalid-warning-marker",K.title=z.title,"string"==typeof z.correction&&(K.classList.add("clickable"),K.addEventListener("click",function(){this._codeMirror.replaceRange(z.correction,_,S),z.autocomplete&&(this._codeMirror.setCursor(S),this.focus(),this._completionController._completeAtCurrentPosition(!0))}.bind(this))),this._codeMirror.setBookmark(z.position,K)}function E(z){var K=0;for(var q of this._style.properties)q.name===z&&++K;return K}if(!this._codeMirror.getOption("readOnly")){var I=document.createElement("input");I.type="checkbox",I.checked=!0,I.addEventListener("change",this._propertyCheckboxChanged.bind(this)),I.__cssProperty=C;var R=this._codeMirror.setUniqueBookmark(_,I);R.__propertyCheckbox=!0}else if(this._delegate.cssStyleDeclarationTextEditorShouldAddPropertyGoToArrows&&!C.implicit&&"function"==typeof this._delegate.cssStyleDeclarationTextEditorShowProperty){let z=WebInspector.createGoToArrowButton();z.title=WebInspector.UIString("Option-click to show source");let K=this._delegate;z.addEventListener("click",function(q){K.cssStyleDeclarationTextEditorShowProperty(C,q.altKey)}),this._codeMirror.setUniqueBookmark(S,z)}var N=!1;WebInspector.CSSCompletions.cssNameCompletions&&(N=WebInspector.CSSCompletions.cssNameCompletions.isValidPropertyName(C.name));var L=["css-style-declaration-property"];C.overridden&&L.push("overridden"),C.implicit&&L.push("implicit"),this._style.inherited&&!C.inherited&&L.push("not-inherited"),!C.valid&&C.hasOtherVendorNameOrKeyword()?L.push("other-vendor"):!C.valid&&(!N||function(z){var K=!1;for(var q of this._style.properties)if(q===z)K=!0;else if(q.name===z.name&&K)return!0;return!1}.call(this,C))&&L.push("invalid"),C.enabled||L.push("disabled"),C.__filterResultClassName&&!C.__filterResultNeedlePosition&&L.push(C.__filterResultClassName);var D=L.join(" ");if(C.__propertyTextMarker&&C.__propertyTextMarker.doc.cm===this._codeMirror&&C.__propertyTextMarker.find()){if(C.__propertyTextMarker.className===D)return;C.__propertyTextMarker.clear()}var M=this._codeMirror.markText(_,S,{className:D});if(M.__cssProperty=C,C.__propertyTextMarker=M,C.addEventListener(WebInspector.CSSProperty.Event.OverriddenStatusChanged,this._propertyOverriddenStatusChanged,this),this._removeCheckboxPlaceholder(_.line),C.__filterResultClassName&&C.__filterResultNeedlePosition)for(var P of C.__filterResultNeedlePosition.start){var O={line:_.line,ch:P},F={line:S.line,ch:O.ch+C.__filterResultNeedlePosition.length};this._codeMirror.markText(O,F,{className:C.__filterResultClassName})}if(!(this._codeMirror.getOption("readOnly")||C.hasOtherVendorNameOrKeyword()||C.text.trim().endsWith(":")||!WebInspector.settings.stylesShowInlineWarnings.value)){var V=C.name.startsWith("-webkit-")&&WebInspector.CSSCompletions.cssNameCompletions.isValidPropertyName(C.canonicalName),U=E.call(this,C.name),G;if(V&&!E.call(this,C.canonicalName)?T.call(this,{position:_,title:WebInspector.UIString("The \u201Cwebkit\u201D prefix is not necessary.\nClick to insert a duplicate without the prefix."),correction:C.text+"\n"+C.text.replace("-webkit-",""),autocomplete:!1}):1E;this._filterResultPropertyNames?f=E=>{return(E.variable||this._propertyVisibilityMode!==WebInspector.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.HideNonVariables)&&(E.variable&&this._propertyVisibilityMode===WebInspector.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.HideVariables?!1:E.implicit&&!this._showsImplicitProperties?!1:!!(E.name in this._filterResultPropertyNames))}:!_&&(f=E=>{switch(this._propertyVisibilityMode){case WebInspector.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.HideNonVariables:if(!E.variable)return!1;break;case WebInspector.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.HideVariables:if(E.variable)return!1;break;case WebInspector.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.ShowAll:break;default:console.error("Invalid property visibility mode");}return!E.implicit||this._showsImplicitProperties||E.canonicalName in this._alwaysShowPropertyNames}),C=C.filter(f),this._sortProperties&&C.sort((E,I)=>E.name.extendedLocaleCompare(I.name)),this._shownProperties=C;for(var T=0;T{R.dataTransfer.setData(WebInspector.CSSStyleDetailsSidebarPanel.ToggledClassesDragType,_),R.dataTransfer.effectAllowed="copy"});let I=()=>{this.domNode.toggleClass(_,T.checked),S.set(_,T.checked)};T.addEventListener("click",I),E.addEventListener("click",()=>{T.checked=!T.checked,I()}),this._classListContainer.appendChild(f)}}}_filterDidChange(){this.contentView.element.classList.toggle(WebInspector.CSSStyleDetailsSidebarPanel.FilterInProgressClassName,this._filterBar.hasActiveFilters()),this._selectedPanel.filterDidChange(this._filterBar)}_styleSheetAddedOrRemoved(){this.needsLayout()}},WebInspector.CSSStyleDetailsSidebarPanel.NoForcedPseudoClassesScrollOffset=30,WebInspector.CSSStyleDetailsSidebarPanel.FilterInProgressClassName="filter-in-progress",WebInspector.CSSStyleDetailsSidebarPanel.FilterMatchingSectionHasLabelClassName="filter-section-has-label",WebInspector.CSSStyleDetailsSidebarPanel.FilterMatchSectionClassName="filter-matching",WebInspector.CSSStyleDetailsSidebarPanel.NoFilterMatchInSectionClassName="filter-section-non-matching",WebInspector.CSSStyleDetailsSidebarPanel.NoFilterMatchInPropertyClassName="filter-property-non-matching",WebInspector.CSSStyleDetailsSidebarPanel.ToggledClassesSymbol=Symbol("css-style-details-sidebar-panel-toggled-classes-symbol"),WebInspector.CSSStyleDetailsSidebarPanel.ToggledClassesDragType="text/classname",WebInspector.CSSStyleSheetTreeElement=class extends WebInspector.SourceCodeTreeElement{constructor(_){const C=WebInspector.UIString("Inspector Style Sheet");super(_,["stylesheet","stylesheet-icon"],C,null,_,!1)}},WebInspector.CallFrameTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_,S){let C=WebInspector.CallFrameView.iconClassNameForCallFrame(_),f=_.functionName||WebInspector.UIString("(anonymous function)");if(super(["call-frame",C],f,null,_,!1),this._callFrame=_,this._isActiveCallFrame=!1,S&&(this.addClassName("async-boundary"),this.selectable=!1),this._callFrame.nativeCode||!this._callFrame.sourceCodeLocation)return void(this.subtitle="");let T=this._callFrame.sourceCodeLocation.displaySourceCode.url;T&&(this.subtitle=document.createElement("span"),this._callFrame.sourceCodeLocation.populateLiveDisplayLocationString(this.subtitle,"textContent"),this.tooltipHandledSeparately=!0)}get callFrame(){return this._callFrame}get isActiveCallFrame(){return this._isActiveCallFrame}set isActiveCallFrame(_){this._isActiveCallFrame===_||(this._isActiveCallFrame=_,this._updateStatus())}onattach(){if(super.onattach(),this.tooltipHandledSeparately){let _="";this._callFrame.isTailDeleted&&(_=" "+WebInspector.UIString("(Tail Call)"));let S=this.mainTitle+_+"\n";this._callFrame.sourceCodeLocation.populateLiveDisplayLocationTooltip(this.element,S)}this._updateStatus()}_updateStatus(){return this.element?this._isActiveCallFrame?void(!this._statusImageElement&&(this._statusImageElement=useSVGSymbol("Images/ActiveCallFrame.svg","status-image")),this.status=this._statusImageElement):void(this.status=null):void 0}},WebInspector.CallFrameView=class extends WebInspector.Object{constructor(_,S){var C=document.createElement("div");C.classList.add("call-frame",WebInspector.CallFrameView.iconClassNameForCallFrame(_));var f=document.createElement("span");f.classList.add("subtitle");var T=_.sourceCodeLocation;if(T){WebInspector.linkifyElement(C,T);var E=document.createElement("a");if(E.classList.add("source-link"),E.href=T.sourceCode.url,S){var I=document.createElement("span");I.classList.add("separator"),I.textContent=" \u2014 ",f.append(I)}f.append(E),T.populateLiveDisplayLocationTooltip(E),T.populateLiveDisplayLocationString(E,"textContent")}var R=document.createElement("span");if(R.classList.add("title"),S){var N=document.createElement("img");N.classList.add("icon"),R.append(N,_.functionName||WebInspector.UIString("(anonymous function)"))}return C.append(R,f),C}static iconClassNameForCallFrame(_){return _.isTailDeleted?WebInspector.CallFrameView.TailDeletedIcon:_.programCode?WebInspector.CallFrameView.ProgramIconStyleClassName:_.functionName&&_.functionName.startsWith("on")&&5<=_.functionName.length?WebInspector.CallFrameView.EventListenerIconStyleClassName:_.nativeCode?WebInspector.CallFrameView.NativeIconStyleClassName:WebInspector.CallFrameView.FunctionIconStyleClassName}},WebInspector.CallFrameView.ProgramIconStyleClassName="program-icon",WebInspector.CallFrameView.FunctionIconStyleClassName="function-icon",WebInspector.CallFrameView.EventListenerIconStyleClassName="event-listener-icon",WebInspector.CallFrameView.NativeIconStyleClassName="native-icon",WebInspector.CallFrameView.TailDeletedIcon="tail-deleted",WebInspector.CanvasContentView=class extends WebInspector.ContentView{constructor(_){super(_),this.element.classList.add("canvas"),this._previewContainerElement=null,this._previewImageElement=null,this._errorElement=null,this._refreshButtonNavigationItem=new WebInspector.ButtonNavigationItem("canvas-refresh",WebInspector.UIString("Refresh"),"Images/ReloadFull.svg",13,13),this._refreshButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._showPreview,this),this._showGridButtonNavigationItem=new WebInspector.ActivateButtonNavigationItem("show-grid",WebInspector.UIString("Show Grid"),WebInspector.UIString("Hide Grid"),"Images/NavigationItemCheckers.svg",13,13),this._showGridButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._showGridButtonClicked,this),this._showGridButtonNavigationItem.activated=!!WebInspector.settings.showImageGrid.value}get navigationItems(){return[this._refreshButtonNavigationItem,this._showGridButtonNavigationItem]}shown(){super.shown(),this._showPreview(),WebInspector.settings.showImageGrid.addEventListener(WebInspector.Setting.Event.Changed,this._updateImageGrid,this)}hidden(){WebInspector.settings.showImageGrid.removeEventListener(WebInspector.Setting.Event.Changed,this._updateImageGrid,this),super.hidden()}_showPreview(){let _=()=>{if(this._previewContainerElement&&this._previewContainerElement.remove(),!this._errorElement){this._errorElement=WebInspector.createMessageTextView(WebInspector.UIString("No Preview Available"),!0)}this.element.appendChild(this._errorElement)};this._previewContainerElement||(this._previewContainerElement=this.element.appendChild(document.createElement("div")),this._previewContainerElement.classList.add("preview")),this.representedObject.requestContent(S=>{return S?void(this._errorElement&&this._errorElement.remove(),!this._previewImageElement&&(this._previewImageElement=document.createElement("img"),this._previewImageElement.addEventListener("error",_)),this._previewImageElement.src=S,this._previewContainerElement.appendChild(this._previewImageElement),this._updateImageGrid()):void _()})}_updateImageGrid(){if(this._previewImageElement){let _=WebInspector.settings.showImageGrid.value;this._showGridButtonNavigationItem.activated=_,this._previewImageElement.classList.toggle("show-grid",_)}}_showGridButtonClicked(){WebInspector.settings.showImageGrid.value=!this._showGridButtonNavigationItem.activated,this._updateImageGrid()}},WebInspector.CanvasDetailsSidebarPanel=class extends WebInspector.DetailsSidebarPanel{constructor(){super("canvas",WebInspector.UIString("Canvas")),this.element.classList.add("canvas"),this._canvas=null,this._node=null}inspect(_){return _ instanceof Array||(_=[_]),this.canvas=_.find(S=>S instanceof WebInspector.Canvas),!!this._canvas}get canvas(){return this._canvas}set canvas(_){_===this._canvas||(this._node&&(this._node.removeEventListener(WebInspector.DOMNode.Event.AttributeModified,this._refreshSourceSection,this),this._node.removeEventListener(WebInspector.DOMNode.Event.AttributeRemoved,this._refreshSourceSection,this),this._node=null),this._canvas&&(this._canvas.removeEventListener(WebInspector.Canvas.Event.MemoryChanged,this._canvasMemoryChanged,this),this._canvas.removeEventListener(WebInspector.Canvas.Event.CSSCanvasClientNodesChanged,this._refreshCSSCanvasSection,this)),this._canvas=_||null,this._canvas&&(this._canvas.addEventListener(WebInspector.Canvas.Event.MemoryChanged,this._canvasMemoryChanged,this),this._canvas.addEventListener(WebInspector.Canvas.Event.CSSCanvasClientNodesChanged,this._refreshCSSCanvasSection,this)),this.needsLayout())}initialLayout(){super.initialLayout(),this._nameRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Name")),this._typeRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Type")),this._memoryRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Memory")),this._memoryRow.tooltip=WebInspector.UIString("Memory usage of this canvas");let _=new WebInspector.DetailsSection("canvas-details",WebInspector.UIString("Identity"));_.groups=[new WebInspector.DetailsSectionGroup([this._nameRow,this._typeRow,this._memoryRow])],this.contentView.element.appendChild(_.element),this._nodeRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Node")),this._cssCanvasRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("CSS Canvas")),this._widthRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Width")),this._heightRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Height")),this._datachedRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Detached"));let S=new WebInspector.DetailsSection("canvas-source",WebInspector.UIString("Source"));S.groups=[new WebInspector.DetailsSectionGroup([this._nodeRow,this._cssCanvasRow,this._widthRow,this._heightRow,this._datachedRow])],this.contentView.element.appendChild(S.element),this._attributesDataGridRow=new WebInspector.DetailsSectionDataGridRow(null,WebInspector.UIString("No Attributes"));let C=new WebInspector.DetailsSection("canvas-attributes",WebInspector.UIString("Attributes"));C.groups=[new WebInspector.DetailsSectionGroup([this._attributesDataGridRow])],this.contentView.element.appendChild(C.element),this._cssCanvasClientsRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Nodes")),this._cssCanvasSection=new WebInspector.DetailsSection("canvas-css",WebInspector.UIString("CSS")),this._cssCanvasSection.groups=[new WebInspector.DetailsSectionGroup([this._cssCanvasClientsRow])],this._cssCanvasSection.element.hidden=!0,this.contentView.element.appendChild(this._cssCanvasSection.element)}layout(){super.layout();this._canvas&&(this._refreshIdentitySection(),this._refreshSourceSection(),this._refreshAttributesSection(),this._refreshCSSCanvasSection())}sizeDidChange(){super.sizeDidChange(),this._attributesDataGridRow.sizeDidChange()}_refreshIdentitySection(){this._canvas&&(this._nameRow.value=this._canvas.displayName,this._typeRow.value=WebInspector.Canvas.displayNameForContextType(this._canvas.contextType),this._formatMemoryRow())}_refreshSourceSection(){this._canvas&&(this._nodeRow.value=this._canvas.cssCanvasName?null:emDash,this._cssCanvasRow.value=this._canvas.cssCanvasName||null,this._widthRow.value=emDash,this._heightRow.value=emDash,this._datachedRow.value=null,this._canvas.requestNode(_=>{if(_){_!==this._node&&(this._node&&(this._node.removeEventListener(WebInspector.DOMNode.Event.AttributeModified,this._refreshSourceSection,this),this._node.removeEventListener(WebInspector.DOMNode.Event.AttributeRemoved,this._refreshSourceSection,this),this._node=null),this._node=_,this._node.addEventListener(WebInspector.DOMNode.Event.AttributeModified,this._refreshSourceSection,this),this._node.addEventListener(WebInspector.DOMNode.Event.AttributeRemoved,this._refreshSourceSection,this)),this._canvas.cssCanvasName||(this._nodeRow.value=WebInspector.linkifyNodeReference(this._node));let S=(T,E)=>{let I=+this._node.getAttribute(E);return!Number.isInteger(I)||0>I?!1:(T.value=I,!0)},C=S(this._widthRow,"width"),f=S(this._heightRow,"height");C&&f||WebInspector.RemoteObject.resolveNode(_,"",T=>{function E(I,R){T.getProperty(R,(N,L)=>{N||"number"!==L.type||(I.value=`${L.value}px`)})}T&&(E(this._widthRow,"width"),E(this._heightRow,"height"),T.release())}),this._canvas.cssCanvasName||this._node.parentNode||(this._datachedRow.value=WebInspector.UIString("Yes"))}}))}_refreshAttributesSection(){if(this._canvas){if(isEmptyObject(this._canvas.contextAttributes))return void(this._attributesDataGridRow.dataGrid=null);let _=this._attributesDataGridRow.dataGrid;for(let S in _||(_=this._attributesDataGridRow.dataGrid=new WebInspector.DataGrid({name:{title:WebInspector.UIString("Name")},value:{title:WebInspector.UIString("Value"),width:"30%"}})),_.removeChildren(),this._canvas.contextAttributes){let C={name:S,value:this._canvas.contextAttributes[S]},f=new WebInspector.DataGridNode(C);_.appendChild(f)}_.updateLayoutIfNeeded()}}_refreshCSSCanvasSection(){return this._canvas?this._canvas.cssCanvasName?void(this._cssCanvasClientsRow.value=emDash,this._cssCanvasSection.element.hidden=!1,this._canvas.requestCSSCanvasClientNodes(_=>{if(_.length){let S=document.createDocumentFragment();for(let C of _)S.appendChild(WebInspector.linkifyNodeReference(C));this._cssCanvasClientsRow.value=S}})):void(this._cssCanvasSection.element.hidden=!0):void 0}_formatMemoryRow(){return!this._canvas.memoryCost||isNaN(this._canvas.memoryCost)?void(this._memoryRow.value=emDash):void(this._memoryRow.value=Number.bytesToString(this._canvas.memoryCost))}_canvasMemoryChanged(){this._formatMemoryRow()}},WebInspector.CanvasTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_){super(["canvas",_.contextType],_.displayName,null,_)}onattach(){super.onattach(),this.element.addEventListener("mouseover",this._handleMouseOver.bind(this)),this.element.addEventListener("mouseout",this._handleMouseOut.bind(this))}populateContextMenu(_,S){super.populateContextMenu(_,S),_.appendItem(WebInspector.UIString("Log Canvas Context"),()=>{WebInspector.RemoteObject.resolveCanvasContext(this.representedObject,WebInspector.RuntimeManager.ConsoleObjectGroup,C=>{if(C){const f=WebInspector.UIString("Selected Canvas Context");WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(f,C,!0)}})}),_.appendSeparator()}_handleMouseOver(){this.representedObject.cssCanvasName?this.representedObject.requestCSSCanvasClientNodes(S=>{WebInspector.domTreeManager.highlightDOMNodeList(S.map(C=>C.id),"all")}):this.representedObject.requestNode(S=>{S&&S.ownerDocument&&WebInspector.domTreeManager.highlightDOMNode(S.id,"all")})}_handleMouseOut(){WebInspector.domTreeManager.hideDOMNodeHighlight()}},WebInspector.ChartDetailsSectionRow=class extends WebInspector.DetailsSectionRow{constructor(_,S,C){super(WebInspector.UIString("No Chart Available")),C=C||0,this.element.classList.add("chart"),this._titleElement=document.createElement("div"),this._titleElement.className="title",this.element.appendChild(this._titleElement);let T=document.createElement("div");T.className="chart-content",this.element.appendChild(T),this._chartElement=createSVGElement("svg"),T.appendChild(this._chartElement),this._legendElement=document.createElement("div"),this._legendElement.className="legend",T.appendChild(this._legendElement),this._delegate=_,this._items=new Map,this._title="",this._chartSize=S,this._radius=this._chartSize/2-1,this._innerRadius=C?Math.floor(this._radius*C):0,this._total=0,this._svgFiltersElement=document.createElement("svg"),this._svgFiltersElement.classList.add("defs-only"),this.element.append(this._svgFiltersElement),this._checkboxStyleElement=document.createElement("style"),this._checkboxStyleElement.id="checkbox-styles",document.getElementsByTagName("head")[0].append(this._checkboxStyleElement),this._emptyChartPath=createSVGElement("path"),this._emptyChartPath.setAttribute("d",function(E,I,R){const N=0,L=1.9999*Math.PI;let D=E+Math.cos(N)*I,M=E+Math.sin(N)*I,P=E+Math.cos(L)*I,O=E+Math.sin(L)*I,F=E+Math.cos(L)*R,V=E+Math.sin(L)*R,U=E+Math.cos(N)*R,G=E+Math.sin(N)*R;return["M",D,M,"A",I,I,0,1,1,P,O,"Z","M",F,V,"A",R,R,0,1,0,U,G,"Z"].join(" ")}(this._chartSize/2,this._radius,this._innerRadius)),this._emptyChartPath.classList.add("empty-chart"),this._chartElement.appendChild(this._emptyChartPath)}get chartSize(){return this._chartSize}set title(_){this._title===_||(this._title=_,this._titleElement.textContent=_)}get total(){return this._total}addItem(_,S,C,f,T,E){this._items.has(_)||0>C||(this._items.set(_,{label:S,value:C,color:f,checkbox:T,checked:E}),this._total+=C,this._needsLayout())}setItemValue(_,S){let C=this._items.get(_);!C||0>S||C.value===S||(this._total+=S-C.value,C.value=S,this._needsLayout())}clearItems(){for(let _ of this._items.values()){let S=_[WebInspector.ChartDetailsSectionRow.ChartSegmentPathSymbol];S&&S.remove()}this._total=0,this._items.clear(),this._needsLayout()}_addCheckboxColorFilter(_,S,C,f){function T(D,M){let P=createSVGElement(D);return P.setAttribute("type","gamma"),P.setAttribute("exponent",M),P}for(let D=0;D .content > .group > .row.chart > .chart-content > .legend > .legend-item > label > input[type=checkbox]."+_+" { filter: grayscale(1) url(#"+_+") }",0)}_updateLegend(){function _(S){return this._delegate&&"function"==typeof this._delegate.formatChartValue?this._delegate.formatChartValue(S.value):S.value}if(!this._items.size)return void this._legendElement.removeChildren();for(let[S,C]of this._items){if(C[WebInspector.ChartDetailsSectionRow.LegendItemValueElementSymbol]){let R=C[WebInspector.ChartDetailsSectionRow.LegendItemValueElementSymbol];R.textContent=_.call(this,C);continue}let f=document.createElement("label"),T;if(C.checkbox){let R=S.toLowerCase(),N=C.color.substring(4,C.color.length-1).replace(/ /g,"").split(",");N[0]===N[1]&&N[1]===N[2]&&(N[0]=N[1]=N[2]=Math.min(160,N[0])),T=document.createElement("input"),T.type="checkbox",T.classList.add(R),T.checked=C.checked,T[WebInspector.ChartDetailsSectionRow.DataItemIdSymbol]=S,T.addEventListener("change",this._legendItemCheckboxValueChanged.bind(this)),this._addCheckboxColorFilter(R,N[0],N[1],N[2])}else T=document.createElement("div"),T.classList.add("color-key"),T.style.backgroundColor=C.color;f.append(T,C.label);let E=document.createElement("div");E.classList.add("value"),E.textContent=_.call(this,C),C[WebInspector.ChartDetailsSectionRow.LegendItemValueElementSymbol]=E;let I=document.createElement("div");I.classList.add("legend-item"),I.append(f,E),this._legendElement.append(I)}}_legendItemCheckboxValueChanged(_){let S=_.target,C=S[WebInspector.ChartDetailsSectionRow.DataItemIdSymbol];this.dispatchEventToListeners(WebInspector.ChartDetailsSectionRow.Event.LegendItemChecked,{id:C,checked:S.checked})}_needsLayout(){this._scheduledLayoutUpdateIdentifier||(this._scheduledLayoutUpdateIdentifier=requestAnimationFrame(this._updateLayout.bind(this)))}_updateLayout(){function _(I,R,N,L,D){const M=(N-R)%(2*Math.PI)>Math.PI?1:0;let P=I+Math.cos(R)*L,O=I+Math.sin(R)*L,F=I+Math.cos(N)*L,V=I+Math.sin(N)*L,U=I+Math.cos(N)*D,G=I+Math.sin(N)*D,H=I+Math.cos(R)*D,W=I+Math.sin(R)*D;return["M",P,O,"A",L,L,0,M,1,F,V,"L",U,G,"A",D,D,0,M,0,H,W,"Z"].join(" ")}this._scheduledLayoutUpdateIdentifier&&(cancelAnimationFrame(this._scheduledLayoutUpdateIdentifier),this._scheduledLayoutUpdateIdentifier=void 0),this._updateLegend(),this._chartElement.setAttribute("width",this._chartSize),this._chartElement.setAttribute("height",this._chartSize),this._chartElement.setAttribute("viewbox","0 0 "+this._chartSize+" "+this._chartSize);const S=0.015*this._total;let C=[];for(let I of this._items.values())I.displayValue=I.value?Math.max(S,I.value):0,I.displayValue&&C.push(I);if(1=S&&(N.displayValue-=L,R-=L),I--}}const f=this._chartSize/2;let T=-Math.PI/2,E=0;for(let[I,R]of this._items){let N=R[WebInspector.ChartDetailsSectionRow.ChartSegmentPathSymbol];if(N||(N=createSVGElement("path"),N.classList.add("chart-segment"),N.setAttribute("fill",R.color),this._chartElement.appendChild(N),R[WebInspector.ChartDetailsSectionRow.ChartSegmentPathSymbol]=N),!R.value){N.classList.add("hidden");continue}const L=2*(R.displayValue/this._total*Math.PI);E=T+L,N.setAttribute("d",_(f,T,E,this._radius,this._innerRadius)),N.classList.remove("hidden"),T=E}}},WebInspector.ChartDetailsSectionRow.DataItemIdSymbol=Symbol("chart-details-section-row-data-item-id"),WebInspector.ChartDetailsSectionRow.ChartSegmentPathSymbol=Symbol("chart-details-section-row-chart-segment-path"),WebInspector.ChartDetailsSectionRow.LegendItemValueElementSymbol=Symbol("chart-details-section-row-legend-item-value-element"),WebInspector.ChartDetailsSectionRow.Event={LegendItemChecked:"chart-details-section-row-legend-item-checked"},WebInspector.CircleChart=class{constructor({size:_,innerRadiusRatio:S}){this._data=[],this._size=_,this._radius=_/2-1,this._innerRadius=S?Math.floor(this._radius*S):0,this._element=document.createElement("div"),this._element.classList.add("circle-chart"),this._chartElement=this._element.appendChild(createSVGElement("svg")),this._chartElement.setAttribute("width",_),this._chartElement.setAttribute("height",_),this._chartElement.setAttribute("viewbox",`0 0 ${_} ${_}`),this._pathElements=[],this._values=[],this._total=0;let C=this._chartElement.appendChild(createSVGElement("path"));C.setAttribute("d",this._createCompleteCirclePathData(this.size/2,this._radius,this._innerRadius)),C.classList.add("background")}get element(){return this._element}get points(){return this._points}get size(){return this._size}get centerElement(){return this._centerElement||(this._centerElement=this._element.appendChild(document.createElement("div")),this._centerElement.classList.add("center"),this._centerElement.style.width=this._centerElement.style.height=this._radius+"px",this._centerElement.style.top=this._centerElement.style.left=this._radius-this._innerRadius+"px"),this._centerElement}get segments(){return this._segments}set segments(_){for(let S of this._pathElements)S.remove();this._pathElements=[];for(let S of _){let C=this._chartElement.appendChild(createSVGElement("path"));C.classList.add("segment",S),this._pathElements.push(C)}}get values(){return this._values}set values(_){this._values=_,this._total=0;for(let S of _)this._total+=S}clear(){this.values=Array(this._values.length).fill(0)}needsLayout(){this._scheduledLayoutUpdateIdentifier||(this._scheduledLayoutUpdateIdentifier=requestAnimationFrame(this.updateLayout.bind(this)))}updateLayout(){if(this._scheduledLayoutUpdateIdentifier&&(cancelAnimationFrame(this._scheduledLayoutUpdateIdentifier),this._scheduledLayoutUpdateIdentifier=void 0),!!this._values.length){const _=this._size/2;let S=-Math.PI/2,C=0;for(let f=0;fMath.PI?1:0;let I=_+Math.cos(S)*f,R=_+Math.sin(S)*f,N=_+Math.cos(C)*f,L=_+Math.sin(C)*f,D=_+Math.cos(C)*T,M=_+Math.sin(C)*T,P=_+Math.cos(S)*T,O=_+Math.sin(S)*T;return["M",I,R,"A",f,f,0,E,1,N,L,"L",D,M,"A",T,T,0,E,0,P,O,"Z"].join(" ")}},WebInspector.ClusterContentView=class extends WebInspector.ContentView{constructor(_){super(_),this.element.classList.add("cluster"),this._contentViewContainer=new WebInspector.ContentViewContainer,this._contentViewContainer.addEventListener(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange,this._currentContentViewDidChange,this),this.addSubview(this._contentViewContainer),WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SelectionPathComponentsDidChange,this._contentViewSelectionPathComponentDidChange,this),WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange,this._contentViewSupplementalRepresentedObjectsDidChange,this),WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange,this._contentViewNumberOfSearchResultsDidChange,this)}get navigationItems(){var _=this._contentViewContainer.currentContentView;return _?_.navigationItems:[]}get contentViewContainer(){return this._contentViewContainer}get supportsSplitContentBrowser(){return this._contentViewContainer.currentContentView?this._contentViewContainer.currentContentView.supportsSplitContentBrowser:super.supportsSplitContentBrowser}shown(){super.shown(),this._contentViewContainer.shown()}hidden(){super.hidden(),this._contentViewContainer.hidden()}closed(){super.closed(),this._contentViewContainer.closeAllContentViews(),WebInspector.ContentView.removeEventListener(null,null,this)}canGoBack(){return this._contentViewContainer.canGoBack()}canGoForward(){return this._contentViewContainer.canGoForward()}goBack(){this._contentViewContainer.goBack()}goForward(){this._contentViewContainer.goForward()}get scrollableElements(){return this._contentViewContainer.currentContentView?this._contentViewContainer.currentContentView.scrollableElements:[]}get selectionPathComponents(){return this._contentViewContainer.currentContentView?this._contentViewContainer.currentContentView.selectionPathComponents:[]}get supplementalRepresentedObjects(){return this._contentViewContainer.currentContentView?this._contentViewContainer.currentContentView.supplementalRepresentedObjects:[]}get handleCopyEvent(){var _=this._contentViewContainer.currentContentView;return _&&"function"==typeof _.handleCopyEvent?_.handleCopyEvent.bind(_):null}get supportsSave(){var _=this._contentViewContainer.currentContentView;return _&&_.supportsSave}get saveData(){var _=this._contentViewContainer.currentContentView;return _&&_.saveData||null}get supportsSearch(){return!0}get numberOfSearchResults(){var _=this._contentViewContainer.currentContentView;return _&&_.supportsSearch?_.numberOfSearchResults:null}get hasPerformedSearch(){var _=this._contentViewContainer.currentContentView;return _&&_.supportsSearch&&_.hasPerformedSearch}set automaticallyRevealFirstSearchResult(_){var S=this._contentViewContainer.currentContentView;S&&S.supportsSearch&&(S.automaticallyRevealFirstSearchResult=_)}performSearch(_){this._searchQuery=_;var S=this._contentViewContainer.currentContentView;S&&S.supportsSearch&&S.performSearch(_)}searchCleared(){this._searchQuery=null;var _=this._contentViewContainer.currentContentView;_&&_.supportsSearch&&_.searchCleared()}searchQueryWithSelection(){var _=this._contentViewContainer.currentContentView;return _&&_.supportsSearch?_.searchQueryWithSelection():null}revealPreviousSearchResult(_){var S=this._contentViewContainer.currentContentView;S&&S.supportsSearch&&S.revealPreviousSearchResult(_)}revealNextSearchResult(_){var S=this._contentViewContainer.currentContentView;S&&S.supportsSearch&&S.revealNextSearchResult(_)}_currentContentViewDidChange(){var S=this._contentViewContainer.currentContentView;S&&S.supportsSearch&&(this._searchQuery?S.performSearch(this._searchQuery):S.searchCleared()),this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange),this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange),this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange)}_contentViewSelectionPathComponentDidChange(_){_.target!==this._contentViewContainer.currentContentView||this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange)}_contentViewSupplementalRepresentedObjectsDidChange(_){_.target!==this._contentViewContainer.currentContentView||this.dispatchEventToListeners(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange)}_contentViewNumberOfSearchResultsDidChange(_){_.target!==this._contentViewContainer.currentContentView||this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange)}},function(){function u(U,G){return G._linkQuoteCharacter?U.eatWhile(new RegExp("[^"+G._linkQuoteCharacter+"]")):U.eatWhile(/[^\s\u00a0=<>\"\']/),U.eol()||(G._linkTokenize=_),"link"}function _(U,G){G._linkQuoteCharacter&&U.eat(G._linkQuoteCharacter);var H=G._linkBaseStyle;return delete G._linkTokenize,delete G._linkQuoteCharacter,delete G._linkBaseStyle,delete G._srcSetTokenizeState,H}function S(U,G){return("link"===G._srcSetTokenizeState?G._linkQuoteCharacter?U.eatWhile(new RegExp("[^\\s,"+G._linkQuoteCharacter+"]")):U.eatWhile(/[^\s,\u00a0=<>\"\']/):(U.eatSpace(),G._linkQuoteCharacter?U.eatWhile(new RegExp("[^,"+G._linkQuoteCharacter+"]")):U.eatWhile(/[^\s\u00a0=<>\"\']/),U.eatWhile(/[\s,]/)),(U.eol()||!G._linkQuoteCharacter||U.peek()===G._linkQuoteCharacter)&&(G._linkTokenize=_),"link"===G._srcSetTokenizeState)?(G._srcSetTokenizeState="descriptor","link"):(G._srcSetTokenizeState="link",G._linkBaseStyle)}function f(U,G){if(G._unquotedURLString&&U.eatSpace())return null;for(var H=null,W=!1,z=!1,K=U.pos,q=G._urlQuoteCharacter;null!=(H=U.next());){if(H===q&&!W){z=!0;break}W=!W&&"\\"===H,/[\s\u00a0]/.test(H)||(K=U.pos)}return G._unquotedURLString&&(U.pos=K),z&&(!G._unquotedURLString&&U.backUp(1),this._urlTokenize=T),"link"}function T(U,G){G._unquotedURLString||U.eat(G._urlQuoteCharacter);var H=G._urlBaseStyle;return delete G._urlTokenize,delete G._urlQuoteCharacter,delete G._urlBaseStyle,H}function E(U,G){var H=/#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})\b/g;if(G._urlTokenize){var W=G._urlTokenize(U,G);return W&&W+" m-"+(this.alternateName||this.name)}var z=U.pos,W=this._token(U,G);if(W)if("atom"===W)"url"===U.current()?G._expectLink=!0:H.test(U.current())&&(W+=" hex-color");else if(G._expectLink&&(delete G._expectLink,"string"===W)){G._urlTokenize=f,G._urlBaseStyle=W;var K=U.current()[0];G._urlQuoteCharacter="'"===K||"\""===K?K:")",G._unquotedURLString=")"===G._urlQuoteCharacter,U.pos=z,G._unquotedURLString||U.eat(G._urlQuoteCharacter)}return W&&W+" m-"+(this.alternateName||this.name)}function N(U,G){G.preventDefault(),setTimeout(function(){if(U.getWrapperElement().classList.contains("CodeMirror-focused")){var W=U.getScrollerElement().getElementsByClassName("CodeMirror-cursor")[0];W&&W.scrollIntoViewIfNeeded(!1)}},0)}function L(U,G){function H(q){var X=G.getTokenAt(q);return X&&X.type&&/\bnumber\b/.test(X.type)?X:null}var W=G.getCursor("head"),z=H(W);if(z||(W.ch+=1,z=H(W)),!z)return CodeMirror.Pass;var K=G.alterNumberInRange(U,{ch:z.start,line:W.line},{ch:z.end,line:W.line},!0);if(!K)return CodeMirror.Pass}CodeMirror.extendMode("css",{token:E}),CodeMirror.extendMode("xml",{token:function(U,G){if(G._linkTokenize){var H=G._linkTokenize(U,G);return H&&H+" m-"+this.name}var W=U.pos,H=this._token(U,G);if("attribute"===H){var z=U.current().toLowerCase();"src"===z||/\bhref\b/.test(z)?G._expectLink=!0:"srcset"===z?G._expectSrcSet=!0:(delete G._expectLink,delete G._expectSrcSet)}else if(G._expectLink&&"string"===H){var K=U.current();if("\"\""!==K&&"''"!==K){delete G._expectLink,G._linkTokenize=u,G._linkBaseStyle=H;var q=K[0];G._linkQuoteCharacter="'"===q||"\""===q?q:null,U.pos=W,G._linkQuoteCharacter&&U.eat(G._linkQuoteCharacter)}}else if(G._expectSrcSet&&"string"===H){var K=U.current();if("\"\""!==K&&"''"!==K){delete G._expectSrcSet,G._srcSetTokenizeState="link",G._linkTokenize=S,G._linkBaseStyle=H;var q=K[0];G._linkQuoteCharacter="'"===q||"\""===q?q:null,U.pos=W,G._linkQuoteCharacter&&U.eat(G._linkQuoteCharacter)}}else H&&(delete G._expectLink,delete G._expectSrcSet);return H&&H+" m-"+this.name}}),CodeMirror.extendMode("javascript",{token:function(U,G){var H=this._token(U,G);return H&&H+" m-"+(this.alternateName||this.name)}}),CodeMirror.defineMode("css-rule",CodeMirror.modes.css),CodeMirror.extendMode("css-rule",{token:E,startState:function(U){var G=this._startState(U);return G.state="block",G.context.type="block",G},alternateName:"css"}),CodeMirror.defineInitHook(function(U){U.on("scrollCursorIntoView",N)});CodeMirror.defineOption("showWhitespaceCharacters",!1,function(U,G,H){return!G||H&&H!==CodeMirror.Init?void U.removeOverlay("whitespace"):void U.addOverlay({name:"whitespace",token(W){if(" "===W.peek()){let z=0;for(;z<16&&" "===W.peek();)++z,W.next();return`whitespace whitespace-${z}`}for(;!W.eol()&&" "!==W.peek();)W.next();return null}})}),CodeMirror.defineExtension("hasLineClass",function(U,G,H){var W="text"===G?"textClass":"background"===G?"bgClass":"wrapClass",z=this.lineInfo(U);if(!z)return!1;if(!z[W])return!1;if(z[W]===H)return!0;var K=z[W].indexOf(H);if(-1===K)return!1;var q=" "+z[W]+" ";return-1!==q.indexOf(" "+H+" ",K)}),CodeMirror.defineExtension("setUniqueBookmark",function(U,G){for(var H=this.findMarksAt(U),W=0;Wne.ch&&(z.ch+=oe),K.ch>ne.ch&&(K.ch+=oe)),this.setSelection(z,K)}return!0}),CodeMirror.defineExtension("rectsForRange",function(U){for(var G=[],H=U.start.line;H<=U.end.line;++H){var W=this.getLine(H),z=H===U.start.line?U.start.ch:W.length-W.trimLeft().length,K=H===U.end.line?U.end.ch:W.length,q=this.cursorCoords({ch:z,line:H}),X=this.cursorCoords({ch:K,line:H});if(q.bottom!==X.bottom){for(var Y=-Number.MAX_VALUE,Q=z,J;Q<=K;++Q)if(J=this.cursorCoords({ch:Q,line:H}),J.bottom>Y){if(Q>z){var Z=Math.ceil(this.cursorCoords({ch:Q-1,line:H}).right);G.push(new WebInspector.Rect($,ee,Z-$,Y-ee))}var $=Math.floor(J.left),ee=Math.floor(J.top);Y=Math.ceil(J.bottom)}Z=Math.ceil(J.right),G.push(new WebInspector.Rect($,ee,Z-$,Y-ee))}else{var $=Math.floor(q.left),ee=Math.floor(q.top),Z=Math.ceil(X.right),Y=Math.ceil(X.bottom);G.push(new WebInspector.Rect($,ee,Z-$,Y-ee))}}return G});let M="mac"===WebInspector.Platform.name;CodeMirror.keyMap["default"]={"Alt-Up":L.bind(null,1),"Ctrl-Alt-Up":L.bind(null,0.1),"Shift-Alt-Up":L.bind(null,10),"Alt-PageUp":L.bind(null,10),"Shift-Alt-PageUp":L.bind(null,100),"Alt-Down":L.bind(null,-1),"Ctrl-Alt-Down":L.bind(null,-0.1),"Shift-Alt-Down":L.bind(null,-10),"Alt-PageDown":L.bind(null,-10),"Shift-Alt-PageDown":L.bind(null,-100),"Cmd-/":"toggleComment","Cmd-D":"selectNextOccurrence","Shift-Tab":"indentLess",fallthrough:M?"macDefault":"pcDefault"};["text/xml","text/xsl"].forEach(function(U){CodeMirror.defineMIME(U,"xml")});["application/xhtml+xml","image/svg+xml"].forEach(function(U){CodeMirror.defineMIME(U,"htmlmixed")});["text/ecmascript","application/javascript","application/ecmascript","application/x-javascript","text/x-javascript","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/jscript","text/livescript"].forEach(function(U){CodeMirror.defineMIME(U,"javascript")});["application/x-json","text/x-json","application/vnd.api+json"].forEach(function(U){CodeMirror.defineMIME(U,{name:"javascript",json:!0})})}(),WebInspector.compareCodeMirrorPositions=function(u,_){var S=u.line-_.line;if(0!=S)return S;var C="ch"in u?u.ch:Number.MAX_VALUE,f="ch"in _?_.ch:Number.MAX_VALUE;return C-f},WebInspector.walkTokens=function(u,_,S,C){let f=CodeMirror.copyState(_,u.getTokenAt(S).state);f.localState&&(f=f.localState);let T=u.lineCount(),E=!1;for(let I=S.line;!E&&I{C.scrollIntoView({line:0,ch:0})},End:()=>{C.scrollIntoView({line:C.lineCount()-1,ch:null})}}),new WebInspector.CodeMirrorTextKillController(C),C}},CodeMirror.extendMode("javascript",{shouldHaveSpaceBeforeToken:function(u,_,S,C,f,T){return S?!!T||(/\boperator\b/.test(S)?(u||"+"!==f&&"-"!==f&&"~"!==f||")"===_||"]"===_)&&"!"!==f&&0<="+-/*%&&||!===+=-=>=<=?".indexOf(f):!!/\bkeyword\b/.test(S)&&("else"===f||"catch"===f||"finally"===f?"}"===_:"while"===f&&"}"===_&&"do"===C._jsPrettyPrint.lastContentBeforeBlock)):"("===f?u&&/\bkeyword\b/.test(u)&&"function"!==_&&"typeof"!==_&&"instanceof"!==_:":"===f&&("stat"===C.lexical.type||")"===C.lexical.type||"]"===C.lexical.type)},shouldHaveSpaceAfterLastToken:function(u,_,S,C,f){return u&&/\bkeyword\b/.test(u)?"else"===_||"catch"===_||("return"===_?";"!==f:"throw"===_||"try"===_||"finally"===_||"do"===_):u&&/\bcomment\b/.test(u)||(")"===_?"{"===f:";"===_?")"===C.lexical.type:"!"!==_&&("+"!==_&&"-"!==_&&"~"!==_||C._jsPrettyPrint.unaryOperatorHadLeadingExpr)&&0<=",+-/*%&&||:!===+=-=>=<=?".indexOf(_))},newlinesAfterToken:function(u,_,S,C,f,T){return S?T?1:0:","===f?"}"===C.lexical.type?1:0:";"===f?")"===C.lexical.type?0:1:":"===f&&"}"===C.lexical.type&&C.lexical.prev&&"form"===C.lexical.prev.type?1:1===f.length&&0<="{}".indexOf(f)?1:0},removeLastWhitespace:function(){return!1},removeLastNewline:function(u,_,S,C,f,T,E){return S?T?E||";"!==_?!1:!0:!!/\bkeyword\b/.test(S)&&("else"===f||"catch"===f||"finally"===f?"}"===_:"while"===f&&"}"===_&&"do"===C._jsPrettyPrint.lastContentBeforeBlock):"}"===f?"{"===_:";"===f?0<="};".indexOf(_):":"===f?"}"===_&&("stat"===C.lexical.type||")"===C.lexical.type||"]"===C.lexical.type):!!(0<=",().".indexOf(f))&&"}"===_},indentAfterToken:function(u,_,S,C,f){return!("{"!==f)||("case"===f||"default"===f)&&"}"===C.lexical.type&&C.lexical.prev&&"form"===C.lexical.prev.type},newlineBeforeToken:function(u,_,S,C,f){return!!C._jsPrettyPrint.shouldIndent||"}"===f&&"{"!==_},indentBeforeToken:function(u,_,S,C){return!!C._jsPrettyPrint.shouldIndent},dedentsBeforeToken:function(u,_,S,C,f){var E=0;return C._jsPrettyPrint.shouldDedent&&(E+=C._jsPrettyPrint.dedentSize),S||"}"!==f?S&&/\bkeyword\b/.test(S)&&("case"===f||"default"===f)&&(E+=1):E+=1,E},modifyStateForTokenPre:function(u,_,S,C,f,T){if(C._jsPrettyPrint||(C._jsPrettyPrint={indentCount:0,shouldIndent:!1,shouldDedent:!1,dedentSize:0,lastIfIndentCount:0,openBraceStartMarkers:[],openBraceTrackingCount:-1,unaryOperatorHadLeadingExpr:!1,lastContentBeforeBlock:void 0}),!T&&C.lexical.prev&&"form"===C.lexical.prev.type&&!C.lexical.prev._jsPrettyPrintMarker&&(")"===_||"else"===_||"do"===_)&&")"!==C.lexical.type){if("{"===f){var E={indentCount:C._jsPrettyPrint.indentCount,openBraceTrackingCount:C._jsPrettyPrint.openBraceTrackingCount,lastContentBeforeBlock:_};C._jsPrettyPrint.openBraceStartMarkers.push(E),C._jsPrettyPrint.openBraceTrackingCount=1}else"}"!==C.lexical.type&&("else"==_&&"if"==f||(C._jsPrettyPrint.indentCount++,C._jsPrettyPrint.shouldIndent=!0),C.lexical.prev._jsPrettyPrintMarker=!0,C._jsPrettyPrint.enteringIf&&(C._jsPrettyPrint.lastIfIndentCount=C._jsPrettyPrint.indentCount-1));}else if(T||("{"===f?C._jsPrettyPrint.openBraceTrackingCount++:"}"==f&&C._jsPrettyPrint.openBraceTrackingCount--),";"===f);else if("else"===f)"}"!=_&&(C._jsPrettyPrint.shouldDedent=!0,C._jsPrettyPrint.dedentSize=C._jsPrettyPrint.indentCount-C._jsPrettyPrint.lastIfIndentCount,C._jsPrettyPrint.lastIfIndentCount=0);else if("}"===f&&!C._jsPrettyPrint.openBraceTrackingCount&&C._jsPrettyPrint.openBraceStartMarkers.length){var E=C._jsPrettyPrint.openBraceStartMarkers.pop();C._jsPrettyPrint.shouldDedent=!0,C._jsPrettyPrint.dedentSize=C._jsPrettyPrint.indentCount-E.indentCount,C._jsPrettyPrint.openBraceTrackingCount=E.openBraceTrackingCount,C._jsPrettyPrint.lastContentBeforeBlock=E.lastContentBeforeBlock}else{for(var I=!0,R=C.lexical.prev;R;){if(R._jsPrettyPrintMarker){I=!1;break}R=R.prev}I&&(C._jsPrettyPrint.shouldDedent=!0,C._jsPrettyPrint.dedentSize=C._jsPrettyPrint.indentCount)}S&&"form"===C.lexical.type&&C.lexical.prev&&"form"!==C.lexical.prev&&/\bkeyword\b/.test(S)&&(C._jsPrettyPrint.enteringIf="if"===f)},modifyStateForTokenPost:function(u,_,S,C,f){C._jsPrettyPrint.shouldIndent&&(C._jsPrettyPrint.shouldIndent=!1),C._jsPrettyPrint.shouldDedent&&(C._jsPrettyPrint.indentCount-=C._jsPrettyPrint.dedentSize,C._jsPrettyPrint.dedentSize=0,C._jsPrettyPrint.shouldDedent=!1),C._jsPrettyPrint.unaryOperatorHadLeadingExpr=("+"===f||"-"===f||"~"===f)&&(")"===_||"]"===_||/\b(?:variable|number)\b/.test(u))}}),CodeMirror.extendMode("css",{shouldHaveSpaceBeforeToken:function(u,_,S,C,f,T){return S?!!T||!!/\bkeyword\b/.test(S)&&"!"===f.charAt(0):"{"===f||0<=">+~-*/".indexOf(f)},shouldHaveSpaceAfterLastToken:function(u,_,S,C,f){return u?!!/\bcomment\b/.test(u)||!!/\bkeyword\b/.test(u)&&("media"===C.state||"atBlock_parens"===C.state&&")"!==f):","===_||(":"===_?"prop"===C.state:")"===_&&")"!==f&&","!==f?!!/\bnumber\b/.test(S)||"prop"===C.state||"media"===C.state||"atBlock_parens"===C.state:0<=">+~-*/".indexOf(_))},newlinesAfterToken:function(u,_,S,C,f,T){return S?T?1:0:";"===f?1:","===f?("top"===C.state||"media"===C.state)&&60N?"error":"regex-quantifier"}return"["===T?(f.tokenize=u,f.pushContext(C,"regex-character-set")):/[.^$|]/.test(T)?"regex-special":null}return{startState:function(){let C=[];return{currentContext:function(){return C.length?C[C.length-1]:null},pushContext:function(f,T,E){return C.push({data:T,type:E}),T},popContext:function(){return C.pop().data},tokenize:S}},token:function(C,f){return f.tokenize(C,f)}}}),CodeMirror.defineMIME("text/x-regex","regex");function createCodeMirrorTextMarkers(u,_,S,C,f,T){for(var E=[],I=f instanceof WebInspector.TextRange?f.startLine:0,R=f instanceof WebInspector.TextRange?f.endLine+1:C.lineCount(),N=I;NR););return!/(repeating-)?(linear|radial)-gradient$/.test(T.substring(0,R))&&!(0=R.length&&(I++,M=0,R=u.getLine(I),!R))break}if(-1!=P){N=E.exec(R);continue}var F={line:L,ch:D},V={line:I,ch:M},U=u.getRange(F,V),G=WebInspector.Gradient.fromString(U);if(!G){N=E.exec(R);continue}var H=new WebInspector.TextMarker(u.markText(F,V),WebInspector.TextMarker.Type.Gradient);C.push(H),"function"==typeof S&&S(H,G,U),N=E.exec(R)}return C}function createCodeMirrorCubicBezierTextMarkers(u,_,S){var C=/(cubic-bezier\([^)]+\)|\b\w+\b(?:-\b\w+\b){0,2})/g;return createCodeMirrorTextMarkers("CubicBezier",C,null,u,_,S)}function createCodeMirrorSpringTextMarkers(u,_,S){const C=/(spring\([^)]+\))/g;return createCodeMirrorTextMarkers("Spring",C,null,u,_,S)}function createCodeMirrorVariableTextMarkers(u,_,S){const C=/var\((--[\w-]+)\)/g;return createCodeMirrorTextMarkers("Variable",C,null,u,_,S)}WebInspector.CollectionContentView=class extends WebInspector.ContentView{constructor(_){super(_),this.representedObject.addEventListener(WebInspector.Collection.Event.ItemAdded,this._handleItemAdded,this),this.representedObject.addEventListener(WebInspector.Collection.Event.ItemRemoved,this._handleItemRemoved,this),this._contentViewMap=new WeakMap,this._handleClickMap=new WeakMap,this._contentViewConstructor=null;let S="";switch(this.representedObject.typeVerifier){case WebInspector.Collection.TypeVerifier.Frame:S=WebInspector.UIString("Frames");break;case WebInspector.Collection.TypeVerifier.ContentFlow:S=WebInspector.UIString("Flows");break;case WebInspector.Collection.TypeVerifier.Script:S=WebInspector.UIString("Extra Scripts");break;case WebInspector.Collection.TypeVerifier.Resource:S=WebInspector.UIString("Resource");break;case WebInspector.ResourceCollection.TypeVerifier.Document:S=WebInspector.Resource.displayNameForType(WebInspector.Resource.Type.Document,!0);break;case WebInspector.ResourceCollection.TypeVerifier.Stylesheet:S=WebInspector.Resource.displayNameForType(WebInspector.Resource.Type.Stylesheet,!0);break;case WebInspector.ResourceCollection.TypeVerifier.Image:this._contentViewConstructor=WebInspector.ImageResourceContentView,S=WebInspector.Resource.displayNameForType(WebInspector.Resource.Type.Image,!0);break;case WebInspector.ResourceCollection.TypeVerifier.Font:S=WebInspector.Resource.displayNameForType(WebInspector.Resource.Type.Font,!0);break;case WebInspector.ResourceCollection.TypeVerifier.Script:S=WebInspector.Resource.displayNameForType(WebInspector.Resource.Type.Script,!0);break;case WebInspector.ResourceCollection.TypeVerifier.XHR:S=WebInspector.Resource.displayNameForType(WebInspector.Resource.Type.XHR,!0);break;case WebInspector.ResourceCollection.TypeVerifier.Fetch:S=WebInspector.Resource.displayNameForType(WebInspector.Resource.Type.Fetch,!0);break;case WebInspector.ResourceCollection.TypeVerifier.WebSocket:S=WebInspector.Resource.displayNameForType(WebInspector.Resource.Type.WebSocket,!0);break;case WebInspector.ResourceCollection.TypeVerifier.Other:S=WebInspector.Resource.displayNameForType(WebInspector.Resource.Type.Other,!0);}this._contentPlaceholder=new WebInspector.TitleView(S),this.element.classList.add("collection")}initialLayout(){let _=this.representedObject.items;if(this._contentViewConstructor&&_.size)for(let S of _)this._addContentViewForItem(S);else this.addSubview(this._contentPlaceholder)}_addContentViewForItem(_){if(this._contentViewConstructor){this._contentPlaceholder.parentView&&this.removeSubview(this._contentPlaceholder);let S=new this._contentViewConstructor(_);S.addEventListener(WebInspector.ResourceContentView.Event.ContentError,this._handleContentError,this);let C=f=>{0!==f.button||f.ctrlKey||WebInspector.showRepresentedObject(_)};this._handleClickMap.set(_,C),S.element.addEventListener("click",C),S.element.title=WebInspector.displayNameForURL(_.url,_.urlComponents),this.addSubview(S),this._contentViewMap.set(_,S)}}_removeContentViewForItem(_){if(this._contentViewConstructor){let S=this._contentViewMap.get(_);if(S){this.removeSubview(S),this._contentViewMap.delete(_),S.removeEventListener(null,null,this);let C=this._handleClickMap.get(_);C&&(S.element.removeEventListener("click",C),this._handleClickMap.delete(_)),this.representedObject.resources.length||this.addSubview(this._contentPlaceholder)}}}_handleItemAdded(_){let S=_.data.item;S&&this._addContentViewForItem(S)}_handleItemRemoved(_){let S=_.data.item;S&&this._removeContentViewForItem(S)}_handleContentError(_){_&&_.target&&this._removeContentViewForItem(_.target.representedObject)}},WebInspector.ColorPicker=class extends WebInspector.Object{constructor(){function _(C,{min:T=0,max:E=100,step:I=1,units:f}={}){let R=S.createChild("div");R.append(C);let N=R.createChild("input");return N.type="number",N.min=T,N.max=E,N.step=I,N.addEventListener("input",this._handleColorInputInput.bind(this)),f&&f.length&&R.append(f),{containerElement:R,numberInputElement:N}}super(),this._colorWheel=new WebInspector.ColorWheel,this._colorWheel.delegate=this,this._colorWheel.dimension=200,this._brightnessSlider=new WebInspector.Slider,this._brightnessSlider.delegate=this,this._brightnessSlider.element.classList.add("brightness"),this._opacitySlider=new WebInspector.Slider,this._opacitySlider.delegate=this,this._opacitySlider.element.classList.add("opacity");let S=document.createElement("div");S.classList.add("color-inputs"),this._colorInputs=new Map([["R",_.call(this,"R",{max:255})],["G",_.call(this,"G",{max:255})],["B",_.call(this,"B",{max:255})],["H",_.call(this,"H",{max:360})],["S",_.call(this,"S",{units:"%"})],["L",_.call(this,"L",{units:"%"})],["A",_.call(this,"A"),{max:1,step:0.01}]]),this._element=document.createElement("div"),this._element.classList.add("color-picker"),this._element.appendChild(this._colorWheel.element),this._element.appendChild(this._brightnessSlider.element),this._element.appendChild(this._opacitySlider.element),this._element.appendChild(S),this._opacity=0,this._opacityPattern="url(Images/Checkers.svg)",this._color=WebInspector.Color.fromString("white"),this._dontUpdateColor=!1,this._enableColorComponentInputs=!0}get element(){return this._element}set brightness(_){_===this._brightness||(this._colorWheel.brightness=_,this._updateColor(),this._updateSliders(this._colorWheel.rawColor,this._colorWheel.tintedColor))}set opacity(_){_===this._opacity||(this._opacity=_,this._updateColor())}get colorWheel(){return this._colorWheel}get color(){return this._color}set color(_){this._dontUpdateColor=!0;let S=!this._color||this._color.format!==_.format;this._color=_,this._colorWheel.tintedColor=this._color,this._brightnessSlider.value=this._colorWheel.brightness,this._opacitySlider.value=this._color.alpha,this._updateSliders(this._colorWheel.rawColor,this._color),this._showColorComponentInputs(),S&&this._handleFormatChange(),this._dontUpdateColor=!1}set enableColorComponentInputs(_){this._enableColorComponentInputs=_,this._showColorComponentInputs()}colorWheelColorDidChange(){this._updateColor(),this._updateSliders(this._colorWheel.rawColor,this._colorWheel.tintedColor)}sliderValueDidChange(_,S){_===this._opacitySlider?this.opacity=S:_===this._brightnessSlider&&(this.brightness=S)}_updateColor(){if(!this._dontUpdateColor){let _=Math.round(100*this._opacity)/100,S=this._color.format,C=null;S===WebInspector.Color.Format.HSL||S===WebInspector.Color.Format.HSLA?(C=this._colorWheel.tintedColor.hsl.concat(_),1!=_&&(S=WebInspector.Color.Format.HSLA)):(C=this._colorWheel.tintedColor.rgb.concat(_),1!=_&&S===WebInspector.Color.Format.RGB&&(S=WebInspector.Color.Format.RGBA));let f=this._color.format===S;this._color=new WebInspector.Color(S,C),this._showColorComponentInputs(),this.dispatchEventToListeners(WebInspector.ColorPicker.Event.ColorChanged,{color:this._color}),f&&this._handleFormatChange()}}_updateSliders(_){var C=this._colorWheel.tintedColor.rgb,f=new WebInspector.Color(WebInspector.Color.Format.RGBA,C.concat(1)).toString(),T=new WebInspector.Color(WebInspector.Color.Format.RGBA,C.concat(0)).toString();this._opacitySlider.element.style.backgroundImage="linear-gradient(90deg, "+T+", "+f+"), "+this._opacityPattern,this._brightnessSlider.element.style.backgroundImage="linear-gradient(90deg, black, "+_+")"}_handleFormatChange(){this._element.classList.toggle("hide-inputs",this._color.format!==WebInspector.Color.Format.Keyword&&this._color.format!==WebInspector.Color.Format.RGB&&this._color.format!==WebInspector.Color.Format.RGBA&&this._color.format!==WebInspector.Color.Format.HEX&&this._color.format!==WebInspector.Color.Format.ShortHEX&&this._color.format!==WebInspector.Color.Format.HEXAlpha&&this._color.format!==WebInspector.Color.Format.ShortHEXAlpha&&this._color.format!==WebInspector.Color.Format.HSL&&this._color.format!==WebInspector.Color.Format.HSLA),this.dispatchEventToListeners(WebInspector.ColorPicker.Event.FormatChanged)}_showColorComponentInputs(){function _(R,N){let{containerElement:L,numberInputElement:D}=this._colorInputs.get(R);D.value=N,L.hidden=!1}for(let{containerElement:R}of this._colorInputs.values())R.hidden=!0;if(this._enableColorComponentInputs){switch(this._color.format){case WebInspector.Color.Format.RGB:case WebInspector.Color.Format.RGBA:case WebInspector.Color.Format.HEX:case WebInspector.Color.Format.ShortHEX:case WebInspector.Color.Format.HEXAlpha:case WebInspector.Color.Format.ShortHEXAlpha:case WebInspector.Color.Format.Keyword:var[S,C,f]=this._color.rgb;_.call(this,"R",S),_.call(this,"G",C),_.call(this,"B",f);break;case WebInspector.Color.Format.HSL:case WebInspector.Color.Format.HSLA:var[T,E,I]=this._color.hsl;_.call(this,"H",T),_.call(this,"S",E),_.call(this,"L",I);break;default:return;}(this._color.format===WebInspector.Color.Format.Keyword&&1!==this._color.alpha||this._color.format===WebInspector.Color.Format.RGBA||this._color.format===WebInspector.Color.Format.HSLA||this._color.format===WebInspector.Color.Format.HEXAlpha||this._color.format===WebInspector.Color.Format.ShortHEXAlpha)&&_.call(this,"A",this._color.alpha)}}_handleColorInputInput(){if(!this._enableColorComponentInputs)return void WebInspector.reportInternalError("Input event fired for disabled color component input");let S=this._colorInputs.get("R").numberInputElement.value,C=this._colorInputs.get("G").numberInputElement.value,f=this._colorInputs.get("B").numberInputElement.value,T=this._colorInputs.get("H").numberInputElement.value,E=this._colorInputs.get("S").numberInputElement.value,I=this._colorInputs.get("L").numberInputElement.value,R=this._colorInputs.get("A").numberInputElement.value,N="",L=this._color.format;switch(L){case WebInspector.Color.Format.RGB:case WebInspector.Color.Format.HEX:case WebInspector.Color.Format.ShortHEX:case WebInspector.Color.Format.Keyword:N=`rgb(${S}, ${C}, ${f})`;break;case WebInspector.Color.Format.RGBA:case WebInspector.Color.Format.HEXAlpha:case WebInspector.Color.Format.ShortHEXAlpha:N=`rgba(${S}, ${C}, ${f}, ${R})`;break;case WebInspector.Color.Format.HSL:N=`hsl(${T}, ${E}%, ${I}%)`;break;case WebInspector.Color.Format.HSLA:N=`hsla(${T}, ${E}%, ${I}%, ${R})`;break;default:return void WebInspector.reportInternalError(`Input event fired for invalid color format "${this._color.format}"`);}this.color=WebInspector.Color.fromString(N),this._color.format=L,this.dispatchEventToListeners(WebInspector.ColorPicker.Event.ColorChanged,{color:this._color})}},WebInspector.ColorPicker.Event={ColorChanged:"css-color-picker-color-changed",FormatChanged:"css-color-picker-format-changed"},WebInspector.ColorWheel=class extends WebInspector.Object{constructor(){super(),this._rawCanvas=document.createElement("canvas"),this._tintedCanvas=document.createElement("canvas"),this._finalCanvas=document.createElement("canvas"),this._crosshair=document.createElement("div"),this._crosshair.className="crosshair",this._element=document.createElement("div"),this._element.className="color-wheel",this._element.appendChild(this._finalCanvas),this._element.appendChild(this._crosshair),this._finalCanvas.addEventListener("mousedown",this)}set dimension(_){this._element.style.width=this.element.style.height=`${_}px`,this._finalCanvas.width=this._tintedCanvas.width=this._rawCanvas.width=_*window.devicePixelRatio,this._finalCanvas.height=this._tintedCanvas.height=this._rawCanvas.height=_*window.devicePixelRatio,this._finalCanvas.style.width=this._finalCanvas.style.height=_+"px",this._dimension=_,this._radius=_/2-2,this._setCrosshairPosition(new WebInspector.Point(_/2,_/2)),this._drawRawCanvas(),this._draw()}get element(){return this._element}get brightness(){return this._brightness}set brightness(_){this._brightness=_,this._draw()}get tintedColor(){return this._crosshairPosition?this._colorAtPointWithBrightness(this._crosshairPosition.x*window.devicePixelRatio,this._crosshairPosition.y*window.devicePixelRatio,this._brightness):new WebInspector.Color(WebInspector.Color.Format.RGBA,[0,0,0,0])}set tintedColor(_){var S=this._tintedColorToPointAndBrightness(_);this._setCrosshairPosition(S.point),this.brightness=S.brightness}get rawColor(){return this._crosshairPosition?this._colorAtPointWithBrightness(this._crosshairPosition.x*window.devicePixelRatio,this._crosshairPosition.y*window.devicePixelRatio,1):new WebInspector.Color(WebInspector.Color.Format.RGBA,[0,0,0,0])}handleEvent(_){switch(_.type){case"mousedown":this._handleMousedown(_);break;case"mousemove":this._handleMousemove(_);break;case"mouseup":this._handleMouseup(_);}}_handleMousedown(_){window.addEventListener("mousemove",this,!0),window.addEventListener("mouseup",this,!0),this._updateColorForMouseEvent(_)}_handleMousemove(_){this._updateColorForMouseEvent(_)}_handleMouseup(){window.removeEventListener("mousemove",this,!0),window.removeEventListener("mouseup",this,!0)}_pointInCircleForEvent(_){function C(N,L){return Math.atan2(L.y-N.y,L.x-N.x)}function f(N,L,D){return new WebInspector.Point(N.x+L*Math.cos(D),N.y+L*Math.sin(D))}var T=this._dimension,E=window.webkitConvertPointFromPageToNode(this._finalCanvas,new WebKitPoint(_.pageX,_.pageY)),I=new WebInspector.Point(T/2,T/2);if(function(N,L){return Math.sqrt(Math.pow(N.x-L.x,2)+Math.pow(N.y-L.y,2))}(E,I)>this._radius){var R=C(I,E);E=f(I,this._radius,R)}return E}_updateColorForMouseEvent(_){var S=this._pointInCircleForEvent(_);this._setCrosshairPosition(S),this.delegate&&"function"==typeof this.delegate.colorWheelColorDidChange&&this.delegate.colorWheelColorDidChange(this)}_setCrosshairPosition(_){this._crosshairPosition=_,this._crosshair.style.webkitTransform="translate("+Math.round(_.x)+"px, "+Math.round(_.y)+"px)"}_tintedColorToPointAndBrightness(_){var S=_.rgb,C=WebInspector.Color.rgb2hsv(S[0],S[1],S[2]),f=Math.cos(C[0]*Math.PI/180),T=Math.sin(C[0]*Math.PI/180),E=this._dimension/2,I=E+E*f*C[1],R=E-E*T*C[1];return{point:new WebInspector.Point(I,R),brightness:C[2]}}_drawRawCanvas(){var _=this._rawCanvas.getContext("2d"),S=this._dimension*window.devicePixelRatio;_.fillStyle="white",_.fillRect(0,0,S,S);for(var C=_.getImageData(0,0,S,S),f=C.data,T=0;TP-F&&(R=M-F),this._element.style.left=I+"px",this._element.style.top=R+"px",this._element.style.width=L+"px",this._element.style.height=F+"px",document.body.appendChild(this._element)}hide(){this._element.remove()}update(_,S){this._containerElement.removeChildren(),"number"==typeof S&&(this._selectedIndex=S);for(var C=0,f;C<_.length;++C)f=document.createElement("div"),f.className=WebInspector.CompletionSuggestionsView.ItemElementStyleClassName,f.textContent=_[C],C===this._selectedIndex&&f.classList.add(WebInspector.CompletionSuggestionsView.SelectedItemStyleClassName),this._containerElement.appendChild(f),this._delegate&&"function"==typeof this._delegate.completionSuggestionsViewCustomizeCompletionElement&&this._delegate.completionSuggestionsViewCustomizeCompletionElement(this,f,_[C])}get _selectedItemElement(){if(isNaN(this._selectedIndex))return null;var _=this._containerElement.children[this._selectedIndex]||null;return _}_mouseDown(_){0!==_.button||(this._mouseIsDown=!0)}_mouseUp(_){0!==_.button||(this._mouseIsDown=!1)}_itemClicked(_){if(0===_.button){var S=_.target.enclosingNodeOrSelfWithClass(WebInspector.CompletionSuggestionsView.ItemElementStyleClassName);!S||this._delegate&&"function"==typeof this._delegate.completionSuggestionsClickedCompletion&&this._delegate.completionSuggestionsClickedCompletion(this,S.textContent)}}},WebInspector.CompletionSuggestionsView.ItemElementStyleClassName="item",WebInspector.CompletionSuggestionsView.SelectedItemStyleClassName="selected",WebInspector.ComputedStyleDetailsPanel=class extends WebInspector.StyleDetailsPanel{constructor(_){super(_,WebInspector.ComputedStyleDetailsPanel.StyleClassName,"computed",WebInspector.UIString("Styles \u2014 Computed")),this._computedStyleShowAllSetting=new WebInspector.Setting("computed-style-show-all",!1),this.cssStyleDeclarationTextEditorShouldAddPropertyGoToArrows=!0}get regionFlow(){return this._regionFlow}set regionFlow(_){this._regionFlow=_,this._regionFlowNameLabelValue.textContent=_?_.name:"",this._regionFlowNameRow.value=_?this._regionFlowFragment:null,this._updateFlowNamesSectionVisibility()}get contentFlow(){return this._contentFlow}set contentFlow(_){this._contentFlow=_,this._contentFlowNameLabelValue.textContent=_?_.name:"",this._contentFlowNameRow.value=_?this._contentFlowFragment:null,this._updateFlowNamesSectionVisibility()}get containerRegions(){return this._containerRegions}set containerRegions(_){if(this._containerRegions=_,!_||!_.length)return void this._containerRegionsFlowSection.element.classList.add("hidden");this._containerRegionsDataGrid.removeChildren();for(var S of _)this._containerRegionsDataGrid.appendChild(new WebInspector.DOMTreeDataGridNode(S));this._containerRegionsFlowSection.element.classList.remove("hidden"),this._containerRegionsDataGrid.updateLayoutIfNeeded()}cssStyleDeclarationTextEditorShowProperty(_,S){function C(){"function"==typeof this._delegate.computedStyleDetailsPanelShowProperty&&this._delegate.computedStyleDetailsPanelShowProperty(_)}if(!S)return void C.call(this);let f=this._nodeStyles.effectivePropertyForName(_.name);if(!f||!f.styleSheetTextRange){if(!f.relatedShorthandProperty)return void C.call(this);f=f.relatedShorthandProperty}let T=f.ownerStyle.ownerRule;if(!T)return void C.call(this);let E=T.sourceCodeLocation.sourceCode,{startLine:I,startColumn:R}=f.styleSheetTextRange;WebInspector.showSourceCodeLocation(E.createSourceCodeLocation(I,R),{ignoreNetworkTab:!0,ignoreSearchTab:!0})}refresh(_){return _?void(this._propertiesTextEditor.style=this.nodeStyles.computedStyle,this._variablesTextEditor.style=this.nodeStyles.computedStyle,this._refreshFlowDetails(this.nodeStyles.node),this._boxModelDiagramRow.nodeStyles=this.nodeStyles,super.refresh(),this._variablesSection.element.classList.toggle("hidden",!this._variablesTextEditor.shownProperties.length)):void super.refresh()}filterDidChange(_){let S=_.filters.text;this._propertiesTextEditor.removeNonMatchingProperties(S),this._variablesTextEditor.removeNonMatchingProperties(S)}initialLayout(){let _=document.createElement("label");_.textContent=WebInspector.UIString("Show All"),this._computedStyleShowAllCheckbox=document.createElement("input"),this._computedStyleShowAllCheckbox.type="checkbox",this._computedStyleShowAllCheckbox.checked=this._computedStyleShowAllSetting.value,this._computedStyleShowAllCheckbox.addEventListener("change",this._computedStyleShowAllCheckboxValueChanged.bind(this)),_.appendChild(this._computedStyleShowAllCheckbox),this._propertiesTextEditor=new WebInspector.CSSStyleDeclarationTextEditor(this),this._propertiesTextEditor.propertyVisibilityMode=WebInspector.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.HideVariables,this._propertiesTextEditor.showsImplicitProperties=this._computedStyleShowAllSetting.value,this._propertiesTextEditor.alwaysShowPropertyNames=["display","width","height"],this._propertiesTextEditor.sortProperties=!0;let S=new WebInspector.DetailsSectionRow,C=new WebInspector.DetailsSectionGroup([S]),f=new WebInspector.DetailsSection("computed-style-properties",WebInspector.UIString("Properties"),[C],_);f.addEventListener(WebInspector.DetailsSection.Event.CollapsedStateChanged,this._handlePropertiesSectionCollapsedStateChanged,this),this.addSubview(this._propertiesTextEditor),S.element.appendChild(this._propertiesTextEditor.element),this._variablesTextEditor=new WebInspector.CSSStyleDeclarationTextEditor(this),this._variablesTextEditor.propertyVisibilityMode=WebInspector.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.HideNonVariables,this._variablesTextEditor.sortProperties=!0;let T=new WebInspector.DetailsSectionRow,E=new WebInspector.DetailsSectionGroup([T]);this._variablesSection=new WebInspector.DetailsSection("computed-style-properties",WebInspector.UIString("Variables"),[E]),this._variablesSection.addEventListener(WebInspector.DetailsSection.Event.CollapsedStateChanged,this._handleVariablesSectionCollapsedStateChanged,this),this.addSubview(this._variablesTextEditor),T.element.appendChild(this._variablesTextEditor.element),this._regionFlowFragment=document.createElement("span"),this._regionFlowFragment.appendChild(document.createElement("img")).className="icon",this._regionFlowNameLabelValue=this._regionFlowFragment.appendChild(document.createElement("span"));let I=this._regionFlowFragment.appendChild(WebInspector.createGoToArrowButton());I.addEventListener("click",this._goToRegionFlowArrowWasClicked.bind(this)),this._regionFlowNameRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Region Flow")),this._regionFlowNameRow.element.classList.add("content-flow-link"),this._contentFlowFragment=document.createElement("span"),this._contentFlowFragment.appendChild(document.createElement("img")).className="icon",this._contentFlowNameLabelValue=this._contentFlowFragment.appendChild(document.createElement("span"));let R=this._contentFlowFragment.appendChild(WebInspector.createGoToArrowButton());R.addEventListener("click",this._goToContentFlowArrowWasClicked.bind(this)),this._contentFlowNameRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Content Flow")),this._contentFlowNameRow.element.classList.add("content-flow-link");let N=new WebInspector.DetailsSectionGroup([this._regionFlowNameRow,this._contentFlowNameRow]);this._flowNamesSection=new WebInspector.DetailsSection("content-flow",WebInspector.UIString("Flows"),[N]),this._containerRegionsDataGrid=new WebInspector.DOMTreeDataGrid,this._containerRegionsDataGrid.headerVisible=!1,this._containerRegionsRow=new WebInspector.DetailsSectionDataGridRow(this._containerRegionsDataGrid);let L=new WebInspector.DetailsSectionGroup([this._containerRegionsRow]);this._containerRegionsFlowSection=new WebInspector.DetailsSection("container-regions",WebInspector.UIString("Container Regions"),[L]),this.element.appendChild(f.element),this.element.appendChild(this._variablesSection.element),this.element.appendChild(this._flowNamesSection.element),this.element.appendChild(this._containerRegionsFlowSection.element),this._resetFlowDetails(),this._boxModelDiagramRow=new WebInspector.BoxModelDetailsSectionRow;let D=new WebInspector.DetailsSectionGroup([this._boxModelDiagramRow]),M=new WebInspector.DetailsSection("style-box-model",WebInspector.UIString("Box Model"),[D]);this.element.appendChild(M.element)}sizeDidChange(){super.sizeDidChange(),this._containerRegionsRow.sizeDidChange()}_computedStyleShowAllCheckboxValueChanged(){let S=this._computedStyleShowAllCheckbox.checked;this._computedStyleShowAllSetting.value=S,this._propertiesTextEditor.showsImplicitProperties=S,this._propertiesTextEditor.updateLayout()}_handlePropertiesSectionCollapsedStateChanged(_){_&&_.data&&!_.data.collapsed&&this._propertiesTextEditor.refresh()}_handleVariablesSectionCollapsedStateChanged(_){_&&_.data&&!_.data.collapsed&&this._variablesTextEditor.refresh()}_updateFlowNamesSectionVisibility(){this._flowNamesSection.element.classList.toggle("hidden",!this._contentFlow&&!this._regionFlow)}_resetFlowDetails(){this.regionFlow=null,this.contentFlow=null,this.containerRegions=null}_refreshFlowDetails(_){this._resetFlowDetails();_&&WebInspector.domTreeManager.getNodeContentFlowInfo(_,function(C,f){return C||!f?void this._resetFlowDetails():void(this.regionFlow=f.regionFlow,this.contentFlow=f.contentFlow,this.containerRegions=f.regions)}.bind(this))}_goToRegionFlowArrowWasClicked(){WebInspector.showRepresentedObject(this._regionFlow)}_goToContentFlowArrowWasClicked(){WebInspector.showRepresentedObject(this._contentFlow,{nodeToSelect:this.nodeStyles.node})}},WebInspector.ComputedStyleDetailsPanel.StyleClassName="computed",WebInspector.ConsoleDrawer=class extends WebInspector.ContentBrowser{constructor(_){super(_,null,!0,!1),this.element.classList.add("console-drawer"),this._drawerHeightSetting=new WebInspector.Setting("console-drawer-height",150),this.navigationBar.element.addEventListener("mousedown",this._consoleResizerMouseDown.bind(this)),this._toggleDrawerButton=new WebInspector.ToggleButtonNavigationItem("toggle-drawer",WebInspector.UIString("Hide Console"),WebInspector.UIString("Show Console"),"Images/HideConsoleDrawer.svg","Images/ShowConsoleDrawer.svg"),this._toggleDrawerButton.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,()=>{WebInspector.toggleSplitConsole()}),this.navigationBar.insertNavigationItem(this._toggleDrawerButton,0),this.collapsed=!0,WebInspector.TabBrowser.addEventListener(WebInspector.TabBrowser.Event.SelectedTabContentViewDidChange,this._selectedTabContentViewDidChange,this)}get collapsed(){return this._collapsed}set collapsed(_){_===this._collapsed||(this._collapsed=_||!1,this._toggleDrawerButton.toggled=this._collapsed,this.element.classList.toggle("hidden",this._collapsed),this._collapsed?this.hidden():this.shown(),this.dispatchEventToListeners(WebInspector.ConsoleDrawer.Event.CollapsedStateChanged))}get height(){return this.element.offsetHeight}shown(){super.shown(),this._restoreDrawerHeight()}layout(){if(!this._collapsed&&this.layoutReason===WebInspector.View.LayoutReason.Resize){super.layout();let _=this.height;this._restoreDrawerHeight(),_!==this.height&&this.dispatchEventToListeners(WebInspector.ConsoleDrawer.Event.Resized)}}_consoleResizerMouseDown(_){function S(E){let I=window.innerHeight-E.pageY-T;this._drawerHeightSetting.value=I,this._updateDrawerHeight(I),this.collapsed=!1}function C(E){0!==E.button||WebInspector.elementDragEnd(E)}if(!(0!==_.button||_.ctrlKey)&&(_.target===this.navigationBar.element||_.target.classList.contains("flexible-space"))){let f=_.target,T=f.offsetHeight-(_.pageY-f.totalOffsetTop);WebInspector.elementDragStart(f,S.bind(this),C.bind(this),_,"row-resize")}}_restoreDrawerHeight(){this._updateDrawerHeight(this._drawerHeightSetting.value)}_updateDrawerHeight(_){const C=this.element.parentNode.offsetHeight-100;_=Number.constrain(_,64,C);_===this.element.style.height||(this.element.style.height=_+"px",this.dispatchEventToListeners(WebInspector.ConsoleDrawer.Event.Resized))}_selectedTabContentViewDidChange(){WebInspector.doesCurrentTabSupportSplitContentBrowser()||this.element.classList.add("hidden")}},WebInspector.ConsoleDrawer.Event={CollapsedStateChanged:"console-drawer-collapsed-state-changed",Resized:"console-drawer-resized"},WebInspector.ConsoleGroup=class extends WebInspector.Object{constructor(_){super(),this._parentGroup=_}get parentGroup(){return this._parentGroup}render(_){var S=document.createElement("div");S.className="console-group",S.group=this,this.element=S;var C=_.element;C.classList.add(WebInspector.LogContentView.ItemWrapperStyleClassName),C.addEventListener("click",this._titleClicked.bind(this)),C.addEventListener("mousedown",this._titleMouseDown.bind(this)),S&&_.message.type===WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed&&S.classList.add("collapsed"),S.appendChild(C);var f=document.createElement("div");return this._messagesElement=f,f.className="console-group-messages",S.appendChild(f),S}addMessageView(_){var S=_.element;S.classList.add(WebInspector.LogContentView.ItemWrapperStyleClassName),this.append(S)}append(_){this._messagesElement.appendChild(_)}_titleMouseDown(_){_.preventDefault()}_titleClicked(_){var S=_.target.enclosingNodeOrSelfWithClass("console-group-title");if(S){var C=S.enclosingNodeOrSelfWithClass("console-group");C&&(C.classList.contains("collapsed")?C.classList.remove("collapsed"):C.classList.add("collapsed")),S.scrollIntoViewIfNeeded(!0)}}},WebInspector.ConsolePrompt=class extends WebInspector.View{constructor(_,S){super(),S=parseMIMEType(S).type,this.element.classList.add("console-prompt",WebInspector.SyntaxHighlightedStyleClassName),this._delegate=_||null,this._codeMirror=WebInspector.CodeMirrorEditor.create(this.element,{lineWrapping:!0,mode:{name:S,globalVars:!0},indentWithTabs:!0,indentUnit:4,matchBrackets:!0});var C={Up:this._handlePreviousKey.bind(this),Down:this._handleNextKey.bind(this),"Ctrl-P":this._handlePreviousKey.bind(this),"Ctrl-N":this._handleNextKey.bind(this),Enter:this._handleEnterKey.bind(this),"Cmd-Enter":this._handleCommandEnterKey.bind(this),Tab:this._handleTabKey.bind(this),Esc:this._handleEscapeKey.bind(this)};this._codeMirror.addKeyMap(C),this._completionController=new WebInspector.CodeMirrorCompletionController(this._codeMirror,this),this._completionController.addExtendedCompletionProvider("javascript",WebInspector.javaScriptRuntimeCompletionProvider),this._history=[{}],this._historyIndex=0}get delegate(){return this._delegate}set delegate(_){this._delegate=_||null}set escapeKeyHandlerWhenEmpty(_){this._escapeKeyHandlerWhenEmpty=_}get text(){return this._codeMirror.getValue()}set text(_){this._codeMirror.setValue(_||""),this._codeMirror.clearHistory(),this._codeMirror.markClean()}get history(){return this._history[this._historyIndex]=this._historyEntryForCurrentText(),this._history}set history(_){this._history=_ instanceof Array?_.slice(0,WebInspector.ConsolePrompt.MaximumHistorySize):[{}],this._historyIndex=0,this._restoreHistoryEntry(0)}get focused(){return this._codeMirror.getWrapperElement().classList.contains("CodeMirror-focused")}focus(){this._codeMirror.focus()}updateCompletions(_,S){this._completionController.updateCompletions(_,S)}pushHistoryItem(_){this._commitHistoryEntry({text:_})}completionControllerCompletionsNeeded(_,S,C,f,T,E){this.delegate&&"function"==typeof this.delegate.consolePromptCompletionsNeeded?this.delegate.consolePromptCompletionsNeeded(this,C,f,S,T,E):this._completionController.updateCompletions(C)}completionControllerShouldAllowEscapeCompletion(){return!!this.text}layout(){this._codeMirror.refresh()}_handleTabKey(_){var S=_.getCursor(),C=_.getLine(S.line);if(!C.trim().length)return CodeMirror.Pass;var f=C.search(/[^\s]/);return S.ch<=f?CodeMirror.Pass:void this._completionController.completeAtCurrentPositionIfNeeded().then(function(T){T===WebInspector.CodeMirrorCompletionController.UpdatePromise.NoCompletionsFound&&InspectorFrontendHost.beep()})}_handleEscapeKey(){return this.text?CodeMirror.Pass:this._escapeKeyHandlerWhenEmpty?void this._escapeKeyHandlerWhenEmpty():CodeMirror.Pass}_handlePreviousKey(){if(this._codeMirror.somethingSelected())return CodeMirror.Pass;if(this._codeMirror.getCursor().line)return CodeMirror.Pass;var S=this._history[this._historyIndex+1];return S?void(this._rememberCurrentTextInHistory(),++this._historyIndex,this._restoreHistoryEntry(this._historyIndex)):CodeMirror.Pass}_handleNextKey(){if(this._codeMirror.somethingSelected())return CodeMirror.Pass;if(this._codeMirror.getCursor().line!==this._codeMirror.lastLine())return CodeMirror.Pass;var S=this._history[this._historyIndex-1];return S?void(this._rememberCurrentTextInHistory(),--this._historyIndex,this._restoreHistoryEntry(this._historyIndex)):CodeMirror.Pass}_handleEnterKey(_,S,C){function f(D,M){return D.line===M.line&&D.ch===M.ch}function T(D){return D?void(this._commitHistoryEntry(this._historyEntryForCurrentText()),!C&&(this._codeMirror.setValue(""),this._codeMirror.clearHistory()),this.delegate&&"function"==typeof this.delegate.consolePromptHistoryDidChange&&this.delegate.consolePromptHistoryDidChange(this),this.delegate&&"function"==typeof this.delegate.consolePromptTextCommitted&&this.delegate.consolePromptTextCommitted(this,E)):void(f(I,this._codeMirror.getCursor())&&CodeMirror.commands.newlineAndIndent(this._codeMirror))}var E=this.text;if(E.trim()){var I=this._codeMirror.getCursor(),R=this._codeMirror.lastLine(),N=this._codeMirror.getLine(R).length,L=f(I,{line:R,ch:N});return!S&&this.delegate&&"function"==typeof this.delegate.consolePromptShouldCommitText?void this.delegate.consolePromptShouldCommitText(this,E,L,T.bind(this)):void T.call(this,!0)}}_commitHistoryEntry(_){this._history[1]&&(!this._history[1].text||this._history[1].text===_.text)?(this._history[1]=_,this._history[0]={}):(this._history[0]=_,this._history.unshift({}),this._history.length>WebInspector.ConsolePrompt.MaximumHistorySize&&(this._history=this._history.slice(0,WebInspector.ConsolePrompt.MaximumHistorySize))),this._historyIndex=0}_handleCommandEnterKey(_){this._handleEnterKey(_,!0,!0)}_restoreHistoryEntry(_){var S=this._history[_];this._codeMirror.setValue(S.text||""),S.undoHistory?this._codeMirror.setHistory(S.undoHistory):this._codeMirror.clearHistory(),this._codeMirror.setCursor(S.cursor||{line:0})}_historyEntryForCurrentText(){return{text:this.text,undoHistory:this._codeMirror.getHistory(),cursor:this._codeMirror.getCursor()}}_rememberCurrentTextInHistory(){this._history[this._historyIndex]=this._historyEntryForCurrentText(),this.delegate&&"function"==typeof this.delegate.consolePromptHistoryDidChange&&this.delegate.consolePromptHistoryDidChange(this)}},WebInspector.ConsolePrompt.MaximumHistorySize=30,WebInspector.ConsoleSession=class extends WebInspector.Object{constructor(_){super(),this._hasMessages=!1;let S=document.createElement("div");S.className="console-session";let C=document.createElement("div");C.classList.add("console-session-header");let f="";switch(_.newSessionReason){case WebInspector.ConsoleSession.NewSessionReason.PageReloaded:f=WebInspector.UIString("Page reloaded at %s");break;case WebInspector.ConsoleSession.NewSessionReason.PageNavigated:f=WebInspector.UIString("Page navigated at %s");break;case WebInspector.ConsoleSession.NewSessionReason.ConsoleCleared:f=WebInspector.UIString("Console cleared at %s");break;default:f=WebInspector.UIString("Console opened at %s");}let T=_.timestamp||Date.now();C.textContent=f.format(new Date(T).toLocaleTimeString()),S.append(C),this.element=S,this._messagesElement=S}addMessageView(_){var S=_.element;S.classList.add(WebInspector.LogContentView.ItemWrapperStyleClassName),this.append(S)}append(_){this._hasMessages=!0,this._messagesElement.append(_)}hasMessages(){return this._hasMessages}},WebInspector.ConsoleSession.NewSessionReason={PageReloaded:Symbol("Page reloaded"),PageNavigated:Symbol("Page navigated"),ConsoleCleared:Symbol("Console cleared")},WebInspector.ContentFlowDOMTreeContentView=class extends WebInspector.DOMTreeContentView{constructor(_){super(_),_.addEventListener(WebInspector.ContentFlow.Event.ContentNodeWasAdded,this._contentNodeWasAdded,this),_.addEventListener(WebInspector.ContentFlow.Event.ContentNodeWasRemoved,this._contentNodeWasRemoved,this),this._createContentTrees()}closed(){this.representedObject.removeEventListener(null,null,this),super.closed()}getSearchContextNodes(_){_(this.domTreeOutline.children.map(function(S){return S.representedObject.id}))}_createContentTrees(){var _=this.representedObject.contentNodes;for(var S of _)this.domTreeOutline.appendChild(new WebInspector.DOMTreeElement(S));var C=_.length?_[0].ownerDocument.documentURL:null;this._restoreSelectedNodeAfterUpdate(C,_[0])}_contentNodeWasAdded(_){var S=new WebInspector.DOMTreeElement(_.data.node);if(!_.data.before)return void this.domTreeOutline.appendChild(S);var C=this.domTreeOutline.findTreeElement(_.data.before),f=this.domTreeOutline.children.indexOf(C);this.domTreeOutline.insertChild(S,f)}_contentNodeWasRemoved(_){var S=this.domTreeOutline.findTreeElement(_.data.node);this.domTreeOutline.removeChild(S)}},WebInspector.ContentFlowTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_){super("content-flow-icon",_.name,null,_,!1)}},WebInspector.ContentViewContainer=class extends WebInspector.View{constructor(){super(),this.element.classList.add("content-view-container"),this._backForwardList=[],this._currentIndex=-1}get currentIndex(){return this._currentIndex}get backForwardList(){return this._backForwardList}get currentContentView(){return 0>this._currentIndex||this._currentIndex>this._backForwardList.length-1?null:this._backForwardList[this._currentIndex].contentView}get currentBackForwardEntry(){return 0>this._currentIndex||this._currentIndex>this._backForwardList.length-1?null:this._backForwardList[this._currentIndex]}contentViewForRepresentedObject(_,S,C){return WebInspector.ContentView.contentViewForRepresentedObject(_,S,C)}showContentViewForRepresentedObject(_,S){var C=this.contentViewForRepresentedObject(_,!1,S);return C?(this.showContentView(C),C):null}showContentView(_,S){if(!(_ instanceof WebInspector.ContentView))return null;_.parentContainer!==this&&this._takeOwnershipOfContentView(_);let C=this.currentBackForwardEntry,f=null;for(let I=this._backForwardList.length-1;0<=I;--I)if(this._backForwardList[I].contentView===_){f=this._backForwardList[I].makeCopy(S);break}if(f||(f=new WebInspector.BackForwardEntry(_,S)),f.isEqual(C)){return C.prepareToShow(!1),C.contentView}let T=this._currentIndex+1,E=this._backForwardList.splice(T,this._backForwardList.length-T,f);for(let I=0,R;IN.contentView===E[I].contentView),R&&this._disassociateFromContentView(E[I].contentView,E[I].tombstone);return _._parentContainer=this,this.showBackForwardEntryForIndex(T),_}showBackForwardEntryForIndex(_){if(!(0>_||_>this._backForwardList.length-1)&&this._currentIndex!==_){var S=this.currentBackForwardEntry;this._currentIndex=_;var C=this.currentBackForwardEntry,f=!S||!C.contentView.visible;f?(S&&this._hideEntry(S),this._showEntry(C,!0)):this._showEntry(C,!1),this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange)}}replaceContentView(_,S){if(_ instanceof WebInspector.ContentView&&S instanceof WebInspector.ContentView&&_.parentContainer===this&&!(S.parentContainer&&S.parentContainer!==this)){var C=this.currentContentView===_;C&&this._hideEntry(this.currentBackForwardEntry),this._disassociateFromContentView(_,!1),S._parentContainer=this;for(var f=0;f=C&&--this._currentIndex,this._disassociateFromContentView(E.contentView,E.tombstone),this._backForwardList.splice(C,1),T=!0);T&&this._removeIdenticalAdjacentBackForwardEntries();var I=this.currentBackForwardEntry;(I&&I.contentView!==f||T)&&(this._showEntry(I,!0),this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange))}}closeAllContentViews(){if(this._backForwardList.length){for(var _=this.currentContentView,S=0,C;Sthis._backForwardList.length)){let _;for(let S=this._backForwardList.length-1,C;0<=S;--S){if(C=this._backForwardList[S],!C.isEqual(_)){_=C;continue}this._currentIndex>=S&&--this._currentIndex,this._backForwardList.splice(S,1)}}}},WebInspector.ContentViewContainer.Event={CurrentContentViewDidChange:"content-view-container-current-content-view-did-change"},WebInspector.ContentViewContainer.TombstoneContentViewContainersSymbol=Symbol("content-view-container-tombstone-content-view-containers"),WebInspector.ContextMenuItem=class extends WebInspector.Object{constructor(_,S,C,f,T){super(),this._type=S,this._label=C,this._disabled=f,this._checked=T,this._contextMenu=_||this,("item"===S||"checkbox"===S)&&(this._id=_.nextId())}id(){return this._id}type(){return this._type}isEnabled(){return!this._disabled}setEnabled(_){this._disabled=!_}_buildDescriptor(){switch(this._type){case"item":return{type:"item",id:this._id,label:this._label,enabled:!this._disabled};case"separator":return{type:"separator"};case"checkbox":return{type:"checkbox",id:this._id,label:this._label,checked:!!this._checked,enabled:!this._disabled};}}},WebInspector.ContextSubMenuItem=class extends WebInspector.ContextMenuItem{constructor(_,S,C){super(_,"subMenu",S,C),this._items=[]}appendItem(_,S,C){let f=new WebInspector.ContextMenuItem(this._contextMenu,"item",_,C);return this._pushItem(f),this._contextMenu._setHandler(f.id(),S),f}appendSubMenuItem(_,S){let C=new WebInspector.ContextSubMenuItem(this._contextMenu,_,S);return this._pushItem(C),C}appendCheckboxItem(_,S,C,f){let T=new WebInspector.ContextMenuItem(this._contextMenu,"checkbox",_,f,C);return this._pushItem(T),this._contextMenu._setHandler(T.id(),S),T}appendSeparator(){this._items.length&&(this._pendingSeparator=!0)}_pushItem(_){this._pendingSeparator&&(this._items.push(new WebInspector.ContextMenuItem(this._contextMenu,"separator")),this._pendingSeparator=null),this._items.push(_)}isEmpty(){return!this._items.length}_buildDescriptor(){let _=this._items.map(S=>S._buildDescriptor());return{type:"subMenu",label:this._label,enabled:!this._disabled,subItems:_}}},WebInspector.ContextMenu=class extends WebInspector.ContextSubMenuItem{constructor(_){super(null,""),this._event=_,this._handlers={},this._id=0}static createFromEvent(_,S=!1){return _[WebInspector.ContextMenu.ProposedMenuSymbol]||S||(_[WebInspector.ContextMenu.ProposedMenuSymbol]=new WebInspector.ContextMenu(_)),_[WebInspector.ContextMenu.ProposedMenuSymbol]||null}static contextMenuItemSelected(_){WebInspector.ContextMenu._lastContextMenu&&WebInspector.ContextMenu._lastContextMenu._itemSelected(_)}static contextMenuCleared(){}nextId(){return this._id++}show(){let _=this._buildDescriptor();_.length&&(WebInspector.ContextMenu._lastContextMenu=this,"contextmenu"!==this._event.type&&"function"==typeof InspectorFrontendHost.dispatchEventAsContextMenuEvent?(this._menuObject=_,this._event.target.addEventListener("contextmenu",this,!0),InspectorFrontendHost.dispatchEventAsContextMenuEvent(this._event)):InspectorFrontendHost.showContextMenu(this._event,_)),this._event&&this._event.stopImmediatePropagation()}handleEvent(_){this._event.target.removeEventListener("contextmenu",this,!0),InspectorFrontendHost.showContextMenu(_,this._menuObject),this._menuObject=null,_.stopImmediatePropagation()}_setHandler(_,S){S&&(this._handlers[_]=S)}_buildDescriptor(){return this._items.map(_=>_._buildDescriptor())}_itemSelected(_){this._handlers[_]&&this._handlers[_].call(this)}},WebInspector.ContextMenu.ProposedMenuSymbol=Symbol("context-menu-proposed-menu"),WebInspector.appendContextMenuItemsForSourceCode=function(u,_){if(u instanceof WebInspector.ContextMenu){let S=_,C=null;if((_ instanceof WebInspector.SourceCodeLocation&&(S=_.sourceCode,C=_),!!(S instanceof WebInspector.SourceCode))&&(u.appendSeparator(),S.url&&(u.appendItem(WebInspector.UIString("Open in New Tab"),()=>{WebInspector.openURL(S.url,null,{alwaysOpenExternally:!0})}),WebInspector.frameResourceManager.resourceForURL(S.url)&&!WebInspector.isShowingResourcesTab()&&u.appendItem(WebInspector.UIString("Reveal in Resources Tab"),()=>{const f={ignoreNetworkTab:!0};C?WebInspector.showSourceCodeLocation(C,f):WebInspector.showSourceCode(S,f)}),u.appendItem(WebInspector.UIString("Copy Link Address"),()=>{InspectorFrontendHost.copyText(S.url)})),S instanceof WebInspector.Resource&&"data"!==S.urlComponents.scheme&&u.appendItem(WebInspector.UIString("Copy as cURL"),()=>{S.generateCURLCommand()}),u.appendItem(WebInspector.UIString("Save File"),()=>{S.requestContent().then(()=>{WebInspector.saveDataToFile({url:S.url||"",content:S.content},!0)})}),u.appendSeparator(),C&&(S instanceof WebInspector.Script||S instanceof WebInspector.Resource&&S.type===WebInspector.Resource.Type.Script))){let f=WebInspector.debuggerManager.breakpointForSourceCodeLocation(C);f?u.appendItem(WebInspector.UIString("Delete Breakpoint"),()=>{WebInspector.debuggerManager.removeBreakpoint(f)}):u.appendItem(WebInspector.UIString("Add Breakpoint"),()=>{WebInspector.debuggerManager.addBreakpoint(new WebInspector.Breakpoint(C))}),u.appendSeparator()}}},WebInspector.appendContextMenuItemsForDOMNode=function(u,_,S={}){if(u instanceof WebInspector.ContextMenu&&_ instanceof WebInspector.DOMNode){let C=_.nodeType()===Node.ELEMENT_NODE;if(u.appendSeparator(),_.ownerDocument&&C&&u.appendItem(WebInspector.UIString("Copy Selector Path"),()=>{let f=WebInspector.cssPath(_);InspectorFrontendHost.copyText(f)}),_.ownerDocument&&!_.isPseudoElement()&&u.appendItem(WebInspector.UIString("Copy XPath"),()=>{let f=WebInspector.xpath(_);InspectorFrontendHost.copyText(f)}),_.isCustomElement()&&(u.appendSeparator(),u.appendItem(WebInspector.UIString("Jump to Definition"),()=>{function f(I,R){if(!I){let N=R.location,L=WebInspector.debuggerManager.scriptForIdentifier(N.scriptId,WebInspector.mainTarget);if(L){let D=L.createSourceCodeLocation(N.lineNumber,N.columnNumber||0);WebInspector.showSourceCodeLocation(D,{ignoreNetworkTab:!0,ignoreSearchTab:!0})}}}function T(I,R){I||"function"!==R.type||(DebuggerAgent.getFunctionDetails(R.objectId,f),R.release())}WebInspector.RemoteObject.resolveNode(_,"",function(I){I&&(I.getProperty("constructor",T),I.release())})})),WebInspector.domDebuggerManager.supported&&C&&!_.isPseudoElement()&&_.ownerDocument){u.appendSeparator();WebInspector.DOMBreakpointTreeController.appendBreakpointContextMenuItems(u,_,!1)}if(u.appendSeparator(),!S.excludeRevealElement&&_.ownerDocument&&u.appendItem(WebInspector.UIString("Reveal in DOM Tree"),()=>{WebInspector.domTreeManager.inspectElement(_.id)}),!S.excludeLogElement&&!_.isInUserAgentShadowTree()&&!_.isPseudoElement()){let f=C?WebInspector.UIString("Log Element"):WebInspector.UIString("Log Node");u.appendItem(f,()=>{WebInspector.RemoteObject.resolveNode(_,WebInspector.RuntimeManager.ConsoleObjectGroup,T=>{if(T){let E=C?WebInspector.UIString("Selected Element"):WebInspector.UIString("Selected Node");WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(E,T,!0)}})})}}},WebInspector.ControlToolbarItem=class extends WebInspector.ButtonNavigationItem{constructor(_,S,C,f,T){super(_,S,C,f,T,!1)}get additionalClassNames(){return["control"]}},WebInspector.CookieStorageContentView=class extends WebInspector.ContentView{constructor(_){super(_),this.element.classList.add("cookie-storage"),this._refreshButtonNavigationItem=new WebInspector.ButtonNavigationItem("cookie-storage-refresh",WebInspector.UIString("Refresh"),"Images/ReloadFull.svg",13,13),this._refreshButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._refreshButtonClicked,this),this.update()}get navigationItems(){return[this._refreshButtonNavigationItem]}update(){PageAgent.getCookies().then(_=>{this._cookies=this._filterCookies(_.cookies),this._rebuildTable()}).catch(_=>{console.error("Could not fetch cookies: ",_)})}saveToCookie(_){_.type=WebInspector.ContentViewCookieType.CookieStorage,_.host=this.representedObject.host}get scrollableElements(){return this._dataGrid?[this._dataGrid.scrollContainer]:[]}_rebuildTable(){if(!this._dataGrid){var _={name:{},value:{},domain:{},path:{},expires:{},size:{},http:{},secure:{}};_.name.title=WebInspector.UIString("Name"),_.name.sortable=!0,_.name.width="24%",_.name.locked=!0,_.value.title=WebInspector.UIString("Value"),_.value.sortable=!0,_.value.width="34%",_.value.locked=!0,_.domain.title=WebInspector.UIString("Domain"),_.domain.sortable=!0,_.domain.width="7%",_.path.title=WebInspector.UIString("Path"),_.path.sortable=!0,_.path.width="7%",_.expires.title=WebInspector.UIString("Expires"),_.expires.sortable=!0,_.expires.width="7%",_.size.title=WebInspector.UIString("Size"),_.size.aligned="right",_.size.sortable=!0,_.size.width="7%",_.http.title=WebInspector.UIString("HTTP"),_.http.aligned="centered",_.http.sortable=!0,_.http.width="7%",_.secure.title=WebInspector.UIString("Secure"),_.secure.aligned="centered",_.secure.sortable=!0,_.secure.width="7%",this._dataGrid=new WebInspector.DataGrid(_,null,this._deleteCallback.bind(this)),this._dataGrid.columnChooserEnabled=!0,this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged,this._sortDataGrid,this),this.addSubview(this._dataGrid),this._dataGrid.updateLayout()}this._dataGrid.removeChildren();for(var S of this._cookies){const T="\u2713";var C={name:S.name,value:S.value,domain:S.domain||"",path:S.path||"",expires:"",size:Number.bytesToString(S.size),http:S.httpOnly?T:"",secure:S.secure?T:""};S.type!==WebInspector.CookieType.Request&&(C.expires=S.session?WebInspector.UIString("Session"):new Date(S.expires).toLocaleString());var f=new WebInspector.DataGridNode(C);f.cookie=S,this._dataGrid.appendChild(f)}this._dataGrid.sortColumnIdentifier="name",this._dataGrid.createSettings("cookie-storage-content-view")}_filterCookies(_){let C=[];for(let E of WebInspector.frameResourceManager.frames)C.push(E.mainResource),C=C.concat(E.resourceCollection.toArray());let f=C.filter(E=>{let I=E.urlComponents;return I&&I.host&&I.host===this.representedObject.host}),T=_.filter(E=>{return f.some(I=>{return WebInspector.CookieStorageObject.cookieMatchesResourceURL(E,I.url)})});return T}_sortDataGrid(){function _(T,E,I){return(E.data[T]+"").extendedLocaleCompare(I.data[T]+"")}function S(T,E,I){return E.cookie[T]-I.cookie[T]}function C(T,E){return T.cookie.session===E.cookie.session?T.cookie.session?0:T.cookie.expires-E.cookie.expires:T.cookie.session?-1:1}var f;switch(this._dataGrid.sortColumnIdentifier){case"value":f=_.bind(this,"value");break;case"domain":f=_.bind(this,"domain");break;case"path":f=_.bind(this,"path");break;case"expires":f=C;break;case"size":f=S.bind(this,"size");break;case"http":f=_.bind(this,"http");break;case"secure":f=_.bind(this,"secure");break;case"name":default:f=_.bind(this,"name");}this._dataGrid.sortNodes(f)}_deleteCallback(_){if(_&&_.cookie){var S=_.cookie,C=(S.secure?"https://":"http://")+S.domain+S.path;PageAgent.deleteCookie(S.name,C),this.update()}}_refreshButtonClicked(){this.update()}},WebInspector.CookieType={Request:0,Response:1},WebInspector.CookieStorageTreeElement=class extends WebInspector.StorageTreeElement{constructor(_){super("cookie-icon",WebInspector.displayNameForHost(_.host),_)}get name(){return this.representedObject.host}get categoryName(){return WebInspector.UIString("Cookies")}},WebInspector.DOMBreakpointTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_,S,C){S||(S=WebInspector.BreakpointTreeElement.GenericLineIconStyleClassName),C||(C=WebInspector.DOMBreakpointTreeElement.displayNameForType(_.type)),super(["breakpoint",S],C,null,_),this._statusImageElement=document.createElement("img"),this._statusImageElement.classList.add("status-image","resolved"),this.status=this._statusImageElement,_.addEventListener(WebInspector.DOMBreakpoint.Event.DisabledStateDidChange,this._updateStatus,this),this._updateStatus()}static displayNameForType(_){return _===WebInspector.DOMBreakpoint.Type.SubtreeModified?WebInspector.UIString("Subtree Modified"):_===WebInspector.DOMBreakpoint.Type.AttributeModified?WebInspector.UIString("Attribute Modified"):_===WebInspector.DOMBreakpoint.Type.NodeRemoved?WebInspector.UIString("Node Removed"):(console.error("Unexpected DOM breakpoint type: "+_),null)}onattach(){super.onattach(),this._boundStatusImageElementClicked=this._statusImageElementClicked.bind(this),this._boundStatusImageElementFocused=this._statusImageElementFocused.bind(this),this._boundStatusImageElementMouseDown=this._statusImageElementMouseDown.bind(this),this._statusImageElement.addEventListener("click",this._boundStatusImageElementClicked),this._statusImageElement.addEventListener("focus",this._boundStatusImageElementFocused),this._statusImageElement.addEventListener("mousedown",this._boundStatusImageElementMouseDown)}ondetach(){super.ondetach(),this._statusImageElement.removeEventListener("click",this._boundStatusImageElementClicked),this._statusImageElement.removeEventListener("focus",this._boundStatusImageElementFocused),this._statusImageElement.removeEventListener("mousedown",this._boundStatusImageElementMouseDown),this._boundStatusImageElementClicked=null,this._boundStatusImageElementFocused=null,this._boundStatusImageElementMouseDown=null}ondelete(){return WebInspector.domDebuggerManager.removeDOMBreakpoint(this.representedObject),!0}onenter(){return this._toggleBreakpoint(),!0}onspace(){return this._toggleBreakpoint(),!0}populateContextMenu(_){let C=this.representedObject,f=C.disabled?WebInspector.UIString("Enable Breakpoint"):WebInspector.UIString("Disable Breakpoint");_.appendItem(f,this._toggleBreakpoint.bind(this)),_.appendSeparator(),_.appendItem(WebInspector.UIString("Delete Breakpoint"),function(){WebInspector.domDebuggerManager.removeDOMBreakpoint(C)})}_statusImageElementClicked(){this._toggleBreakpoint()}_statusImageElementFocused(_){_.stopPropagation()}_statusImageElementMouseDown(_){_.stopPropagation()}_toggleBreakpoint(){this.representedObject.disabled=!this.representedObject.disabled}_updateStatus(){this._statusImageElement.classList.toggle("disabled",this.representedObject.disabled)}},WebInspector.DOMNodeDetailsSidebarPanel=class extends WebInspector.DOMDetailsSidebarPanel{constructor(){super("dom-node-details",WebInspector.UIString("Node")),this._eventListenerGroupingMethodSetting=new WebInspector.Setting("dom-node-event-listener-grouping-method",WebInspector.DOMNodeDetailsSidebarPanel.EventListenerGroupingMethod.Event),this.element.classList.add("dom-node"),this._nodeRemoteObject=null}initialLayout(){function _(M,P){let O=N.appendChild(document.createElement("option"));O.value=P,O.textContent=M}super.initialLayout(),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeModified,this._attributesChanged,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeRemoved,this._attributesChanged,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.CharacterDataModified,this._characterDataModified,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.CustomElementStateChanged,this._customElementStateChanged,this),this._identityNodeTypeRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Type")),this._identityNodeNameRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Name")),this._identityNodeValueRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Value")),this._identityNodeContentSecurityPolicyHashRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("CSP Hash"));var S=new WebInspector.DetailsSectionGroup([this._identityNodeTypeRow,this._identityNodeNameRow,this._identityNodeValueRow,this._identityNodeContentSecurityPolicyHashRow]),C=new WebInspector.DetailsSection("dom-node-identity",WebInspector.UIString("Identity"),[S]);this._attributesDataGridRow=new WebInspector.DetailsSectionDataGridRow(null,WebInspector.UIString("No Attributes"));var f=new WebInspector.DetailsSectionGroup([this._attributesDataGridRow]),T=new WebInspector.DetailsSection("dom-node-attributes",WebInspector.UIString("Attributes"),[f]);this._propertiesRow=new WebInspector.DetailsSectionRow;var E=new WebInspector.DetailsSectionGroup([this._propertiesRow]),I=new WebInspector.DetailsSection("dom-node-properties",WebInspector.UIString("Properties"),[E]);let R=useSVGSymbol("Images/FilterFieldGlyph.svg","filter",WebInspector.UIString("Grouping Method")),N=R.appendChild(document.createElement("select"));N.addEventListener("change",()=>{this._eventListenerGroupingMethodSetting.value=N.value,this._refreshEventListeners()}),_(WebInspector.UIString("Group by Event"),WebInspector.DOMNodeDetailsSidebarPanel.EventListenerGroupingMethod.Event),_(WebInspector.UIString("Group by Node"),WebInspector.DOMNodeDetailsSidebarPanel.EventListenerGroupingMethod.Node),N.value=this._eventListenerGroupingMethodSetting.value,this._eventListenersSectionGroup=new WebInspector.DetailsSectionGroup;let L=new WebInspector.DetailsSection("dom-node-event-listeners",WebInspector.UIString("Event Listeners"),[this._eventListenersSectionGroup],R);if(this.contentView.element.appendChild(C.element),this.contentView.element.appendChild(T.element),this.contentView.element.appendChild(I.element),this.contentView.element.appendChild(L.element),this._accessibilitySupported()){this._accessibilityEmptyRow=new WebInspector.DetailsSectionRow(WebInspector.UIString("No Accessibility Information")),this._accessibilityNodeActiveDescendantRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Shared Focus")),this._accessibilityNodeBusyRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Busy")),this._accessibilityNodeCheckedRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Checked")),this._accessibilityNodeChildrenRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Children")),this._accessibilityNodeControlsRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Controls")),this._accessibilityNodeCurrentRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Current")),this._accessibilityNodeDisabledRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Disabled")),this._accessibilityNodeExpandedRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Expanded")),this._accessibilityNodeFlowsRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Flows")),this._accessibilityNodeFocusedRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Focused")),this._accessibilityNodeHeadingLevelRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Heading Level")),this._accessibilityNodehierarchyLevelRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Hierarchy Level")),this._accessibilityNodeIgnoredRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Ignored")),this._accessibilityNodeInvalidRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Invalid")),this._accessibilityNodeLiveRegionStatusRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Live")),this._accessibilityNodeMouseEventRow=new WebInspector.DetailsSectionSimpleRow(""),this._accessibilityNodeLabelRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Label")),this._accessibilityNodeOwnsRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Owns")),this._accessibilityNodeParentRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Parent")),this._accessibilityNodePressedRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Pressed")),this._accessibilityNodeReadonlyRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Readonly")),this._accessibilityNodeRequiredRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Required")),this._accessibilityNodeRoleRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Role")),this._accessibilityNodeSelectedRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Selected")),this._accessibilityNodeSelectedChildrenRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Selected Items")),this._accessibilityGroup=new WebInspector.DetailsSectionGroup([this._accessibilityEmptyRow]);var D=new WebInspector.DetailsSection("dom-node-accessibility",WebInspector.UIString("Accessibility"),[this._accessibilityGroup]);this.contentView.element.appendChild(D.element)}}layout(){super.layout();this.domNode&&(this._refreshIdentity(),this._refreshAttributes(),this._refreshProperties(),this._refreshEventListeners(),this._refreshAccessibility())}sizeDidChange(){super.sizeDidChange(),this._attributesDataGridRow.sizeDidChange()}_accessibilitySupported(){return window.DOMAgent&&DOMAgent.getAccessibilityPropertiesForNode}_refreshIdentity(){const _=this.domNode;this._identityNodeTypeRow.value=this._nodeTypeDisplayName(),this._identityNodeNameRow.value=_.nodeNameInCorrectCase(),this._identityNodeValueRow.value=_.nodeValue(),this._identityNodeContentSecurityPolicyHashRow.value=_.contentSecurityPolicyHash()}_refreshAttributes(){let _=this.domNode;if(!_||!_.hasAttributes())return void(this._attributesDataGridRow.dataGrid=null);let S=this._attributesDataGridRow.dataGrid;if(!S){const f={name:{title:WebInspector.UIString("Name"),width:"30%"},value:{title:WebInspector.UIString("Value")}};S=this._attributesDataGridRow.dataGrid=new WebInspector.DataGrid(f)}S.removeChildren();let C=_.attributes();C.sort((f,T)=>f.name.extendedLocaleCompare(T.name));for(let f of C){let T=new WebInspector.EditableDataGridNode(f);T.addEventListener(WebInspector.EditableDataGridNode.Event.ValueChanged,this._attributeNodeValueChanged,this),S.appendChild(T)}S.updateLayoutIfNeeded()}_refreshProperties(){function S(T,E,I){T||I||!E||this.domNode!==f||E.deprecatedGetOwnProperties(C.bind(this))}function C(T){if(T&&this.domNode===f){let E=this._propertiesRow.element;E.removeChildren();let I=new WebInspector.PropertyPath(this._nodeRemoteObject,"node"),R=!0;for(let N=0;Nnew WebInspector.EventListenerSectionGroup(P,R));let M=new WebInspector.DetailsSection(`${E}-event-listener-section`,E,N,null,!0);return M.element.classList.add("event-listener-section"),M}function S(E){let I=new Map;for(let L of E){L.node=WebInspector.domTreeManager.nodeForId(L.nodeId);let D=I.get(L.type);D||I.set(L.type,D=[]),D.push(L)}let R=[],N=Array.from(I.keys());N.sort();for(let L of N)R.push(_(L,I.get(L),{hideType:!0}));return R}function C(E){let I=new Map;for(let L of E){L.node=WebInspector.domTreeManager.nodeForId(L.nodeId);let D=I.get(L.node);D||I.set(L.node,D=[]),D.push(L)}let R=[],N=T;do{let L=I.get(N);if(!L)continue;L.sort((D,M)=>D.type.toLowerCase().extendedLocaleCompare(M.type.toLowerCase())),R.push(_(N.displayName,L,{hideNode:!0}))}while(N=N.parentNode);return R}var T=this.domNode;T&&T.getEventListeners(function(E,I){if(!E&&this.domNode===T){if(!I.length){var R=new WebInspector.DetailsSectionRow(WebInspector.UIString("No Event Listeners"));return R.showEmptyMessage(),void(this._eventListenersSectionGroup.rows=[R])}switch(this._eventListenerGroupingMethodSetting.value){case WebInspector.DOMNodeDetailsSidebarPanel.EventListenerGroupingMethod.Event:this._eventListenersSectionGroup.rows=S.call(this,I);break;case WebInspector.DOMNodeDetailsSidebarPanel.EventListenerGroupingMethod.Node:this._eventListenersSectionGroup.rows=C.call(this,I);}}}.bind(this))}_refreshAccessibility(){function _(R){return I[R]?WebInspector.UIString("Yes"):""}function S(R){return void 0===I[R]?"":I[R]?WebInspector.UIString("Yes"):WebInspector.UIString("No")}function C(R){var N=null;if(R!==void 0&&"number"==typeof R){var L=WebInspector.domTreeManager.nodeForId(R);L&&(N=WebInspector.linkifyAccessibilityNodeReference(L))}return N}function f(R){if(!R)return null;const N=5;let L=!1,D=0,M=document.createElement("div");M.classList.add("list-container");let P=M.createChild("ul","node-link-list"),O=[];for(let F of R){let V=WebInspector.domTreeManager.nodeForId(F);if(V){let Ce=WebInspector.linkifyAccessibilityNodeReference(V);L=!0;let ye=P.createChild("li");ye.appendChild(Ce),D>=N&&(ye.hidden=!0,O.push(ye)),D++}}if(M.appendChild(P),D>N){let F=M.createChild("button","expand-list-button");F.textContent=WebInspector.UIString("%d More\u2026").format(D-N),F.addEventListener("click",()=>{O.forEach(V=>{V.hidden=!1}),F.remove()})}return L?M:null}function T(R){if(this.domNode===E)if(I=R,R&&R.exists){var N=C(R.activeDescendantNodeId),L=S("busy"),D="";void 0!==R.checked&&(R.checked===DOMAgent.AccessibilityPropertiesChecked.True?D=WebInspector.UIString("Yes"):R.checked===DOMAgent.AccessibilityPropertiesChecked.Mixed?D=WebInspector.UIString("Mixed"):D=WebInspector.UIString("No"));var M=f(R.childNodeIds),P=f(R.controlledNodeIds),O="";switch(R.current){case DOMAgent.AccessibilityPropertiesCurrent.True:O=WebInspector.UIString("True");break;case DOMAgent.AccessibilityPropertiesCurrent.Page:O=WebInspector.UIString("Page");break;case DOMAgent.AccessibilityPropertiesCurrent.Location:O=WebInspector.UIString("Location");break;case DOMAgent.AccessibilityPropertiesCurrent.Step:O=WebInspector.UIString("Step");break;case DOMAgent.AccessibilityPropertiesCurrent.Date:O=WebInspector.UIString("Date");break;case DOMAgent.AccessibilityPropertiesCurrent.Time:O=WebInspector.UIString("Time");break;default:O="";}var F=_("disabled"),V=S("expanded"),U=f(R.flowedNodeIds),G=S("focused"),H="";R.ignored&&(H=WebInspector.UIString("Yes"),R.hidden?H=WebInspector.UIString("%s (hidden)").format(H):R.ignoredByDefault&&(H=WebInspector.UIString("%s (default)").format(H)));var W="";R.invalid===DOMAgent.AccessibilityPropertiesInvalid.True?W=WebInspector.UIString("Yes"):R.invalid===DOMAgent.AccessibilityPropertiesInvalid.Grammar?W=WebInspector.UIString("Grammar"):R.invalid===DOMAgent.AccessibilityPropertiesInvalid.Spelling&&(W=WebInspector.UIString("Spelling"));var z=R.label,K="",q=null,X=R.liveRegionStatus;if(K=X===DOMAgent.AccessibilityPropertiesLiveRegionStatus.Assertive?WebInspector.UIString("Assertive"):X===DOMAgent.AccessibilityPropertiesLiveRegionStatus.Polite?WebInspector.UIString("Polite"):"",K){var Y=R.liveRegionRelevant;if(Y&&Y.length&&(Y=3===Y.length&&Y[0]===DOMAgent.LiveRegionRelevant.Additions&&Y[1]===DOMAgent.LiveRegionRelevant.Removals&&Y[2]===DOMAgent.LiveRegionRelevant.Text?[WebInspector.UIString("All Changes")]:Y.map(function(he){return he===DOMAgent.LiveRegionRelevant.Additions?WebInspector.UIString("Additions"):he===DOMAgent.LiveRegionRelevant.Removals?WebInspector.UIString("Removals"):he===DOMAgent.LiveRegionRelevant.Text?WebInspector.UIString("Text"):"\""+he+"\""}),K+=" ("+Y.join(", ")+")"),R.liveRegionAtomic){q=document.createElement("div"),q.className="value-with-clarification",q.setAttribute("role","text"),q.append(K);var Q=document.createElement("div");Q.className="clarification",Q.append(WebInspector.UIString("Region announced in its entirety.")),q.appendChild(Q)}}var J=R.mouseEventNodeId,Z="",$=null;J&&(J===R.nodeId?Z=WebInspector.UIString("Yes"):$=C(J));var ee=f(R.ownedNodeIds),te=C(R.parentNodeId),ne=S("pressed"),re=_("readonly"),ae=S("required"),ie=R.role;let ce=R.isPopupButton,ue=null,me=null,pe=WebInspector.UIString("popup"),_e=WebInspector.UIString("toggle"),ge=WebInspector.UIString("popup, toggle");if(""===ie||"unknown"===ie)ie=WebInspector.UIString("No matching ARIA role");else if(ie)if("button"==ie&&(ne&&(me=_e),ce&&(me=me?ge:pe)),E.getAttribute("role")?(me||E.getAttribute("role")!==ie)&&(ue=WebInspector.UIString("computed")):ue=WebInspector.UIString("default"),me&&ue)ie=WebInspector.UIString("%s (%s, %s)").format(ie,me,ue);else if(ue||me){let he=ue||me;ie=WebInspector.UIString("%s (%s)").format(ie,he)}var oe=_("selected"),se=f(R.selectedChildNodeIds),de=R.headingLevel,le=R.hierarchyLevel;this._accessibilityNodeActiveDescendantRow.value=N||"",this._accessibilityNodeBusyRow.value=L,this._accessibilityNodeCheckedRow.value=D,this._accessibilityNodeChildrenRow.value=M||"",this._accessibilityNodeControlsRow.value=P||"",this._accessibilityNodeCurrentRow.value=O,this._accessibilityNodeDisabledRow.value=F,this._accessibilityNodeExpandedRow.value=V,this._accessibilityNodeFlowsRow.value=U||"",this._accessibilityNodeFocusedRow.value=G,this._accessibilityNodeHeadingLevelRow.value=de||"",this._accessibilityNodehierarchyLevelRow.value=le||"",this._accessibilityNodeIgnoredRow.value=H,this._accessibilityNodeInvalidRow.value=W,this._accessibilityNodeLabelRow.value=z,this._accessibilityNodeLiveRegionStatusRow.value=q||K,this._accessibilityNodeMouseEventRow.label=$?WebInspector.UIString("Click Listener"):WebInspector.UIString("Clickable"),this._accessibilityNodeMouseEventRow.value=$||Z,this._accessibilityNodeOwnsRow.value=ee||"",this._accessibilityNodeParentRow.value=te||"",this._accessibilityNodePressedRow.value=ne,this._accessibilityNodeReadonlyRow.value=re,this._accessibilityNodeRequiredRow.value=ae,this._accessibilityNodeRoleRow.value=ie,this._accessibilityNodeSelectedRow.value=oe,this._accessibilityNodeSelectedChildrenRow.label=WebInspector.UIString("Selected Items"),this._accessibilityNodeSelectedChildrenRow.value=se||"",se&&1===R.selectedChildNodeIds.length&&(this._accessibilityNodeSelectedChildrenRow.label=WebInspector.UIString("Selected Item")),this._accessibilityGroup.rows=[this._accessibilityNodeIgnoredRow,this._accessibilityNodeRoleRow,this._accessibilityNodeLabelRow,this._accessibilityNodeParentRow,this._accessibilityNodeActiveDescendantRow,this._accessibilityNodeSelectedChildrenRow,this._accessibilityNodeChildrenRow,this._accessibilityNodeOwnsRow,this._accessibilityNodeControlsRow,this._accessibilityNodeFlowsRow,this._accessibilityNodeMouseEventRow,this._accessibilityNodeFocusedRow,this._accessibilityNodeHeadingLevelRow,this._accessibilityNodehierarchyLevelRow,this._accessibilityNodeBusyRow,this._accessibilityNodeLiveRegionStatusRow,this._accessibilityNodeCurrentRow,this._accessibilityNodeDisabledRow,this._accessibilityNodeInvalidRow,this._accessibilityNodeRequiredRow,this._accessibilityNodeCheckedRow,this._accessibilityNodeExpandedRow,this._accessibilityNodePressedRow,this._accessibilityNodeReadonlyRow,this._accessibilityNodeSelectedRow],this._accessibilityEmptyRow.hideEmptyMessage()}else this._accessibilityGroup.rows=[this._accessibilityEmptyRow],this._accessibilityEmptyRow.showEmptyMessage()}if(this._accessibilitySupported()){var E=this.domNode;if(E){var I={};E.accessibilityProperties(T.bind(this))}}}_attributesChanged(_){_.data.node!==this.domNode||(this._refreshAttributes(),this._refreshAccessibility())}_attributeNodeValueChanged(_){let S=_.data,C=_.target.data;"name"===S.columnIdentifier?this.domNode.removeAttribute(C[S.columnIdentifier],()=>{this.domNode.setAttribute(S.value,`${S.value}="${C.value}"`)}):"value"===S.columnIdentifier&&this.domNode.setAttributeValue(C.name,S.value)}_characterDataModified(_){_.data.node!==this.domNode||(this._identityNodeValueRow.value=this.domNode.nodeValue())}_customElementStateChanged(_){_.data.node!==this.domNode||this._refreshIdentity()}_nodeTypeDisplayName(){switch(this.domNode.nodeType()){case Node.ELEMENT_NODE:{const _=WebInspector.UIString("Element"),S=this._customElementState();return null===S?_:`${_} (${S})`}case Node.TEXT_NODE:return WebInspector.UIString("Text Node");case Node.COMMENT_NODE:return WebInspector.UIString("Comment");case Node.DOCUMENT_NODE:return WebInspector.UIString("Document");case Node.DOCUMENT_TYPE_NODE:return WebInspector.UIString("Document Type");case Node.DOCUMENT_FRAGMENT_NODE:return WebInspector.UIString("Document Fragment");case Node.CDATA_SECTION_NODE:return WebInspector.UIString("Character Data");case Node.PROCESSING_INSTRUCTION_NODE:return WebInspector.UIString("Processing Instruction");default:return console.error("Unknown DOM node type: ",this.domNode.nodeType()),this.domNode.nodeType();}}_customElementState(){const _=this.domNode.customElementState();return _===WebInspector.DOMNode.CustomElementState.Builtin?null:_===WebInspector.DOMNode.CustomElementState.Custom?WebInspector.UIString("Custom"):_===WebInspector.DOMNode.CustomElementState.Waiting?WebInspector.UIString("Undefined custom element"):_===WebInspector.DOMNode.CustomElementState.Failed?WebInspector.UIString("Failed to upgrade"):(console.error("Unknown DOM custom element state: ",_),null)}},WebInspector.DOMNodeDetailsSidebarPanel.EventListenerGroupingMethod={Event:"event",Node:"node"},WebInspector.DOMNodeDetailsSidebarPanel.PropertiesObjectGroupName="dom-node-details-sidebar-properties-object-group",WebInspector.DOMNodeTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_){super("dom-node",_.displayName,null,_,!0),this.status=WebInspector.linkifyNodeReferenceElement(_,WebInspector.createGoToArrowButton())}ondelete(){return WebInspector.domDebuggerManager.removeDOMBreakpointsForNode(this.representedObject),!0}populateContextMenu(_){_.appendSeparator();WebInspector.DOMBreakpointTreeController.appendBreakpointContextMenuItems(_,this.representedObject,!0),_.appendSeparator(),_.appendItem(WebInspector.UIString("Reveal in DOM Tree"),()=>{WebInspector.domTreeManager.inspectElement(this.representedObject.id)})}},WebInspector.DOMStorageContentView=class extends WebInspector.ContentView{constructor(_){super(_),this.element.classList.add("dom-storage"),_.addEventListener(WebInspector.DOMStorageObject.Event.ItemsCleared,this.itemsCleared,this),_.addEventListener(WebInspector.DOMStorageObject.Event.ItemAdded,this.itemAdded,this),_.addEventListener(WebInspector.DOMStorageObject.Event.ItemRemoved,this.itemRemoved,this),_.addEventListener(WebInspector.DOMStorageObject.Event.ItemUpdated,this.itemUpdated,this);let S={};S.key={title:WebInspector.UIString("Key"),sortable:!0},S.value={title:WebInspector.UIString("Value"),sortable:!0},this._dataGrid=new WebInspector.DataGrid(S,this._editingCallback.bind(this),this._deleteCallback.bind(this)),this._dataGrid.sortOrder=WebInspector.DataGrid.SortOrder.Ascending,this._dataGrid.sortColumnIdentifier="key",this._dataGrid.createSettings("dom-storage-content-view"),this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged,this._sortDataGrid,this),this.addSubview(this._dataGrid),this._populate()}saveToCookie(_){_.type=WebInspector.ContentViewCookieType.DOMStorage,_.isLocalStorage=this.representedObject.isLocalStorage(),_.host=this.representedObject.host}get scrollableElements(){return[this._dataGrid.scrollContainer]}itemsCleared(){this._dataGrid.removeChildren(),this._dataGrid.addPlaceholderNode()}itemRemoved(_){for(let S of this._dataGrid.children)if(S.data.key===_.data.key)return this._dataGrid.removeChild(S);return null}itemAdded(_){let{key:S,value:C}=_.data;C=this._truncateValue(C);for(let f of this._dataGrid.children)if(f.data.key===S)return;this._dataGrid.appendChild(new WebInspector.DataGridNode({key:S,value:C},!1)),this._sortDataGrid()}itemUpdated(_){let{key:S,value:C}=_.data;C=this._truncateValue(C);let f=!1;for(let T of this._dataGrid.children)if(T.data.key===S){if(f){this._dataGrid.removeChild(T);continue}f=!0,T.data.value=C,T.refresh()}this._sortDataGrid()}_truncateValue(_){return _.truncate(200)}_populate(){this.representedObject.getEntries(function(_,S){if(!_){for(let[C,f]of S)if(C&&f){f=this._truncateValue(f);let Ce=new WebInspector.DataGridNode({key:C,value:f},!1);this._dataGrid.appendChild(Ce)}this._sortDataGrid(),this._dataGrid.addPlaceholderNode(),this._dataGrid.updateLayout()}}.bind(this))}_sortDataGrid(){let S=this._dataGrid.sortColumnIdentifier||"key";this._dataGrid.sortNodesImmediately(function(C,f){return C.data[S].extendedLocaleCompare(f.data[S])})}_deleteCallback(_){!_||_.isPlaceholderNode||(this._dataGrid.removeChild(_),this.representedObject.removeItem(_.data.key))}_editingCallback(_,S,C,f,T){function E(){_.element.classList.remove(WebInspector.DOMStorageContentView.MissingKeyStyleClassName),_.element.classList.remove(WebInspector.DOMStorageContentView.MissingValueStyleClassName),_.element.classList.remove(WebInspector.DOMStorageContentView.DuplicateKeyStyleClassName),_.__hasUncommittedEdits=void 0,_.__originalKey=void 0,_.__originalValue=void 0}var I=_.data.key.trim().removeWordBreakCharacters(),R=_.data.value.trim().removeWordBreakCharacters(),N=C.trim().removeWordBreakCharacters(),L=f.trim().removeWordBreakCharacters(),D=_.__hasUncommittedEdits,M=N!==L,P="key"===S,O=!P,F=this.representedObject;if(M||D){M&&!_.__hasUncommittedEdits&&(_.__hasUncommittedEdits=!0,_.__originalKey=P?N:I,_.__originalValue=O?N:R),P?I.length?_.element.classList.remove(WebInspector.DOMStorageContentView.MissingKeyStyleClassName):_.element.classList.add(WebInspector.DOMStorageContentView.MissingKeyStyleClassName):O&&(R.length?_.element.classList.remove(WebInspector.DOMStorageContentView.MissingValueStyleClassName):_.element.classList.add(WebInspector.DOMStorageContentView.MissingValueStyleClassName));var V=I!==_.__originalKey;V&&(F.entries.has(I)?_.element.classList.add(WebInspector.DOMStorageContentView.DuplicateKeyStyleClassName):_.element.classList.remove(WebInspector.DOMStorageContentView.DuplicateKeyStyleClassName));var U=this._dataGrid.orderedColumns.indexOf(S),G="forward"===T&&U===this._dataGrid.orderedColumns.length-1;if(G||"backward"===T&&0===U||!T){if(!I.length&&!R.length&&!_.isPlaceholderNode)return this._dataGrid.removeChild(_),void F.removeItem(_.__originalKey);var z=_.element.classList.contains(WebInspector.DOMStorageContentView.DuplicateKeyStyleClassName);I.length&&R.length&&!z&&(V&&!_.isPlaceholderNode&&F.removeItem(_.__originalKey),_.isPlaceholderNode&&this._dataGrid.addPlaceholderNode(),E(),F.setItem(I,R))}}}},WebInspector.DOMStorageContentView.DuplicateKeyStyleClassName="duplicate-key",WebInspector.DOMStorageContentView.MissingKeyStyleClassName="missing-key",WebInspector.DOMStorageContentView.MissingValueStyleClassName="missing-value",WebInspector.DOMStorageTreeElement=class extends WebInspector.StorageTreeElement{constructor(_){if(_.isLocalStorage())var S=WebInspector.DOMStorageTreeElement.LocalStorageIconStyleClassName;else var S=WebInspector.DOMStorageTreeElement.SessionStorageIconStyleClassName;super(S,WebInspector.displayNameForHost(_.host),_)}get name(){return WebInspector.displayNameForHost(this.representedObject.host)}get categoryName(){return this.representedObject.isLocalStorage()?WebInspector.UIString("Local Storage"):WebInspector.UIString("Session Storage")}},WebInspector.DOMStorageTreeElement.LocalStorageIconStyleClassName="local-storage-icon",WebInspector.DOMStorageTreeElement.SessionStorageIconStyleClassName="session-storage-icon",WebInspector.DOMTreeDataGrid=class extends WebInspector.DataGrid{constructor(){super({name:{title:WebInspector.UIString("Node"),sortable:!1,icon:!0}}),this._previousHoveredElement=null,this.inline=!0,this.element.classList.add("dom-tree-data-grid"),this.element.addEventListener("mousemove",this._onmousemove.bind(this),!1),this.element.addEventListener("mouseout",this._onmouseout.bind(this),!1)}_onmousemove(_){var S=this.dataGridNodeFromNode(_.target);S&&this._previousHoveredElement!==S.domNode&&(this._previousHoveredElement=S.domNode,WebInspector.domTreeManager.highlightDOMNode(S.domNode.id))}_onmouseout(){this._previousHoveredElement&&(WebInspector.domTreeManager.hideDOMNodeHighlight(),this._previousHoveredElement=null)}},WebInspector.DOMTreeDataGridNode=class extends WebInspector.DataGridNode{constructor(_){super(),this._domNode=_}get domNode(){return this._domNode}createCellContent(_,S){return"name"===_?this._createNameCellDocumentFragment():super.createCellContent(_,S)}_createNameCellDocumentFragment(){let _=document.createDocumentFragment(),S=this._domNode.displayName;_.append(S);let C=_.appendChild(WebInspector.createGoToArrowButton());return C.addEventListener("click",this._goToArrowWasClicked.bind(this),!1),_}_goToArrowWasClicked(){WebInspector.showMainFrameDOMTree(this._domNode)}},WebInspector.DOMTreeElement=class extends WebInspector.TreeElement{constructor(_,S){super("",_),this._elementCloseTag=S,this.hasChildren=!S&&this._hasVisibleChildren(),this.representedObject.nodeType()!==Node.ELEMENT_NODE||S||(this._canAddAttributes=!0),this._searchQuery=null,this._expandedChildrenLimit=WebInspector.DOMTreeElement.InitialChildrenLimit,this._breakpointStatus=WebInspector.DOMTreeElement.BreakpointStatus.None,this._animatingHighlight=!1,this._shouldHighlightAfterReveal=!1,this._boundHighlightAnimationEnd=this._highlightAnimationEnd.bind(this),this._subtreeBreakpointCount=0,this._recentlyModifiedAttributes=[],this._boundNodeChangedAnimationEnd=this._nodeChangedAnimationEnd.bind(this),_.addEventListener(WebInspector.DOMNode.Event.EnabledPseudoClassesChanged,this._nodePseudoClassesDidChange,this)}static shadowRootTypeDisplayName(_){return _===WebInspector.DOMNode.ShadowRootType.UserAgent?WebInspector.UIString("User Agent"):_===WebInspector.DOMNode.ShadowRootType.Open?WebInspector.UIString("Open"):_===WebInspector.DOMNode.ShadowRootType.Closed?WebInspector.UIString("Closed"):void 0}get breakpointStatus(){return this._breakpointStatus}set breakpointStatus(_){if(this._breakpointStatus!==_){let S;if(this._breakpointStatus===WebInspector.DOMTreeElement.BreakpointStatus.None?S=1:_===WebInspector.DOMTreeElement.BreakpointStatus.None&&(S=-1),this._breakpointStatus=_,this._updateBreakpointStatus(),!!S)for(let C=this.parent;C&&!C.root;)C.subtreeBreakpointCountDidChange(S),C=C.parent}}revealAndHighlight(){this._animatingHighlight||(this._shouldHighlightAfterReveal=!0,this.reveal())}subtreeBreakpointCountDidChange(_){this._subtreeBreakpointCount+=_,this._updateBreakpointStatus()}isCloseTag(){return this._elementCloseTag}highlightSearchResults(_){this._searchQuery!==_&&(this._updateSearchHighlight(!1),this._highlightResult=void 0),this._searchQuery=_,this._searchHighlightsVisible=!0,this.updateTitle(!0)}hideSearchHighlights(){this._searchHighlightsVisible=!1,this._updateSearchHighlight(!1)}emphasizeSearchHighlight(){function _(){this._bouncyHighlightElement&&(this._bouncyHighlightElement.remove(),this._bouncyHighlightElement=null)}var S=this.title.querySelector("."+WebInspector.DOMTreeElement.SearchHighlightStyleClassName);if(S){this._bouncyHighlightElement&&this._bouncyHighlightElement.remove(),this._bouncyHighlightElement=document.createElement("div"),this._bouncyHighlightElement.className=WebInspector.DOMTreeElement.BouncyHighlightStyleClassName,this._bouncyHighlightElement.textContent=S.textContent;var C=S.getBoundingClientRect(),f=this.treeOutline.element.getBoundingClientRect();this._bouncyHighlightElement.style.top=C.top-f.top+"px",this._bouncyHighlightElement.style.left=C.left-f.left+"px",this.title.appendChild(this._bouncyHighlightElement),this._bouncyHighlightElement.addEventListener("animationend",_.bind(this))}}_updateSearchHighlight(_){function S(I){switch(I.type){case"added":I.parent.insertBefore(I.node,I.nextSibling);break;case"changed":I.node.textContent=I.newText;}}function C(I){switch(I.type){case"added":I.node.remove();break;case"changed":I.node.textContent=I.oldText;}}if(this._highlightResult)for(var f=_?S:C,T=0,E=this._highlightResult.length;T=this.expandedChildrenLimit&&(this._expandedChildrenLimit=S+1,this._updateChildren(!0)),this.children[S])}_createTooltipForNode(){function _(f,T,E){if(!(f||E||!T||"string"!==T.type))try{var I=JSON.parse(T.description),R=I[0],N=I[1],L=I[2],D=I[3];this.tooltip=N===D&&R===L?WebInspector.UIString("%d \xD7 %d pixels").format(R,N):WebInspector.UIString("%d \xD7 %d pixels (Natural: %d \xD7 %d pixels)").format(R,N,L,D)}catch(M){console.error(M)}}var C=this.representedObject;C.nodeName()&&"img"===C.nodeName().toLowerCase()&&WebInspector.RemoteObject.resolveNode(C,"",function(f){f&&(f.callFunction(function(){return"["+this.offsetWidth+","+this.offsetHeight+","+this.naturalWidth+","+this.naturalHeight+"]"},void 0,!1,_.bind(this)),f.release())}.bind(this))}updateSelectionArea(){let _=this.listItemElement;if(_){let S=this.treeOutline&&(this.treeOutline.dragOverTreeElement===this||this.treeOutline.selectedTreeElement===this||this._animatingHighlight);return this.hovered||this.pseudoClassesEnabled||S?void(!this._selectionElement&&(this._selectionElement=document.createElement("div"),this._selectionElement.className="selection-area",_.insertBefore(this._selectionElement,_.firstChild)),this._selectionElement.style.height=_.offsetHeight+"px"):void(this._selectionElement&&(this._selectionElement.remove(),this._selectionElement=null))}}onattach(){this.hovered&&this.listItemElement.classList.add("hovered"),this.updateTitle(),this.editable&&(this.listItemElement.draggable=!0,this.listItemElement.addEventListener("dragstart",this))}onpopulate(){this.children.length||!this._hasVisibleChildren()||this._elementCloseTag||this.updateChildren()}expandRecursively(){this.representedObject.getSubtree(-1,super.expandRecursively.bind(this,Number.MAX_VALUE))}updateChildren(_){this._elementCloseTag||this.representedObject.getChildNodes(this._updateChildren.bind(this,_))}insertChildElement(_,S,C){var f=new WebInspector.DOMTreeElement(_,C);return f.selectable=this.treeOutline._selectEnabled,this.insertChild(f,S),f}moveChild(_,S){if(this.children[S]!==_){var C=this.treeOutline.selectedTreeElement;this.removeChild(_),this.insertChild(_,S),C!==this.treeOutline.selectedTreeElement&&C.select()}}_updateChildren(_){if(!this._updateChildrenInProgress&&this.treeOutline._visible){this._updateChildrenInProgress=!0;var S=this.representedObject,C=this.treeOutline.selectedDOMNode(),f=0,T=this._hasVisibleChildren();if(_||!T){var E=this.treeOutline.element.parentNode;f=E.scrollTop;var I=this.treeOutline.selectedTreeElement;if(I&&I.hasAncestor(this)&&this.select(),this.removeChildren(),!T)return this.hasChildren=!1,this.updateTitle(),void(this._updateChildrenInProgress=!1)}this.hasChildren||(this.hasChildren=!0,this.updateTitle());for(var R=new Map,N=this.children.length-1;0<=N;--N){var L=this.children[N],D=L.representedObject,M=D.parentNode;if(M===S){R.set(D,L);continue}this.removeChildAtIndex(N)}for(var P=null,O=this._visibleChildren(),N=0;Nthis.expandedChildrenLimit&&this.expandedChildrenLimit++}this.adjustCollapsedRange();var G=this.children.lastValue;S.nodeType()!==Node.ELEMENT_NODE||G&&G._elementCloseTag||this.insertChildElement(this.representedObject,this.children.length,!0),_&&P&&(P.select(),E&&f<=E.scrollHeight&&(E.scrollTop=f)),this._updateChildrenInProgress=!1}}adjustCollapsedRange(){if(this.expandAllButtonElement&&this.expandAllButtonElement.__treeElement.parent&&this.removeChild(this.expandAllButtonElement.__treeElement),!!this._hasVisibleChildren()){for(var _=this._visibleChildren(),S=_.length,C=this.expandedChildCount,f=Math.min(this.expandedChildrenLimit,S);Cthis.expandedChildCount){var E=T;if(!this.expandAllButtonElement){var I=document.createElement("button");I.className="show-all-nodes",I.value="";var R=new WebInspector.TreeElement(I,null,!1);R.selectable=!1,R.expandAllButton=!0,this.insertChild(R,E),this.expandAllButtonElement=I,this.expandAllButtonElement.__treeElement=R,this.expandAllButtonElement.addEventListener("click",this.handleLoadAllChildren.bind(this),!1)}else this.expandAllButtonElement.__treeElement.parent||this.insertChild(this.expandAllButtonElement.__treeElement,E);this.expandAllButtonElement.textContent=WebInspector.UIString("Show All Nodes (%d More)").format(S-T)}else this.expandAllButtonElement&&(this.expandAllButtonElement=null)}}handleLoadAllChildren(){var _=this._visibleChildren();this.expandedChildrenLimit=Math.max(_.length,this.expandedChildrenLimit+WebInspector.DOMTreeElement.InitialChildrenLimit)}onexpand(){this._elementCloseTag||!this.listItemElement||this.updateTitle()}oncollapse(){this._elementCloseTag||this.updateTitle()}onreveal(){let _=this.listItemElement;if(_){let S=_.getElementsByClassName("html-tag-name");S.length?S[0].scrollIntoViewIfNeeded(!1):_.scrollIntoViewIfNeeded(!1),this._shouldHighlightAfterReveal&&(this._shouldHighlightAfterReveal=!1,this._animatingHighlight=!0,this.updateSelectionArea(),_.addEventListener("animationend",this._boundHighlightAnimationEnd),_.classList.add(WebInspector.DOMTreeElement.HighlightStyleClassName))}}onselect(_,S){this.treeOutline.suppressRevealAndSelect=!0,this.treeOutline.selectDOMNode(this.representedObject,S),S&&WebInspector.domTreeManager.highlightDOMNode(this.representedObject.id),this.treeOutline.updateSelection(),this.treeOutline.suppressRevealAndSelect=!1}ondeselect(){this.treeOutline.selectDOMNode(null)}ondelete(){if(!this.editable)return!1;var _=this.treeOutline.findTreeElement(this.representedObject);return _?_.remove():this.remove(),!0}onenter(){return!!this.editable&&!this.treeOutline.editing&&(this._startEditing(),!0)}selectOnMouseDown(_){super.selectOnMouseDown(_);this._editing||2<=_.detail&&_.preventDefault()}ondblclick(_){return!!this.editable&&void(this._editing||this._elementCloseTag||this._startEditingTarget(_.target)||this.hasChildren&&!this.expanded&&this.expand())}_insertInLastAttributePosition(_,S){if(0<_.getElementsByClassName("html-attribute").length)_.insertBefore(S,_.lastChild);else{var C=_.textContent.match(/^<(.*?)>$/)[1];_.textContent="",_.append("<"+C,S,">")}this.updateSelectionArea()}_startEditingTarget(_){if(this.treeOutline.selectedDOMNode()!==this.representedObject)return!1;if(this.representedObject.isShadowRoot()||this.representedObject.isInUserAgentShadowTree())return!1;if(this.representedObject.isPseudoElement())return!1;if(this.representedObject.nodeType()!==Node.ELEMENT_NODE&&this.representedObject.nodeType()!==Node.TEXT_NODE)return!1;var S=_.enclosingNodeOrSelfWithClass("html-text-node");if(S)return this._startEditingTextNode(S);var C=_.enclosingNodeOrSelfWithClass("html-attribute");if(C)return this._startEditingAttribute(C,_);var f=_.enclosingNodeOrSelfWithClass("html-tag-name");return!!f&&this._startEditingTagName(f)}_populateTagContextMenu(_,S){let C=this.representedObject;if(!C.isInUserAgentShadowTree()){let f=S.target.enclosingNodeOrSelfWithClass("html-attribute");if(S.target&&"A"===S.target.tagName){let T=S.target.href;_.appendItem(WebInspector.UIString("Open in New Tab"),()=>{WebInspector.openURL(T,null,{alwaysOpenExternally:!0})}),WebInspector.frameResourceManager.resourceForURL(T)&&_.appendItem(WebInspector.UIString("Reveal in Resources Tab"),()=>{let E=WebInspector.frameResourceManager.frameForIdentifier(C.frameIdentifier);WebInspector.openURL(T,E,{ignoreNetworkTab:!0,ignoreSearchTab:!0})}),_.appendItem(WebInspector.UIString("Copy Link Address"),()=>{InspectorFrontendHost.copyText(T)}),_.appendSeparator()}if(this.editable&&(_.appendItem(WebInspector.UIString("Add Attribute"),this._addNewAttribute.bind(this)),f&&_.appendItem(WebInspector.UIString("Edit Attribute"),this._startEditingAttribute.bind(this,f,S.target)),_.appendSeparator()),WebInspector.cssStyleManager.canForcePseudoClasses()){let T=_.appendSubMenuItem(WebInspector.UIString("Forced Pseudo-Classes"));this._populateForcedPseudoStateItems(T),_.appendSeparator()}}this._populateNodeContextMenu(_)}_populateForcedPseudoStateItems(_){var S=this.representedObject,C=S.enabledPseudoClasses;WebInspector.CSSStyleManager.ForceablePseudoClasses.forEach(function(f){var T=f.capitalize(),E=C.includes(f);_.appendCheckboxItem(T,function(){S.setPseudoClassEnabled(f,!E)},E,!1)})}_populateTextContextMenu(_,S){this.editable&&_.appendItem(WebInspector.UIString("Edit Text"),this._startEditingTextNode.bind(this,S)),this._populateNodeContextMenu(_)}_populateNodeContextMenu(_){let S=this.representedObject;this.editable&&_.appendItem(WebInspector.UIString("Edit as HTML"),this._editAsHTML.bind(this)),S.isPseudoElement()||_.appendItem(WebInspector.UIString("Copy as HTML"),this._copyHTML.bind(this)),this.editable&&_.appendItem(WebInspector.UIString("Delete Node"),this.remove.bind(this)),S.nodeType()===Node.ELEMENT_NODE&&_.appendItem(WebInspector.UIString("Scroll Into View"),this._scrollIntoView.bind(this))}_startEditing(){if(this.treeOutline.selectedDOMNode()!==this.representedObject)return!1;if(!this.editable)return!1;var _=this.listItemElement;if(this._canAddAttributes){var S=_.getElementsByClassName("html-attribute")[0];return S?this._startEditingAttribute(S,S.getElementsByClassName("html-attribute-value")[0]):this._addNewAttribute()}if(this.representedObject.nodeType()===Node.TEXT_NODE){var C=_.getElementsByClassName("html-text-node")[0];return!!C&&this._startEditingTextNode(C)}}_addNewAttribute(){var _=document.createElement("span");this._buildAttributeDOM(_," ","");var S=_.firstChild;S.style.marginLeft="2px",S.style.marginRight="2px";var C=this.listItemElement.getElementsByClassName("html-tag")[0];return this._insertInLastAttributePosition(C,S),this._startEditingAttribute(S,S)}_triggerEditAttribute(_){for(var S=this.listItemElement.getElementsByClassName("html-attribute-name"),C=0,f=S.length;C")}if(!_&&(_=this.listItemElement.getElementsByClassName("html-tag-name")[0],!_))return!1;var T=_.textContent;if(WebInspector.DOMTreeElement.EditTagBlacklist[T.toLowerCase()])return!1;if(WebInspector.isBeingEdited(_))return!0;let E=this._distinctClosingTagElement(),I=E?E.textContent:"";_.addEventListener("keyup",S,!1);var R=new WebInspector.EditingConfig(function(){_.removeEventListener("keyup",S,!1),this._tagNameEditingCommitted.apply(this,arguments)}.bind(this),function(){E&&(E.textContent=I),_.removeEventListener("keyup",S,!1),this._editingCancelled.apply(this,arguments)}.bind(this),T);return this._editing=WebInspector.startEditing(_,R),window.getSelection().setBaseAndExtent(_,0,_,1),!0}_startEditingAsHTML(_,S,C){function f(){_(this._htmlEditElement.textContent),T.call(this)}function T(){this._editing=!1,this.listItemElement.removeChild(this._htmlEditElement),this._htmlEditElement=null,this._childrenListNode&&this._childrenListNode.style.removeProperty("display");for(var R=this.listItemElement.firstChild;R;)R.style.removeProperty("display"),R=R.nextSibling;this.updateSelectionArea()}if(!S&&!(this._htmlEditElement&&WebInspector.isBeingEdited(this._htmlEditElement))){this._htmlEditElement=document.createElement("div"),this._htmlEditElement.textContent=C;for(var E=this.listItemElement.firstChild;E;)E.style.display="none",E=E.nextSibling;this._childrenListNode&&(this._childrenListNode.style.display="none"),this.listItemElement.appendChild(this._htmlEditElement),this.updateSelectionArea();var I=new WebInspector.EditingConfig(f.bind(this),T.bind(this));I.setMultiline(!0),this._editing=WebInspector.startEditing(this._htmlEditElement,I)}}_attributeEditingCommitted(_,S,C,f,T){function E(R){if(R&&this._editingCancelled(_,f),!!T){I._updateModifiedNodes();for(var N=this.representedObject.attributes(),L=0;L"),N._editingCancelled(_,f),I.call(N)}function I(){if("forward"!==T)return void this._addNewAttribute();var M=this.representedObject.attributes();0"),_.append("\u200B")}_nodeTitleInfo(){function _(){return S.nodeValue().replace(/^[\n\r]*/,"").replace(/\s*$/,"")}var S=this.representedObject,C={titleDOM:document.createDocumentFragment(),hasChildren:this.hasChildren};switch(S.nodeType()){case Node.DOCUMENT_FRAGMENT_NODE:var f=C.titleDOM.createChild("span","html-fragment");S.shadowRootType()?(f.textContent=WebInspector.UIString("Shadow Content (%s)").format(WebInspector.DOMTreeElement.shadowRootTypeDisplayName(S.shadowRootType())),this.listItemElement.classList.add("shadow")):S.parentNode&&S.parentNode.templateContent()===S?(f.textContent=WebInspector.UIString("Template Content"),this.listItemElement.classList.add("template")):(f.textContent=WebInspector.UIString("Document Fragment"),this.listItemElement.classList.add("fragment"));break;case Node.ATTRIBUTE_NODE:var T=S.value||"\u200B";this._buildAttributeDOM(C.titleDOM,S.name,T);break;case Node.ELEMENT_NODE:if(S.isPseudoElement()){var E=C.titleDOM.createChild("span","html-pseudo-element");E.textContent="::"+S.pseudoType(),C.titleDOM.appendChild(document.createTextNode("\u200B")),C.hasChildren=!1;break}var I=S.nodeNameInCorrectCase();if(this._elementCloseTag){this._buildTagDOM(C.titleDOM,I,!0,!0),C.hasChildren=!1;break}this._buildTagDOM(C.titleDOM,I,!1,!1);var R=this._singleTextChild(S),N=R&&R.nodeValue().length");break;case Node.DOCUMENT_TYPE_NODE:var O=C.titleDOM.createChild("span","html-doctype");O.append("");break;case Node.CDATA_SECTION_NODE:var F=C.titleDOM.createChild("span","html-text-node");F.append("");break;case Node.PROCESSING_INSTRUCTION_NODE:var V=C.titleDOM.createChild("span","html-processing-instruction"),U=S.nodeValue(),G=U.length?" "+U:"",H="";V.append(H);break;default:C.titleDOM.append(S.nodeNameInCorrectCase().collapseWhitespace());}return C}_singleTextChild(_){if(!_)return null;var S=_.firstChild;if(!S||S.nodeType()!==Node.TEXT_NODE)return null;if(_.hasShadowRoots())return null;if(_.templateContent())return null;if(_.hasPseudoElements())return null;var C=S.nextSibling;return C?null:S}_showInlineText(_){if(_.nodeType()===Node.ELEMENT_NODE){var S=this._singleTextChild(_);if(S&&S.nodeValue().length{T.stopPropagation()})),this._statusImageElement.classList.toggle("subtree",!S&&C),this.listItemElement.insertBefore(this._statusImageElement,this.listItemElement.firstChild);let f=this._breakpointStatus===WebInspector.DOMTreeElement.BreakpointStatus.DisabledBreakpoint;this._statusImageElement.classList.toggle("disabled",f)}}_statusImageClicked(_){if(this._breakpointStatus!==WebInspector.DOMTreeElement.BreakpointStatus.None&&!(0!==_.button||_.ctrlKey)){let S=WebInspector.domDebuggerManager.domBreakpointsForNode(this.representedObject);if(S&&S.length){let C=S.some(f=>f.disabled);S.forEach(f=>f.disabled=!C)}}}_statusImageContextmenu(_){let S=this._breakpointStatus!==WebInspector.DOMTreeElement.BreakpointStatus.None,C=!!this._subtreeBreakpointCount;if(S||C){let f=WebInspector.ContextMenu.createFromEvent(_);if(S){return void WebInspector.DOMBreakpointTreeController.appendBreakpointContextMenuItems(f,this.representedObject,!0)}f.appendItem(WebInspector.UIString("Reveal Breakpoint"),()=>{let T=this.selfOrDescendant(E=>E.breakpointStatus&&E.breakpointStatus!==WebInspector.DOMTreeElement.BreakpointStatus.None);T&&T.revealAndHighlight()})}}_highlightAnimationEnd(){let _=this.listItemElement;_&&(_.removeEventListener("animationend",this._boundHighlightAnimationEnd),_.classList.remove(WebInspector.DOMTreeElement.HighlightStyleClassName),this._animatingHighlight=!1)}},WebInspector.DOMTreeElement.InitialChildrenLimit=500,WebInspector.DOMTreeElement.MaximumInlineTextChildLength=80,WebInspector.DOMTreeElement.ForbiddenClosingTagElements=["area","base","basefont","br","canvas","col","command","embed","frame","hr","img","input","keygen","link","meta","param","source","wbr","track","menuitem"].keySet(),WebInspector.DOMTreeElement.EditTagBlacklist=["html","head","body"].keySet(),WebInspector.DOMTreeElement.ChangeType={Attribute:"dom-tree-element-change-type-attribute"},WebInspector.DOMTreeElement.BreakpointStatus={None:Symbol("none"),Breakpoint:Symbol("breakpoint"),DisabledBreakpoint:Symbol("disabled-breakpoint")},WebInspector.DOMTreeElement.HighlightStyleClassName="highlight",WebInspector.DOMTreeElement.SearchHighlightStyleClassName="search-highlight",WebInspector.DOMTreeElement.BouncyHighlightStyleClassName="bouncy-highlight",WebInspector.DOMTreeElementPathComponent=class extends WebInspector.HierarchicalPathComponent{constructor(_,S){var C=_.representedObject,f=null,T=null;switch(C.nodeType()){case Node.ELEMENT_NODE:C.isPseudoElement()?(T=WebInspector.DOMTreeElementPathComponent.DOMPseudoElementIconStyleClassName,f="::"+C.pseudoType()):(T=WebInspector.DOMTreeElementPathComponent.DOMElementIconStyleClassName,f=C.displayName);break;case Node.TEXT_NODE:T=WebInspector.DOMTreeElementPathComponent.DOMTextNodeIconStyleClassName,f="\""+C.nodeValue().trimEnd(32)+"\"";break;case Node.COMMENT_NODE:T=WebInspector.DOMTreeElementPathComponent.DOMCommentIconStyleClassName,f="";break;case Node.DOCUMENT_TYPE_NODE:T=WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName,f="";break;case Node.DOCUMENT_NODE:T=WebInspector.DOMTreeElementPathComponent.DOMDocumentIconStyleClassName,f=C.nodeNameInCorrectCase();break;case Node.CDATA_SECTION_NODE:T=WebInspector.DOMTreeElementPathComponent.DOMCharacterDataIconStyleClassName,f="";break;case Node.DOCUMENT_FRAGMENT_NODE:T=WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName,f=C.shadowRootType()?WebInspector.UIString("Shadow Content"):C.displayName;break;case Node.PROCESSING_INSTRUCTION_NODE:T=WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName,f=C.nodeNameInCorrectCase();break;default:console.error("Unknown DOM node type: ",C.nodeType()),T=WebInspector.DOMTreeElementPathComponent.DOMNodeIconStyleClassName,f=C.nodeNameInCorrectCase();}super(f,T,S||_.representedObject),this._domTreeElement=_}get domTreeElement(){return this._domTreeElement}get previousSibling(){return this._domTreeElement.previousSibling?new WebInspector.DOMTreeElementPathComponent(this._domTreeElement.previousSibling):null}get nextSibling(){return this._domTreeElement.nextSibling?this._domTreeElement.nextSibling.isCloseTag()?null:new WebInspector.DOMTreeElementPathComponent(this._domTreeElement.nextSibling):null}mouseOver(){var _=this._domTreeElement.representedObject.id;WebInspector.domTreeManager.highlightDOMNode(_)}mouseOut(){WebInspector.domTreeManager.hideDOMNodeHighlight()}},WebInspector.DOMTreeElementPathComponent.DOMElementIconStyleClassName="dom-element-icon",WebInspector.DOMTreeElementPathComponent.DOMPseudoElementIconStyleClassName="dom-pseudo-element-icon",WebInspector.DOMTreeElementPathComponent.DOMTextNodeIconStyleClassName="dom-text-node-icon",WebInspector.DOMTreeElementPathComponent.DOMCommentIconStyleClassName="dom-comment-icon",WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName="dom-document-type-icon",WebInspector.DOMTreeElementPathComponent.DOMDocumentIconStyleClassName="dom-document-icon",WebInspector.DOMTreeElementPathComponent.DOMCharacterDataIconStyleClassName="dom-character-data-icon",WebInspector.DOMTreeElementPathComponent.DOMNodeIconStyleClassName="dom-node-icon",WebInspector.DOMTreeOutline=class extends WebInspector.TreeOutline{constructor(_,S,C){super(),this.element.addEventListener("mousedown",this._onmousedown.bind(this),!1),this.element.addEventListener("mousemove",this._onmousemove.bind(this),!1),this.element.addEventListener("mouseout",this._onmouseout.bind(this),!1),this.element.addEventListener("dragstart",this._ondragstart.bind(this),!1),this.element.addEventListener("dragover",this._ondragover.bind(this),!1),this.element.addEventListener("dragleave",this._ondragleave.bind(this),!1),this.element.addEventListener("drop",this._ondrop.bind(this),!1),this.element.addEventListener("dragend",this._ondragend.bind(this),!1),this.element.classList.add("dom",WebInspector.SyntaxHighlightedStyleClassName),this._includeRootDOMNode=!_,this._selectEnabled=S,this._excludeRevealElementContextMenu=C,this._rootDOMNode=null,this._selectedDOMNode=null,this._editable=!1,this._editing=!1,this._visible=!1,this._hideElementKeyboardShortcut=new WebInspector.KeyboardShortcut(null,"H",this._hideElement.bind(this),this.element),this._hideElementKeyboardShortcut.implicitlyPreventsDefault=!1,WebInspector.showShadowDOMSetting.addEventListener(WebInspector.Setting.Event.Changed,this._showShadowDOMSettingChanged,this)}wireToDomAgent(){this._elementsTreeUpdater=new WebInspector.DOMTreeUpdater(this)}close(){WebInspector.showShadowDOMSetting.removeEventListener(null,null,this),this._elementsTreeUpdater&&(this._elementsTreeUpdater.close(),this._elementsTreeUpdater=null)}setVisible(_,S){this._visible=_;this._visible&&(this._updateModifiedNodes(),this._selectedDOMNode&&this._revealAndSelectNode(this._selectedDOMNode,S),this.update())}get rootDOMNode(){return this._rootDOMNode}set rootDOMNode(_){this._rootDOMNode===_||(this._rootDOMNode=_,this._isXMLMimeType=_&&_.isXMLNode(),this.update())}get isXMLMimeType(){return this._isXMLMimeType}selectedDOMNode(){return this._selectedDOMNode}selectDOMNode(_,S){return this._selectedDOMNode===_?void this._revealAndSelectNode(_,!S):void(this._selectedDOMNode=_,this._revealAndSelectNode(_,!S),(!_||this._selectedDOMNode===_)&&this._selectedNodeChanged())}get editable(){return this._editable}set editable(_){this._editable=_}get editing(){return this._editing}update(){if(this.rootDOMNode){let _=this.selectedTreeElement?this.selectedTreeElement.representedObject:null;this.removeChildren();var S;if(this._includeRootDOMNode)S=new WebInspector.DOMTreeElement(this.rootDOMNode),S.selectable=this._selectEnabled,this.appendChild(S);else for(var C=this.rootDOMNode.firstChild;C;)S=new WebInspector.DOMTreeElement(C),S.selectable=this._selectEnabled,this.appendChild(S),C=C.nextSibling,S.hasChildren&&!S.expanded&&S.expand();_&&this._revealAndSelectNode(_,!0)}}updateSelection(){this.selectedTreeElement&&this.selectedTreeElement.updateSelectionArea()}_selectedNodeChanged(){this.dispatchEventToListeners(WebInspector.DOMTreeOutline.Event.SelectedNodeChanged)}findTreeElement(_){let S=(T,E)=>T.isAncestor(E),C=T=>T.parentNode,f=super.findTreeElement(_,S,C);return f||_.nodeType()!==Node.TEXT_NODE||(f=super.findTreeElement(_.parentNode,S,C)),f}createTreeElementFor(_){var S=this.findTreeElement(_);return S?S:_.parentNode?(S=this.createTreeElementFor(_.parentNode),S?S.showChildNode(_):null):null}set suppressRevealAndSelect(_){this._suppressRevealAndSelect===_||(this._suppressRevealAndSelect=_)}populateContextMenu(_,S,C){let f=S.target.enclosingNodeOrSelfWithClass("html-tag"),T=S.target.enclosingNodeOrSelfWithClass("html-text-node"),E=S.target.enclosingNodeOrSelfWithClass("html-comment"),I=S.target.enclosingNodeOrSelfWithClass("html-pseudo-element");f&&C._populateTagContextMenu?(_.appendSeparator(),C._populateTagContextMenu(_,S)):T&&C._populateTextContextMenu?(_.appendSeparator(),C._populateTextContextMenu(_,T)):(E||I)&&C._populateNodeContextMenu&&(_.appendSeparator(),C._populateNodeContextMenu(_));const R={excludeRevealElement:this._excludeRevealElementContextMenu};WebInspector.appendContextMenuItemsForDOMNode(_,C.representedObject,R),super.populateContextMenu(_,S,C)}adjustCollapsedRange(){}_revealAndSelectNode(_,S){if(_&&!this._suppressRevealAndSelect){if(!WebInspector.showShadowDOMSetting.value){for(;_&&_.isInShadowTree();)_=_.parentNode;if(!_)return}var C=this.createTreeElementFor(_);C&&C.revealAndSelect(S)}}_onmousedown(_){let S=this.treeElementFromEvent(_);return!S||S.isEventWithinDisclosureTriangle(_)?void _.preventDefault():void S.select()}_onmousemove(_){let S=this.treeElementFromEvent(_);S&&this._previousHoveredElement===S||(this._previousHoveredElement&&(this._previousHoveredElement.hovered=!1,this._previousHoveredElement=null),S&&(S.hovered=!0,this._previousHoveredElement=S,S.representedObject&&!S.tooltip&&S._createTooltipForNode&&S._createTooltipForNode()),WebInspector.domTreeManager.highlightDOMNode(S?S.representedObject.id:0))}_onmouseout(_){var S=document.elementFromPoint(_.pageX,_.pageY);S&&S.isDescendant(this.element)||(this._previousHoveredElement&&(this._previousHoveredElement.hovered=!1,this._previousHoveredElement=null),WebInspector.domTreeManager.hideDOMNodeHighlight())}_ondragstart(_){let S=this.treeElementFromEvent(_);return!!S&&!!this._isValidDragSourceOrTarget(S)&&("BODY"===S.representedObject.nodeName()||"HEAD"===S.representedObject.nodeName()?!1:(_.dataTransfer.setData("text/plain",S.listItemElement.textContent),_.dataTransfer.effectAllowed="copyMove",this._nodeBeingDragged=S.representedObject,WebInspector.domTreeManager.hideDOMNodeHighlight(),!0))}_ondragover(_){if(_.dataTransfer.types.includes(WebInspector.CSSStyleDetailsSidebarPanel.ToggledClassesDragType))return _.preventDefault(),_.dataTransfer.dropEffect="copy",!1;if(!this._nodeBeingDragged)return!1;let S=this.treeElementFromEvent(_);if(!this._isValidDragSourceOrTarget(S))return!1;for(let C=S.representedObject;C;){if(C===this._nodeBeingDragged)return!1;C=C.parentNode}return this.dragOverTreeElement=S,S.listItemElement.classList.add("elements-drag-over"),S.updateSelectionArea(),_.preventDefault(),_.dataTransfer.dropEffect="move",!1}_ondragleave(_){return this._clearDragOverTreeElementMarker(),_.preventDefault(),!1}_isValidDragSourceOrTarget(_){if(!_)return!1;var S=_.representedObject;return!!(S instanceof WebInspector.DOMNode)&&S.parentNode&&S.parentNode.nodeType()===Node.ELEMENT_NODE}_ondrop(_){function S(f,T){if(!f){this._updateModifiedNodes();var E=WebInspector.domTreeManager.nodeForId(T);E&&this.selectDOMNode(E,!0)}}_.preventDefault();let C=this.treeElementFromEvent(_);if(this._nodeBeingDragged&&C){let f=null,T=null;if(C._elementCloseTag)f=C.representedObject;else{let E=C.representedObject;f=E.parentNode,T=E}this._nodeBeingDragged.moveTo(f,T,S.bind(this))}else{let f=_.dataTransfer.getData(WebInspector.CSSStyleDetailsSidebarPanel.ToggledClassesDragType);f&&C&&C.representedObject.toggleClass(f,!0)}delete this._nodeBeingDragged}_ondragend(_){_.preventDefault(),this._clearDragOverTreeElementMarker(),delete this._nodeBeingDragged}_clearDragOverTreeElementMarker(){if(this.dragOverTreeElement){let _=this.dragOverTreeElement;this.dragOverTreeElement=null,_.listItemElement.classList.remove("elements-drag-over"),_.updateSelectionArea()}}_updateModifiedNodes(){this._elementsTreeUpdater&&this._elementsTreeUpdater._updateModifiedNodes()}_showShadowDOMSettingChanged(){for(var S=this.selectedTreeElement?this.selectedTreeElement.representedObject:null;S&&!!S.isInShadowTree();)S=S.parentNode;this.children.forEach(function(C){C.updateChildren(!0)}),S&&this.selectDOMNode(S)}_hideElement(_){function C(T){T&&(T.callFunction(function(){var I="__WebInspectorHideElement__",R=document.getElementById(I);R||(R=document.createElement("style"),R.id=I,R.textContent="."+I+" { visibility: hidden !important; }",document.head.appendChild(R)),this.classList.toggle(I)},void 0,!1,function(){}),T.release())}if(this.selectedTreeElement&&!WebInspector.isEditingAnyField()){_.preventDefault();var f=this.selectedTreeElement.representedObject;!f||f.isPseudoElement()&&(f=f.parentNode,!f)||f.nodeType()!==Node.ELEMENT_NODE||WebInspector.RemoteObject.resolveNode(f,"",C)}}},WebInspector.DOMTreeOutline.Event={SelectedNodeChanged:"dom-tree-outline-selected-node-changed"},WebInspector.DOMTreeUpdater=function(u){WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeInserted,this._nodeInserted,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeRemoved,this._nodeRemoved,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeModified,this._attributesUpdated,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeRemoved,this._attributesUpdated,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.CharacterDataModified,this._characterDataModified,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.DocumentUpdated,this._documentUpdated,this),WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.ChildNodeCountUpdated,this._childNodeCountUpdated,this),this._treeOutline=u,this._recentlyInsertedNodes=new Map,this._recentlyDeletedNodes=new Map,this._recentlyModifiedNodes=new Set,this._recentlyModifiedAttributes=new Map,this._textContentAttributeSymbol=Symbol("text-content-attribute")},WebInspector.DOMTreeUpdater.prototype={close:function(){WebInspector.domTreeManager.removeEventListener(null,null,this)},_documentUpdated:function(){this._reset()},_attributesUpdated:function(u){let{node:_,name:S}=u.data;this._nodeAttributeModified(_,S)},_characterDataModified:function(u){let{node:_}=u.data;this._nodeAttributeModified(_,this._textContentAttributeSymbol)},_nodeAttributeModified:function(u,_){this._recentlyModifiedAttributes.has(_)||this._recentlyModifiedAttributes.set(_,new Set),this._recentlyModifiedAttributes.get(_).add(u),this._recentlyModifiedNodes.add(u),this._treeOutline._visible&&this.onNextFrame._updateModifiedNodes()},_nodeInserted:function(u){this._recentlyInsertedNodes.set(u.data.node,{parent:u.data.parent}),this._treeOutline._visible&&this.onNextFrame._updateModifiedNodes()},_nodeRemoved:function(u){this._recentlyDeletedNodes.set(u.data.node,{parent:u.data.parent}),this._treeOutline._visible&&this.onNextFrame._updateModifiedNodes()},_childNodeCountUpdated:function(u){var _=this._treeOutline.findTreeElement(u.data);_&&(_.hasChildren=u.data.hasChildNodes())},_updateModifiedNodes:function(){let u=new Set,_=S=>{let T=S.parent,E=this._treeOutline.findTreeElement(T);E&&u.add(E)};this._recentlyInsertedNodes.forEach(_),this._recentlyDeletedNodes.forEach(_);for(let S of u)S.updateTitle(),S.updateChildren();for(let S of this._recentlyModifiedNodes.values()){let C=this._treeOutline.findTreeElement(S);if(!C)return;for(let[f,T]of this._recentlyModifiedAttributes.entries())f!==this._textContentAttributeSymbol&&T.has(S)&&C.attributeDidChange(f);C.updateTitle()}this._recentlyInsertedNodes.clear(),this._recentlyDeletedNodes.clear(),this._recentlyModifiedNodes.clear(),this._recentlyModifiedAttributes.clear()},_reset:function(){WebInspector.domTreeManager.hideDOMNodeHighlight(),this._recentlyInsertedNodes.clear(),this._recentlyDeletedNodes.clear(),this._recentlyModifiedNodes.clear(),this._recentlyModifiedAttributes.clear()}},WebInspector.DashboardContainerView=class extends WebInspector.Object{constructor(){super(),this._toolbarItem=new WebInspector.NavigationItem("dashboard-container","group",WebInspector.UIString("Activity Viewer")),this._advanceForwardArrowElement=this._toolbarItem.element.appendChild(document.createElement("div")),this._advanceForwardArrowElement.className="advance-arrow advance-forward",this._advanceBackwardArrowElement=this._toolbarItem.element.appendChild(document.createElement("div")),this._advanceBackwardArrowElement.className="advance-arrow advance-backward",this._advanceForwardArrowElement.addEventListener("click",this._advanceForwardArrowClicked.bind(this)),this._advanceBackwardArrowElement.addEventListener("click",this._advanceBackwardArrowClicked.bind(this)),this._dashboardStack=[],this._currentIndex=-1,this._updateAdvanceArrowVisibility()}get toolbarItem(){return this._toolbarItem}get currentDashboardView(){return-1===this._currentIndex?null:this._dashboardStack[this._currentIndex]}showDashboardViewForRepresentedObject(_){var S=this._dashboardViewForRepresentedObject(_);if(!S)return null;if(this.currentDashboardView===S)return S;var C=this._dashboardStack.indexOf(S);return this._showDashboardAtIndex(C),S}hideDashboardViewForRepresentedObject(_){var C=this._dashboardViewForRepresentedObject(_,!0);this.currentDashboardView!==C||this._showDashboardAtIndex(this._currentIndex-1)}closeDashboardViewForRepresentedObject(_){var C=this._dashboardViewForRepresentedObject(_,!0);C&&this._closeDashboardView(C)}_advanceForwardArrowClicked(){this._showDashboardAtIndex(this._currentIndex+1)}_advanceBackwardArrowClicked(){this._showDashboardAtIndex(this._currentIndex-1)}_dismissAdvanceArrows(){this._advanceForwardArrowElement.classList.add(WebInspector.DashboardContainerView.InactiveStyleClassName),this._advanceBackwardArrowElement.classList.add(WebInspector.DashboardContainerView.InactiveStyleClassName)}_updateAdvanceArrowVisibility(){var _=this._currentIndexC&&--this._currentIndex,S.call(this),this._updateAdvanceArrowVisibility()}},WebInspector.DashboardContainerView.VisibleDashboardStyleClassName="visible",WebInspector.DashboardContainerView.InactiveStyleClassName="inactive",WebInspector.DashboardContainerView.AdvanceDirection={Forward:Symbol("dashboard-container-view-advance-direction-forward"),Backward:Symbol("dashboard-container-view-advance-direction-backward"),None:Symbol("dashboard-container-view-advance-direction-none")},WebInspector.DashboardContainerView.ForwardIncomingDashboardStyleClassName="slide-in-down",WebInspector.DashboardContainerView.BackwardIncomingDashboardStyleClassName="slide-in-up",WebInspector.DashboardContainerView.ForwardOutgoingDashboardStyleClassName="slide-out-down",WebInspector.DashboardContainerView.BackwardOutgoingDashboardStyleClassName="slide-out-up",WebInspector.DashboardView=class extends WebInspector.Object{constructor(_,S){super(),this._representedObject=_,this._element=document.createElement("div"),this._element.classList.add("dashboard"),this._element.classList.add(S)}static create(_){if(_ instanceof WebInspector.DefaultDashboard)return new WebInspector.DefaultDashboardView(_);if(_ instanceof WebInspector.DebuggerDashboard)return new WebInspector.DebuggerDashboardView(_);throw"Can't make a DashboardView for an unknown representedObject."}get element(){return this._element}get representedObject(){return this._representedObject}shown(){}hidden(){}closed(){}},WebInspector.DatabaseContentView=class extends WebInspector.ContentView{constructor(_){super(_),this.database=_,this.element.classList.add("storage-view","query","monospace"),this._prompt=new WebInspector.ConsolePrompt(this,"text/x-sql"),this.addSubview(this._prompt),this.element.addEventListener("click",this._messagesClicked.bind(this),!0)}saveToCookie(_){_.type=WebInspector.ContentViewCookieType.Database,_.host=this.representedObject.host,_.name=this.representedObject.name}consolePromptCompletionsNeeded(_,S,C,f){function E(N){for(let L of N)L.toLowerCase().startsWith(f)&&R.push(L)}let R=[];f=f.toLowerCase(),this.database.getTableNames(function(N){E(N),E(["SELECT","FROM","WHERE","LIMIT","DELETE FROM","CREATE","DROP","TABLE","INDEX","UPDATE","INSERT INTO","VALUES"]),this._prompt.updateCompletions(R," ")}.bind(this))}consolePromptTextCommitted(_,S){this.database.executeSQL(S,this._queryFinished.bind(this,S),this._queryError.bind(this,S))}_messagesClicked(){this._prompt.focus()}_queryFinished(_,S,C){let f=_.trim(),T=new WebInspector.DatabaseUserQuerySuccessView(f,S,C);this.insertSubviewBefore(T,this._prompt),T.dataGrid&&T.dataGrid.autoSizeColumns(5),this._prompt.element.scrollIntoView(!1),(f.match(/^create /i)||f.match(/^drop table /i))&&this.dispatchEventToListeners(WebInspector.DatabaseContentView.Event.SchemaUpdated,this.database)}_queryError(_,S){let C=S.message?S.message:2===S.code?WebInspector.UIString("Database no longer has expected version."):WebInspector.UIString("An unexpected error %s occurred.").format(S.code);let f=new WebInspector.DatabaseUserQueryErrorView(_,C);this.insertSubviewBefore(f,this._prompt),this._prompt.element.scrollIntoView(!1)}},WebInspector.DatabaseContentView.Event={SchemaUpdated:"SchemaUpdated"},WebInspector.DatabaseHostTreeElement=class extends WebInspector.StorageTreeElement{constructor(_){super(WebInspector.FolderTreeElement.FolderIconStyleClassName,WebInspector.displayNameForHost(_),null),this._host=_,this.hasChildren=!0,this.expanded=!0}get name(){return WebInspector.displayNameForHost(this._host)}get categoryName(){return WebInspector.UIString("Databases")}},WebInspector.DatabaseTableContentView=class extends WebInspector.ContentView{constructor(_){super(_),this.element.classList.add("database-table"),this._refreshButtonNavigationItem=new WebInspector.ButtonNavigationItem("database-table-refresh",WebInspector.UIString("Refresh"),"Images/ReloadFull.svg",13,13),this._refreshButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._refreshButtonClicked,this),this._messageTextViewElement=null,this.update()}get navigationItems(){return[this._refreshButtonNavigationItem]}update(){this.representedObject.database.executeSQL("SELECT * FROM \""+this._escapeTableName(this.representedObject.name)+"\"",this._queryFinished.bind(this),this._queryError.bind(this))}saveToCookie(_){_.type=WebInspector.ContentViewCookieType.DatabaseTable,_.host=this.representedObject.host,_.name=this.representedObject.name,_.database=this.representedObject.database.name}get scrollableElements(){return this._dataGrid?[this._dataGrid.scrollContainer]:[]}_escapeTableName(_){return _.replace(/\"/g,"\"\"")}_queryFinished(_,S){return this._dataGrid&&(this.removeSubview(this._dataGrid),this._dataGrid=null),this._messageTextViewElement&&this._messageTextViewElement.remove(),_.length?(this._dataGrid=WebInspector.DataGrid.createSortableDataGrid(_,S),this.addSubview(this._dataGrid),void this._dataGrid.updateLayout()):void(this._messageTextViewElement=WebInspector.createMessageTextView(WebInspector.UIString("The \u201C%s\u201D\ntable is empty.").format(this.representedObject.name),!1),this.element.appendChild(this._messageTextViewElement))}_queryError(){this._dataGrid&&(this.removeSubview(this._dataGrid),this._dataGrid=null),this._messageTextViewElement&&this._messageTextViewElement.remove(),this._messageTextViewElement=WebInspector.createMessageTextView(WebInspector.UIString("An error occurred trying to read the \u201C%s\u201D table.").format(this.representedObject.name),!0),this.element.appendChild(this._messageTextViewElement)}_refreshButtonClicked(){this.update()}},WebInspector.DatabaseTableTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_){super("database-table-icon",_.name,null,_,!1)}},WebInspector.DatabaseTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_){super("database-icon",_.name,null,_,!0),this.hasChildren=!1,this.onpopulate()}oncollapse(){this.shouldRefreshChildren=!0}onpopulate(){this.children.length&&!this.shouldRefreshChildren||(this.shouldRefreshChildren=!1,this.removeChildren(),this.representedObject.getTableNames(function(S){for(var C=0,f;C{WebInspector.timelineManager.stopCapturing()}),this._breakpointsDisabledWarningElement=document.createElement("div"),this._breakpointsDisabledWarningElement.classList.add("warning-banner"),this._breakpointsDisabledWarningElement.append(WebInspector.UIString("Breakpoints disabled"),document.createElement("br"));let f=this._breakpointsDisabledWarningElement.appendChild(document.createElement("a"));f.textContent=WebInspector.UIString("Enable breakpoints"),f.addEventListener("click",()=>{WebInspector.debuggerToggleBreakpoints()}),this._navigationBar=new WebInspector.NavigationBar,this.addSubview(this._navigationBar);var T={src:"Images/Breakpoints.svg",width:15,height:15},E={src:"Images/Pause.svg",width:15,height:15},R={src:"Images/StepOver.svg",width:15,height:15},N={src:"Images/StepInto.svg",width:15,height:15},L={src:"Images/StepOut.svg",width:15,height:15},D=WebInspector.UIString("Enable all breakpoints (%s)").format(WebInspector.toggleBreakpointsKeyboardShortcut.displayName),M=WebInspector.UIString("Disable all breakpoints (%s)").format(WebInspector.toggleBreakpointsKeyboardShortcut.displayName);this._debuggerBreakpointsButtonItem=new WebInspector.ActivateButtonNavigationItem("debugger-breakpoints",D,M,T.src,T.width,T.height),this._debuggerBreakpointsButtonItem.activated=WebInspector.debuggerManager.breakpointsEnabled,this._debuggerBreakpointsButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,WebInspector.debuggerToggleBreakpoints,this),this._navigationBar.addNavigationItem(this._debuggerBreakpointsButtonItem),D=WebInspector.UIString("Pause script execution (%s or %s)").format(WebInspector.pauseOrResumeKeyboardShortcut.displayName,WebInspector.pauseOrResumeAlternateKeyboardShortcut.displayName),M=WebInspector.UIString("Continue script execution (%s or %s)").format(WebInspector.pauseOrResumeKeyboardShortcut.displayName,WebInspector.pauseOrResumeAlternateKeyboardShortcut.displayName),this._debuggerPauseResumeButtonItem=new WebInspector.ToggleButtonNavigationItem("debugger-pause-resume",D,M,E.src,{src:"Images/Resume.svg",width:15,height:15}.src,E.width,E.height),this._debuggerPauseResumeButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,WebInspector.debuggerPauseResumeToggle,this),this._navigationBar.addNavigationItem(this._debuggerPauseResumeButtonItem),this._debuggerStepOverButtonItem=new WebInspector.ButtonNavigationItem("debugger-step-over",WebInspector.UIString("Step over (%s or %s)").format(WebInspector.stepOverKeyboardShortcut.displayName,WebInspector.stepOverAlternateKeyboardShortcut.displayName),R.src,R.width,R.height),this._debuggerStepOverButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,WebInspector.debuggerStepOver,this),this._debuggerStepOverButtonItem.enabled=!1,this._navigationBar.addNavigationItem(this._debuggerStepOverButtonItem),this._debuggerStepIntoButtonItem=new WebInspector.ButtonNavigationItem("debugger-step-into",WebInspector.UIString("Step into (%s or %s)").format(WebInspector.stepIntoKeyboardShortcut.displayName,WebInspector.stepIntoAlternateKeyboardShortcut.displayName),N.src,N.width,N.height),this._debuggerStepIntoButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,WebInspector.debuggerStepInto,this),this._debuggerStepIntoButtonItem.enabled=!1,this._navigationBar.addNavigationItem(this._debuggerStepIntoButtonItem),this._debuggerStepOutButtonItem=new WebInspector.ButtonNavigationItem("debugger-step-out",WebInspector.UIString("Step out (%s or %s)").format(WebInspector.stepOutKeyboardShortcut.displayName,WebInspector.stepOutAlternateKeyboardShortcut.displayName),L.src,L.width,L.height),this._debuggerStepOutButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,WebInspector.debuggerStepOut,this),this._debuggerStepOutButtonItem.enabled=!1,this._navigationBar.addNavigationItem(this._debuggerStepOutButtonItem),this.element.classList.add(WebInspector.DebuggerSidebarPanel.OffsetSectionsStyleClassName),this._allExceptionsBreakpointTreeElement=new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allExceptionsBreakpoint,WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName,WebInspector.UIString("All Exceptions")),this._allUncaughtExceptionsBreakpointTreeElement=new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint,WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName,WebInspector.UIString("Uncaught Exceptions")),this._assertionsBreakpointTreeElement=new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.assertionsBreakpoint,WebInspector.DebuggerSidebarPanel.AssertionIconStyleClassName,WebInspector.UIString("Assertion Failures")),this.suppressFilteringOnTreeElements([this._allExceptionsBreakpointTreeElement,this._allUncaughtExceptionsBreakpointTreeElement,this._assertionsBreakpointTreeElement]),this.filterBar.placeholder=WebInspector.UIString("Filter List"),this.filterBar.addFilterBarButton("debugger-show-resources-with-issues-only",function(W){if(W.treeOutline!==this._scriptsContentTreeOutline)return!0;if(W instanceof WebInspector.IssueTreeElement)return!0;if(W.hasChildren)for(let z of W.children)if(z instanceof WebInspector.IssueTreeElement)return!0;return!1}.bind(this),!1,WebInspector.UIString("Only show resources with issues"),WebInspector.UIString("Show all resources"),"Images/Errors.svg",15,15),this._breakpointsContentTreeOutline=this.contentTreeOutline;let P=new WebInspector.DetailsSectionRow;P.element.appendChild(this._breakpointsContentTreeOutline.element);let O=new WebInspector.DetailsSectionGroup([P]),F=new WebInspector.DetailsSection("breakpoints",WebInspector.UIString("Breakpoints"),[O]);if(this.contentView.element.appendChild(F.element),this._breakpointSectionElement=F.element,this._breakpointsContentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange,this._treeSelectionDidChange,this),this._breakpointsContentTreeOutline.ondelete=this._breakpointTreeOutlineDeleteTreeElement.bind(this),this._breakpointsContentTreeOutline.populateContextMenu=function(W,z,K){this._breakpointTreeOutlineContextMenuTreeElement(W,z,K),WebInspector.TreeOutline.prototype.populateContextMenu(W,z,K)}.bind(this),this._breakpointsContentTreeOutline.appendChild(this._allExceptionsBreakpointTreeElement),this._breakpointsContentTreeOutline.appendChild(this._allUncaughtExceptionsBreakpointTreeElement),DebuggerAgent.setPauseOnAssertions&&this._breakpointsContentTreeOutline.appendChild(this._assertionsBreakpointTreeElement),WebInspector.domDebuggerManager.supported){this._domBreakpointsContentTreeOutline=this.createContentTreeOutline(!0),this._domBreakpointsContentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.ElementAdded,this._domBreakpointAddedOrRemoved,this),this._domBreakpointsContentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.ElementRemoved,this._domBreakpointAddedOrRemoved,this),this._domBreakpointTreeController=new WebInspector.DOMBreakpointTreeController(this._domBreakpointsContentTreeOutline),this._domBreakpointsRow=new WebInspector.DetailsSectionRow(WebInspector.UIString("No Breakpoints")),this._domBreakpointsRow.element.appendChild(this._domBreakpointsContentTreeOutline.element),this._domBreakpointsRow.showEmptyMessage();const W=!0;let z=new WebInspector.DetailsSectionGroup([this._domBreakpointsRow]);this._domBreakpointsSection=new WebInspector.DetailsSection("dom-breakpoints",WebInspector.UIString("DOM Breakpoints"),[z],null,W),this.contentView.element.appendChild(this._domBreakpointsSection.element),this._xhrBreakpointsContentTreeOutline=this.createContentTreeOutline(!0),this._xhrBreakpointTreeController=new WebInspector.XHRBreakpointTreeController(this._xhrBreakpointsContentTreeOutline),this._xhrBreakpointsRow=new WebInspector.DetailsSectionRow,this._xhrBreakpointsRow.element.appendChild(this._xhrBreakpointsContentTreeOutline.element);let K=new WebInspector.NavigationBar,q=document.createElement("div");q.appendChild(K.element);let X=new WebInspector.ButtonNavigationItem("add-xhr-breakpoint",WebInspector.UIString("Add XHR Breakpoint"),"Images/Plus13.svg",13,13);X.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._addXHRBreakpointButtonClicked,this),K.addNavigationItem(X);let Y=new WebInspector.DetailsSectionGroup([this._xhrBreakpointsRow]),Q=new WebInspector.DetailsSection("xhr-breakpoints",WebInspector.UIString("XHR Breakpoints"),[Y],q,W);this.contentView.element.appendChild(Q.element)}this._scriptsContentTreeOutline=this.createContentTreeOutline(),this._scriptsContentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange,this._treeSelectionDidChange,this),this._scriptsContentTreeOutline.includeSourceMapResourceChildren=!0;let V=new WebInspector.DetailsSectionRow;V.element.appendChild(this._scriptsContentTreeOutline.element);let U=new WebInspector.DetailsSectionGroup([V]);this._scriptsSection=new WebInspector.DetailsSection("scripts",WebInspector.UIString("Sources"),[U]),this.contentView.element.appendChild(this._scriptsSection.element);this._callStackTreeOutline=this.createContentTreeOutline(!0),this._callStackTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange,this._treeSelectionDidChange,this),this._mainTargetTreeElement=new WebInspector.ThreadTreeElement(WebInspector.mainTarget),this._callStackTreeOutline.appendChild(this._mainTargetTreeElement),this._updateCallStackTreeOutline(),this._callStackRow=new WebInspector.DetailsSectionRow,this._callStackRow.element.appendChild(this._callStackTreeOutline.element),this._callStackGroup=new WebInspector.DetailsSectionGroup([this._callStackRow]),this._callStackSection=new WebInspector.DetailsSection("call-stack",WebInspector.UIString("Call Stack"),[this._callStackGroup]),this._showingSingleThreadCallStack=!0,this._activeCallFrameTreeElement=null,this._pauseReasonTreeOutline=null,this._pauseReasonLinkContainerElement=document.createElement("span"),this._pauseReasonTextRow=new WebInspector.DetailsSectionTextRow,this._pauseReasonGroup=new WebInspector.DetailsSectionGroup([this._pauseReasonTextRow]),this._pauseReasonSection=new WebInspector.DetailsSection("paused-reason",WebInspector.UIString("Pause Reason"),[this._pauseReasonGroup],this._pauseReasonLinkContainerElement),WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisplayLocationDidChange,this._handleDebuggerObjectDisplayLocationDidChange,this),WebInspector.IssueMessage.addEventListener(WebInspector.IssueMessage.Event.DisplayLocationDidChange,this._handleDebuggerObjectDisplayLocationDidChange,this),WebInspector.issueManager.addEventListener(WebInspector.IssueManager.Event.IssueWasAdded,this._handleIssueAdded,this),WebInspector.issueManager.addEventListener(WebInspector.IssueManager.Event.Cleared,this._handleIssuesCleared,this),WebInspector.frameResourceManager.mainFrame&&this._addResourcesRecursivelyForFrame(WebInspector.frameResourceManager.mainFrame);for(var H of WebInspector.debuggerManager.knownNonResourceScripts)this._addScript(H);WebInspector.debuggerManager.paused&&this._debuggerDidPause(null),WebInspector.timelineManager.isCapturing()&&WebInspector.debuggerManager.breakpointsDisabledTemporarily&&this._timelineCapturingWillStart(null),this._updateBreakpointsDisabledBanner()}get minimumWidth(){return this._navigationBar.minimumWidth}closed(){super.closed(),this._domBreakpointTreeController.disconnect(),this._domBreakpointTreeController=null,WebInspector.Frame.removeEventListener(null,null,this),WebInspector.debuggerManager.removeEventListener(null,null,this),WebInspector.Breakpoint.removeEventListener(null,null,this),WebInspector.IssueMessage.removeEventListener(null,null,this)}showDefaultContentView(){if(WebInspector.frameResourceManager.mainFrame){let S=this._scriptsContentTreeOutline.findTreeElement(WebInspector.frameResourceManager.mainFrame.mainResource);if(S&&this.showDefaultContentViewForTreeElement(S))return}for(let _=this._scriptsContentTreeOutline.children[0];_&&!_.root;){if((_ instanceof WebInspector.ResourceTreeElement||_ instanceof WebInspector.ScriptTreeElement)&&this.showDefaultContentViewForTreeElement(_))return;_=_.traverseNextTreeElement(!1,null,!0)}}treeElementForRepresentedObject(_){_ instanceof WebInspector.Frame&&(_=_.mainResource);let S=this._breakpointsContentTreeOutline.findTreeElement(_);return S||(S=this._scriptsContentTreeOutline.findTreeElement(_)),S?S:_ instanceof WebInspector.Script?_.url?(console.error("Didn't find a ScriptTreeElement for a Script with a URL."),null):this._addScript(_):(console.error("Didn't find a TreeElement for representedObject",_),null)}saveStateToCookie(_){var S=this._breakpointsContentTreeOutline.selectedTreeElement;if(!S)return void super.saveStateToCookie(_);var C=S.representedObject;return C===WebInspector.debuggerManager.allExceptionsBreakpoint?void(_[WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey]=!0):C===WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint?void(_[WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey]=!0):C===WebInspector.debuggerManager.assertionsBreakpoint?void(_[WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey]=!0):C===WebInspector.domDebuggerManager.allRequestsBreakpoint?void(_[WebInspector.DebuggerSidebarPanel.SelectedAllRequestsCookieKey]=!0):void super.saveStateToCookie(_)}restoreStateFromCookie(_,S){_[WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey]?this._allExceptionsBreakpointTreeElement.revealAndSelect():_[WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey]?this._allUncaughtExceptionsBreakpointTreeElement.revealAndSelect():_[WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey]?this._assertionsBreakpointTreeElement.revealAndSelect():_[WebInspector.DebuggerSidebarPanel.SelectedAllRequestsCookieKey]?this._xhrBreakpointTreeController.revealAndSelect(WebInspector.domDebuggerManager.allRequestsBreakpoint):super.restoreStateFromCookie(_,S)}_debuggerWaitingToPause(){this._debuggerPauseResumeButtonItem.enabled=!1}_debuggerDidPause(){this.contentView.element.insertBefore(this._callStackSection.element,this.contentView.element.firstChild),this._updatePauseReason()&&this.contentView.element.insertBefore(this._pauseReasonSection.element,this.contentView.element.firstChild),this._debuggerPauseResumeButtonItem.enabled=!0,this._debuggerPauseResumeButtonItem.toggled=!0,this._debuggerStepOverButtonItem.enabled=!0,this._debuggerStepIntoButtonItem.enabled=!0,this._debuggerStepOutButtonItem.enabled=!0,this.element.classList.add(WebInspector.DebuggerSidebarPanel.DebuggerPausedStyleClassName)}_debuggerDidResume(){this._callStackSection.element.remove(),this._pauseReasonSection.element.remove(),this._debuggerPauseResumeButtonItem.enabled=!0,this._debuggerPauseResumeButtonItem.toggled=!1,this._debuggerStepOverButtonItem.enabled=!1,this._debuggerStepIntoButtonItem.enabled=!1,this._debuggerStepOutButtonItem.enabled=!1,this.element.classList.remove(WebInspector.DebuggerSidebarPanel.DebuggerPausedStyleClassName)}_breakpointsEnabledDidChange(){this._debuggerBreakpointsButtonItem.activated=WebInspector.debuggerManager.breakpointsEnabled,this._updateBreakpointsDisabledBanner()}_addBreakpoint(_){let S=_.sourceCodeLocation.displaySourceCode;if(!S)return null;if(!this._breakpointsContentTreeOutline.findTreeElement(_)){let C=this._addTreeElementForSourceCodeToTreeOutline(S,this._breakpointsContentTreeOutline);_.disabled&&(_.resolved=!0);let f=new WebInspector.BreakpointTreeElement(_);return C.insertChild(f,insertionIndexForObjectInListSortedByFunction(f,C.children,this._compareTreeElements)),1===C.children.length&&C.expand(),f}}_addBreakpointsForSourceCode(_){for(var S=WebInspector.debuggerManager.breakpointsForSourceCode(_),C=0;C!R.disabled),I=()=>{this._toggleAllBreakpoints(f,T)};T?_.appendItem(WebInspector.UIString("Disable Breakpoints"),I):_.appendItem(WebInspector.UIString("Enable Breakpoints"),I),_.appendItem(WebInspector.UIString("Delete Breakpoints"),()=>{this._removeAllBreakpoints(f)})}}_treeSelectionDidChange(_){if(this.visible){let S=_.data.selectedElement;if(S){const C={ignoreNetworkTab:!0,ignoreSearchTab:!0};if(S instanceof WebInspector.ResourceTreeElement||S instanceof WebInspector.ScriptTreeElement)return void WebInspector.showSourceCode(S.representedObject,C);if(S instanceof WebInspector.CallFrameTreeElement){let T=S.callFrame;return T.id&&(WebInspector.debuggerManager.activeCallFrame=T),void(T.sourceCodeLocation&&WebInspector.showSourceCodeLocation(T.sourceCodeLocation,C))}if(S instanceof WebInspector.IssueTreeElement)return void WebInspector.showSourceCodeLocation(S.issueMessage.sourceCodeLocation,C);if(S instanceof WebInspector.BreakpointTreeElement){let f=S.breakpoint;return S.treeOutline===this._pauseReasonTreeOutline?void WebInspector.showSourceCodeLocation(f.sourceCodeLocation,C):void(!S.parent.representedObject||!(S.parent.representedObject instanceof WebInspector.SourceCode)||WebInspector.showSourceCodeLocation(f.sourceCodeLocation,C))}}}}_compareTopLevelTreeElements(_,S){function C(f){return f.representedObject===WebInspector.debuggerManager.allExceptionsBreakpoint||f.representedObject===WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint||f.representedObject===WebInspector.debuggerManager.assertionsBreakpoint}return C(_)?-1:C(S)?1:_.mainTitle.extendedLocaleCompare(S.mainTitle)}_compareTreeElements(_,S){if(!_.representedObject||!S.representedObject)return 0;let C=_.representedObject.sourceCodeLocation,f=S.representedObject.sourceCodeLocation;if(!C||!f)return 0;var T=C.displayLineNumber-f.displayLineNumber;return 0==T?C.displayColumnNumber-f.displayColumnNumber:T}_updatePauseReason(){return this._pauseReasonTreeOutline=null,this._updatePauseReasonGotoArrow(),this._updatePauseReasonSection()}_updatePauseReasonSection(){let _=WebInspector.debuggerManager.activeCallFrame.target,S=WebInspector.debuggerManager.dataForTarget(_),{pauseReason:C,pauseData:f}=S;switch(C){case WebInspector.DebuggerManager.PauseReason.Assertion:return f&&f.message?(this._pauseReasonTextRow.text=WebInspector.UIString("Assertion with message: %s").format(f.message),!0):(this._pauseReasonTextRow.text=WebInspector.UIString("Assertion Failed"),this._pauseReasonGroup.rows=[this._pauseReasonTextRow],!0);case WebInspector.DebuggerManager.PauseReason.Breakpoint:if(f&&f.breakpointId){this._pauseReasonTreeOutline=this.createContentTreeOutline(!0),this._pauseReasonTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange,this._treeSelectionDidChange,this);let I=WebInspector.debuggerManager.breakpointForIdentifier(f.breakpointId),R=new WebInspector.BreakpointTreeElement(I,WebInspector.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName,WebInspector.UIString("Triggered Breakpoint")),N=new WebInspector.DetailsSectionRow;return this._pauseReasonTreeOutline.appendChild(R),N.element.appendChild(this._pauseReasonTreeOutline.element),this._pauseReasonGroup.rows=[N],!0}break;case WebInspector.DebuggerManager.PauseReason.CSPViolation:if(f)return this._pauseReasonTextRow.text=WebInspector.UIString("Content Security Policy violation of directive: %s").format(f.directive||f.directiveText),this._pauseReasonGroup.rows=[this._pauseReasonTextRow],!0;break;case WebInspector.DebuggerManager.PauseReason.DebuggerStatement:return this._pauseReasonTextRow.text=WebInspector.UIString("Debugger Statement"),this._pauseReasonGroup.rows=[this._pauseReasonTextRow],!0;case WebInspector.DebuggerManager.PauseReason.DOM:if(f&&f.nodeId){let E=WebInspector.domTreeManager.nodeForId(f.nodeId),I=WebInspector.domDebuggerManager.domBreakpointsForNode(E),R;for(let F of I)if(F.type===f.type){R=F;break}if(!R)return;this._pauseReasonTreeOutline=this.createContentTreeOutline(!0);let L=WebInspector.DOMBreakpointTreeElement.displayNameForType(R.type),D=new WebInspector.DOMBreakpointTreeElement(R,WebInspector.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName,L),M=new WebInspector.DetailsSectionRow;this._pauseReasonTreeOutline.appendChild(D),M.element.appendChild(this._pauseReasonTreeOutline.element);let P=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Element"),WebInspector.linkifyNodeReference(E));if(this._pauseReasonGroup.rows=[M,P],R.type!==WebInspector.DOMBreakpoint.Type.SubtreeModified)return!0;let O=WebInspector.RemoteObject.fromPayload(f.targetNode,_);return O.pushNodeToFrontend(F=>{if(F){let V=WebInspector.domTreeManager.nodeForId(F);if(V){let U=document.createDocumentFragment(),G=f.insertion?WebInspector.UIString("Child added to "):WebInspector.UIString("Removed descendant ");U.append(G,WebInspector.linkifyNodeReference(V));let H=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Details"),U);H.element.classList.add("target-description"),this._pauseReasonGroup.rows=this._pauseReasonGroup.rows.concat(H)}}}),!0}break;case WebInspector.DebuggerManager.PauseReason.Exception:if(f){var T=WebInspector.RemoteObject.fromPayload(f,_);return this._pauseReasonTextRow.text=WebInspector.UIString("Exception with thrown value: %s").format(T.description),this._pauseReasonGroup.rows=[this._pauseReasonTextRow],!0}break;case WebInspector.DebuggerManager.PauseReason.PauseOnNextStatement:return this._pauseReasonTextRow.text=WebInspector.UIString("Immediate Pause Requested"),this._pauseReasonGroup.rows=[this._pauseReasonTextRow],!0;case WebInspector.DebuggerManager.PauseReason.XHR:if(f){if(f.breakpointURL){let E=WebInspector.domDebuggerManager.xhrBreakpointForURL(f.breakpointURL);this._pauseReasonTreeOutline=this.createContentTreeOutline(!0);let I=new WebInspector.XHRBreakpointTreeElement(E,WebInspector.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName,WebInspector.UIString("Triggered XHR Breakpoint")),R=new WebInspector.DetailsSectionRow;this._pauseReasonTreeOutline.appendChild(I),R.element.appendChild(this._pauseReasonTreeOutline.element),this._pauseReasonTextRow.text=f.url,this._pauseReasonGroup.rows=[R,this._pauseReasonTextRow]}else this._pauseReasonTextRow.text=WebInspector.UIString("Requesting: %s").format(f.url),this._pauseReasonGroup.rows=[this._pauseReasonTextRow];return this._pauseReasonTextRow.element.title=f.url,!0}break;case WebInspector.DebuggerManager.PauseReason.Other:console.error("Paused for unknown reason. We should always have a reason.");}return!1}_updatePauseReasonGotoArrow(){this._pauseReasonLinkContainerElement.removeChildren();var _=WebInspector.debuggerManager.activeCallFrame;if(_){var S=_.sourceCodeLocation;if(S){let f=WebInspector.createSourceCodeLocationLink(S,{useGoToArrowButton:!0,ignoreNetworkTab:!0,ignoreSearchTab:!0});this._pauseReasonLinkContainerElement.appendChild(f)}}}_addDebuggerObject(_){return _ instanceof WebInspector.Breakpoint?this._addBreakpoint(_):_ instanceof WebInspector.IssueMessage?this._addIssue(_):null}_addIssue(_){let S=this._scriptsContentTreeOutline.findTreeElement(_);if(S)return S;let C=this._addTreeElementForSourceCodeToTreeOutline(_.sourceCodeLocation.sourceCode,this._scriptsContentTreeOutline);return C?(S=new WebInspector.IssueTreeElement(_),C.insertChild(S,insertionIndexForObjectInListSortedByFunction(S,C.children,this._compareTreeElements)),1===C.children.length&&C.expand(),S):null}_handleIssueAdded(_){var S=_.data.issue;S.sourceCodeLocation&&S.sourceCodeLocation.sourceCode&&("javascript"===S.source||"console-api"===S.source)&&this._addIssue(S)}_handleIssuesCleared(){let S=this._scriptsContentTreeOutline.children[0],C=[];for(;S&&!S.root;)S instanceof WebInspector.IssueTreeElement&&C.push(S),S=S.traverseNextTreeElement(!1,null,!0);C.forEach(f=>f.parent.removeChild(f))}_domBreakpointAddedOrRemoved(){return this._domBreakpointsContentTreeOutline.children.length?void(this._domBreakpointsContentTreeOutline.element.parent||(this._domBreakpointsRow.hideEmptyMessage(),this._domBreakpointsRow.element.append(this._domBreakpointsContentTreeOutline.element),this._domBreakpointsSection.collapsed=!1)):void this._domBreakpointsRow.showEmptyMessage()}_addXHRBreakpointButtonClicked(_){let S=new WebInspector.XHRBreakpointPopover(this);S.show(_.target.element,[WebInspector.RectEdge.MAX_Y,WebInspector.RectEdge.MIN_Y,WebInspector.RectEdge.MAX_X])}willDismissPopover(_){if(_.result===WebInspector.InputPopover.Result.Committed){let S=_.value;S&&WebInspector.domDebuggerManager.addXHRBreakpoint(new WebInspector.XHRBreakpoint(_.type,S))}}},WebInspector.DebuggerSidebarPanel.DebuggerPausedStyleClassName="paused",WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName="breakpoint-exception-icon",WebInspector.DebuggerSidebarPanel.AssertionIconStyleClassName="breakpoint-assertion-icon",WebInspector.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName="breakpoint-paused-icon",WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey="debugger-sidebar-panel-all-exceptions-breakpoint",WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey="debugger-sidebar-panel-all-uncaught-exceptions-breakpoint",WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey="debugger-sidebar-panel-assertions-breakpoint",WebInspector.DebuggerSidebarPanel.SelectedAllRequestsCookieKey="debugger-sidebar-panel-all-requests-breakpoint",WebInspector.DefaultDashboardView=class extends WebInspector.DashboardView{constructor(_){for(var S in super(_,"default"),_.addEventListener(WebInspector.DefaultDashboard.Event.DataDidChange,()=>{this._updateDisplaySoon()}),this._scheduledUpdateIdentifier=void 0,this._items={resourcesCount:{tooltip:WebInspector.UIString("Show page resources"),handler:this._resourcesItemWasClicked},resourcesSize:{tooltip:WebInspector.UIString("Show network information"),handler:this._networkItemWasClicked},time:{tooltip:WebInspector.UIString("Show page load timing"),handler:this._timelineItemWasClicked},logs:{tooltip:WebInspector.UIString("Show messages logged to the Console"),handler:this._consoleItemWasClicked.bind(this,WebInspector.LogContentView.Scopes.Logs)},errors:{tooltip:WebInspector.UIString("Show errors logged to the Console"),handler:this._consoleItemWasClicked.bind(this,WebInspector.LogContentView.Scopes.Errors)},issues:{tooltip:WebInspector.UIString("Show warnings logged to the Console"),handler:this._consoleItemWasClicked.bind(this,WebInspector.LogContentView.Scopes.Warnings)}},this._items)this._appendElementForNamedItem(S)}_updateDisplaySoon(){this._scheduledUpdateIdentifier||(this._scheduledUpdateIdentifier=requestAnimationFrame(this._updateDisplay.bind(this)))}_updateDisplay(){this._scheduledUpdateIdentifier=void 0;var _=this.representedObject;for(var S of["logs","issues","errors"])this._setConsoleItemValue(S,_[S]);var C=this._items.time;C.text=_.time?Number.secondsToString(_.time):emDash,this._setItemEnabled(C,0<_.time);var f=this._items.resourcesCount;f.text=Number.abbreviate(_.resourcesCount),this._setItemEnabled(f,0<_.resourcesCount);var T=this._items.resourcesSize;T.text=_.resourcesSize?Number.bytesToString(_.resourcesSize,!1):emDash,this._setItemEnabled(T,0<_.resourcesSize)}_appendElementForNamedItem(_){var S=this._items[_];S.container=this._element.appendChild(document.createElement("div")),S.container.className="item "+_,S.container.appendChild(document.createElement("img")),S.outlet=S.container.appendChild(document.createElement("div")),Object.defineProperty(S,"text",{set:function(C){C=C.toString();C===S.outlet.textContent||(S.outlet.textContent=C)}}),S.container.addEventListener("click",()=>{this._itemWasClicked(_)})}_itemWasClicked(_){var S=this._items[_];!S.container.classList.contains(WebInspector.DefaultDashboardView.EnabledItemStyleClassName)||S.handler&&S.handler.call(this)}_resourcesItemWasClicked(){WebInspector.showResourcesTab()}_networkItemWasClicked(){WebInspector.showNetworkTab()}_timelineItemWasClicked(){WebInspector.showTimelineTab()}_consoleItemWasClicked(_){WebInspector.showConsoleTab(_)}_setConsoleItemValue(_,S){function C(R){R.target===I&&(I.classList.remove("pulsing"),I.removeEventListener("animationend",C))}var f="_"+_,T=this[f];this[f]=S;var E=this._items[_];if(E.text=Number.abbreviate(S),this._setItemEnabled(E,0Y.startOffset+$.index&&ieu.tabIndex&&(u.tabIndex=0),u.addEventListener("blur",S,!1),u.addEventListener("keydown",L,!0),P&&u.addEventListener("paste",N,!0),u.focus(),{cancel:T.bind(u),commit:E.bind(u)}},WebInspector.EditingSupport={StyleValueDelimiters:" \xA0\t\n\"':;,/()",CSSNumberRegex:/(.*?)(-?(?:\d+(?:\.\d+)?|\.\d+))(.*)/,NumberRegex:/^(-?(?:\d+(?:\.\d+)?|\.\d+))$/},WebInspector.ErrorObjectView=class extends WebInspector.Object{constructor(_){super(),this._object=_,this._expanded=!1,this._hasStackTrace=!1,this._element=document.createElement("div"),this._element.classList.add("error-object");var S=WebInspector.FormattedValue.createElementForError(this._object);this._element.append(S),S.addEventListener("click",this._handlePreviewOrTitleElementClick.bind(this)),this._outlineElement=this._element.appendChild(document.createElement("div")),this._outline=new WebInspector.TreeOutline(this._outlineElement)}static makeSourceLinkWithPrefix(_,S,C){if(!_)return null;var f=document.createElement("span");f.classList.add("error-object-link-container"),f.textContent=" \u2014 ";let E=WebInspector.linkifyLocation(_,new WebInspector.SourceCodePosition(parseInt(S)-1,parseInt(C)),{ignoreNetworkTab:!0,ignoreSearchTab:!0});return E.classList.add("error-object-link"),f.appendChild(E),f}get object(){return this._object}get element(){return this._element}get treeOutline(){return this._outline}get expanded(){return this._expanded}update(){this._object.getOwnPropertyDescriptorsAsObject(_=>{this._hasStackTrace||this._buildStackTrace(_.stack.value.value),this._hasStackTrace=!0})}expand(){this._expanded||(this._expanded=!0,this._element.classList.add("expanded"),this.update())}collapse(){this._expanded&&(this._expanded=!1,this._element.classList.remove("expanded"))}appendTitleSuffix(_){this._element.insertBefore(_,this._outlineElement)}_handlePreviewOrTitleElementClick(_){this._expanded?this.collapse():this.expand(),_.stopPropagation()}_buildStackTrace(_){let S=WebInspector.StackTrace.fromString(this._object.target,_),C=new WebInspector.StackTraceView(S).element;this._outlineElement.appendChild(C)}},WebInspector.EventListenerSectionGroup=class extends WebInspector.DetailsSectionGroup{constructor(_,S={}){super(),this._eventListener=_;var C=[];S.hideType||C.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Event"),this._eventListener.type)),S.hideNode||C.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Node"),this._nodeTextOrLink())),C.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Function"),this._functionTextOrLink())),this._eventListener.useCapture?C.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Capturing"),WebInspector.UIString("Yes"))):C.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Bubbling"),WebInspector.UIString("Yes"))),this._eventListener.isAttribute&&C.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Attribute"),WebInspector.UIString("Yes"))),this._eventListener.passive&&C.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Passive"),WebInspector.UIString("Yes"))),this._eventListener.once&&C.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Once"),WebInspector.UIString("Yes"))),this.rows=C}_nodeTextOrLink(){var _=this._eventListener.node;return _?_.nodeType()===Node.DOCUMENT_NODE?"document":WebInspector.linkifyNodeReference(_):""}_functionTextOrLink(){var _=this._eventListener.handlerBody.match(/function ([^\(]+?)\(/);if(_)var S=!1,C=_[1];else var S=!0,C=WebInspector.UIString("(anonymous function)");if(!this._eventListener.location)return C;var f=WebInspector.debuggerManager.scriptForIdentifier(this._eventListener.location.scriptId,WebInspector.mainTarget);if(!f)return C;var T=f.createSourceCodeLocation(this._eventListener.location.lineNumber,this._eventListener.location.columnNumber||0);let I=WebInspector.createSourceCodeLocationLink(T,{dontFloat:S,ignoreNetworkTab:!0,ignoreSearchTab:!0});if(S)return I;var R=document.createDocumentFragment();return R.append(I,C),R}},WebInspector.FilterBar=class extends WebInspector.Object{constructor(_){super(),this._element=_||document.createElement("div"),this._element.classList.add("filter-bar"),this._filtersNavigationBar=new WebInspector.NavigationBar,this._element.appendChild(this._filtersNavigationBar.element),this._filterFunctionsMap=new Map,this._inputField=document.createElement("input"),this._inputField.type="search",this._inputField.spellcheck=!1,this._inputField.incremental=!0,this._inputField.addEventListener("search",this._handleFilterChanged.bind(this),!1),this._element.appendChild(this._inputField),this._lastFilterValue=this.filters}get element(){return this._element}get placeholder(){return this._inputField.getAttribute("placeholder")}set placeholder(_){this._inputField.setAttribute("placeholder",_)}get inputField(){return this._inputField}get filters(){return{text:this._inputField.value,functions:[...this._filterFunctionsMap.values()]}}set filters(_){_=_||{};var S=this._inputField.value;this._inputField.value=_.text||"",S!==this._inputField.value&&this._handleFilterChanged()}addFilterBarButton(_,S,C,f,T,E,I,R){var N=new WebInspector.FilterBarButton(_,S,C,f,T,E,I,R);N.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._handleFilterBarButtonClicked,this),N.addEventListener(WebInspector.FilterBarButton.Event.ActivatedStateToggled,this._handleFilterButtonToggled,this),this._filtersNavigationBar.addNavigationItem(N),N.activated&&(this._filterFunctionsMap.set(N.identifier,N.filterFunction),this._handleFilterChanged())}hasActiveFilters(){return!!this._inputField.value||!!this._filterFunctionsMap.size}hasFilterChanged(){var _=this.filters.functions;if(this._lastFilterValue.text!==this._inputField.value||this._lastFilterValue.functions.length!==_.length)return!0;for(var S=0;S<_.length;++S)if(this._lastFilterValue.functions[S]!==_[S])return!0;return!1}_handleFilterBarButtonClicked(_){var S=_.target;S.toggle()}_handleFilterButtonToggled(_){var S=_.target;S.activated?this._filterFunctionsMap.set(S.identifier,S.filterFunction):this._filterFunctionsMap.delete(S.identifier),this._handleFilterChanged()}_handleFilterChanged(){this.hasFilterChanged()&&(this._lastFilterValue=this.filters,this.dispatchEventToListeners(WebInspector.FilterBar.Event.FilterDidChange))}},WebInspector.FilterBar.Event={FilterDidChange:"filter-bar-text-filter-did-change"},WebInspector.FilterBarButton=class extends WebInspector.ActivateButtonNavigationItem{constructor(_,S,C,f,T,E,I,R,N){super(_,f,T,E,I,R,N),this._filterFunction=S,this._activatedSetting=new WebInspector.Setting(_,C),this.activated=!!this._activatedSetting.value}get filterFunction(){return this._filterFunction}toggle(){this.activated=!this.activated,this._activatedSetting.value=this.activated,this.dispatchEventToListeners(WebInspector.FilterBarButton.Event.ActivatedStateToggled)}},WebInspector.FilterBarButton.Event={ActivatedStateToggled:"filter-bar-activated-state-toggled"},WebInspector.FilterBarNavigationItem=class extends WebInspector.NavigationItem{constructor(){super(),this._filterBar=new WebInspector.FilterBar(this.element)}get filterBar(){return this._filterBar}},WebInspector.FindBanner=class extends WebInspector.NavigationItem{constructor(_,S,C=!1){super(),this._delegate=_||null,this.element.classList.add("find-banner"),S&&this.element.classList.add(S),this._resultCountLabel=document.createElement("label"),this.element.appendChild(this._resultCountLabel),this._inputField=document.createElement("input"),this._inputField.type="search",this._inputField.spellcheck=!1,this._inputField.incremental=!0,this._inputField.setAttribute("results",5),this._inputField.setAttribute("autosave","inspector-search"),this._inputField.addEventListener("keydown",this._inputFieldKeyDown.bind(this),!1),this._inputField.addEventListener("keyup",this._inputFieldKeyUp.bind(this),!1),this._inputField.addEventListener("search",this._inputFieldSearch.bind(this),!1),this.element.appendChild(this._inputField),this._previousResultButton=document.createElement("button"),this._previousResultButton.classList.add("segmented","previous-result"),this._previousResultButton.disabled=!0,this._previousResultButton.addEventListener("click",this._previousResultButtonClicked.bind(this)),this.element.appendChild(this._previousResultButton);let f=document.createElement("div");f.classList.add(WebInspector.FindBanner.SegmentGlyphStyleClassName),this._previousResultButton.appendChild(f),this._nextResultButton=document.createElement("button"),this._nextResultButton.classList.add("segmented","next-result"),this._nextResultButton.disabled=!0,this._nextResultButton.addEventListener("click",this._nextResultButtonClicked.bind(this)),this.element.appendChild(this._nextResultButton);let T=document.createElement("div");if(T.classList.add(WebInspector.FindBanner.SegmentGlyphStyleClassName),this._nextResultButton.appendChild(T),C)this._clearAndBlurKeyboardShortcut=new WebInspector.KeyboardShortcut(null,WebInspector.KeyboardShortcut.Key.Escape,this._clearAndBlur.bind(this),this.element);else{let E=document.createElement("button");E.textContent=WebInspector.UIString("Done"),E.addEventListener("click",this._doneButtonClicked.bind(this)),this.element.appendChild(E),this._hideKeyboardShortcut=new WebInspector.KeyboardShortcut(null,WebInspector.KeyboardShortcut.Key.Escape,this.hide.bind(this),this.element)}this._numberOfResults=null,this._searchBackwards=!1,this._searchKeyPressed=!1,this._previousSearchValue="",this._populateFindKeyboardShortcut=new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl,"E",this._populateSearchQueryFromSelection.bind(this)),this._populateFindKeyboardShortcut.implicitlyPreventsDefault=!1,this._findNextKeyboardShortcut=new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl,"G",this._nextResultButtonClicked.bind(this)),this._findPreviousKeyboardShortcut=new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Shift|WebInspector.KeyboardShortcut.Modifier.CommandOrControl,"G",this._previousResultButtonClicked.bind(this)),this.disableKeyboardShortcuts()}get delegate(){return this._delegate}set delegate(_){this._delegate=_||null}get inputField(){return this._inputField}get searchQuery(){return this._inputField.value||""}set searchQuery(_){this._inputField.value=_||""}get numberOfResults(){return this._numberOfResults}set numberOfResults(_){(_===void 0||isNaN(_))&&(_=null),this._numberOfResults=_,this._previousResultButton.disabled=this._nextResultButton.disabled=0>=_,null===_?this._resultCountLabel.textContent="":0>=_?this._resultCountLabel.textContent=WebInspector.UIString("Not found"):1===_?this._resultCountLabel.textContent=WebInspector.UIString("1 match"):1<_&&(this._resultCountLabel.textContent=WebInspector.UIString("%d matches").format(_))}get targetElement(){return this._targetElement}set targetElement(_){function S(){C.classList.remove(WebInspector.FindBanner.NoTransitionStyleClassName),this.element.classList.remove(WebInspector.FindBanner.NoTransitionStyleClassName)}if(this._targetElement){var C=this._targetElement;this._targetElement.classList.add(WebInspector.FindBanner.NoTransitionStyleClassName),this._targetElement.classList.remove(WebInspector.FindBanner.SupportsFindBannerStyleClassName),this._targetElement.classList.remove(WebInspector.FindBanner.ShowingFindBannerStyleClassName),this.element.classList.add(WebInspector.FindBanner.NoTransitionStyleClassName),this.element.classList.remove(WebInspector.FindBanner.ShowingStyleClassName),setTimeout(S.bind(this),0)}this._targetElement=_||null,this._targetElement&&this._targetElement.classList.add(WebInspector.FindBanner.SupportsFindBannerStyleClassName)}get showing(){return this.element.classList.contains(WebInspector.FindBanner.ShowingStyleClassName)}focus(){this._inputField.value.length?this._inputField.select():this._inputField.focus()}_clearAndBlur(){this.numberOfResults=null,this._inputField.value="",this._previousSearchValue="",this._delegate.findBannerSearchCleared&&this._delegate.findBannerSearchCleared(),this._delegate.findBannerWantsToClearAndBlur&&this._delegate.findBannerWantsToClearAndBlur()}show(){this._targetElement&&this._targetElement.parentNode&&(this.element.parentNode!==this._targetElement.parentNode&&this._targetElement.parentNode.insertBefore(this.element,this._targetElement),setTimeout(function(){this._targetElement.classList.add(WebInspector.FindBanner.ShowingFindBannerStyleClassName),this.element.classList.add(WebInspector.FindBanner.ShowingStyleClassName),this._inputField.select()}.bind(this),0),this.dispatchEventToListeners(WebInspector.FindBanner.Event.DidShow))}hide(){this._targetElement&&(this._inputField.blur(),this._targetElement.classList.remove(WebInspector.FindBanner.ShowingFindBannerStyleClassName),this.element.classList.remove(WebInspector.FindBanner.ShowingStyleClassName),this.dispatchEventToListeners(WebInspector.FindBanner.Event.DidHide))}enableKeyboardShortcuts(){this._populateFindKeyboardShortcut.disabled=!1,this._findNextKeyboardShortcut.disabled=!1,this._findPreviousKeyboardShortcut.disabled=!1}disableKeyboardShortcuts(){this._populateFindKeyboardShortcut.disabled=!0,this._findNextKeyboardShortcut.disabled=!0,this._findPreviousKeyboardShortcut.disabled=!0}_inputFieldKeyDown(_){"Shift"===_.keyIdentifier?this._searchBackwards=!0:"Enter"===_.keyIdentifier&&(this._searchKeyPressed=!0)}_inputFieldKeyUp(_){"Shift"===_.keyIdentifier?this._searchBackwards=!1:"Enter"===_.keyIdentifier&&(this._searchKeyPressed=!1)}_inputFieldSearch(){this._inputField.value?this._previousSearchValue===this.searchQuery?this._searchKeyPressed&&0=WebInspector.FontResourceContentView.MinimumFontSize&&(this._previewElement.style.fontSize=_+"px",!(this._previewElement.offsetWidth<=this.element.offsetWidth));_-=5);}contentAvailable(){function C(L){var D=document.createElement("div");return D.className="metric "+L,D}if(this._fontObjectURL=this.resource.createObjectURL(),!this._fontObjectURL)return void this.showGenericErrorMessage();const f="WebInspectorFontPreview"+ ++WebInspector.FontResourceContentView._uniqueFontIdentifier;var T="";"image/svg+xml"===this.resource.mimeTypeComponents.type&&(T=" format(\"svg\")"),this._styleElement&&this._styleElement.parentNode&&this._styleElement.parentNode.removeChild(this._styleElement),this.removeLoadingIndicator(),this._styleElement=document.createElement("style"),this._styleElement.textContent="@font-face { font-family: \""+f+"\"; src: url("+this._fontObjectURL+")"+T+"; }",this.visible&&document.head.appendChild(this._styleElement),this._previewElement=document.createElement("div"),this._previewElement.className="preview",this._previewElement.style.fontFamily=f;for(var E=WebInspector.FontResourceContentView.PreviewLines,I=0,R;I$/);if(!T)return S.textContent=_,S;var E=document.createElement("span");E.className="html-tag",E.append("<");var I=E.appendChild(document.createElement("span"));if(I.className="html-tag-name",I.textContent=T[1],T[2]){E.append(" ");var R=E.appendChild(document.createElement("span"));R.className="html-attribute";var N=R.appendChild(document.createElement("span"));N.className="html-attribute-name",N.textContent=T[2],R.append("=\"");var L=R.appendChild(document.createElement("span"));L.className="html-attribute-value",L.textContent=T[3],R.append("\"")}return E.append(">"),S.appendChild(E),S},WebInspector.FormattedValue.createElementForFunctionWithName=function(u){var _=document.createElement("span");return _.classList.add("formatted-function"),_.textContent=u.substring(0,u.indexOf("(")),_},WebInspector.FormattedValue.createElementForTypesAndValue=function(u,_,S,C,f,T){var E=document.createElement("span");if(E.classList.add(WebInspector.FormattedValue.classNameForTypes(u,_)),T)return E.textContent="[Exception: "+S+"]",E;if("string"===u)return S=S.truncate(WebInspector.FormattedValue.MAX_PREVIEW_STRING_LENGTH),E.textContent=doubleQuotedString(S.replace(/\n/g,"\u21B5")),E;if("function"===u)return E.textContent="class"===_?S:f?"function":S,E;if(E.textContent=S,void 0!==C&&("array"===_||"set"===_||"map"===_||"weakmap"===_||"weakset"===_)){var I=E.appendChild(document.createElement("span"));I.className="size",I.textContent=" ("+C+")"}return E},WebInspector.FormattedValue.createElementForRemoteObject=function(u,_){return WebInspector.FormattedValue.createElementForTypesAndValue(u.type,u.subtype,u.description,u.size,!1,_)},WebInspector.FormattedValue.createElementForObjectPreview=function(u){return WebInspector.FormattedValue.createElementForTypesAndValue(u.type,u.subtype,u.description,u.size,!0,!1)},WebInspector.FormattedValue.createElementForPropertyPreview=function(u){return WebInspector.FormattedValue.createElementForTypesAndValue(u.type,u.subtype,u.value,void 0,!0,!1)},WebInspector.FormattedValue.createObjectPreviewOrFormattedValueForObjectPreview=function(u,_){return"node"===u.subtype?WebInspector.FormattedValue.createElementForNodePreview(u):"function"===u.type?WebInspector.FormattedValue.createElementForFunctionWithName(u.description):new WebInspector.ObjectPreviewView(u,_).element},WebInspector.FormattedValue.createObjectPreviewOrFormattedValueForRemoteObject=function(u,_){return"node"===u.subtype?WebInspector.FormattedValue.createElementForNode(u):"error"===u.subtype?WebInspector.FormattedValue.createElementForError(u):u.preview?new WebInspector.ObjectPreviewView(u.preview,_):WebInspector.FormattedValue.createElementForRemoteObject(u)},WebInspector.FormattedValue.createObjectTreeOrFormattedValueForRemoteObject=function(u,_,S){if("node"===u.subtype)return WebInspector.FormattedValue.createElementForNode(u);if("null"===u.subtype)return WebInspector.FormattedValue.createElementForRemoteObject(u);if("object"===u.type||"class"===u.subtype){var C=new WebInspector.ObjectTreeView(u,null,_,S);return C.element}return WebInspector.FormattedValue.createElementForRemoteObject(u)},WebInspector.FormattedValue.MAX_PREVIEW_STRING_LENGTH=140,WebInspector.FrameDOMTreeContentView=class extends WebInspector.DOMTreeContentView{constructor(_){super(_),this._domTree=_,this._domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated,this._rootDOMNodeInvalidated,this),this._requestRootDOMNode()}get domTree(){return this._domTree}closed(){this._domTree.removeEventListener(null,null,this),super.closed()}getSearchContextNodes(_){this._domTree.requestRootDOMNode(function(S){_([S.id])})}_rootDOMNodeAvailable(_){return this.domTreeOutline.rootDOMNode=_,_?void(this._restoreBreakpointsAfterUpdate(),this._restoreSelectedNodeAfterUpdate(this._domTree.frame.url,_.body||_.documentElement||_.firstChild)):void this.domTreeOutline.selectDOMNode(null,!1)}_rootDOMNodeInvalidated(){this._requestRootDOMNode()}_requestRootDOMNode(){this._domTree.requestRootDOMNode(this._rootDOMNodeAvailable.bind(this))}},WebInspector.FrameTreeElement=class extends WebInspector.ResourceTreeElement{constructor(_,S){function C(f,...T){return f instanceof WebInspector.CSSStyleSheet?new WebInspector.CSSStyleSheetTreeElement(f,...T):new WebInspector.ResourceTreeElement(f,...T)}super(_.mainResource,S||_),this._frame=_,this._updateExpandedSetting(),_.addEventListener(WebInspector.Frame.Event.MainResourceDidChange,this._mainResourceDidChange,this),_.addEventListener(WebInspector.Frame.Event.ResourceWasAdded,this._resourceWasAdded,this),_.addEventListener(WebInspector.Frame.Event.ResourceWasRemoved,this._resourceWasRemoved,this),_.addEventListener(WebInspector.Frame.Event.ExtraScriptAdded,this._extraScriptAdded,this),_.addEventListener(WebInspector.Frame.Event.ChildFrameWasAdded,this._childFrameWasAdded,this),_.addEventListener(WebInspector.Frame.Event.ChildFrameWasRemoved,this._childFrameWasRemoved,this),_.domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasAdded,this._childContentFlowWasAdded,this),_.domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasRemoved,this._childContentFlowWasRemoved,this),_.domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated,this._rootDOMNodeInvalidated,this),this.shouldRefreshChildren=!0,this.folderSettingsKey=this._frame.url.hash,this.registerFolderizeSettings("frames",WebInspector.UIString("Frames"),this._frame.childFrameCollection,WebInspector.FrameTreeElement),this.registerFolderizeSettings("flows",WebInspector.UIString("Flows"),this._frame.domTree.contentFlowCollection,WebInspector.ContentFlowTreeElement),this.registerFolderizeSettings("extra-scripts",WebInspector.UIString("Extra Scripts"),this._frame.extraScriptCollection,WebInspector.ScriptTreeElement),window.CanvasAgent&&WebInspector.settings.experimentalShowCanvasContextsInResources.value&&this.registerFolderizeSettings("canvases",WebInspector.UIString("Canvases"),this._frame.canvasCollection,WebInspector.CanvasTreeElement);for(let[f,T]of Object.entries(WebInspector.Resource.Type)){let E=WebInspector.Resource.displayNameForType(T,!0),I=C;T===WebInspector.Resource.Type.WebSocket&&(I=WebInspector.WebSocketResourceTreeElement),this.registerFolderizeSettings(f,E,this._frame.resourceCollectionForType(T),I)}this.updateParentStatus()}get frame(){return this._frame}descendantResourceTreeElementTypeDidChange(_){this._addTreeElement(_)}descendantResourceTreeElementMainTitleDidChange(_){this._addTreeElement(_)}updateSourceMapResources(){this.treeOutline&&this.treeOutline.includeSourceMapResourceChildren&&this._frame&&(this.updateParentStatus(),this.resource&&this.resource.sourceMaps.length&&(this.shouldRefreshChildren=!0))}onattach(){WebInspector.GeneralTreeElement.prototype.onattach.call(this),WebInspector.cssStyleManager.addEventListener(WebInspector.CSSStyleManager.Event.StyleSheetAdded,this._styleSheetAdded,this),window.CanvasAgent&&WebInspector.settings.experimentalShowCanvasContextsInResources.value&&(this._frame.canvasCollection.addEventListener(WebInspector.Collection.Event.ItemAdded,this._canvasWasAdded,this),this._frame.canvasCollection.addEventListener(WebInspector.Collection.Event.ItemRemoved,this._canvasWasRemoved,this))}ondetach(){WebInspector.cssStyleManager.removeEventListener(WebInspector.CSSStyleManager.Event.StyleSheetAdded,this._styleSheetAdded,this),window.CanvasAgent&&WebInspector.settings.experimentalShowCanvasContextsInResources.value&&(this._frame.canvasCollection.removeEventListener(WebInspector.Collection.Event.ItemAdded,this._canvasWasAdded,this),this._frame.canvasCollection.removeEventListener(WebInspector.Collection.Event.ItemRemoved,this._canvasWasRemoved,this)),super.ondetach()}compareChildTreeElements(_,S){if(_===S)return 0;var C=_ instanceof WebInspector.ResourceTreeElement,f=S instanceof WebInspector.ResourceTreeElement;return C&&f?WebInspector.ResourceTreeElement.compareResourceTreeElements(_,S):C||f?C?1:-1:super.compareChildTreeElements(_,S)}onpopulate(){if(!this.children.length||this.shouldRefreshChildren){this.shouldRefreshChildren=!1,this.removeChildren(),this.updateParentStatus(),this.prepareToPopulate();for(let E of this._frame.childFrameCollection.items)this.addChildForRepresentedObject(E);for(let E of this._frame.resourceCollection.items)this.addChildForRepresentedObject(E);for(var _=this.resource&&this.resource.sourceMaps,S=0,C;S<_.length;++S){C=_[S];for(var f=0;f{let R=this._angleUnitsSelectElement.appendChild(document.createElement("option"));return R.value=R.textContent=f,[f,{element:R,min:T,max:E,step:I}]}))}get element(){return this._element}set gradient(_){if(_){const S=_ instanceof WebInspector.LinearGradient,C=_ instanceof WebInspector.RadialGradient;(S||C)&&(this._gradient=_,this._gradientSlider.stops=this._gradient.stops,S?(this._gradientTypePicker.value=this._gradient.repeats?"repeating-linear-gradient":"linear-gradient",this._angleUnitsChanged()):this._gradientTypePicker.value=this._gradient.repeats?"repeating-radial-gradient":"radial-gradient",this._updateCSSClassForGradientType())}}get gradient(){return this._gradient}gradientSliderStopsDidChange(_){this._gradient.stops=_.stops,this.dispatchEventToListeners(WebInspector.GradientEditor.Event.GradientChanged,{gradient:this._gradient})}gradientSliderStopWasSelected(_){const C=_.selectedStop;C&&!this._editingColor?(this._element.appendChild(this._colorPicker.element),this._element.classList.add("editing-color"),this._colorPicker.color=C.color,this._editingColor=!0):!C&&(this._colorPicker.element.remove(),this._element.classList.remove("editing-color"),this._editingColor=!1),this._angleInputElement.blur(),this.dispatchEventToListeners(WebInspector.GradientEditor.Event.ColorPickerToggled),this.dispatchEventToListeners(WebInspector.GradientEditor.Event.GradientChanged,{gradient:this._gradient})}_updateCSSClassForGradientType(){const _=this._gradient instanceof WebInspector.RadialGradient;this._element.classList.toggle("radial-gradient",_),this.dispatchEventToListeners(WebInspector.GradientEditor.Event.ColorPickerToggled)}_gradientTypeChanged(){const S=this._gradientTypes[this._gradientTypePicker.value];this._gradient instanceof S.type||(S.type===WebInspector.LinearGradient?(this._gradient=new WebInspector.LinearGradient({value:180,units:WebInspector.LinearGradient.AngleUnits.DEG},this._gradient.stops),this._angleUnitsChanged()):this._gradient=new WebInspector.RadialGradient("",this._gradient.stops),this._updateCSSClassForGradientType()),this._gradient.repeats=S.repeats,this.dispatchEventToListeners(WebInspector.GradientEditor.Event.GradientChanged,{gradient:this._gradient})}_colorPickerColorChanged(_){this._gradientSlider.selectedStop.color=_.target.color,this._gradientSlider.stops=this._gradient.stops,this.dispatchEventToListeners(WebInspector.GradientEditor.Event.GradientChanged,{gradient:this._gradient})}_angleValueChanged(_){switch(_.target){case this._angleInputElement:this._gradient.angleValue=this._angleSliderElement.value=parseFloat(this._angleInputElement.value)||0;break;case this._angleSliderElement:this._gradient.angleValue=this._angleInputElement.value=parseFloat(this._angleSliderElement.value)||0;break;default:return void WebInspector.reportInternalError("Input event fired for disabled color component input");}this.dispatchEventToListeners(WebInspector.GradientEditor.Event.GradientChanged,{gradient:this._gradient})}_angleUnitsChanged(){let S=this._angleUnitsSelectElement.value,C=this._angleUnitsConfiguration.get(S);return C?void(this._gradient.angleUnits=S,this._angleInputElement.min=this._angleSliderElement.min=C.min,this._angleInputElement.max=this._angleSliderElement.max=C.max,this._angleInputElement.step=this._angleSliderElement.step=C.step,this._angleInputElement.value=this._angleSliderElement.value=this._gradient.angleValue,this.dispatchEventToListeners(WebInspector.GradientEditor.Event.GradientChanged,{gradient:this._gradient})):void WebInspector.reportInternalError(`Missing configuration data for selected angle units "${S}"`)}},WebInspector.GradientEditor.Event={GradientChanged:"gradient-editor-gradient-changed",ColorPickerToggled:"gradient-editor-color-picker-toggled"},WebInspector.GradientSlider=class extends WebInspector.Object{constructor(_){super(),this.delegate=_,this._element=null,this._stops=[],this._knobs=[],this._selectedKnob=null,this._canvas=document.createElement("canvas"),this._keyboardShortcutEsc=new WebInspector.KeyboardShortcut(null,WebInspector.KeyboardShortcut.Key.Escape)}get element(){return this._element||(this._element=document.createElement("div"),this._element.className="gradient-slider",this._element.appendChild(this._canvas),this._addArea=this._element.appendChild(document.createElement("div")),this._addArea.addEventListener("mouseover",this),this._addArea.addEventListener("mousemove",this),this._addArea.addEventListener("mouseout",this),this._addArea.addEventListener("click",this),this._addArea.className=WebInspector.GradientSlider.AddAreaClassName),this._element}get stops(){return this._stops}set stops(_){this._stops=_,this._updateStops()}get selectedStop(){return this._selectedKnob?this._selectedKnob.stop:null}handleEvent(_){switch(_.type){case"mouseover":this._handleMouseover(_);break;case"mousemove":this._handleMousemove(_);break;case"mouseout":this._handleMouseout(_);break;case"click":this._handleClick(_);}}handleKeydownEvent(_){return this._keyboardShortcutEsc.matchesEvent(_)&&this._selectedKnob&&this._selectedKnob.selected&&(this._selectedKnob.selected=!1,!0)}knobXDidChange(_){_.stop.offset=_.x/WebInspector.GradientSlider.Width,this._sortStops(),this._updateCanvas()}knobCanDetach(){return 2this._stops.length;)this._knobs.pop().element.remove();for(;this._knobs.length{this._heapAllocationsView.showHeapSnapshotTimelineRecord(this._record)})}return C;case"timestamp":return isNaN(this._data.timestamp)?emDash:Number.secondsToString(this._data.timestamp,!0);case"size":return Number.bytesToString(this._data.size);case"liveSize":return Number.bytesToString(this._data.liveSize);}return super.createCellContent(_,S)}markAsBaseline(){this.element.classList.add("baseline")}clearBaseline(){this.element.classList.remove("baseline")}updateTimestamp(_){this._data.timestamp=this._record.timestamp-_,this.needsRefresh()}createCells(){super.createCells(),this._record.heapSnapshot.invalid&&this.element.classList.add("invalid")}_heapSnapshotCollectedNodes(){let _=this._data.liveSize,S=this._record.heapSnapshot.liveSize;_===S||(this._data.liveSize=S,this.needsRefresh())}_heapSnapshotInvalidated(){this._data.liveSize=0,this.needsRefresh()}},WebInspector.HeapAllocationsTimelineDataGridNodePathComponent=class extends WebInspector.TimelineDataGridNodePathComponent{get previousSibling(){let _=this.timelineDataGridNode.previousSibling;for(;_&&(_.hidden||_.record.heapSnapshot.invalid);)_=_.previousSibling;return _?new WebInspector.HeapAllocationsTimelineDataGridNodePathComponent(_):null}get nextSibling(){let _=this.timelineDataGridNode.nextSibling;for(;_&&(_.hidden||_.record.heapSnapshot.invalid);)_=_.nextSibling;return _?new WebInspector.HeapAllocationsTimelineDataGridNodePathComponent(_):null}},WebInspector.HeapAllocationsTimelineOverviewGraph=class extends WebInspector.TimelineOverviewGraph{constructor(_,S){super(S),this.element.classList.add("heap-allocations"),this._heapAllocationsTimeline=_,this._heapAllocationsTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded,this._heapAllocationTimelineRecordAdded,this),this._selectedImageElement=null,this.reset()}reset(){super.reset(),this.element.removeChildren()}layout(){function _(T){return(T-C)/f}if(this.visible){this.element.removeChildren(),this._selectedImageElement&&(this._selectedImageElement.classList.remove("selected"),this._selectedImageElement=null);let S=this._heapAllocationsTimeline.recordsInTimeRange(this.startTime,this.endTime);if(S.length){let C=this.startTime,f=this.timelineOverview.secondsPerPixel;for(let T of S){let I=_(T.timestamp)-8;1>=I&&(I=1);let R=T[WebInspector.HeapAllocationsTimelineOverviewGraph.RecordElementAssociationSymbol];R||(R=T[WebInspector.HeapAllocationsTimelineOverviewGraph.RecordElementAssociationSymbol]=document.createElement("img"),R.classList.add("snapshot"),R.addEventListener("click",()=>{T.heapSnapshot.invalid||(this.selectedRecord=T)})),R.style.setProperty(WebInspector.resolvedLayoutDirection()===WebInspector.LayoutDirection.RTL?"right":"left",`${I}px`),T.heapSnapshot.invalid&&R.classList.add("invalid"),this.element.appendChild(R)}this._updateSnapshotMarkers()}}}updateSelectedRecord(){this._updateSnapshotMarkers()}_updateSnapshotMarkers(){if(this._selectedImageElement&&this._selectedImageElement.classList.remove("selected"),!this.selectedRecord)return void(this._selectedImageElement=null);let _=this.selectedRecord[WebInspector.HeapAllocationsTimelineOverviewGraph.RecordElementAssociationSymbol];_&&(_.classList.add("selected"),this._selectedImageElement=_)}_heapAllocationTimelineRecordAdded(){this.needsLayout()}},WebInspector.HeapAllocationsTimelineOverviewGraph.RecordElementAssociationSymbol=Symbol("record-element-association"),WebInspector.HeapAllocationsTimelineView=class extends WebInspector.TimelineView{constructor(_,S){super(_,S),this.element.classList.add("heap-allocations");let C={name:{title:WebInspector.UIString("Name"),width:"150px",icon:!0},timestamp:{title:WebInspector.UIString("Time"),width:"80px",sortable:!0,aligned:"right"},size:{title:WebInspector.UIString("Size"),width:"80px",sortable:!0,aligned:"right"},liveSize:{title:WebInspector.UIString("Live Size"),width:"80px",sortable:!0,aligned:"right"}},f=WebInspector.UIString("Take snapshot");this._takeHeapSnapshotButtonItem=new WebInspector.ButtonNavigationItem("take-snapshot",f,"Images/Camera.svg",16,16),this._takeHeapSnapshotButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._takeHeapSnapshotClicked,this);let T=WebInspector.UIString("Compare snapshots"),E=WebInspector.UIString("Cancel comparison");this._compareHeapSnapshotsButtonItem=new WebInspector.ActivateButtonNavigationItem("compare-heap-snapshots",T,E,"Images/Compare.svg",16,16),this._compareHeapSnapshotsButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._compareHeapSnapshotsClicked,this),this._compareHeapSnapshotsButtonItem.enabled=!1,this._compareHeapSnapshotsButtonItem.activated=!1,this._compareHeapSnapshotHelpTextItem=new WebInspector.TextNavigationItem("compare-heap-snapshot-help-text",""),this._selectingComparisonHeapSnapshots=!1,this._baselineDataGridNode=null,this._baselineHeapSnapshotTimelineRecord=null,this._heapSnapshotDiff=null,this._snapshotListScrollTop=0,this._showingSnapshotList=!0,this._snapshotListPathComponent=new WebInspector.HierarchicalPathComponent(WebInspector.UIString("Snapshot List"),"snapshot-list-icon","snapshot-list",!1,!1),this._snapshotListPathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.Clicked,this._snapshotListPathComponentClicked,this),this._dataGrid=new WebInspector.TimelineDataGrid(C),this._dataGrid.sortColumnIdentifier="timestamp",this._dataGrid.sortOrder=WebInspector.DataGrid.SortOrder.Ascending,this._dataGrid.createSettings("heap-allocations-timeline-view"),this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged,this._dataGridNodeSelected,this),this.addSubview(this._dataGrid),this._contentViewContainer=new WebInspector.ContentViewContainer,this._contentViewContainer.addEventListener(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange,this._currentContentViewDidChange,this),WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SelectionPathComponentsDidChange,this._contentViewSelectionPathComponentDidChange,this),this._pendingRecords=[],this._pendingZeroTimeDataGridNodes=[],_.addEventListener(WebInspector.Timeline.Event.RecordAdded,this._heapAllocationsTimelineRecordAdded,this),WebInspector.HeapSnapshotProxy.addEventListener(WebInspector.HeapSnapshotProxy.Event.Invalidated,this._heapSnapshotInvalidated,this),WebInspector.HeapSnapshotWorkerProxy.singleton().addEventListener("HeapSnapshot.CollectionEvent",this._heapSnapshotCollectionEvent,this)}get scrollableElements(){return this._showingSnapshotList?[this._dataGrid.scrollContainer]:this._contentViewContainer.currentContentView?this._contentViewContainer.currentContentView.scrollableElements:[]}showHeapSnapshotList(){this._showingSnapshotList||(this._showingSnapshotList=!0,this._heapSnapshotDiff=null,this._cancelSelectComparisonHeapSnapshots(),this._contentViewContainer.hidden(),this.removeSubview(this._contentViewContainer),this.addSubview(this._dataGrid),this._dataGrid.scrollContainer.scrollTop=this._snapshotListScrollTop,this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange),this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange))}showHeapSnapshotTimelineRecord(_){this._showingSnapshotList&&(this._snapshotListScrollTop=this._dataGrid.scrollContainer.scrollTop,this.removeSubview(this._dataGrid),this.addSubview(this._contentViewContainer),this._contentViewContainer.shown()),this._showingSnapshotList=!1,this._heapSnapshotDiff=null,this._cancelSelectComparisonHeapSnapshots();for(let C of this._dataGrid.children)if(C.record===_){C.select();break}let S=this._contentViewContainer.currentContentView&&this._contentViewContainer.currentContentView.representedObject===_.heapSnapshot;this._contentViewContainer.showContentViewForRepresentedObject(_.heapSnapshot),S&&this._currentContentViewDidChange()}showHeapSnapshotDiff(_){this._showingSnapshotList&&(this.removeSubview(this._dataGrid),this.addSubview(this._contentViewContainer),this._contentViewContainer.shown()),this._showingSnapshotList=!1,this._heapSnapshotDiff=_,this._contentViewContainer.showContentViewForRepresentedObject(_)}get showsFilterBar(){return this._showingSnapshotList}get navigationItems(){if(this._showingSnapshotList){let _=[this._takeHeapSnapshotButtonItem,this._compareHeapSnapshotsButtonItem];return this._selectingComparisonHeapSnapshots&&_.push(this._compareHeapSnapshotHelpTextItem),_}return this._contentViewContainer.currentContentView.navigationItems}get selectionPathComponents(){let _=[this._snapshotListPathComponent];if(this._showingSnapshotList)return _;if(this._heapSnapshotDiff){let S=this._heapSnapshotDiff.snapshot1.identifier,C=this._heapSnapshotDiff.snapshot2.identifier,f=new WebInspector.HierarchicalPathComponent(WebInspector.UIString("Snapshot Comparison (%d and %d)").format(S,C),"snapshot-diff-icon","snapshot-diff");_.push(f)}else if(this._dataGrid.selectedNode){let S=new WebInspector.HeapAllocationsTimelineDataGridNodePathComponent(this._dataGrid.selectedNode);S.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected,this._snapshotPathComponentSelected,this),_.push(S)}return _.concat(this._contentViewContainer.currentContentView.selectionPathComponents)}selectRecord(_){_?this.showHeapSnapshotTimelineRecord(_):this.showHeapSnapshotList()}shown(){super.shown(),this._dataGrid.shown(),this._showingSnapshotList||this._contentViewContainer.shown()}hidden(){super.hidden(),this._dataGrid.hidden(),this._showingSnapshotList||this._contentViewContainer.hidden()}closed(){this.representedObject.removeEventListener(null,null,this),this._dataGrid.closed(),this._contentViewContainer.closeAllContentViews(),WebInspector.ContentView.removeEventListener(null,null,this),WebInspector.HeapSnapshotProxy.removeEventListener(null,null,this),WebInspector.HeapSnapshotWorkerProxy.singleton().removeEventListener("HeapSnapshot.CollectionEvent",this._heapSnapshotCollectionEvent,this)}layout(){if(this._pendingZeroTimeDataGridNodes.length&&this.zeroTime){for(let _ of this._pendingZeroTimeDataGridNodes)_.updateTimestamp(this.zeroTime);this._pendingZeroTimeDataGridNodes=[],this._dataGrid._sort()}if(this._pendingRecords.length){for(let _ of this._pendingRecords){let S=new WebInspector.HeapAllocationsTimelineDataGridNode(_,this.zeroTime,this);this._dataGrid.addRowInSortOrder(null,S),this.zeroTime||this._pendingZeroTimeDataGridNodes.push(S)}this._pendingRecords=[],this._updateCompareHeapSnapshotButton()}}reset(){super.reset(),this._dataGrid.reset(),this.showHeapSnapshotList(),this._pendingRecords=[],this._pendingZeroTimeDataGridNodes=[],this._updateCompareHeapSnapshotButton()}updateFilter(_){this._dataGrid.filterText=_?_.text:""}_heapAllocationsTimelineRecordAdded(_){this._pendingRecords.push(_.data.record),this.needsLayout()}_heapSnapshotCollectionEvent(_){function S(C){C.invalid||C.updateForCollectionEvent(_)}for(let C of this._dataGrid.children)S(C.record.heapSnapshot);for(let C of this._pendingRecords)S(C.heapSnapshot);this._heapSnapshotDiff&&S(this._heapSnapshotDiff)}_snapshotListPathComponentClicked(){this.showHeapSnapshotList()}_snapshotPathComponentSelected(_){this.showHeapSnapshotTimelineRecord(_.data.pathComponent.representedObject)}_currentContentViewDidChange(){this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange),this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange)}_contentViewSelectionPathComponentDidChange(_){_.target!==this._contentViewContainer.currentContentView||this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange)}_heapSnapshotInvalidated(_){let S=_.target;this._baselineHeapSnapshotTimelineRecord&&S===this._baselineHeapSnapshotTimelineRecord.heapSnapshot&&this._cancelSelectComparisonHeapSnapshots(),this._heapSnapshotDiff?(S===this._heapSnapshotDiff.snapshot1||S===this._heapSnapshotDiff.snapshot2)&&this.showHeapSnapshotList():this._dataGrid.selectedNode&&S===this._dataGrid.selectedNode.record.heapSnapshot&&this.showHeapSnapshotList(),this._updateCompareHeapSnapshotButton()}_updateCompareHeapSnapshotButton(){let _=!1,S=0;for(let C of this._dataGrid.children)if(C.revealed&&!C.hidden&&!C.record.heapSnapshot.invalid&&(S++,2==S)){_=!0;break}this._compareHeapSnapshotsButtonItem.enabled=_}_takeHeapSnapshotClicked(){HeapAgent.snapshot(function(_,S,C){let f=WebInspector.HeapSnapshotWorkerProxy.singleton();f.createSnapshot(C,({objectId:T,snapshot:E})=>{let I=WebInspector.HeapSnapshotProxy.deserialize(T,E);WebInspector.timelineManager.heapSnapshotAdded(S,I)})})}_cancelSelectComparisonHeapSnapshots(){this._selectingComparisonHeapSnapshots&&(this._baselineDataGridNode&&this._baselineDataGridNode.clearBaseline(),this._selectingComparisonHeapSnapshots=!1,this._baselineDataGridNode=null,this._baselineHeapSnapshotTimelineRecord=null,this._compareHeapSnapshotsButtonItem.activated=!1,this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange))}_compareHeapSnapshotsClicked(){let S=!this._compareHeapSnapshotsButtonItem.activated;return this._compareHeapSnapshotsButtonItem.activated=S,S?void(this._dataGrid.selectedNode&&this._dataGrid.selectedNode.deselect(),this._selectingComparisonHeapSnapshots=!0,this._baselineHeapSnapshotTimelineRecord=null,this._compareHeapSnapshotHelpTextItem.text=WebInspector.UIString("Select baseline snapshot"),this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange)):void this._cancelSelectComparisonHeapSnapshots()}_dataGridNodeSelected(){if(this._selectingComparisonHeapSnapshots){let S=this._dataGrid.selectedNode;if(S){let C=S.record;if(C.heapSnapshot.invalid||this._baselineHeapSnapshotTimelineRecord===C)return void this._dataGrid.selectedNode.deselect();if(!this._baselineHeapSnapshotTimelineRecord)return this._baselineDataGridNode=S,this._baselineDataGridNode.markAsBaseline(),this._baselineHeapSnapshotTimelineRecord=C,this._dataGrid.selectedNode.deselect(),this._compareHeapSnapshotHelpTextItem.text=WebInspector.UIString("Select comparison snapshot"),void this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange);let f=this._baselineHeapSnapshotTimelineRecord.heapSnapshot,T=C.heapSnapshot;f.identifier>T.identifier&&([f,T]=[T,f]);let E=WebInspector.HeapSnapshotWorkerProxy.singleton();E.createSnapshotDiff(f.proxyObjectId,T.proxyObjectId,({objectId:I,snapshotDiff:R})=>{let N=WebInspector.HeapSnapshotDiffProxy.deserialize(I,R);this.showHeapSnapshotDiff(N)}),this._baselineDataGridNode.clearBaseline(),this._baselineDataGridNode=null,this._selectingComparisonHeapSnapshots=!1,this._compareHeapSnapshotsButtonItem.activated=!1}}}},WebInspector.HeapSnapshotClassDataGridNode=class extends WebInspector.DataGridNode{constructor(_,S){super(_,!0),this._data=_,this._tree=S,this._batched=!1,this._instances=null,this.addEventListener("populate",this._populate,this)}get data(){return this._data}createCellContent(_){if("retainedSize"===_){let S=this._data.retainedSize,C=document.createDocumentFragment(),f=C.appendChild(document.createElement("span"));f.classList.add("size"),f.textContent=Number.bytesToString(S);let T=C.appendChild(document.createElement("span"));return T.classList.add("percentage"),T.textContent=emDash,C}if("size"===_)return Number.bytesToString(this._data.size);if("className"===_){let{className:S}=this._data,C=document.createDocumentFragment(),f=C.appendChild(document.createElement("img"));f.classList.add("icon",WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName(S));let T=C.appendChild(document.createElement("span"));return T.classList.add("class-name"),T.textContent=S,C}return super.createCellContent(_)}sort(){if(this._batched)return this._removeFetchMoreDataGridNode(),this._sortInstances(),this._updateBatchedChildren(),void this._appendFetchMoreDataGridNode();let _=this.children;_.sort(this._tree._sortComparator);for(let S=0;S<_.length;++S)_[S]._recalculateSiblings(S),_[S].sort()}removeCollectedNodes(_){let S=[];if(this.forEachImmediateChild(C=>{if(C instanceof WebInspector.HeapSnapshotInstanceDataGridNode){let f=C.node;f.id in _&&S.push(C)}}),S.length)for(let C of S)this.removeChild(C);this._instances&&(this._instances=this._instances.filter(C=>!(C.id in _)),this._fetchBatch(S.length))}updateCount(_){return _===this._data.count?void 0:_?void(this._data.count=_,this.needsRefresh()):void this._tree.removeChild(this)}_populate(){this.removeEventListener("populate",this._populate,this),this._tree.heapSnapshot.instancesWithClassName(this._data.className,_=>{if(this._instances=_.filter(S=>!S.dead),this._sortInstances(),_.length>WebInspector.HeapSnapshotClassDataGridNode.ChildrenBatchLimit)return this._batched=!0,void this._fetchBatch(WebInspector.HeapSnapshotClassDataGridNode.ChildrenBatchLimit);for(let S of this._instances)this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(S,this._tree))})}_fetchBatch(_){this._batched&&this.children.length&&this._removeFetchMoreDataGridNode();let S=this.children.length,C=S+_;C>=this._instances.length&&(C=this._instances.length-1,this._batched=!1);let f=C-S;if(f)for(let T=0,E;T<=f;++T)E=this._instances[S+T],this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(E,this._tree));this._batched&&this._appendFetchMoreDataGridNode()}_sortInstances(){this._instances.sort((_,S)=>{return this._tree._sortComparator({data:_},{data:S})})}_updateBatchedChildren(){let _=this.children.length;this.removeChildren();for(let S=0;S<_;++S)this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(this._instances[S],this._tree))}_removeFetchMoreDataGridNode(){this.removeChild(this.children[this.children.length-1])}_appendFetchMoreDataGridNode(){let _=this.children.length,S=this._instances.length,C=S-_,f=C>=WebInspector.HeapSnapshotClassDataGridNode.ChildrenBatchLimit?WebInspector.HeapSnapshotClassDataGridNode.ChildrenBatchLimit:0;this.appendChild(new WebInspector.HeapSnapshotInstanceFetchMoreDataGridNode(this._tree,f,C,this._fetchBatch.bind(this)))}},WebInspector.HeapSnapshotClassDataGridNode.ChildrenBatchLimit=100,WebInspector.HeapSnapshotClusterContentView=class extends WebInspector.ClusterContentView{constructor(_){function S(C,f,T){let E=new WebInspector.HierarchicalPathComponent(C,f,T,!1,!0);return E.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected,this._pathComponentSelected,this),E.comparisonData=_,E}super(_),this._heapSnapshot=_,this._shownInitialContent=!1,this._instancesContentView=null,this._objectGraphContentView=null,this._instancesPathComponent=S.call(this,WebInspector.UIString("Instances"),"heap-snapshot-instances-icon",WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier),this._objectGraphPathComponent=S.call(this,WebInspector.UIString("Object Graph"),"heap-snapshot-object-graph-icon",WebInspector.HeapSnapshotClusterContentView.ObjectGraphIdentifier),this._supportsObjectGraph()&&(this._instancesPathComponent.nextSibling=this._objectGraphPathComponent,this._objectGraphPathComponent.previousSibling=this._instancesPathComponent),this._currentContentViewSetting=new WebInspector.Setting("heap-snapshot-cluster-current-view",WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier)}static iconStyleClassNameForClassName(_,S){if(S)return"native";switch(_){case"Object":case"Array":case"Map":case"Set":case"WeakMap":case"WeakSet":case"Promise":case"Error":case"Window":case"Map Iterator":case"Set Iterator":case"Math":case"JSON":case"GlobalObject":return"object";case"Function":return"function";case"RegExp":return"regex";case"Number":return"number";case"Boolean":return"boolean";case"String":case"string":return"string";case"Symbol":case"symbol":return"symbol";}return _.endsWith("Prototype")?"object":_.endsWith("Element")||"Node"===_||"Text"===_?"node":"native"}get heapSnapshot(){return this._heapSnapshot}get instancesContentView(){return this._instancesContentView||(this._instancesContentView=new WebInspector.HeapSnapshotInstancesContentView(this._heapSnapshot)),this._instancesContentView}get objectGraphContentView(){return this._supportsObjectGraph()?(this._objectGraphContentView||(this._objectGraphContentView=new WebInspector.HeapSnapshotObjectGraphContentView(this._heapSnapshot)),this._objectGraphContentView):null}get selectionPathComponents(){let _=this._contentViewContainer.currentContentView;if(!_)return[];let S=[this._pathComponentForContentView(_)];return S.concat(_.selectionPathComponents)}shown(){super.shown();this._shownInitialContent||this._showContentViewForIdentifier(this._currentContentViewSetting.value)}closed(){super.closed(),this._shownInitialContent=!1}saveToCookie(_){_[WebInspector.HeapSnapshotClusterContentView.ContentViewIdentifierCookieKey]=this._currentContentViewSetting.value}restoreFromCookie(_){this._showContentViewForIdentifier(_[WebInspector.HeapSnapshotClusterContentView.ContentViewIdentifierCookieKey])}showInstances(){return this._shownInitialContent=!0,this._showContentViewForIdentifier(WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier)}showObjectGraph(){return this._shownInitialContent=!0,this._showContentViewForIdentifier(WebInspector.HeapSnapshotClusterContentView.ObjectGraphIdentifier)}_supportsObjectGraph(){return this._heapSnapshot instanceof WebInspector.HeapSnapshotProxy}_pathComponentForContentView(_){return _?_===this._instancesContentView?this._instancesPathComponent:_===this._objectGraphContentView?this._objectGraphPathComponent:(console.error("Unknown contentView."),null):null}_identifierForContentView(_){return _?_===this._instancesContentView?WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier:_===this._objectGraphContentView?WebInspector.HeapSnapshotClusterContentView.ObjectGraphIdentifier:(console.error("Unknown contentView."),null):null}_showContentViewForIdentifier(_){let S=null;return _===WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier?S=this.instancesContentView:_===WebInspector.HeapSnapshotClusterContentView.ObjectGraphIdentifier?S=this.objectGraphContentView:void 0,S||(S=this.instancesContentView),this._shownInitialContent=!0,this._currentContentViewSetting.value=this._identifierForContentView(S),this.contentViewContainer.showContentView(S)}_pathComponentSelected(_){this._showContentViewForIdentifier(_.data.pathComponent.representedObject)}},WebInspector.HeapSnapshotClusterContentView.ContentViewIdentifierCookieKey="heap-snapshot-cluster-content-view-identifier",WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier="instances",WebInspector.HeapSnapshotClusterContentView.ObjectGraphIdentifier="object-graph",WebInspector.HeapSnapshotContentView=class extends WebInspector.ContentView{constructor(_,S,C,f){super(_),this.element.classList.add("heap-snapshot"),this._dataGrid=new WebInspector.DataGrid(C),this._dataGrid.sortColumnIdentifier="retainedSize",this._dataGrid.sortOrder=WebInspector.DataGrid.SortOrder.Descending,this._dataGrid.createSettings(S),this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged,this._sortDataGrid,this);let T=WebInspector.HeapSnapshotDataGridTree.buildSortComparator(this._dataGrid.sortColumnIdentifier,this._dataGrid.sortOrder);this._heapSnapshotDataGridTree=new f(this.representedObject,T),this._heapSnapshotDataGridTree.addEventListener(WebInspector.HeapSnapshotDataGridTree.Event.DidPopulate,this._heapSnapshotDataGridTreeDidPopulate,this);for(let E of this._heapSnapshotDataGridTree.children)this._dataGrid.appendChild(E);this.addSubview(this._dataGrid),this._dataGrid.updateLayout()}shown(){super.shown(),this._heapSnapshotDataGridTree.shown()}hidden(){super.hidden(),this._heapSnapshotDataGridTree.hidden()}get scrollableElements(){return[this._dataGrid.scrollContainer]}_sortDataGrid(){if(this._heapSnapshotDataGridTree){this._heapSnapshotDataGridTree.sortComparator=WebInspector.HeapSnapshotDataGridTree.buildSortComparator(this._dataGrid.sortColumnIdentifier,this._dataGrid.sortOrder),this._dataGrid.removeChildren();for(let _ of this._heapSnapshotDataGridTree.children)this._dataGrid.appendChild(_)}}_heapSnapshotDataGridTreeDidPopulate(){this._dataGrid.removeChildren();for(let _ of this._heapSnapshotDataGridTree.children)this._dataGrid.appendChild(_)}},WebInspector.HeapSnapshotInstancesContentView=class extends WebInspector.HeapSnapshotContentView{constructor(_){let S={retainedSize:{title:WebInspector.UIString("Retained Size"),tooltip:WebInspector.UIString("Size of current object plus all objects it keeps alive"),width:"140px",aligned:"right",sortable:!0},size:{title:WebInspector.UIString("Self Size"),width:"90px",aligned:"right",sortable:!0},count:{title:WebInspector.UIString("Count"),width:"75px",aligned:"right",sortable:!0},className:{title:WebInspector.UIString("Name"),sortable:!0,disclosure:!0}};super(_,"heap-snapshot-instances-content-view",S,WebInspector.HeapSnapshotInstancesDataGridTree)}},WebInspector.HeapSnapshotObjectGraphContentView=class extends WebInspector.HeapSnapshotContentView{constructor(_){let S={retainedSize:{title:WebInspector.UIString("Retained Size"),tooltip:WebInspector.UIString("Size of current object plus all objects it keeps alive"),width:"140px",aligned:"right",sortable:!0},size:{title:WebInspector.UIString("Self Size"),width:"90px",aligned:"right",sortable:!0},className:{title:WebInspector.UIString("Name"),sortable:!0,disclosure:!0}};super(_,"heap-snapshot-object-graph-content-view",S,WebInspector.HeapSnapshotObjectGraphDataGridTree)}},WebInspector.HeapSnapshotDataGridTree=class extends WebInspector.Object{constructor(_,S){super(),this._heapSnapshot=_,this._heapSnapshot.addEventListener(WebInspector.HeapSnapshotProxy.Event.CollectedNodes,this._heapSnapshotCollectedNodes,this),this._children=[],this._sortComparator=S,this._visible=!1,this._popover=null,this._popoverGridNode=null,this._popoverTargetElement=null,this.populateTopLevel()}static buildSortComparator(_,S){let C=S===WebInspector.DataGrid.SortOrder.Ascending?1:-1,f=(E,I,R)=>C*(I.data[E]-R.data[E]);return"retainedSize"===_?f.bind(this,"retainedSize"):"size"===_?f.bind(this,"size"):"count"===_?f.bind(this,"count"):"className"===_?(E,I)=>{if(E.propertyName||I.propertyName){if(E.propertyName&&!I.propertyName)return-1*C;if(!E.propertyName&&I.propertyName)return 1*C;let N=E.propertyName.extendedLocaleCompare(I.propertyName);return C*N}let R=E.data.className.extendedLocaleCompare(I.data.className);return R?C*R:E.data.id||I.data.id?C*(E.data.id-I.data.id):0}:void 0}get heapSnapshot(){return this._heapSnapshot}get visible(){return this._visible}get popoverGridNode(){return this._popoverGridNode}set popoverGridNode(_){this._popoverGridNode=_}get popoverTargetElement(){return this._popoverTargetElement}set popoverTargetElement(_){this._popoverTargetElement=_}get popover(){return this._popover||(this._popover=new WebInspector.Popover(this),this._popover.windowResizeHandler=()=>{let _=WebInspector.Rect.rectFromClientRect(this._popoverTargetElement.getBoundingClientRect());this._popover.present(_.pad(2),[WebInspector.RectEdge.MAX_Y,WebInspector.RectEdge.MIN_Y,WebInspector.RectEdge.MAX_X])}),this._popover}get children(){return this._children}appendChild(_){this._children.push(_)}insertChild(_,S){this._children.splice(S,0,_)}removeChild(_){this._children.remove(_,!0)}removeChildren(){this._children=[]}set sortComparator(_){this._sortComparator=_,this.sort()}sort(){let _=this._children;_.sort(this._sortComparator);for(let S=0;S<_.length;++S)_[S]._recalculateSiblings(S),_[S].sort()}shown(){this._visible=!0}hidden(){this._visible=!1,this._popover&&this._popover.visible&&this._popover.dismiss()}willDismissPopover(){this._popoverGridNode=null,this._popoverTargetElement=null}get alwaysShowRetainedSize(){return!1}populateTopLevel(){}removeCollectedNodes(){}didPopulate(){this.sort(),this.dispatchEventToListeners(WebInspector.HeapSnapshotDataGridTree.Event.DidPopulate)}_heapSnapshotCollectedNodes(_){this.removeCollectedNodes(_.data.collectedNodes)}},WebInspector.HeapSnapshotDataGridTree.Event={DidPopulate:"heap-snapshot-data-grid-tree-did-populate"},WebInspector.HeapSnapshotInstancesDataGridTree=class extends WebInspector.HeapSnapshotDataGridTree{get alwaysShowRetainedSize(){return!1}populateTopLevel(){for(let[_,{size:S,retainedSize:C,count:f,internalCount:T,deadCount:E}]of this.heapSnapshot.categories)if(f!==T){let ye=f-E;ye&&this.appendChild(new WebInspector.HeapSnapshotClassDataGridNode({className:_,size:S,retainedSize:C,count:ye},this))}this.didPopulate()}removeCollectedNodes(_){for(let S of this.children){let{count:C,deadCount:f}=this.heapSnapshot.categories.get(S.data.className),T=C-f;S.updateCount(T),T&&S.removeCollectedNodes(_)}this.didPopulate()}},WebInspector.HeapSnapshotObjectGraphDataGridTree=class extends WebInspector.HeapSnapshotDataGridTree{get alwaysShowRetainedSize(){return!0}populateTopLevel(){this.heapSnapshot.instancesWithClassName("GlobalObject",_=>{for(let S of _)this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(S,this))}),this.heapSnapshot.instancesWithClassName("Window",_=>{for(let S of _)0===S.dominatorNodeIdentifier&&this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(S,this));this.didPopulate()})}},WebInspector.HeapSnapshotInstanceDataGridNode=class extends WebInspector.DataGridNode{constructor(_,S,C,f){let T=_.hasChildren&&"string"!==_.className;super(_,T),this._node=_,this._tree=S,this._edge=C||null,this._base=f||null,this.copyable=!1,T&&this.addEventListener("populate",this._populate,this)}static logHeapSnapshotNode(_){let S=_.id,C=!0,f=WebInspector.UIString("Heap Snapshot Object (%s)").format("@"+S);_.shortestGCRootPath(T=>{if(T.length){T=T.slice().reverse();let E=T.findIndex(R=>{return R instanceof WebInspector.HeapSnapshotNodeProxy&&"Window"===R.className}),I=WebInspector.HeapSnapshotRootPath.emptyPath();for(let R=-1===E?0:E,N;R{for(let f=0;f{let E={data:f,propertyName:_(f.__edge)},I={data:T,propertyName:_(T.__edge)};return this._tree._sortComparator(E,I)});for(let f of S)f.__edge&&f.__edge.isPrivateSymbol()||this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(f,this._tree,f.__edge,this._base||this))})}_contextMenuHandler(_){let S=WebInspector.ContextMenu.createFromEvent(_);S.appendSeparator(),S.appendItem(WebInspector.UIString("Log Value"),WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.bind(null,this._node))}_populateError(_){if(!this._node.internal){let S=_.appendChild(document.createElement("span"));S.classList.add("preview-error"),S.textContent=WebInspector.UIString("No preview available")}}_populateWindowPreview(_){HeapAgent.getRemoteObject(this._node.id,(S,C)=>{if(S)return void this._populateError(_);let T=WebInspector.RemoteObject.fromPayload(C,WebInspector.assumingMainTarget());T.callFunctionJSON(function(){return this.location.href},void 0,E=>{if(T.release(),!E)this._populateError(_);else{let I=WebInspector.RemoteObject.fromPrimitiveValue(E);_.appendChild(WebInspector.FormattedValue.createElementForRemoteObject(I))}})})}_populatePreview(_){HeapAgent.getPreview(this._node.id,(S,C,f,T)=>{if(S)return void this._populateError(_);if(C){let E=WebInspector.RemoteObject.fromPrimitiveValue(C);return void _.appendChild(WebInspector.FormattedValue.createElementForRemoteObject(E))}if(f){let{location:E,name:I,displayName:R}=f,N=_.appendChild(document.createElement("span"));N.classList.add("function-name"),N.textContent=I||R||WebInspector.UIString("(anonymous function)");let L=WebInspector.debuggerManager.scriptForIdentifier(E.scriptId,WebInspector.assumingMainTarget());if(L){let D=_.appendChild(document.createElement("span"));D.classList.add("location");let M=L.createSourceCodeLocation(E.lineNumber,E.columnNumber);M.populateLiveDisplayLocationString(D,"textContent",WebInspector.SourceCodeLocation.ColumnStyle.Hidden,WebInspector.SourceCodeLocation.NameStyle.Short);let O=WebInspector.createSourceCodeLocationLink(M,{dontFloat:!0,useGoToArrowButton:!0,ignoreNetworkTab:!0,ignoreSearchTab:!0});_.appendChild(O)}return}if(T){let E=WebInspector.ObjectPreview.fromPayload(T),I=WebInspector.FormattedValue.createObjectPreviewOrFormattedValueForObjectPreview(E);return void _.appendChild(I)}})}_mouseoverHandler(_){function S(N){let L=document.createElement("span");L.classList.add("object-id"),L.textContent="@"+N.id,L.addEventListener("click",WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.bind(null,N));let D=R.appendChild(document.createElement("div"));D.classList.add("title");let M=WebInspector.UIString("Shortest property path to %s").format("@@@"),[P,O]=M.split(/\s*@@@\s*/);D.append(P+" ",L," "+O)}function C(N){let L=R.appendChild(document.createElement("div"));L.classList.add("table-container");let D=L.appendChild(document.createElement("table"));N=N.slice().reverse();let M=N.findIndex(O=>{return O instanceof WebInspector.HeapSnapshotNodeProxy&&"Window"===O.className}),P=null;for(let O=-1===M?0:M,F;O{if(this._tree.visible){if(N.length)S(this._node),C(N);else if(this._node.gcRoot){let L=R.appendChild(document.createElement("div"));L.textContent=WebInspector.UIString("This object is a root")}else{let L=R.appendChild(document.createElement("div"));L.textContent=WebInspector.UIString("This object is referenced by internal objects")}this._tree.popover.presentNewContentWithFrame(R,I.pad(2),[WebInspector.RectEdge.MAX_Y,WebInspector.RectEdge.MIN_Y,WebInspector.RectEdge.MAX_X])}})}}},WebInspector.HeapSnapshotInstanceFetchMoreDataGridNode=class extends WebInspector.DataGridNode{constructor(_,S,C,f){super({},!1),this._tree=_,this._batchCount=S,this._remainingCount=C,this._fetchCallback=f}createCellContent(_){if("className"!==_)return"";let S=document.createDocumentFragment();if(this._batchCount){let f=S.appendChild(document.createElement("span"));f.classList.add("more"),f.textContent=WebInspector.UIString("Show %d More").format(this._batchCount),f.addEventListener("click",()=>{this._fetchCallback(this._batchCount)})}let C=S.appendChild(document.createElement("span"));return C.classList.add("more"),C.textContent=WebInspector.UIString("Show Remaining (%d)").format(this._remainingCount),C.addEventListener("click",()=>{this._fetchCallback(this._remainingCount)}),S}sort(){}},WebInspector.HierarchicalPathNavigationItem=class extends WebInspector.NavigationItem{constructor(_,S){super(_),this.components=S}get components(){return this._components}set components(_){_||(_=[]);if(!(this._components&&function(f,T){let E=M=>M.representedObject,I=f.map(E),R=T.map(E);if(!Array.shallowEqual(I,R))return!1;let N=M=>M.comparisonData,L=f.map(N),D=T.map(N);return Array.shallowEqual(L,D)}(this._components,_))){for(var C=0;this._components&&C=N)break}if(!(0>=N)&&!(3>=this._components.length)){var D=this._components.length>>1,M=-1,C=D;this._collapsedComponent=new WebInspector.HierarchicalPathComponent(ellipsis,[]),this._collapsedComponent.collapsed=!0,this.element.insertBefore(this._collapsedComponent.element,this._components[D].element),N+=this._collapsedComponent.minimumWidth;for(var P=[];0<=C&&C<=this._components.length-1;){if(0=N)break}C=D+M,0=_[1].maxX()?this._drawTwoNonOverlappingLines(_):this._drawOverlappingLines(_);var T=WebInspector.Rect.unionOfRects(_).pad(3),E=this._element.style;E.left=T.minX()+"px",E.top=T.minY()+"px",E.width=T.size.width+"px",E.height=T.size.height+"px",this._outlineElement.style.width=T.size.width+"px",this._outlineElement.style.height=T.size.height+"px",this._button.style.left=f.maxX()-T.minX()-S+"px",this._button.style.top=f.maxY()-T.minY()-C+"px"}_addRect(_){var S=4,C=document.createElementNS("http://www.w3.org/2000/svg","rect");return C.setAttribute("x",1),C.setAttribute("y",1),C.setAttribute("width",_.size.width),C.setAttribute("height",_.size.height),C.setAttribute("rx",S),C.setAttribute("ry",S),this._outlineElement.appendChild(C)}_addPath(_,S,C){var f=document.createElementNS("http://www.w3.org/2000/svg","path");return f.setAttribute("d",_.join(" ")),f.setAttribute("transform","translate("+(S+1)+","+(C+1)+")"),this._outlineElement.appendChild(f)}_drawSingleLine(_){this._addRect(_.pad(2))}_drawTwoNonOverlappingLines(_){var S=4,C=_[0].pad(2),f=_[1].pad(2),T=-f.minX(),E=-C.minY(),I=C;this._addPath(["M",I.maxX(),I.minY(),"H",I.minX()+S,"q",-S,0,-S,S,"V",I.maxY()-S,"q",0,S,S,S,"H",I.maxX()],T,E),I=f,this._addPath(["M",I.minX(),I.minY(),"H",I.maxX()-S,"q",S,0,S,S,"V",I.maxY()-S,"q",0,S,-S,S,"H",I.minX()],T,E)}_drawOverlappingLines(_){var S=2,C=4,f=Number.MAX_VALUE,T=-Number.MAX_VALUE;for(var E of _)var f=Math.min(E.minX(),f),T=Math.max(E.maxX(),T);f-=S,T+=S;var I=_[0].minY()-S,R=_.lastValue.maxY()+S,N=_[0].minX()-S,L=_.lastValue.maxX()+S;if(N===f&&L===T)return this._addRect(new WebInspector.Rect(f,I,T-f,R-I));var D=_.lastValue.minY()+S;if(_[0].minX()===f+S)return this._addPath(["M",f+C,I,"H",T-C,"q",C,0,C,C,"V",D-C,"q",0,C,-C,C,"H",L+C,"q",-C,0,-C,C,"V",R-C,"q",0,C,-C,C,"H",f+C,"q",-C,0,-C,-C,"V",I+C,"q",0,-C,C,-C],-f,-I);var M=_[0].maxY()-S;return _.lastValue.maxX()===T-S?this._addPath(["M",N+C,I,"H",T-C,"q",C,0,C,C,"V",R-C,"q",0,C,-C,C,"H",f+C,"q",-C,0,-C,-C,"V",M+C,"q",0,-C,C,-C,"H",N-C,"q",C,0,C,-C,"V",I+C,"q",0,-C,C,-C],-f,-I):this._addPath(["M",N+C,I,"H",T-C,"q",C,0,C,C,"V",D-C,"q",0,C,-C,C,"H",L+C,"q",-C,0,-C,C,"V",R-C,"q",0,C,-C,C,"H",f+C,"q",-C,0,-C,-C,"V",M+C,"q",0,-C,C,-C,"H",N-C,"q",C,0,C,-C,"V",I+C,"q",0,-C,C,-C],-f,-I)}},WebInspector.HoverMenu.VisibleClassName="visible",WebInspector.IdleTreeElement=class extends WebInspector.GeneralTreeElement{constructor(){super("idle",WebInspector.UIString("Idle"))}},WebInspector.ImageResourceContentView=class extends WebInspector.ResourceContentView{constructor(_){super(_,"image"),this._imageElement=null;const S=WebInspector.UIString("Show Grid"),C=WebInspector.UIString("Hide Grid");this._showGridButtonNavigationItem=new WebInspector.ActivateButtonNavigationItem("show-grid",S,C,"Images/NavigationItemCheckers.svg",13,13),this._showGridButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._showGridButtonClicked,this),this._showGridButtonNavigationItem.activated=!!WebInspector.settings.showImageGrid.value}get navigationItems(){return[this._showGridButtonNavigationItem]}contentAvailable(){let C=this.resource.createObjectURL();return C?void(this.removeLoadingIndicator(),this._imageElement=document.createElement("img"),this._imageElement.addEventListener("load",function(){URL.revokeObjectURL(C)}),this._imageElement.src=C,this._imageElement.setAttribute("filename",this.resource.urlComponents.lastPathComponent||""),this._updateImageGrid(),this.element.appendChild(this._imageElement)):void this.showGenericErrorMessage()}shown(){super.shown(),this._updateImageGrid(),WebInspector.settings.showImageGrid.addEventListener(WebInspector.Setting.Event.Changed,this._updateImageGrid,this)}hidden(){WebInspector.settings.showImageGrid.removeEventListener(WebInspector.Setting.Event.Changed,this._updateImageGrid,this),super.hidden()}_updateImageGrid(){if(this._imageElement){let _=WebInspector.settings.showImageGrid.value;this._showGridButtonNavigationItem.activated=_,this._imageElement.classList.toggle("show-grid",_)}}_showGridButtonClicked(){WebInspector.settings.showImageGrid.value=!this._showGridButtonNavigationItem.activated,this._updateImageGrid()}},WebInspector.IndeterminateProgressSpinner=class extends WebInspector.Object{constructor(){super(),this._element=document.createElement("div"),this._element.classList.add("indeterminate-progress-spinner")}get element(){return this._element}},WebInspector.IndexedDatabaseContentView=class extends WebInspector.ContentView{constructor(_){super(_),this._element.classList.add("indexed-database"),this._databaseHostRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Host")),this._databaseSecurityOriginRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Security Origin")),this._databaseVersionRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Version")),this._databaseGroup=new WebInspector.DetailsSectionGroup([this._databaseHostRow,this._databaseSecurityOriginRow,this._databaseVersionRow]),this._databaseSection=new WebInspector.DetailsSection("indexed-database-details",WebInspector.UIString("Database"),[this._databaseGroup]),this.element.append(this._databaseSection.element),this._databaseHostRow.value=_.host,this._databaseSecurityOriginRow.value=_.securityOrigin,this._databaseVersionRow.value=_.version.toLocaleString()}},WebInspector.IndexedDatabaseDetailsSidebarPanel=class extends WebInspector.DetailsSidebarPanel{constructor(){super("indexed-database-details",WebInspector.UIString("Storage")),this.element.classList.add("indexed-database"),this._database=null,this._objectStore=null,this._index=null}inspect(_){_ instanceof Array||(_=[_]),this._database=null,this._objectStore=null,this._index=null;for(let C of _)C instanceof WebInspector.IndexedDatabaseObjectStore?(this._objectStore=C,this._database=this._objectStore.parentDatabase):C instanceof WebInspector.IndexedDatabaseObjectStoreIndex&&(this._index=C,this._objectStore=this._index.parentObjectStore,this._database=this._objectStore.parentDatabase);let S=this._database||this._objectStore||this._index;return S&&this.needsLayout(),S}initialLayout(){super.initialLayout(),this._databaseNameRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Name")),this._databaseVersionRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Version")),this._databaseSecurityOriginRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Security Origin"));let _=new WebInspector.DetailsSectionGroup([this._databaseNameRow,this._databaseVersionRow,this._databaseSecurityOriginRow]);this._databaseSection=new WebInspector.DetailsSection("indexed-database-database",WebInspector.UIString("Database"),[_]),this._objectStoreNameRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Name")),this._objectStoreKeyPathRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Key Path")),this._objectStoreAutoIncrementRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Auto Increment"));let S=new WebInspector.DetailsSectionGroup([this._objectStoreNameRow,this._objectStoreKeyPathRow,this._objectStoreAutoIncrementRow]);this._objectStoreSection=new WebInspector.DetailsSection("indexed-database-object-store",WebInspector.UIString("Object Store"),[S]),this._indexNameRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Name")),this._indexKeyPathRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Key Path")),this._indexUniqueRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Unique")),this._indexMultiEntryRow=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Multi-Entry"));let C=new WebInspector.DetailsSectionGroup([this._indexNameRow,this._indexKeyPathRow,this._indexUniqueRow,this._indexMultiEntryRow]);this._indexSection=new WebInspector.DetailsSection("indexed-database-index",WebInspector.UIString("Index"),[C]),this.contentView.element.appendChild(this._databaseSection.element),this.contentView.element.appendChild(this._objectStoreSection.element),this.contentView.element.appendChild(this._indexSection.element)}layout(){super.layout(),this._database?(this._databaseSection.element.hidden=!1,this._databaseSecurityOriginRow.value=this._database.securityOrigin,this._databaseNameRow.value=this._database.name,this._databaseVersionRow.value=this._database.version.toLocaleString()):this._databaseSection.element.hidden=!0,this._objectStore?(this._objectStoreSection.element.hidden=!1,this._objectStoreNameRow.value=this._objectStore.name,this._objectStoreKeyPathRow.value=this._keyPathString(this._objectStore.keyPath),this._objectStoreAutoIncrementRow.value=this._objectStore.autoIncrement?WebInspector.UIString("Yes"):WebInspector.UIString("No")):this._objectStoreSection.element.hidden=!0,this._index?(this._indexSection.element.hidden=!1,this._indexNameRow.value=this._index.name,this._indexKeyPathRow.value=this._keyPathString(this._index.keyPath),this._indexUniqueRow.value=this._index.unique?WebInspector.UIString("Yes"):WebInspector.UIString("No"),this._indexMultiEntryRow.value=this._index.keyPath.type===IndexedDBAgent.KeyPathType.Array?this._index.multiEntry?WebInspector.UIString("Yes"):WebInspector.UIString("No"):null):this._indexSection.element.hidden=!0}_keyPathString(_){return _?JSON.stringify(_):emDash}},WebInspector.IndexedDatabaseEntryDataGridNode=class extends WebInspector.DataGridNode{constructor(_){super(_),this._entry=_}get entry(){return this._entry}createCellContent(_,S){var C=this._entry[_];return C instanceof WebInspector.RemoteObject?WebInspector.FormattedValue.createObjectTreeOrFormattedValueForRemoteObject(C,null,!0):super.createCellContent(_,S)}},WebInspector.IndexedDatabaseHostTreeElement=class extends WebInspector.StorageTreeElement{constructor(_){super(WebInspector.FolderTreeElement.FolderIconStyleClassName,WebInspector.displayNameForHost(_),null),this._host=_,this.hasChildren=!0,this.expanded=!0}get name(){return WebInspector.displayNameForHost(this._host)}get categoryName(){return WebInspector.UIString("Indexed Databases")}},WebInspector.IndexedDatabaseObjectStoreContentView=class extends WebInspector.ContentView{constructor(_){function S(E){return E?E instanceof Array?E.join(WebInspector.UIString(", ")):E:""}super(_),this.element.classList.add("indexed-database-object-store"),_ instanceof WebInspector.IndexedDatabaseObjectStore?(this._objectStore=_,this._objectStoreIndex=null):_ instanceof WebInspector.IndexedDatabaseObjectStoreIndex&&(this._objectStore=_.parentObjectStore,this._objectStoreIndex=_);var C=S(this._objectStore.keyPath),f={primaryKey:{title:C?WebInspector.UIString("Primary Key \u2014 %s").format(C):WebInspector.UIString("Primary Key")},key:{},value:{title:WebInspector.UIString("Value")}};if(this._objectStoreIndex){var T=S(this._objectStoreIndex.keyPath);f.key.title=WebInspector.UIString("Index Key \u2014 %s").format(T)}else delete f.key;this._dataGrid=new WebInspector.DataGrid(f),this._dataGrid.variableHeightRows=!0,this._dataGrid.scrollContainer.addEventListener("scroll",this._dataGridScrolled.bind(this)),this.addSubview(this._dataGrid),this._entries=[],this._fetchingMoreData=!1,this._fetchMoreData(),this._refreshButtonNavigationItem=new WebInspector.ButtonNavigationItem("indexed-database-object-store-refresh",WebInspector.UIString("Refresh"),"Images/ReloadFull.svg",13,13),this._refreshButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._refreshButtonClicked,this),this._clearButtonNavigationItem=new WebInspector.ButtonNavigationItem("indexed-database-object-store-clear",WebInspector.UIString("Clear object store"),"Images/NavigationItemTrash.svg",15,15),this._clearButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked,this._clearButtonClicked,this)}get navigationItems(){return[this._refreshButtonNavigationItem,this._clearButtonNavigationItem]}closed(){super.closed(),this._reset()}saveToCookie(_){_.type=WebInspector.ContentViewCookieType.IndexedDatabaseObjectStore,_.securityOrigin=this._objectStore.parentDatabase.securityOrigin,_.databaseName=this._objectStore.parentDatabase.name,_.objectStoreName=this._objectStore.name,_.objectStoreIndexName=this._objectStoreIndex&&this._objectStoreIndex.name}get scrollableElements(){return[this._dataGrid.scrollContainer]}_reset(){for(var _ of this._entries)_.primaryKey.release(),_.key.release(),_.value.release();this._entries=[],this._dataGrid.removeChildren()}_dataGridScrolled(){this._moreEntriesAvailable&&this._dataGrid.isScrolledToLastRow()&&this._fetchMoreData()}_fetchMoreData(){this._fetchingMoreData||(this._fetchingMoreData=!0,WebInspector.storageManager.requestIndexedDatabaseData(this._objectStore,this._objectStoreIndex,this._entries.length,25,function(S,C){this._entries=this._entries.concat(S),this._moreEntriesAvailable=C;for(var f of S){var T=new WebInspector.IndexedDatabaseEntryDataGridNode(f);this._dataGrid.appendChild(T)}this._fetchingMoreData=!1,C&&this._dataGrid.isScrolledToLastRow()&&this._fetchMoreData()}.bind(this)))}_refreshButtonClicked(){this._reset(),this._fetchMoreData()}_clearButtonClicked(){WebInspector.storageManager.clearObjectStore(this._objectStore),this._reset()}},WebInspector.IndexedDatabaseObjectStoreIndexTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_){super("database-table-icon",_.name,null,_,!1),this._objectStoreIndex=_}get objectStoreIndex(){return this._objectStoreIndex}},WebInspector.IndexedDatabaseObjectStoreTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_){super("database-table-icon",_.name,null,_,!!_.indexes.length),this._objectStore=_}get objectStore(){return this._objectStore}oncollapse(){this.shouldRefreshChildren=!0}onpopulate(){if(!this.children.length||this.shouldRefreshChildren){this.shouldRefreshChildren=!1,this.removeChildren();for(var _ of this._objectStore.indexes)this.appendChild(new WebInspector.IndexedDatabaseObjectStoreIndexTreeElement(_))}}},WebInspector.IndexedDatabaseTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_){super("database-icon",_.name,null,_,!!_.objectStores.length),this._indexedDatabase=_}get indexedDatabase(){return this._indexedDatabase}oncollapse(){this.shouldRefreshChildren=!0}onpopulate(){if(!this.children.length||this.shouldRefreshChildren){this.shouldRefreshChildren=!1,this.removeChildren();for(var _ of this._indexedDatabase.objectStores)this.appendChild(new WebInspector.IndexedDatabaseObjectStoreTreeElement(_))}}},WebInspector.InlineSwatch=class extends WebInspector.Object{constructor(_,S,C){switch(super(),this._type=_,this._swatchElement=document.createElement("span"),this._swatchElement.classList.add("inline-swatch",this._type.split("-").lastValue),this._type){case WebInspector.InlineSwatch.Type.Color:this._swatchElement.title=WebInspector.UIString("Click to select a color. Shift-click to switch color formats.");break;case WebInspector.InlineSwatch.Type.Gradient:this._swatchElement.title=WebInspector.UIString("Edit custom gradient");break;case WebInspector.InlineSwatch.Type.Bezier:this._swatchElement.title=WebInspector.UIString("Edit \u201Ccubic-bezier\u201C function");break;case WebInspector.InlineSwatch.Type.Spring:this._swatchElement.title=WebInspector.UIString("Edit \u201Cspring\u201C function");break;case WebInspector.InlineSwatch.Type.Variable:this._swatchElement.title=WebInspector.UIString("View variable value");break;default:WebInspector.reportInternalError(`Unknown InlineSwatch type "${_}"`);}this._boundSwatchElementClicked=null,C||(this._boundSwatchElementClicked=this._swatchElementClicked.bind(this),this._swatchElement.addEventListener("click",this._boundSwatchElementClicked),this._type===WebInspector.InlineSwatch.Type.Color&&this._swatchElement.addEventListener("contextmenu",this._handleContextMenuEvent.bind(this))),this._swatchInnerElement=this._swatchElement.createChild("span"),this._value=S||this._fallbackValue(),this._valueEditor=null,this._updateSwatch()}get element(){return this._swatchElement}get value(){return this._value}set value(_){this._value=_,this._updateSwatch(!0)}didDismissPopover(){this._valueEditor&&("function"==typeof this._valueEditor.removeListeners&&this._valueEditor.removeListeners(),this._boundSwatchElementClicked&&this._swatchElement.addEventListener("click",this._boundSwatchElementClicked),this.dispatchEventToListeners(WebInspector.InlineSwatch.Event.Deactivated))}_fallbackValue(){switch(this._type){case WebInspector.InlineSwatch.Type.Bezier:return WebInspector.CubicBezier.fromString("linear");case WebInspector.InlineSwatch.Type.Gradient:return WebInspector.Gradient.fromString("linear-gradient(transparent, transparent)");case WebInspector.InlineSwatch.Type.Spring:return WebInspector.Spring.fromString("1 100 10 0");case WebInspector.InlineSwatch.Type.Color:return WebInspector.Color.fromString("white");default:return null;}}_updateSwatch(_){(this._type===WebInspector.InlineSwatch.Type.Color||this._type===WebInspector.InlineSwatch.Type.Gradient)&&(this._swatchInnerElement.style.background=this._value?this._value.toString():null),_||this.dispatchEventToListeners(WebInspector.InlineSwatch.Event.ValueChanged,{value:this._value})}_swatchElementClicked(_){if(this.dispatchEventToListeners(WebInspector.InlineSwatch.Event.BeforeClicked),this._type===WebInspector.InlineSwatch.Type.Color&&_.shiftKey&&this._value){let T=this._value.nextFormat();return T?(this._value.format=T,void this._updateSwatch()):void 0}let S=WebInspector.Rect.rectFromClientRect(this._swatchElement.getBoundingClientRect()),C=new WebInspector.Popover(this);if(C.windowResizeHandler=()=>{let T=WebInspector.Rect.rectFromClientRect(this._swatchElement.getBoundingClientRect());C.present(T.pad(2),[WebInspector.RectEdge.MIN_X])},this._valueEditor=null,this._type===WebInspector.InlineSwatch.Type.Color?(this._valueEditor=new WebInspector.ColorPicker,this._valueEditor.addEventListener(WebInspector.ColorPicker.Event.ColorChanged,this._valueEditorValueDidChange,this),this._valueEditor.addEventListener(WebInspector.ColorPicker.Event.FormatChanged,()=>C.update())):this._type===WebInspector.InlineSwatch.Type.Gradient?(this._valueEditor=new WebInspector.GradientEditor,this._valueEditor.addEventListener(WebInspector.GradientEditor.Event.GradientChanged,this._valueEditorValueDidChange,this),this._valueEditor.addEventListener(WebInspector.GradientEditor.Event.ColorPickerToggled,()=>C.update())):this._type===WebInspector.InlineSwatch.Type.Bezier?(this._valueEditor=new WebInspector.BezierEditor,this._valueEditor.addEventListener(WebInspector.BezierEditor.Event.BezierChanged,this._valueEditorValueDidChange,this)):this._type===WebInspector.InlineSwatch.Type.Spring?(this._valueEditor=new WebInspector.SpringEditor,this._valueEditor.addEventListener(WebInspector.SpringEditor.Event.SpringChanged,this._valueEditorValueDidChange,this)):this._type===WebInspector.InlineSwatch.Type.Variable&&(this._valueEditor={},this._valueEditor.element=document.createElement("div"),this._valueEditor.element.classList.add("inline-swatch-variable-popover"),this._valueEditor.codeMirror=WebInspector.CodeMirrorEditor.create(this._valueEditor.element,{mode:"css",readOnly:"nocursor"}),this._valueEditor.codeMirror.on("update",()=>{C.update()})),!!this._valueEditor){C.content=this._valueEditor.element,C.present(S.pad(2),[WebInspector.RectEdge.MIN_X]),this._boundSwatchElementClicked&&this._swatchElement.removeEventListener("click",this._boundSwatchElementClicked),this.dispatchEventToListeners(WebInspector.InlineSwatch.Event.Activated);let f=this._value||this._fallbackValue();this._type===WebInspector.InlineSwatch.Type.Color?this._valueEditor.color=f:this._type===WebInspector.InlineSwatch.Type.Gradient?this._valueEditor.gradient=f:this._type===WebInspector.InlineSwatch.Type.Bezier?this._valueEditor.bezier=f:this._type===WebInspector.InlineSwatch.Type.Spring?this._valueEditor.spring=f:this._type===WebInspector.InlineSwatch.Type.Variable&&this._valueEditor.codeMirror.setValue(f)}}_valueEditorValueDidChange(_){this._type===WebInspector.InlineSwatch.Type.Color?this._value=_.data.color:this._type===WebInspector.InlineSwatch.Type.Gradient?this._value=_.data.gradient:this._type===WebInspector.InlineSwatch.Type.Bezier?this._value=_.data.bezier:this._type===WebInspector.InlineSwatch.Type.Spring&&(this._value=_.data.spring),this._updateSwatch()}_handleContextMenuEvent(_){if(this._value){let S=WebInspector.ContextMenu.createFromEvent(_);this._value.isKeyword()&&this._value.format!==WebInspector.Color.Format.Keyword&&S.appendItem(WebInspector.UIString("Format: Keyword"),()=>{this._value.format=WebInspector.Color.Format.Keyword,this._updateSwatch()});let C=this._getNextValidHEXFormat();C&&S.appendItem(C.title,()=>{this._value.format=C.format,this._updateSwatch()}),this._value.simple&&this._value.format!==WebInspector.Color.Format.HSL?S.appendItem(WebInspector.UIString("Format: HSL"),()=>{this._value.format=WebInspector.Color.Format.HSL,this._updateSwatch()}):this._value.format!==WebInspector.Color.Format.HSLA&&S.appendItem(WebInspector.UIString("Format: HSLA"),()=>{this._value.format=WebInspector.Color.Format.HSLA,this._updateSwatch()}),this._value.simple&&this._value.format!==WebInspector.Color.Format.RGB?S.appendItem(WebInspector.UIString("Format: RGB"),()=>{this._value.format=WebInspector.Color.Format.RGB,this._updateSwatch()}):this._value.format!==WebInspector.Color.Format.RGBA&&S.appendItem(WebInspector.UIString("Format: RGBA"),()=>{this._value.format=WebInspector.Color.Format.RGBA,this._updateSwatch()})}}_getNextValidHEXFormat(){function _(f){let T=f.format===WebInspector.Color.Format.ShortHEX||f.format===WebInspector.Color.Format.HEX;if(T&&!this._value.simple)return!1;let E=f.format===WebInspector.Color.Format.ShortHEX||f.format===WebInspector.Color.Format.ShortHEXAlpha;return E&&!this._value.canBeSerializedAsShortHEX()?!1:!0}if(this._type!==WebInspector.InlineSwatch.Type.Color)return!1;const S=[{format:WebInspector.Color.Format.ShortHEX,title:WebInspector.UIString("Format: Short Hex")},{format:WebInspector.Color.Format.ShortHEXAlpha,title:WebInspector.UIString("Format: Short Hex with Alpha")},{format:WebInspector.Color.Format.HEX,title:WebInspector.UIString("Format: Hex")},{format:WebInspector.Color.Format.HEXAlpha,title:WebInspector.UIString("Format: Hex with Alpha")}];let C=S.some(f=>f.format===this._value.format);for(let f=0;f{isEnterKey(f)&&(this._result=WebInspector.InputPopover.Result.Committed,this._value=f.target.value,this.dismiss())}),C.appendChild(this._inputElement),this.content=C,this._presentOverTargetElement()}_presentOverTargetElement(){if(this._targetElement){let _=WebInspector.Rect.rectFromClientRect(this._targetElement.getBoundingClientRect());this.present(_,this._preferredEdges),this._inputElement.select()}}},WebInspector.InputPopover.Result={None:Symbol("result-none"),Cancelled:Symbol("result-cancelled"),Committed:Symbol("result-committed")},WebInspector.IssueTreeElement=class extends WebInspector.GeneralTreeElement{constructor(_){var S;switch(_.level){case"error":S=WebInspector.IssueTreeElement.ErrorStyleClassName;break;case"warning":S=WebInspector.IssueTreeElement.WarningStyleClassName;}super([WebInspector.IssueTreeElement.StyleClassName,S],null,null,_,!1),this._issueMessage=_,this._updateTitles(),this._issueMessage.addEventListener(WebInspector.IssueMessage.Event.DisplayLocationDidChange,this._updateTitles,this)}get issueMessage(){return this._issueMessage}_updateTitles(){var _=this._issueMessage.sourceCodeLocation.displayLineNumber,S=this._issueMessage.sourceCodeLocation.displayColumnNumber,C;C=0{this._unfilteredChildLayers=S,this._updateDisplayWithLayers(_,S)})}sizeDidChange(){super.sizeDidChange(),this._childLayersRow.sizeDidChange()}_layerTreeDidChange(){this.needsLayout()}_showShadowDOMSettingChanged(){this.selected&&this._updateDisplayWithLayers(this._layerForNode,this._unfilteredChildLayers)}_buildLayerInfoSection(){var _=this._layerInfoRows={},S=[];S.push(_.Width=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Width"))),S.push(_.Height=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Height"))),S.push(_.Paints=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Paints"))),S.push(_.Memory=new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Memory"))),this._layerInfoGroup=new WebInspector.DetailsSectionGroup(S);var C=new WebInspector.DetailsSectionRow(WebInspector.UIString("No Layer Available"));C.showEmptyMessage(),this._noLayerInformationGroup=new WebInspector.DetailsSectionGroup([C]),this._layerInfoSection=new WebInspector.DetailsSection("layer-info",WebInspector.UIString("Layer Info"),[this._noLayerInformationGroup]),this.contentView.element.appendChild(this._layerInfoSection.element)}_buildDataGridSection(){var _={name:{},paintCount:{},memory:{}};_.name.title=WebInspector.UIString("Node"),_.name.sortable=!1,_.paintCount.title=WebInspector.UIString("Paints"),_.paintCount.sortable=!0,_.paintCount.aligned="right",_.paintCount.width="50px",_.memory.title=WebInspector.UIString("Memory"),_.memory.sortable=!0,_.memory.aligned="right",_.memory.width="70px",this._dataGrid=new WebInspector.DataGrid(_),this._dataGrid.inline=!0,this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged,this._sortDataGrid,this),this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged,this._selectedDataGridNodeChanged,this),this._dataGrid.sortColumnIdentifier="memory",this._dataGrid.sortOrder=WebInspector.DataGrid.SortOrder.Descending,this._dataGrid.createSettings("layer-tree-details-sidebar-panel");var S=this._dataGrid.element;S.addEventListener("focus",this._dataGridGainedFocus.bind(this),!1),S.addEventListener("blur",this._dataGridLostFocus.bind(this),!1),S.addEventListener("click",this._dataGridWasClicked.bind(this),!1),this._childLayersRow=new WebInspector.DetailsSectionDataGridRow(null,WebInspector.UIString("No Child Layers"));var C=new WebInspector.DetailsSectionGroup([this._childLayersRow]),f=new WebInspector.DetailsSection("layer-children",WebInspector.UIString("Child Layers"),[C],null,!0);this.contentView.element.appendChild(f.element)}_buildBottomBar(){var _=this.element.appendChild(document.createElement("div"));_.className="bottom-bar",this._layersCountLabel=_.appendChild(document.createElement("div")),this._layersCountLabel.className="layers-count-label",this._layersMemoryLabel=_.appendChild(document.createElement("div")),this._layersMemoryLabel.className="layers-memory-label"}_sortDataGrid(){var S=this._dataGrid.sortColumnIdentifier;this._dataGrid.sortNodes(function(C,f){var T=C.layer[S]||0,E=f.layer[S]||0;return T-E}),this._updatePopoverForSelectedNode()}_selectedDataGridNodeChanged(){this._dataGrid.selectedNode?(this._highlightSelectedNode(),this._showPopoverForSelectedNode()):(WebInspector.domTreeManager.hideDOMNodeHighlight(),this._hidePopover())}_dataGridGainedFocus(){this._highlightSelectedNode(),this._showPopoverForSelectedNode()}_dataGridLostFocus(){WebInspector.domTreeManager.hideDOMNodeHighlight(),this._hidePopover()}_dataGridWasClicked(_){this._dataGrid.selectedNode&&_.target.parentNode.classList.contains("filler")&&this._dataGrid.selectedNode.deselect()}_highlightSelectedNode(){var _=this._dataGrid.selectedNode;if(_){var S=_.layer;S.isGeneratedContent||S.isReflection||S.isAnonymous?WebInspector.domTreeManager.highlightRect(S.bounds,!0):WebInspector.domTreeManager.highlightDOMNode(S.nodeId)}}_updateDisplayWithLayers(_,S){WebInspector.showShadowDOMSetting.value||(S=S.filter(function(C){return!C.isInShadowTree})),this._updateLayerInfoSection(_),this._updateDataGrid(_,S),this._updateMetrics(_,S),this._layerForNode=_,this._childLayers=S}_updateLayerInfoSection(_){this._layerInfoSection.groups=_?[this._layerInfoGroup]:[this._noLayerInformationGroup];_&&(this._layerInfoRows.Memory.value=Number.bytesToString(_.memory),this._layerInfoRows.Width.value=_.compositedBounds.width+"px",this._layerInfoRows.Height.value=_.compositedBounds.height+"px",this._layerInfoRows.Paints.value=_.paintCount+"")}_updateDataGrid(_,S){let C=this._dataGrid,f=WebInspector.layerTreeManager.layerTreeMutations(this._childLayers,S);f.removals.forEach(function(T){let E=this._dataGridNodesByLayerId.get(T.layerId);E&&(C.removeChild(E),this._dataGridNodesByLayerId.delete(T.layerId))},this),f.additions.forEach(function(T){let E=this._dataGridNodeForLayer(T);E&&C.appendChild(E)},this),f.preserved.forEach(function(T){let E=this._dataGridNodesByLayerId.get(T.layerId);E&&(E.layer=T)},this),this._sortDataGrid(),this._childLayersRow.dataGrid=isEmptyObject(S)?null:this._dataGrid}_dataGridNodeForLayer(_){let S=new WebInspector.LayerTreeDataGridNode(_);return this._dataGridNodesByLayerId.set(_.layerId,S),S}_updateMetrics(_,S){var C=0,f=0;_&&(C++,f+=_.memory||0),S.forEach(function(T){C++,f+=T.memory||0}),this._layersCountLabel.textContent=WebInspector.UIString("Layer Count: %d").format(C),this._layersMemoryLabel.textContent=WebInspector.UIString("Memory: %s").format(Number.bytesToString(f))}_showPopoverForSelectedNode(){var _=this._dataGrid.selectedNode;_&&this._contentForPopover(_.layer,S=>{_===this._dataGrid.selectedNode&&this._updatePopoverForSelectedNode(S)})}_updatePopoverForSelectedNode(_){var S=this._dataGrid.selectedNode;if(S){var C=this._popover;C||(C=this._popover=new WebInspector.Popover,C.windowResizeHandler=()=>{this._updatePopoverForSelectedNode()});var f=WebInspector.Rect.rectFromClientRect(S.element.getBoundingClientRect());_&&(C.content=_),C.present(f.pad(2),[WebInspector.RectEdge.MIN_X])}}_hidePopover(){this._popover&&this._popover.dismiss()}_contentForPopover(_,S){var C=document.createElement("div");C.className="layer-tree-popover",C.appendChild(document.createElement("p")).textContent=WebInspector.UIString("Reasons for compositing:");var f=C.appendChild(document.createElement("ul"));return WebInspector.layerTreeManager.reasonsForCompositingLayer(_,T=>{return isEmptyObject(T)?void S(C):void(this._populateListOfCompositingReasons(f,T),S(C))}),C}_populateListOfCompositingReasons(_,S){function C(f){_.appendChild(document.createElement("li")).textContent=f}S.transform3D&&C(WebInspector.UIString("Element has a 3D transform")),S.video&&C(WebInspector.UIString("Element is