slimerjs-firefox
Version:
This repo includes slimerjs as well as downloads a local copy of Firefox.
93 lines • 51.2 kB
JavaScript
function(){return function(){function h(a){return function(){return this[a]}}function k(a){return function(){return a}}var n=this;
function aa(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 ba(a){var b=aa(a);return"array"==b||"object"==b&&"number"==typeof a.length}function p(a){return"string"==typeof a}function ca(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function da(a,b,c){return a.call.apply(a.bind,arguments)}
function ea(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 fa(a,b,c){fa=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?da:ea;return fa.apply(null,arguments)}
function ga(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=Array.prototype.slice.call(arguments);b.unshift.apply(b,c);return a.apply(this,b)}}var ha=Date.now||function(){return+new Date};function s(a,b){function c(){}c.prototype=b.prototype;a.wa=b.prototype;a.prototype=new c};function ia(a,b){for(var c=0,d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=String(b).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var q=d[g]||"",u=e[g]||"",U=RegExp("(\\d*)(\\D*)","g"),r=RegExp("(\\d*)(\\D*)","g");do{var l=U.exec(q)||["","",""],m=r.exec(u)||["","",""];if(0==l[0].length&&0==m[0].length)break;c=((0==l[1].length?0:parseInt(l[1],10))<(0==m[1].length?0:parseInt(m[1],10))?-1:(0==l[1].length?0:parseInt(l[1],10))>(0==m[1].length?
0:parseInt(m[1],10))?1:0)||((0==l[2].length)<(0==m[2].length)?-1:(0==l[2].length)>(0==m[2].length)?1:0)||(l[2]<m[2]?-1:l[2]>m[2]?1:0)}while(0==c)}return c}function ja(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};var ka=Array.prototype;function t(a,b){for(var c=a.length,d=p(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function la(a,b){for(var c=a.length,d=[],e=0,f=p(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var q=f[g];b.call(void 0,q,g,a)&&(d[e++]=q)}return d}function ma(a,b){for(var c=a.length,d=Array(c),e=p(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 na(a,b,c){if(a.reduce)return a.reduce(b,c);var d=c;t(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function oa(a,b){for(var c=a.length,d=p(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 pa(a,b){for(var c=a.length,d=p(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 qa(a,b){var c;a:{c=a.length;for(var d=p(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:p(a)?a.charAt(c):a[c]}function ra(a,b){var c;a:if(p(a))c=p(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 sa(a){return ka.concat.apply(ka,arguments)}function ta(a,b,c){return 2>=arguments.length?ka.slice.call(a,b):ka.slice.call(a,b,c)};var ua={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 va="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),wa=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,xa=/^#(?:[0-9a-f]{3}){1,2}$/i,ya=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,za=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function Aa(a,b){this.code=a;this.state=Ba[a]||Ha;this.message=b||"";var c=this.state.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||""}s(Aa,Error);
var Ha="unknown error",Ba={15:"element not selectable",11:"element not visible",31:"ime engine activation failed",30:"ime not available",24:"invalid cookie domain",29:"invalid element coordinates",12:"invalid element state",32:"invalid selector",51:"invalid selector",52:"invalid selector",17:"javascript error",405:"unsupported operation",34:"move target out of bounds",27:"no such alert",7:"no such element",8:"no such frame",23:"no such window",28:"script timeout",33:"session not created",10:"stale element reference",
0:"success",21:"timeout",25:"unable to set cookie",26:"unexpected alert open"};Ba[13]=Ha;Ba[9]="unknown command";Aa.prototype.toString=function(){return this.name+": "+this.message};var Ia,Ja,Ka,La,Ma,Na;function Oa(){return n.navigator?n.navigator.userAgent:null}La=Ka=Ja=Ia=!1;var Pa;if(Pa=Oa()){var Qa=n.navigator;Ia=0==Pa.indexOf("Opera");Ja=!Ia&&-1!=Pa.indexOf("MSIE");Ka=!Ia&&-1!=Pa.indexOf("WebKit");La=!Ia&&!Ka&&"Gecko"==Qa.product}var v=Ia,w=Ja,x=La,Ra=Ka,Sa,Ta=n.navigator;Sa=Ta&&Ta.platform||"";Ma=-1!=Sa.indexOf("Mac");Na=-1!=Sa.indexOf("Win");var Ua=-1!=Sa.indexOf("Linux");function Va(){var a=n.document;return a?a.documentMode:void 0}var Wa;
a:{var Xa="",Ya;if(v&&n.opera)var Za=n.opera.version,Xa="function"==typeof Za?Za():Za;else if(x?Ya=/rv\:([^\);]+)(\)|;)/:w?Ya=/MSIE\s+([^\);]+)(\)|;)/:Ra&&(Ya=/WebKit\/(\S+)/),Ya)var $a=Ya.exec(Oa()),Xa=$a?$a[1]:"";if(w){var ab=Va();if(ab>parseFloat(Xa)){Wa=String(ab);break a}}Wa=Xa}var bb={};function cb(a){return bb[a]||(bb[a]=0<=ia(Wa,a))}var db=n.document,eb=db&&w?Va()||("CSS1Compat"==db.compatMode?parseInt(Wa,10):5):void 0;!x&&!w||w&&w&&9<=eb||x&&cb("1.9.1");w&&cb("9");function fb(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}fb.prototype.toString=function(){return"("+this.x+", "+this.y+")"};fb.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};fb.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};fb.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function gb(a,b){this.width=a;this.height=b}gb.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};gb.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};gb.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};gb.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function hb(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function ib(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function jb(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};var kb=3;function lb(a){a=a.document;a="CSS1Compat"==a.compatMode?a.documentElement:a.body;return new gb(a.clientWidth,a.clientHeight)}function mb(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 nb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(w&&!(w&&9<=eb)){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?ob(a,b):!c&&mb(e,b)?-1*pb(a,b):!d&&mb(f,a)?pb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=y(a);c=d.createRange();
c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(n.Range.START_TO_END,d)}function pb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return ob(d,a)}function ob(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function y(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function qb(a,b){a=a.parentNode;for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}
function rb(a){this.ja=a||n.document||document}rb.prototype.contains=mb;var sb,tb,ub,vb,wb,xb,yb;yb=xb=wb=vb=ub=tb=sb=!1;var z=Oa();z&&(-1!=z.indexOf("Firefox")?sb=!0:-1!=z.indexOf("Camino")?tb=!0:-1!=z.indexOf("iPhone")||-1!=z.indexOf("iPod")?ub=!0:-1!=z.indexOf("iPad")?vb=!0:-1!=z.indexOf("Android")?wb=!0:-1!=z.indexOf("Chrome")?xb=!0:-1!=z.indexOf("Safari")&&(yb=!0));var zb=sb,Ab=tb,Bb=ub,Cb=vb,Db=wb,Eb=xb,Fb=yb;function Gb(a,b,c){this.e=a;this.qa=b||1;this.m=c||1};var A=w&&!(w&&9<=eb),Hb=w&&!(w&&8<=eb);function Ib(a,b,c,d,e){this.e=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.ownerElement=b;this.ua=e;this.parentNode=b}function Jb(a,b,c){var d=Hb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Ib(b,a,b.nodeName,d,c)};function Kb(a){this.S=a;this.G=0}function Lb(a){a=a.match(Mb);for(var b=0;b<a.length;b++)Nb.test(a[b])&&a.splice(b,1);return new Kb(a)}var Mb=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Nb=/^\s/;function B(a,b){return a.S[a.G+(b||0)]}Kb.prototype.next=function(){return this.S[this.G++]};Kb.prototype.back=function(){this.G--};Kb.prototype.empty=function(){return this.S.length<=this.G};function C(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 D(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,p(c)?c:null,p(d)?d:null,e||new E)}
function Pb(a,b,c,d,e){if(a instanceof Rb||8==a.l||c&&null===a.l){var f=b.all;if(!f)return e;a=Sb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],q=0;b=f[q++];)D(b,c,d)&&g.push(b);f=g}for(q=0;b=f[q++];)"*"==a&&"!"==b.tagName||e.add(b);return e}Tb(a,b,c,d,e);return e}
function Qb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!w?(b=b.getElementsByName(d),t(b,function(b){a.matches(b)&&e.add(b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),t(b,function(b){b.className==d&&a.matches(b)&&e.add(b)})):a instanceof F?Tb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.getName()),t(b,function(a){D(a,c,d)&&e.add(a)}));return e}
function Ub(a,b,c,d,e){var f;if((a instanceof Rb||8==a.l||c&&null===a.l)&&(f=b.childNodes)){var g=Sb(a);if("*"!=g&&(f=la(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=la(f,function(a){return D(a,c,d)}));t(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||e.add(a)});return e}return Vb(a,b,c,d,e)}function Vb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)D(b,c,d)&&a.matches(b)&&e.add(b);return e}
function Tb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)D(b,c,d)&&a.matches(b)&&e.add(b),Tb(a,b,c,d,e)}function Sb(a){if(a instanceof F){if(8==a.l)return"!";if(null===a.l)return"*"}return a.getName()};function E(){this.m=this.i=null;this.B=0}function Wb(a){this.p=a;this.next=this.u=null}function Xb(a,b){if(!a.i)return b;if(!b.i)return a;for(var c=a.i,d=b.i,e=null,f=null,g=0;c&&d;)c.p==d.p||c.p instanceof Ib&&d.p instanceof Ib&&c.p.e==d.p.e?(f=c,c=c.next,d=d.next):0<nb(c.p,d.p)?(f=d,d=d.next):(f=c,c=c.next),(f.u=e)?e.next=f:a.i=f,e=f,g++;for(f=c||d;f;)f.u=e,e=e.next=f,g++,f=f.next;a.m=e;a.B=g;return a}
E.prototype.unshift=function(a){a=new Wb(a);a.next=this.i;this.m?this.i.u=a:this.i=this.m=a;this.i=a;this.B++};E.prototype.add=function(a){a=new Wb(a);a.u=this.m;this.i?this.m.next=a:this.i=this.m=a;this.m=a;this.B++};function Yb(a){return(a=a.i)?a.p:null}E.prototype.o=h("B");function Zb(a){return(a=Yb(a))?C(a):""}function G(a,b){return new $b(a,!!b)}function $b(a,b){this.ma=a;this.T=(this.v=b)?a.m:a.i;this.N=null}
$b.prototype.next=function(){var a=this.T;if(null==a)return null;var b=this.N=a;this.T=this.v?a.u:a.next;return b.p};$b.prototype.remove=function(){var a=this.ma,b=this.N;if(!b)throw Error("Next must be called at least once before remove.");var c=b.u,b=b.next;c?c.next=b:a.i=b;b?b.u=c:a.m=c;a.B--;this.N=null};function H(a){this.h=a;this.j=this.q=!1;this.C=null}function I(a){return"\n "+a.toString().split("\n").join("\n ")}H.prototype.f=h("q");function ac(a,b){a.q=b}function bc(a,b){a.j=b}H.prototype.s=h("C");function J(a,b){var c=a.evaluate(b);return c instanceof E?+Zb(c):+c}function K(a,b){var c=a.evaluate(b);return c instanceof E?Zb(c):""+c}function cc(a,b){var c=a.evaluate(b);return c instanceof E?!!c.o():!!c};function dc(a,b,c){H.call(this,a.h);this.R=a;this.X=b;this.ba=c;this.q=b.f()||c.f();this.j=b.j||c.j;this.R==ec&&(c.j||c.f()||4==c.h||0==c.h||!b.s()?b.j||(b.f()||4==b.h||0==b.h||!c.s())||(this.C={name:c.s().name,w:b}):this.C={name:b.s().name,w:c})}s(dc,H);
function fc(a,b,c,d,e){b=b.evaluate(d);c=c.evaluate(d);var f;if(b instanceof E&&c instanceof E){e=G(b);for(d=e.next();d;d=e.next())for(b=G(c),f=b.next();f;f=b.next())if(a(C(d),C(f)))return!0;return!1}if(b instanceof E||c instanceof E){b instanceof E?e=b:(e=c,c=b);e=G(e);b=typeof c;for(d=e.next();d;d=e.next()){switch(b){case "number":d=+C(d);break;case "boolean":d=!!C(d);break;case "string":d=C(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)}dc.prototype.evaluate=function(a){return this.R.n(this.X,this.ba,a)};dc.prototype.toString=function(){var a="Binary Expression: "+this.R,a=a+I(this.X);return a+=I(this.ba)};function gc(a,b,c,d){this.pa=a;this.$=b;this.h=c;this.n=d}gc.prototype.toString=h("pa");var hc={};
function L(a,b,c,d){if(hc.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new gc(a,b,c,d);return hc[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 fc(function(a,b){return a<b},a,b,c)});
L(">",4,2,function(a,b,c){return fc(function(a,b){return a>b},a,b,c)});L("<=",4,2,function(a,b,c){return fc(function(a,b){return a<=b},a,b,c)});L(">=",4,2,function(a,b,c){return fc(function(a,b){return a>=b},a,b,c)});var ec=L("=",3,2,function(a,b,c){return fc(function(a,b){return a==b},a,b,c,!0)});L("!=",3,2,function(a,b,c){return fc(function(a,b){return a!=b},a,b,c,!0)});L("and",2,2,function(a,b,c){return cc(a,c)&&cc(b,c)});L("or",1,2,function(a,b,c){return cc(a,c)||cc(b,c)});function ic(a,b){if(b.o()&&4!=a.h)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");H.call(this,a.h);this.aa=a;this.d=b;this.q=a.f();this.j=a.j}s(ic,H);ic.prototype.evaluate=function(a){a=this.aa.evaluate(a);return jc(this.d,a)};ic.prototype.toString=function(){var a;a="Filter:"+I(this.aa);return a+=I(this.d)};function kc(a,b){if(b.length<a.Z)throw Error("Function "+a.k+" expects at least"+a.Z+" arguments, "+b.length+" given");if(null!==a.O&&b.length>a.O)throw Error("Function "+a.k+" expects at most "+a.O+" arguments, "+b.length+" given");a.na&&t(b,function(b,d){if(4!=b.h)throw Error("Argument "+d+" to function "+a.k+" is not of type Nodeset: "+b);});H.call(this,a.h);this.F=a;this.K=b;ac(this,a.q||oa(b,function(a){return a.f()}));bc(this,a.la&&!b.length||a.ka&&!!b.length||oa(b,function(a){return a.j}))}
s(kc,H);kc.prototype.evaluate=function(a){return this.F.n.apply(null,sa(a,this.K))};kc.prototype.toString=function(){var a="Function: "+this.F;if(this.K.length)var b=na(this.K,function(a,b){return a+I(b)},"Arguments:"),a=a+I(b);return a};function lc(a,b,c,d,e,f,g,q,u){this.k=a;this.h=b;this.q=c;this.la=d;this.ka=e;this.n=f;this.Z=g;this.O=void 0!==q?q:g;this.na=!!u}lc.prototype.toString=h("k");var mc={};
function M(a,b,c,d,e,f,g,q){if(mc.hasOwnProperty(a))throw Error("Function already created: "+a+".");mc[a]=new lc(a,b,c,d,!1,e,f,g,q)}M("boolean",2,!1,!1,function(a,b){return cc(b,a)},1);M("ceiling",1,!1,!1,function(a,b){return Math.ceil(J(b,a))},1);M("concat",3,!1,!1,function(a,b){var c=ta(arguments,1);return na(c,function(b,c){return b+K(c,a)},"")},2,null);M("contains",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return-1!=b.indexOf(a)},2);
M("count",1,!1,!1,function(a,b){return b.evaluate(a).o()},1,1,!0);M("false",2,!1,!1,k(!1),0);M("floor",1,!1,!1,function(a,b){return Math.floor(J(b,a))},1);
M("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 qa(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.e,e=9==d.nodeType?d:d.ownerDocument,d=K(b,a).split(/\s+/),f=[];t(d,function(a){(a=c(a))&&!ra(f,a)&&f.push(a)});f.sort(nb);var g=new E;t(f,function(a){g.add(a)});return g},1);M("lang",2,!1,!1,k(!1),1);
M("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.m},0);M("local-name",3,!1,!0,function(a,b){var c=b?Yb(b.evaluate(a)):a.e;return c?c.nodeName.toLowerCase():""},0,1,!0);M("name",3,!1,!0,function(a,b){var c=b?Yb(b.evaluate(a)):a.e;return c?c.nodeName.toLowerCase():""},0,1,!0);M("namespace-uri",3,!0,!1,k(""),0,1,!0);M("normalize-space",3,!1,!0,function(a,b){return(b?K(b,a):C(a.e)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);
M("not",2,!1,!1,function(a,b){return!cc(b,a)},1);M("number",1,!1,!0,function(a,b){return b?J(b,a):+C(a.e)},0,1);M("position",1,!0,!1,function(a){return a.qa},0);M("round",1,!1,!1,function(a,b){return Math.round(J(b,a))},1);M("starts-with",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return 0==b.lastIndexOf(a,0)},2);M("string",3,!1,!0,function(a,b){return b?K(b,a):C(a.e)},0,1);M("string-length",1,!1,!0,function(a,b){return(b?K(b,a):C(a.e)).length},0,1);
M("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);M("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);
M("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);M("sum",1,!1,!1,function(a,b){for(var c=G(b.evaluate(a)),d=0,e=c.next();e;e=c.next())d+=+C(e);return d},1,1,!0);M("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);M("true",2,!1,!1,k(!0),0);function F(a,b){this.da=a;this.Y=void 0!==b?b:null;this.l=null;switch(a){case "comment":this.l=8;break;case "text":this.l=kb;break;case "processing-instruction":this.l=7;break;case "node":break;default:throw Error("Unexpected argument");}}function nc(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}F.prototype.matches=function(a){return null===this.l||this.l==a.nodeType};F.prototype.getName=h("da");
F.prototype.toString=function(){var a="Kind Test: "+this.da;null===this.Y||(a+=I(this.Y));return a};function oc(a){H.call(this,3);this.ca=a.substring(1,a.length-1)}s(oc,H);oc.prototype.evaluate=h("ca");oc.prototype.toString=function(){return"Literal: "+this.ca};function Rb(a,b){this.k=a.toLowerCase();this.P=b?b.toLowerCase():"http://www.w3.org/1999/xhtml"}Rb.prototype.matches=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.k&&this.k!=a.nodeName.toLowerCase()?!1:this.P==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Rb.prototype.getName=h("k");Rb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.P?"":this.P+":")+this.k};function pc(a){H.call(this,1);this.ea=a}s(pc,H);pc.prototype.evaluate=h("ea");pc.prototype.toString=function(){return"Number: "+this.ea};function qc(a,b){H.call(this,a.h);this.V=a;this.D=b;this.q=a.f();this.j=a.j;if(1==this.D.length){var c=this.D[0];c.M||c.r!=rc||(c=c.J,"*"!=c.getName()&&(this.C={name:c.getName(),w:null}))}}s(qc,H);function sc(){H.call(this,4)}s(sc,H);sc.prototype.evaluate=function(a){var b=new E;a=a.e;9==a.nodeType?b.add(a):b.add(a.ownerDocument);return b};sc.prototype.toString=k("Root Helper Expression");function tc(){H.call(this,4)}s(tc,H);tc.prototype.evaluate=function(a){var b=new E;b.add(a.e);return b};
tc.prototype.toString=k("Context Helper Expression");
qc.prototype.evaluate=function(a){var b=this.V.evaluate(a);if(!(b instanceof E))throw Error("Filter expression must evaluate to nodeset.");a=this.D;for(var c=0,d=a.length;c<d&&b.o();c++){var e=a[c],f=G(b,e.r.v),g;if(e.f()||e.r!=uc)if(e.f()||e.r!=vc)for(g=f.next(),b=e.evaluate(new Gb(g));null!=(g=f.next());)g=e.evaluate(new Gb(g)),b=Xb(b,g);else g=f.next(),b=e.evaluate(new Gb(g));else{for(g=f.next();(b=f.next())&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.evaluate(new Gb(g))}}return b};
qc.prototype.toString=function(){var a;a="Path Expression:"+I(this.V);if(this.D.length){var b=na(this.D,function(a,b){return a+I(b)},"Steps:");a+=I(b)}return a};function wc(a,b){this.d=a;this.v=!!b}function jc(a,b,c){for(c=c||0;c<a.d.length;c++)for(var d=a.d[c],e=G(b),f=b.o(),g,q=0;g=e.next();q++){var u=a.v?f-q:q+1;g=d.evaluate(new Gb(g,u,f));if("number"==typeof g)u=u==g;else if("string"==typeof g||"boolean"==typeof g)u=!!g;else if(g instanceof E)u=0<g.o();else throw Error("Predicate.evaluate returned an unexpected type.");u||e.remove()}return b}wc.prototype.s=function(){return 0<this.d.length?this.d[0].s():null};
wc.prototype.f=function(){for(var a=0;a<this.d.length;a++){var b=this.d[a];if(b.f()||1==b.h||0==b.h)return!0}return!1};wc.prototype.o=function(){return this.d.length};wc.prototype.toString=function(){return na(this.d,function(a,b){return a+I(b)},"Predicates:")};function N(a,b,c,d){H.call(this,4);this.r=a;this.J=b;this.d=c||new wc([]);this.M=!!d;b=this.d.s();a.sa&&b&&(a=b.name,a=A?a.toLowerCase():a,this.C={name:a,w:b.w});this.q=this.d.f()}s(N,H);
N.prototype.evaluate=function(a){var b=a.e,c=null,c=this.s(),d=null,e=null,f=0;c&&(d=c.name,e=c.w?K(c.w,a):null,f=1);if(this.M)if(this.f()||this.r!=xc)if(a=G((new N(yc,new F("node"))).evaluate(a)),b=a.next())for(c=this.n(b,d,e,f);null!=(b=a.next());)c=Xb(c,this.n(b,d,e,f));else c=new E;else c=Ob(this.J,b,d,e),c=jc(this.d,c,f);else c=this.n(a.e,d,e,f);return c};N.prototype.n=function(a,b,c,d){a=this.r.F(this.J,a,b,c);return a=jc(this.d,a,d)};
N.prototype.toString=function(){var a;a="Step:"+I("Operator: "+(this.M?"//":"/"));this.r.k&&(a+=I("Axis: "+this.r));a+=I(this.J);if(this.d.o()){var b=na(this.d.d,function(a,b){return a+I(b)},"Predicates:");a+=I(b)}return a};function zc(a,b,c,d){this.k=a;this.F=b;this.v=c;this.sa=d}zc.prototype.toString=h("k");var Ac={};function O(a,b,c,d){if(Ac.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new zc(a,b,c,!!d);return Ac[a]=b}
O("ancestor",function(a,b){for(var c=new E,d=b;d=d.parentNode;)a.matches(d)&&c.unshift(d);return c},!0);O("ancestor-or-self",function(a,b){var c=new E,d=b;do a.matches(d)&&c.unshift(d);while(d=d.parentNode);return c},!0);
var rc=O("attribute",function(a,b){var c=new E,d=a.getName();if("style"==d&&b.style&&A)return c.add(new Ib(b.style,b,"style",b.style.cssText,b.sourceIndex)),c;var e=b.attributes;if(e)if(a instanceof F&&null===a.l||"*"==d)for(var d=b.sourceIndex,f=0,g;g=e[f];f++)A?g.nodeValue&&c.add(Jb(b,g,d)):c.add(g);else(g=e.getNamedItem(d))&&(A?g.nodeValue&&c.add(Jb(b,g,b.sourceIndex)):c.add(g));return c},!1),xc=O("child",function(a,b,c,d,e){return(A?Ub:Vb).call(null,a,b,p(c)?c:null,p(d)?d:null,e||new E)},!1,!0);
O("descendant",Ob,!1,!0);var yc=O("descendant-or-self",function(a,b,c,d){var e=new E;D(b,c,d)&&a.matches(b)&&e.add(b);return Ob(a,b,c,d,e)},!1,!0),uc=O("following",function(a,b,c,d){var e=new E;do for(var f=b;f=f.nextSibling;)D(f,c,d)&&a.matches(f)&&e.add(f),e=Ob(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);O("following-sibling",function(a,b){for(var c=new E,d=b;d=d.nextSibling;)a.matches(d)&&c.add(d);return c},!1);O("namespace",function(){return new E},!1);
var Bc=O("parent",function(a,b){var c=new E;if(9==b.nodeType)return c;if(2==b.nodeType)return c.add(b.ownerElement),c;var d=b.parentNode;a.matches(d)&&c.add(d);return c},!1),vc=O("preceding",function(a,b,c,d){var e=new E,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,q=f.length;g<q;g++){var u=[];for(b=f[g];b=b.previousSibling;)u.unshift(b);for(var U=0,r=u.length;U<r;U++)b=u[U],D(b,c,d)&&a.matches(b)&&e.add(b),e=Ob(a,b,c,d,e)}return e},!0,!0);
O("preceding-sibling",function(a,b){for(var c=new E,d=b;d=d.previousSibling;)a.matches(d)&&c.unshift(d);return c},!0);var Cc=O("self",function(a,b){var c=new E;a.matches(b)&&c.add(b);return c},!1);function Dc(a){H.call(this,1);this.U=a;this.q=a.f();this.j=a.j}s(Dc,H);Dc.prototype.evaluate=function(a){return-J(this.U,a)};Dc.prototype.toString=function(){return"Unary Expression: -"+I(this.U)};function Ec(a){H.call(this,4);this.H=a;ac(this,oa(this.H,function(a){return a.f()}));bc(this,oa(this.H,function(a){return a.j}))}s(Ec,H);Ec.prototype.evaluate=function(a){var b=new E;t(this.H,function(c){c=c.evaluate(a);if(!(c instanceof E))throw Error("Path expression must evaluate to NodeSet.");b=Xb(b,c)});return b};Ec.prototype.toString=function(){return na(this.H,function(a,b){return a+I(b)},"Union Expression:")};function Fc(a,b){this.a=a;this.oa=b}function Gc(a){for(var b,c=[];;){Q(a,"Missing right hand side of binary expression.");b=Hc(a);var d=a.a.next();if(!d)break;var e=(d=hc[d]||null)&&d.$;if(!e){a.a.back();break}for(;c.length&&e<=c[c.length-1].$;)b=new dc(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new dc(c.pop(),c.pop(),b);return b}function Q(a,b){if(a.a.empty())throw Error(b);}function Ic(a,b){var c=a.a.next();if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);}
function Jc(a){a=a.a.next();if(")"!=a)throw Error("Bad token: "+a);}function Kc(a){a=a.a.next();if(2>a.length)throw Error("Unclosed literal string");return new oc(a)}function Lc(a){var b=a.a.next(),c=b.indexOf(":");if(-1==c)return new Rb(b);var d=b.substring(0,c);a=a.oa(d);if(!a)throw Error("Namespace prefix not declared: "+d);b=b.substr(c+1);return new Rb(b,a)}
function Mc(a){var b,c=[],d;if("/"==B(a.a)||"//"==B(a.a)){b=a.a.next();d=B(a.a);if("/"==b&&(a.a.empty()||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new sc;d=new sc;Q(a,"Missing next location step.");b=Nc(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 "(":a.a.next();b=Gc(a);Q(a,'unclosed "("');Ic(a,")");break;case '"':case "'":b=Kc(a);break;default:if(isNaN(+b))if(!nc(b)&&/(?![0-9])[\w]/.test(d)&&
"("==B(a.a,1)){b=a.a.next();b=mc[b]||null;a.a.next();for(d=[];")"!=B(a.a);){Q(a,"Missing function argument list.");d.push(Gc(a));if(","!=B(a.a))break;a.a.next()}Q(a,"Unclosed function argument list.");Jc(a);b=new kc(b,d)}else{b=null;break a}else b=new pc(+a.a.next())}"["==B(a.a)&&(d=new wc(Oc(a)),b=new ic(b,d))}if(b)if("/"==B(a.a)||"//"==B(a.a))d=b;else return b;else b=Nc(a,"/"),d=new tc,c.push(b)}for(;"/"==B(a.a)||"//"==B(a.a);)b=a.a.next(),Q(a,"Missing next location step."),b=Nc(a,b),c.push(b);
return new qc(d,c)}
function Nc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==B(a.a))return d=new N(Cc,new F("node")),a.a.next(),d;if(".."==B(a.a))return d=new N(Bc,new F("node")),a.a.next(),d;var f;if("@"==B(a.a))f=rc,a.a.next(),Q(a,"Missing attribute name");else if("::"==B(a.a,1)){if(!/(?![0-9])[\w]/.test(B(a.a).charAt(0)))throw Error("Bad token: "+a.a.next());c=a.a.next();f=Ac[c]||null;if(!f)throw Error("No axis with name: "+c);a.a.next();Q(a,"Missing node name")}else f=xc;
c=B(a.a);if(/(?![0-9])[\w]/.test(c.charAt(0)))if("("==B(a.a,1)){if(!nc(c))throw Error("Invalid node type: "+c);c=a.a.next();if(!nc(c))throw Error("Invalid type name: "+c);Ic(a,"(");Q(a,"Bad nodetype");e=B(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Kc(a);Q(a,"Bad nodetype");Jc(a);c=new F(c,g)}else c=Lc(a);else if("*"==c)c=Lc(a);else throw Error("Bad token: "+a.a.next());e=new wc(Oc(a),f.v);return d||new N(f,c,e,"//"==b)}
function Oc(a){for(var b=[];"["==B(a.a);){a.a.next();Q(a,"Missing predicate expression.");var c=Gc(a);b.push(c);Q(a,"Unclosed predicate expression.");Ic(a,"]")}return b}function Hc(a){if("-"==B(a.a))return a.a.next(),new Dc(Hc(a));var b=Mc(a);if("|"!=B(a.a))a=b;else{for(b=[b];"|"==a.a.next();)Q(a,"Missing next union location path."),b.push(Mc(a));a.a.back();a=new Ec(b)}return a};function Pc(a){switch(a.nodeType){case 1:return ga(Qc,a);case 9:return Pc(a.documentElement);case 2:return a.ownerElement?Pc(a.ownerElement):Rc;case 11:case 10:case 6:case 12:return Rc;default:return a.parentNode?Pc(a.parentNode):Rc}}function Rc(){return null}function Qc(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?Qc(a.parentNode,b):null};function Sc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Lb(a);if(c.empty())throw Error("Invalid XPath expression.");b?"function"==aa(b)||(b=fa(b.lookupNamespaceURI,b)):b=k(null);var d=Gc(new Fc(c,b));if(!c.empty())throw Error("Bad token: "+c.next());this.evaluate=function(a,b){var c=d.evaluate(new Gb(a));return new R(c,b)}}
function R(a,b){if(0==b)if(a instanceof E)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 E))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof E?Zb(a):""+a;break;case 1:this.numberValue=a instanceof E?+Zb(a):+a;break;case 3:this.booleanValue=a instanceof E?0<a.o():!!a;break;case 4:case 5:case 6:case 7:var d=
G(a);c=[];for(var e=d.next();e;e=d.next())c.push(e instanceof Ib?e.e:e);this.snapshotLength=a.o();this.invalidIteratorState=!1;break;case 8:case 9:d=Yb(a);this.singleNodeValue=d instanceof Ib?d.e: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]}}R.ANY_TYPE=0;R.NUMBER_TYPE=1;R.STRING_TYPE=2;R.BOOLEAN_TYPE=3;R.UNORDERED_NODE_ITERATOR_TYPE=4;R.ORDERED_NODE_ITERATOR_TYPE=5;R.UNORDERED_NODE_SNAPSHOT_TYPE=6;R.ORDERED_NODE_SNAPSHOT_TYPE=7;R.ANY_UNORDERED_NODE_TYPE=8;R.FIRST_ORDERED_NODE_TYPE=9;function Tc(a){this.lookupNamespaceURI=Pc(a)}
function Uc(a){a=a||n;var b=a.document;b.evaluate||(a.XPathResult=R,b.evaluate=function(a,b,e,f){return(new Sc(a,e)).evaluate(b,f)},b.createExpression=function(a,b){return new Sc(a,b)},b.createNSResolver=function(a){return new Tc(a)})};var S={};S.ga=function(){var a={xa:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();S.n=function(a,b,c){var d=y(a);(w||Db)&&Uc(d?d.parentWindow||d.defaultView:window);try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):S.ga;return w&&!cb(7)?d.evaluate.call(d,b,a,e,c,null):d.evaluate(b,a,e,c,null)}catch(f){if(!x||"NS_ERROR_ILLEGAL_VALUE"!=f.name)throw new Aa(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+f);}};
S.L=function(a,b){if(!a||1!=a.nodeType)throw new Aa(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};S.ra=function(a,b){var c=function(){var c=S.n(b,a,9);return c?(c=c.singleNodeValue,v?c:c||null):b.selectSingleNode?(c=y(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||S.L(c,a);return c};
S.ta=function(a,b){var c=function(){var c=S.n(b,a,7);if(c){var e=c.snapshotLength;v&&void 0===e&&S.L(null,a);for(var f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=y(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();t(c,function(b){S.L(b,a)});return c};function Vc(a){return(a=a.exec(Oa()))?a[1]:""}var Wc=function(){if(zb)return Vc(/Firefox\/([0-9.]+)/);if(w||v)return Wa;if(Eb)return Vc(/Chrome\/([0-9.]+)/);if(Fb)return Vc(/Version\/([0-9.]+)/);if(Bb||Cb){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(Oa());if(a)return a[1]+"."+a[2]}else{if(Db)return(a=Vc(/Android\s+([0-9.]+)/))?a:Vc(/Version\/([0-9.]+)/);if(Ab)return Vc(/Camino\/([0-9.]+)/)}return""}();var Xc,Yc;function Zc(a){return $c?Xc(a):w?0<=ia(eb,a):cb(a)}function ad(a){$c?Yc(a):Db?ia(bd,a):ia(Wc,a)}
var $c=function(){if(!x)return!1;var a=n.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;Xc=function(a){return 0<=d.ia(e,""+a)};Yc=function(a){d.ia(f,""+a)};return!0}(),cd;if(Db){var dd=/Android\s+([0-9\.]+)/.exec(Oa());cd=dd?dd[1]:"0"}else cd="0";
var bd=cd,ed=w&&!(w&&9<=eb),fd=w&&!(w&&10<=eb);Db&&ad(2.3);Db&&ad(4);Fb&&ad(6);function gd(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}gd.prototype.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};gd.prototype.contains=function(a){return this&&a?a instanceof gd?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};
gd.prototype.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};gd.prototype.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};
gd.prototype.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};function T(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}T.prototype.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};T.prototype.contains=function(a){return a instanceof T?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};
T.prototype.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};T.prototype.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};
T.prototype.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};function V(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function hd(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return V(a)?a:null}
function W(a,b){var c=ja(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=ed?"styleFloat":"cssFloat";var d;a:{d=c;var e=y(a);if(e.defaultView&&e.defaultView.getComputedStyle&&(e=e.defaultView.getComputedStyle(a,null))){d=e[d]||e.getPropertyValue(d)||"";break a}d=""}d=d||id(a,c);if(null===d)d=null;else if(ra(va,c)){b:{var f=d.match(ya);if(f){var c=Number(f[1]),e=Number(f[2]),g=Number(f[3]),f=Number(f[4]);if(0<=c&&255>=c&&0<=e&&255>=e&&0<=g&&255>=g&&0<=f&&1>=f){c=[c,e,g,f];break b}}c=null}if(!c){b:{if(g=
d.match(za))if(c=Number(g[1]),e=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=e&&255>=e&&0<=g&&255>=g){c=[c,e,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase();e=ua[c.toLowerCase()];if(!e&&(e="#"==c.charAt(0)?c:"#"+c,4==e.length&&(e=e.replace(wa,"#$1$1$2$2$3$3")),!xa.test(e))){c=null;break b}c=[parseInt(e.substr(1,2),16),parseInt(e.substr(3,2),16),parseInt(e.substr(5,2),16),1]}}d=c?"rgba("+c.join(", ")+")":d}return d}
function id(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&"function"==aa(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?void 0!==d?d:null:(c=hd(a))?id(c,b):null}
function jd(a,b){function c(a){if("none"==W(a,"display"))return!1;a=hd(a);return!a||c(a)}function d(a){var b=kd(a);return 0<b.height&&0<b.width?!0:V(a,"PATH")&&(0<b.height||0<b.width)?(a=W(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=W(a,"overflow")&&oa(a.childNodes,function(a){return a.nodeType==kb||V(a)&&d(a)})}function e(a){return ld(a)==X&&pa(a.childNodes,function(a){return!V(a)||e(a)})}if(!V(a))throw Error("Argument to isShown must be of type Element");if(V(a,"OPTION")||V(a,"OPTGROUP")){var f=
qb(a,function(a){return V(a,"SELECT")});return!!f&&jd(f,!0)}return(f=md(a))?!!f.W&&0<f.rect.width&&0<f.rect.height&&jd(f.W,b):V(a,"INPUT")&&"hidden"==a.type.toLowerCase()||V(a,"NOSCRIPT")||"hidden"==W(a,"visibility")||!c(a)||!b&&0==nd(a)||!d(a)?!1:!e(a)}var X="hidden";
function ld(a){function b(a){var b=W(a,"position");if("fixed"==b)return U=!0,a==g?null:g;for(a=hd(a);a&&a!=g&&(0==W(a,"display").lastIndexOf("inline",0)||"absolute"==b&&"static"==W(a,"position"));)a=hd(a);return a}function c(a){var b=a;if("visible"==u)if(a==g&&q)b=q;else if(a==q)return{x:"visible",y:"visible"};b={x:W(b,"overflow-x"),y:W(b,"overflow-y")};a==g&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function d(a){if(a==g){var b=(new rb(f)).ja;a=Ra||"CSS1Compat"!=b.compatMode?
b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=w&&cb("10")&&b.pageYOffset!=a.scrollTop?new fb(a.scrollLeft,a.scrollTop):new fb(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new fb(a.scrollLeft,a.scrollTop);return a}var e=od(a),f=y(a),g=f.documentElement,q=f.body,u=W(g,"overflow"),U;for(a=b(a);a;a=b(a)){var r=c(a);if("visible"!=r.x||"visible"!=r.y){var l=kd(a);if(0==l.width||0==l.height)return X;var m=e.right<l.left,P=e.bottom<l.top;if(m&&"hidden"==r.x||
P&&"hidden"==r.y)return X;if(m&&"visible"!=r.x||P&&"visible"!=r.y){m=d(a);P=e.bottom<l.top-m.y;if(e.right<l.left-m.x&&"visible"!=r.x||P&&"visible"!=r.x)return X;e=ld(a);return e==X?X:"scroll"}m=e.left>=l.left+l.width;l=e.top>=l.top+l.height;if(m&&"hidden"==r.x||l&&"hidden"==r.y)return X;if(m&&"visible"!=r.x||l&&"visible"!=r.y){if(U&&(r=d(a),e.left>=g.scrollWidth-r.x||e.right>=g.scrollHeight-r.y))return X;e=ld(a);return e==X?X:"scroll"}}}return"none"}var pd=RegExp("matrix\\(([\\d\\.\\-]+), ([\\d\\.\\-]+), ([\\d\\.\\-]+), ([\\d\\.\\-]+), ([\\d\\.\\-]+)(?:px)?, ([\\d\\.\\-]+)(?:px)?\\)");
function kd(a){function b(a){var c=(y(a)?y(a).parentWindow||y(a).defaultView:window).getComputedStyle(a,null).MozTransform.match(pd);if(c){var d=parseFloat(c[1]),e=parseFloat(c[2]),r=parseFloat(c[3]),l=parseFloat(c[4]),m=parseFloat(c[5]),c=parseFloat(c[6]),P=f.left+f.width,Ca=f.top+f.height,Da=f.left*d,d=P*d,Ea=f.left*e,e=P*e,Fa=f.top*r,r=Ca*r,Ga=f.top*l,P=Ca*l,Ca=Da+Fa+m,l=Ea+Ga+c,Fa=d+Fa+m,Ga=e+Ga+c,Da=Da+r+m,Ea=Ea+P+c,m=d+r+m,c=e+P+c;f.left=Math.min(Ca,Fa,Da,m);f.top=Math.min(l,Ga,Ea,c);m=Math.max(Ca,
Fa,Da,m);c=Math.max(l,Ga,Ea,c);f.width=m-f.left;f.height=c-f.top}(a=hd(a))&&b(a)}var c=md(a);if(c)return c.rect;if(V(a,"HTML"))return c=y(a),a=lb((c?c.parentWindow||c.defaultView:window)||window),new T(0,0,a.width,a.height);var d;try{d=a.getBoundingClientRect()}catch(e){return new T(0,0,0,0)}var f=new T(d.left,d.top,d.right-d.left,d.bottom-d.top);w&&a.ownerDocument.body&&(c=y(a),f.left-=c.documentElement.clientLeft+c.body.clientLeft,f.top-=c.documentElement.clientTop+c.body.clientTop);v&&(0==f.width&&
0<a.offsetWidth&&(f.width=a.offsetWidth),0==f.height&&0<a.offsetHeight&&(f.height=a.offsetHeight));x&&!Zc(12)&&b(a);return f}
function md(a){var b=V(a,"MAP");if(!b&&!V(a,"AREA"))return null;var c=b?a:V(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;if(c&&c.name&&(d=S.ra('/descendant::*[@usemap = "#'+c.name+'"]',y(c)))&&(e=kd(d),!b&&"default"!=a.shape.toLowerCase())){var f=qd(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 T(a+e.left,b+e.top,c,f)}return{W:d,rect:e||new T(0,0,0,0)}}
function qd(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 T(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new T(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 T(b,c,d-b,e-c)}return new T(0,0,0,0)}function od(a){a=kd(a);return new gd(a.top,a.left+a.width,a.top+a.height,a.left)}
function nd(a){if(fd){if("relative"==W(a,"position"))return 1;a=W(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return rd(a)}function rd(a){var b=1,c=W(a,"opacity");c&&(b=Number(c));(a=hd(a))&&(b*=rd(a));return b};Ra||v||$c&&ad(3.6);w&&Zc(10);Db&&ad(4);function Y(a,b){this.t={};this.g=[];var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof Y)for(d=sd(a),td(a),e=[],c=0;c<a.g.length;c++)e.push(a.t[a.g[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)this.set(d[c],e[c])}}Y.prototype.A=0;Y.prototype.fa=0;function sd(a){td(a);return a.g.concat()}
Y.prototype.remove=function(a){return Object.prototype.hasOwnProperty.call(this.t,a)?(delete this.t[a],this.A--,this.fa++,this.g.length>2*this.A&&td(this),!0):!1};function td(a){if(a.A!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];Object.prototype.hasOwnProperty.call(a.t,d)&&(a.g[c++]=d);b++}a.g.length=c}if(a.A!=a.g.length){for(var e={},c=b=0;b<a.g.length;)d=a.g[b],Object.prototype.hasOwnProperty.call(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c}}
Y.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.t,a)?this.t[a]:b};Y.prototype.set=function(a,b){Object.prototype.hasOwnProperty.call(this.t,a)||(this.A++,this.g.push(a),this.fa++);this.t[a]=b};var ud={};function Z(a,b,c){ca(a)&&(a=x?a.b:v?a.opera:a.c);a=new vd(a,b,c);!b||b in ud&&!c||(ud[b]={key:a,shift:!1},c&&(ud[c]={key:a,shift:!0}));return a}function vd(a,b,c){this.code=a;this.ha=b||null;this.va=c||this.ha}Z(8);Z(9);Z(13);var wd=Z(16),xd=Z(17),yd=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");
Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D");Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var zd=Z(Na?{b:91,c:91,opera:219}:Ma?{b:224,c:91,opera:17}:{b:0,c:91,opera:null});
Z(Na?{b:92,c:92,opera:220}:Ma?{b:224,c:93,opera:17}:{b:0,c:92,opera:null});Z(Na?{b:93,c:93,opera:0}:Ma?{b:0,c:0,opera:16}:{b:93,c:null,opera:0});Z({b:96,c:96,opera:48},"0");Z({b:97,c:97,opera:49},"1");Z({b:98,c:98,opera:50},"2");Z({b:99,c:99,opera:51},"3");Z({b:100,c:100,opera:52},"4");Z({b:101,c:101,opera:53},"5");Z({b:102,c:102,opera:54},"6");Z({b:103,c:103,opera:55},"7");Z({b:104,c:104,opera:56},"8");Z({b:105,c:105,opera:57},"9");Z({b:106,c:106,opera:Ua?56:42},"*");
Z({b:107,c:107,opera:Ua?61:43},"+");Z({b:109,c:109,opera:Ua?109:45},"-");Z({b:110,c:110,opera:Ua?190:78},".");Z({b:111,c:111,opera:Ua?191:47},"/");Z(Ua&&v?null:144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({b:107,c:187,opera:61},"=","+");Z(108,",");Z({b:109,c:189,opera:109},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{");Z(220,"\\","|");Z(221,"]","}");Z({b:59,c:186,opera:59},";",":");Z(222,"'",'"');var Ad=new Y;
Ad.set(1,wd);Ad.set(2,xd);Ad.set(4,yd);Ad.set(8,zd);(function(a){var b=new Y;t(sd(a),function(c){b.set(a.get(c).code,c)});return b})(Ad);x&&Zc(12);function Bd(){this.I=void 0}
function Cd(a,b,c){switch(typeof b){case "string":Dd(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(null==b){c.push("null");break}if("array"==aa(b)){var d=b.length;c.push("[");for(var e="",f=0;f<d;f++)c.push(e),e=b[f],Cd(a,a.I?a.I.call(b,String(f),e):e,c),e=",";c.push("]");break}c.push("{");d="";for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&(e=b[f],"function"!=typeof e&&(c.push(d),
Dd(f,c),c.push(":"),Cd(a,a.I?a.I.call(b,f,e):e,c),d=","));c.push("}");break;case "function":break;default:throw Error("Unknown type: "+typeof b);}}var Ed={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Fd=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
function Dd(a,b){b.push('"',a.replace(Fd,function(a){if(a in Ed)return Ed[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return Ed[a]=e+b.toString(16)}),'"')};Ra||v||x&&Zc(3.5)||w&&Zc(8);function Gd(a){switch(aa(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return ma(a,Gd);case "object":if("nodeType"in a&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Hd(a);return b}if("document"in a)return b={},b.WINDOW=Hd(a),b;if(ba(a))return ma(a,Gd);a=hb(a,function(a,b){return"number"==typeof b||p(b)});return ib(a,Gd);default:return null}}
function Id(a,b){return"array"==aa(a)?ma(a,function(a){return Id(a,b)}):ca(a)?"function"==typeof a?a:"ELEMENT"in a?Jd(a.ELEMENT,b):"WINDOW"in a?Jd(a.WINDOW,b):ib(a,