selenium-atoms
Version:
84 lines (78 loc) • 34.7 kB
JavaScript
function(){return function(){var h=this;function aa(a,b){var c=a.split("."),d=h;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b}
function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ea(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function k(a){return"string"==typeof a}function fa(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ga(a,b,c){return a.call.apply(a.bind,arguments)}
function ha(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ia(a,b,c){ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ga:ha;return ia.apply(null,arguments)}
function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function m(a,b){function c(){}c.prototype=b.prototype;a.H=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.G=function(a,c,f){for(var g=Array(arguments.length-2),l=2;l<arguments.length;l++)g[l-2]=arguments[l];return b.prototype[c].apply(a,g)}};function n(a,b){this.code=a;this.a=p[a]||la;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}m(n,Error);var la="unknown error",p={15:"element not selectable",11:"element not visible"};p[31]=la;p[30]=la;p[24]="invalid cookie domain";p[29]="invalid element coordinates";p[12]="invalid element state";
p[32]="invalid selector";p[51]="invalid selector";p[52]="invalid selector";p[17]="javascript error";p[405]="unsupported operation";p[34]="move target out of bounds";p[27]="no such alert";p[7]="no such element";p[8]="no such frame";p[23]="no such window";p[28]="script timeout";p[33]="session not created";p[10]="stale element reference";p[21]="timeout";p[25]="unable to set cookie";p[26]="unexpected alert open";p[13]=la;p[9]="unknown command";n.prototype.toString=function(){return this.name+": "+this.message};var ma=window;var na=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};
function oa(a,b){for(var c=0,d=na(String(a)).split("."),e=na(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var l=d[g]||"",r=e[g]||"",B=RegExp("(\\d*)(\\D*)","g"),N=RegExp("(\\d*)(\\D*)","g");do{var ca=B.exec(l)||["","",""],da=N.exec(r)||["","",""];if(0==ca[0].length&&0==da[0].length)break;c=pa(0==ca[1].length?0:parseInt(ca[1],10),0==da[1].length?0:parseInt(da[1],10))||pa(0==ca[2].length,0==da[2].length)||pa(ca[2],da[2])}while(0==c)}return c}
function pa(a,b){return a<b?-1:a>b?1:0};var qa=Array.prototype;function q(a,b){for(var c=a.length,d=k(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function ra(a,b){for(var c=a.length,d=[],e=0,f=k(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var l=f[g];b.call(void 0,l,g,a)&&(d[e++]=l)}return d}function sa(a,b){for(var c=a.length,d=Array(c),e=k(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function t(a,b,c){var d=c;q(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}
function ta(a,b){for(var c=a.length,d=k(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ua(a,b){var c;a:{c=a.length;for(var d=k(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:k(a)?a.charAt(c):a[c]}function va(a){return qa.concat.apply(qa,arguments)}function wa(a,b,c){return 2>=arguments.length?qa.slice.call(a,b):qa.slice.call(a,b,c)};var u;a:{var xa=h.navigator;if(xa){var ya=xa.userAgent;if(ya){u=ya;break a}}u=""}function v(a){return-1!=u.indexOf(a)};function za(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Aa(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function w(a,b){return null!==a&&b in a}function Ba(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ca(){return v("Opera")||v("OPR")}function Da(){return(v("Chrome")||v("CriOS"))&&!Ca()&&!v("Edge")};function Ea(){return v("iPhone")&&!v("iPod")&&!v("iPad")};var Fa=Ca(),x=v("Trident")||v("MSIE"),Ga=v("Edge"),Ha=v("Gecko")&&!(-1!=u.toLowerCase().indexOf("webkit")&&!v("Edge"))&&!(v("Trident")||v("MSIE"))&&!v("Edge"),Ia=-1!=u.toLowerCase().indexOf("webkit")&&!v("Edge");function Ja(){var a=u;if(Ha)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Ga)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ia)return/WebKit\/(\S+)/.exec(a)}function Ka(){var a=h.document;return a?a.documentMode:void 0}
var La=function(){if(Fa&&h.opera){var a;var b=h.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ja())&&(a=b?b[1]:"");return x&&(b=Ka(),b>parseFloat(a))?String(b):a}(),Ma={};function Na(a){return Ma[a]||(Ma[a]=0<=oa(La,a))}var Oa=h.document,y=Oa&&x?Ka()||("CSS1Compat"==Oa.compatMode?parseInt(La,10):5):void 0;!Ha&&!x||x&&9<=y||Ha&&Na("1.9.1");x&&Na("9");function Pa(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}
function Qa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=y)){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Ra(a,b):!c&&Pa(e,b)?-1*Sa(a,b):!d&&Pa(f,a)?Sa(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType?a:a.ownerDocument||
a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(h.Range.START_TO_END,d)}function Sa(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Ra(d,a)}function Ra(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};var Ta=v("Firefox"),Ua=Ea()||v("iPod"),Va=v("iPad"),Wa=v("Android")&&!(Da()||v("Firefox")||Ca()||v("Silk")),Xa=Da(),Ya=v("Safari")&&!(Da()||v("Coast")||Ca()||v("Edge")||v("Silk")||v("Android"))&&!(Ea()||v("iPad")||v("iPod"));function Za(a){return(a=a.exec(u))?a[1]:""}var $a=function(){if(Ta)return Za(/Firefox\/([0-9.]+)/);if(x||Ga||Fa)return La;if(Xa)return Za(/Chrome\/([0-9.]+)/);if(Ya&&!(Ea()||v("iPad")||v("iPod")))return Za(/Version\/([0-9.]+)/);if(Ua||Va){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(u))return a[1]+"."+a[2]}else if(Wa)return(a=Za(/Android\s+([0-9.]+)/))?a:Za(/Version\/([0-9.]+)/);return""}();var ab,bb;function cb(a){db?bb(a):Wa?oa(eb,a):oa($a,a)}var db=function(){if(!Ha)return!1;var a=h.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(b){return!1}var c=a.classes,a=a.interfaces,d=c["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),c=c["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),e=c.platformVersion,f=c.version;ab=function(a){return 0<=d.compare(e,""+a)};bb=function(a){d.compare(f,""+a)};return!0}(),fb;
if(Wa){var gb=/Android\s+([0-9\.]+)/.exec(u);fb=gb?gb[1]:"0"}else fb="0";var eb=fb;Wa&&cb(2.3);Wa&&cb(4);Ya&&cb(6);/*
The MIT License
Copyright (c) 2007 Cybozu Labs, Inc.
Copyright (c) 2012 Google Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
function z(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var A=x&&!(9<=y),hb=x&&!(8<=y);function C(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function ib(a,b){var c=hb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new C(b,a,b.nodeName,c)};function jb(a){this.b=a;this.a=0}function kb(a){a=a.match(lb);for(var b=0;b<a.length;b++)mb.test(a[b])&&a.splice(b,1);return new jb(a)}var lb=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),mb=/^\s/;function D(a,b){return a.b[a.a+(b||0)]}function E(a){return a.b[a.a++]}function nb(a){return a.b.length<=a.a};function F(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(A&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),A&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b}
function G(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}hb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function ob(a,b,c,d,e){return(A?pb:qb).call(null,a,b,k(c)?c:null,k(d)?d:null,e||new H)}
function pb(a,b,c,d,e){if(a instanceof I||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=rb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],l=0;b=f[l++];)G(b,c,d)&&g.push(b);f=g}for(l=0;b=f[l++];)"*"==a&&"!"==b.tagName||J(e,b);return e}sb(a,b,c,d,e);return e}
function qb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),q(b,function(b){a.a(b)&&J(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),q(b,function(b){b.className==d&&a.a(b)&&J(e,b)})):a instanceof K?sb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),q(b,function(a){G(a,c,d)&&J(e,a)}));return e}
function tb(a,b,c,d,e){var f;if((a instanceof I||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=rb(a);if("*"!=g&&(f=ra(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=ra(f,function(a){return G(a,c,d)}));q(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||J(e,a)});return e}return ub(a,b,c,d,e)}function ub(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)G(b,c,d)&&a.a(b)&&J(e,b);return e}
function sb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)G(b,c,d)&&a.a(b)&&J(e,b),sb(a,b,c,d,e)}function rb(a){if(a instanceof K){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function H(){this.b=this.a=null;this.l=0}function vb(a){this.node=a;this.a=this.b=null}function wb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,l=d.node;f==l||f instanceof C&&l instanceof C&&f.a==l.a?(f=c,c=c.a,d=d.a):0<Qa(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.l=g;return a}H.prototype.unshift=function(a){a=new vb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.l++};
function J(a,b){var c=new vb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.l++}function xb(a){return(a=a.a)?a.node:null}function yb(a){return(a=xb(a))?F(a):""}function L(a,b){return new zb(a,!!b)}function zb(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function M(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function O(a){this.i=a;this.b=this.g=!1;this.f=null}function P(a){return"\n "+a.toString().split("\n").join("\n ")}function Ab(a,b){a.g=b}function Bb(a,b){a.b=b}function Q(a,b){var c=a.a(b);return c instanceof H?+yb(c):+c}function R(a,b){var c=a.a(b);return c instanceof H?yb(c):""+c}function S(a,b){var c=a.a(b);return c instanceof H?!!c.l:!!c};function Cb(a,b,c){O.call(this,a.i);this.c=a;this.h=b;this.o=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==Db&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,s:b}):this.f={name:b.f.name,s:c})}m(Cb,O);
function T(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof H&&c instanceof H){e=L(b);for(d=M(e);d;d=M(e))for(b=L(c),f=M(b);f;f=M(b))if(a(F(d),F(f)))return!0;return!1}if(b instanceof H||c instanceof H){b instanceof H?e=b:(e=c,c=b);e=L(e);b=typeof c;for(d=M(e);d;d=M(e)){switch(b){case "number":d=+F(d);break;case "boolean":d=!!F(d);break;case "string":d=F(d);break;default:throw Error("Illegal primitive type for comparison.");}if(a(d,c))return!0}return!1}return e?"boolean"==typeof b||"boolean"==typeof c?
a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Cb.prototype.a=function(a){return this.c.m(this.h,this.o,a)};Cb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+P(this.h);return a+=P(this.o)};function Eb(a,b,c,d){this.a=a;this.A=b;this.i=c;this.m=d}Eb.prototype.toString=function(){return this.a};var Fb={};function U(a,b,c,d){if(Fb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Eb(a,b,c,d);return Fb[a.toString()]=a}
U("div",6,1,function(a,b,c){return Q(a,c)/Q(b,c)});U("mod",6,1,function(a,b,c){return Q(a,c)%Q(b,c)});U("*",6,1,function(a,b,c){return Q(a,c)*Q(b,c)});U("+",5,1,function(a,b,c){return Q(a,c)+Q(b,c)});U("-",5,1,function(a,b,c){return Q(a,c)-Q(b,c)});U("<",4,2,function(a,b,c){return T(function(a,b){return a<b},a,b,c)});U(">",4,2,function(a,b,c){return T(function(a,b){return a>b},a,b,c)});U("<=",4,2,function(a,b,c){return T(function(a,b){return a<=b},a,b,c)});
U(">=",4,2,function(a,b,c){return T(function(a,b){return a>=b},a,b,c)});var Db=U("=",3,2,function(a,b,c){return T(function(a,b){return a==b},a,b,c,!0)});U("!=",3,2,function(a,b,c){return T(function(a,b){return a!=b},a,b,c,!0)});U("and",2,2,function(a,b,c){return S(a,c)&&S(b,c)});U("or",1,2,function(a,b,c){return S(a,c)||S(b,c)});function Gb(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");O.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}m(Gb,O);Gb.prototype.a=function(a){a=this.c.a(a);return Hb(this.h,a)};Gb.prototype.toString=function(){var a;a="Filter:"+P(this.c);return a+=P(this.h)};function Ib(a,b){if(b.length<a.B)throw Error("Function "+a.j+" expects at least"+a.B+" arguments, "+b.length+" given");if(null!==a.w&&b.length>a.w)throw Error("Function "+a.j+" expects at most "+a.w+" arguments, "+b.length+" given");a.C&&q(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});O.call(this,a.i);this.h=a;this.c=b;Ab(this,a.g||ta(b,function(a){return a.g}));Bb(this,a.F&&!b.length||a.D&&!!b.length||ta(b,function(a){return a.b}))}
m(Ib,O);Ib.prototype.a=function(a){return this.h.m.apply(null,va(a,this.c))};Ib.prototype.toString=function(){var a="Function: "+this.h;if(this.c.length)var b=t(this.c,function(a,b){return a+P(b)},"Arguments:"),a=a+P(b);return a};function Jb(a,b,c,d,e,f,g,l,r){this.j=a;this.i=b;this.g=c;this.F=d;this.D=e;this.m=f;this.B=g;this.w=void 0!==l?l:g;this.C=!!r}Jb.prototype.toString=function(){return this.j};var Kb={};
function V(a,b,c,d,e,f,g,l){if(Kb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Kb[a]=new Jb(a,b,c,d,!1,e,f,g,l)}V("boolean",2,!1,!1,function(a,b){return S(b,a)},1);V("ceiling",1,!1,!1,function(a,b){return Math.ceil(Q(b,a))},1);V("concat",3,!1,!1,function(a,b){return t(wa(arguments,1),function(b,d){return b+R(d,a)},"")},2,null);V("contains",2,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);return-1!=b.indexOf(a)},2);V("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0);
V("false",2,!1,!1,function(){return!1},0);V("floor",1,!1,!1,function(a,b){return Math.floor(Q(b,a))},1);
V("id",4,!1,!1,function(a,b){function c(a){if(A){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ua(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=R(b,a).split(/\s+/),f=[];q(d,function(a){a=c(a);var b;if(!(b=!a)){a:if(k(f))b=k(a)&&1==a.length?f.indexOf(a,0):-1;else{for(b=0;b<f.length;b++)if(b in f&&f[b]===a)break a;b=-1}b=0<=b}b||f.push(a)});f.sort(Qa);var g=new H;q(f,function(a){J(g,a)});return g},1);
V("lang",2,!1,!1,function(){return!1},1);V("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);V("local-name",3,!1,!0,function(a,b){var c=b?xb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);V("name",3,!1,!0,function(a,b){var c=b?xb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);V("namespace-uri",3,!0,!1,function(){return""},0,1,!0);
V("normalize-space",3,!1,!0,function(a,b){return(b?R(b,a):F(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);V("not",2,!1,!1,function(a,b){return!S(b,a)},1);V("number",1,!1,!0,function(a,b){return b?Q(b,a):+F(a.a)},0,1);V("position",1,!0,!1,function(a){return a.b},0);V("round",1,!1,!1,function(a,b){return Math.round(Q(b,a))},1);V("starts-with",2,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);return 0==b.lastIndexOf(a,0)},2);V("string",3,!1,!0,function(a,b){return b?R(b,a):F(a.a)},0,1);
V("string-length",1,!1,!0,function(a,b){return(b?R(b,a):F(a.a)).length},0,1);V("substring",3,!1,!1,function(a,b,c,d){c=Q(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?Q(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=R(b,a);if(Infinity==d)return a.substring(e);b=Math.round(d);return a.substring(e,c+b)},2,3);V("substring-after",3,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
V("substring-before",3,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);V("sum",1,!1,!1,function(a,b){for(var c=L(b.a(a)),d=0,e=M(c);e;e=M(c))d+=+F(e);return d},1,1,!0);V("translate",3,!1,!1,function(a,b,c,d){b=R(b,a);c=R(c,a);var e=R(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);V("true",2,!1,!1,function(){return!0},0);function K(a,b){this.h=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Lb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}K.prototype.a=function(a){return null===this.b||this.b==a.nodeType};K.prototype.f=function(){return this.h};
K.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=P(this.c));return a};function Mb(a){O.call(this,3);this.c=a.substring(1,a.length-1)}m(Mb,O);Mb.prototype.a=function(){return this.c};Mb.prototype.toString=function(){return"Literal: "+this.c};function I(a,b){this.j=a.toLowerCase();this.c=b?b.toLowerCase():"http://www.w3.org/1999/xhtml"}I.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.j&&this.j!=a.nodeName.toLowerCase()?!1:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};I.prototype.f=function(){return this.j};I.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j};function Nb(a){O.call(this,1);this.c=a}m(Nb,O);Nb.prototype.a=function(){return this.c};Nb.prototype.toString=function(){return"Number: "+this.c};function Ob(a,b){O.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.v||c.c!=Pb||(c=c.o,"*"!=c.f()&&(this.f={name:c.f(),s:null}))}}m(Ob,O);function Qb(){O.call(this,4)}m(Qb,O);Qb.prototype.a=function(a){var b=new H;a=a.a;9==a.nodeType?J(b,a):J(b,a.ownerDocument);return b};Qb.prototype.toString=function(){return"Root Helper Expression"};function Rb(){O.call(this,4)}m(Rb,O);Rb.prototype.a=function(a){var b=new H;J(b,a.a);return b};Rb.prototype.toString=function(){return"Context Helper Expression"};
function Sb(a){return"/"==a||"//"==a}Ob.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof H))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=L(b,e.c.a),g;if(e.g||e.c!=Tb)if(e.g||e.c!=Ub)for(g=M(f),b=e.a(new z(g));null!=(g=M(f));)g=e.a(new z(g)),b=wb(b,g);else g=M(f),b=e.a(new z(g));else{for(g=M(f);(b=M(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new z(g))}}return b};
Ob.prototype.toString=function(){var a;a="Path Expression:"+P(this.h);if(this.c.length){var b=t(this.c,function(a,b){return a+P(b)},"Steps:");a+=P(b)}return a};function Vb(a,b){this.a=a;this.b=!!b}
function Hb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=L(b),f=b.l,g,l=0;g=M(e);l++){var r=a.b?f-l:l+1;g=d.a(new z(g,r,f));if("number"==typeof g)r=r==g;else if("string"==typeof g||"boolean"==typeof g)r=!!g;else if(g instanceof H)r=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!r){r=e;g=r.f;var B=r.a;if(!B)throw Error("Next must be called at least once before remove.");var N=B.b,B=B.a;N?N.a=B:g.a=B;B?B.b=N:g.b=N;g.l--;r.a=null}}return b}
Vb.prototype.toString=function(){return t(this.a,function(a,b){return a+P(b)},"Predicates:")};function W(a,b,c,d){O.call(this,4);this.c=a;this.o=b;this.h=c||new Vb([]);this.v=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(a=b.name,a=A?a.toLowerCase():a,this.f={name:a,s:b.s});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}m(W,O);
W.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.s?R(c.s,a):null,f=1);if(this.v)if(this.g||this.c!=Wb)if(a=L((new W(Xb,new K("node"))).a(a)),b=M(a))for(c=this.m(b,d,e,f);null!=(b=M(a));)c=wb(c,this.m(b,d,e,f));else c=new H;else c=ob(this.o,b,d,e),c=Hb(this.h,c,f);else c=this.m(a.a,d,e,f);return c};W.prototype.m=function(a,b,c,d){a=this.c.f(this.o,a,b,c);return a=Hb(this.h,a,d)};
W.prototype.toString=function(){var a;a="Step:"+P("Operator: "+(this.v?"//":"/"));this.c.j&&(a+=P("Axis: "+this.c));a+=P(this.o);if(this.h.a.length){var b=t(this.h.a,function(a,b){return a+P(b)},"Predicates:");a+=P(b)}return a};function Yb(a,b,c,d){this.j=a;this.f=b;this.a=c;this.b=d}Yb.prototype.toString=function(){return this.j};var Zb={};function X(a,b,c,d){if(Zb.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Yb(a,b,c,!!d);return Zb[a]=b}
X("ancestor",function(a,b){for(var c=new H,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);X("ancestor-or-self",function(a,b){var c=new H,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0);
var Pb=X("attribute",function(a,b){var c=new H,d=a.f();if("style"==d&&b.style&&A)return J(c,new C(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof K&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)A?f.nodeValue&&J(c,ib(b,f)):J(c,f);else(f=e.getNamedItem(d))&&(A?f.nodeValue&&J(c,ib(b,f)):J(c,f));return c},!1),Wb=X("child",function(a,b,c,d,e){return(A?tb:ub).call(null,a,b,k(c)?c:null,k(d)?d:null,e||new H)},!1,!0);X("descendant",ob,!1,!0);
var Xb=X("descendant-or-self",function(a,b,c,d){var e=new H;G(b,c,d)&&a.a(b)&&J(e,b);return ob(a,b,c,d,e)},!1,!0),Tb=X("following",function(a,b,c,d){var e=new H;do for(var f=b;f=f.nextSibling;)G(f,c,d)&&a.a(f)&&J(e,f),e=ob(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);X("following-sibling",function(a,b){for(var c=new H,d=b;d=d.nextSibling;)a.a(d)&&J(c,d);return c},!1);X("namespace",function(){return new H},!1);
var $b=X("parent",function(a,b){var c=new H;if(9==b.nodeType)return c;if(2==b.nodeType)return J(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&J(c,d);return c},!1),Ub=X("preceding",function(a,b,c,d){var e=new H,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,l=f.length;g<l;g++){var r=[];for(b=f[g];b=b.previousSibling;)r.unshift(b);for(var B=0,N=r.length;B<N;B++)b=r[B],G(b,c,d)&&a.a(b)&&J(e,b),e=ob(a,b,c,d,e)}return e},!0,!0);
X("preceding-sibling",function(a,b){for(var c=new H,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var ac=X("self",function(a,b){var c=new H;a.a(b)&&J(c,b);return c},!1);function bc(a){O.call(this,1);this.c=a;this.g=a.g;this.b=a.b}m(bc,O);bc.prototype.a=function(a){return-Q(this.c,a)};bc.prototype.toString=function(){return"Unary Expression: -"+P(this.c)};function cc(a){O.call(this,4);this.c=a;Ab(this,ta(this.c,function(a){return a.g}));Bb(this,ta(this.c,function(a){return a.b}))}m(cc,O);cc.prototype.a=function(a){var b=new H;q(this.c,function(c){c=c.a(a);if(!(c instanceof H))throw Error("Path expression must evaluate to NodeSet.");b=wb(b,c)});return b};cc.prototype.toString=function(){return t(this.c,function(a,b){return a+P(b)},"Union Expression:")};function dc(a,b){this.a=a;this.b=b}function ec(a){for(var b,c=[];;){Y(a,"Missing right hand side of binary expression.");b=fc(a);var d=E(a.a);if(!d)break;var e=(d=Fb[d]||null)&&d.A;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].A;)b=new Cb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Cb(c.pop(),c.pop(),b);return b}function Y(a,b){if(nb(a.a))throw Error(b);}function gc(a,b){var c=E(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);}
function hc(a){a=E(a.a);if(")"!=a)throw Error("Bad token: "+a);}function ic(a){a=E(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Mb(a)}function jc(a){var b=E(a.a),c=b.indexOf(":");if(-1==c)return new I(b);var d=b.substring(0,c);a=a.b(d);if(!a)throw Error("Namespace prefix not declared: "+d);b=b.substr(c+1);return new I(b,a)}
function kc(a){var b,c=[],d;if(Sb(D(a.a))){b=E(a.a);d=D(a.a);if("/"==b&&(nb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Qb;d=new Qb;Y(a,"Missing next location step.");b=lc(a,b);c.push(b)}else{a:{b=D(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":E(a.a);b=ec(a);Y(a,'unclosed "("');gc(a,")");break;case '"':case "'":b=ic(a);break;default:if(isNaN(+b))if(!Lb(b)&&/(?![0-9])[\w]/.test(d)&&"("==D(a.a,1)){b=E(a.a);
b=Kb[b]||null;E(a.a);for(d=[];")"!=D(a.a);){Y(a,"Missing function argument list.");d.push(ec(a));if(","!=D(a.a))break;E(a.a)}Y(a,"Unclosed function argument list.");hc(a);b=new Ib(b,d)}else{b=null;break a}else b=new Nb(+E(a.a))}"["==D(a.a)&&(d=new Vb(mc(a)),b=new Gb(b,d))}if(b)if(Sb(D(a.a)))d=b;else return b;else b=lc(a,"/"),d=new Rb,c.push(b)}for(;Sb(D(a.a));)b=E(a.a),Y(a,"Missing next location step."),b=lc(a,b),c.push(b);return new Ob(d,c)}
function lc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==D(a.a))return d=new W(ac,new K("node")),E(a.a),d;if(".."==D(a.a))return d=new W($b,new K("node")),E(a.a),d;var f;if("@"==D(a.a))f=Pb,E(a.a),Y(a,"Missing attribute name");else if("::"==D(a.a,1)){if(!/(?![0-9])[\w]/.test(D(a.a).charAt(0)))throw Error("Bad token: "+E(a.a));c=E(a.a);f=Zb[c]||null;if(!f)throw Error("No axis with name: "+c);E(a.a);Y(a,"Missing node name")}else f=Wb;c=D(a.a);if(/(?![0-9])[\w]/.test(c.charAt(0)))if("("==
D(a.a,1)){if(!Lb(c))throw Error("Invalid node type: "+c);c=E(a.a);if(!Lb(c))throw Error("Invalid type name: "+c);gc(a,"(");Y(a,"Bad nodetype");e=D(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=ic(a);Y(a,"Bad nodetype");hc(a);c=new K(c,g)}else c=jc(a);else if("*"==c)c=jc(a);else throw Error("Bad token: "+E(a.a));e=new Vb(mc(a),f.a);return d||new W(f,c,e,"//"==b)}
function mc(a){for(var b=[];"["==D(a.a);){E(a.a);Y(a,"Missing predicate expression.");var c=ec(a);b.push(c);Y(a,"Unclosed predicate expression.");gc(a,"]")}return b}function fc(a){if("-"==D(a.a))return E(a.a),new bc(fc(a));var b=kc(a);if("|"!=D(a.a))a=b;else{for(b=[b];"|"==E(a.a);)Y(a,"Missing next union location path."),b.push(kc(a));a.a.a--;a=new cc(b)}return a};function nc(a){switch(a.nodeType){case 1:return ja(oc,a);case 9:return nc(a.documentElement);case 11:case 10:case 6:case 12:return pc;default:return a.parentNode?nc(a.parentNode):pc}}function pc(){return null}function oc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?oc(a.parentNode,b):null};function qc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=kb(a);if(nb(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=ec(new dc(c,b));if(!nb(c))throw Error("Bad token: "+E(c));this.evaluate=function(a,b){var c=d.a(new z(a));return new Z(c,b)}}
function Z(a,b){if(0==b)if(a instanceof H)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof H))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof H?yb(a):""+a;break;case 1:this.numberValue=a instanceof H?+yb(a):+a;break;case 3:this.booleanValue=a instanceof H?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var d=
L(a);c=[];for(var e=M(d);e;e=M(d))c.push(e instanceof C?e.a:e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:d=xb(a);this.singleNodeValue=d instanceof C?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length||
0>a?null:c[a]}}Z.ANY_TYPE=0;Z.NUMBER_TYPE=1;Z.STRING_TYPE=2;Z.BOOLEAN_TYPE=3;Z.UNORDERED_NODE_ITERATOR_TYPE=4;Z.ORDERED_NODE_ITERATOR_TYPE=5;Z.UNORDERED_NODE_SNAPSHOT_TYPE=6;Z.ORDERED_NODE_SNAPSHOT_TYPE=7;Z.ANY_UNORDERED_NODE_TYPE=8;Z.FIRST_ORDERED_NODE_TYPE=9;function rc(a){this.lookupNamespaceURI=nc(a)}
aa("wgxpath.install",function(a){a=a||h;var b=a.document;b.evaluate||(a.XPathResult=Z,b.evaluate=function(a,b,e,f){return(new qc(a,e)).evaluate(b,f)},b.createExpression=function(a,b){return new qc(a,b)},b.createNSResolver=function(a){return new rc(a)})});function sc(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)};function tc(a){if(sc(a,"FRAME")||sc(a,"IFRAME")){var b;(b=a.contentWindow)||(b=(a=a.contentDocument||a.contentWindow.document)?a.parentWindow||a.defaultView:window);return b}throw new n(8,"The given element isn't a frame or an iframe.");};function uc(){}
function vc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),vc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),wc(d,c),c.push(":"),vc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":wc(b,c);break;case "number":c.push(isFinite(b)&&
!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var xc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},yc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
function wc(a,b){b.push('"',a.replace(yc,function(a){var b=xc[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),xc[a]=b);return b}),'"')};Ia||Ha&&(db?ab(3.5):x?0<=oa(y,3.5):Na(3.5))||x&&(db?ab(8):x?oa(y,8):Na(8));function zc(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return sa(a,zc);case "object":if(w(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Ac(a);return b}if(w(a,"document"))return b={},b.WINDOW=Ac(a),b;if(ea(a))return sa(a,zc);a=za(a,function(a,b){return"number"==typeof b||k(b)});return Aa(a,zc);default:return null}}
function Bc(a,b){return"array"==ba(a)?sa(a,function(a){return Bc(a,b)}):fa(a)?"function"==typeof a?a:w(a,"ELEMENT")?Cc(a.ELEMENT,b):w(a,"WINDOW")?Cc(a.WINDOW,b):Aa(a,function(a){return Bc(a,b)}):a}function Dc(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.u=ka());b.u||(b.u=ka());return b}function Ac(a){var b=Dc(a.ownerDocument),c=Ba(b,function(b){return b==a});c||(c=":wdc:"+b.u++,b[c]=a);return c}
function Cc(a,b){a=decodeURIComponent(a);var c=b||document,d=Dc(c);if(!w(d,a))throw new n(10,"Element does not exist in cache");var e=d[a];if(w(e,"setInterval")){if(e.closed)throw delete d[a],new n(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new n(10,"Element is no longer attached to the DOM");};aa("_",function(a){a=[a];var b=tc,c=window||ma,d;try{a:{var e=b;if(k(e))try{b=new c.Function(e);break a}catch(f){if(x&&c.execScript){c.execScript(";");b=new c.Function(e);break a}throw f;}b=c==window?e:new c.Function("return ("+e+").apply(null,arguments);")}var g=Bc(a,c.document),l=b.apply(null,g);d={status:0,value:zc(l)}}catch(r){d={status:w(r,"code")?r.code:13,value:{message:r.message}}}g=[];vc(new uc,d,g);return g.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);}