8 lines
59 KiB
JavaScript
8 lines
59 KiB
JavaScript
|
|
"use strict";
|
||
|
|
|
||
|
|
Object.defineProperty(exports, "__esModule", {
|
||
|
|
value: true
|
||
|
|
});
|
||
|
|
exports.source = void 0;
|
||
|
|
const source = "var pwExport=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=9)}([function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.parseSelector=function(e){const t=function(e){let t,n=0,r=0;const o={parts:[]},i=()=>{const t=e.substring(r,n).trim(),i=t.indexOf(\"=\");let s,c;-1!==i&&t.substring(0,i).trim().match(/^[a-zA-Z_0-9-+:*]+$/)?(s=t.substring(0,i).trim(),c=t.substring(i+1)):t.length>1&&'\"'===t[0]&&'\"'===t[t.length-1]||t.length>1&&\"'\"===t[0]&&\"'\"===t[t.length-1]?(s=\"text\",c=t):/^\\(*\\/\\//.test(t)||t.startsWith(\"..\")?(s=\"xpath\",c=t):(s=\"css\",c=t);let a=!1;if(\"*\"===s[0]&&(a=!0,s=s.substring(1)),o.parts.push({name:s,body:c}),a){if(void 0!==o.capture)throw new Error(\"Only one of the selectors can capture using * modifier\");o.capture=o.parts.length-1}};if(!e.includes(\">>\"))return n=e.length,i(),o;for(;n<e.length;){const o=e[n];\"\\\\\"===o&&n+1<e.length?n+=2:o===t?(t=void 0,n++):t||'\"'!==o&&\"'\"!==o&&\"`\"!==o?t||\">\"!==o||\">\"!==e[n+1]?n++:(i(),n+=2,r=n):(t=o,n++)}return i(),o}(e),n=t.parts.map(e=>{if(\"css\"===e.name||\"css:light\"===e.name){\"css:light\"===e.name&&(e.body=\":light(\"+e.body+\")\");return{name:\"css\",body:(0,r.parseCSS)(e.body,o).selector}}return e});return{selector:e,capture:t.capture,parts:n}},t.customCSSNames=void 0;var r=n(2);const o=new Set([\"not\",\"is\",\"where\",\"has\",\"scope\",\"light\",\"visible\",\"text\",\"text-matches\",\"text-is\",\"has-text\",\"above\",\"below\",\"right-of\",\"left-of\",\"near\",\"nth-match\"]);t.customCSSNames=o},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.createLaxTextMatcher=d,t.createStrictTextMatcher=m,t.createRegexTextMatcher=g,t.elementText=w,t.elementMatchesText=v,t.parentElementOrShadowHost=C,t.isVisible=O,t.SelectorEvaluatorImpl=void 0;var r=n(0);t.SelectorEvaluatorImpl=class{constructor(e){this._engines=new Map,this._cacheQueryCSS=new Map,this._cacheMatches=new Map,this._cacheQuery=new Map,this._cacheMatchesSimple=new Map,this._cacheMatchesParents=new Map,this._cacheCallMatches=new Map,this._cacheCallQuery=new Map,this._cacheQuerySimple=new Map,this._cacheText=new Map,this._scoreMap=void 0,this._retainCacheCounter=0;for(const[t,n]of e)this._engines.set(t,n);this._engines.set(\"not\",c),this._engines.set(\"is\",o),this._engines.set(\"where\",o),this._engines.set(\"has\",i),this._engines.set(\"scope\",s),this._engines.set(\"light\",a),this._engines.set(\"visible\",u),this._engines.set(\"text\",l),this._engines.set(\"text-is\",p),this._engines.set(\"text-matches\",h),this._engines.set(\"has-text\",f),this._engines.set(\"right-of\",k(\"right-of\",b)),this._engines.set(\"left-of\",k(\"left-of\",E)),this._engines.set(\"above\",k(\"above\",_)),this._engines.set(\"below\",k(\"below\",S)),this._engines.set(\"near\",k(\"near\",T)),this._engines.set(\"nth-match\",N);const t=[...this._engines.keys()];t.sort();const n=[...r.customCSSNames];if(n.sort(),t.join(\"|\")!==n.join(\"|\"))throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${t.join(\"|\")} vs ${n.join(\"|\")}`)}begin(){++this._retainCacheCounter}end(){--this._retainCacheCounter,this._retainCacheCounter||(this._cacheQueryC
|
||
|
|
exports.source = source;
|