webdriverio-automation
Version:
WebdriverIO-Automation android ios project
113 lines (108 loc) • 60.7 kB
JavaScript
function(){return function(){var h,aa=this;function l(a){return void 0!==a}function n(a){return"string"==typeof a}function ba(a){return"number"==typeof a}function ca(a,b){a=a.split(".");var c=aa;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 da(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 ea(a){var b=da(a);return"array"==b||"object"==b&&"number"==typeof a.length}function fa(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ga(a,b,c){return a.call.apply(a.bind,arguments)}
function ia(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 ja(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ja=ga:ja=ia;return ja.apply(null,arguments)}
function ka(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 la=Date.now||function(){return+new Date};function q(a,b){function c(){}c.prototype=b.prototype;a.V=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.T=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 r=window;var ma;var na=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};
function oa(a,b){var c=0;a=na(String(a)).split(".");b=na(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=pa(0==f[1].length?0:parseInt(f[1],10),0==g[1].length?0:parseInt(g[1],10))||pa(0==f[2].length,0==g[2].length)||pa(f[2],g[2]);f=f[3];g=g[3]}while(!c)}return c}function pa(a,b){return a<b?-1:a>b?1:0}
function qa(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};function ra(a,b){if(n(a))return n(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 u(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function sa(a,b){for(var c=a.length,d=[],e=0,f=n(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var k=f[g];b.call(void 0,k,g,a)&&(d[e++]=k)}return d}
function ta(a,b){for(var c=a.length,d=Array(c),e=n(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function ua(a,b,c){var d=c;u(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function va(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function wa(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0}
function xa(a,b){a:{for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:n(a)?a.charAt(b):a[b]}function ya(a){return Array.prototype.concat.apply([],arguments)}function za(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var Aa={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 Ba="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Ca=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Da=/^#(?:[0-9a-f]{3}){1,2}$/i,Ea=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Fa=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function v(a,b){this.code=a;this.a=w[a]||Ga;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||""}q(v,Error);var Ga="unknown error",w={15:"element not selectable",11:"element not visible"};w[31]=Ga;w[30]=Ga;w[24]="invalid cookie domain";w[29]="invalid element coordinates";w[12]="invalid element state";
w[32]="invalid selector";w[51]="invalid selector";w[52]="invalid selector";w[17]="javascript error";w[405]="unsupported operation";w[34]="move target out of bounds";w[27]="no such alert";w[7]="no such element";w[8]="no such frame";w[23]="no such window";w[28]="script timeout";w[33]="session not created";w[10]="stale element reference";w[21]="timeout";w[25]="unable to set cookie";w[26]="unexpected alert open";w[13]=Ga;w[9]="unknown command";v.prototype.toString=function(){return this.name+": "+this.message};var Ha;a:{var Ia=aa.navigator;if(Ia){var Ja=Ia.userAgent;if(Ja){Ha=Ja;break a}}Ha=""}function x(a){return-1!=Ha.indexOf(a)};function Ka(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function La(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Ma(a,b){return null!==a&&b in a}function Na(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Oa(){return(x("Chrome")||x("CriOS"))&&!x("Edge")};function Pa(){return x("iPhone")&&!x("iPod")&&!x("iPad")};function Ra(a,b){var c=Sa;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var Ta=x("Opera"),y=x("Trident")||x("MSIE"),Ua=x("Edge"),z=x("Gecko")&&!(-1!=Ha.toLowerCase().indexOf("webkit")&&!x("Edge"))&&!(x("Trident")||x("MSIE"))&&!x("Edge"),Va=-1!=Ha.toLowerCase().indexOf("webkit")&&!x("Edge"),Wa=x("Macintosh"),Xa=x("Windows");function Ya(){var a=aa.document;return a?a.documentMode:void 0}var Za;
a:{var $a="",ab=function(){var a=Ha;if(z)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Ua)return/Edge\/([\d\.]+)/.exec(a);if(y)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Va)return/WebKit\/(\S+)/.exec(a);if(Ta)return/(?:Version)[ \/]?(\S+)/.exec(a)}();ab&&($a=ab?ab[1]:"");if(y){var bb=Ya();if(null!=bb&&bb>parseFloat($a)){Za=String(bb);break a}}Za=$a}var Sa={};function cb(a){return Ra(a,function(){return 0<=oa(Za,a)})}function A(a){return Number(db)>=a}var eb;var fb=aa.document;
eb=fb&&y?Ya()||("CSS1Compat"==fb.compatMode?parseInt(Za,10):5):void 0;var db=eb;var gb=x("Firefox"),hb=Pa()||x("iPod"),ib=x("iPad"),jb=x("Android")&&!(Oa()||x("Firefox")||x("Opera")||x("Silk")),kb=Oa(),lb=x("Safari")&&!(Oa()||x("Coast")||x("Opera")||x("Edge")||x("Silk")||x("Android"))&&!(Pa()||x("iPad")||x("iPod"));function mb(a){return(a=a.exec(Ha))?a[1]:""}(function(){if(gb)return mb(/Firefox\/([0-9.]+)/);if(y||Ua||Ta)return Za;if(kb)return Pa()||x("iPad")||x("iPod")?mb(/CriOS\/([0-9.]+)/):mb(/Chrome\/([0-9.]+)/);if(lb&&!(Pa()||x("iPad")||x("iPod")))return mb(/Version\/([0-9.]+)/);if(hb||ib){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(Ha);if(a)return a[1]+"."+a[2]}else if(jb)return(a=mb(/Android\s+([0-9.]+)/))?a:mb(/Version\/([0-9.]+)/);return""})();var nb,ob;function pb(a){return qb?nb(a):y?0<=oa(db,a):cb(a)}var qb=function(){if(!z)return!1;var a=aa.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;nb=function(a){return 0<=c.compare(d,""+a)};ob=function(a){c.compare(e,""+a)};return!0}(),rb=A(9),sb=y&&!A(9),tb=A(10);
jb&&qb&&ob(2.3);jb&&qb&&ob(4);lb&&qb&&ob(6);function ub(a,b){this.x=l(a)?a:0;this.y=l(b)?b:0}h=ub.prototype;h.toString=function(){return"("+this.x+", "+this.y+")"};h.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};h.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};h.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};h.scale=function(a,b){b=ba(b)?b:a;this.x*=a;this.y*=b;return this};function vb(a,b){this.width=a;this.height=b}h=vb.prototype;h.toString=function(){return"("+this.width+" x "+this.height+")"};h.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};h.scale=function(a,b){b=ba(b)?b:a;this.width*=a;this.height*=b;return this};function wb(a){return a.scrollingElement?a.scrollingElement:Va||"CSS1Compat"!=a.compatMode?a.body||a.documentElement:a.documentElement}function xb(a){return a?a.parentWindow||a.defaultView:window}function yb(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function zb(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 Ab(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(y&&!A(9)){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Bb(a,b):!c&&zb(e,b)?-1*Cb(a,b):!d&&zb(f,a)?Cb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=C(a);c=d.createRange();
c.selectNode(a);c.collapse(!0);a=d.createRange();a.selectNode(b);a.collapse(!0);return c.compareBoundaryPoints(aa.Range.START_TO_END,a)}function Cb(a,b){var c=a.parentNode;if(c==b)return-1;for(;b.parentNode!=c;)b=b.parentNode;return Bb(b,a)}function Bb(a,b){for(;b=b.previousSibling;)if(b==a)return-1;return 1}function C(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function Db(a,b,c){a&&!c&&(a=a.parentNode);for(c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}
function Eb(a){this.a=a||aa.document||document}Eb.prototype.getElementsByTagName=function(a,b){return(b||this.a).getElementsByTagName(String(a))};Eb.prototype.contains=zb;function D(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 Gb=y&&!A(9),Hb=y&&!A(8);function Ib(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Jb(a,b){var c=Hb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Ib(b,a,b.nodeName,c)};function Kb(a){this.b=a;this.a=0}function Lb(a){a=a.match(Mb);for(var b=0;b<a.length;b++)Nb.test(a[b])&&a.splice(b,1);return new Kb(a)}var Mb=/\$?(?:(?![0-9-\.])(?:\*|[\w-\.]+):)?(?![0-9-\.])(?:\*|[\w-\.]+)|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|\s+|./g,Nb=/^\s/;function E(a,b){return a.b[a.a+(b||0)]}Kb.prototype.next=function(){return this.b[this.a++]};function Ob(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(Gb&&"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),Gb&&"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 Pb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Hb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Qb(a,b,c,d,e){return(Gb?Rb:Sb).call(null,a,b,n(c)?c:null,n(d)?d:null,e||new G)}
function Rb(a,b,c,d,e){if(a instanceof Tb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;var g=Ub(a);if("*"!=g&&(f=b.getElementsByTagName(g),!f))return e;if(c){var k=[];for(a=0;b=f[a++];)Pb(b,c,d)&&k.push(b);f=k}for(a=0;b=f[a++];)"*"==g&&"!"==b.tagName||H(e,b);return e}Vb(a,b,c,d,e);return e}
function Sb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!y?(b=b.getElementsByName(d),u(b,function(b){a.a(b)&&H(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),u(b,function(b){b.className==d&&a.a(b)&&H(e,b)})):a instanceof I?Vb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),u(b,function(a){Pb(a,c,d)&&H(e,a)}));return e}
function Wb(a,b,c,d,e){var f;if((a instanceof Tb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Ub(a);if("*"!=g&&(f=sa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=sa(f,function(a){return Pb(a,c,d)}));u(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||H(e,a)});return e}return Xb(a,b,c,d,e)}function Xb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Pb(b,c,d)&&a.a(b)&&H(e,b);return e}
function Vb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Pb(b,c,d)&&a.a(b)&&H(e,b),Vb(a,b,c,d,e)}function Ub(a){if(a instanceof I){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function G(){this.b=this.a=null;this.s=0}function Yb(a){this.node=a;this.next=this.a=null}function Zb(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 Ib&&g instanceof Ib&&e.a==g.a?(e=c,c=c.next,b=b.next):0<Ab(c.node,b.node)?(e=b,b=b.next):(e=c,c=c.next);(e.a=d)?d.next=e:a.a=e;d=e;f++}for(e=c||b;e;)e.a=d,d=d.next=e,f++,e=e.next;a.b=d;a.s=f;return a}function $b(a,b){b=new Yb(b);b.next=a.a;a.b?a.a.a=b:a.a=a.b=b;a.a=b;a.s++}
function H(a,b){b=new Yb(b);b.a=a.b;a.a?a.b.next=b:a.a=a.b=b;a.b=b;a.s++}function ac(a){return(a=a.a)?a.node:null}function bc(a){return(a=ac(a))?F(a):""}G.prototype.iterator=function(a){return new cc(this,!!a)};function cc(a,b){this.f=a;this.b=(this.A=b)?a.b:a.a;this.a=null}cc.prototype.next=function(){var a=this.b;if(a){var b=this.a=a;this.b=this.A?a.a:a.next;return b.node}return null};function J(a){this.l=a;this.b=this.j=!1;this.f=null}function K(a){return"\n "+a.toString().split("\n").join("\n ")}function dc(a,b){a.j=b}function ec(a,b){a.b=b}function L(a,b){a=a.a(b);return a instanceof G?+bc(a):+a}function M(a,b){a=a.a(b);return a instanceof G?bc(a):""+a}function fc(a,b){a=a.a(b);return a instanceof G?!!a.s:!!a};function gc(a,b,c){J.call(this,a.l);this.c=a;this.i=b;this.v=c;this.j=b.j||c.j;this.b=b.b||c.b;this.c==hc&&(c.b||c.j||4==c.l||0==c.l||!b.f?b.b||b.j||4==b.l||0==b.l||!c.f||(this.f={name:c.f.name,B:b}):this.f={name:b.f.name,B:c})}q(gc,J);
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=b.iterator();for(d=b.next();d;d=b.next())for(e=c.iterator(),f=e.next();f;f=e.next())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=e.iterator();for(var g=typeof d,k=f.next();k;k=f.next()){switch(g){case "number":k=+F(k);break;case "boolean":k=!!F(k);break;case "string":k=F(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,
d)||e==c&&a(d,k))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.u(this.i,this.v,a)};gc.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+K(this.i);return a+=K(this.v)};function jc(a,b,c,d){this.P=a;this.L=b;this.l=c;this.u=d}jc.prototype.toString=function(){return this.P};var kc={};
function N(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}N("div",6,1,function(a,b,c){return L(a,c)/L(b,c)});N("mod",6,1,function(a,b,c){return L(a,c)%L(b,c)});N("*",6,1,function(a,b,c){return L(a,c)*L(b,c)});N("+",5,1,function(a,b,c){return L(a,c)+L(b,c)});N("-",5,1,function(a,b,c){return L(a,c)-L(b,c)});N("<",4,2,function(a,b,c){return ic(function(a,b){return a<b},a,b,c)});
N(">",4,2,function(a,b,c){return ic(function(a,b){return a>b},a,b,c)});N("<=",4,2,function(a,b,c){return ic(function(a,b){return a<=b},a,b,c)});N(">=",4,2,function(a,b,c){return ic(function(a,b){return a>=b},a,b,c)});var hc=N("=",3,2,function(a,b,c){return ic(function(a,b){return a==b},a,b,c,!0)});N("!=",3,2,function(a,b,c){return ic(function(a,b){return a!=b},a,b,c,!0)});N("and",2,2,function(a,b,c){return fc(a,c)&&fc(b,c)});N("or",1,2,function(a,b,c){return fc(a,c)||fc(b,c)});function lc(a,b){if(b.a.length&&4!=a.l)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");J.call(this,a.l);this.c=a;this.i=b;this.j=a.j;this.b=a.b}q(lc,J);lc.prototype.a=function(a){a=this.c.a(a);return mc(this.i,a)};lc.prototype.toString=function(){var a="Filter:"+K(this.c);return a+=K(this.i)};function nc(a,b){if(b.length<a.K)throw Error("Function "+a.o+" expects at least"+a.K+" arguments, "+b.length+" given");if(null!==a.F&&b.length>a.F)throw Error("Function "+a.o+" expects at most "+a.F+" arguments, "+b.length+" given");a.O&&u(b,function(b,d){if(4!=b.l)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});J.call(this,a.l);this.C=a;this.c=b;dc(this,a.j||va(b,function(a){return a.j}));ec(this,a.N&&!b.length||a.M&&!!b.length||va(b,function(a){return a.b}))}
q(nc,J);nc.prototype.a=function(a){return this.C.u.apply(null,ya(a,this.c))};nc.prototype.toString=function(){var a="Function: "+this.C;if(this.c.length)var b=ua(this.c,function(a,b){return a+K(b)},"Arguments:"),a=a+K(b);return a};function oc(a,b,c,d,e,f,g,k,p){this.o=a;this.l=b;this.j=c;this.N=d;this.M=e;this.u=f;this.K=g;this.F=l(k)?k:g;this.O=!!p}oc.prototype.toString=function(){return this.o};var pc={};
function O(a,b,c,d,e,f,g,k){if(pc.hasOwnProperty(a))throw Error("Function already created: "+a+".");pc[a]=new oc(a,b,c,d,!1,e,f,g,k)}O("boolean",2,!1,!1,function(a,b){return fc(b,a)},1);O("ceiling",1,!1,!1,function(a,b){return Math.ceil(L(b,a))},1);O("concat",3,!1,!1,function(a,b){return ua(za(arguments,1),function(b,d){return b+M(d,a)},"")},2,null);O("contains",2,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);return-1!=b.indexOf(a)},2);O("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0);
O("false",2,!1,!1,function(){return!1},0);O("floor",1,!1,!1,function(a,b){return Math.floor(L(b,a))},1);O("id",4,!1,!1,function(a,b){function c(a){if(Gb){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return xa(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=M(b,a).split(/\s+/);var f=[];u(a,function(a){a=c(a);!a||0<=ra(f,a)||f.push(a)});f.sort(Ab);var g=new G;u(f,function(a){H(g,a)});return g},1);
O("lang",2,!1,!1,function(){return!1},1);O("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);O("local-name",3,!1,!0,function(a,b){return(a=b?ac(b.a(a)):a.a)?a.localName||a.nodeName.toLowerCase():""},0,1,!0);O("name",3,!1,!0,function(a,b){return(a=b?ac(b.a(a)):a.a)?a.nodeName.toLowerCase():""},0,1,!0);O("namespace-uri",3,!0,!1,function(){return""},0,1,!0);
O("normalize-space",3,!1,!0,function(a,b){return(b?M(b,a):F(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);O("not",2,!1,!1,function(a,b){return!fc(b,a)},1);O("number",1,!1,!0,function(a,b){return b?L(b,a):+F(a.a)},0,1);O("position",1,!0,!1,function(a){return a.b},0);O("round",1,!1,!1,function(a,b){return Math.round(L(b,a))},1);O("starts-with",2,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);return!b.lastIndexOf(a,0)},2);O("string",3,!1,!0,function(a,b){return b?M(b,a):F(a.a)},0,1);
O("string-length",1,!1,!0,function(a,b){return(b?M(b,a):F(a.a)).length},0,1);O("substring",3,!1,!1,function(a,b,c,d){c=L(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?L(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=M(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);O("substring-after",3,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
O("substring-before",3,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);O("sum",1,!1,!1,function(a,b){a=b.a(a).iterator();b=0;for(var c=a.next();c;c=a.next())b+=+F(c);return b},1,1,!0);O("translate",3,!1,!1,function(a,b,c,d){b=M(b,a);c=M(c,a);var e=M(d,a);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);O("true",2,!1,!1,function(){return!0},0);function I(a,b){this.i=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}I.prototype.a=function(a){return null===this.b||this.b==a.nodeType};I.prototype.f=function(){return this.i};
I.prototype.toString=function(){var a="Kind Test: "+this.i;null===this.c||(a+=K(this.c));return a};function rc(a){J.call(this,3);this.c=a.substring(1,a.length-1)}q(rc,J);rc.prototype.a=function(){return this.c};rc.prototype.toString=function(){return"Literal: "+this.c};function Tb(a,b){this.o=a.toLowerCase();a="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():a}Tb.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.o&&this.o!=b.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Tb.prototype.f=function(){return this.o};
Tb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function sc(a){J.call(this,1);this.c=a}q(sc,J);sc.prototype.a=function(){return this.c};sc.prototype.toString=function(){return"Number: "+this.c};function tc(a,b){J.call(this,a.l);this.i=a;this.c=b;this.j=a.j;this.b=a.b;1==this.c.length&&(a=this.c[0],a.D||a.c!=uc||(a=a.v,"*"!=a.f()&&(this.f={name:a.f(),B:null})))}q(tc,J);function vc(){J.call(this,4)}q(vc,J);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(){J.call(this,4)}q(wc,J);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.i.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.s;c++){var e=a[c],f=b.iterator(e.c.A);if(e.j||e.c!=yc)if(e.j||e.c!=zc){var g=f.next();for(b=e.a(new Fb(g));g=f.next();)g=e.a(new Fb(g)),b=Zb(b,g)}else g=f.next(),b=e.a(new Fb(g));else{for(g=f.next();(b=f.next())&&(!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:"+K(this.i);if(this.c.length){var b=ua(this.c,function(a,b){return a+K(b)},"Steps:");a+=K(b)}return a};function Ac(a,b){this.a=a;this.A=!!b}
function mc(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=b.iterator(),f=b.s,g,k=0;g=e.next();k++){var p=a.A?f-k:k+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.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!p){p=e;g=p.f;var t=p.a;if(!t)throw Error("Next must be called at least once before remove.");var m=t.a,t=t.next;m?m.next=t:g.a=t;t?t.a=m:g.b=m;g.s--;p.a=null}}return b}
Ac.prototype.toString=function(){return ua(this.a,function(a,b){return a+K(b)},"Predicates:")};function Bc(a,b,c,d){J.call(this,4);this.c=a;this.v=b;this.i=c||new Ac([]);this.D=!!d;b=this.i;b=0<b.a.length?b.a[0].f:null;a.S&&b&&(a=b.name,a=Gb?a.toLowerCase():a,this.f={name:a,B:b.B});a:{a=this.i;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.j||1==c.l||0==c.l){a=!0;break a}a=!1}this.j=a}q(Bc,J);
Bc.prototype.a=function(a){var b=a.a,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.B?M(c.B,a):null,f=1);if(this.D)if(this.j||this.c!=Cc)if(b=(new Bc(Dc,new I("node"))).a(a).iterator(),c=b.next())for(a=this.u(c,d,e,f);c=b.next();)a=Zb(a,this.u(c,d,e,f));else a=new G;else a=Qb(this.v,b,d,e),a=mc(this.i,a,f);else a=this.u(a.a,d,e,f);return a};Bc.prototype.u=function(a,b,c,d){a=this.c.C(this.v,a,b,c);return a=mc(this.i,a,d)};
Bc.prototype.toString=function(){var a="Step:"+K("Operator: "+(this.D?"//":"/"));this.c.o&&(a+=K("Axis: "+this.c));a+=K(this.v);if(this.i.a.length){var b=ua(this.i.a,function(a,b){return a+K(b)},"Predicates:");a+=K(b)}return a};function Ec(a,b,c,d){this.o=a;this.C=b;this.A=c;this.S=d}Ec.prototype.toString=function(){return this.o};var Fc={};function P(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}
P("ancestor",function(a,b){for(var c=new G;b=b.parentNode;)a.a(b)&&$b(c,b);return c},!0);P("ancestor-or-self",function(a,b){var c=new G;do a.a(b)&&$b(c,b);while(b=b.parentNode);return c},!0);
var uc=P("attribute",function(a,b){var c=new G,d=a.f();if("style"==d&&Gb&&b.style)return H(c,new Ib(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof I&&null===a.b||"*"==d)for(d=0;a=e[d];d++)Gb?a.nodeValue&&H(c,Jb(b,a)):H(c,a);else(a=e.getNamedItem(d))&&(Gb?a.nodeValue&&H(c,Jb(b,a)):H(c,a));return c},!1),Cc=P("child",function(a,b,c,d,e){return(Gb?Wb:Xb).call(null,a,b,n(c)?c:null,n(d)?d:null,e||new G)},!1,!0);P("descendant",Qb,!1,!0);
var Dc=P("descendant-or-self",function(a,b,c,d){var e=new G;Pb(b,c,d)&&a.a(b)&&H(e,b);return Qb(a,b,c,d,e)},!1,!0),yc=P("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)Pb(f,c,d)&&a.a(f)&&H(e,f),e=Qb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);P("following-sibling",function(a,b){for(var c=new G;b=b.nextSibling;)a.a(b)&&H(c,b);return c},!1);P("namespace",function(){return new G},!1);
var Gc=P("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=P("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var p=[];for(b=f[g];b=b.previousSibling;)p.unshift(b);for(var t=0,m=p.length;t<m;t++)b=p[t],Pb(b,c,d)&&a.a(b)&&H(e,b),e=Qb(a,b,c,d,e)}return e},!0,!0);
P("preceding-sibling",function(a,b){for(var c=new G;b=b.previousSibling;)a.a(b)&&$b(c,b);return c},!0);var Hc=P("self",function(a,b){var c=new G;a.a(b)&&H(c,b);return c},!1);function Ic(a){J.call(this,1);this.c=a;this.j=a.j;this.b=a.b}q(Ic,J);Ic.prototype.a=function(a){return-L(this.c,a)};Ic.prototype.toString=function(){return"Unary Expression: -"+K(this.c)};function Jc(a){J.call(this,4);this.c=a;dc(this,va(this.c,function(a){return a.j}));ec(this,va(this.c,function(a){return a.b}))}q(Jc,J);Jc.prototype.a=function(a){var b=new G;u(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=Zb(b,c)});return b};Jc.prototype.toString=function(){return ua(this.c,function(a,b){return a+K(b)},"Union Expression:")};function Kc(a,b){this.a=a;this.b=b}function Lc(a){for(var b,c=[];;){R(a,"Missing right hand side of binary expression.");b=Mc(a);var d=a.a.next();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 R(a,b){if(Ob(a.a))throw Error(b);}function Nc(a,b){a=a.a.next();if(a!=b)throw Error("Bad token, expected: "+b+" got: "+a);}
function Oc(a){a=a.a.next();if(")"!=a)throw Error("Bad token: "+a);}function Pc(a){a=a.a.next();if(2>a.length)throw Error("Unclosed literal string");return new rc(a)}
function Qc(a){var b=[];if(xc(E(a.a))){var c=a.a.next();var d=E(a.a);if("/"==c&&(Ob(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new vc;d=new vc;R(a,"Missing next location step.");c=Rc(a,c);b.push(c)}else{a:{c=E(a.a);d=c.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":a.a.next();c=Lc(a);R(a,'unclosed "("');Nc(a,")");break;case '"':case "'":c=Pc(a);break;default:if(isNaN(+c))if(!qc(c)&&/(?![0-9])[\w]/.test(d)&&"("==E(a.a,
1)){c=a.a.next();c=pc[c]||null;a.a.next();for(d=[];")"!=E(a.a);){R(a,"Missing function argument list.");d.push(Lc(a));if(","!=E(a.a))break;a.a.next()}R(a,"Unclosed function argument list.");Oc(a);c=new nc(c,d)}else{c=null;break a}else c=new sc(+a.a.next())}"["==E(a.a)&&(d=new Ac(Sc(a)),c=new lc(c,d))}if(c)if(xc(E(a.a)))d=c;else return c;else c=Rc(a,"/"),d=new wc,b.push(c)}for(;xc(E(a.a));)c=a.a.next(),R(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("."==E(a.a)){var c=new Bc(Hc,new I("node"));a.a.next();return c}if(".."==E(a.a))return c=new Bc(Gc,new I("node")),a.a.next(),c;if("@"==E(a.a)){var d=uc;a.a.next();R(a,"Missing attribute name")}else if("::"==E(a.a,1)){if(!/(?![0-9])[\w]/.test(E(a.a).charAt(0)))throw Error("Bad token: "+a.a.next());var e=a.a.next();d=Fc[e]||null;if(!d)throw Error("No axis with name: "+e);a.a.next();R(a,"Missing node name")}else d=Cc;
e=E(a.a);if(/(?![0-9])[\w\*]/.test(e.charAt(0)))if("("==E(a.a,1)){if(!qc(e))throw Error("Invalid node type: "+e);e=a.a.next();if(!qc(e))throw Error("Invalid type name: "+e);Nc(a,"(");R(a,"Bad nodetype");var f=E(a.a).charAt(0),g=null;if('"'==f||"'"==f)g=Pc(a);R(a,"Bad nodetype");Oc(a);e=new I(e,g)}else if(e=a.a.next(),f=e.indexOf(":"),-1==f)e=new Tb(e);else{var g=e.substring(0,f);if("*"==g)var k="*";else if(k=a.b(g),!k)throw Error("Namespace prefix not declared: "+g);e=e.substr(f+1);e=new Tb(e,k)}else throw Error("Bad token: "+
a.a.next());a=new Ac(Sc(a),d.A);return c||new Bc(d,e,a,"//"==b)}function Sc(a){for(var b=[];"["==E(a.a);){a.a.next();R(a,"Missing predicate expression.");var c=Lc(a);b.push(c);R(a,"Unclosed predicate expression.");Nc(a,"]")}return b}function Mc(a){if("-"==E(a.a))return a.a.next(),new Ic(Mc(a));var b=Qc(a);if("|"!=E(a.a))a=b;else{for(b=[b];"|"==a.a.next();)R(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 ka(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=Lb(a);if(Ob(a))throw Error("Invalid XPath expression.");b?"function"==da(b)||(b=ja(b.lookupNamespaceURI,b)):b=function(){return null};var c=Lc(new Kc(a,b));if(!Ob(a))throw Error("Bad token: "+a.next());this.evaluate=function(a,b){a=c.a(new Fb(a));return new S(a,b)}}
function S(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?bc(a):""+a;break;case 1:this.numberValue=a instanceof G?+bc(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var c=
a.iterator();var d=[];for(var e=c.next();e;e=c.next())d.push(e instanceof Ib?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:a=ac(a);this.singleNodeValue=a instanceof Ib?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]}}S.ANY_TYPE=0;S.NUMBER_TYPE=1;S.STRING_TYPE=2;S.BOOLEAN_TYPE=3;S.UNORDERED_NODE_ITERATOR_TYPE=4;S.ORDERED_NODE_ITERATOR_TYPE=5;S.UNORDERED_NODE_SNAPSHOT_TYPE=6;S.ORDERED_NODE_SNAPSHOT_TYPE=7;S.ANY_UNORDERED_NODE_TYPE=8;S.FIRST_ORDERED_NODE_TYPE=9;function Xc(a){this.lookupNamespaceURI=Tc(a)}
function Yc(a,b){a=a||aa;var c=a.Document&&a.Document.prototype||a.document;if(!c.evaluate||b)a.XPathResult=S,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)}}ca("wgxpath.install",Yc);var T={};T.H=function(){var a={W:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();
T.u=function(a,b,c){var d=C(a);if(!d.documentElement)return null;(y||jb)&&Yc(xb(d));try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):T.H;if(y&&!cb(7))return d.evaluate.call(d,b,a,e,c,null);if(!y||A(9)){for(var f={},g=d.getElementsByTagName("*"),k=0;k<g.length;++k){var p=g[k],t=p.namespaceURI;if(t&&!f[t]){var m=p.lookupPrefix(t);if(!m)var B=t.match(".*/(\\w+)/?$"),m=B?B[1]:"xhtml";f[t]=m}}var Q={},ha;for(ha in f)Q[f[ha]]=ha;e=function(a){return Q[a]||null}}try{return d.evaluate(b,
a,e,c,null)}catch(Qa){if("TypeError"===Qa.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):T.H,d.evaluate(b,a,e,c,null);throw Qa;}}catch(Qa){if(!z||"NS_ERROR_ILLEGAL_VALUE"!=Qa.name)throw new v(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+Qa);}};T.I=function(a,b){if(!a||1!=a.nodeType)throw new v(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};
T.R=function(a,b){var c=function(){var c=T.u(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=C(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||T.I(c,a);return c};
T.U=function(a,b){var c=function(){var c=T.u(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=C(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();u(c,function(b){T.I(b,a)});return c};function Zc(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}h=Zc.prototype;h.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};h.contains=function(a){return this&&a?a instanceof Zc?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1};
h.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};h.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};h.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};
h.scale=function(a,b){b=ba(b)?b:a;this.left*=a;this.right*=a;this.top*=b;this.bottom*=b;return this};function U(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}h=U.prototype;h.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};h.contains=function(a){return a instanceof ub?a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height:this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height};
h.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};h.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};h.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};
h.scale=function(a,b){b=ba(b)?b:a;this.left*=a;this.width*=a;this.top*=b;this.height*=b;return this};function $c(a,b){var c=C(a);return c.defaultView&&c.defaultView.getComputedStyle&&(a=c.defaultView.getComputedStyle(a,null))?a[b]||a.getPropertyValue(b)||"":""}function ad(a){a=a?C(a):document;return!y||A(9)||"CSS1Compat"==(a?new Eb(C(a)):ma||(ma=new Eb)).a.compatMode?a.documentElement:a.body}
function bd(a){var b=a.offsetWidth,c=a.offsetHeight,d=Va&&!b&&!c;if((!l(b)||d)&&a.getBoundingClientRect){a:{try{var e=a.getBoundingClientRect()}catch(f){e={left:0,top:0,right:0,bottom:0};break a}y&&a.ownerDocument.body&&(a=a.ownerDocument,e.left-=a.documentElement.clientLeft+a.body.clientLeft,e.top-=a.documentElement.clientTop+a.body.clientTop)}return new vb(e.right-e.left,e.bottom-e.top)}return new vb(b,c)}var cd={thin:2,medium:4,thick:6};
function dd(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null;if(c in cd)a=cd[c];else if(/^\d+px?$/.test(c))a=parseInt(c,10);else{b=a.style.left;var d=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=c;c=a.style.pixelLeft;a.style.left=b;a.runtimeStyle.left=d;a=+c}return a};var ed="function"===typeof ShadowRoot;function fd(a){var b;if(b=gd(a)&&hd(a))b=!(y||z&&!pb("1.9.2")?0:"none"==V(a,"pointer-events"));return b}var id="BUTTON INPUT OPTGROUP OPTION SELECT TEXTAREA".split(" ");
function hd(a){return va(id,function(b){return D(a,b)})?a.disabled?!1:a.parentNode&&1==a.parentNode.nodeType&&D(a,"OPTGROUP")||D(a,"OPTION")?hd(a.parentNode):!Db(a,function(a){var b=a.parentNode;if(b&&D(b,"FIELDSET")&&b.disabled){if(!D(a,"LEGEND"))return!0;for(;a=l(a.previousElementSibling)?a.previousElementSibling:yb(a.previousSibling);)if(D(a,"LEGEND"))return!0}return!1},!0):!0}function jd(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return D(a)?a:null}
function V(a,b){b=qa(b);if("float"==b||"cssFloat"==b||"styleFloat"==b)b=sb?"styleFloat":"cssFloat";a=$c(a,b)||kd(a,b);if(null===a)a=null;else if(0<=ra(Ba,b)){b:{var c=a.match(Ea);if(c){b=Number(c[1]);var d=Number(c[2]),e=Number(c[3]),c=Number(c[4]);if(0<=b&&255>=b&&0<=d&&255>=d&&0<=e&&255>=e&&0<=c&&1>=c){b=[b,d,e,c];break b}}b=null}if(!b)b:{if(e=a.match(Fa))if(b=Number(e[1]),d=Number(e[2]),e=Number(e[3]),0<=b&&255>=b&&0<=d&&255>=d&&0<=e&&255>=e){b=[b,d,e,1];break b}b=null}if(!b)b:{b=a.toLowerCase();
d=Aa[b.toLowerCase()];if(!d&&(d="#"==b.charAt(0)?b:"#"+b,4==d.length&&(d=d.replace(Ca,"#$1$1$2$2$3$3")),!Da.test(d))){b=null;break b}b=[parseInt(d.substr(1,2),16),parseInt(d.substr(3,2),16),parseInt(d.substr(5,2),16),1]}a=b?"rgba("+b.join(", ")+")":a}return a}function kd(a,b){var c=a.currentStyle||a.style,d=c[b];!l(d)&&"function"==da(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?l(d)?d:null:(a=jd(a))?kd(a,b):null}
function ld(a,b,c){function d(a){var b=md(a);return 0<b.height&&0<b.width?!0:D(a,"PATH")&&(0<b.height||0<b.width)?(a=V(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=V(a,"overflow")&&va(a.childNodes,function(a){return 3==a.nodeType||D(a)&&d(a)})}function e(a){return nd(a)==W&&wa(a.childNodes,function(a){return!D(a)||e(a)||!d(a)})}if(!D(a))throw Error("Argument to isShown must be of type Element");if(D(a,"BODY"))return!0;if(D(a,"OPTION")||D(a,"OPTGROUP"))return a=Db(a,function(a){return D(a,"SELECT")}),
!!a&&ld(a,!0,c);var f=od(a);if(f)return!!f.J&&0<f.rect.width&&0<f.rect.height&&ld(f.J,b,c);if(D(a,"INPUT")&&"hidden"==a.type.toLowerCase()||D(a,"NOSCRIPT"))return!1;f=V(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||pd(a))&&d(a)?!e(a):!1}
function gd(a){function b(a){if(D(a)&&"none"==V(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(ed&&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 ld(a,!0,b)}var W="hidden";
function nd(a,b){function c(a){function b(a){return a==g?!0:!V(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==V(a,"position")?!1:!0}var c=V(a,"position");if("fixed"==c)return t=!0,a==g?null:g;for(a=jd(a);a&&!b(a);)a=jd(a);return a}function d(a){var b=a;if("visible"==p)if(a==g&&k)b=k;else if(a==k)return{x:"visible",y:"visible"};b={x:V(b,"overflow-x"),y:V(b,"overflow-y")};a==g&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function e(a){if(a==g){var b=(new Eb(f)).a;
a=wb(b);b=b.parentWindow||b.defaultView;a=y&&cb("10")&&b.pageYOffset!=a.scrollTop?new ub(a.scrollLeft,a.scrollTop):new ub(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new ub(a.scrollLeft,a.scrollTop);return a}b=qd(a,b);var f=C(a),g=f.documentElement,k=f.body,p=V(g,"overflow"),t;for(a=c(a);a;a=c(a)){var m=d(a);if("visible"!=m.x||"visible"!=m.y){var B=md(a);if(!B.width||!B.height)return W;var Q=b.right<B.left,ha=b.bottom<B.top;if(Q&&"hidden"==m.x||ha&&"hidden"==m.y)return W;if(Q&&
"visible"!=m.x||ha&&"visible"!=m.y){Q=e(a);ha=b.bottom<B.top-Q.y;if(b.right<B.left-Q.x&&"visible"!=m.x||ha&&"visible"!=m.x)return W;b=nd(a);return b==W?W:"scroll"}Q=b.left>=B.left+B.width;B=b.top>=B.top+B.height;if(Q&&"hidden"==m.x||B&&"hidden"==m.y)return W;if(Q&&"visible"!=m.x||B&&"visible"!=m.y){if(t&&(m=e(a),b.left>=g.scrollWidth-m.x||b.right>=g.scrollHeight-m.y))return W;b=nd(a);return b==W?W:"scroll"}}}return"none"}
function md(a){var b=od(a);if(b)return b.rect;if(D(a,"HTML"))return a=C(a),a=(xb(a)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new vb(a.clientWidth,a.clientHeight),new U(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(d){return new U(0,0,0,0)}b=new U(c.left,c.top,c.right-c.left,c.bottom-c.top);y&&a.ownerDocument.body&&(a=C(a),b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b}
function od(a){var b=D(a,"MAP");if(!b&&!D(a,"AREA"))return null;var c=b?a:D(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=T.R('/descendant::*[@usemap = "#'+c.name+'"]',C(c)))&&(e=md(d),b||"default"==a.shape.toLowerCase()||(a=rd(a),b=Math.min(Math.max(a.left,0),e.width),c=Math.min(Math.max(a.top,0),e.height),e=new U(b+e.left,c+e.top,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{J:d,rect:e||new U(0,0,0,0)}}
function rd(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new U(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new U(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new U(b,c,d-b,e-c)}return new U(0,0,0,0)}
function qd(a,b){a=md(a);a=new Zc(a.top,a.left+a.width,a.top+a.height,a.left);b&&(b=b instanceof U?b:new U(b.x,b.y,1,1),a.left=Math.min(Math.max(a.left+b.left,a.left),a.right),a.top=Math.min(Math.max(a.top+b.top,a.top),a.bottom),a.right=Math.min(Math.max(a.left+b.width,a.left),a.right),a.bottom=Math.min(Math.max(a.top+b.height,a.top),a.bottom));return a}
function pd(a){if(sb){if("relative"==V(a,"position"))return 1;a=V(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return sd(a)}function sd(a){var b=1,c=V(a,"opacity");c&&(b=Number(c));(a=jd(a))&&(b*=sd(a));return b};function td(){this.a=r.document.documentElement;this.b=null;a:{var a=C(this.a);try{var b=a&&a.activeElement;break a}catch(c){}b=null}(b=y&&b&&"undefined"===typeof b.nodeType?null:b)&&ud(this,b)}function ud(a,b){a.a=b;D(b,"OPTION")?a.b=Db(b,function(a){return D(a,"SELECT")}):a.b=null}
function vd(a,b,c,d,e,f){var g=MSPointerEvent.MSPOINTER_TYPE_MOUSE;if(!f&&!fd(a.a))return!1;if(e&&wd!=b&&xd!=b)throw new v(12,"Event type does not allow related target: "+b);c={clientX:c.x,clientY:c.y,button:d,altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,relatedTarget:e||null,width:0,height:0,pressure:0,rotation:0,pointerId:1,tiltX:0,tiltY:0,pointerType:g,isPrimary:!0};d=a.b?yd(a,b):a.a;zd[1]&&(d=zd[1]);a=xb(C(a.a));if(a&&b==Ad){var k=a.Element.prototype.msSetPointerCapture;a.Element.prototype.msSetPointerCapture=
function(a){zd[a]=this}}b=d?Bd(d,b,c):!0;k&&(a.Element.prototype.msSetPointerCapture=k);return b}function yd(a,b){if(y)switch(b){case Cd:case wd:return null;case Dd:case Ed:case Fd:return a.b.multiple?a.b:null;default:return a.b}if(Va)switch(b){case Gd:case Hd:return a.b.multiple?a.a:a.b;default:return a.b.multiple?a.a:null}return a.a}Va||qb&&qb&&ob(3.6);var zd={};y&&pb(10);jb&&qb&&ob(4);var Id=y&&r.navigator.msPointerEnabled;function Jd(a,b,c){this.a=a;this.b=b;this.f=c}Jd.prototype.create=function(a){a=C(a);sb&&a.createEventObject?a=a.createEventObject():(a=a.createEvent("HTMLEvents"),a.initEvent(this.a,this.b,this.f));return a};Jd.prototype.toString=function(){return this.a};function X(a,b,c){Jd.call(this,a,b,c)}q(X,Jd);
X.prototype.create=function(a,b){if(!z&&this==Kd)throw new v(9,"Browser does not support a mouse pixel scroll event.");var c=C(a);if(sb){var d=c.createEventObject();d.altKey=b.altKey;d.ctrlKey=b.ctrlKey;d.metaKey=b.metaKey;d.shiftKey=b.shiftKey;d.button=b.but