terminus 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +72 -0
- data/lib/capybara/driver/terminus.rb +14 -4
- data/lib/terminus.rb +2 -1
- data/lib/terminus/browser.rb +30 -7
- data/lib/terminus/client.rb +1 -1
- data/lib/terminus/client/phantomjs.rb +1 -1
- data/lib/terminus/connector.rb +120 -3
- data/lib/terminus/controller.rb +1 -1
- data/lib/terminus/node.rb +17 -3
- data/lib/terminus/proxy.rb +6 -4
- data/lib/terminus/proxy/external.rb +14 -9
- data/lib/terminus/public/compiled/terminus-min.js +3 -3
- data/lib/terminus/public/compiled/terminus.js +62 -17
- data/lib/terminus/public/loader.js +2 -1
- data/lib/terminus/public/terminus.js +62 -17
- data/lib/terminus/views/bootstrap.erb +3 -3
- data/lib/terminus/views/index.erb +1 -1
- metadata +40 -85
- data/README.rdoc +0 -56
- data/lib/terminus/connector/server.rb +0 -142
- data/lib/terminus/connector/socket_handler.rb +0 -72
- data/spec/1.1/reports/android.txt +0 -874
- data/spec/1.1/reports/chrome.txt +0 -880
- data/spec/1.1/reports/firefox.txt +0 -879
- data/spec/1.1/reports/opera.txt +0 -880
- data/spec/1.1/reports/phantomjs.txt +0 -874
- data/spec/1.1/reports/safari.txt +0 -880
- data/spec/1.1/spec_helper.rb +0 -31
- data/spec/1.1/terminus_driver_spec.rb +0 -24
- data/spec/1.1/terminus_session_spec.rb +0 -19
- data/spec/2.0/reports/android.txt +0 -815
- data/spec/2.0/reports/chrome.txt +0 -806
- data/spec/2.0/reports/firefox.txt +0 -812
- data/spec/2.0/reports/opera.txt +0 -806
- data/spec/2.0/reports/phantomjs.txt +0 -803
- data/spec/2.0/reports/safari.txt +0 -806
- data/spec/2.0/spec_helper.rb +0 -21
- data/spec/2.0/terminus_spec.rb +0 -25
@@ -5,9 +5,23 @@ module Terminus
|
|
5
5
|
attr_reader :uri
|
6
6
|
|
7
7
|
def initialize(uri)
|
8
|
+
uri.host.gsub!(LOCALHOST, '127.0.0.1')
|
8
9
|
@uri = uri
|
9
10
|
end
|
10
11
|
|
12
|
+
def call(env)
|
13
|
+
dock_host = env['SERVER_NAME']
|
14
|
+
response = super
|
15
|
+
response[1].delete('transfer-encoding')
|
16
|
+
response[2].extend(Rewrite)
|
17
|
+
response[2].dock_host = dock_host
|
18
|
+
response
|
19
|
+
end
|
20
|
+
|
21
|
+
def host
|
22
|
+
"#{@uri.host}:#{@uri.port}"
|
23
|
+
end
|
24
|
+
|
11
25
|
def rewrite_env(env)
|
12
26
|
env = env.dup
|
13
27
|
env['SERVER_NAME'] = @uri.host
|
@@ -25,15 +39,6 @@ module Terminus
|
|
25
39
|
|
26
40
|
env
|
27
41
|
end
|
28
|
-
|
29
|
-
def call(env)
|
30
|
-
dock_host = env['SERVER_NAME']
|
31
|
-
response = super
|
32
|
-
response[1].delete('transfer-encoding')
|
33
|
-
response[2].extend(Rewrite)
|
34
|
-
response[2].dock_host = dock_host
|
35
|
-
response
|
36
|
-
end
|
37
42
|
end
|
38
43
|
|
39
44
|
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
var Pathology={evaluate:function(t,e,s,n,i){i=i||new Pathology.XPathResult(n);var o=Pathology.XPathParser.parse(t);return o.evaluate(e,e,n,i),i},atomize:function(t,e,s){var n=t.evaluate(e,s);return n&&n.atomize&&(n=n.atomize()),n},array:function(t){if(!t)return[];for(var e=[],s=t.length;s--;)e[s]=t[s];return e},indexOf:function(t,e){if(t.indexOf)return t.indexOf(e);for(var s=0,n=t.length;n>s;s++)if(t[s]===e)return s;return-1}};"undefined"==typeof XPathResult&&(XPathResult={ANY_TYPE:0,NUMBER_TYPE:1,STRING_TYPE:2,BOOLEAN_TYPE:3,UNORDERED_NODE_ITERATOR_TYPE:4,ORDERED_NODE_ITERATOR_TYPE:5,UNORDERED_NODE_SNAPSHOT_TYPE:6,ORDERED_NODE_SNAPSHOT_TYPE:7,ANY_UNORDERED_NODE_TYPE:8,FIRST_ORDERED_NODE_TYPE:9}),document.evaluate===void 0&&(document.evaluate=function(){return Pathology.evaluate.apply(Pathology,arguments)}),Pathology.XPathResult=function(t){this._type=t,this._nodes=[],this._index=0},Pathology.XPathResult.prototype.push=function(t){(0===this._type||t.nodeType===this._type)&&(Pathology.indexOf(this._nodes,t)>=0||this._nodes.push(t))},Pathology.XPathResult.prototype.iterateNext=function(){var t=this._nodes[this._index];return t?(this._index+=1,t):null},Pathology.XPathResult.prototype.atomize=function(){if(0===this._nodes.length)return null;if(1===this._nodes.length){var t=this._nodes[0];return void 0===t.nodeValue||null===t.nodeValue?t:t.nodeValue}for(var e=[],s=0,n=this._nodes.length;n>s;s++)e.push(this._nodes[s].nodeValue);return e},Pathology.XPathResult.prototype.makeString=function(){var t=this._nodes[0];if(!t)return"";switch(t.nodeType){case XPathResult.STRING_TYPE:return this.atomize();case XPathResult.BOOLEAN_TYPE:for(var e=[],s=0,n=this._nodes.length;n>s;s++)e.push(this._nodes[s].nodeValue);return e.join("");default:var i=document.evaluate("//text()",t,null,XPathResult.ANY_TYPE,null);return i.makeString()}},function(){var t=function(t,e){if(!t||!e)return t;for(var s in e)t[s]!==e[s]&&(t[s]=e[s]);return t},e=function(t,e){for(var s,n=e.split(".");s=n.shift();)if(t=t[s],void 0===t)throw Error("Cannot find object named "+e);return t},s=function(t){for(var e=t.input.split(/\n/g),s=0,n=0;t.offset+1>n;)n+=e[s].length+1,s+=1;var i="Line "+s+": expected "+t.expected+"\n",o=e[s-1];for(i+=o+"\n",n-=o.length+1;t.offset>n;)i+=" ",n+=1;return i+"^"},n={__consume__union_expression:function(){var s=null,n=this._offset;this._nodeCache.union_expression=this._nodeCache.union_expression||{};var i=this._nodeCache.union_expression[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null;if(l=this.__consume__location_path()){r.push(l),u+=l.textValue,f.head=l;for(var h=null,a=0,c=this._offset,_=[],p="",d=!0;d;){var y=this._offset,g=[],m={},v="",k=null;if(k=this.__consume__space()){g.push(k),v+=k.textValue,m.space=k;var b=null,x=null;if(x=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"|"===x){var w=this.constructor.SyntaxNode,S=null;b=new w("|",this._offset,[]),"object"==typeof S&&t(b,S),this._offset+=1}else{b=null;var N=null;N=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"|"'})}if(b){g.push(b),v+=b.textValue;var C=null;if(C=this.__consume__space()){g.push(C),v+=C.textValue,m.space=C;var E=null;E=this.__consume__location_path(),E?(g.push(E),v+=E.textValue,m.location_path=E):(g=null,this._offset=y)}else g=null,this._offset=y}else g=null,this._offset=y}else g=null,this._offset=y;if(g){this._offset=y;var P=this.constructor.SyntaxNode,T=null;d=new P(v,this._offset,g,m),"object"==typeof T&&t(d,T),this._offset+=v.length}else d=null;d&&(_.push(d),p+=d.textValue,a-=1)}if(0>=a){this._offset=c;var V=this.constructor.SyntaxNode,j=null;h=new V(p,this._offset,_),"object"==typeof j&&t(h,j),this._offset+=p.length}else h=null;h?(r.push(h),u+=h.textValue,f.rest=h):(r=null,this._offset=o)}else r=null,this._offset=o;if(r){this._offset=o;var X=this.constructor.SyntaxNode,R=e(this.constructor,"Union");s=new X(u,this._offset,r,f),"object"==typeof R&&t(s,R),this._offset+=u.length}else s=null;return this._nodeCache.union_expression[n]=s},__consume__location_path:function(){var s=null,n=this._offset;this._nodeCache.location_path=this._nodeCache.location_path||{};var i=this._nodeCache.location_path[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null;if(l=this.__consume__location_step()){r.push(l),u+=l.textValue,f.head=l;for(var h=null,a=0,c=this._offset,_=[],p="",d=!0;d;)d=this.__consume__location_step(),d&&(_.push(d),p+=d.textValue,a-=1);if(0>=a){this._offset=c;var y=this.constructor.SyntaxNode,g=null;h=new y(p,this._offset,_),"object"==typeof g&&t(h,g),this._offset+=p.length}else h=null;h?(r.push(h),u+=h.textValue,f.rest=h):(r=null,this._offset=o)}else r=null,this._offset=o;if(r){this._offset=o;var m=this.constructor.SyntaxNode,v=e(this.constructor,"LocationPath");s=new m(u,this._offset,r,f),"object"==typeof v&&t(s,v),this._offset+=u.length}else s=null;return this._nodeCache.location_path[n]=s},__consume__location_step:function(){var s=null,n=this._offset;this._nodeCache.location_step=this._nodeCache.location_step||{};var i=this._nodeCache.location_step[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null,h=this._offset,a=null;if(a=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"/"===a){var c=this.constructor.SyntaxNode,_=null;l=new c("/",this._offset,[]),"object"==typeof _&&t(l,_),this._offset+=1}else{l=null;var p=null;p=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"/"'})}if(l);else{this._offset=h;var d=this.constructor.SyntaxNode,y=null;l=new d("",this._offset,[]),"object"==typeof y&&t(l,y),this._offset+=0}if(l){r.push(l),u+=l.textValue;var g=null,m=this._offset,v=this._offset,k=[],b={},x="",w=null;if(w=this.__consume__axis()){k.push(w),x+=w.textValue,b.axis=w;var S=null,N=this._offset;if(S=this.__consume__node_test());else{this._offset=N;var C=this.constructor.SyntaxNode,E=null;S=new C("",this._offset,[]),"object"==typeof E&&t(S,E),this._offset+=0}S?(k.push(S),x+=S.textValue,b.test=S):(k=null,this._offset=v)}else k=null,this._offset=v;if(k){this._offset=v;var P=this.constructor.SyntaxNode,T=null;g=new P(x,this._offset,k,b),"object"==typeof T&&t(g,T),this._offset+=x.length}else g=null;if(g);else{this._offset=m;var V=this._offset,j=[],X={},R="",A=null,Y=this._offset;if(A=this.__consume__axis());else{this._offset=Y;var O=this.constructor.SyntaxNode,I=null;A=new O("",this._offset,[]),"object"==typeof I&&t(A,I),this._offset+=0}if(A){j.push(A),R+=A.textValue,X.axis=A;var D=null;D=this.__consume__node_test(),D?(j.push(D),R+=D.textValue,X.test=D):(j=null,this._offset=V)}else j=null,this._offset=V;if(j){this._offset=V;var L=this.constructor.SyntaxNode,z=null;g=new L(R,this._offset,j,X),"object"==typeof z&&t(g,z),this._offset+=R.length}else g=null;g||(this._offset=m)}if(g){r.push(g),u+=g.textValue,f.selector=g;for(var W=null,F=0,H=this._offset,M=[],K="",U=!0;U;)U=this.__consume__node_predicate(),U&&(M.push(U),K+=U.textValue,F-=1);if(0>=F){this._offset=H;var B=this.constructor.SyntaxNode,q=null;W=new B(K,this._offset,M),"object"==typeof q&&t(W,q),this._offset+=K.length}else W=null;W?(r.push(W),u+=W.textValue,f.predicates=W):(r=null,this._offset=o)}else r=null,this._offset=o}else r=null,this._offset=o;if(r){this._offset=o;var Q=this.constructor.SyntaxNode,G=e(this.constructor,"LocationStep");s=new Q(u,this._offset,r,f),"object"==typeof G&&t(s,G),this._offset+=u.length}else s=null;return this._nodeCache.location_step[n]=s},__consume__axis:function(){var e=null,s=this._offset;this._nodeCache.axis=this._nodeCache.axis||{};var n=this._nodeCache.axis[s];if(n)return this._offset+=n.textValue.length,n;for(var i=this._offset,o=this._offset,r=[],f={},u="",l=null,h=1,a=this._offset,c=[],_="",p=!0;p;){var d=null;if(d=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,d&&/^[a-z\-]/.test(d)){var y=this.constructor.SyntaxNode,g=null;p=new y(d,this._offset,[]),"object"==typeof g&&t(p,g),this._offset+=1}else{p=null;var m=null;m=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[a-z\\-]"})}p&&(c.push(p),_+=p.textValue,h-=1)}if(0>=h){this._offset=a;var v=this.constructor.SyntaxNode,k=null;l=new v(_,this._offset,c),"object"==typeof k&&t(l,k),this._offset+=_.length}else l=null;if(l){r.push(l),u+=l.textValue,f.axis_name=l;var b=null,x=null;if(x=this._input.length>this._offset?this._input.substring(this._offset,this._offset+2):null,"::"===x){var w=this.constructor.SyntaxNode,S=null;b=new w("::",this._offset,[]),"object"==typeof S&&t(b,S),this._offset+=2}else{b=null;var N=null;N=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"::"'})}b?(r.push(b),u+=b.textValue):(r=null,this._offset=o)}else r=null,this._offset=o;if(r){this._offset=o;var C=this.constructor.SyntaxNode,E=null;e=new C(u,this._offset,r,f),"object"==typeof E&&t(e,E),this._offset+=u.length}else e=null;return e||(this._offset=i,e=this.__consume__axis_shorthand(),e||(this._offset=i)),this._nodeCache.axis[s]=e},__consume__axis_shorthand:function(){var e=null,s=this._offset;this._nodeCache.axis_shorthand=this._nodeCache.axis_shorthand||{};var n=this._nodeCache.axis_shorthand[s];if(n)return this._offset+=n.textValue.length,n;var i=this._offset,o=null;if(o=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"@"===o){var r=this.constructor.SyntaxNode,f=null;e=new r("@",this._offset,[]),"object"==typeof f&&t(e,f),this._offset+=1}else{e=null;var u=null;u=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"@"'})}if(e);else{this._offset=i;var l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+2):null,".."===l){var h=this.constructor.SyntaxNode,a=null;e=new h("..",this._offset,[]),"object"==typeof a&&t(e,a),this._offset+=2}else{e=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'".."'})}if(e);else{this._offset=i;var _=null;if(_=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"."===_){var p=this.constructor.SyntaxNode,d=null;e=new p(".",this._offset,[]),"object"==typeof d&&t(e,d),this._offset+=1}else{e=null;var y=null;y=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"."'})}if(e);else{this._offset=i;var g=null;if(g=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"/"===g){var m=this.constructor.SyntaxNode,v=null;e=new m("/",this._offset,[]),"object"==typeof v&&t(e,v),this._offset+=1}else{e=null;var k=null;k=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"/"'})}e||(this._offset=i)}}}return this._nodeCache.axis_shorthand[s]=e},__consume__node_test:function(){var s=null,n=this._offset;this._nodeCache.node_test=this._nodeCache.node_test||{};var i=this._nodeCache.node_test[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null,h=this._offset;if(l=this.__consume__node_condition());else if(this._offset=h,l=this.__consume__node_name());else{this._offset=h;var a=null;if(a=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"*"===a){var c=this.constructor.SyntaxNode,_=null;l=new c("*",this._offset,[]),"object"==typeof _&&t(l,_),this._offset+=1}else{l=null;var p=null;p=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"*"'})}l||(this._offset=h)}if(l){r.push(l),u+=l.textValue;var d=null,y=this._offset;if(d=this.__consume__subscript());else{this._offset=y;var g=this.constructor.SyntaxNode,m=null;d=new g("",this._offset,[]),"object"==typeof m&&t(d,m),this._offset+=0}d?(r.push(d),u+=d.textValue,f.subscript=d):(r=null,this._offset=o)}else r=null,this._offset=o;if(r){this._offset=o;var v=this.constructor.SyntaxNode,k=e(this.constructor,"NodeTest");s=new v(u,this._offset,r,f),"object"==typeof k&&t(s,k),this._offset+=u.length}else s=null;return this._nodeCache.node_test[n]=s},__consume__node_condition:function(){var e=null,s=this._offset;this._nodeCache.node_condition=this._nodeCache.node_condition||{};var n=this._nodeCache.node_condition[s];if(n)return this._offset+=n.textValue.length,n;for(var i=this._offset,o=[],r={},f="",u=null,l=1,h=this._offset,a=[],c="",_=!0;_;){var p=null;if(p=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,p&&/^[a-z\-]/.test(p)){var d=this.constructor.SyntaxNode,y=null;_=new d(p,this._offset,[]),"object"==typeof y&&t(_,y),this._offset+=1}else{_=null;var g=null;g=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[a-z\\-]"})}_&&(a.push(_),c+=_.textValue,l-=1)}if(0>=l){this._offset=h;var m=this.constructor.SyntaxNode,v=null;u=new m(c,this._offset,a),"object"==typeof v&&t(u,v),this._offset+=c.length}else u=null;if(u){o.push(u),f+=u.textValue,r.condition_name=u;var k=null,b=null;if(b=this._input.length>this._offset?this._input.substring(this._offset,this._offset+2):null,"()"===b){var x=this.constructor.SyntaxNode,w=null;k=new x("()",this._offset,[]),"object"==typeof w&&t(k,w),this._offset+=2}else{k=null;var S=null;S=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"()"'})}k?(o.push(k),f+=k.textValue):(o=null,this._offset=i)}else o=null,this._offset=i;if(o){this._offset=i;var N=this.constructor.SyntaxNode,C=null;e=new N(f,this._offset,o,r),"object"==typeof C&&t(e,C),this._offset+=f.length}else e=null;return this._nodeCache.node_condition[s]=e},__consume__node_name:function(){var e=null,s=this._offset;this._nodeCache.node_name=this._nodeCache.node_name||{};var n=this._nodeCache.node_name[s];if(n)return this._offset+=n.textValue.length,n;for(var i=1,o=this._offset,r=[],f="",u=!0;u;){var l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,l&&/^[A-Za-z0-9\-]/.test(l)){var h=this.constructor.SyntaxNode,a=null;u=new h(l,this._offset,[]),"object"==typeof a&&t(u,a),this._offset+=1}else{u=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[A-Za-z0-9\\-]"})}u&&(r.push(u),f+=u.textValue,i-=1)}if(0>=i){this._offset=o;var _=this.constructor.SyntaxNode,p=null;e=new _(f,this._offset,r),"object"==typeof p&&t(e,p),this._offset+=f.length}else e=null;return this._nodeCache.node_name[s]=e},__consume__subscript:function(){var e=null,s=this._offset;this._nodeCache.subscript=this._nodeCache.subscript||{};var n=this._nodeCache.subscript[s];if(n)return this._offset+=n.textValue.length,n;var i=this._offset,o=[],r={},f="",u=null,l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"["===l){var h=this.constructor.SyntaxNode,a=null;u=new h("[",this._offset,[]),"object"==typeof a&&t(u,a),this._offset+=1}else{u=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"["'})}if(u){o.push(u),f+=u.textValue;var _=null;if(_=this.__consume__space()){o.push(_),f+=_.textValue,r.space=_;var p=null;if(p=this.__consume__integer()){o.push(p),f+=p.textValue,r.integer=p;var d=null;if(d=this.__consume__space()){o.push(d),f+=d.textValue,r.space=d;var y=null,g=null;if(g=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"]"===g){var m=this.constructor.SyntaxNode,v=null;y=new m("]",this._offset,[]),"object"==typeof v&&t(y,v),this._offset+=1}else{y=null;var k=null;k=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"]"'})}y?(o.push(y),f+=y.textValue):(o=null,this._offset=i)}else o=null,this._offset=i}else o=null,this._offset=i}else o=null,this._offset=i}else o=null,this._offset=i;if(o){this._offset=i;var b=this.constructor.SyntaxNode,x=null;e=new b(f,this._offset,o,r),"object"==typeof x&&t(e,x),this._offset+=f.length}else e=null;return this._nodeCache.subscript[s]=e},__consume__node_predicate:function(){var e=null,s=this._offset;this._nodeCache.node_predicate=this._nodeCache.node_predicate||{};var n=this._nodeCache.node_predicate[s];if(n)return this._offset+=n.textValue.length,n;var i=this._offset,o=[],r={},f="",u=null,l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"["===l){var h=this.constructor.SyntaxNode,a=null;u=new h("[",this._offset,[]),"object"==typeof a&&t(u,a),this._offset+=1}else{u=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"["'})}if(u){o.push(u),f+=u.textValue;var _=null;if(_=this.__consume__expression()){o.push(_),f+=_.textValue,r.expression=_;var p=null,d=null;if(d=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"]"===d){var y=this.constructor.SyntaxNode,g=null;p=new y("]",this._offset,[]),"object"==typeof g&&t(p,g),this._offset+=1}else{p=null;var m=null;m=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"]"'})}if(p){o.push(p),f+=p.textValue;var v=null,k=this._offset;if(v=this.__consume__subscript());else{this._offset=k;var b=this.constructor.SyntaxNode,x=null;v=new b("",this._offset,[]),"object"==typeof x&&t(v,x),this._offset+=0}v?(o.push(v),f+=v.textValue,r.subscript=v):(o=null,this._offset=i)}else o=null,this._offset=i}else o=null,this._offset=i}else o=null,this._offset=i;if(o){this._offset=i;var w=this.constructor.SyntaxNode,S=null;e=new w(f,this._offset,o,r),"object"==typeof S&&t(e,S),this._offset+=f.length}else e=null;return this._nodeCache.node_predicate[s]=e},__consume__expression:function(){var t=null,e=this._offset;this._nodeCache.expression=this._nodeCache.expression||{};var s=this._nodeCache.expression[e];if(s)return this._offset+=s.textValue.length,s;var n=this._offset;return t=this.__consume__or_expression(),t||(this._offset=n,t=this.__consume__and_expression(),t||(this._offset=n,t=this.__consume__comparison(),t||(this._offset=n,t=this.__consume__atom(),t||(this._offset=n)))),this._nodeCache.expression[e]=t},__consume__or_expression:function(){var s=null,n=this._offset;this._nodeCache.or_expression=this._nodeCache.or_expression||{};var i=this._nodeCache.or_expression[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=this._offset,f=[],u={},l="",h=null;if(h=this.__consume__and_expression()){f.push(h),l+=h.textValue,u.left=h;var a=null,c=null;if(c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+2):null,"or"===c){var _=this.constructor.SyntaxNode,p=null;a=new _("or",this._offset,[]),"object"==typeof p&&t(a,p),this._offset+=2}else{a=null;var d=null;d=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"or"'})}if(a){f.push(a),l+=a.textValue;var y=null;y=this.__consume__or_expression(),y?(f.push(y),l+=y.textValue,u.right=y):(f=null,this._offset=r)}else f=null,this._offset=r}else f=null,this._offset=r;if(f){this._offset=r;var g=this.constructor.SyntaxNode,m=e(this.constructor,"Or");s=new g(l,this._offset,f,u),"object"==typeof m&&t(s,m),this._offset+=l.length}else s=null;return s||(this._offset=o,s=this.__consume__and_expression(),s||(this._offset=o)),this._nodeCache.or_expression[n]=s},__consume__and_expression:function(){var s=null,n=this._offset;this._nodeCache.and_expression=this._nodeCache.and_expression||{};var i=this._nodeCache.and_expression[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=this._offset,f=[],u={},l="",h=null;if(h=this.__consume__comparison()){f.push(h),l+=h.textValue,u.left=h;var a=null,c=null;if(c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+3):null,"and"===c){var _=this.constructor.SyntaxNode,p=null;a=new _("and",this._offset,[]),"object"==typeof p&&t(a,p),this._offset+=3}else{a=null;var d=null;d=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"and"'})}if(a){f.push(a),l+=a.textValue;var y=null;y=this.__consume__and_expression(),y?(f.push(y),l+=y.textValue,u.right=y):(f=null,this._offset=r)}else f=null,this._offset=r}else f=null,this._offset=r;if(f){this._offset=r;var g=this.constructor.SyntaxNode,m=e(this.constructor,"And");s=new g(l,this._offset,f,u),"object"==typeof m&&t(s,m),this._offset+=l.length}else s=null;return s||(this._offset=o,s=this.__consume__comparison(),s||(this._offset=o)),this._nodeCache.and_expression[n]=s},__consume__comparison:function(){var s=null,n=this._offset;this._nodeCache.comparison=this._nodeCache.comparison||{};var i=this._nodeCache.comparison[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=this._offset,f=[],u={},l="",h=null;if(h=this.__consume__atom()){f.push(h),l+=h.textValue,u.left=h;var a=null;if(a=this.__consume__comparator()){f.push(a),l+=a.textValue,u.comparator=a;var c=null;c=this.__consume__comparison(),c?(f.push(c),l+=c.textValue,u.right=c):(f=null,this._offset=r)}else f=null,this._offset=r}else f=null,this._offset=r;if(f){this._offset=r;var _=this.constructor.SyntaxNode,p=e(this.constructor,"Comparison");s=new _(l,this._offset,f,u),"object"==typeof p&&t(s,p),this._offset+=l.length}else s=null;return s||(this._offset=o,s=this.__consume__atom(),s||(this._offset=o)),this._nodeCache.comparison[n]=s},__consume__comparator:function(){var e=null,s=this._offset;this._nodeCache.comparator=this._nodeCache.comparator||{};var n=this._nodeCache.comparator[s];if(n)return this._offset+=n.textValue.length,n;var i=this._offset,o=null;if(o=this._input.length>this._offset?this._input.substring(this._offset,this._offset+2):null,"!="===o){var r=this.constructor.SyntaxNode,f=null;e=new r("!=",this._offset,[]),"object"==typeof f&&t(e,f),this._offset+=2}else{e=null;var u=null;u=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"!="'})}if(e);else{this._offset=i;var l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"="===l){var h=this.constructor.SyntaxNode,a=null;e=new h("=",this._offset,[]),"object"==typeof a&&t(e,a),this._offset+=1}else{e=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"="'})}e||(this._offset=i)}return this._nodeCache.comparator[s]=e},__consume__atom:function(){var s=null,n=this._offset;this._nodeCache.atom=this._nodeCache.atom||{};var i=this._nodeCache.atom[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null;if(l=this.__consume__space()){r.push(l),u+=l.textValue,f.space=l;var h=null,a=this._offset,c=this._offset,_=[],p={},d="",y=null,g=null;if(g=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"("===g){var m=this.constructor.SyntaxNode,v=null;y=new m("(",this._offset,[]),"object"==typeof v&&t(y,v),this._offset+=1}else{y=null;var k=null;k=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"("'})}if(y){_.push(y),d+=y.textValue;var b=null;if(b=this.__consume__expression()){_.push(b),d+=b.textValue,p.in_parens=b;var x=null,w=null;if(w=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,")"===w){var S=this.constructor.SyntaxNode,N=null;x=new S(")",this._offset,[]),"object"==typeof N&&t(x,N),this._offset+=1}else{x=null;var C=null;C=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'")"'})}x?(_.push(x),d+=x.textValue):(_=null,this._offset=c)}else _=null,this._offset=c}else _=null,this._offset=c;if(_){this._offset=c;var E=this.constructor.SyntaxNode,P=null;h=new E(d,this._offset,_,p),"object"==typeof P&&t(h,P),this._offset+=d.length}else h=null;if(h||(this._offset=a,h=this.__consume__value(),h||(this._offset=a)),h){r.push(h),u+=h.textValue,f.expression=h;var T=null;T=this.__consume__space(),T?(r.push(T),u+=T.textValue,f.space=T):(r=null,this._offset=o)}else r=null,this._offset=o}else r=null,this._offset=o;if(r){this._offset=o;var V=this.constructor.SyntaxNode,j=e(this.constructor,"Atom");s=new V(u,this._offset,r,f),"object"==typeof j&&t(s,j),this._offset+=u.length}else s=null;return this._nodeCache.atom[n]=s},__consume__value:function(){var t=null,e=this._offset;this._nodeCache.value=this._nodeCache.value||{};var s=this._nodeCache.value[e];if(s)return this._offset+=s.textValue.length,s;var n=this._offset;return t=this.__consume__function_call(),t||(this._offset=n,t=this.__consume__string(),t||(this._offset=n,t=this.__consume__union_expression(),t||(this._offset=n))),this._nodeCache.value[e]=t},__consume__function_call:function(){var s=null,n=this._offset;this._nodeCache.function_call=this._nodeCache.function_call||{};var i=this._nodeCache.function_call[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null;if(l=this.__consume__function_name()){r.push(l),u+=l.textValue,f.function_name=l;var h=null,a=null;if(a=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"("===a){var c=this.constructor.SyntaxNode,_=null;h=new c("(",this._offset,[]),"object"==typeof _&&t(h,_),this._offset+=1}else{h=null;var p=null;p=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"("'})}if(h){r.push(h),u+=h.textValue;var d=null;if(d=this.__consume__function_args()){r.push(d),u+=d.textValue,f.function_args=d;var y=null,g=null;if(g=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,")"===g){var m=this.constructor.SyntaxNode,v=null;y=new m(")",this._offset,[]),"object"==typeof v&&t(y,v),this._offset+=1}else{y=null;var k=null;k=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'")"'})}y?(r.push(y),u+=y.textValue):(r=null,this._offset=o)}else r=null,this._offset=o}else r=null,this._offset=o}else r=null,this._offset=o;if(r){this._offset=o;var b=this.constructor.SyntaxNode,x=e(this.constructor,"FunctionCall");s=new b(u,this._offset,r,f),"object"==typeof x&&t(s,x),this._offset+=u.length}else s=null;return this._nodeCache.function_call[n]=s},__consume__function_name:function(){var e=null,s=this._offset;this._nodeCache.function_name=this._nodeCache.function_name||{};var n=this._nodeCache.function_name[s];if(n)return this._offset+=n.textValue.length,n;for(var i=1,o=this._offset,r=[],f="",u=!0;u;){var l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,l&&/^[a-z\-]/.test(l)){var h=this.constructor.SyntaxNode,a=null;u=new h(l,this._offset,[]),"object"==typeof a&&t(u,a),this._offset+=1}else{u=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[a-z\\-]"})}u&&(r.push(u),f+=u.textValue,i-=1)}if(0>=i){this._offset=o;var _=this.constructor.SyntaxNode,p=null;e=new _(f,this._offset,r),"object"==typeof p&&t(e,p),this._offset+=f.length}else e=null;return this._nodeCache.function_name[s]=e},__consume__function_args:function(){var e=null,s=this._offset;this._nodeCache.function_args=this._nodeCache.function_args||{};var n=this._nodeCache.function_args[s];if(n)return this._offset+=n.textValue.length,n;var i=this._offset,o=this._offset,r=[],f={},u="",l=null;if(l=this.__consume__expression()){r.push(l),u+=l.textValue,f.first=l;for(var h=null,a=0,c=this._offset,_=[],p="",d=!0;d;){var y=this._offset,g=[],m={},v="",k=null,b=null;if(b=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,","===b){var x=this.constructor.SyntaxNode,w=null;k=new x(",",this._offset,[]),"object"==typeof w&&t(k,w),this._offset+=1}else{k=null;var S=null;S=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'","'})}if(k){g.push(k),v+=k.textValue;var N=null;N=this.__consume__expression(),N?(g.push(N),v+=N.textValue,m.expression=N):(g=null,this._offset=y)}else g=null,this._offset=y;if(g){this._offset=y;var C=this.constructor.SyntaxNode,E=null;d=new C(v,this._offset,g,m),"object"==typeof E&&t(d,E),this._offset+=v.length}else d=null;d&&(_.push(d),p+=d.textValue,a-=1)}if(0>=a){this._offset=c;var P=this.constructor.SyntaxNode,T=null;h=new P(p,this._offset,_),"object"==typeof T&&t(h,T),this._offset+=p.length}else h=null;h?(r.push(h),u+=h.textValue,f.rest=h):(r=null,this._offset=o)}else r=null,this._offset=o;if(r){this._offset=o;var V=this.constructor.SyntaxNode,j=null;
|
2
|
-
e=new V(u,this._offset,r,f),"object"==typeof j&&t(e,j),this._offset+=u.length}else e=null;if(e);else{this._offset=i;var X=this.constructor.SyntaxNode,R=null;e=new X("",this._offset,[]),"object"==typeof R&&t(e,R),this._offset+=0}return this._nodeCache.function_args[s]=e},__consume__integer:function(){var s=null,n=this._offset;this._nodeCache.integer=this._nodeCache.integer||{};var i=this._nodeCache.integer[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null,h=null;if(h=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,h&&/^[1-9]/.test(h)){var a=this.constructor.SyntaxNode,c=null;l=new a(h,this._offset,[]),"object"==typeof c&&t(l,c),this._offset+=1}else{l=null;var _=null;_=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[1-9]"})}if(l){r.push(l),u+=l.textValue;for(var p=null,d=0,y=this._offset,g=[],m="",v=!0;v;){var k=null;if(k=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,k&&/^[0-9]/.test(k)){var b=this.constructor.SyntaxNode,x=null;v=new b(k,this._offset,[]),"object"==typeof x&&t(v,x),this._offset+=1}else{v=null;var w=null;w=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[0-9]"})}v&&(g.push(v),m+=v.textValue,d-=1)}if(0>=d){this._offset=y;var S=this.constructor.SyntaxNode,N=null;p=new S(m,this._offset,g),"object"==typeof N&&t(p,N),this._offset+=m.length}else p=null;p?(r.push(p),u+=p.textValue):(r=null,this._offset=o)}else r=null,this._offset=o;if(r){this._offset=o;var C=this.constructor.SyntaxNode,E=e(this.constructor,"Integer");s=new C(u,this._offset,r,f),"object"==typeof E&&t(s,E),this._offset+=u.length}else s=null;return this._nodeCache.integer[n]=s},__consume__string:function(){var s=null,n=this._offset;this._nodeCache.string=this._nodeCache.string||{};var i=this._nodeCache.string[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=this._offset,f=[],u={},l="",h=null,a=null;if(a=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"'"===a){var c=this.constructor.SyntaxNode,_=null;h=new c("'",this._offset,[]),"object"==typeof _&&t(h,_),this._offset+=1}else{h=null;var p=null;p=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"\'"'})}if(h){f.push(h),l+=h.textValue;for(var d=null,y=0,g=this._offset,m=[],v="",k=!0;k;){var b=this._offset,x=this._offset,w=[],S={},N="",C=null,E=null;if(E=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"\\"===E){var P=this.constructor.SyntaxNode,T=null;C=new P("\\",this._offset,[]),"object"==typeof T&&t(C,T),this._offset+=1}else{C=null;var V=null;V=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"\\\\"'})}if(C){w.push(C),N+=C.textValue;var j=null,X=null;X=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null;var R=X;if(null===R){j=null;var A=null;A=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"<any char>"})}else{var Y=this.constructor.SyntaxNode,O=null;j=new Y(R,this._offset,[]),"object"==typeof O&&t(j,O),this._offset+=1}j?(w.push(j),N+=j.textValue):(w=null,this._offset=x)}else w=null,this._offset=x;if(w){this._offset=x;var I=this.constructor.SyntaxNode,D=null;k=new I(N,this._offset,w,S),"object"==typeof D&&t(k,D),this._offset+=N.length}else k=null;if(k);else{this._offset=b;var L=null;if(L=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,L&&/^[^']/.test(L)){var z=this.constructor.SyntaxNode,W=null;k=new z(L,this._offset,[]),"object"==typeof W&&t(k,W),this._offset+=1}else{k=null;var F=null;F=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[^']"})}k||(this._offset=b)}k&&(m.push(k),v+=k.textValue,y-=1)}if(0>=y){this._offset=g;var H=this.constructor.SyntaxNode,M=null;d=new H(v,this._offset,m),"object"==typeof M&&t(d,M),this._offset+=v.length}else d=null;if(d){f.push(d),l+=d.textValue;var K=null,U=null;if(U=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"'"===U){var B=this.constructor.SyntaxNode,q=null;K=new B("'",this._offset,[]),"object"==typeof q&&t(K,q),this._offset+=1}else{K=null;var Q=null;Q=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"\'"'})}K?(f.push(K),l+=K.textValue):(f=null,this._offset=r)}else f=null,this._offset=r}else f=null,this._offset=r;if(f){this._offset=r;var G=this.constructor.SyntaxNode,J=null;s=new G(l,this._offset,f,u),"object"==typeof J&&t(s,J),this._offset+=l.length}else s=null;if(s){var $=e(this.constructor,"String");"object"==typeof $&&t(s,$)}else{this._offset=o;var Z=this._offset,te=[],ee={},se="",ne=null,ie=null;if(ie=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,'"'===ie){var oe=this.constructor.SyntaxNode,re=null;ne=new oe('"',this._offset,[]),"object"==typeof re&&t(ne,re),this._offset+=1}else{ne=null;var fe=null;fe=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"\\""'})}if(ne){te.push(ne),se+=ne.textValue;for(var ue=null,le=0,he=this._offset,ae=[],ce="",_e=!0;_e;){var pe=this._offset,de=this._offset,ye=[],ge={},me="",ve=null,ke=null;if(ke=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"\\"===ke){var be=this.constructor.SyntaxNode,xe=null;ve=new be("\\",this._offset,[]),"object"==typeof xe&&t(ve,xe),this._offset+=1}else{ve=null;var we=null;we=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"\\\\"'})}if(ve){ye.push(ve),me+=ve.textValue;var Se=null,Ne=null;Ne=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null;var Ce=Ne;if(null===Ce){Se=null;var Ee=null;Ee=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"<any char>"})}else{var Pe=this.constructor.SyntaxNode,Te=null;Se=new Pe(Ce,this._offset,[]),"object"==typeof Te&&t(Se,Te),this._offset+=1}Se?(ye.push(Se),me+=Se.textValue):(ye=null,this._offset=de)}else ye=null,this._offset=de;if(ye){this._offset=de;var Ve=this.constructor.SyntaxNode,je=null;_e=new Ve(me,this._offset,ye,ge),"object"==typeof je&&t(_e,je),this._offset+=me.length}else _e=null;if(_e);else{this._offset=pe;var Xe=null;if(Xe=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,Xe&&/^[^"]/.test(Xe)){var Re=this.constructor.SyntaxNode,Ae=null;_e=new Re(Xe,this._offset,[]),"object"==typeof Ae&&t(_e,Ae),this._offset+=1}else{_e=null;var Ye=null;Ye=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'[^"]'})}_e||(this._offset=pe)}_e&&(ae.push(_e),ce+=_e.textValue,le-=1)}if(0>=le){this._offset=he;var Oe=this.constructor.SyntaxNode,Ie=null;ue=new Oe(ce,this._offset,ae),"object"==typeof Ie&&t(ue,Ie),this._offset+=ce.length}else ue=null;if(ue){te.push(ue),se+=ue.textValue;var De=null,Le=null;if(Le=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,'"'===Le){var ze=this.constructor.SyntaxNode,We=null;De=new ze('"',this._offset,[]),"object"==typeof We&&t(De,We),this._offset+=1}else{De=null;var Fe=null;Fe=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"\\""'})}De?(te.push(De),se+=De.textValue):(te=null,this._offset=Z)}else te=null,this._offset=Z}else te=null,this._offset=Z;if(te){this._offset=Z;var He=this.constructor.SyntaxNode,Me=null;s=new He(se,this._offset,te,ee),"object"==typeof Me&&t(s,Me),this._offset+=se.length}else s=null;if(s){var Ke=e(this.constructor,"String");"object"==typeof Ke&&t(s,Ke)}else this._offset=o}return this._nodeCache.string[n]=s},__consume__space:function(){var e=null,s=this._offset;this._nodeCache.space=this._nodeCache.space||{};var n=this._nodeCache.space[s];if(n)return this._offset+=n.textValue.length,n;for(var i=0,o=this._offset,r=[],f="",u=!0;u;){var l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null," "===l){var h=this.constructor.SyntaxNode,a=null;u=new h(" ",this._offset,[]),"object"==typeof a&&t(u,a),this._offset+=1}else{u=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'" "'})}u&&(r.push(u),f+=u.textValue,i-=1)}if(0>=i){this._offset=o;var _=this.constructor.SyntaxNode,p=null;e=new _(f,this._offset,r),"object"==typeof p&&t(e,p),this._offset+=f.length}else e=null;return this._nodeCache.space[s]=e}},i=function(t){this._input=t,this._offset=0,this._nodeCache={}};i.prototype.parse=function(){var t=this.__consume__union_expression();if(t&&this._offset===this._input.length)return t;this.error||(this.error={input:this._input,offset:this._offset,expected:"<EOF>"});var e=s(this.error),n=Error(e);throw n},i.parse=function(t){var e=new i(t);return e.parse()},t(i.prototype,n);var o=function(t,e,s,n){if(this.textValue=t,this.offset=e,this.elements=s||[],n)for(var i in n)this[i]=n[i]};if(o.prototype.forEach=function(t,e){for(var s=0,n=this.elements.length;n>s;s++)t.call(e,this.elements[s],s)},i.SyntaxNode=o,"function"==typeof require&&"object"==typeof exports)exports.Grammar=n,exports.Parser=i,exports.parse=i.parse,Pathology!==void 0&&(Pathology.XPath=n,Pathology.XPathParser=i,Pathology.XPathParser.formatError=s);else{var r=this;r=r.Pathology=r.Pathology||{},Pathology.XPath=n,Pathology.XPathParser=i,Pathology.XPathParser.formatError=s}}(),Pathology.XPathParser.And={evaluate:function(t,e){return Pathology.atomize(this.left,t,e)&&Pathology.atomize(this.right,t,e)}},Pathology.XPathParser.Atom={evaluate:function(t,e){var s=this.expression.in_parens||this.expression;return s.evaluate(t,e)}},Pathology.Axis=function(t){this.name=t},Pathology.Axis.prototype.walk=function(t,e,s){var n,i=t.childNodes,o=Pathology.array(t.attributes);switch(t.checked&&o.push({nodeName:"checked",nodeValue:!0,nodeType:XPathResult.STRING_TYPE}),t.selected&&o.push({nodeName:"selected",nodeValue:!0,nodeType:XPathResult.STRING_TYPE}),this.name){case"attribute":for(var r=0,f=o.length;f>r;r++)e.call(s,o[r]);break;case"child":for(var r=0,f=i.length;f>r;r++)e.call(s,i[r]);break;case"descendant-or-self":e.call(s,t);for(var r=0,f=i.length;f>r;r++)this.walk(i[r],e,s);break;case"following-sibling":for(n=t.nextSibling;n;)e.call(s,n),n=n.nextSibling;break;case"parent":e.call(s,t.parentNode);break;case"self":e.call(s,t)}},Pathology.Axis.SHORTHANDS={"@":"attribute","..":"parent",".":"self","/":"descendant-or-self","":"child"},Pathology.Axis.fromAST=function(t){var e=t.axis_name?t.axis_name.textValue:t.textValue;return new this(this.SHORTHANDS[e]||e)},Pathology.XPathParser.Comparison={evaluate:function(t,e){var s,n=this.comparator.textValue,i=this.left.evaluate(t,e),o=Pathology.atomize(this.right,t,e),r=!1,f=o instanceof Array;if(i._nodes){for(var u=0,l=i._nodes.length;l>u;u++)s=i._nodes[u],"="===n?r=r||(f?Pathology.indexOf(o,s.nodeValue)>=0:s.nodeValue===o||s.innerHTML===o):"!="===n&&(r=r||(f?0>Pathology.indexOf(o,s.nodeValue):s.nodeValue!==o&&s.innerHTML!==o));return r}switch(n){case"=":return f?Pathology.indexOf(o,i.nodeValue)>=0:i==o;case"!=":return f?0>Pathology.indexOf(o,s.nodeValue):i!=o}}},Pathology.XPathParser.FunctionCall={getArguments:function(t,e){var s=[],n=this.function_args.rest;if(this.function_args.first&&this.function_args.first.evaluate&&s.push(this.function_args.first.evaluate(t,e)),n)for(var i=0,o=n.elements.length;o>i;i++)s.push(n.elements[i].expression.evaluate(t,e));return s},evaluate:function(t,e){var s=this.getArguments(t,e),n=this.REGISTER[this.function_name.textValue];return n.apply(t,s)},REGISTER:{concat:function(){for(var t="",e=0,s=arguments.length;s>e;e++)t+=arguments[e].makeString?arguments[e].makeString():arguments[e];return t},contains:function(t,e){return t?(t.makeString&&(t=t.makeString()),(""+t).indexOf(e)>=0):!1},"normalize-space":function(t){return t.makeString&&(t=t.makeString()),(""+t).replace(/^\s*/g,"").replace(/\s*$/g,"").replace(/\s+/g," ")},name:function(){return this.nodeName.toLowerCase()},not:function(t){return t&&t.atomize&&(t=t.atomize()),"string"==typeof t?!1:!t},string:function(t){return t.atomize().innerText},text:function(){return document.evaluate("/text()",this,null,XPathResult.ANY_TYPE,null)}}},Pathology.XPathParser.LocationPath={eachStep:function(t,e){for(var s=[this.head].concat(this.rest.elements),n=0,i=s.length;i>n;n++)t.call(e,s[n])},evaluate:function(t,e,s,n){n=n||new Pathology.XPathResult(XPathResult.ANY_TYPE),s=s||XPathResult.ANY_TYPE;var i,o,r,f,u,l,h=new Pathology.XPathResult(s),a=this.head.isRelative()?t:e,c=[this.head].concat(this.rest.elements);for(h.push(a),r=0,u=c.length;u>r;r++){for(i=c[r],o=new Pathology.XPathResult(s),f=0,l=h._nodes.length;l>f;f++)i.evaluate(h._nodes[f],e,s,o);h=o}for(r=0,u=h._nodes.length;u>r;r++)n.push(h._nodes[r]);return n}},Pathology.XPathParser.LocationStep={isRelative:function(){return"/"!==this.elements[0].textValue},evaluate:function(t,e,s,n){var i=this.selector.axis,o=this.selector.test,r=[[]];Pathology.Axis.fromAST(i).walk(t,function(t){return o&&o.evaluate?(o.evaluate(t,this.predicates,e,s,r,n),void 0):n.push(t)},this)}},Pathology.XPathParser.NodeTest={evaluate:function(t,e,s,n,i,o){var r=this.elements[0].condition_name,f=f=this.elements[0].textValue.toLowerCase(),u={expression:{evaluate:function(){if(r&&"node"===r.textValue)return!0;if(r&&"text"===r.textValue){if(t.nodeType!==XPathResult.BOOLEAN_TYPE)return!1}else if("*"===f){if(1!==t.nodeType)return!1}else{if(!t.nodeName)return!1;if(t.nodeName.toLowerCase()!==f)return!1}return!0}},subscript:this.subscript};e=[u].concat(e.elements);for(var l,h,a=0,c=e.length;c>a;a++){if(i[a]=i[a]||[],h=e[a],l=Pathology.atomize(h.expression,t,s),"string"==typeof l&&(l=!0),!l)return;if(i[a].push(t),h.subscript.integer&&h.subscript.integer.evaluate()!==i[a].length)return}o.push(t)}},Pathology.XPathParser.Or={evaluate:function(t,e){return Pathology.atomize(this.left,t,e)||Pathology.atomize(this.right,t,e)}},Pathology.XPathParser.Integer={evaluate:function(){return parseInt(this.textValue,10)}},Pathology.XPathParser.String={evaluate:function(context,root){return eval(this.textValue)}},Pathology.XPathParser.Union={evaluate:function(t,e,s,n){n=n||new Pathology.XPathResult(XPathResult.ANY_TYPE),s=s||XPathResult.ANY_TYPE,this.head.evaluate(t,e,s,n);for(var i=this.rest.elements,o=0,r=i.length;r>o;o++)i[o].location_path.evaluate(t,e,s,n);return n}},function(){var t,e,s,n=function(t,e){var s;for(s in e)t[s]=e[s];return t},i={msie:!(!window.attachEvent||window.opera),opera:!!window.opera,webkit:navigator.userAgent.indexOf("AppleWebKit/")>-1,safari:navigator.userAgent.indexOf("AppleWebKit/")>-1&&-1===navigator.userAgent.indexOf("Chrome/"),gecko:navigator.userAgent.indexOf("Gecko")>-1,mobilesafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/),rhino:navigator.userAgent.match(/Rhino/)&&!0},o=function(t,e,s){var i=s.ownerDocument.createEventObject();return n(i,e)},r={},f=1,u="_synthetic"+(new Date).getTime(),l=/keypress|keyup|keydown/,h=/load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll/,a=function(t,e,s,n){return new a.init(t,e,s,n)};t=function(t,e,s){return t.addEventListener?t.addEventListener(e,s,!1):t.attachEvent("on"+e,s)},e=function(t,e,s){return t.addEventListener?t.removeEventListener(e,s,!1):t.detachEvent("on"+e,s)},n(a,{init:function(t,e,s,n){var i=a.args(e,s,n),o=this;this.queue=[],this.element=i.element,"function"==typeof this[t]?this[t](i.options,i.element,function(){i.callback&&i.callback.apply(o,arguments),o.done.apply(o,arguments)}):(this.result=a.trigger(t,i.options,i.element),i.callback&&i.callback.call(this,i.element,this.result))},jquery:function(t){return window.FuncUnit&&window.FuncUnit.jQuery?window.FuncUnit.jQuery:t?a.helpers.getWindow(t).jQuery||window.jQuery:window.jQuery},args:function(){for(var t={},e=0;arguments.length>e;e++)"function"==typeof arguments[e]?t.callback=arguments[e]:arguments[e]&&arguments[e].jquery?t.element=arguments[e][0]:arguments[e]&&arguments[e].nodeName?t.element=arguments[e]:t.options&&"string"==typeof arguments[e]?t.element=document.getElementById(arguments[e]):arguments[e]&&(t.options=arguments[e]);return t},click:function(t,e,s){a("click!",t,e,s)},defaults:{focus:function(){if(!a.support.focusChanges){var s=this,n=s.nodeName.toLowerCase();a.data(s,"syntheticvalue",s.value),("input"===n||"textarea"===n)&&t(s,"blur",function(){a.data(s,"syntheticvalue")!=s.value&&a.trigger("change",{},s),e(s,"blur",arguments.callee)})}},submit:function(){a.onParents(this,function(t){return"form"===t.nodeName.toLowerCase()?(t.submit(),!1):void 0})}},changeOnBlur:function(s,n,i){t(s,"blur",function(){i!==s[n]&&a.trigger("change",{},s),e(s,"blur",arguments.callee)})},closest:function(t,e){for(;t&&t.nodeName.toLowerCase()!==e.toLowerCase();)t=t.parentNode;return t},data:function(t,e,s){var n;return t[u]||(t[u]=f++),r[t[u]]||(r[t[u]]={}),n=r[t[u]],s?(r[t[u]][e]=s,void 0):r[t[u]][e]},onParents:function(t,e){for(var s;t&&s!==!1;)s=e(t),t=t.parentNode;return t},focusable:/^(a|area|frame|iframe|label|input|select|textarea|button|html|object)$/i,isFocusable:function(t){var e;return(this.focusable.test(t.nodeName)||(e=t.getAttributeNode("tabIndex"))&&e.specified)&&a.isVisible(t)},isVisible:function(t){return t.offsetWidth&&t.offsetHeight||t.clientWidth&&t.clientHeight},tabIndex:function(t){var e=t.getAttributeNode("tabIndex");return e&&e.specified&&(parseInt(t.getAttribute("tabIndex"))||0)},bind:t,unbind:e,browser:i,helpers:{createEventObject:o,createBasicStandardEvent:function(t,e,s){var i;try{i=s.createEvent("Events")}catch(o){i=s.createEvent("UIEvents")}finally{i.initEvent(t,!0,!0),n(i,e)}return i},inArray:function(t,e){for(var s=0;e.length>s;s++)if(e[s]===t)return s;return-1},getWindow:function(t){return t.ownerDocument.defaultView||t.ownerDocument.parentWindow},extend:n,scrollOffset:function(t,e){var s=t.document.documentElement,n=t.document.body;return e?(window.scrollTo(e.left,e.top),void 0):{left:(s&&s.scrollLeft||n&&n.scrollLeft||0)+(s.clientLeft||0),top:(s&&s.scrollTop||n&&n.scrollTop||0)+(s.clientTop||0)}},scrollDimensions:function(t){var e=t.document.documentElement,s=t.document.body,n=e.clientWidth,i=e.clientHeight,o="CSS1Compat"===t.document.compatMode;return{height:o&&i||s.clientHeight||i,width:o&&n||s.clientWidth||n}},addOffset:function(t,e){var s,n=a.jquery(e);"object"==typeof t&&void 0===t.clientX&&void 0===t.clientY&&void 0===t.pageX&&void 0===t.pageY&&n&&(e=n(e),s=e.offset(),t.pageX=s.left+e.width()/2,t.pageY=s.top+e.height()/2)}},key:{ctrlKey:null,altKey:null,shiftKey:null,metaKey:null},dispatch:function(s,n,i,o){if(n.dispatchEvent&&s){var r=s.preventDefault,f=o?-1:0;return o&&t(n,i,function(t){t.preventDefault(),e(this,i,arguments.callee)}),s.preventDefault=function(){f++,++f>0&&r.apply(this,[])},n.dispatchEvent(s),0>=f}try{window.event=s}catch(u){}return 0>=n.sourceIndex||n.fireEvent&&n.fireEvent("on"+i,s)},create:{page:{event:function(t,e,s){var n,i=a.helpers.getWindow(s).document||document;if(i.createEvent)return n=i.createEvent("Events"),n.initEvent(t,!0,!0),n;try{n=o(t,e,s)}catch(r){}return n}},focus:{event:function(t,e,n){return a.onParents(n,function(t){if(a.isFocusable(t)){if("html"!==t.nodeName.toLowerCase())t.focus(),s=t;else if(s){var e=a.helpers.getWindow(n).document;if(e!==window.document)return!1;e.activeElement?(e.activeElement.blur(),s=null):(s.blur(),s=null)}return!1}}),!0}}},support:{clickChanges:!1,clickSubmits:!1,keypressSubmits:!1,mouseupSubmits:!1,radioClickChanges:!1,focusChanges:!1,linkHrefJS:!1,keyCharacters:!1,backspaceWorks:!1,mouseDownUpClicks:!1,tabKeyTabs:!1,keypressOnAnchorClicks:!1,optionClickBubbles:!1,ready:0},trigger:function(t,e,s){e||(e={});var n,i,o,r=a.create,f=r[t]&&r[t].setup,u=l.test(t)?"key":h.test(t)?"page":"mouse",c=r[t]||{},_=r[u],p=s;return 2===a.support.ready&&f&&f(t,e,s),o=e._autoPrevent,delete e._autoPrevent,c.event?i=c.event(t,e,s):(e=_.options?_.options(t,e,s):e,!a.support.changeBubbles&&/option/i.test(s.nodeName)&&(p=s.parentNode),n=_.event(t,e,p),i=a.dispatch(n,p,t,o)),i&&2===a.support.ready&&a.defaults[t]&&a.defaults[t].call(s,e,o),i},eventSupported:function(t){var e=document.createElement("div");t="on"+t;var s=t in e;return s||(e.setAttribute(t,"return;"),s="function"==typeof e[t]),e=null,s}}),n(a.init.prototype,{then:function(t,e,s,n){a.autoDelay&&this.delay();var i=a.args(e,s,n),o=this;return this.queue.unshift(function(e){return"function"!=typeof this[t]?(this.result=a.trigger(t,i.options,i.element),i.callback&&i.callback.call(this,i.element,this.result),this):(this.element=i.element||e,this[t](i.options,this.element,function(){i.callback&&i.callback.apply(o,arguments),o.done.apply(o,arguments)}),void 0)}),this},delay:function(t,e){"function"==typeof t&&(e=t,t=null),t=t||600;var s=this;return this.queue.unshift(function(){setTimeout(function(){e&&e.apply(s,[]),s.done.apply(s,arguments)},t)}),this},done:function(t,e){e&&(this.element=e),this.queue.length&&this.queue.pop().call(this,this.element,t)},_click:function(t,e,s,n){a.helpers.addOffset(t,e),a.trigger("mousedown",t,e),setTimeout(function(){a.trigger("mouseup",t,e),!a.support.mouseDownUpClicks||n?(a.trigger("click",t,e),s(!0)):(a.create.click.setup("click",t,e),a.defaults.click.call(e),setTimeout(function(){s(!0)},1))},1)},_rightClick:function(t,e,s){a.helpers.addOffset(t,e);var i=n(n({},a.mouse.browser.right.mouseup),t);a.trigger("mousedown",i,e),setTimeout(function(){a.trigger("mouseup",i,e),a.mouse.browser.right.contextmenu&&a.trigger("contextmenu",n(n({},a.mouse.browser.right.contextmenu),t),e),s(!0)},1)},_dblclick:function(t,e,s){a.helpers.addOffset(t,e);var n=this;this._click(t,e,function(){setTimeout(function(){n._click(t,e,function(){a.trigger("dblclick",t,e),s(!0)},!0)},2)})}});for(var c=["click","dblclick","move","drag","key","type","rightClick"],_=function(t){a[t]=function(e,s,n){return a("_"+t,e,s,n)},a.init.prototype[t]=function(e,s,n){return this.then("_"+t,e,s,n)}},p=0;c.length>p;p++)_(c[p]);(window.FuncUnit&&window.FuncUnit.jQuery||window.jQuery)&&((window.FuncUnit&&window.FuncUnit.jQuery||window.jQuery).fn.triggerSyn=function(t,e,s){if(!this[0])throw"Can't "+t.substring(1)+" because no element matching '"+this.selector+"' was found";return a(t,e,this[0],s),this}),window.Syn=a}(),function(){var h=Syn.helpers,getWin=h.getWindow;Syn.mouse={},h.extend(Syn.defaults,{mousedown:function(){Syn.trigger("focus",{},this)},click:function(){var element=this;try{element.nodeType}catch(e){return}var href,radioChanged=Syn.data(element,"radioChanged"),scope=getWin(element),nodeName=element.nodeName.toLowerCase();if(!Syn.support.linkHrefJS&&/^\s*javascript:/.test(element.href)){var code=element.href.replace(/^\s*javascript:/,"");"//"!=code&&-1==code.indexOf("void(0)")&&(window.selenium?eval("with(selenium.browserbot.getCurrentWindow()){"+code+"}"):eval("with(scope){"+code+"}"))}if(!Syn.support.clickSubmits&&"input"==nodeName&&"submit"==element.type||"button"==nodeName){var form=Syn.closest(element,"form");form&&Syn.trigger("submit",{},form)}"a"==nodeName&&element.href&&!/^\s*javascript:/.test(element.href)&&(scope.location.href=element.href),"input"==nodeName&&"checkbox"==element.type&&(Syn.support.clickChanges||Syn.trigger("change",{},element)),"input"==nodeName&&"radio"==element.type&&radioChanged&&!Syn.support.radioClickChanges&&Syn.trigger("change",{},element),"option"==nodeName&&Syn.data(element,"createChange")&&(Syn.trigger("change",{},element.parentNode),Syn.data(element,"createChange",!1))}}),h.extend(Syn.create,{mouse:{options:function(t,e){var s=document.documentElement,n=document.body,i=[e.pageX||0,e.pageY||0],o=Syn.mouse.browser&&Syn.mouse.browser.left[t],r=Syn.mouse.browser&&Syn.mouse.browser.right[t];return h.extend({bubbles:!0,cancelable:!0,view:window,detail:1,screenX:1,screenY:1,clientX:e.clientX||i[0]-(s&&s.scrollLeft||n&&n.scrollLeft||0)-(s.clientLeft||0),clientY:e.clientY||i[1]-(s&&s.scrollTop||n&&n.scrollTop||0)-(s.clientTop||0),ctrlKey:!!Syn.key.ctrlKey,altKey:!!Syn.key.altKey,shiftKey:!!Syn.key.shiftKey,metaKey:!!Syn.key.metaKey,button:o&&null!=o.button?o.button:r&&r.button||("contextmenu"==t?2:0),relatedTarget:document.documentElement},e)},event:function(t,e,s){var n=getWin(s).document||document;if(n.createEvent){var i;try{i=n.createEvent("MouseEvents"),i.initMouseEvent(t,e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}catch(o){i=h.createBasicStandardEvent(t,e,n)}return i.synthetic=!0,i}var i;try{i=h.createEventObject(t,e,s)}catch(o){}return i}},click:{setup:function(t,e,s){var t,n=s.nodeName.toLowerCase();if(!Syn.support.clickChecks&&!Syn.support.changeChecks&&"input"===n&&(t=s.type.toLowerCase(),"checkbox"===t&&(s.checked=!s.checked),"radio"===t&&!s.checked)){try{Syn.data(s,"radioChanged",!0)}catch(i){}s.checked=!0}if("a"==n&&s.href&&!/^\s*javascript:/.test(s.href)&&Syn.data(s,"href",s.href),/option/i.test(s.nodeName)){for(var o=s.parentNode.firstChild,r=-1;o&&(1!=o.nodeType||(r++,o!=s));)o=o.nextSibling;r!==s.parentNode.selectedIndex&&(s.parentNode.selectedIndex=r,Syn.data(s,"createChange",!0))}}},mousedown:{setup:function(t,e,s){var n=s.nodeName.toLowerCase();!Syn.browser.safari||"select"!=n&&"option"!=n||(e._autoPrevent=!0)}}}),function(){if(!document.body)return setTimeout(arguments.callee,1),void 0;var t=window.__synthTest;window.__synthTest=function(){Syn.support.linkHrefJS=!0};var e,s,n,i,o=document.createElement("div");o.innerHTML="<form id='outer'><input name='checkbox' type='checkbox'/><input name='radio' type='radio' /><input type='submit' name='submitter'/><input type='input' name='inputter'/><input name='one'><input name='two'/><a href='javascript:__synthTest()' id='synlink'></a><select><option></option></select></form>",document.documentElement.appendChild(o),n=o.firstChild,e=n.childNodes[0],s=n.childNodes[2],i=n.getElementsByTagName("select")[0],e.checked=!1,e.onchange=function(){Syn.support.clickChanges=!0},Syn.trigger("click",{},e),Syn.support.clickChecks=e.checked,e.checked=!1,Syn.trigger("change",{},e),Syn.support.changeChecks=e.checked,n.onsubmit=function(t){return t.preventDefault&&t.preventDefault(),Syn.support.clickSubmits=!0,!1},Syn.trigger("click",{},s),n.childNodes[1].onchange=function(){Syn.support.radioClickChanges=!0},Syn.trigger("click",{},n.childNodes[1]),Syn.bind(o,"click",function(){Syn.support.optionClickBubbles=!0,Syn.unbind(o,"click",arguments.callee)}),Syn.trigger("click",{},i.firstChild),Syn.support.changeBubbles=Syn.eventSupported("change"),o.onclick=function(){Syn.support.mouseDownUpClicks=!0},Syn.trigger("mousedown",{},o),Syn.trigger("mouseup",{},o),document.documentElement.removeChild(o),window.__synthTest=t,Syn.support.ready++}()}(),function(){Syn.key.browsers={webkit:{prevent:{keyup:[],keydown:["char","keypress"],keypress:["char"]},character:{keydown:[0,"key"],keypress:["char","char"],keyup:[0,"key"]},specialChars:{keydown:[0,"char"],keyup:[0,"char"]},navigation:{keydown:[0,"key"],keyup:[0,"key"]},special:{keydown:[0,"key"],keyup:[0,"key"]},tab:{keydown:[0,"char"],keyup:[0,"char"]},"pause-break":{keydown:[0,"key"],keyup:[0,"key"]},caps:{keydown:[0,"key"],keyup:[0,"key"]},escape:{keydown:[0,"key"],keyup:[0,"key"]},"num-lock":{keydown:[0,"key"],keyup:[0,"key"]},"scroll-lock":{keydown:[0,"key"],keyup:[0,"key"]},print:{keyup:[0,"key"]},"function":{keydown:[0,"key"],keyup:[0,"key"]},"\r":{keydown:[0,"key"],keypress:["char","key"],keyup:[0,"key"]}},gecko:{prevent:{keyup:[],keydown:["char"],keypress:["char"]},character:{keydown:[0,"key"],keypress:["char",0],keyup:[0,"key"]},specialChars:{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},navigation:{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},special:{keydown:[0,"key"],keyup:[0,"key"]}," ":{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},"pause-break":{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},caps:{keydown:[0,"key"],keyup:[0,"key"]},escape:{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},"num-lock":{keydown:[0,"key"],keyup:[0,"key"]},"scroll-lock":{keydown:[0,"key"],keyup:[0,"key"]},print:{keyup:[0,"key"]},"function":{keydown:[0,"key"],keyup:[0,"key"]},"\r":{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]}},msie:{prevent:{keyup:[],keydown:["char","keypress"],keypress:["char"]},character:{keydown:[null,"key"],keypress:[null,"char"],keyup:[null,"key"]},specialChars:{keydown:[null,"char"],keyup:[null,"char"]},navigation:{keydown:[null,"key"],keyup:[null,"key"]},special:{keydown:[null,"key"],keyup:[null,"key"]},tab:{keydown:[null,"char"],keyup:[null,"char"]},"pause-break":{keydown:[null,"key"],keyup:[null,"key"]},caps:{keydown:[null,"key"],keyup:[null,"key"]},escape:{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},"num-lock":{keydown:[null,"key"],keyup:[null,"key"]},"scroll-lock":{keydown:[null,"key"],keyup:[null,"key"]},print:{keyup:[null,"key"]},"function":{keydown:[null,"key"],keyup:[null,"key"]},"\r":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]}},opera:{prevent:{keyup:[],keydown:[],keypress:["char"]},character:{keydown:[null,"key"],keypress:[null,"char"],keyup:[null,"key"]},specialChars:{keydown:[null,"char"],keypress:[null,"char"],keyup:[null,"char"]},navigation:{keydown:[null,"key"],keypress:[null,"key"]},special:{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},tab:{keydown:[null,"char"],keypress:[null,"char"],keyup:[null,"char"]},"pause-break":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},caps:{keydown:[null,"key"],keyup:[null,"key"]},escape:{keydown:[null,"key"],keypress:[null,"key"]},"num-lock":{keyup:[null,"key"],keydown:[null,"key"],keypress:[null,"key"]},"scroll-lock":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},print:{},"function":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},"\r":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]}}},Syn.mouse.browsers={webkit:{right:{mousedown:{button:2,which:3},mouseup:{button:2,which:3},contextmenu:{button:2,which:3}},left:{mousedown:{button:0,which:1},mouseup:{button:0,which:1},click:{button:0,which:1}}},opera:{right:{mousedown:{button:2,which:3},mouseup:{button:2,which:3}},left:{mousedown:{button:0,which:1},mouseup:{button:0,which:1},click:{button:0,which:1}}},msie:{right:{mousedown:{button:2},mouseup:{button:2},contextmenu:{button:0}},left:{mousedown:{button:1},mouseup:{button:1},click:{button:0}}},chrome:{right:{mousedown:{button:2,which:3},mouseup:{button:2,which:3},contextmenu:{button:2,which:3}},left:{mousedown:{button:0,which:1},mouseup:{button:0,which:1},click:{button:0,which:1}}},gecko:{left:{mousedown:{button:0,which:1},mouseup:{button:0,which:1},click:{button:0,which:1}},right:{mousedown:{button:2,which:3},mouseup:{button:2,which:3},contextmenu:{button:2,which:3}}}},Syn.key.browser=function(){if(Syn.key.browsers[window.navigator.userAgent])return Syn.key.browsers[window.navigator.userAgent];
|
3
|
-
for(var t in Syn.browser)if(Syn.browser[t]&&Syn.key.browsers[t])return Syn.key.browsers[t];return Syn.key.browsers.gecko}(),Syn.mouse.browser=function(){if(Syn.mouse.browsers[window.navigator.userAgent])return Syn.mouse.browsers[window.navigator.userAgent];for(var t in Syn.browser)if(Syn.browser[t]&&Syn.mouse.browsers[t])return Syn.mouse.browsers[t];return Syn.mouse.browsers.gecko}()}(),function(){(function(){if(!document.body)return setTimeout(arguments.callee,1),void 0;var t=document.createElement("div");if(document.body.appendChild(t),Syn.helpers.extend(t.style,{width:"100px",height:"10000px",backgroundColor:"blue",position:"absolute",top:"10px",left:"0px",zIndex:19999}),document.body.scrollTop=11,document.elementFromPoint){var e=document.elementFromPoint(3,1);e==t?Syn.support.elementFromClient=!0:Syn.support.elementFromPage=!0,document.body.removeChild(t),document.body.scrollTop=0}})();var t=function(t,e){var s,n=t.clientX,i=t.clientY,o=Syn.helpers.getWindow(e);if(Syn.support.elementFromPage){var r=Syn.helpers.scrollOffset(o);n+=r.left,i+=r.top}return s=o.document.elementFromPoint?o.document.elementFromPoint(n,i):e,s===o.document.documentElement&&(0>t.clientY||0>t.clientX)?e:s},e=function(e,s,n){var i=t(s,n);return Syn.trigger(e,s,i||n),i},s=function(e,s,n){var i=t(e,s);if(n!=i&&i&&n){var o=Syn.helpers.extend({},e);o.relatedTarget=i,Syn.trigger("mouseout",o,n),o.relatedTarget=n,Syn.trigger("mouseover",o,i)}return Syn.trigger("mousemove",e,i||s),i},n=function(e,n,i,o,r){var f=new Date,u=n.clientX-e.clientX,l=n.clientY-e.clientY,h=Syn.helpers.getWindow(o),a=t(e,o),c=h.document.createElement("div"),_=0;move=function(){var t=new Date,p=Syn.helpers.scrollOffset(h),d=(0==_?0:t-f)/i,y={clientX:u*d+e.clientX,clientY:l*d+e.clientY};_++,1>d?(Syn.helpers.extend(c.style,{left:y.clientX+p.left+2+"px",top:y.clientY+p.top+2+"px"}),a=s(y,o,a),setTimeout(arguments.callee,15)):(a=s(n,o,a),h.document.body.removeChild(c),r())},Syn.helpers.extend(c.style,{height:"5px",width:"5px",backgroundColor:"red",position:"absolute",zIndex:19999,fontSize:"1px"}),h.document.body.appendChild(c),move()},i=function(t,s,i,o,r){e("mousedown",t,o),n(t,s,i,o,function(){e("mouseup",s,o),r()})},o=function(t){var e=Syn.jquery()(t),s=e.offset();return{pageX:s.left+e.outerWidth()/2,pageY:s.top+e.outerHeight()/2}},r=function(t,e,s){var n=/(\d+)[x ](\d+)/,i=/(\d+)X(\d+)/,r=/([+-]\d+)[xX ]([+-]\d+)/;if("string"==typeof t&&r.test(t)&&s){var f=o(s),u=t.match(r);t={pageX:f.pageX+parseInt(u[1]),pageY:f.pageY+parseInt(u[2])}}if("string"==typeof t&&n.test(t)){var u=t.match(n);t={pageX:parseInt(u[1]),pageY:parseInt(u[2])}}if("string"==typeof t&&i.test(t)){var u=t.match(i);t={clientX:parseInt(u[1]),clientY:parseInt(u[2])}}if("string"==typeof t&&(t=Syn.jquery()(t,e.document)[0]),t.nodeName&&(t=o(t)),t.pageX){var l=Syn.helpers.scrollOffset(e);t={clientX:t.pageX-l.left,clientY:t.pageY-l.top}}return t},f=function(t,e,s){if(0>t.clientY){var n=Syn.helpers.scrollOffset(s),i=(Syn.helpers.scrollDimensions(s),n.top+t.clientY-100),o=i-n.top;i>0||(i=0,o=-n.top),t.clientY=t.clientY-o,e.clientY=e.clientY-o,Syn.helpers.scrollOffset(s,{top:i,left:n.left})}};Syn.helpers.extend(Syn.init.prototype,{_move:function(t,e,s){var i=Syn.helpers.getWindow(e),o=r(t.from||e,i,e),u=r(t.to||t,i,e);t.adjust!==!1&&f(o,u,i),n(o,u,t.duration||500,e,s)},_drag:function(t,e,s){var n=Syn.helpers.getWindow(e),o=r(t.from||e,n,e),u=r(t.to||t,n,e);t.adjust!==!1&&f(o,u,n),i(o,u,t.duration||500,e,s)}})}(),Terminus={isIE:/\bMSIE\b/.test(navigator.userAgent),connect:function(t,e){if(!this._bayeux){this._host=t,this._pageId=Faye.random(),this._id=window.name=window.name||document.name||Faye.random(),this._id=this._id.split("|")[0];for(var s=document.getElementsByTagName("iframe"),n=s.length;n--;)s[n].contentDocument.name=s[n].id;this.Registry.initialize(),this.Worker.initialize(),this.AjaxMonitor.initialize(),Faye.Event.on(window,"beforeunload",function(){Terminus.disabled=!0});var i="http://"+t+":"+e+"/messaging",o=this._bayeux=new Faye.Client(i),r=this;o.addExtension({outgoing:function(t,e){t.href=window.location.href,"websocket"===t.connectionType&&(r._socketCapable=!0),e(t)}}),this.getId(function(t){var e=window.name.split("|")[1];e||o.subscribe("/terminus/sockets/"+t,function(t){window.name+="|"+t.url,this.openSocket(t.url)},this);var s=o.subscribe("/terminus/clients/"+t,this.handleMessage,this);s.callback(function(){this.ping(),e&&this.openSocket(e)},this)},this)}},browserDetails:function(t,e){this.getId(function(s){t.call(e,{host:this._host,id:s,infinite:!!window.TERMINUS_INFINITE_REDIRECT,page:this._pageId,sockets:this._socketCapable,ua:navigator.userAgent,url:window.location.href})},this)},getId:function(t,e){var s=this._id;if(this.isIE)return t.call(e,s);if(opener&&opener.Terminus)opener.Terminus.getId(function(n){t.call(e,n+"/"+s)});else if(parent&&parent!==window){var n=function(){return parent.Terminus?(parent.Terminus.getId(function(n){t.call(e,n+"/"+s)}),void 0):setTimeout(n,100)};n()}else t.call(e,s)},openSocket:function(t){if(!this.disabled&&!this._socket){var e=this,s=window.MozWebSocket||window.WebSocket,n=new s(t);n.onopen=function(){e._socket=n,up=!0},n.onclose=function(){var s=!!e._socket;e._socket=null,s?e.openSocket(t):window.name=window.name.split("|")[0]},n.onmessage=function(t){e.handleMessage(JSON.parse(t.data))}}},ping:function(){this.disabled||this.browserDetails(function(t){this._bayeux.publish("/terminus/ping",t);var e=this;setTimeout(function(){e.ping()},3e3)},this)},handleMessage:function(t){var e=t.command,s=e.shift(),n=this.Driver,i=this.Worker,o=!1,r=this;e.push(function(e){o||(r.postResult(t.commandId,e),o=!0)}),i.monitor=!0,n[s].apply(n,e),i.monitor=!1},postResult:function(t,e){return!this.disabled&&t?this._socket?this._socket.send(JSON.stringify({value:e})):(this.getId(function(s){this._bayeux.publish("/terminus/results",{id:s,commandId:t,result:e})},this),void 0):void 0},getAttribute:function(t,e){return Terminus.isIE?(t.getAttributeNode(e)||{}).nodeValue||!1:t.getAttribute(e)},hideNodes:function(t,e){if(!t)return e;e=e||[];var s="script"===(t.tagName||"").toLowerCase(),n="none"===(t.style||{}).display;if(s||n){var i=t.parentNode,o=t.nextSibling;s||e.push([t,i,o]),i&&i.removeChild(t)}else for(var r=t.childNodes||[],f=0,u=r.length;u>f;f++)this.hideNodes(r[f],e);return e},showNodes:function(t){for(var e,s,n,i,o=0,r=t.length;r>o;o++)e=t[o],s=e[0],n=e[1],i=e[2],n&&(i?n.insertBefore(s,i):n.appendChild(s))},Driver:{_node:function(t){return Terminus.Registry.get(t)},attribute:function(t,e,s){var n=this._node(t);return n?(Terminus.isIE||"checked"!==e&&"selected"!==e?"textarea"===n.tagName.toLowerCase()&&"type"===e?s("textarea"):s(Terminus.getAttribute(n,e)):s(!!n[e]),void 0):s(null)},set_attribute:function(t,e,s,n){var i=this._node(t);return i?(i.setAttribute(e,s),n(!0),void 0):n(null)},body:function(t){var e=document.getElementsByTagName("html")[0];t(e.outerHTML||"<html>\n"+e.innerHTML+"\n</html>\n")},clear_cookies:function(t){var e,s=document.cookie.split(";"),n=new Date;n.setTime(n.getTime()-864e5);for(var i=0,o=s.length;o>i;i++)e=s[i].split("=")[0],document.cookie=e+"=; expires="+n.toGMTString()+"; path=/";t(!0)},click:function(t,e,s){var n=this._node(t),i=e.resynchronization_timeout;return n?(Syn.trigger("click",{},n),e.resynchronize===!1?s(!0):(i&&Terminus.Worker._setTimeout.call(window,function(){s("failed to resynchronize, ajax request timed out")},1e3*i),Terminus.Worker.callback(function(){s(!0)}),void 0)):s(!0)},current_url:function(t){Terminus.browserDetails(function(e){t(e.url)})},drag:function(t,e){var s=this._node(t.from),n=this._node(t.to);return s&&n?(Syn.drag({to:n},s,function(){e(!0)}),void 0):e(null)},evaluate:function(expression,callback){callback(eval(expression))},execute:function(expression,callback){eval(expression),callback(!0)},find:function(t,e,s){var n=e?this._node(e):document;if(!n)return s([]);for(var i,o=document.evaluate(t,n,null,XPathResult.ANY_TYPE,null),r=[];i=o.iterateNext();)r.push(Terminus.Registry.put(i));return s(r)},is_visible:function(t,e){var s=this._node(t);if(!s)return e(null);for(;s.tagName&&"body"!==s.tagName.toLowerCase();){if("none"===s.style.display||"hidden"===s.type)return e(!1);s=s.parentNode}e(!0)},select:function(t,e){var s=this._node(t);return s?(s.selected=!0,Syn.trigger("change",{},s.parentNode),e(!0),void 0):e(null)},set:function(t,e,s){var n=this._node(t),i=Terminus.getAttribute(n,"maxlength");if(!n)return s(null);if("file"===n.type)return s("not_allowed");switch(Syn.trigger("focus",{},n),Syn.trigger("click",{},n),typeof e){case"string":i&&(e=e.substr(0,parseInt(i))),n.value=e;break;case"boolean":n.checked=e}Syn.trigger("change",{},n),s(!0)},tag_name:function(t,e){var s=this._node(t);return s?(e(s.tagName.toLowerCase()),void 0):e(null)},text:function(t,e){var s=this._node(t);if(!s)return e(null);var n=Terminus.hideNodes(s),i=document.title;document.title="";var o=s.textContent||s.innerText||"";document.title=i,Terminus.showNodes(n),o=o.replace(/^\s*|\s*$/g,"").replace(/\s+/g," "),e(o)},trigger:function(t,e,s){var n=this._node(t);return n?(Syn.trigger(e,{},n),s(!0),void 0):s(null)},unselect:function(t,e){var s=this._node(t);return s?s.parentNode.multiple?(s.selected=!1,Syn.trigger("change",{},s.parentNode),e(!0),void 0):e(!1):e(null)},value:function(t,e){var s=this._node(t);if(!s)return e(null);if("select"!==s.tagName.toLowerCase()||!s.multiple)return e(s.value);for(var n=s.children,i=[],o=0,r=n.length;r>o;o++)n[o].selected&&i.push(n[o].value);e(i)},visit:function(t,e){window.location.href=t,e(t)}},Registry:{initialize:function(){this._namespace=new Faye.Namespace,this._elements={}},get:function(t){for(var e=this._elements[t],s=e;s&&"BODY"!==s.tagName&&"HTML"!==s.tagName;)s=s.parentNode;return s?e:null},put:function(t){var e=t["data-terminus-id"];return e||(e=this._namespace.generate(),t["data-terminus-id"]=e),this._elements[e]=t,e}},Worker:{initialize:function(){this._callbacks=[],this._pending=0,Terminus.isIE||this._wrapTimeouts()},callback:function(t,e){0===this._pending?this._setTimeout?this._setTimeout.call(window,function(){t.call(e)},0):setTimeout(function(){t.call(e)},0):this._callbacks.push([t,e])},suspend:function(){this._pending+=1},resume:function(){if(0!==this._pending&&(this._pending-=1,0===this._pending)){for(var t,e=0,s=this._callbacks.length;s>e;e++)t=this._callbacks[e],t[0].call(t[1]);this._callbacks=[]}},_wrapTimeouts:function(){var timeout=window.setTimeout,clear=window.clearTimeout,timeouts={},self=this,finish=function(t){timeouts.hasOwnProperty(t)&&(delete timeouts[t],self.resume())};window.setTimeout=function(callback,delay){var id=timeout.call(window,function(){try{switch(typeof callback){case"function":callback();break;case"string":eval(callback)}}finally{finish(id)}},delay);return self.monitor&&(timeouts[id]=!0,self.suspend()),id},window.clearTimeout=function(t){return finish(t),clear(t)},this._setTimeout=timeout}},AjaxMonitor:{initialize:function(){window.jQuery&&this._patchJquery()},_patchJquery:function(){var t=jQuery.ajax;jQuery.ajax=function(e,s){var n=("string"==typeof e?s:e)||{},i=n.complete,o=Terminus.Worker.monitor;return n.complete=function(){var t;try{t=i.apply(this,arguments)}finally{o&&Terminus.Worker.resume()}return t},o&&Terminus.Worker.suspend(),"string"==typeof e?t.call(jQuery,e,n):t.call(jQuery,n)}}}};
|
1
|
+
var Pathology={evaluate:function(t,e,s,n,i){i=i||new Pathology.XPathResult(n);var o=Pathology.XPathParser.parse(t);return o.evaluate(e,e,n,i),i},atomize:function(t,e,s){var n=t.evaluate(e,s);return n&&n.atomize&&(n=n.atomize()),n},array:function(t){if(!t)return[];for(var e=[],s=t.length;s--;)e[s]=t[s];return e},indexOf:function(t,e){if(t.indexOf)return t.indexOf(e);for(var s=0,n=t.length;n>s;s++)if(t[s]===e)return s;return-1}};"undefined"==typeof XPathResult&&(XPathResult={ANY_TYPE:0,NUMBER_TYPE:1,STRING_TYPE:2,BOOLEAN_TYPE:3,UNORDERED_NODE_ITERATOR_TYPE:4,ORDERED_NODE_ITERATOR_TYPE:5,UNORDERED_NODE_SNAPSHOT_TYPE:6,ORDERED_NODE_SNAPSHOT_TYPE:7,ANY_UNORDERED_NODE_TYPE:8,FIRST_ORDERED_NODE_TYPE:9}),"undefined"==typeof document.evaluate&&(document.evaluate=function(){return Pathology.evaluate.apply(Pathology,arguments)}),Pathology.XPathResult=function(t){this._type=t,this._nodes=[],this._index=0},Pathology.XPathResult.prototype.push=function(t){(0===this._type||t.nodeType===this._type)&&(Pathology.indexOf(this._nodes,t)>=0||this._nodes.push(t))},Pathology.XPathResult.prototype.iterateNext=function(){var t=this._nodes[this._index];return t?(this._index+=1,t):null},Pathology.XPathResult.prototype.atomize=function(){if(0===this._nodes.length)return null;if(1===this._nodes.length){var t=this._nodes[0];return void 0===t.nodeValue||null===t.nodeValue?t:t.nodeValue}for(var e=[],s=0,n=this._nodes.length;n>s;s++)e.push(this._nodes[s].nodeValue);return e},Pathology.XPathResult.prototype.makeString=function(){var t=this._nodes[0];if(!t)return"";switch(t.nodeType){case XPathResult.STRING_TYPE:return this.atomize();case XPathResult.BOOLEAN_TYPE:for(var e=[],s=0,n=this._nodes.length;n>s;s++)e.push(this._nodes[s].nodeValue);return e.join("");default:var i=document.evaluate("//text()",t,null,XPathResult.ANY_TYPE,null);return i.makeString()}},function(){var t=function(t,e){if(!t||!e)return t;for(var s in e)t[s]!==e[s]&&(t[s]=e[s]);return t},e=function(t,e){for(var s,n=e.split(".");s=n.shift();)if(t=t[s],void 0===t)throw new Error("Cannot find object named "+e);return t},s=function(t){for(var e=t.input.split(/\n/g),s=0,n=0;n<t.offset+1;)n+=e[s].length+1,s+=1;var i="Line "+s+": expected "+t.expected+"\n",o=e[s-1];for(i+=o+"\n",n-=o.length+1;n<t.offset;)i+=" ",n+=1;return i+"^"},n={__consume__union_expression:function(){var s=null,n=this._offset;this._nodeCache.union_expression=this._nodeCache.union_expression||{};var i=this._nodeCache.union_expression[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null;if(l=this.__consume__location_path()){r.push(l),u+=l.textValue,f.head=l;for(var h=null,a=0,c=this._offset,_=[],p="",d=!0;d;){var y=this._offset,g=[],m={},v="",b=null;if(b=this.__consume__space()){g.push(b),v+=b.textValue,m.space=b;var k=null,x=null;if(x=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"|"===x){var w=this.constructor.SyntaxNode,S=null;k=new w("|",this._offset,[]),"object"==typeof S&&t(k,S),this._offset+=1}else{k=null;var N=null;N=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"|"'})}if(k){g.push(k),v+=k.textValue;var C=null;if(C=this.__consume__space()){g.push(C),v+=C.textValue,m.space=C;var E=null;E=this.__consume__location_path(),E?(g.push(E),v+=E.textValue,m.location_path=E):(g=null,this._offset=y)}else g=null,this._offset=y}else g=null,this._offset=y}else g=null,this._offset=y;if(g){this._offset=y;var P=this.constructor.SyntaxNode,T=null;d=new P(v,this._offset,g,m),"object"==typeof T&&t(d,T),this._offset+=v.length}else d=null;d&&(_.push(d),p+=d.textValue,a-=1)}if(0>=a){this._offset=c;var V=this.constructor.SyntaxNode,j=null;h=new V(p,this._offset,_),"object"==typeof j&&t(h,j),this._offset+=p.length}else h=null;h?(r.push(h),u+=h.textValue,f.rest=h):(r=null,this._offset=o)}else r=null,this._offset=o;if(r){this._offset=o;var X=this.constructor.SyntaxNode,A=e(this.constructor,"Union");s=new X(u,this._offset,r,f),"object"==typeof A&&t(s,A),this._offset+=u.length}else s=null;return this._nodeCache.union_expression[n]=s},__consume__location_path:function(){var s=null,n=this._offset;this._nodeCache.location_path=this._nodeCache.location_path||{};var i=this._nodeCache.location_path[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null;if(l=this.__consume__location_step()){r.push(l),u+=l.textValue,f.head=l;for(var h=null,a=0,c=this._offset,_=[],p="",d=!0;d;)d=this.__consume__location_step(),d&&(_.push(d),p+=d.textValue,a-=1);if(0>=a){this._offset=c;var y=this.constructor.SyntaxNode,g=null;h=new y(p,this._offset,_),"object"==typeof g&&t(h,g),this._offset+=p.length}else h=null;h?(r.push(h),u+=h.textValue,f.rest=h):(r=null,this._offset=o)}else r=null,this._offset=o;if(r){this._offset=o;var m=this.constructor.SyntaxNode,v=e(this.constructor,"LocationPath");s=new m(u,this._offset,r,f),"object"==typeof v&&t(s,v),this._offset+=u.length}else s=null;return this._nodeCache.location_path[n]=s},__consume__location_step:function(){var s=null,n=this._offset;this._nodeCache.location_step=this._nodeCache.location_step||{};var i=this._nodeCache.location_step[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null,h=this._offset,a=null;if(a=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"/"===a){var c=this.constructor.SyntaxNode,_=null;l=new c("/",this._offset,[]),"object"==typeof _&&t(l,_),this._offset+=1}else{l=null;var p=null;p=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"/"'})}if(l);else{this._offset=h;var d=this.constructor.SyntaxNode,y=null;l=new d("",this._offset,[]),"object"==typeof y&&t(l,y),this._offset+=0}if(l){r.push(l),u+=l.textValue;var g=null,m=this._offset,v=this._offset,b=[],k={},x="",w=null;if(w=this.__consume__axis()){b.push(w),x+=w.textValue,k.axis=w;var S=null,N=this._offset;if(S=this.__consume__node_test());else{this._offset=N;var C=this.constructor.SyntaxNode,E=null;S=new C("",this._offset,[]),"object"==typeof E&&t(S,E),this._offset+=0}S?(b.push(S),x+=S.textValue,k.test=S):(b=null,this._offset=v)}else b=null,this._offset=v;if(b){this._offset=v;var P=this.constructor.SyntaxNode,T=null;g=new P(x,this._offset,b,k),"object"==typeof T&&t(g,T),this._offset+=x.length}else g=null;if(g);else{this._offset=m;var V=this._offset,j=[],X={},A="",R=null,Y=this._offset;if(R=this.__consume__axis());else{this._offset=Y;var O=this.constructor.SyntaxNode,I=null;R=new O("",this._offset,[]),"object"==typeof I&&t(R,I),this._offset+=0}if(R){j.push(R),A+=R.textValue,X.axis=R;var D=null;D=this.__consume__node_test(),D?(j.push(D),A+=D.textValue,X.test=D):(j=null,this._offset=V)}else j=null,this._offset=V;if(j){this._offset=V;var L=this.constructor.SyntaxNode,z=null;g=new L(A,this._offset,j,X),"object"==typeof z&&t(g,z),this._offset+=A.length}else g=null;g||(this._offset=m)}if(g){r.push(g),u+=g.textValue,f.selector=g;for(var W=null,F=0,M=this._offset,H=[],K="",U=!0;U;)U=this.__consume__node_predicate(),U&&(H.push(U),K+=U.textValue,F-=1);if(0>=F){this._offset=M;var B=this.constructor.SyntaxNode,q=null;W=new B(K,this._offset,H),"object"==typeof q&&t(W,q),this._offset+=K.length}else W=null;W?(r.push(W),u+=W.textValue,f.predicates=W):(r=null,this._offset=o)}else r=null,this._offset=o}else r=null,this._offset=o;if(r){this._offset=o;var Q=this.constructor.SyntaxNode,G=e(this.constructor,"LocationStep");s=new Q(u,this._offset,r,f),"object"==typeof G&&t(s,G),this._offset+=u.length}else s=null;return this._nodeCache.location_step[n]=s},__consume__axis:function(){var e=null,s=this._offset;this._nodeCache.axis=this._nodeCache.axis||{};var n=this._nodeCache.axis[s];if(n)return this._offset+=n.textValue.length,n;for(var i=this._offset,o=this._offset,r=[],f={},u="",l=null,h=1,a=this._offset,c=[],_="",p=!0;p;){var d=null;if(d=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,d&&/^[a-z\-]/.test(d)){var y=this.constructor.SyntaxNode,g=null;p=new y(d,this._offset,[]),"object"==typeof g&&t(p,g),this._offset+=1}else{p=null;var m=null;m=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[a-z\\-]"})}p&&(c.push(p),_+=p.textValue,h-=1)}if(0>=h){this._offset=a;var v=this.constructor.SyntaxNode,b=null;l=new v(_,this._offset,c),"object"==typeof b&&t(l,b),this._offset+=_.length}else l=null;if(l){r.push(l),u+=l.textValue,f.axis_name=l;var k=null,x=null;if(x=this._input.length>this._offset?this._input.substring(this._offset,this._offset+2):null,"::"===x){var w=this.constructor.SyntaxNode,S=null;k=new w("::",this._offset,[]),"object"==typeof S&&t(k,S),this._offset+=2}else{k=null;var N=null;N=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"::"'})}k?(r.push(k),u+=k.textValue):(r=null,this._offset=o)}else r=null,this._offset=o;if(r){this._offset=o;var C=this.constructor.SyntaxNode,E=null;e=new C(u,this._offset,r,f),"object"==typeof E&&t(e,E),this._offset+=u.length}else e=null;return e||(this._offset=i,e=this.__consume__axis_shorthand(),e||(this._offset=i)),this._nodeCache.axis[s]=e},__consume__axis_shorthand:function(){var e=null,s=this._offset;this._nodeCache.axis_shorthand=this._nodeCache.axis_shorthand||{};var n=this._nodeCache.axis_shorthand[s];if(n)return this._offset+=n.textValue.length,n;var i=this._offset,o=null;if(o=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"@"===o){var r=this.constructor.SyntaxNode,f=null;e=new r("@",this._offset,[]),"object"==typeof f&&t(e,f),this._offset+=1}else{e=null;var u=null;u=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"@"'})}if(e);else{this._offset=i;var l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+2):null,".."===l){var h=this.constructor.SyntaxNode,a=null;e=new h("..",this._offset,[]),"object"==typeof a&&t(e,a),this._offset+=2}else{e=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'".."'})}if(e);else{this._offset=i;var _=null;if(_=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"."===_){var p=this.constructor.SyntaxNode,d=null;e=new p(".",this._offset,[]),"object"==typeof d&&t(e,d),this._offset+=1}else{e=null;var y=null;y=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"."'})}if(e);else{this._offset=i;var g=null;if(g=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"/"===g){var m=this.constructor.SyntaxNode,v=null;e=new m("/",this._offset,[]),"object"==typeof v&&t(e,v),this._offset+=1}else{e=null;var b=null;b=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"/"'})}e||(this._offset=i)}}}return this._nodeCache.axis_shorthand[s]=e},__consume__node_test:function(){var s=null,n=this._offset;this._nodeCache.node_test=this._nodeCache.node_test||{};var i=this._nodeCache.node_test[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null,h=this._offset;if(l=this.__consume__node_condition());else if(this._offset=h,l=this.__consume__node_name());else{this._offset=h;var a=null;if(a=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"*"===a){var c=this.constructor.SyntaxNode,_=null;l=new c("*",this._offset,[]),"object"==typeof _&&t(l,_),this._offset+=1}else{l=null;var p=null;p=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"*"'})}l||(this._offset=h)}if(l){r.push(l),u+=l.textValue;var d=null,y=this._offset;if(d=this.__consume__subscript());else{this._offset=y;var g=this.constructor.SyntaxNode,m=null;d=new g("",this._offset,[]),"object"==typeof m&&t(d,m),this._offset+=0}d?(r.push(d),u+=d.textValue,f.subscript=d):(r=null,this._offset=o)}else r=null,this._offset=o;if(r){this._offset=o;var v=this.constructor.SyntaxNode,b=e(this.constructor,"NodeTest");s=new v(u,this._offset,r,f),"object"==typeof b&&t(s,b),this._offset+=u.length}else s=null;return this._nodeCache.node_test[n]=s},__consume__node_condition:function(){var e=null,s=this._offset;this._nodeCache.node_condition=this._nodeCache.node_condition||{};var n=this._nodeCache.node_condition[s];if(n)return this._offset+=n.textValue.length,n;for(var i=this._offset,o=[],r={},f="",u=null,l=1,h=this._offset,a=[],c="",_=!0;_;){var p=null;if(p=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,p&&/^[a-z\-]/.test(p)){var d=this.constructor.SyntaxNode,y=null;_=new d(p,this._offset,[]),"object"==typeof y&&t(_,y),this._offset+=1}else{_=null;var g=null;g=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[a-z\\-]"})}_&&(a.push(_),c+=_.textValue,l-=1)}if(0>=l){this._offset=h;var m=this.constructor.SyntaxNode,v=null;u=new m(c,this._offset,a),"object"==typeof v&&t(u,v),this._offset+=c.length}else u=null;if(u){o.push(u),f+=u.textValue,r.condition_name=u;var b=null,k=null;if(k=this._input.length>this._offset?this._input.substring(this._offset,this._offset+2):null,"()"===k){var x=this.constructor.SyntaxNode,w=null;b=new x("()",this._offset,[]),"object"==typeof w&&t(b,w),this._offset+=2}else{b=null;var S=null;S=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"()"'})}b?(o.push(b),f+=b.textValue):(o=null,this._offset=i)}else o=null,this._offset=i;if(o){this._offset=i;var N=this.constructor.SyntaxNode,C=null;e=new N(f,this._offset,o,r),"object"==typeof C&&t(e,C),this._offset+=f.length}else e=null;return this._nodeCache.node_condition[s]=e},__consume__node_name:function(){var e=null,s=this._offset;this._nodeCache.node_name=this._nodeCache.node_name||{};var n=this._nodeCache.node_name[s];if(n)return this._offset+=n.textValue.length,n;for(var i=1,o=this._offset,r=[],f="",u=!0;u;){var l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,l&&/^[A-Za-z0-9\-]/.test(l)){var h=this.constructor.SyntaxNode,a=null;u=new h(l,this._offset,[]),"object"==typeof a&&t(u,a),this._offset+=1}else{u=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[A-Za-z0-9\\-]"})}u&&(r.push(u),f+=u.textValue,i-=1)}if(0>=i){this._offset=o;var _=this.constructor.SyntaxNode,p=null;e=new _(f,this._offset,r),"object"==typeof p&&t(e,p),this._offset+=f.length}else e=null;return this._nodeCache.node_name[s]=e},__consume__subscript:function(){var e=null,s=this._offset;this._nodeCache.subscript=this._nodeCache.subscript||{};var n=this._nodeCache.subscript[s];if(n)return this._offset+=n.textValue.length,n;var i=this._offset,o=[],r={},f="",u=null,l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"["===l){var h=this.constructor.SyntaxNode,a=null;u=new h("[",this._offset,[]),"object"==typeof a&&t(u,a),this._offset+=1}else{u=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"["'})}if(u){o.push(u),f+=u.textValue;var _=null;if(_=this.__consume__space()){o.push(_),f+=_.textValue,r.space=_;var p=null;if(p=this.__consume__integer()){o.push(p),f+=p.textValue,r.integer=p;var d=null;if(d=this.__consume__space()){o.push(d),f+=d.textValue,r.space=d;var y=null,g=null;if(g=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"]"===g){var m=this.constructor.SyntaxNode,v=null;y=new m("]",this._offset,[]),"object"==typeof v&&t(y,v),this._offset+=1}else{y=null;var b=null;b=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"]"'})}y?(o.push(y),f+=y.textValue):(o=null,this._offset=i)}else o=null,this._offset=i}else o=null,this._offset=i}else o=null,this._offset=i}else o=null,this._offset=i;if(o){this._offset=i;var k=this.constructor.SyntaxNode,x=null;e=new k(f,this._offset,o,r),"object"==typeof x&&t(e,x),this._offset+=f.length}else e=null;return this._nodeCache.subscript[s]=e},__consume__node_predicate:function(){var e=null,s=this._offset;this._nodeCache.node_predicate=this._nodeCache.node_predicate||{};var n=this._nodeCache.node_predicate[s];if(n)return this._offset+=n.textValue.length,n;var i=this._offset,o=[],r={},f="",u=null,l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"["===l){var h=this.constructor.SyntaxNode,a=null;u=new h("[",this._offset,[]),"object"==typeof a&&t(u,a),this._offset+=1}else{u=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"["'})}if(u){o.push(u),f+=u.textValue;var _=null;if(_=this.__consume__expression()){o.push(_),f+=_.textValue,r.expression=_;var p=null,d=null;if(d=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"]"===d){var y=this.constructor.SyntaxNode,g=null;p=new y("]",this._offset,[]),"object"==typeof g&&t(p,g),this._offset+=1}else{p=null;var m=null;m=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"]"'})}if(p){o.push(p),f+=p.textValue;var v=null,b=this._offset;if(v=this.__consume__subscript());else{this._offset=b;var k=this.constructor.SyntaxNode,x=null;v=new k("",this._offset,[]),"object"==typeof x&&t(v,x),this._offset+=0}v?(o.push(v),f+=v.textValue,r.subscript=v):(o=null,this._offset=i)}else o=null,this._offset=i}else o=null,this._offset=i}else o=null,this._offset=i;if(o){this._offset=i;var w=this.constructor.SyntaxNode,S=null;e=new w(f,this._offset,o,r),"object"==typeof S&&t(e,S),this._offset+=f.length}else e=null;return this._nodeCache.node_predicate[s]=e},__consume__expression:function(){var t=null,e=this._offset;this._nodeCache.expression=this._nodeCache.expression||{};var s=this._nodeCache.expression[e];if(s)return this._offset+=s.textValue.length,s;var n=this._offset;return t=this.__consume__or_expression(),t||(this._offset=n,t=this.__consume__and_expression(),t||(this._offset=n,t=this.__consume__comparison(),t||(this._offset=n,t=this.__consume__atom(),t||(this._offset=n)))),this._nodeCache.expression[e]=t},__consume__or_expression:function(){var s=null,n=this._offset;this._nodeCache.or_expression=this._nodeCache.or_expression||{};var i=this._nodeCache.or_expression[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=this._offset,f=[],u={},l="",h=null;if(h=this.__consume__and_expression()){f.push(h),l+=h.textValue,u.left=h;var a=null,c=null;if(c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+2):null,"or"===c){var _=this.constructor.SyntaxNode,p=null;a=new _("or",this._offset,[]),"object"==typeof p&&t(a,p),this._offset+=2}else{a=null;var d=null;d=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"or"'})}if(a){f.push(a),l+=a.textValue;var y=null;y=this.__consume__or_expression(),y?(f.push(y),l+=y.textValue,u.right=y):(f=null,this._offset=r)}else f=null,this._offset=r}else f=null,this._offset=r;if(f){this._offset=r;var g=this.constructor.SyntaxNode,m=e(this.constructor,"Or");s=new g(l,this._offset,f,u),"object"==typeof m&&t(s,m),this._offset+=l.length}else s=null;return s||(this._offset=o,s=this.__consume__and_expression(),s||(this._offset=o)),this._nodeCache.or_expression[n]=s},__consume__and_expression:function(){var s=null,n=this._offset;this._nodeCache.and_expression=this._nodeCache.and_expression||{};var i=this._nodeCache.and_expression[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=this._offset,f=[],u={},l="",h=null;if(h=this.__consume__comparison()){f.push(h),l+=h.textValue,u.left=h;var a=null,c=null;if(c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+3):null,"and"===c){var _=this.constructor.SyntaxNode,p=null;a=new _("and",this._offset,[]),"object"==typeof p&&t(a,p),this._offset+=3}else{a=null;var d=null;d=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"and"'})}if(a){f.push(a),l+=a.textValue;var y=null;y=this.__consume__and_expression(),y?(f.push(y),l+=y.textValue,u.right=y):(f=null,this._offset=r)}else f=null,this._offset=r}else f=null,this._offset=r;if(f){this._offset=r;var g=this.constructor.SyntaxNode,m=e(this.constructor,"And");s=new g(l,this._offset,f,u),"object"==typeof m&&t(s,m),this._offset+=l.length}else s=null;return s||(this._offset=o,s=this.__consume__comparison(),s||(this._offset=o)),this._nodeCache.and_expression[n]=s},__consume__comparison:function(){var s=null,n=this._offset;this._nodeCache.comparison=this._nodeCache.comparison||{};var i=this._nodeCache.comparison[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=this._offset,f=[],u={},l="",h=null;if(h=this.__consume__atom()){f.push(h),l+=h.textValue,u.left=h;var a=null;if(a=this.__consume__comparator()){f.push(a),l+=a.textValue,u.comparator=a;var c=null;c=this.__consume__comparison(),c?(f.push(c),l+=c.textValue,u.right=c):(f=null,this._offset=r)}else f=null,this._offset=r}else f=null,this._offset=r;if(f){this._offset=r;var _=this.constructor.SyntaxNode,p=e(this.constructor,"Comparison");s=new _(l,this._offset,f,u),"object"==typeof p&&t(s,p),this._offset+=l.length}else s=null;return s||(this._offset=o,s=this.__consume__atom(),s||(this._offset=o)),this._nodeCache.comparison[n]=s},__consume__comparator:function(){var e=null,s=this._offset;this._nodeCache.comparator=this._nodeCache.comparator||{};var n=this._nodeCache.comparator[s];if(n)return this._offset+=n.textValue.length,n;var i=this._offset,o=null;if(o=this._input.length>this._offset?this._input.substring(this._offset,this._offset+2):null,"!="===o){var r=this.constructor.SyntaxNode,f=null;e=new r("!=",this._offset,[]),"object"==typeof f&&t(e,f),this._offset+=2}else{e=null;var u=null;u=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"!="'})}if(e);else{this._offset=i;var l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"="===l){var h=this.constructor.SyntaxNode,a=null;e=new h("=",this._offset,[]),"object"==typeof a&&t(e,a),this._offset+=1}else{e=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"="'})}e||(this._offset=i)}return this._nodeCache.comparator[s]=e},__consume__atom:function(){var s=null,n=this._offset;this._nodeCache.atom=this._nodeCache.atom||{};var i=this._nodeCache.atom[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null;if(l=this.__consume__space()){r.push(l),u+=l.textValue,f.space=l;var h=null,a=this._offset,c=this._offset,_=[],p={},d="",y=null,g=null;if(g=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"("===g){var m=this.constructor.SyntaxNode,v=null;y=new m("(",this._offset,[]),"object"==typeof v&&t(y,v),this._offset+=1}else{y=null;var b=null;b=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"("'})}if(y){_.push(y),d+=y.textValue;var k=null;if(k=this.__consume__expression()){_.push(k),d+=k.textValue,p.in_parens=k;var x=null,w=null;if(w=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,")"===w){var S=this.constructor.SyntaxNode,N=null;x=new S(")",this._offset,[]),"object"==typeof N&&t(x,N),this._offset+=1}else{x=null;var C=null;C=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'")"'})}x?(_.push(x),d+=x.textValue):(_=null,this._offset=c)}else _=null,this._offset=c}else _=null,this._offset=c;if(_){this._offset=c;var E=this.constructor.SyntaxNode,P=null;h=new E(d,this._offset,_,p),"object"==typeof P&&t(h,P),this._offset+=d.length}else h=null;if(h||(this._offset=a,h=this.__consume__value(),h||(this._offset=a)),h){r.push(h),u+=h.textValue,f.expression=h;var T=null;T=this.__consume__space(),T?(r.push(T),u+=T.textValue,f.space=T):(r=null,this._offset=o)}else r=null,this._offset=o}else r=null,this._offset=o;if(r){this._offset=o;var V=this.constructor.SyntaxNode,j=e(this.constructor,"Atom");s=new V(u,this._offset,r,f),"object"==typeof j&&t(s,j),this._offset+=u.length}else s=null;return this._nodeCache.atom[n]=s},__consume__value:function(){var t=null,e=this._offset;this._nodeCache.value=this._nodeCache.value||{};var s=this._nodeCache.value[e];if(s)return this._offset+=s.textValue.length,s;var n=this._offset;return t=this.__consume__function_call(),t||(this._offset=n,t=this.__consume__string(),t||(this._offset=n,t=this.__consume__union_expression(),t||(this._offset=n))),this._nodeCache.value[e]=t},__consume__function_call:function(){var s=null,n=this._offset;this._nodeCache.function_call=this._nodeCache.function_call||{};var i=this._nodeCache.function_call[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null;if(l=this.__consume__function_name()){r.push(l),u+=l.textValue,f.function_name=l;var h=null,a=null;if(a=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"("===a){var c=this.constructor.SyntaxNode,_=null;h=new c("(",this._offset,[]),"object"==typeof _&&t(h,_),this._offset+=1}else{h=null;var p=null;p=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"("'})}if(h){r.push(h),u+=h.textValue;var d=null;if(d=this.__consume__function_args()){r.push(d),u+=d.textValue,f.function_args=d;var y=null,g=null;if(g=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,")"===g){var m=this.constructor.SyntaxNode,v=null;y=new m(")",this._offset,[]),"object"==typeof v&&t(y,v),this._offset+=1}else{y=null;var b=null;b=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'")"'})}y?(r.push(y),u+=y.textValue):(r=null,this._offset=o)}else r=null,this._offset=o}else r=null,this._offset=o}else r=null,this._offset=o;if(r){this._offset=o;var k=this.constructor.SyntaxNode,x=e(this.constructor,"FunctionCall");s=new k(u,this._offset,r,f),"object"==typeof x&&t(s,x),this._offset+=u.length}else s=null;return this._nodeCache.function_call[n]=s},__consume__function_name:function(){var e=null,s=this._offset;this._nodeCache.function_name=this._nodeCache.function_name||{};var n=this._nodeCache.function_name[s];if(n)return this._offset+=n.textValue.length,n;for(var i=1,o=this._offset,r=[],f="",u=!0;u;){var l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,l&&/^[a-z\-]/.test(l)){var h=this.constructor.SyntaxNode,a=null;u=new h(l,this._offset,[]),"object"==typeof a&&t(u,a),this._offset+=1}else{u=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[a-z\\-]"})}u&&(r.push(u),f+=u.textValue,i-=1)}if(0>=i){this._offset=o;var _=this.constructor.SyntaxNode,p=null;e=new _(f,this._offset,r),"object"==typeof p&&t(e,p),this._offset+=f.length}else e=null;return this._nodeCache.function_name[s]=e},__consume__function_args:function(){var e=null,s=this._offset;this._nodeCache.function_args=this._nodeCache.function_args||{};var n=this._nodeCache.function_args[s];if(n)return this._offset+=n.textValue.length,n;var i=this._offset,o=this._offset,r=[],f={},u="",l=null;if(l=this.__consume__expression()){r.push(l),u+=l.textValue,f.first=l;for(var h=null,a=0,c=this._offset,_=[],p="",d=!0;d;){var y=this._offset,g=[],m={},v="",b=null,k=null;if(k=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,","===k){var x=this.constructor.SyntaxNode,w=null;b=new x(",",this._offset,[]),"object"==typeof w&&t(b,w),this._offset+=1}else{b=null;var S=null;S=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'","'})}if(b){g.push(b),v+=b.textValue;var N=null;N=this.__consume__expression(),N?(g.push(N),v+=N.textValue,m.expression=N):(g=null,this._offset=y)}else g=null,this._offset=y;if(g){this._offset=y;var C=this.constructor.SyntaxNode,E=null;d=new C(v,this._offset,g,m),"object"==typeof E&&t(d,E),this._offset+=v.length}else d=null;d&&(_.push(d),p+=d.textValue,a-=1)}if(0>=a){this._offset=c;var P=this.constructor.SyntaxNode,T=null;h=new P(p,this._offset,_),"object"==typeof T&&t(h,T),this._offset+=p.length}else h=null;h?(r.push(h),u+=h.textValue,f.rest=h):(r=null,this._offset=o)}else r=null,this._offset=o;if(r){this._offset=o;
|
2
|
+
var V=this.constructor.SyntaxNode,j=null;e=new V(u,this._offset,r,f),"object"==typeof j&&t(e,j),this._offset+=u.length}else e=null;if(e);else{this._offset=i;var X=this.constructor.SyntaxNode,A=null;e=new X("",this._offset,[]),"object"==typeof A&&t(e,A),this._offset+=0}return this._nodeCache.function_args[s]=e},__consume__integer:function(){var s=null,n=this._offset;this._nodeCache.integer=this._nodeCache.integer||{};var i=this._nodeCache.integer[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=[],f={},u="",l=null,h=null;if(h=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,h&&/^[1-9]/.test(h)){var a=this.constructor.SyntaxNode,c=null;l=new a(h,this._offset,[]),"object"==typeof c&&t(l,c),this._offset+=1}else{l=null;var _=null;_=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[1-9]"})}if(l){r.push(l),u+=l.textValue;for(var p=null,d=0,y=this._offset,g=[],m="",v=!0;v;){var b=null;if(b=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,b&&/^[0-9]/.test(b)){var k=this.constructor.SyntaxNode,x=null;v=new k(b,this._offset,[]),"object"==typeof x&&t(v,x),this._offset+=1}else{v=null;var w=null;w=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[0-9]"})}v&&(g.push(v),m+=v.textValue,d-=1)}if(0>=d){this._offset=y;var S=this.constructor.SyntaxNode,N=null;p=new S(m,this._offset,g),"object"==typeof N&&t(p,N),this._offset+=m.length}else p=null;p?(r.push(p),u+=p.textValue):(r=null,this._offset=o)}else r=null,this._offset=o;if(r){this._offset=o;var C=this.constructor.SyntaxNode,E=e(this.constructor,"Integer");s=new C(u,this._offset,r,f),"object"==typeof E&&t(s,E),this._offset+=u.length}else s=null;return this._nodeCache.integer[n]=s},__consume__string:function(){var s=null,n=this._offset;this._nodeCache.string=this._nodeCache.string||{};var i=this._nodeCache.string[n];if(i)return this._offset+=i.textValue.length,i;var o=this._offset,r=this._offset,f=[],u={},l="",h=null,a=null;if(a=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"'"===a){var c=this.constructor.SyntaxNode,_=null;h=new c("'",this._offset,[]),"object"==typeof _&&t(h,_),this._offset+=1}else{h=null;var p=null;p=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"\'"'})}if(h){f.push(h),l+=h.textValue;for(var d=null,y=0,g=this._offset,m=[],v="",b=!0;b;){var k=this._offset,x=this._offset,w=[],S={},N="",C=null,E=null;if(E=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"\\"===E){var P=this.constructor.SyntaxNode,T=null;C=new P("\\",this._offset,[]),"object"==typeof T&&t(C,T),this._offset+=1}else{C=null;var V=null;V=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"\\\\"'})}if(C){w.push(C),N+=C.textValue;var j=null,X=null;X=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null;var A=X;if(null===A){j=null;var R=null;R=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"<any char>"})}else{var Y=this.constructor.SyntaxNode,O=null;j=new Y(A,this._offset,[]),"object"==typeof O&&t(j,O),this._offset+=1}j?(w.push(j),N+=j.textValue):(w=null,this._offset=x)}else w=null,this._offset=x;if(w){this._offset=x;var I=this.constructor.SyntaxNode,D=null;b=new I(N,this._offset,w,S),"object"==typeof D&&t(b,D),this._offset+=N.length}else b=null;if(b);else{this._offset=k;var L=null;if(L=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,L&&/^[^']/.test(L)){var z=this.constructor.SyntaxNode,W=null;b=new z(L,this._offset,[]),"object"==typeof W&&t(b,W),this._offset+=1}else{b=null;var F=null;F=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[^']"})}b||(this._offset=k)}b&&(m.push(b),v+=b.textValue,y-=1)}if(0>=y){this._offset=g;var M=this.constructor.SyntaxNode,H=null;d=new M(v,this._offset,m),"object"==typeof H&&t(d,H),this._offset+=v.length}else d=null;if(d){f.push(d),l+=d.textValue;var K=null,U=null;if(U=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"'"===U){var B=this.constructor.SyntaxNode,q=null;K=new B("'",this._offset,[]),"object"==typeof q&&t(K,q),this._offset+=1}else{K=null;var Q=null;Q=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"\'"'})}K?(f.push(K),l+=K.textValue):(f=null,this._offset=r)}else f=null,this._offset=r}else f=null,this._offset=r;if(f){this._offset=r;var G=this.constructor.SyntaxNode,J=null;s=new G(l,this._offset,f,u),"object"==typeof J&&t(s,J),this._offset+=l.length}else s=null;if(s){var $=e(this.constructor,"String");"object"==typeof $&&t(s,$)}else{this._offset=o;var Z=this._offset,te=[],ee={},se="",ne=null,ie=null;if(ie=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,'"'===ie){var oe=this.constructor.SyntaxNode,re=null;ne=new oe('"',this._offset,[]),"object"==typeof re&&t(ne,re),this._offset+=1}else{ne=null;var fe=null;fe=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"\\""'})}if(ne){te.push(ne),se+=ne.textValue;for(var ue=null,le=0,he=this._offset,ae=[],ce="",_e=!0;_e;){var pe=this._offset,de=this._offset,ye=[],ge={},me="",ve=null,be=null;if(be=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,"\\"===be){var ke=this.constructor.SyntaxNode,xe=null;ve=new ke("\\",this._offset,[]),"object"==typeof xe&&t(ve,xe),this._offset+=1}else{ve=null;var we=null;we=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"\\\\"'})}if(ve){ye.push(ve),me+=ve.textValue;var Se=null,Ne=null;Ne=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null;var Ce=Ne;if(null===Ce){Se=null;var Ee=null;Ee=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"<any char>"})}else{var Pe=this.constructor.SyntaxNode,Te=null;Se=new Pe(Ce,this._offset,[]),"object"==typeof Te&&t(Se,Te),this._offset+=1}Se?(ye.push(Se),me+=Se.textValue):(ye=null,this._offset=de)}else ye=null,this._offset=de;if(ye){this._offset=de;var Ve=this.constructor.SyntaxNode,je=null;_e=new Ve(me,this._offset,ye,ge),"object"==typeof je&&t(_e,je),this._offset+=me.length}else _e=null;if(_e);else{this._offset=pe;var Xe=null;if(Xe=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,Xe&&/^[^"]/.test(Xe)){var Ae=this.constructor.SyntaxNode,Re=null;_e=new Ae(Xe,this._offset,[]),"object"==typeof Re&&t(_e,Re),this._offset+=1}else{_e=null;var Ye=null;Ye=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'[^"]'})}_e||(this._offset=pe)}_e&&(ae.push(_e),ce+=_e.textValue,le-=1)}if(0>=le){this._offset=he;var Oe=this.constructor.SyntaxNode,Ie=null;ue=new Oe(ce,this._offset,ae),"object"==typeof Ie&&t(ue,Ie),this._offset+=ce.length}else ue=null;if(ue){te.push(ue),se+=ue.textValue;var De=null,Le=null;if(Le=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,'"'===Le){var ze=this.constructor.SyntaxNode,We=null;De=new ze('"',this._offset,[]),"object"==typeof We&&t(De,We),this._offset+=1}else{De=null;var Fe=null;Fe=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'"\\""'})}De?(te.push(De),se+=De.textValue):(te=null,this._offset=Z)}else te=null,this._offset=Z}else te=null,this._offset=Z;if(te){this._offset=Z;var Me=this.constructor.SyntaxNode,He=null;s=new Me(se,this._offset,te,ee),"object"==typeof He&&t(s,He),this._offset+=se.length}else s=null;if(s){var Ke=e(this.constructor,"String");"object"==typeof Ke&&t(s,Ke)}else this._offset=o}return this._nodeCache.string[n]=s},__consume__space:function(){var e=null,s=this._offset;this._nodeCache.space=this._nodeCache.space||{};var n=this._nodeCache.space[s];if(n)return this._offset+=n.textValue.length,n;for(var i=0,o=this._offset,r=[],f="",u=!0;u;){var l=null;if(l=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null," "===l){var h=this.constructor.SyntaxNode,a=null;u=new h(" ",this._offset,[]),"object"==typeof a&&t(u,a),this._offset+=1}else{u=null;var c=null;c=this._input.length>this._offset?this._input.substring(this._offset,this._offset+1):null,(!this.error||this.error.offset<=this._offset)&&(this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:'" "'})}u&&(r.push(u),f+=u.textValue,i-=1)}if(0>=i){this._offset=o;var _=this.constructor.SyntaxNode,p=null;e=new _(f,this._offset,r),"object"==typeof p&&t(e,p),this._offset+=f.length}else e=null;return this._nodeCache.space[s]=e}},i=function(t){this._input=t,this._offset=0,this._nodeCache={}};i.prototype.parse=function(){var t=this.__consume__union_expression();if(t&&this._offset===this._input.length)return t;this.error||(this.error={input:this._input,offset:this._offset,expected:"<EOF>"});var e=s(this.error),n=new Error(e);throw n},i.parse=function(t){var e=new i(t);return e.parse()},t(i.prototype,n);var o=function(t,e,s,n){if(this.textValue=t,this.offset=e,this.elements=s||[],n)for(var i in n)this[i]=n[i]};if(o.prototype.forEach=function(t,e){for(var s=0,n=this.elements.length;n>s;s++)t.call(e,this.elements[s],s)},i.SyntaxNode=o,"function"==typeof require&&"object"==typeof exports)exports.Grammar=n,exports.Parser=i,exports.parse=i.parse,"undefined"!=typeof Pathology&&(Pathology.XPath=n,Pathology.XPathParser=i,Pathology.XPathParser.formatError=s);else{var r=this;r=r.Pathology=r.Pathology||{},Pathology.XPath=n,Pathology.XPathParser=i,Pathology.XPathParser.formatError=s}}(),Pathology.XPathParser.And={evaluate:function(t,e){return Pathology.atomize(this.left,t,e)&&Pathology.atomize(this.right,t,e)}},Pathology.XPathParser.Atom={evaluate:function(t,e){var s=this.expression.in_parens||this.expression;return s.evaluate(t,e)}},Pathology.Axis=function(t){this.name=t},Pathology.Axis.prototype.walk=function(t,e,s){var n,i=t.childNodes,o=Pathology.array(t.attributes);switch(t.checked&&o.push({nodeName:"checked",nodeValue:!0,nodeType:XPathResult.STRING_TYPE}),t.selected&&o.push({nodeName:"selected",nodeValue:!0,nodeType:XPathResult.STRING_TYPE}),this.name){case"attribute":for(var r=0,f=o.length;f>r;r++)e.call(s,o[r]);break;case"child":for(var r=0,f=i.length;f>r;r++)e.call(s,i[r]);break;case"descendant-or-self":e.call(s,t);for(var r=0,f=i.length;f>r;r++)this.walk(i[r],e,s);break;case"following-sibling":for(n=t.nextSibling;n;)e.call(s,n),n=n.nextSibling;break;case"parent":e.call(s,t.parentNode);break;case"self":e.call(s,t)}},Pathology.Axis.SHORTHANDS={"@":"attribute","..":"parent",".":"self","/":"descendant-or-self","":"child"},Pathology.Axis.fromAST=function(t){var e=t.axis_name?t.axis_name.textValue:t.textValue;return new this(this.SHORTHANDS[e]||e)},Pathology.XPathParser.Comparison={evaluate:function(t,e){var s,n=this.comparator.textValue,i=this.left.evaluate(t,e),o=Pathology.atomize(this.right,t,e),r=!1,f=o instanceof Array;if(i._nodes){for(var u=0,l=i._nodes.length;l>u;u++)s=i._nodes[u],"="===n?r=r||(f?Pathology.indexOf(o,s.nodeValue)>=0:s.nodeValue===o||s.innerHTML===o):"!="===n&&(r=r||(f?Pathology.indexOf(o,s.nodeValue)<0:s.nodeValue!==o&&s.innerHTML!==o));return r}switch(n){case"=":return f?Pathology.indexOf(o,i.nodeValue)>=0:i==o;case"!=":return f?Pathology.indexOf(o,s.nodeValue)<0:i!=o}}},Pathology.XPathParser.FunctionCall={getArguments:function(t,e){var s=[],n=this.function_args.rest;if(this.function_args.first&&this.function_args.first.evaluate&&s.push(this.function_args.first.evaluate(t,e)),n)for(var i=0,o=n.elements.length;o>i;i++)s.push(n.elements[i].expression.evaluate(t,e));return s},evaluate:function(t,e){var s=this.getArguments(t,e),n=this.REGISTER[this.function_name.textValue];return n.apply(t,s)},REGISTER:{concat:function(){for(var t="",e=0,s=arguments.length;s>e;e++)t+=arguments[e].makeString?arguments[e].makeString():arguments[e];return t},contains:function(t,e){return t?(t.makeString&&(t=t.makeString()),t.toString().indexOf(e)>=0):!1},"normalize-space":function(t){return t.makeString&&(t=t.makeString()),t.toString().replace(/^\s*/g,"").replace(/\s*$/g,"").replace(/\s+/g," ")},name:function(){return this.nodeName.toLowerCase()},not:function(t){return t&&t.atomize&&(t=t.atomize()),"string"==typeof t?!1:!t},string:function(t){return t.atomize().innerText},text:function(){return document.evaluate("/text()",this,null,XPathResult.ANY_TYPE,null)}}},Pathology.XPathParser.LocationPath={eachStep:function(t,e){for(var s=[this.head].concat(this.rest.elements),n=0,i=s.length;i>n;n++)t.call(e,s[n])},evaluate:function(t,e,s,n){n=n||new Pathology.XPathResult(XPathResult.ANY_TYPE),s=s||XPathResult.ANY_TYPE;var i,o,r,f,u,l,h=new Pathology.XPathResult(s),a=this.head.isRelative()?t:e,c=[this.head].concat(this.rest.elements);for(h.push(a),r=0,u=c.length;u>r;r++){for(i=c[r],o=new Pathology.XPathResult(s),f=0,l=h._nodes.length;l>f;f++)i.evaluate(h._nodes[f],e,s,o);h=o}for(r=0,u=h._nodes.length;u>r;r++)n.push(h._nodes[r]);return n}},Pathology.XPathParser.LocationStep={isRelative:function(){return"/"!==this.elements[0].textValue},evaluate:function(t,e,s,n){var i=this.selector.axis,o=this.selector.test,r=[[]];Pathology.Axis.fromAST(i).walk(t,function(t){return o&&o.evaluate?(o.evaluate(t,this.predicates,e,s,r,n),void 0):n.push(t)},this)}},Pathology.XPathParser.NodeTest={evaluate:function(t,e,s,n,i,o){var r=this.elements[0].condition_name,f=f=this.elements[0].textValue.toLowerCase(),u={expression:{evaluate:function(){if(r&&"node"===r.textValue)return!0;if(r&&"text"===r.textValue){if(t.nodeType!==XPathResult.BOOLEAN_TYPE)return!1}else if("*"===f){if(1!==t.nodeType)return!1}else{if(!t.nodeName)return!1;if(t.nodeName.toLowerCase()!==f)return!1}return!0}},subscript:this.subscript};e=[u].concat(e.elements);for(var l,h,a=0,c=e.length;c>a;a++){if(i[a]=i[a]||[],h=e[a],l=Pathology.atomize(h.expression,t,s),"string"==typeof l&&(l=!0),!l)return;if(i[a].push(t),h.subscript.integer&&h.subscript.integer.evaluate()!==i[a].length)return}o.push(t)}},Pathology.XPathParser.Or={evaluate:function(t,e){return Pathology.atomize(this.left,t,e)||Pathology.atomize(this.right,t,e)}},Pathology.XPathParser.Integer={evaluate:function(){return parseInt(this.textValue,10)}},Pathology.XPathParser.String={evaluate:function(context,root){return eval(this.textValue)}},Pathology.XPathParser.Union={evaluate:function(t,e,s,n){n=n||new Pathology.XPathResult(XPathResult.ANY_TYPE),s=s||XPathResult.ANY_TYPE,this.head.evaluate(t,e,s,n);for(var i=this.rest.elements,o=0,r=i.length;r>o;o++)i[o].location_path.evaluate(t,e,s,n);return n}},function(){var t,e,s,n=function(t,e){var s;for(s in e)t[s]=e[s];return t},i={msie:!(!window.attachEvent||window.opera),opera:!!window.opera,webkit:navigator.userAgent.indexOf("AppleWebKit/")>-1,safari:navigator.userAgent.indexOf("AppleWebKit/")>-1&&-1===navigator.userAgent.indexOf("Chrome/"),gecko:navigator.userAgent.indexOf("Gecko")>-1,mobilesafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/),rhino:navigator.userAgent.match(/Rhino/)&&!0},o=function(t,e,s){var i=s.ownerDocument.createEventObject();return n(i,e)},r={},f=1,u="_synthetic"+(new Date).getTime(),l=/keypress|keyup|keydown/,h=/load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll/,a=function(t,e,s,n){return new a.init(t,e,s,n)};t=function(t,e,s){return t.addEventListener?t.addEventListener(e,s,!1):t.attachEvent("on"+e,s)},e=function(t,e,s){return t.addEventListener?t.removeEventListener(e,s,!1):t.detachEvent("on"+e,s)},n(a,{init:function(t,e,s,n){var i=a.args(e,s,n),o=this;this.queue=[],this.element=i.element,"function"==typeof this[t]?this[t](i.options,i.element,function(){i.callback&&i.callback.apply(o,arguments),o.done.apply(o,arguments)}):(this.result=a.trigger(t,i.options,i.element),i.callback&&i.callback.call(this,i.element,this.result))},jquery:function(t){return window.FuncUnit&&window.FuncUnit.jQuery?window.FuncUnit.jQuery:t?a.helpers.getWindow(t).jQuery||window.jQuery:window.jQuery},args:function(){for(var t={},e=0;e<arguments.length;e++)"function"==typeof arguments[e]?t.callback=arguments[e]:arguments[e]&&arguments[e].jquery?t.element=arguments[e][0]:arguments[e]&&arguments[e].nodeName?t.element=arguments[e]:t.options&&"string"==typeof arguments[e]?t.element=document.getElementById(arguments[e]):arguments[e]&&(t.options=arguments[e]);return t},click:function(t,e,s){a("click!",t,e,s)},defaults:{focus:function(){if(!a.support.focusChanges){var s=this,n=s.nodeName.toLowerCase();a.data(s,"syntheticvalue",s.value),("input"===n||"textarea"===n)&&t(s,"blur",function(){a.data(s,"syntheticvalue")!=s.value&&a.trigger("change",{},s),e(s,"blur",arguments.callee)})}},submit:function(){a.onParents(this,function(t){return"form"===t.nodeName.toLowerCase()?(t.submit(),!1):void 0})}},changeOnBlur:function(s,n,i){t(s,"blur",function(){i!==s[n]&&a.trigger("change",{},s),e(s,"blur",arguments.callee)})},closest:function(t,e){for(;t&&t.nodeName.toLowerCase()!==e.toLowerCase();)t=t.parentNode;return t},data:function(t,e,s){var n;return t[u]||(t[u]=f++),r[t[u]]||(r[t[u]]={}),n=r[t[u]],s?(r[t[u]][e]=s,void 0):r[t[u]][e]},onParents:function(t,e){for(var s;t&&s!==!1;)s=e(t),t=t.parentNode;return t},focusable:/^(a|area|frame|iframe|label|input|select|textarea|button|html|object)$/i,isFocusable:function(t){var e;return(this.focusable.test(t.nodeName)||(e=t.getAttributeNode("tabIndex"))&&e.specified)&&a.isVisible(t)},isVisible:function(t){return t.offsetWidth&&t.offsetHeight||t.clientWidth&&t.clientHeight},tabIndex:function(t){var e=t.getAttributeNode("tabIndex");return e&&e.specified&&(parseInt(t.getAttribute("tabIndex"))||0)},bind:t,unbind:e,browser:i,helpers:{createEventObject:o,createBasicStandardEvent:function(t,e,s){var i;try{i=s.createEvent("Events")}catch(o){i=s.createEvent("UIEvents")}finally{i.initEvent(t,!0,!0),n(i,e)}return i},inArray:function(t,e){for(var s=0;s<e.length;s++)if(e[s]===t)return s;return-1},getWindow:function(t){return t.ownerDocument.defaultView||t.ownerDocument.parentWindow},extend:n,scrollOffset:function(t,e){var s=t.document.documentElement,n=t.document.body;return e?(window.scrollTo(e.left,e.top),void 0):{left:(s&&s.scrollLeft||n&&n.scrollLeft||0)+(s.clientLeft||0),top:(s&&s.scrollTop||n&&n.scrollTop||0)+(s.clientTop||0)}},scrollDimensions:function(t){var e=t.document.documentElement,s=t.document.body,n=e.clientWidth,i=e.clientHeight,o="CSS1Compat"===t.document.compatMode;return{height:o&&i||s.clientHeight||i,width:o&&n||s.clientWidth||n}},addOffset:function(t,e){var s,n=a.jquery(e);"object"==typeof t&&void 0===t.clientX&&void 0===t.clientY&&void 0===t.pageX&&void 0===t.pageY&&n&&(e=n(e),s=e.offset(),t.pageX=s.left+e.width()/2,t.pageY=s.top+e.height()/2)}},key:{ctrlKey:null,altKey:null,shiftKey:null,metaKey:null},dispatch:function(s,n,i,o){if(n.dispatchEvent&&s){var r=s.preventDefault,f=o?-1:0;return o&&t(n,i,function(t){t.preventDefault(),e(this,i,arguments.callee)}),s.preventDefault=function(){f++,++f>0&&r.apply(this,[])},n.dispatchEvent(s),0>=f}try{window.event=s}catch(u){}return n.sourceIndex<=0||n.fireEvent&&n.fireEvent("on"+i,s)},create:{page:{event:function(t,e,s){var n,i=a.helpers.getWindow(s).document||document;if(i.createEvent)return n=i.createEvent("Events"),n.initEvent(t,!0,!0),n;try{n=o(t,e,s)}catch(r){}return n}},focus:{event:function(t,e,n){return a.onParents(n,function(t){if(a.isFocusable(t)){if("html"!==t.nodeName.toLowerCase())t.focus(),s=t;else if(s){var e=a.helpers.getWindow(n).document;if(e!==window.document)return!1;e.activeElement?(e.activeElement.blur(),s=null):(s.blur(),s=null)}return!1}}),!0}}},support:{clickChanges:!1,clickSubmits:!1,keypressSubmits:!1,mouseupSubmits:!1,radioClickChanges:!1,focusChanges:!1,linkHrefJS:!1,keyCharacters:!1,backspaceWorks:!1,mouseDownUpClicks:!1,tabKeyTabs:!1,keypressOnAnchorClicks:!1,optionClickBubbles:!1,ready:0},trigger:function(t,e,s){e||(e={});var n,i,o,r=a.create,f=r[t]&&r[t].setup,u=l.test(t)?"key":h.test(t)?"page":"mouse",c=r[t]||{},_=r[u],p=s;return 2===a.support.ready&&f&&f(t,e,s),o=e._autoPrevent,delete e._autoPrevent,c.event?i=c.event(t,e,s):(e=_.options?_.options(t,e,s):e,!a.support.changeBubbles&&/option/i.test(s.nodeName)&&(p=s.parentNode),n=_.event(t,e,p),i=a.dispatch(n,p,t,o)),i&&2===a.support.ready&&a.defaults[t]&&a.defaults[t].call(s,e,o),i},eventSupported:function(t){var e=document.createElement("div");t="on"+t;var s=t in e;return s||(e.setAttribute(t,"return;"),s="function"==typeof e[t]),e=null,s}}),n(a.init.prototype,{then:function(t,e,s,n){a.autoDelay&&this.delay();var i=a.args(e,s,n),o=this;return this.queue.unshift(function(e){return"function"!=typeof this[t]?(this.result=a.trigger(t,i.options,i.element),i.callback&&i.callback.call(this,i.element,this.result),this):(this.element=i.element||e,this[t](i.options,this.element,function(){i.callback&&i.callback.apply(o,arguments),o.done.apply(o,arguments)}),void 0)}),this},delay:function(t,e){"function"==typeof t&&(e=t,t=null),t=t||600;var s=this;return this.queue.unshift(function(){setTimeout(function(){e&&e.apply(s,[]),s.done.apply(s,arguments)},t)}),this},done:function(t,e){e&&(this.element=e),this.queue.length&&this.queue.pop().call(this,this.element,t)},_click:function(t,e,s,n){a.helpers.addOffset(t,e),a.trigger("mousedown",t,e),setTimeout(function(){a.trigger("mouseup",t,e),!a.support.mouseDownUpClicks||n?(a.trigger("click",t,e),s(!0)):(a.create.click.setup("click",t,e),a.defaults.click.call(e),setTimeout(function(){s(!0)},1))},1)},_rightClick:function(t,e,s){a.helpers.addOffset(t,e);var i=n(n({},a.mouse.browser.right.mouseup),t);a.trigger("mousedown",i,e),setTimeout(function(){a.trigger("mouseup",i,e),a.mouse.browser.right.contextmenu&&a.trigger("contextmenu",n(n({},a.mouse.browser.right.contextmenu),t),e),s(!0)},1)},_dblclick:function(t,e,s){a.helpers.addOffset(t,e);var n=this;this._click(t,e,function(){setTimeout(function(){n._click(t,e,function(){a.trigger("dblclick",t,e),s(!0)},!0)},2)})}});for(var c=["click","dblclick","move","drag","key","type","rightClick"],_=function(t){a[t]=function(e,s,n){return a("_"+t,e,s,n)},a.init.prototype[t]=function(e,s,n){return this.then("_"+t,e,s,n)}},p=0;p<c.length;p++)_(c[p]);(window.FuncUnit&&window.FuncUnit.jQuery||window.jQuery)&&((window.FuncUnit&&window.FuncUnit.jQuery||window.jQuery).fn.triggerSyn=function(t,e,s){if(!this[0])throw"Can't "+t.substring(1)+" because no element matching '"+this.selector+"' was found";return a(t,e,this[0],s),this}),window.Syn=a}(),function(){var h=Syn.helpers,getWin=h.getWindow;Syn.mouse={},h.extend(Syn.defaults,{mousedown:function(){Syn.trigger("focus",{},this)},click:function(){var element=this;try{element.nodeType}catch(e){return}var href,radioChanged=Syn.data(element,"radioChanged"),scope=getWin(element),nodeName=element.nodeName.toLowerCase();if(!Syn.support.linkHrefJS&&/^\s*javascript:/.test(element.href)){var code=element.href.replace(/^\s*javascript:/,"");"//"!=code&&-1==code.indexOf("void(0)")&&(window.selenium?eval("with(selenium.browserbot.getCurrentWindow()){"+code+"}"):eval("with(scope){"+code+"}"))}if(!Syn.support.clickSubmits&&"input"==nodeName&&"submit"==element.type||"button"==nodeName){var form=Syn.closest(element,"form");form&&Syn.trigger("submit",{},form)}"a"==nodeName&&element.href&&!/^\s*javascript:/.test(element.href)&&(scope.location.href=element.href),"input"==nodeName&&"checkbox"==element.type&&(Syn.support.clickChanges||Syn.trigger("change",{},element)),"input"==nodeName&&"radio"==element.type&&radioChanged&&!Syn.support.radioClickChanges&&Syn.trigger("change",{},element),"option"==nodeName&&Syn.data(element,"createChange")&&(Syn.trigger("change",{},element.parentNode),Syn.data(element,"createChange",!1))}}),h.extend(Syn.create,{mouse:{options:function(t,e){var s=document.documentElement,n=document.body,i=[e.pageX||0,e.pageY||0],o=Syn.mouse.browser&&Syn.mouse.browser.left[t],r=Syn.mouse.browser&&Syn.mouse.browser.right[t];return h.extend({bubbles:!0,cancelable:!0,view:window,detail:1,screenX:1,screenY:1,clientX:e.clientX||i[0]-(s&&s.scrollLeft||n&&n.scrollLeft||0)-(s.clientLeft||0),clientY:e.clientY||i[1]-(s&&s.scrollTop||n&&n.scrollTop||0)-(s.clientTop||0),ctrlKey:!!Syn.key.ctrlKey,altKey:!!Syn.key.altKey,shiftKey:!!Syn.key.shiftKey,metaKey:!!Syn.key.metaKey,button:o&&null!=o.button?o.button:r&&r.button||("contextmenu"==t?2:0),relatedTarget:document.documentElement},e)},event:function(t,e,s){var n=getWin(s).document||document;if(n.createEvent){var i;try{i=n.createEvent("MouseEvents"),i.initMouseEvent(t,e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}catch(o){i=h.createBasicStandardEvent(t,e,n)}return i.synthetic=!0,i}var i;try{i=h.createEventObject(t,e,s)}catch(o){}return i}},click:{setup:function(t,e,s){var t,n=s.nodeName.toLowerCase();if(!Syn.support.clickChecks&&!Syn.support.changeChecks&&"input"===n&&(t=s.type.toLowerCase(),"checkbox"===t&&(s.checked=!s.checked),"radio"===t&&!s.checked)){try{Syn.data(s,"radioChanged",!0)}catch(i){}s.checked=!0}if("a"==n&&s.href&&!/^\s*javascript:/.test(s.href)&&Syn.data(s,"href",s.href),/option/i.test(s.nodeName)){for(var o=s.parentNode.firstChild,r=-1;o&&(1!=o.nodeType||(r++,o!=s));)o=o.nextSibling;r!==s.parentNode.selectedIndex&&(s.parentNode.selectedIndex=r,Syn.data(s,"createChange",!0))}}},mousedown:{setup:function(t,e,s){var n=s.nodeName.toLowerCase();!Syn.browser.safari||"select"!=n&&"option"!=n||(e._autoPrevent=!0)}}}),function(){if(!document.body)return setTimeout(arguments.callee,1),void 0;var t=window.__synthTest;window.__synthTest=function(){Syn.support.linkHrefJS=!0};var e,s,n,i,o=document.createElement("div");o.innerHTML="<form id='outer'><input name='checkbox' type='checkbox'/><input name='radio' type='radio' /><input type='submit' name='submitter'/><input type='input' name='inputter'/><input name='one'><input name='two'/><a href='javascript:__synthTest()' id='synlink'></a><select><option></option></select></form>",document.documentElement.appendChild(o),n=o.firstChild,e=n.childNodes[0],s=n.childNodes[2],i=n.getElementsByTagName("select")[0],e.checked=!1,e.onchange=function(){Syn.support.clickChanges=!0},Syn.trigger("click",{},e),Syn.support.clickChecks=e.checked,e.checked=!1,Syn.trigger("change",{},e),Syn.support.changeChecks=e.checked,n.onsubmit=function(t){return t.preventDefault&&t.preventDefault(),Syn.support.clickSubmits=!0,!1},Syn.trigger("click",{},s),n.childNodes[1].onchange=function(){Syn.support.radioClickChanges=!0},Syn.trigger("click",{},n.childNodes[1]),Syn.bind(o,"click",function(){Syn.support.optionClickBubbles=!0,Syn.unbind(o,"click",arguments.callee)}),Syn.trigger("click",{},i.firstChild),Syn.support.changeBubbles=Syn.eventSupported("change");o.onclick=function(){Syn.support.mouseDownUpClicks=!0},Syn.trigger("mousedown",{},o),Syn.trigger("mouseup",{},o),document.documentElement.removeChild(o),window.__synthTest=t,Syn.support.ready++}()}(),function(){Syn.key.browsers={webkit:{prevent:{keyup:[],keydown:["char","keypress"],keypress:["char"]},character:{keydown:[0,"key"],keypress:["char","char"],keyup:[0,"key"]},specialChars:{keydown:[0,"char"],keyup:[0,"char"]},navigation:{keydown:[0,"key"],keyup:[0,"key"]},special:{keydown:[0,"key"],keyup:[0,"key"]},tab:{keydown:[0,"char"],keyup:[0,"char"]},"pause-break":{keydown:[0,"key"],keyup:[0,"key"]},caps:{keydown:[0,"key"],keyup:[0,"key"]},escape:{keydown:[0,"key"],keyup:[0,"key"]},"num-lock":{keydown:[0,"key"],keyup:[0,"key"]},"scroll-lock":{keydown:[0,"key"],keyup:[0,"key"]},print:{keyup:[0,"key"]},"function":{keydown:[0,"key"],keyup:[0,"key"]},"\r":{keydown:[0,"key"],keypress:["char","key"],keyup:[0,"key"]}},gecko:{prevent:{keyup:[],keydown:["char"],keypress:["char"]},character:{keydown:[0,"key"],keypress:["char",0],keyup:[0,"key"]},specialChars:{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},navigation:{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},special:{keydown:[0,"key"],keyup:[0,"key"]}," ":{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},"pause-break":{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},caps:{keydown:[0,"key"],keyup:[0,"key"]},escape:{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},"num-lock":{keydown:[0,"key"],keyup:[0,"key"]},"scroll-lock":{keydown:[0,"key"],keyup:[0,"key"]},print:{keyup:[0,"key"]},"function":{keydown:[0,"key"],keyup:[0,"key"]},"\r":{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]}},msie:{prevent:{keyup:[],keydown:["char","keypress"],keypress:["char"]},character:{keydown:[null,"key"],keypress:[null,"char"],keyup:[null,"key"]},specialChars:{keydown:[null,"char"],keyup:[null,"char"]},navigation:{keydown:[null,"key"],keyup:[null,"key"]},special:{keydown:[null,"key"],keyup:[null,"key"]},tab:{keydown:[null,"char"],keyup:[null,"char"]},"pause-break":{keydown:[null,"key"],keyup:[null,"key"]},caps:{keydown:[null,"key"],keyup:[null,"key"]},escape:{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},"num-lock":{keydown:[null,"key"],keyup:[null,"key"]},"scroll-lock":{keydown:[null,"key"],keyup:[null,"key"]},print:{keyup:[null,"key"]},"function":{keydown:[null,"key"],keyup:[null,"key"]},"\r":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]}},opera:{prevent:{keyup:[],keydown:[],keypress:["char"]},character:{keydown:[null,"key"],keypress:[null,"char"],keyup:[null,"key"]},specialChars:{keydown:[null,"char"],keypress:[null,"char"],keyup:[null,"char"]},navigation:{keydown:[null,"key"],keypress:[null,"key"]},special:{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},tab:{keydown:[null,"char"],keypress:[null,"char"],keyup:[null,"char"]},"pause-break":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},caps:{keydown:[null,"key"],keyup:[null,"key"]},escape:{keydown:[null,"key"],keypress:[null,"key"]},"num-lock":{keyup:[null,"key"],keydown:[null,"key"],keypress:[null,"key"]},"scroll-lock":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},print:{},"function":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},"\r":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]}}},Syn.mouse.browsers={webkit:{right:{mousedown:{button:2,which:3},mouseup:{button:2,which:3},contextmenu:{button:2,which:3}},left:{mousedown:{button:0,which:1},mouseup:{button:0,which:1},click:{button:0,which:1}}},opera:{right:{mousedown:{button:2,which:3},mouseup:{button:2,which:3}},left:{mousedown:{button:0,which:1},mouseup:{button:0,which:1},click:{button:0,which:1}}},msie:{right:{mousedown:{button:2},mouseup:{button:2},contextmenu:{button:0}},left:{mousedown:{button:1},mouseup:{button:1},click:{button:0}}},chrome:{right:{mousedown:{button:2,which:3},mouseup:{button:2,which:3},contextmenu:{button:2,which:3}},left:{mousedown:{button:0,which:1},mouseup:{button:0,which:1},click:{button:0,which:1}}},gecko:{left:{mousedown:{button:0,which:1},mouseup:{button:0,which:1},click:{button:0,which:1}},right:{mousedown:{button:2,which:3},mouseup:{button:2,which:3},contextmenu:{button:2,which:3}}}},Syn.key.browser=function(){if(Syn.key.browsers[window.navigator.userAgent])return Syn.key.browsers[window.navigator.userAgent];
|
3
|
+
for(var t in Syn.browser)if(Syn.browser[t]&&Syn.key.browsers[t])return Syn.key.browsers[t];return Syn.key.browsers.gecko}(),Syn.mouse.browser=function(){if(Syn.mouse.browsers[window.navigator.userAgent])return Syn.mouse.browsers[window.navigator.userAgent];for(var t in Syn.browser)if(Syn.browser[t]&&Syn.mouse.browsers[t])return Syn.mouse.browsers[t];return Syn.mouse.browsers.gecko}()}(),function(){!function(){if(!document.body)return setTimeout(arguments.callee,1),void 0;var t=document.createElement("div");if(document.body.appendChild(t),Syn.helpers.extend(t.style,{width:"100px",height:"10000px",backgroundColor:"blue",position:"absolute",top:"10px",left:"0px",zIndex:19999}),document.body.scrollTop=11,document.elementFromPoint){var e=document.elementFromPoint(3,1);e==t?Syn.support.elementFromClient=!0:Syn.support.elementFromPage=!0,document.body.removeChild(t),document.body.scrollTop=0}}();var t=function(t,e){var s,n=t.clientX,i=t.clientY,o=Syn.helpers.getWindow(e);if(Syn.support.elementFromPage){var r=Syn.helpers.scrollOffset(o);n+=r.left,i+=r.top}return s=o.document.elementFromPoint?o.document.elementFromPoint(n,i):e,s===o.document.documentElement&&(t.clientY<0||t.clientX<0)?e:s},e=function(e,s,n){var i=t(s,n);return Syn.trigger(e,s,i||n),i},s=function(e,s,n){var i=t(e,s);if(n!=i&&i&&n){var o=Syn.helpers.extend({},e);o.relatedTarget=i,Syn.trigger("mouseout",o,n),o.relatedTarget=n,Syn.trigger("mouseover",o,i)}return Syn.trigger("mousemove",e,i||s),i},n=function(e,n,i,o,r){var f=new Date,u=n.clientX-e.clientX,l=n.clientY-e.clientY,h=Syn.helpers.getWindow(o),a=t(e,o),c=h.document.createElement("div"),_=0;move=function(){var t=new Date,p=Syn.helpers.scrollOffset(h),d=(0==_?0:t-f)/i,y={clientX:u*d+e.clientX,clientY:l*d+e.clientY};_++,1>d?(Syn.helpers.extend(c.style,{left:y.clientX+p.left+2+"px",top:y.clientY+p.top+2+"px"}),a=s(y,o,a),setTimeout(arguments.callee,15)):(a=s(n,o,a),h.document.body.removeChild(c),r())},Syn.helpers.extend(c.style,{height:"5px",width:"5px",backgroundColor:"red",position:"absolute",zIndex:19999,fontSize:"1px"}),h.document.body.appendChild(c),move()},i=function(t,s,i,o,r){e("mousedown",t,o),n(t,s,i,o,function(){e("mouseup",s,o),r()})},o=function(t){var e=Syn.jquery()(t),s=e.offset();return{pageX:s.left+e.outerWidth()/2,pageY:s.top+e.outerHeight()/2}},r=function(t,e,s){var n=/(\d+)[x ](\d+)/,i=/(\d+)X(\d+)/,r=/([+-]\d+)[xX ]([+-]\d+)/;if("string"==typeof t&&r.test(t)&&s){var f=o(s),u=t.match(r);t={pageX:f.pageX+parseInt(u[1]),pageY:f.pageY+parseInt(u[2])}}if("string"==typeof t&&n.test(t)){var u=t.match(n);t={pageX:parseInt(u[1]),pageY:parseInt(u[2])}}if("string"==typeof t&&i.test(t)){var u=t.match(i);t={clientX:parseInt(u[1]),clientY:parseInt(u[2])}}if("string"==typeof t&&(t=Syn.jquery()(t,e.document)[0]),t.nodeName&&(t=o(t)),t.pageX){var l=Syn.helpers.scrollOffset(e);t={clientX:t.pageX-l.left,clientY:t.pageY-l.top}}return t},f=function(t,e,s){if(t.clientY<0){var n=Syn.helpers.scrollOffset(s),i=(Syn.helpers.scrollDimensions(s),n.top+t.clientY-100),o=i-n.top;i>0||(i=0,o=-n.top),t.clientY=t.clientY-o,e.clientY=e.clientY-o,Syn.helpers.scrollOffset(s,{top:i,left:n.left})}};Syn.helpers.extend(Syn.init.prototype,{_move:function(t,e,s){var i=Syn.helpers.getWindow(e),o=r(t.from||e,i,e),u=r(t.to||t,i,e);t.adjust!==!1&&f(o,u,i),n(o,u,t.duration||500,e,s)},_drag:function(t,e,s){var n=Syn.helpers.getWindow(e),o=r(t.from||e,n,e),u=r(t.to||t,n,e);t.adjust!==!1&&f(o,u,n),i(o,u,t.duration||500,e,s)}})}(),Faye.random=function(){for(var t="",e=40;e--;)t+=Math.floor(16*Math.random()).toString(16);return t},Terminus={isIE:/\bMSIE\b/.test(navigator.userAgent),connect:function(t,e){if(!this._bayeux){this._host=t,this._pageId=Faye.random(),this._id=window.name=window.name||document.name||Faye.random(),this._id=this._id.split("|")[0];for(var s=document.getElementsByTagName("iframe"),n=s.length;n--;)s[n].contentDocument.name=s[n].id;this.Registry.initialize(),this.Worker.initialize(),this.AjaxMonitor.initialize(),Faye.Event.on(window,"beforeunload",function(){Terminus.disabled=!0});var i="http://"+t+":"+e+"/messaging",o=this._bayeux=new Faye.Client(i),r=this;o.addExtension({outgoing:function(t,e){t.href=window.location.href,"websocket"===t.connectionType&&(r._socketCapable=!0),e(t)}}),this.getId(function(t){var e=window.name.split("|")[1];e||o.subscribe("/terminus/sockets/"+t,function(t){window.name+="|"+t.url,this.openSocket(t.url)},this);var s=o.subscribe("/terminus/clients/"+t,this.handleMessage,this);s.callback(function(){this.ping(),e&&this.openSocket(e)},this)},this)}},browserDetails:function(t,e){this.getId(function(s){t.call(e,{host:this._host,id:s,infinite:!!window.TERMINUS_INFINITE_REDIRECT,page:this._pageId,sockets:this._socketCapable,ua:navigator.userAgent,url:window.location.href})},this)},getId:function(t,e){var s=this._id;if(this.isIE)return t.call(e,s);if(opener&&opener.Terminus)opener.Terminus.getId(function(n){t.call(e,n+"/"+s)});else if(parent&&parent!==window){var n=function(){return parent.Terminus?(parent.Terminus.getId(function(n){t.call(e,n+"/"+s)}),void 0):setTimeout(n,100)};n()}else t.call(e,s)},openSocket:function(t){if(!this.disabled&&!this._socket){var e=this,s=window.MozWebSocket||window.WebSocket,n=new s(t);n.onopen=function(){e._socket=n,up=!0},n.onclose=function(){var s=!!e._socket;e._socket=null,s?e.openSocket(t):window.name=window.name.split("|")[0]},n.onmessage=function(t){e.handleMessage(JSON.parse(t.data))}}},ping:function(){this.disabled||this.browserDetails(function(t){this._bayeux.publish("/terminus/ping",t);var e=this;setTimeout(function(){e.ping()},3e3)},this)},handleMessage:function(t){var e=t.command,s=e.shift(),n=this.Driver,i=this.Worker,o=!1,r=this;e.push(function(e){o||(r.postResult(t.commandId,e),o=!0)}),i.monitor=!0,n[s].apply(n,e),i.monitor=!1},postResult:function(t,e){return!this.disabled&&t?this._socket?this._socket.send(JSON.stringify({value:e})):(this.getId(function(s){this._bayeux.publish("/terminus/results",{id:s,commandId:t,result:e})},this),void 0):void 0},getAttribute:function(t,e){return Terminus.isIE?(t.getAttributeNode(e)||{}).nodeValue||!1:t.getAttribute(e)||!1},hideNodes:function(t,e,s){if(!t)return s;s=s||[];var n="script"===(t.tagName||"").toLowerCase(),i="none"===(t.style||{}).display||t.hidden;if(n||e&&i){var o=t.parentNode,r=t.nextSibling;n||s.push([t,o,r]),o&&o.removeChild(t)}else for(var f=t.childNodes||[],u=0,l=f.length;l>u;u++)this.hideNodes(f[u],e,s);return s},showNodes:function(t){for(var e,s,n,i,o=0,r=t.length;r>o;o++)e=t[o],s=e[0],n=e[1],i=e[2],n&&(i?n.insertBefore(s,i):n.appendChild(s))},Driver:{_node:function(t){return Terminus.Registry.get(t)},attribute:function(t,e,s){var n=this._node(t);return n?(Terminus.isIE||"checked"!==e&&"selected"!==e?"textarea"===n.tagName.toLowerCase()&&"type"===e?s("textarea"):s(Terminus.getAttribute(n,e)):s(!!n[e]),void 0):s(null)},set_attribute:function(t,e,s,n){var i=this._node(t);return i?(i.setAttribute(e,s),n(!0),void 0):n(null)},body:function(t){var e=document.getElementsByTagName("html")[0];t(e.outerHTML||"<html>\n"+e.innerHTML+"\n</html>\n")},clear_cookies:function(t){var e,s=document.cookie.split(";"),n=new Date;n.setTime(n.getTime()-864e5);for(var i=0,o=s.length;o>i;i++)e=s[i].split("=")[0],document.cookie=e+"=; expires="+n.toGMTString()+"; path=/";t(!0)},click:function(t,e,s){var n=this._node(t),i=e.resynchronization_timeout;return n?(Syn.trigger("click",{},n),e.resynchronize?(i&&Terminus.Worker.timeout.call(window,function(){s("failed to resynchronize, ajax request timed out")},1e3*i),Terminus.Worker.callback(function(){s(!0)}),void 0):s(!0)):s(!0)},current_url:function(t){Terminus.browserDetails(function(e){t(e.url)})},drag:function(t,e){var s=this._node(t.from),n=this._node(t.to);return s&&n?(Syn.drag({to:n},s,function(){e(!0)}),void 0):e(null)},evaluate:function(expression,callback){callback(eval(expression))},execute:function(expression,callback){eval(expression),callback(!0)},find_css:function(t,e,s){var n=e?this._node(e):document;if(!n||!n.querySelectorAll)return s([]);for(var i=n.querySelectorAll(t),o=[],r=0,f=i.length;f>r;r++)o[r]=Terminus.Registry.put(i[r]);s(o)},find_xpath:function(t,e,s){var n=e?this._node(e):document;if(!n)return s([]);for(var i,o=document.evaluate(t,n,null,XPathResult.ANY_TYPE,null),r=[];i=o.iterateNext();)r.push(Terminus.Registry.put(i));s(r)},is_disabled:function(t,e){var s=this._node(t);if(!s)return e(null);for(;s.tagName&&"body"!==s.tagName.toLowerCase();){if(Terminus.getAttribute(s,"disabled"))return e(!0);s=s.parentNode}e(!1)},is_visible:function(t,e){var s=this._node(t);if(!s)return e(null);for(;s.tagName&&"body"!==s.tagName.toLowerCase();){if(s.hidden||"none"===s.style.display||"hidden"===s.type)return e(!1);s=s.parentNode}e(!0)},select:function(t,e){var s=this._node(t);return s?(s.selected=!0,Syn.trigger("change",{},s.parentNode),e(!0),void 0):e(null)},set:function(t,e,s){var n=this._node(t),i=Terminus.getAttribute(n,"maxlength");if(!n)return s(null);if("file"===n.type)return s("not_allowed");if(Terminus.getAttribute(n,"readonly"))return s(!0);switch(Syn.trigger("focus",{},n),Syn.trigger("click",{},n),"number"==typeof e&&(e=e.toString()),"true"===String(n.contentEditable)&&(n.innerHTML=e),typeof e){case"string":i&&(e=e.substr(0,parseInt(i))),n.value=e;break;case"boolean":n.checked=e}Syn.trigger("change",{},n),s(!0)},tag_name:function(t,e){var s=this._node(t);return s?(e(s.tagName.toLowerCase()),void 0):e(null)},text:function(t,e,s){var n=this._node(t);if(!n)return s(null);var i=Terminus.hideNodes(n,e),o=document.title;document.title="";var r=n.textContent||n.innerText||"";document.title=o,Terminus.showNodes(i),r=r.replace(/^\s*|\s*$/g,"").replace(/\s+/g," "),s(r)},title:function(t){t(document.title)},trigger:function(t,e,s){var n=this._node(t);return n?(Syn.trigger(e,{},n),s(!0),void 0):s(null)},unselect:function(t,e){var s=this._node(t);return s?s.parentNode.multiple?(s.selected=!1,Syn.trigger("change",{},s.parentNode),e(!0),void 0):e(!1):e(null)},value:function(t,e){var s=this._node(t);if(!s)return e(null);if("select"!==s.tagName.toLowerCase()||!s.multiple)return e(s.value);for(var n=s.children,i=[],o=0,r=n.length;r>o;o++)n[o].selected&&i.push(n[o].value);e(i)},visit:function(t,e){window.location.href=t,e(t)}},Registry:{initialize:function(){this._namespace=new Faye.Namespace,this._elements={}},get:function(t){for(var e=this._elements[t],s=e;s&&"BODY"!==s.tagName&&"HTML"!==s.tagName;)s=s.parentNode;return s?e:null},put:function(t){var e=t["data-terminus-id"];return e||(e=this._namespace.generate(),t["data-terminus-id"]=e),this._elements[e]=t,e}},Worker:{initialize:function(){this._callbacks=[],this._pending=0,Terminus.isIE||this._wrapTimeouts()},callback:function(t,e){0===this._pending?Terminus.Worker.timeout(function(){t.call(e)},0):this._callbacks.push([t,e])},suspend:function(){this._pending+=1},resume:function(){if(0!==this._pending&&(this._pending-=1,0===this._pending)){for(var t,e=0,s=this._callbacks.length;s>e;e++)t=this._callbacks[e],t[0].call(t[1]);this._callbacks=[]}},timeout:function(t,e){this._setTimeout?this._setTimeout.call(window,t,e):setTimeout(t,e)},_wrapTimeouts:function(){var timeout=window.setTimeout,clear=window.clearTimeout,timeouts={},self=this,finish=function(t){timeouts.hasOwnProperty(t)&&(delete timeouts[t],self.resume())};window.setTimeout=function(callback,delay){var id=timeout.call(window,function(){try{switch(typeof callback){case"function":callback();break;case"string":eval(callback)}}finally{finish(id)}},delay);return self.monitor&&(timeouts[id]=!0,self.suspend()),id},window.clearTimeout=function(t){return finish(t),clear(t)},this._setTimeout=timeout}},AjaxMonitor:{initialize:function(){window.jQuery&&this._patchJquery()},_patchJquery:function(){var t=jQuery.ajax;jQuery.ajax=function(e,s){var n=("string"==typeof e?s:e)||{},i=n.complete,o=Terminus.Worker.monitor;return n.complete=function(){var t;try{i&&(t=i.apply(this,arguments))}finally{o&&Terminus.Worker.resume()}return t},o&&Terminus.Worker.suspend(),"string"==typeof e?t.call(jQuery,e,n):t.call(jQuery,n)}}}};
|
@@ -4778,6 +4778,12 @@ Pathology.XPathParser.Union = {
|
|
4778
4778
|
})();
|
4779
4779
|
|
4780
4780
|
|
4781
|
+
Faye.random = function() {
|
4782
|
+
var s = '', i = 40;
|
4783
|
+
while (i--) s += Math.floor(Math.random() * 16).toString(16);
|
4784
|
+
return s;
|
4785
|
+
};
|
4786
|
+
|
4781
4787
|
Terminus = {
|
4782
4788
|
isIE: /\bMSIE\b/.test(navigator.userAgent),
|
4783
4789
|
|
@@ -4933,24 +4939,24 @@ Terminus = {
|
|
4933
4939
|
|
4934
4940
|
getAttribute: function(node, name) {
|
4935
4941
|
return Terminus.isIE ? (node.getAttributeNode(name) || {}).nodeValue || false
|
4936
|
-
: node.getAttribute(name);
|
4942
|
+
: node.getAttribute(name) || false;
|
4937
4943
|
},
|
4938
4944
|
|
4939
|
-
hideNodes: function(root, list) {
|
4945
|
+
hideNodes: function(root, hide, list) {
|
4940
4946
|
if (!root) return list;
|
4941
4947
|
list = list || [];
|
4942
4948
|
|
4943
4949
|
var isScript = (root.tagName || '').toLowerCase() === 'script',
|
4944
|
-
isHidden = (root.style || {}).display === 'none';
|
4950
|
+
isHidden = (root.style || {}).display === 'none' || root.hidden;
|
4945
4951
|
|
4946
|
-
if (isScript || isHidden) {
|
4952
|
+
if (isScript || (hide && isHidden)) {
|
4947
4953
|
var parent = root.parentNode, next = root.nextSibling;
|
4948
4954
|
if (!isScript) list.push([root, parent, next]);
|
4949
4955
|
if (parent) parent.removeChild(root);
|
4950
4956
|
} else {
|
4951
4957
|
var children = root.childNodes || [];
|
4952
4958
|
for (var i = 0, n = children.length; i < n; i++) {
|
4953
|
-
this.hideNodes(children[i], list);
|
4959
|
+
this.hideNodes(children[i], hide, list);
|
4954
4960
|
}
|
4955
4961
|
}
|
4956
4962
|
return list;
|
@@ -5022,10 +5028,10 @@ Terminus = {
|
|
5022
5028
|
|
5023
5029
|
Syn.trigger('click', {}, element);
|
5024
5030
|
|
5025
|
-
if (options.resynchronize
|
5031
|
+
if (!options.resynchronize) return callback(true);
|
5026
5032
|
|
5027
5033
|
if (timeout)
|
5028
|
-
Terminus.Worker.
|
5034
|
+
Terminus.Worker.timeout.call(window, function() {
|
5029
5035
|
callback('failed to resynchronize, ajax request timed out');
|
5030
5036
|
}, 1000 * timeout);
|
5031
5037
|
|
@@ -5060,7 +5066,21 @@ Terminus = {
|
|
5060
5066
|
callback(true);
|
5061
5067
|
},
|
5062
5068
|
|
5063
|
-
|
5069
|
+
find_css: function(css, nodeId, callback) {
|
5070
|
+
var root = nodeId ? this._node(nodeId) : document;
|
5071
|
+
if (!root || !root.querySelectorAll) return callback([]);
|
5072
|
+
|
5073
|
+
var result = root.querySelectorAll(css),
|
5074
|
+
list = [];
|
5075
|
+
|
5076
|
+
for (var i = 0, n = result.length; i < n; i++) {
|
5077
|
+
list[i] = Terminus.Registry.put(result[i]);
|
5078
|
+
}
|
5079
|
+
|
5080
|
+
callback(list);
|
5081
|
+
},
|
5082
|
+
|
5083
|
+
find_xpath: function(xpath, nodeId, callback) {
|
5064
5084
|
var root = nodeId ? this._node(nodeId) : document;
|
5065
5085
|
if (!root) return callback([]);
|
5066
5086
|
|
@@ -5071,7 +5091,18 @@ Terminus = {
|
|
5071
5091
|
while (element = result.iterateNext())
|
5072
5092
|
list.push(Terminus.Registry.put(element));
|
5073
5093
|
|
5074
|
-
|
5094
|
+
callback(list);
|
5095
|
+
},
|
5096
|
+
|
5097
|
+
is_disabled: function(nodeId, callback) {
|
5098
|
+
var node = this._node(nodeId);
|
5099
|
+
if (!node) return callback(null);
|
5100
|
+
|
5101
|
+
while (node.tagName && node.tagName.toLowerCase() !== 'body') {
|
5102
|
+
if (Terminus.getAttribute(node, 'disabled')) return callback(true);
|
5103
|
+
node = node.parentNode;
|
5104
|
+
}
|
5105
|
+
callback(false);
|
5075
5106
|
},
|
5076
5107
|
|
5077
5108
|
is_visible: function(nodeId, callback) {
|
@@ -5079,7 +5110,7 @@ Terminus = {
|
|
5079
5110
|
if (!node) return callback(null);
|
5080
5111
|
|
5081
5112
|
while (node.tagName && node.tagName.toLowerCase() !== 'body') {
|
5082
|
-
if (node.style.display === 'none' || node.type === 'hidden')
|
5113
|
+
if (node.hidden || node.style.display === 'none' || node.type === 'hidden')
|
5083
5114
|
return callback(false);
|
5084
5115
|
node = node.parentNode;
|
5085
5116
|
}
|
@@ -5100,10 +5131,16 @@ Terminus = {
|
|
5100
5131
|
|
5101
5132
|
if (!field) return callback(null);
|
5102
5133
|
if (field.type === 'file') return callback('not_allowed');
|
5134
|
+
if (Terminus.getAttribute(field, 'readonly')) return callback(true);
|
5103
5135
|
|
5104
5136
|
Syn.trigger('focus', {}, field);
|
5105
5137
|
Syn.trigger('click', {}, field);
|
5106
5138
|
|
5139
|
+
if (typeof value === 'number') value = value.toString();
|
5140
|
+
|
5141
|
+
if (String(field.contentEditable) === 'true')
|
5142
|
+
field.innerHTML = value;
|
5143
|
+
|
5107
5144
|
switch (typeof value) {
|
5108
5145
|
case 'string':
|
5109
5146
|
if (max) value = value.substr(0, parseInt(max));
|
@@ -5123,11 +5160,11 @@ Terminus = {
|
|
5123
5160
|
callback(node.tagName.toLowerCase());
|
5124
5161
|
},
|
5125
5162
|
|
5126
|
-
text: function(nodeId, callback) {
|
5163
|
+
text: function(nodeId, hide, callback) {
|
5127
5164
|
var node = this._node(nodeId);
|
5128
5165
|
if (!node) return callback(null);
|
5129
5166
|
|
5130
|
-
var hidden = Terminus.hideNodes(node),
|
5167
|
+
var hidden = Terminus.hideNodes(node, hide),
|
5131
5168
|
title = document.title;
|
5132
5169
|
|
5133
5170
|
document.title = '';
|
@@ -5141,6 +5178,10 @@ Terminus = {
|
|
5141
5178
|
callback(text);
|
5142
5179
|
},
|
5143
5180
|
|
5181
|
+
title: function(callback) {
|
5182
|
+
callback(document.title);
|
5183
|
+
},
|
5184
|
+
|
5144
5185
|
trigger: function(nodeId, eventType, callback) {
|
5145
5186
|
var node = this._node(nodeId);
|
5146
5187
|
if (!node) return callback(null);
|
@@ -5214,10 +5255,7 @@ Terminus = {
|
|
5214
5255
|
|
5215
5256
|
callback: function(callback, scope) {
|
5216
5257
|
if (this._pending === 0) {
|
5217
|
-
|
5218
|
-
this._setTimeout.call(window, function() { callback.call(scope) }, 0);
|
5219
|
-
else
|
5220
|
-
setTimeout(function() { callback.call(scope) }, 0);
|
5258
|
+
Terminus.Worker.timeout(function() { callback.call(scope) }, 0);
|
5221
5259
|
} else {
|
5222
5260
|
this._callbacks.push([callback, scope]);
|
5223
5261
|
}
|
@@ -5240,6 +5278,13 @@ Terminus = {
|
|
5240
5278
|
this._callbacks = [];
|
5241
5279
|
},
|
5242
5280
|
|
5281
|
+
timeout: function(fn, time) {
|
5282
|
+
if (this._setTimeout)
|
5283
|
+
this._setTimeout.call(window, fn, time);
|
5284
|
+
else
|
5285
|
+
setTimeout(fn, time);
|
5286
|
+
},
|
5287
|
+
|
5243
5288
|
_wrapTimeouts: function() {
|
5244
5289
|
var timeout = window.setTimeout,
|
5245
5290
|
clear = window.clearTimeout,
|
@@ -5295,7 +5340,7 @@ Terminus = {
|
|
5295
5340
|
options.complete = function() {
|
5296
5341
|
var result;
|
5297
5342
|
try {
|
5298
|
-
result = complete.apply(this, arguments);
|
5343
|
+
if (complete) result = complete.apply(this, arguments);
|
5299
5344
|
} finally {
|
5300
5345
|
if (monitor) Terminus.Worker.resume();
|
5301
5346
|
}
|
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
var JS=void 0===this.JS?{}:this.JS;JS.Date=Date,function(t){var e="object"==typeof this.global?this.global:this,n="object"==typeof exports;n?(exports.JS=exports,JS=exports):e.JS=JS,t(e,JS)}(function(t,e){"use strict";var n=function(t){n._index(this),this._loader=t,this._names=new r,this._deps=new r,this._uses=new r,this._styles=new r,this._observers={},this._events={}};n.displayName="Package",n.toString=function(){return n.displayName},n.log=function(n){e.debug&&"undefined"!=typeof window&&("object"==typeof t.runtime&&runtime.trace(n),t.console&&console.info&&console.info(n))};var i=function(t){if(/^https?:/.test(t))return t;var n=e.ROOT;return n&&(t=(n+"/"+t).replace(/\/+/g,"/")),t},r=function(t){if(this._members=this.list=[],this._index={},t)for(var e=0,n=t.length;n>e;e++)this.push(t[e])};r.prototype.push=function(t){var e=void 0!==t.id?t.id:t,n=this._index;n.hasOwnProperty(e)||(n[e]=this._members.length,this._members.push(t))};var s=n.Deferred=function(){this._status="deferred",this._value=null,this._callbacks=[]};s.prototype.callback=function(t,e){"succeeded"===this._status?t.call(e,this._value):this._callbacks.push([t,e])},s.prototype.succeed=function(t){this._status="succeeded",this._value=t;for(var e;e=this._callbacks.shift();)e[0].call(e[1],t)},n.ENV=e.ENV=t,n.onerror=function(t){throw t},n._throw=function(t){n.onerror(Error(t))};for(var o=n.prototype,a=[["requires","_deps"],["uses","_uses"]],_=a.length;_--;)(function(t){var e=t[0],n=t[1];o[e]=function(){var t,e=arguments.length;for(t=0;e>t;t++)this[n].push(arguments[t]);return this}})(a[_]);o.provides=function(){var t,e=arguments.length;for(t=0;e>t;t++)this._names.push(arguments[t]),n._getFromCache(arguments[t]).pkg=this;return this},o.styling=function(){for(var t=0,e=arguments.length;e>t;t++)this._styles.push(i(arguments[t]))},o.setup=function(t){return this._onload=t,this},o._on=function(t,e,n){if(this._events[t])return e.call(n);var i=this._observers[t]=this._observers[t]||[];i.push([e,n]),this._load()},o._fire=function(t){if(this._events[t])return!1;this._events[t]=!0;var e=this._observers[t];if(!e)return!0;delete this._observers[t];for(var n=0,i=e.length;i>n;n++)e[n][0].call(e[n][1]);return!0},o._isLoaded=function(t){if(!t&&void 0!==this.__isLoaded)return this.__isLoaded;for(var e,i,r=this._names.list,s=r.length;s--;)if(e=r[s],i=n._getObject(e,this._exports),void 0===i)return t?n._throw("Expected package at "+this._loader+" to define "+e):this.__isLoaded=!1;return this.__isLoaded=!0},o._load=function(){if(this._fire("request")){this._isLoaded()||this._prefetch();var t=this._deps.list.concat(this._uses.list),e=this._source||[],i=(this._loader||{}).length,r=this;n.when({load:t}),n.when({complete:this._deps.list},function(){n.when({complete:t,load:[this]},function(){this._fire("complete")},this);var s=function(t){if(0===i)return o(t);i-=1;var a=r._loader.length-i-1;n.loader.loadFile(r._loader[a],s,e[a])},o=function(t){r._exports=t,r._onload&&r._onload(),r._isLoaded(!0),r._fire("load")};if(this._isLoaded())return this._fire("download"),this._fire("load");if(void 0===this._loader)return n._throw("No load path found for "+this._names.list[0]);if("function"==typeof this._loader?this._loader(o):s(),n.loader.loadStyle){for(var a=this._styles.list,_=a.length;_--;)n.loader.loadStyle(a[_]);this._fire("download")}},this)}},o._prefetch=function(){if(!this._source&&this._loader instanceof Array&&n.loader.fetch){this._source=[];for(var t=0,e=this._loader.length;e>t;t++)this._source[t]=n.loader.fetch(this._loader[t])}},o.toString=function(){return"Package:"+this._names.list.join(",")},n.when=function(t,e,i){var s,o,a,_=[],u={};for(s in t)if(t.hasOwnProperty(s))for(u[s]=[],o=new r(t[s]),a=o.list.length;a--;)_.push([s,o.list[a],a]);var l=a=_.length;if(0===l)return e&&e.call(i,u);for(;a--;)(function(t){var r=n._getByName(t[1]);r._on(t[0],function(){u[t[0]][t[2]]=n._getObject(t[1],r._exports),l-=1,0===l&&e&&e.call(i,u)})})(_[a])};var u=(t.JS||{}).Package||{};n._autoIncrement=u._autoIncrement||1,n._indexByPath=u._indexByPath||{},n._indexByName=u._indexByName||{},n._autoloaders=u._autoloaders||[],n._index=function(t){t.id=this._autoIncrement,this._autoIncrement+=1},n._getByPath=function(t){var e=""+t,n=this._indexByPath[e];return n?n:("string"==typeof t&&(t=[].slice.call(arguments)),n=this._indexByPath[e]=new this(t))},n._getByName=function(t){if("string"!=typeof t)return t;var e=this._getFromCache(t);if(e.pkg)return e.pkg;var n=this._manufacture(t);if(n)return n;var i=new this;return i.provides(t),i},n.remove=function(t){var e=this._getByName(t);delete this._indexByName[t],delete this._indexByPath[e._loader]},n._autoload=function(t,e){this._autoloaders.push([t,e])},n._manufacture=function(t){var e,n,i,r,s=this._autoloaders,o=s.length;for(e=0;o>e;e++)if(i=s[e],i[0].test(t)){r=i[1].from,"string"==typeof r&&(r=this._convertNameToPath(r));var a=new this([r(t)]);if(a.provides(t),r=i[1].require)for(r=[].concat(r),n=r.length;n--;)a.requires(t.replace(i[0],r[n]));return a}return null},n._convertNameToPath=function(t){return function(e){return t.replace(/\/?$/,"/")+e.replace(/([a-z])([A-Z])/g,function(t,e,n){return e+"_"+n}).replace(/\./g,"/").toLowerCase()+".js"}},n._getFromCache=function(t){return this._indexByName[t]=this._indexByName[t]||{}},n._getObject=function(t,e){if("string"!=typeof t)return void 0;var n=e?{}:this._getFromCache(t);if(void 0!==n.obj)return n.obj;for(var i,r=e||this.ENV,s=t.split(".");i=s.shift();)r=r&&r[i];return e&&void 0===r?this._getObject(t):n.obj=r},n.BrowserLoader={HOST_REGEX:/^(https?\:)?\/\/[^\/]+/i,usable:function(){return!!n._getObject("window.document.getElementsByTagName")&&"undefined"==typeof phantom},__FILE__:function(){var t=document.getElementsByTagName("script"),e=t[t.length-1].src,n=window.location.href;return/^\w+\:\/+/.test(e)?e:/^\//.test(e)?window.location.origin+e:n.replace(/[^\/]*$/g,"")+e},cacheBust:function(t){if(e.cache!==!1)return t;var n=(new JS.Date).getTime();return t+(/\?/.test(t)?"&":"?")+n},fetch:function(t){var e=t;t=this.cacheBust(t),this.HOST=this.HOST||this.HOST_REGEX.exec(window.location.href);var i=this.HOST_REGEX.exec(t);if(!this.HOST||i&&i[0]!==this.HOST[0])return null;n.log("[FETCH] "+t);var r=new n.Deferred,s=this,o=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest;return o.open("GET",t,!0),o.onreadystatechange=function(){4===o.readyState&&(o.onreadystatechange=s._K,r.succeed(o.responseText+"\n//@ sourceURL="+e),o=null)},o.send(null),r},loadFile:function(t,e,i){i||(t=this.cacheBust(t));var r=this,s=document.getElementsByTagName("head")[0],o=document.createElement("script");return o.type="text/javascript",i?i.callback(function(i){n.log("[EXEC] "+t);var r=Function("code","eval(code)");r(i),e()}):(n.log("[LOAD] "+t),o.src=t,o.onload=o.onreadystatechange=function(){var t=o.readyState,n=o.status;(!t||"loaded"===t||"complete"===t||4===t&&200===n)&&(e(),o.onload=o.onreadystatechange=r._K,s=null,o=null)},s.appendChild(o),void 0)},loadStyle:function(t){var e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=this.cacheBust(t),document.getElementsByTagName("head")[0].appendChild(e)},_K:function(){}},n.loader=n.BrowserLoader;var l={__FILE__:function(){return n.loader.__FILE__()},pkg:function(t,e){var i=e?n._getByPath(e):n._getByName(t);return i.provides(t),i},file:function(){for(var t=[],e=arguments.length;e--;)t[e]=i(arguments[e]);return n._getByPath.apply(n,t)},load:function(t,e){n.loader.loadFile(t,e)},autoload:function(t,e){n._autoload(t,e)}};l.files=l.file,l.loader=l.file;var h=function(t){t.call(l)},c=function(t){for(var e=[],n=0;"string"==typeof t[n];)e.push(t[n]),n+=1;return{files:e,callback:t[n],context:t[n+1]}};e.load=function(){var t=c(arguments),e=t.files.length,i=function(r){return r===e?t.callback.call(t.context):(n.loader.loadFile(t.files[r],function(){i(r+1)}),void 0)};i(0)},e.require=function(){var t=c(arguments);return n.when({complete:t.files},function(e){t.callback&&t.callback.apply(t.context,e&&e.complete)}),this},e.Package=n,e.Packages=e.packages=h,e.DSL=l});
|
2
|
+
//@ sourceMappingURL=package-browser.js.map
|
@@ -1,3 +1,9 @@
|
|
1
|
+
Faye.random = function() {
|
2
|
+
var s = '', i = 40;
|
3
|
+
while (i--) s += Math.floor(Math.random() * 16).toString(16);
|
4
|
+
return s;
|
5
|
+
};
|
6
|
+
|
1
7
|
Terminus = {
|
2
8
|
isIE: /\bMSIE\b/.test(navigator.userAgent),
|
3
9
|
|
@@ -153,24 +159,24 @@ Terminus = {
|
|
153
159
|
|
154
160
|
getAttribute: function(node, name) {
|
155
161
|
return Terminus.isIE ? (node.getAttributeNode(name) || {}).nodeValue || false
|
156
|
-
: node.getAttribute(name);
|
162
|
+
: node.getAttribute(name) || false;
|
157
163
|
},
|
158
164
|
|
159
|
-
hideNodes: function(root, list) {
|
165
|
+
hideNodes: function(root, hide, list) {
|
160
166
|
if (!root) return list;
|
161
167
|
list = list || [];
|
162
168
|
|
163
169
|
var isScript = (root.tagName || '').toLowerCase() === 'script',
|
164
|
-
isHidden = (root.style || {}).display === 'none';
|
170
|
+
isHidden = (root.style || {}).display === 'none' || root.hidden;
|
165
171
|
|
166
|
-
if (isScript || isHidden) {
|
172
|
+
if (isScript || (hide && isHidden)) {
|
167
173
|
var parent = root.parentNode, next = root.nextSibling;
|
168
174
|
if (!isScript) list.push([root, parent, next]);
|
169
175
|
if (parent) parent.removeChild(root);
|
170
176
|
} else {
|
171
177
|
var children = root.childNodes || [];
|
172
178
|
for (var i = 0, n = children.length; i < n; i++) {
|
173
|
-
this.hideNodes(children[i], list);
|
179
|
+
this.hideNodes(children[i], hide, list);
|
174
180
|
}
|
175
181
|
}
|
176
182
|
return list;
|
@@ -242,10 +248,10 @@ Terminus = {
|
|
242
248
|
|
243
249
|
Syn.trigger('click', {}, element);
|
244
250
|
|
245
|
-
if (options.resynchronize
|
251
|
+
if (!options.resynchronize) return callback(true);
|
246
252
|
|
247
253
|
if (timeout)
|
248
|
-
Terminus.Worker.
|
254
|
+
Terminus.Worker.timeout.call(window, function() {
|
249
255
|
callback('failed to resynchronize, ajax request timed out');
|
250
256
|
}, 1000 * timeout);
|
251
257
|
|
@@ -280,7 +286,21 @@ Terminus = {
|
|
280
286
|
callback(true);
|
281
287
|
},
|
282
288
|
|
283
|
-
|
289
|
+
find_css: function(css, nodeId, callback) {
|
290
|
+
var root = nodeId ? this._node(nodeId) : document;
|
291
|
+
if (!root || !root.querySelectorAll) return callback([]);
|
292
|
+
|
293
|
+
var result = root.querySelectorAll(css),
|
294
|
+
list = [];
|
295
|
+
|
296
|
+
for (var i = 0, n = result.length; i < n; i++) {
|
297
|
+
list[i] = Terminus.Registry.put(result[i]);
|
298
|
+
}
|
299
|
+
|
300
|
+
callback(list);
|
301
|
+
},
|
302
|
+
|
303
|
+
find_xpath: function(xpath, nodeId, callback) {
|
284
304
|
var root = nodeId ? this._node(nodeId) : document;
|
285
305
|
if (!root) return callback([]);
|
286
306
|
|
@@ -291,7 +311,18 @@ Terminus = {
|
|
291
311
|
while (element = result.iterateNext())
|
292
312
|
list.push(Terminus.Registry.put(element));
|
293
313
|
|
294
|
-
|
314
|
+
callback(list);
|
315
|
+
},
|
316
|
+
|
317
|
+
is_disabled: function(nodeId, callback) {
|
318
|
+
var node = this._node(nodeId);
|
319
|
+
if (!node) return callback(null);
|
320
|
+
|
321
|
+
while (node.tagName && node.tagName.toLowerCase() !== 'body') {
|
322
|
+
if (Terminus.getAttribute(node, 'disabled')) return callback(true);
|
323
|
+
node = node.parentNode;
|
324
|
+
}
|
325
|
+
callback(false);
|
295
326
|
},
|
296
327
|
|
297
328
|
is_visible: function(nodeId, callback) {
|
@@ -299,7 +330,7 @@ Terminus = {
|
|
299
330
|
if (!node) return callback(null);
|
300
331
|
|
301
332
|
while (node.tagName && node.tagName.toLowerCase() !== 'body') {
|
302
|
-
if (node.style.display === 'none' || node.type === 'hidden')
|
333
|
+
if (node.hidden || node.style.display === 'none' || node.type === 'hidden')
|
303
334
|
return callback(false);
|
304
335
|
node = node.parentNode;
|
305
336
|
}
|
@@ -320,10 +351,16 @@ Terminus = {
|
|
320
351
|
|
321
352
|
if (!field) return callback(null);
|
322
353
|
if (field.type === 'file') return callback('not_allowed');
|
354
|
+
if (Terminus.getAttribute(field, 'readonly')) return callback(true);
|
323
355
|
|
324
356
|
Syn.trigger('focus', {}, field);
|
325
357
|
Syn.trigger('click', {}, field);
|
326
358
|
|
359
|
+
if (typeof value === 'number') value = value.toString();
|
360
|
+
|
361
|
+
if (String(field.contentEditable) === 'true')
|
362
|
+
field.innerHTML = value;
|
363
|
+
|
327
364
|
switch (typeof value) {
|
328
365
|
case 'string':
|
329
366
|
if (max) value = value.substr(0, parseInt(max));
|
@@ -343,11 +380,11 @@ Terminus = {
|
|
343
380
|
callback(node.tagName.toLowerCase());
|
344
381
|
},
|
345
382
|
|
346
|
-
text: function(nodeId, callback) {
|
383
|
+
text: function(nodeId, hide, callback) {
|
347
384
|
var node = this._node(nodeId);
|
348
385
|
if (!node) return callback(null);
|
349
386
|
|
350
|
-
var hidden = Terminus.hideNodes(node),
|
387
|
+
var hidden = Terminus.hideNodes(node, hide),
|
351
388
|
title = document.title;
|
352
389
|
|
353
390
|
document.title = '';
|
@@ -361,6 +398,10 @@ Terminus = {
|
|
361
398
|
callback(text);
|
362
399
|
},
|
363
400
|
|
401
|
+
title: function(callback) {
|
402
|
+
callback(document.title);
|
403
|
+
},
|
404
|
+
|
364
405
|
trigger: function(nodeId, eventType, callback) {
|
365
406
|
var node = this._node(nodeId);
|
366
407
|
if (!node) return callback(null);
|
@@ -434,10 +475,7 @@ Terminus = {
|
|
434
475
|
|
435
476
|
callback: function(callback, scope) {
|
436
477
|
if (this._pending === 0) {
|
437
|
-
|
438
|
-
this._setTimeout.call(window, function() { callback.call(scope) }, 0);
|
439
|
-
else
|
440
|
-
setTimeout(function() { callback.call(scope) }, 0);
|
478
|
+
Terminus.Worker.timeout(function() { callback.call(scope) }, 0);
|
441
479
|
} else {
|
442
480
|
this._callbacks.push([callback, scope]);
|
443
481
|
}
|
@@ -460,6 +498,13 @@ Terminus = {
|
|
460
498
|
this._callbacks = [];
|
461
499
|
},
|
462
500
|
|
501
|
+
timeout: function(fn, time) {
|
502
|
+
if (this._setTimeout)
|
503
|
+
this._setTimeout.call(window, fn, time);
|
504
|
+
else
|
505
|
+
setTimeout(fn, time);
|
506
|
+
},
|
507
|
+
|
463
508
|
_wrapTimeouts: function() {
|
464
509
|
var timeout = window.setTimeout,
|
465
510
|
clear = window.clearTimeout,
|
@@ -515,7 +560,7 @@ Terminus = {
|
|
515
560
|
options.complete = function() {
|
516
561
|
var result;
|
517
562
|
try {
|
518
|
-
result = complete.apply(this, arguments);
|
563
|
+
if (complete) result = complete.apply(this, arguments);
|
519
564
|
} finally {
|
520
565
|
if (monitor) Terminus.Worker.resume();
|
521
566
|
}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
origin = 'http://' + host + ':' + <%= Terminus.port %>;
|
5
5
|
|
6
6
|
var withPackageManager = function(callback) {
|
7
|
-
if (window.JS && JS.
|
7
|
+
if (window.JS && JS.packages) return callback();
|
8
8
|
|
9
9
|
var script = document.createElement('script'),
|
10
10
|
head = document.getElementsByTagName('head')[0];
|
@@ -23,9 +23,9 @@
|
|
23
23
|
};
|
24
24
|
|
25
25
|
withPackageManager(function() {
|
26
|
-
JS.
|
26
|
+
JS.cache = false;
|
27
27
|
|
28
|
-
JS.
|
28
|
+
JS.packages(function() { with(this) {
|
29
29
|
file(origin + faye + '/client.js').provides('Faye', 'Faye.Client');
|
30
30
|
file(origin + '/compiled/terminus-min.js').requires('Faye.Client').provides('Terminus');
|
31
31
|
}});
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<h1><a href="javascript:<%= bootstrap %>">Terminus</a></h1>
|
14
14
|
|
15
15
|
<p><a href="http://terminus.jcoglan.com">Terminus</a><br>
|
16
|
-
Copyright © 2010–
|
16
|
+
Copyright © 2010–2013 <a href="http://jcoglan.com">James Coglan</a><br>
|
17
17
|
Released under the MIT license</p>
|
18
18
|
|
19
19
|
</body>
|
metadata
CHANGED
@@ -1,222 +1,195 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terminus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.6.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- James Coglan
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-12-23 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: capybara
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 0.4.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 0.4.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: childprocess
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: 0.3.0
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: 0.3.0
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: cookiejar
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: 0.3.0
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: 0.3.0
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: faye
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - '>='
|
68
60
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
61
|
+
version: 1.0.0
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - '>='
|
76
67
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.
|
68
|
+
version: 1.0.0
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: oyster
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - '>='
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: 0.9.0
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - '>='
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: 0.9.0
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: packr
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - '>='
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: 3.1.0
|
102
90
|
type: :runtime
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - '>='
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: 3.1.0
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: rack
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - '>='
|
116
102
|
- !ruby/object:Gem::Version
|
117
103
|
version: 1.0.0
|
118
104
|
type: :runtime
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- -
|
108
|
+
- - '>='
|
124
109
|
- !ruby/object:Gem::Version
|
125
110
|
version: 1.0.0
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: rack-proxy
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
|
-
- -
|
115
|
+
- - '>='
|
132
116
|
- !ruby/object:Gem::Version
|
133
117
|
version: 0.3.0
|
134
118
|
type: :runtime
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
|
-
- -
|
122
|
+
- - '>='
|
140
123
|
- !ruby/object:Gem::Version
|
141
124
|
version: 0.3.0
|
142
125
|
- !ruby/object:Gem::Dependency
|
143
126
|
name: sinatra
|
144
127
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
128
|
requirements:
|
147
|
-
- -
|
129
|
+
- - '>='
|
148
130
|
- !ruby/object:Gem::Version
|
149
131
|
version: 1.0.0
|
150
132
|
type: :runtime
|
151
133
|
prerelease: false
|
152
134
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
135
|
requirements:
|
155
|
-
- -
|
136
|
+
- - '>='
|
156
137
|
- !ruby/object:Gem::Version
|
157
138
|
version: 1.0.0
|
158
139
|
- !ruby/object:Gem::Dependency
|
159
140
|
name: thin
|
160
141
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
142
|
requirements:
|
163
|
-
- -
|
143
|
+
- - '>='
|
164
144
|
- !ruby/object:Gem::Version
|
165
145
|
version: 1.2.0
|
166
146
|
type: :runtime
|
167
147
|
prerelease: false
|
168
148
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
149
|
requirements:
|
171
|
-
- -
|
150
|
+
- - '>='
|
172
151
|
- !ruby/object:Gem::Version
|
173
152
|
version: 1.2.0
|
174
153
|
- !ruby/object:Gem::Dependency
|
175
154
|
name: useragent
|
176
155
|
requirement: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
156
|
requirements:
|
179
|
-
- -
|
157
|
+
- - '>='
|
180
158
|
- !ruby/object:Gem::Version
|
181
159
|
version: 0.3.0
|
182
160
|
type: :runtime
|
183
161
|
prerelease: false
|
184
162
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
none: false
|
186
163
|
requirements:
|
187
|
-
- -
|
164
|
+
- - '>='
|
188
165
|
- !ruby/object:Gem::Version
|
189
166
|
version: 0.3.0
|
190
167
|
- !ruby/object:Gem::Dependency
|
191
168
|
name: rake
|
192
169
|
requirement: !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
170
|
requirements:
|
195
|
-
- -
|
171
|
+
- - '>='
|
196
172
|
- !ruby/object:Gem::Version
|
197
173
|
version: '0'
|
198
174
|
type: :development
|
199
175
|
prerelease: false
|
200
176
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
-
none: false
|
202
177
|
requirements:
|
203
|
-
- -
|
178
|
+
- - '>='
|
204
179
|
- !ruby/object:Gem::Version
|
205
180
|
version: '0'
|
206
181
|
- !ruby/object:Gem::Dependency
|
207
182
|
name: rspec
|
208
183
|
requirement: !ruby/object:Gem::Requirement
|
209
|
-
none: false
|
210
184
|
requirements:
|
211
|
-
- -
|
185
|
+
- - '>='
|
212
186
|
- !ruby/object:Gem::Version
|
213
187
|
version: '0'
|
214
188
|
type: :development
|
215
189
|
prerelease: false
|
216
190
|
version_requirements: !ruby/object:Gem::Requirement
|
217
|
-
none: false
|
218
191
|
requirements:
|
219
|
-
- -
|
192
|
+
- - '>='
|
220
193
|
- !ruby/object:Gem::Version
|
221
194
|
version: '0'
|
222
195
|
description:
|
@@ -225,9 +198,9 @@ executables:
|
|
225
198
|
- terminus
|
226
199
|
extensions: []
|
227
200
|
extra_rdoc_files:
|
228
|
-
- README.
|
201
|
+
- README.md
|
229
202
|
files:
|
230
|
-
- README.
|
203
|
+
- README.md
|
231
204
|
- bin/terminus
|
232
205
|
- lib/capybara/driver/terminus.rb
|
233
206
|
- lib/terminus/application.rb
|
@@ -236,8 +209,6 @@ files:
|
|
236
209
|
- lib/terminus/client/phantom.js
|
237
210
|
- lib/terminus/client/phantomjs.rb
|
238
211
|
- lib/terminus/client.rb
|
239
|
-
- lib/terminus/connector/server.rb
|
240
|
-
- lib/terminus/connector/socket_handler.rb
|
241
212
|
- lib/terminus/connector.rb
|
242
213
|
- lib/terminus/controller.rb
|
243
214
|
- lib/terminus/headers.rb
|
@@ -260,23 +231,6 @@ files:
|
|
260
231
|
- lib/terminus/views/index.erb
|
261
232
|
- lib/terminus/views/infinite.html
|
262
233
|
- lib/terminus.rb
|
263
|
-
- spec/1.1/reports/android.txt
|
264
|
-
- spec/1.1/reports/chrome.txt
|
265
|
-
- spec/1.1/reports/firefox.txt
|
266
|
-
- spec/1.1/reports/opera.txt
|
267
|
-
- spec/1.1/reports/phantomjs.txt
|
268
|
-
- spec/1.1/reports/safari.txt
|
269
|
-
- spec/1.1/spec_helper.rb
|
270
|
-
- spec/1.1/terminus_driver_spec.rb
|
271
|
-
- spec/1.1/terminus_session_spec.rb
|
272
|
-
- spec/2.0/reports/android.txt
|
273
|
-
- spec/2.0/reports/chrome.txt
|
274
|
-
- spec/2.0/reports/firefox.txt
|
275
|
-
- spec/2.0/reports/opera.txt
|
276
|
-
- spec/2.0/reports/phantomjs.txt
|
277
|
-
- spec/2.0/reports/safari.txt
|
278
|
-
- spec/2.0/spec_helper.rb
|
279
|
-
- spec/2.0/terminus_spec.rb
|
280
234
|
- lib/terminus/public/syn/synthetic.js
|
281
235
|
- lib/terminus/public/syn/mouse.js
|
282
236
|
- lib/terminus/public/syn/browsers.js
|
@@ -284,28 +238,29 @@ files:
|
|
284
238
|
- lib/terminus/public/syn/drag/drag.js
|
285
239
|
homepage: http://terminus.jcoglan.com
|
286
240
|
licenses: []
|
241
|
+
metadata: {}
|
287
242
|
post_install_message:
|
288
243
|
rdoc_options:
|
289
244
|
- --main
|
290
|
-
- README.
|
245
|
+
- README.md
|
246
|
+
- --markup
|
247
|
+
- markdown
|
291
248
|
require_paths:
|
292
249
|
- lib
|
293
250
|
required_ruby_version: !ruby/object:Gem::Requirement
|
294
|
-
none: false
|
295
251
|
requirements:
|
296
|
-
- -
|
252
|
+
- - '>='
|
297
253
|
- !ruby/object:Gem::Version
|
298
254
|
version: '0'
|
299
255
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
300
|
-
none: false
|
301
256
|
requirements:
|
302
|
-
- -
|
257
|
+
- - '>='
|
303
258
|
- !ruby/object:Gem::Version
|
304
259
|
version: '0'
|
305
260
|
requirements: []
|
306
261
|
rubyforge_project:
|
307
|
-
rubygems_version:
|
262
|
+
rubygems_version: 2.0.14
|
308
263
|
signing_key:
|
309
|
-
specification_version:
|
264
|
+
specification_version: 4
|
310
265
|
summary: Capybara driver for cross-browser and remote scripting
|
311
266
|
test_files: []
|