UNPKG

slimerjs-firefox

Version:

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

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