UNPKG

selenium-atoms

Version:
99 lines (93 loc) 42.2 kB
function(){return function(){var g,l=this;function aa(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} 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){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function da(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ea(a,b,c){return a.call.apply(a.bind,arguments)} function fa(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 ga(a,b,c){ga=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:fa;return ga.apply(null,arguments)} function ha(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ia=Date.now||function(){return+new Date};function n(a,b){function c(){}c.prototype=b.prototype;a.P=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.N=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};var ja=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; function ka(a,b){for(var c=0,d=ja(String(a)).split("."),e=ja(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",t=e[h]||"",v=RegExp("(\\d*)(\\D*)","g"),E=RegExp("(\\d*)(\\D*)","g");do{var S=v.exec(k)||["","",""],T=E.exec(t)||["","",""];if(0==S[0].length&&0==T[0].length)break;c=la(0==S[1].length?0:parseInt(S[1],10),0==T[1].length?0:parseInt(T[1],10))||la(0==S[2].length,0==T[2].length)||la(S[2],T[2])}while(0==c)}return c}function la(a,b){return a<b?-1:a>b?1:0};var ma=Array.prototype;function p(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function na(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,h=0;h<c;h++)if(h in f){var k=f[h];b.call(void 0,k,h,a)&&(d[e++]=k)}return d}function oa(a,b){for(var c=a.length,d=Array(c),e=m(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function pa(a,b,c){var d=c;p(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} function qa(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ra(a,b){var c;a:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]}function sa(a){return ma.concat.apply(ma,arguments)}function ta(a,b,c){return 2>=arguments.length?ma.slice.call(a,b):ma.slice.call(a,b,c)};function q(a,b){this.code=a;this.a=r[a]||ua;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}n(q,Error);var ua="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=ua;r[30]=ua;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=ua;r[9]="unknown command";q.prototype.toString=function(){return this.name+": "+this.message};var u;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){u=wa;break a}}u=""}function w(a){return-1!=u.indexOf(a)};function xa(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function ya(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function za(a,b){return null!==a&&b in a}function Aa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ba(){return w("Opera")||w("OPR")}function Ca(){return(w("Chrome")||w("CriOS"))&&!Ba()&&!w("Edge")};function Da(){return w("iPhone")&&!w("iPod")&&!w("iPad")};var Ea=Ba(),x=w("Trident")||w("MSIE"),Fa=w("Edge"),y=w("Gecko")&&!(-1!=u.toLowerCase().indexOf("webkit")&&!w("Edge"))&&!(w("Trident")||w("MSIE"))&&!w("Edge"),Ga=-1!=u.toLowerCase().indexOf("webkit")&&!w("Edge"),Ha=w("Macintosh"),Ia=w("Windows");function Ja(){var a=u;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Fa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ga)return/WebKit\/(\S+)/.exec(a)}function Ka(){var a=l.document;return a?a.documentMode:void 0} var La=function(){if(Ea&&l.opera){var a;var b=l.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ja())&&(a=b?b[1]:"");return x&&(b=Ka(),b>parseFloat(a))?String(b):a}(),Ma={};function Na(a){return Ma[a]||(Ma[a]=0<=ka(La,a))}var Oa=l.document,Pa=Oa&&x?Ka()||("CSS1Compat"==Oa.compatMode?parseInt(La,10):5):void 0;!y&&!x||x&&9<=Pa||y&&Na("1.9.1");x&&Na("9");function Qa(a,b){this.width=a;this.height=b}g=Qa.prototype;g.clone=function(){return new Qa(this.width,this.height)};g.toString=function(){return"("+this.width+" x "+this.height+")"};g.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};g.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};g.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; g.scale=function(a,b){this.width*=a;this.height*="number"==typeof b?b:a;return this};function Ra(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 Sa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Pa)){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?Ta(a,b):!c&&Ra(e,b)?-1*Ua(a,b):!d&&Ra(f,a)?Ua(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=Va(a);c=d.createRange(); c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(l.Range.START_TO_END,d)}function Ua(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Ta(d,a)}function Ta(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function Va(a){return 9==a.nodeType?a:a.ownerDocument||a.document};var Wa=w("Firefox"),Xa=Da()||w("iPod"),Ya=w("iPad"),Za=w("Android")&&!(Ca()||w("Firefox")||Ba()||w("Silk")),$a=Ca(),ab=w("Safari")&&!(Ca()||w("Coast")||Ba()||w("Edge")||w("Silk")||w("Android"))&&!(Da()||w("iPad")||w("iPod"));/* The MIT License Copyright (c) 2007 Cybozu Labs, Inc. Copyright (c) 2012 Google Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ function bb(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var z=x&&!(9<=Pa),cb=x&&!(8<=Pa);function db(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function eb(a,b){var c=cb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new db(b,a,b.nodeName,c)};function fb(a){this.b=a;this.a=0}function gb(a){a=a.match(hb);for(var b=0;b<a.length;b++)jb.test(a[b])&&a.splice(b,1);return new fb(a)}var hb=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),jb=/^\s/;function A(a,b){return a.b[a.a+(b||0)]}function B(a){return a.b[a.a++]}function kb(a){return a.b.length<=a.a};function C(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(z&&"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),z&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} function D(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}cb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function lb(a,b,c,d,e){return(z?mb:nb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new F)} function mb(a,b,c,d,e){if(a instanceof ob||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=pb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var h=[],k=0;b=f[k++];)D(b,c,d)&&h.push(b);f=h}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||G(e,b);return e}qb(a,b,c,d,e);return e} function nb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),p(b,function(b){a.a(b)&&G(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),p(b,function(b){b.className==d&&a.a(b)&&G(e,b)})):a instanceof H?qb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),p(b,function(a){D(a,c,d)&&G(e,a)}));return e} function rb(a,b,c,d,e){var f;if((a instanceof ob||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var h=pb(a);if("*"!=h&&(f=na(f,function(a){return a.tagName&&a.tagName.toLowerCase()==h}),!f))return e;c&&(f=na(f,function(a){return D(a,c,d)}));p(f,function(a){"*"==h&&("!"==a.tagName||"*"==h&&1!=a.nodeType)||G(e,a)});return e}return sb(a,b,c,d,e)}function sb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)D(b,c,d)&&a.a(b)&&G(e,b);return e} function qb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)D(b,c,d)&&a.a(b)&&G(e,b),qb(a,b,c,d,e)}function pb(a){if(a instanceof H){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function F(){this.b=this.a=null;this.s=0}function tb(a){this.node=a;this.a=this.b=null}function ub(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,h=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof db&&k instanceof db&&f.a==k.a?(f=c,c=c.a,d=d.a):0<Sa(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;h++}for(f=c||d;f;)f.b=e,e=e.a=f,h++,f=f.a;a.b=e;a.s=h;return a} F.prototype.unshift=function(a){a=new tb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function G(a,b){var c=new tb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function vb(a){return(a=a.a)?a.node:null}function wb(a){return(a=vb(a))?C(a):""}function I(a,b){return new xb(a,!!b)}function xb(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function J(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function K(a){this.m=a;this.b=this.i=!1;this.h=null}function L(a){return"\n "+a.toString().split("\n").join("\n ")}function yb(a,b){a.i=b}function zb(a,b){a.b=b}function M(a,b){var c=a.a(b);return c instanceof F?+wb(c):+c}function N(a,b){var c=a.a(b);return c instanceof F?wb(c):""+c}function Ab(a,b){var c=a.a(b);return c instanceof F?!!c.s:!!c};function Bb(a,b,c){K.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==Cb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}n(Bb,K); function Db(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof F&&c instanceof F){e=I(b);for(d=J(e);d;d=J(e))for(b=I(c),f=J(b);f;f=J(b))if(a(C(d),C(f)))return!0;return!1}if(b instanceof F||c instanceof F){b instanceof F?e=b:(e=c,c=b);e=I(e);b=typeof c;for(d=J(e);d;d=J(e)){switch(b){case "number":d=+C(d);break;case "boolean":d=!!C(d);break;case "string":d=C(d);break;default:throw Error("Illegal primitive type for comparison.");}if(a(d,c))return!0}return!1}return e?"boolean"==typeof b||"boolean"==typeof c? a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Bb.prototype.a=function(a){return this.c.u(this.j,this.w,a)};Bb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+L(this.j);return a+=L(this.w)};function Eb(a,b,c,d){this.a=a;this.H=b;this.m=c;this.u=d}Eb.prototype.toString=function(){return this.a};var Fb={};function O(a,b,c,d){if(Fb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Eb(a,b,c,d);return Fb[a.toString()]=a} O("div",6,1,function(a,b,c){return M(a,c)/M(b,c)});O("mod",6,1,function(a,b,c){return M(a,c)%M(b,c)});O("*",6,1,function(a,b,c){return M(a,c)*M(b,c)});O("+",5,1,function(a,b,c){return M(a,c)+M(b,c)});O("-",5,1,function(a,b,c){return M(a,c)-M(b,c)});O("<",4,2,function(a,b,c){return Db(function(a,b){return a<b},a,b,c)});O(">",4,2,function(a,b,c){return Db(function(a,b){return a>b},a,b,c)});O("<=",4,2,function(a,b,c){return Db(function(a,b){return a<=b},a,b,c)}); O(">=",4,2,function(a,b,c){return Db(function(a,b){return a>=b},a,b,c)});var Cb=O("=",3,2,function(a,b,c){return Db(function(a,b){return a==b},a,b,c,!0)});O("!=",3,2,function(a,b,c){return Db(function(a,b){return a!=b},a,b,c,!0)});O("and",2,2,function(a,b,c){return Ab(a,c)&&Ab(b,c)});O("or",1,2,function(a,b,c){return Ab(a,c)||Ab(b,c)});function Gb(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");K.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}n(Gb,K);Gb.prototype.a=function(a){a=this.c.a(a);return Hb(this.j,a)};Gb.prototype.toString=function(){var a;a="Filter:"+L(this.c);return a+=L(this.j)};function Ib(a,b){if(b.length<a.I)throw Error("Function "+a.o+" expects at least"+a.I+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.M&&p(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});K.call(this,a.m);this.j=a;this.c=b;yb(this,a.i||qa(b,function(a){return a.i}));zb(this,a.L&&!b.length||a.K&&!!b.length||qa(b,function(a){return a.b}))} n(Ib,K);Ib.prototype.a=function(a){return this.j.u.apply(null,sa(a,this.c))};Ib.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=pa(this.c,function(a,b){return a+L(b)},"Arguments:"),a=a+L(b);return a};function Jb(a,b,c,d,e,f,h,k,t){this.o=a;this.m=b;this.i=c;this.L=d;this.K=e;this.u=f;this.I=h;this.D=void 0!==k?k:h;this.M=!!t}Jb.prototype.toString=function(){return this.o};var Kb={}; function P(a,b,c,d,e,f,h,k){if(Kb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Kb[a]=new Jb(a,b,c,d,!1,e,f,h,k)}P("boolean",2,!1,!1,function(a,b){return Ab(b,a)},1);P("ceiling",1,!1,!1,function(a,b){return Math.ceil(M(b,a))},1);P("concat",3,!1,!1,function(a,b){return pa(ta(arguments,1),function(b,d){return b+N(d,a)},"")},2,null);P("contains",2,!1,!1,function(a,b,c){b=N(b,a);a=N(c,a);return-1!=b.indexOf(a)},2);P("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); P("false",2,!1,!1,function(){return!1},0);P("floor",1,!1,!1,function(a,b){return Math.floor(M(b,a))},1); P("id",4,!1,!1,function(a,b){function c(a){if(z){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ra(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=N(b,a).split(/\s+/),f=[];p(d,function(a){a=c(a);var b;if(!(b=!a)){a:if(m(f))b=m(a)&&1==a.length?f.indexOf(a,0):-1;else{for(b=0;b<f.length;b++)if(b in f&&f[b]===a)break a;b=-1}b=0<=b}b||f.push(a)});f.sort(Sa);var h=new F;p(f,function(a){G(h,a)});return h},1); P("lang",2,!1,!1,function(){return!1},1);P("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);P("local-name",3,!1,!0,function(a,b){var c=b?vb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);P("name",3,!1,!0,function(a,b){var c=b?vb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);P("namespace-uri",3,!0,!1,function(){return""},0,1,!0); P("normalize-space",3,!1,!0,function(a,b){return(b?N(b,a):C(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);P("not",2,!1,!1,function(a,b){return!Ab(b,a)},1);P("number",1,!1,!0,function(a,b){return b?M(b,a):+C(a.a)},0,1);P("position",1,!0,!1,function(a){return a.b},0);P("round",1,!1,!1,function(a,b){return Math.round(M(b,a))},1);P("starts-with",2,!1,!1,function(a,b,c){b=N(b,a);a=N(c,a);return 0==b.lastIndexOf(a,0)},2);P("string",3,!1,!0,function(a,b){return b?N(b,a):C(a.a)},0,1); P("string-length",1,!1,!0,function(a,b){return(b?N(b,a):C(a.a)).length},0,1);P("substring",3,!1,!1,function(a,b,c,d){c=M(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?M(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=N(b,a);if(Infinity==d)return a.substring(e);b=Math.round(d);return a.substring(e,c+b)},2,3);P("substring-after",3,!1,!1,function(a,b,c){b=N(b,a);a=N(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); P("substring-before",3,!1,!1,function(a,b,c){b=N(b,a);a=N(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);P("sum",1,!1,!1,function(a,b){for(var c=I(b.a(a)),d=0,e=J(c);e;e=J(c))d+=+C(e);return d},1,1,!0);P("translate",3,!1,!1,function(a,b,c,d){b=N(b,a);c=N(c,a);var e=N(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);P("true",2,!1,!1,function(){return!0},0);function H(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Lb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}H.prototype.a=function(a){return null===this.b||this.b==a.nodeType};H.prototype.h=function(){return this.j}; H.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=L(this.c));return a};function Mb(a){K.call(this,3);this.c=a.substring(1,a.length-1)}n(Mb,K);Mb.prototype.a=function(){return this.c};Mb.prototype.toString=function(){return"Literal: "+this.c};function ob(a,b){this.o=a.toLowerCase();this.c=b?b.toLowerCase():"http://www.w3.org/1999/xhtml"}ob.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.nodeName.toLowerCase()?!1:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};ob.prototype.h=function(){return this.o};ob.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Nb(a){K.call(this,1);this.c=a}n(Nb,K);Nb.prototype.a=function(){return this.c};Nb.prototype.toString=function(){return"Number: "+this.c};function Ob(a,b){K.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.B||c.c!=Pb||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}n(Ob,K);function Qb(){K.call(this,4)}n(Qb,K);Qb.prototype.a=function(a){var b=new F;a=a.a;9==a.nodeType?G(b,a):G(b,a.ownerDocument);return b};Qb.prototype.toString=function(){return"Root Helper Expression"};function Rb(){K.call(this,4)}n(Rb,K);Rb.prototype.a=function(a){var b=new F;G(b,a.a);return b};Rb.prototype.toString=function(){return"Context Helper Expression"}; function Sb(a){return"/"==a||"//"==a}Ob.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof F))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=I(b,e.c.a),h;if(e.i||e.c!=Tb)if(e.i||e.c!=Ub)for(h=J(f),b=e.a(new bb(h));null!=(h=J(f));)h=e.a(new bb(h)),b=ub(b,h);else h=J(f),b=e.a(new bb(h));else{for(h=J(f);(b=J(f))&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new bb(h))}}return b}; Ob.prototype.toString=function(){var a;a="Path Expression:"+L(this.j);if(this.c.length){var b=pa(this.c,function(a,b){return a+L(b)},"Steps:");a+=L(b)}return a};function Vb(a,b){this.a=a;this.b=!!b} function Hb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=I(b),f=b.s,h,k=0;h=J(e);k++){var t=a.b?f-k:k+1;h=d.a(new bb(h,t,f));if("number"==typeof h)t=t==h;else if("string"==typeof h||"boolean"==typeof h)t=!!h;else if(h instanceof F)t=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!t){t=e;h=t.h;var v=t.a;if(!v)throw Error("Next must be called at least once before remove.");var E=v.b,v=v.a;E?E.a=v:h.a=v;v?v.b=E:h.b=E;h.s--;t.a=null}}return b} Vb.prototype.toString=function(){return pa(this.a,function(a,b){return a+L(b)},"Predicates:")};function Q(a,b,c,d){K.call(this,4);this.c=a;this.w=b;this.j=c||new Vb([]);this.B=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=z?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}n(Q,K); Q.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?N(c.A,a):null,f=1);if(this.B)if(this.i||this.c!=Wb)if(a=I((new Q(Xb,new H("node"))).a(a)),b=J(a))for(c=this.u(b,d,e,f);null!=(b=J(a));)c=ub(c,this.u(b,d,e,f));else c=new F;else c=lb(this.w,b,d,e),c=Hb(this.j,c,f);else c=this.u(a.a,d,e,f);return c};Q.prototype.u=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Hb(this.j,a,d)}; Q.prototype.toString=function(){var a;a="Step:"+L("Operator: "+(this.B?"//":"/"));this.c.o&&(a+=L("Axis: "+this.c));a+=L(this.w);if(this.j.a.length){var b=pa(this.j.a,function(a,b){return a+L(b)},"Predicates:");a+=L(b)}return a};function Yb(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}Yb.prototype.toString=function(){return this.o};var Zb={};function R(a,b,c,d){if(Zb.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Yb(a,b,c,!!d);return Zb[a]=b} R("ancestor",function(a,b){for(var c=new F,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);R("ancestor-or-self",function(a,b){var c=new F,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); var Pb=R("attribute",function(a,b){var c=new F,d=a.h();if("style"==d&&b.style&&z)return G(c,new db(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof H&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)z?f.nodeValue&&G(c,eb(b,f)):G(c,f);else(f=e.getNamedItem(d))&&(z?f.nodeValue&&G(c,eb(b,f)):G(c,f));return c},!1),Wb=R("child",function(a,b,c,d,e){return(z?rb:sb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new F)},!1,!0);R("descendant",lb,!1,!0); var Xb=R("descendant-or-self",function(a,b,c,d){var e=new F;D(b,c,d)&&a.a(b)&&G(e,b);return lb(a,b,c,d,e)},!1,!0),Tb=R("following",function(a,b,c,d){var e=new F;do for(var f=b;f=f.nextSibling;)D(f,c,d)&&a.a(f)&&G(e,f),e=lb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);R("following-sibling",function(a,b){for(var c=new F,d=b;d=d.nextSibling;)a.a(d)&&G(c,d);return c},!1);R("namespace",function(){return new F},!1); var $b=R("parent",function(a,b){var c=new F;if(9==b.nodeType)return c;if(2==b.nodeType)return G(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&G(c,d);return c},!1),Ub=R("preceding",function(a,b,c,d){var e=new F,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,k=f.length;h<k;h++){var t=[];for(b=f[h];b=b.previousSibling;)t.unshift(b);for(var v=0,E=t.length;v<E;v++)b=t[v],D(b,c,d)&&a.a(b)&&G(e,b),e=lb(a,b,c,d,e)}return e},!0,!0); R("preceding-sibling",function(a,b){for(var c=new F,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var ac=R("self",function(a,b){var c=new F;a.a(b)&&G(c,b);return c},!1);function bc(a){K.call(this,1);this.c=a;this.i=a.i;this.b=a.b}n(bc,K);bc.prototype.a=function(a){return-M(this.c,a)};bc.prototype.toString=function(){return"Unary Expression: -"+L(this.c)};function cc(a){K.call(this,4);this.c=a;yb(this,qa(this.c,function(a){return a.i}));zb(this,qa(this.c,function(a){return a.b}))}n(cc,K);cc.prototype.a=function(a){var b=new F;p(this.c,function(c){c=c.a(a);if(!(c instanceof F))throw Error("Path expression must evaluate to NodeSet.");b=ub(b,c)});return b};cc.prototype.toString=function(){return pa(this.c,function(a,b){return a+L(b)},"Union Expression:")};function fc(a,b){this.a=a;this.b=b}function gc(a){for(var b,c=[];;){U(a,"Missing right hand side of binary expression.");b=hc(a);var d=B(a.a);if(!d)break;var e=(d=Fb[d]||null)&&d.H;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].H;)b=new Bb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Bb(c.pop(),c.pop(),b);return b}function U(a,b){if(kb(a.a))throw Error(b);}function ic(a,b){var c=B(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} function jc(a){a=B(a.a);if(")"!=a)throw Error("Bad token: "+a);}function kc(a){a=B(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Mb(a)}function lc(a){var b=B(a.a),c=b.indexOf(":");if(-1==c)return new ob(b);var d=b.substring(0,c);a=a.b(d);if(!a)throw Error("Namespace prefix not declared: "+d);b=b.substr(c+1);return new ob(b,a)} function mc(a){var b,c=[],d;if(Sb(A(a.a))){b=B(a.a);d=A(a.a);if("/"==b&&(kb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Qb;d=new Qb;U(a,"Missing next location step.");b=nc(a,b);c.push(b)}else{a:{b=A(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":B(a.a);b=gc(a);U(a,'unclosed "("');ic(a,")");break;case '"':case "'":b=kc(a);break;default:if(isNaN(+b))if(!Lb(b)&&/(?![0-9])[\w]/.test(d)&&"("==A(a.a,1)){b=B(a.a); b=Kb[b]||null;B(a.a);for(d=[];")"!=A(a.a);){U(a,"Missing function argument list.");d.push(gc(a));if(","!=A(a.a))break;B(a.a)}U(a,"Unclosed function argument list.");jc(a);b=new Ib(b,d)}else{b=null;break a}else b=new Nb(+B(a.a))}"["==A(a.a)&&(d=new Vb(oc(a)),b=new Gb(b,d))}if(b)if(Sb(A(a.a)))d=b;else return b;else b=nc(a,"/"),d=new Rb,c.push(b)}for(;Sb(A(a.a));)b=B(a.a),U(a,"Missing next location step."),b=nc(a,b),c.push(b);return new Ob(d,c)} function nc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==A(a.a))return d=new Q(ac,new H("node")),B(a.a),d;if(".."==A(a.a))return d=new Q($b,new H("node")),B(a.a),d;var f;if("@"==A(a.a))f=Pb,B(a.a),U(a,"Missing attribute name");else if("::"==A(a.a,1)){if(!/(?![0-9])[\w]/.test(A(a.a).charAt(0)))throw Error("Bad token: "+B(a.a));c=B(a.a);f=Zb[c]||null;if(!f)throw Error("No axis with name: "+c);B(a.a);U(a,"Missing node name")}else f=Wb;c=A(a.a);if(/(?![0-9])[\w]/.test(c.charAt(0)))if("("== A(a.a,1)){if(!Lb(c))throw Error("Invalid node type: "+c);c=B(a.a);if(!Lb(c))throw Error("Invalid type name: "+c);ic(a,"(");U(a,"Bad nodetype");e=A(a.a).charAt(0);var h=null;if('"'==e||"'"==e)h=kc(a);U(a,"Bad nodetype");jc(a);c=new H(c,h)}else c=lc(a);else if("*"==c)c=lc(a);else throw Error("Bad token: "+B(a.a));e=new Vb(oc(a),f.a);return d||new Q(f,c,e,"//"==b)} function oc(a){for(var b=[];"["==A(a.a);){B(a.a);U(a,"Missing predicate expression.");var c=gc(a);b.push(c);U(a,"Unclosed predicate expression.");ic(a,"]")}return b}function hc(a){if("-"==A(a.a))return B(a.a),new bc(hc(a));var b=mc(a);if("|"!=A(a.a))a=b;else{for(b=[b];"|"==B(a.a);)U(a,"Missing next union location path."),b.push(mc(a));a.a.a--;a=new cc(b)}return a};function pc(a){switch(a.nodeType){case 1:return ha(qc,a);case 9:return pc(a.documentElement);case 11:case 10:case 6:case 12:return rc;default:return a.parentNode?pc(a.parentNode):rc}}function rc(){return null}function qc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?qc(a.parentNode,b):null};function sc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=gb(a);if(kb(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ga(b.lookupNamespaceURI,b)):b=function(){return null};var d=gc(new fc(c,b));if(!kb(c))throw Error("Bad token: "+B(c));this.evaluate=function(a,b){var c=d.a(new bb(a));return new V(c,b)}} function V(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?wb(a):""+a;break;case 1:this.numberValue=a instanceof F?+wb(a):+a;break;case 3:this.booleanValue=a instanceof F?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= I(a);c=[];for(var e=J(d);e;e=J(d))c.push(e instanceof db?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=vb(a);this.singleNodeValue=d instanceof db?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| 0>a?null:c[a]}}V.ANY_TYPE=0;V.NUMBER_TYPE=1;V.STRING_TYPE=2;V.BOOLEAN_TYPE=3;V.UNORDERED_NODE_ITERATOR_TYPE=4;V.ORDERED_NODE_ITERATOR_TYPE=5;V.UNORDERED_NODE_SNAPSHOT_TYPE=6;V.ORDERED_NODE_SNAPSHOT_TYPE=7;V.ANY_UNORDERED_NODE_TYPE=8;V.FIRST_ORDERED_NODE_TYPE=9;function tc(a){this.lookupNamespaceURI=pc(a)} function uc(a){a=a||l;var b=a.document;b.evaluate||(a.XPathResult=V,b.evaluate=function(a,b,e,f){return(new sc(a,e)).evaluate(b,f)},b.createExpression=function(a,b){return new sc(a,b)},b.createNSResolver=function(a){return new tc(a)})}aa("wgxpath.install",uc);var W={};W.F=function(){var a={R:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); W.u=function(a,b,c){var d=Va(a);if(!d.documentElement)return null;(x||Za)&&uc(d?d.parentWindow||d.defaultView:window);try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):W.F;if(x&&!Na(7))return d.evaluate.call(d,b,a,e,c,null);if(!x||9<=Pa){for(var f={},h=d.getElementsByTagName("*"),k=0;k<h.length;++k){var t=h[k],v=t.namespaceURI;if(v&&!f[v]){var E=t.lookupPrefix(v);if(!E){var S=v.match(".*/(\\w+)/?$");S?E=S[1]:E="xhtml"}f[v]=E}}var T={},ib;for(ib in f)T[f[ib]]=ib;e=function(a){return T[a]|| null}}try{return d.evaluate(b,a,e,c,null)}catch(dc){if("TypeError"===dc.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):W.F,d.evaluate(b,a,e,c,null);throw dc;}}catch(ec){if(!y||"NS_ERROR_ILLEGAL_VALUE"!=ec.name)throw new q(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+ec);}};W.G=function(a,b){if(!a||1!=a.nodeType)throw new q(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");}; W.J=function(a,b){var c=function(){var c=W.u(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=Va(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||W.G(c,a);return c}; W.O=function(a,b){var c=function(){var c=W.u(b,a,7);if(c){for(var e=c.snapshotLength,f=[],h=0;h<e;++h)f.push(c.snapshotItem(h));return f}return b.selectNodes?(c=Va(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();p(c,function(b){W.G(b,a)});return c};function vc(a){return(a=a.exec(u))?a[1]:""}var wc=function(){if(Wa)return vc(/Firefox\/([0-9.]+)/);if(x||Fa||Ea)return La;if($a)return vc(/Chrome\/([0-9.]+)/);if(ab&&!(Da()||w("iPad")||w("iPod")))return vc(/Version\/([0-9.]+)/);if(Xa||Ya){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(u))return a[1]+"."+a[2]}else if(Za)return(a=vc(/Android\s+([0-9.]+)/))?a:vc(/Version\/([0-9.]+)/);return""}();var xc,yc;function zc(a){return Ac?xc(a):x?0<=ka(Pa,a):Na(a)}function Bc(a){Ac?yc(a):Za?ka(Cc,a):ka(wc,a)} var Ac=function(){if(!y)return!1;var a=l.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(b){return!1}var c=a.classes,a=a.interfaces,d=c["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),c=c["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),e=c.platformVersion,f=c.version;xc=function(a){return 0<=d.compare(e,""+a)};yc=function(a){d.compare(f,""+a)};return!0}(),Dc;if(Za){var Ec=/Android\s+([0-9\.]+)/.exec(u);Dc=Ec?Ec[1]:"0"}else Dc="0"; var Cc=Dc,Fc=x&&!(10<=Pa);Za&&Bc(2.3);Za&&Bc(4);ab&&Bc(6);function X(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}g=X.prototype;g.clone=function(){return new X(this.left,this.top,this.width,this.height)};g.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};g.contains=function(a){return a instanceof X?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}; g.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};g.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};g.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}; g.scale=function(a,b){var c="number"==typeof b?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function Gc(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)} function Hc(a){var b;var c=Gc(a,"MAP");if(c||Gc(a,"AREA")){var d=c?a:Gc(a.parentNode,"MAP")?a.parentNode:null,e=b=null;if(d&&d.name&&(b=W.J('/descendant::*[@usemap = "#'+d.name+'"]',Va(d)))&&(e=Hc(b),!c&&"default"!=a.shape.toLowerCase()))var f=Ic(a),c=Math.min(Math.max(f.left,0),e.width),d=Math.min(Math.max(f.top,0),e.height),h=Math.min(f.width,e.width-c),f=Math.min(f.height,e.height-d),e=new X(c+e.left,d+e.top,h,f);b={a:b,rect:e||new X(0,0,0,0)}}else b=null;if(b)return b.rect;if(Gc(a,"HTML"))return a= Va(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new Qa(a.clientWidth,a.clientHeight),new X(0,0,a.width,a.height);var k;try{k=a.getBoundingClientRect()}catch(t){return new X(0,0,0,0)}k=new X(k.left,k.top,k.right-k.left,k.bottom-k.top);x&&a.ownerDocument.body&&(a=Va(a),k.left-=a.documentElement.clientLeft+a.body.clientLeft,k.top-=a.documentElement.clientTop+a.body.clientTop);return k} function Ic(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 X(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new X(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 X(b,c,d-b,e-c)}return new X(0,0,0,0)};Ga||Ac&&Bc(3.6);x&&zc(10);Za&&Bc(4);function Y(a,b){this.v={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Jc(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof Y)for(d=Kc(a),Lc(a),e=[],c=0;c<a.l.length;c++)e.push(a.v[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)Jc(this,d[c],e[c])}}function Kc(a){Lc(a);return a.l.concat()} Y.prototype.clear=function(){this.v={};this.b=this.a=this.l.length=0};function Lc(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.v,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}Y.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.v,a)?this.v[a]:b}; function Jc(a,b,c){Object.prototype.hasOwnProperty.call(a.v,b)||(a.a++,a.l.push(b),a.b++);a.v[b]=c}Y.prototype.forEach=function(a,b){for(var c=Kc(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};Y.prototype.clone=function(){return new Y(this)};var Mc={};function Z(a,b,c){da(a)&&(a=y?a.f:a.g);a=new Nc(a);!b||b in Mc&&!c||(Mc[b]={key:a,shift:!1},c&&(Mc[c]={key:a,shift:!0}));return a}function Nc(a){this.code=a}Z(8);Z(9);Z(13);var Oc=Z(16),Pc=Z(17),Qc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var Rc=Z(Ia?{f:91,g:91}:Ha?{f:224,g:91}:{f:0,g:91});Z(Ia?{f:92,g:92}:Ha?{f:224,g:93}:{f:0,g:92});Z(Ia?{f:93,g:93}:Ha?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var Sc=new Y;Jc(Sc,1,Oc);Jc(Sc,2,Pc);Jc(Sc,4,Qc);Jc(Sc,8,Rc);(function(a){var b=new Y;p(Kc(a),function(c){Jc(b,a.get(c).code,c)});return b})(Sc);y&&zc(12);function Tc(){} function Uc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Uc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Vc(d,c),c.push(":"),Uc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":Vc(b,c);break;case "number":c.push(isFinite(b)&& !isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Wc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Xc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; function Vc(a,b){b.push('"',a.replace(Xc,function(a){var b=Wc[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Wc[a]=b);return b}),'"')};Ga||y&&zc(3.5)||x&&zc(8);function Yc(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return oa(a,Yc);case "object":if(za(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Zc(a);return b}if(za(a,"document"))return b={},b.WINDOW=Zc(a),b;if(ca(a))return oa(a,Yc);a=xa(a,function(a,b){return"number"==typeof b||m(b)});return ya(a,Yc);default:return null}} function $c(a,b){return"array"==ba(a)?oa(a,function(a){return $c(a,b)}):da(a)?"function"==typeof a?a:za(a,"ELEMENT")?ad(a.ELEMENT,b):za(a,"WINDOW")?ad(a.WINDOW,b):ya(a,function(a){return $c(a,b)}):a}function bd(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.C=ia());b.C||(b.C=ia());return b}function Zc(a){var b=bd(a.ownerDocument),c=Aa(b,function(b){return b==a});c||(c=":wdc:"+b.C++,b[c]=a);return c} function ad(a,b){a=decodeURIComponent(a);var c=b||document,d=bd(c);if(!za(d,a))throw new q(10,"Element does not exist in cache");var e=d[a];if(za(e,"setInterval")){if(e.closed)throw delete d[a],new q(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new q(10,"Element is no longer attached to the DOM");};function cd(a,b,c){var d;try{var e;c?e=ad(c.WINDOW):e=window;var f=$c(b,e.document),h=a.apply(null,f);d={status:0,value:Yc(h)}}catch(k){d={status:za(k,"code")?k.code:13,value:{message:k.message}}}a=[];Uc(new Tc,d,a);return a.join("")};aa("_",function(a,b){return cd(function(a){var b=Hc(a);a=b.height;b=b.width;Fc||(b=Math.floor(b),a=Math.floor(a));return{width:b,height:a}},[a],b)});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);}