UUU\UUjUUUUz!UOf"U"UVR'Uǿ(Ul*Uɶ,U.-VEG-VS-V`-V'a-Vu-VR-Vԙ-Vq-V- V2- V;- V . VC. VR.Vc.V0p.V.V.V.V.V.V/V!/V0/VC/V[/V!d/Vr/V*/V/Vp/VQ/ Vu/!V/"V/#Vu/$V/%V/&V/'V_/(VJ/)V /*Ve/+V/,V/-VS/.VF//Vs/0V/1V&/2V03VZ04V05V06Vk07V08V]09V0:V0;V>0V<0?V0@V0AV!0BV#0CVN%0DV'0EV*0FV.0GV/0HVY60IV;0JVq@0KVZB0LV2C0MVC0NV2D0OVD0PVD0QVH0RVL0SV%M0TV8P0UV_Q0VVQ0WVLW0XVW0YVX0ZV>Y0[VnZ0\VB[0]V\0^V#]0_V]0`V^0aV^0bV _0cV_0dVdc0eVe0fV i0gVo0hV%|0iV0jV50kV0lVR0mV0nV0oVJ0pVW0qVW0rVe0sVq1tVp1uVs1vV\1wV 1xV 1yV1zV1{V1|V1}V1~Vj1V1V=!1V#1V&1Vz(1V^)1V5+1,1
Object.isEmpty=function(obj) {for(var i in obj) return false;return true;} Object.values=function(obj) {var result=Object.keys(obj);var length=result.length;for(var i=0;i/g,">").replace(/"/g,""");} String.prototype.collapseWhitespace=function() {return this.replace(/[\s\xA0]+/g," ");} String.prototype.trimMiddle=function(maxLength) {if(this.length<=maxLength) return String(this);var leftHalf=maxLength>>1;var rightHalf=maxLength-leftHalf-1;return this.substr(0,leftHalf)+"\u2026"+this.substr(this.length-rightHalf,rightHalf);} String.prototype.trimEnd=function(maxLength) {if(this.length<=maxLength) return String(this);return this.substr(0,maxLength-1)+"\u2026";} String.prototype.trimURL=function(baseURLDomain) {var result=this.replace(/^(https|http|file):\/\//i,"");if(baseURLDomain) result=result.replace(new RegExp("^"+baseURLDomain.escapeForRegExp(),"i"),"");return result;} String.prototype.toTitleCase=function() {return this.substring(0,1).toUpperCase()+this.substring(1);} String.prototype.compareTo=function(other) {if(this>other) return 1;if(thismax) num=max;return num;} Number.gcd=function(a,b) {if(b===0) return a;else return Number.gcd(b,a%b);} Number.toFixedIfFloating=function(value) {if(!value||isNaN(value)) return value;var number=Number(value);return number%1?number.toFixed(3):String(number);} Date.prototype.toISO8601Compact=function() {function leadZero(x) {return(x>9?"":"0")+x;} return this.getFullYear()+ leadZero(this.getMonth()+1)+ leadZero(this.getDate())+"T"+ leadZero(this.getHours())+ leadZero(this.getMinutes())+ leadZero(this.getSeconds());} Object.defineProperty(Array.prototype,"remove",{value:function(value,onlyFirst) {if(onlyFirst){var index=this.indexOf(value);if(index!==-1) this.splice(index,1);return;} var length=this.length;for(var i=0;i=rightBound) this.sort(comparator);else quickSortRange(this,comparator,leftBound,rightBound,sortWindowLeft,sortWindowRight);return this;}} Object.defineProperty(Array.prototype,"sortRange",sortRange);Object.defineProperty(Uint32Array.prototype,"sortRange",sortRange);})();Object.defineProperty(Array.prototype,"qselect",{value:function(k,comparator) {if(k<0||k>=this.length) return;if(!comparator) comparator=function(a,b){return a-b;} var low=0;var high=this.length-1;for(;;){var pivotPosition=this.partition(comparator,low,high,Math.floor((high+low)/2));if(pivotPosition===k) return this[k];else if(pivotPosition>k) high=pivotPosition-1;else low=pivotPosition+1;}}});Object.defineProperty(Array.prototype,"lowerBound",{value:function(object,comparator) {function defaultComparator(a,b) {return ab?1:0);} comparator=comparator||defaultComparator;var l=0;var r=this.length;while(l>1;if(comparator(object,this[m])>0) l=m+1;else r=m;} return r;}});Object.defineProperty(Array.prototype,"upperBound",{value:function(object,comparator) {function defaultComparator(a,b) {return ab?1:0);} comparator=comparator||defaultComparator;var l=0;var r=this.length;while(l>1;if(comparator(object,this[m])>=0) l=m+1;else r=m;} return r;}});Object.defineProperty(Array.prototype,"binaryIndexOf",{value:function(value,comparator) {var index=this.lowerBound(value,comparator);return index0&&format[index]==="$"){substitutionIndex=(number-1);++index;}} var precision=-1;if(format[index]==="."){++index;precision=parseInt(format.substring(index),10);if(isNaN(precision)) precision=0;while(isDigit(format[index])) ++index;} if(!(format[index]in formatters)){addStringToken(format.substring(precentIndex,index+1));++index;continue;} addSpecifierToken(format[index],precision,substitutionIndex);++substitutionIndex;++index;} addStringToken(format.substring(index));return tokens;} String.standardFormatters={d:function(substitution) {return!isNaN(substitution)?substitution:0;},f:function(substitution,token) {if(substitution&&token.precision>-1) substitution=substitution.toFixed(token.precision);return!isNaN(substitution)?substitution:(token.precision>-1?Number(0).toFixed(token.precision):0);},s:function(substitution) {return substitution;}} String.vsprintf=function(format,substitutions) {return String.format(format,substitutions,String.standardFormatters,"",function(a,b){return a+b;}).formattedResult;} String.format=function(format,substitutions,formatters,initialValue,append) {if(!format||!substitutions||!substitutions.length) return{formattedResult:append(initialValue,format),unusedSubstitutions:substitutions};function prettyFunctionName() {return"String.format(\""+format+"\", \""+substitutions.join("\", \"")+"\")";} function warn(msg) {console.warn(prettyFunctionName()+": "+msg);} function error(msg) {console.error(prettyFunctionName()+": "+msg);} var result=initialValue;var tokens=String.tokenizeFormatString(format,formatters);var usedSubstitutionIndexes={};for(var i=0;i=substitutions.length){error("not enough substitution arguments. Had "+substitutions.length+" but needed "+(token.substitutionIndex+1)+", so substitution was skipped.");result=append(result,"%"+(token.precision>-1?token.precision:"")+token.specifier);continue;} usedSubstitutionIndexes[token.substitutionIndex]=true;if(!(token.specifier in formatters)){warn("unsupported format character \u201C"+token.specifier+"\u201D. Treating as a string.");result=append(result,substitutions[token.substitutionIndex]);continue;} result=append(result,formatters[token.specifier](substitutions[token.substitutionIndex],token));} var unusedSubstitutions=[];for(var i=0;i0) ++result;text=text.substring(match.index+1);} return result;} function numberToStringWithSpacesPadding(value,symbolsCount) {var numberString=value.toString();var paddingLength=Math.max(0,symbolsCount-numberString.length);var paddingString=Array(paddingLength+1).join("\u00a0");return paddingString+numberString;} var createObjectIdentifier=function() {return"_"+ ++createObjectIdentifier._last;} createObjectIdentifier._last=0;var Set=function() {this._set={};this._size=0;} Set.prototype={add:function(item) {var objectIdentifier=item.__identifier;if(!objectIdentifier){objectIdentifier=createObjectIdentifier();item.__identifier=objectIdentifier;} if(!this._set[objectIdentifier]) ++this._size;this._set[objectIdentifier]=item;},remove:function(item) {if(this._set[item.__identifier]){--this._size;delete this._set[item.__identifier];return true;} return false;},items:function() {var result=new Array(this._size);var i=0;for(var objectIdentifier in this._set) result[i++]=this._set[objectIdentifier];return result;},hasItem:function(item) {return!!this._set[item.__identifier];},size:function() {return this._size;},clear:function() {this._set={};this._size=0;}} var Map=function() {this._map={};this._size=0;} Map.prototype={put:function(key,value) {var objectIdentifier=key.__identifier;if(!objectIdentifier){objectIdentifier=createObjectIdentifier();key.__identifier=objectIdentifier;} if(!this._map[objectIdentifier]) ++this._size;this._map[objectIdentifier]=[key,value];},remove:function(key) {var result=this._map[key.__identifier];if(!result) return undefined;--this._size;delete this._map[key.__identifier];return result[1];},keys:function() {return this._list(0);},values:function() {return this._list(1);},_list:function(index) {var result=new Array(this._size);var i=0;for(var objectIdentifier in this._map) result[i++]=this._map[objectIdentifier][index];return result;},get:function(key) {var entry=this._map[key.__identifier];return entry?entry[1]:undefined;},contains:function(key) {var entry=this._map[key.__identifier];return!!entry;},size:function() {return this._size;},clear:function() {this._map={};this._size=0;}} var StringMap=function() {this._map={};this._size=0;} StringMap.prototype={put:function(key,value) {if(key==="__proto__"){if(!this._hasProtoKey){++this._size;this._hasProtoKey=true;} this._protoValue=value;return;} if(!Object.prototype.hasOwnProperty.call(this._map,key)) ++this._size;this._map[key]=value;},remove:function(key) {var result;if(key==="__proto__"){if(!this._hasProtoKey) return undefined;--this._size;delete this._hasProtoKey;result=this._protoValue;delete this._protoValue;return result;} if(!Object.prototype.hasOwnProperty.call(this._map,key)) return undefined;--this._size;result=this._map[key];delete this._map[key];return result;},keys:function() {var result=Object.keys(this._map)||[];if(this._hasProtoKey) result.push("__proto__");return result;},values:function() {var result=Object.values(this._map);if(this._hasProtoKey) result.push(this._protoValue);return result;},get:function(key) {if(key==="__proto__") return this._protoValue;if(!Object.prototype.hasOwnProperty.call(this._map,key)) return undefined;return this._map[key];},contains:function(key) {var result;if(key==="__proto__") return this._hasProtoKey;return Object.prototype.hasOwnProperty.call(this._map,key);},size:function() {return this._size;},clear:function() {this._map={};this._size=0;delete this._hasProtoKey;delete this._protoValue;}} function loadXHR(url,async,callback) {function onReadyStateChanged() {if(xhr.readyState!==XMLHttpRequest.DONE) return;if(xhr.status===200){callback(xhr.responseText);return;} callback(null);} var xhr=new XMLHttpRequest();xhr.open("GET",url,async);if(async) xhr.onreadystatechange=onReadyStateChanged;xhr.send(null);if(!async){if(xhr.status===200) return xhr.responseText;return null;} return null;} function StringPool() {this.reset();} StringPool.prototype={intern:function(string) {if(string==="__proto__") return"__proto__";var result=this._strings[string];if(result===undefined){this._strings[string]=string;result=string;} return result;},reset:function() {this._strings=Object.create(null);},internObjectStrings:function(obj,depthLimit) {if(typeof depthLimit!=="number") depthLimit=100;else if(--depthLimit<0) throw"recursion depth limit reached in StringPool.deepIntern(), perhaps attempting to traverse cyclical references?";for(var field in obj){switch(typeof obj[field]){case"string":obj[field]=this.intern(obj[field]);break;case"object":this.internObjectStrings(obj[field],depthLimit);break;}}}} var _importedScripts={};function importScript(scriptName) {if(_importedScripts[scriptName]) return;var xhr=new XMLHttpRequest();_importedScripts[scriptName]=true;xhr.open("GET",scriptName,false);xhr.send(null);if(!xhr.responseText) throw"empty response arrived for script '"+scriptName+"'";var sourceURL=WebInspector.ParsedURL.completeURL(window.location.href,scriptName);window.eval(xhr.responseText+"\n//# sourceURL="+sourceURL);} var loadScript=importScript;function CallbackBarrier() {this._pendingIncomingCallbacksCount=0;} CallbackBarrier.prototype={createCallback:function(userCallback) {console.assert(!this._outgoingCallback,"CallbackBarrier.createCallback() is called after CallbackBarrier.callWhenDone()");++this._pendingIncomingCallbacksCount;return this._incomingCallback.bind(this,userCallback);},callWhenDone:function(callback) {console.assert(!this._outgoingCallback,"CallbackBarrier.callWhenDone() is called multiple times");this._outgoingCallback=callback;if(!this._pendingIncomingCallbacksCount) this._outgoingCallback();},_incomingCallback:function(userCallback) {console.assert(this._pendingIncomingCallbacksCount>0);if(userCallback){var args=Array.prototype.slice.call(arguments,1);userCallback.apply(null,args);} if(!--this._pendingIncomingCallbacksCount&&this._outgoingCallback) this._outgoingCallback();}} __whitespace={" ":true,"\t":true,"\n":true,"\f":true,"\r":true};difflib={defaultJunkFunction:function(c){return __whitespace.hasOwnProperty(c);},stripLinebreaks:function(str){return str.replace(/^[\n\r]*|[\n\r]*$/g,"");},stringAsLines:function(str){var lfpos=str.indexOf("\n");var crpos=str.indexOf("\r");var linebreak=((lfpos>-1&&crpos>-1)||crpos<0)?"\n":"\r";var lines=str.split(linebreak);for(var i=0;ib[i])return 1;} return a.length==b.length?0:(a.length=200&&indices.length*100>n){populardict[elt]=1;delete b2j[elt];}else{indices.push(i);}}else{b2j[elt]=[i];}} for(var elt in populardict){if(populardict.hasOwnProperty(elt)){delete b2j[elt];}} var isjunk=this.isjunk;var junkdict={};if(isjunk){for(var elt in populardict){if(populardict.hasOwnProperty(elt)&&isjunk(elt)){junkdict[elt]=1;delete populardict[elt];}} for(var elt in b2j){if(b2j.hasOwnProperty(elt)&&isjunk(elt)){junkdict[elt]=1;delete b2j[elt];}}} this.isbjunk=difflib.__isindict(junkdict);this.isbpopular=difflib.__isindict(populardict);} this.find_longest_match=function(alo,ahi,blo,bhi){var a=this.a;var b=this.b;var b2j=this.b2j;var isbjunk=this.isbjunk;var besti=alo;var bestj=blo;var bestsize=0;var j=null;var j2len={};var nothing=[];for(var i=alo;i=bhi)break;newj2len[j]=k=difflib.__dictget(j2len,j-1,0)+1;if(k>bestsize){besti=i-k+1;bestj=j-k+1;bestsize=k;}}} j2len=newj2len;} while(besti>alo&&bestj>blo&&!isbjunk(b[bestj-1])&&a[besti-1]==b[bestj-1]){besti--;bestj--;bestsize++;} while(besti+bestsizealo&&bestj>blo&&isbjunk(b[bestj-1])&&a[besti-1]==b[bestj-1]){besti--;bestj--;bestsize++;} while(besti+bestsizenn){groups.push([tag,i1,Math.min(i2,i1+n),j1,Math.min(j2,j1+n)]);i1=Math.max(i1,i2-n);j1=Math.max(j1,j2-n);} groups.push([tag,i1,i2,j1,j2]);}} if(groups&&groups[groups.length-1][0]=='equal')groups.pop();return groups;} this.ratio=function(){matches=difflib.__reduce(function(sum,triple){return sum+triple[triple.length-1];},this.get_matching_blocks(),0);return difflib.__calculate_ratio(matches,this.a.length+this.b.length);} this.quick_ratio=function(){var fullbcount,elt;if(this.fullbcount==null){this.fullbcount=fullbcount={};for(var i=0;i0)matches++;} return difflib.__calculate_ratio(matches,this.a.length+this.b.length);} this.real_quick_ratio=function(){var la=this.a.length;var lb=this.b.length;return _calculate_ratio(Math.min(la,lb),la+lb);} this.isjunk=isjunk?isjunk:difflib.defaultJunkFunction;this.a=this.b=null;this.set_seqs(a,b);}} Node.prototype.rangeOfWord=function(offset,stopCharacters,stayWithinNode,direction) {var startNode;var startOffset=0;var endNode;var endOffset=0;if(!stayWithinNode) stayWithinNode=this;if(!direction||direction==="backward"||direction==="both"){var node=this;while(node){if(node===stayWithinNode){if(!startNode) startNode=stayWithinNode;break;} if(node.nodeType===Node.TEXT_NODE){var start=(node===this?(offset-1):(node.nodeValue.length-1));for(var i=start;i>=0;--i){if(stopCharacters.indexOf(node.nodeValue[i])!==-1){startNode=node;startOffset=i+1;break;}}} if(startNode) break;node=node.traversePreviousNode(stayWithinNode);} if(!startNode){startNode=stayWithinNode;startOffset=0;}}else{startNode=this;startOffset=offset;} if(!direction||direction==="forward"||direction==="both"){node=this;while(node){if(node===stayWithinNode){if(!endNode) endNode=stayWithinNode;break;} if(node.nodeType===Node.TEXT_NODE){var start=(node===this?offset:0);for(var i=start;inode.nodeValue.length){offset-=node.nodeValue.length;node=node.traverseNextTextNode(this);} if(!node) return{container:this,offset:0};return{container:node,offset:offset};} Element.prototype.removeStyleClass=function(className) {this.classList.remove(className);} Element.prototype.removeMatchingStyleClasses=function(classNameRegex) {var regex=new RegExp("(^|\\s+)"+classNameRegex+"($|\\s+)");if(regex.test(this.className)) this.className=this.className.replace(regex," ");} Element.prototype.addStyleClass=function(className) {this.classList.add(className);} Element.prototype.hasStyleClass=function(className) {return this.classList.contains(className);} Element.prototype.enableStyleClass=function(className,enable) {if(enable) this.addStyleClass(className);else this.removeStyleClass(className);} Element.prototype.positionAt=function(x,y) {if(typeof x==="number") this.style.setProperty("left",x+"px");else this.style.removeProperty("left");if(typeof y==="number") this.style.setProperty("top",y+"px");else this.style.removeProperty("top");} Element.prototype.isScrolledToBottom=function() {return this.scrollTop+this.clientHeight===this.scrollHeight;} function removeSubsequentNodes(fromNode,toNode) {for(var node=fromNode;node&&node!==toNode;){var nodeToRemove=node;node=node.nextSibling;nodeToRemove.remove();}} function Size(width,height) {this.width=width;this.height=height;} Element.prototype.measurePreferredSize=function(containerElement) {containerElement=containerElement||document.body;containerElement.appendChild(this);this.positionAt(0,0);var result=new Size(this.offsetWidth,this.offsetHeight);this.positionAt(undefined,undefined);this.remove();return result;} Node.prototype.enclosingNodeOrSelfWithNodeNameInArray=function(nameArray) {for(var node=this;node&&node!==this.ownerDocument;node=node.parentNode) for(var i=0;i0?this.children[index-1]:null);if(previousChild){previousChild.nextSibling=child;child.previousSibling=previousChild;}else{child.previousSibling=null;} var nextChild=this.children[index];if(nextChild){nextChild.previousSibling=child;child.nextSibling=nextChild;}else{child.nextSibling=null;} this.children.splice(index,0,child);this.hasChildren=true;child.parent=this;child.treeOutline=this.treeOutline;child.treeOutline._rememberTreeElement(child);var current=child.children[0];while(current){current.treeOutline=this.treeOutline;current.treeOutline._rememberTreeElement(current);current=current.traverseNextTreeElement(false,child,true);} if(child.hasChildren&&typeof(child.treeOutline._expandedStateMap.get(child.representedObject))!=="undefined") child.expanded=child.treeOutline._expandedStateMap.get(child.representedObject);if(!this._childrenListNode){this._childrenListNode=this.treeOutline._childrenListNode.ownerDocument.createElement("ol");this._childrenListNode.parentTreeElement=this;this._childrenListNode.classList.add("children");if(this.hidden) this._childrenListNode.classList.add("hidden");} child._attach();} TreeOutline.prototype.removeChildAtIndex=function(childIndex) {if(childIndex<0||childIndex>=this.children.length) throw("childIndex out of range");var child=this.children[childIndex];this.children.splice(childIndex,1);var parent=child.parent;if(child.deselect()){if(child.previousSibling) child.previousSibling.select();else if(child.nextSibling) child.nextSibling.select();else parent.select();} if(child.previousSibling) child.previousSibling.nextSibling=child.nextSibling;if(child.nextSibling) child.nextSibling.previousSibling=child.previousSibling;if(child.treeOutline){child.treeOutline._forgetTreeElement(child);child.treeOutline._forgetChildrenRecursive(child);} child._detach();child.treeOutline=null;child.parent=null;child.nextSibling=null;child.previousSibling=null;} TreeOutline.prototype.removeChild=function(child) {if(!child) throw("child can't be undefined or null");var childIndex=this.children.indexOf(child);if(childIndex===-1) throw("child not found in this node's children");this.removeChildAtIndex.call(this,childIndex);} TreeOutline.prototype.removeChildren=function() {for(var i=0;i=0;--i){var treeElement=this.getCachedTreeElement(ancestors[i]);if(treeElement) treeElement.onpopulate();} return this.getCachedTreeElement(representedObject);} TreeOutline.prototype.treeElementFromPoint=function(x,y) {var node=this._childrenListNode.ownerDocument.elementFromPoint(x,y);if(!node) return null;var listNode=node.enclosingNodeOrSelfWithNodeNameInArray(["ol","li"]);if(listNode) return listNode.parentTreeElement||listNode.treeElement;return null;} TreeOutline.prototype._treeKeyDown=function(event) {if(event.target!==this._childrenListNode) return;if(!this.selectedTreeElement||event.shiftKey||event.metaKey||event.ctrlKey) return;var handled=false;var nextSelectedElement;if(event.keyIdentifier==="Up"&&!event.altKey){nextSelectedElement=this.selectedTreeElement.traversePreviousTreeElement(true);while(nextSelectedElement&&!nextSelectedElement.selectable) nextSelectedElement=nextSelectedElement.traversePreviousTreeElement(!this.expandTreeElementsWhenArrowing);handled=nextSelectedElement?true:false;}else if(event.keyIdentifier==="Down"&&!event.altKey){nextSelectedElement=this.selectedTreeElement.traverseNextTreeElement(true);while(nextSelectedElement&&!nextSelectedElement.selectable) nextSelectedElement=nextSelectedElement.traverseNextTreeElement(!this.expandTreeElementsWhenArrowing);handled=nextSelectedElement?true:false;}else if(event.keyIdentifier==="Left"){if(this.selectedTreeElement.expanded){if(event.altKey) this.selectedTreeElement.collapseRecursively();else this.selectedTreeElement.collapse();handled=true;}else if(this.selectedTreeElement.parent&&!this.selectedTreeElement.parent.root){handled=true;if(this.selectedTreeElement.parent.selectable){nextSelectedElement=this.selectedTreeElement.parent;while(nextSelectedElement&&!nextSelectedElement.selectable) nextSelectedElement=nextSelectedElement.parent;handled=nextSelectedElement?true:false;}else if(this.selectedTreeElement.parent) this.selectedTreeElement.parent.collapse();}}else if(event.keyIdentifier==="Right"){if(!this.selectedTreeElement.revealed()){this.selectedTreeElement.reveal();handled=true;}else if(this.selectedTreeElement.hasChildren){handled=true;if(this.selectedTreeElement.expanded){nextSelectedElement=this.selectedTreeElement.children[0];while(nextSelectedElement&&!nextSelectedElement.selectable) nextSelectedElement=nextSelectedElement.nextSibling;handled=nextSelectedElement?true:false;}else{if(event.altKey) this.selectedTreeElement.expandRecursively();else this.selectedTreeElement.expand();}}}else if(event.keyCode===8||event.keyCode===46) handled=this.selectedTreeElement.ondelete();else if(isEnterKey(event)) handled=this.selectedTreeElement.onenter();else if(event.keyCode===WebInspector.KeyboardShortcut.Keys.Space.code) handled=this.selectedTreeElement.onspace();if(nextSelectedElement){nextSelectedElement.reveal();nextSelectedElement.select(false,true);} if(handled) event.consume(true);} TreeOutline.prototype.expand=function() {} TreeOutline.prototype.collapse=function() {} TreeOutline.prototype.revealed=function() {return true;} TreeOutline.prototype.reveal=function() {} TreeOutline.prototype.select=function() {} TreeOutline.prototype.revealAndSelect=function(omitFocus) {} function TreeElement(title,representedObject,hasChildren) {this._title=title;this.representedObject=(representedObject||{});this._hidden=false;this._selectable=true;this.expanded=false;this.selected=false;this.hasChildren=hasChildren;this.children=[];this.treeOutline=null;this.parent=null;this.previousSibling=null;this.nextSibling=null;this._listItemNode=null;} TreeElement.prototype={arrowToggleWidth:10,get selectable(){if(this._hidden) return false;return this._selectable;},set selectable(x){this._selectable=x;},get listItemElement(){return this._listItemNode;},get childrenListElement(){return this._childrenListNode;},get title(){return this._title;},set title(x){this._title=x;this._setListItemNodeContent();},get tooltip(){return this._tooltip;},set tooltip(x){this._tooltip=x;if(this._listItemNode) this._listItemNode.title=x?x:"";},get hasChildren(){return this._hasChildren;},set hasChildren(x){if(this._hasChildren===x) return;this._hasChildren=x;if(!this._listItemNode) return;if(x) this._listItemNode.classList.add("parent");else{this._listItemNode.classList.remove("parent");this.collapse();}},get hidden(){return this._hidden;},set hidden(x){if(this._hidden===x) return;this._hidden=x;if(x){if(this._listItemNode) this._listItemNode.classList.add("hidden");if(this._childrenListNode) this._childrenListNode.classList.add("hidden");}else{if(this._listItemNode) this._listItemNode.classList.remove("hidden");if(this._childrenListNode) this._childrenListNode.classList.remove("hidden");}},get shouldRefreshChildren(){return this._shouldRefreshChildren;},set shouldRefreshChildren(x){this._shouldRefreshChildren=x;if(x&&this.expanded) this.expand();},_setListItemNodeContent:function() {if(!this._listItemNode) return;if(typeof this._title==="string") this._listItemNode.textContent=this._title;else{this._listItemNode.removeChildren();if(this._title) this._listItemNode.appendChild(this._title);}}} TreeElement.prototype.appendChild=TreeOutline.prototype.appendChild;TreeElement.prototype.insertChild=TreeOutline.prototype.insertChild;TreeElement.prototype.insertBeforeChild=TreeOutline.prototype.insertBeforeChild;TreeElement.prototype.removeChild=TreeOutline.prototype.removeChild;TreeElement.prototype.removeChildAtIndex=TreeOutline.prototype.removeChildAtIndex;TreeElement.prototype.removeChildren=TreeOutline.prototype.removeChildren;TreeElement.prototype._attach=function() {if(!this._listItemNode||this.parent._shouldRefreshChildren){if(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:"";if(this.hidden) this._listItemNode.classList.add("hidden");if(this.hasChildren) this._listItemNode.classList.add("parent");if(this.expanded) this._listItemNode.classList.add("expanded");if(this.selected) this._listItemNode.classList.add("selected");this._listItemNode.addEventListener("mousedown",TreeElement.treeElementMouseDown,false);this._listItemNode.addEventListener("click",TreeElement.treeElementToggled,false);this._listItemNode.addEventListener("dblclick",TreeElement.treeElementDoubleClicked,false);this.onattach();} var nextSibling=null;if(this.nextSibling&&this.nextSibling._listItemNode&&this.nextSibling._listItemNode.parentNode===this.parent._childrenListNode) nextSibling=this.nextSibling._listItemNode;this.parent._childrenListNode.insertBefore(this._listItemNode,nextSibling);if(this._childrenListNode) this.parent._childrenListNode.insertBefore(this._childrenListNode,this._listItemNode.nextSibling);if(this.selected) this.select();if(this.expanded) this.expand();} TreeElement.prototype._detach=function() {if(this._listItemNode&&this._listItemNode.parentNode) this._listItemNode.parentNode.removeChild(this._listItemNode);if(this._childrenListNode&&this._childrenListNode.parentNode) this._childrenListNode.parentNode.removeChild(this._childrenListNode);} TreeElement.treeElementMouseDown=function(event) {var element=event.currentTarget;if(!element||!element.treeElement||!element.treeElement.selectable) return;if(element.treeElement.isEventWithinDisclosureTriangle(event)) return;element.treeElement.selectOnMouseDown(event);} TreeElement.treeElementToggled=function(event) {var element=event.currentTarget;if(!element||!element.treeElement) return;var toggleOnClick=element.treeElement.toggleOnClick&&!element.treeElement.selectable;var isInTriangle=element.treeElement.isEventWithinDisclosureTriangle(event);if(!toggleOnClick&&!isInTriangle) return;if(element.treeElement.expanded){if(event.altKey) element.treeElement.collapseRecursively();else element.treeElement.collapse();}else{if(event.altKey) element.treeElement.expandRecursively();else element.treeElement.expand();} event.consume();} TreeElement.treeElementDoubleClicked=function(event) {var element=event.currentTarget;if(!element||!element.treeElement) return;var handled=element.treeElement.ondblclick.call(element.treeElement,event);if(handled) return;if(element.treeElement.hasChildren&&!element.treeElement.expanded) element.treeElement.expand();} TreeElement.prototype.collapse=function() {if(this._listItemNode) this._listItemNode.classList.remove("expanded");if(this._childrenListNode) this._childrenListNode.classList.remove("expanded");this.expanded=false;if(this.treeOutline) this.treeOutline._expandedStateMap.put(this.representedObject,false);this.oncollapse();} TreeElement.prototype.collapseRecursively=function() {var item=this;while(item){if(item.expanded) item.collapse();item=item.traverseNextTreeElement(false,this,true);}} TreeElement.prototype.expand=function() {if(!this.hasChildren||(this.expanded&&!this._shouldRefreshChildren&&this._childrenListNode)) return;this.expanded=true;if(this.treeOutline) this.treeOutline._expandedStateMap.put(this.representedObject,true);if(this.treeOutline&&(!this._childrenListNode||this._shouldRefreshChildren)){if(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");if(this.hidden) this._childrenListNode.classList.add("hidden");this.onpopulate();for(var i=0;i=maxDepth),info);depth+=info.depthChange;}} TreeElement.prototype.hasAncestor=function(ancestor){if(!ancestor) return false;var currentNode=this.parent;while(currentNode){if(ancestor===currentNode) return true;currentNode=currentNode.parent;} return false;} TreeElement.prototype.reveal=function() {var currentAncestor=this.parent;while(currentAncestor&&!currentAncestor.root){if(!currentAncestor.expanded) currentAncestor.expand();currentAncestor=currentAncestor.parent;} this.onreveal(this);} TreeElement.prototype.revealed=function() {var currentAncestor=this.parent;while(currentAncestor&&!currentAncestor.root){if(!currentAncestor.expanded) return false;currentAncestor=currentAncestor.parent;} return true;} TreeElement.prototype.selectOnMouseDown=function(event) {if(this.select(false,true)) event.consume(true);} TreeElement.prototype.select=function(omitFocus,selectedByUser) {if(!this.treeOutline||!this.selectable||this.selected) return false;if(this.treeOutline.selectedTreeElement) this.treeOutline.selectedTreeElement.deselect();this.selected=true;if(!omitFocus) this.treeOutline._childrenListNode.focus();if(!this.treeOutline) return false;this.treeOutline.selectedTreeElement=this;if(this._listItemNode) this._listItemNode.classList.add("selected");return this.onselect(selectedByUser);} TreeElement.prototype.revealAndSelect=function(omitFocus) {this.reveal();this.select(omitFocus);} TreeElement.prototype.deselect=function(supressOnDeselect) {if(!this.treeOutline||this.treeOutline.selectedTreeElement!==this||!this.selected) return false;this.selected=false;this.treeOutline.selectedTreeElement=null;if(this._listItemNode) this._listItemNode.classList.remove("selected");return true;} TreeElement.prototype.onpopulate=function(){} TreeElement.prototype.onenter=function(){} TreeElement.prototype.ondelete=function(){} TreeElement.prototype.onspace=function(){} TreeElement.prototype.onattach=function(){} TreeElement.prototype.onexpand=function(){} TreeElement.prototype.oncollapse=function(){} TreeElement.prototype.ondblclick=function(){} TreeElement.prototype.onreveal=function(){} TreeElement.prototype.onselect=function(selectedByUser){} TreeElement.prototype.traverseNextTreeElement=function(skipUnrevealed,stayWithin,dontPopulate,info) {if(!dontPopulate&&this.hasChildren) this.onpopulate();if(info) info.depthChange=0;var element=skipUnrevealed?(this.revealed()?this.children[0]:null):this.children[0];if(element&&(!skipUnrevealed||(skipUnrevealed&&this.expanded))){if(info) info.depthChange=1;return element;} if(this===stayWithin) return null;element=skipUnrevealed?(this.revealed()?this.nextSibling:null):this.nextSibling;if(element) return element;element=this;while(element&&!element.root&&!(skipUnrevealed?(element.revealed()?element.nextSibling:null):element.nextSibling)&&element.parent!==stayWithin){if(info) info.depthChange-=1;element=element.parent;} if(!element) return null;return(skipUnrevealed?(element.revealed()?element.nextSibling:null):element.nextSibling);} TreeElement.prototype.traversePreviousTreeElement=function(skipUnrevealed,dontPopulate) {var element=skipUnrevealed?(this.revealed()?this.previousSibling:null):this.previousSibling;if(!dontPopulate&&element&&element.hasChildren) element.onpopulate();while(element&&(skipUnrevealed?(element.revealed()&&element.expanded?element.children[element.children.length-1]:null):element.children[element.children.length-1])){if(!dontPopulate&&element.hasChildren) element.onpopulate();element=(skipUnrevealed?(element.revealed()&&element.expanded?element.children[element.children.length-1]:null):element.children[element.children.length-1]);} if(element) return element;if(!this.parent||this.parent.root) return null;return this.parent;} TreeElement.prototype.isEventWithinDisclosureTriangle=function(event) {var paddingLeftValue=window.getComputedStyle(this._listItemNode).getPropertyCSSValue("padding-left");var computedLeftPadding=paddingLeftValue?paddingLeftValue.getFloatValue(CSSPrimitiveValue.CSS_PX):0;var left=this._listItemNode.totalOffsetLeft()+computedLeftPadding;return event.pageX>=left&&event.pageX<=left+this.arrowToggleWidth&&this.hasChildren;} var WebInspector={_panelDescriptors:function() {this.panels={};WebInspector.inspectorView=new WebInspector.InspectorView();var parentElement=document.getElementById("main");WebInspector.inspectorView.show(parentElement);WebInspector.inspectorView.addEventListener(WebInspector.InspectorView.Events.PanelSelected,this._panelSelected,this);var elements=new WebInspector.ElementsPanelDescriptor();var resources=new WebInspector.PanelDescriptor("resources",WebInspector.UIString("Resources"),"ResourcesPanel","ResourcesPanel.js");var network=new WebInspector.NetworkPanelDescriptor();var sources=new WebInspector.SourcesPanelDescriptor();var timeline=new WebInspector.TimelinePanelDescriptor();var profiles=new WebInspector.ProfilesPanelDescriptor();var audits=new WebInspector.PanelDescriptor("audits",WebInspector.UIString("Audits"),"AuditsPanel","AuditsPanel.js");var console=new WebInspector.PanelDescriptor("console",WebInspector.UIString("Console"),"ConsolePanel");var allDescriptors=[elements,resources,network,sources,timeline,profiles,audits,console];if(WebInspector.experimentsSettings.layersPanel.isEnabled()){var layers=new WebInspector.LayersPanelDescriptor();allDescriptors.push(layers);} var allProfilers=[profiles];if(WebInspector.experimentsSettings.customizableToolbar.isEnabled()){allProfilers=[];allProfilers.push(new WebInspector.PanelDescriptor("cpu-profiler",WebInspector.UIString("CPU Profiler"),"CPUProfilerPanel","ProfilesPanel.js"));if(!WebInspector.WorkerManager.isWorkerFrontend()) allProfilers.push(new WebInspector.PanelDescriptor("css-profiler",WebInspector.UIString("CSS Profiler"),"CSSSelectorProfilerPanel","ProfilesPanel.js"));allProfilers.push(new WebInspector.PanelDescriptor("heap-profiler",WebInspector.UIString("Heap Profiler"),"HeapProfilerPanel","ProfilesPanel.js"));if(!WebInspector.WorkerManager.isWorkerFrontend()&&WebInspector.experimentsSettings.canvasInspection.isEnabled()) allProfilers.push(new WebInspector.PanelDescriptor("canvas-profiler",WebInspector.UIString("Canvas Profiler"),"CanvasProfilerPanel","ProfilesPanel.js"));Array.prototype.splice.bind(allDescriptors,allDescriptors.indexOf(profiles),1).apply(null,allProfilers);} var panelDescriptors=[];if(WebInspector.WorkerManager.isWorkerFrontend()){panelDescriptors.push(sources);panelDescriptors.push(timeline);panelDescriptors=panelDescriptors.concat(allProfilers);panelDescriptors.push(console);return panelDescriptors;} for(var i=0;imaxBreakpointsCount) breakpointsSetting.set([]);}} WebInspector.settings=new WebInspector.Settings();WebInspector.experimentsSettings=new WebInspector.ExperimentsSettings();WebInspector.View=function() {this.element=document.createElement("div");this.element.__view=this;this._visible=true;this._isRoot=false;this._isShowing=false;this._children=[];this._hideOnDetach=false;this._cssFiles=[];this._notificationDepth=0;} WebInspector.View._cssFileToVisibleViewCount={};WebInspector.View._cssFileToStyleElement={};WebInspector.View._cssUnloadTimeout=2000;WebInspector.View.prototype={statusBarText:function() {return null;},markAsRoot:function() {WebInspector.View._assert(!this.element.parentElement,"Attempt to mark as root attached node");this._isRoot=true;},parentView:function() {return this._parentView;},isShowing:function() {return this._isShowing;},setHideOnDetach:function() {this._hideOnDetach=true;},_inNotification:function() {return!!this._notificationDepth||(this._parentView&&this._parentView._inNotification());},_parentIsShowing:function() {if(this._isRoot) return true;return this._parentView&&this._parentView.isShowing();},_callOnVisibleChildren:function(method) {var copy=this._children.slice();for(var i=0;i=0,"Attempt to remove non-child view");this._parentView._children.splice(childIndex,1);this._parentView=null;}else WebInspector.View._assert(this._isRoot,"Removing non-root view from DOM");},detachChildViews:function() {var children=this._children.slice();for(var i=0;i=duration) hasCompleted=true;if(callback) callback(hasCompleted);if(!hasCompleted) window.requestAnimationFrame(animateLoop);} function forceComplete() {if(hasCompleted) return;duration=0;animateLoop();} window.requestAnimationFrame(animateLoop);return{forceComplete:forceComplete};} WebInspector.isBeingEdited=function(element) {if(element.hasStyleClass("text-prompt")||element.nodeName==="INPUT"||element.nodeName==="TEXTAREA") return true;if(!WebInspector.__editingCount) return false;while(element){if(element.__editing) return true;element=element.parentElement;} return false;} WebInspector.markBeingEdited=function(element,value) {if(value){if(element.__editing) return false;element.addStyleClass("being-edited");element.__editing=true;WebInspector.__editingCount=(WebInspector.__editingCount||0)+1;}else{if(!element.__editing) return false;element.removeStyleClass("being-edited");delete element.__editing;--WebInspector.__editingCount;} return true;} WebInspector.EditingConfig=function(commitHandler,cancelHandler,context) {this.commitHandler=commitHandler;this.cancelHandler=cancelHandler this.context=context;this.pasteHandler;this.multiline;this.customFinishHandler;} WebInspector.EditingConfig.prototype={setPasteHandler:function(pasteHandler) {this.pasteHandler=pasteHandler;},setMultilineOptions:function(initialValue,mode,theme,lineWrapping,smartIndent) {this.multiline=true;this.initialValue=initialValue;this.mode=mode;this.theme=theme;this.lineWrapping=lineWrapping;this.smartIndent=smartIndent;},setCustomFinishHandler:function(customFinishHandler) {this.customFinishHandler=customFinishHandler;}} WebInspector.CSSNumberRegex=/^(-?(?:\d+(?:\.\d+)?|\.\d+))$/;WebInspector.StyleValueDelimiters=" \xA0\t\n\"':;,/()";WebInspector._valueModificationDirection=function(event) {var direction=null;if(event.type==="mousewheel"){if(event.wheelDeltaY>0) direction="Up";else if(event.wheelDeltaY<0) direction="Down";}else{if(event.keyIdentifier==="Up"||event.keyIdentifier==="PageUp") direction="Up";else if(event.keyIdentifier==="Down"||event.keyIdentifier==="PageDown") direction="Down";} return direction;} WebInspector._modifiedHexValue=function(hexString,event) {var direction=WebInspector._valueModificationDirection(event);if(!direction) return hexString;var number=parseInt(hexString,16);if(isNaN(number)||!isFinite(number)) return hexString;var maxValue=Math.pow(16,hexString.length)-1;var arrowKeyOrMouseWheelEvent=(event.keyIdentifier==="Up"||event.keyIdentifier==="Down"||event.type==="mousewheel");var delta;if(arrowKeyOrMouseWheelEvent) delta=(direction==="Up")?1:-1;else delta=(event.keyIdentifier==="PageUp")?16:-16;if(event.shiftKey) delta*=16;var result=number+delta;if(result<0) result=0;else if(result>maxValue) return hexString;var resultString=result.toString(16).toUpperCase();for(var i=0,lengthDelta=hexString.length-resultString.length;i=6) return WebInspector.PlatformFlavor.WindowsVista;return null;}else if(WebInspector.platform()==="mac"){var match=userAgent.match(/Mac OS X\s*(?:(\d+)_(\d+))?/);if(!match||match[1]!=10) return WebInspector.PlatformFlavor.MacSnowLeopard;switch(Number(match[2])){case 4:return WebInspector.PlatformFlavor.MacTiger;case 5:return WebInspector.PlatformFlavor.MacLeopard;case 6:return WebInspector.PlatformFlavor.MacSnowLeopard;case 7:return WebInspector.PlatformFlavor.MacLion;case 8:return WebInspector.PlatformFlavor.MacMountainLion;default:return"";}}} if(!WebInspector._platformFlavor) WebInspector._platformFlavor=detectFlavor();return WebInspector._platformFlavor;} WebInspector.port=function() {if(!WebInspector._port) WebInspector._port=InspectorFrontendHost.port();return WebInspector._port;} WebInspector.installPortStyles=function() {var platform=WebInspector.platform();document.body.addStyleClass("platform-"+platform);var flavor=WebInspector.platformFlavor();if(flavor) document.body.addStyleClass("platform-"+flavor);var port=WebInspector.port();document.body.addStyleClass("port-"+port);} WebInspector._windowFocused=function(event) {if(event.target.document.nodeType===Node.DOCUMENT_NODE) document.body.removeStyleClass("inactive");} WebInspector._windowBlurred=function(event) {if(event.target.document.nodeType===Node.DOCUMENT_NODE) document.body.addStyleClass("inactive");} WebInspector.previousFocusElement=function() {return WebInspector._previousFocusElement;} WebInspector.currentFocusElement=function() {return WebInspector._currentFocusElement;} WebInspector._focusChanged=function(event) {WebInspector.setCurrentFocusElement(event.target);} WebInspector._textInputTypes=["text","search","tel","url","email","password"].keySet();WebInspector._isTextEditingElement=function(element) {if(element instanceof HTMLInputElement) return element.type in WebInspector._textInputTypes;if(element instanceof HTMLTextAreaElement) return true;return false;} WebInspector.setCurrentFocusElement=function(x) {if(WebInspector._glassPane&&x&&!WebInspector._glassPane.element.isAncestor(x)) return;if(WebInspector._currentFocusElement!==x) WebInspector._previousFocusElement=WebInspector._currentFocusElement;WebInspector._currentFocusElement=x;if(WebInspector._currentFocusElement){WebInspector._currentFocusElement.focus();var selection=window.getSelection();if(!WebInspector._isTextEditingElement(WebInspector._currentFocusElement)&&selection.isCollapsed&&!WebInspector._currentFocusElement.isInsertionCaretInside()){var selectionRange=WebInspector._currentFocusElement.ownerDocument.createRange();selectionRange.setStart(WebInspector._currentFocusElement,0);selectionRange.setEnd(WebInspector._currentFocusElement,0);selection.removeAllRanges();selection.addRange(selectionRange);}}else if(WebInspector._previousFocusElement) WebInspector._previousFocusElement.blur();} WebInspector.restoreFocusFromElement=function(element) {if(element&&element.isSelfOrAncestor(WebInspector.currentFocusElement())) WebInspector.setCurrentFocusElement(WebInspector.previousFocusElement());} WebInspector.setToolbarColors=function(backgroundColor,color) {if(!WebInspector._themeStyleElement){WebInspector._themeStyleElement=document.createElement("style");document.head.appendChild(WebInspector._themeStyleElement);} WebInspector._themeStyleElement.textContent="#toolbar {\ background-image: none !important;\ background-color: "+backgroundColor+" !important;\ }\ \ .toolbar-label {\ color: "+color+" !important;\ text-shadow: none;\ }";} WebInspector.resetToolbarColors=function() {if(WebInspector._themeStyleElement) WebInspector._themeStyleElement.textContent="";} WebInspector.highlightSearchResult=function(element,offset,length,domChanges) {var result=WebInspector.highlightSearchResults(element,[{offset:offset,length:length}],domChanges);return result.length?result[0]:null;} WebInspector.highlightSearchResults=function(element,resultRanges,changes) {return WebInspector.highlightRangesWithStyleClass(element,resultRanges,"highlighted-search-result",changes);} WebInspector.highlightRangesWithStyleClass=function(element,resultRanges,styleClass,changes) {changes=changes||[];var highlightNodes=[];var lineText=element.textContent;var ownerDocument=element.ownerDocument;var textNodeSnapshot=ownerDocument.evaluate(".//text()",element,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var snapshotLength=textNodeSnapshot.snapshotLength;if(snapshotLength===0) return highlightNodes;var nodeRanges=[];var rangeEndOffset=0;for(var i=0;i=0;--i){var entry=domChanges[i];switch(entry.type){case"added":entry.node.remove();break;case"changed":entry.node.textContent=entry.oldText;break;}}} WebInspector._coalescingLevel=0;WebInspector.startBatchUpdate=function() {if(!WebInspector._coalescingLevel) WebInspector._postUpdateHandlers=new Map();WebInspector._coalescingLevel++;} WebInspector.endBatchUpdate=function() {if(--WebInspector._coalescingLevel) return;var handlers=WebInspector._postUpdateHandlers;delete WebInspector._postUpdateHandlers;var keys=handlers.keys();for(var i=0;i=0;},_onKeyDown:function(event) {if(this.isShowing()&&this.isClosingKey(event.keyCode)){this.hide();event.consume();}},__proto__:WebInspector.View.prototype} WebInspector.HelpScreenUntilReload=function(title,message) {WebInspector.HelpScreen.call(this,title);var p=this.contentElement.createChild("p");p.addStyleClass("help-section");p.textContent=message;WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,this.hide,this);} WebInspector.HelpScreenUntilReload.prototype={willHide:function() {WebInspector.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,this.hide,this);WebInspector.HelpScreen.prototype.willHide.call(this);},__proto__:WebInspector.HelpScreen.prototype} if(!window.InspectorFrontendHost){WebInspector.InspectorFrontendHostStub=function() {this.isStub=true;this._fileBuffers={};WebInspector.documentCopyEventFired=this.documentCopy.bind(this);} WebInspector.InspectorFrontendHostStub.prototype={getSelectionBackgroundColor:function() {return"#6e86ff";},getSelectionForegroundColor:function() {return"#ffffff";},platform:function() {var match=navigator.userAgent.match(/Windows NT/);if(match) return"windows";match=navigator.userAgent.match(/Mac OS X/);if(match) return"mac";return"linux";},port:function() {return"unknown";},bringToFront:function() {this._windowVisible=true;},closeWindow:function() {this._windowVisible=false;},requestSetDockSide:function(side) {InspectorFrontendAPI.setDockSide(side);},setAttachedWindowHeight:function(height) {},moveWindowBy:function(x,y) {},setInjectedScriptForOrigin:function(origin,script) {},loaded:function() {},localizedStringsURL:function() {return undefined;},inspectedURLChanged:function(url) {document.title=WebInspector.UIString(Preferences.applicationTitle,url);},documentCopy:function(event) {if(!this._textToCopy) return;event.clipboardData.setData("text",this._textToCopy);event.preventDefault();delete this._textToCopy;},copyText:function(text) {this._textToCopy=text;if(!document.execCommand("copy")){var screen=new WebInspector.ClipboardAccessDeniedScreen();screen.showModal();}},openInNewTab:function(url) {window.open(url,"_blank");},canSave:function() {return true;},save:function(url,content,forceSaveAs) {if(this._fileBuffers[url]) throw new Error("Concurrent file modification denied.");this._fileBuffers[url]=[content];setTimeout(WebInspector.fileManager.savedURL.bind(WebInspector.fileManager,url),0);},append:function(url,content) {var buffer=this._fileBuffers[url];if(!buffer) throw new Error("File is not open for write yet.");buffer.push(content);setTimeout(WebInspector.fileManager.appendedToURL.bind(WebInspector.fileManager,url),0);},close:function(url) {var content=this._fileBuffers[url];delete this._fileBuffers[url];if(!content) return;var lastSlashIndex=url.lastIndexOf("/");var fileNameSuffix=(lastSlashIndex===-1)?url:url.substring(lastSlashIndex+1);var blob=new Blob(content,{type:"application/octet-stream"});var objectUrl=window.URL.createObjectURL(blob);window.location=objectUrl+"#/"+fileNameSuffix;function cleanup() {window.URL.revokeObjectURL(objectUrl);} setTimeout(cleanup,3000);},sendMessageToBackend:function(message) {},sendMessageToEmbedder:function(message) {},recordActionTaken:function(actionCode) {},recordPanelShown:function(panelCode) {},recordSettingChanged:function(settingCode) {},loadResourceSynchronously:function(url) {return loadXHR(url);},supportsFileSystems:function() {return false;},requestFileSystems:function() {},addFileSystem:function() {},removeFileSystem:function(fileSystemPath) {},isolatedFileSystem:function(fileSystemId,registeredName) {return null;},indexPath:function(requestId,fileSystemPath) {},stopIndexing:function(requestId) {},searchInPath:function(requestId,fileSystemPath,query) {},setZoomFactor:function(zoom) {},isUnderTest:function() {return false;}} InspectorFrontendHost=new WebInspector.InspectorFrontendHostStub();WebInspector.ClipboardAccessDeniedScreen=function() {WebInspector.HelpScreen.call(this,WebInspector.UIString("Clipboard access is denied"));var platformMessage=WebInspector.UIString("You need to install a Chrome extension that grants clipboard access to Developer Tools.");if(platformMessage){var p=this.contentElement.createChild("p");p.addStyleClass("help-section");p.textContent=platformMessage;}} WebInspector.ClipboardAccessDeniedScreen.prototype={__proto__:WebInspector.HelpScreen.prototype}} WebInspector.RemoteDebuggingTerminatedScreen=function(reason) {WebInspector.HelpScreen.call(this,WebInspector.UIString("Detached from the target"));var p=this.contentElement.createChild("p");p.addStyleClass("help-section");p.createChild("span").textContent="Remote debugging has been terminated with reason: ";p.createChild("span","error-message").textContent=reason;p.createChild("br");p.createChild("span").textContent="Please re-attach to the new target.";} WebInspector.RemoteDebuggingTerminatedScreen.prototype={__proto__:WebInspector.HelpScreen.prototype} WebInspector.FileManager=function() {this._saveCallbacks={};} WebInspector.FileManager.EventTypes={SavedURL:"SavedURL",AppendedToURL:"AppendedToURL"} WebInspector.FileManager.prototype={canSave:function() {return true;},save:function(url,content,forceSaveAs,callback) {var savedURLs=WebInspector.settings.savedURLs.get();delete savedURLs[url];WebInspector.settings.savedURLs.set(savedURLs);InspectorFrontendHost.save(url,content,forceSaveAs);this._saveCallbacks[url]=callback;},savedURL:function(url) {var savedURLs=WebInspector.settings.savedURLs.get();savedURLs[url]=true;WebInspector.settings.savedURLs.set(savedURLs);this.dispatchEventToListeners(WebInspector.FileManager.EventTypes.SavedURL,url);var callback=this._saveCallbacks[url];delete this._saveCallbacks[url];if(callback) callback();},isURLSaved:function(url) {var savedURLs=WebInspector.settings.savedURLs.get();return savedURLs[url];},append:function(url,content) {InspectorFrontendHost.append(url,content);},close:function(url) {InspectorFrontendHost.close(url);},appendedToURL:function(url) {this.dispatchEventToListeners(WebInspector.FileManager.EventTypes.AppendedToURL,url);},__proto__:WebInspector.Object.prototype} WebInspector.fileManager=new WebInspector.FileManager();WebInspector.Checkbox=function(label,className,tooltip) {this.element=document.createElement('label');this._inputElement=document.createElement('input');this._inputElement.type="checkbox";this.element.className=className;this.element.appendChild(this._inputElement);this.element.appendChild(document.createTextNode(label));if(tooltip) this.element.title=tooltip;} WebInspector.Checkbox.prototype={set checked(checked) {this._inputElement.checked=checked;},get checked() {return this._inputElement.checked;},addEventListener:function(listener) {function listenerWrapper(event) {if(listener) listener(event);event.consume();return true;} this._inputElement.addEventListener("click",listenerWrapper,false);this.element.addEventListener("click",listenerWrapper,false);}} WebInspector.ContextMenuItem=function(topLevelMenu,type,label,disabled,checked) {this._type=type;this._label=label;this._disabled=disabled;this._checked=checked;this._contextMenu=topLevelMenu;if(type==="item"||type==="checkbox") this._id=topLevelMenu.nextId();} WebInspector.ContextMenuItem.prototype={id:function() {return this._id;},type:function() {return this._type;},isEnabled:function() {return!this._disabled;},setEnabled:function(enabled) {this._disabled=!enabled;},_buildDescriptor:function() {switch(this._type){case"item":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=function(topLevelMenu,label,disabled) {WebInspector.ContextMenuItem.call(this,topLevelMenu,"subMenu",label,disabled);this._items=[];} WebInspector.ContextSubMenuItem.prototype={appendItem:function(label,handler,disabled) {var item=new WebInspector.ContextMenuItem(this._contextMenu,"item",label,disabled);this._pushItem(item);this._contextMenu._setHandler(item.id(),handler);return item;},appendSubMenuItem:function(label,disabled) {var item=new WebInspector.ContextSubMenuItem(this._contextMenu,label,disabled);this._pushItem(item);return item;},appendCheckboxItem:function(label,handler,checked,disabled) {var item=new WebInspector.ContextMenuItem(this._contextMenu,"checkbox",label,disabled,checked);this._pushItem(item);this._contextMenu._setHandler(item.id(),handler);return item;},appendSeparator:function() {if(this._items.length) this._pendingSeparator=true;},_pushItem:function(item) {if(this._pendingSeparator){this._items.push(new WebInspector.ContextMenuItem(this._contextMenu,"separator"));delete this._pendingSeparator;} this._items.push(item);},isEmpty:function() {return!this._items.length;},_buildDescriptor:function() {var result={type:"subMenu",label:this._label,enabled:!this._disabled,subItems:[]};for(var i=0;i=aboveHeight){boxY=anchorBox.y+anchorBox.height;this._element.removeStyleClass("above-anchor");this._element.addStyleClass("under-anchor");}else{boxY=anchorBox.y-height;this._element.removeStyleClass("under-anchor");this._element.addStyleClass("above-anchor");} this._element.positionAt(boxX,boxY);this._element.style.width=width+"px";this._element.style.height=height+"px";},_onBoxMouseDown:function(event) {event.preventDefault();},hide:function() {if(!this.visible()) return;this._element.remove();delete this._selectedElement;},removeFromElement:function() {window.removeEventListener("scroll",this._boundOnScroll,true);window.removeEventListener("resize",this._boundOnResize,true);this.hide();},_applySuggestion:function(text,isIntermediateSuggestion) {if(!this.visible()||!(text||this._selectedElement)) return false;var suggestion=text||this._selectedElement.textContent;if(!suggestion) return false;this._suggestBoxDelegate.applySuggestion(suggestion,isIntermediateSuggestion);return true;},acceptSuggestion:function(text) {var result=this._applySuggestion(text,false);this.hide();if(!result) return false;this._suggestBoxDelegate.acceptSuggestion();return true;},_selectClosest:function(shift,isCircular) {if(!this._length) return false;var index=this._selectedIndex+shift;if(isCircular) index=(this._length+index)%this._length;else index=Number.constrain(index,0,this._length-1);this._selectItem(index);this._applySuggestion(undefined,true);return true;},_onItemMouseDown:function(text,event) {this.acceptSuggestion(text);event.consume(true);},_createItemElement:function(prefix,text) {var element=document.createElement("div");element.className="suggest-box-content-item source-code";element.tabIndex=-1;if(prefix&&prefix.length&&!text.indexOf(prefix)){var prefixElement=element.createChild("span","prefix");prefixElement.textContent=prefix;var suffixElement=element.createChild("span","suffix");suffixElement.textContent=text.substring(prefix.length);}else{var suffixElement=element.createChild("span","suffix");suffixElement.textContent=text;} element.addEventListener("mousedown",this._onItemMouseDown.bind(this,text),false);return element;},_updateItems:function(items,selectedIndex,userEnteredText) {this._length=items.length;this.contentElement.removeChildren();for(var i=0;i1) return true;return canShowForSingleItem&&completions[0]!==userEnteredText;},_rememberRowCountPerViewport:function() {if(!this.contentElement.firstChild) return;this._rowCountPerViewport=Math.floor(this.containerElement.offsetHeight/this.contentElement.firstChild.offsetHeight);},updateSuggestions:function(anchorBox,completions,selectedIndex,canShowForSingleItem,userEnteredText) {if(this._canShowBox(completions,canShowForSingleItem,userEnteredText)){this._updateItems(completions,selectedIndex,userEnteredText);this._updateBoxPosition(anchorBox);if(!this.visible()) this._bodyElement.appendChild(this._element);this._rememberRowCountPerViewport();}else this.hide();},keyPressed:function(event) {switch(event.keyIdentifier){case"Up":return this.upKeyPressed();case"Down":return this.downKeyPressed();case"PageUp":return this.pageUpKeyPressed();case"PageDown":return this.pageDownKeyPressed();case"Enter":return this.enterKeyPressed();} return false;},upKeyPressed:function() {return this._selectClosest(-1,true);},downKeyPressed:function() {return this._selectClosest(1,true);},pageUpKeyPressed:function() {return this._selectClosest(-this._rowCountPerViewport,false);},pageDownKeyPressed:function() {return this._selectClosest(this._rowCountPerViewport,false);},enterKeyPressed:function() {var hasSelectedItem=!!this._selectedElement;this.acceptSuggestion();return hasSelectedItem;}} WebInspector.TextPrompt=function(completions,stopCharacters) {this._proxyElement;this._proxyElementDisplay="inline-block";this._loadCompletions=completions;this._completionStopCharacters=stopCharacters||" =:[({;,!+-*/&|^<>.";this._suggestForceable=true;} WebInspector.TextPrompt.Events={ItemApplied:"text-prompt-item-applied",ItemAccepted:"text-prompt-item-accepted"};WebInspector.TextPrompt.prototype={get proxyElement() {return this._proxyElement;},setSuggestForceable:function(x) {this._suggestForceable=x;},setShowSuggestForEmptyInput:function(x) {this._showSuggestForEmptyInput=x;},setSuggestBoxEnabled:function(className) {this._suggestBoxClassName=className;},renderAsBlock:function() {this._proxyElementDisplay="block";},attach:function(element) {return this._attachInternal(element);},attachAndStartEditing:function(element,blurListener) {this._attachInternal(element);this._startEditing(blurListener);return this.proxyElement;},_attachInternal:function(element) {if(this.proxyElement) throw"Cannot attach an attached TextPrompt";this._element=element;this._boundOnKeyDown=this.onKeyDown.bind(this);this._boundOnMouseWheel=this.onMouseWheel.bind(this);this._boundSelectStart=this._selectStart.bind(this);this._proxyElement=element.ownerDocument.createElement("span");this._proxyElement.style.display=this._proxyElementDisplay;element.parentElement.insertBefore(this.proxyElement,element);this.proxyElement.appendChild(element);this._element.addStyleClass("text-prompt");this._element.addEventListener("keydown",this._boundOnKeyDown,false);this._element.addEventListener("mousewheel",this._boundOnMouseWheel,false);this._element.addEventListener("selectstart",this._boundSelectStart,false);if(typeof this._suggestBoxClassName==="string") this._suggestBox=new WebInspector.SuggestBox(this,this._element,this._suggestBoxClassName);return this.proxyElement;},detach:function() {this._removeFromElement();this.proxyElement.parentElement.insertBefore(this._element,this.proxyElement);this.proxyElement.remove();delete this._proxyElement;this._element.removeStyleClass("text-prompt");this._element.removeEventListener("keydown",this._boundOnKeyDown,false);this._element.removeEventListener("mousewheel",this._boundOnMouseWheel,false);this._element.removeEventListener("selectstart",this._boundSelectStart,false);WebInspector.restoreFocusFromElement(this._element);},get text() {return this._element.textContent;},set text(x) {this._removeSuggestionAids();if(!x){this._element.removeChildren();this._element.appendChild(document.createElement("br"));}else this._element.textContent=x;this.moveCaretToEndOfPrompt();this._element.scrollIntoView();},_removeFromElement:function() {this.clearAutoComplete(true);this._element.removeEventListener("keydown",this._boundOnKeyDown,false);this._element.removeEventListener("selectstart",this._boundSelectStart,false);if(this._isEditing) this._stopEditing();if(this._suggestBox) this._suggestBox.removeFromElement();},_startEditing:function(blurListener) {this._isEditing=true;this._element.addStyleClass("editing");if(blurListener){this._blurListener=blurListener;this._element.addEventListener("blur",this._blurListener,false);} this._oldTabIndex=this._element.tabIndex;if(this._element.tabIndex<0) this._element.tabIndex=0;WebInspector.setCurrentFocusElement(this._element);if(!this.text) this._updateAutoComplete();},_stopEditing:function() {this._element.tabIndex=this._oldTabIndex;if(this._blurListener) this._element.removeEventListener("blur",this._blurListener,false);this._element.removeStyleClass("editing");delete this._isEditing;},_removeSuggestionAids:function() {this.clearAutoComplete();this.hideSuggestBox();},_selectStart:function() {if(this._selectionTimeout) clearTimeout(this._selectionTimeout);this._removeSuggestionAids();function moveBackIfOutside() {delete this._selectionTimeout;if(!this.isCaretInsidePrompt()&&window.getSelection().isCollapsed){this.moveCaretToEndOfPrompt();this.autoCompleteSoon();}} this._selectionTimeout=setTimeout(moveBackIfOutside.bind(this),100);},defaultKeyHandler:function(event,force) {this._updateAutoComplete(force);return false;},_updateAutoComplete:function(force) {this.clearAutoComplete();this.autoCompleteSoon(force);},onMouseWheel:function(event) {},onKeyDown:function(event) {var handled=false;var invokeDefault=true;switch(event.keyIdentifier){case"U+0009":handled=this.tabKeyPressed(event);break;case"Left":case"Home":this._removeSuggestionAids();invokeDefault=false;break;case"Right":case"End":if(this.isCaretAtEndOfPrompt()) handled=this.acceptAutoComplete();else this._removeSuggestionAids();invokeDefault=false;break;case"U+001B":if(this.isSuggestBoxVisible()){this._removeSuggestionAids();handled=true;} break;case"U+0020":if(this._suggestForceable&&event.ctrlKey&&!event.metaKey&&!event.altKey&&!event.shiftKey){this.defaultKeyHandler(event,true);handled=true;} break;case"Alt":case"Meta":case"Shift":case"Control":invokeDefault=false;break;} if(!handled&&this.isSuggestBoxVisible()) handled=this._suggestBox.keyPressed(event);if(!handled&&invokeDefault) handled=this.defaultKeyHandler(event);if(handled) event.consume(true);return handled;},acceptAutoComplete:function() {var result=false;if(this.isSuggestBoxVisible()) result=this._suggestBox.acceptSuggestion();if(!result) result=this.acceptSuggestion();return result;},clearAutoComplete:function(includeTimeout) {if(includeTimeout&&this._completeTimeout){clearTimeout(this._completeTimeout);delete this._completeTimeout;} delete this._waitingForCompletions;if(!this.autoCompleteElement) return;this.autoCompleteElement.remove();delete this.autoCompleteElement;if(!this._userEnteredRange||!this._userEnteredText) return;this._userEnteredRange.deleteContents();this._element.normalize();var userTextNode=document.createTextNode(this._userEnteredText);this._userEnteredRange.insertNode(userTextNode);var selectionRange=document.createRange();selectionRange.setStart(userTextNode,this._userEnteredText.length);selectionRange.setEnd(userTextNode,this._userEnteredText.length);var selection=window.getSelection();selection.removeAllRanges();selection.addRange(selectionRange);delete this._userEnteredRange;delete this._userEnteredText;},autoCompleteSoon:function(force) {var immediately=this.isSuggestBoxVisible()||force;if(!this._completeTimeout) this._completeTimeout=setTimeout(this.complete.bind(this,force),immediately?0:250);},complete:function(force,reverse) {this.clearAutoComplete(true);var selection=window.getSelection();if(!selection.rangeCount) return;var selectionRange=selection.getRangeAt(0);var shouldExit;if(!force&&!this.isCaretAtEndOfPrompt()&&!this.isSuggestBoxVisible()) shouldExit=true;else if(!selection.isCollapsed) shouldExit=true;else if(!force){var wordSuffixRange=selectionRange.startContainer.rangeOfWord(selectionRange.endOffset,this._completionStopCharacters,this._element,"forward");if(wordSuffixRange.toString().length) shouldExit=true;} if(shouldExit){this.hideSuggestBox();return;} var wordPrefixRange=selectionRange.startContainer.rangeOfWord(selectionRange.startOffset,this._completionStopCharacters,this._element,"backward");this._waitingForCompletions=true;this._loadCompletions(this.proxyElement,wordPrefixRange,force,this._completionsReady.bind(this,selection,wordPrefixRange,!!reverse));},_boxForAnchorAtStart:function(selection,textRange) {var rangeCopy=selection.getRangeAt(0).cloneRange();var anchorElement=document.createElement("span");anchorElement.textContent="\u200B";textRange.insertNode(anchorElement);var box=anchorElement.boxInWindow(window);anchorElement.remove();selection.removeAllRanges();selection.addRange(rangeCopy);return box;},_buildCommonPrefix:function(completions,wordPrefixLength) {var commonPrefix=completions[0];for(var i=0;ithis._data.length) return undefined;if(this._historyOffset===1) this._pushCurrentText();++this._historyOffset;return this._currentHistoryItem();},_next:function() {if(this._historyOffset===1) return undefined;--this._historyOffset;return this._currentHistoryItem();},_currentHistoryItem:function() {return this._data[this._data.length-this._historyOffset];},defaultKeyHandler:function(event,force) {var newText;var isPrevious;switch(event.keyIdentifier){case"Up":if(!this.isCaretOnFirstLine()) break;newText=this._previous();isPrevious=true;break;case"Down":if(!this.isCaretOnLastLine()) break;newText=this._next();break;case"U+0050":if(WebInspector.isMac()&&event.ctrlKey&&!event.metaKey&&!event.altKey&&!event.shiftKey){newText=this._previous();isPrevious=true;} break;case"U+004E":if(WebInspector.isMac()&&event.ctrlKey&&!event.metaKey&&!event.altKey&&!event.shiftKey) newText=this._next();break;} if(newText!==undefined){event.consume(true);this.text=newText;if(isPrevious){var firstNewlineIndex=this.text.indexOf("\n");if(firstNewlineIndex===-1) this.moveCaretToEndOfPrompt();else{var selection=window.getSelection();var selectionRange=document.createRange();selectionRange.setStart(this._element.firstChild,firstNewlineIndex);selectionRange.setEnd(this._element.firstChild,firstNewlineIndex);selection.removeAllRanges();selection.addRange(selectionRange);}} return true;} return WebInspector.TextPrompt.prototype.defaultKeyHandler.apply(this,arguments);},__proto__:WebInspector.TextPrompt.prototype} WebInspector.Popover=function(popoverHelper) {WebInspector.View.call(this);this.markAsRoot();this.element.className="popover custom-popup-vertical-scroll custom-popup-horizontal-scroll";this._popupArrowElement=document.createElement("div");this._popupArrowElement.className="arrow";this.element.appendChild(this._popupArrowElement);this._contentDiv=document.createElement("div");this._contentDiv.className="content";this.element.appendChild(this._contentDiv);this._popoverHelper=popoverHelper;} WebInspector.Popover.prototype={show:function(element,anchor,preferredWidth,preferredHeight,arrowDirection) {this._innerShow(null,element,anchor,preferredWidth,preferredHeight,arrowDirection);},showView:function(view,anchor,preferredWidth,preferredHeight) {this._innerShow(view,view.element,anchor,preferredWidth,preferredHeight);},_innerShow:function(view,contentElement,anchor,preferredWidth,preferredHeight,arrowDirection) {if(this._disposed) return;this.contentElement=contentElement;if(WebInspector.Popover._popover) WebInspector.Popover._popover.detach();WebInspector.Popover._popover=this;var preferredSize=view?view.measurePreferredSize():this.contentElement.measurePreferredSize();preferredWidth=preferredWidth||preferredSize.width;preferredHeight=preferredHeight||preferredSize.height;WebInspector.View.prototype.show.call(this,document.body);if(view) view.show(this._contentDiv);else this._contentDiv.appendChild(this.contentElement);this._positionElement(anchor,preferredWidth,preferredHeight,arrowDirection);if(this._popoverHelper){this._contentDiv.addEventListener("mousemove",this._popoverHelper._killHidePopoverTimer.bind(this._popoverHelper),true);this.element.addEventListener("mouseout",this._popoverHelper._popoverMouseOut.bind(this._popoverHelper),true);}},hide:function() {this.detach();delete WebInspector.Popover._popover;},get disposed() {return this._disposed;},dispose:function() {if(this.isShowing()) this.hide();this._disposed=true;},setCanShrink:function(canShrink) {this._hasFixedHeight=!canShrink;this._contentDiv.addStyleClass("fixed-height");},_positionElement:function(anchorElement,preferredWidth,preferredHeight,arrowDirection) {const borderWidth=25;const scrollerWidth=this._hasFixedHeight?0:11;const arrowHeight=15;const arrowOffset=10;const borderRadius=10;preferredWidth=Math.max(preferredWidth,50);const totalWidth=window.innerWidth;const totalHeight=window.innerHeight;var anchorBox=anchorElement instanceof AnchorBox?anchorElement:anchorElement.boxInWindow(window);var newElementPosition={x:0,y:0,width:preferredWidth+scrollerWidth,height:preferredHeight};var verticalAlignment;var roomAbove=anchorBox.y;var roomBelow=totalHeight-anchorBox.y-anchorBox.height;if((roomAbove>roomBelow)||(arrowDirection===WebInspector.Popover.Orientation.Bottom)){if((anchorBox.y>newElementPosition.height+arrowHeight+borderRadius)||(arrowDirection===WebInspector.Popover.Orientation.Bottom)) newElementPosition.y=anchorBox.y-newElementPosition.height-arrowHeight;else{newElementPosition.y=borderRadius;newElementPosition.height=anchorBox.y-borderRadius*2-arrowHeight;if(this._hasFixedHeight&&newElementPosition.height=totalHeight)&&(arrowDirection!==WebInspector.Popover.Orientation.Top)){newElementPosition.height=totalHeight-anchorBox.y-anchorBox.height-borderRadius*2-arrowHeight;if(this._hasFixedHeight&&newElementPosition.height=this._tabsElement.children.length) this._tabsElement.appendChild(tab.tabElement);else this._tabsElement.insertBefore(tab.tabElement,this._tabsElement.children[index]);tab._shown=true;},_hideTabElement:function(tab) {this._tabsElement.removeChild(tab.tabElement);tab._shown=false;},_createDropDownButton:function() {var dropDownContainer=document.createElement("div");dropDownContainer.addStyleClass("tabbed-pane-header-tabs-drop-down-container");var dropDownButton=dropDownContainer.createChild("div","tabbed-pane-header-tabs-drop-down");dropDownButton.appendChild(document.createTextNode("\u00bb"));this._tabsSelect=dropDownButton.createChild("select","tabbed-pane-header-tabs-drop-down-select");this._tabsSelect.addEventListener("change",this._tabsSelectChanged.bind(this),false);return dropDownContainer;},_totalWidth:function() {return this._headerContentsElement.getBoundingClientRect().width;},_updateTabsDropDown:function() {var tabsToShowIndexes=this._tabsToShowIndexes(this._tabs,this._tabsHistory,this._totalWidth(),this._measuredDropDownButtonWidth);for(var i=0;i=totalMeasuredWidth) return measuredWidths[measuredWidths.length-1];var totalExtraWidth=0;for(var i=measuredWidths.length-1;i>0;--i){var extraWidth=measuredWidths[i]-measuredWidths[i-1];totalExtraWidth+=(measuredWidths.length-i)*extraWidth;if(totalWidth+totalExtraWidth>=totalMeasuredWidth) return measuredWidths[i-1]+(totalWidth+totalExtraWidth-totalMeasuredWidth)/(measuredWidths.length-i);} return totalWidth/measuredWidths.length;},_tabsToShowIndexes:function(tabsOrdered,tabsHistory,totalWidth,measuredDropDownButtonWidth) {var tabsToShowIndexes=[];var totalTabsWidth=0;var tabCount=tabsOrdered.length;for(var i=0;itotalWidth) break;tabsToShowIndexes.push(tabsOrdered.indexOf(tab));} tabsToShowIndexes.sort(function(x,y){return x-y});return tabsToShowIndexes;},_hideCurrentTab:function() {if(!this._currentTab) return;this._hideTab(this._currentTab);delete this._currentTab;},_showTab:function(tab) {tab.tabElement.addStyleClass("selected");tab.view.show(this._contentElement);},_hideTab:function(tab) {tab.tabElement.removeStyleClass("selected");tab.view.detach();},canHighlightPosition:function() {return this._currentTab&&this._currentTab.view&&this._currentTab.view.canHighlightPosition();},highlightPosition:function(line,column) {if(this.canHighlightPosition()) this._currentTab.view.highlightPosition(line,column);},elementsToRestoreScrollPositionsFor:function() {return[this._contentElement];},_insertBefore:function(tab,index) {this._tabsElement.insertBefore(tab._tabElement,this._tabsElement.childNodes[index]);var oldIndex=this._tabs.indexOf(tab);this._tabs.splice(oldIndex,1);if(oldIndexthis._tabElement.offsetLeft&&this._tabElement.offsetLeft+this._tabElement.clientWidth>tabElement.offsetLeft;if(!intersects) continue;if(Math.abs(event.pageX-this._dragStartX)0){tabElement=tabElement.nextSibling;++i;} var oldOffsetLeft=this._tabElement.offsetLeft;this._tabbedPane._insertBefore(this,i);this._dragStartX+=this._tabElement.offsetLeft-oldOffsetLeft;break;} if(!this._tabElement.previousSibling&&event.pageX-this._dragStartX<0){this._tabElement.style.setProperty("left","0px");return;} if(!this._tabElement.nextSibling&&event.pageX-this._dragStartX>0){this._tabElement.style.setProperty("left","0px");return;} this._tabElement.style.setProperty("position","relative");this._tabElement.style.setProperty("left",(event.pageX-this._dragStartX)+"px");},_endTabDragging:function(event) {this._tabElement.style.removeProperty("position");this._tabElement.style.removeProperty("left");delete this._dragStartX;}} WebInspector.TabbedPaneTabDelegate=function() {} WebInspector.TabbedPaneTabDelegate.prototype={closeTabs:function(tabbedPane,ids){}} WebInspector.ViewportControl=function(provider) {this.element=document.createElement("div");this.element.className="fill";this.element.style.overflow="auto";this._topGapElement=this.element.createChild("div");this._contentElement=this.element.createChild("div");this._bottomGapElement=this.element.createChild("div");this._provider=provider;this.element.addEventListener("scroll",this._onScroll.bind(this),false);this._firstVisibleIndex=0;this._lastVisibleIndex=-1;} WebInspector.ViewportControl.Provider=function() {} WebInspector.ViewportControl.Provider.prototype={itemCount:function(){return 0;},itemElement:function(index){return null;}} WebInspector.ViewportControl.prototype={contentElement:function() {return this._contentElement;},refresh:function() {if(!this.element.clientHeight) return;this._contentElement.style.setProperty("height","100000px");this._contentElement.removeChildren();var itemCount=this._provider.itemCount();if(!itemCount){this._firstVisibleIndex=-1;this._lastVisibleIndex=-1;return;} if(!this._rowHeight){var firstElement=this._provider.itemElement(0);this._rowHeight=firstElement.measurePreferredSize(this._contentElement).height;} var visibleFrom=this.element.scrollTop;var visibleTo=visibleFrom+this.element.clientHeight;this._firstVisibleIndex=Math.floor(visibleFrom/this._rowHeight);this._lastVisibleIndex=Math.min(Math.ceil(visibleTo/this._rowHeight),itemCount)-1;this._topGapElement.style.height=(this._rowHeight*this._firstVisibleIndex)+"px";this._bottomGapElement.style.height=(this._rowHeight*(itemCount-this._lastVisibleIndex-1))+"px";for(var i=this._firstVisibleIndex;i<=this._lastVisibleIndex;++i) this._contentElement.appendChild(this._provider.itemElement(i));this._contentElement.style.removeProperty("height");},_onScroll:function(event) {this.refresh();},rowsPerViewport:function() {return Math.floor(this.element.clientHeight/this._rowHeight);},firstVisibleIndex:function() {return this._firstVisibleIndex;},lastVisibleIndex:function() {return this._lastVisibleIndex;},renderedElementAt:function(index) {if(indexthis._lastVisibleIndex) return null;return this._contentElement.childNodes[index-this._firstVisibleIndex];},scrollItemIntoView:function(index,makeLast) {if(index>this._firstVisibleIndex&&index0) titleElement.createTextChild(", ");var property=preview.properties[i];if(!isArray||property.name!=i){titleElement.createChild("span","name").textContent=property.name;titleElement.createTextChild(": ");} titleElement.appendChild(this._renderPropertyPreview(property));} if(preview.overflow) titleElement.createChild("span").textContent="\u2026";titleElement.createTextChild(isArray?"]":"}");return preview.lossless;},_renderPropertyPreview:function(property) {var span=document.createElement("span");span.className="console-formatted-"+property.type;if(property.type==="function"){span.textContent="function";return span;} if(property.type==="object"&&property.subtype==="regexp"){span.addStyleClass("console-formatted-string");span.textContent=property.value;return span;} if(property.type==="object"&&property.subtype==="node"&&property.value){span.addStyleClass("console-formatted-preview-node");WebInspector.DOMPresentationUtils.createSpansForNodeTitle(span,property.value);return span;} if(property.type==="string"){span.textContent="\""+property.value+"\"";return span;} span.textContent=property.value;return span;},_formatParameterAsNode:function(object,elem) {function printNode(nodeId) {if(!nodeId){this._formatParameterAsObject(object,elem,false);return;} var treeOutline=new WebInspector.ElementsTreeOutline(false,false);treeOutline.setVisible(true);treeOutline.rootDOMNode=WebInspector.domAgent.nodeForId(nodeId);treeOutline.element.addStyleClass("outline-disclosure");if(!treeOutline.children[0].hasChildren) treeOutline.element.addStyleClass("single-node");elem.appendChild(treeOutline.element);treeOutline.element.treeElementForTest=treeOutline.children[0];} object.pushNodeToFrontend(printNode.bind(this));},useArrayPreviewInFormatter:function(array) {return this.type!==WebInspector.ConsoleMessage.MessageType.DirXML&&!!array.preview;},_formatParameterAsArray:function(array,elem) {if(this.useArrayPreviewInFormatter(array)){this._formatParameterAsArrayOrObject(array,"",elem,true);return;} const maxFlatArrayLength=100;if(this._isOutdated||array.arrayLength()>maxFlatArrayLength) this._formatParameterAsObject(array,elem,false);else array.getOwnProperties(this._printArray.bind(this,array,elem));},_formatParameterAsTable:function(parameters) {var element=document.createElement("span");var table=parameters[0];if(!table||!table.preview) return element;var columnNames=[];var preview=table.preview;var rows=[];for(var i=0;i1){appendUndefined(elem,i);elem.appendChild(document.createTextNode(", "));} elem.appendChild(element);lastNonEmptyIndex=i;if(i1) this.updateRepeatCount();return element;},_populateStackTraceTreeElement:function(parentTreeElement) {for(var i=0;i