| CARVIEW |
=0&&y<=1&&A>=0&&A<=1&&(d?n++:n.push({x:x.x,y:x.y,t1:y,t2:A}))}}return n}function bF(a,b){return bG(a,b,1)}function bE(a,b){return bG(a,b)}function bD(a,b,c,d,e,f,g,h){if(!(x(a,c)x(e,g)||x(b,d) x(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(!k)return;var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(n<+y(a,c).toFixed(2)||n>+x(a,c).toFixed(2)||n<+y(e,g).toFixed(2)||n>+x(e,g).toFixed(2)||o<+y(b,d).toFixed(2)||o>+x(b,d).toFixed(2)||o<+y(f,h).toFixed(2)||o>+x(f,h).toFixed(2))return;return{x:l,y:m}}}function bC(a,b,c,d,e,f,g,h,i){if(!(i<0||bB(a,b,c,d,e,f,g,h)n)k/=2,l+=(m1?1:i<0?0:i;var j=i/2,k=12,l=[-0.1252,.1252,-0.3678,.3678,-0.5873,.5873,-0.7699,.7699,-0.9041,.9041,-0.9816,.9816],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],n=0;for(var o=0;o d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}function bx(){return this.hex}function bv(a,b,c){function d(){var e=Array.prototype.slice.call(arguments,0),f=e.join("␀"),h=d.cache=d.cache||{},i=d.count=d.count||[];if(h[g](f)){bu(i,f);return c?c(h[f]):h[f]}i.length>=1e3&&delete h[i.shift()],i.push(f),h[f]=a[m](b,e);return c?c(h[f]):h[f]}return d}function bu(a,b){for(var c=0,d=a.length;c ',bl=bk.firstChild,bl.style.behavior="url(#default#VML)";if(!bl||typeof bl.adj!="object")return a.type=p;bk=null}a.svg=!(a.vml=a.type=="VML"),a._Paper=j,a.fn=k=j.prototype=a.prototype,a._id=0,a._oid=0,a.is=function(a,b){b=v.call(b);if(b=="finite")return!M[g](+a);if(b=="array")return a instanceof Array;return b=="null"&&a===null||b==typeof a&&a!==null||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||H.call(a).slice(8,-1).toLowerCase()==b},a.angle=function(b,c,d,e,f,g){if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return(180+w.atan2(-i,-h)*180/B+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)},a.rad=function(a){return a%360*B/180},a.deg=function(a){return a*180/B%360},a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,E)){var e=b.length;while(e--)if(z(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(f b-d)return c-f+b}return c};var bn=a.createUUID=function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=w.random()*16|0,c=a=="x"?b:b&3|8;return c.toString(16)});a.setWindow=function(b){eve("raphael.setWindow",a,h.win,b),h.win=b,h.doc=h.win.document,a._engine.initWin&&a._engine.initWin(h.win)};var bo=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write(""),e.close(),d=e.body}catch(f){d=createPopup().document.body}var g=d.createTextRange();bo=bv(function(a){try{d.style.color=r(a).replace(c,p);var b=g.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b.toString(16)).slice(-6)}catch(e){return"none"}})}else{var i=h.doc.createElement("i");i.title="Raphaël Colour Picker",i.style.display="none",h.doc.body.appendChild(i),bo=bv(function(a){i.style.color=a;return h.doc.defaultView.getComputedStyle(i,p).getPropertyValue("color")})}return bo(b)},bp=function(){return"hsb("+[this.h,this.s,this.b]+")"},bq=function(){return"hsl("+[this.h,this.s,this.l]+")"},br=function(){return this.hex},bs=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,D)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;return[b,c,d]},bt=function(b,c,d,e){b*=255,c*=255,d*=255;var f={r:b,g:c,b:d,hex:a.rgb(b,c,d),toString:br};a.is(e,"finite")&&(f.opacity=e);return f};a.color=function(b){var c;a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b?(c=a.hsb2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b?(c=a.hsl2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):(a.is(b,"string")&&(b=a.getRGB(b)),a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b?(c=a.rgb2hsl(b),b.h=c.h,b.s=c.s,b.l=c.l,c=a.rgb2hsb(b),b.v=c.b):(b={hex:"none"},b.r=b.g=b.b=b.h=b.s=b.v=b.l=-1)),b.toString=br;return b},a.hsb2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h,d=a.o),a*=360;var e,f,g,h,i;a=a%360/60,i=c*b,h=i*(1-z(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return bt(e,f,g,d)},a.hsl2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h);if(a>1||b>1||c>1)a/=360,b/=100,c/=100;a*=360;var e,f,g,h,i;a=a%360/60,i=2*b*(c<.5?c:1-c),h=i*(1-z(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return bt(e,f,g,d)},a.rgb2hsb=function(a,b,c){c=bs(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;f=x(a,b,c),g=f-y(a,b,c),d=g==0?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=g==0?0:g/f;return{h:d,s:e,b:f,toString:bp}},a.rgb2hsl=function(a,b,c){c=bs(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;g=x(a,b,c),h=y(a,b,c),i=g-h,d=i==0?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=i==0?0:f<.5?i/(2*f):i/(2-2*f);return{h:d,s:e,l:f,toString:bq}},a._path2string=function(){return this.join(",").replace(Y,"$1")};var bw=a._preload=function(a,b){var c=h.doc.createElement("img");c.style.cssText="position:absolute;left:-9999em;top:-9999em",c.onload=function(){b.call(this),this.onload=null,h.doc.body.removeChild(this)},c.onerror=function(){h.doc.body.removeChild(this)},h.doc.body.appendChild(c),c.src=a};a.getRGB=bv(function(b){if(!b||!!((b=r(b)).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bx};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:bx};!X[g](b.toLowerCase().substring(0,2))&&b.charAt()!="#"&&(b=bo(b));var c,d,e,f,h,i,j,k=b.match(L);if(k){k[2]&&(f=R(k[2].substring(5),16),e=R(k[2].substring(3,5),16),d=R(k[2].substring(1,3),16)),k[3]&&(f=R((i=k[3].charAt(3))+i,16),e=R((i=k[3].charAt(2))+i,16),d=R((i=k[3].charAt(1))+i,16)),k[4]&&(j=k[4][s](W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),k[1].toLowerCase().slice(0,4)=="rgba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100));if(k[5]){j=k[5][s](W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,f,h)}if(k[6]){j=k[6][s](W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsla"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,f,h)}k={r:d,g:e,b:f,toString:bx},k.hex="#"+(16777216|f|e<<8|d<<16).toString(16).slice(1),a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bx}},a),a.hsb=bv(function(b,c,d){return a.hsb2rgb(b,c,d).hex}),a.hsl=bv(function(b,c,d){return a.hsl2rgb(b,c,d).hex}),a.rgb=bv(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b}));return c.hex},a.getColor.reset=function(){delete this.start},a.parsePathString=function(b){if(!b)return null;var c=bz(b);if(c.arr)return bJ(c.arr);var d={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[];a.is(b,E)&&a.is(b[0],E)&&(e=bJ(b)),e.length||r(b).replace(Z,function(a,b,c){var f=[],g=b.toLowerCase();c.replace(_,function(a,b){b&&f.push(+b)}),g=="m"&&f.length>2&&(e.push([b][n](f.splice(0,2))),g="l",b=b=="m"?"l":"L");if(g=="r")e.push([b][n](f));else while(f.length>=d[g]){e.push([b][n](f.splice(0,d[g])));if(!d[g])break}}),e.toString=a._path2string,c.arr=bJ(e);return e},a.parseTransformString=bv(function(b){if(!b)return null;var c={r:3,s:4,t:2,m:6},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=bJ(b)),d.length||r(b).replace($,function(a,b,c){var e=[],f=v.call(b);c.replace(_,function(a,b){b&&e.push(+b)}),d.push([b][n](e))}),d.toString=a._path2string;return d});var bz=function(a){var b=bz.ps=bz.ps||{};b[a]?b[a].sleep=100:b[a]={sleep:100},setTimeout(function(){for(var c in b)b[g](c)&&c!=a&&(b[c].sleep--,!b[c].sleep&&delete b[c])});return b[a]};a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=A(j,3),l=A(j,2),m=i*i,n=m*i,o=k*a+l*3*i*c+j*3*i*i*e+n*g,p=k*b+l*3*i*d+j*3*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,x=j*e+i*g,y=j*f+i*h,z=90-w.atan2(q-s,r-t)*180/B;(q>s||r =a.x&&b<=a.x2&&c>=a.y&&c<=a.y2},a.isBBoxIntersect=function(b,c){var d=a.isPointInsideBBox;return d(c,b.x,b.y)||d(c,b.x2,b.y)||d(c,b.x,b.y2)||d(c,b.x2,b.y2)||d(b,c.x,c.y)||d(b,c.x2,c.y)||d(b,c.x,c.y2)||d(b,c.x2,c.y2)||(b.x c.x||c.x b.x)&&(b.y c.y||c.y b.y)},a.pathIntersection=function(a,b){return bH(a,b)},a.pathIntersectionNumber=function(a,b){return bH(a,b,1)},a.isPointInsidePath=function(b,c,d){var e=a.pathBBox(b);return a.isPointInsideBBox(e,c,d)&&bH(b,[["M",c,d],["H",e.x2+10]],1)%2==1},a._removedFactory=function(a){return function(){eve("raphael.log",null,"Raphaël: you are calling to method “"+a+"” of removed object",a)}};var bI=a.pathBBox=function(a){var b=bz(a);if(b.bbox)return b.bbox;if(!a)return{x:0,y:0,width:0,height:0,x2:0,y2:0};a=bR(a);var c=0,d=0,e=[],f=[],g;for(var h=0,i=a.length;h1&&(v=w.sqrt(v),c=v*c,d=v*d);var x=c*c,y=d*d,A=(f==g?-1:1)*w.sqrt(z((x*y-x*u*u-y*t*t)/(x*u*u+y*t*t))),C=A*c*u/d+(a+h)/2,D=A*-d*t/c+(b+i)/2,E=w.asin(((b-D)/d).toFixed(9)),F=w.asin(((i-D)/d).toFixed(9));E=a F&&(E=E-B*2),!g&&F>E&&(F=F-B*2)}else E=j[0],F=j[1],C=j[2],D=j[3];var G=F-E;if(z(G)>k){var H=F,I=h,J=i;F=E+k*(g&&F>E?1:-1),h=C+c*w.cos(F),i=D+d*w.sin(F),m=bO(h,i,c,d,e,0,g,I,J,[F,H,C,D])}G=F-E;var K=w.cos(E),L=w.sin(E),M=w.cos(F),N=w.sin(F),O=w.tan(G/4),P=4/3*c*O,Q=4/3*d*O,R=[a,b],S=[a+P*L,b-Q*K],T=[h+P*N,i-Q*M],U=[h,i];S[0]=2*R[0]-S[0],S[1]=2*R[1]-S[1];if(j)return[S,T,U][n](m);m=[S,T,U][n](m).join()[s](",");var V=[];for(var W=0,X=m.length;W "1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bP(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bP(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y)),i=f-2*d+b-(h-2*f+d),j=2*(d-b)-2*(f-d),k=b-d,l=(-j+w.sqrt(j*j-4*i*k))/2/i,n=(-j-w.sqrt(j*j-4*i*k))/2/i,z(l)>"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bP(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bP(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y));return{min:{x:y[m](0,p),y:y[m](0,o)},max:{x:x[m](0,p),y:x[m](0,o)}}}),bR=a._path2curve=bv(function(a,b){var c=!b&&bz(a);if(!b&&c.curve)return bJ(c.curve);var d=bL(a),e=b&&bL(b),f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},h=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][n](bO[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][n](bN(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][n](bN(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](bM(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](bM(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](bM(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](bM(b.x,b.y,b.X,b.Y))}return a},i=function(a,b){if(a[b].length>7){a[b].shift();var c=a[b];while(c.length)a.splice(b++,0,["C"][n](c.splice(0,6)));a.splice(b,1),l=x(d.length,e&&e.length||0)}},j=function(a,b,c,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),c.bx=0,c.by=0,c.x=a[g][1],c.y=a[g][2],l=x(d.length,e&&e.length||0))};for(var k=0,l=x(d.length,e&&e.length||0);k e){if(c&&!l.start){m=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),k+=["C"+m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k,k=["M"+m.x,m.y+"C"+m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!b&&!c){m=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j,g=+i[5],h=+i[6]}k+=i.shift()+i}l.end=k,m=b?n:c?l:a.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},cu=ct(1),cv=ct(),cw=ct(0,1);a.getTotalLength=cu,a.getPointAtLength=cv,a.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return cw(a,b).end;var d=cw(a,c,1);return b?cw(d,b).end:d},cl.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return cu(this.attrs.path)}},cl.getPointAtLength=function(a){if(this.type=="path")return cv(this.attrs.path,a)},cl.getSubpath=function(b,c){if(this.type=="path")return a.getSubpath(this.attrs.path,b,c)};var cx=a.easing_formulas={linear:function(a){return a},"<":function(a){return A(a,1.7)},">":function(a){return A(a,.48)},"<>":function(a){var b=.48-a/1.04,c=w.sqrt(.1734+b*b),d=c-b,e=A(z(d),1/3)*(d<0?-1:1),f=-c-b,g=A(z(f),1/3)*(f<0?-1:1),h=e+g+.5;return(1-h)*3*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==!!a)return a;return A(2,-10*a)*w.sin((a-.075)*2*B/.3)+1},bounce:function(a){var b=7.5625,c=2.75,d;a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375);return d}};cx.easeIn=cx["ease-in"]=cx["<"],cx.easeOut=cx["ease-out"]=cx[">"],cx.easeInOut=cx["ease-in-out"]=cx["<>"],cx["back-in"]=cx.backIn,cx["back-out"]=cx.backOut;var cy=[],cz=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,16)},cA=function(){var b=+(new Date),c=0;for(;c 1&&!d.next){for(s in k)k[g](s)&&(r[s]=d.totalOrigin[s]);d.el.attr(r),cE(d.anim,d.el,d.anim.percents[0],null,d.totalOrigin,d.repeat-1)}d.next&&!d.stop&&cE(d.anim,d.el,d.next,null,d.totalOrigin,d.repeat)}}a.svg&&m&&m.paper&&m.paper.safari(),cy.length&&cz(cA)},cB=function(a){return a>255?255:a<0?0:a};cl.animateWith=function(b,c,d,e,f,g){var h=this;if(h.removed){g&&g.call(h);return h}var i=d instanceof cD?d:a.animation(d,e,f,g),j,k;cE(i,h,i.percents[0],null,h.attr());for(var l=0,m=cy.length;l .5)*2-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&n!=.5&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\s*\-\s*/);if(j=="linear"){var t=e.shift();t=-d(t);if(isNaN(t))return null;var u=[0,0,f.cos(a.rad(t)),f.sin(a.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=a._parseDots(e);if(!w)return null;k=k.replace(/[\(\)\s,\xb0#]/g,"_"),b.gradient&&k!=b.gradient.id&&(p.defs.removeChild(b.gradient),delete b.gradient);if(!b.gradient){s=q(j+"Gradient",{id:k}),b.gradient=s,q(s,j=="radial"?{fx:m,fy:n}:{x1:u[0],y1:u[1],x2:u[2],y2:u[3],gradientTransform:b.matrix.invert()}),p.defs.appendChild(s);for(var x=0,y=w.length;x 1?G.opacity/100:G.opacity});case"stroke":G=a.getRGB(p),i.setAttribute(o,G.hex),o=="stroke"&&G[b]("opacity")&&q(i,{"stroke-opacity":G.opacity>1?G.opacity/100:G.opacity}),o=="stroke"&&d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"gradient":(d.type=="circle"||d.type=="ellipse"||c(p).charAt()!="r")&&r(d,p);break;case"opacity":k.gradient&&!k[b]("stroke-opacity")&&q(i,{"stroke-opacity":p>1?p/100:p});case"fill-opacity":if(k.gradient){H=a._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l)),H&&(I=H.getElementsByTagName("stop"),q(I[I.length-1],{"stop-opacity":p}));break};default:o=="font-size"&&(p=e(p,10)+"px");var J=o.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});i.style[J]=p,d._.dirty=1,i.setAttribute(o,p)}}y(d,f),i.style.visibility=m},x=1.2,y=function(d,f){if(d.type=="text"&&!!(f[b]("text")||f[b]("font")||f[b]("font-size")||f[b]("x")||f[b]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(a._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue("font-size"),10):10;if(f[b]("text")){g.text=f.text;while(h.firstChild)h.removeChild(h.firstChild);var j=c(f.text).split("\n"),k=[],m;for(var n=0,o=j.length;n "));var $=X.getBoundingClientRect();t.W=m.w=($.right-$.left)/Y,t.H=m.h=($.bottom-$.top)/Y,t.X=m.x,t.Y=m.y+t.H/2,("x"in i||"y"in i)&&(t.path.v=a.format("m{0},{1}l{2},{1}",f(m.x*u),f(m.y*u),f(m.x*u)+1));var _=["x","y","text","font","font-family","font-weight","font-style","font-size"];for(var ba=0,bb=_.length;ba .25&&(c=e.sqrt(.25-i(b-.5,2))*((c>.5)*2-1)+.5),m=b+n+c);return o}),f=f.split(/\s*\-\s*/);if(l=="linear"){var p=f.shift();p=-d(p);if(isNaN(p))return null}var q=a._parseDots(f);if(!q)return null;b=b.shape||b.node;if(q.length){b.removeChild(g),g.on=!0,g.method="none",g.color=q[0].color,g.color2=q[q.length-1].color;var r=[];for(var s=0,t=q.length;s ')}}catch(c){F=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},a._engine.initWin(a._g.win),a._engine.create=function(){var b=a._getContainer.apply(0,arguments),c=b.container,d=b.height,e,f=b.width,g=b.x,h=b.y;if(!c)throw new Error("VML container not found.");var i=new a._Paper,j=i.canvas=a._g.doc.createElement("div"),k=j.style;g=g||0,h=h||0,f=f||512,d=d||342,i.width=f,i.height=d,f==+f&&(f+="px"),d==+d&&(d+="px"),i.coordsize=u*1e3+n+u*1e3,i.coordorigin="0 0",i.span=a._g.doc.createElement("span"),i.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",j.appendChild(i.span),k.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d),c==1?(a._g.doc.body.appendChild(j),k.left=g+"px",k.top=h+"px",k.position="absolute"):c.firstChild?c.insertBefore(j,c.firstChild):c.appendChild(j),i.renderfix=function(){};return i},a.prototype.clear=function(){a.eve("raphael.clear",this),this.canvas.innerHTML=o,this.span=a._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},a.prototype.remove=function(){a.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]=typeof this[b]=="function"?a._removedFactory(b):null;return!0};var G=a.st;for(var H in E)E[b](H)&&!G[b](H)&&(G[H]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(H))}(window.Raphael) ; window.polyjs=function(X){if(!X){var c={};(function(){var n=[].indexOf||function(c){for(var l=0,d=this.length;l r[0].val||b[0].val===r[0].val&& ("lt"===b[0].key||"gt"===r[0].key)))throw"No intersection found!";return e};e={};for(a in c)h=c[a],e[a]=a in l?"in"in c[a]?b(a):d(a):h;for(a in l)h=l[a],a in e||(e[a]=h);return e};c.linear=function(n,l,d,b){if(_.isFinite(n)&&_.isFinite(l)&&_.isFinite(d)&&_.isFinite(b))return function(a){return(b-l)/(d-n)*(a-n)+l};throw c.error.input("Attempting to create linear function from infinity");};c.median=function(c,l){var d;null==l&&(l=!1);l||(c=_.sortBy(c,function(b){return b}));d=c.length/2;return 0!== d%1?c[Math.floor(d)]:(c[d-1]+c[d])/2};c.counter=function(){var c;c=0;return function(){return c++}};c.sample=function(c,l){return _.pick(c,_.shuffle(_.keys(c)).splice(0,l))};c.compare=function(c,l){var d,b,a,e,h,k,m,t,p;p=_.sortBy(c,function(a){return a});t=_.sortBy(l,function(a){return a});b=[];a=[];d=[];for(m=h=0;m =p.length)d.push(e),h+=1;else if(h>=t.length)b.push(k),m+=1;else if(k e)d.push(e),h+=1;else if(k===e)a.push(k),m+= 1,h+=1;else throw DataError("Unknown data encounted");return{deleted:b,kept:a,added:d}};c.flatten=function(n){var l,d,b,a;l=[];if(null!=n)if(_.isObject(n))if("scalefn"===n.t)"novalue"!==n.f&&l.push(n.v);else for(d in n)b=n[d],l=l.concat(c.flatten(b));else if(_.isArray(n))for(d=0,a=n.length;dc?6*c:5*(c-10)+60};c.sortArrays=function(c,l){var d;d=_.zip.apply(_,l);d.sort(function(b,a){return c(b[0],a[0])});return _.zip.apply(_,d)};c.isDefined=function(n){return _.isObject(n)?"scalefn"===n.t&&"novalue"!==n.f?c.isDefined(n.v):!0:void 0!==n&&null!==n&&!(_.isNumber(n)&&_.isNaN(n))};c.isURI=function(c){var l;return _.isString(c)?(l=RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$", "i"),l.test(c)):!1}}).call(this);(function(){c["const"]={aes:"x y color size opacity shape id text".split(" "),pivot_aes:["row","column","value"],noDomain:["id","text","tooltip"],noLegend:["x","y","id","text","tooltip"],trans:{bin:["key","binwidth"],lag:["key","lag"]},stat:{count:["key"],unique:["key"],sum:["key"],mean:["key"],box:["key"],median:["key"]},timerange:"second minute hour day week month twomonth quarter sixmonth year twoyear fiveyear decade".split(" "),approxTimeInSeconds:{second:1,minute:60, hour:3600,day:86400,week:604800,month:2592E3,twomonth:5184E3,quarter:10368E3,sixmonth:15552E3,year:31536E3,twoyear:63072E3,fiveyear:157766400},sort:{key:null,sort:null,limit:null,asc:!1},scaleFns:{novalue:function(){return{v:null,f:"novalue",t:"scalefn"}},max:function(c){return{v:c,f:"max",t:"scalefn"}},min:function(c){return{v:c,f:"min",t:"scalefn"}},upper:function(c,s,l){return{v:c,n:s,m:l,f:"upper",t:"scalefn"}},lower:function(c,s,l){return{v:c,n:s,m:l,f:"lower",t:"scalefn"}},middle:function(c){return{v:c, f:"middle",t:"scalefn"}},jitter:function(c){return{v:c,f:"jitter",t:"scalefn"}},identity:function(c){return{v:c,f:"identity",t:"scalefn"}}},epsilon:Math.pow(10,-7),defaults:{x:{v:null,f:"novalue",t:"scalefn"},y:{v:null,f:"novalue",t:"scalefn"},color:"steelblue",size:2,opacity:0.7}}}).call(this);(function(){var n,s,l,d,b,a,e,h,k,m={}.hasOwnProperty,t=function(a,b){function f(){this.constructor=a}for(var g in b)m.call(b,g)&&(a[g]=b[g]);f.prototype=b.prototype;a.prototype=new f;a.__super__=b.prototype; return a};s=function(a){function b(f){this.message=f;this.name="DefinitionError"}t(b,a);return b}(Error);l=function(a){function b(f){this.message=f;this.name="DependencyError"}t(b,a);return b}(Error);b=function(a){function b(f){this.message=f;this.name="ModeError"}t(b,a);return b}(Error);n=function(a){function b(f){this.message=f;this.name="DataError"}t(b,a);return b}(Error);k=function(a){function b(f){this.message=f;this.name="UnknownInput"}t(b,a);return b}(Error);a=function(a){function b(f){this.message= f;this.name="ModeError"}t(b,a);return b}(Error);e=function(a){function b(f){this.message=f;this.name="ScaleError"}t(b,a);return b}(Error);d=function(a){function b(f){this.message=f;this.name="MissingData"}t(b,a);return b}(Error);h=function(a){function b(f){this.message=f;this.name="Type"}t(b,a);return b}(Error);c.error=function(a){return Error(a)};c.error.data=function(a){return new n(a)};c.error.depn=function(a){return new l(a)};c.error.defn=function(a){return new s(a)};c.error.mode=function(a){return new b(a)}; c.error.impl=function(b){return new a(b)};c.error.input=function(a){return new k(a)};c.error.scale=function(a){return new e(a)};c.error.missing=function(a){return new d(a)};c.error.type=function(a){return new h(a)}}).call(this);(function(){var n,s,l,d,b,a,e={}.hasOwnProperty,h=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);c.prototype=b.prototype;a.prototype=new c;a.__super__=b.prototype;return a},k=function(a,b){return function(){return a.apply(b,arguments)}}; d=function(){function a(){}a.prototype.render=function(){return c.error.impl()};a.prototype.dispose=function(){return c.error.impl()};return a}();s=function(a){function e(){return b=e.__super__.constructor.apply(this,arguments)}h(e,a);e.prototype.getDimension=function(){throw c.error.impl();};return e}(d);l=function(b){function e(){return a=e.__super__.constructor.apply(this,arguments)}h(e,b);e.prototype.getDimension=function(){throw c.error.impl();};e.prototype.make=function(){throw c.error.impl(); };return e}(d);n=function(a){function b(a){this.type=null!=a?a:null;this.dispose=k(this.dispose,this);this.geoms={};this.pts={}}h(b,a);b.prototype.set=function(a){return this.geoms=a};b.prototype.render=function(a){var b,f,g,q,e,v,d;e={};g=c.compare(_.keys(this.pts),_.keys(this.geoms));f=g.deleted;q=g.kept;b=g.added;v=0;for(d=f.length;v b.timeStamp-n.lastStart)return c.touchToMouse("click",n)}else if("touchcancel"===l)return window.clearTimeout(n.pressTimer),c.touchToMouse("mouseout",n),c.touchToMouse("mouseup",n,300)}}).call(this); (function(){var n,s,l;c.format=function(d,b){switch(d){case "cat":return c.format.identity;case "num":return c.format.number(b);case "date":return c.format.date(b);case "none":return c.format.identity}};c.format.identity=function(c){return c};n={0:"carview.php?tsp=",3:"k",6:"m",9:"b",12:"t"};l=function(c,b){return _.isUndefined(n[b])?c+"e"+(0c))+ e[0].slice(b).replace(/(\d{3})/g,",$1"),a=e.join("."));return a};c.format.getExp=function(c){return Math.floor(Math.log(Math.abs(0===c?1:c))/Math.LN10)};c.format.number=function(d){return function(b){var a,e;e=0;a=null!=d?d:c.format.getExp(b);null==d||2!==a&&5!==a&&8!==a&&11!==a?-1===a?(a=0,e=null!=d?1:2):-2===a?(a=0,e=null!=d?2:3):1===a||2===a?a=0:3a?a=3:6a?a=6:9a?a=9:12a?a=12:e=null!=d?0:1:(a+=1,e=1);b=Math.round(b/Math.pow(10,a-e));b/=Math.pow(10,e);b=b.toFixed(e);return l(s(b), a)}};c.format.date=function(d){return-1!==_.indexOf(c["const"].timerange,d)?"second"===d?function(b){return moment.unix(b).format("h:mm:ss a")}:"minute"===d?function(b){return moment.unix(b).format("h:mm a")}:"hour"===d?function(b){return moment.unix(b).format("MMM D h a")}:"day"===d||"week"===d?function(b){return moment.unix(b).format("MMM D")}:"month"===d||"twomonth"===d||"quarter"===d||"sixmonth"===d?function(b){return moment.unix(b).format("YYYY/MM")}:function(b){return moment.unix(b).format("YYYY")}: function(b){return moment.unix(b).format(d)}};c.format._number_instance=c.format.number();c.format.value=function(d){return _.isNumber(d)?c.format._number_instance(d):d}}).call(this);(function(){var n,s;c.type={};c.type.impute=function(c){var d,b,a,e,h,k;h=b=e=d=0;for(k=c.length;h 0.95*b?"num":d>0.95*b?"date":"cat"};c.type.coerce=function(c,d){if(_.isUndefined(c)||_.isNull(c)||"cat"=== d.type)return c;if("num"===d.type)return isNaN(c)?+("carview.php?tsp="+c).replace(/\$|\,/g,"carview.php?tsp="):+c;if("date"===d.type)return!_.isNumber(c)&&_.isEmpty(c)?null:d.format?"unix"===d.format?moment.unix(c).unix():moment(c,d.format).unix():isFinite(c)&&c>=Math.pow(10,9)?moment.unix(c).unix():moment(c).unix()};c.type.compare=function(c){switch(c){case "cat":return n;default:return s}};n=function(c,d){var b,a;if(c===d)return 0;_.isString(c)||(c="carview.php?tsp="+c);_.isString(d)||(d="carview.php?tsp="+d);b=c.toLowerCase();a=d.toLowerCase();return b===a? c d?1:0:ba?1:0};s=function(c,d){return c===d?0:null===c?1:null===d?-1:c d?1:0}}).call(this);(function(){var n,s,l,d,b,a,e=function(a,b){return function(){return a.apply(b,arguments)}},h={}.hasOwnProperty,k=function(a,b){function c(){this.constructor=a}for(var e in b)h.call(b,e)&&(a[e]=b[e]);c.prototype=b.prototype;a.prototype=new c;a.__super__=b.prototype;return a};c.spec={};c.spec.toStrictMode=function(a){var b,e,d,f,g,q,u,v;a=_.clone(a);null==a.layers&&a.layer&&(a.layers=[a.layer]); null==a.guides&&a.guide&&(a.guides=a.guide);null==a.guides&&(a.guides={});if(a.layers)for(q=a.layers,b=e=0,f=q.length;e arguments.length?(l=s,s=null):s&&d.overrideMimeType&&d.overrideMimeType(s);d.open("GET",c,!0);s&&d.setRequestHeader("Accept",s);d.onreadystatechange=function(){var b;if(4===d.readyState)return b= d.status,b=!b&&d.response||200<=b&&300>b||304===b?d:null,l(b)};return d.send(null)};c.text=function(n,s,l){3>arguments.length&&(l=s,s=null);return c.xhr(n,s,function(c){return l(c&&c.responseText)})};c.json=function(n,s){return c.text(n,"application/json",function(c){return s(c?JSON.parse(c):null)})};c.dsv=function(n,s){var l,d,b,a,e,h,k;k=RegExp("\r\n|["+n+"\r\n]","g");h=RegExp('["'+n+"\n]");l=n.charCodeAt(0);b=function(b){return b.map(a).join(n)};a=function(a){var b;return null!=(b=h.test(a))?b: '"'+a.replace(/\"/g,'"carview.php?tsp="')+{'"':a}};e=null;d=function(a,b){return c.text(a,s,function(a){return b(a&&d.parse(a))})};d.parse=function(a){return d.parseRows(a,function(a,b){var c,f,g;if(b){g={};c=-1;for(f=e.length;++c =a.length)return c;if(g)return g=!1,e;q=k.lastIndex;if(34===a.charCodeAt(q)){for(f=q;f++ ")}O(b,a);b.prototype.toString=function(){var a,b,f,g,c;g=this.domains;c=[];b=0;for(f=g.length;b "+this.range+")"};b.prototype._unify=function(a,f){var g,c,q,e,d;b.__super__._unify.call(this,a,f);this.domains.length!==f.domains.length&&this.error(a,"function domains differ in length"); d=_.zip(this.domains,f.domains);q=0;for(e=d.length;q "};a.prototype.contents=function(){return[this.tag]};return a}();C=function(a){function b(a){this.name=a;this.contents=w(this.contents,this);this.name=ja(this.name);b.__super__.constructor.call(this,z.Tag.symbol)}O(b,a);b.prototype.contents=function(){return b.__super__.contents.call(this).concat([this.name])};return b}(z);g=function(b){function f(b,g){this.val=b;this.type=g;this.contents= w(this.contents,this);f.__super__.constructor.call(this,z.Tag.literal);this.type===a.Base.cat&&(this.val=ka(this.val))}O(f,b);f.prototype.contents=function(){return f.__super__.contents.call(this).concat([this.val])};return f}(z);p=function(a){function b(a){this.op=a;this.contents=w(this.contents,this);b.__super__.constructor.call(this,z.Tag.infixsymbol)}O(b,a);b.prototype.contents=function(){return b.__super__.contents.call(this).concat([this.op])};return b}(z);r=function(a){function b(a){this.name= a;this.contents=w(this.contents,this);b.__super__.constructor.call(this,z.Tag.keyword)}O(b,a);b.prototype.contents=function(){return b.__super__.contents.call(this).concat([this.name])};return b}(z);h=function(){var a,b,f,g;f=[z.Tag.lparen,z.Tag.rparen,z.Tag.comma];g=[];a=0;for(b=f.length;a= > <= < != ==".split(" ");R=function(a,b){return S.indexOf(a)<=S.indexOf(b)};h=function(){var a,b,f;f=[];a=0;for(b=S.length;a= > <= < != == =".split(" ");M=0;for(N=ca.length;M c?1:0}:c.type.compare(a.type):function(a){return a}};l=function(){return function(a){this.type=a.type;this.min=a.min;this.max=a.max;this.bw=a.bw}}();s=function(){return function(a){this.type=a.type; this.min=a.min;this.max=a.max;this.bw=a.bw}}();n=function(){return function(a){this.type=a.type;this.levels=a.levels;this.sorted=a.sorted}}();e=function(a){"cat"!==a.type&&a.max===a.min&&(a.bw?(a.max+=a.bw,a.min-=a.bw):0===a.max?a.max+=1:(a.max*=1.1,a.min/=1.1));switch(a.type){case "num":return new l(a);case "date":return new s(a);case "cat":return new n(a)}};c.domain.single=function(a,b,d){var f,g,q,u,v,h,k,m,l,G,B,F,x,H,I,P,R,n,A;if(0===a.length)throw c.error.input("Dataset is none?");g=function(a){return null!= d?d[a]:null};switch(b.type){case "num":return f=null!=(u=g("bw"))?u:b.bw,1 =b.min&&a<=b.max}):a.ticks:(h=null!=(r=a.numticks)?r:5,h=d[e](b,h),r=h.ticks,p=h.step);h=a.labels?function(b){var f;return null!=(f=a.labels[b])?f:b}:a.formatter?a.formatter:c.format(e.split("-")[0],p);p={};e=l(e,h);if(r)for(k=f=0,g=r.length-1;0<=g?f<=g:f>=g;k=0<=g?++f:--f)n=0===k?null:r[k-1],m=k===r.length-1?null:r[k+1],k=r[k],m=e(k,n,m),p[m.value]= m;return{ticks:p,ticksFormatter:h}};n=function(){return function(b){this.location=b.location;this.value=b.value;this.index=b.index;this.evtData=b.evtData}}();l=function(b,a){var c;c=0;return function(d,k,m){var l;"cat"===b?l={"in":[d]}:(l={},null!=k&&(l.ge=k),null!=m&&(l.le=m));return new n({location:d,value:a(d),index:c++,evtData:l})}};s=function(b,a){var c,d;d=Math.pow(10,Math.floor(Math.log(b/a)/Math.LN10));c=a/b*d;0.15>c?d*=10:0.35>=c?d*=5:0.75>=c&&(d*=2);return d};d={none:function(){return{}}, cat:function(b,a){var c,d,k,m,l,p,r;k=Math.max(1,Math.round(b.levels.length/a));m=[];r=b.levels;c=l=0;for(p=r.length;l 1.4*a;)c*=2;m=k}else c=s(d-k,a),m=Math.ceil(k/c)*c;for(k=[];m<=d;)k.push(m),m+=c;return{ticks:k,step:Math.floor(Math.log(c)/Math.LN10)}},"num-log":function(b,a){var d,h,k,m,l,p,r,f,g;f=[];p=b.min;l=b.max;h=function(a){return Math.log(a)/Math.LN10};d=function(a){return Math.exp(a* Math.LN10)};m=Math.max(h(p),0);k=h(l);r=s(k-m,a);for(g=Math.ceil(m/r)*r;g
=g%1)){if(g%1>c["const"].epsilon){if(m=Math.floor(g)+h(10*(g%1)),0===m%1){g+=r;continue}}else m=g;m=d(m);m l||f.push(m)}g+=r}return{ticks:f}},date:function(b,a){var d,h,k,m,l,p,r;m=b.min;k=b.max;if(d=b.bw)for(l=d;"decade"!==l&&(k-m)/c["const"].approxTimeInSeconds[l]>1.4*a;)l=c["const"].timerange[_.indexOf(c["const"].timerange,l)+1];else for(h in d=(k-m)/a,l="decade",r=c["const"].approxTimeInSeconds, r)if(p=r[h],d<1.4*p){l=h;break}p=[];h=moment.unix(m).startOf(l);d=function(){switch(l){case "twomonth":return["months",2];case "quarter":return["months",4];case "sixmonth":return["months",6];case "twoyear":return["years",2];case "fiveyear":return["years",5];case "decade":return["years",10];default:return[l+"s",1]}}();for(h.unix()
g.call(this.validPositions,h))throw c.error.defn("X-axis position can't be "+this.position+".");this.titletext=q("title",a);this.renderTick=q("renderTick",this.renderTickDefault);this.renderGrid=q("renderGrid",this.renderGridDefault);this.renderLabel=q("renderLabel", this.renderLabelDefault);this.renderLine=q("renderLine",this.renderLineDefault);this.gridColor=q("gridColor",this.gridColor);d=c.tick.make(d,e,u);this.ticks=d.ticks;this.ticksFormatter=d.ticksFormatter;this.maxwidth=_.max(_.map(this.ticks,function(a){return c.strSize(a.value)}));this.maxwidth=Math.max(this.maxwidth,0)}r(b,a);b.prototype.renderTickDefault=!0;b.prototype.renderGridDefault=!0;b.prototype.renderLabelDefault=!0;b.prototype.renderLineDefault=!0;b.prototype.calculate=function(a,b,f){var g, c,d,e,q,u,h;this.coord=b;if("none"===this.position)return{};null==f&&(f={});a.centerx=a.left+a.width/2;a.centery=a.top+a.height/2;a.radius=Math.min(a.width,a.height)/2-10;b={};this.renderLine&&(b.line={marks:{0:this._renderline(a)}});e=this.ticks;for(g in e)d=e[g],c={},this.renderTick&&(null!=(q=f.renderTick)?q:1)&&(c.tick=this._makeTick(a,d)),this.renderLabel&&(null!=(u=f.renderLabel)?u:1)&&(c.text=this._makeLabel(a,d)),this.renderGrid&&(null!=(h=f.renderGrid)?h:1)&&(c.grid=this._makeGrid(a,d)), b[g]={marks:c};return b};b.prototype._makeTick=function(a){if(!a)throw c.error.impl();a.type="path";a.stroke=e.identity("#666");a.color=e.identity("#666");return a};b.prototype._makeLabel=function(a){if(!a)throw c.error.impl();a.type="text";a.stroke=e.identity("#666");a.color=e.identity("#666");return a};b.prototype._makeGrid=function(a){if(!a)throw c.error.impl();a.stroke=null!=this.gridColor?this.gridColor:"#EFEFEF";return a};return b}(c.Guide);b=function(a){function b(){return h=b.__super__.constructor.apply(this, arguments)}r(b,a);b.prototype.type="x";b.prototype.renderGridDefault=!1;b.prototype.defaultPosition="bottom";b.prototype.validPositions=["top","bottom","none"];b.prototype._renderline=function(a){var b,f;f="top"===this.position?e.identity(a.top):e.identity(a.bottom);b=e.identity(a.left);a=e.identity(a.left+a.width);return{type:"path",y:[f,f],x:[b,a],stroke:e.identity("#666")}};b.prototype._makeTick=function(a,f){var g,c;"top"===this.position?(g=e.identity(a.top),c=e.identity(a.top-5)):(g=e.identity(a.bottom), c=e.identity(a.bottom+5));return b.__super__._makeTick.call(this,{x:[f.location,f.location],y:[g,c]})};b.prototype._makeLabel=function(a,f){var g;g="top"===this.position?e.identity(a.top-15):e.identity(a.bottom+15);return b.__super__._makeLabel.call(this,{x:f.location,y:g,text:f.value,"text-anchor":"middle"})};b.prototype._makeGrid=function(a,f){var g,c;g=e.identity(a.top);c=e.identity(a.bottom);return b.__super__._makeGrid.call(this,{type:"path",x:[f.location,f.location],y:[g,c]})};b.prototype.getDimension= function(){var a;return{position:null!=(a=this.position)?a:"bottom",height:30,width:"all"}};return b}(s);a=function(a){function b(){return k=b.__super__.constructor.apply(this,arguments)}r(b,a);b.prototype.type="y";b.prototype.renderLineDefault=!1;b.prototype.renderTickDefault=!1;b.prototype.defaultPosition="left";b.prototype.validPositions=["left","right","none"];b.prototype._renderline=function(a){var b,f;b="left"===this.position?e.identity(a.left):e.identity(a.right);f=e.identity(a.top);a=e.identity(a.top+ a.height);return{type:"path",x:[b,b],y:[f,a],stroke:e.identity("#666")}};b.prototype._makeTick=function(a,f){var g,c;"left"===this.position?(g=e.identity(a.left),c=e.identity(a.left-5)):(g=e.identity(a.right),c=e.identity(a.right+5));return b.__super__._makeTick.call(this,{x:[g,c],y:[f.location,f.location]})};b.prototype._makeLabel=function(a,f){var g;g="left"===this.position?e.identity(a.left-7):e.identity(a.right+7);return b.__super__._makeLabel.call(this,{x:g,y:f.location,text:f.value,"text-anchor":"left"=== this.position?"end":"start"})};b.prototype._makeGrid=function(a,f){var g,c;g=e.identity(a.left);c=e.identity(a.right);return b.__super__._makeGrid.call(this,{type:"path",y:[f.location,f.location],x:[g,c]})};b.prototype.getDimension=function(){var a;return{position:null!=(a=this.position)?a:"right",height:"all",width:5+this.maxwidth}};return b}(s);l=function(a){function b(){return m=b.__super__.constructor.apply(this,arguments)}r(b,a);b.prototype.type="r";b.prototype.defaultPosition="left";b.prototype.validPositions= ["left","right","none"];b.prototype._renderline=function(a){var b,f;b=e.identity(a.left);f=e.identity(a.top);a=e.identity(a.top+a.height/2);return{type:"path",x:[b,b],y:[f,a],stroke:e.identity("#666")}};b.prototype._makeTick=function(a,f){return b.__super__._makeTick.call(this,{x:[e.identity(a.left),e.identity(a.left-5)],y:[f.location,f.location]})};b.prototype._makeLabel=function(a,f){return b.__super__._makeLabel.call(this,{x:e.identity(a.left-7),y:f.location,text:f.value,"text-anchor":"end"})}; b.prototype._makeGrid=function(a,f){return b.__super__._makeGrid.call(this,{type:"circle",x:e.identity(a.centerx),y:e.identity(a.centery),size:e.identity(this.coord.getScale("r")(f.location)),color:e.identity("none"),"fill-opacity":0,"stroke-width":1})};b.prototype.getDimension=function(){return{position:"left",height:"all",width:5+this.maxwidth}};return b}(s);d=function(a){function b(){return t=b.__super__.constructor.apply(this,arguments)}r(b,a);b.prototype.type="t";b.prototype.defaultPosition= "out";b.prototype.validPositions=["out","none"];b.prototype._renderline=function(a){return{type:"circle",x:e.identity(a.centerx),y:e.identity(a.centery),size:e.identity(a.radius),color:e.identity("none"),stroke:e.identity("#666"),"stroke-width":1}};b.prototype._makeTick=function(a,f){return b.__super__._makeTick.call(this,{x:[f.location,f.location],y:[e.max(0),e.max(3)]})};b.prototype._makeLabel=function(a,f){return b.__super__._makeLabel.call(this,{x:f.location,y:e.max(12),text:f.value,"text-anchor":"middle"})}; b.prototype._makeGrid=function(a,f){var g,c,d,q;c=e.identity(a.centerx);q=e.identity(a.centery);g=this.coord.getScale("t")(f.location)-Math.PI/2;d=e.identity(a.centerx+a.radius*Math.cos(g));g=e.identity(a.centery+a.radius*Math.sin(g));return b.__super__._makeGrid.call(this,{type:"path",y:[q,g],x:[c,d]})};b.prototype.getDimension=function(){return{}};return b}(s);null==c.guide&&(c.guide={});c.guide.axis=function(f,g){if("x"===f)return new b(g);if("y"===f)return new a(g);if("r"===f)return new l(g); if("t"===f)return new d(g)};c.guide.axes=function(a){return new n(a)}}).call(this);(function(){var n,s,l,d,b,a,e,h={}.hasOwnProperty,k=function(a,b){function f(){this.constructor=a}for(var g in b)h.call(b,g)&&(a[g]=b[g]);f.prototype=b.prototype;a.prototype=new f;a.__super__=b.prototype;return a},m=[].indexOf||function(a){for(var b=0,f=this.length;b e&&(b+=h+5,h=c=0),d.width>h&&(h=d.width),c+=d.height;return b+h};b.prototype._topbottomHeight=function(a){var b,c,d,e,h;c=10;h=this.legends;d=0;for(e=h.length;d k&&(r+=m+5,m=p=0),l.width> m&&(m=l.width),n={x:r+e,y:p+d},h.render(b(n,!1,!1),m),P.push(p+=l.height);return P};b.prototype._renderH=function(a,b,c){var d,e,h,k,m,l;d=a.paddingLeft;e="top"===this.position?a.paddingTop:a.height-a.guideBottom-a.paddingBottom;e={x:d,y:"top"===this.position?c.top+e:c.bottom+e+10};m=this.legends;l=[];h=0;for(k=m.length;h this.domain.min)throw c.error.input("Log scale cannot handle zero or negative input.");a=Math.log;f=c.linear(a(this.domain.min),this.range.min,a(this.domain.max),this.range.max);this.f=this._numWrapper(this.domain,function(b){return f(a(b))});g=c.linear(this.range.min,a(this.domain.min),this.range.max,a(this.domain.max));b=function(a){return Math.exp(g(a))};return this.finv= function(a,c){var f;f=[b(a),b(c)];return{ge:_.min(f),le:_.max(f)}}};b.prototype._tickNum=function(){return"num-log"};return b}(n);n=function(a){function b(){this._makeDate=v(this._makeDate,this);this._makeNum=v(this._makeNum,this);return r=b.__super__.constructor.apply(this,arguments)}C(b,a);b.prototype._makeNum=function(){var a,b,f;a=0===this.domain.min?0:1;b=Math.sqrt;f=c.linear(b(this.domain.min),a,b(this.domain.max),10);return this.f=this._identityWrapper(function(a){return f(b(a))})};b.prototype._makeDate= function(){return this._makeNum()};return b}(m);h=function(a){function b(){this._makeDate=v(this._makeDate,this);this._makeNum=v(this._makeNum,this);return f=b.__super__.constructor.apply(this,arguments)}C(b,a);b.prototype._makeNum=function(){return this.f=this._identityWrapper(c.linear(this.domain.min,0===this.domain.min?0:0.1,this.domain.max,1))};b.prototype._makeDate=function(){return this._makeNum()};return b}(m);k=function(a){function b(){this._makeCat=v(this._makeCat,this);return g=b.__super__.constructor.apply(this, arguments)}C(b,a);b.prototype._makeCat=function(){var a,b,c,f=this;c=this.domain.levels.length;if(9>=c)return a="#E41A1C #377EB8 #4DAF4A #984EA3 #FF7F00 #FFFF33 #A65628 #F781BF #999999".split(" "),this.f=function(b){b=_.indexOf(f.domain.levels,b);return a[b]};b=function(a){return _.indexOf(f.domain.levels,a)/c+1/(2*c)};return this.f=function(a){return"undefined"!==typeof Raphael&&null!==Raphael?Raphael.hsl(b(a),0.5,0.5):"hsl("+b(a)+",0.5,0.5)"}};return b}(m);l=function(a){function b(a){this._makeDate= v(this._makeDate,this);this._makeNum=v(this._makeNum,this);this.lower=a.lower;this.upper=a.upper}C(b,a);b.prototype._makeNum=function(){var a,b,f,g,d;f="undefined"!==typeof Raphael&&null!==Raphael?Raphael.color(this.lower):this.lower;d="undefined"!==typeof Raphael&&null!==Raphael?Raphael.color(this.upper):this.upper;g=c.linear(this.domain.min,f.r,this.domain.max,d.r);b=c.linear(this.domain.min,f.g,this.domain.max,d.g);a=c.linear(this.domain.min,f.b,this.domain.max,d.b);return this.f=this._identityWrapper(function(c){return"undefined"!== typeof Raphael&&null!==Raphael?Raphael.rgb(g(c),b(c),a(c)):"rgb("+g(c)+","+b(c)+","+a(c)+")"})};b.prototype._makeDate=function(){return this._makeNum()};return b}(m);d=function(a){function b(a){this._makeDate=v(this._makeDate,this);this._makeCat=v(this._makeCat,this);this._makeNum=v(this._makeNum,this);this.lower=a.lower;this.middle=a.middle;this.upper=a.upper;this.midpoint=a.midpoint;null==this.midpoint&&(this.midpoint=0)}C(b,a);b.prototype._makeNum=function(){var a,b,f,g,d,e,q,h,k,m=this;d="undefined"!== typeof Raphael&&null!==Raphael?Raphael.color(this.lower):this.lower;e="undefined"!==typeof Raphael&&null!==Raphael?Raphael.color(this.middle):this.middle;k="undefined"!==typeof Raphael&&null!==Raphael?Raphael.color(this.upper):this.upper;q=c.linear(this.domain.min,d.r,this.midpoint,e.r);f=c.linear(this.domain.min,d.g,this.midpoint,e.g);a=c.linear(this.domain.min,d.b,this.midpoint,e.b);h=c.linear(this.midpoint,e.r,this.domain.max,k.r);g=c.linear(this.midpoint,e.g,this.domain.max,k.g);b=c.linear(this.midpoint, e.b,this.domain.max,k.b);return this.f=this._identityWrapper(function(c){return c (b=_.keys(a).length)&&"meta"in a||5>b)?(b=a.data,d=a.meta):b=a;switch(h(b)){case "json-object":case "json-grid":case "json-array":return c.data.json(b,d,void 0);case "url":return c.data.url(b,d,void 0);case "csv":return c.data.csv(b,d);case "api":return c.data.api(b);default:throw c.error.data("Unknown data format."); }};c.data.json=function(a,b,c){return new d({data:a,meta:b,type:c})};c.data.csv=function(a,b){return new d({data:a,meta:b,csv:"csv"})};c.data.url=function(a,b,c){return new l({url:a,computeBackend:b,limit:c})};c.data.api=function(a){return new s({apiFun:a})};h=function(a){if(_.isArray(a))return _.isArray(a[0])?"json-grid":"json-array";if(_.isObject(a))return"json-object";if(_.isString(a))return c.isURI(a)?"url":"csv";if(_.isFunction(a))return"api";throw c.error.data("Unknown data format.");};b=function(a, b){var d,e,h,k,m,l,p;if(0 =r;d=0<=r?++l:--l){k={};p=0;for(n=h.length;p _.keys(f).length&&"data"in f?(g=f.data, d=null!=(m=f.meta)?m:{}):(g=f,d={});m=function(){var m;switch(null!=(m=f.type)?m:h(g)){case "json-object":return k(g,d);case "json-grid":return a(g,d);case "json-array":return b(g,d);case "csv":return e(g,d);default:throw c.error.data("Unknown data format.");}}();this.key=m.key;this.raw=m.raw;this.meta=m.meta;return this.data=this.raw};g.prototype._checkRename=function(a,b){if("carview.php?tsp="===b)throw c.error.defn("Column names cannot be an empty string");if(-1===_.indexOf(this.key,a))throw c.error.defn("The key "+ a+" doesn't exist!");if(-1!==_.indexOf(this.key,b))throw c.error.defn("The key "+b+" already exists!");};g.prototype.rename=function(a,b,c){var f,g,d;null==c&&(c=!1);a=a.toString();b=b.toString();if(a===b)return!0;c||this._checkRename(a,b);d=this.raw;f=0;for(g=d.length;f _.keys(g).length&&"data"in g?(d=g.data,m=null!=(p=g.meta)?p:{}):(d=g,m={});g=function(){switch(h(d)){case "json-object":return k(d,m);case "json-grid":return a(d,m);case "json-array":return b(d,m);case "csv":return e(d,m); default:throw c.error.data("Unknown data format.");}}();l.key=g.key;l.raw=g.raw;l.meta=g.meta;l.data=l.raw;return f(null,l)});if(null==g)return f(null,this);c.data.frontendProcess(g,this,function(a,b){b.raw=b.data;return f(a,b)})};g.prototype.update=function(a){this.raw=null;return g.__super__.update.call(this)};g.prototype.renameMany=function(a){return 0===_.keys(a).length};return g}(n);s=function(f){function g(a){this.getData=r(this.getData,this);g.__super__.constructor.call(this);this.apiFun=a.apiFun; this.computeBackend=!0}t(g,f);g.prototype.getData=function(f,g){var d=this;return this.apiFun(g,function(g,m){var l,p,n,r,t;if(null!=g)return f(g,null);if(_.isString(m))try{m=JSON.parse(m)}catch(x){p=x}p=null;try{l=m.data,n=null!=(r=m.meta)?r:{},t=function(){switch(h(l)){case "json-object":return k(l,n);case "json-grid":return a(l,n);case "json-array":return b(l,n);case "csv":return e(l,n);default:throw c.error.data("Unknown data format.");}}(),d.key=t.key,d.raw=t.raw,d.meta=t.meta,d.data=d.raw}catch(H){p= H}return f(p,d)})};g.prototype.update=function(a){this.raw=null;return g.__super__.update.call(this)};g.prototype.renameMany=function(a){return 0===_.keys(a).length};return g}(n)}).call(this);(function(){var n,s,l,d,b,a,e,h,k,m,t,p=function(a,b){return function(){return a.apply(b,arguments)}},r=[].indexOf||function(a){for(var b=0,c=this.length;b ":function(a,b){return function(c){return a(c)>b(c)}},">=":function(a,b){return function(c){return a(c)>=b(c)}},"<":function(a,b){return function(c){return a(c)=d;1<=d?++e:--e)k.push(void 0);b=k}else if(e!==d)throw c.error.defn("Lag period needs to be constant, but isn't!");b.push(h);return b.shift()}},bin:function(a){return function(b){var c,d;c=a[0](b);b=a[1](b);if(_.isNumber(b))return Math.floor(c/b)*b;d=function(a,b){var d;d=moment.unix(c).startOf(b);d[b](a*Math.floor(d[b]()/a));return d.unix()};switch(b){case "week":return moment.unix(c).day(0).unix();case "twomonth":return d(2,"month");case "quarter":return d(4,"month");case "sixmonth":return d(6, "month");case "twoyear":return d(2,"year");case "fiveyear":return d(5,"year");case "decade":return d(10,"year");default:return moment.unix(c).startOf(b).unix()}}}}};b=function(d){var e,h,k,m,l,p,n;l=d[0];d=d[1];if("ident"===l)d=a.ident(d.name);else if("const"===l)d=(n=c.type.coerce(d.value,{type:d.type}),a["const"](n));else if("infixop"===l)d=(m=b(d.lhs),p=b(d.rhs),a.infixop[d.opname](m,p));else if("conditional"===l)d=(h=b(d.cond),k=b(d.conseq),e=b(d.altern),a.conditional(h,k,e));else if("call"=== l){m=d.args;p=[];h=0;for(k=m.length;h b},ge:function(a,b){return a>=b},"in":function(a,b){return 0<=r.call(b,a)}};e=function(a){var b;b=[];_.each(a,function(a){var d,f;d=c.parser.unbracket(a.expr.name);f=_.pick(a,"lt","gt","le","ge","in");return _.each(f,function(c,f){if(f in h)return a= function(a){return h[f](a[d],c)},b.push(a)})});return function(a){var c,d,f;d=0;for(f=b.length;d =e&&a<=k}),{q1:_.min(b["true"]),q2:h,q3:c.median(a,!0),q4:d,q5:_.max(b["true"]),outliers:null!=(m=b["false"])?m:[]}):{outliers:a}}};d=function(a,b){var d,e,h;h={};_.each(b.stats,function(a){var b,d,f,e; e=a.name;b=a.expr;a=a.args;d=t[e];f=c.parser.unbracket(a[0].name);return h[b.name]=function(a){return d(_.pluck(a,f))}});e=c.groupBy(a,function(){var a,f,e,h;e=b.groups;h=[];a=0;for(f=e.length;a =b[n]?1*l:-1*l});m&&(b=b.slice(0,+(m-1)+1||9E9));h=_.uniq(_.pluck(b,c.parser.unbracket(k.name)));return{meta:{levels:h,sorted:!0},filter:{expr:k,"in":h}}};m=function(a){var b;b=c.parser.createColTypeEnv(a);return function(a){var d,e,f;d=a.expr;f=d[0];e=d[1];d=null;"call"===f&&"bin"===e.fname&&(e=e.args[1],f=e[0],e=e[1],"const"===f&&(d=c.type.coerce(e.value, {type:e.type})));return{type:c.parser.getType(a.name,b),bw:d}}};k=function(a,g,h){var k,p,n,r,t,s,G,B,F,x,H;G=null!=(p=_.clone(g.meta))?p:{};t=m(G);p=function(a,b){var d,e;null==b&&(b={});d=c.parser.unbracket(a.name);return G[d]=_.extend(null!=(e=G[d])?e:{},t(a),b)};g=_.clone(g.raw);k=function(a,b){var c,d,e,f;f=[];d=0;for(e=g.length;d b?1:0}:(b=c.type.compare(this.meta[this.mapping.color].type),function(a,c){a=a[n.mapping.color];c=c[n.mapping.color];return b(a,c)}),d.sort(h)),k=0,m=null!=this.mapping.y?function(a){return a[n.mapping.y]}:function(a){return 0},l.push(function(){var a,b,c;c=[];a=0;for(b=d.length;aG.call(this.guideSpec[b].levels,g)))return!1;return!0};return a}();e=function(a){function b(){return f=b.__super__.constructor.apply(this, arguments)}F(b,a);b.prototype._calcGeoms=function(){var a,b,c,d,e,f,g,h,k;b=this._getIdFunc();this.geoms={};h=this.statData;k=[];f=0;for(g=h.length;f s&&(c.guideLeft=s);c.guideRight>s&&(c.guideRight=s);c.guideTop>b&&(c.guideTop=b);c.guideBottom>b&&(c.guideBottom=b);c.chartHeight=c.height-c.paddingTop-c.paddingBottom-c.guideTop-c.guideBottom;c.chartWidth= c.width-c.paddingLeft-c.paddingRight-c.guideLeft-c.guideRight;null!=l.cols&&1 =d;e=0<=d?++c:--c)f.push(void 0===a[e]||void 0===b[e]);return f}()))throw c.error.missing("carview.php?tsp="+d+" cannot be plotted due to too many missing points.");};a.prototype._checkArrayNaN=function(a,b){var c,d;d=_.map(_.zip(a,b),function(a,b){return isNaN(a[0])||isNaN(a[1])?void 0:a});return{x:function(){var a,b,e;e= [];a=0;for(b=d.length;a=q;h=1<=q?++p:--p)k=Math.abs(m[h]-m[h-1])>Math.PI?1:0,g=0 Math.PI?1:0,b="M "+h[0]+" "+k[0]+" A "+f[0]+" "+f[1]+" 0 "+d+" 1 "+h[1]+" "+k[1],d=Math.abs(g[3]-g[2])>Math.PI?1:0,b+="L "+h[2]+" "+k[2]+" A "+f[2]+" "+f[3]+" 0 "+d+" 0 "+h[3]+" "+k[3]+" Z");d=this._maybeApply(a,e,e.stroke?"stroke":"color");return this._shared(a,e,{path:b,fill:this._maybeApply(a,e,"color"),stroke:d,"stroke-width":this._maybeApply(a, e,"stroke-width")})};return b}(h);h=function(a){function b(){return C=b.__super__.constructor.apply(this,arguments)}J(b,a);b.prototype._make=function(a){return a.text()};b.prototype.attr=function(a,b,c,d,e){var f;e=b.getXY(e,d);b=e.x;e=e.y;this._checkPointUndefined(b,e,"Text");c=this._applyOffset(b,e,c);b=c.x;e=c.y;return this._shared(a,d,{x:b,y:e,r:10,text:this._maybeApply(a,d,"text"),"font-size":this._maybeApply(a,d,"size"),"text-anchor":null!=(f=d["text-anchor"])?f:"left",fill:this._maybeApply(a, d,"color")||"black"})};return b}(h);m={cartesian:{circle:new s,line:new d,pline:new d,area:new n,path:new b,text:new h,rect:new e,spline:new k},polar:{circle:new s,path:new b,line:new d,pline:new a,area:new n,text:new h,rect:new l,spline:new k}}}).call(this);(function(){var n=[].indexOf||function(c){for(var l=0,d=this.length;l c.y&&(c.y=h+30+e,f.y=d+e/2+15),c.x+c.width>n&&(d=c.x+c.width-n,c.x-=d/2,f.x-=d/2),c.x n.call(c["const"].aes,s))throw c.error.input("Unknown aesthetic "+s+".");b=0;a=[d];return function(c,d,k,m){var n,p;if("reset"===c&&0c["const"].epsilon&&(null==f[p]&&(f[p]={min:null,max:null}),f[p].min=h[e].ge,f[p].max=h[e].le),"cat"===r.axes.domains[p].type&&0!==h[e]["in"].length&&(null==f[p]&&(f[p]={levels:null}),f[p].levels=h[e]["in"]));r.handlers=_.map(r.handlers,k);J.push(r.make(r.spec))}return J}}}}}).call(this);(function(){var n,s=[].indexOf||function(c){for(var d=0,b=this.length;dh||h>=this.cols||0>m||m>=this.rows)return null;k={x:d.paddingLeft+d.guideLeft+(d.eachWidth+d.horizontalSpacing)*h,y:d.paddingTop+d.guideTop+(d.eachHeight+d.verticalSpacing)*m+d.verticalSpacing};b={x:b-k.x,y:a-k.y};if(!e&&(b.x>d.eachWidth||b.y>d.eachHeight))return null;b.x=Math.max(Math.min(b.x,d.eachWidth), 0);b.y=Math.max(Math.min(b.y,d.eachHeight),0);return{row:m,col:h,offset:k,adjusted:b,evtData:this.getEvtData(h,m)}};l.prototype._getMappings=function(d){var b;b={type:"none",mapping:{}};if(_.isObject(d))if("wrap"===d.type){b.type="wrap";if(!d["var"])throw c.error.defn("You didn't specify a variable to facet on.");d["var"]&&(b.mapping["var"]=c.parser.normalize(d["var"]["var"]))}else if("grid"===d.type){b.type="grid";if(!d.x&&d.y)throw c.error.defn("You didn't specify a variable to facet on.");d.x&& (b.mapping.x=c.parser.normalize(d.x["var"]));d.y&&(b.mapping.y=c.parser.normalize(d.y["var"]))}return b};l.prototype._makeIndices=function(d,b){var a,e,h,k,m,l,p,n;n={};for(a in b)if(e=b[a],m=c.parser.normalize(e["var"]),e.levels)n[m]=e.levels;else{l=[];for(h in d){e=d[h];if(k=e.metaData[m])!k||"num"!==(p=k.type)&&"date"!==p||c.type.compare(k.type);l=_.uniq(_.union(l,_.pluck(e.statData,m)))}n[m]=l}a=c.cross(n);h={};k=_.pluck(b,"var");l=[];p=0;for(e=k.length;p ").attr("border","1px solid black");C.attr("cellspacing",0);C.attr("cellpadding",0); for(q=0;q ");r=c.parser.unbracket(this.spec.columns[q]["var"]);0===q&&1 "),u.attr("rowspan",k),u.attr("colspan",l-1),D.append(u));D.append($(" "+r+": ").attr("align","right"));for(u=0;u"+p+"").attr("colspan",f*n);p.attr("align","center");D.append(p);u+=f}C.append(D);q++}D=$(" ");0===l&&(u=$(" "),u.attr("rowspan",a.length+ 1),D.append(u));for(q=0;q "+r+"").attr("align","center")),q++;for(q=0;q "+c.parser.unbracket(p["var"])+""),p.attr("align","center"),D.append(p);q++}C.append(D);for(q=0;q ");l=this.spec.rows;u=0;for(k=l.length;u "+p+"").attr("rowspan",n);p.attr("align","center");p.attr("valign","middle");D.append(p)}for(u=0;u "+p+"").attr("align","right"));u++}C.append(D);q++}this.prepare&&this.prepare(this);this.spec.width&&C.attr("width",this.spec.width);this.spec.height&&C.attr("height", this.spec.height);this.dom=_.isString(this.spec.dom)?$("#"+this.spec.dom):$(this.spec.dom);this.dom.empty();this.dom.append(C);if(this.callback)return this.callback(null,this)};return b}();c.pivot=function(b,a,c){return new n(b,a,c)}}).call(this);(function(){var n,s,l=function(b,a){return function(){return b.apply(a,arguments)}},d=[].indexOf||function(b){for(var a=0,c=this.length;a d.call(this.handlers,a))return this.handlers.push(a)};b.prototype.render=function(a,b,d){var k,l,n,p;if(null!=a)console.error(a);else{a=c.parser.normalize(this.spec.value["var"]);this.value=b[0][a];this.title=null!=(n=this.spec.title)? n:a;b=0<(l=this.value)&&1>l?void 0:0===this.value%1?0:-1;this.value=c.format.number(b)(this.value);if(_.isNaN(this.value)||"NaN"===this.value)this.value="Not a Number";null!=this.prepare&&this.prepare(this);this.dom=this.spec.dom;this.width=null!=(k=this.spec.width)?k:200;this.height=null!=(p=this.spec.height)?p:100;null==this.paper&&(this.paper=this._makePaper(this.dom,this.width,this.height,this));null==this.titleObj&&(this.titleObj=this.paper.text(this.width/2,10,"carview.php?tsp="));this.titleObj.attr({text:this.title, "font-size":"12px"});this.titleObj.click(this.handleEvent("guide-title"));this.titleObj.hover(this.handleEvent("tover"),this.handleEvent("tout"));null==this.textObj&&(this.textObj=this.paper.text(this.width/2,this.height/2,"carview.php?tsp="));this.textObj.attr({x:this.width/2,y:7+this.height/2,text:this.value});k=this.textObj.getBBox();l=k.width;k=k.height;l=Math.min(0.9*this.width/l,0.9*(this.height-14)/k);this.textObj.transform("s"+l);this.callback&&this.callback(null,this)}};b.prototype._makePaper=function(a, b,d,k){return c.paper(a,b,d,{numeral:k},!1)};return b}();c.numeral=function(b,a,d){try{return new n(b,a,d)}catch(h){console.log(h);if(null!=a)return a(h,null);throw c.error.defn("Bad specification.");}}}).call(this);(function(){var n,s,l,d={}.hasOwnProperty,b=function(a,b){function c(){this.constructor=a}for(var k in b)d.call(b,k)&&(a[k]=b[k]);c.prototype=b.prototype;a.prototype=new c;a.__super__=b.prototype;return a};s=function(){function a(a,b,c){null==a&&(a="polyjsEvent");this.eventName=a;this.cancelable= this.bubbles=!0;this.detail={type:c,data:b}}a.prototype.dispatch=function(a){var b;b=new CustomEvent(this.eventName,{detail:this.detail});if(null!=a)return a.dispatchEvent(b)};return a}();l=function(a){function c(a,b){c.__super__.constructor.call(this,"title-click",a,b)}b(c,a);return c}(s);n=function(a){function c(a,b){c.__super__.constructor.call(this,"legend-click",a,b)}b(c,a);return c}(s);c.event={};c.event.make=function(a,b){if("guide-title"===a||"guide-titleH"===a||"guide-titleV"===a)return new l(b, a);if("legend-label"===a||"legend-title"===a)return new n(b,a);throw c.error.defn("No such event "+a+".");}}).call(this);(function(){var n,s=function(c,b){return function(){return c.apply(b,arguments)}},l=[].indexOf||function(c){for(var b=0,a=this.length;bl.call(this.handlers,b))return this.handlers.push(b)};d.prototype.removeHandler=function(b){return this.handlers.splice(_.indexOf(this.handlers,b),1)};d.prototype.handleEvent=function(b){var a;a=this;return _.throttle(function(d){var h,k,l,n,p;if("touchstart"===b||"touchmove"===b||"touchend"===b||"touchcancel"===b)c.touch(b,this,d,a);else if("select"===b){k=d.start;h=d.end;k=a.facet.getFacetInfo(a.dims,k.x,k.y);if(!k)return;n=k.col;p=k.row;l=k.adjusted;k=_.clone(l);l=a.facet.getFacetInfo(a.dims, h.x,h.y,{col:n,row:p}).adjusted;h=_.clone(l);this.evtData="cartesian"===a.coord.type?a.scaleSet.fromPixels(k,h):null}else if("data"===b)this.evtData={};else if("reset"===b||"click"===b||"mover"===b||"mout"===b||"tover"===b||"tout"===b||"gover"===b||"gout"===b||"guide-click"===b)this.tooltip=this.data("t"),this.evtData=this.data("e"),"guide-click"===b&&"text"===this.type&&null!=this.evtData&&(d="legendTitle"===this.evtData.value?c.event.make("legend-title",this):c.event.make("legend-label",this),d.dispatch(a.dom)); else if("guide-title"===b||"guide-titleH"===b||"guide-titleV"===b)this.tooltip=this.data("t"),this.evtData=this.data("e"),d=c.event.make(b,this),d.dispatch(a.dom);p=a.handlers;l=[];k=0;for(n=p.length;k