UNPKG

slimerjs-firefox

Version:

This repo includes slimerjs as well as downloads a local copy of Firefox.

94 lines 60.5 kB
function(){return function(){function h(a){return function(){return this[a]}}function aa(a){return function(){return a}}var l=this; function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){return void 0!==a}function da(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function p(a){return"string"==typeof a}function ea(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function fa(a,b,c){return a.call.apply(a.bind,arguments)} function ga(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 ha(a,b,c){ha=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?fa:ga;return ha.apply(null,arguments)} function ia(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 ja=Date.now||function(){return+new Date};function q(a,b){function c(){}c.prototype=b.prototype;a.Ua=b.prototype;a.prototype=new c};var ka=window;function la(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 k=d[g]||"",n=e[g]||"",w=RegExp("(\\d*)(\\D*)","g"),x=RegExp("(\\d*)(\\D*)","g");do{var r=w.exec(k)||["","",""],m=x.exec(n)||["","",""];if(0==r[0].length&&0==m[0].length)break;c=((0==r[1].length?0:parseInt(r[1],10))<(0==m[1].length?0:parseInt(m[1],10))?-1:(0==r[1].length?0:parseInt(r[1],10))>(0==m[1].length? 0:parseInt(m[1],10))?1:0)||((0==r[2].length)<(0==m[2].length)?-1:(0==r[2].length)>(0==m[2].length)?1:0)||(r[2]<m[2]?-1:r[2]>m[2]?1:0)}while(0==c)}return c}function ma(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};var na=Array.prototype;function s(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 oa(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 k=f[g];b.call(void 0,k,g,a)&&(d[e++]=k)}return d}function pa(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 qa(a,b,c){if(a.reduce)return a.reduce(b,c);var d=c;s(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function ra(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 sa(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 ta(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 ua(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 va(a){return na.concat.apply(na,arguments)}function wa(a,b,c){return 2>=arguments.length?na.slice.call(a,b):na.slice.call(a,b,c)};var xa={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 ya="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),za=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Aa=/^#(?:[0-9a-f]{3}){1,2}$/i,Ba=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Ca=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function t(a,b){this.code=a;this.state=Da[a]||Ea;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||""}q(t,Error); var Ea="unknown error",Da={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"};Da[13]=Ea;Da[9]="unknown command";t.prototype.toString=function(){return this.name+": "+this.message};var Fa,Ga,Ha,Ia,Ja,Ka;function La(){return l.navigator?l.navigator.userAgent:null}Ia=Ha=Ga=Fa=!1;var Ma;if(Ma=La()){var Na=l.navigator;Fa=0==Ma.indexOf("Opera");Ga=!Fa&&-1!=Ma.indexOf("MSIE");Ha=!Fa&&-1!=Ma.indexOf("WebKit");Ia=!Fa&&!Ha&&"Gecko"==Na.product}var u=Fa,v=Ga,y=Ia,Oa=Ha,Pa,Qa=l.navigator;Pa=Qa&&Qa.platform||"";Ja=-1!=Pa.indexOf("Mac");Ka=-1!=Pa.indexOf("Win");var Ra=-1!=Pa.indexOf("Linux");function Sa(){var a=l.document;return a?a.documentMode:void 0}var Ta; a:{var Ua="",Va;if(u&&l.opera)var Wa=l.opera.version,Ua="function"==typeof Wa?Wa():Wa;else if(y?Va=/rv\:([^\);]+)(\)|;)/:v?Va=/MSIE\s+([^\);]+)(\)|;)/:Oa&&(Va=/WebKit\/(\S+)/),Va)var $a=Va.exec(La()),Ua=$a?$a[1]:"";if(v){var ab=Sa();if(ab>parseFloat(Ua)){Ta=String(ab);break a}}Ta=Ua}var bb={};function cb(a){return bb[a]||(bb[a]=0<=la(Ta,a))}function A(a){return v&&db>=a}var eb=l.document,db=eb&&v?Sa()||("CSS1Compat"==eb.compatMode?parseInt(Ta,10):5):void 0;var fb;!y&&!v||v&&A(9)||y&&cb("1.9.1");v&&cb("9");function B(a,b){this.x=ca(a)?a:0;this.y=ca(b)?b:0}B.prototype.toString=function(){return"("+this.x+", "+this.y+")"};B.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};B.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};B.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=mb(a)?a.documentElement:a.body;return new gb(a.clientWidth,a.clientHeight)}function nb(a){return a?a.parentWindow||a.defaultView:window}function mb(a){return"CSS1Compat"==a.compatMode}function ob(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a} function pb(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 qb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(v&&!A(9)){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?rb(a,b):!c&&pb(e,b)?-1*sb(a,b):!d&&pb(f,a)?sb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=C(a);c=d.createRange(); c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(l.Range.START_TO_END,d)}function sb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return rb(d,a)}function rb(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function C(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function tb(a,b,c){c||(a=a.parentNode);for(c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null} function ub(a){this.w=a||l.document||document}ub.prototype.ia=function(a){return p(a)?this.w.getElementById(a):a};function vb(a){return!Oa&&mb(a.w)?a.w.documentElement:a.w.body||a.w.documentElement}ub.prototype.contains=pb;var wb,xb,yb,zb,Ab,Bb,Cb;Cb=Bb=Ab=zb=yb=xb=wb=!1;var D=La();D&&(-1!=D.indexOf("Firefox")?wb=!0:-1!=D.indexOf("Camino")?xb=!0:-1!=D.indexOf("iPhone")||-1!=D.indexOf("iPod")?yb=!0:-1!=D.indexOf("iPad")?zb=!0:-1!=D.indexOf("Android")?Ab=!0:-1!=D.indexOf("Chrome")?Bb=!0:-1!=D.indexOf("Safari")&&(Cb=!0));var Db=wb,Eb=xb,Fb=yb,Gb=zb,Hb=Ab,Ib=Bb,Jb=Cb;function Kb(a,b,c){this.f=a;this.Ha=b||1;this.n=c||1};var Lb=v&&!A(9),Mb=v&&!A(8);function Nb(a,b,c,d,e){this.f=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.ownerElement=b;this.Sa=e;this.parentNode=b}function Ob(a,b,c){var d=Mb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Nb(b,a,b.nodeName,d,c)};function Pb(a){this.da=a;this.L=0}function Qb(a){a=a.match(Rb);for(var b=0;b<a.length;b++)Sb.test(a[b])&&a.splice(b,1);return new Pb(a)}var Rb=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Sb=/^\s/;function E(a,b){return a.da[a.L+(b||0)]}Pb.prototype.next=function(){return this.da[this.L++]};Pb.prototype.back=function(){this.L--};Pb.prototype.empty=function(){return this.da.length<=this.L};function F(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(Lb&&"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),Lb&&"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 Tb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Mb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Ub(a,b,c,d,e){return(Lb?Vb:Wb).call(null,a,b,p(c)?c:null,p(d)?d:null,e||new G)} function Vb(a,b,c,d,e){if(a instanceof Xb||8==a.e||c&&null===a.e){var f=b.all;if(!f)return e;a=Yb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],k=0;b=f[k++];)Tb(b,c,d)&&g.push(b);f=g}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||e.add(b);return e}Zb(a,b,c,d,e);return e} function Wb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!v?(b=b.getElementsByName(d),s(b,function(b){a.matches(b)&&e.add(b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),s(b,function(b){b.className==d&&a.matches(b)&&e.add(b)})):a instanceof H?Zb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.getName()),s(b,function(a){Tb(a,c,d)&&e.add(a)}));return e} function $b(a,b,c,d,e){var f;if((a instanceof Xb||8==a.e||c&&null===a.e)&&(f=b.childNodes)){var g=Yb(a);if("*"!=g&&(f=oa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=oa(f,function(a){return Tb(a,c,d)}));s(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||e.add(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)Tb(b,c,d)&&a.matches(b)&&e.add(b);return e} function Zb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Tb(b,c,d)&&a.matches(b)&&e.add(b),Zb(a,b,c,d,e)}function Yb(a){if(a instanceof H){if(8==a.e)return"!";if(null===a.e)return"*"}return a.getName()};function G(){this.n=this.j=null;this.H=0}function bc(a){this.q=a;this.next=this.A=null}function cc(a,b){if(!a.j)return b;if(!b.j)return a;for(var c=a.j,d=b.j,e=null,f=null,g=0;c&&d;)c.q==d.q||c.q instanceof Nb&&d.q instanceof Nb&&c.q.f==d.q.f?(f=c,c=c.next,d=d.next):0<qb(c.q,d.q)?(f=d,d=d.next):(f=c,c=c.next),(f.A=e)?e.next=f:a.j=f,e=f,g++;for(f=c||d;f;)f.A=e,e=e.next=f,g++,f=f.next;a.n=e;a.H=g;return a} G.prototype.unshift=function(a){a=new bc(a);a.next=this.j;this.n?this.j.A=a:this.j=this.n=a;this.j=a;this.H++};G.prototype.add=function(a){a=new bc(a);a.A=this.n;this.j?this.n.next=a:this.j=this.n=a;this.n=a;this.H++};function dc(a){return(a=a.j)?a.q:null}G.prototype.p=h("H");function ec(a){return(a=dc(a))?F(a):""}function fc(a,b){return new gc(a,!!b)}function gc(a,b){this.Da=a;this.ea=(this.B=b)?a.n:a.j;this.Z=null} gc.prototype.next=function(){var a=this.ea;if(null==a)return null;var b=this.Z=a;this.ea=this.B?a.A:a.next;return b.q};gc.prototype.remove=function(){var a=this.Da,b=this.Z;if(!b)throw Error("Next must be called at least once before remove.");var c=b.A,b=b.next;c?c.next=b:a.j=b;b?b.A=c:a.n=c;a.H--;this.Z=null};function J(a){this.i=a;this.k=this.s=!1;this.I=null}function K(a){return"\n "+a.toString().split("\n").join("\n ")}J.prototype.g=h("s");function hc(a,b){a.s=b}function ic(a,b){a.k=b}J.prototype.u=h("I");function L(a,b){var c=a.evaluate(b);return c instanceof G?+ec(c):+c}function M(a,b){var c=a.evaluate(b);return c instanceof G?ec(c):""+c}function jc(a,b){var c=a.evaluate(b);return c instanceof G?!!c.p():!!c};function kc(a,b,c){J.call(this,a.i);this.ca=a;this.ka=b;this.qa=c;this.s=b.g()||c.g();this.k=b.k||c.k;this.ca==lc&&(c.k||c.g()||4==c.i||0==c.i||!b.u()?b.k||(b.g()||4==b.i||0==b.i||!c.u())||(this.I={name:c.u().name,C:b}):this.I={name:b.u().name,C:c})}q(kc,J); function mc(a,b,c,d,e){b=b.evaluate(d);c=c.evaluate(d);var f;if(b instanceof G&&c instanceof G){e=fc(b);for(d=e.next();d;d=e.next())for(b=fc(c),f=b.next();f;f=b.next())if(a(F(d),F(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?e=b:(e=c,c=b);e=fc(e);b=typeof c;for(d=e.next();d;d=e.next()){switch(b){case "number":d=+F(d);break;case "boolean":d=!!F(d);break;case "string":d=F(d);break;default:throw Error("Illegal primitive type for comparison.");}if(a(d,c))return!0}return!1}return e? "boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}kc.prototype.evaluate=function(a){return this.ca.o(this.ka,this.qa,a)};kc.prototype.toString=function(){var a="Binary Expression: "+this.ca,a=a+K(this.ka);return a+=K(this.qa)};function nc(a,b,c,d){this.Ga=a;this.oa=b;this.i=c;this.o=d}nc.prototype.toString=h("Ga");var oc={}; function N(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}N("div",6,1,function(a,b,c){return L(a,c)/L(b,c)});N("mod",6,1,function(a,b,c){return L(a,c)%L(b,c)});N("*",6,1,function(a,b,c){return L(a,c)*L(b,c)});N("+",5,1,function(a,b,c){return L(a,c)+L(b,c)});N("-",5,1,function(a,b,c){return L(a,c)-L(b,c)});N("<",4,2,function(a,b,c){return mc(function(a,b){return a<b},a,b,c)}); N(">",4,2,function(a,b,c){return mc(function(a,b){return a>b},a,b,c)});N("<=",4,2,function(a,b,c){return mc(function(a,b){return a<=b},a,b,c)});N(">=",4,2,function(a,b,c){return mc(function(a,b){return a>=b},a,b,c)});var lc=N("=",3,2,function(a,b,c){return mc(function(a,b){return a==b},a,b,c,!0)});N("!=",3,2,function(a,b,c){return mc(function(a,b){return a!=b},a,b,c,!0)});N("and",2,2,function(a,b,c){return jc(a,c)&&jc(b,c)});N("or",1,2,function(a,b,c){return jc(a,c)||jc(b,c)});function pc(a,b){if(b.p()&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");J.call(this,a.i);this.pa=a;this.d=b;this.s=a.g();this.k=a.k}q(pc,J);pc.prototype.evaluate=function(a){a=this.pa.evaluate(a);return qc(this.d,a)};pc.prototype.toString=function(){var a;a="Filter:"+K(this.pa);return a+=K(this.d)};function rc(a,b){if(b.length<a.ma)throw Error("Function "+a.m+" expects at least"+a.ma+" arguments, "+b.length+" given");if(null!==a.$&&b.length>a.$)throw Error("Function "+a.m+" expects at most "+a.$+" arguments, "+b.length+" given");a.Ea&&s(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.m+" is not of type Nodeset: "+b);});J.call(this,a.i);this.K=a;this.R=b;hc(this,a.s||ra(b,function(a){return a.g()}));ic(this,a.Ca&&!b.length||a.Ba&&!!b.length||ra(b,function(a){return a.k}))} q(rc,J);rc.prototype.evaluate=function(a){return this.K.o.apply(null,va(a,this.R))};rc.prototype.toString=function(){var a="Function: "+this.K;if(this.R.length)var b=qa(this.R,function(a,b){return a+K(b)},"Arguments:"),a=a+K(b);return a};function sc(a,b,c,d,e,f,g,k,n){this.m=a;this.i=b;this.s=c;this.Ca=d;this.Ba=e;this.o=f;this.ma=g;this.$=ca(k)?k:g;this.Ea=!!n}sc.prototype.toString=h("m");var tc={}; function O(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)}O("boolean",2,!1,!1,function(a,b){return jc(b,a)},1);O("ceiling",1,!1,!1,function(a,b){return Math.ceil(L(b,a))},1);O("concat",3,!1,!1,function(a,b){var c=wa(arguments,1);return qa(c,function(b,c){return b+M(c,a)},"")},2,null);O("contains",2,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);return-1!=b.indexOf(a)},2); O("count",1,!1,!1,function(a,b){return b.evaluate(a).p()},1,1,!0);O("false",2,!1,!1,aa(!1),0);O("floor",1,!1,!1,function(a,b){return Math.floor(L(b,a))},1); O("id",4,!1,!1,function(a,b){function c(a){if(Lb){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ta(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.f,e=9==d.nodeType?d:d.ownerDocument,d=M(b,a).split(/\s+/),f=[];s(d,function(a){(a=c(a))&&!ua(f,a)&&f.push(a)});f.sort(qb);var g=new G;s(f,function(a){g.add(a)});return g},1);O("lang",2,!1,!1,aa(!1),1); O("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.n},0);O("local-name",3,!1,!0,function(a,b){var c=b?dc(b.evaluate(a)):a.f;return c?c.nodeName.toLowerCase():""},0,1,!0);O("name",3,!1,!0,function(a,b){var c=b?dc(b.evaluate(a)):a.f;return c?c.nodeName.toLowerCase():""},0,1,!0);O("namespace-uri",3,!0,!1,aa(""),0,1,!0);O("normalize-space",3,!1,!0,function(a,b){return(b?M(b,a):F(a.f)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1); O("not",2,!1,!1,function(a,b){return!jc(b,a)},1);O("number",1,!1,!0,function(a,b){return b?L(b,a):+F(a.f)},0,1);O("position",1,!0,!1,function(a){return a.Ha},0);O("round",1,!1,!1,function(a,b){return Math.round(L(b,a))},1);O("starts-with",2,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);return 0==b.lastIndexOf(a,0)},2);O("string",3,!1,!0,function(a,b){return b?M(b,a):F(a.f)},0,1);O("string-length",1,!1,!0,function(a,b){return(b?M(b,a):F(a.f)).length},0,1); O("substring",3,!1,!1,function(a,b,c,d){c=L(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?L(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=M(b,a);if(Infinity==d)return a.substring(e);b=Math.round(d);return a.substring(e,c+b)},2,3);O("substring-after",3,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); O("substring-before",3,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);O("sum",1,!1,!1,function(a,b){for(var c=fc(b.evaluate(a)),d=0,e=c.next();e;e=c.next())d+=+F(e);return d},1,1,!0);O("translate",3,!1,!1,function(a,b,c,d){b=M(b,a);c=M(c,a);var e=M(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);O("true",2,!1,!1,aa(!0),0);function H(a,b){this.sa=a;this.la=ca(b)?b:null;this.e=null;switch(a){case "comment":this.e=8;break;case "text":this.e=kb;break;case "processing-instruction":this.e=7;break;case "node":break;default:throw Error("Unexpected argument");}}function uc(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}H.prototype.matches=function(a){return null===this.e||this.e==a.nodeType};H.prototype.getName=h("sa"); H.prototype.toString=function(){var a="Kind Test: "+this.sa;null===this.la||(a+=K(this.la));return a};function vc(a){J.call(this,3);this.ra=a.substring(1,a.length-1)}q(vc,J);vc.prototype.evaluate=h("ra");vc.prototype.toString=function(){return"Literal: "+this.ra};function Xb(a,b){this.m=a.toLowerCase();this.aa=b?b.toLowerCase():"http://www.w3.org/1999/xhtml"}Xb.prototype.matches=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.m&&this.m!=a.nodeName.toLowerCase()?!1:this.aa==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Xb.prototype.getName=h("m");Xb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.aa?"":this.aa+":")+this.m};function wc(a){J.call(this,1);this.ta=a}q(wc,J);wc.prototype.evaluate=h("ta");wc.prototype.toString=function(){return"Number: "+this.ta};function xc(a,b){J.call(this,a.i);this.ha=a;this.J=b;this.s=a.g();this.k=a.k;if(1==this.J.length){var c=this.J[0];c.V||c.t!=yc||(c=c.Q,"*"!=c.getName()&&(this.I={name:c.getName(),C:null}))}}q(xc,J);function zc(){J.call(this,4)}q(zc,J);zc.prototype.evaluate=function(a){var b=new G;a=a.f;9==a.nodeType?b.add(a):b.add(a.ownerDocument);return b};zc.prototype.toString=aa("Root Helper Expression");function Ac(){J.call(this,4)}q(Ac,J);Ac.prototype.evaluate=function(a){var b=new G;b.add(a.f);return b}; Ac.prototype.toString=aa("Context Helper Expression"); xc.prototype.evaluate=function(a){var b=this.ha.evaluate(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.J;for(var c=0,d=a.length;c<d&&b.p();c++){var e=a[c],f=fc(b,e.t.B),g;if(e.g()||e.t!=Bc)if(e.g()||e.t!=Cc)for(g=f.next(),b=e.evaluate(new Kb(g));null!=(g=f.next());)g=e.evaluate(new Kb(g)),b=cc(b,g);else g=f.next(),b=e.evaluate(new Kb(g));else{for(g=f.next();(b=f.next())&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.evaluate(new Kb(g))}}return b}; xc.prototype.toString=function(){var a;a="Path Expression:"+K(this.ha);if(this.J.length){var b=qa(this.J,function(a,b){return a+K(b)},"Steps:");a+=K(b)}return a};function Dc(a,b){this.d=a;this.B=!!b}function qc(a,b,c){for(c=c||0;c<a.d.length;c++)for(var d=a.d[c],e=fc(b),f=b.p(),g,k=0;g=e.next();k++){var n=a.B?f-k:k+1;g=d.evaluate(new Kb(g,n,f));if("number"==typeof g)n=n==g;else if("string"==typeof g||"boolean"==typeof g)n=!!g;else if(g instanceof G)n=0<g.p();else throw Error("Predicate.evaluate returned an unexpected type.");n||e.remove()}return b}Dc.prototype.u=function(){return 0<this.d.length?this.d[0].u():null}; Dc.prototype.g=function(){for(var a=0;a<this.d.length;a++){var b=this.d[a];if(b.g()||1==b.i||0==b.i)return!0}return!1};Dc.prototype.p=function(){return this.d.length};Dc.prototype.toString=function(){return qa(this.d,function(a,b){return a+K(b)},"Predicates:")};function Ec(a,b,c,d){J.call(this,4);this.t=a;this.Q=b;this.d=c||new Dc([]);this.V=!!d;b=this.d.u();a.Ka&&b&&(a=b.name,a=Lb?a.toLowerCase():a,this.I={name:a,C:b.C});this.s=this.d.g()}q(Ec,J); Ec.prototype.evaluate=function(a){var b=a.f,c=null,c=this.u(),d=null,e=null,f=0;c&&(d=c.name,e=c.C?M(c.C,a):null,f=1);if(this.V)if(this.g()||this.t!=Fc)if(a=fc((new Ec(Gc,new H("node"))).evaluate(a)),b=a.next())for(c=this.o(b,d,e,f);null!=(b=a.next());)c=cc(c,this.o(b,d,e,f));else c=new G;else c=Ub(this.Q,b,d,e),c=qc(this.d,c,f);else c=this.o(a.f,d,e,f);return c};Ec.prototype.o=function(a,b,c,d){a=this.t.K(this.Q,a,b,c);return a=qc(this.d,a,d)}; Ec.prototype.toString=function(){var a;a="Step:"+K("Operator: "+(this.V?"//":"/"));this.t.m&&(a+=K("Axis: "+this.t));a+=K(this.Q);if(this.d.p()){var b=qa(this.d.d,function(a,b){return a+K(b)},"Predicates:");a+=K(b)}return a};function Hc(a,b,c,d){this.m=a;this.K=b;this.B=c;this.Ka=d}Hc.prototype.toString=h("m");var Ic={};function P(a,b,c,d){if(Ic.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Hc(a,b,c,!!d);return Ic[a]=b} P("ancestor",function(a,b){for(var c=new G,d=b;d=d.parentNode;)a.matches(d)&&c.unshift(d);return c},!0);P("ancestor-or-self",function(a,b){var c=new G,d=b;do a.matches(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); var yc=P("attribute",function(a,b){var c=new G,d=a.getName();if("style"==d&&b.style&&Lb)return c.add(new Nb(b.style,b,"style",b.style.cssText,b.sourceIndex)),c;var e=b.attributes;if(e)if(a instanceof H&&null===a.e||"*"==d)for(var d=b.sourceIndex,f=0,g;g=e[f];f++)Lb?g.nodeValue&&c.add(Ob(b,g,d)):c.add(g);else(g=e.getNamedItem(d))&&(Lb?g.nodeValue&&c.add(Ob(b,g,b.sourceIndex)):c.add(g));return c},!1),Fc=P("child",function(a,b,c,d,e){return(Lb?$b:ac).call(null,a,b,p(c)?c:null,p(d)?d:null,e||new G)}, !1,!0);P("descendant",Ub,!1,!0);var Gc=P("descendant-or-self",function(a,b,c,d){var e=new G;Tb(b,c,d)&&a.matches(b)&&e.add(b);return Ub(a,b,c,d,e)},!1,!0),Bc=P("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)Tb(f,c,d)&&a.matches(f)&&e.add(f),e=Ub(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);P("following-sibling",function(a,b){for(var c=new G,d=b;d=d.nextSibling;)a.matches(d)&&c.add(d);return c},!1);P("namespace",function(){return new G},!1); var Jc=P("parent",function(a,b){var c=new G;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),Cc=P("preceding",function(a,b,c,d){var e=new G,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 w=0,x=n.length;w<x;w++)b=n[w],Tb(b,c,d)&&a.matches(b)&&e.add(b),e=Ub(a,b,c,d,e)}return e},!0,!0); P("preceding-sibling",function(a,b){for(var c=new G,d=b;d=d.previousSibling;)a.matches(d)&&c.unshift(d);return c},!0);var Kc=P("self",function(a,b){var c=new G;a.matches(b)&&c.add(b);return c},!1);function Lc(a){J.call(this,1);this.ga=a;this.s=a.g();this.k=a.k}q(Lc,J);Lc.prototype.evaluate=function(a){return-L(this.ga,a)};Lc.prototype.toString=function(){return"Unary Expression: -"+K(this.ga)};function Mc(a){J.call(this,4);this.N=a;hc(this,ra(this.N,function(a){return a.g()}));ic(this,ra(this.N,function(a){return a.k}))}q(Mc,J);Mc.prototype.evaluate=function(a){var b=new G;s(this.N,function(c){c=c.evaluate(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=cc(b,c)});return b};Mc.prototype.toString=function(){return qa(this.N,function(a,b){return a+K(b)},"Union Expression:")};function Nc(a,b){this.a=a;this.Fa=b}function Oc(a){for(var b,c=[];;){Q(a,"Missing right hand side of binary expression.");b=Pc(a);var d=a.a.next();if(!d)break;var e=(d=oc[d]||null)&&d.oa;if(!e){a.a.back();break}for(;c.length&&e<=c[c.length-1].oa;)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 Q(a,b){if(a.a.empty())throw Error(b);}function Qc(a,b){var c=a.a.next();if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} function Rc(a){a=a.a.next();if(")"!=a)throw Error("Bad token: "+a);}function Sc(a){a=a.a.next();if(2>a.length)throw Error("Unclosed literal string");return new vc(a)}function Tc(a){var b=a.a.next(),c=b.indexOf(":");if(-1==c)return new Xb(b);var d=b.substring(0,c);a=a.Fa(d);if(!a)throw Error("Namespace prefix not declared: "+d);b=b.substr(c+1);return new Xb(b,a)} function Uc(a){var b,c=[],d;if("/"==E(a.a)||"//"==E(a.a)){b=a.a.next();d=E(a.a);if("/"==b&&(a.a.empty()||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new zc;d=new zc;Q(a,"Missing next location step.");b=Vc(a,b);c.push(b)}else{a:{b=E(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":a.a.next();b=Oc(a);Q(a,'unclosed "("');Qc(a,")");break;case '"':case "'":b=Sc(a);break;default:if(isNaN(+b))if(!uc(b)&&/(?![0-9])[\w]/.test(d)&& "("==E(a.a,1)){b=a.a.next();b=tc[b]||null;a.a.next();for(d=[];")"!=E(a.a);){Q(a,"Missing function argument list.");d.push(Oc(a));if(","!=E(a.a))break;a.a.next()}Q(a,"Unclosed function argument list.");Rc(a);b=new rc(b,d)}else{b=null;break a}else b=new wc(+a.a.next())}"["==E(a.a)&&(d=new Dc(Wc(a)),b=new pc(b,d))}if(b)if("/"==E(a.a)||"//"==E(a.a))d=b;else return b;else b=Vc(a,"/"),d=new Ac,c.push(b)}for(;"/"==E(a.a)||"//"==E(a.a);)b=a.a.next(),Q(a,"Missing next location step."),b=Vc(a,b),c.push(b); return new xc(d,c)} function Vc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==E(a.a))return d=new Ec(Kc,new H("node")),a.a.next(),d;if(".."==E(a.a))return d=new Ec(Jc,new H("node")),a.a.next(),d;var f;if("@"==E(a.a))f=yc,a.a.next(),Q(a,"Missing attribute name");else if("::"==E(a.a,1)){if(!/(?![0-9])[\w]/.test(E(a.a).charAt(0)))throw Error("Bad token: "+a.a.next());c=a.a.next();f=Ic[c]||null;if(!f)throw Error("No axis with name: "+c);a.a.next();Q(a,"Missing node name")}else f=Fc; c=E(a.a);if(/(?![0-9])[\w]/.test(c.charAt(0)))if("("==E(a.a,1)){if(!uc(c))throw Error("Invalid node type: "+c);c=a.a.next();if(!uc(c))throw Error("Invalid type name: "+c);Qc(a,"(");Q(a,"Bad nodetype");e=E(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Sc(a);Q(a,"Bad nodetype");Rc(a);c=new H(c,g)}else c=Tc(a);else if("*"==c)c=Tc(a);else throw Error("Bad token: "+a.a.next());e=new Dc(Wc(a),f.B);return d||new Ec(f,c,e,"//"==b)} function Wc(a){for(var b=[];"["==E(a.a);){a.a.next();Q(a,"Missing predicate expression.");var c=Oc(a);b.push(c);Q(a,"Unclosed predicate expression.");Qc(a,"]")}return b}function Pc(a){if("-"==E(a.a))return a.a.next(),new Lc(Pc(a));var b=Uc(a);if("|"!=E(a.a))a=b;else{for(b=[b];"|"==a.a.next();)Q(a,"Missing next union location path."),b.push(Uc(a));a.a.back();a=new Mc(b)}return a};function Xc(a){switch(a.nodeType){case 1:return ia(Yc,a);case 9:return Xc(a.documentElement);case 2:return a.ownerElement?Xc(a.ownerElement):Zc;case 11:case 10:case 6:case 12:return Zc;default:return a.parentNode?Xc(a.parentNode):Zc}}function Zc(){return null}function Yc(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?Yc(a.parentNode,b):null};function $c(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Qb(a);if(c.empty())throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ha(b.lookupNamespaceURI,b)):b=aa(null);var d=Oc(new Nc(c,b));if(!c.empty())throw Error("Bad token: "+c.next());this.evaluate=function(a,b){var c=d.evaluate(new Kb(a));return new R(c,b)}} function R(a,b){if(0==b)if(a instanceof G)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 G))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof G?ec(a):""+a;break;case 1:this.numberValue=a instanceof G?+ec(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.p():!!a;break;case 4:case 5:case 6:case 7:var d= fc(a);c=[];for(var e=d.next();e;e=d.next())c.push(e instanceof Nb?e.f:e);this.snapshotLength=a.p();this.invalidIteratorState=!1;break;case 8:case 9:d=dc(a);this.singleNodeValue=d instanceof Nb?d.f: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 ad(a){this.lookupNamespaceURI=Xc(a)} function bd(a){a=a||l;var b=a.document;b.evaluate||(a.XPathResult=R,b.evaluate=function(a,b,e,f){return(new $c(a,e)).evaluate(b,f)},b.createExpression=function(a,b){return new $c(a,b)},b.createNSResolver=function(a){return new ad(a)})};var S={};S.va=function(){var a={Va:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();S.o=function(a,b,c){var d=C(a);(v||Hb)&&bd(nb(d));try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):S.va;return v&&!cb(7)?d.evaluate.call(d,b,a,e,c,null):d.evaluate(b,a,e,c,null)}catch(f){if(!y||"NS_ERROR_ILLEGAL_VALUE"!=f.name)throw new t(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+f);}}; S.U=function(a,b){if(!a||1!=a.nodeType)throw new t(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};S.Ja=function(a,b){var c=function(){var c=S.o(b,a,9);return c?(c=c.singleNodeValue,u?c:c||null):b.selectSingleNode?(c=C(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||S.U(c,a);return c}; S.Qa=function(a,b){var c=function(){var c=S.o(b,a,7);if(c){var e=c.snapshotLength;u&&!ca(e)&&S.U(null,a);for(var f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=C(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();s(c,function(b){S.U(b,a)});return c};function cd(a){return(a=a.exec(La()))?a[1]:""}var dd=function(){if(Db)return cd(/Firefox\/([0-9.]+)/);if(v||u)return Ta;if(Ib)return cd(/Chrome\/([0-9.]+)/);if(Jb)return cd(/Version\/([0-9.]+)/);if(Fb||Gb){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(La());if(a)return a[1]+"."+a[2]}else{if(Hb)return(a=cd(/Android\s+([0-9.]+)/))?a:cd(/Version\/([0-9.]+)/);if(Eb)return cd(/Camino\/([0-9.]+)/)}return""}();var ed,fd;function gd(a){return hd?ed(a):v?0<=la(db,a):cb(a)}function id(a){hd?fd(a):Hb?la(jd,a):la(dd,a)} var hd=function(){if(!y)return!1;var a=l.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;ed=function(a){return 0<=d.xa(e,""+a)};fd=function(a){d.xa(f,""+a)};return!0}(),kd;if(Hb){var ld=/Android\s+([0-9\.]+)/.exec(La());kd=ld?ld[1]:"0"}else kd="0"; var jd=kd,md=A(9),nd=v&&!A(9),od=A(10),pd=v&&!A(10);Hb&&id(2.3);Hb&&id(4);Jb&&id(6);function qd(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}qd.prototype.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};qd.prototype.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}; qd.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};qd.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}; qd.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 rd(a,b){var c=C(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}function sd(a){a=a?C(a):document;var b;(b=!v)||(b=A(9))||(b=a?new ub(C(a)):fb||(fb=new ub),b=mb(b.w));return b?a.documentElement:a.body} function td(a){var b=a.offsetWidth,c=a.offsetHeight,d=Oa&&!b&&!c;if((!ca(b)||d)&&a.getBoundingClientRect){var e;a:{try{e=a.getBoundingClientRect()}catch(f){e={left:0,top:0,right:0,bottom:0};break a}v&&a.ownerDocument.body&&(a=a.ownerDocument,e.left-=a.documentElement.clientLeft+a.body.clientLeft,e.top-=a.documentElement.clientTop+a.body.clientTop)}return new gb(e.right-e.left,e.bottom-e.top)}return new gb(b,c)}var ud={thin:2,medium:4,thick:6}; function vd(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 ud)d=ud[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 U(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function wd(a){return xd(a,!0)&&yd(a)&&!(v||u||y&&!gd("1.9.2")?0:"none"==V(a,"pointer-events"))}var zd="BUTTON INPUT OPTGROUP OPTION SELECT TEXTAREA".split(" "); function yd(a){var b=a.tagName.toUpperCase();return ua(zd,b)?a.disabled?!1:a.parentNode&&1==a.parentNode.nodeType&&"OPTGROUP"==b||"OPTION"==b?yd(a.parentNode):!tb(a,function(a){var b=a.parentNode;if(b&&U(b,"FIELDSET")&&b.disabled){if(!U(a,"LEGEND"))return!0;for(;a=void 0!=a.previousElementSibling?a.previousElementSibling:ob(a.previousSibling);)if(U(a,"LEGEND"))return!0}return!1},!0):!0} function Ad(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return U(a)?a:null} function V(a,b){var c=ma(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=nd?"styleFloat":"cssFloat";var d=rd(a,c)||Bd(a,c);if(null===d)d=null;else if(ua(ya,c)){b:{var e=d.match(Ba);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(Ca))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=xa[c.toLowerCase()];if(!f&&(f="#"==c.charAt(0)?c:"#"+c,4==f.length&&(f=f.replace(za,"#$1$1$2$2$3$3")),!Aa.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 Bd(a,b){var c=a.currentStyle||a.style,d=c[b];!ca(d)&&"function"==ba(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?ca(d)?d:null:(c=Ad(a))?Bd(c,b):null} function xd(a,b){function c(a){if("none"==V(a,"display"))return!1;a=Ad(a);return!a||c(a)}function d(a){var b=Cd(a);return 0<b.height&&0<b.width?!0:U(a,"PATH")&&(0<b.height||0<b.width)?(a=V(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=V(a,"overflow")&&ra(a.childNodes,function(a){return a.nodeType==kb||U(a)&&d(a)})}function e(a){return Dd(a)==W&&sa(a.childNodes,function(a){return!U(a)||e(a)})}if(!U(a))throw Error("Argument to isShown must be of type Element");if(U(a,"OPTION")||U(a,"OPTGROUP")){var f= tb(a,function(a){return U(a,"SELECT")});return!!f&&xd(f,!0)}return(f=Ed(a))?!!f.ja&&0<f.rect.width&&0<f.rect.height&&xd(f.ja,b):U(a,"INPUT")&&"hidden"==a.type.toLowerCase()||U(a,"NOSCRIPT")||"hidden"==V(a,"visibility")||!c(a)||!b&&0==Fd(a)||!d(a)?!1:!e(a)}var W="hidden"; function Dd(a,b){function c(a){var b=V(a,"position");if("fixed"==b)return x=!0,a==k?null:k;for(a=Ad(a);a&&a!=k&&(0==V(a,"display").lastIndexOf("inline",0)||"absolute"==b&&"static"==V(a,"position"));)a=Ad(a);return a}function d(a){var b=a;if("visible"==w)if(a==k&&n)b=n;else if(a==n)return{x:"visible",y:"visible"};b={x:V(b,"overflow-x"),y:V(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 ub(g)).w;a=!Oa&&mb(b)?b.documentElement: b.body||b.documentElement;b=b.parentWindow||b.defaultView;a=v&&cb("10")&&b.pageYOffset!=a.scrollTop?new B(a.scrollLeft,a.scrollTop):new B(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new B(a.scrollLeft,a.scrollTop);return a}for(var f=Gd(a,b),g=C(a),k=g.documentElement,n=g.body,w=V(k,"overflow"),x,r=c(a);r;r=c(r)){var m=d(r);if("visible"!=m.x||"visible"!=m.y){var z=Cd(r);if(0==z.width||0==z.height)return W;var I=f.right<z.left,Y=f.bottom<z.top;if(I&&"hidden"==m.x||Y&&"hidden"==m.y)return W; if(I&&"visible"!=m.x||Y&&"visible"!=m.y){I=e(r);Y=f.bottom<z.top-I.y;if(f.right<z.left-I.x&&"visible"!=m.x||Y&&"visible"!=m.x)return W;f=Dd(r);return f==W?W:"scroll"}I=f.left>=z.left+z.width;z=f.top>=z.top+z.height;if(I&&"hidden"==m.x||z&&"hidden"==m.y)return W;if(I&&"visible"!=m.x||z&&"visible"!=m.y){if(x&&(m=e(r),f.left>=k.scrollWidth-m.x||f.right>=k.scrollHeight-m.y))return W;f=Dd(r);return f==W?W:"scroll"}}}return"none"}var Hd=RegExp("matrix\\(([\\d\\.\\-]+), ([\\d\\.\\-]+), ([\\d\\.\\-]+), ([\\d\\.\\-]+), ([\\d\\.\\-]+)(?:px)?, ([\\d\\.\\-]+)(?:px)?\\)"); function Cd(a){function b(a){var c=nb(C(a)).getComputedStyle(a,null).MozTransform.match(Hd);if(c){var d=parseFloat(c[1]),e=parseFloat(c[2]),x=parseFloat(c[3]),r=parseFloat(c[4]),m=parseFloat(c[5]),c=parseFloat(c[6]),z=f.left+f.width,I=f.top+f.height,Y=f.left*d,d=z*d,Xa=f.left*e,e=z*e,Ya=f.top*x,x=I*x,Za=f.top*r,z=I*r,I=Y+Ya+m,r=Xa+Za+c,Ya=d+Ya+m,Za=e+Za+c,Y=Y+x+m,Xa=Xa+z+c,m=d+x+m,c=e+z+c;f.left=Math.min(I,Ya,Y,m);f.top=Math.min(r,Za,Xa,c);m=Math.max(I,Ya,Y,m);c=Math.max(r,Za,Xa,c);f.width=m-f.left; f.height=c-f.top}(a=Ad(a))&&b(a)}var c=Ed(a);if(c)return c.rect;if(U(a,"HTML"))return c=C(a),a=lb(nb(c)||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);v&&a.ownerDocument.body&&(c=C(a),f.left-=c.documentElement.clientLeft+c.body.clientLeft,f.top-=c.documentElement.clientTop+c.body.clientTop);u&&(0==f.width&&0<a.offsetWidth&&(f.width=a.offsetWidth),0==f.height&&0<a.offsetHeight&&(f.height= a.offsetHeight));y&&!gd(12)&&b(a);return f} function Ed(a){var b=U(a,"MAP");if(!b&&!U(a,"AREA"))return null;var c=b?a:U(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;if(c&&c.name&&(d=S.Ja('/descendant::*[@usemap = "#'+c.name+'"]',C(c)))&&(e=Cd(d),!b&&"default"!=a.shape.toLowerCase())){var f=Id(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{ja:d,rect:e||new T(0,0,0,0)}} function Id(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 Gd(a,b){var c;c=Cd(a);c=new qd(c.top,c.left+c.width,c.top+c.height,c.left);if(b){var d=b instanceof T?b:new T(b.x,b.y,1,1);c.left=Math.min(Math.max(c.left+d.left,c.left),c.right);c.top=Math.min(Math.max(c.top+d.top,c.top),c.bottom);c.right=Math.min(Math.max(c.left+d.width,c.left),c.right);c.bottom=Math.min(Math.max(c.top+d.height,c.top),c.bottom)}return c} function Fd(a){if(pd){if("relative"==V(a,"position"))return 1;a=V(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return Jd(a)}function Jd(a){var b=1,c=V(a,"opacity");c&&(b=Number(c));(a=Ad(a))&&(b*=Jd(a));return b};function Kd(a,b){this.l=ka.document.documentElement;this.r=null;var c;a:{var d=C(this.l);try{c=d&&d.activeElement;break a}catch(e){}c=null}(c=v&&c&&"undefined"===typeof c.nodeType?null:c)&&Ld(this,c);this.M=a||new Md;this.fa=b||new Nd}Kd.prototype.ia=h("l");function Ld(a,b){a.l=b;a.r=U(b,"OPTION")?tb(b,function(a){return U(a,"SELECT")}):null} Kd.prototype.X=function(a,b,c,d,e,f,g){if(!f&&!wd(this.l))return!1;if(d&&Od!=a&&Pd!=a)throw new t(12,"Event type does not allow related target: "+a);b={clientX:b.x,clientY:b.y,button:c,altKey:0!=(this.M.O&4),ctrlKey:0!=(this.M.O&2),shiftKey:0!=(this.M.O&1),metaKey:0!=(this.M.O&8),wheelDelta:e||0,relatedTarget:d||null};g=g||1;c=this.l;a!=Qd&&a!=Rd&&g in Sd?c=Sd[g]:this.r&&(c=Td(this,a));return c?this.fa.X(c,a,b):!0}; Kd.prototype.W=function(a,b,c,d,e,f,g,k){if(!k&&!wd(this.l))return!1;if(g&&Ud!=a&&Vd!=a)throw new t(12,"Event type does not allow related target: "+a);b={clientX:b.x,clientY:b.y,button:c,altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,relatedTarget:g||null,width:0,height:0,Ia:0,rotation:0,pointerId:d,La:0,Ma:0,pointerType:e,Aa:f};c=this.r?Td(this,a):this.l;Sd[d]&&(c=Sd[d]);d=nb(C(this.l));var n;d&&a==Wd&&(n=d.Element.prototype.msSetPointerCapture,d.Element.prototype.msSetPointerCapture=function(a){Sd[a]= this});a=c?this.fa.W(c,a,b):!0;n&&(d.Element.prototype.msSetPointerCapture=n);return a};function Td(a,b){if(v)switch(b){case Od:case Ud:return null;case Xd:case Yd:case Zd:return a.r.multiple?a.r:null;default:return a.r}if(u)switch(b){case Xd:case Od:return a.r.multiple?a.l:null;default:return a.l}if(Oa)switch(b){case Qd:case $d:return a.r.multiple?a.l:a.r;default:return a.r.multiple?a.l:null}return a.l}Oa||u||hd&&id(3.6);function Md(){this.O=0}var Sd={};function Nd(){} Nd.prototype.X=function(a,b,c){return ae(a,b,c)};Nd.prototype.W=function(a,b,c){return ae(a,b,c)};v&&gd(10);Hb&&id(4);var be=v&&ka.navigator.msPointerEnabled;function ce(a,b,c){this.e=a;this.S=b;this.T=c}ce.prototype.create=function(a){a=C(a);nd?a=a.createEventObject():(a=a.createEvent("HTMLEvents"),a.initEvent(this.e,this.S,this.T));return a};ce.prototype.toString=h("e");function X(a,b,c){ce.call(this,a,b,c)}q(X,ce); X.prototype.create=function(a,b){if(!y&&this==de)throw new t(9,"Browser does not support a mouse pixel scroll event.");var c=C(a),d;if(nd){d=c.createEventObject();d.altKey=b.altKey;d.ctrlKey=b.ctrlKey;d.metaKey=b.metaKey;d.shiftKey=b.shiftKey;d.button=b.button;d.clientX=b.clientX;d.clientY=b.clientY;c=function(a,b){Object.defineProperty(d,a,{get:function(){return b}})};if(this==Pd||this==Od)if(Object.defineProperty){var e=this==Pd;c("fromElement",e?a:b.relatedTarget);c("toElement",e?b.relatedTarget: a)}else d.relatedTarget=b.relatedTarget;this==ee&&(Object.defineProperty?c("wheelDelta",b.wheelDelta):d.detail=b.wheelDelta)}else{e=nb(c);d=c.createEvent("MouseEvents");var f=1;this=