UNPKG

slimerjs-firefox

Version:

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

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