selenium-atoms
Version:
114 lines (109 loc) • 71.5 kB
JavaScript
function(){return function(){var h,aa=this;function l(a){return void 0!==a}function ba(a,b){var c=a.split("."),d=aa;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&l(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}}
function ca(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=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function fa(a){return"number"==typeof a}function ga(a){return"function"==ca(a)}function ha(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}var ia="closure_uid_"+(1E9*Math.random()>>>0),ja=0;function ka(a,b,c){return a.call.apply(a.bind,arguments)}
function la(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 ma(a,b,c){ma=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ka:la;return ma.apply(null,arguments)}
function na(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 oa=Date.now||function(){return+new Date};function p(a,b){function c(){}c.prototype=b.prototype;a.V=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.U=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};var pa=window;var qa;function ra(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var sa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};
function ta(a,b){for(var c=0,d=sa(String(a)).split("."),e=sa(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var k=d[g]||"",n=e[g]||"",v=RegExp("(\\d*)(\\D*)","g"),u=RegExp("(\\d*)(\\D*)","g");do{var E=v.exec(k)||["","",""],y=u.exec(n)||["","",""];if(0==E[0].length&&0==y[0].length)break;c=ua(0==E[1].length?0:parseInt(E[1],10),0==y[1].length?0:parseInt(y[1],10))||ua(0==E[2].length,0==y[2].length)||ua(E[2],y[2])}while(0==c)}return c}function ua(a,b){return a<b?-1:a>b?1:0}
function va(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};var wa=Array.prototype;function q(a,b,c){for(var d=a.length,e=m(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)}function xa(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var k=f[g];b.call(void 0,k,g,a)&&(d[e++]=k)}return d}function ya(a,b){for(var c=a.length,d=Array(c),e=m(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 za(a,b,c){var d=c;q(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}
function Ba(a,b){for(var c=a.length,d=m(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 Ca(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0}function Da(a,b){var c;a:{c=a.length;for(var d=m(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:m(a)?a.charAt(c):a[c]}
function Ea(a,b){var c;a:if(m(a))c=m(b)&&1==b.length?a.indexOf(b,0):-1;else{for(c=0;c<a.length;c++)if(c in a&&a[c]===b)break a;c=-1}return 0<=c}function Fa(a){return wa.concat.apply(wa,arguments)}function Ga(a,b,c){return 2>=arguments.length?wa.slice.call(a,b):wa.slice.call(a,b,c)};var Ha={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",
lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var Ia="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Ja=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Ka=/^#(?:[0-9a-f]{3}){1,2}$/i,La=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Ma=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function r(a,b){this.code=a;this.a=t[a]||Na;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||""}p(r,Error);var Na="unknown error",t={15:"element not selectable",11:"element not visible"};t[31]=Na;t[30]=Na;t[24]="invalid cookie domain";t[29]="invalid element coordinates";t[12]="invalid element state";
t[32]="invalid selector";t[51]="invalid selector";t[52]="invalid selector";t[17]="javascript error";t[405]="unsupported operation";t[34]="move target out of bounds";t[27]="no such alert";t[7]="no such element";t[8]="no such frame";t[23]="no such window";t[28]="script timeout";t[33]="session not created";t[10]="stale element reference";t[21]="timeout";t[25]="unable to set cookie";t[26]="unexpected alert open";t[13]=Na;t[9]="unknown command";r.prototype.toString=function(){return this.name+": "+this.message};var Oa;a:{var Pa=aa.navigator;if(Pa){var Qa=Pa.userAgent;if(Qa){Oa=Qa;break a}}Oa=""}function w(a){return-1!=Oa.indexOf(a)};function Ra(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Sa(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Ta(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Ua(a,b){return null!==a&&b in a}function Va(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Wa(){return w("Opera")||w("OPR")}function Xa(){return(w("Chrome")||w("CriOS"))&&!Wa()&&!w("Edge")};function Ya(){return w("iPhone")&&!w("iPod")&&!w("iPad")};var Za=Wa(),x=w("Trident")||w("MSIE"),$a=w("Edge"),z=w("Gecko")&&!(-1!=Oa.toLowerCase().indexOf("webkit")&&!w("Edge"))&&!(w("Trident")||w("MSIE"))&&!w("Edge"),ab=-1!=Oa.toLowerCase().indexOf("webkit")&&!w("Edge"),bb=ab&&w("Mobile"),cb=w("Macintosh"),db=w("Windows");function eb(){var a=Oa;if(z)return/rv\:([^\);]+)(\)|;)/.exec(a);if($a)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(ab)return/WebKit\/(\S+)/.exec(a)}
function fb(){var a=aa.document;return a?a.documentMode:void 0}var gb=function(){if(Za&&aa.opera){var a;var b=aa.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=eb())&&(a=b?b[1]:"");return x&&(b=fb(),b>parseFloat(a))?String(b):a}(),hb={};function ib(a){return hb[a]||(hb[a]=0<=ta(gb,a))}var jb=aa.document,kb=jb&&x?fb()||("CSS1Compat"==jb.compatMode?parseInt(gb,10):5):void 0;!z&&!x||x&&9<=kb||z&&ib("1.9.1");x&&ib("9");function lb(a,b,c){return Math.min(Math.max(a,b),c)};function mb(a,b){this.x=l(a)?a:0;this.y=l(b)?b:0}h=mb.prototype;h.clone=function(){return new mb(this.x,this.y)};h.toString=function(){return"("+this.x+", "+this.y+")"};h.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};h.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};h.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};h.scale=function(a,b){var c=fa(b)?b:a;this.x*=a;this.y*=c;return this};function nb(a,b){this.width=a;this.height=b}h=nb.prototype;h.clone=function(){return new nb(this.width,this.height)};h.toString=function(){return"("+this.width+" x "+this.height+")"};h.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};
h.scale=function(a,b){var c=fa(b)?b:a;this.width*=a;this.height*=c;return this};function ob(a){return a?new pb(A(a)):qa||(qa=new pb)}function qb(a){return a?a.parentWindow||a.defaultView:window}function rb(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function sb(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 tb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=kb)){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?ub(a,b):!c&&sb(e,b)?-1*vb(a,b):!d&&sb(f,a)?vb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=A(a);c=d.createRange();
c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(aa.Range.START_TO_END,d)}function vb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return ub(d,a)}function ub(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function A(a){return 9==a.nodeType?a:a.ownerDocument||a.document}var wb={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},xb={IMG:" ",BR:"\n"};
function yb(a,b,c){if(!(a.nodeName in wb))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in xb)b.push(xb[a.nodeName]);else for(a=a.firstChild;a;)yb(a,b,c),a=a.nextSibling}function zb(a,b,c){c||(a=a.parentNode);for(c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function pb(a){this.a=a||aa.document||document}
function Ab(a,b,c,d){a=d||a.a;b=b&&"*"!=b?b.toUpperCase():"";if(a.querySelectorAll&&a.querySelector&&(b||c))c=a.querySelectorAll(b+(c?"."+c:""));else if(c&&a.getElementsByClassName)if(a=a.getElementsByClassName(c),b){d={};for(var e=0,f=0,g;g=a[f];f++)b==g.nodeName&&(d[e++]=g);d.length=e;c=d}else c=a;else if(a=a.getElementsByTagName(b||"*"),c){d={};for(f=e=0;g=a[f];f++)b=g.className,"function"==typeof b.split&&Ea(b.split(/\s+/),c)&&(d[e++]=g);d.length=e;c=d}else c=a;return c}
pb.prototype.contains=sb;var Bb=w("Firefox"),Cb=Ya()||w("iPod"),Db=w("iPad"),Eb=w("Android")&&!(Xa()||w("Firefox")||Wa()||w("Silk")),Fb=Xa(),Gb=w("Safari")&&!(Xa()||w("Coast")||Wa()||w("Edge")||w("Silk")||w("Android"))&&!(Ya()||w("iPad")||w("iPod"));/*
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 Hb(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var Ib=x&&!(9<=kb),Jb=x&&!(8<=kb);function Kb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Lb(a,b){var c=Jb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Kb(b,a,b.nodeName,c)};function Mb(a){this.b=a;this.a=0}function Nb(a){a=a.match(Ob);for(var b=0;b<a.length;b++)Pb.test(a[b])&&a.splice(b,1);return new Mb(a)}var Ob=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Pb=/^\s/;function B(a,b){return a.b[a.a+(b||0)]}function C(a){return a.b[a.a++]}function Qb(a){return a.b.length<=a.a};function Rb(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(Ib&&"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),Ib&&"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 Sb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Jb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Tb(a,b,c,d,e){return(Ib?Ub:Vb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new D)}
function Ub(a,b,c,d,e){if(a instanceof Wb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Xb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],k=0;b=f[k++];)Sb(b,c,d)&&g.push(b);f=g}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||F(e,b);return e}Yb(a,b,c,d,e);return e}
function Vb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),q(b,function(b){a.a(b)&&F(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),q(b,function(b){b.className==d&&a.a(b)&&F(e,b)})):a instanceof Zb?Yb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),q(b,function(a){Sb(a,c,d)&&F(e,a)}));return e}
function $b(a,b,c,d,e){var f;if((a instanceof Wb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Xb(a);if("*"!=g&&(f=xa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=xa(f,function(a){return Sb(a,c,d)}));q(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||F(e,a)});return e}return ac(a,b,c,d,e)}function ac(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Sb(b,c,d)&&a.a(b)&&F(e,b);return e}
function Yb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Sb(b,c,d)&&a.a(b)&&F(e,b),Yb(a,b,c,d,e)}function Xb(a){if(a instanceof Zb){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function D(){this.b=this.a=null;this.o=0}function bc(a){this.node=a;this.a=this.b=null}function cc(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,k=d.node;f==k||f instanceof Kb&&k instanceof Kb&&f.a==k.a?(f=c,c=c.a,d=d.a):0<tb(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.o=g;return a}
D.prototype.unshift=function(a){a=new bc(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.o++};function F(a,b){var c=new bc(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.o++}function dc(a){return(a=a.a)?a.node:null}function ec(a){return(a=dc(a))?Rb(a):""}function fc(a,b){return new gc(a,!!b)}function gc(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function G(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 H(a){this.l=a;this.b=this.j=!1;this.f=null}function I(a){return"\n "+a.toString().split("\n").join("\n ")}function hc(a,b){a.j=b}function ic(a,b){a.b=b}function J(a,b){var c=a.a(b);return c instanceof D?+ec(c):+c}function K(a,b){var c=a.a(b);return c instanceof D?ec(c):""+c}function jc(a,b){var c=a.a(b);return c instanceof D?!!c.o:!!c};function kc(a,b,c){H.call(this,a.l);this.c=a;this.i=b;this.v=c;this.j=b.j||c.j;this.b=b.b||c.b;this.c==lc&&(c.b||c.j||4==c.l||0==c.l||!b.f?b.b||b.j||4==b.l||0==b.l||!c.f||(this.f={name:c.f.name,B:b}):this.f={name:b.f.name,B:c})}p(kc,H);
function mc(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof D&&c instanceof D){e=fc(b);for(d=G(e);d;d=G(e))for(b=fc(c),f=G(b);f;f=G(b))if(a(Rb(d),Rb(f)))return!0;return!1}if(b instanceof D||c instanceof D){b instanceof D?e=b:(e=c,c=b);e=fc(e);b=typeof c;for(d=G(e);d;d=G(e)){switch(b){case "number":d=+Rb(d);break;case "boolean":d=!!Rb(d);break;case "string":d=Rb(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)}kc.prototype.a=function(a){return this.c.u(this.i,this.v,a)};kc.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+I(this.i);return a+=I(this.v)};function nc(a,b,c,d){this.a=a;this.M=b;this.l=c;this.u=d}nc.prototype.toString=function(){return this.a};var oc={};
function L(a,b,c,d){if(oc.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new nc(a,b,c,d);return oc[a.toString()]=a}L("div",6,1,function(a,b,c){return J(a,c)/J(b,c)});L("mod",6,1,function(a,b,c){return J(a,c)%J(b,c)});L("*",6,1,function(a,b,c){return J(a,c)*J(b,c)});L("+",5,1,function(a,b,c){return J(a,c)+J(b,c)});L("-",5,1,function(a,b,c){return J(a,c)-J(b,c)});L("<",4,2,function(a,b,c){return mc(function(a,b){return a<b},a,b,c)});
L(">",4,2,function(a,b,c){return mc(function(a,b){return a>b},a,b,c)});L("<=",4,2,function(a,b,c){return mc(function(a,b){return a<=b},a,b,c)});L(">=",4,2,function(a,b,c){return mc(function(a,b){return a>=b},a,b,c)});var lc=L("=",3,2,function(a,b,c){return mc(function(a,b){return a==b},a,b,c,!0)});L("!=",3,2,function(a,b,c){return mc(function(a,b){return a!=b},a,b,c,!0)});L("and",2,2,function(a,b,c){return jc(a,c)&&jc(b,c)});L("or",1,2,function(a,b,c){return jc(a,c)||jc(b,c)});function pc(a,b){if(b.a.length&&4!=a.l)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");H.call(this,a.l);this.c=a;this.i=b;this.j=a.j;this.b=a.b}p(pc,H);pc.prototype.a=function(a){a=this.c.a(a);return qc(this.i,a)};pc.prototype.toString=function(){var a;a="Filter:"+I(this.c);return a+=I(this.i)};function rc(a,b){if(b.length<a.N)throw Error("Function "+a.m+" expects at least"+a.N+" arguments, "+b.length+" given");if(null!==a.G&&b.length>a.G)throw Error("Function "+a.m+" expects at most "+a.G+" arguments, "+b.length+" given");a.T&&q(b,function(b,d){if(4!=b.l)throw Error("Argument "+d+" to function "+a.m+" is not of type Nodeset: "+b);});H.call(this,a.l);this.i=a;this.c=b;hc(this,a.j||Ba(b,function(a){return a.j}));ic(this,a.S&&!b.length||a.R&&!!b.length||Ba(b,function(a){return a.b}))}
p(rc,H);rc.prototype.a=function(a){return this.i.u.apply(null,Fa(a,this.c))};rc.prototype.toString=function(){var a="Function: "+this.i;if(this.c.length)var b=za(this.c,function(a,b){return a+I(b)},"Arguments:"),a=a+I(b);return a};function sc(a,b,c,d,e,f,g,k,n){this.m=a;this.l=b;this.j=c;this.S=d;this.R=e;this.u=f;this.N=g;this.G=l(k)?k:g;this.T=!!n}sc.prototype.toString=function(){return this.m};var tc={};
function N(a,b,c,d,e,f,g,k){if(tc.hasOwnProperty(a))throw Error("Function already created: "+a+".");tc[a]=new sc(a,b,c,d,!1,e,f,g,k)}N("boolean",2,!1,!1,function(a,b){return jc(b,a)},1);N("ceiling",1,!1,!1,function(a,b){return Math.ceil(J(b,a))},1);N("concat",3,!1,!1,function(a,b){return za(Ga(arguments,1),function(b,d){return b+K(d,a)},"")},2,null);N("contains",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return-1!=b.indexOf(a)},2);N("count",1,!1,!1,function(a,b){return b.a(a).o},1,1,!0);
N("false",2,!1,!1,function(){return!1},0);N("floor",1,!1,!1,function(a,b){return Math.floor(J(b,a))},1);N("id",4,!1,!1,function(a,b){function c(a){if(Ib){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return Da(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=K(b,a).split(/\s+/),f=[];q(d,function(a){(a=c(a))&&!Ea(f,a)&&f.push(a)});f.sort(tb);var g=new D;q(f,function(a){F(g,a)});return g},1);
N("lang",2,!1,!1,function(){return!1},1);N("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);N("local-name",3,!1,!0,function(a,b){var c=b?dc(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);N("name",3,!1,!0,function(a,b){var c=b?dc(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);N("namespace-uri",3,!0,!1,function(){return""},0,1,!0);
N("normalize-space",3,!1,!0,function(a,b){return(b?K(b,a):Rb(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);N("not",2,!1,!1,function(a,b){return!jc(b,a)},1);N("number",1,!1,!0,function(a,b){return b?J(b,a):+Rb(a.a)},0,1);N("position",1,!0,!1,function(a){return a.b},0);N("round",1,!1,!1,function(a,b){return Math.round(J(b,a))},1);N("starts-with",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return 0==b.lastIndexOf(a,0)},2);N("string",3,!1,!0,function(a,b){return b?K(b,a):Rb(a.a)},0,1);
N("string-length",1,!1,!0,function(a,b){return(b?K(b,a):Rb(a.a)).length},0,1);N("substring",3,!1,!1,function(a,b,c,d){c=J(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?J(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=K(b,a);if(Infinity==d)return a.substring(e);b=Math.round(d);return a.substring(e,c+b)},2,3);N("substring-after",3,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
N("substring-before",3,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);N("sum",1,!1,!1,function(a,b){for(var c=fc(b.a(a)),d=0,e=G(c);e;e=G(c))d+=+Rb(e);return d},1,1,!0);N("translate",3,!1,!1,function(a,b,c,d){b=K(b,a);c=K(c,a);var e=K(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);N("true",2,!1,!1,function(){return!0},0);function Zb(a,b){this.i=a;this.c=l(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 uc(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}Zb.prototype.a=function(a){return null===this.b||this.b==a.nodeType};Zb.prototype.f=function(){return this.i};
Zb.prototype.toString=function(){var a="Kind Test: "+this.i;null===this.c||(a+=I(this.c));return a};function vc(a){H.call(this,3);this.c=a.substring(1,a.length-1)}p(vc,H);vc.prototype.a=function(){return this.c};vc.prototype.toString=function(){return"Literal: "+this.c};function Wb(a,b){this.m=a.toLowerCase();this.c=b?b.toLowerCase():"http://www.w3.org/1999/xhtml"}Wb.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.m&&this.m!=a.nodeName.toLowerCase()?!1:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Wb.prototype.f=function(){return this.m};Wb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.m};function wc(a){H.call(this,1);this.c=a}p(wc,H);wc.prototype.a=function(){return this.c};wc.prototype.toString=function(){return"Number: "+this.c};function xc(a,b){H.call(this,a.l);this.i=a;this.c=b;this.j=a.j;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.D||c.c!=yc||(c=c.v,"*"!=c.f()&&(this.f={name:c.f(),B:null}))}}p(xc,H);function zc(){H.call(this,4)}p(zc,H);zc.prototype.a=function(a){var b=new D;a=a.a;9==a.nodeType?F(b,a):F(b,a.ownerDocument);return b};zc.prototype.toString=function(){return"Root Helper Expression"};function Ac(){H.call(this,4)}p(Ac,H);Ac.prototype.a=function(a){var b=new D;F(b,a.a);return b};Ac.prototype.toString=function(){return"Context Helper Expression"};
function Bc(a){return"/"==a||"//"==a}xc.prototype.a=function(a){var b=this.i.a(a);if(!(b instanceof D))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.o;c++){var e=a[c],f=fc(b,e.c.a),g;if(e.j||e.c!=Cc)if(e.j||e.c!=Dc)for(g=G(f),b=e.a(new Hb(g));null!=(g=G(f));)g=e.a(new Hb(g)),b=cc(b,g);else g=G(f),b=e.a(new Hb(g));else{for(g=G(f);(b=G(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new Hb(g))}}return b};
xc.prototype.toString=function(){var a;a="Path Expression:"+I(this.i);if(this.c.length){var b=za(this.c,function(a,b){return a+I(b)},"Steps:");a+=I(b)}return a};function Ec(a,b){this.a=a;this.b=!!b}
function qc(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=fc(b),f=b.o,g,k=0;g=G(e);k++){var n=a.b?f-k:k+1;g=d.a(new Hb(g,n,f));if("number"==typeof g)n=n==g;else if("string"==typeof g||"boolean"==typeof g)n=!!g;else if(g instanceof D)n=0<g.o;else throw Error("Predicate.evaluate returned an unexpected type.");if(!n){n=e;g=n.f;var v=n.a;if(!v)throw Error("Next must be called at least once before remove.");var u=v.b,v=v.a;u?u.a=v:g.a=v;v?v.b=u:g.b=u;g.o--;n.a=null}}return b}
Ec.prototype.toString=function(){return za(this.a,function(a,b){return a+I(b)},"Predicates:")};function Fc(a,b,c,d){H.call(this,4);this.c=a;this.v=b;this.i=c||new Ec([]);this.D=!!d;b=this.i;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(a=b.name,a=Ib?a.toLowerCase():a,this.f={name:a,B:b.B});a:{a=this.i;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.j||1==c.l||0==c.l){a=!0;break a}a=!1}this.j=a}p(Fc,H);
Fc.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.B?K(c.B,a):null,f=1);if(this.D)if(this.j||this.c!=Gc)if(a=fc((new Fc(Hc,new Zb("node"))).a(a)),b=G(a))for(c=this.u(b,d,e,f);null!=(b=G(a));)c=cc(c,this.u(b,d,e,f));else c=new D;else c=Tb(this.v,b,d,e),c=qc(this.i,c,f);else c=this.u(a.a,d,e,f);return c};Fc.prototype.u=function(a,b,c,d){a=this.c.f(this.v,a,b,c);return a=qc(this.i,a,d)};
Fc.prototype.toString=function(){var a;a="Step:"+I("Operator: "+(this.D?"//":"/"));this.c.m&&(a+=I("Axis: "+this.c));a+=I(this.v);if(this.i.a.length){var b=za(this.i.a,function(a,b){return a+I(b)},"Predicates:");a+=I(b)}return a};function Ic(a,b,c,d){this.m=a;this.f=b;this.a=c;this.b=d}Ic.prototype.toString=function(){return this.m};var Jc={};function O(a,b,c,d){if(Jc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Ic(a,b,c,!!d);return Jc[a]=b}
O("ancestor",function(a,b){for(var c=new D,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);O("ancestor-or-self",function(a,b){var c=new D,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0);
var yc=O("attribute",function(a,b){var c=new D,d=a.f();if("style"==d&&b.style&&Ib)return F(c,new Kb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof Zb&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)Ib?f.nodeValue&&F(c,Lb(b,f)):F(c,f);else(f=e.getNamedItem(d))&&(Ib?f.nodeValue&&F(c,Lb(b,f)):F(c,f));return c},!1),Gc=O("child",function(a,b,c,d,e){return(Ib?$b:ac).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new D)},!1,!0);O("descendant",Tb,!1,!0);
var Hc=O("descendant-or-self",function(a,b,c,d){var e=new D;Sb(b,c,d)&&a.a(b)&&F(e,b);return Tb(a,b,c,d,e)},!1,!0),Cc=O("following",function(a,b,c,d){var e=new D;do for(var f=b;f=f.nextSibling;)Sb(f,c,d)&&a.a(f)&&F(e,f),e=Tb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);O("following-sibling",function(a,b){for(var c=new D,d=b;d=d.nextSibling;)a.a(d)&&F(c,d);return c},!1);O("namespace",function(){return new D},!1);
var Kc=O("parent",function(a,b){var c=new D;if(9==b.nodeType)return c;if(2==b.nodeType)return F(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&F(c,d);return c},!1),Dc=O("preceding",function(a,b,c,d){var e=new D,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var n=[];for(b=f[g];b=b.previousSibling;)n.unshift(b);for(var v=0,u=n.length;v<u;v++)b=n[v],Sb(b,c,d)&&a.a(b)&&F(e,b),e=Tb(a,b,c,d,e)}return e},!0,!0);
O("preceding-sibling",function(a,b){for(var c=new D,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Lc=O("self",function(a,b){var c=new D;a.a(b)&&F(c,b);return c},!1);function Mc(a){H.call(this,1);this.c=a;this.j=a.j;this.b=a.b}p(Mc,H);Mc.prototype.a=function(a){return-J(this.c,a)};Mc.prototype.toString=function(){return"Unary Expression: -"+I(this.c)};function Nc(a){H.call(this,4);this.c=a;hc(this,Ba(this.c,function(a){return a.j}));ic(this,Ba(this.c,function(a){return a.b}))}p(Nc,H);Nc.prototype.a=function(a){var b=new D;q(this.c,function(c){c=c.a(a);if(!(c instanceof D))throw Error("Path expression must evaluate to NodeSet.");b=cc(b,c)});return b};Nc.prototype.toString=function(){return za(this.c,function(a,b){return a+I(b)},"Union Expression:")};function Oc(a,b){this.a=a;this.b=b}function Pc(a){for(var b,c=[];;){P(a,"Missing right hand side of binary expression.");b=Qc(a);var d=C(a.a);if(!d)break;var e=(d=oc[d]||null)&&d.M;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].M;)b=new kc(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new kc(c.pop(),c.pop(),b);return b}function P(a,b){if(Qb(a.a))throw Error(b);}function Rc(a,b){var c=C(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);}
function Sc(a){a=C(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Tc(a){a=C(a.a);if(2>a.length)throw Error("Unclosed literal string");return new vc(a)}function Uc(a){var b=C(a.a),c=b.indexOf(":");if(-1==c)return new Wb(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 Wb(b,a)}
function Vc(a){var b,c=[],d;if(Bc(B(a.a))){b=C(a.a);d=B(a.a);if("/"==b&&(Qb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new zc;d=new zc;P(a,"Missing next location step.");b=Wc(a,b);c.push(b)}else{a:{b=B(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":C(a.a);b=Pc(a);P(a,'unclosed "("');Rc(a,")");break;case '"':case "'":b=Tc(a);break;default:if(isNaN(+b))if(!uc(b)&&/(?![0-9])[\w]/.test(d)&&"("==B(a.a,1)){b=C(a.a);
b=tc[b]||null;C(a.a);for(d=[];")"!=B(a.a);){P(a,"Missing function argument list.");d.push(Pc(a));if(","!=B(a.a))break;C(a.a)}P(a,"Unclosed function argument list.");Sc(a);b=new rc(b,d)}else{b=null;break a}else b=new wc(+C(a.a))}"["==B(a.a)&&(d=new Ec(Xc(a)),b=new pc(b,d))}if(b)if(Bc(B(a.a)))d=b;else return b;else b=Wc(a,"/"),d=new Ac,c.push(b)}for(;Bc(B(a.a));)b=C(a.a),P(a,"Missing next location step."),b=Wc(a,b),c.push(b);return new xc(d,c)}
function Wc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==B(a.a))return d=new Fc(Lc,new Zb("node")),C(a.a),d;if(".."==B(a.a))return d=new Fc(Kc,new Zb("node")),C(a.a),d;var f;if("@"==B(a.a))f=yc,C(a.a),P(a,"Missing attribute name");else if("::"==B(a.a,1)){if(!/(?![0-9])[\w]/.test(B(a.a).charAt(0)))throw Error("Bad token: "+C(a.a));c=C(a.a);f=Jc[c]||null;if(!f)throw Error("No axis with name: "+c);C(a.a);P(a,"Missing node name")}else f=Gc;c=B(a.a);if(/(?![0-9])[\w]/.test(c.charAt(0)))if("("==
B(a.a,1)){if(!uc(c))throw Error("Invalid node type: "+c);c=C(a.a);if(!uc(c))throw Error("Invalid type name: "+c);Rc(a,"(");P(a,"Bad nodetype");e=B(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Tc(a);P(a,"Bad nodetype");Sc(a);c=new Zb(c,g)}else c=Uc(a);else if("*"==c)c=Uc(a);else throw Error("Bad token: "+C(a.a));e=new Ec(Xc(a),f.a);return d||new Fc(f,c,e,"//"==b)}
function Xc(a){for(var b=[];"["==B(a.a);){C(a.a);P(a,"Missing predicate expression.");var c=Pc(a);b.push(c);P(a,"Unclosed predicate expression.");Rc(a,"]")}return b}function Qc(a){if("-"==B(a.a))return C(a.a),new Mc(Qc(a));var b=Vc(a);if("|"!=B(a.a))a=b;else{for(b=[b];"|"==C(a.a);)P(a,"Missing next union location path."),b.push(Vc(a));a.a.a--;a=new Nc(b)}return a};function Yc(a){switch(a.nodeType){case 1:return na(Zc,a);case 9:return Yc(a.documentElement);case 11:case 10:case 6:case 12:return $c;default:return a.parentNode?Yc(a.parentNode):$c}}function $c(){return null}function Zc(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?Zc(a.parentNode,b):null};function ad(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Nb(a);if(Qb(c))throw Error("Invalid XPath expression.");b?ga(b)||(b=ma(b.lookupNamespaceURI,b)):b=function(){return null};var d=Pc(new Oc(c,b));if(!Qb(c))throw Error("Bad token: "+C(c));this.evaluate=function(a,b){var c=d.a(new Hb(a));return new Q(c,b)}}
function Q(a,b){if(0==b)if(a instanceof D)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 D))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof D?ec(a):""+a;break;case 1:this.numberValue=a instanceof D?+ec(a):+a;break;case 3:this.booleanValue=a instanceof D?0<a.o:!!a;break;case 4:case 5:case 6:case 7:var d=
fc(a);c=[];for(var e=G(d);e;e=G(d))c.push(e instanceof Kb?e.a:e);this.snapshotLength=a.o;this.invalidIteratorState=!1;break;case 8:case 9:d=dc(a);this.singleNodeValue=d instanceof Kb?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]}}Q.ANY_TYPE=0;Q.NUMBER_TYPE=1;Q.STRING_TYPE=2;Q.BOOLEAN_TYPE=3;Q.UNORDERED_NODE_ITERATOR_TYPE=4;Q.ORDERED_NODE_ITERATOR_TYPE=5;Q.UNORDERED_NODE_SNAPSHOT_TYPE=6;Q.ORDERED_NODE_SNAPSHOT_TYPE=7;Q.ANY_UNORDERED_NODE_TYPE=8;Q.FIRST_ORDERED_NODE_TYPE=9;function bd(a){this.lookupNamespaceURI=Yc(a)}
function cd(a){a=a||aa;var b=a.document;b.evaluate||(a.XPathResult=Q,b.evaluate=function(a,b,e,f){return(new ad(a,e)).evaluate(b,f)},b.createExpression=function(a,b){return new ad(a,b)},b.createNSResolver=function(a){return new bd(a)})}ba("wgxpath.install",cd);var R={};R.H=function(){var a={W:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();
R.u=function(a,b,c){var d=A(a);if(!d.documentElement)return null;(x||Eb)&&cd(qb(d));try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):R.H;if(x&&!ib(7))return d.evaluate.call(d,b,a,e,c,null);if(!x||9<=kb){for(var f={},g=d.getElementsByTagName("*"),k=0;k<g.length;++k){var n=g[k],v=n.namespaceURI;if(v&&!f[v]){var u=n.lookupPrefix(v);if(!u){var E=v.match(".*/(\\w+)/?$");E?u=E[1]:u="xhtml"}f[v]=u}}var y={},M;for(M in f)y[f[M]]=M;e=function(a){return y[a]||null}}try{return d.evaluate(b,
a,e,c,null)}catch(da){if("TypeError"===da.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):R.H,d.evaluate(b,a,e,c,null);throw da;}}catch(Aa){if(!z||"NS_ERROR_ILLEGAL_VALUE"!=Aa.name)throw new r(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+Aa);}};R.I=function(a,b){if(!a||1!=a.nodeType)throw new r(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};
R.w=function(a,b){var c=function(){var c=R.u(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=A(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||R.I(c,a);return c};
R.s=function(a,b){var c=function(){var c=R.u(b,a,7);if(c){for(var e=c.snapshotLength,f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=A(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();q(c,function(b){R.I(b,a)});return c};function dd(a){return(a=a.exec(Oa))?a[1]:""}var ed=function(){if(Bb)return dd(/Firefox\/([0-9.]+)/);if(x||$a||Za)return gb;if(Fb)return dd(/Chrome\/([0-9.]+)/);if(Gb&&!(Ya()||w("iPad")||w("iPod")))return dd(/Version\/([0-9.]+)/);if(Cb||Db){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(Oa))return a[1]+"."+a[2]}else if(Eb)return(a=dd(/Android\s+([0-9.]+)/))?a:dd(/Version\/([0-9.]+)/);return""}();var fd,gd;function hd(a){return id?fd(a):x?0<=ta(kb,a):ib(a)}function jd(a){return id?gd(a):Eb?0<=ta(kd,a):0<=ta(ed,a)}
var id=function(){if(!z)return!1;var a=aa.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;fd=function(a){return 0<=d.compare(e,""+a)};gd=function(a){return 0<=d.compare(f,""+a)};return!0}(),ld=Db||Cb,md;
if(Eb){var nd=/Android\s+([0-9\.]+)/.exec(Oa);md=nd?nd[1]:"0"}else md="0";var kd=md,od=x&&!(8<=kb),pd=x&&!(9<=kb);Eb&&jd(2.3);Eb&&jd(4);Gb&&jd(6);function qd(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}h=qd.prototype;h.clone=function(){return new qd(this.top,this.right,this.bottom,this.left)};h.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};h.contains=function(a){return this&&a?a instanceof qd?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1};
h.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};h.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};h.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};
h.scale=function(a,b){var c=fa(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function S(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}h=S.prototype;h.clone=function(){return new S(this.left,this.top,this.width,this.height)};h.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};h.contains=function(a){return a instanceof S?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};
h.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};
h.scale=function(a,b){var c=fa(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function rd(a,b){var c=A(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}var sd={thin:2,medium:4,thick:6};
function td(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null,d;if(c in sd)d=sd[c];else if(/^\d+px?$/.test(c))d=parseInt(c,10);else{d=a.style.left;var e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=c;c=a.style.pixelLeft;a.style.left=d;a.runtimeStyle.left=e;d=c}return d};function ud(a){var b;a:{a=A(a);try{b=a&&a.activeElement;break a}catch(c){}b=null}return x&&b&&"undefined"===typeof b.nodeType?null:b}function T(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function vd(a){var b;if(b=wd(a,!0)&&xd(a))b=!(x||z&&!hd("1.9.2")?0:"none"==U(a,"pointer-events"));return b}function yd(a,b){var c;if(c=od&&"value"==b&&T(a,"OPTION"))c=null===zd(a,"value");c?(c=[],yb(a,c,!1),c=c.join("")):c=a[b];return c}var Ad=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/;
function Bd(a){var b=[];q(a.split(Ad),function(a){var d=a.indexOf(":");0<d&&(a=[a.slice(0,d),a.slice(d+1)],2==a.length&&b.push(a[0].toLowerCase(),":",a[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}function zd(a,b){b=b.toLowerCase();if("style"==b)return Bd(a.style.cssText);if(od&&"value"==b&&T(a,"INPUT"))return a.value;if(pd&&!0===a[b])return String(a.getAttribute(b));var c=a.getAttributeNode(b);return c&&c.specified?c.value:null}var Cd="BUTTON INPUT OPTGROUP OPTION SELECT TEXTAREA".split(" ");
function xd(a){var b=a.tagName.toUpperCase();return Ea(Cd,b)?yd(a,"disabled")?!1:a.parentNode&&1==a.parentNode.nodeType&&"OPTGROUP"==b||"OPTION"==b?xd(a.parentNode):!zb(a,function(a){var b=a.parentNode;if(b&&T(b,"FIELDSET")&&yd(b,"disabled")){if(!T(a,"LEGEND"))return!0;for(;a=l(a.previousElementSibling)?a.previousElementSibling:rb(a.previousSibling);)if(T(a,"LEGEND"))return!0}return!1},!0):!0}var Dd="text search tel url email password number".split(" ");
function Ed(a){function b(a){return"inherit"==a.contentEditable?(a=Fd(a))?b(a):!1:"true"==a.contentEditable}return l(a.contentEditable)?!x&&l(a.isContentEditable)?a.isContentEditable:b(a):!1}function Gd(a){return((T(a,"TEXTAREA")?!0:T(a,"INPUT")?Ea(Dd,a.type.toLowerCase()):Ed(a)?!0:!1)||(T(a,"INPUT")?"file"==a.type.toLowerCase():!1))&&!yd(a,"readOnly")}function Fd(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return T(a)?a:null}
function U(a,b){var c=va(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=pd?"styleFloat":"cssFloat";var d=rd(a,c)||Hd(a,c);if(null===d)d=null;else if(Ea(Ia,c)){b:{var e=d.match(La);if(e){var c=Number(e[1]),f=Number(e[2]),g=Number(e[3]),e=Number(e[4]);if(0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g&&0<=e&&1>=e){c=[c,f,g,e];break b}}c=null}if(!c)b:{if(g=d.match(Ma))if(c=Number(g[1]),f=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g){c=[c,f,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase();
f=Ha[c.toLowerCase()];if(!f&&(f="#"==c.charAt(0)?c:"#"+c,4==f.length&&(f=f.replace(Ja,"#$1$1$2$2$3$3")),!Ka.test(f))){c=null;break b}c=[parseInt(f.substr(1,2),16),parseInt(f.substr(3,2),16),parseInt(f.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d}function Hd(a,b){var c=a.currentStyle||a.style,d=c[b];!l(d)&&ga(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?l(d)?d:null:(c=Fd(a))?Hd(c,b):null}
function Id(a,b,c){function d(a){var b=Jd(a);return 0<b.height&&0<b.width?!0:T(a,"PATH")&&(0<b.height||0<b.width)?(a=U(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=U(a,"overflow")&&Ba(a.childNodes,function(a){return 3==a.nodeType||T(a)&&d(a)})}function e(a){return Kd(a)==Ld&&Ca(a.childNodes,function(a){return!T(a)||e(a)||!d(a)})}if(!T(a))throw Error("Argument to isShown must be of type Element");if(T(a,"BODY"))return!0;if(T(a,"OPTION")||T(a,"OPTGROUP"))return a=zb(a,function(a){return T(a,"SELECT")}),
!!a&&Id(a,!0,c);var f=Md(a);if(f)return!!f.J&&0<f.rect.width&&0<f.rect.height&&Id(f.J,b,c);if(T(a,"INPUT")&&"hidden"==a.type.toLowerCase()||T(a,"NOSCRIPT"))return!1;f=U(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=Nd(a))&&d(a)?!e(a):!1}function wd(a,b){function c(a){if("none"==U(a,"display"))return!1;a=Fd(a);return!a||c(a)}return Id(a,!!b,c)}var Ld="hidden";
function Kd(a,b){function c(a){function b(a){return a==k?!0:0==U(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==U(a,"position")?!1:!0}var c=U(a,"position");if("fixed"==c)return u=!0,a==k?null:k;for(a=Fd(a);a&&!b(a);)a=Fd(a);return a}function d(a){var b=a;if("visible"==v)if(a==k&&n)b=n;else if(a==n)return{x:"visible",y:"visible"};b={x:U(b,"overflow-x"),y:U(b,"overflow-y")};a==k&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function e(a){if(a==k){var b=(new pb(g)).a;
a=b.scrollingElement?b.scrollingElement:ab||"CSS1Compat"!=b.compatMode?b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=x&&ib("10")&&b.pageYOffset!=a.scrollTop?new mb(a.scrollLeft,a.scrollTop):new mb(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new mb(a.scrollLeft,a.scrollTop);return a}for(var f=Od(a,b),g=A(a),k=g.documentElement,n=g.body,v=U(k,"overflow"),u,E=c(a);E;E=c(E)){var y=d(E);if("visible"!=y.x||"visible"!=y.y){var M=Jd(E);if(0==M.width||0==
M.height)return Ld;var da=f.right<M.left,Aa=f.bottom<M.top;if(da&&"hidden"==y.x||Aa&&"hidden"==y.y)return Ld;if(da&&"visible"!=y.x||Aa&&"visible"!=y.y){da=e(E);Aa=f.bottom<M.top-da.y;if(f.right<M.left-da.x&&"visible"!=y.x||Aa&&"visible"!=y.x)return Ld;f=Kd(E);return f==Ld?Ld:"scroll"}da=f.left>=M.left+M.width;M=f.top>=M.top+M.height;if(da&&"hidden"==y.x||M&&"hidden"==y.y)return Ld;if(da&&"visible"!=y.x||M&&"visible"!=y.y){if(u&&(y=e(E),f.left>=k.scrollWidth-y.x||f.right>=k.scrollHeight-y.y))return Ld;
f=Kd(E);return f==Ld?Ld:"scroll"}}}return"none"}
function Jd(a){var b=Md(a);if(b)return b.rect;if(T(a,"HTML"))return a=A(a),a=(qb(a)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new nb(a.clientWidth,a.clientHeight),new S(0,0,a.width,a.height);var c;try{c=a.getBoundingClientRect()}catch(d){return new S(0,0,0,0)}b=new S(c.left,c.top,c.right-c.left,c.bottom-c.top);x&&a.ownerDocument.body&&(a=A(a),b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b}
function Md(a){var b=T(a,"MAP");if(!b&&!T(a,"AREA"))return null;var c=b?a:T(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;if(c&&c.name&&(d=R.w('/descendant::*[@usemap = "#'+c.name+'"]',A(c)))&&(e=Jd(d),!b&&"default"!=a.shape.toLowerCase())){var f=Pd(a);a=Math.min(Math.max(f.left,0),e.width);b=Math.min(Math.max(f.top,0),e.height);c=Math.min(f.width,e.width-a);f=Math.min(f.height,e.height-b);e=new S(a+e.left,b+e.top,c,f)}return{J:d,rect:e||new S(0,0,0,0)}}
function Pd(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new S(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new S(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new S(b,c,d-b,e-c)}return new S(0,0,0,0)}
function Od(a,b){var c;c=Jd(a);c=new qd(c.top,c.left+c.width,c.top+c.height,c.left);if(b){var d=b instanceof S?b:new S(b.x,b.y,1,1);c.left=lb(c.left+d.left,c.left,c.right);c.top=lb(c.top+d.top,c.top,c.bottom);c.right=lb(c.left+d.width,c.left,c.right);c.bottom=lb(c.top+d.height,c.top,c.bottom)}return c}function Qd(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")}function Rd(a){var b=[];Sd(a,b);a=ya(b,Qd);return Qd(a.join("\n")).replace(/\xa0/g," ")}
function Td(a,b,c){var d=wd;if(T(a,"BR"))b.push("");else{var e=T(a,"TD"),f=U(a,"display"),g=!e&&!Ea(Ud,f),k=l(a.previousElementSibling)?a.previousElementSibling:rb(a.previousSibling),k=k?U(k,"display"):"",n=U(a,"float")||U(a,"cssFloat")||U(a,"styleFloat");!g||"run-in"==k&&"none"==n||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var v=d(a),u=null,E=null;v&&(u=U(a,"white-space"),E=U(a,"text-transform"));q(a.childNodes,function(a){c(a,b,v,u,E)});a=b[b.length-1]||"";!e&&"table-cell"!=f||!a||ra(a)||
(b[b.length-1]+=" ");g&&"run-in"!=f&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function Sd(a,b){Td(a,b,function(a,b,e,f,g){3==a.