export const fullQualifiedSelector=function(node,justSelector){if(node.nodeType()!==Node.ELEMENT_NODE){return node.localName()||node.nodeName().toLowerCase();} return cssPath(node,justSelector);};export const cssPath=function(node,optimized){if(node.nodeType()!==Node.ELEMENT_NODE){return'';} const steps=[];let contextNode=node;while(contextNode){const step=_cssPathStep(contextNode,!!optimized,contextNode===node);if(!step){break;} steps.push(step);if(step.optimized){break;} contextNode=contextNode.parentNode;} steps.reverse();return steps.join(' > ');};export const canGetJSPath=function(node){let wp=node;while(wp){if(wp.ancestorShadowRoot()&&wp.ancestorShadowRoot().shadowRootType()!==SDK.DOMNode.ShadowRootTypes.Open){return false;} wp=wp.ancestorShadowHost();} return true;};export const jsPath=function(node,optimized){if(node.nodeType()!==Node.ELEMENT_NODE){return'';} const path=[];let wp=node;while(wp){path.push(cssPath(wp,optimized));wp=wp.ancestorShadowHost();} path.reverse();let result='';for(let i=0;i0){ownValue+='['+ownIndex+']';} return new Step(ownValue,node.nodeType()===Node.DOCUMENT_NODE);};export const _xPathIndex=function(node){function areNodesSimilar(left,right){if(left===right){return true;} if(left.nodeType()===Node.ELEMENT_NODE&&right.nodeType()===Node.ELEMENT_NODE){return left.localName()===right.localName();} if(left.nodeType()===right.nodeType()){return true;} const leftType=left.nodeType()===Node.CDATA_SECTION_NODE?Node.TEXT_NODE:left.nodeType();const rightType=right.nodeType()===Node.CDATA_SECTION_NODE?Node.TEXT_NODE:right.nodeType();return leftType===rightType;} const siblings=node.parentNode?node.parentNode.children():null;if(!siblings){return 0;} let hasSameNamedElements;for(let i=0;i