UNPKG

webdriverio-automation

Version:

WebdriverIO-Automation android ios project

116 lines (111 loc) 54.3 kB
function(){return function(){var k=this;function l(a){return void 0!==a}function q(a){return"string"==typeof a}function aa(a,b){a=a.split(".");var c=k;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&l(b)?c[d]=b:c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}} 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 da(a){return"function"==ba(a)}function ea(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function fa(a,b,c){return a.call.apply(a.bind,arguments)} function ga(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ha(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ha=fa:ha=ga;return ha.apply(null,arguments)} function ia(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 ja=Date.now||function(){return+new Date};function r(a,b){function c(){}c.prototype=b.prototype;a.V=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.U=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}};var ka=window;function t(a,b){this.code=a;this.a=u[a]||la;this.message=b||"";a=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")});b=a.length-5;if(0>b||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}r(t,Error);var la="unknown error",u={15:"element not selectable",11:"element not visible"};u[31]=la;u[30]=la;u[24]="invalid cookie domain";u[29]="invalid element coordinates";u[12]="invalid element state"; u[32]="invalid selector";u[51]="invalid selector";u[52]="invalid selector";u[17]="javascript error";u[405]="unsupported operation";u[34]="move target out of bounds";u[27]="no such alert";u[7]="no such element";u[8]="no such frame";u[23]="no such window";u[28]="script timeout";u[33]="session not created";u[10]="stale element reference";u[21]="timeout";u[25]="unable to set cookie";u[26]="unexpected alert open";u[13]=la;u[9]="unknown command";t.prototype.toString=function(){return this.name+": "+this.message};var ma;function na(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var oa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; function pa(a,b){var c=0;a=oa(String(a)).split(".");b=oa(String(b)).split(".");for(var d=Math.max(a.length,b.length),e=0;!c&&e<d;e++){var f=a[e]||"",g=b[e]||"";do{f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];if(0==f[0].length&&0==g[0].length)break;c=qa(0==f[1].length?0:parseInt(f[1],10),0==g[1].length?0:parseInt(g[1],10))||qa(0==f[2].length,0==g[2].length)||qa(f[2],g[2]);f=f[3];g=g[3]}while(!c)}return c}function qa(a,b){return a<b?-1:a>b?1:0} function ra(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};function sa(a,b){if(q(a))return q(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function v(a,b){for(var c=a.length,d=q(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function ta(a,b){for(var c=a.length,d=[],e=0,f=q(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d} function ua(a,b){for(var c=a.length,d=Array(c),e=q(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 va(a,b,c){var d=c;v(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function wa(a,b){for(var c=a.length,d=q(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 xa(a,b){for(var c=a.length,d=q(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0} function za(a,b){a:{for(var c=a.length,d=q(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:q(a)?a.charAt(b):a[b]}function Aa(a){return Array.prototype.concat.apply([],arguments)}function Ba(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var w;a:{var Ca=k.navigator;if(Ca){var Da=Ca.userAgent;if(Da){w=Da;break a}}w=""}function x(a){return-1!=w.indexOf(a)};function Ea(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Fa(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Ga(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ha(){return(x("Chrome")||x("CriOS"))&&!x("Edge")};function Ia(){return x("iPhone")&&!x("iPod")&&!x("iPad")};function Ja(a,b){var c=Ka;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var La=x("Opera"),y=x("Trident")||x("MSIE"),Ma=x("Edge"),Na=x("Gecko")&&!(-1!=w.toLowerCase().indexOf("webkit")&&!x("Edge"))&&!(x("Trident")||x("MSIE"))&&!x("Edge"),Oa=-1!=w.toLowerCase().indexOf("webkit")&&!x("Edge");function Pa(){var a=k.document;return a?a.documentMode:void 0}var Qa; a:{var Ra="",Sa=function(){var a=w;if(Na)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Ma)return/Edge\/([\d\.]+)/.exec(a);if(y)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Oa)return/WebKit\/(\S+)/.exec(a);if(La)return/(?:Version)[ \/]?(\S+)/.exec(a)}();Sa&&(Ra=Sa?Sa[1]:"");if(y){var Ta=Pa();if(null!=Ta&&Ta>parseFloat(Ra)){Qa=String(Ta);break a}}Qa=Ra}var Ka={};function Ua(a){return Ja(a,function(){return 0<=pa(Qa,a)})}var Va;var Wa=k.document; Va=Wa&&y?Pa()||("CSS1Compat"==Wa.compatMode?parseInt(Qa,10):5):void 0;function Xa(a,b){this.x=l(a)?a:0;this.y=l(b)?b:0}Xa.prototype.toString=function(){return"("+this.x+", "+this.y+")"};Xa.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};Xa.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};Xa.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function Ya(a,b){this.width=a;this.height=b}Ya.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};Ya.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};Ya.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};Ya.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function Za(a){return a?new $a(z(a)):ma||(ma=new $a)}function ab(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function bb(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(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(y&&!(9<=Number(Va))){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=z(a);c=d.createRange(); c.selectNode(a);c.collapse(!0);a=d.createRange();a.selectNode(b);a.collapse(!0);return c.compareBoundaryPoints(k.Range.START_TO_END,a)}function eb(a,b){var c=a.parentNode;if(c==b)return-1;for(;b.parentNode!=c;)b=b.parentNode;return db(b,a)}function db(a,b){for(;b=b.previousSibling;)if(b==a)return-1;return 1}function z(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function fb(a,b){a&&(a=a.parentNode);for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null} function $a(a){this.a=a||k.document||document}$a.prototype.getElementsByTagName=function(a,b){return(b||this.a).getElementsByTagName(String(a))}; function gb(a,b,c,d){a=d||a.a;var e=b&&"*"!=b?String(b).toUpperCase():"";if(a.querySelectorAll&&a.querySelector&&(e||c))c=a.querySelectorAll(e+(c?"."+c:""));else if(c&&a.getElementsByClassName)if(d=a.getElementsByClassName(c),e){a={};for(var f=b=0,g;g=d[f];f++)e==g.nodeName&&(a[b++]=g);a.length=b;c=a}else c=d;else if(d=a.getElementsByTagName(e||"*"),c){a={};for(f=b=0;g=d[f];f++){var e=g.className,h;if(h="function"==typeof e.split)h=0<=sa(e.split(/\s+/),c);h&&(a[b++]=g)}a.length=b;c=a}else c=d;return c} ;var hb={A:function(a){return!(!a.querySelectorAll||!a.querySelector)},s:function(a,b){if(!a)throw new t(32,"No class name specified");a=oa(a);if(-1!==a.indexOf(" "))throw new t(32,"Compound class names not permitted");if(hb.A(b))try{return b.querySelector("."+a.replace(/\./g,"\\."))||null}catch(c){throw new t(32,"An invalid or illegal class name was specified");}a=gb(Za(b),"*",a,b);return a.length?a[0]:null},m:function(a,b){if(!a)throw new t(32,"No class name specified");a=oa(a);if(-1!==a.indexOf(" "))throw new t(32, "Compound class names not permitted");if(hb.A(b))try{return b.querySelectorAll("."+a.replace(/\./g,"\\."))}catch(c){throw new t(32,"An invalid or illegal class name was specified");}return gb(Za(b),"*",a,b)}};var ib=x("Firefox"),jb=Ia()||x("iPod"),kb=x("iPad"),lb=x("Android")&&!(Ha()||x("Firefox")||x("Opera")||x("Silk")),mb=Ha(),nb=x("Safari")&&!(Ha()||x("Coast")||x("Opera")||x("Edge")||x("Silk")||x("Android"))&&!(Ia()||x("iPad")||x("iPod"));function ob(a){return(a=a.exec(w))?a[1]:""}(function(){if(ib)return ob(/Firefox\/([0-9.]+)/);if(y||Ma||La)return Qa;if(mb)return Ia()||x("iPad")||x("iPod")?ob(/CriOS\/([0-9.]+)/):ob(/Chrome\/([0-9.]+)/);if(nb&&!(Ia()||x("iPad")||x("iPod")))return ob(/Version\/([0-9.]+)/);if(jb||kb){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(w);if(a)return a[1]+"."+a[2]}else if(lb)return(a=ob(/Android\s+([0-9.]+)/))?a:ob(/Version\/([0-9.]+)/);return""})();var pb,qb;function rb(a){return sb?pb(a):y?0<=pa(Va,a):Ua(a)} var sb=function(){if(!Na)return!1;var a=k.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;pb=function(a){return 0<=c.compare(d,""+a)};qb=function(a){c.compare(e,""+a)};return!0}(),tb=y&&!(8<=Number(Va)),ub=y&&!(9<=Number(Va));lb&&sb&&qb(2.3);lb&&sb&&qb(4);nb&&sb&&qb(6);var vb={s:function(a,b){if(!da(b.querySelector)&&y&&rb(8)&&!ea(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new t(32,"No selector specified");a=oa(a);try{var c=b.querySelector(a)}catch(d){throw new t(32,"An invalid or illegal selector was specified");}return c&&1==c.nodeType?c:null},m:function(a,b){if(!da(b.querySelectorAll)&&y&&rb(8)&&!ea(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new t(32,"No selector specified");a=oa(a);try{return b.querySelectorAll(a)}catch(c){throw new t(32, "An invalid or illegal selector was specified");}}};var wb={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 xb="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),yb=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,zb=/^#(?:[0-9a-f]{3}){1,2}$/i,Ab=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Bb=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function Cb(a,b){b=b.toLowerCase();return"style"==b?Db(a.style.cssText):tb&&"value"==b&&A(a,"INPUT")?a.value:ub&&!0===a[b]?String(a.getAttribute(b)):(a=a.getAttributeNode(b))&&a.specified?a.value:null}var Eb=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/; function Db(a){var b=[];v(a.split(Eb),function(a){var c=a.indexOf(":");0<c&&(a=[a.slice(0,c),a.slice(c+1)],2==a.length&&b.push(a[0].toLowerCase(),":",a[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}function A(a,b){b&&"string"!==typeof b&&(b=b.toString());return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)};/* 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 Fb(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var B=y&&!(9<=Number(Va)),Gb=y&&!(8<=Number(Va));function Hb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Ib(a,b){var c=Gb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Hb(b,a,b.nodeName,c)};function Jb(a){this.b=a;this.a=0}function Kb(a){a=a.match(Lb);for(var b=0;b<a.length;b++)Mb.test(a[b])&&a.splice(b,1);return new Jb(a)}var Lb=/\$?(?:(?![0-9-\.])(?:\*|[\w-\.]+):)?(?![0-9-\.])(?:\*|[\w-\.]+)|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|\s+|./g,Mb=/^\s/;function C(a,b){return a.b[a.a+(b||0)]}function D(a){return a.b[a.a++]}function Nb(a){return a.b.length<=a.a};function F(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(B&&"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),B&&"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 Ob(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Gb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Pb(a,b,c,d,e){return(B?Qb:Rb).call(null,a,b,q(c)?c:null,q(d)?d:null,e||new G)} function Qb(a,b,c,d,e){if(a instanceof Sb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;var g=Tb(a);if("*"!=g&&(f=b.getElementsByTagName(g),!f))return e;if(c){var h=[];for(a=0;b=f[a++];)Ob(b,c,d)&&h.push(b);f=h}for(a=0;b=f[a++];)"*"==g&&"!"==b.tagName||H(e,b);return e}Ub(a,b,c,d,e);return e} function Rb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!y?(b=b.getElementsByName(d),v(b,function(b){a.a(b)&&H(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),v(b,function(b){b.className==d&&a.a(b)&&H(e,b)})):a instanceof J?Ub(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),v(b,function(a){Ob(a,c,d)&&H(e,a)}));return e} function Vb(a,b,c,d,e){var f;if((a instanceof Sb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Tb(a);if("*"!=g&&(f=ta(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=ta(f,function(a){return Ob(a,c,d)}));v(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||H(e,a)});return e}return Wb(a,b,c,d,e)}function Wb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Ob(b,c,d)&&a.a(b)&&H(e,b);return e} function Ub(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Ob(b,c,d)&&a.a(b)&&H(e,b),Ub(a,b,c,d,e)}function Tb(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function G(){this.b=this.a=null;this.l=0}function Xb(a){this.node=a;this.a=this.b=null}function Yb(a,b){if(!a.a)return b;if(!b.a)return a;var c=a.a;b=b.a;for(var d=null,e,f=0;c&&b;){e=c.node;var g=b.node;e==g||e instanceof Hb&&g instanceof Hb&&e.a==g.a?(e=c,c=c.a,b=b.a):0<cb(c.node,b.node)?(e=b,b=b.a):(e=c,c=c.a);(e.b=d)?d.a=e:a.a=e;d=e;f++}for(e=c||b;e;)e.b=d,d=d.a=e,f++,e=e.a;a.b=d;a.l=f;return a}function Zb(a,b){b=new Xb(b);b.a=a.a;a.b?a.a.b=b:a.a=a.b=b;a.a=b;a.l++} function H(a,b){b=new Xb(b);b.b=a.b;a.a?a.b.a=b:a.a=a.b=b;a.b=b;a.l++}function $b(a){return(a=a.a)?a.node:null}function ac(a){return(a=$b(a))?F(a):""}function bc(a,b){return new cc(a,!!b)}function cc(a,b){this.f=a;this.b=(this.v=b)?a.b:a.a;this.a=null}function K(a){var b=a.b;if(b){var c=a.a=b;a.b=a.v?b.b:b.a;return c.node}return null};function L(a){this.i=a;this.b=this.g=!1;this.f=null}function M(a){return"\n "+a.toString().split("\n").join("\n ")}function dc(a,b){a.g=b}function ec(a,b){a.b=b}function O(a,b){a=a.a(b);return a instanceof G?+ac(a):+a}function P(a,b){a=a.a(b);return a instanceof G?ac(a):""+a}function fc(a,b){a=a.a(b);return a instanceof G?!!a.l:!!a};function gc(a,b,c){L.call(this,a.i);this.c=a;this.h=b;this.u=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==hc&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,w:b}):this.f={name:b.f.name,w:c})}r(gc,L); function ic(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=bc(b);for(d=K(b);d;d=K(b))for(e=bc(c),f=K(e);f;f=K(e))if(a(F(d),F(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=bc(e);for(var g=typeof d,h=K(f);h;h=K(f)){switch(g){case "number":h=+F(h);break;case "boolean":h=!!F(h);break;case "string":h=F(h);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(h,d)||e==c&&a(d,h))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)}gc.prototype.a=function(a){return this.c.o(this.h,this.u,a)};gc.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+M(this.h);return a+=M(this.u)};function jc(a,b,c,d){this.S=a;this.L=b;this.i=c;this.o=d}jc.prototype.toString=function(){return this.S};var kc={}; function Q(a,b,c,d){if(kc.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new jc(a,b,c,d);return kc[a.toString()]=a}Q("div",6,1,function(a,b,c){return O(a,c)/O(b,c)});Q("mod",6,1,function(a,b,c){return O(a,c)%O(b,c)});Q("*",6,1,function(a,b,c){return O(a,c)*O(b,c)});Q("+",5,1,function(a,b,c){return O(a,c)+O(b,c)});Q("-",5,1,function(a,b,c){return O(a,c)-O(b,c)});Q("<",4,2,function(a,b,c){return ic(function(a,b){return a<b},a,b,c)}); Q(">",4,2,function(a,b,c){return ic(function(a,b){return a>b},a,b,c)});Q("<=",4,2,function(a,b,c){return ic(function(a,b){return a<=b},a,b,c)});Q(">=",4,2,function(a,b,c){return ic(function(a,b){return a>=b},a,b,c)});var hc=Q("=",3,2,function(a,b,c){return ic(function(a,b){return a==b},a,b,c,!0)});Q("!=",3,2,function(a,b,c){return ic(function(a,b){return a!=b},a,b,c,!0)});Q("and",2,2,function(a,b,c){return fc(a,c)&&fc(b,c)});Q("or",1,2,function(a,b,c){return fc(a,c)||fc(b,c)});function lc(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");L.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}r(lc,L);lc.prototype.a=function(a){a=this.c.a(a);return mc(this.h,a)};lc.prototype.toString=function(){var a="Filter:"+M(this.c);return a+=M(this.h)};function nc(a,b){if(b.length<a.K)throw Error("Function "+a.j+" expects at least"+a.K+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.j+" expects at most "+a.D+" arguments, "+b.length+" given");a.R&&v(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});L.call(this,a.i);this.B=a;this.c=b;dc(this,a.g||wa(b,function(a){return a.g}));ec(this,a.P&&!b.length||a.O&&!!b.length||wa(b,function(a){return a.b}))} r(nc,L);nc.prototype.a=function(a){return this.B.o.apply(null,Aa(a,this.c))};nc.prototype.toString=function(){var a="Function: "+this.B;if(this.c.length)var b=va(this.c,function(a,b){return a+M(b)},"Arguments:"),a=a+M(b);return a};function oc(a,b,c,d,e,f,g,h,p){this.j=a;this.i=b;this.g=c;this.P=d;this.O=e;this.o=f;this.K=g;this.D=l(h)?h:g;this.R=!!p}oc.prototype.toString=function(){return this.j};var pc={}; function R(a,b,c,d,e,f,g,h){if(pc.hasOwnProperty(a))throw Error("Function already created: "+a+".");pc[a]=new oc(a,b,c,d,!1,e,f,g,h)}R("boolean",2,!1,!1,function(a,b){return fc(b,a)},1);R("ceiling",1,!1,!1,function(a,b){return Math.ceil(O(b,a))},1);R("concat",3,!1,!1,function(a,b){return va(Ba(arguments,1),function(b,d){return b+P(d,a)},"")},2,null);R("contains",2,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);return-1!=b.indexOf(a)},2);R("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0); R("false",2,!1,!1,function(){return!1},0);R("floor",1,!1,!1,function(a,b){return Math.floor(O(b,a))},1);R("id",4,!1,!1,function(a,b){function c(a){if(B){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return za(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument;a=P(b,a).split(/\s+/);var f=[];v(a,function(a){a=c(a);!a||0<=sa(f,a)||f.push(a)});f.sort(cb);var g=new G;v(f,function(a){H(g,a)});return g},1); R("lang",2,!1,!1,function(){return!1},1);R("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);R("local-name",3,!1,!0,function(a,b){return(a=b?$b(b.a(a)):a.a)?a.localName||a.nodeName.toLowerCase():""},0,1,!0);R("name",3,!1,!0,function(a,b){return(a=b?$b(b.a(a)):a.a)?a.nodeName.toLowerCase():""},0,1,!0);R("namespace-uri",3,!0,!1,function(){return""},0,1,!0); R("normalize-space",3,!1,!0,function(a,b){return(b?P(b,a):F(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);R("not",2,!1,!1,function(a,b){return!fc(b,a)},1);R("number",1,!1,!0,function(a,b){return b?O(b,a):+F(a.a)},0,1);R("position",1,!0,!1,function(a){return a.b},0);R("round",1,!1,!1,function(a,b){return Math.round(O(b,a))},1);R("starts-with",2,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);return!b.lastIndexOf(a,0)},2);R("string",3,!1,!0,function(a,b){return b?P(b,a):F(a.a)},0,1); R("string-length",1,!1,!0,function(a,b){return(b?P(b,a):F(a.a)).length},0,1);R("substring",3,!1,!1,function(a,b,c,d){c=O(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?O(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=P(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);R("substring-after",3,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); R("substring-before",3,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);R("sum",1,!1,!1,function(a,b){a=bc(b.a(a));b=0;for(var c=K(a);c;c=K(a))b+=+F(c);return b},1,1,!0);R("translate",3,!1,!1,function(a,b,c,d){b=P(b,a);c=P(c,a);var e=P(d,a);d={};for(var f=0;f<c.length;f++)a=c.charAt(f),a in d||(d[a]=e.charAt(f));c="";for(f=0;f<b.length;f++)a=b.charAt(f),c+=a in d?d[a]:a;return c},3);R("true",2,!1,!1,function(){return!0},0);function J(a,b){this.h=a;this.c=l(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 qc(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.f=function(){return this.h}; J.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=M(this.c));return a};function rc(a){L.call(this,3);this.c=a.substring(1,a.length-1)}r(rc,L);rc.prototype.a=function(){return this.c};rc.prototype.toString=function(){return"Literal: "+this.c};function Sb(a,b){this.j=a.toLowerCase();a="*"==this.j?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():a}Sb.prototype.a=function(a){var b=a.nodeType;if(1!=b&&2!=b)return!1;b=l(a.localName)?a.localName:a.nodeName;return"*"!=this.j&&this.j!=b.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Sb.prototype.f=function(){return this.j}; Sb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j};function sc(a){L.call(this,1);this.c=a}r(sc,L);sc.prototype.a=function(){return this.c};sc.prototype.toString=function(){return"Number: "+this.c};function tc(a,b){L.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;1==this.c.length&&(a=this.c[0],a.C||a.c!=uc||(a=a.u,"*"!=a.f()&&(this.f={name:a.f(),w:null})))}r(tc,L);function vc(){L.call(this,4)}r(vc,L);vc.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?H(b,a):H(b,a.ownerDocument);return b};vc.prototype.toString=function(){return"Root Helper Expression"};function wc(){L.call(this,4)}r(wc,L);wc.prototype.a=function(a){var b=new G;H(b,a.a);return b};wc.prototype.toString=function(){return"Context Helper Expression"}; function xc(a){return"/"==a||"//"==a}tc.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=bc(b,e.c.v);if(e.g||e.c!=yc)if(e.g||e.c!=zc){var g=K(f);for(b=e.a(new Fb(g));g=K(f);)g=e.a(new Fb(g)),b=Yb(b,g)}else g=K(f),b=e.a(new Fb(g));else{for(g=K(f);(b=K(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new Fb(g))}}return b}; tc.prototype.toString=function(){var a="Path Expression:"+M(this.h);if(this.c.length){var b=va(this.c,function(a,b){return a+M(b)},"Steps:");a+=M(b)}return a};function Ac(a,b){this.a=a;this.v=!!b} function mc(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=bc(b),f=b.l,g,h=0;g=K(e);h++){var p=a.v?f-h:h+1;g=d.a(new Fb(g,p,f));if("number"==typeof g)p=p==g;else if("string"==typeof g||"boolean"==typeof g)p=!!g;else if(g instanceof G)p=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!p){p=e;g=p.f;var n=p.a;if(!n)throw Error("Next must be called at least once before remove.");var m=n.b,n=n.a;m?m.a=n:g.a=n;n?n.b=m:g.b=m;g.l--;p.a=null}}return b} Ac.prototype.toString=function(){return va(this.a,function(a,b){return a+M(b)},"Predicates:")};function Bc(a,b,c,d){L.call(this,4);this.c=a;this.u=b;this.h=c||new Ac([]);this.C=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.T&&b&&(a=b.name,a=B?a.toLowerCase():a,this.f={name:a,w:b.w});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}r(Bc,L); Bc.prototype.a=function(a){var b=a.a,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.w?P(c.w,a):null,f=1);if(this.C)if(this.g||this.c!=Cc)if(b=bc((new Bc(Dc,new J("node"))).a(a)),c=K(b))for(a=this.o(c,d,e,f);c=K(b);)a=Yb(a,this.o(c,d,e,f));else a=new G;else a=Pb(this.u,b,d,e),a=mc(this.h,a,f);else a=this.o(a.a,d,e,f);return a};Bc.prototype.o=function(a,b,c,d){a=this.c.B(this.u,a,b,c);return a=mc(this.h,a,d)}; Bc.prototype.toString=function(){var a="Step:"+M("Operator: "+(this.C?"//":"/"));this.c.j&&(a+=M("Axis: "+this.c));a+=M(this.u);if(this.h.a.length){var b=va(this.h.a,function(a,b){return a+M(b)},"Predicates:");a+=M(b)}return a};function Ec(a,b,c,d){this.j=a;this.B=b;this.v=c;this.T=d}Ec.prototype.toString=function(){return this.j};var Fc={};function S(a,b,c,d){if(Fc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Ec(a,b,c,!!d);return Fc[a]=b} S("ancestor",function(a,b){for(var c=new G;b=b.parentNode;)a.a(b)&&Zb(c,b);return c},!0);S("ancestor-or-self",function(a,b){var c=new G;do a.a(b)&&Zb(c,b);while(b=b.parentNode);return c},!0); var uc=S("attribute",function(a,b){var c=new G,d=a.f();if("style"==d&&B&&b.style)return H(c,new Hb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(d=0;a=e[d];d++)B?a.nodeValue&&H(c,Ib(b,a)):H(c,a);else(a=e.getNamedItem(d))&&(B?a.nodeValue&&H(c,Ib(b,a)):H(c,a));return c},!1),Cc=S("child",function(a,b,c,d,e){return(B?Vb:Wb).call(null,a,b,q(c)?c:null,q(d)?d:null,e||new G)},!1,!0);S("descendant",Pb,!1,!0); var Dc=S("descendant-or-self",function(a,b,c,d){var e=new G;Ob(b,c,d)&&a.a(b)&&H(e,b);return Pb(a,b,c,d,e)},!1,!0),yc=S("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)Ob(f,c,d)&&a.a(f)&&H(e,f),e=Pb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);S("following-sibling",function(a,b){for(var c=new G;b=b.nextSibling;)a.a(b)&&H(c,b);return c},!1);S("namespace",function(){return new G},!1); var Gc=S("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return H(c,b.ownerElement),c;b=b.parentNode;a.a(b)&&H(c,b);return c},!1),zc=S("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){var p=[];for(b=f[g];b=b.previousSibling;)p.unshift(b);for(var n=0,m=p.length;n<m;n++)b=p[n],Ob(b,c,d)&&a.a(b)&&H(e,b),e=Pb(a,b,c,d,e)}return e},!0,!0); S("preceding-sibling",function(a,b){for(var c=new G;b=b.previousSibling;)a.a(b)&&Zb(c,b);return c},!0);var Hc=S("self",function(a,b){var c=new G;a.a(b)&&H(c,b);return c},!1);function Ic(a){L.call(this,1);this.c=a;this.g=a.g;this.b=a.b}r(Ic,L);Ic.prototype.a=function(a){return-O(this.c,a)};Ic.prototype.toString=function(){return"Unary Expression: -"+M(this.c)};function Jc(a){L.call(this,4);this.c=a;dc(this,wa(this.c,function(a){return a.g}));ec(this,wa(this.c,function(a){return a.b}))}r(Jc,L);Jc.prototype.a=function(a){var b=new G;v(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=Yb(b,c)});return b};Jc.prototype.toString=function(){return va(this.c,function(a,b){return a+M(b)},"Union Expression:")};function Kc(a,b){this.a=a;this.b=b}function Lc(a){for(var b,c=[];;){T(a,"Missing right hand side of binary expression.");b=Mc(a);var d=D(a.a);if(!d)break;var e=(d=kc[d]||null)&&d.L;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].L;)b=new gc(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new gc(c.pop(),c.pop(),b);return b}function T(a,b){if(Nb(a.a))throw Error(b);}function Nc(a,b){a=D(a.a);if(a!=b)throw Error("Bad token, expected: "+b+" got: "+a);} function Oc(a){a=D(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Pc(a){a=D(a.a);if(2>a.length)throw Error("Unclosed literal string");return new rc(a)} function Qc(a){var b=[];if(xc(C(a.a))){var c=D(a.a);var d=C(a.a);if("/"==c&&(Nb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new vc;d=new vc;T(a,"Missing next location step.");c=Rc(a,c);b.push(c)}else{a:{c=C(a.a);d=c.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":D(a.a);c=Lc(a);T(a,'unclosed "("');Nc(a,")");break;case '"':case "'":c=Pc(a);break;default:if(isNaN(+c))if(!qc(c)&&/(?![0-9])[\w]/.test(d)&&"("==C(a.a,1)){c=D(a.a); c=pc[c]||null;D(a.a);for(d=[];")"!=C(a.a);){T(a,"Missing function argument list.");d.push(Lc(a));if(","!=C(a.a))break;D(a.a)}T(a,"Unclosed function argument list.");Oc(a);c=new nc(c,d)}else{c=null;break a}else c=new sc(+D(a.a))}"["==C(a.a)&&(d=new Ac(Sc(a)),c=new lc(c,d))}if(c)if(xc(C(a.a)))d=c;else return c;else c=Rc(a,"/"),d=new wc,b.push(c)}for(;xc(C(a.a));)c=D(a.a),T(a,"Missing next location step."),c=Rc(a,c),b.push(c);return new tc(d,b)} function Rc(a,b){if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==C(a.a)){var c=new Bc(Hc,new J("node"));D(a.a);return c}if(".."==C(a.a))return c=new Bc(Gc,new J("node")),D(a.a),c;if("@"==C(a.a)){var d=uc;D(a.a);T(a,"Missing attribute name")}else if("::"==C(a.a,1)){if(!/(?![0-9])[\w]/.test(C(a.a).charAt(0)))throw Error("Bad token: "+D(a.a));var e=D(a.a);d=Fc[e]||null;if(!d)throw Error("No axis with name: "+e);D(a.a);T(a,"Missing node name")}else d=Cc;e=C(a.a);if(/(?![0-9])[\w\*]/.test(e.charAt(0)))if("("== C(a.a,1)){if(!qc(e))throw Error("Invalid node type: "+e);e=D(a.a);if(!qc(e))throw Error("Invalid type name: "+e);Nc(a,"(");T(a,"Bad nodetype");var f=C(a.a).charAt(0),g=null;if('"'==f||"'"==f)g=Pc(a);T(a,"Bad nodetype");Oc(a);e=new J(e,g)}else if(e=D(a.a),f=e.indexOf(":"),-1==f)e=new Sb(e);else{var g=e.substring(0,f);if("*"==g)var h="*";else if(h=a.b(g),!h)throw Error("Namespace prefix not declared: "+g);e=e.substr(f+1);e=new Sb(e,h)}else throw Error("Bad token: "+D(a.a));a=new Ac(Sc(a),d.v);return c|| new Bc(d,e,a,"//"==b)}function Sc(a){for(var b=[];"["==C(a.a);){D(a.a);T(a,"Missing predicate expression.");var c=Lc(a);b.push(c);T(a,"Unclosed predicate expression.");Nc(a,"]")}return b}function Mc(a){if("-"==C(a.a))return D(a.a),new Ic(Mc(a));var b=Qc(a);if("|"!=C(a.a))a=b;else{for(b=[b];"|"==D(a.a);)T(a,"Missing next union location path."),b.push(Qc(a));a.a.a--;a=new Jc(b)}return a};function Tc(a){switch(a.nodeType){case 1:return ia(Uc,a);case 9:return Tc(a.documentElement);case 11:case 10:case 6:case 12:return Vc;default:return a.parentNode?Tc(a.parentNode):Vc}}function Vc(){return null}function Uc(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?Uc(a.parentNode,b):null};function Wc(a,b){if(!a.length)throw Error("Empty XPath expression.");a=Kb(a);if(Nb(a))throw Error("Invalid XPath expression.");b?da(b)||(b=ha(b.lookupNamespaceURI,b)):b=function(){return null};var c=Lc(new Kc(a,b));if(!Nb(a))throw Error("Bad token: "+D(a));this.evaluate=function(a,b){a=c.a(new Fb(a));return new U(a,b)}} function U(a,b){if(!b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;switch(b){case 2:this.stringValue=a instanceof G?ac(a):""+a;break;case 1:this.numberValue=a instanceof G?+ac(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var c= bc(a);var d=[];for(var e=K(c);e;e=K(c))d.push(e instanceof Hb?e.a:e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:a=$b(a);this.singleNodeValue=a instanceof Hb?a.a:a;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>=d.length?null:d[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=d.length|| 0>a?null:d[a]}}U.ANY_TYPE=0;U.NUMBER_TYPE=1;U.STRING_TYPE=2;U.BOOLEAN_TYPE=3;U.UNORDERED_NODE_ITERATOR_TYPE=4;U.ORDERED_NODE_ITERATOR_TYPE=5;U.UNORDERED_NODE_SNAPSHOT_TYPE=6;U.ORDERED_NODE_SNAPSHOT_TYPE=7;U.ANY_UNORDERED_NODE_TYPE=8;U.FIRST_ORDERED_NODE_TYPE=9;function Xc(a){this.lookupNamespaceURI=Tc(a)} function Yc(a,b){a=a||k;var c=a.Document&&a.Document.prototype||a.document;if(!c.evaluate||b)a.XPathResult=U,c.evaluate=function(a,b,c,g){return(new Wc(a,c)).evaluate(b,g)},c.createExpression=function(a,b){return new Wc(a,b)},c.createNSResolver=function(a){return new Xc(a)}}aa("wgxpath.install",Yc);var V={};V.G=function(){var a={W:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); V.o=function(a,b,c){var d=z(a);if(!d.documentElement)return null;(y||lb)&&Yc(d?d.parentWindow||d.defaultView:window);try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):V.G;if(y&&!Ua(7))return d.evaluate.call(d,b,a,e,c,null);if(!y||9<=Number(Va)){for(var f={},g=d.getElementsByTagName("*"),h=0;h<g.length;++h){var p=g[h],n=p.namespaceURI;if(n&&!f[n]){var m=p.lookupPrefix(n);if(!m)var E=n.match(".*/(\\w+)/?$"),m=E?E[1]:"xhtml";f[n]=m}}var I={},N;for(N in f)I[f[N]]=N;e=function(a){return I[a]|| null}}try{return d.evaluate(b,a,e,c,null)}catch(ya){if("TypeError"===ya.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):V.G,d.evaluate(b,a,e,c,null);throw ya;}}catch(ya){if(!Na||"NS_ERROR_ILLEGAL_VALUE"!=ya.name)throw new t(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+ya);}};V.H=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.");}; V.s=function(a,b){var c=function(){var c=V.o(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=z(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||V.H(c,a);return c}; V.m=function(a,b){var c=function(){var c=V.o(b,a,7);if(c){for(var e=c.snapshotLength,f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=z(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();v(c,function(b){V.H(b,a)});return c};function Zc(a,b,c,d){this.c=a;this.a=b;this.b=c;this.f=d}Zc.prototype.toString=function(){return"("+this.c+"t, "+this.a+"r, "+this.b+"b, "+this.f+"l)"};Zc.prototype.ceil=function(){this.c=Math.ceil(this.c);this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.f=Math.ceil(this.f);return this};Zc.prototype.floor=function(){this.c=Math.floor(this.c);this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.f=Math.floor(this.f);return this}; Zc.prototype.round=function(){this.c=Math.round(this.c);this.a=Math.round(this.a);this.b=Math.round(this.b);this.f=Math.round(this.f);return this};function W(a,b,c,d){this.a=a;this.b=b;this.width=c;this.height=d}W.prototype.toString=function(){return"("+this.a+", "+this.b+" - "+this.width+"w x "+this.height+"h)"};W.prototype.ceil=function(){this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};W.prototype.floor=function(){this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this}; W.prototype.round=function(){this.a=Math.round(this.a);this.b=Math.round(this.b);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};var $c="function"===typeof ShadowRoot;function ad(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return A(a)?a:null} function X(a,b){b=ra(b);if("float"==b||"cssFloat"==b||"styleFloat"==b)b=ub?"styleFloat":"cssFloat";a:{var c=b;var d=z(a);if(d.defaultView&&d.defaultView.getComputedStyle&&(d=d.defaultView.getComputedStyle(a,null))){c=d[c]||d.getPropertyValue(c)||"";break a}c=""}a=c||bd(a,b);if(null===a)a=null;else if(0<=sa(xb,b)){b:{var e=a.match(Ab);if(e&&(b=Number(e[1]),c=Number(e[2]),d=Number(e[3]),e=Number(e[4]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d&&0<=e&&1>=e)){b=[b,c,d,e];break b}b=null}if(!b)b:{if(d=a.match(Bb))if(b= Number(d[1]),c=Number(d[2]),d=Number(d[3]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d){b=[b,c,d,1];break b}b=null}if(!b)b:{b=a.toLowerCase();c=wb[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(yb,"#$1$1$2$2$3$3")),!zb.test(c))){b=null;break b}b=[parseInt(c.substr(1,2),16),parseInt(c.substr(3,2),16),parseInt(c.substr(5,2),16),1]}a=b?"rgba("+b.join(", ")+")":a}return a} function bd(a,b){var c=a.currentStyle||a.style,d=c[b];!l(d)&&da(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?l(d)?d:null:(a=ad(a))?bd(a,b):null} function cd(a,b,c){function d(a){var b=dd(a);return 0<b.height&&0<b.width?!0:A(a,"PATH")&&(0<b.height||0<b.width)?(a=X(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=X(a,"overflow")&&wa(a.childNodes,function(a){return 3==a.nodeType||A(a)&&d(a)})}function e(a){return ed(a)==Y&&xa(a.childNodes,function(a){return!A(a)||e(a)||!d(a)})}if(!A(a))throw Error("Argument to isShown must be of type Element");if(A(a,"BODY"))return!0;if(A(a,"OPTION")||A(a,"OPTGROUP"))return a=fb(a,function(a){return A(a,"SELECT")}), !!a&&cd(a,!0,c);var f=fd(a);if(f)return!!f.I&&0<f.rect.width&&0<f.rect.height&&cd(f.I,b,c);if(A(a,"INPUT")&&"hidden"==a.type.toLowerCase()||A(a,"NOSCRIPT"))return!1;f=X(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||gd(a))&&d(a)?!e(a):!1} function hd(a){function b(a){if(A(a)&&"none"==X(a,"display"))return!1;var c;(c=a.parentNode)&&c.shadowRoot&&void 0!==a.assignedSlot?c=a.assignedSlot?a.assignedSlot.parentNode:null:a.getDestinationInsertionPoints&&(a=a.getDestinationInsertionPoints(),0<a.length&&(c=a[a.length-1]));if($c&&c instanceof ShadowRoot){if(c.host.shadowRoot!==c)return!1;c=c.host}return!c||9!=c.nodeType&&11!=c.nodeType?c&&b(c):!0}return cd(a,!1,b)}var Y="hidden"; function ed(a){function b(a){function b(a){return a==g?!0:!X(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==X(a,"position")?!1:!0}var c=X(a,"position");if("fixed"==c)return n=!0,a==g?null:g;for(a=ad(a);a&&!b(a);)a=ad(a);return a}function c(a){var b=a;if("visible"==p)if(a==g&&h)b=h;else if(a==h)return{x:"visible",y:"visible"};b={x:X(b,"overflow-x"),y:X(b,"overflow-y")};a==g&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function d(a){if(a==g){var b=(new $a(f)).a; a=b.scrollingElement?b.scrollingElement:Oa||"CSS1Compat"!=b.compatMode?b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=y&&Ua("10")&&b.pageYOffset!=a.scrollTop?new Xa(a.scrollLeft,a.scrollTop):new Xa(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new Xa(a.scrollLeft,a.scrollTop);return a}var e=id(a);var f=z(a),g=f.documentElement,h=f.body,p=X(g,"overflow"),n;for(a=b(a);a;a=b(a)){var m=c(a);if("visible"!=m.x||"visible"!=m.y){var E=dd(a);if(!E.width||!E.height)return Y; var I=e.a<E.a,N=e.b<E.b;if(I&&"hidden"==m.x||N&&"hidden"==m.y)return Y;if(I&&"visible"!=m.x||N&&"visible"!=m.y){I=d(a);N=e.b<E.b-I.y;if(e.a<E.a-I.x&&"visible"!=m.x||N&&"visible"!=m.x)return Y;e=ed(a);return e==Y?Y:"scroll"}I=e.f>=E.a+E.width;E=e.c>=E.b+E.height;if(I&&"hidden"==m.x||E&&"hidden"==m.y)return Y;if(I&&"visible"!=m.x||E&&"visible"!=m.y){if(n&&(m=d(a),e.f>=g.scrollWidth-m.x||e.a>=g.scrollHeight-m.y))return Y;e=ed(a);return e==Y?Y:"scroll"}}}return"none"} function dd(a){var b=fd(a);if(b)return b.rect;if(A(a,"HTML"))return a=z(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new Ya(a.clientWidth,a.clientHeight),new W(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(d){return new W(0,0,0,0)}b=new W(c.left,c.top,c.right-c.left,c.bottom-c.top);y&&a.ownerDocument.body&&(a=z(a),b.a-=a.documentElement.clientLeft+a.body.clientLeft,b.b-=a.documentElement.clientTop+a.body.clientTop); return b}function fd(a){var b=A(a,"MAP");if(!b&&!A(a,"AREA"))return null;var c=b?a:A(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=V.s('/descendant::*[@usemap = "#'+c.name+'"]',z(c)))&&(e=dd(d),b||"default"==a.shape.toLowerCase()||(a=jd(a),b=Math.min(Math.max(a.a,0),e.width),c=Math.min(Math.max(a.b,0),e.height),e=new W(b+e.a,c+e.b,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{I:d,rect:e||new W(0,0,0,0)}} function jd(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 W(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new W(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 W(b,c,d-b,e-c)}return new W(0,0,0,0)}function id(a){a=dd(a);return new Zc(a.b,a.a+a.width,a.b+a.height,a.a)} function kd(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")}function ld(a){var b=[];$c?md(a,b):nd(a,b);a=ua(b,kd);return kd(a.join("\n")).replace(/\xa0/g," ")} function od(a,b,c){if(A(a,"BR"))b.push("");else{var d=A(a,"TD"),e=X(a,"display"),f=!d&&!(0<=sa(pd,e)),g=l(a.previousElementSibling)?a.previousElementSibling:ab(a.previousSibling),g=g?X(g,"display"):"",h=X(a,"float")||X(a,"cssFloat")||X(a,"styleFloat");!f||"run-in"==g&&"none"==h||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var p=hd(a),n=null,m=null;p&&(n=X(a,"white-space"),m=X(a,"text-transform"));v(a.childNodes,function(a){c(a,b,p,n,m)});a=b[b.length-1]||"";!d&&"table-cell"!=e||!a||na(a)||(b[b.length- 1]+=" ");f&&"run-in"!=e&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function nd(a,b){od(a,b,function(a,b,e,f,g){3==a.nodeType&&e?qd(a,b,f,g):A(a)&&nd(a,b)})}var pd="inline inline-block inline-table none table-cell table-column table-column-group".split(" "); function qd(a,b,c,d){a=a.nodeValue.replace(/[\u200b\u200e\u200f]/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[\ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(/(^|\s)(\S)/g,function(a,b,c){return b+c.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";na(c)&&!a.lastIndexOf(" ",0)&&(a=a.substr(1));b.push(c+a)} function gd(a){if(ub){if("relative"==X(a,"position"))return 1;a=X(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return rd(a)}function rd(a){var b=1,c=X(a,"opacity");c&&(b=Number(c));(a=ad(a))&&(b*=rd(a));return b} function sd(a,b,c,d,e){var f;if(3==a.nodeType&&c)qd(a,b,d,e);else if(A(a))if(A(a,"CONTENT")||A(a,"SLOT")){for(f=a;f.parentNode;)f=f.parentNode;f instanceof ShadowRoot?(a=A(a,"CONTENT")?a.getDistributedNodes():a.assignedNodes(),v(a,function(a){sd(a,b,c,d,e)})):md(a,b)}else if(A(a,"SHADOW")){for(f=a;f.parentNode;)f=f.parentNode;if(f instanceof ShadowRoot&&(a=f))for(a=a.olderShadowRoot;a;)v(a.childNodes,function(a){sd(a,b,c,d,e)}),a=a.olderShadowRoot}else md(a,b)} function md(a,b){a.shadowRoot&&v(a.shadowRoot.childNodes,function(a){sd(a,b,!0,null,null)});od(a,b,function(a,b,e,f,g){var c=null;1==a.nodeType?c=a:3==a.nodeType&&(c=a);c&&(c.assignedSlot||c.getDestinationInsertionPoints&&0<c.getDestinationInsertionPoints().length)||sd(a,b,e,f,g)})};var td={A:function(a,b){return!(!a.querySelectorAll||!a.querySelector)&&!/^\d.*/.test(b)},s:function(a,b){var c=Za(b),d=q(a)?c.a.getElementById(a):a;return d?Cb(d,"id")==a&&b!=d&&bb(b,d)?d:za(gb(c,"*"),function(c){return Cb(c,"id")==a&&b!=c&&bb(b,c)}):null},m:function(a,b){if(!a)return[];if(td.A(b,a))try{return b.querySelectorAl