@basthon/kernel-python3 0.62.21 → 0.62.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,32 @@
1
- !function(){function b(){}function a(t){return t}function L(){return this}function H(){return!0}function k(t){return"function"==typeof t?t:function(){return t}}function I(t){return null!=t&&!isNaN(t)}function O(t){return t.length}function j(t){return null==t}function Y(t){return t.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")}function R(){}function U(o){function t(){for(var t,n=u,e=-1,r=n.length;++e<r;)(t=n[e].on)&&t.apply(this,arguments);return o}var u=[],r=new b;return t.on=function(t,n){var e=r.get(t);return arguments.length<2?e&&e.on:(e&&(e.on=null,u=u.slice(0,e=u.indexOf(e)).concat(u.slice(e+1)),r.remove(t)),n&&u.push(r.set(t,{on:n})),o)},t}function V(t,n){return n-(t?1+Math.floor(Math.log(t+Math.pow(10,1+Math.floor(Math.log(t)/Math.LN10)-n))/Math.LN10):1)}function Z(t){return t+""}function B(t){for(var n=t.lastIndexOf("."),e=0<=n?t.substring(n):(n=t.length,""),r=[];0<n;)r.push(t.substring(n-=3,n+3));return r.reverse().join(",")+e}function X(n){return function(t){return 1-n(1-t)}}function $(n){return function(t){return.5*(t<.5?n(2*t):2-n(2-2*t))}}function G(t){return t}function J(n){return function(t){return Math.pow(t,n)}}function K(t){return 1-Math.cos(t*Math.PI/2)}function W(t){return Math.pow(2,10*(t-1))}function Q(t){return 1-Math.sqrt(1-t*t)}function tt(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function A(){d3.event.stopPropagation(),d3.event.preventDefault()}function nt(){for(var t,n=d3.event;t=n.sourceEvent;)n=t;return n}function et(o){for(var u=new R,t=0,n=arguments.length;++t<n;)u[arguments[t]]=U(u);return u.of=function(e,r){return function(t){try{var n=t.sourceEvent=d3.event;t.target=o,d3.event=t,u[t.type].apply(e,r)}finally{d3.event=n}}},u}function rt(t){return"transform"==t?d3.interpolateTransform:d3.interpolate}function ot(n,e){return e=e-(n=+n)?1/(e-n):0,function(t){return(t-n)*e}}function ut(n,e){return e=e-(n=+n)?1/(e-n):0,function(t){return Math.max(0,Math.min(1,(t-n)*e))}}function i(t,n,e){return new r(t,n,e)}function r(t,n,e){this.r=t,this.g=n,this.b=e}function c(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function it(t,n,e){var r,o=0,u=0,i=0,a=/([a-z]+)\((.*)\)/i.exec(t);if(a)switch(r=a[2].split(","),a[1]){case"hsl":return e(parseFloat(r[0]),parseFloat(r[1])/100,parseFloat(r[2])/100);case"rgb":return n(ct(r[0]),ct(r[1]),ct(r[2]))}return(a=Ue.get(t))?n(a.r,a.g,a.b):(null!=t&&"#"===t.charAt(0)&&(4===t.length?(o=t.charAt(1),o+=o,u=t.charAt(2),u+=u,i=t.charAt(3),i+=i):7===t.length&&(o=t.substring(1,3),u=t.substring(3,5),i=t.substring(5,7)),o=parseInt(o,16),u=parseInt(u,16),i=parseInt(i,16)),n(o,u,i))}function at(t,n,e){var r,o,u=Math.min(t/=255,n/=255,e/=255),i=Math.max(t,n,e),a=i-u,c=(i+u)/2;return a?(o=c<.5?a/(i+u):a/(2-i-u),r=t==i?(n-e)/a+(n<e?6:0):n==i?(e-t)/a+2:(t-n)/a+4,r*=60):o=r=0,l(r,o,c)}function ct(t){var n=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*n):n}function l(t,n,e){return new o(t,n,e)}function o(t,n,e){this.h=t,this.s=n,this.l=e}function lt(t,n,e){function r(t){return Math.round(255*(360<(t=t)?t-=360:t<0&&(t+=360),t<60?o+(u-o)*t/60:t<180?u:t<240?o+(u-o)*(240-t)/60:o))}var o,u;return(t%=360)<0&&(t+=360),n=n<0?0:1<n?1:n,o=2*(e=e<0?0:1<e?1:e)-(u=e<=.5?e*(1+n):e+n-e*n),i(r(t+120),r(t),r(t-120))}function s(t){return Ne(t,m),t}function ft(t){return function(){return Ve(t,this)}}function st(t){return function(){return Ze(t,this)}}function ht(r,t){function n(){if(t=this.classList)return t.add(r);var t=this.className,n=null!=t.baseVal,e=n?t.baseVal:t;i.lastIndex=0,i.test(e)||(e=Y(e+" "+r),n?t.baseVal=e:this.className=e)}function e(){if(t=this.classList)return t.remove(r);var t=this.className,n=null!=t.baseVal,e=Y((e=n?t.baseVal:t).replace(i," "));n?t.baseVal=e:this.className=e}var o,u,i=new RegExp("(^|\\s+)"+d3.requote(r)+"(\\s+|$)","g");return arguments.length<2?(u=(o=this.node()).classList)?u.contains(r):(u=o.className,i.lastIndex=0,i.test(null!=u.baseVal?u.baseVal:u)):this.each("function"==typeof t?function(){(t.apply(this,arguments)?n:e).call(this)}:t?n:e)}function dt(t){return{__data__:t}}function u(t,n){for(var e=0,r=t.length;e<r;e++)for(var o,u=t[e],i=0,a=u.length;i<a;i++)(o=u[i])&&n(o,i,e);return t}function gt(t){return Ne(t,y),t}function pt(e,h,d){Ne(e,M);var g=new b,p=d3.dispatch("start","end"),m=Ke;return e.id=h,e.time=d,e.tween=function(t,n){return arguments.length<2?g.get(t):(null==n?g.remove(t):g.set(t,n),e)},e.ease=function(t){return arguments.length?(m="function"==typeof t?t:d3.ease.apply(d3,arguments),e):m},e.each=function(t,n){return arguments.length<2?function(r){var t=_,n=Ke,e=Ge,o=Je;return _=this.id,Ke=this.ease(),u(this,function(t,n,e){Ge=t.delay,Je=t.duration,r.call(t=t.node,t.__data__,n,e)}),_=t,Ke=n,Ge=e,Je=o,this}.call(e,t):(p.on(t,n),e)},d3.timer(function(s){return u(e,function(r,o,t){function n(t){return l.active>h?u():(l.active=h,g.forEach(function(t,n){(n=n.call(r,f,o))&&i.push(n)}),p.start.call(r,f,o),e(t)||d3.timer(e,0,d),1)}function e(t){if(l.active!==h)return u();for(var t=(t-a)/c,n=m(t),e=i.length;0<e;)i[--e].call(r,n);return 1<=t?(u(),_=h,p.end.call(r,f,o),_=0,1):void 0}function u(){return--l.count||delete r.__transition__,1}var i=[],a=r.delay,c=r.duration,l=(r=r.node).__transition__||(r.__transition__={active:0,count:0}),f=r.__data__;++l.count,a<=s?n(s):d3.timer(n,a,d)})},0,d),e}function mt(t,n,e){return""!=e&&x}function vt(t,r){var o=rt(t);return"function"==typeof r?function(t,n,e){return null==(t=r.call(this,t,n))?""!=e&&x:e!=t&&o(e,t)}:null==r?mt:(r+="",function(t,n,e){return e!=r&&o(e,r)})}function yt(){for(var t,n=Date.now(),e=w;e;)(t=n-e.then)>=e.delay&&(e.flush=e.callback(t)),e=e.next;var r=xt()-n;24<r?(isFinite(r)&&(clearTimeout(qe),qe=setTimeout(yt,r)),ze=0):(ze=1,We(yt))}function xt(){for(var t=null,n=w,e=1/0;n;)n=n.flush?t?t.next=n.next:w=n.next:(e=Math.min(e,n.then+n.delay),(t=n).next);return e}function bt(t){var n,e,r=[t.a,t.b],o=[t.c,t.d],u=_t(r),i=Mt(r,o),a=_t(((n=o)[0]+=(a=-i)*(e=r)[0],n[1]+=a*e[1],n))||0;r[0]*o[1]<o[0]*r[1]&&(r[0]*=-1,r[1]*=-1,u*=-1,i*=-1),this.rotate=(u?Math.atan2(r[1],r[0]):Math.atan2(-o[0],o[1]))*Qe,this.translate=[t.e,t.f],this.scale=[u,a],this.skew=a?Math.atan2(i,a)*Qe:0}function Mt(t,n){return t[0]*n[0]+t[1]*n[1]}function _t(t){var n=Math.sqrt(Mt(t,t));return n&&(t[0]/=n,t[1]/=n),n}function wt(t,n){var e,r,o=t.ownerSVGElement||t;return o.createSVGPoint?(e=o.createSVGPoint(),tr<0&&(window.scrollX||window.scrollY)&&(r=(o=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0))[0][0].getScreenCTM(),tr=!r.f&&!r.e,o.remove()),tr?(e.x=n.pageX,e.y=n.pageY):(e.x=n.clientX,e.y=n.clientY),[(e=e.matrixTransform(t.getScreenCTM().inverse())).x,e.y]):(r=t.getBoundingClientRect(),[n.clientX-r.left-t.clientLeft,n.clientY-r.top-t.clientTop])}function C(t){var n=t[0],t=t[t.length-1];return n<t?[n,t]:[t,n]}function kt(t){return t.rangeExtent?t.rangeExtent():C(t.range())}function Nt(t,n){var e,r=0,o=t.length-1,u=t[r],i=t[o];return i<u&&(e=r,r=o,o=e,e=u,u=i,i=e),(e=i-u)&&(n=n(e),t[r]=n.floor(u),t[o]=n.ceil(i)),t}function At(){return Math}function St(t,n){return d3.rebind(t,n,"range","rangeRound","interpolate","clamp")}function Tt(n){return n=Math.pow(10,Math.round(Math.log(n)/Math.LN10)-1),{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}}function Ct(t,n){var t=C(t),e=t[1]-t[0],r=Math.pow(10,Math.floor(Math.log(e/n)/Math.LN10)),n=n/e*r;return n<=.15?r*=10:n<=.35?r*=5:n<=.75&&(r*=2),t[0]=Math.ceil(t[0]/r)*r,t[1]=Math.floor(t[1]/r)*r+.5*r,t[2]=r,t}function zt(t,n){return d3.range.apply(d3,Ct(t,n))}function qt(t,n){return d3.format(",."+Math.max(0,-Math.floor(Math.log(Ct(t,n)[2])/Math.LN10+.01))+"f")}function Dt(t,n,e,r){var o=e(t[0],t[1]),u=r(n[0],n[1]);return function(t){return u(o(t))}}function Et(e,t,n,r){var o=[],u=[],i=0,a=Math.min(e.length,t.length)-1;for(e[a]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<=a;)o.push(n(e[i-1],e[i])),u.push(r(t[i-1],t[i]));return function(t){var n=d3.bisect(e,t,1,a)-1;return u[n](o[n](t))}}function Pt(t){return Math.log(t<0?0:t)/Math.LN10}function Ft(t){return-Math.log(0<t?0:-t)/Math.LN10}function Lt(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function Ht(t){return t.innerRadius}function It(t){return t.outerRadius}function Ot(t){return t.startAngle}function jt(t){return t.endAngle}function Yt(l){function n(t){function n(){r.push("M",d(l(o),g))}for(var e,r=[],o=[],u=-1,i=t.length,a=k(f),c=k(s);++u<i;)h.call(this,e=t[u],u)?o.push([+a.call(this,e,u),+c.call(this,e,u)]):o.length&&(n(),o=[]);return o.length&&n(),r.length?r.join(""):null}var f=Rt,s=Ut,h=H,e=ar,d=N,g=.7;return n.x=function(t){return arguments.length?(f=t,n):f},n.y=function(t){return arguments.length?(s=t,n):s},n.defined=function(t){return arguments.length?(h=t,n):h},n.interpolate=function(t){return arguments.length?(cr.has(t+="")||(t=ar),d=cr.get(e=t),n):e},n.tension=function(t){return arguments.length?(g=t,n):g},n}function Rt(t){return t[0]}function Ut(t){return t[1]}function N(t){for(var n=0,e=t.length,r=t[0],o=[r[0],",",r[1]];++n<e;)o.push("L",(r=t[n])[0],",",r[1]);return o.join("")}function Vt(t){for(var n=0,e=t.length,r=t[0],o=[r[0],",",r[1]];++n<e;)o.push("V",(r=t[n])[1],"H",r[0]);return o.join("")}function Zt(t){for(var n=0,e=t.length,r=t[0],o=[r[0],",",r[1]];++n<e;)o.push("H",(r=t[n])[0],"V",r[1]);return o.join("")}function Bt(t,n){if(n.length<1||t.length!=n.length&&t.length!=n.length+2)return N(t);var e=t.length!=n.length,r="",o=t[0],u=t[1],i=n[0],a=i,c=1;if(e&&(r+="Q"+(u[0]-2*i[0]/3)+","+(u[1]-2*i[1]/3)+","+u[0]+","+u[1],o=t[1],c=2),1<n.length){a=n[1],u=t[c],c++,r+="C"+(o[0]+i[0])+","+(o[1]+i[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var l=2;l<n.length;l++,c++)u=t[c],a=n[l],r+="S"+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1]}return e&&(o=t[c],r+="Q"+(u[0]+2*a[0]/3)+","+(u[1]+2*a[1]/3)+","+o[0]+","+o[1]),r}function Xt(t,n){for(var e,r=[],o=(1-n)/2,u=t[0],i=t[1],a=1,c=t.length;++a<c;)e=u,u=i,i=t[a],r.push([o*(i[0]-e[0]),o*(i[1]-e[1])]);return r}function $t(t){if(t.length<3)return N(t);var n=1,e=t.length,r=t[0],o=r[0],u=r[1],i=[o,o,o,(r=t[1])[0]],a=[u,u,u,r[1]],c=[o,",",u];for(h(c,i,a);++n<e;)r=t[n],i.shift(),i.push(r[0]),a.shift(),a.push(r[1]),h(c,i,a);for(n=-1;++n<2;)i.shift(),i.push(r[0]),a.shift(),a.push(r[1]),h(c,i,a);return c.join("")}function f(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function h(t,n,e){t.push("C",f(lr,n),",",f(lr,e),",",f(fr,n),",",f(fr,e),",",f(T,n),",",f(T,e))}function Gt(t,n){return(n[1]-t[1])/(n[0]-t[0])}function Jt(t){for(var n,e,r,o,u=[],i=function(t){for(var n=0,e=t.length-1,r=[],o=t[0],u=t[1],i=r[0]=Gt(o,u);++n<e;)r[n]=i+(i=Gt(u,u=t[n+1]));return r[n]=i,r}(t),a=-1,c=t.length-1;++a<c;)n=Gt(t[a],t[a+1]),Math.abs(n)<1e-6?i[a]=i[a+1]=0:9<(o=(e=i[a]/n)*e+(r=i[a+1]/n)*r)&&(o=3*n/Math.sqrt(o),i[a]=o*e,i[a+1]=o*r);for(a=-1;++a<=c;)o=(t[Math.min(c,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+i[a]*i[a])),u.push([o||0,i[a]*o||0]);return u}function Kt(t){for(var n,e,r,o=-1,u=t.length;++o<u;)e=(n=t[o])[0],r=n[1]+S,n[0]=e*Math.cos(r),n[1]=e*Math.sin(r);return t}function Wt(g){function n(t){function n(){u.push("M",b(g(a),w),_,M(g(i.reverse()),w),"Z")}for(var e,r,o,u=[],i=[],a=[],c=-1,l=t.length,f=k(p),s=k(v),h=p===m?function(){return r}:k(m),d=v===y?function(){return o}:k(y);++c<l;)x.call(this,e=t[c],c)?(i.push([r=+f.call(this,e,c),o=+s.call(this,e,c)]),a.push([+h.call(this,e,c),+d.call(this,e,c)])):i.length&&(n(),i=[],a=[]);return i.length&&n(),u.length?u.join(""):null}var p=Rt,m=Rt,v=0,y=Ut,x=H,e=ar,b=N,M=N,_="L",w=.7;return n.x=function(t){return arguments.length?(p=m=t,n):m},n.x0=function(t){return arguments.length?(p=t,n):p},n.x1=function(t){return arguments.length?(m=t,n):m},n.y=function(t){return arguments.length?(v=y=t,n):y},n.y0=function(t){return arguments.length?(v=t,n):v},n.y1=function(t){return arguments.length?(y=t,n):y},n.defined=function(t){return arguments.length?(x=t,n):x},n.interpolate=function(t){return arguments.length?(cr.has(t+="")||(t=ar),b=cr.get(e=t),M=b.reverse||b,_=/-closed$/.test(t)?"M":"L",n):e},n.tension=function(t){return arguments.length?(w=t,n):w},n}function Qt(t){return t.source}function tn(t){return t.target}function nn(t){return t.radius}function en(t){return[t.x,t.y]}function rn(){return 64}function on(){return"circle"}function un(t){t=Math.sqrt(t/Math.PI);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function an(t,n){t.attr("transform",function(t){return"translate("+n(t)+",0)"})}function cn(t,n){t.attr("transform",function(t){return"translate(0,"+n(t)+")"})}function ln(t){for(var n=t.source,e=t.target,r=function(t,n){if(t===n)return t;var e=fn(t),r=fn(n),o=e.pop(),u=r.pop(),i=null;for(;o===u;)i=o,o=e.pop(),u=r.pop();return i}(n,e),o=[n];n!==r;)n=n.parent,o.push(n);for(var u=o.length;e!==r;)o.splice(u,0,e),e=e.parent;return o}function fn(t){for(var n=[],e=t.parent;null!=e;)n.push(t),e=(t=e).parent;return n.push(t),n}function sn(t){t.fixed|=2}function hn(t){t!==z&&(t.fixed&=1)}function dn(){z.fixed&=1,vr=z=null}function gn(){z.px=d3.event.x,z.py=d3.event.y,vr.resume()}function pn(t){return 20}function mn(t){return 1}function vn(t){return t.x}function yn(t){return t.y}function xn(t,n,e){t.y0=n,t.y=e}function bn(t){return d3.range(t.length)}function Mn(t){for(var n=-1,e=t[0].length,r=[];++n<e;)r[n]=0;return r}function _n(t){for(var n,e=1,r=0,o=t[0][1],u=t.length;e<u;++e)(n=t[e][1])>o&&(r=e,o=n);return r}function wn(t){return t.reduce(kn,0)}function kn(t,n){return t+n[1]}function Nn(t,n){return An(t,Math.ceil(Math.log(n.length)/Math.LN2+1))}function An(t,n){for(var e=-1,r=+t[0],o=(t[1]-r)/n,u=[];++e<=n;)u[e]=o*e+r;return u}function Sn(t){return[d3.min(t),d3.max(t)]}function t(n,t){return d3.rebind(n,t,"sort","children","value"),n.links=qn,n.nodes=function(t){return _r=!0,(n.nodes=n)(t)},n}function Tn(t){return t.children}function Cn(t){return t.value}function zn(t,n){return n.value-t.value}function qn(t){return d3.merge(t.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function Dn(t,n){return t.value-n.value}function En(t,n){var e=t._pack_next;(t._pack_next=n)._pack_prev=t,(n._pack_next=e)._pack_prev=n}function Pn(t,n){(t._pack_next=n)._pack_prev=t}function Fn(t,n){var e=n.x-t.x,r=n.y-t.y,t=t.r+n.r;return.001<t*t-e*e-r*r}function Ln(t){t._pack_next=t._pack_prev=t}function Hn(t){delete t._pack_next,delete t._pack_prev}function In(t){var n=t.children;n&&n.length?(n.forEach(In),t.r=function(t){function n(t){u=Math.min(t.x-t.r,u),i=Math.max(t.x+t.r,i),a=Math.min(t.y-t.r,a),c=Math.max(t.y+t.r,c)}var e,r,o,u=1/0,i=-1/0,a=1/0,c=-1/0,l=t.length;if(t.forEach(Ln),(e=t[0]).x=-e.r,e.y=0,n(e),1<l&&((f=t[1]).x=f.r,f.y=0,n(f),2<l)){On(e,f,r=t[2]),n(r),En(e,r),En(e._pack_prev=r,f);for(var f=e._pack_next,s=3;s<l;s++){On(e,f,r=t[s]);for(var h=0,d=1,g=1,p=f._pack_next;p!==f;p=p._pack_next,d++)if(Fn(p,r)){h=1;break}if(1==h)for(o=e._pack_prev;o!==p._pack_prev&&!Fn(o,r);o=o._pack_prev,g++);h?(d<g||d==g&&f.r<e.r?Pn(e,f=p):Pn(e=o,f),s--):(En(e,r),n(f=r))}}for(var m=(u+i)/2,v=(a+c)/2,y=0,s=0;s<l;s++){var x=t[s];x.x-=m,x.y-=v,y=Math.max(y,x.r+Math.sqrt(x.x*x.x+x.y*x.y))}return t.forEach(Hn),y}(n)):t.r=Math.sqrt(t.value)}function On(t,n,e){var r,o,u=t.r+e.r,i=n.x-t.x,a=n.y-t.y;u&&(i||a)?(n=n.r+e.r,o=Math.sqrt(i*i+a*a),n=Math.max(-1,Math.min(1,(u*u+o*o-n*n)/(2*u*o))),r=Math.acos(n),n=n*(u/=o),o=Math.sin(r)*u,e.x=t.x+n*i+o*a,e.y=t.y+n*a-o*i):(e.x=t.x+u,e.y=t.y)}function jn(t,n){return t.parent==n.parent?1:2}function Yn(t){var n=t.children;return n&&n.length?n[0]:t._tree.thread}function Rn(t){var n,e=t.children;return e&&(n=e.length)?e[n-1]:t._tree.thread}function Un(t,n){var e=t.children;if(e&&(o=e.length))for(var r,o,u=-1;++u<o;)0<n(r=Un(e[u],n),t)&&(t=r);return t}function Vn(t,n){return t.x-n.x}function Zn(t,n){return n.x-t.x}function Bn(t,n){return t.depth-n.depth}function Xn(t,c){!function t(n,e){var r=n.children;if(r&&(u=r.length))for(var o,u,i=null,a=-1;++a<u;)t(o=r[a],i),i=o;c(n,e)}(t,null)}function $n(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Gn(t,n){var e=t.x+n[3],r=t.y+n[0],o=t.dx-n[1]-n[3],t=t.dy-n[0]-n[2];return o<0&&(e+=o/2,o=0),t<0&&(r+=t/2,t=0),{x:e,y:r,dx:o,dy:t}}function Jn(t){return t.map(Kn).join(",")}function Kn(t){return/[",\n]/.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}function Wn(n,e){return function(t){return t&&n.hasOwnProperty(t.type)?n[t.type](t):e}}function Qn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function te(t,n){wr.hasOwnProperty(t.type)&&wr[t.type](t,n)}function ne(t,n){for(var e=t.coordinates,r=0,o=e.length;r<o;r++)n.apply(null,e[r])}function ee(t){return t.source}function re(t){return t.target}function oe(){function r(t){var n=Math.sin(t*=m)*v,t=Math.sin(m-t)*v,e=t*c+n*g,r=t*l+n*p,t=t*a+n*d;return[Math.atan2(r,e)/q,Math.atan2(t,Math.sqrt(e*e+r*r))/q]}var o,u,i,a,c,l,f,s,h,d,g,p,m,v;return r.distance=function(){return null==m&&(v=1/Math.sin(m=Math.acos(Math.max(-1,Math.min(1,a*d+i*h*Math.cos(f-o)))))),m},r.source=function(t){var n=Math.cos(o=t[0]*q),e=Math.sin(o);return i=Math.cos(u=t[1]*q),a=Math.sin(u),c=i*n,l=i*e,m=null,r},r.target=function(t){var n=Math.cos(f=t[0]*q),e=Math.sin(f);return h=Math.cos(s=t[1]*q),d=Math.sin(s),g=h*n,p=h*e,m=null,r},r}function ue(t,n){t=oe().source(t).target(n);return t.distance(),t}function ie(t,n,e){return(e[0]-n[0])*(t[1]-n[1])<(e[1]-n[1])*(t[0]-n[0])}function ae(t,n,e,r){var o=t[0],u=n[0],i=e[0],a=r[0],t=t[1],n=n[1],e=e[1],u=u-o,a=a-i,n=n-t,r=r[1]-e,e=(a*(t-e)-r*(o-i))/(r*u-a*n);return[o+e*u,t+e*n]}function ce(t,r){for(var n,e,o,u,i,a,c,l,f,s,h,d,g,p={list:t.map(function(t,n){return{index:n,x:t[0],y:t[1]}}).sort(function(t,n){return t.y<n.y?-1:t.y>n.y?1:t.x<n.x?-1:t.x>n.x?1:0}),bottomSite:null},m={list:[],leftEnd:null,rightEnd:null,init:function(){m.leftEnd=m.createHalfEdge(null,"l"),m.rightEnd=m.createHalfEdge(null,"l"),m.leftEnd.r=m.rightEnd,m.rightEnd.l=m.leftEnd,m.list.unshift(m.leftEnd,m.rightEnd)},createHalfEdge:function(t,n){return{edge:t,side:n,vertex:null,l:null,r:null}},insert:function(t,n){n.l=t,n.r=t.r,t.r.l=n,t.r=n},leftBound:function(t){for(var n=m.leftEnd;(n=n.r)!=m.rightEnd&&v.rightOf(n,t););return n=n.l},del:function(t){t.l.r=t.r,t.r.l=t.l,t.edge=null},right:function(t){return t.r},left:function(t){return t.l},leftRegion:function(t){return null==t.edge?p.bottomSite:t.edge.region[t.side]},rightRegion:function(t){return null==t.edge?p.bottomSite:t.edge.region[Ar[t.side]]}},v={bisect:function(t,n){var e={region:{l:t,r:n},ep:{l:null,r:null}},r=n.x-t.x,n=n.y-t.y,o=0<r?r:-r,u=0<n?n:-n;return e.c=t.x*r+t.y*n+.5*(r*r+n*n),u<o?(e.a=1,e.b=n/r,e.c/=r):(e.b=1,e.a=r/n,e.c/=n),e},intersect:function(t,n){var e,r,o,u,i,a=t.edge,c=n.edge;return!a||!c||a.region.r==c.region.r||(r=a.a*c.b-a.b*c.a,Math.abs(r)<1e-10)||(e=(a.c*c.b-c.c*a.b)/r,r=(c.c*a.a-a.c*c.a)/r,i=a.region.r,o=c.region.r,(i=e>=(i.y<o.y||i.y==o.y&&i.x<o.x?(u=t,a):(u=n,c)).region.r.x)&&"l"===u.side)||!i&&"r"===u.side?null:{x:e,y:r}},rightOf:function(t,n){var e,r,o,u,i=t.edge,a=i.region.r,c=n.x>a.x;return c&&"l"===t.side?1:c||"r"!==t.side?(1===i.a?(o=n.y-a.y,u=n.x-a.x,e=r=0,!c&&i.b<0||c&&0<=i.b?e=r=o>=i.b*u:(e=n.x+n.y*i.b>i.c,(e=i.b<0?!e:e)||(r=1)),r||(c=a.x-i.region.l.x,e=i.b*(u*u-o*o)<c*o*(1+2*u/c+i.b*i.b),i.b<0&&(e=!e))):(r=i.c-i.a*n.x,o=n.y-r,e=(u=n.x-a.x)*u+(c=r-a.y)*c<o*o),"l"===t.side?e:!e):0},endPoint:function(t,n,e){t.ep[n]=e,t.ep[Ar[n]]&&r(t)},distance:function(t,n){var e=t.x-n.x,t=t.y-n.y;return Math.sqrt(e*e+t*t)}},y={list:[],insert:function(t,n,e){t.vertex=n,t.ystar=n.y+e;for(var r=0,o=y.list,u=o.length;r<u;r++){var i=o[r];if(!(t.ystar>i.ystar||t.ystar==i.ystar&&n.x>i.vertex.x))break}o.splice(r,0,t)},del:function(t){for(var n=0,e=y.list,r=e.length;n<r&&e[n]!=t;++n);e.splice(n,1)},empty:function(){return 0===y.list.length},nextEvent:function(t){for(var n=0,e=y.list,r=e.length;n<r;++n)if(e[n]==t)return e[n+1];return null},min:function(){var t=y.list[0];return{x:t.vertex.x,y:t.ystar}},extractMin:function(){return y.list.shift()}},x=(m.init(),p.bottomSite=p.list.shift(),p.list.shift());;)if(y.empty()||(n=y.min()),x&&(y.empty()||x.y<n.y||x.y==n.y&&x.x<n.x))e=m.leftBound(x),o=m.right(e),c=m.rightRegion(e),d=v.bisect(c,x),a=m.createHalfEdge(d,"l"),m.insert(e,a),(s=v.intersect(e,a))&&(y.del(e),y.insert(e,s,v.distance(s,x))),e=a,a=m.createHalfEdge(d,"r"),m.insert(e,a),(s=v.intersect(a,o))&&y.insert(a,s,v.distance(s,x)),x=p.list.shift();else{if(y.empty())break;e=y.extractMin(),u=m.left(e),o=m.right(e),i=m.right(o),c=m.leftRegion(e),l=m.rightRegion(o),h=e.vertex,v.endPoint(e.edge,e.side,h),v.endPoint(o.edge,o.side,h),m.del(e),y.del(o),m.del(o),g="l",c.y>l.y&&(f=c,c=l,l=f,g="r"),d=v.bisect(c,l),a=m.createHalfEdge(d,g),m.insert(u,a),v.endPoint(d,Ar[g],h),(s=v.intersect(u,a))&&(y.del(u),y.insert(u,s,v.distance(s,c))),(s=v.intersect(a,i))&&y.insert(a,s,v.distance(s,c))}for(e=m.right(m.leftEnd);e!=m.rightEnd;e=m.right(e))r(e.edge)}function le(){return{leaf:!0,nodes:[],point:null}}function fe(t){return{x:t[0],y:t[1]}}function d(){this._=new Date(1<arguments.length?Date.UTC.apply(this,arguments):arguments[0])}function se(t,n,e,r){for(var o,u,i=0,a=n.length,c=e.length;i<a;){if(c<=r)return-1;if(37==(o=n.charCodeAt(i++))){if(!(u=qr[n.charAt(i++)])||(r=u(t,e,r))<0)return-1}else if(o!=e.charCodeAt(r++))return-1}return r}function he(t,n,e){F.lastIndex=0;n=F.exec(n.substring(e,e+2));return n?(t.d=+n[0],e+n[0].length):-1}function de(t,n,e){F.lastIndex=0;n=F.exec(n.substring(e,e+2));return n?(t.H=+n[0],e+n[0].length):-1}function ge(t){return t.toISOString()}function g(r,u,i){function t(t){var n=r(t),e=o(n,1);return t-n<e-t?n:e}function a(t){return u(t=r(new D(t-1)),1),t}function o(t,n){return u(t=new D(+t),n),t}function c(t,n,e){var r=a(t),o=[];if(1<e)for(;r<n;)i(r)%e||o.push(new Date(+r)),u(r,1);else for(;r<n;)o.push(new Date(+r)),u(r,1);return o}(r.floor=r).round=t,r.ceil=a,r.offset=o,r.range=c;var n=r.utc=pe(r);return(n.floor=n).round=pe(t),n.ceil=pe(a),n.offset=pe(o),n.range=function(t,n,e){try{var r=new(D=d);return r._=t,c(r,n,e)}finally{D=Date}},r}function pe(r){return function(t,n){try{var e=new(D=d);return e._=t,r(e,n)._}finally{D=Date}}}function me(u,i,t){function a(t){return u(t)}return a.invert=function(t){return ye(u.invert(t))},a.domain=function(t){return arguments.length?(u.domain(t),a):u.domain().map(ye)},a.nice=function(t){var n=ve(a.domain());return a.domain([t.floor(n[0]),t.ceil(n[1])])},a.ticks=function(t,n){var e=ve(a.domain());if("function"!=typeof t){var r=(e[1]-e[0])/t,o=d3.bisect(jr,r);if(o==jr.length)return i.year(e,t);if(!o)return u.ticks(t).map(ye);Math.log(r/jr[o-1])<Math.log(jr[o]/r)&&--o,n=(t=i[o])[1],t=t[0].range}return t(e[0],new Date(+e[1]+1),n)},a.tickFormat=function(){return t},a.copy=function(){return me(u.copy(),i,t)},d3.rebind(a,u,"range","rangeRound","interpolate","clamp")}function ve(t){var n=t[0],t=t[t.length-1];return n<t?[n,t]:[t,n]}function ye(t){return new Date(t)}function xe(r){return function(t){for(var n=r.length-1,e=r[n];!e[1](t);)e=r[--n];return e[0](t)}}function be(t){var n=new Date(t,0,1);return n.setFullYear(t),n}function Me(t){var n=t.getFullYear(),e=be(n);return n+(t-e)/(be(n+1)-e)}function _e(t){var n=new Date(Date.UTC(t,0,1));return n.setUTCFullYear(t),n}function we(t){var n=t.getUTCFullYear(),e=_e(n);return n+(t-e)/(_e(n+1)-e)}Date.now||(Date.now=function(){return+new Date});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(t){var n=CSSStyleDeclaration.prototype,ke=n.setProperty;n.setProperty=function(t,n,e){ke.call(this,t,n+"",e)}}d3={version:"2.9.6"};var p=function(t){return Array.prototype.slice.call(t)};try{p(document.documentElement.childNodes)[0].nodeType}catch(t){p=function(t){for(var n=-1,e=t.length,r=[];++n<e;)r.push(t[n]);return r}}var Ne=[].__proto__?function(t,n){t.__proto__=n}:function(t,n){for(var e in n)t[e]=n[e]},Ae=(d3.map=function(t){var n,e=new b;for(n in t)e.set(n,t[n]);return e},b),Se={has:function(t){return e+t in this},get:function(t){return this[e+t]},set:function(t,n){return this[e+t]=n},remove:function(t){return(t=e+t)in this&&delete this[t]},keys:function(){var n=[];return this.forEach(function(t){n.push(t)}),n},values:function(){var e=[];return this.forEach(function(t,n){e.push(n)}),e},entries:function(){var e=[];return this.forEach(function(t,n){e.push({key:t,value:n})}),e},forEach:function(t){for(var n in this)n.charCodeAt(0)===De&&t.call(this,n.substring(1),this[n])}};try{for(var Te in Se)Object.defineProperty(Ae.prototype,Te,{value:Se[Te],enumerable:!1})}catch(t){Ae.prototype=Se}function Ce(){return G}var ze,qe,e="\0",De=e.charCodeAt(0),n=(d3.functor=k,d3.rebind=function(t,n){for(var e,r=1,o=arguments.length;++r<o;)t[e=arguments[r]]=function(n,e,r){return function(){var t=r.apply(e,arguments);return arguments.length?n:t}}(t,n,n[e]);return t},d3.ascending=function(t,n){return t<n?-1:n<t?1:n<=t?0:NaN},d3.descending=function(t,n){return n<t?-1:t<n?1:t<=n?0:NaN},d3.mean=function(t,n){var e,r=t.length,o=0,u=-1,i=0;if(1===arguments.length)for(;++u<r;)I(e=t[u])&&(o+=(e-o)/++i);else for(;++u<r;)I(e=n.call(t,t[u],u))&&(o+=(e-o)/++i);return i?o:void 0},d3.median=function(t,n){return(t=(t=1<arguments.length?t.map(n):t).filter(I)).length?d3.quantile(t.sort(d3.ascending),.5):void 0},d3.min=function(t,n){var e,r,o=-1,u=t.length;if(1===arguments.length){for(;++o<u&&(null==(e=t[o])||e!=e);)e=void 0;for(;++o<u;)null!=(r=t[o])&&r<e&&(e=r)}else{for(;++o<u&&(null==(e=n.call(t,t[o],o))||e!=e);)e=void 0;for(;++o<u;)null!=(r=n.call(t,t[o],o))&&r<e&&(e=r)}return e},d3.max=function(t,n){var e,r,o=-1,u=t.length;if(1===arguments.length){for(;++o<u&&(null==(e=t[o])||e!=e);)e=void 0;for(;++o<u;)null!=(r=t[o])&&e<r&&(e=r)}else{for(;++o<u&&(null==(e=n.call(t,t[o],o))||e!=e);)e=void 0;for(;++o<u;)null!=(r=n.call(t,t[o],o))&&e<r&&(e=r)}return e},d3.extent=function(t,n){var e,r,o,u=-1,i=t.length;if(1===arguments.length){for(;++u<i&&(null==(e=o=t[u])||e!=e);)e=o=void 0;for(;++u<i;)null!=(r=t[u])&&(r<e&&(e=r),o<r)&&(o=r)}else{for(;++u<i&&(null==(e=o=n.call(t,t[u],u))||e!=e);)e=void 0;for(;++u<i;)null!=(r=n.call(t,t[u],u))&&(r<e&&(e=r),o<r)&&(o=r)}return[e,o]},d3.random={normal:function(r,o){return arguments.length<2&&(o=1),arguments.length<1&&(r=0),function(){for(var t,n,e;!(e=(t=2*Math.random()-1)*t+(n=2*Math.random()-1)*n)||1<e;);return r+o*t*Math.sqrt(-2*Math.log(e)/e)}}},d3.sum=function(t,n){var e,r=0,o=t.length,u=-1;if(1===arguments.length)for(;++u<o;)isNaN(e=+t[u])||(r+=e);else for(;++u<o;)isNaN(e=+n.call(t,t[u],u))||(r+=e);return r},d3.quantile=function(t,n){var n=(t.length-1)*n+1,e=Math.floor(n),r=t[e-1],n=n-e;return n?r+n*(t[e]-r):r},d3.transpose=function(t){return d3.zip.apply(d3,t)},d3.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,n=d3.min(arguments,O),e=new Array(n);++t<n;)for(var r,o=-1,u=e[t]=new Array(r);++o<r;)u[o]=arguments[o][t];return e},d3.bisector=function(u){return{left:function(t,n,e,r){for(arguments.length<3&&(e=0),arguments.length<4&&(r=t.length);e<r;){var o=e+r>>1;u.call(t,t[o],o)<n?e=1+o:r=o}return e},right:function(t,n,e,r){for(arguments.length<3&&(e=0),arguments.length<4&&(r=t.length);e<r;){var o=e+r>>1;n<u.call(t,t[o],o)?r=o:e=1+o}return e}}},d3.bisector(function(t){return t})),Ee=(d3.bisectLeft=n.left,d3.bisect=d3.bisectRight=n.right,d3.first=function(t,n){var e,r=0,o=t.length,u=t[0];for(1===arguments.length&&(n=d3.ascending);++r<o;)0<n.call(t,u,e=t[r])&&(u=e);return u},d3.last=function(t,n){var e,r=0,o=t.length,u=t[0];for(1===arguments.length&&(n=d3.ascending);++r<o;)n.call(t,u,e=t[r])<=0&&(u=e);return u},d3.nest=function(){function f(t,n){if(n>=g.length)return h?h.call(d,t):s?t.sort(s):t;for(var e,r,o,u=-1,i=t.length,a=g[n++],c=new b,l={};++u<i;)(o=c.get(e=a(r=t[u])))?o.push(r):c.set(e,[r]);return c.forEach(function(t){l[t]=f(c.get(t),n)}),l}var s,h,d={},g=[],i=[];return d.map=function(t){return f(t,0)},d.entries=function(t){return function t(n,e){if(e>=g.length)return n;var r,o=[],u=i[e++];for(r in n)o.push({key:r,values:t(n[r],e)});return u&&o.sort(function(t,n){return u(t.key,n.key)}),o}(f(t,0),0)},d.key=function(t){return g.push(t),d},d.sortKeys=function(t){return i[g.length-1]=t,d},d.sortValues=function(t){return s=t,d},d.rollup=function(t){return h=t,d},d},d3.keys=function(t){var n,e=[];for(n in t)e.push(n);return e},d3.values=function(t){var n,e=[];for(n in t)e.push(t[n]);return e},d3.entries=function(t){var n,e=[];for(n in t)e.push({key:n,value:t[n]});return e},d3.permute=function(t,n){for(var e=[],r=-1,o=n.length;++r<o;)e[r]=t[n[r]];return e},d3.merge=function(t){return Array.prototype.concat.apply([],t)},d3.split=function(t,n){var e,r=[],o=[],u=-1,i=t.length;for(arguments.length<2&&(n=j);++u<i;)n.call(o,e=t[u],u)?o=[]:(o.length||r.push(o),o.push(e));return r},d3.range=function(t,n,e){if(arguments.length<3&&(e=1,arguments.length<2)&&(n=t,t=0),(n-t)/e==1/0)throw new Error("infinite range");var r,o=[],u=function(t){for(var n=1;t*n%1;)n*=10;return n}(Math.abs(e)),i=-1;if(t*=u,n*=u,(e*=u)<0)for(;(r=t+e*++i)>n;)o.push(r/u);else for(;(r=t+e*++i)<n;)o.push(r/u);return o},d3.requote=function(t){return t.replace(Ee,"\\$&")},/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g),Pe=(d3.round=function(t,n){return n?Math.round(t*(n=Math.pow(10,n)))/n:Math.round(t)},d3.xhr=function(t,n,e){var r=new XMLHttpRequest;arguments.length<3?(e=n,n=null):n&&r.overrideMimeType&&r.overrideMimeType(n),r.open("GET",t,!0),n&&r.setRequestHeader("Accept",n),r.onreadystatechange=function(){var t;4===r.readyState&&(t=r.status,e(!t&&r.response||200<=t&&t<300||304===t?r:null))},r.send(null)},d3.text=function(t,n,e){arguments.length<3&&(e=n,n=null),d3.xhr(t,n,function(t){e(t&&t.responseText)})},d3.json=function(t,n){d3.text(t,"application/json",function(t){n(t?JSON.parse(t):null)})},d3.html=function(t,e){d3.text(t,"text/html",function(t){var n;null!=t&&((n=document.createRange()).selectNode(document.body),t=n.createContextualFragment(t)),e(t)})},d3.xml=function(t,n,e){arguments.length<3&&(e=n,n=null),d3.xhr(t,n,function(t){e(t&&t.responseXML)})},{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}),Fe=(d3.ns={prefix:Pe,qualify:function(t){var n=t.indexOf(":"),e=t;return 0<=n&&(e=t.substring(0,n),t=t.substring(n+1)),Pe.hasOwnProperty(e)?{space:Pe[e],local:t}:t}},d3.dispatch=function(){for(var t=new R,n=-1,e=arguments.length;++n<e;)t[arguments[n]]=U(t);return t},R.prototype.on=function(t,n){var e=t.indexOf("."),r="";return 0<e&&(r=t.substring(e+1),t=t.substring(0,e)),arguments.length<2?this[t].on(r):this[t].on(r,n)},d3.format=function(t){var t=Fe.exec(t),o=t[1]||" ",u=t[3]||"",i=t[5],a=+t[6],c=t[7],l=t[8],f=t[9],s=1,h="",d=!1,l=l&&+l.substring(1);switch(i&&(o="0",c)&&(a-=Math.floor((a-1)/4)),f){case"n":c=!0,f="g";break;case"%":s=100,h="%",f="f";break;case"p":s=100,h="%",f="r";break;case"d":d=!0,l=0;break;case"s":s=-1,f="r"}return"r"!=f||l||(f="g"),f=Le.get(f)||Z,function(t){var n,e,r;return d&&t%1?"":(n=t<0&&(t=-t)?"−":u,s<0?(t=(e=d3.formatPrefix(t,l)).scale(t),h=e.symbol):t*=s,t=f(t,l),i?((r=t.length+n.length)<a&&(t=new Array(a-r+1).join(o)+t),t=n+(t=c?B(t):t)):(r=(t=n+(t=c?B(t):t)).length)<a&&(t=new Array(a-r+1).join(o)+t),t+h)}},/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/),Le=d3.map({g:function(t,n){return t.toPrecision(n)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},r:function(t,n){return d3.round(t,n=V(t,n)).toFixed(Math.max(0,Math.min(20,n)))}}),He=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(function(t,n){var e=Math.pow(10,3*Math.abs(8-n));return{scale:8<n?function(t){return t/e}:function(t){return t*e},symbol:t}}),Ie=(d3.formatPrefix=function(t,n){var e=0;return t&&(t<0&&(t*=-1),n&&(t=d3.round(t,V(t,n))),e=1+Math.floor(1e-12+Math.log(t)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e<=0?e+1:e-1)/3)))),He[8+e/3]},J(2)),Oe=J(3),je=d3.map({linear:Ce,poly:J,quad:function(){return Ie},cubic:function(){return Oe},sin:function(){return K},exp:function(){return W},circle:function(){return Q},elastic:function(n,e){var r;return arguments.length<2&&(e=.45),r=arguments.length<1?(n=1,e/4):e/(2*Math.PI)*Math.asin(1/n),function(t){return 1+n*Math.pow(2,10*-t)*Math.sin(2*(t-r)*Math.PI/e)}},back:function(n){return n=n||1.70158,function(t){return t*t*((n+1)*t-n)}},bounce:function(){return tt}}),Ye=d3.map({in:G,out:X,"in-out":$,"out-in":function(t){return $(X(t))}}),Re=(d3.ease=function(t){var n,e=t.indexOf("-"),r=0<=e?t.substring(0,e):t,e=0<=e?t.substring(e+1):"in",r=je.get(r)||Ce,e=Ye.get(e)||G;return n=e(r.apply(null,Array.prototype.slice.call(arguments,1))),function(t){return t<=0?0:1<=t?1:n(t)}},d3.event=null,d3.interpolate=function(t,n){for(var e,r=d3.interpolators.length;0<=--r&&!(e=d3.interpolators[r](t,n)););return e},d3.interpolateNumber=function(n,e){return e-=n,function(t){return n+e*t}},d3.interpolateRound=function(n,e){return e-=n,function(t){return Math.round(n+e*t)}},d3.interpolateString=function(t,n){var e,r,o,u,i,a=0,c=[],l=[];for(Re.lastIndex=0,r=0;e=Re.exec(n);++r)e.index&&c.push(n.substring(a,e.index)),l.push({i:c.length,x:e[0]}),c.push(null),a=Re.lastIndex;for(a<n.length&&c.push(n.substring(a)),r=0,u=l.length;(e=Re.exec(t))&&r<u;++r)if((i=l[r]).x==e[0]){if(i.i)if(null==c[i.i+1])for(c[i.i-1]+=i.x,c.splice(i.i,1),o=r+1;o<u;++o)l[o].i--;else for(c[i.i-1]+=i.x+c[i.i+1],c.splice(i.i,2),o=r+1;o<u;++o)l[o].i-=2;else if(null==c[i.i+1])c[i.i]=i.x;else for(c[i.i]=i.x+c[i.i+1],c.splice(i.i+1,1),o=r+1;o<u;++o)l[o].i--;l.splice(r,1),u--,r--}else i.x=d3.interpolateNumber(parseFloat(e[0]),parseFloat(i.x));for(;r<u;)i=l.pop(),null==c[i.i+1]?c[i.i]=i.x:(c[i.i]=i.x+c[i.i+1],c.splice(i.i+1,1)),u--;return 1===c.length?null==c[0]?l[0].x:function(){return n}:function(t){for(r=0;r<u;++r)c[(i=l[r]).i]=i.x(t);return c.join("")}},d3.interpolateTransform=function(t,n){var r,o=[],u=[],t=d3.transform(t),n=d3.transform(n),e=t.translate,i=n.translate,a=t.rotate,c=n.rotate,l=t.skew,f=n.skew,t=t.scale,n=n.scale;return e[0]!=i[0]||e[1]!=i[1]?(o.push("translate(",null,",",null,")"),u.push({i:1,x:d3.interpolateNumber(e[0],i[0])},{i:3,x:d3.interpolateNumber(e[1],i[1])})):i[0]||i[1]?o.push("translate("+i+")"):o.push(""),a!=c?(180<a-c?c+=360:180<c-a&&(a+=360),u.push({i:o.push(o.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(a,c)})):c&&o.push(o.pop()+"rotate("+c+")"),l!=f?u.push({i:o.push(o.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(l,f)}):f&&o.push(o.pop()+"skewX("+f+")"),t[0]!=n[0]||t[1]!=n[1]?(r=o.push(o.pop()+"scale(",null,",",null,")"),u.push({i:r-4,x:d3.interpolateNumber(t[0],n[0])},{i:r-2,x:d3.interpolateNumber(t[1],n[1])})):1==n[0]&&1==n[1]||o.push(o.pop()+"scale("+n+")"),r=u.length,function(t){for(var n,e=-1;++e<r;)o[(n=u[e]).i]=n.x(t);return o.join("")}},d3.interpolateRgb=function(t,n){t=d3.rgb(t),n=d3.rgb(n);var e=t.r,r=t.g,o=t.b,u=n.r-e,i=n.g-r,a=n.b-o;return function(t){return"#"+c(Math.round(e+u*t))+c(Math.round(r+i*t))+c(Math.round(o+a*t))}},d3.interpolateHsl=function(t,n){t=d3.hsl(t),n=d3.hsl(n);var e=t.h,r=t.s,o=t.l,u=n.h-e,i=n.s-r,a=n.l-o;return 180<u?u-=360:u<-180&&(u+=360),function(t){return lt(e+u*t,r+i*t,o+a*t).toString()}},d3.interpolateArray=function(t,n){for(var e=[],r=[],o=t.length,u=n.length,i=Math.min(t.length,n.length),a=0;a<i;++a)e.push(d3.interpolate(t[a],n[a]));for(;a<o;++a)r[a]=t[a];for(;a<u;++a)r[a]=n[a];return function(t){for(a=0;a<i;++a)r[a]=e[a](t);return r}},d3.interpolateObject=function(t,n){var e,r={},o={};for(e in t)e in n?r[e]=rt(e)(t[e],n[e]):o[e]=t[e];for(e in n)e in t||(o[e]=n[e]);return function(t){for(e in r)o[e]=r[e](t);return o}},/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g),Ue=(d3.interpolators=[d3.interpolateObject,function(t,n){return n instanceof Array&&d3.interpolateArray(t,n)},function(t,n){return("string"==typeof t||"string"==typeof n)&&d3.interpolateString(t+"",n+"")},function(t,n){return("string"==typeof n?Ue.has(n)||/^(#|rgb\(|hsl\()/.test(n):n instanceof r||n instanceof o)&&d3.interpolateRgb(t,n)},function(t,n){return!isNaN(t=+t)&&!isNaN(n=+n)&&d3.interpolateNumber(t,n)}],d3.rgb=function(t,n,e){return 1===arguments.length?t instanceof r?i(t.r,t.g,t.b):it(""+t,i,lt):i(~~t,~~n,~~e)},r.prototype.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var n=this.r,e=this.g,r=this.b;return n||e||r?(n&&n<30&&(n=30),e&&e<30&&(e=30),r&&r<30&&(r=30),i(Math.min(255,Math.floor(n/t)),Math.min(255,Math.floor(e/t)),Math.min(255,Math.floor(r/t)))):i(30,30,30)},r.prototype.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),i(Math.floor(t*this.r),Math.floor(t*this.g),Math.floor(t*this.b))},r.prototype.hsl=function(){return at(this.r,this.g,this.b)},r.prototype.toString=function(){return"#"+c(this.r)+c(this.g)+c(this.b)},d3.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"})),Ve=(Ue.forEach(function(t,n){Ue.set(t,it(n,i,lt))}),d3.hsl=function(t,n,e){return 1===arguments.length?t instanceof o?l(t.h,t.s,t.l):it(""+t,at,l):l(+t,+n,+e)},o.prototype.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),l(this.h,this.s,this.l/t)},o.prototype.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),l(this.h,this.s,t*this.l)},o.prototype.rgb=function(){return lt(this.h,this.s,this.l)},o.prototype.toString=function(){return this.rgb().toString()},function(t,n){return n.querySelector(t)}),Ze=function(t,n){return n.querySelectorAll(t)},n=document.documentElement,Be=n.matchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector,Xe=function(t,n){return Be.call(t,n)},m=("function"==typeof Sizzle&&(Ve=function(t,n){return Sizzle(t,n)[0]||null},Ze=function(t,n){return Sizzle.uniqueSort(Sizzle(t,n))},Xe=Sizzle.matchesSelector),[]),v=(d3.selection=function(){return v},(d3.selection.prototype=m).select=function(t){var n,e,r,o,u=[];"function"!=typeof t&&(t=ft(t));for(var i=-1,a=this.length;++i<a;){u.push(n=[]),n.parentNode=(r=this[i]).parentNode;for(var c=-1,l=r.length;++c<l;)(o=r[c])?(n.push(e=t.call(o,o.__data__,c)),e&&"__data__"in o&&(e.__data__=o.__data__)):n.push(null)}return s(u)},m.selectAll=function(t){var n,e,r=[];"function"!=typeof t&&(t=st(t));for(var o=-1,u=this.length;++o<u;)for(var i=this[o],a=-1,c=i.length;++a<c;)(e=i[a])&&(r.push(n=p(t.call(e,e.__data__,a))),n.parentNode=e);return s(r)},m.attr=function(n,e){var t;return n=d3.ns.qualify(n),arguments.length<2?(t=this.node(),n.local?t.getAttributeNS(n.space,n.local):t.getAttribute(n)):this.each(null==e?n.local?function(){this.removeAttributeNS(n.space,n.local)}:function(){this.removeAttribute(n)}:"function"==typeof e?n.local?function(){var t=e.apply(this,arguments);null==t?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}:function(){var t=e.apply(this,arguments);null==t?this.removeAttribute(n):this.setAttribute(n,t)}:n.local?function(){this.setAttributeNS(n.space,n.local,e)}:function(){this.setAttribute(n,e)})},m.classed=function(t,n){var e=Y(t).split(" "),r=e.length,o=-1;if(1<arguments.length){for(;++o<r;)ht.call(this,e[o],n);return this}for(;++o<r;)if(!ht.call(this,e[o]))return!1;return!0},m.style=function(n,e,r){return arguments.length<3&&(r=""),arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(n):this.each(null==e?function(){this.style.removeProperty(n)}:"function"==typeof e?function(){var t=e.apply(this,arguments);null==t?this.style.removeProperty(n):this.style.setProperty(n,t,r)}:function(){this.style.setProperty(n,e,r)})},m.property=function(n,e){return arguments.length<2?this.node()[n]:this.each(null==e?function(){delete this[n]}:"function"==typeof e?function(){var t=e.apply(this,arguments);null==t?delete this[n]:this[n]=t}:function(){this[n]=e})},m.text=function(n){return arguments.length<1?this.node().textContent:this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n})},m.html=function(n){return arguments.length<1?this.node().innerHTML:this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n})},m.append=function(t){return t=d3.ns.qualify(t),this.select(t.local?function(){return this.appendChild(document.createElementNS(t.space,t.local))}:function(){return this.appendChild(document.createElementNS(this.namespaceURI,t))})},m.insert=function(t,n){return t=d3.ns.qualify(t),this.select(t.local?function(){return this.insertBefore(document.createElementNS(t.space,t.local),Ve(n,this))}:function(){return this.insertBefore(document.createElementNS(this.namespaceURI,t),Ve(n,this))})},m.remove=function(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})},m.data=function(t,m){function n(t,n){var e,r,o=t.length,u=n.length,i=Math.min(o,u),a=Math.max(o,u),c=[],l=[],f=[];if(m){for(var s,h=new b,d=[],g=n.length,p=-1;++p<o;)s=m.call(e=t[p],e.__data__,p),h.has(s)?f[g++]=e:h.set(s,e),d.push(s);for(p=-1;++p<u;)s=m.call(n,r=n[p],p),h.has(s)?(c[p]=e=h.get(s),e.__data__=r,l[p]=f[p]=null):(l[p]=dt(r),c[p]=f[p]=null),h.remove(s);for(p=-1;++p<o;)h.has(d[p])&&(f[p]=t[p])}else{for(p=-1;++p<i;)e=t[p],r=n[p],e?(e.__data__=r,c[p]=e,l[p]=f[p]=null):(l[p]=dt(r),c[p]=f[p]=null);for(;p<u;++p)l[p]=dt(n[p]),c[p]=f[p]=null;for(;p<a;++p)f[p]=t[p],l[p]=c[p]=null}l.update=c,l.parentNode=c.parentNode=f.parentNode=t.parentNode,v.push(l),y.push(c),x.push(f)}var e,r,o=-1,u=this.length;if(!arguments.length){for(t=new Array(u=(e=this[0]).length);++o<u;)(r=e[o])&&(t[o]=r.__data__);return t}var v=gt([]),y=s([]),x=s([]);if("function"==typeof t)for(;++o<u;)n(e=this[o],t.call(e,e.parentNode.__data__,o));else for(;++o<u;)n(e=this[o],t);return y.enter=function(){return v},y.exit=function(){return x},y},m.datum=m.map=function(t){return arguments.length<1?this.property("__data__"):this.property("__data__",t)},m.filter=function(t){var n,e,r,o,u=[];"function"!=typeof t&&(o=t,t=function(){return Xe(this,o)});for(var i=0,a=this.length;i<a;i++){u.push(n=[]),n.parentNode=(e=this[i]).parentNode;for(var c=0,l=e.length;c<l;c++)(r=e[c])&&t.call(r,r.__data__,c)&&n.push(r)}return s(u)},m.order=function(){for(var t=-1,n=this.length;++t<n;)for(var e,r=this[t],o=r.length-1,u=r[o];0<=--o;)(e=r[o])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},m.sort=function(t){t=function(e){return arguments.length||(e=d3.ascending),function(t,n){return e(t&&t.__data__,n&&n.__data__)}}.apply(this,arguments);for(var n=-1,e=this.length;++n<e;)this[n].sort(t);return this.order()},m.on=function(u,i,a){arguments.length<3&&(a=!1);var c="__on"+u,t=u.indexOf(".");return 0<t&&(u=u.substring(0,t)),arguments.length<2?(t=this.node()[c])&&t._:this.each(function(t,e){function n(t){var n=d3.event;d3.event=t;try{i.call(r,r.__data__,e)}finally{d3.event=n}}var r=this,o=r[c];o&&(r.removeEventListener(u,o,o.$),delete r[c]),i&&(r.addEventListener(u,r[c]=n,n.$=a),n._=i)})},m.each=function(r){return u(this,function(t,n,e){r.call(t,t.__data__,n,e)})},m.call=function(t){return t.apply(this,(arguments[0]=this,arguments)),this},m.empty=function(){return!this.node()},m.node=function(t){for(var n=0,e=this.length;n<e;n++)for(var r=this[n],o=0,u=r.length;o<u;o++){var i=r[o];if(i)return i}return null},m.transition=function(){for(var t,n,e=[],r=-1,o=this.length;++r<o;){e.push(t=[]);for(var u=this[r],i=-1,a=u.length;++i<a;)t.push((n=u[i])?{node:n,delay:Ge,duration:Je}:null)}return pt(e,_||++$e,Date.now())},s([[document]])),y=(v[0].parentNode=n,d3.select=function(t){return"string"==typeof t?v.select(t):s([[t]])},d3.selectAll=function(t){return"string"==typeof t?v.selectAll(t):s([p(t)])},[]),x=(d3.selection.enter=gt,(d3.selection.enter.prototype=y).append=m.append,y.insert=m.insert,y.empty=m.empty,y.node=m.node,y.select=function(t){for(var n,e,r,o,u,i=[],a=-1,c=this.length;++a<c;){r=(o=this[a]).update,i.push(n=[]),n.parentNode=o.parentNode;for(var l=-1,f=o.length;++l<f;)(u=o[l])?(n.push(r[l]=e=t.call(o.parentNode,u.__data__,l)),e.__data__=u.__data__):n.push(null)}return s(i)},{}),M=[],$e=0,_=0,n=d3.ease("cubic-in-out"),Ge=0,Je=250,Ke=n,w=(M.call=m.call,d3.transition=function(t){return arguments.length?_?t.transition():t:v.transition()},(d3.transition.prototype=M).select=function(t){var n,e,r,o=[];"function"!=typeof t&&(t=ft(t));for(var u=-1,i=this.length;++u<i;){o.push(n=[]);for(var a=this[u],c=-1,l=a.length;++c<l;)(r=a[c])&&(e=t.call(r.node,r.node.__data__,c))?("__data__"in r.node&&(e.__data__=r.node.__data__),n.push({node:e,delay:r.delay,duration:r.duration})):n.push(null)}return pt(o,this.id,this.time).ease(this.ease())},M.selectAll=function(t){var n,e,r,o=[];"function"!=typeof t&&(t=st(t));for(var u=-1,i=this.length;++u<i;)for(var a=this[u],c=-1,l=a.length;++c<l;)if(r=a[c]){e=t.call(r.node,r.node.__data__,c),o.push(n=[]);for(var f=-1,s=e.length;++f<s;)n.push({node:e[f],delay:r.delay,duration:r.duration})}return pt(o,this.id,this.time).ease(this.ease())},M.attr=function(t,n){return this.attrTween(t,vt(t,n))},M.attrTween=function(t,r){var o=d3.ns.qualify(t);return this.tween("attr."+t,o.local?function(t,n){var e=r.call(this,t,n,this.getAttributeNS(o.space,o.local));return e===x?(this.removeAttributeNS(o.space,o.local),null):e&&function(t){this.setAttributeNS(o.space,o.local,e(t))}}:function(t,n){var e=r.call(this,t,n,this.getAttribute(o));return e===x?(this.removeAttribute(o),null):e&&function(t){this.setAttribute(o,e(t))}})},M.style=function(t,n,e){return arguments.length<3&&(e=""),this.styleTween(t,vt(t,n),e)},M.styleTween=function(r,o,u){return arguments.length<3&&(u=""),this.tween("style."+r,function(t,n){var e=o.call(this,t,n,window.getComputedStyle(this,null).getPropertyValue(r));return e===x?(this.style.removeProperty(r),null):e&&function(t){this.style.setProperty(r,e(t),u)}})},M.text=function(e){return this.tween("text",function(t,n){this.textContent="function"==typeof e?e.call(this,t,n):e})},M.remove=function(){return this.each("end.transition",function(){var t;!this.__transition__&&(t=this.parentNode)&&t.removeChild(this)})},M.delay=function(r){return u(this,"function"==typeof r?function(t,n,e){t.delay=0|r.call(t=t.node,t.__data__,n,e)}:(r|=0,function(t){t.delay=r}))},M.duration=function(r){return u(this,"function"==typeof r?function(t,n,e){t.duration=Math.max(1,0|r.call(t=t.node,t.__data__,n,e))}:(r=Math.max(1,0|r),function(t){t.duration=r}))},M.transition=function(){return this.select(L)},null),We=(d3.timer=function(t,n,e){var r=!1,o=w;if(arguments.length<3){if(arguments.length<2)n=0;else if(!isFinite(n))return;e=Date.now()}for(;o;){if(o.callback===t){o.then=e,o.delay=n,r=!0;break}o=o.next}r||(w={callback:t,then:e,delay:n,next:w}),ze||(qe=clearTimeout(qe),ze=1,We(yt))},d3.timer.flush=function(){for(var t,n=Date.now(),e=w;e;)t=n-e.then,e.delay||(e.flush=e.callback(t)),e=e.next;xt()},window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,17)}),Qe=(d3.transform=function(t){var n=document.createElementNS(d3.ns.prefix.svg,"g"),e={a:1,b:0,c:0,d:1,e:0,f:0};return(d3.transform=function(t){n.setAttribute("transform",t);t=n.transform.baseVal.consolidate();return new bt(t?t.matrix:e)})(t)},bt.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"},180/Math.PI),tr=(d3.mouse=function(t){return wt(t,nt())},/WebKit/.test(navigator.userAgent)?-1:0),nr=(d3.touches=function(e,t){return(t=arguments.length<2?nt().touches:t)?p(t).map(function(t){var n=wt(e,t);return n.identifier=t.identifier,n}):[]},d3.scale={},d3.scale.linear=function(){return function t(e,r,o,u){function n(){var t=2<Math.min(e.length,r.length)?Et:Dt,n=u?ut:ot;return a=t(e,r,n,o),c=t(r,e,n,d3.interpolate),i}function i(t){return a(t)}var a,c;return i.invert=function(t){return c(t)},i.domain=function(t){return arguments.length?(e=t.map(Number),n()):e},i.range=function(t){return arguments.length?(r=t,n()):r},i.rangeRound=function(t){return i.range(t).interpolate(d3.interpolateRound)},i.clamp=function(t){return arguments.length?(u=t,n()):u},i.interpolate=function(t){return arguments.length?(o=t,n()):o},i.ticks=function(t){return zt(e,t)},i.tickFormat=function(t){return qt(e,t)},i.nice=function(){return Nt(e,Tt),n()},i.copy=function(){return t(e,r,o,u)},n()}([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return function t(a,c){function u(t){return a(c(t))}var l=c.pow;return u.invert=function(t){return l(a.invert(t))},u.domain=function(t){return arguments.length?(c=t[0]<0?Ft:Pt,l=c.pow,a.domain(t.map(c)),u):a.domain().map(l)},u.nice=function(){return a.domain(Nt(a.domain(),At)),u},u.ticks=function(){var t=C(a.domain()),n=[];if(t.every(isFinite)){var e=Math.floor(t[0]),r=Math.ceil(t[1]),o=l(t[0]),u=l(t[1]);if(c===Ft)for(n.push(l(e));e++<r;)for(var i=9;0<i;i--)n.push(l(e)*i);else{for(;e<r;e++)for(i=1;i<10;i++)n.push(l(e)*i);n.push(l(e))}for(e=0;n[e]<o;e++);for(r=n.length;n[r-1]>u;r--);n=n.slice(e,r)}return n},u.tickFormat=function(t,n){var e,r,o;return arguments.length<2&&(n=nr),arguments.length<1?n:(e=Math.max(.1,t/u.ticks().length),r=c===Ft?(o=-1e-12,Math.floor):(o=1e-12,Math.ceil),function(t){return t/l(r(c(t)+o))<=e?n(t):""})},u.copy=function(){return t(a.copy(),c)},St(u,a)}(d3.scale.linear(),Pt)},d3.format(".0e")),er=(Pt.pow=function(t){return Math.pow(10,t)},Ft.pow=function(t){return-Math.pow(10,-t)},d3.scale.pow=function(){return function t(n,e){function r(t){return n(o(t))}var o=Lt(e),u=Lt(1/e);return r.invert=function(t){return u(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t.map(o)),r):n.domain().map(u)},r.ticks=function(t){return zt(r.domain(),t)},r.tickFormat=function(t){return qt(r.domain(),t)},r.nice=function(){return r.domain(Nt(r.domain(),Tt))},r.exponent=function(t){var n;return arguments.length?(n=r.domain(),o=Lt(e=t),u=Lt(1/e),r.domain(n)):e},r.copy=function(){return t(n.copy(),e)},St(r,n)}(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return function t(i,a){function c(t){return f[((o.get(t)||o.set(t,i.push(t)))-1)%f.length]}function l(n,e){return d3.range(i.length).map(function(t){return n+e*t})}var o,f,s;return c.domain=function(t){if(!arguments.length)return i;i=[],o=new b;for(var n,e=-1,r=t.length;++e<r;)o.has(n=t[e])||o.set(n,i.push(n));return c[a.t](a.x,a.p)},c.range=function(t){return arguments.length?(s=0,a={t:"range",x:f=t},c):f},c.rangePoints=function(t,n){var e=t[0],r=t[1],o=(r-e)/(i.length-1+(n=arguments.length<2?0:n));return f=l(i.length<2?(e+r)/2:e+o*n/2,o),s=0,a={t:"rangePoints",x:t,p:n},c},c.rangeBands=function(t,n){var e=t[1]<t[0],r=t[+e],o=(t[1-e]-r)/(i.length+(n=arguments.length<2?0:n));return f=l(r+o*n,o),e&&f.reverse(),s=o*(1-n),a={t:"rangeBands",x:t,p:n},c},c.rangeRoundBands=function(t,n){arguments.length<2&&(n=0);var e=t[1]<t[0],r=t[+e],o=t[1-e],u=Math.floor((o-r)/(i.length+n)),o=o-r-(i.length-n)*u;return f=l(r+Math.round(o/2),u),e&&f.reverse(),s=Math.round(u*(1-n)),a={t:"rangeRoundBands",x:t,p:n},c},c.rangeBand=function(){return s},c.rangeExtent=function(){return C(a.x)},c.copy=function(){return t(i,a)},c.domain(i)}([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(er)},d3.scale.category20=function(){return d3.scale.ordinal().range(rr)},d3.scale.category20b=function(){return d3.scale.ordinal().range(or)},d3.scale.category20c=function(){return d3.scale.ordinal().range(ur)},["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"]),rr=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],or=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],ur=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"],S=(d3.scale.quantile=function(){return function t(e,r){function n(){var t=0,n=(e.length,r.length);for(u=[];++t<n;)u[t-1]=d3.quantile(e,t/n);return o}function o(t){return isNaN(t=+t)?NaN:r[d3.bisect(u,t)]}var u;return o.domain=function(t){return arguments.length?(e=t.filter(function(t){return!isNaN(t)}).sort(d3.ascending),n()):e},o.range=function(t){return arguments.length?(r=t,n()):r},o.quantiles=function(){return u},o.copy=function(){return t(e,r)},n()}([],[])},d3.scale.quantize=function(){return function t(n,e,r){function o(t){return r[Math.max(0,Math.min(a,Math.floor(i*(t-n))))]}function u(){return i=r.length/(e-n),a=r.length-1,o}var i,a;return o.domain=function(t){return arguments.length?(n=+t[0],e=+t[t.length-1],u()):[n,e]},o.range=function(t){return arguments.length?(r=t,u()):r},o.copy=function(){return t(n,e,r)},u()}(0,1,[0,1])},d3.scale.identity=function(){return function t(n){function e(t){return+t}return(e.invert=e).domain=e.range=function(t){return arguments.length?(n=t.map(e),e):n},e.ticks=function(t){return zt(n,t)},e.tickFormat=function(t){return qt(n,t)},e.copy=function(){return t(n)},e}([0,1])},d3.svg={},d3.svg.arc=function(){function n(){var t=c.apply(this,arguments),n=l.apply(this,arguments),e=f.apply(this,arguments)+S,r=s.apply(this,arguments)+S,o=(r<e&&(o=e,e=r,r=o),r-e),u=o<Math.PI?"0":"1",i=Math.cos(e),e=Math.sin(e),a=Math.cos(r),r=Math.sin(r);return ir<=o?t?"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z":t?"M"+n*i+","+n*e+"A"+n+","+n+" 0 "+u+",1 "+n*a+","+n*r+"L"+t*a+","+t*r+"A"+t+","+t+" 0 "+u+",0 "+t*i+","+t*e+"Z":"M"+n*i+","+n*e+"A"+n+","+n+" 0 "+u+",1 "+n*a+","+n*r+"L0,0Z"}var c=Ht,l=It,f=Ot,s=jt;return n.innerRadius=function(t){return arguments.length?(c=k(t),n):c},n.outerRadius=function(t){return arguments.length?(l=k(t),n):l},n.startAngle=function(t){return arguments.length?(f=k(t),n):f},n.endAngle=function(t){return arguments.length?(s=k(t),n):s},n.centroid=function(){var t=(c.apply(this,arguments)+l.apply(this,arguments))/2,n=(f.apply(this,arguments)+s.apply(this,arguments))/2+S;return[Math.cos(n)*t,Math.sin(n)*t]},n},-Math.PI/2),ir=2*Math.PI-1e-6,ar=(d3.svg.line=function(){return Yt(a)},"linear"),cr=d3.map({linear:N,"step-before":Vt,"step-after":Zt,basis:$t,"basis-open":function(t){if(t.length<4)return N(t);for(var n,e=[],r=-1,o=t.length,u=[0],i=[0];++r<3;)n=t[r],u.push(n[0]),i.push(n[1]);for(e.push(f(T,u)+","+f(T,i)),--r;++r<o;)n=t[r],u.shift(),u.push(n[0]),i.shift(),i.push(n[1]),h(e,u,i);return e.join("")},"basis-closed":function(t){for(var n,e,r=-1,o=t.length,u=o+4,i=[],a=[];++r<4;)e=t[r%o],i.push(e[0]),a.push(e[1]);for(n=[f(T,i),",",f(T,a)],--r;++r<u;)e=t[r%o],i.shift(),i.push(e[0]),a.shift(),a.push(e[1]),h(n,i,a);return n.join("")},bundle:function(t,n){var e=t.length-1;if(e)for(var r,o,u=t[0][0],i=t[0][1],a=t[e][0]-u,c=t[e][1]-i,l=-1;++l<=e;)(r=t[l])[0]=n*r[0]+(1-n)*(u+(o=l/e)*a),r[1]=n*r[1]+(1-n)*(i+o*c);return $t(t)},cardinal:function(t,n,e){return t.length<3?N(t):t[0]+Bt(t,Xt(t,n))},"cardinal-open":function(t,n){return t.length<4?N(t):t[1]+Bt(t.slice(1,t.length-1),Xt(t,n))},"cardinal-closed":function(t,n){return t.length<3?N(t):t[0]+Bt((t.push(t[0]),t),Xt([t[t.length-2]].concat(t,[t[1]]),n))},monotone:function(t){return t.length<3?N(t):t[0]+Bt(t,Jt(t))}}),lr=[0,2/3,1/3,0],fr=[0,1/3,2/3,0],T=[0,1/6,2/3,1/6],sr=(d3.svg.line.radial=function(){var t=Yt(Kt);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},(Vt.reverse=Zt).reverse=Vt,d3.svg.area=function(){return Wt(Object)},d3.svg.area.radial=function(){var t=Wt(Kt);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},d3.svg.chord=function(){function n(t,n){var e,r=o(this,a,t,n),t=o(this,c,t,n);return"M"+r.p0+u(r.r,r.p1,r.a1-r.a0)+(n=t,(e=r).a0==n.a0&&e.a1==n.a1?i(r.r,r.p1,r.r,r.p0):i(r.r,r.p1,t.r,t.p0)+u(t.r,t.p1,t.a1-t.a0)+i(t.r,t.p1,r.r,r.p0))+"Z"}function o(t,n,e,r){var n=n.call(t,e,r),e=l.call(t,n,r),o=f.call(t,n,r)+S,t=s.call(t,n,r)+S;return{r:e,a0:o,a1:t,p0:[e*Math.cos(o),e*Math.sin(o)],p1:[e*Math.cos(t),e*Math.sin(t)]}}function u(t,n,e){return"A"+t+","+t+" 0 "+ +(e>Math.PI)+",1 "+n}function i(t,n,e,r){return"Q 0,0 "+r}var a=Qt,c=tn,l=nn,f=Ot,s=jt;return n.radius=function(t){return arguments.length?(l=k(t),n):l},n.source=function(t){return arguments.length?(a=k(t),n):a},n.target=function(t){return arguments.length?(c=k(t),n):c},n.startAngle=function(t){return arguments.length?(f=k(t),n):f},n.endAngle=function(t){return arguments.length?(s=k(t),n):s},n},d3.svg.diagonal=function(){function n(t,n){var e=r.call(this,t,n),t=o.call(this,t,n),n=(e.y+t.y)/2,e=[e,{x:e.x,y:n},{x:t.x,y:n},t];return"M"+(e=e.map(u))[0]+"C"+e[1]+" "+e[2]+" "+e[3]}var r=Qt,o=tn,u=en;return n.source=function(t){return arguments.length?(r=k(t),n):r},n.target=function(t){return arguments.length?(o=k(t),n):o},n.projection=function(t){return arguments.length?(u=t,n):u},n},d3.svg.diagonal.radial=function(){var t=d3.svg.diagonal(),n=en,r=t.projection;return t.projection=function(t){return arguments.length?r((e=n=t,function(){var t=e.apply(this,arguments),n=t[0],t=t[1]+S;return[n*Math.cos(t),n*Math.sin(t)]})):n;var e},t},d3.svg.mouse=d3.mouse,d3.svg.touches=d3.touches,d3.svg.symbol=function(){function n(t,n){return(sr.get(e.call(this,t,n))||un)(r.call(this,t,n))}var e=on,r=rn;return n.type=function(t){return arguments.length?(e=k(t),n):e},n.size=function(t){return arguments.length?(r=k(t),n):r},n},d3.map({circle:un,cross:function(t){t=Math.sqrt(t/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(t){var t=Math.sqrt(t/(2*dr)),n=t*dr;return"M0,"+-t+"L"+n+",0 0,"+t+" "+-n+",0Z"},square:function(t){t=Math.sqrt(t)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(t){var t=Math.sqrt(t/hr),n=t*hr/2;return"M0,"+n+"L"+t+","+-n+" "+-t+","+-n+"Z"},"triangle-up":function(t){var t=Math.sqrt(t/hr),n=t*hr/2;return"M0,"+-n+"L"+t+","+n+" "+-t+","+n+"Z"}})),hr=(d3.svg.symbolTypes=sr.keys(),Math.sqrt(3)),dr=Math.tan(30*Math.PI/180),gr=(d3.svg.axis=function(){function o(t){t.each(function(){var t,n,e=d3.select(this),r=null==S?b.ticks?b.ticks.apply(b,A):b.domain():S,o=null==x?b.tickFormat?b.tickFormat.apply(b,A):String:x,u=function(t,n,e){if(r=[],e&&1<n.length){for(var r,o,u,i=C(t.domain()),a=-1,c=n.length,l=(n[1]-n[0])/++e;++a<c;)for(o=e;0<--o;)(u=+n[a]-o*l)>=i[0]&&r.push(u);for(--a,o=0;++o<e&&(u=+n[a]+o*l)<i[1];)r.push(u)}return r}(b,r,T),u=e.selectAll(".minor").data(u,String),i=u.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),a=d3.transition(u.exit()).style("opacity",1e-6).remove(),c=d3.transition(u).style("opacity",1),u=e.selectAll("g").data(r,String),r=u.enter().insert("g","path").style("opacity",1e-6),l=d3.transition(u.exit()).style("opacity",1e-6).remove(),f=d3.transition(u).style("opacity",1),s=kt(b),e=e.selectAll(".domain").data([0]),h=(e.enter().append("path").attr("class","domain"),d3.transition(e)),d=b.copy(),e=this.__chart__||d,g=(this.__chart__=d,r.append("line").attr("class","tick"),r.append("text"),r.select("line")),p=f.select("line"),m=u.select("text").text(o),v=r.select("text"),y=f.select("text");switch(M){case"bottom":t=an,i.attr("y2",w),c.attr("x2",0).attr("y2",w),g.attr("y2",_),v.attr("y",Math.max(_,0)+N),p.attr("x2",0).attr("y2",_),y.attr("x",0).attr("y",Math.max(_,0)+N),m.attr("dy",".71em").attr("text-anchor","middle"),h.attr("d","M"+s[0]+","+k+"V0H"+s[1]+"V"+k);break;case"top":t=an,i.attr("y2",-w),c.attr("x2",0).attr("y2",-w),g.attr("y2",-_),v.attr("y",-(Math.max(_,0)+N)),p.attr("x2",0).attr("y2",-_),y.attr("x",0).attr("y",-(Math.max(_,0)+N)),m.attr("dy","0em").attr("text-anchor","middle"),h.attr("d","M"+s[0]+","+-k+"V0H"+s[1]+"V"+-k);break;case"left":t=cn,i.attr("x2",-w),c.attr("x2",-w).attr("y2",0),g.attr("x2",-_),v.attr("x",-(Math.max(_,0)+N)),p.attr("x2",-_).attr("y2",0),y.attr("x",-(Math.max(_,0)+N)).attr("y",0),m.attr("dy",".32em").attr("text-anchor","end"),h.attr("d","M"+-k+","+s[0]+"H0V"+s[1]+"H"+-k);break;case"right":t=cn,i.attr("x2",w),c.attr("x2",w).attr("y2",0),g.attr("x2",_),v.attr("x",Math.max(_,0)+N),p.attr("x2",_).attr("y2",0),y.attr("x",Math.max(_,0)+N).attr("y",0),m.attr("dy",".32em").attr("text-anchor","start"),h.attr("d","M"+k+","+s[0]+"H0V"+s[1]+"H"+k)}b.ticks?(r.call(t,e),f.call(t,d),l.call(t,d),i.call(t,e),c.call(t,d),a.call(t,d)):(n=d.rangeBand()/2,r.call(t,u=function(t){return d(t)+n}),f.call(t,u))})}var x,b=d3.scale.linear(),M="bottom",_=6,w=6,k=6,N=3,A=[10],S=null,T=0;return o.scale=function(t){return arguments.length?(b=t,o):b},o.orient=function(t){return arguments.length?(M=t,o):M},o.ticks=function(){return arguments.length?(A=arguments,o):A},o.tickValues=function(t){return arguments.length?(S=t,o):S},o.tickFormat=function(t){return arguments.length?(x=t,o):x},o.tickSize=function(t,n,e){var r;return arguments.length?(_=+t,w=1<(r=arguments.length-1)?+n:_,k=0<r?+arguments[r]:_,o):_},o.tickPadding=function(t){return arguments.length?(N=+t,o):N},o.tickSubdivide=function(t){return arguments.length?(T=+t,o):T},o},d3.svg.brush=function(){function v(t){t.each(function(){var t,n=d3.select(this),e=n.selectAll(".background").data([0]),r=n.selectAll(".extent").data([0]),o=n.selectAll(".resize").data(i,String);n.style("pointer-events","all").on("mousedown.brush",u).on("touchstart.brush",u),e.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),r.enter().append("rect").attr("class","extent").style("cursor","move"),o.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return gr[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",v.empty()?"none":null),o.exit().remove(),w&&(t=kt(w),e.attr("x",t[0]).attr("width",t[1]-t[0]),x(n)),k&&(t=kt(k),e.attr("y",t[0]).attr("height",t[1]-t[0]),b(n)),y(n)})}function y(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+N[+/e$/.test(t)][0]+","+N[+/^s/.test(t)][1]+")"})}function x(t){t.select(".extent").attr("x",N[0][0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",N[1][0]-N[0][0])}function b(t){t.select(".extent").attr("y",N[0][1]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",N[1][1]-N[0][1])}function u(){function e(){var t=d3.event.changedTouches;return t?d3.touches(i,t)[0]:d3.mouse(i)}function t(){var t=e(),n=!1;u&&(t[0]+=u[0],t[1]+=u[1]),g||(d3.event.altKey?(a=a||[(N[0][0]+N[1][0])/2,(N[0][1]+N[1][1])/2],p[0]=N[+(t[0]<a[0])][0],p[1]=N[+(t[1]<a[1])][1]):a=null),h&&r(t,w,0)&&(x(f),n=!0),d&&r(t,k,1)&&(b(f),n=!0),n&&(y(f),l({type:"brush",mode:g?"move":"resize"}))}function r(t,n,e){var r,n=kt(n),o=n[0],n=n[1],u=p[e],i=N[1][e]-N[0][e];return g&&(o-=u,n-=i+u),t=Math.max(o,Math.min(n,t[e])),g?r=(t+=u)+i:(u=a?Math.max(o,Math.min(n,2*a[e]-t)):u)<t?(r=t,t=u):r=u,(N[0][e]!==t||N[1][e]!==r)&&(M=null,N[0][e]=t,N[1][e]=r,1)}function n(){t(),f.style("pointer-events","all").selectAll(".resize").style("display",v.empty()?"none":null),d3.select("body").style("cursor",null),m.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),l({type:"brushend"}),A()}var a,o,u,i=this,c=d3.select(d3.event.target),l=_.of(i,arguments),f=d3.select(i),s=c.datum(),h=!/^(n|s)$/.test(s)&&w,d=!/^(e|w)$/.test(s)&&k,g=c.classed("extent"),p=e(),m=d3.select(window).on("mousemove.brush",t).on("mouseup.brush",n).on("touchmove.brush",t).on("touchend.brush",n).on("keydown.brush",function(){32==d3.event.keyCode&&(g||(a=null,p[0]-=N[1][0],p[1]-=N[1][1],g=2),A())}).on("keyup.brush",function(){32==d3.event.keyCode&&2==g&&(p[0]+=N[1][0],p[1]+=N[1][1],g=0,A())});g?(p[0]=N[0][0]-p[0],p[1]=N[0][1]-p[1]):s?(o=+/w$/.test(s),s=+/^n/.test(s),u=[N[1-o][0]-p[0],N[1-s][1]-p[1]],p[0]=N[o][0],p[1]=N[s][1]):d3.event.altKey&&(a=p.slice()),f.style("pointer-events","none").selectAll(".resize").style("display",null),d3.select("body").style("cursor",c.style("cursor")),l({type:"brushstart"}),t(),A()}var M,_=et(v,"brushstart","brush","brushend"),w=null,k=null,i=pr[0],N=[[0,0],[0,0]];return v.x=function(t){return arguments.length?(i=pr[!(w=t)<<1|!k],v):w},v.y=function(t){return arguments.length?(i=pr[!w<<1|!(k=t)],v):k},v.extent=function(t){var n,e,r,o,u;return arguments.length?(M=[[0,0],[0,0]],w&&(n=t[0],e=t[1],k&&(n=n[0],e=e[0]),M[0][0]=n,M[1][0]=e,w.invert&&(n=w(n),e=w(e)),e<n&&(u=n,n=e,e=u),N[0][0]=0|n,N[1][0]=0|e),k&&(r=t[0],o=t[1],w&&(r=r[1],o=o[1]),M[0][1]=r,M[1][1]=o,k.invert&&(r=k(r),o=k(o)),o<r&&(u=r,r=o,o=u),N[0][1]=0|r,N[1][1]=0|o),v):(t=M||N,w&&(n=t[0][0],e=t[1][0],M||(n=N[0][0],e=N[1][0],w.invert&&(n=w.invert(n),e=w.invert(e)),e<n&&(u=n,n=e,e=u))),k&&(r=t[0][1],o=t[1][1],M||(r=N[0][1],o=N[1][1],k.invert&&(r=k.invert(r),o=k.invert(o)),o<r&&(u=r,r=o,o=u))),w&&k?[[n,r],[e,o]]:w?[n,e]:k&&[r,o])},v.clear=function(){return M=null,N[0][0]=N[0][1]=N[1][0]=N[1][1]=0,v},v.empty=function(){return w&&N[0][0]===N[1][0]||k&&N[0][1]===N[1][1]},d3.rebind(v,_,"on")},{n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"}),pr=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];d3.behavior={},d3.behavior.drag=function(){function n(){this.on("mousedown.drag",t).on("touchstart.drag",t)}function t(){function r(){var t=u.parentNode,n=d3.event.changedTouches;return n?d3.touches(t,n)[0]:d3.mouse(t)}function t(){if(!u.parentNode)return o();var t=r(),n=t[0]-a[0],e=t[1]-a[1];c|=n|e,a=t,A(),i({type:"drag",x:t[0]+f[0],y:t[1]+f[1],dx:n,dy:e})}function o(){i({type:"dragend"}),c&&(A(),d3.event.target===e)&&l.on("click.drag",n,!0),l.on("mousemove.drag",null).on("touchmove.drag",null).on("mouseup.drag",null).on("touchend.drag",null)}function n(){A(),l.on("click.drag",null)}var u=this,i=s.of(u,arguments),e=d3.event.target,a=r(),c=0,l=d3.select(window).on("mousemove.drag",t).on("touchmove.drag",t).on("mouseup.drag",o,!0).on("touchend.drag",o,!0),f=h?[(f=h.apply(u,arguments)).x-a[0],f.y-a[1]]:[0,0];A(),i({type:"dragstart"})}var s=et(n,"drag","dragstart","dragend"),h=null;return n.origin=function(t){return arguments.length?(h=t,n):h},d3.rebind(n,s,"on")},d3.behavior.zoom=function(){function n(){this.on("mousedown.zoom",t).on("mousewheel.zoom",e).on("mousemove.zoom",r).on("DOMMouseScroll.zoom",e).on("dblclick.zoom",u).on("touchstart.zoom",i).on("touchmove.zoom",f).on("touchend.zoom",i)}function a(t){return[(t[0]-y[0])/x,(t[1]-y[1])/x]}function o(t){x=Math.max(b[0],Math.min(b[1],t))}function c(t,n){var e;n=[(e=n)[0]*x+y[0],e[1]*x+y[1]],y[0]+=t[0]-n[0],y[1]+=t[1]-n[1]}function l(t){g&&g.domain(d.range().map(function(t){return(t-y[0])/x}).map(d.invert)),m&&m.domain(p.range().map(function(t){return(t-y[1])/x}).map(p.invert)),d3.event.preventDefault(),t({type:"zoom",scale:x,translate:y})}function t(){function t(){A(),u.on("click.zoom",null)}var n=this,e=M.of(n,arguments),r=d3.event.target,o=0,u=d3.select(window).on("mousemove.zoom",function(){o=1,c(d3.mouse(n),i),l(e)}).on("mouseup.zoom",function(){o&&A(),u.on("mousemove.zoom",null).on("mouseup.zoom",null),o&&d3.event.target===r&&u.on("click.zoom",t,!0)}),i=a(d3.mouse(n));window.focus(),A()}function e(){s=s||a(d3.mouse(this)),o(Math.pow(2,.002*function(){mr=mr||d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode;var n,e=d3.event;try{mr.scrollTop=1e3,mr.dispatchEvent(e),n=1e3-mr.scrollTop}catch(t){n=e.wheelDelta||5*-e.detail}return n}())*x),c(d3.mouse(this),s),l(M.of(this,arguments))}function r(){s=null}function u(){var t=d3.mouse(this),n=a(t);o(d3.event.shiftKey?x/2:2*x),c(t,n),l(M.of(this,arguments))}function i(){var t,n=d3.touches(this),e=Date.now();h=x,s={},n.forEach(function(t){s[t.identifier]=a(t)}),A(),1===n.length&&e-v<500&&(t=n[0],n=a(n[0]),o(2*x),c(t,n),l(M.of(this,arguments))),v=e}function f(){var t,n=d3.touches(this),e=n[0],r=s[e.identifier];(n=n[1])&&(t=s[n.identifier],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],r=[(r[0]+t[0])/2,(r[1]+t[1])/2],o(d3.event.scale*h)),c(e,r),l(M.of(this,arguments))}var s,h,d,g,p,m,v,y=[0,0],x=1,b=yr,M=et(n,"zoom");return n.translate=function(t){return arguments.length?(y=t.map(Number),n):y},n.scale=function(t){return arguments.length?(x=+t,n):x},n.scaleExtent=function(t){return arguments.length?(b=null==t?yr:t.map(Number),n):b},n.x=function(t){return arguments.length?(d=(g=t).copy(),n):g},n.y=function(t){return arguments.length?(p=(m=t).copy(),n):m},d3.rebind(n,M,"on")};var mr,vr,z,yr=[0,1/0],xr=(d3.layout={},d3.layout.bundle=function(){return function(t){for(var n=[],e=-1,r=t.length;++e<r;)n.push(ln(t[e]));return n}},d3.layout.chord=function(){function t(){var t,n,e,r,o,u={},i=[],a=d3.range(b),c=[];for(v=[],y=[],t=0,r=-1;++r<b;){for(n=0,o=-1;++o<b;)n+=x[r][o];i.push(n),c.push(d3.range(b)),t+=n}for(M&&a.sort(function(t,n){return M(i[t],i[n])}),_&&c.forEach(function(t,e){t.sort(function(t,n){return _(x[e][t],x[e][n])})}),t=(2*Math.PI-k*b)/t,n=0,r=-1;++r<b;){for(e=n,o=-1;++o<b;){var l=a[r],f=c[l][o],s=x[l][f],h=n,d=n+=s*t;u[l+"-"+f]={index:l,subindex:f,startAngle:h,endAngle:d,value:s}}y[l]={index:l,startAngle:e,endAngle:n,value:(n-e)/t},n+=k}for(r=-1;++r<b;)for(o=r-1;++o<b;){var g=u[r+"-"+o],p=u[o+"-"+r];(g.value||p.value)&&v.push(g.value<p.value?{source:p,target:g}:{source:g,target:p})}w&&m()}function m(){v.sort(function(t,n){return w((t.source.value+t.target.value)/2,(n.source.value+n.target.value)/2)})}var v,y,x,b,M,_,w,n={},k=0;return n.matrix=function(t){return arguments.length?(b=(x=t)&&x.length,v=y=null,n):x},n.padding=function(t){return arguments.length?(k=t,v=y=null,n):k},n.sortGroups=function(t){return arguments.length?(M=t,v=y=null,n):M},n.sortSubgroups=function(t){return arguments.length?(_=t,v=null,n):_},n.sortChords=function(t){return arguments.length?(w=t,v&&m(),n):w},n.chords=function(){return v||t(),v},n.groups=function(){return y||t(),y},n},d3.layout.force=function(){function t(t){sn(z=t),vr=o}var n,s,h,d,g,o={},p=d3.dispatch("start","tick","end"),m=[1,1],v=.9,u=pn,y=mn,x=-30,b=.1,M=.8,_=[],w=[];return o.tick=function(){if((s*=.99)<.005)return p.end({type:"end",alpha:s=0}),!0;for(var t,n,e,r,o,u,i,a,c=_.length,l=w.length,f=0;f<l;++f)e=(n=w[f]).source,(o=(i=(r=n.target).x-e.x)*i+(a=r.y-e.y)*a)&&(i*=o=s*d[f]*((o=Math.sqrt(o))-h[f])/o,a*=o,r.x-=i*(u=e.weight/(r.weight+e.weight)),r.y-=a*u,e.x+=i*(u=1-u),e.y+=a*u);if((u=s*b)&&(i=m[0]/2,a=m[1]/2,f=-1,u))for(;++f<c;)(n=_[f]).x+=(i-n.x)*u,n.y+=(a-n.y)*u;if(x)for(function t(n,e,r){var o,u=0,i=0;if(n.charge=0,!n.leaf)for(var a,c=n.nodes,l=c.length,f=-1;++f<l;)null!=(a=c[f])&&(t(a,e,r),n.charge+=a.charge,u+=a.charge*a.cx,i+=a.charge*a.cy);n.point&&(n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5),o=e*r[n.point.index],n.charge+=n.pointCharge=o,u+=o*n.point.x,i+=o*n.point.y),n.cx=u/n.charge,n.cy=i/n.charge}(t=d3.geom.quadtree(_),s,g),f=-1;++f<c;)(n=_[f]).fixed||t.visit(function(l){return function(t,n,e,r,o){if(t.point!==l){var u,i=t.cx-l.x,a=t.cy-l.y,c=1/Math.sqrt(i*i+a*a);if((r-n)*c<M)return u=t.charge*c*c,l.px-=i*u,l.py-=a*u,!0;t.point&&isFinite(c)&&(u=t.pointCharge*c*c,l.px-=i*u,l.py-=a*u)}return!t.charge}}(n));for(f=-1;++f<c;)(n=_[f]).fixed?(n.x=n.px,n.y=n.py):(n.x-=(n.px-(n.px=n.x))*v,n.y-=(n.py-(n.py=n.y))*v);p.tick({type:"tick",alpha:s})},o.nodes=function(t){return arguments.length?(_=t,o):_},o.links=function(t){return arguments.length?(w=t,o):w},o.size=function(t){return arguments.length?(m=t,o):m},o.linkDistance=function(t){return arguments.length?(u=k(t),o):u},o.distance=o.linkDistance,o.linkStrength=function(t){return arguments.length?(y=k(t),o):y},o.friction=function(t){return arguments.length?(v=t,o):v},o.charge=function(t){return arguments.length?(x="function"==typeof t?t:+t,o):x},o.gravity=function(t){return arguments.length?(b=t,o):b},o.theta=function(t){return arguments.length?(M=t,o):M},o.alpha=function(t){return arguments.length?(s?s=0<t?t:0:0<t&&(p.start({type:"start",alpha:s=t}),d3.timer(o.tick)),o):s},o.start=function(){function t(t,n){for(var e,r=function(){if(!a){for(a=[],i=0;i<c;++i)a[i]=[];for(i=0;i<l;++i){var t=w[i];a[t.source.index].push(t.target),a[t.target.index].push(t.source)}}return a[f]}(),o=-1,u=r.length;++o<u;)if(!isNaN(e=r[o][t]))return e;return Math.random()*n}for(var i,a,n,c=_.length,l=w.length,e=m[0],r=m[1],f=0;f<c;++f)(n=_[f]).index=f,n.weight=0;for(h=[],d=[],f=0;f<l;++f)"number"==typeof(n=w[f]).source&&(n.source=_[n.source]),"number"==typeof n.target&&(n.target=_[n.target]),h[f]=u.call(this,n,f),d[f]=y.call(this,n,f),++n.source.weight,++n.target.weight;for(f=0;f<c;++f)n=_[f],isNaN(n.x)&&(n.x=t("x",e)),isNaN(n.y)&&(n.y=t("y",r)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(g=[],"function"==typeof x)for(f=0;f<c;++f)g[f]=+x.call(this,_[f],f);else for(f=0;f<c;++f)g[f]=x;return o.resume()},o.resume=function(){return o.alpha(.1)},o.stop=function(){return o.alpha(0)},o.drag=function(){n=n||d3.behavior.drag().origin(a).on("dragstart",t).on("drag",gn).on("dragend",dn),this.on("mouseover.force",sn).on("mouseout.force",hn).call(n)},d3.rebind(o,p,"on")},d3.layout.partition=function(){function n(t,n){t=e.call(this,t,n);return function t(n,e,r,o){var u=n.children;if(n.x=e,n.y=n.depth*o,n.dx=r,n.dy=o,u&&(i=u.length)){var i,a,c=-1;for(r=n.value?r/n.value:0;++c<i;)t(a=u[c],e,a=a.value*r,o),e+=a}}(t[0],0,r[0],r[1]/function t(n){var e=n.children,r=0;if(e&&(o=e.length))for(var o,u=-1;++u<o;)r=Math.max(r,t(e[u]));return 1+r}(t[0])),t}var e=d3.layout.hierarchy(),r=[1,1];return n.size=function(t){return arguments.length?(r=t,n):r},t(n,e)},d3.layout.pie=function(){function a(e,t){var r=e.map(function(t,n){return+c.call(a,t,n)}),n=+("function"==typeof f?f.apply(this,arguments):f),o=(("function"==typeof s?s.apply(this,arguments):s)-f)/d3.sum(r),u=d3.range(e.length),i=(null!=l&&u.sort(l===xr?function(t,n){return r[n]-r[t]}:function(t,n){return l(e[t],e[n])}),[]);return u.forEach(function(t){i[t]={data:e[t],value:t=r[t],startAngle:n,endAngle:n+=t*o}}),i}var c=Number,l=xr,f=0,s=2*Math.PI;return a.value=function(t){return arguments.length?(c=t,a):c},a.sort=function(t){return arguments.length?(l=t,a):l},a.startAngle=function(t){return arguments.length?(f=t,a):f},a.endAngle=function(t){return arguments.length?(s=t,a):s},a},{}),br=(d3.layout.stack=function(){function s(t,n){for(var e,r,o=(i=t.map(function(t,n){return h.call(s,t,n)})).map(function(t,n){return t.map(function(t,n){return[m.call(s,t,n),v.call(s,t,n)]})}),u=d.call(s,o,n),i=d3.permute(i,u),o=d3.permute(o,u),a=g.call(s,o,n),c=i.length,l=i[0].length,f=0;f<l;++f)for(p.call(s,i[0][f],r=a[f],o[0][f][1]),e=1;e<c;++e)p.call(s,i[e][f],r+=o[e-1][f][1],o[e][f][1]);return t}var h=a,d=bn,g=Mn,p=xn,m=vn,v=yn;return s.values=function(t){return arguments.length?(h=t,s):h},s.order=function(t){return arguments.length?(d="function"==typeof t?t:br.get(t)||bn,s):d},s.offset=function(t){return arguments.length?(g="function"==typeof t?t:Mr.get(t)||Mn,s):g},s.x=function(t){return arguments.length?(m=t,s):m},s.y=function(t){return arguments.length?(v=t,s):v},s.out=function(t){return arguments.length?(p=t,s):p},s},d3.map({"inside-out":function(t){for(var n,e=t.length,r=t.map(_n),o=t.map(wn),u=d3.range(e).sort(function(t,n){return r[t]-r[n]}),i=0,a=0,c=[],l=[],f=0;f<e;++f)n=u[f],(i<a?(i+=o[n],c):(a+=o[n],l)).push(n);return l.reverse().concat(c)},reverse:function(t){return d3.range(t.length).reverse()},default:bn})),Mr=d3.map({silhouette:function(t){for(var n,e,r=t.length,o=t[0].length,u=[],i=0,a=[],c=0;c<o;++c){for(e=n=0;n<r;n++)e+=t[n][c][1];i<e&&(i=e),u.push(e)}for(c=0;c<o;++c)a[c]=(i-u[c])/2;return a},wiggle:function(t){var n,e,r,o,u,i,a,c,l,f=t.length,s=t[0],h=s.length,d=[];for(d[0]=c=l=0,e=1;e<h;++e){for(o=n=0;n<f;++n)o+=t[n][e][1];for(a=s[e][u=n=0]-s[e-1][0];n<f;++n){for(r=0,i=(t[n][e][1]-t[n][e-1][1])/(2*a);r<n;++r)i+=(t[r][e][1]-t[r][e-1][1])/a;u+=i*t[n][e][1]}d[e]=c-=o?u/o*a:0,c<l&&(l=c)}for(e=0;e<h;++e)d[e]-=l;return d},expand:function(t){for(var n,e,r=t.length,o=t[0].length,u=1/r,i=[],a=0;a<o;++a){for(e=n=0;n<r;n++)e+=t[n][a][1];if(e)for(n=0;n<r;n++)t[n][a][1]/=e;else for(n=0;n<r;n++)t[n][a][1]=u}for(a=0;a<o;++a)i[a]=0;return i},zero:Mn}),_r=(d3.layout.histogram=function(){function e(t,n){for(var e,r,o=[],u=t.map(h,this),i=d.call(this,u,n),a=g.call(this,i,u,n),n=-1,c=u.length,l=a.length-1,f=s?1:1/c;++n<l;)(e=o[n]=[]).dx=a[n+1]-(e.x=a[n]),e.y=0;if(0<l)for(n=-1;++n<c;)(r=u[n])>=i[0]&&r<=i[1]&&((e=o[d3.bisect(a,r,1,l)-1]).y+=f,e.push(t[n]));return o}var s=!0,h=Number,d=Sn,g=Nn;return e.value=function(t){return arguments.length?(h=t,e):h},e.range=function(t){return arguments.length?(d=k(t),e):d},e.bins=function(n){return arguments.length?(g="number"==typeof n?function(t){return An(t,n)}:k(n),e):g},e.frequency=function(t){return arguments.length?(s=!!t,e):s},e},!(d3.layout.hierarchy=function(){function h(t){var n=[];return function t(n,e,r){var o=g.call(h,n,e),u=_r?n:{data:n};if(u.depth=e,r.push(u),o&&(i=o.length)){for(var i,a,c=-1,l=u.children=[],f=0,s=e+1;++c<i;)(a=t(o[c],s,r)).parent=u,l.push(a),f+=a.value;d&&l.sort(d),p&&(u.value=f)}else p&&(u.value=+p.call(h,n,e)||0);return u}(t,0,n),n}var d=zn,g=Tn,p=Cn;return h.sort=function(t){return arguments.length?(d=t,h):d},h.children=function(t){return arguments.length?(g=t,h):g},h.value=function(t){return arguments.length?(p=t,h):p},h.revalue=function(t){return function t(n,e){var r=n.children,o=0;if(r&&(u=r.length))for(var u,i=-1,a=e+1;++i<u;)o+=t(r[i],a);else p&&(o=+p.call(h,_r?n:n.data,e)||0);return p&&(n.value=o),o}(t,0),t},h})),q=(d3.layout.pack=function(){function n(t,n){var t=o.call(this,t,n),n=t[0],e=(n.x=0,n.y=0,In(n),u[0]),r=u[1];return function t(n,e,r,o){var u=n.children;if(n.x=e+=o*n.x,n.y=r+=o*n.y,n.r*=o,u)for(var i=-1,a=u.length;++i<a;)t(u[i],e,r,o)}(n,e/2,r/2,1/Math.max(2*n.r/e,2*n.r/r)),t}var o=d3.layout.hierarchy().sort(Dn),u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},t(n,o)},d3.layout.cluster=function(){function n(t,n){var r,t=c.call(this,t,n),e=t[0],o=0,n=(Xn(e,function(t){var n,e=t.children;e&&e.length?(t.x=(n=e).reduce(function(t,n){return t+n.x},0)/n.length,t.y=1+d3.max(e,function(t){return t.y})):(t.x=r?o+=l(t,r):0,t.y=0,r=t)}),function t(n){var e=n.children;return e&&e.length?t(e[0]):n}(e)),u=function t(n){var e,r=n.children;return r&&(e=r.length)?t(r[e-1]):n}(e),i=n.x-l(n,u)/2,a=u.x+l(u,n)/2;return Xn(e,function(t){t.x=(t.x-i)/(a-i)*f[0],t.y=(1-(e.y?t.y/e.y:1))*f[1]}),t}var c=d3.layout.hierarchy().sort(null).value(null),l=jn,f=[1,1];return n.separation=function(t){return arguments.length?(l=t,n):l},n.size=function(t){return arguments.length?(f=t,n):f},t(n,c)},d3.layout.tree=function(){function n(t,n){var t=c.call(this,t,n),n=t[0],e=(Xn(n,function(t,n){t._tree={ancestor:t,prelim:0,mod:0,change:0,shift:0,number:n?n._tree.number+1:0}}),function t(n,e){var r=n.children,o=n._tree;if(r&&(u=r.length)){for(var u,i,a,c=r[0],l=c,f=-1;++f<u;)t(a=r[f],i),l=function(t,n,e){if(n){for(var r,o=t,u=t,i=n,a=t.parent.children[0],c=o._tree.mod,l=u._tree.mod,f=i._tree.mod,s=a._tree.mod;i=Rn(i),o=Yn(o),i&&o;)a=Yn(a),(u=Rn(u))._tree.ancestor=t,0<(r=i._tree.prelim+f-o._tree.prelim-c+m(i,o))&&(function(t,n,e){t=t._tree;var r=e/((n=n._tree).number-t.number);t.change+=r,n.change-=r,n.shift+=e,n.prelim+=e,n.mod+=e}(function(t,n,e){return t._tree.ancestor.parent==n.parent?t._tree.ancestor:e}(i,t,e),t,r),c+=r,l+=r),f+=i._tree.mod,c+=o._tree.mod,s+=a._tree.mod,l+=u._tree.mod;i&&!Rn(u)&&(u._tree.thread=i,u._tree.mod+=f-l),o&&!Yn(a)&&(a._tree.thread=o,a._tree.mod+=c-s,e=t)}return e}(a,i,l),i=a;for(var s,h=0,d=0,g=n.children,p=g.length;0<=--p;)(s=g[p]._tree).prelim+=h,s.mod+=h,h+=s.shift+(d+=s.change);c=.5*(c._tree.prelim+a._tree.prelim),e?(o.prelim=e._tree.prelim+m(n,e),o.mod=o.prelim-c):o.prelim=c}else e&&(o.prelim=e._tree.prelim+m(n,e))}(n),function t(n,e){n.x=n._tree.prelim+e;var r=n.children;if(r&&(o=r.length)){var o,u=-1;for(e+=n._tree.mod;++u<o;)t(r[u],e)}}(n,-n._tree.prelim),Un(n,Zn)),r=Un(n,Vn),o=Un(n,Bn),u=e.x-m(e,r)/2,i=r.x+m(r,e)/2,a=o.depth||1;return Xn(n,function(t){t.x=(t.x-u)/(i-u)*l[0],t.y=t.depth/a*l[1],delete t._tree}),t}var c=d3.layout.hierarchy().sort(null).value(null),m=jn,l=[1,1];return n.separation=function(t){return arguments.length?(m=t,n):m},n.size=function(t){return arguments.length?(l=t,n):l},t(n,c)},d3.layout.treemap=function(){function c(t,n){for(var e,r,o=-1,u=t.length;++o<u;)r=(e=t[o]).value*(n<0?0:n),e.area=isNaN(r)||r<=0?0:r}function l(t){var n=t.children;if(n&&n.length){var e,r=h(t),o=[],u=n.slice(),i=1/0,a=Math.min(r.dx,r.dy);for(c(u,r.dx*r.dy/t.value),o.area=0;0<(e=u.length);)o.push(e=u[e-1]),o.area+=e.area,i=(e=function(t,n){var e,r=t.area,o=0,u=1/0,i=-1,a=t.length;for(;++i<a;)(e=t[i].area)&&(e<u&&(u=e),o<e)&&(o=e);return n*=n,(r*=r)?Math.max(n*o*g/r,r/(n*u*g)):1/0}(o,a))<=i?(u.pop(),e):(o.area-=o.pop().area,f(o,a,r,!1),a=Math.min(r.dx,r.dy),1/(o.length=o.area=0));o.length&&(f(o,a,r,!0),o.length=o.area=0),n.forEach(l)}}function i(t){var n=t.children;if(n&&n.length){var e,r=h(t),o=n.slice(),u=[];for(c(o,r.dx*r.dy/t.value),u.area=0;e=o.pop();)u.push(e),u.area+=e.area,null!=e.z&&(f(u,e.z?r.dx:r.dy,r,!o.length),u.length=u.area=0);n.forEach(i)}}function f(t,n,e,r){var o,u=-1,i=t.length,a=e.x,c=e.y,l=n?s(t.area/n):0;if(n==e.dx){for((r||l>e.dy)&&(l=e.dy);++u<i;)(o=t[u]).x=a,o.y=c,o.dy=l,a+=o.dx=Math.min(e.x+e.dx-a,l?s(o.area/l):0);o.z=!0,o.dx+=e.x+e.dx-a,e.y+=l,e.dy-=l}else{for((r||l>e.dx)&&(l=e.dx);++u<i;)(o=t[u]).x=a,o.y=c,o.dx=l,c+=o.dy=Math.min(e.y+e.dy-c,l?s(o.area/l):0);o.z=!1,o.dy+=e.y+e.dy-c,e.x+=l,e.dx-=l}}function r(t){var t=e||o(t),n=t[0];return n.x=0,n.y=0,n.dx=u[0],n.dy=u[1],e&&o.revalue(n),c([n],n.dx*n.dy/n.value),(e?i:l)(n),d&&(e=t),t}var e,o=d3.layout.hierarchy(),s=Math.round,u=[1,1],a=null,h=$n,d=!1,g=.5*(1+Math.sqrt(5));return r.size=function(t){return arguments.length?(u=t,r):u},r.padding=function(e){function t(t){return Gn(t,e)}var n;return arguments.length?(h=null==(a=e)?$n:"function"==(n=typeof e)?function(t){var n=e.call(r,t,t.depth);return null==n?$n(t):Gn(t,"number"==typeof n?[n,n,n,n]:n)}:("number"==n&&(e=[e,e,e,e]),t),r):a},r.round=function(t){return arguments.length?(s=t?Math.round:Number,r):s!=Number},r.sticky=function(t){return arguments.length?(d=t,e=null,r):d},r.ratio=function(t){return arguments.length?(g=t,r):g},t(r,o)},d3.csv=function(t,n){d3.text(t,"text/csv",function(t){n(t&&d3.csv.parse(t))})},d3.csv.parse=function(t){var u;return d3.csv.parseRows(t,function(t,n){if(n){for(var e={},r=-1,o=u.length;++r<o;)e[u[r]]=t[r];return e}return u=t,null})},d3.csv.parseRows=function(r,t){function n(){if(c.lastIndex>=r.length)return i;if(o)return o=!1,u;var t=c.lastIndex;if(34===r.charCodeAt(t)){for(var n=t;n++<r.length;)if(34===r.charCodeAt(n)){if(34!==r.charCodeAt(n+1))break;n++}c.lastIndex=n+2;var e=r.charCodeAt(n+1);return 13===e?(o=!0,10===r.charCodeAt(n+2)&&c.lastIndex++):10===e&&(o=!0),r.substring(t+1,n).replace(/""/g,'"')}e=c.exec(r);return e?(o=44!==e[0].charCodeAt(0),r.substring(t,e.index)):(c.lastIndex=r.length,r.substring(t))}var e,o,u={},i={},a=[],c=/\r\n|[,\r\n]/g,l=0;for(c.lastIndex=0;(e=n())!==i;){for(var f=[];e!==u&&e!==i;)f.push(e),e=n();t&&!(f=t(f,l++))||a.push(f)}return a},d3.csv.format=function(t){return t.map(Jn).join("\n")},d3.geo={},Math.PI/180),wr=(d3.geo.azimuthal=function(){function n(t){var n=t[0]*q-i,t=t[1]*q,e=Math.cos(n),n=Math.sin(n),r=Math.cos(t),t=Math.sin(t),o="orthographic"!==l?c*t+a*r*e:null,u="stereographic"===l?1/(1+o):"gnomonic"===l?1/o:"equidistant"===l?(u=Math.acos(o))?u/Math.sin(u):0:"equalarea"===l?Math.sqrt(2/(1+o)):1,o=u*(c*r*e-a*t);return[f*(u*r*n)+s[0],f*o+s[1]]}var e,i,r,a,c,l="orthographic",f=200,s=[480,250];return n.invert=function(t){var n=(t[0]-s[0])/f,t=(t[1]-s[1])/f,e=Math.sqrt(n*n+t*t),r="stereographic"===l?2*Math.atan(e):"gnomonic"===l?Math.atan(e):"equidistant"===l?e:"equalarea"===l?2*Math.asin(.5*e):Math.asin(e),o=Math.sin(r),r=Math.cos(r);return[(i+Math.atan2(n*o,e*a*r+t*c*o))/q,Math.asin(r*c-(e?t*o*a/e:0))/q]},n.mode=function(t){return arguments.length?(l=t+"",n):l},n.origin=function(t){return arguments.length?(i=(e=t)[0]*q,r=e[1]*q,a=Math.cos(r),c=Math.sin(r),n):e},n.scale=function(t){return arguments.length?(f=+t,n):f},n.translate=function(t){return arguments.length?(s=[+t[0],+t[1]],n):s},n.origin([0,0])},d3.geo.albers=function(){function o(t){var n=i*(q*t[0]-u),t=Math.sqrt(a-2*i*Math.sin(q*t[1]))/i;return[r*t*Math.sin(n)+s[0],r*(t*Math.cos(n)-c)+s[1]]}function n(){var t=q*f[0],n=q*f[1],e=q*l[1],r=Math.sin(t),t=Math.cos(t);return u=q*l[0],i=.5*(r+Math.sin(n)),a=t*t+2*i*r,c=Math.sqrt(a-2*i*Math.sin(e))/i,o}var u,i,a,c,l=[-98,38],f=[29.5,45.5],r=1e3,s=[480,250];return o.invert=function(t){var n=(t[0]-s[0])/r,t=(t[1]-s[1])/r,t=c+t,e=Math.atan2(n,t),n=Math.sqrt(n*n+t*t);return[(u+e/i)/q,Math.asin((a-n*n*i*i)/(2*i))/q]},o.origin=function(t){return arguments.length?(l=[+t[0],+t[1]],n()):l},o.parallels=function(t){return arguments.length?(f=[+t[0],+t[1]],n()):f},o.scale=function(t){return arguments.length?(r=+t,o):r},o.translate=function(t){return arguments.length?(s=[+t[0],+t[1]],o):s},n()},d3.geo.albersUsa=function(){function o(t){var n=t[0],e=t[1];return(50<e?i:n<-140?a:e<21?c:u)(t)}var u=d3.geo.albers(),i=d3.geo.albers().origin([-160,60]).parallels([55,65]),a=d3.geo.albers().origin([-160,20]).parallels([8,18]),c=d3.geo.albers().origin([-60,10]).parallels([8,18]);return o.scale=function(t){return arguments.length?(u.scale(t),i.scale(.6*t),a.scale(t),c.scale(1.5*t),o.translate(u.translate())):u.scale()},o.translate=function(t){var n,e,r;return arguments.length?(n=u.scale()/1e3,e=t[0],r=t[1],u.translate(t),i.translate([e-400*n,r+170*n]),a.translate([e-190*n,r+200*n]),c.translate([e+580*n,r+430*n]),o):u.translate()},o.scale(u.scale())},d3.geo.bonne=function(){function n(t){var n,e,r=t[0]*q-o,t=t[1]*q-u;return i?(n=a+i-t,e=r*Math.cos(t)/n,r=n*Math.sin(e),t=n*Math.cos(e)-a):(r*=Math.cos(t),t*=-1),[c*r+l[0],c*t+l[1]]}var o,u,i,a,c=200,l=[480,250];return n.invert=function(t){var n,e,r=(t[0]-l[0])/c,t=(t[1]-l[1])/c;return i?(n=a+t,e=Math.sqrt(r*r+n*n),t=a+i-e,r=o+e*Math.atan2(r,n)/Math.cos(t)):(t*=-1,r/=Math.cos(t)),[r/q,t/q]},n.parallel=function(t){return arguments.length?(a=1/Math.tan(i=t*q),n):i/q},n.origin=function(t){return arguments.length?(o=t[0]*q,u=t[1]*q,n):[o/q,u/q]},n.scale=function(t){return arguments.length?(c=+t,n):c},n.translate=function(t){return arguments.length?(l=[+t[0],+t[1]],n):l},n.origin([0,0]).parallel(45)},d3.geo.equirectangular=function(){function n(t){var n=t[0]/360,t=-t[1]/360;return[e*n+r[0],e*t+r[1]]}var e=500,r=[480,250];return n.invert=function(t){return[360*((t[0]-r[0])/e),-360*((t[1]-r[1])/e)]},n.scale=function(t){return arguments.length?(e=+t,n):e},n.translate=function(t){return arguments.length?(r=[+t[0],+t[1]],n):r},n},d3.geo.mercator=function(){function n(t){var n=t[0]/360,t=-Math.log(Math.tan(Math.PI/4+t[1]*q/2))/q/360;return[e*n+r[0],e*Math.max(-.5,Math.min(.5,t))+r[1]]}var e=500,r=[480,250];return n.invert=function(t){var n=(t[0]-r[0])/e,t=(t[1]-r[1])/e;return[360*n,2*Math.atan(Math.exp(-360*t*q))/q-90]},n.scale=function(t){return arguments.length?(e=+t,n):e},n.translate=function(t){return arguments.length?(r=[+t[0],+t[1]],n):r},n},d3.geo.path=function(){function n(t,n){"function"==typeof r&&(i=Qn(r.apply(this,arguments))),a(t);var e=s.length?s.join(""):null;return s=[],e}function f(t){return l(t).join(",")}function u(t){for(var n=o(t[0]),e=0,r=t.length;++e<r;)n-=o(t[e]);return n}function c(t){for(var n=d3.geom.polygon(t[0].map(l)),e=n.area(),r=n.centroid(e<0?(e*=-1,1):-1),o=r[0],u=r[1],i=e,a=0,c=t.length;++a<c;)e=(n=d3.geom.polygon(t[a].map(l))).area(),o-=(r=n.centroid(e<0?(e*=-1,1):-1))[0],u-=r[1],i-=e;return[o,u,6*i]}function o(t){return Math.abs(d3.geom.polygon(t.map(l)).area())}var r=4.5,i=Qn(r),l=d3.geo.albersUsa(),s=[],a=Wn({FeatureCollection:function(t){for(var n=t.features,e=-1,r=n.length;++e<r;)s.push(a(n[e].geometry))},Feature:function(t){a(t.geometry)},Point:function(t){s.push("M",f(t.coordinates),i)},MultiPoint:function(t){for(var n=t.coordinates,e=-1,r=n.length;++e<r;)s.push("M",f(n[e]),i)},LineString:function(t){var n=t.coordinates,e=-1,r=n.length;for(s.push("M");++e<r;)s.push(f(n[e]),"L");s.pop()},MultiLineString:function(t){for(var n,e,r,o=t.coordinates,u=-1,i=o.length;++u<i;){for(e=-1,r=(n=o[u]).length,s.push("M");++e<r;)s.push(f(n[e]),"L");s.pop()}},Polygon:function(t){for(var n,e,r,o=t.coordinates,u=-1,i=o.length;++u<i;)if(e=-1,0<(r=(n=o[u]).length-1)){for(s.push("M");++e<r;)s.push(f(n[e]),"L");s[s.length-1]="Z"}},MultiPolygon:function(t){for(var n,e,r,o,u,i,a=t.coordinates,c=-1,l=a.length;++c<l;)for(e=-1,r=(n=a[c]).length;++e<r;)if(u=-1,0<(i=(o=n[e]).length-1)){for(s.push("M");++u<i;)s.push(f(o[u]),"L");s[s.length-1]="Z"}},GeometryCollection:function(t){for(var n=t.geometries,e=-1,r=n.length;++e<r;)s.push(a(n[e]))}}),h=n.area=Wn({FeatureCollection:function(t){for(var n=0,e=t.features,r=-1,o=e.length;++r<o;)n+=h(e[r]);return n},Feature:function(t){return h(t.geometry)},Polygon:function(t){return u(t.coordinates)},MultiPolygon:function(t){for(var n=0,e=t.coordinates,r=-1,o=e.length;++r<o;)n+=u(e[r]);return n},GeometryCollection:function(t){for(var n=0,e=t.geometries,r=-1,o=e.length;++r<o;)n+=h(e[r]);return n}},0),e=n.centroid=Wn({Feature:function(t){return e(t.geometry)},Polygon:function(t){t=c(t.coordinates);return[t[0]/t[2],t[1]/t[2]]},MultiPolygon:function(t){for(var n,e=t.coordinates,r=0,o=0,u=0,i=-1,a=e.length;++i<a;)r+=(n=c(e[i]))[0],o+=n[1],u+=n[2];return[r/u,o/u]}});return n.projection=function(t){return l=t,n},n.pointRadius=function(t){return"function"==typeof t?r=t:i=Qn(r=+t),n},n},d3.geo.bounds=function(t){var e=1/0,r=1/0,o=-1/0,u=-1/0;return te(t,function(t,n){t<e&&(e=t),o<t&&(o=t),n<r&&(r=n),u<n&&(u=n)}),[[e,r],[o,u]]},{Feature:function(t,n){te(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=0,o=e.length;r<o;r++)te(e[r].geometry,n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=0,o=e.length;r<o;r++)te(e[r],n)},LineString:ne,MultiLineString:function(t,n){for(var e=t.coordinates,r=0,o=e.length;r<o;r++)for(var u=e[r],i=0,a=u.length;i<a;i++)n.apply(null,u[i])},MultiPoint:ne,MultiPolygon:function(t,n){for(var e=t.coordinates,r=0,o=e.length;r<o;r++)for(var u=e[r][0],i=0,a=u.length;i<a;i++)n.apply(null,u[i])},Point:function(t,n){n.apply(null,t.coordinates)},Polygon:function(t,n){for(var e=t.coordinates[0],r=0,o=e.length;r<o;r++)n.apply(null,e[r])}}),kr=(d3.geo.circle=function(){function n(){}function e(t){return y.distance(t)<v}function r(t){for(var n,e,r,o,u,i=-1,a=t.length,c=[];++i<a;)(u=y.distance(r=t[i]))<v?(e&&c.push(ue(e,r)((o-v)/(o-u))),c.push(r),n=e=null):(e=r,!n&&c.length&&(c.push(ue(c[c.length-1],e)((v-o)/(u-o))),n=e)),o=u;n=t[0],!(e=c[0])||r[0]!==n[0]||r[1]!==n[1]||r[0]===e[0]&&r[1]===e[1]||c.push(e);for(var l,f,s,h=c,d=0,g=h.length,p=g?[h[0]]:h,m=y.source();++d<g;)for(s=y.source(h[d-1])(h[d]).coordinates,l=0,f=s.length;++l<f;)p.push(s[l]);return y.source(m),p}var o=[0,0],u=89.99,v=u*q,y=d3.geo.greatArc().source(o).target(a),i=(n.clip=function(t){return"function"==typeof o&&y.source(o.apply(this,arguments)),i(t)||null},Wn({FeatureCollection:function(t){var n=t.features.map(i).filter(a);return n&&((t=Object.create(t)).features=n,t)},Feature:function(t){var n=i(t.geometry);return n&&((t=Object.create(t)).geometry=n,t)},Point:function(t){return e(t.coordinates)&&t},MultiPoint:function(t){var n=t.coordinates.filter(e);return n.length&&{type:t.type,coordinates:n}},LineString:function(t){var n=r(t.coordinates);return n.length&&((t=Object.create(t)).coordinates=n,t)},MultiLineString:function(t){var n=t.coordinates.map(r).filter(function(t){return t.length});return n.length&&((t=Object.create(t)).coordinates=n,t)},Polygon:function(t){var n=t.coordinates.map(r);return n[0].length&&((t=Object.create(t)).coordinates=n,t)},MultiPolygon:function(t){var n=t.coordinates.map(function(t){return t.map(r)}).filter(function(t){return t[0].length});return n.length&&((t=Object.create(t)).coordinates=n,t)},GeometryCollection:function(t){var n=t.geometries.map(i).filter(a);return n.length&&((t=Object.create(t)).geometries=n,t)}}));return n.origin=function(t){return arguments.length?("function"!=typeof(o=t)&&y.source(o),n):o},n.angle=function(t){return arguments.length?(v=(u=+t)*q,n):u},d3.rebind(n,y,"precision")},d3.geo.greatArc=function(){function o(){for(var t=o.distance.apply(this,arguments),n=0,e=a/t,r=[u];(n+=e)<1;)r.push(c(n));return r.push(i),{type:"LineString",coordinates:r}}var u,i,n=ee,e=re,a=6*q,c=oe();return o.distance=function(){return"function"==typeof n&&c.source(u=n.apply(this,arguments)),"function"==typeof e&&c.target(i=e.apply(this,arguments)),c.distance()},o.source=function(t){return arguments.length?("function"!=typeof(n=t)&&c.source(u=n),o):n},o.target=function(t){return arguments.length?("function"!=typeof(e=t)&&c.target(i=e),o):e},o.precision=function(t){return arguments.length?(a=t*q,o):a/q},o},d3.geo.greatCircle=d3.geo.circle,d3.geom={},d3.geom.contour=function(t,n){for(var e=n||function(t){for(var n=0,e=0;;){if(t(n,e))return[n,e];0===n?(n=e+1,e=0):(--n,e+=1)}}(t),r=[],o=e[0],u=e[1],i=0,a=0,c=NaN,l=NaN,f=0;f=0,t(o-1,u-1)&&(f+=1),t(o,u-1)&&(f+=2),t(o-1,u)&&(f+=4),t(o,u)&&(f+=8),a=6===f?(i=-1===l?-1:1,0):9===f?(i=0,1===c?-1:1):(i=kr[f],Nr[f]),i!=c&&a!=l&&(r.push([o,u]),c=i,l=a),u+=a,e[0]!=(o+=i)||e[1]!=u;);return r},[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN]),Nr=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN],Ar=(d3.geom.hull=function(t){if(t.length<3)return[];for(var n,e,r,o,u,i,a,c,l,f,s,h,d,g,p,m=t.length,v=m-1,y=[],x=[],b=0,M=1;M<m;++M)t[M][1]<t[b][1]?b=M:t[M][1]==t[b][1]&&(b=t[M][0]<t[b][0]?M:b);for(M=0;M<m;++M)M!==b&&(r=t[M][1]-t[b][1],e=t[M][0]-t[b][0],y.push({angle:Math.atan2(r,e),index:M}));for(y.sort(function(t,n){return t.angle-n.angle}),a=y[0].angle,i=y[0].index,u=0,M=1;M<v;++M)n=y[M].index,a==y[M].angle?(e=t[i][0]-t[b][0],r=t[i][1]-t[b][1],(o=t[n][0]-t[b][0])*o+(o=t[n][1]-t[b][1])*o<=e*e+r*r?y[M].index=-1:(y[u].index=-1,a=y[M].angle,u=M,i=n)):(a=y[M].angle,u=M,i=n);for(x.push(b),n=M=0;M<2;++n)-1!==y[n].index&&(x.push(y[n].index),M++);for(c=x.length;n<v;++n)if(-1!==y[n].index){for(;l=x[c-2],f=x[c-1],s=y[n].index,p=g=d=void 0,d=(l=(h=t)[l])[0],g=l[1],f=(l=t[f])[0],p=l[1],h=(l=t[s])[0],!(0<(l[1]-g)*(f-d)-(p-g)*(h-d));)--c;x[c++]=y[n].index}var _=[];for(M=0;M<c;++M)_.push(t[x[M]]);return _},d3.geom.polygon=function(f){return f.area=function(){for(var t=0,n=f.length,e=f[n-1][0]*f[0][1],r=f[n-1][1]*f[0][0];++t<n;)e+=f[t-1][0]*f[t][1],r+=f[t-1][1]*f[t][0];return.5*(r-e)},f.centroid=function(t){var n,e,r=-1,o=f.length,u=0,i=0,a=f[o-1];for(arguments.length||(t=-1/(6*f.area()));++r<o;)n=a,a=f[r],e=n[0]*a[1]-a[0]*n[1],u+=(n[0]+a[0])*e,i+=(n[1]+a[1])*e;return[u*t,i*t]},f.clip=function(t){for(var n,e,r,o,u,i,a=-1,c=f.length,l=f[c-1];++a<c;){for(n=t.slice(),t.length=0,o=f[a],u=n[(r=n.length)-1],e=-1;++e<r;)ie(i=n[e],l,o)?(ie(u,l,o)||t.push(ae(u,i,l,o)),t.push(i)):ie(u,l,o)&&t.push(ae(u,i,l,o)),u=i;l=o}return t},f},d3.geom.voronoi=function(o){var a=o.map(function(){return[]});return ce(o,function(t){var n,e,r,o,u=1===t.a&&0<=t.b?(i=t.ep.r,t.ep.l):(i=t.ep.l,t.ep.r),i=(1===t.a?(r=i?i.y:-1e6,n=t.c-t.b*r,o=u?u.y:1e6,e=t.c-t.b*o):(n=i?i.x:-1e6,r=t.c-t.a*n,e=u?u.x:1e6,o=t.c-t.a*e),[n,r]),u=[e,o];a[t.region.l.index].push(i,u),a[t.region.r.index].push(i,u)}),a.map(function(e,t){var n=o[t][0],r=o[t][1];return e.forEach(function(t){t.angle=Math.atan2(t[0]-n,t[1]-r)}),e.sort(function(t,n){return t.angle-n.angle}).filter(function(t,n){return!n||1e-10<t.angle-e[n-1].angle})})},{l:"r",r:"l"}),D=(d3.geom.delaunay=function(a){var n=a.map(function(){return[]}),c=[];return ce(a,function(t){n[t.region.l.index].push(a[t.region.r.index])}),n.forEach(function(t,n){var e=a[n],r=e[0],o=e[1];t.forEach(function(t){t.angle=Math.atan2(t[0]-r,t[1]-o)}),t.sort(function(t,n){return t.angle-n.angle});for(var u=0,i=t.length-1;u<i;u++)c.push([e,t[u],t[u+1]])}),c},d3.geom.quadtree=function(t,n,e,r,o){function s(t,n,e,r,o,u){var i;isNaN(n.x)||isNaN(n.y)||(t.leaf?(i=t.point)?(Math.abs(i.x-n.x)+Math.abs(i.y-n.y)<.01||(t.point=null,a(t,i,e,r,o,u)),a(t,n,e,r,o,u)):t.point=n:a(t,n,e,r,o,u))}function a(t,n,e,r,o,u){var i=.5*(e+o),a=.5*(r+u),c=n.x>=i,l=n.y>=a,f=(l<<1)+c;t.leaf=!1,c?e=i:o=i,l?r=a:u=a,s(t=t.nodes[f]||(t.nodes[f]=le()),n,e,r,o,u)}var u,i=-1,c=t.length;if(c&&isNaN(t[0].x)&&(t=t.map(fe)),arguments.length<5)if(3===arguments.length)o=r=e,e=n;else{for(n=e=1/0,r=o=-1/0;++i<c;)(u=t[i]).x<n&&(n=u.x),u.y<e&&(e=u.y),u.x>r&&(r=u.x),u.y>o&&(o=u.y);var l=r-n,f=o-e;f<l?o=e+l:r=n+f}var h=le();return h.add=function(t){s(h,t,n,e,r,o)},h.visit=function(t){!function t(n,e,r,o,u,i){var a,c;n(e,r,o,u,i)||(a=.5*(r+u),c=.5*(o+i),(e=e.nodes)[0]&&t(n,e[0],r,o,a,c),e[1]&&t(n,e[1],a,o,u,c),e[2]&&t(n,e[2],r,c,a,i),e[3]&&t(n,e[3],a,c,u,i))}(t,h,n,e,r,o)},t.forEach(h.add),h},d3.time={},Date),E=(d.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){E.setUTCDate.apply(this._,arguments)},setDay:function(){E.setUTCDay.apply(this._,arguments)},setFullYear:function(){E.setUTCFullYear.apply(this._,arguments)},setHours:function(){E.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){E.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){E.setUTCMinutes.apply(this._,arguments)},setMonth:function(){E.setUTCMonth.apply(this._,arguments)},setSeconds:function(){E.setUTCSeconds.apply(this._,arguments)},setTime:function(){E.setTime.apply(this._,arguments)}},Date.prototype),P=(d3.time.format=function(i){function t(t){for(var n,e,r=[],o=-1,u=0;++o<a;)37==i.charCodeAt(o)&&(r.push(i.substring(u,o),(e=zr[n=i.charAt(++o)])?e(t):n),u=o+1);return r.push(i.substring(u,o)),r.join("")}var a=i.length;return t.parse=function(t){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0};if(se(n,i,t,0)!=t.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);t=new D;return t.setFullYear(n.y,n.m,n.d),t.setHours(n.H,n.M,n.S,n.L),t},t.toString=function(){return i},t},d3.format("02d")),Sr=d3.format("03d"),Tr=d3.format("04d"),Cr=d3.format("2d"),zr={a:function(t){return Pr[t.getDay()].substring(0,3)},A:function(t){return Pr[t.getDay()]},b:function(t){return Ir[t.getMonth()].substring(0,3)},B:function(t){return Ir[t.getMonth()]},c:d3.time.format("%a %b %e %H:%M:%S %Y"),d:function(t){return P(t.getDate())},e:function(t){return Cr(t.getDate())},H:function(t){return P(t.getHours())},I:function(t){return P(t.getHours()%12||12)},j:function(t){return Sr(1+d3.time.dayOfYear(t))},L:function(t){return Sr(t.getMilliseconds())},m:function(t){return P(t.getMonth()+1)},M:function(t){return P(t.getMinutes())},p:function(t){return 12<=t.getHours()?"PM":"AM"},S:function(t){return P(t.getSeconds())},U:function(t){return P(d3.time.sundayOfYear(t))},w:function(t){return t.getDay()},W:function(t){return P(d3.time.mondayOfYear(t))},x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(t){return P(t.getFullYear()%100)},Y:function(t){return Tr(t.getFullYear()%1e4)},Z:function(t){var n=0<(t=t.getTimezoneOffset())?"-":"+",e=~~(Math.abs(t)/60),t=Math.abs(t)%60;return n+P(e)+P(t)},"%":function(t){return"%"}},qr={a:function(t,n,e){return Dr.test(n.substring(e,e+=3))?e:-1},A:function(t,n,e){return Er.lastIndex=0,(n=Er.exec(n.substring(e,e+10)))?e+n[0].length:-1},b:function(t,n,e){return null==(n=Fr.get(n.substring(e,e+=3).toLowerCase()))?-1:(t.m=n,e)},B:function(t,n,e){return Lr.lastIndex=0,(n=Lr.exec(n.substring(e,e+12)))?(t.m=Hr.get(n[0].toLowerCase()),e+n[0].length):-1},c:function(t,n,e){return se(t,zr.c.toString(),n,e)},d:he,e:he,H:de,I:de,L:function(t,n,e){return F.lastIndex=0,(n=F.exec(n.substring(e,e+3)))?(t.L=+n[0],e+n[0].length):-1},m:function(t,n,e){return F.lastIndex=0,(n=F.exec(n.substring(e,e+2)))?(t.m=n[0]-1,e+n[0].length):-1},M:function(t,n,e){return F.lastIndex=0,(n=F.exec(n.substring(e,e+2)))?(t.M=+n[0],e+n[0].length):-1},p:function(t,n,e){return null==(n=Or.get(n.substring(e,e+=2).toLowerCase()))?-1:(t.p=n,e)},S:function(t,n,e){return F.lastIndex=0,(n=F.exec(n.substring(e,e+2)))?(t.S=+n[0],e+n[0].length):-1},x:function(t,n,e){return se(t,zr.x.toString(),n,e)},X:function(t,n,e){return se(t,zr.X.toString(),n,e)},y:function(t,n,e){return F.lastIndex=0,(n=F.exec(n.substring(e,e+2)))?(t.y=1e3*~~((new Date).getFullYear()/1e3)+ +n[0],e+n[0].length):-1},Y:function(t,n,e){return F.lastIndex=0,(n=F.exec(n.substring(e,e+4)))?(t.y=+n[0],e+n[0].length):-1}},Dr=/^(?:sun|mon|tue|wed|thu|fri|sat)/i,Er=/^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/i,Pr=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Fr=d3.map({jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11}),Lr=/^(?:January|February|March|April|May|June|July|August|September|October|November|December)/gi,Hr=d3.map({january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11}),Ir=["January","February","March","April","May","June","July","August","September","October","November","December"],F=/\s*\d+/,Or=d3.map({am:0,pm:1}),n=(d3.time.format.utc=function(t){function n(t){try{var n=new(D=d);return n._=t,e(n)}finally{D=Date}}var e=d3.time.format(t);return n.parse=function(t){try{D=d;var n=e.parse(t);return n&&n._}finally{D=Date}},n.toString=e.toString,n},d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ")),jr=(d3.time.format.iso=Date.prototype.toISOString?ge:n,ge.parse=function(t){t=new Date(t);return isNaN(t)?null:t},ge.toString=n.toString,d3.time.second=g(function(t){return new D(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(t.getTime()+1e3*Math.floor(n))},function(t){return t.getSeconds()}),d3.time.seconds=d3.time.second.range,d3.time.seconds.utc=d3.time.second.utc.range,d3.time.minute=g(function(t){return new D(6e4*Math.floor(t/6e4))},function(t,n){t.setTime(t.getTime()+6e4*Math.floor(n))},function(t){return t.getMinutes()}),d3.time.minutes=d3.time.minute.range,d3.time.minutes.utc=d3.time.minute.utc.range,d3.time.hour=g(function(t){var n=t.getTimezoneOffset()/60;return new D(36e5*(Math.floor(t/36e5-n)+n))},function(t,n){t.setTime(t.getTime()+36e5*Math.floor(n))},function(t){return t.getHours()}),d3.time.hours=d3.time.hour.range,d3.time.hours.utc=d3.time.hour.utc.range,d3.time.day=g(function(t){return new D(t.getFullYear(),t.getMonth(),t.getDate())},function(t,n){t.setDate(t.getDate()+n)},function(t){return t.getDate()-1}),d3.time.days=d3.time.day.range,d3.time.days.utc=d3.time.day.utc.range,d3.time.dayOfYear=function(t){var n=d3.time.year(t);return Math.floor((t-n)/864e5-(t.getTimezoneOffset()-n.getTimezoneOffset())/1440)},Pr.forEach(function(t,e){t=t.toLowerCase(),e=7-e;var n=d3.time[t]=g(function(t){return(t=d3.time.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,n){t.setDate(t.getDate()+7*Math.floor(n))},function(t){var n=d3.time.year(t).getDay();return Math.floor((d3.time.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});d3.time[t+"s"]=n.range,d3.time[t+"s"].utc=n.utc.range,d3.time[t+"OfYear"]=function(t){var n=d3.time.year(t).getDay();return Math.floor((d3.time.dayOfYear(t)+(n+e)%7)/7)}}),d3.time.week=d3.time.sunday,d3.time.weeks=d3.time.sunday.range,d3.time.weeks.utc=d3.time.sunday.utc.range,d3.time.weekOfYear=d3.time.sundayOfYear,d3.time.month=g(function(t){return new D(t.getFullYear(),t.getMonth(),1)},function(t,n){t.setMonth(t.getMonth()+n)},function(t){return t.getMonth()}),d3.time.months=d3.time.month.range,d3.time.months.utc=d3.time.month.utc.range,d3.time.year=g(function(t){return new D(t.getFullYear(),0,1)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t){return t.getFullYear()}),d3.time.years=d3.time.year.range,d3.time.years.utc=d3.time.year.utc.range,[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6]),Yr=[[d3.time.second,1],[d3.time.second,5],[d3.time.second,15],[d3.time.second,30],[d3.time.minute,1],[d3.time.minute,5],[d3.time.minute,15],[d3.time.minute,30],[d3.time.hour,1],[d3.time.hour,3],[d3.time.hour,6],[d3.time.hour,12],[d3.time.day,1],[d3.time.day,2],[d3.time.week,1],[d3.time.month,1],[d3.time.month,3],[d3.time.year,1]],n=[[d3.time.format("%Y"),function(t){return!0}],[d3.time.format("%B"),function(t){return t.getMonth()}],[d3.time.format("%b %d"),function(t){return 1!=t.getDate()}],[d3.time.format("%a %d"),function(t){return t.getDay()&&1!=t.getDate()}],[d3.time.format("%I %p"),function(t){return t.getHours()}],[d3.time.format("%I:%M"),function(t){return t.getMinutes()}],[d3.time.format(":%S"),function(t){return t.getSeconds()}],[d3.time.format(".%L"),function(t){return t.getMilliseconds()}]],Rr=d3.scale.linear(),Ur=xe(n),Vr=(Yr.year=function(t,n){return Rr.domain(t.map(Me)).ticks(n).map(be)},d3.time.scale=function(){return me(d3.scale.linear(),Yr,Ur)},Yr.map(function(t){return[t[0].utc,t[1]]})),Zr=xe([[d3.time.format.utc("%Y"),function(t){return!0}],[d3.time.format.utc("%B"),function(t){return t.getUTCMonth()}],[d3.time.format.utc("%b %d"),function(t){return 1!=t.getUTCDate()}],[d3.time.format.utc("%a %d"),function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[d3.time.format.utc("%I %p"),function(t){return t.getUTCHours()}],[d3.time.format.utc("%I:%M"),function(t){return t.getUTCMinutes()}],[d3.time.format.utc(":%S"),function(t){return t.getUTCSeconds()}],[d3.time.format.utc(".%L"),function(t){return t.getUTCMilliseconds()}]]);Vr.year=function(t,n){return Rr.domain(t.map(we)).ticks(n).map(_e)},d3.time.scale.utc=function(){return me(d3.scale.linear(),Vr,Zr)}}();
2
- !function(m,T){function _(e,t,n){if(n===T&&1===e.nodeType){var r="data-"+t.replace(Me,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Fe.test(n)?N.parseJSON(n):n)}catch(e){}N.data(e,t,n)}else n=T}return n}function q(e){for(var t in e)if(("data"!==t||!N.isEmptyObject(e[t]))&&"toJSON"!==t)return;return 1}function s(){return!1}function B(){return!0}function n(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function W(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function P(e,n,r){if(n=n||0,N.isFunction(n))return N.grep(e,function(e,t){return!!n.call(e,t,e)===r});if(n.nodeType)return N.grep(e,function(e,t){return e===n===r});if("string"==typeof n){var t=N.grep(e,function(e){return 1===e.nodeType});if(Xt.test(n))return N.filter(n,t,!r);n=N.filter(n,t)}return N.grep(e,function(e,t){return 0<=N.inArray(e,n)===r})}function R(e){var t=Jt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function $(e,t){if(1===t.nodeType&&N.hasData(e)){var n,r,i,e=N._data(e),o=N._data(t,e),a=e.events;if(a)for(n in delete o.handle,o.events={},a)for(r=0,i=a[n].length;r<i;r++)N.event.add(t,n,a[n][r]);o.data&&(o.data=N.extend({},o.data))}}function I(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),"object"===(n=t.nodeName.toLowerCase())?(t.parentNode&&(t.outerHTML=e.outerHTML),N.support.html5Clone&&e.innerHTML&&!N.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&on.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.selected=e.defaultSelected:"input"===n||"textarea"===n?t.defaultValue=e.defaultValue:"script"===n&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(N.expando))}function z(e){return void 0!==e.getElementsByTagName?e.getElementsByTagName("*"):void 0!==e.querySelectorAll?e.querySelectorAll("*"):[]}function X(e){on.test(e.type)&&(e.defaultChecked=e.checked)}function U(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Nn.length;i--;)if((t=Nn[i]+n)in e)return t;return r}function Y(e,t){return"none"===N.css(e=t||e,"display")||!N.contains(e.ownerDocument,e)}function J(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(n=e[o]).style&&(i[o]=N._data(n,"olddisplay"),t?(i[o]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&Y(n)&&(i[o]=N._data(n,"olddisplay",K(n.nodeName)))):(r=D(n,"display"),i[o]||"none"===r||N._data(n,"olddisplay",r)));for(o=0;o<a;o++)!(n=e[o]).style||t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?i[o]||"":"none");return e}function V(e,t,n){var r=yn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function G(e,t,n,r){for(var i=n===(r?"border":"content")?4:"width"===t?1:0,o=0;i<4;i+=2)"margin"===n&&(o+=N.css(e,n+H[i],!0)),r?("content"===n&&(o-=parseFloat(D(e,"padding"+H[i]))||0),"margin"!==n&&(o-=parseFloat(D(e,"border"+H[i]+"Width"))||0)):(o+=parseFloat(D(e,"padding"+H[i]))||0,"padding"!==n&&(o+=parseFloat(D(e,"border"+H[i]+"Width"))||0));return o}function Q(e,t,n){var r="width"===t?e.offsetWidth:e.offsetHeight,i=!0,o=N.support.boxSizing&&"border-box"===N.css(e,"boxSizing");if(r<=0||null==r){if(((r=D(e,t))<0||null==r)&&(r=e.style[t]),vn.test(r))return r;i=o&&(N.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+G(e,t,n||(o?"border":"content"),i)+"px"}function K(e){var t,n;return xn[e]||(n=(t=N("<"+e+">").appendTo(y.body)).css("display"),t.remove(),"none"!==n&&""!==n||(L=y.body.appendChild(L||N.extend(y.createElement("iframe"),{frameBorder:0,width:0,height:0})),fn&&L.createElement||((fn=(L.contentWindow||L.contentDocument).document).write("<!doctype html><html><body>"),fn.close()),t=fn.body.appendChild(fn.createElement(e)),n=D(t,"display"),y.body.removeChild(L)),xn[e]=n)}function Z(s){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r,i=e.toLowerCase().split(C),o=0,a=i.length;if(N.isFunction(t))for(;o<a;o++)n=i[o],(r=/^\+/.test(n))&&(n=n.substr(1)||"*"),(s[n]=s[n]||[])[r?"unshift":"push"](t)}}function ee(e,t,n,r,i,o){(o=o||{})[i=i||t.dataTypes[0]]=!0;for(var a,s=e[i],l=0,u=s?s.length:0,c=e===Wn;l<u&&(c||!a);l++)"string"==typeof(a=s[l](t,n,r))&&(a=!c||o[a]?T:(t.dataTypes.unshift(a),ee(e,t,n,r,a,o)));return a=!c&&a||o["*"]?a:ee(e,t,n,r,"*",o)}function te(e,t){var n,r,i=N.ajaxSettings.flatOptions||{};for(n in t)t[n]!==T&&((i[n]?e:r=r||{})[n]=t[n]);r&&N.extend(!0,e,r)}function ne(){try{return new m.XMLHttpRequest}catch(e){}}function re(){return setTimeout(function(){Jn=T},0),Jn=N.now()}function ie(i,e,t){var n,r,o,a,s,l,u,c=0,f=Zn.length,p=N.Deferred().always(function(){delete d.elem}),d=function(){for(var e=Jn||re(),e=Math.max(0,h.startTime+h.duration-e),t=1-(e/h.duration||0),n=0,r=h.tweens.length;n<r;n++)h.tweens[n].run(t);return p.notifyWith(i,[h,t,e]),t<1&&r?e:(p.resolveWith(i,[h]),!1)},h=p.promise({elem:i,props:N.extend({},e),opts:N.extend(!0,{specialEasing:{}},t),originalProperties:e,originalOptions:t,startTime:Jn||re(),duration:t.duration,tweens:[],createTween:function(e,t,n){t=N.Tween(i,h.opts,e,t,h.opts.specialEasing[e]||h.opts.easing);return h.tweens.push(t),t},stop:function(e){for(var t=0,n=e?h.tweens.length:0;t<n;t++)h.tweens[t].run(1);return e?p.resolveWith(i,[h,e]):p.rejectWith(i,[h,e]),this}}),g=h.props,m=g,y=h.opts.specialEasing;for(r in m)if(o=N.camelCase(r),a=y[o],s=m[r],N.isArray(s)&&(a=s[1],s=m[r]=s[0]),r!==o&&(m[o]=s,delete m[r]),(l=N.cssHooks[o])&&"expand"in l)for(r in s=l.expand(s),delete m[o],s)r in m||(m[r]=s[r],y[r]=a);else y[o]=a;for(;c<f;c++)if(n=Zn[c].call(h,i,g,h.opts))return n;return u=h,N.each(g,function(e,t){for(var n=(er[e]||[]).concat(er["*"]),r=0,i=n.length;r<i;r++)if(n[r].call(u,e,t))return}),N.isFunction(h.opts.start)&&h.opts.start.call(i,h),N.fx.timer(N.extend(d,{anim:h,queue:h.opts.queue,elem:i})),h.progress(h.opts.progress).done(h.opts.done,h.opts.complete).fail(h.opts.fail).always(h.opts.always)}function o(e,t,n,r,i){return new o.prototype.init(e,t,n,r,i)}function oe(e,t){var n,r={height:e},i=0;for(t=t?1:0;i<4;i+=2-t)r["margin"+(n=H[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function ae(e){return N.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}function se(e,t){return(t+"").toUpperCase()}function le(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",le,!1),N.ready()):"complete"===y.readyState&&(y.detachEvent("onreadystatechange",le),N.ready())}var ue,ce,y=m.document,fe=m.location,pe=m.navigator,de=m.jQuery,he=m.$,ge=Array.prototype.push,v=Array.prototype.slice,me=Array.prototype.indexOf,ye=Object.prototype.toString,ve=Object.prototype.hasOwnProperty,be=String.prototype.trim,N=function(e,t){return new N.fn.init(e,t,ue)},xe=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,we=/\S/,C=/\s+/,Te=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,Ne=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Ce=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Ee=/^[\],:{}\s]*$/,ke=/(?:^|:|,)(?:\s*\[)+/g,Se=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,Ae=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,je=/^-ms-/,De=/-([\da-z])/gi,Le={},He=(N.fn=N.prototype={constructor:N,init:function(e,t,n){var r,i;if(e)if(e.nodeType)this.context=this[0]=e,this.length=1;else{if("string"!=typeof e)return N.isFunction(e)?n.ready(e):(e.selector!==T&&(this.selector=e.selector,this.context=e.context),N.makeArray(e,this));if(!(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Ne.exec(e))||!r[1]&&t)return(!t||t.jquery?t||n:this.constructor(t)).find(e);if(r[1])return i=(t=t instanceof N?t[0]:t)&&t.nodeType?t.ownerDocument||t:y,e=N.parseHTML(r[1],i,!0),Ce.test(r[1])&&N.isPlainObject(t)&&this.attr.call(e,t,!0),N.merge(this,e);if((i=y.getElementById(r[2]))&&i.parentNode){if(i.id!==r[2])return n.find(e);this.length=1,this[0]=i}this.context=y,this.selector=e}return this},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return v.call(this)},get:function(e){return null==e?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){e=N.merge(this.constructor(),e);return e.prevObject=this,e.context=this.context,"find"===t?e.selector=this.selector+(this.selector?" ":"")+n:t&&(e.selector=this.selector+"."+t+"("+n+")"),e},each:function(e,t){return N.each(this,e,t)},ready:function(e){return N.ready.promise().done(e),this},eq:function(e){return-1===(e=+e)?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(v.apply(this,arguments),"slice",v.call(arguments).join(","))},map:function(n){return this.pushStack(N.map(this,function(e,t){return n.call(e,t,e)}))},end:function(){return this.prevObject||this.constructor(null)},push:ge,sort:[].sort,splice:[].splice},N.fn.init.prototype=N.fn,N.extend=N.fn.extend=function(){var e,t,n,r,i,o=arguments[0]||{},a=1,s=arguments.length,l=!1;for("boolean"==typeof o&&(l=o,o=arguments[1]||{},a=2),"object"==typeof o||N.isFunction(o)||(o={}),s===a&&(o=this,--a);a<s;a++)if(null!=(e=arguments[a]))for(t in e)i=o[t],o!==(n=e[t])&&(l&&n&&(N.isPlainObject(n)||(r=N.isArray(n)))?(i=r?(r=!1,i&&N.isArray(i)?i:[]):i&&N.isPlainObject(i)?i:{},o[t]=N.extend(l,i,n)):n!==T&&(o[t]=n));return o},N.extend({noConflict:function(e){return m.$===N&&(m.$=he),e&&m.jQuery===N&&(m.jQuery=de),N},isReady:!1,readyWait:1,holdReady:function(e){e?N.readyWait++:N.ready(!0)},ready:function(e){if(!0===e?!--N.readyWait:!N.isReady){if(!y.body)return setTimeout(N.ready,1);(N.isReady=!0)!==e&&0<--N.readyWait||(ce.resolveWith(y,[N]),N.fn.trigger&&N(y).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===N.type(e)},isArray:Array.isArray||function(e){return"array"===N.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?String(e):Le[ye.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==N.type(e)||e.nodeType||N.isWindow(e))return!1;try{if(e.constructor&&!ve.call(e,"constructor")&&!ve.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}for(var t in e);return t===T||ve.call(e,t)},isEmptyObject:function(e){for(var t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return e&&"string"==typeof e?("boolean"==typeof t&&(n=t,t=0),t=t||y,(r=Ce.exec(e))?[t.createElement(r[1])]:(r=N.buildFragment([e],t,n?null:[]),N.merge([],(r.cacheable?N.clone(r.fragment):r.fragment).childNodes))):null},parseJSON:function(e){return e&&"string"==typeof e?(e=N.trim(e),m.JSON&&m.JSON.parse?m.JSON.parse(e):Ee.test(e.replace(Se,"@").replace(Ae,"]").replace(ke,""))?new Function("return "+e)():void N.error("Invalid JSON: "+e)):null},parseXML:function(e){var t;if(!e||"string"!=typeof e)return null;try{m.DOMParser?t=(new DOMParser).parseFromString(e,"text/xml"):((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e))}catch(e){t=T}return t&&t.documentElement&&!t.getElementsByTagName("parsererror").length||N.error("Invalid XML: "+e),t},noop:function(){},globalEval:function(e){e&&we.test(e)&&(m.execScript||function(e){m.eval.call(m,e)})(e)},camelCase:function(e){return e.replace(je,"ms-").replace(De,se)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=o===T||N.isFunction(e);if(n)if(a){for(r in e)if(!1===t.apply(e[r],n))break}else for(;i<o&&!1!==t.apply(e[i++],n););else if(a){for(r in e)if(!1===t.call(e[r],r,e[r]))break}else for(;i<o&&!1!==t.call(e[i],i,e[i++]););return e},trim:be&&!be.call("\ufeff ")?function(e){return null==e?"":be.call(e)}:function(e){return null==e?"":(e+"").replace(Te,"")},makeArray:function(e,t){var n,t=t||[];return null!=e&&(n=N.type(e),null==e.length||"string"===n||"function"===n||"regexp"===n||N.isWindow(e)?ge.call(t,e):N.merge(t,e)),t},inArray:function(e,t,n){var r;if(t){if(me)return me.call(t,e,n);for(r=t.length,n=n?n<0?Math.max(0,r+n):n:0;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,t){var n=t.length,r=e.length,i=0;if("number"==typeof n)for(;i<n;i++)e[r++]=t[i];else for(;t[i]!==T;)e[r++]=t[i++];return e.length=r,e},grep:function(e,t,n){var r=[],i=0,o=e.length;for(n=!!n;i<o;i++)n!==!!t(e[i],i)&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=[],a=0,s=e.length;if(e instanceof N||s!==T&&"number"==typeof s&&(0<s&&e[0]&&e[s-1]||0===s||N.isArray(e)))for(;a<s;a++)null!=(r=t(e[a],a,n))&&(o[o.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(o[o.length]=r);return o.concat.apply([],o)},guid:1,proxy:function(e,t){var n,r;return"string"==typeof t&&(r=e[t],t=e,e=r),N.isFunction(e)?(n=v.call(arguments,2),(r=function(){return e.apply(t,n.concat(v.call(arguments)))}).guid=e.guid=e.guid||N.guid++,r):T},access:function(e,t,n,r,i,o,a){var s,l=null==n,u=0,c=e.length;if(n&&"object"==typeof n){for(u in n)N.access(e,t,u,n[u],1,o,r);i=1}else if(r!==T){if(s=a===T&&N.isFunction(r),t=l?s?(s=t,function(e,t,n){return s.call(N(e),n)}):(t.call(e,r),null):t)for(;u<c;u++)t(e[u],n,s?r.call(e[u],u,t(e[u],n)):r,a);i=1}return i?e:l?t.call(e):c?t(e[0],n):o},now:function(){return(new Date).getTime()}}),N.ready.promise=function(e){if(!ce)if(ce=N.Deferred(),"complete"===y.readyState)setTimeout(N.ready,1);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",le,!1),m.addEventListener("load",N.ready,!1);else{y.attachEvent("onreadystatechange",le),m.attachEvent("onload",N.ready);var n=!1;try{n=null==m.frameElement&&y.documentElement}catch(e){}n&&n.doScroll&&function t(){if(!N.isReady){try{n.doScroll("left")}catch(e){return setTimeout(t,50)}N.ready()}}()}return ce.promise(e)},N.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){Le["[object "+t+"]"]=t.toLowerCase()}),ue=N(y),{}),Fe=(N.Callbacks=function(i){var e,n;i="string"==typeof i?He[i]||(n=He[e=i]={},N.each(e.split(C),function(e,t){n[t]=!0}),n):N.extend({},i);function r(e){for(t=i.memory&&e,o=!0,u=s||0,s=0,l=c.length,a=!0;c&&u<l;u++)if(!1===c[u].apply(e[0],e[1])&&i.stopOnFalse){t=!1;break}a=!1,c&&(f?f.length&&r(f.shift()):t?c=[]:p.disable())}var t,o,a,s,l,u,c=[],f=!i.once&&[],p={add:function(){var e;return c&&(e=c.length,function r(e){N.each(e,function(e,t){var n=N.type(t);"function"!==n||i.unique&&p.has(t)?t&&t.length&&"string"!==n&&r(t):c.push(t)})}(arguments),a?l=c.length:t&&(s=e,r(t))),this},remove:function(){return c&&N.each(arguments,function(e,t){for(var n;-1<(n=N.inArray(t,c,n));)c.splice(n,1),a&&(n<=l&&l--,n<=u)&&u--}),this},has:function(e){return-1<N.inArray(e,c)},empty:function(){return c=[],this},disable:function(){return c=f=t=T,this},disabled:function(){return!c},lock:function(){return f=T,t||p.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=[e,(t=t||[]).slice?t.slice():t],!c||o&&!f||(a?f.push(t):r(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!o}};return p},N.extend({Deferred:function(e){var a=[["resolve","done",N.Callbacks("once memory"),"resolved"],["reject","fail",N.Callbacks("once memory"),"rejected"],["notify","progress",N.Callbacks("memory")]],i="pending",o={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var o=arguments;return N.Deferred(function(i){N.each(a,function(e,t){var n=t[0],r=o[e];s[t[1]](N.isFunction(r)?function(){var e=r.apply(this,arguments);e&&N.isFunction(e.promise)?e.promise().done(i.resolve).fail(i.reject).progress(i.notify):i[n+"With"](this===s?i:this,[e])}:i[n])}),o=null}).promise()},promise:function(e){return null!=e?N.extend(e,o):o}},s={};return o.pipe=o.then,N.each(a,function(e,t){var n=t[2],r=t[3];o[t[1]]=n.add,r&&n.add(function(){i=r},a[1^e][2].disable,a[2][2].lock),s[t[0]]=n.fire,s[t[0]+"With"]=n.fireWith}),o.promise(s),e&&e.call(s,s),s},when:function(e){function t(t,n,r){return function(e){n[t]=this,r[t]=1<arguments.length?v.call(arguments):e,r===i?u.notifyWith(n,r):--l||u.resolveWith(n,r)}}var i,n,r,o=0,a=v.call(arguments),s=a.length,l=1!==s||e&&N.isFunction(e.promise)?s:0,u=1===l?e:N.Deferred();if(1<s)for(i=new Array(s),n=new Array(s),r=new Array(s);o<s;o++)a[o]&&N.isFunction(a[o].promise)?a[o].promise().done(t(o,r,a)).fail(u.reject).progress(t(o,n,i)):--l;return l||u.resolveWith(r,a),u.promise()}}),N.support=function(){var o,e,t,n,r,i,a,s,l=y.createElement("div");if(l.setAttribute("className","t"),l.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",t=l.getElementsByTagName("*"),(e=l.getElementsByTagName("a")[0]).style.cssText="top:1px;float:left;opacity:.5",!t||!t.length)return{};s=(t=y.createElement("select")).appendChild(y.createElement("option")),n=l.getElementsByTagName("input")[0],o={leadingWhitespace:3===l.firstChild.nodeType,tbody:!l.getElementsByTagName("tbody").length,htmlSerialize:!!l.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:"/a"===e.getAttribute("href"),opacity:/^0.5/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:"on"===n.value,optSelected:s.selected,getSetAttribute:"t"!==l.className,enctype:!!y.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===y.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},n.checked=!0,o.noCloneChecked=n.cloneNode(!0).checked,t.disabled=!0,o.optDisabled=!s.disabled;try{delete l.test}catch(e){o.deleteExpando=!1}if(!l.addEventListener&&l.attachEvent&&l.fireEvent&&(l.attachEvent("onclick",s=function(){o.noCloneEvent=!1}),l.cloneNode(!0).fireEvent("onclick"),l.detachEvent("onclick",s)),(n=y.createElement("input")).value="t",n.setAttribute("type","radio"),o.radioValue="t"===n.value,n.setAttribute("checked","checked"),n.setAttribute("name","t"),l.appendChild(n),(s=y.createDocumentFragment()).appendChild(l.lastChild),o.checkClone=s.cloneNode(!0).cloneNode(!0).lastChild.checked,o.appendChecked=n.checked,s.removeChild(n),s.appendChild(l),l.attachEvent)for(i in{submit:!0,change:!0,focusin:!0})r="on"+i,a=r in l,a||(l.setAttribute(r,"return;"),a="function"==typeof l[r]),o[i+"Bubbles"]=a;return N(function(){var e,t,n,r="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=y.getElementsByTagName("body")[0];i&&((e=y.createElement("div")).style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(e,i.firstChild),t=y.createElement("div"),e.appendChild(t),t.innerHTML="<table><tr><td></td><td>t</td></tr></table>",(n=t.getElementsByTagName("td"))[0].style.cssText="padding:0;margin:0;border:0;display:none",a=0===n[0].offsetHeight,n[0].style.display="",n[1].style.display="none",o.reliableHiddenOffsets=a&&0===n[0].offsetHeight,t.innerHTML="",t.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",o.boxSizing=4===t.offsetWidth,o.doesNotIncludeMarginInBodyOffset=1!==i.offsetTop,m.getComputedStyle&&(o.pixelPosition="1%"!==(m.getComputedStyle(t,null)||{}).top,o.boxSizingReliable="4px"===(m.getComputedStyle(t,null)||{width:"4px"}).width,(n=y.createElement("div")).style.cssText=t.style.cssText=r,n.style.marginRight=n.style.width="0",t.style.width="1px",t.appendChild(n),o.reliableMarginRight=!parseFloat((m.getComputedStyle(n,null)||{}).marginRight)),void 0!==t.style.zoom&&(t.innerHTML="",t.style.cssText=r+"width:1px;padding:1px;display:inline;zoom:1",o.inlineBlockNeedsLayout=3===t.offsetWidth,t.style.display="block",t.style.overflow="visible",t.innerHTML="<div></div>",t.firstChild.style.width="5px",o.shrinkWrapBlocks=3!==t.offsetWidth,e.style.zoom=1),i.removeChild(e))}),s.removeChild(l),e=t=n=s=l=null,o}(),/(?:\{[\s\S]*\}|\[[\s\S]*\])$/),Me=/([A-Z])/g;N.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(N.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return!!(e=e.nodeType?N.cache[e[N.expando]]:e[N.expando])&&!q(e)},data:function(e,t,n,r){if(N.acceptData(e)){var i,o=N.expando,a="string"==typeof t,s=e.nodeType,l=s?N.cache:e,u=s?e[o]:e[o]&&o;if(u&&l[u]&&(r||l[u].data)||!a||n!==T)return u||(s?e[o]=u=N.deletedIds.pop()||N.guid++:u=o),l[u]||(l[u]={},s)||(l[u].toJSON=N.noop),"object"!=typeof t&&"function"!=typeof t||(r?l[u]=N.extend(l[u],t):l[u].data=N.extend(l[u].data,t)),e=l[u],r||(e.data||(e.data={}),e=e.data),n!==T&&(e[N.camelCase(t)]=n),a?null==(i=e[t])&&(i=e[N.camelCase(t)]):i=e,i}},removeData:function(e,t,n){if(N.acceptData(e)){var r,i,o,a=e.nodeType,s=a?N.cache:e,l=a?e[N.expando]:N.expando;if(s[l]){if(t&&(r=n?s[l]:s[l].data)){for((i=0,o=(t=N.isArray(t)?t:t in r||(t=N.camelCase(t))in r?[t]:t.split(" ")).length);i<o;i++)delete r[t[i]];if(!(n?q:N.isEmptyObject)(r))return}(n||(delete s[l].data,q(s[l])))&&(a?N.cleanData([e],!0):N.support.deleteExpando||s!=s.window?delete s[l]:s[l]=null)}}},_data:function(e,t,n){return N.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&N.noData[e.nodeName.toLowerCase()];return!t||!0!==t&&e.getAttribute("classid")===t}}),N.fn.extend({data:function(n,e){var r,i,t,o,a,s=this[0],l=0,u=null;if(n!==T)return"object"==typeof n?this.each(function(){N.data(this,n)}):((r=n.split(".",2))[1]=r[1]?"."+r[1]:"",i=r[1]+"!",N.access(this,function(t){if(t===T)return(u=this.triggerHandler("getData"+i,[r[0]]))===T&&s&&(u=N.data(s,n),u=_(s,n,u)),u===T&&r[1]?this.data(r[0]):u;r[1]=t,this.each(function(){var e=N(this);e.triggerHandler("setData"+i,r),N.data(this,n,t),e.triggerHandler("changeData"+i,r)})},null,e,1<arguments.length,null,!1));if(this.length&&(u=N.data(s),1===s.nodeType)&&!N._data(s,"parsedAttrs")){for(a=(t=s.attributes).length;l<a;l++)(o=t[l].name).indexOf("data-")||(o=N.camelCase(o.substring(5)),_(s,o,u[o]));N._data(s,"parsedAttrs",!0)}return u},removeData:function(e){return this.each(function(){N.removeData(this,e)})}}),N.extend({queue:function(e,t,n){var r;if(e)return r=N._data(e,t=(t||"fx")+"queue"),n&&(!r||N.isArray(n)?r=N._data(e,t,N.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=N.queue(e,t),r=n.length,i=n.shift(),o=N._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){N.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return N._data(e,n)||N._data(e,n,{empty:N.Callbacks("once memory").add(function(){N.removeData(e,t+"queue",!0),N.removeData(e,n,!0)})})}}),N.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?N.queue(this[0],t):n===T?this:this.each(function(){var e=N.queue(this,t,n);N._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&N.dequeue(this,t)})},dequeue:function(e){return this.each(function(){N.dequeue(this,e)})},delay:function(r,e){return r=N.fx&&N.fx.speeds[r]||r,this.queue(e=e||"fx",function(e,t){var n=setTimeout(e,r);t.stop=function(){clearTimeout(n)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){function n(){--i||o.resolveWith(a,[a])}var r,i=1,o=N.Deferred(),a=this,s=this.length;for("string"!=typeof e&&(t=e,e=T),e=e||"fx";s--;)(r=N._data(a[s],e+"queueHooks"))&&r.empty&&(i++,r.empty.add(n));return n(),o.promise(t)}});function Oe(e){return N.event.special.hover?e:e.replace(Ye,"mouseenter$1 mouseleave$1")}var l,_e,qe,Be=/[\t\r\n]/g,We=/\r/g,Pe=/^(?:button|input)$/i,Re=/^(?:button|input|object|select|textarea)$/i,$e=/^a(?:rea|)$/i,Ie=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,ze=N.support.getSetAttribute,Xe=(N.fn.extend({attr:function(e,t){return N.access(this,N.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){N.removeAttr(this,e)})},prop:function(e,t){return N.access(this,N.prop,e,t,1<arguments.length)},removeProp:function(e){return e=N.propFix[e]||e,this.each(function(){try{this[e]=T,delete this[e]}catch(e){}})},addClass:function(t){var e,n,r,i,o,a,s;if(N.isFunction(t))return this.each(function(e){N(this).addClass(t.call(this,e,this.className))});if(t&&"string"==typeof t)for(e=t.split(C),n=0,r=this.length;n<r;n++)if(1===(i=this[n]).nodeType)if(i.className||1!==e.length){for(o=" "+i.className+" ",a=0,s=e.length;a<s;a++)o.indexOf(" "+e[a]+" ")<0&&(o+=e[a]+" ");i.className=N.trim(o)}else i.className=t;return this},removeClass:function(t){var e,n,r,i,o,a,s;if(N.isFunction(t))return this.each(function(e){N(this).removeClass(t.call(this,e,this.className))});if(t&&"string"==typeof t||t===T)for(e=(t||"").split(C),a=0,s=this.length;a<s;a++)if(1===(r=this[a]).nodeType&&r.className){for(n=(" "+r.className+" ").replace(Be," "),i=0,o=e.length;i<o;i++)for(;0<=n.indexOf(" "+e[i]+" ");)n=n.replace(" "+e[i]+" "," ");r.className=t?N.trim(n):""}return this},toggleClass:function(o,a){var s=typeof o,l="boolean"==typeof a;return N.isFunction(o)?this.each(function(e){N(this).toggleClass(o.call(this,e,this.className,a),a)}):this.each(function(){if("string"==s)for(var e,t=0,n=N(this),r=a,i=o.split(C);e=i[t++];)r=l?r:!n.hasClass(e),n[r?"addClass":"removeClass"](e);else"undefined"!=s&&"boolean"!=s||(this.className&&N._data(this,"__className__",this.className),this.className=!this.className&&!1!==o&&N._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;n<r;n++)if(1===this[n].nodeType&&0<=(" "+this[n].className+" ").replace(Be," ").indexOf(t))return!0;return!1},val:function(n){var r,e,i,t=this[0];return arguments.length?(i=N.isFunction(n),this.each(function(e){var t=N(this);1!==this.nodeType||(null==(e=i?n.call(this,e,t.val()):n)?e="":"number"==typeof e?e+="":N.isArray(e)&&(e=N.map(e,function(e){return null==e?"":e+""})),(r=N.valHooks[this.type]||N.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&r.set(this,e,"value")!==T)||(this.value=e)})):t?(r=N.valHooks[t.type]||N.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&(e=r.get(t,"value"))!==T?e:"string"==typeof(e=t.value)?e.replace(We,""):null==e?"":e:void 0}}),N.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r,i=e.selectedIndex,o=[],a=e.options,s="select-one"===e.type;if(i<0)return null;for(t=s?i:0,n=s?i+1:a.length;t<n;t++)if((r=a[t]).selected&&(N.support.optDisabled?!r.disabled:null===r.getAttribute("disabled"))&&(!r.parentNode.disabled||!N.nodeName(r.parentNode,"optgroup"))){if(r=N(r).val(),s)return r;o.push(r)}return s&&!o.length&&a.length?N(a[i]).val():o},set:function(e,t){var n=N.makeArray(t);return N(e).find("option").each(function(){this.selected=0<=N.inArray(N(this).val(),n)}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,t,n,r){var i,o,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return r&&N.isFunction(N.fn[t])?N(e)[t](n):void 0===e.getAttribute?N.prop(e,t,n):((r=1!==a||!N.isXMLDoc(e))&&(t=t.toLowerCase(),o=N.attrHooks[t]||(Ie.test(t)?_e:l)),n!==T?null===n?void N.removeAttr(e,t):o&&"set"in o&&r&&(i=o.set(e,n,t))!==T?i:(e.setAttribute(t,n+""),n):!(o&&"get"in o&&r&&null!==(i=o.get(e,t)))&&null===(i=e.getAttribute(t))?T:i)},removeAttr:function(e,t){var n,r,i,o,a=0;if(t&&1===e.nodeType)for(r=t.split(C);a<r.length;a++)(i=r[a])&&(n=N.propFix[i]||i,(o=Ie.test(i))||N.attr(e,i,""),e.removeAttribute(ze?i:n),o)&&n in e&&(e[n]=!1)},attrHooks:{type:{set:function(e,t){var n;if(Pe.test(e.nodeName)&&e.parentNode)N.error("type property can't be changed");else if(!N.support.radioValue&&"radio"===t&&N.nodeName(e,"input"))return n=e.value,e.setAttribute("type",t),n&&(e.value=n),t}},value:{get:function(e,t){return l&&N.nodeName(e,"button")?l.get(e,t):t in e?e.value:null},set:function(e,t,n){if(l&&N.nodeName(e,"button"))return l.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return(1!==o||!N.isXMLDoc(e))&&(t=N.propFix[t]||t,i=N.propHooks[t]),n!==T?i&&"set"in i&&(r=i.set(e,n,t))!==T?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=e.getAttributeNode("tabindex");return t&&t.specified?parseInt(t.value,10):Re.test(e.nodeName)||$e.test(e.nodeName)&&e.href?0:T}}}}),_e={get:function(e,t){var n=N.prop(e,t);return!0===n||"boolean"!=typeof n&&(n=e.getAttributeNode(t))&&!1!==n.nodeValue?t.toLowerCase():T},set:function(e,t,n){return!1===t?N.removeAttr(e,n):((t=N.propFix[n]||n)in e&&(e[t]=!0),e.setAttribute(n,n.toLowerCase())),n}},ze||(qe={name:!0,id:!0,coords:!0},l=N.valHooks.button={get:function(e,t){e=e.getAttributeNode(t);return e&&(qe[t]?""!==e.value:e.specified)?e.value:T},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=y.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},N.each(["width","height"],function(e,n){N.attrHooks[n]=N.extend(N.attrHooks[n],{set:function(e,t){if(""===t)return e.setAttribute(n,"auto"),t}})}),N.attrHooks.contenteditable={get:l.get,set:function(e,t,n){l.set(e,t=""===t?"false":t,n)}}),N.support.hrefNormalized||N.each(["href","src","width","height"],function(e,t){N.attrHooks[t]=N.extend(N.attrHooks[t],{get:function(e){e=e.getAttribute(t,2);return null===e?T:e}})}),N.support.style||(N.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||T},set:function(e,t){return e.style.cssText=t+""}}),N.support.optSelected||(N.propHooks.selected=N.extend(N.propHooks.selected,{get:function(e){e=e.parentNode;return e&&(e.selectedIndex,e.parentNode)&&e.parentNode.selectedIndex,null}})),N.support.enctype||(N.propFix.enctype="encoding"),N.support.checkOn||N.each(["radio","checkbox"],function(){N.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),N.each(["radio","checkbox"],function(){N.valHooks[this]=N.extend(N.valHooks[this],{set:function(e,t){if(N.isArray(t))return e.checked=0<=N.inArray(N(e).val(),t)}})}),/^(?:textarea|input|select)$/i),Ue=/^([^\.]*|)(?:\.(.+)|)$/,Ye=/(?:^|\s)hover(\.\S+|)\b/,Je=/^key/,Ve=/^(?:mouse|contextmenu)|click/,Ge=/^(?:focusinfocus|focusoutblur)$/,e=(N.event={add:function(e,t,n,r,i){var o,a,s,l,u,c,f,p,d,h;if(3!==e.nodeType&&8!==e.nodeType&&t&&n&&(o=N._data(e)))for(n.handler&&(n=(p=n).handler,i=p.selector),n.guid||(n.guid=N.guid++),(s=o.events)||(o.events=s={}),(a=o.handle)||(o.handle=a=function(e){return void 0===N||e&&N.event.triggered===e.type?T:N.event.dispatch.apply(a.elem,arguments)},a.elem=e),t=N.trim(Oe(t)).split(" "),l=0;l<t.length;l++)u=(f=Ue.exec(t[l])||[])[1],c=(f[2]||"").split(".").sort(),h=N.event.special[u]||{},u=(i?h.delegateType:h.bindType)||u,h=N.event.special[u]||{},f=N.extend({type:u,origType:f[1],data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&N.expr.match.needsContext.test(i),namespace:c.join(".")},p),(d=s[u])||((d=s[u]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,r,c,a))||(e.addEventListener?e.addEventListener(u,a,!1):e.attachEvent&&e.attachEvent("on"+u,a)),h.add&&(h.add.call(e,f),f.handler.guid||(f.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,f):d.push(f),N.event.global[u]=!0},global:{},remove:function(e,t,n,r,i){var o,a,s,l,u,c,f,p,d,h,g=N.hasData(e)&&N._data(e);if(g&&(f=g.events)){for(t=N.trim(Oe(t||"")).split(" "),o=0;o<t.length;o++)if(a=s=(u=Ue.exec(t[o])||[])[1],l=u[2],a){for(p=N.event.special[a]||{},u=(d=f[a=(r?p.delegateType:p.bindType)||a]||[]).length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c=0;c<d.length;c++)h=d[c],!i&&s!==h.origType||n&&n.guid!==h.guid||l&&!l.test(h.namespace)||r&&r!==h.selector&&("**"!==r||!h.selector)||(d.splice(c--,1),h.selector&&d.delegateCount--,!p.remove)||p.remove.call(e,h);0===d.length&&u!==d.length&&(p.teardown&&!1!==p.teardown.call(e,l,g.handle)||N.removeEvent(e,a,g.handle),delete f[a])}else for(a in f)N.event.remove(e,a+t[o],n,r,!0);N.isEmptyObject(f)&&(delete g.handle,N.removeData(e,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(e,t,n,r){if(!n||3!==n.nodeType&&8!==n.nodeType){var i,o,a,s,l,u,c,f,p,d=e.type||e,h=[];if(Ge.test(d+N.event.triggered))return;if(0<=d.indexOf("!")&&(d=d.slice(0,-1),u=!0),0<=d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),(!n||N.event.customEvent[d])&&!N.event.global[d])return;if((e="object"==typeof e?e[N.expando]?e:new N.Event(d,e):new N.Event(d)).type=d,e.isTrigger=!0,e.exclusive=u,e.namespace=h.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,l=d.indexOf(":")<0?"on"+d:"",!n){for(o in i=N.cache)i[o].events&&i[o].events[d]&&N.event.trigger(e,t,i[o].handle.elem,!0);return}if(e.result=T,e.target||(e.target=n),(t=null!=t?N.makeArray(t):[]).unshift(e),(u=N.event.special[d]||{}).trigger&&!1===u.trigger.apply(n,t))return;if(f=[[n,u.bindType||d]],!r&&!u.noBubble&&!N.isWindow(n)){for(p=u.delegateType||d,a=Ge.test(p+d)?n:n.parentNode,s=n;a;a=a.parentNode)f.push([a,p]),s=a;s===(n.ownerDocument||y)&&f.push([s.defaultView||s.parentWindow||m,p])}for(o=0;o<f.length&&!e.isPropagationStopped();o++)a=f[o][0],e.type=f[o][1],(c=(N._data(a,"events")||{})[e.type]&&N._data(a,"handle"))&&c.apply(a,t),(c=l&&a[l])&&N.acceptData(a)&&c.apply&&!1===c.apply(a,t)&&e.preventDefault();return e.type=d,r||e.isDefaultPrevented()||u._default&&!1!==u._default.apply(n.ownerDocument,t)||"click"===d&&N.nodeName(n,"a")||!N.acceptData(n)||!l||!n[d]||("focus"===d||"blur"===d)&&0===e.target.offsetWidth||N.isWindow(n)||((s=n[l])&&(n[l]=null),n[N.event.triggered=d](),N.event.triggered=T,!s)||(n[l]=s),e.result}},dispatch:function(e){e=N.event.fix(e||m.event);var t,n,r,i,o,a,s,l,u,c=(N._data(this,"events")||{})[e.type]||[],f=c.delegateCount,p=v.call(arguments),d=!e.exclusive&&!e.namespace,h=N.event.special[e.type]||{},g=[];if((p[0]=e).delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,e)){if(f&&(!e.button||"click"!==e.type))for(r=e.target;r!=this;r=r.parentNode||this)if(!0!==r.disabled||"click"!==e.type){for(o={},s=[],t=0;t<f;t++)o[u=(l=c[t]).selector]===T&&(o[u]=l.needsContext?0<=N(u,this).index(r):N.find(u,this,null,[r]).length),o[u]&&s.push(l);s.length&&g.push({elem:r,matches:s})}for(c.length>f&&g.push({elem:this,matches:c.slice(f)}),t=0;t<g.length&&!e.isPropagationStopped();t++)for(a=g[t],e.currentTarget=a.elem,n=0;n<a.matches.length&&!e.isImmediatePropagationStopped();n++)l=a.matches[n],(d||!e.namespace&&!l.namespace||e.namespace_re&&e.namespace_re.test(l.namespace))&&(e.data=l.data,e.handleObj=l,(i=((N.event.special[l.origType]||{}).handle||l.handler).apply(a.elem,p))!==T)&&!1===(e.result=i)&&(e.preventDefault(),e.stopPropagation());return h.postDispatch&&h.postDispatch.call(this,e),e.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i=t.button,o=t.fromElement;return null==e.pageX&&null!=t.clientX&&(n=(r=e.target.ownerDocument||y).documentElement,r=r.body,e.pageX=t.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0),e.pageY=t.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&o&&(e.relatedTarget=o===e.target?t.toElement:o),e.which||i===T||(e.which=1&i?1:2&i?3:4&i?2:0),e}},fix:function(e){if(e[N.expando])return e;var t,n,r=e,i=N.event.fixHooks[e.type]||{},o=i.props?this.props.concat(i.props):this.props;for(e=N.Event(r),t=o.length;t;)e[n=o[--t]]=r[n];return e.target||(e.target=r.srcElement||y),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,i.filter?i.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){N.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){e=N.extend(new N.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?N.event.trigger(e,null,t):N.event.dispatch.call(t,e),e.isDefaultPrevented()&&n.preventDefault()}},N.event.handle=N.event.dispatch,N.removeEvent=y.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){t="on"+t;e.detachEvent&&(void 0===e[t]&&(e[t]=null),e.detachEvent(t,n))},N.Event=function(e,t){if(!(this instanceof N.Event))return new N.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||!1===e.returnValue||e.getPreventDefault&&e.getPreventDefault()?B:s):this.type=e,t&&N.extend(this,t),this.timeStamp=e&&e.timeStamp||N.now(),this[N.expando]=!0},N.Event.prototype={preventDefault:function(){this.isDefaultPrevented=B;var e=this.originalEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=B;var e=this.originalEvent;e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=B,this.stopPropagation()},isDefaultPrevented:s,isPropagationStopped:s,isImmediatePropagationStopped:s},N.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,i){N.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;r.selector;return n&&(n===this||N.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),N.support.submitBubbles||(N.event.special.submit={setup:function(){if(N.nodeName(this,"form"))return!1;N.event.add(this,"click._submit keypress._submit",function(e){e=e.target,e=N.nodeName(e,"input")||N.nodeName(e,"button")?e.form:T;e&&!N._data(e,"_submit_attached")&&(N.event.add(e,"submit._submit",function(e){e._submit_bubble=!0}),N._data(e,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode)&&!e.isTrigger&&N.event.simulate("submit",this.parentNode,e,!0)},teardown:function(){if(N.nodeName(this,"form"))return!1;N.event.remove(this,"._submit")}}),N.support.changeBubbles||(N.event.special.change={setup:function(){if(Xe.test(this.nodeName))return"checkbox"!==this.type&&"radio"!==this.type||(N.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),N.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),N.event.simulate("change",this,e,!0)})),!1;N.event.add(this,"beforeactivate._change",function(e){e=e.target;Xe.test(e.nodeName)&&!N._data(e,"_change_attached")&&(N.event.add(e,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||N.event.simulate("change",this.parentNode,e,!0)}),N._data(e,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return e.handleObj.handler.apply(this,arguments)},teardown:function(){return N.event.remove(this,"._change"),!Xe.test(this.nodeName)}}),N.support.focusinBubbles||N.each({focus:"focusin",blur:"focusout"},function(e,t){function n(e){N.event.simulate(t,e.target,N.event.fix(e),!0)}var r=0;N.event.special[t]={setup:function(){0==r++&&y.addEventListener(e,n,!0)},teardown:function(){0==--r&&y.removeEventListener(e,n,!0)}}}),N.fn.extend({on:function(e,t,n,r,i){var o,a;if("object"==typeof e){for(a in"string"!=typeof t&&(n=n||t,t=T),e)this.on(a,t,n,e[a],i);return this}if(null==n&&null==r?(r=t,n=t=T):null==r&&("string"==typeof t?(r=n,n=T):(r=n,n=t,t=T)),!1===r)r=s;else if(!r)return this;return 1===i&&(o=r,(r=function(e){return N().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=N.guid++)),this.each(function(){N.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)r=e.handleObj,N(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler);else{if("object"!=typeof e)return!1!==t&&"function"!=typeof t||(n=t,t=T),!1===n&&(n=s),this.each(function(){N.event.remove(this,e,n,t)});for(i in e)this.off(i,t,e[i])}return this},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return N(this.context).on(e,this.selector,t,n),this},die:function(e,t){return N(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){N.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return N.event.trigger(e,t,this[0],!0)},toggle:function(n){function e(e){var t=(N._data(this,"lastToggle"+n.guid)||0)%i;return N._data(this,"lastToggle"+n.guid,1+t),e.preventDefault(),r[t].apply(this,arguments)||!1}var r=arguments,t=n.guid||N.guid++,i=0;for(e.guid=t;i<r.length;)r[i++].guid=t;return this.click(e)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),N.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,n){N.fn[n]=function(e,t){return null==t&&(t=e,e=null),0<arguments.length?this.on(n,null,e,t):this.trigger(n)},Je.test(n)&&(N.event.fixHooks[n]=N.event.keyHooks),Ve.test(n)&&(N.event.fixHooks[n]=N.event.mouseHooks)}),m);function w(e,t,n,r){n=n||[];var i,o,a,s,l=(t=t||k).nodeType;if(!e||"string"!=typeof e)return n;if(1!==l&&9!==l)return[];if(!(a=ft(t))&&!r&&(i=_t.exec(e)))if(s=i[1]){if(9===l){if(!(o=t.getElementById(s))||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&pt(t,o)&&o.id===s)return n.push(o),n}else{if(i[2])return S.apply(n,d.call(t.getElementsByTagName(e),0)),n;if((s=i[3])&&$t&&t.getElementsByClassName)return S.apply(n,d.call(t.getElementsByClassName(s),0)),n}return ot(e.replace(Ht,"$1"),t,n,r,a)}function t(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Qe(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function r(a){return A(function(o){return o=+o,A(function(e,t){for(var n,r=a([],e.length,o),i=r.length;i--;)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function Ke(e,t,n){if(e===t)return n;for(var r=e.nextSibling;r;){if(r===t)return-1;r=r.nextSibling}return 1}function Ze(e,t){var n,r,i,o,a,s,l,u=jt[p][e];if(u)return t?0:u.slice(0);for(a=e,s=[],l=E.preFilter;a;){for(o in n&&!(r=Ft.exec(a))||(r&&(a=a.slice(r[0].length)),s.push(i=[])),n=!1,(r=Mt.exec(a))&&(i.push(n=new Nt(r.shift())),a=a.slice(n.length),n.type=r[0].replace(Ht," ")),E.filter)!(r=Pt[o].exec(a))||l[o]&&!(r=l[o](r,k,!0))||(i.push(n=new Nt(r.shift())),a=a.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?a.length:a?w.error(e):jt(e,s).slice(0)}function et(a,e,t){var s=e.dir,l=t&&"parentNode"===e.dir,u=Et++;return e.first?function(e,t,n){for(;e=e[s];)if(l||1===e.nodeType)return a(e,t,n)}:function(e,t,n){if(n){for(;e=e[s];)if((l||1===e.nodeType)&&a(e,t,n))return e}else for(var r,i=Ct+" "+u+" ",o=i+lt;e=e[s];)if(l||1===e.nodeType){if((r=e[p])===o)return e.sizset;if("string"==typeof r&&0===r.indexOf(i)){if(e.sizset)return e}else{if(e[p]=o,a(e,t,n))return e.sizset=!0,e;e.sizset=!1}}}}function tt(i){return 1<i.length?function(e,t,n){for(var r=i.length;r--;)if(!i[r](e,t,n))return!1;return!0}:i[0]}function nt(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s<l;s++)!(o=e[s])||n&&!n(o,r,i)||(a.push(o),u&&t.push(s));return a}function rt(d,h,g,m,y,e){return m&&!m[p]&&(m=rt(m)),y&&!y[p]&&(y=rt(y,e)),A(function(e,t,n,r){if(!e||!y){var i,o,a,s=[],l=[],u=t.length,c=e||function(e,t,n,r){for(var i=0,o=t.length;i<o;i++)w(e,t[i],n,r);return n}(h||"*",n.nodeType?[n]:n,[],e),f=!d||!e&&h?c:nt(c,s,d,n,r),p=g?y||(e?d:u||m)?[]:t:f;if(g&&g(f,p,n,r),m)for(a=nt(p,l),m(a,[],n,r),i=a.length;i--;)(o=a[i])&&(p[l[i]]=!(f[l[i]]=o));if(e)for(i=d&&p.length;i--;)(o=p[i])&&(e[s[i]]=!(t[s[i]]=o));else p=nt(p===t?p.splice(u,p.length):p),y?y(null,t,p,r):S.apply(t,p)}})}function it(m,y){function v(e,t,n,r,i){var o,a,s,l=[],u=0,c="0",f=e&&[],p=null!=i,d=gt,h=e||x&&E.find.TAG("*",i&&t.parentNode||t),g=Ct+=null==d?1:Math.E;for(p&&(gt=t!==k&&t,lt=v.el);null!=(o=h[c]);c++){if(x&&o){for(a=0;s=m[a];a++)if(s(o,t,n)){r.push(o);break}p&&(Ct=g,lt=++v.el)}b&&((o=!s&&o)&&u--,e)&&f.push(o)}if(u+=c,b&&c!==u){for(a=0;s=y[a];a++)s(f,l,t,n);if(e){if(0<u)for(;c--;)f[c]||l[c]||(l[c]=kt.call(r));l=nt(l)}S.apply(r,l),p&&!e&&0<l.length&&1<u+y.length&&w.uniqueSort(r)}return p&&(Ct=g,gt=d),f}var b=0<y.length,x=0<m.length;return v.el=0,b?A(v):v}function ot(e,t,n,r,i){var o,a,s,l,u,c=Ze(e);c.length;if(!r&&1===c.length){if(2<(a=c[0]=c[0].slice(0)).length&&"ID"===(s=a[0]).type&&9===t.nodeType&&!i&&E.relative[a[1].type]){if(!(t=E.find.ID(s.matches[0].replace(x,""),t,i)[0]))return n;e=e.slice(a.shift().length)}for(o=Pt.POS.test(e)?-1:a.length-1;0<=o&&(s=a[o],!E.relative[l=s.type]);o--)if((u=E.find[l])&&(r=u(s.matches[0].replace(x,""),qt.test(a[0].type)&&t.parentNode||t,i))){if(a.splice(o,1),e=r.length&&a.join(""))break;return S.apply(n,d.call(r,0)),n}}return dt(e,c)(r,t,i,n,qt.test(e)),n}function at(){}function st(){var n={},r=[];return A(function(e,t){return r.push(e)>E.cacheLength&&delete n[r.shift()],n[e]=t},n)}function i(e){var t=k.createElement("div");try{return e(t)}catch(e){return!1}}var lt,ut,E,ct,ft,pt,dt,ht,c,gt,mt,yt,vt,bt,xt,f,wt,Tt,a="undefined",p=("sizcache"+Math.random()).replace(".",""),Nt=String,k=e.document,u=k.documentElement,Ct=0,Et=0,kt=[].pop,S=[].push,d=[].slice,St=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},A=function(e,t){return e[p]=null==t||t,e},At=st(),jt=st(),Dt=st(),h="[\\x20\\t\\r\\n\\f]",g=(e="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+").replace("w","w#"),Lt=":("+e+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+(g="\\["+h+"*("+e+")"+h+"*(?:([*^$|!~]?=)"+h+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+g+")|)|)"+h+"*\\]")+")|[^:]|\\\\.)*|.*))\\)|)",b=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+h+"*((?:-\\d)?\\d*)"+h+"*\\)|)(?=[^-]|$)",Ht=new RegExp("^"+h+"+|((?:^|[^\\\\])(?:\\\\.)*)"+h+"+$","g"),Ft=new RegExp("^"+h+"*,"+h+"*"),Mt=new RegExp("^"+h+"*([\\x20\\t\\r\\n\\f>+~])"+h+"*"),Ot=new RegExp(Lt),_t=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,qt=/[\x20\t\r\n\f]*[+~]/,Bt=/h\d/i,Wt=/input|select|textarea|button/i,x=/\\(?!\\)/g,Pt={ID:new RegExp("^#("+e+")"),CLASS:new RegExp("^\\.("+e+")"),NAME:new RegExp("^\\[name=['\"]?("+e+")['\"]?\\]"),TAG:new RegExp("^("+e.replace("w","w*")+")"),ATTR:new RegExp("^"+g),PSEUDO:new RegExp("^"+Lt),POS:new RegExp(b,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+h+"*(even|odd|(([+-]|)(\\d*)n|)"+h+"*(?:([+-]|)"+h+"*(\\d+)|))"+h+"*\\)|)","i"),needsContext:new RegExp("^"+h+"*[>+~]|"+b,"i")},e=i(function(e){return e.appendChild(k.createComment("")),!e.getElementsByTagName("*").length}),g=i(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!=a&&"#"===e.firstChild.getAttribute("href")}),Rt=i(function(e){e.innerHTML="<select></select>";e=typeof e.lastChild.getAttribute("multiple");return"boolean"!=e&&"string"!=e}),$t=i(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!(!e.getElementsByClassName||!e.getElementsByClassName("e").length)&&(e.lastChild.className="e",2===e.getElementsByClassName("e").length)}),b=i(function(e){e.id=p+0,e.innerHTML="<a name='"+p+"'></a><div name='"+p+"'></div>",u.insertBefore(e,u.firstChild);var t=k.getElementsByName&&k.getElementsByName(p).length===2+k.getElementsByName(p+0).length;return ut=!k.getElementById(p),u.removeChild(e),t});try{d.call(u.childNodes,0)[0].nodeType}catch(e){d=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}w.matches=function(e,t){return w(e,null,null,t)},w.matchesSelector=function(e,t){return 0<w(t,null,null,[e]).length},ct=w.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=ct(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=ct(t);return n},ft=w.isXML=function(e){e=e&&(e.ownerDocument||e).documentElement;return!!e&&"HTML"!==e.nodeName},pt=w.contains=u.contains?function(e,t){var n=9===e.nodeType?e.documentElement:e,t=t&&t.parentNode;return e===t||!!(t&&1===t.nodeType&&n.contains&&n.contains(t))}:u.compareDocumentPosition?function(e,t){return t&&!!(16&e.compareDocumentPosition(t))}:function(e,t){for(;t=t.parentNode;)if(t===e)return!0;return!1},w.attr=function(e,t){var n,r=ft(e);return r||(t=t.toLowerCase()),(n=E.attrHandle[t])?n(e):r||Rt?e.getAttribute(t):(n=e.getAttributeNode(t))?"boolean"==typeof e[t]?e[t]?t:null:n.specified?n.value:null:null},E=w.selectors={cacheLength:50,createPseudo:A,match:Pt,attrHandle:g?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:ut?function(e,t,n){if(typeof t.getElementById!=a&&!n)return(n=t.getElementById(e))&&n.parentNode?[n]:[]}:function(e,t,n){if(typeof t.getElementById!=a&&!n)return(n=t.getElementById(e))?n.id===e||typeof n.getAttributeNode!=a&&n.getAttributeNode("id").value===e?[n]:void 0:[]},TAG:e?function(e,t){if(typeof t.getElementsByTagName!=a)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if("*"!==e)return n;for(var r,i=[],o=0;r=n[o];o++)1===r.nodeType&&i.push(r);return i},NAME:b&&function(e,t){if(typeof t.getElementsByName!=a)return t.getElementsByName(name)},CLASS:$t&&function(e,t,n){if(typeof t.getElementsByClassName!=a&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(x,""),e[3]=(e[4]||e[5]||"").replace(x,""),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1]?(e[2]||w.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*("even"===e[2]||"odd"===e[2])),e[4]=+(e[6]+e[7]||"odd"===e[2])):e[2]&&w.error(e[0]),e},PSEUDO:function(e){var t,n;return Pt.CHILD.test(e[0])?null:(e[3]?e[2]=e[3]:(t=e[4])&&(Ot.test(t)&&(n=(n=Ze(t,!0))&&t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t),e.slice(0,3))}},filter:{ID:ut?function(t){return t=t.replace(x,""),function(e){return e.getAttribute("id")===t}}:function(t){return t=t.replace(x,""),function(e){e=typeof e.getAttributeNode!=a&&e.getAttributeNode("id");return e&&e.value===t}},TAG:function(t){return"*"===t?function(){return!0}:(t=t.replace(x,"").toLowerCase(),function(e){return e.nodeName&&e.nodeName.toLowerCase()===t})},CLASS:function(e){var t=(t=At[p][e])||At(e,new RegExp("(^|"+h+")"+e+"("+h+"|$)"));return function(e){return t.test(e.className||typeof e.getAttribute!=a&&e.getAttribute("class")||"")}},ATTR:function(n,r,i){return function(e,t){e=w.attr(e,n);return null==e?"!="===r:!r||(e+="","="===r?e===i:"!="===r?e!==i:"^="===r?i&&0===e.indexOf(i):"*="===r?i&&-1<e.indexOf(i):"$="===r?i&&e.substr(e.length-i.length)===i:"~="===r?-1<(" "+e+" ").indexOf(i):"|="===r&&(e===i||e.substr(0,i.length+1)===i+"-"))}},CHILD:function(n,e,i,o){return"nth"===n?function(e){var t,n,r=e.parentNode;if(1===i&&0===o)return!0;if(r)for(n=0,t=r.firstChild;t&&(1!==t.nodeType||(n++,e!==t));t=t.nextSibling);return(n-=o)===i||n%i==0&&0<=n/i}:function(e){var t=e;switch(n){case"only":case"first":for(;t=t.previousSibling;)if(1===t.nodeType)return!1;if("first"===n)return!0;t=e;case"last":for(;t=t.nextSibling;)if(1===t.nodeType)return!1;return!0}}},PSEUDO:function(e,o){var t,a=E.pseudos[e]||E.setFilters[e.toLowerCase()]||w.error("unsupported pseudo: "+e);return a[p]?a(o):1<a.length?(t=[e,e,"",o],E.setFilters.hasOwnProperty(e.toLowerCase())?A(function(e,t){for(var n,r=a(e,o),i=r.length;i--;)e[n=St.call(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:A(function(e){var r=[],i=[],s=dt(e.replace(Ht,"$1"));return s[p]?A(function(e,t,n,r){for(var i,o=s(e,null,r,[]),a=e.length;a--;)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),!i.pop()}}),has:A(function(t){return function(e){return 0<w(t,e).length}}),contains:A(function(t){return function(e){return-1<(e.textContent||e.innerText||ct(e)).indexOf(t)}}),enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},parent:function(e){return!E.pseudos.empty(e)},empty:function(e){var t;for(e=e.firstChild;e;){if("@"<e.nodeName||3===(t=e.nodeType)||4===t)return!1;e=e.nextSibling}return!0},header:function(e){return Bt.test(e.nodeName)},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===(t=e.type)&&(null==(e=e.getAttribute("type"))||e.toLowerCase()===t)},radio:t("radio"),checkbox:t("checkbox"),file:t("file"),password:t("password"),image:t("image"),submit:Qe("submit"),reset:Qe("reset"),button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return Wt.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&(!!e.type||!!e.href)},active:function(e){return e===e.ownerDocument.activeElement},first:r(function(e,t,n){return[0]}),last:r(function(e,t,n){return[t-1]}),eq:r(function(e,t,n){return[n<0?n+t:n]}),even:r(function(e,t,n){for(var r=0;r<t;r+=2)e.push(r);return e}),odd:r(function(e,t,n){for(var r=1;r<t;r+=2)e.push(r);return e}),lt:r(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:r(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},ht=u.compareDocumentPosition?function(e,t){return e===t?(c=!0,0):(e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t):e.compareDocumentPosition)?-1:1}:function(e,t){if(e===t)return c=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n=[],r=[],i=e.parentNode,o=t.parentNode,a=i;if(i===o)return Ke(e,t);if(!i)return-1;if(!o)return 1;for(;a;)n.unshift(a),a=a.parentNode;for(a=o;a;)r.unshift(a),a=a.parentNode;for(var s=n.length,l=r.length,u=0;u<s&&u<l;u++)if(n[u]!==r[u])return Ke(n[u],r[u]);return u===s?Ke(e,r[u],-1):Ke(n[u],t,1)},[0,0].sort(ht),mt=!c,w.uniqueSort=function(e){var t,n=1;if(c=mt,e.sort(ht),c)for(;t=e[n];n++)t===e[n-1]&&e.splice(n--,1);return e},w.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},dt=w.compile=function(e,t){var n,r=[],i=[],o=Dt[p][e];if(!o){for(n=(t=t||Ze(e)).length;n--;)((o=function e(t){for(var r,n,i,o=t.length,a=E.relative[t[0].type],s=a||E.relative[" "],l=a?1:0,u=et(function(e){return e===r},s,!0),c=et(function(e){return-1<St.call(r,e)},s,!0),f=[function(e,t,n){return!a&&(n||t!==gt)||((r=t).nodeType?u:c)(e,t,n)}];l<o;l++)if(n=E.relative[t[l].type])f=[et(tt(f),n)];else{if((n=E.filter[t[l].type].apply(null,t[l].matches))[p]){for(i=++l;i<o&&!E.relative[t[i].type];i++);return rt(1<l&&tt(f),1<l&&t.slice(0,l-1).join("").replace(Ht,"$1"),n,l<i&&e(t.slice(l,i)),i<o&&e(t=t.slice(i)),i<o&&t.join(""))}f.push(n)}return tt(f)}(t[n]))[p]?r:i).push(o);o=Dt(e,it(i,r))}return o},k.querySelectorAll&&(vt=ot,bt=/'|\\/g,xt=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,f=[":focus"],wt=[":active",":focus"],Tt=u.matchesSelector||u.mozMatchesSelector||u.webkitMatchesSelector||u.oMatchesSelector||u.msMatchesSelector,i(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||f.push("\\["+h+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||f.push(":checked")}),i(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&f.push("[*^$]="+h+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||f.push(":enabled",":disabled")}),f=new RegExp(f.join("|")),ot=function(e,t,n,r,i){if(!(r||i||f&&f.test(e))){var o,a,s=!0,l=p,u=t,c=9===t.nodeType&&e;if(1===t.nodeType&&"object"!==t.nodeName.toLowerCase()){for(o=Ze(e),(s=t.getAttribute("id"))?l=s.replace(bt,"\\$&"):t.setAttribute("id",l),l="[id='"+l+"'] ",a=o.length;a--;)o[a]=l+o[a].join("");u=qt.test(e)&&t.parentNode||t,c=o.join(",")}if(c)try{return S.apply(n,d.call(u.querySelectorAll(c),0)),n}catch(e){}finally{s||t.removeAttribute("id")}}return vt(e,t,n,r,i)},Tt)&&(i(function(e){yt=Tt.call(e,"div");try{Tt.call(e,"[test!='']:sizzle"),wt.push("!=",Lt)}catch(e){}}),wt=new RegExp(wt.join("|")),w.matchesSelector=function(e,t){if(t=t.replace(xt,"='$1']"),!(ft(e)||wt.test(t)||f&&f.test(t)))try{var n=Tt.call(e,t);if(n||yt||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0<w(t,null,null,[e]).length}),E.pseudos.nth=E.pseudos.eq,E.filters=at.prototype=E.pseudos,E.setFilters=new at,w.attr=N.attr,N.find=w,N.expr=w.selectors,N.expr[":"]=N.expr.pseudos,N.unique=w.uniqueSort,N.text=w.getText,N.isXMLDoc=w.isXML,N.contains=w.contains;var It=/Until$/,zt=/^(?:parents|prev(?:Until|All))/,Xt=/^.[^:#\[\.,]*$/,Ut=N.expr.match.needsContext,Yt={children:!0,contents:!0,next:!0,prev:!0},Jt=(N.fn.extend({find:function(e){var t,n,r,i,o,a,s=this;if("string"!=typeof e)return N(e).filter(function(){for(t=0,n=s.length;t<n;t++)if(N.contains(s[t],this))return!0});for(a=this.pushStack("","find",e),t=0,n=this.length;t<n;t++)if(r=a.length,N.find(e,this[t],a),0<t)for(i=r;i<a.length;i++)for(o=0;o<r;o++)if(a[o]===a[i]){a.splice(i--,1);break}return a},has:function(e){var t,n=N(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(N.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(P(this,e,!1),"not",e)},filter:function(e){return this.pushStack(P(this,e,!0),"filter",e)},is:function(e){return!!e&&("string"==typeof e?Ut.test(e)?0<=N(e,this.context).index(this[0]):0<N.filter(e,this).length:0<this.filter(e).length)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=Ut.test(e)||"string"!=typeof e?N(e,t||this.context):0;r<i;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?-1<a.index(n):N.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return o=1<o.length?N.unique(o):o,this.pushStack(o,"closest",e)},index:function(e){return e?"string"==typeof e?N.inArray(this[0],N(e)):N.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){t="string"==typeof e?N(e,t):N.makeArray(e&&e.nodeType?[e]:e),e=N.merge(this.get(),t);return this.pushStack(n(t[0])||n(e[0])?e:N.unique(e))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),N.fn.andSelf=N.fn.addBack,N.each({parent:function(e){e=e.parentNode;return e&&11!==e.nodeType?e:null},parents:function(e){return N.dir(e,"parentNode")},parentsUntil:function(e,t,n){return N.dir(e,"parentNode",n)},next:function(e){return W(e,"nextSibling")},prev:function(e){return W(e,"previousSibling")},nextAll:function(e){return N.dir(e,"nextSibling")},prevAll:function(e){return N.dir(e,"previousSibling")},nextUntil:function(e,t,n){return N.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return N.dir(e,"previousSibling",n)},siblings:function(e){return N.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return N.sibling(e.firstChild)},contents:function(e){return N.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:N.merge([],e.childNodes)}},function(r,i){N.fn[r]=function(e,t){var n=N.map(this,i,e);return(t=It.test(r)?t:e)&&"string"==typeof t&&(n=N.filter(t,n)),n=1<this.length&&!Yt[r]?N.unique(n):n,1<this.length&&zt.test(r)&&(n=n.reverse()),this.pushStack(n,r,v.call(arguments).join(","))}}),N.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?N.find.matchesSelector(t[0],e)?[t[0]]:[]:N.find.matches(e,t)},dir:function(e,t,n){for(var r=[],i=e[t];i&&9!==i.nodeType&&(n===T||1!==i.nodeType||!N(i).is(n));)1===i.nodeType&&r.push(i),i=i[t];return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),"abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video"),Vt=/ jQuery\d+="(?:null|\d+)"/g,Gt=/^\s+/,Qt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Kt=/<([\w:]+)/,Zt=/<tbody/i,en=/<|&#?\w+;/,tn=/<(?:script|style|link)/i,nn=/<(?:script|object|embed|option|style)/i,rn=new RegExp("<(?:"+Jt+")[\\s/>]","i"),on=/^(?:checkbox|radio)$/,an=/checked\s*(?:[^=]|=\s*.checked.)/i,sn=/\/(java|ecma)script/i,ln=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,j={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},un=R(y),cn=un.appendChild(y.createElement("div"));j.optgroup=j.option,j.tbody=j.tfoot=j.colgroup=j.caption=j.thead,j.th=j.td,N.support.htmlSerialize||(j._default=[1,"X<div>","</div>"]),N.fn.extend({text:function(e){return N.access(this,function(e){return e===T?N.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(e))},null,e,arguments.length)},wrapAll:function(t){var e;return N.isFunction(t)?this.each(function(e){N(this).wrapAll(t.call(this,e))}):(this[0]&&(e=N(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)),this)},wrapInner:function(n){return N.isFunction(n)?this.each(function(e){N(this).wrapInner(n.call(this,e))}):this.each(function(){var e=N(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=N.isFunction(t);return this.each(function(e){N(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(){return this.parent().each(function(){N.nodeName(this,"body")||N(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){1!==this.nodeType&&11!==this.nodeType||this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){1!==this.nodeType&&11!==this.nodeType||this.insertBefore(e,this.firstChild)})},before:function(){var e;return n(this[0])?arguments.length?(e=N.clean(arguments),this.pushStack(N.merge(e,this),"before",this.selector)):void 0:this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)})},after:function(){var e;return n(this[0])?arguments.length?(e=N.clean(arguments),this.pushStack(N.merge(this,e),"after",this.selector)):void 0:this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)e&&!N.filter(e,[n]).length||(t||1!==n.nodeType||(N.cleanData(n.getElementsByTagName("*")),N.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&N.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return N.clone(this,e,t)})},html:function(e){return N.access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===T)return 1===t.nodeType?t.innerHTML.replace(Vt,""):T;if("string"==typeof e&&!tn.test(e)&&(N.support.htmlSerialize||!rn.test(e))&&(N.support.leadingWhitespace||!Gt.test(e))&&!j[(Kt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Qt,"<$1></$2>");try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(N.cleanData(t.getElementsByTagName("*")),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(r){return n(this[0])?this.length?this.pushStack(N(N.isFunction(r)?r():r),"replaceWith",r):this:N.isFunction(r)?this.each(function(e){var t=N(this),n=t.html();t.replaceWith(r.call(this,e,n))}):("string"!=typeof r&&(r=N(r).detach()),this.each(function(){var e=this.nextSibling,t=this.parentNode;N(this).remove(),e?N(e).before(r):N(t).append(r)}))},detach:function(e){return this.remove(e,!0)},domManip:function(n,r,i){var e,t,o,a,s,l,u=0,c=(n=[].concat.apply([],n))[0],f=[],p=this.length;if(!N.support.checkClone&&1<p&&"string"==typeof c&&an.test(c))return this.each(function(){N(this).domManip(n,r,i)});if(N.isFunction(c))return this.each(function(e){var t=N(this);n[0]=c.call(this,e,r?t.html():T),t.domManip(n,r,i)});if(this[0]){if(t=(o=(e=N.buildFragment(n,this,f)).fragment).firstChild,1===o.childNodes.length&&(o=t),t)for(r=r&&N.nodeName(t,"tr"),a=e.cacheable||p-1;u<p;u++)i.call(r&&N.nodeName(this[u],"table")?(s=this[u],l="tbody",s.getElementsByTagName(l)[0]||s.appendChild(s.ownerDocument.createElement(l))):this[u],u===a?o:N.clone(o,!0,!0));o=null,f.length&&N.each(f,function(e,t){t.src?N.ajax?N.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,throws:!0}):N.error("no ajax"):N.globalEval((t.text||t.textContent||t.innerHTML||"").replace(ln,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),N.buildFragment=function(e,t,n){var r,i,o,a=e[0];return t=(t=!(t=t||y).nodeType&&t[0]||t).ownerDocument||t,!(1===e.length&&"string"==typeof a&&a.length<512&&t===y&&"<"===a.charAt(0))||nn.test(a)||!N.support.checkClone&&an.test(a)||!N.support.html5Clone&&rn.test(a)||(i=!0,o=(r=N.fragments[a])!==T),r||(r=t.createDocumentFragment(),N.clean(e,t,r,n),i&&(N.fragments[a]=o&&r)),{fragment:r,cacheable:i}},N.fragments={},N.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,s){N.fn[a]=function(e){var t,n=0,r=[],i=N(e),o=i.length,e=1===this.length&&this[0].parentNode;if((null==e||e&&11===e.nodeType&&1===e.childNodes.length)&&1===o)return i[s](this[0]),this;for(;n<o;n++)t=(0<n?this.clone(!0):this).get(),N(i[n])[s](t),r=r.concat(t);return this.pushStack(r,a,i.selector)}}),N.extend({clone:function(e,t,n){var r,i,o,a;if(N.support.html5Clone||N.isXMLDoc(e)||!rn.test("<"+e.nodeName+">")?a=e.cloneNode(!0):(cn.innerHTML=e.outerHTML,cn.removeChild(a=cn.firstChild)),!(N.support.noCloneEvent&&N.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||N.isXMLDoc(e)))for(I(e,a),r=z(e),i=z(a),o=0;r[o];++o)i[o]&&I(r[o],i[o]);if(t&&($(e,a),n))for(r=z(e),i=z(a),o=0;r[o];++o)$(r[o],i[o]);return r=i=null,a},clean:function(e,t,n,r){var i,o,a,s,l,u,c,f,p,d,h,g=t===y&&un,m=[];for(t&&void 0!==t.createDocumentFragment||(t=y),i=0;null!=(a=e[i]);i++)if("number"==typeof a&&(a+=""),a){if("string"==typeof a)if(en.test(a)){for(g=g||R(t),c=t.createElement("div"),g.appendChild(c),a=a.replace(Qt,"<$1></$2>"),s=(Kt.exec(a)||["",""])[1].toLowerCase(),u=(l=j[s]||j._default)[0],c.innerHTML=l[1]+a+l[2];u--;)c=c.lastChild;if(!N.support.tbody)for(f=Zt.test(a),o=(p="table"!==s||f?"<table>"!==l[1]||f?[]:c.childNodes:c.firstChild&&c.firstChild.childNodes).length-1;0<=o;--o)N.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o]);!N.support.leadingWhitespace&&Gt.test(a)&&c.insertBefore(t.createTextNode(Gt.exec(a)[0]),c.firstChild),a=c.childNodes,c.parentNode.removeChild(c)}else a=t.createTextNode(a);a.nodeType?m.push(a):N.merge(m,a)}if(c&&(a=c=g=null),!N.support.appendChecked)for(i=0;null!=(a=m[i]);i++)N.nodeName(a,"input")?X(a):void 0!==a.getElementsByTagName&&N.grep(a.getElementsByTagName("input"),X);if(n)for(d=function(e){if(!e.type||sn.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)},i=0;null!=(a=m[i]);i++)N.nodeName(a,"script")&&d(a)||(n.appendChild(a),void 0!==a.getElementsByTagName&&(h=N.grep(N.merge([],a.getElementsByTagName("script")),d),m.splice.apply(m,[i+1,0].concat(h)),i+=h.length));return m},cleanData:function(e,t){for(var n,r,i,o,a=0,s=N.expando,l=N.cache,u=N.support.deleteExpando,c=N.event.special;null!=(i=e[a]);a++)if((t||N.acceptData(i))&&(n=(r=i[s])&&l[r])){if(n.events)for(o in n.events)c[o]?N.event.remove(i,o):N.removeEvent(i,o,n.handle);l[r]&&(delete l[r],u?delete i[s]:i.removeAttribute?i.removeAttribute(s):i[s]=null,N.deletedIds.push(r))}}}),N.uaMatch=function(e){e=e.toLowerCase();e=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:e[1]||"",version:e[2]||"0"}},g={},(e=N.uaMatch(pe.userAgent)).browser&&(g[e.browser]=!0,g.version=e.version),g.chrome?g.webkit=!0:g.webkit&&(g.safari=!0),N.browser=g,N.sub=function(){function n(e,t){return new n.fn.init(e,t)}N.extend(!0,n,this),n.superclass=this,((n.fn=n.prototype=this()).constructor=n).sub=this.sub,n.fn.init=function(e,t){return t&&t instanceof N&&!(t instanceof n)&&(t=n(t)),N.fn.init.call(this,e,t,r)},n.fn.init.prototype=n.fn;var r=n(y);return n};var D,L,fn,pn=/alpha\([^)]*\)/i,dn=/opacity=([^)]*)/,hn=/^(top|right|bottom|left)$/,gn=/^(none|table(?!-c[ea]).+)/,mn=/^margin/,yn=new RegExp("^("+xe+")(.*)$","i"),vn=new RegExp("^("+xe+")(?!px)[a-z%]+$","i"),bn=new RegExp("^([-+])=("+xe+")","i"),xn={},wn={position:"absolute",visibility:"hidden",display:"block"},Tn={letterSpacing:0,fontWeight:400},H=["Top","Right","Bottom","Left"],Nn=["Webkit","O","Moz","ms"],Cn=N.fn.toggle,En=(N.fn.extend({css:function(e,t){return N.access(this,function(e,t,n){return n!==T?N.style(e,t,n):N.css(e,t)},e,t,1<arguments.length)},show:function(){return J(this,!0)},hide:function(){return J(this)},toggle:function(e,t){var n="boolean"==typeof e;return N.isFunction(e)&&N.isFunction(t)?Cn.apply(this,arguments):this.each(function(){(n?e:Y(this))?N(this).show():N(this).hide()})}}),N.extend({cssHooks:{opacity:{get:function(e,t){if(t)return""===(t=D(e,"opacity"))?"1":t}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:N.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=N.camelCase(t),l=e.style;if(t=N.cssProps[s]||(N.cssProps[s]=U(l,s)),a=N.cssHooks[t]||N.cssHooks[s],n===T)return a&&"get"in a&&(i=a.get(e,!1,r))!==T?i:l[t];if("string"===(o=typeof n)&&(i=bn.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(N.css(e,t)),o="number"),!(null==n||"number"===o&&isNaN(n)||("number"!==o||N.cssNumber[s]||(n+="px"),a&&"set"in a&&(n=a.set(e,n,r))===T)))try{l[t]=n}catch(e){}}},css:function(e,t,n,r){var i,o=N.camelCase(t);return t=N.cssProps[o]||(N.cssProps[o]=U(e.style,o)),"normal"===(i=(i=(o=N.cssHooks[t]||N.cssHooks[o])&&"get"in o?o.get(e,!0,r):i)===T?D(e,t):i)&&t in Tn&&(i=Tn[t]),(n||r!==T)&&(o=parseFloat(i),n||N.isNumeric(o))?o||0:i},swap:function(e,t,n){var r,i={};for(r in t)i[r]=e.style[r],e.style[r]=t[r];for(r in n=n.call(e),t)e.style[r]=i[r];return n}}),m.getComputedStyle?D=function(e,t){var n,r,i=m.getComputedStyle(e,null),o=e.style;return i&&(""!==(n=i[t])||N.contains(e.ownerDocument,e)||(n=N.style(e,t)),vn.test(n))&&mn.test(t)&&(e=o.width,t=o.minWidth,r=o.maxWidth,o.minWidth=o.maxWidth=o.width=n,n=i.width,o.width=e,o.minWidth=t,o.maxWidth=r),n}:y.documentElement.currentStyle&&(D=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],o=e.style;return null==i&&o&&o[t]&&(i=o[t]),vn.test(i)&&!hn.test(t)&&(n=o.left,(r=e.runtimeStyle&&e.runtimeStyle.left)&&(e.runtimeStyle.left=e.currentStyle.left),o.left="fontSize"===t?"1em":i,i=o.pixelLeft+"px",o.left=n,r)&&(e.runtimeStyle.left=r),""===i?"auto":i}),N.each(["height","width"],function(e,r){N.cssHooks[r]={get:function(e,t,n){if(t)return 0===e.offsetWidth&&gn.test(D(e,"display"))?N.swap(e,wn,function(){return Q(e,r,n)}):Q(e,r,n)},set:function(e,t,n){return V(0,t,n?G(e,r,n,N.support.boxSizing&&"border-box"===N.css(e,"boxSizing")):0)}}}),N.support.opacity||(N.cssHooks.opacity={get:function(e,t){return dn.test((t&&e.currentStyle?e.currentStyle:e.style).filter||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,e=e.currentStyle,r=N.isNumeric(t)?"alpha(opacity="+100*t+")":"",i=e&&e.filter||n.filter||"";(n.zoom=1)<=t&&""===N.trim(i.replace(pn,""))&&n.removeAttribute&&(n.removeAttribute("filter"),e)&&!e.filter||(n.filter=pn.test(i)?i.replace(pn,r):i+" "+r)}}),N(function(){N.support.reliableMarginRight||(N.cssHooks.marginRight={get:function(e,t){return N.swap(e,{display:"inline-block"},function(){if(t)return D(e,"marginRight")})}}),!N.support.pixelPosition&&N.fn.position&&N.each(["top","left"],function(e,n){N.cssHooks[n]={get:function(e,t){if(t)return t=D(e,n),vn.test(t)?N(e).position()[n]+"px":t}}})}),N.expr&&N.expr.filters&&(N.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!N.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||D(e,"display"))},N.expr.filters.visible=function(e){return!N.expr.filters.hidden(e)}),N.each({margin:"",padding:"",border:"Width"},function(i,o){N.cssHooks[i+o]={expand:function(e){for(var t="string"==typeof e?e.split(" "):[e],n={},r=0;r<4;r++)n[i+H[r]+o]=t[r]||t[r-2]||t[0];return n}},mn.test(i)||(N.cssHooks[i+o].set=V)}),/%20/g),kn=/\[\]$/,Sn=/\r?\n/g,An=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,jn=/^(?:select|textarea)/i;N.fn.extend({serialize:function(){return N.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?N.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||jn.test(this.nodeName)||An.test(this.type))}).map(function(e,n){var t=N(this).val();return null==t?null:N.isArray(t)?N.map(t,function(e,t){return{name:n.name,value:e.replace(Sn,"\r\n")}}):{name:n.name,value:t.replace(Sn,"\r\n")}}).get()}}),N.param=function(e,t){function n(e,t){t=N.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)}var r,i=[];if(t===T&&(t=N.ajaxSettings&&N.ajaxSettings.traditional),N.isArray(e)||e.jquery&&!N.isPlainObject(e))N.each(e,function(){n(this.name,this.value)});else for(r in e)!function n(r,e,i,o){if(N.isArray(e))N.each(e,function(e,t){i||kn.test(r)?o(r,t):n(r+"["+("object"==typeof t?e:"")+"]",t,i,o)});else if(i||"object"!==N.type(e))o(r,e);else for(var t in e)n(r+"["+t+"]",e[t],i,o)}(r,e[r],t,n);return i.join("&").replace(En,"+")};var F,M,Dn=/#.*$/,Ln=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Hn=/^(?:GET|HEAD)$/,Fn=/^\/\//,Mn=/\?/,On=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,_n=/([?&])_=[^&]*/,qn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Bn=N.fn.load,Wn={},Pn={},Rn=["*/"]+["*"];try{M=fe.href}catch(e){(M=y.createElement("a")).href="",M=M.href}F=qn.exec(M.toLowerCase())||[],N.fn.load=function(e,t,n){var r,i,o,a,s;return"string"!=typeof e&&Bn?Bn.apply(this,arguments):(this.length&&(a=this,0<=(s=e.indexOf(" "))&&(r=e.slice(s,e.length),e=e.slice(0,s)),N.isFunction(t)?(n=t,t=T):t&&"object"==typeof t&&(i="POST"),N.ajax({url:e,type:i,dataType:"html",data:t,complete:function(e,t){n&&a.each(n,o||[e.responseText,t,e])}}).done(function(e){o=arguments,a.html(r?N("<div>").append(e.replace(On,"")).find(r):e)})),this)},N.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){N.fn[t]=function(e){return this.on(t,e)}}),N.each(["get","post"],function(e,i){N[i]=function(e,t,n,r){return N.isFunction(t)&&(r=r||n,n=t,t=T),N.ajax({type:i,url:e,data:t,success:n,dataType:r})}}),N.extend({getScript:function(e,t){return N.get(e,T,t,"script")},getJSON:function(e,t,n){return N.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?te(e,N.ajaxSettings):(t=e,e=N.ajaxSettings),te(e,t),e},ajaxSettings:{url:M,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(F[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Rn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":m.String,"text html":!0,"text json":N.parseJSON,"text xml":N.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Z(Wn),ajaxTransport:Z(Pn),ajax:function(e,t){function n(e,t,n,r){var i,o,a,s,l=t;2!==x&&(x=2,p&&clearTimeout(p),f=T,c=r||"",w.readyState=0<e?4:0,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,l=e.dataTypes,u=e.responseFields;for(i in u)i in n&&(t[u[i]]=n[i]);for(;"*"===l[0];)l.shift(),r===T&&(r=e.mimeType||t.getResponseHeader("content-type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a=a||i}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(h,w,n)),200<=e&&e<300||304===e?(h.ifModified&&((r=w.getResponseHeader("Last-Modified"))&&(N.lastModified[u]=r),r=w.getResponseHeader("Etag"))&&(N.etag[u]=r),i=304===e?(l="notmodified",!0):(l=(i=function(e,t){var n,r,i,o,a=e.dataTypes.slice(),s=a[0],l={},u=0;if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a[1])for(n in e.converters)l[n.toLowerCase()]=e.converters[n];for(;i=a[++u];)if("*"!==i){if("*"!==s&&s!==i){if(!(n=l[s+" "+i]||l["* "+i]))for(r in l)if((o=r.split(" "))[1]===i&&(n=l[s+" "+o[0]]||l["* "+o[0]])){!0===n?n=l[r]:!0!==l[r]&&(i=o[0],a.splice(u--,0,i));break}if(!0!==n)if(n&&e.throws)t=n(t);else try{t=n(t)}catch(e){return{state:"parsererror",error:n?e:"No conversion from "+s+" to "+i}}}s=i}return{state:"success",data:t}}(h,s)).state,o=i.data,!(a=i.error))):(a=l)&&!e||(l="error",e<0&&(e=0)),w.status=e,w.statusText=(t||l)+"",i?y.resolveWith(g,[o,l,w]):y.rejectWith(g,[w,l,a]),w.statusCode(b),b=T,d&&m.trigger("ajax"+(i?"Success":"Error"),[w,h,i?o:a]),v.fireWith(g,[w,l]),d)&&(m.trigger("ajaxComplete",[w,h]),--N.active||N.event.trigger("ajaxStop"))}"object"==typeof e&&(t=e,e=T);var u,c,r,f,p,d,i,o,h=N.ajaxSetup({},t=t||{}),g=h.context||h,m=g!==h&&(g.nodeType||g instanceof N)?N(g):N.event,y=N.Deferred(),v=N.Callbacks("once memory"),b=h.statusCode||{},a={},s={},x=0,l="canceled",w={readyState:0,setRequestHeader:function(e,t){var n;return x||(n=e.toLowerCase(),e=s[n]=s[n]||e,a[e]=t),this},getAllResponseHeaders:function(){return 2===x?c:null},getResponseHeader:function(e){var t;if(2===x){if(!r)for(r={};t=Ln.exec(c);)r[t[1].toLowerCase()]=t[2];t=r[e.toLowerCase()]}return t===T?null:t},overrideMimeType:function(e){return x||(h.mimeType=e),this},abort:function(e){return e=e||l,f&&f.abort(e),n(0,e),this}};if(y.promise(w),w.success=w.done,w.error=w.fail,w.complete=v.add,w.statusCode=function(e){if(e)if(x<2)for(var t in e)b[t]=[b[t],e[t]];else t=e[w.status],w.always(t);return this},h.url=((e||h.url)+"").replace(Dn,"").replace(Fn,F[1]+"//"),h.dataTypes=N.trim(h.dataType||"*").toLowerCase().split(C),null==h.crossDomain&&(e=qn.exec(h.url.toLowerCase())||!1,h.crossDomain=e&&e.join(":")+(e[3]?"":"http:"===e[1]?80:443)!==F.join(":")+(F[3]?"":"http:"===F[1]?80:443)),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=N.param(h.data,h.traditional)),ee(Wn,h,t,w),2===x)return w;for(i in d=h.global,h.type=h.type.toUpperCase(),h.hasContent=!Hn.test(h.type),d&&0==N.active++&&N.event.trigger("ajaxStart"),h.hasContent||(h.data&&(h.url+=(Mn.test(h.url)?"&":"?")+h.data,delete h.data),u=h.url,!1===h.cache&&(e=N.now(),o=h.url.replace(_n,"$1_="+e),h.url=o+(o===h.url?(Mn.test(h.url)?"&":"?")+"_="+e:""))),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&w.setRequestHeader("Content-Type",h.contentType),h.ifModified&&(u=u||h.url,N.lastModified[u]&&w.setRequestHeader("If-Modified-Since",N.lastModified[u]),N.etag[u])&&w.setRequestHeader("If-None-Match",N.etag[u]),w.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Rn+"; q=0.01":""):h.accepts["*"]),h.headers)w.setRequestHeader(i,h.headers[i]);if(!h.beforeSend||!1!==h.beforeSend.call(g,w,h)&&2!==x){for(i in l="abort",{success:1,error:1,complete:1})w[i](h[i]);if(f=ee(Pn,h,t,w)){w.readyState=1,d&&m.trigger("ajaxSend",[w,h]),h.async&&0<h.timeout&&(p=setTimeout(function(){w.abort("timeout")},h.timeout));try{x=1,f.send(a,n)}catch(e){if(!(x<2))throw e;n(-1,e)}}else n(-1,"No Transport");return w}return w.abort()},active:0,lastModified:{},etag:{}});var $n=[],In=/\?/,zn=/(=)\?(?=&|$)|\?\?/,Xn=N.now();N.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=$n.pop()||N.expando+"_"+Xn++;return this[e]=!0,e}}),N.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=e.data,s=e.url,l=!1!==e.jsonp,u=l&&zn.test(s),c=l&&!u&&"string"==typeof a&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&zn.test(a);if("jsonp"===e.dataTypes[0]||u||c)return r=e.jsonpCallback=N.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,i=m[r],u?e.url=s.replace(zn,"$1"+r):c?e.data=a.replace(zn,"$1"+r):l&&(e.url+=(In.test(s)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||N.error(r+" was not called"),o[0]},e.dataTypes[0]="json",m[r]=function(){o=arguments},n.always(function(){m[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,$n.push(r)),o&&N.isFunction(i)&&i(o[0]),o=i=T}),"script"}),N.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return N.globalEval(e),e}}}),N.ajaxPrefilter("script",function(e){e.cache===T&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),N.ajaxTransport("script",function(t){var r,i;if(t.crossDomain)return i=y.head||y.getElementsByTagName("head")[0]||y.documentElement,{send:function(e,n){(r=y.createElement("script")).async="async",t.scriptCharset&&(r.charset=t.scriptCharset),r.src=t.url,r.onload=r.onreadystatechange=function(e,t){!t&&r.readyState&&!/loaded|complete/.test(r.readyState)||(r.onload=r.onreadystatechange=null,i&&r.parentNode&&i.removeChild(r),r=T,t)||n(200,"success")},i.insertBefore(r,i.firstChild)},abort:function(){r&&r.onload(0,1)}}});var O,Un=!!m.ActiveXObject&&function(){for(var e in O)O[e](0,1)},Yn=0;N.ajaxSettings.xhr=m.ActiveXObject?function(){return!this.isLocal&&ne()||function(){try{return new m.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}()}:ne,b=N.ajaxSettings.xhr(),N.extend(N.support,{ajax:!!b,cors:!!b&&"withCredentials"in b}),N.support.ajax&&N.ajaxTransport(function(c){var f;if(!c.crossDomain||N.support.cors)return{send:function(e,s){var l,t,u=c.xhr();if(c.username?u.open(c.type,c.url,c.async,c.username,c.password):u.open(c.type,c.url,c.async),c.xhrFields)for(t in c.xhrFields)u[t]=c.xhrFields[t];c.mimeType&&u.overrideMimeType&&u.overrideMimeType(c.mimeType),c.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");try{for(t in e)u.setRequestHeader(t,e[t])}catch(e){}u.send(c.hasContent&&c.data||null),f=function(e,t){var n,r,i,o,a;try{if(f&&(t||4===u.readyState))if(f=T,l&&(u.onreadystatechange=N.noop,Un)&&delete O[l],t)4!==u.readyState&&u.abort();else{n=u.status,i=u.getAllResponseHeaders(),o={},(a=u.responseXML)&&a.documentElement&&(o.xml=a);try{o.text=u.responseText}catch(e){}try{r=u.statusText}catch(e){r=""}n||!c.isLocal||c.crossDomain?1223===n&&(n=204):n=o.text?200:404}}catch(e){t||s(-1,e)}o&&s(n,r,o,i)},c.async?4===u.readyState?setTimeout(f,0):(l=++Yn,Un&&(O||(O={},N(m).unload(Un)),O[l]=f),u.onreadystatechange=f):f()},abort:function(){f&&f(0,1)}}});var Jn,Vn,Gn=/^(?:toggle|show|hide)$/,Qn=new RegExp("^(?:([-+])=|)("+xe+")([a-z%]*)$","i"),Kn=/queueHooks$/,Zn=[function(t,e,n){var r,i,o,a,s,l,u,c,f=this,p=t.style,d={},h=[],g=t.nodeType&&Y(t);for(r in n.queue||(null==(u=N._queueHooks(t,"fx")).unqueued&&(u.unqueued=0,c=u.empty.fire,u.empty.fire=function(){u.unqueued||c()}),u.unqueued++,f.always(function(){f.always(function(){u.unqueued--,N.queue(t,"fx").length||u.empty.fire()})})),1===t.nodeType&&("height"in e||"width"in e)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===N.css(t,"display"))&&"none"===N.css(t,"float")&&(N.support.inlineBlockNeedsLayout&&"inline"!==K(t.nodeName)?p.zoom=1:p.display="inline-block"),n.overflow&&(p.overflow="hidden",N.support.shrinkWrapBlocks||f.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})),e)o=e[r],Gn.exec(o)&&(delete e[r],o!==(g?"hide":"show"))&&h.push(r);if(a=h.length)for(s=N._data(t,"fxshow")||N._data(t,"fxshow",{}),g?N(t).show():f.done(function(){N(t).hide()}),f.done(function(){for(var e in N.removeData(t,"fxshow",!0),d)N.style(t,e,d[e])}),r=0;r<a;r++)l=f.createTween(i=h[r],g?s[i]:0),d[i]=s[i]||N.style(t,i),i in s||(s[i]=l.start,g&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}],er={"*":[function(e,t){var n,r,i=this.createTween(e,t),t=Qn.exec(t),o=i.cur(),a=+o||0,s=1,l=20;if(t){if(n=+t[2],"px"!==(r=t[3]||(N.cssNumber[e]?"":"px"))&&a)for(a=N.css(i.elem,e,!0)||n||1;N.style(i.elem,e,(a/=s=s||".5")+r),s!==(s=i.cur()/o)&&1!==s&&--l;);i.unit=r,i.start=a,i.end=t[1]?a+(t[1]+1)*n:n}return i}]},tr=(N.Animation=N.extend(ie,{tweener:function(e,t){for(var n,r=0,i=(e=N.isFunction(e)?(t=e,["*"]):e.split(" ")).length;r<i;r++)n=e[r],er[n]=er[n]||[],er[n].unshift(t)},prefilter:function(e,t){t?Zn.unshift(e):Zn.push(e)}}),((N.Tween=o).prototype={constructor:o,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(N.cssNumber[n]?"":"px")},cur:function(){var e=o.propHooks[this.prop];return(e&&e.get?e:o.propHooks._default).get(this)},run:function(e){var t,n=o.propHooks[this.prop];return this.options.duration?this.pos=t=N.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),(n&&n.set?n:o.propHooks._default).set(this),this}}).init.prototype=o.prototype,(o.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=N.css(e.elem,e.prop,!1,""))&&"auto"!==t?t:0:e.elem[e.prop]},set:function(e){N.fx.step[e.prop]?N.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[N.cssProps[e.prop]]||N.cssHooks[e.prop])?N.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}}).scrollTop=o.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},N.each(["toggle","show","hide"],function(r,i){var o=N.fn[i];N.fn[i]=function(e,t,n){return null==e||"boolean"==typeof e||!r&&N.isFunction(e)&&N.isFunction(t)?o.apply(this,arguments):this.animate(oe(i,!0),e,t,n)}}),N.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Y).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){function i(){var e=ie(this,N.extend({},t),a);o&&e.stop(!0)}var o=N.isEmptyObject(t),a=N.speed(e,n,r);return o||!1===a.queue?this.each(i):this.queue(a.queue,i)},stop:function(i,e,o){function a(e){var t=e.stop;delete e.stop,t(o)}return"string"!=typeof i&&(o=e,e=i,i=T),e&&!1!==i&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=N.timers,r=N._data(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&Kn.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||N.dequeue(this,i)})}}),N.each({slideDown:oe("show"),slideUp:oe("hide"),slideToggle:oe("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){N.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),N.speed=function(e,t,n){var r=e&&"object"==typeof e?N.extend({},e):{complete:n||!n&&t||N.isFunction(e)&&e,duration:e,easing:n&&t||t&&!N.isFunction(t)&&t};return r.duration=N.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in N.fx.speeds?N.fx.speeds[r.duration]:N.fx.speeds._default,null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){N.isFunction(r.old)&&r.old.call(this),r.queue&&N.dequeue(this,r.queue)},r},N.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},N.timers=[],N.fx=o.prototype.init,N.fx.tick=function(){for(var e,t=N.timers,n=0;n<t.length;n++)(e=t[n])()||t[n]!==e||t.splice(n--,1);t.length||N.fx.stop()},N.fx.timer=function(e){e()&&N.timers.push(e)&&!Vn&&(Vn=setInterval(N.fx.tick,N.fx.interval))},N.fx.interval=13,N.fx.stop=function(){clearInterval(Vn),Vn=null},N.fx.speeds={slow:600,fast:200,_default:400},N.fx.step={},N.expr&&N.expr.filters&&(N.expr.filters.animated=function(t){return N.grep(N.timers,function(e){return t===e.elem}).length}),/^(?:body|html)$/i);N.fn.offset=function(t){var e,n,r,i,o,a;return arguments.length?t===T?this:this.each(function(e){N.offset.setOffset(this,t,e)}):(i={top:0,left:0},(a=(o=this[0])&&o.ownerDocument)?(n=a.body)===o?N.offset.bodyOffset(o):(e=a.documentElement,N.contains(e,o)?(void 0!==o.getBoundingClientRect&&(i=o.getBoundingClientRect()),o=ae(a),a=e.clientTop||n.clientTop||0,n=e.clientLeft||n.clientLeft||0,r=o.pageYOffset||e.scrollTop,o=o.pageXOffset||e.scrollLeft,{top:i.top+r-a,left:i.left+o-n}):i):void 0)},N.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return N.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(N.css(e,"marginTop"))||0,n+=parseFloat(N.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r,i=N.css(e,"position"),o=("static"===i&&(e.style.position="relative"),N(e)),a=o.offset(),s=N.css(e,"top"),l=N.css(e,"left"),u={},i=("absolute"===i||"fixed"===i)&&-1<N.inArray("auto",[s,l])?(r=(i=o.position()).top,i.left):(r=parseFloat(s)||0,parseFloat(l)||0);null!=(t=N.isFunction(t)?t.call(e,n,a):t).top&&(u.top=t.top-a.top+r),null!=t.left&&(u.left=t.left-a.left+i),"using"in t?t.using.call(e,u):o.css(u)}},N.fn.extend({position:function(){var e,t,n,r;if(this[0])return e=this[0],t=this.offsetParent(),n=this.offset(),r=tr.test(t[0].nodeName)?{top:0,left:0}:t.offset(),n.top-=parseFloat(N.css(e,"marginTop"))||0,n.left-=parseFloat(N.css(e,"marginLeft"))||0,r.top+=parseFloat(N.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(N.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||y.body;e&&!tr.test(e.nodeName)&&"static"===N.css(e,"position");)e=e.offsetParent;return e||y.body})}}),N.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o=/Y/.test(i);N.fn[t]=function(e){return N.access(this,function(e,t,n){var r=ae(e);if(n===T)return r?i in r?r[i]:r.document.documentElement[t]:e[t];r?r.scrollTo(o?N(r).scrollLeft():n,o?n:N(r).scrollTop()):e[t]=n},t,e,arguments.length,null)}}),N.each({Height:"height",Width:"width"},function(o,a){N.each({padding:"inner"+o,content:a,"":"outer"+o},function(r,e){N.fn[e]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return N.access(this,function(e,t,n){var r;return N.isWindow(e)?e.document.documentElement["client"+o]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+o],r["scroll"+o],e.body["offset"+o],r["offset"+o],r["client"+o])):n===T?N.css(e,t,n,i):N.style(e,t,n,i)},a,n?e:T,n,null)}})}),m.jQuery=m.$=N,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return N})}(window);
3
- !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(l){var e=[],o=l(document),a=l.browser.msie&&6===parseInt(l.browser.version)&&"object"!=typeof window.XMLHttpRequest,h=l.browser.msie&&7===parseInt(l.browser.version),s=null,n=l(window),c=[];l.modal=function(t,i){return l.modal.impl.init(t,i)},l.modal.close=function(){l.modal.impl.close()},l.modal.focus=function(t){l.modal.impl.focus(t)},l.modal.setContainerDimensions=function(){l.modal.impl.setContainerDimensions()},l.modal.setPosition=function(){l.modal.impl.setPosition()},l.modal.update=function(t,i){l.modal.impl.update(t,i)},l.fn.modal=function(t){return l.modal.impl.init(this,t)},l.modal.defaults={appendTo:"body",focus:!0,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:!1,autoPosition:!0,zIndex:1e3,close:!0,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:!0,overlayClose:!1,fixed:!0,position:null,persist:!1,modal:!0,onOpen:null,onShow:null,onClose:null},l.modal.impl={d:{},init:function(t,i){if(this.d.data)return!1;if(s=l.browser.msie&&!l.support.boxModel,this.o=l.extend({},l.modal.defaults,i),this.zIndex=this.o.zIndex,this.occb=!1,"object"==typeof t)t=t instanceof l?t:l(t),this.d.placeholder=!1,0<t.parent().parent().size()&&(t.before(l("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"})),this.d.placeholder=!0,this.display=t.css("display"),!this.o.persist)&&(this.d.orig=t.clone(!0));else{if("string"!=typeof t&&"number"!=typeof t)return alert("SimpleModal Error: Unsupported data type: "+typeof t),this;t=l("<div></div>").html(t)}return this.create(t),this.open(),l.isFunction(this.o.onShow)&&this.o.onShow.apply(this,[this.d]),this},create:function(t){this.getDimensions(),this.o.modal&&a&&(this.d.iframe=l('<iframe src="javascript:false;"></iframe>').css(l.extend(this.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:c[0],width:c[1],zIndex:this.o.zIndex,top:0,left:0})).appendTo(this.o.appendTo)),this.d.overlay=l("<div></div>").attr("id",this.o.overlayId).addClass("simplemodal-overlay").css(l.extend(this.o.overlayCss,{display:"none",opacity:this.o.opacity/100,height:this.o.modal?e[0]:0,width:this.o.modal?e[1]:0,position:"fixed",left:0,top:0,zIndex:this.o.zIndex+1})).appendTo(this.o.appendTo),this.d.container=l("<div></div>").attr("id",this.o.containerId).addClass("simplemodal-container").css(l.extend({position:this.o.fixed?"fixed":"absolute"},this.o.containerCss,{display:"none",zIndex:this.o.zIndex+2})).append(this.o.close&&this.o.closeHTML?l(this.o.closeHTML).addClass(this.o.closeClass):"").appendTo(this.o.appendTo),this.d.wrap=l("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(this.d.container),this.d.data=t.attr("id",t.attr("id")||this.o.dataId).addClass("simplemodal-data").css(l.extend(this.o.dataCss,{display:"none"})).appendTo("body"),this.setContainerDimensions(),this.d.data.appendTo(this.d.wrap),(a||s)&&this.fixIE()},bindEvents:function(){var i=this;l("."+i.o.closeClass).bind("click.simplemodal",function(t){t.preventDefault(),i.close()}),i.o.modal&&i.o.close&&i.o.overlayClose&&i.d.overlay.bind("click.simplemodal",function(t){t.preventDefault(),i.close()}),o.bind("keydown.simplemodal",function(t){i.o.modal&&9===t.keyCode?i.watchTab(t):i.o.close&&i.o.escClose&&27===t.keyCode&&(t.preventDefault(),i.close())}),n.bind("resize.simplemodal orientationchange.simplemodal",function(){i.getDimensions(),i.o.autoResize?i.setContainerDimensions():i.o.autoPosition&&i.setPosition(),a||s?i.fixIE():i.o.modal&&(i.d.iframe&&i.d.iframe.css({height:c[0],width:c[1]}),i.d.overlay.css({height:e[0],width:e[1]}))})},unbindEvents:function(){l("."+this.o.closeClass).unbind("click.simplemodal"),o.unbind("keydown.simplemodal"),n.unbind(".simplemodal"),this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var n=this.o.position;l.each([this.d.iframe||null,this.o.modal?this.d.overlay:null,"fixed"===this.d.container.css("position")?this.d.container:null],function(t,i){var e,o,s;i&&((e=i[0].style).position="absolute",t<2?(e.removeExpression("height"),e.removeExpression("width"),e.setExpression("height",'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'),e.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"')):(n&&n.constructor===Array?(o=-1===(o=n[0]?"number"==typeof n[0]?n[0].toString():n[0].replace(/px/,""):i.css("top").replace(/px/,"")).indexOf("%")?o+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':parseInt(o.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',n[1]&&(s=-1===(s="number"==typeof n[1]?n[1].toString():n[1].replace(/px/,"")).indexOf("%")?s+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(s.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')):(o='(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',s='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'),e.removeExpression("top"),e.removeExpression("left"),e.setExpression("top",o),e.setExpression("left",s)))})},focus:function(t){var i=this,t=t&&-1!==l.inArray(t,["first","last"])?t:"first",e=l(":input:enabled:visible:"+t,i.d.wrap);setTimeout(function(){(0<e.length?e:i.d.wrap).focus()},10)},getDimensions:function(){var t=void 0===window.innerHeight?n.height():window.innerHeight;e=[o.height(),o.width()],c=[t,n.width()]},getVal:function(t,i){return t?"number"==typeof t?t:"auto"===t?0:0<t.indexOf("%")?parseInt(t.replace(/%/,""))/100*("h"===i?c[0]:c[1]):parseInt(t.replace(/px/,"")):null},update:function(t,i){if(!this.d.data)return!1;this.d.origHeight=this.getVal(t,"h"),this.d.origWidth=this.getVal(i,"w"),this.d.data.hide(),t&&this.d.container.css("height",t),i&&this.d.container.css("width",i),this.setContainerDimensions(),this.d.data.show(),this.o.focus&&this.focus(),this.unbindEvents(),this.bindEvents()},setContainerDimensions:function(){var t=a||h,i=this.d.origHeight||(l.browser.opera?this.d.container.height():this.getVal(t?this.d.container[0].currentStyle.height:this.d.container.css("height"),"h")),t=this.d.origWidth||(l.browser.opera?this.d.container.width():this.getVal(t?this.d.container[0].currentStyle.width:this.d.container.css("width"),"w")),e=this.d.data.outerHeight(!0),o=this.d.data.outerWidth(!0),s=(this.d.origHeight=this.d.origHeight||i,this.d.origWidth=this.d.origWidth||t,this.o.maxHeight?this.getVal(this.o.maxHeight,"h"):null),n=this.o.maxWidth?this.getVal(this.o.maxWidth,"w"):null,s=s&&s<c[0]?s:c[0],n=n&&n<c[1]?n:c[1],d=this.o.minHeight?this.getVal(this.o.minHeight,"h"):"auto",i=i?this.o.autoResize&&s<i?s:i<d?d:i:e?s<e?s:this.o.minHeight&&"auto"!==d&&e<d?d:e:d,s=this.o.minWidth?this.getVal(this.o.minWidth,"w"):"auto",t=t?this.o.autoResize&&n<t?n:t<s?s:t:o?n<o?n:this.o.minWidth&&"auto"!==s&&o<s?s:o:s;this.d.container.css({height:i,width:t}),this.d.wrap.css({overflow:i<e||t<o?"auto":"visible"}),this.o.autoPosition&&this.setPosition()},setPosition:function(){var t=c[0]/2-this.d.container.outerHeight(!0)/2,i=c[1]/2-this.d.container.outerWidth(!0)/2,e="fixed"!==this.d.container.css("position")?n.scrollTop():0;this.o.position&&"[object Array]"===Object.prototype.toString.call(this.o.position)?(t=e+(this.o.position[0]||t),i=this.o.position[1]||i):t=e+t,this.d.container.css({left:i,top:t})},watchTab:function(t){0<l(t.target).parents(".simplemodal-container").length?(this.inputs=l(":input:enabled:visible:first, :input:enabled:visible:last",this.d.data[0]),(!t.shiftKey&&t.target===this.inputs[this.inputs.length-1]||t.shiftKey&&t.target===this.inputs[0]||0===this.inputs.length)&&(t.preventDefault(),this.focus(t.shiftKey?"last":"first"))):(t.preventDefault(),this.focus())},open:function(){this.d.iframe&&this.d.iframe.show(),l.isFunction(this.o.onOpen)?this.o.onOpen.apply(this,[this.d]):(this.d.overlay.show(),this.d.container.show(),this.d.data.show()),this.o.focus&&this.focus(),this.bindEvents()},close:function(){if(!this.d.data)return!1;var t;this.unbindEvents(),l.isFunction(this.o.onClose)&&!this.occb?(this.occb=!0,this.o.onClose.apply(this,[this.d])):(this.d.placeholder?(t=l("#simplemodal-placeholder"),this.o.persist?t.replaceWith(this.d.data.removeClass("simplemodal-data").css("display",this.display)):(this.d.data.hide().remove(),t.replaceWith(this.d.orig))):this.d.data.hide().remove(),this.d.container.hide().remove(),this.d.overlay.hide(),this.d.iframe&&this.d.iframe.hide().remove(),this.d.overlay.remove(),this.d={})}}});
4
- !function(l,f){var p,r,s,n,t,o,c,h,a=Array.prototype.slice,d=decodeURIComponent,m=l.param,e=l.bbq=l.bbq||{},i=l.event.special,u="hashchange",g="querystring",v="fragment",y="elemUrlAttr",b="location",$="href",x="src",j=/^.*\?|#.*$/g,w=/^.*\#/,A={};function N(e){return"string"==typeof e}function S(e){var t=a.call(arguments,1);return function(){return e.apply(this,t.concat(a.call(arguments)))}}function q(e,t,n,r,o){var a,i,c,u,o=r!==p?(u=(i=n.match(e?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/))[3]||"",2===o&&N(r)?a=r.replace(e?w:j,""):(c=s(i[2]),r=N(r)?s[e?v:g](r):r,a=2===o?r:1===o?l.extend({},r,c):l.extend({},c,r),a=m(a),e&&(a=a.replace(h,d))),i[1]+(e?"#":a||!i[1]?"?":"")+a+u):t(n!==p?n:f[b][$]);return o}function C(e,t,n){return t=t===p||"boolean"==typeof t?(n=t,m[e?v:g]()):N(t)?t.replace(e?w:j,""):t,s(t,n)}function E(r,o,a,i){return N(a)||"object"==typeof a||(i=a,a=o,o=p),this.each(function(){var e=l(this),t=o||c()[(this.nodeName||"").toLowerCase()]||"",n=t&&e.attr(t)||"";e.attr(t,m[r](n,a,i))})}m[g]=S(q,0,function(e){return e.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}),m[v]=r=S(q,1,function(e){return e.replace(/^[^#]*#?(.*)$/,"$1")}),r.noEscape=function(e){e=l.map((e=e||"").split(""),encodeURIComponent);h=new RegExp(e.join("|"),"g")},r.noEscape(",/"),l.deparam=s=function(e,u){var f={},s={true:!0,false:!1,null:null};return l.each(e.replace(/\+/g," ").split("&"),function(e,t){var n,t=t.split("="),r=d(t[0]),o=f,a=0,i=r.split("]["),c=i.length-1,c=/\[/.test(i[0])&&/\]$/.test(i[c])?(i[c]=i[c].replace(/\]$/,""),(i=i.shift().split("[").concat(i)).length-1):0;if(2===t.length)if(n=d(t[1]),u&&(n=n&&!isNaN(n)?+n:"undefined"===n?p:s[n]!==p?s[n]:n),c)for(;a<=c;a++)o=o[r=""===i[a]?o.length:i[a]]=a<c?o[r]||(i[a+1]&&isNaN(i[a+1])?{}:[]):n;else l.isArray(f[r])?f[r].push(n):f[r]!==p?f[r]=[f[r],n]:f[r]=n;else r&&(f[r]=u?p:"")}),f},s[g]=S(C,0),s[v]=n=S(C,1),l[y]||(l[y]=function(e){return l.extend(A,e)})({a:$,base:$,iframe:x,img:x,input:x,form:"action",link:$,script:x}),c=l[y],l.fn[g]=S(E,g),l.fn[v]=S(E,v),e.pushState=t=function(e,t){N(e)&&/^#/.test(e)&&t===p&&(t=2);var n=e!==p,e=r(f[b][$],n?e:{},n?t:2);f[b][$]=e+(/#/.test(e)?"":"#")},e.getState=o=function(e,t){return e===p||"boolean"==typeof e?n(e):n(t)[e]},e.removeState=function(e){var n={};e!==p&&(n=o(),l.each(l.isArray(e)?e:arguments,function(e,t){delete n[t]})),t(n,2)},i[u]=l.extend(i[u],{add:function(e){var t;function n(e){var n=e[v]=r();e.getState=function(e,t){return e===p||"boolean"==typeof e?s(n,e):s(n,t)[e]},t.apply(this,arguments)}if(l.isFunction(e))return t=e,n;t=e.handler,e.handler=n}})}(jQuery,this),function(o,a){var e,i,n,c,u,t=o.event.special,f="location",s="hashchange",l="href",r=o.browser,p=document.documentMode,h=r.msie&&(void 0===p||p<8),d="on"+s in a&&!h;function m(e){return(e=e||a[f][l]).replace(/^[^#]*#?(.*)$/,"$1")}o[s+"Delay"]=100,t[s]=o.extend(t[s],{setup:function(){if(d)return!1;o(e.start)},teardown:function(){if(d)return!1;o(e.stop)}}),(r={}).start=function(){var r;i||(r=m(),c||(c=u=function(e){return e},h&&(n=o('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow,u=function(){return m(n.document[f][l])},(c=function(e,t){e!==t&&((t=n.document).open().close(),t[f].hash="#"+e)})(m()))),function e(){var t=m(),n=u(r);t!==r?(c(r=t,n),o(a).trigger(s)):n!==r&&(a[f][l]=a[f][l].replace(/#.*/,"")+"#"+n),i=setTimeout(e,o[s+"Delay"])}())},r.stop=function(){n||(i&&clearTimeout(i),i=0)},e=r}(jQuery,this);
5
- jsPlumbUtil={isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isString:function(t){return"string"==typeof t},isObject:function(t){return"[object Object]"===Object.prototype.toString.call(t)},convertStyle:function(t,n){var e,i,o;return"transparent"===t?t:(e=function(t){return 1==(t=Number(t).toString(16)).length?"0"+t:t},(o=t).match(i=/(rgb[a]?\()(.*)(\))/)&&(o="#"+e((t=t.match(i)[2].split(","))[0])+e(t[1])+e(t[2]),n||4!=t.length||(o+=e(t[3]))),o)},gradient:function(t,n){return t=jsPlumbUtil.isArray(t)?t:[t.x,t.y],((n=jsPlumbUtil.isArray(n)?n:[n.x,n.y])[1]-t[1])/(n[0]-t[0])},normal:function(t,n){return-1/jsPlumbUtil.gradient(t,n)},lineLength:function(t,n){return t=jsPlumbUtil.isArray(t)?t:[t.x,t.y],n=jsPlumbUtil.isArray(n)?n:[n.x,n.y],Math.sqrt(Math.pow(n[1]-t[1],2)+Math.pow(n[0]-t[0],2))},segment:function(t,n){return t=jsPlumbUtil.isArray(t)?t:[t.x,t.y],(n=jsPlumbUtil.isArray(n)?n:[n.x,n.y])[0]>t[0]?n[1]>t[1]?2:1:n[1]>t[1]?3:4},intersects:function(t,n){var e=t.x,i=t.x+t.w,o=t.y,t=t.y+t.h,r=n.x,s=n.x+n.w,a=n.y,n=n.y+n.h;return e<=r&&r<=i&&o<=a&&a<=t||e<=s&&s<=i&&o<=a&&a<=t||e<=r&&r<=i&&o<=n&&n<=t||e<=s&&r<=i&&o<=n&&n<=t||r<=e&&e<=s&&a<=o&&o<=n||r<=i&&i<=s&&a<=o&&o<=n||r<=e&&e<=s&&a<=t&&t<=n||r<=i&&e<=s&&a<=t&&t<=n},segmentMultipliers:[null,[1,-1],[1,1],[-1,1],[-1,-1]],inverseSegmentMultipliers:[null,[-1,-1],[-1,1],[1,1],[1,-1]],pointOnLine:function(t,n,e){var i=jsPlumbUtil.gradient(t,n),n=jsPlumbUtil.segment(t,n),n=(0<e?jsPlumbUtil.segmentMultipliers:jsPlumbUtil.inverseSegmentMultipliers)[n],i=Math.atan(i),o=Math.abs(e*Math.sin(i))*n[1],e=Math.abs(e*Math.cos(i))*n[0];return{x:t.x+e,y:t.y+o}},perpendicularLineTo:function(t,n,e){var t=jsPlumbUtil.gradient(t,n),t=Math.atan(-1/t),i=e/2*Math.sin(t),e=e/2*Math.cos(t);return[{x:n.x+e,y:n.y+i},{x:n.x-e,y:n.y-i}]},findWithFunction:function(t,n){if(t)for(var e=0;e<t.length;e++)if(n(t[e]))return e;return-1},indexOf:function(t,n){return jsPlumbUtil.findWithFunction(t,function(t){return t==n})},removeWithFunction:function(t,n){n=jsPlumbUtil.findWithFunction(t,n);return-1<n&&t.splice(n,1),-1!=n},remove:function(t,n){n=jsPlumbUtil.indexOf(t,n);return-1<n&&t.splice(n,1),-1!=n},addWithFunction:function(t,n,e){-1==jsPlumbUtil.findWithFunction(t,e)&&t.push(n)},addToList:function(t,n,e){var i=t[n];return null==i&&(t[n]=i=[]),i.push(e),i},EventGenerator:function(){var o={},r=this,s=["ready"];this.bind=function(t,n){return jsPlumbUtil.addToList(o,t,n),r},this.fire=function(n,t,e){if(o[n])for(var i=0;i<o[n].length;i++)if(-1!=jsPlumbUtil.findWithFunction(s,function(t){return t===n}))o[n][i](t,e);else try{o[n][i](t,e)}catch(t){jsPlumbUtil.log("jsPlumb: fire failed for event "+n+" : "+t)}return r},this.unbind=function(t){return t?delete o[t]:(delete o,o={}),r},this.getListener=function(t){return o[t]}},logEnabled:!0,log:function(){if(jsPlumbUtil.logEnabled&&"undefined"!=typeof console)try{var t=arguments[arguments.length-1];console.log(t)}catch(t){}},group:function(t){jsPlumbUtil.logEnabled&&"undefined"!=typeof console&&console.group(t)},groupEnd:function(t){jsPlumbUtil.logEnabled&&"undefined"!=typeof console&&console.groupEnd(t)},time:function(t){jsPlumbUtil.logEnabled&&"undefined"!=typeof console&&console.time(t)},timeEnd:function(t){jsPlumbUtil.logEnabled&&"undefined"!=typeof console&&console.timeEnd(t)}},function(){function It(t,n){return Kt.CurrentLibrary.getAttribute(Rt(t),n)}function Ot(t,n,e){Kt.CurrentLibrary.setAttribute(Rt(t),n,e)}function Mt(t){return Kt.CurrentLibrary.getOffset(Rt(t))}function At(t){return Kt.CurrentLibrary.getSize(Rt(t))}function wt(t){function n(t){var n=null;if(Wt(t)){var e=t[0],i=Kt.extend({component:r,_jsPlumb:r._jsPlumb},t[1]);if(3==t.length&&Kt.extend(i,t[2]),n=new Kt.Overlays[r._jsPlumb.getRenderMode()][e](i),i.events)for(var o in i.events)n.bind(o,i.events[o])}else n=t.constructor==String?new Kt.Overlays[r._jsPlumb.getRenderMode()][t]({component:r,_jsPlumb:r._jsPlumb}):t;r.overlays.push(n)}Yt.apply(this,arguments);var r=this,e=(this.overlays=[],function(t){for(var n,e=r.defaultOverlayKeys||[],i=(i=t.overlays)||[],o=0;o<e.length;o++)i.unshift.apply(i,(n=e[o],r._jsPlumb.Defaults[n]||Kt.Defaults[n]||[]));return i}(t));if(e)for(var i=0;i<e.length;i++)n(e[i]);function o(t){for(var n=-1,e=0;e<r.overlays.length;e++)if(t===r.overlays[e].id){n=e;break}return n}function s(t){var n={cssClass:t.cssClass,labelStyle:this.labelStyle,id:c,component:r,_jsPlumb:r._jsPlumb},n=Kt.extend(n,t);return new Kt.Overlays[r._jsPlumb.getRenderMode()].Label(n)}this.addOverlay=function(t){n(t),r.repaint()},this.getOverlay=function(t){t=o(t);return 0<=t?r.overlays[t]:null},this.getOverlays=function(){return r.overlays},this.hideOverlay=function(t){t=r.getOverlay(t);t&&t.hide()},this.hideOverlays=function(){for(var t=0;t<r.overlays.length;t++)r.overlays[t].hide()},this.showOverlay=function(t){t=r.getOverlay(t);t&&t.show()},this.showOverlays=function(){for(var t=0;t<r.overlays.length;t++)r.overlays[t].show()},this.removeAllOverlays=function(){for(var t in r.overlays)r.overlays[t].cleanup();r.overlays.splice(0,r.overlays.length),r.repaint()},this.removeOverlay=function(t){t=o(t);-1!=t&&(r.overlays[t].cleanup(),r.overlays.splice(t,1))},this.removeOverlays=function(){for(var t=0;t<arguments.length;t++)r.removeOverlay(arguments[t])};var a,l,c="__label";t.label&&(a=t.labelLocation||r.defaultLabelLocation||.5,l=t.labelStyle||r._jsPlumb.Defaults.LabelStyle||Kt.Defaults.LabelStyle,this.overlays.push(s({label:t.label,location:a,labelStyle:l}))),this.setLabel=function(t){var n=r.getOverlay(c);n?t.constructor==String||t.constructor==Function?n.setLabel(t):(t.label&&n.setLabel(t.label),t.location&&n.setLocation(t.location)):(t=t.constructor==String||t.constructor==Function?{label:t}:t,n=s(t),this.overlays.push(n)),r.repaint()},this.getLabel=function(){var t=r.getOverlay(c);return null!=t?t.getLabel():null},this.getLabelOverlay=function(){return r.getOverlay(c)}}function kt(t,e,i){t.bind("click",function(t,n){e.fire("click",e,n)}),t.bind("dblclick",function(t,n){e.fire("dblclick",e,n)}),t.bind("contextmenu",function(t,n){e.fire("contextmenu",e,n)}),t.bind("mouseenter",function(t,n){e.isHover()||(i(!0),e.fire("mouseenter",e,n))}),t.bind("mouseexit",function(t,n){e.isHover()&&(i(!1),e.fire("mouseexit",e,n))})}function n(t){this.Defaults={Anchor:"BottomCenter",Anchors:[null,null],ConnectionsDetachable:!0,ConnectionOverlays:[],Connector:"Bezier",Container:null,DragOptions:{},DropOptions:{},Endpoint:"Dot",EndpointOverlays:[],Endpoints:[null,null],EndpointStyle:{fillStyle:"#456"},EndpointStyles:[null,null],EndpointHoverStyle:null,EndpointHoverStyles:[null,null],HoverPaintStyle:null,LabelStyle:{color:"black"},LogEnabled:!1,Overlays:[],MaxConnections:1,PaintStyle:{lineWidth:8,strokeStyle:"#456"},RenderMode:"svg",Scope:"jsPlumb_DefaultScope"},t&&Kt.extend(this.Defaults,t),this.logEnabled=this.Defaults.LogEnabled,jsPlumbUtil.EventGenerator.apply(this);var h,O=this,d=(t=Xt+1,Xt++,t),E=O.bind,x={};for(h in this.Defaults)x[h]=this.Defaults[h];function S(e,t,n){var i,o,r,t=null!=t&&t,s=Kt.CurrentLibrary;t&&s.isDragSupported(e)&&!s.isAlreadyDraggable(e)&&(n=n||O.Defaults.DragOptions||Kt.Defaults.DragOptions,n=Kt.extend({},n),i=s.dragEvents.drag,o=s.dragEvents.stop,n[r=s.dragEvents.start]=B(n[r],function(){O.setHoverSuspended(!0)}),n[i]=B(n[i],function(){var t,n=s.getUIPosition(arguments);l(e,n),n=e,t="jsPlumb_dragged",Kt.CurrentLibrary.addClass(Rt(n),t)}),n[o]=B(n[o],function(){var t,n=s.getUIPosition(arguments);l(e,n),n=e,t="jsPlumb_dragged",Kt.CurrentLibrary.removeClass(Rt(n),t),O.setHoverSuspended(!1)}),r=z(e),a[r]=!0,t=a[r],n.disabled=null!=t&&!t,s.initDraggable(e,n,!1),O.dragManager.register(e))}function D(t,e,i){e="block"===e;var n=null,o=(i&&(n=e?function(t){t.setVisible(!0,!0,!0)}:function(t){t.setVisible(!1,!0,!0)}),It(t,"id"));tt(o,function(t){var n;e&&i?(n=t.sourceId===o?1:0,t.endpoints[n].isVisible()&&t.setVisible(!0)):t.setVisible(e)},n)}function L(t,n){tt(t,function(t){var n=t.isVisible();t.setVisible(!n)},n?function(t){var n=t.isVisible();t.setVisible(!n)}:null)}function I(t,n){t.paintStyle=t.paintStyle||O.Defaults.EndpointStyles[n]||O.Defaults.EndpointStyle||Kt.Defaults.EndpointStyles[n]||Kt.Defaults.EndpointStyle,t.hoverPaintStyle=t.hoverPaintStyle||O.Defaults.EndpointHoverStyles[n]||O.Defaults.EndpointHoverStyle||Kt.Defaults.EndpointHoverStyles[n]||Kt.Defaults.EndpointHoverStyle,t.anchor=t.anchor||O.Defaults.Anchors[n]||O.Defaults.Anchor||Kt.Defaults.Anchors[n]||Kt.Defaults.Anchor,t.endpoint=t.endpoint||O.Defaults.Endpoints[n]||O.Defaults.Endpoint||Kt.Defaults.Endpoints[n]||Kt.Defaults.Endpoint}function e(t,n,e,i){var o,r="source"==t?P:j;if(zt(n))r[n]=i?!r[n]:e;else if(n.length){n=p(n);for(var s=0;s<n.length;s++){_el=Kt.CurrentLibrary.getElementObject(n[s]);r[o=z(_el)]=i?!r[o]:e}}return O}function R(e){return function(t,n){return!1===(e?t[0][0]<n[0][0]||t[0][1]>n[0][1]:t[0][0]>n[0][0]||t[0][1]>n[0][1])?-1:1}}this.bind=function(t,n){"ready"===t&&G?n():E.apply(O,[t,n])},O.importDefaults=function(t){for(var n in t)O.Defaults[n]=t[n]};var G=!(O.restoreDefaults=function(){O.Defaults=Kt.extend({},x)}),M={},A={},w={},k={},q={},_={},a={},T=[],U=this.Defaults.Scope,F=null,H=function(t,n,e){var i=t[n];return null==i&&(t[n]=i=[]),i.push(e),i},Y=function(t,n){O.Defaults.Container?Kt.CurrentLibrary.appendElement(t,O.Defaults.Container):n?Kt.CurrentLibrary.appendElement(t,n):document.body.appendChild(t)},X=1,r=function(){return""+X++},p=function(t){return t._nodes||t},K=!1,l=function(t,n,e){if(!K){var t=It(t,"id"),i=O.dragManager.getElementsForDraggable(t);if(null==e&&(e=qt()),O.anchorManager.redraw(t,n,e),i)for(var o in i)O.anchorManager.redraw(i[o].id,n,e,i[o].offset)}},Q=function(t,n){var e=null;if(Wt(t))for(var e=[],i=0;i<t.length;i++){var o=Rt(t[i]),r=It(o,"id");e.push(n(o,r))}else e=n(o=Rt(t),r=It(o,"id"));return e},c=function(t){return w[t]},Z=function(t){var n=O.Defaults.ConnectionType||O.getDefaultConnectionType(),e=O.Defaults.EndpointType||Lt,i=Kt.CurrentLibrary.getParent,e=(t.container?t.parent=t.container:t.sourceEndpoint?t.parent=t.sourceEndpoint.parent:t.source.constructor==e?t.parent=t.source.parent:t.parent=i(t.source),t._jsPlumb=O,new n(t));return e.id="con_"+r(),o("click","click",e),o("dblclick","dblclick",e),o("contextmenu","contextmenu",e),e},J=function(t,n,e){n=n||{},t.suspendedEndpoint||H(M,t.scope,t),n.doNotFireConnectionEvent||!1===n.fireEvent||O.fire("jsPlumbConnection",{connection:t,source:t.source,target:t.target,sourceId:t.sourceId,targetId:t.targetId,sourceEndpoint:t.endpoints[0],targetEndpoint:t.endpoints[1]},e),O.anchorManager.newConnection(t),l(t.source)},o=function(t,e,i){i.bind(t,function(t,n){O.fire(e,i,n)})},$=function(t){var n;return t.container||(n=Kt.CurrentLibrary.getTagName(t.source),t=Kt.CurrentLibrary.getParent(t.source),n&&"td"===n.toLowerCase()?Kt.CurrentLibrary.getParent(t):t)},N=function(t){var n=O.Defaults.EndpointType||Lt,n=(t.parent=$(t),t._jsPlumb=O,new n(t));return n.id="ep_"+r(),o("click","endpointClick",n),o("dblclick","endpointDblClick",n),o("contextmenu","contextmenu",n),n},tt=function(t,n,e){var i=A[t];if(i&&i.length)for(var o=0;o<i.length;o++){for(var r=0;r<i[o].connections.length;r++)if(n(i[o].connections[r]))return;e&&e(i[o])}},nt=function(t,n){null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t)},V=function(t,n){for(var e=0;e<t.length;e++)nt(t[e],n)},W=function(t){var n,e=t.timestamp,i=t.recalc,o=t.offset,t=t.elId;return!i&&e&&e===q[t]||(i||!o?null!=(n=Rt(t))&&(T[t]=At(n),k[t]=Mt(n),q[t]=e):(k[t]=o,null==T[t]&&null!=(n=Rt(t))&&(T[t]=At(n))),k[t]&&!k[t].right&&(k[t].right=k[t].left+T[t][0],k[t].bottom=k[t].top+T[t][1],k[t].width=T[t][0],k[t].height=T[t][1],k[t].centerx=k[t].left+k[t].width/2,k[t].centery=k[t].top+k[t].height/2)),k[t]},et=function(t){return{o:k[t]||W({elId:t}),s:T[t]}},z=function(t,n,e){var i=Rt(t),o=It(i,"id");return o&&"undefined"!=o||(2==arguments.length&&null!=n?o=n:1!=arguments.length&&(3!=arguments.length||e)||(o="jsPlumb_"+d+"_"+r()),Ot(i,"id",o)),o},B=function(n,e,i){return n=n||function(){},e=e||function(){},function(){var t=null;try{t=e.apply(this,arguments)}catch(t){Gt(O,"jsPlumb function failed : "+t)}if(null==i||t!==i)try{n.apply(this,arguments)}catch(t){Gt(O,"wrapped function failed : "+t)}return t}},it=(this.connectorClass="_jsPlumb_connector",this.endpointClass="_jsPlumb_endpoint",this.overlayClass="_jsPlumb_overlay",this.Anchors={},this.Connectors={canvas:{},svg:{},vml:{}},this.Endpoints={canvas:{},svg:{},vml:{}},this.Overlays={canvas:{},svg:{},vml:{}},this.addClass=function(t,n){return Kt.CurrentLibrary.addClass(t,n)},this.removeClass=function(t,n){return Kt.CurrentLibrary.removeClass(t,n)},this.hasClass=function(t,n){return Kt.CurrentLibrary.hasClass(t,n)},this.addEndpoint=function(t,n,e){for(var i=Kt.extend({},e=e||{}),o=(Kt.extend(i,n),i.endpoint=i.endpoint||O.Defaults.Endpoint||Kt.Defaults.Endpoint,i.paintStyle=i.paintStyle||O.Defaults.EndpointStyle||Kt.Defaults.EndpointStyle,[]),r=(t=p(t)).length&&t.constructor!=String?t:[t],s=0;s<r.length;s++){var a=Rt(r[s]),l=z(a),c=(i.source=a,W({elId:l}),N(i)),u=(i.parentAnchor&&(c.parentAnchor=i.parentAnchor),H(A,l,c),k[l]),l=T[l],u=c.anchor.compute({xy:[u.left,u.top],wh:l,element:c});c.paint({anchorLoc:u}),o.push(c),O.dragManager.endpointAdded(a)}return 1==o.length?o[0]:o},this.addEndpoints=function(t,n,e){for(var i=[],o=0;o<n.length;o++){var r=O.addEndpoint(t,n[o],e);Wt(r)?Array.prototype.push.apply(i,r):i.push(r)}return i},this.animate=function(t,n,e){var i=Rt(t),o=It(t,"id"),t=Kt.CurrentLibrary.dragEvents.step,r=Kt.CurrentLibrary.dragEvents.complete;(e=e||{})[t]=B(e[t],function(){O.repaint(o)}),e[r]=B(e[r],function(){O.repaint(o)}),Kt.CurrentLibrary.animate(i,n,e)},this.checkCondition=function(n,t){var e=O.getListener(n),i=!0;if(e&&0<e.length)try{for(var o=0;o<e.length;o++)i=i&&e[o](t)}catch(t){Gt(O,"cannot check condition ["+n+"]"+t)}return i},this.connect=function(t,n){t=function(t,n){var e=Kt.extend({},t);if(n&&Kt.extend(e,n),e.source&&e.source.endpoint&&(e.sourceEndpoint=e.source),e.source&&e.target.endpoint&&(e.targetEndpoint=e.target),t.uuids&&(e.sourceEndpoint=c(t.uuids[0]),e.targetEndpoint=c(t.uuids[1])),e.sourceEndpoint&&e.sourceEndpoint.isFull())Gt(O,"could not add connection; source endpoint is full");else{if(!e.targetEndpoint||!e.targetEndpoint.isFull()){if(e.sourceEndpoint&&e.sourceEndpoint.connectorOverlays){e.overlays=e.overlays||[];for(var i=0;i<e.sourceEndpoint.connectorOverlays.length;i++)e.overlays.push(e.sourceEndpoint.connectorOverlays[i])}if(e.tooltip=t.tooltip,!e.tooltip&&e.sourceEndpoint&&e.sourceEndpoint.connectorTooltip&&(e.tooltip=e.sourceEndpoint.connectorTooltip),e.target&&!e.target.endpoint&&!e.targetEndpoint&&!e.newConnection){var o=z(e.target),r=f[o],s=m[o];if(r){if(!j[o])return;var a=null!=s?s:O.addEndpoint(e.target,r);g[o]&&(m[o]=a),(e.targetEndpoint=a)._makeTargetCreator=!0}}if(e.source&&!e.source.endpoint&&!e.sourceEndpoint&&!e.newConnection){o=z(e.source),r=y[o],s=ct[o];if(r){if(!P[o])return;a=null!=s?s:O.addEndpoint(e.source,r);b[o]&&(ct[o]=a),e.sourceEndpoint=a}}return e}Gt(O,"could not add connection; target endpoint is full")}}(t,n);if(t)return null==t.deleteEndpointsOnDetach&&(t.deleteEndpointsOnDetach=!0),n=Z(t),J(n,t),n},this.deleteEndpoint=function(t){var n="string"==typeof t?w[t]:t;if(n){var e,t=n.getUuid();for(e in t&&(w[t]=null),n.detachAll(),V(n.endpoint.getDisplayElements()),O.anchorManager.deleteEndpoint(n),A){var i=A[e];if(i){for(var o=[],r=0;r<i.length;r++)i[r]!=n&&o.push(i[r]);A[e]=o}}O.dragManager.endpointDeleted(n)}},this.deleteEveryEndpoint=function(){for(var t in A){var n=A[t];if(n&&n.length)for(var e=0;e<n.length;e++)O.deleteEndpoint(n[e])}delete A,A={},delete w,w={}},function(t,n,e){var i=O.Defaults.ConnectionType||O.getDefaultConnectionType(),i=t.constructor==i?{connection:t,source:t.source,target:t.target,sourceId:t.sourceId,targetId:t.targetId,sourceEndpoint:t.endpoints[0],targetEndpoint:t.endpoints[1]}:t;n&&O.fire("jsPlumbConnectionDetached",i,e),O.anchorManager.connectionDetached(i)}),ot=function(t){O.fire("connectionDrag",t)},rt=function(t){O.fire("connectionDragStop",t)},st=(this.detach=function(){var t,n,e,i,o,r;0!=arguments.length&&(e=O.Defaults.ConnectionType||O.getDefaultConnectionType(),e=arguments[0].constructor==e,n=!1!==(t=2==arguments.length&&e?arguments[1]||{}:arguments[0]).fireEvent,i=t.forceDetach,(e=e?arguments[0]:t.connection)?(i||e.isDetachAllowed(e)&&e.endpoints[0].isDetachAllowed(e)&&e.endpoints[1].isDetachAllowed(e))&&(i||O.checkCondition("beforeDetach",e))&&e.endpoints[0].detach(e,!1,!0,n):(i=Kt.extend({},t)).uuids?c(i.uuids[0]).detachFrom(c(i.uuids[1]),n):i.sourceEndpoint&&i.targetEndpoint?i.sourceEndpoint.detachFrom(i.targetEndpoint):(o=z(i.source),r=z(i.target),tt(o,function(t){(t.sourceId==o&&t.targetId==r||t.targetId==o&&t.sourceId==r)&&O.checkCondition("beforeDetach",t)&&t.endpoints[0].detach(t,!1,!0,n)})))},this.detachAllConnections=function(t,n){n=n||{},t=Rt(t);var t=It(t,"id"),e=A[t];if(e&&e.length)for(var i=0;i<e.length;i++)e[i].detachAll(n.fireEvent)},this.detachEveryConnection=function(t){for(var n in t=t||{},A){var e=A[n];if(e&&e.length)for(var i=0;i<e.length;i++)e[i].detachAll(t.fireEvent)}delete M,M={}},this.draggable=function(t,n){if("object"==typeof t&&t.length)for(var e=0;e<t.length;e++)(i=Rt(t[e]))&&S(i,!0,n);else if(t._nodes)for(var i,e=0;e<t._nodes.length;e++)(i=Rt(t._nodes[e]))&&S(i,!0,n);else(i=Rt(t))&&S(i,!0,n)},this.extend=function(t,n){return Kt.CurrentLibrary.extend(t,n)},this.getDefaultEndpointType=function(){return Lt},this.getDefaultConnectionType=function(){return Et},function(t,n,e,i){for(var o=0;o<t.length;o++)t[o][n].apply(t[o],e);return i(t)}),at=function(t,n,e){for(var i=[],o=0;o<t.length;o++)i.push([t[o][n].apply(t[o],e),t[o]]);return i},n=function(t,n,e){return function(){return st(t,n,arguments,e)}},i=function(t,n){return function(){return at(t,n,arguments)}},s=(this.getConnections=function(t,n){t?t.constructor==String&&(t={scope:t}):t={};function e(t){var n=[];if(t)if("string"==typeof t){if("*"===t)return t;n.push(t)}else n=t;return n}function i(t,n){return"*"===t||!(0<t.length)||-1!=Ht(t,n)}var o,r,s,a=e(t.scope||O.getDefaultScope()),l=e(t.source),c=e(t.target),u=!n&&1<a.length?{}:[];for(o in M)if(i(a,o))for(var h=0;h<M[o].length;h++){var d=M[o][h];i(l,d.sourceId)&&i(c,d.targetId)&&(r=o,d=d,s=void 0,(!n&&1<a.length?(null==(s=u[r])&&(u[r]=s=[]),s):u).push(d))}return u},function(e){return{setHover:n(e,"setHover",s),removeAllOverlays:n(e,"removeAllOverlays",s),setLabel:n(e,"setLabel",s),addOverlay:n(e,"addOverlay",s),removeOverlay:n(e,"removeOverlay",s),removeOverlays:n(e,"removeOverlays",s),showOverlay:n(e,"showOverlay",s),hideOverlay:n(e,"hideOverlay",s),showOverlays:n(e,"showOverlays",s),hideOverlays:n(e,"hideOverlays",s),setPaintStyle:n(e,"setPaintStyle",s),setHoverPaintStyle:n(e,"setHoverPaintStyle",s),setDetachable:n(e,"setDetachable",s),setConnector:n(e,"setConnector",s),setParameter:n(e,"setParameter",s),setParameters:n(e,"setParameters",s),detach:function(){for(var t=0;t<e.length;t++)O.detach(e[t])},getLabel:i(e,"getLabel"),getOverlay:i(e,"getOverlay"),isHover:i(e,"isHover"),isDetachable:i(e,"isDetachable"),getParameter:i(e,"getParameter"),getParameters:i(e,"getParameters"),getPaintStyle:i(e,"getPaintStyle"),getHoverPaintStyle:i(e,"getHoverPaintStyle"),length:e.length,each:function(t){for(var n=0;n<e.length;n++)t(e[n]);return s(e)},get:function(t){return e[t]}}}),lt=(this.select=function(t){(t=t||{}).scope=t.scope||"*";t=O.getConnections(t,!0);return s(t)},this.getAllConnections=function(){return M},this.getDefaultScope=function(){return U},this.getEndpoint=c,this.getEndpoints=function(t){return A[z(t)]},this.getId=z,this.getOffset=function(t){k[t];return W({elId:t})},this.getSelector=function(t){return Kt.CurrentLibrary.getSelector(t)},this.getSize=function(t){return T[t]||W({elId:t}),T[t]},this.appendElement=Y,!1),f=(this.isHoverSuspended=function(){return lt},this.setHoverSuspended=function(t){lt=t},this.isCanvasAvailable=function(){return _t},this.isSVGAvailable=function(){return Tt},this.isVMLAvailable=Ut,this.hide=function(t,n){D(t,"none",n)},this.idstamp=r,this.init=function(){var t;G||(O.setRenderMode(O.Defaults.RenderMode),(t=function(s){Kt.CurrentLibrary.bind(document,s,function(t){if(!O.currentlyDragging&&F==Kt.CANVAS){for(var n in M)for(var e=M[n],i=0;i<e.length;i++)if(e[i].connector[s](t))return;for(var o in A)for(var r=A[o],i=0;i<r.length;i++)if(r[i].endpoint[s](t))return}})})("click"),t("dblclick"),t("mousemove"),t("mousedown"),t("mouseup"),t("contextmenu"),G=!0,O.fire("ready"))},this.log=null,this.jsPlumbUIComponent=Yt,this.makeAnchor=function(){var t,n,e,i,o;return 0==arguments.length?null:(t=arguments[0],n=arguments[1],i=null,t.compute&&t.getOrientation?t:("string"==typeof t?i=Kt.Anchors[arguments[0]]({elementId:n,jsPlumbInstance:O}):Wt(t)&&(Wt(t[0])||zt(t[0])?i=2==t.length&&zt(t[0])&&Bt(t[1])?(e=Kt.extend({elementId:n,jsPlumbInstance:O},t[1]),Kt.Anchors[t[0]](e)):new pt(t,null,n):(o={x:t[0],y:t[1],orientation:4<=t.length?[t[2],t[3]]:[0,0],offsets:6==t.length?[t[4],t[5]]:[0,0],elementId:n},(i=new ht(o)).clone=function(){return new ht(o)})),i.id||(i.id="anchor_"+r()),i))},this.makeAnchors=function(t,n,e){for(var i=[],o=0;o<t.length;o++)"string"==typeof t[o]?i.push(Kt.Anchors[t[o]]({elementId:n,jsPlumbInstance:e})):Wt(t[o])&&i.push(O.makeAnchor(t[o],n,e));return i},this.makeDynamicAnchor=function(t,n){return new pt(t,n)},{}),m={},g={},v={},y=(this.makeTarget=function(t,n,e){for(var u=Kt.extend({_jsPlumb:O},e),h=(Kt.extend(u,n),I(u,1),Kt.CurrentLibrary),i=u.scope||O.Defaults.Scope,d=!(!1===u.deleteEndpointsOnDetach),o=u.maxConnections||-1,r=(t=p(t)).length&&t.constructor!=String?t:[t],s=0;s<r.length;s++)!function(l){var c=z(l),t=(f[c]=u,g[c]=u.uniqueEndpoint,v[c]=o,j[c]=!0,proxyComponent=new Yt(u),Kt.extend({},u.dropOptions||{})),n=h.dragEvents.drop;t.scope=t.scope||i,t[n]=B(t[n],function(){var t=Kt.CurrentLibrary.getDropEvent(arguments),n=O.select({target:c}).length;if(!j[c]||0<v[c]&&n>=v[c])return console.log("target element "+c+" is full."),!1;O.currentlyDragging=!1;var e,i,o,n=Rt(h.getDragObject(arguments)),r=It(n,"dragId"),s=It(n,"originalScope"),r=_[r],a=r.endpoints[0],n=(u.endpoint&&Kt.extend({},u.endpoint),a.anchor.locked=!1,s&&h.setDragScope(n,s),proxyComponent.isDropAllowed(r.sourceId,z(l),r.scope,r,null));r.endpointsToDeleteOnDetach&&(a===r.endpointsToDeleteOnDetach[0]?r.endpointsToDeleteOnDetach[0]=null:a===r.endpointsToDeleteOnDetach[1]&&(r.endpointsToDeleteOnDetach[1]=null)),r.suspendedEndpoint&&(r.targetId=r.suspendedEndpoint.elementId,r.target=h.getElementObject(r.suspendedEndpoint.elementId),r.endpoints[1]=r.suspendedEndpoint),n?(a.detach(r,!1,!0,!1),n=m[c]||O.addEndpoint(l,u),u.uniqueEndpoint&&(m[c]=n),n._makeTargetCreator=!0,null!=n.anchor.positionFinder&&(i=h.getUIPosition(arguments),o=h.getOffset(l),e=h.getSize(l),i=n.anchor.positionFinder(i,o,e,n.anchor.constructorParams),n.anchor.x=i[0],n.anchor.y=i[1]),o=O.connect({source:a,target:n,scope:s,previousConnection:r,container:r.parent,deleteEndpointsOnDetach:d,doNotFireConnectionEvent:a.endpointWillMoveAfterConnection}),r.endpoints[1]._makeTargetCreator&&r.endpoints[1].connections.length<2&&O.deleteEndpoint(r.endpoints[1]),d&&(o.endpointsToDeleteOnDetach=[a,n]),o.repaint()):r.suspendedEndpoint&&(a.isReattach?(r.setHover(!1),r.floatingAnchorIndex=null,r.suspendedEndpoint.addConnection(r),O.repaint(a.elementId)):a.detach(r,!1,!0,!0,t))}),h.initDroppable(l,t,!0)}(Rt(r[s]));return O},this.unmakeTarget=function(t,n){t=Kt.CurrentLibrary.getElementObject(t);t=z(t);return n||(delete f[t],delete g[t],delete v[t],delete j[t]),O},this.makeTargets=function(t,n,e){for(var i=0;i<t.length;i++)O.makeTarget(t[i],n,e)},{}),ct={},b={},P={},C={},j={},u=(this.makeSource=function(t,f,n){function e(l){function t(t){if(P[u]){if(f.filter)if(!1===f.filter(g.getOriginalEvent(t),l))return;function n(){p&&O.deleteEndpoint(d)}var e=W({elId:c}),i=((t.pageX||t.page.x)-e.left)/e.width,o=((t.pageY||t.page.y)-e.top)/e.height,r=i,s=o,a=(m.parent&&(a=g.getElementObject(m.parent),a=z(a),e=W({elId:a}),r=((t.pageX||t.page.x)-e.left)/e.width,s=((t.pageY||t.page.y)-e.top)/e.height),{});Kt.extend(a,m),a.isSource=!0,a.anchor=[i,o,0,0],a.parentAnchor=[r,s,0,0],a.dragOptions=h,m.parent&&(e=a.container||O.Defaults.Container||Kt.Defaults.Container,a.container=e||Kt.CurrentLibrary.getParent(m.parent)),d=O.addEndpoint(c,a),p=!0,d.endpointWillMoveAfterConnection=null!=m.parent,d.endpointWillMoveTo=m.parent?g.getElementObject(m.parent):null;O.registerListener(d.canvas,"mouseup",n),O.registerListener(l,"mouseup",n),g.trigger(d.canvas,"mousedown",t)}}var c=z(l),u=null!=(n=m.parent)?O.getId(g.getElementObject(n)):c,n=(y[u]=m,b[u]=m.uniqueEndpoint,P[u]=!0,g.dragEvents.stop),e=g.dragEvents.drag,h=Kt.extend({},m.dragOptions||{}),i=h.drag,o=h.stop,d=null,p=!1;h.scope=h.scope||m.scope,h[e]=B(h[e],function(){i&&i.apply(this,arguments),p=!1}),h[n]=B(h[n],function(){var n,t,e,i;o&&o.apply(this,arguments),O.currentlyDragging=!1,0==d.connections.length?O.deleteEndpoint(d):(g.unbind(d.canvas,"mousedown"),t=m.anchor||O.Defaults.Anchor,d.anchor,n=d.connections[0],d.anchor=O.makeAnchor(t,c,O),m.parent&&(t=g.getElementObject(m.parent))&&(e=d.elementId,i=m.container||O.Defaults.Container||Kt.Defaults.Container,d.setElement(t,i),d.endpointWillMoveAfterConnection=!1,O.anchorManager.rehomeEndpoint(e,t),n.previousConnection=null,Nt(M[n.scope],function(t){return t.id===n.id}),O.anchorManager.connectionDetached({sourceId:n.sourceId,targetId:n.targetId,connection:n}),J(n)),d.repaint(),O.repaint(d.elementId),O.repaint(n.targetId))}),O.registerListener(l,"mousedown",t),C[c]=t}for(var m=Kt.extend({},n),g=(Kt.extend(m,f),I(m,0),Kt.CurrentLibrary),i=(t=p(t)).length&&t.constructor!=String?t:[t],o=0;o<i.length;o++)e(Rt(i[o]));return O},this.unmakeSource=function(t,n){t=Kt.CurrentLibrary.getElementObject(t);var t=z(t),e=C[t];return e&&O.unregisterListener(_el,"mousedown",e),n||(delete y[t],delete b[t],delete P[t],delete C[t]),O},this.unmakeEverySource=function(){for(var t in P)O.unmakeSource(t,!0);y={},b={},P={},C={}},this.unmakeEveryTarget=function(){for(var t in j)O.unmakeTarget(t,!0);return f={},g={},v={},j={},O},this.makeSources=function(t,n,e){for(var i=0;i<t.length;i++)O.makeSource(t[i],n,e);return O},this.setSourceEnabled=function(t,n){return e("source",t,n)},this.toggleSourceEnabled=function(t){return e("source",t,null,!0),O.isSourceEnabled(t)},this.isSource=function(t){return t=Kt.CurrentLibrary.getElementObject(t),null!=P[z(t)]},this.isSourceEnabled=function(t){return t=Kt.CurrentLibrary.getElementObject(t),!0===P[z(t)]},this.setTargetEnabled=function(t,n){return e("target",t,n)},this.toggleTargetEnabled=function(t){return e("target",t,null,!0)},this.isTarget=function(t){return t=Kt.CurrentLibrary.getElementObject(t),null!=j[z(t)]},this.isTargetEnabled=function(t){return t=Kt.CurrentLibrary.getElementObject(t),!0===j[z(t)]},this.ready=function(t){O.bind("ready",t)},this.repaint=function(t){function n(t){l(Rt(t))}if("object"==typeof t)for(var e=0;e<t.length;e++)n(t[e]);else n(t)},this.repaintEverything=function(){for(var t in A)l(Rt(t),null,null)},this.removeAllEndpoints=function(t){var t=It(t,"id"),n=A[t];if(n)for(var e=0;e<n.length;e++)O.deleteEndpoint(n[e]);A[t]=[]},this.removeEveryEndpoint=this.deleteEveryEndpoint,this.removeEndpoint=function(t,n){O.deleteEndpoint(n)},{}),ut=(this.registerListener=function(t,n,e){Kt.CurrentLibrary.bind(t,n,e),H(u,n,{el:t,event:n,listener:e})},this.unregisterListener=function(t,n,e){Kt.CurrentLibrary.unbind(t,n,e),Nt(u,function(t){return t.type==n&&t.listener==e})},this.reset=function(){for(var t in O.deleteEveryEndpoint(),O.unbind(),f={},m={},g={},v={},y={},ct={},b={},u)for(var n=0;n<u[t].length;n++){var e=u[t][n];Kt.CurrentLibrary.unbind(e.el,e.event,e.listener)}u={},O.anchorManager.reset(),O.dragManager.reset()},this.setDefaultScope=function(t){U=t},this.setDraggable=function(t,e){return Q(t,function(t,n){a[n]=e,Kt.CurrentLibrary.isDragSupported(t)&&Kt.CurrentLibrary.setDraggable(t,e)})},this.setId=function(o,r,t){var n=o.constructor==String?o:O.getId(o),e=O.getConnections({source:n,scope:"*"},!0),i=O.getConnections({target:n,scope:"*"},!0);r=""+r,t||(o=Kt.CurrentLibrary.getElementObject(n),Kt.CurrentLibrary.setAttribute(o,"id",r)),o=Kt.CurrentLibrary.getElementObject(r),A[r]=A[n]||[];for(var s=0;s<A[r].length;s++)A[r][s].elementId=r,A[r][s].element=o,A[r][s].anchor.elementId=r;delete A[n],O.anchorManager.changeId(n,r);function a(t,n,e){for(var i=0;i<t.length;i++)t[i].endpoints[n].elementId=r,t[i].endpoints[n].element=o,t[i][e+"Id"]=r,t[i][e]=o}a(e,0,"source"),a(i,1,"target")},this.setIdChanged=function(t,n){O.setId(t,n,!0)},this.setDebugLog=function(t){0},this.setRepaintFunction=function(t){0},this.setSuspendDrawing=function(t,n){K=t,n&&O.repaintEverything()},this.CANVAS="canvas",this.SVG="svg",this.VML="vml",this.setRenderMode=function(t){if(t){if((t=t.toLowerCase())!==Kt.CANVAS&&t!==Kt.SVG&&t!==Kt.VML)throw new Error("render mode must be one of jsPlumb.CANVAS, jsPlumb.SVG or jsPlumb.VML");return t===Kt.SVG?Tt?F=Kt.SVG:_t?F=Kt.CANVAS:Ut()&&(F=Kt.VML):t===Kt.CANVAS&&_t?F=Kt.CANVAS:Ut()&&(F=Kt.VML),F}},this.getRenderMode=function(){return F},this.show=function(t,n){D(t,"block",n)},this.sizeCanvas=function(t,n,e,i,o){t&&(t.style.height=o+"px",t.height=o,t.style.width=i+"px",t.width=i,t.style.left=n+"px",t.style.top=e+"px")},this.getTestHarness=function(){return{endpointsByElement:A,endpointCount:function(t){t=A[t];return t?t.length:0},connectionCount:function(t){t=M[t=t||U];return t?t.length:0},getId:z,makeAnchor:self.makeAnchor,makeDynamicAnchor:self.makeDynamicAnchor}},this.toggle=L,this.toggleVisible=L,this.toggleDraggable=function(t){return Q(t,function(t,n){var e=null!=a[n]&&a[n];return a[n]=e=!e,Kt.CurrentLibrary.setDraggable(t,e),e})},this.unload=function(){},this.wrap=B,this.addListener=this.bind,function(t,n){var e=null,i=t;return"svg"===n.tagName.toLowerCase()&&n.parentNode?e=n.parentNode:n.offsetParent&&(e=n.offsetParent),null!=e&&(n="body"===e.tagName.toLowerCase()?{left:0,top:0}:Mt(e),e="body"===e.tagName.toLowerCase()?{left:0,top:0}:{left:e.scrollLeft,top:e.scrollTop},i[0]=t[0]-n.left+e.left,i[1]=t[1]-n.top+e.top),i}),ht=function(t){var o=this,n=(this.x=t.x||0,this.y=t.y||0,this.elementId=t.elementId,t.orientation||[0,0]),r=null;this.offsets=t.offsets||[0,0],o.timestamp=null,this.compute=function(t){var n=t.xy,e=t.wh,i=t.element,t=t.timestamp;return t&&t===o.timestamp||(r=[n[0]+o.x*e[0]+o.offsets[0],n[1]+o.y*e[1]+o.offsets[1]],r=ut(r,i.canvas),o.timestamp=t),r},this.getOrientation=function(t){return n},this.equals=function(t){var n,e;return!!t&&(n=t.getOrientation(),e=this.getOrientation(),this.x==t.x)&&this.y==t.y&&this.offsets[0]==t.offsets[0]&&this.offsets[1]==t.offsets[1]&&e[0]==n[0]&&e[1]==n[1]},this.getCurrentLocation=function(){return r}},dt=function(t){var n=t.reference,t=t.referenceCanvas,e=At(Rt(t)),i=null,o=null;this.x=0,this.y=0,this.isFloating=!0,this.compute=function(t){var n=t.xy,t=t.element,n=[n[0]+e[0]/2,n[1]+e[1]/2],n=ut(n,t.canvas);return o=n},this.getOrientation=function(t){return i||(t=n.getOrientation(t),[0*Math.abs(t[0])*-1,0*Math.abs(t[1])*-1])},this.over=function(t){i=t.getOrientation()},this.out=function(){i=null},this.getCurrentLocation=function(){return o}},pt=function(t,n,e){this.isSelective=!0,this.isDynamic=!0;function i(t){return t.constructor==ht?t:O.makeAnchor(t,e,O)}for(var r=[],o=0;o<t.length;o++)r[o]=i(t[o]);this.addAnchor=function(t){r.push(i(t))},this.getAnchors=function(){return r},this.locked=!1;var s=0<r.length?r[0]:null,a=this,l=n||function(t,n,e,i,o){for(var r,s,a,l=e[0]+i[0]/2,c=e[1]+i[1]/2,u=-1,h=1/0,d=0;d<o.length;d++){p=o[d],r=c,a=void 0,a=(s=t)[0]+p.x*n[0],s=t[1]+p.y*n[1];var p=Math.sqrt(Math.pow(l-a,2)+Math.pow(r-s,2));p<h&&(u=d+0,h=p)}return o[u]};this.compute=function(t){var n=t.xy,e=t.wh,i=(t.timestamp,t.txy),o=t.twh;return a.locked||null==i||null==o||(t.timestamp=null,s=l(n,e,i,o,r),a.x=s.x,a.y=s.y),s.compute(t)},this.getCurrentLocation=function(){return null!=s?s.getCurrentLocation():null},this.getOrientation=function(t){return null!=s?s.getOrientation(t):[0,0]},this.over=function(t){null!=s&&s.over(t)},this.out=function(){null!=s&&s.out()}},ft={},mt={},gt={},vt={HORIZONTAL:"horizontal",VERTICAL:"vertical",DIAGONAL:"diagonal",IDENTITY:"identity"},yt=function(t,n,e,i){var o,r;return t===n?{orientation:vt.IDENTITY,a:["top","top"]}:(t=Math.atan2(i.centery-e.centery,i.centerx-e.centerx),n=Math.atan2(e.centery-i.centery,e.centerx-i.centerx),o=e.left<=i.left&&e.right>=i.left||e.left<=i.right&&e.right>=i.right||e.left<=i.left&&e.right>=i.right||i.left<=e.left&&i.right>=e.right,r=e.top<=i.top&&e.bottom>=i.top||e.top<=i.bottom&&e.bottom>=i.bottom||e.top<=i.top&&e.bottom>=i.bottom||i.top<=e.top&&i.bottom>=e.bottom,o||r?o?{orientation:vt.HORIZONTAL,a:e.top<i.top?["bottom","top"]:["top","bottom"],theta:t,theta2:n}:{orientation:vt.VERTICAL,a:e.left<i.left?["right","left"]:["left","right"],theta:t,theta2:n}:(0,r=null,i.left>e.left&&i.top>e.top?r=["right","top"]:i.left>e.left&&e.top>i.top?r=["top","left"]:i.left<e.left&&i.top<e.top?r=["top","right"]:i.left<e.left&&i.top>e.top&&(r=["left","top"]),{orientation:vt.DIAGONAL,a:r,theta:t,theta2:n}))},bt=function(t,n,e,i,o,r,s){for(var a=[],l=n[o?0:1]/(i.length+1),c=0;c<i.length;c++){var u=(c+1)*l,h=r*n[o?1:0],d=(s&&(u=n[o?0:1]-u),o?u:h),p=e[0]+d,d=d/n[0],h=o?h:u,u=e[1]+h,h=h/n[1];a.push([p,u,d,h,i[c][1],i[c][2]])}return a},Pt={top:function(t,n){return t[0]>n[0]?1:-1},right:R(!0),bottom:R(!0),left:function(t,n){var e=t[0][0]<0?-Math.PI-t[0][0]:Math.PI-t[0][0];return(n[0][0]<0?-Math.PI-n[0][0]:Math.PI-n[0][0])<e||t[0][1]>n[0][1]?1:-1}},Ct=function(t,n){return t.sort(n)},jt=function(p,t){function n(t,n,e,i,o,r,s){if(0<i.length){function a(t,n){var e=ut([n[0],n[1]],t.canvas);mt[t.id]=[e[0],e[1],n[2],n[3]],gt[t.id]=s}for(var i=Ct(i,Pt[t]),l=bt(t,n,e,i,o,r,"right"===t||"top"===t),c=0;c<l.length;c++){var u=l[c][4],h=u.endpoints[0].elementId===p,d=u.endpoints[1].elementId===p;h?a(u.endpoints[0],l[c]):d&&a(u.endpoints[1],l[c])}}}var e=T[p],i=k[p];n("bottom",e,[i.left,i.top],t.bottom,!0,1,[0,1]),n("top",e,[i.left,i.top],t.top,!0,0,[0,-1]),n("left",e,[i.left,i.top],t.left,!1,0,[-1,0]),n("right",e,[i.left,i.top],t.right,!1,1,[1,0])},Et=(O.anchorManager=new function(){function S(t,n,e,i,o,r,s,a,l,c,u,h){var d=-1,p=i.endpoints[s],f=p.id,n=[[n,e],i,o,r,f],m=t[l],g=p._continuousAnchorEdge?t[p._continuousAnchorEdge]:null;if(g){e=Ft(g,function(t){return t[4]==f});if(-1!=e){g.splice(e,1);for(var v=0;v<g.length;v++)Vt(u,g[v][1],function(t){return t.id==g[v][1].id}),Vt(h,g[v][1].endpoints[s],function(t){return t.id==g[v][1].endpoints[s].id})}}for(v=0;v<m.length;v++)1==s&&m[v][3]===r&&-1==d&&(d=v),Vt(u,m[v][1],function(t){return t.id==m[v][1].id}),Vt(h,m[v][1].endpoints[s],function(t){return t.id==m[v][1].endpoints[s].id});i=a?-1!=d?d:0:m.length,m.splice(i,0,n),p._continuousAnchorEdge=l}var D={},L={},s=this,I={};this.reset=function(){D={},L={},I={}},this.newConnection=function(t){function n(t,n,e,i,o){r==s&&e.isContinuous&&(Kt.CurrentLibrary.removeElement(a[1].canvas),l=!1),H(L,i,[o,n,e.constructor==pt])}var r=t.sourceId,s=t.targetId,a=t.endpoints,l=!0;n(0,a[0],a[0].anchor,s,t),l&&n(0,a[1],a[1].anchor,r,t)},this.connectionDetached=function(t){function n(t,n,e,i,o){e.constructor!=dt&&Nt(L[i],function(t){return t[0].id==o.id})}function e(t,n){var e;t&&(Nt(t.top,e=function(t){return t[4]==n}),Nt(t.left,e),Nt(t.bottom,e),Nt(t.right,e))}var t=t.connection||t,i=t.sourceId,o=t.targetId,r=t.endpoints,i=(n(0,r[1],r[1].anchor,i,t),n(0,r[0],r[0].anchor,o,t),t.sourceId),r=t.targetId,o=t.endpoints[0].id,t=t.endpoints[1].id;e(I[i],o),e(I[r],t),s.redraw(i),s.redraw(r)},this.add=function(t,n){H(D,n,t)},this.changeId=function(t,n){L[n]=L[t],D[n]=D[t],delete L[t],delete D[t]},this.getConnectionsFor=function(t){return L[t]||[]},this.getEndpointsFor=function(t){return D[t]||[]},this.deleteEndpoint=function(n){Nt(D[n.elementId],function(t){return t.id==n.id})},this.clearFor=function(t){delete D[t],D[t]=[]};this.redraw=function(t,n,e,i){for(var o=D[t]||[],r=L[t]||[],s=[],a=[],l=[],c=(e=e||qt(),i=i||{left:0,top:0},n=n&&{left:n.left+i.left,top:n.top+i.top},W({elId:t,offset:n,recalc:!1,timestamp:e}),k[t]),u=T[t],h={},d=0;d<r.length;d++){var p,f,m,g,v,y=r[d][0],b=y.sourceId,P=y.targetId,C=y.endpoints[0].anchor.isContinuous,j=y.endpoints[1].anchor.isContinuous;(C||j)&&(f=h[p=b+"_"+P],m=y.sourceId==t?1:0,C&&!I[b]&&(I[b]={top:[],right:[],bottom:[],left:[]}),j&&!I[P]&&(I[P]={top:[],right:[],bottom:[],left:[]}),t!=P&&W({elId:P,timestamp:e}),t!=b&&W({elId:b,timestamp:e}),g=et(P),v=et(b),P==b&&(C||j)?S(I[b],-Math.PI/2,0,y,!1,P,0,!1,"top",0,s,a):(f||(f=yt(b,P,v.o,g.o),h[p]=f),C&&S(I[b],f.theta,0,y,!1,P,0,!1,f.a[0],0,s,a),j&&S(I[P],f.theta2,-1,y,!0,b,1,!0,f.a[1],0,s,a)),C&&Vt(l,b,function(t){return t===b}),j&&Vt(l,P,function(t){return t===P}),Vt(s,y,function(t){return t.id==y.id}),C&&0==m||j&&1==m)&&Vt(a,y.endpoints[m],function(t){return t.id==y.endpoints[m].id})}for(d=0;d<l.length;d++)jt(l[d],I[l[d]]);for(d=0;d<o.length;d++)o[d].paint({timestamp:e,offset:c,dimensions:u});for(d=0;d<a.length;d++)a[d].paint({timestamp:e,offset:c,dimensions:u});for(d=0;d<r.length;d++){var E=r[d][1];if(E.anchor.constructor==pt){E.paint({elementWithPrecedence:t}),Vt(s,r[d][0],function(t){return t.id==r[d][0].id});for(var x=0;x<E.connections.length;x++)E.connections[x]!==r[d][0]&&Vt(s,E.connections[x],function(t){return t.id==E.connections[x].id})}else E.anchor.constructor==ht&&Vt(s,r[d][0],function(t){return t.id==r[d][0].id})}i=_[t];i&&i.paint({timestamp:e,recalc:!1,elId:t});for(d=0;d<s.length;d++)s[d].paint({elId:t,timestamp:e,recalc:!1})},this.rehomeEndpoint=function(t,n){for(var e=D[t]||[],i=O.getId(n),o=0;o<e.length;o++)s.add(e[o],i);e.splice(0,e.length)}},O.continuousAnchorFactory={get:function(t){var n=ft[t.elementId];return n||(ft[t.elementId]=n={type:"Continuous",compute:function(t){return mt[t.element.id]||[0,0]},getCurrentLocation:function(t){return mt[t.id]||[0,0]},getOrientation:function(t){return gt[t.id]||[0,0]},isDynamic:!0,isContinuous:!0}),n}},O.dragManager=new function(){var c={},u=[],h={},d={};this.register=function(t){for(var n,e,i=Kt.CurrentLibrary,o=(t=i.getElementObject(t),O.getId(t)),r=i.getDOMElement(t),s=(c[o]||(c[o]=t,u.push(t),h[o]={}),r),t=i.getElementObject(s),a=i.getOffset(t),l=0;l<s.childNodes.length;l++)3!=s.childNodes[l].nodeType&&(e=i.getElementObject(s.childNodes[l]),n=O.getId(e,null,!0))&&d[n]&&0<d[n]&&(e=i.getOffset(e),h[o][n]={id:n,offset:{left:e.left-a.left,top:e.top-a.top}})},this.endpointAdded=function(t){var n=Kt.CurrentLibrary,e=document.body,i=O.getId(t),o=n.getDOMElement(t).parentNode;for(d[i]=d[i]?d[i]+1:1;o!=e;){var r=O.getId(o);if(c[r]){var s,a=n.getElementObject(o),a=n.getOffset(a);null==h[r][i]&&(s=Kt.CurrentLibrary.getOffset(t),h[r][i]={id:i,offset:{left:s.left-a.left,top:s.top-a.top}});break}o=o.parentNode}},this.endpointDeleted=function(t){if(d[t.elementId]&&(d[t.elementId]--,d[t.elementId]<=0))for(var n in h)delete h[n][t.elementId]},this.getElementsForDraggable=function(t){return h[t]},this.reset=function(){c={},u=[],h={},d={}}},function(i){function t(t,n,e,i,o,r,s){var a,l;if(!t)return e.endpoints||(e.endpoints=[null,null]),a=e.endpoints[n]||e.endpoint||O.Defaults.Endpoints[n]||Kt.Defaults.Endpoints[n]||O.Defaults.Endpoint||Kt.Defaults.Endpoint,e.endpointStyles||(e.endpointStyles=[null,null]),e.endpointHoverStyles||(e.endpointHoverStyles=[null,null]),null==(l=e.endpointStyles[n]||e.endpointStyle||O.Defaults.EndpointStyles[n]||Kt.Defaults.EndpointStyles[n]||O.Defaults.EndpointStyle||Kt.Defaults.EndpointStyle).fillStyle&&null!=r&&(l.fillStyle=r.strokeStyle),null==l.outlineColor&&null!=r&&(l.outlineColor=r.outlineColor),null==l.outlineWidth&&null!=r&&(l.outlineWidth=r.outlineWidth),r=e.endpointHoverStyles[n]||e.endpointHoverStyle||O.Defaults.EndpointHoverStyles[n]||Kt.Defaults.EndpointHoverStyles[n]||O.Defaults.EndpointHoverStyle||Kt.Defaults.EndpointHoverStyle,null!=s&&null==(r=null==r?{}:r).fillStyle&&(r.fillStyle=s.strokeStyle),s=e.anchors?e.anchors[n]:e.anchor||u(O.Defaults.Anchors[n],o)||u(Kt.Defaults.Anchors[n],o)||u(O.Defaults.Anchor,o)||u(Kt.Defaults.Anchor,o),o=e.uuids?e.uuids[n]:null,l=N({paintStyle:l,hoverPaintStyle:r,endpoint:a,connections:[c],uuid:o,anchor:s,source:i,scope:e.scope,container:e.container,reattach:e.reattach,detachable:e.detachable}),c.endpoints[n]=l,!1===e.drawEndpoints&&l.setVisible(!1,!0,!0),l;(c.endpoints[n]=t).addConnection(c)}var c=this,n=!0,e=(c.idPrefix="_jsplumb_c_",c.defaultLabelLocation=.5,c.defaultOverlayKeys=["Overlays","ConnectionOverlays"],this.parent=i.parent,wt.apply(this,arguments),this.isVisible=function(){return n},this.setVisible=function(t){c[(n=t)?"showOverlays":"hideOverlays"](),c.connector&&c.connector.canvas&&(c.connector.canvas.style.display=t?"block":"none")},this.source=Rt(i.source),this.target=Rt(i.target),i.sourceEndpoint&&(this.source=i.sourceEndpoint.endpointWillMoveTo||i.sourceEndpoint.getElement()),i.targetEndpoint&&(this.target=i.targetEndpoint.getElement()),c.previousConnection=i.previousConnection,i.cost),o=(c.getCost=function(){return e},!(c.setCost=function(t){e=t})!==i.bidirectional),u=(c.isBidirectional=function(){return o},this.sourceId=It(this.source,"id"),this.targetId=It(this.target,"id"),this.getAttachedElements=function(){return c.endpoints},this.scope=i.scope,this.endpoints=[],this.endpointStyles=[],function(t,n){if(t)return O.makeAnchor(t,n,O)}),r=t(i.sourceEndpoint,0,i,c.source,c.sourceId,i.paintStyle,i.hoverPaintStyle);r&&H(A,this.sourceId,r);function s(t){c.setHover(t,!1)}var a=t(c.sourceId==c.targetId&&null==i.targetEndpoint?r:i.targetEndpoint,1,i,c.target,c.targetId,i.paintStyle,i.hoverPaintStyle),l=(a&&H(A,this.targetId,a),this.scope||(this.scope=this.endpoints[0].scope),i.deleteEndpointsOnDetach&&(c.endpointsToDeleteOnDetach=[r,a]),O.Defaults.ConnectionsDetachable),r=(!1===i.detachable&&(l=!1),!1===c.endpoints[0].connectionsDetachable&&(l=!1),!1===c.endpoints[1].connectionsDetachable&&(l=!1),null==e&&(e=c.endpoints[0].getConnectionCost()),null==i.bidirectional&&(o=c.endpoints[0].areConnectionsBidirectional()),this.isDetachable=function(){return!0===l},this.setDetachable=function(t){l=!0===t},Kt.extend({},this.endpoints[0].getParameters())),h=(Kt.extend(r,this.endpoints[1].getParameters()),Kt.extend(r,c.getParameters()),c.setParameters(r),c.setHover),a=(c.setHover=function(t){c.connector.setHover.apply(c.connector,arguments),h.apply(c,arguments)},this.setConnector=function(t,n){null!=c.connector&&V(c.connector.getDisplayElements(),c.parent);var e={_jsPlumb:c._jsPlumb,parent:i.parent,cssClass:i.cssClass,container:i.container,tooltip:c.tooltip};zt(t)?this.connector=new Kt.Connectors[F][t](e):Wt(t)&&(this.connector=new Kt.Connectors[F][t[0]](Kt.extend(t[1],e))),c.canvas=c.connector.canvas,kt(c.connector,c,s),n||c.repaint()},c.setConnector(this.endpoints[0].connector||this.endpoints[1].connector||i.connector||O.Defaults.Connector||Kt.Defaults.Connector,!0),this.setPaintStyle(this.endpoints[0].connectorStyle||this.endpoints[1].connectorStyle||i.paintStyle||O.Defaults.PaintStyle||Kt.Defaults.PaintStyle,!0),this.setHoverPaintStyle(this.endpoints[0].connectorHoverStyle||this.endpoints[1].connectorHoverStyle||i.hoverPaintStyle||O.Defaults.HoverPaintStyle||Kt.Defaults.HoverPaintStyle,!0),this.paintStyleInUse=this.getPaintStyle(),this.moveParent=function(t){var n=Kt.CurrentLibrary,e=n.getParent(c.connector.canvas);c.connector.bgCanvas&&(n.removeElement(c.connector.bgCanvas,e),n.appendElement(c.connector.bgCanvas,t)),n.removeElement(c.connector.canvas,e),n.appendElement(c.connector.canvas,t);for(var i=0;i<c.overlays.length;i++)c.overlays[i].isAppendedAtTopLevel&&(n.removeElement(c.overlays[i].canvas,e),n.appendElement(c.overlays[i].canvas,t),c.overlays[i].reattachListeners)&&c.overlays[i].reattachListeners(c.connector);c.connector.reattachListeners&&c.connector.reattachListeners()},W({elId:this.sourceId}),W({elId:this.targetId}),k[this.sourceId]),r=T[this.sourceId],d=k[this.targetId],p=T[this.targetId],f=qt(),m=this.endpoints[0].anchor.compute({xy:[a.left,a.top],wh:r,element:this.endpoints[0],elementId:this.endpoints[0].elementId,txy:[d.left,d.top],twh:p,tElement:this.endpoints[1],timestamp:f});this.endpoints[0].paint({anchorLoc:m,timestamp:f}),m=this.endpoints[1].anchor.compute({xy:[d.left,d.top],wh:p,element:this.endpoints[1],elementId:this.endpoints[1].elementId,txy:[a.left,a.top],twh:r,tElement:this.endpoints[0],timestamp:f}),this.endpoints[1].paint({anchorLoc:m,timestamp:f}),this.paint=function(t){for(var n=(t=t||{}).elId,e=t.ui,i=t.recalc,t=t.timestamp,o=this.targetId,n=(this.sourceId,W({elId:n,offset:e,recalc:i,timestamp:t})),e=W({elId:o,timestamp:t}),i=this.endpoints[0],o=this.endpoints[1],t=i.anchor.getCurrentLocation(i),i=o.anchor.getCurrentLocation(o),r=0,s=0;s<c.overlays.length;s++)(l=c.overlays[s]).isVisible()&&(r=Math.max(r,l.computeMaxSize(c.connector)));var a=this.connector.compute(t,i,this.endpoints[0],this.endpoints[1],this.endpoints[0].anchor,this.endpoints[1].anchor,c.paintStyleInUse.lineWidth,r,n,e);c.connector.paint(a,c.paintStyleInUse);for(var l,s=0;s<c.overlays.length;s++)(l=c.overlays[s]).isVisible&&(c.overlayPlacements[s]=l.draw(c.connector,c.paintStyleInUse,a))},this.repaint=function(t){var n=!(!1===(t=t||{}).recalc);this.paint({elId:this.sourceId,recalc:n,timestamp:t.timestamp})}}),xt=function(e){var i=!1;return{drag:function(){if(i)return!(i=!1);var t=Kt.CurrentLibrary.getUIPosition(arguments),n=e.element;n&&(Kt.CurrentLibrary.setOffset(n,t),l(Rt(n),t))},stopDrag:function(){i=!0}}},St=function(t,n,e,i,o){n=new dt({reference:n,referenceCanvas:i});return N({paintStyle:t,endpoint:e,anchor:n,source:o,scope:"__floating"})},Dt=function(t,n){var e=document.createElement("div"),i=(e.style.position="absolute",Rt(e)),e=(Y(e,n),z(i));W({elId:e}),t.id=e,t.element=i},Lt=function(s){var o,r,a,l,c,u,t,n,e,i,h,d,p=this,f=(p.idPrefix="_jsplumb_e_",p.defaultLabelLocation=[.5,.5],p.defaultOverlayKeys=["Overlays","EndpointOverlays"],this.parent=s.parent,wt.apply(this,arguments),!0),m=!(!1===(s=s||{}).enabled),g=(this.isVisible=function(){return f},this.setVisible=function(t,n,e){if(f=t,p.canvas&&(p.canvas.style.display=t?"block":"none"),p[t?"showOverlays":"hideOverlays"](),!n)for(var i,o=0;o<p.connections.length;o++)p.connections[o].setVisible(t),e||(i=p===p.connections[o].endpoints[0]?1:0,1==p.connections[o].endpoints[i].connections.length&&p.connections[o].endpoints[i].setVisible(t,!0,!0))},this.isEnabled=function(){return m},this.setEnabled=function(t){m=t},s.source),v=s.uuid,y=null,b=null,P=(v&&(w[v]=p),It(g,"id")),C=(this.elementId=P,this.element=g,s.connectionCost),j=(this.getConnectionCost=function(){return C},!(this.setConnectionCost=function(t){C=t})!==s.connectionsBidirectional),E=(this.areConnectionsBidirectional=function(){return j},this.setConnectionsBidirectional=function(t){j=t},p.anchor=s.anchor?O.makeAnchor(s.anchor,P,O):s.anchors?O.makeAnchor(s.anchors,P,O):O.makeAnchor("TopCenter",P,O),s._transient||O.anchorManager.add(p,P),null),x=(this.setEndpoint=function(t){var n={_jsPlumb:p._jsPlumb,parent:s.parent,container:s.container,tooltip:s.tooltip,connectorTooltip:s.connectorTooltip,endpoint:p},e=(E=zt(t)?new Kt.Endpoints[F][t](n):Wt(t)?(n=Kt.extend(t[1],n),new Kt.Endpoints[F][t[0]](n)):t.clone(),Kt.extend({},n));E.clone=function(){var t=new Object;return E.constructor.apply(t,[e]),t},p.endpoint=E,p.type=p.endpoint.type},this.setEndpoint(s.endpoint||O.Defaults.Endpoint||Kt.Defaults.Endpoint||"Dot"),p.setHover),S=(p.setHover=function(){p.endpoint.setHover.apply(p.endpoint,arguments),x.apply(p,arguments)},kt(p.endpoint,p,function(t){0<p.connections.length?p.connections[0].setHover(t,!1):p.setHover(t)}),this.setPaintStyle(s.paintStyle||s.style||O.Defaults.EndpointStyle||Kt.Defaults.EndpointStyle,!0),this.setHoverPaintStyle(s.hoverPaintStyle||O.Defaults.EndpointHoverStyle||Kt.Defaults.EndpointHoverStyle,!0),this.paintStyleInUse=this.getPaintStyle(),this.getPaintStyle()),D=(this.connectorStyle=s.connectorStyle,this.connectorHoverStyle=s.connectorHoverStyle,this.connectorOverlays=s.connectorOverlays,this.connector=s.connector,this.connectorTooltip=s.connectorTooltip,this.isSource=s.isSource||!1,this.isTarget=s.isTarget||!1,s.maxConnections||O.Defaults.MaxConnections),L=(this.getAttachedElements=function(){return p.connections},this.canvas=this.endpoint.canvas,this.connections=s.connections||[],this.scope=s.scope||U,this.timestamp=null,p.isReattach=s.reattach||!1,p.connectionsDetachable=O.Defaults.ConnectionsDetachable,!1!==s.connectionsDetachable&&!1!==s.detachable||(p.connectionsDetachable=!1),s.dragAllowedWhenFull||!0),I=(this.computeAnchor=function(t){return p.anchor.compute(t)},this.addConnection=function(t){p.connections.push(t)},this.detach=function(n,t,e,i,o){var r=Ft(p.connections,function(t){return t.id==n.id}),s=!1;if(i=!1!==i,0<=r&&(e||n._forceDetach||n.isDetachable()||n.isDetachAllowed(n))){var a=n.endpoints[0]==p?n.endpoints[1]:n.endpoints[0];if(e||n._forceDetach||p.isDetachAllowed(n)){if(p.connections.splice(r,1),!t&&(a.detach(n,!0,e),n.endpointsToDeleteOnDetach))for(var l=0;l<n.endpointsToDeleteOnDetach.length;l++){var c=n.endpointsToDeleteOnDetach[l];c&&0==c.connections.length&&O.deleteEndpoint(c)}V(n.connector.getDisplayElements(),n.parent),Nt(M[n.scope],function(t){return t.id==n.id});s=!0;it(n,!t&&i,o)}}return s},this.detachAll=function(t,n){for(;0<p.connections.length;)p.detach(p.connections[0],!1,!0,t,n)},this.detachFrom=function(t,n,e){for(var i=[],o=0;o<p.connections.length;o++)p.connections[o].endpoints[1]!=t&&p.connections[o].endpoints[0]!=t||i.push(p.connections[o]);for(o=0;o<i.length;o++)p.detach(i[o],!1,!0,n,e)&&i[o].setHover(!1,!1)},this.detachFromConnection=function(n){var t=Ft(p.connections,function(t){return t.id==n.id});0<=t&&p.connections.splice(t,1)},this.getElement=function(){return g},this.setElement=function(t,n){var e=z(t),i=(Nt(A[p.elementId],function(t){return t.id==p.id}),g=Rt(t),P=z(g),p.elementId=P,$({source:e,container:n})),t=u.getParent(p.canvas);u.removeElement(p.canvas,t),u.appendElement(p.canvas,i);for(var o=0;o<p.connections.length;o++)p.connections[o].moveParent(i),p.connections[o].sourceId=P,p.connections[o].source=g;H(A,e,p)},this.getUuid=function(){return v},this.makeInPlaceCopy=function(){var t=p.anchor.getCurrentLocation(p),n=p.anchor.getOrientation(p);return N({anchor:{compute:function(){return[t[0],t[1]]},getCurrentLocation:function(){return[t[0],t[1]]},getOrientation:function(){return n}},source:g,paintStyle:this.getPaintStyle(),endpoint:E,_transient:!0,scope:p.scope})},this.isConnectedTo=function(t){var n=!1;if(t)for(var e=0;e<p.connections.length;e++)if(p.connections[e].endpoints[1]==t){n=!0;break}return n},this.isFloating=function(){return null!=y},this.connectorSelector=function(){var t=p.connections[0];return(!p.isTarget||!t)&&(p.connections.length<D||-1==D)?null:t},this.isFull=function(){return!(p.isFloating()||D<1||p.connections.length<D)},this.setDragAllowedWhenFull=function(t){L=t},this.setStyle=p.setPaintStyle,this.equals=function(t){return this.anchor.equals(t.anchor)},this.paint=function(t){var n=(t=t||{}).timestamp,e=!(!1===t.recalc);if(!n||p.timestamp!==n){W({elId:P,timestamp:n,recalc:e});var i=t.offset||k[P];if(i){var o,r,s=t.anchorPoint,a=t.connectorPaintStyle,l=(null==s&&(o=t.dimensions||T[P],null!=i&&null!=o||(W({elId:P,timestamp:n}),i=k[P],o=T[P]),i={xy:[i.left,i.top],wh:o,element:p,timestamp:n},e&&p.anchor.isDynamic&&0<p.connections.length&&(t=0==(e=(o=function(t){var n=0;if(null!=t)for(var e=0;e<p.connections.length;e++)if(p.connections[e].sourceId==t||p.connections[e].targetId==t){n=e;break}return p.connections[n]}(t.elementWithPrecedence)).endpoints[0]==p?1:0)?o.sourceId:o.targetId,r=k[t],t=T[t],i.txy=[r.left,r.top],i.twh=t,i.tElement=o.endpoints[e]),s=p.anchor.compute(i)),E.compute(s,p.anchor.getOrientation(p),p.paintStyleInUse,a||p.paintStyleInUse));E.paint(l,p.paintStyleInUse,p.anchor),p.timestamp=n;for(var c=0;c<p.overlays.length;c++){var u=p.overlays[c];u.isVisible&&(p.overlayPlacements[c]=u.draw(p.endpoint,p.paintStyleInUse,l))}}}},this.repaint=this.paint,this.removeConnection=this.detach,Kt.CurrentLibrary.isDragSupported(g)&&(a=!(o={id:null,element:null}),l=r=null,c=xt(o),u=Kt.CurrentLibrary,h=s.dragOptions||{},t=Kt.extend({},u.defaultDragOptions),n=u.dragEvents.start,e=u.dragEvents.stop,i=u.dragEvents.drag,(h=Kt.extend(t,h)).scope=h.scope||p.scope,h[n]=B(h[n],function(){r=p.connectorSelector();var t=!0;if(p.isEnabled()||(t=!1),null!=r||s.isSource||(t=!1),s.isSource&&p.isFull()&&!L&&(t=!1),!1===(t=null==r||r.isDetachable()?t:!1))return Kt.CurrentLibrary.stopDrag&&Kt.CurrentLibrary.stopDrag(),c.stopDrag(),!1;r&&!p.isFull()&&s.isSource&&(r=null),W({elId:P}),(b=p.makeInPlaceCopy()).paint(),Dt(o,p.parent);var n,e,i,t=Rt(b.canvas),t=Kt.CurrentLibrary.getOffset(t),t=ut([t.left,t.top],b.canvas);Kt.CurrentLibrary.setOffset(o.element,{left:t[0],top:t[1]}),p.parentAnchor&&(p.anchor=O.makeAnchor(p.parentAnchor,p.elementId,O)),Ot(Rt(p.canvas),"dragId",o.id),Ot(Rt(p.canvas),"elId",P),s.proxy&&p.setPaintStyle(s.proxy.paintStyle),y=St(p.getPaintStyle(),p.anchor,E,p.canvas,o.element),null==r?(p.anchor.locked=!0,p.setHover(!1,!1),r=Z({sourceEndpoint:p,targetEndpoint:y,source:p.endpointWillMoveTo||Rt(g),target:o.element,anchors:[p.anchor,y.anchor],paintStyle:s.connectorStyle,hoverPaintStyle:s.connectorHoverStyle,connector:s.connector,overlays:s.connectorOverlays})):(a=!0,r.connector.setHover(!1,!1),I(Rt(b.canvas),!1,!0),t=r.endpoints[0].id==p.id?0:1,r.floatingAnchorIndex=t,p.detachFromConnection(r),n=Rt(p.canvas),e=Kt.CurrentLibrary.getDragScope(n),Ot(n,"originalScope",e),i=Kt.CurrentLibrary.getDropScope(n),Kt.CurrentLibrary.setDragScope(n,i),0==t?(l=[r.source,r.sourceId,d,e],r.source=o.element,r.sourceId=o.id):(l=[r.target,r.targetId,d,e],r.target=o.element,r.targetId=o.id),r.endpoints[0==t?1:0].anchor.locked=!0,r.suspendedEndpoint=r.endpoints[t],r.suspendedEndpoint.setHover(!1),r.endpoints[t]=y,ot(r)),_[o.id]=r,y.addConnection(r),H(A,o.id,y),O.currentlyDragging=!0}),h[i]=B(h[i],c.drag),h[e]=B(h[e],function(){var t=u.getDropEvent(arguments),n=(O.currentlyDragging=!1,Nt(A[o.id],function(t){return t.id==y.id}),V([o.element[0],y.canvas],g),nt(b.canvas,g),O.anchorManager.clearFor(o.id),null==r.floatingAnchorIndex?1:r.floatingAnchorIndex);r.endpoints[0==n?1:0].anchor.locked=!1,p.setPaintStyle(S),r.endpoints[n]==y&&(a&&r.suspendedEndpoint?(0==n?(r.source=l[0],r.sourceId=l[1]):(r.target=l[0],r.targetId=l[1]),Kt.CurrentLibrary.setDragScope(l[2],l[3]),r.endpoints[n]=r.suspendedEndpoint,!p.isReattach&&!r._forceDetach&&r.endpoints[0==n?1:0].detach(r,!1,!1,!0,t)||(r.setHover(!1),r.floatingAnchorIndex=null,r.suspendedEndpoint.addConnection(r),O.repaint(l[1])),r._forceDetach=null):(V(r.connector.getDisplayElements(),p.parent),p.detachFromConnection(r))),p.anchor.locked=!1,p.paint({recalc:!1}),r.setHover(!1,!1),rt(r),b=r=null,delete A[y.elementId],y.anchor=null,y=null,O.currentlyDragging=!1}),d=Rt(p.canvas),Kt.CurrentLibrary.initDraggable(d,h,!0)),function(t,n,e,l){var i,o,r;(s.isTarget||n)&&Kt.CurrentLibrary.isDropSupported(g)&&(n=s.dropOptions||O.Defaults.DropOptions||Kt.Defaults.DropOptions,(n=Kt.extend({},n)).scope=n.scope||p.scope,i=Kt.CurrentLibrary.dragEvents.drop,o=Kt.CurrentLibrary.dragEvents.over,r=Kt.CurrentLibrary.dragEvents.out,n[i]=B(n[i],function(){var t=Kt.CurrentLibrary.getDropEvent(arguments),n=Rt(Kt.CurrentLibrary.getDragObject(arguments)),e=It(n,"dragId"),i=(It(n,"elId"),It(n,"originalScope")),o=_[e];if(null!=o){var r=null==o.floatingAnchorIndex?1:o.floatingAnchorIndex,n=(i&&Kt.CurrentLibrary.setDragScope(n,i),null==l||l.isEnabled());if(!p.isFull()&&(0!=r||p.isSource)&&(1!=r||p.isTarget)&&n){i=!0;if(o.suspendedEndpoint&&o.suspendedEndpoint.id!=p.id&&(0==r?(o.source=o.suspendedEndpoint.element,o.sourceId=o.suspendedEndpoint.elementId):(o.target=o.suspendedEndpoint.element,o.targetId=o.suspendedEndpoint.elementId),o.isDetachAllowed(o)&&o.endpoints[r].isDetachAllowed(o)&&o.suspendedEndpoint.isDetachAllowed(o)&&O.checkCondition("beforeDetach",o)||(i=!1)),0==r?(o.source=p.element,o.sourceId=p.elementId):(o.target=p.element,o.targetId=p.elementId),i=i&&p.isDropAllowed(o.sourceId,o.targetId,o.scope,o,p)){o.endpoints[r].detachFromConnection(o),o.suspendedEndpoint&&o.suspendedEndpoint.detachFromConnection(o),(o.endpoints[r]=p).addConnection(o);var s,a=p.getParameters();for(s in a)o.setParameter(s,a[s]);o.suspendedEndpoint?(n=o.suspendedEndpoint.getElement(),i=o.suspendedEndpoint.elementId,it({source:0==r?n:o.source,target:1==r?n:o.target,sourceId:0==r?i:o.sourceId,targetId:1==r?i:o.targetId,sourceEndpoint:0==r?o.suspendedEndpoint:o.endpoints[0],targetEndpoint:1==r?o.suspendedEndpoint:o.endpoints[1],connection:o},!0,t)):a.draggable&&Kt.CurrentLibrary.initDraggable(p.element,h,!0),J(o,null,t)}else o.suspendedEndpoint&&(o.endpoints[r]=o.suspendedEndpoint,o.setHover(!1),o._forceDetach=!0,0==r?(o.source=o.suspendedEndpoint.element,o.sourceId=o.suspendedEndpoint.elementId):(o.target=o.suspendedEndpoint.element,o.targetId=o.suspendedEndpoint.elementId),o.suspendedEndpoint.addConnection(o),o.endpoints[0].repaint(),o.repaint(),O.repaint(o.source.elementId),o._forceDetach=!1);o.floatingAnchorIndex=null}O.currentlyDragging=!1,delete _[e]}}),n[o]=B(n[o],function(){var t,n;p.isTarget&&(t=Kt.CurrentLibrary.getDragObject(arguments),t=It(Rt(t),"dragId"),null!=(t=_[t]))&&(n=null==t.floatingAnchorIndex?1:t.floatingAnchorIndex,t.endpoints[n].anchor.over(p.anchor))}),n[r]=B(n[r],function(){var t,n;p.isTarget&&(t=Kt.CurrentLibrary.getDragObject(arguments),t=It(Rt(t),"dragId"),null!=(t=_[t]))&&(n=null==t.floatingAnchorIndex?1:t.floatingAnchorIndex,t.endpoints[n].anchor.out())}),Kt.CurrentLibrary.initDroppable(t,n,!0,e))});return I(Rt(p.canvas),!0,!(s._transient||p.anchor.isFloating),p),p}}function t(e,i,o,r,s,a){return function(t){var n=(t=t||{}).jsPlumbInstance.makeAnchor([e,i,o,r,0,0],t.elementId,t.jsPlumbInstance);return n.type=s,a&&a(n,t),n}}var _t=!!document.createElement("canvas").getContext,Tt=!!window.SVGAngle||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),Ut=function(){var t,n;return null==Ut.vml&&((t=document.body.appendChild(document.createElement("div"))).innerHTML='<v:shape id="vml_flag1" adj="1" />',(n=t.firstChild).style.behavior="url(#default#VML)",Ut.vml=!n||"object"==typeof n.adj,t.parentNode.removeChild(t)),Ut.vml},Ft=jsPlumbUtil.findWithFunction,Ht=jsPlumbUtil.indexOf,Nt=jsPlumbUtil.removeWithFunction,Vt=(jsPlumbUtil.remove,jsPlumbUtil.addWithFunction),Wt=(jsPlumbUtil.addToList,jsPlumbUtil.isArray),zt=jsPlumbUtil.isString,Bt=jsPlumbUtil.isObject,Rt=(window.console||(window.console={time:function(){},timeEnd:function(){},group:function(){},groupEnd:function(){},log:function(){}}),function(t){return Kt.CurrentLibrary.getElementObject(t)}),Gt=jsPlumbUtil.log,qt=(jsPlumbUtil.group,jsPlumbUtil.groupEnd,jsPlumbUtil.time,jsPlumbUtil.timeEnd,function(){return""+(new Date).getTime()}),Yt=function(t){function e(){var t;a&&l&&(Kt.extend(t={},a),Kt.extend(t,l),delete s.hoverPaintStyle,t.gradient&&a.fillStyle&&delete t.gradient,l=t)}var s=this,n=arguments,i=!1,o=t.parameters||{},r=s.idPrefix+(new Date).getTime(),a=null,l=null,c=(s._jsPlumb=t._jsPlumb,s.getId=function(){return r},s.tooltip=t.tooltip,s.hoverClass=t.hoverClass||s._jsPlumb.Defaults.HoverClass||Kt.Defaults.HoverClass,jsPlumbUtil.EventGenerator.apply(this),this.clone=function(){var t=new Object;return s.constructor.apply(t,n),t},this.getParameter=function(t){return o[t]},this.getParameters=function(){return o},this.setParameter=function(t,n){o[t]=n},this.setParameters=function(t){o=t},this.overlayPlacements=[],t.beforeDetach),u=(this.isDetachAllowed=function(t){var n=s._jsPlumb.checkCondition("beforeDetach",t);if(c)try{n=c(t)}catch(t){Gt("jsPlumb: beforeDetach callback failed",t)}return n},t.beforeDrop),h=(this.isDropAllowed=function(t,n,e,i,o){var r=s._jsPlumb.checkCondition("beforeDrop",{sourceId:t,targetId:n,scope:e,connection:i,dropEndpoint:o});if(u)try{r=u({sourceId:t,targetId:n,scope:e,connection:i,dropEndpoint:o})}catch(t){Gt("jsPlumb: beforeDrop callback failed",t)}return r},this.setPaintStyle=function(t,n){a=t,s.paintStyleInUse=a,e(),n||s.repaint()},this.getPaintStyle=function(){return a},this.setHoverPaintStyle=function(t,n){l=t,e(),n||s.repaint()},this.getHoverPaintStyle=function(){return l},this.setHover=function(t,n,e){s._jsPlumb.currentlyDragging||s._jsPlumb.isHoverSuspended()||(i=t,null!=s.hoverClass&&null!=s.canvas&&(t?h.addClass(s.canvas,s.hoverClass):h.removeClass(s.canvas,s.hoverClass)),null!=l&&(s.paintStyleInUse=t?l:a,e=e||qt(),s.repaint({timestamp:e,recalc:!1})),s.getAttachedElements&&!n&&f(t,qt(),s))},this.isHover=function(){return i},Kt.CurrentLibrary),d=["click","dblclick","mouseenter","mouseout","mousemove","mousedown","mouseup","contextmenu"],p={mouseout:"mouseexit"},f=(this.attachListeners=function(t,n){for(var e=0;e<d.length;e++)!function(t,n,e){var i=p[e]||e;h.bind(t,e,function(t){n.fire(i,n,t)})}(t,n,d[e])},function(t,n,e){var i=s.getAttachedElements();if(i)for(var o=0;o<i.length;o++)e&&e==i[o]||i[o].setHover(t,!0,n)});this.reattachListenersForElement=function(t){if(1<arguments.length){for(var n=0;n<d.length;n++){var e=t,i=d[n];p[i],h.unbind(e,i)}for(n=1;n<arguments.length;n++)s.attachListeners(t,arguments[n])}}},Xt=0,Kt=window.jsPlumb=new n;Kt.getInstance=function(t){t=new n(t);return t.init(),t};Kt.Anchors.TopCenter=t(.5,0,0,-1,"TopCenter"),Kt.Anchors.BottomCenter=t(.5,1,0,1,"BottomCenter"),Kt.Anchors.LeftMiddle=t(0,.5,-1,0,"LeftMiddle"),Kt.Anchors.RightMiddle=t(1,.5,1,0,"RightMiddle"),Kt.Anchors.Center=t(.5,.5,0,0,"Center"),Kt.Anchors.TopRight=t(1,0,0,-1,"TopRight"),Kt.Anchors.BottomRight=t(1,1,0,1,"BottomRight"),Kt.Anchors.TopLeft=t(0,0,0,-1,"TopLeft"),Kt.Anchors.BottomLeft=t(0,1,0,1,"BottomLeft"),Kt.Defaults.DynamicAnchors=function(t){return t.jsPlumbInstance.makeAnchors(["TopCenter","RightMiddle","BottomCenter","LeftMiddle"],t.elementId,t.jsPlumbInstance)},Kt.Anchors.AutoDefault=function(t){t=t.jsPlumbInstance.makeDynamicAnchor(Kt.Defaults.DynamicAnchors(t));return t.type="AutoDefault",t},Kt.Anchors.Assign=t(0,0,0,0,"Assign",function(t,n){var e=n.position||"Fixed";t.positionFinder=e.constructor==String?n.jsPlumbInstance.AnchorPositionFinders[e]:e,t.constructorParams=n}),Kt.Anchors.Continuous=function(t){return t.jsPlumbInstance.continuousAnchorFactory.get(t)},Kt.AnchorPositionFinders={Fixed:function(t,n,e,i){return[(t.left-n.left)/e[0],(t.top-n.top)/e[1]]},Grid:function(t,n,e,i){var o=t.left-n.left,t=t.top-n.top,n=e[0]/i.grid[0],i=e[1]/i.grid[1],o=Math.floor(o/n),t=Math.floor(t/i);return[(o*n+n/2)/e[0],(t*i+i/2)/e[1]]}}}(),function(){jsPlumb.DOMElementComponent=function(t){jsPlumb.jsPlumbUIComponent.apply(this,arguments),this.mousemove=this.dblclick=this.click=this.mousedown=this.mouseup=function(t){}},jsPlumb.Connectors.Straight=function(){this.type="Straight";var f,m,g,v,y,b,P,C,j,E,i=this;this.compute=function(t,n,e,i,o,r,s,a){var l=Math.abs(t[0]-n[0]),c=Math.abs(t[1]-n[1]),u=.45*l,h=.45*c,d=(l*=1.9,c*=1.9,Math.min(t[0],n[0])-u),p=Math.min(t[1],n[1])-h,s=Math.max(2*s,a);return l<s&&(d=t[0]+(n[0]-t[0])/2-(l=s)/2,u=(l-Math.abs(t[0]-n[0]))/2),c<s&&(p=t[1]+(n[1]-t[1])/2-(c=s)/2,h=(c-Math.abs(t[1]-n[1]))/2),b=t[0]<n[0]?u:l-u,P=t[1]<n[1]?h:c-h,C=t[0]<n[0]?l-u:u,j=t[1]<n[1]?c-h:h,f=[d,p,l,c,b,P,C,j],v=C-b,y=j-P,m=jsPlumbUtil.gradient({x:b,y:P},{x:C,y:j}),g=-1/m,Math.atan(m),Math.atan(g),E=Math.sqrt(v*v+y*y),f},this.pointOnPath=function(t,n){return 0!=t||n?1!=t||n?(n=n?0<t?t:E+t:t*E,jsPlumbUtil.pointOnLine({x:b,y:P},{x:C,y:j},n)):{x:C,y:j}:{x:b,y:P}},this.gradientAtPoint=function(t){return m},this.pointAlongPathFrom=function(t,n,e){e=i.pointOnPath(t,e),t=1==t?{x:b+10*(C-b),y:P+10*(P-j)}:{x:C,y:j};return jsPlumbUtil.pointOnLine(e,t,n)}},jsPlumb.Connectors.Bezier=function(t){function o(){return[{x:p,y:f},{x:c[0],y:c[1]},{x:u[0],y:u[1]},{x:h,y:d}]}function r(t,n,e){return n=e?jsBezier.locationAlongCurveFrom(t,0<n?0:1,n):n}var c,u,h,d,p,f,m,g,v,y,b=this;this.majorAnchor=(t=t||{}).curviness||150,this.minorAnchor=10,this.type="Bezier",this._findControlPoint=function(t,n,e,i,o,r,s){var r=r.getOrientation(i),i=s.getOrientation(o),s=r[0]!=i[0]||r[1]==i[1],o=[],a=b.majorAnchor,l=b.minorAnchor;return s?(0==i[0]?o.push(e[0]<n[0]?t[0]+l:t[0]-l):o.push(t[0]+a*i[0]),0==i[1]?o.push(e[1]<n[1]?t[1]+l:t[1]-l):o.push(t[1]+a*r[1])):(0==r[0]?o.push(n[0]<e[0]?t[0]+l:t[0]-l):o.push(t[0]-a*r[0]),0==r[1]?o.push(n[1]<e[1]?t[1]+l:t[1]-l):o.push(t[1]+a*i[1])),o},this.compute=function(t,n,e,i,o,r,s,a){s=s||0,v=Math.abs(t[0]-n[0])+s,y=Math.abs(t[1]-n[1])+s,m=Math.min(t[0],n[0])-s/2,g=Math.min(t[1],n[1])-s/2,p=t[0]<n[0]?v-s/2:s/2,f=t[1]<n[1]?y-s/2:s/2,h=t[0]<n[0]?s/2:v-s/2,d=t[1]<n[1]?s/2:y-s/2,c=b._findControlPoint([p,f],t,n,e,i,o,r),u=b._findControlPoint([h,d],n,t,i,e,r,o);var l,s=Math.min(p,h),n=Math.min(c[0],u[0]),t=Math.min(s,n),i=Math.max(p,h),e=Math.max(c[0],u[0]),r=Math.max(i,e),s=(v<r&&(v=r),t<0&&(m+=t,o=Math.abs(t),v+=o,c[0]+=o,p+=o,h+=o,u[0]+=o),Math.min(f,d)),n=Math.min(c[1],u[1]),i=Math.min(s,n),e=Math.max(f,d),r=Math.max(c[1],u[1]),t=Math.max(e,r);return y<t&&(y=t),i<0&&(g+=i,o=Math.abs(i),y+=o,c[1]+=o,f+=o,d+=o,u[1]+=o),a&&v<a&&(l=(a-v)/2,v=a,m-=l,p+=l,h+=l,c[0]=c[0]+l,u[0]=u[0]+l),a&&y<a&&(l=(a-y)/2,y=a,g-=l,f+=l,d+=l,c[1]=c[1]+l,u[1]=u[1]+l),[m,g,v,y,p,f,h,d,c[0],c[1],u[0],u[1]]};this.pointOnPath=function(t,n){var e=o();return t=r(e,t,n),jsBezier.pointOnCurve(e,t)},this.gradientAtPoint=function(t,n){var e=o();return t=r(e,t,n),jsBezier.gradientAtPoint(e,t)},this.pointAlongPathFrom=function(t,n,e){var i=o();return t=r(i,t,e),jsBezier.pointAlongCurveFrom(i,t,n)}},jsPlumb.Connectors.Flowchart=function(t){this.type="Flowchart";function N(t,n,e,i,o,r){var e=0==G.length?e:G[G.length-1][0],i=0==G.length?i:G[G.length-1][1],s=t==e?1/0:0,a=Math.abs(t==e?n-i:t-e);G.push([t,n,e,i,s,a]),q+=a,Q=Math.max(Q,t),Z=Math.max(Z,n),J=Math.min(J,t),$=Math.min($,n)}function s(t,n){n&&(t=0<t?t/q:(q+t)/q);for(var e=Y.length-1,i=1,o=0;o<Y.length;o++)if(Y[o][1]>=t){i=(t-Y[e=o][0])/X[o];break}return{segment:G[e],proportion:i,index:e}}var V,W,e=this,n=(t=t||{}).stub||t.minStubLength||30,z=jsPlumbUtil.isArray(n)?n[0]:n,B=jsPlumbUtil.isArray(n)?n[1]:n,R=t.gap||0,G=[],q=0,Y=[],X=[],K=[],Q=-1/0,Z=-1/0,J=1/0,$=1/0;this.compute=function(t,n,e,i,o,r,s,a,l,U){G=[],Y=[],X=[],Q=Z=-1/(q=0),J=$=1/0,V=n[0]<t[0],W=n[1]<t[1];var c,u=s||1,h=u/2+(z+B),d=u/2+(B+z),p=u/2+(z+B),u=u/2+(B+z),f=o.orientation||o.getOrientation(e),m=r.orientation||r.getOrientation(i),r=(V?n:t)[0],g=(W?n:t)[1],v=Math.abs(n[0]-t[0])+h+d,y=Math.abs(n[1]-t[1])+p+u,b=((0==f[0]&&0==f[1]||0==m[0]&&0==m[1])&&(c=[1,0][O=y<v?0:1],m=[],(f=[])[O]=t[O]>n[O]?-1:1,m[O]=t[O]>n[O]?1:-1,f[c]=0,m[c]=0),v<a&&(h+=(a-v)/2,v=a),y<a&&(p+=(a-y)/2,y=a),V?v-d+R*f[0]:h+R*f[0]),P=W?y-u+R*f[1]:p+R*f[1],C=V?h+R*m[0]:v-d+R*m[0],j=W?p+R*m[1]:y-u+R*m[1],E=b+f[0]*z,x=P+f[1]*z,S=C+m[0]*B,D=j+m[1]*B,F=Math.abs(b-C)>z+B,H=Math.abs(P-j)>z+B,L=E+(S-E)/2,I=x+(D-x)/2,t=f[0]*m[0]+f[1]*m[1],n=(K=[r-=h,g-=p,v,y,b,P,C,j],0==f[0]?"y":"x"),O=-1==t?"opposite":1==t?"orthogonal":"perpendicular",M=jsPlumbUtil.segment([b,P],[C,j]),A=(-1==f["x"==n?0:1]&&(M={x:[null,4,3,2,1],y:[null,2,1,4,3]}[n][M]),N(E,x,b,P),{oppositex:function(){var t;return e.elementId==i.elementId?(t=x+(1-o.y)*l.height+Math.max(z,B),[[E,t],[S,t]]):!F||1!=M&&2!=M?[[E,I],[S,I]]:[[L,P],[L,j]]},orthogonalx:function(){return 1==M||2==M?[[S,x]]:[[E,D]]},perpendicularx:function(){var t=(j+P)/2;return 1==M&&1==m[1]||2==M&&-1==m[1]?Math.abs(C-b)>Math.max(z,B)?[[S,x]]:[[E,x],[E,t],[S,t]]:3==M&&-1==m[1]||4==M&&1==m[1]?[[E,t],[S,t]]:3==M&&1==m[1]||4==M&&-1==m[1]?[[E,D]]:1==M&&-1==m[1]||2==M&&1==m[1]?Math.abs(C-b)>Math.max(z,B)?[[L,x],[L,D]]:[[E,D]]:void 0},oppositey:function(){var t;return e.elementId==i.elementId?[[t=E+(1-o.x)*l.width+Math.max(z,B),x],[t,D]]:!H||2!=M&&3!=M?[[L,x],[L,D]]:[[b,I],[C,I]]},orthogonaly:function(){return 2==M||3==M?[[E,D]]:[[S,x]]},perpendiculary:function(){var t;return 2==M&&-1==m[0]||3==M&&1==m[0]?Math.abs(C-b)>Math.max(z,B)?[[E,D]]:[[E,I],[S,I]]:1==M&&-1==m[0]||4==M&&1==m[0]?[[t=(C+b)/2,x],[t,D]]:1==M&&1==m[0]||4==M&&-1==m[0]?[[S,x]]:2==M&&1==m[0]||3==M&&-1==m[0]?Math.abs(j-P)>Math.max(z,B)?[[E,I],[S,I]]:[[S,x]]:void 0}}[O+n]());if(A)for(var w=0;w<A.length;w++)N(A[w][0],A[w][1],b,P);N(S,D,b,P),N(C,j,b,P),K.push(G.length);for(var k=0;k<G.length;k++)K.push(G[k][0]),K.push(G[k][1]);for(var _=0,T=0;T<G.length;T++)X[T]=G[T][5]/q,Y[T]=[_,_+=G[T][5]/q];return Z>K[3]&&(K[3]=Z+2*s),Q>K[2]&&(K[2]=Q+2*s),K},this.pointOnPath=function(t,n){return e.pointAlongPathFrom(t,0,n)},this.gradientAtPoint=function(t,n){return G[s(t,n).index][4]},this.pointAlongPathFrom=function(t,n,e){var t=s(t,e),e=t.segment,i=t.proportion,o=G[t.index][5],r=G[t.index][4];return{x:r==1/0?e[2]:e[2]>e[0]?e[0]+(1-i)*o-n:e[2]+i*o+n,y:0==r?e[3]:e[3]>e[1]?e[1]+(1-i)*o-n:e[3]+i*o+n,segmentInfo:t}}},jsPlumb.Endpoints.Dot=function(t){this.type="Dot";var o=this;this.radius=(t=t||{}).radius||10,this.defaultOffset=.5*this.radius,this.defaultInnerRadius=this.radius/3,this.compute=function(t,n,e,i){e=e.radius||o.radius;return[t[0]-e,t[1]-e,2*e,2*e,e]}},jsPlumb.Endpoints.Rectangle=function(t){this.type="Rectangle";var r=this;this.width=(t=t||{}).width||20,this.height=t.height||20,this.compute=function(t,n,e,i){var o=e.width||r.width,e=e.height||r.height;return[t[0]-o/2,t[1]-e/2,o,e]}};function o(t){jsPlumb.DOMElementComponent.apply(this,arguments);var n=[];this.getDisplayElements=function(){return n},this.appendDisplayElement=function(t){n.push(t)}}function l(t){var n=!0,e=this;this.isAppendedAtTopLevel=!0,this.component=t.component,this.loc=null==t.location?.5:t.location,this.endpointLoc=null==t.endpointLocation?[.5,.5]:t.endpointLocation,this.setVisible=function(t){n=t,e.component.repaint()},this.isVisible=function(){return n},this.hide=function(){e.setVisible(!1)},this.show=function(){e.setVisible(!0)},this.incrementLocation=function(t){e.loc+=t,e.component.repaint()},this.setLocation=function(t){e.loc=t,e.component.repaint()},this.getLocation=function(){return e.loc}}jsPlumb.Endpoints.Image=function(t){this.type="Image",o.apply(this,arguments);var r=this,s=!1,a=t.width,l=t.height,e=null,n=t.endpoint,n=(this.img=new Image,r.ready=!1,this.img.onload=function(){r.ready=!0,a=a||r.img.width,l=l||r.img.height,e&&e(r)},n.setImage=function(t,n){t.constructor!=String&&t.src;e=n,r.img.src=t,null!=r.canvas&&r.canvas.setAttribute("src",t)},n.setImage(t.src||t.url,t.onload),this.compute=function(t,n,e,i){return r.anchorPoint=t,r.ready?[t[0]-a/2,t[1]-l/2,a,l]:[0,0,0,0]},r.canvas=document.createElement("img"),s=!1,r.canvas.style.margin=0,r.canvas.style.padding=0,r.canvas.style.outline=0,r.canvas.style.position="absolute",t.cssClass?" "+t.cssClass:"");r.canvas.className=jsPlumb.endpointClass+n,a&&r.canvas.setAttribute("width",a),l&&r.canvas.setAttribute("height",l),jsPlumb.appendElement(r.canvas,t.parent),r.attachListeners(r.canvas,r);this.paint=function(t,n,e){var i,o;r.ready?(s||(r.canvas.setAttribute("src",r.img.src),r.appendDisplayElement(r.canvas),s=!0),i=r.anchorPoint[0]-a/2,o=r.anchorPoint[1]-l/2,jsPlumb.sizeCanvas(r.canvas,i,o,a,l)):window.setTimeout(function(){r.paint(t,n,e)},200)}},jsPlumb.Endpoints.Blank=function(t){var i=this;this.type="Blank",o.apply(this,arguments),this.compute=function(t,n,e,i){return[t[0],t[1],10,0]},i.canvas=document.createElement("div"),i.canvas.style.display="block",i.canvas.style.width="1px",i.canvas.style.height="1px",i.canvas.style.background="transparent",i.canvas.style.position="absolute",i.canvas.className=i._jsPlumb.endpointClass,jsPlumb.appendElement(i.canvas,t.parent),this.paint=function(t,n,e){jsPlumb.sizeCanvas(i.canvas,t[0],t[1],t[2],t[3])}},jsPlumb.Endpoints.Triangle=function(t){this.type="Triangle",(t=t||{}).width=t.width||55,t.height=t.height||55,this.width=t.width,this.height=t.height,this.compute=function(t,n,e,i){var o=e.width||self.width,e=e.height||self.height;return[t[0]-o/2,t[1]-e/2,o,e]}};jsPlumb.Overlays.Arrow=function(t){this.type="Arrow",l.apply(this,arguments),this.isAppendedAtTopLevel=!1;var d=this,p=(this.length=(t=t||{}).length||20,this.width=t.width||20,this.id=t.id,(t.direction||1)<0?-1:1),f=t.paintStyle||{lineWidth:1},m=t.foldback||.623;this.computeMaxSize=function(){return 1.5*d.width},this.cleanup=function(){},this.draw=function(t,n,e){var i,o,r,s,a,l,c,u,h;return t.pointAlongPathFrom?(jsPlumbUtil.isString(d.loc)||1<d.loc||d.loc<0?(o=parseInt(d.loc),i=t.pointAlongPathFrom(o,p*d.length/2,!0),o=t.pointOnPath(o,!0),r=jsPlumbUtil.pointOnLine(i,o,d.length)):1==d.loc?(i=t.pointOnPath(d.loc),o=t.pointAlongPathFrom(d.loc,-1),r=jsPlumbUtil.pointOnLine(i,o,d.length)):0==d.loc?(r=t.pointOnPath(d.loc),o=t.pointAlongPathFrom(d.loc,1),i=jsPlumbUtil.pointOnLine(r,o,d.length)):(i=t.pointAlongPathFrom(d.loc,p*d.length/2),o=t.pointOnPath(d.loc),r=jsPlumbUtil.pointOnLine(i,o,d.length)),o=jsPlumbUtil.perpendicularLineTo(i,r,d.width),r=jsPlumbUtil.pointOnLine(i,r,m*d.length),s=Math.min(i.x,o[0].x,o[1].x),a=Math.max(i.x,o[0].x,o[1].x),l=Math.min(i.y,o[0].y,o[1].y),c=Math.max(i.y,o[0].y,o[1].y),u=f.strokeStyle||n.strokeStyle,h=f.fillStyle||n.strokeStyle,n=f.lineWidth||n.lineWidth,d.paint(t,{hxy:i,tail:o,cxy:r},n,u,h,e),[s,a,l,c]):[0,0,0,0]}},jsPlumb.Overlays.PlainArrow=function(t){t=t||{};t=jsPlumb.extend(t,{foldback:1});jsPlumb.Overlays.Arrow.call(this,t),this.type="PlainArrow"},jsPlumb.Overlays.Diamond=function(t){var n=(t=t||{}).length||40,t=jsPlumb.extend(t,{length:n/2,foldback:2});jsPlumb.Overlays.Arrow.call(this,t),this.type="Diamond"},jsPlumb.Overlays.Label=function(t){this.type="Label",jsPlumb.DOMElementComponent.apply(this,arguments),l.apply(this,arguments),this.labelStyle=t.labelStyle||jsPlumb.Defaults.LabelStyle,this.id=t.id,this.cachedDimensions=null;var n=t.label||"",a=this,i=!1,o=document.createElement("div"),e=null,r=(o.style.position="absolute",t._jsPlumb.overlayClass+" "+(a.labelStyle.cssClass||t.cssClass||"")),s=(o.className=r,jsPlumb.appendElement(o,t.component.parent),jsPlumb.getId(o),a.attachListeners(o,a),a.canvas=o,a.setVisible);a.setVisible=function(t){s(t),o.style.display=t?"block":"none"},this.getElement=function(){return o},this.cleanup=function(){null!=o&&jsPlumb.CurrentLibrary.removeElement(o)},this.setLabel=function(t){n=t,e=null,a.component.repaint()},this.getLabel=function(){return n},this.paint=function(t,n,e){i||(t.appendDisplayElement(o),a.attachListeners(o,t),i=!0),o.style.left=e[0]+n.minx+"px",o.style.top=e[1]+n.miny+"px"},this.getTextDimensions=function(){"function"==typeof n?(t=n(a),o.innerHTML=t.replace(/\r\n/g,"<br/>")):null==e&&(e=n,o.innerHTML=e.replace(/\r\n/g,"<br/>"));var t=jsPlumb.CurrentLibrary.getElementObject(o),t=jsPlumb.CurrentLibrary.getSize(t);return{width:t[0],height:t[1]}},this.computeMaxSize=function(t){t=a.getTextDimensions(t);return t.width?1.5*Math.max(t.width,t.height):0},this.draw=function(t,n,e){var i,o,r,s=a.getTextDimensions(t);return null!=s.width?(r={x:0,y:0},r=t.pointOnPath?(o=a.loc,i=!1,(jsPlumbUtil.isString(a.loc)||a.loc<0||1<a.loc)&&(o=parseInt(a.loc),i=!0),t.pointOnPath(o,i)):{x:(o=a.loc.constructor==Array?a.loc:a.endpointLoc)[0]*e[2],y:o[1]*e[3]},minx=r.x-s.width/2,miny=r.y-s.height/2,a.paint(t,{minx:minx,miny:miny,td:s,cxy:r},e),[minx,minx+s.width,miny,miny+s.height]):[0,0,0,0]},this.reattachListeners=function(t){o&&a.reattachListenersForElement(o,a,t)}},jsPlumb.Overlays.GuideLines=function(){var a=this;a.length=50,a.lineWidth=5,this.type="GuideLines",l.apply(this,arguments),jsPlumb.jsPlumbUIComponent.apply(this,arguments),this.draw=function(t,n,e){var i=t.pointAlongPathFrom(a.loc,a.length/2),o=t.pointOnPath(a.loc),o=jsPlumbUtil.pointOnLine(i,o,a.length),r=jsPlumbUtil.perpendicularLineTo(i,o,40),s=jsPlumbUtil.perpendicularLineTo(o,i,20);return a.paint(t,[i,o,r,s],a.lineWidth,"red",null,e),[Math.min(i.x,o.x),Math.min(i.y,o.y),Math.max(i.x,o.x),Math.max(i.y,o.y)]},this.computeMaxSize=function(){return 50},this.cleanup=function(){}}}(),jsPlumb.Connectors.StateMachine=function(t){function o(){return[{x:b,y:P},{x:j[0],y:j[1]},{x:j[0]+1,y:j[1]+1},{x:v,y:y}]}function r(t,n,e){return n=e?jsBezier.locationAlongCurveFrom(t,0<n?0:1,n):n}var v,y,b,P,C=null,j=[],E=t.curviness||10,x=t.margin||5,S=t.proximityLimit||80,D=t.orientation&&"clockwise"==t.orientation,L=t.loopbackRadius||25,I=!1,O=!1!==t.showLoopback;this.type="StateMachine",t=t||{},this.compute=function(t,n,e,i,o,r,s,a){var l,c,u,h=Math.abs(t[0]-n[0]),d=Math.abs(t[1]-n[1]),p=.45*h,f=.45*d,m=(h*=1.9,d*=1.9,s=s||1,Math.min(t[0],n[0])-p),g=Math.min(t[1],n[1])-f;return C=O&&e.elementId==i.elementId?(I=!0,e=t[0],i=t[0],u=t[1]-x,c=t[1]-x,[m=e-L-s-L,g=(l=u-L)-L-s-L,h=2*s+4*L,d=2*s+4*L,e-m,l-g,L,D,e-m,u-g,i-m,c-g]):(I=!1,v=t[0]<n[0]?p:h-p,y=t[1]<n[1]?f:d-f,b=t[0]<n[0]?h-p:p,P=t[1]<n[1]?d-f:f,0==t[2]&&(v-=x),1==t[2]&&(v+=x),0==t[3]&&(y-=x),1==t[3]&&(y+=x),0==n[2]&&(b-=x),1==n[2]&&(b+=x),0==n[3]&&(P-=x),1==n[3]&&(P+=x),u=-1*(l=(v+b)/2)/(e=(y+P)/2),i=Math.atan(u),u==1/0||u==-1/0||Math.abs(E/2*Math.sin(i)),u==1/0||u==-1/0||Math.abs(E/2*Math.cos(i)),c=y,p=P,i=(f=v)<=(u=b)&&p<=c?1:f<=u&&c<=p?2:u<=f&&c<=p?3:4,u=Math.sqrt(Math.pow(b-v,2)+Math.pow(P-y,2)),f=l,c=e,p=i,l=t,e=n,t=i=E,j=u<=S?[f,c]:1==p?l[3]<=0&&1<=e[3]?[f+(l[2]<.5?-1*i:i),c]:1<=l[2]&&e[2]<=0?[f,c+(l[3]<.5?-1*t:t)]:[f+-1*i,c+-1*t]:2==p?1<=l[3]&&e[3]<=0?[f+(l[2]<.5?-1*i:i),c]:1<=l[2]&&e[2]<=0?[f,c+(l[3]<.5?-1*t:t)]:[f+ +i,c+-1*t]:3==p?1<=l[3]&&e[3]<=0?[f+(l[2]<.5?-1*i:i),c]:l[2]<=0&&1<=e[2]?[f,c+(l[3]<.5?-1*t:t)]:[f+-1*i,c+-1*t]:4==p?l[3]<=0&&1<=e[3]?[f+(l[2]<.5?-1*i:i),c]:l[2]<=0&&1<=e[2]?[f,c+(l[3]<.5?-1*t:t)]:[f+ +i,c+-1*t]:void 0,n=Math.max(3*Math.abs(j[0]-v),3*Math.abs(j[0]-b),Math.abs(b-v),2*s,a),u=Math.max(3*Math.abs(j[1]-y),3*Math.abs(j[1]-P),Math.abs(P-y),2*s,a),h<n&&(m-=(p=n-h)/2,v+=p/2,b+=p/2,h=n,j[0]+=p/2),d<u&&(g-=(e=u-d)/2,y+=e/2,P+=e/2,d=u,j[1]+=e/2),[m,g,h,d,v,y,b,P,j[0],j[1]])};this.pointOnPath=function(t,n){var e;return I?(n&&(t/=2*Math.PI*L),e=2*(t=0<t&&t<1?1-t:t)*Math.PI+Math.PI/2,{x:C[4]+C[6]*Math.cos(e),y:C[5]+C[6]*Math.sin(e)}):(e=o(),t=r(e,t,n),jsBezier.pointOnCurve(e,t))},this.gradientAtPoint=function(t,n){var e;return I?(n&&(t/=2*Math.PI*L),Math.atan(2*t*Math.PI)):(e=o(),t=r(e,t,n),jsBezier.gradientAtPoint(e,t))},this.pointAlongPathFrom=function(t,n,e){var i;return I?(e&&(t/=2*Math.PI*L),0<t&&t<1&&(t=1-t),i=n/(2*Math.PI*C[6])*2*Math.PI,i=2*t*Math.PI-i+Math.PI/2,{x:C[4]+C[6]*Math.cos(i),y:C[5]+C[6]*Math.sin(i)}):(i=o(),t=r(i,t,e),jsBezier.pointAlongCurveFrom(i,t,n))}},jsPlumb.Connectors.canvas.StateMachine=function(t){var i=this;t=t||{},t.avoidSelector;jsPlumb.Connectors.StateMachine.apply(this,arguments),jsPlumb.CanvasConnector.apply(this,arguments),this._paint=function(t){var n,e;10==t.length?(i.ctx.beginPath(),i.ctx.moveTo(t[4],t[5]),i.ctx.bezierCurveTo(t[8],t[9],t[8],t[9],t[6],t[7]),i.ctx.stroke()):(i.ctx.save(),i.ctx.beginPath(),n=2*Math.PI,e=t[7],i.ctx.arc(t[4],t[5],t[6],0,n,e),i.ctx.stroke(),i.ctx.closePath(),i.ctx.restore())},this.createGradient=function(t,n){return n.createLinearGradient(t[4],t[5],t[6],t[7])}},jsPlumb.Connectors.svg.StateMachine=function(){jsPlumb.Connectors.StateMachine.apply(this,arguments),jsPlumb.SvgConnector.apply(this,arguments),this.getPath=function(t){return 10==t.length?"M "+t[4]+" "+t[5]+" C "+t[8]+" "+t[9]+" "+t[8]+" "+t[9]+" "+t[6]+" "+t[7]:"M"+(t[8]+4)+" "+t[9]+" A "+t[6]+" "+t[6]+" 0 1,0 "+(t[8]-4)+" "+t[9]}},jsPlumb.Connectors.vml.StateMachine=function(){jsPlumb.Connectors.StateMachine.apply(this,arguments),jsPlumb.VmlConnector.apply(this,arguments);var i=jsPlumb.vml.convertValue;this.getPath=function(t){var n,e;return 10==t.length?"m"+i(t[4])+","+i(t[5])+" c"+i(t[8])+","+i(t[9])+","+i(t[8])+","+i(t[9])+","+i(t[6])+","+i(t[7])+" e":"ar "+((n=i(t[8]-t[6]))+","+(e=i(t[9]-2*t[6]))+","+(n+i(2*t[6]))+","+(e+i(2*t[6])))+","+i(t[8])+","+i(t[9])+","+i(t[8])+","+i(t[9])+" e"}},function(){var u={"stroke-linejoin":"joinstyle",joinstyle:"joinstyle",endcap:"endcap",miterlimit:"miterlimit"},t=null;if(document.createStyleSheet&&document.namespaces){for(var n=[".jsplumb_vml","jsplumb\\:textbox","jsplumb\\:oval","jsplumb\\:rect","jsplumb\\:stroke","jsplumb\\:shape","jsplumb\\:group"],t=document.createStyleSheet(),e=0;e<n.length;e++)t.addRule(n[e],"behavior:url(#default#VML);position:absolute;");document.namespaces.add("jsplumb","urn:schemas-microsoft-com:vml")}jsPlumb.vml={};function h(t,n,e,i,o){return e=e||{},t=document.createElement("jsplumb:"+t),o.appendElement(t,i),t.className=(e.class?e.class+" ":"")+"jsplumb_vml",g(t,n),m(t,e),t}function d(t,n,e,i){"transparent"===n?i.setOpacity(e,"0.0"):i.setOpacity(e,"1.0")}function p(t,n,e,i){var o,r={};if(n.strokeStyle?(r.stroked="true",o=jsPlumbUtil.convertStyle(n.strokeStyle,!0),d(0,r.strokecolor=o,"stroke",e),r.strokeweight=n.lineWidth+"px"):r.stroked="false",n.fillStyle?(r.filled="true",o=jsPlumbUtil.convertStyle(n.fillStyle,!0),d(0,r.fillcolor=o,"fill",e)):r.filled="false",n.dashstyle)null==e.strokeNode?e.strokeNode=h("stroke",[0,0,0,0],{dashstyle:n.dashstyle},t,i):e.strokeNode.dashstyle=n.dashstyle;else if(n["stroke-dasharray"]&&n.lineWidth){for(var s=-1==n["stroke-dasharray"].indexOf(",")?" ":",",a=n["stroke-dasharray"].split(s),l="",c=0;c<a.length;c++)l+=Math.floor(a[c]/n.lineWidth)+s;null==e.strokeNode?e.strokeNode=h("stroke",[0,0,0,0],{dashstyle:l},t,i):e.strokeNode.dashstyle=l}m(t,r)}function i(){var e=this,i=(jsPlumb.jsPlumbUIComponent.apply(this,arguments),this.opacityNodes={stroke:null,fill:null},this.initOpacityNodes=function(t){e.opacityNodes.stroke=h("stroke",[0,0,1,1],{opacity:"0.0"},t,e._jsPlumb),e.opacityNodes.fill=h("fill",[0,0,1,1],{opacity:"0.0"},t,e._jsPlumb)},this.setOpacity=function(t,n){t=e.opacityNodes[t];t&&(t.opacity=""+n)},[]);this.getDisplayElements=function(){return i},this.appendDisplayElement=function(t,n){n||e.canvas.parentNode.appendChild(t),i.push(t)}}function o(t,n){t.apply(this,n),i.apply(this,n);var l=this;l.canvas=null,l.isAppendedAtTopLevel=!0,this.paint=function(t,n,e,i,o,r){var s={},i=(i&&(s.stroked="true",s.strokecolor=jsPlumbUtil.convertStyle(i,!0)),e&&(s.strokeweight=e+"px"),o&&(s.filled="true",s.fillcolor=o),Math.min(n.hxy.x,n.tail[0].x,n.tail[1].x,n.cxy.x)),e=Math.min(n.hxy.y,n.tail[0].y,n.tail[1].y,n.cxy.y),o=Math.max(n.hxy.x,n.tail[0].x,n.tail[1].x,n.cxy.x),a=Math.max(n.hxy.y,n.tail[0].y,n.tail[1].y,n.cxy.y),o=[i,e,Math.abs(o-i),Math.abs(a-e)];s.path="m "+c((i=n).hxy.x)+","+c(i.hxy.y)+" l "+c(i.tail[0].x)+","+c(i.tail[0].y)+" "+c(i.cxy.x)+","+c(i.cxy.y)+" "+c(i.tail[1].x)+","+c(i.tail[1].y)+" x e",s.coordsize=r[2]*f+","+r[3]*f,o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],null==l.canvas?(l.canvas=h("shape",o,s,t.canvas.parentNode,t._jsPlumb),t.appendDisplayElement(l.canvas,!0),l.attachListeners(l.canvas,t),l.attachListeners(l.canvas,l)):(g(l.canvas,o),m(l.canvas,s))},this.reattachListeners=function(){l.canvas&&l.reattachListenersForElement(l.canvas,l)},this.cleanup=function(){null!=l.canvas&&jsPlumb.CurrentLibrary.removeElement(l.canvas)}}var f=1e3,m=function(t,n){for(var e in n)t[e]=n[e]},g=function(t,n){t.style.left=n[0]+"px",t.style.top=n[1]+"px",t.style.width=n[2]+"px",t.style.height=n[3]+"px",t.style.position="absolute"},c=jsPlumb.vml.convertValue=function(t){return Math.floor(t*f)},r=jsPlumb.VmlConnector=function(a){var l=this,c=(l.strokeNode=null,l.canvas=null,i.apply(this,arguments),l._jsPlumb.connectorClass+(a.cssClass?" "+a.cssClass:""));this.paint=function(t,n,e){if(null!=n){var i={path:l.getPath(t)};if(n.outlineColor){var o,r=n.outlineWidth||1,r=n.lineWidth+2*r,s={strokeStyle:jsPlumbUtil.convertStyle(n.outlineColor),lineWidth:r};for(o in u)s[o]=n[o];null==l.bgCanvas?(i.class=c,i.coordsize=t[2]*f+","+t[3]*f,l.bgCanvas=h("shape",t,i,a.parent,l._jsPlumb),g(l.bgCanvas,t),l.appendDisplayElement(l.bgCanvas,!0),l.attachListeners(l.bgCanvas,l),l.initOpacityNodes(l.bgCanvas,["stroke"])):(i.coordsize=t[2]*f+","+t[3]*f,g(l.bgCanvas,t),m(l.bgCanvas,i)),p(l.bgCanvas,s,l)}null==l.canvas?(i.class=c,i.coordsize=t[2]*f+","+t[3]*f,l.tooltip&&(i.label=l.tooltip),l.canvas=h("shape",t,i,a.parent,l._jsPlumb),l.appendDisplayElement(l.canvas,!0),l.attachListeners(l.canvas,l),l.initOpacityNodes(l.canvas,["stroke"])):(i.coordsize=t[2]*f+","+t[3]*f,g(l.canvas,t),m(l.canvas,i)),p(l.canvas,n,l,l._jsPlumb)}},this.reattachListeners=function(){l.canvas&&l.reattachListenersForElement(l.canvas,l)}},s=window.VmlEndpoint=function(t){i.apply(this,arguments);var o=null,r=this,s=(r.canvas=document.createElement("div"),r.canvas.style.position="absolute",r._jsPlumb.endpointClass+(t.cssClass?" "+t.cssClass:""));t._jsPlumb.appendElement(r.canvas,t.parent),r.tooltip&&r.canvas.setAttribute("label",r.tooltip),this.paint=function(t,n,e){var i={};jsPlumb.sizeCanvas(r.canvas,t[0],t[1],t[2],t[3]),null==o?(i.class=s,o=r.getVml([0,0,t[2],t[3]],i,e,r.canvas,r._jsPlumb),r.attachListeners(o,r),r.appendDisplayElement(o,!0),r.appendDisplayElement(r.canvas,!0),r.initOpacityNodes(o,["fill"])):(g(o,[0,0,t[2],t[3]]),m(o,i)),p(o,n,r)},this.reattachListeners=function(){o&&r.reattachListenersForElement(o,r)}};jsPlumb.Connectors.vml.Bezier=function(){jsPlumb.Connectors.Bezier.apply(this,arguments),r.apply(this,arguments),this.getPath=function(t){return"m"+c(t[4])+","+c(t[5])+" c"+c(t[8])+","+c(t[9])+","+c(t[10])+","+c(t[11])+","+c(t[6])+","+c(t[7])+" e"}},jsPlumb.Connectors.vml.Straight=function(){jsPlumb.Connectors.Straight.apply(this,arguments),r.apply(this,arguments),this.getPath=function(t){return"m"+c(t[4])+","+c(t[5])+" l"+c(t[6])+","+c(t[7])+" e"}},jsPlumb.Connectors.vml.Flowchart=function(){jsPlumb.Connectors.Flowchart.apply(this,arguments),r.apply(this,arguments),this.getPath=function(t){for(var n="m "+c(t[4])+","+c(t[5])+" l",e=0;e<t[8];e++)n=n+" "+c(t[9+2*e])+","+c(t[10+2*e]);return n=n+" "+c(t[6])+","+c(t[7])+" e"}},jsPlumb.Endpoints.vml.Dot=function(){jsPlumb.Endpoints.Dot.apply(this,arguments),s.apply(this,arguments),this.getVml=function(t,n,e,i,o){return h("oval",t,n,i,o)}},jsPlumb.Endpoints.vml.Rectangle=function(){jsPlumb.Endpoints.Rectangle.apply(this,arguments),s.apply(this,arguments),this.getVml=function(t,n,e,i,o){return h("rect",t,n,i,o)}},jsPlumb.Endpoints.vml.Image=jsPlumb.Endpoints.Image,jsPlumb.Endpoints.vml.Blank=jsPlumb.Endpoints.Blank,jsPlumb.Overlays.vml.Label=jsPlumb.Overlays.Label;jsPlumb.Overlays.vml.Arrow=function(){o.apply(this,[jsPlumb.Overlays.Arrow,arguments])},jsPlumb.Overlays.vml.PlainArrow=function(){o.apply(this,[jsPlumb.Overlays.PlainArrow,arguments])},jsPlumb.Overlays.vml.Diamond=function(){o.apply(this,[jsPlumb.Overlays.Diamond,arguments])}}(),function(){function u(t,n){for(var e in n)t.setAttribute(e,""+n[e])}function a(t){return"position:absolute;left:"+t[0]+"px;top:"+t[1]+"px"}function s(t,n,e,i,o){if(e.gradient){var r,s=t,a=n,l=e,c=i,i=x+(i=o)._jsPlumb.idstamp();D(s),r=l.gradient.offset?S(b,{id:i}):S(y,{id:i,gradientUnits:"userSpaceOnUse"}),s.appendChild(r);for(var u=0;u<l.gradient.stops.length;u++){var h=u,h=8==c.length?c[4]<c[6]?u:l.gradient.stops.length-1-u:c[4]<c[6]?l.gradient.stops.length-1-u:u,h=jsPlumbUtil.convertStyle(l.gradient.stops[h][1],!0),h=S(C,{offset:Math.floor(100*l.gradient.stops[u][0])+"%","stop-color":h});r.appendChild(h)}s=l.strokeStyle?j:P,a.setAttribute(E,s+":url(#"+i+")")}else D(t),n.setAttribute(E,"");var d,p,f;for(f in n.setAttribute(P,e.fillStyle?jsPlumbUtil.convertStyle(e.fillStyle,!0):"none"),n.setAttribute(j,e.strokeStyle?jsPlumbUtil.convertStyle(e.strokeStyle,!0):"none"),e.lineWidth&&n.setAttribute("stroke-width",e.lineWidth),e[v]&&e.lineWidth&&!e[g]?(d=-1==e[v].indexOf(",")?" ":",",o=e[v].split(d),p="",o.forEach(function(t){p+=Math.floor(t*e.lineWidth)+d}),n.setAttribute(g,p)):e[g]&&n.setAttribute(g,e[g]),m)e[f]&&n.setAttribute(m[f],e[f])}function e(t,n,e){for(var i,o=e.split(" "),r=t.className.baseVal.split(" "),s=0;s<o.length;s++)n?-1==r.indexOf(o[s])&&r.push(o[s]):-1!=(i=r.indexOf(o[s]))&&r.splice(i,1);t.className.baseVal=r.join(" ")}function n(r){var s=this,t=r.pointerEventsSpec||"all",n=(jsPlumb.jsPlumbUIComponent.apply(this,r.originalArgs),s.canvas=null,s.path=null,s.svg=null,r.cssClass+" "+(r.originalArgs[0].cssClass||"")),t={style:"",width:0,height:0,"pointer-events":t,position:"absolute"},e=(s.tooltip&&(t.title=s.tooltip),s.svg=S("svg",t),r.useDivWrapper?(s.canvas=document.createElement("div"),s.canvas.style.position="absolute",jsPlumb.sizeCanvas(s.canvas,0,0,1,1),s.canvas.className=n,s.tooltip&&s.canvas.setAttribute("title",s.tooltip)):(u(s.svg,{class:n}),s.canvas=s.svg),r._jsPlumb.appendElement(s.canvas,r.originalArgs[0].parent),r.useDivWrapper&&s.canvas.appendChild(s.svg),[s.canvas]);this.getDisplayElements=function(){return e},this.appendDisplayElement=function(t){e.push(t)},this.paint=function(t,n,e){var i,o;null!=n&&(i=t[0],o=t[1],r.useDivWrapper&&(jsPlumb.sizeCanvas(s.canvas,t[0],t[1],t[2],t[3]),o=i=0),u(s.svg,{style:a([i,o,t[2],t[3]]),width:t[2],height:t[3]}),s._paint.apply(this,arguments))}}function t(t,r){t.apply(this,r),jsPlumb.jsPlumbUIComponent.apply(this,r),this.isAppendedAtTopLevel=!1;var s=this,a=null,l=(this.paint=function(t,n,e,i,o){null==a&&(a=S("path",{"pointer-events":"all"}),t.svg.appendChild(a),s.attachListeners(a,t),s.attachListeners(a,s));t=r&&1==r.length&&r[0].cssClass||"";u(a,{d:l(n),class:t,stroke:i||null,fill:o||null})},function(t){return"M"+t.hxy.x+","+t.hxy.y+" L"+t.tail[0].x+","+t.tail[0].y+" L"+t.cxy.x+","+t.cxy.y+" L"+t.tail[1].x+","+t.tail[1].y+" L"+t.hxy.x+","+t.hxy.y});this.reattachListeners=function(){a&&s.reattachListenersForElement(a,s)},this.cleanup=function(){null!=a&&jsPlumb.CurrentLibrary.removeElement(a)}}var m={joinstyle:"stroke-linejoin","stroke-linejoin":"stroke-linejoin","stroke-dashoffset":"stroke-dashoffset","stroke-linecap":"stroke-linecap"},g="stroke-dasharray",v="dashstyle",y="linearGradient",b="radialGradient",P="fill",C="stop",j="stroke",E="style",x="jsplumb_gradient_",i="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",S=function(t,n){t=document.createElementNS(i,t);return(n=n||{}).version="1.1",n.xmlns=o,u(t,n),t},D=function(t){for(var n=0;n<t.childNodes.length;n++)t.childNodes[n].tagName!=y&&t.childNodes[n].tagName!=b||t.removeChild(t.childNodes[n])},r=(jsPlumbUtil.svg={addClass:function(t,n){e(t,!0,n)},removeClass:function(t,n){e(t,!1,n)},node:S,attr:u,pos:a},jsPlumb.SvgConnector=function(t){var r=this;n.apply(this,[{cssClass:t._jsPlumb.connectorClass,originalArgs:arguments,pointerEventsSpec:"none",tooltip:t.tooltip,_jsPlumb:t._jsPlumb}]),this._paint=function(t,n){var e,i={d:r.getPath(t)},o=null;i["pointer-events"]="all",n.outlineColor&&(e=n.outlineWidth||1,e=n.lineWidth+2*e,(o=jsPlumb.CurrentLibrary.extend({},n)).strokeStyle=jsPlumbUtil.convertStyle(n.outlineColor),o.lineWidth=e,null==r.bgPath?(r.bgPath=S("path",i),r.svg.appendChild(r.bgPath),r.attachListeners(r.bgPath,r)):u(r.bgPath,i),s(r.svg,r.bgPath,o,t,r)),null==r.path?(r.path=S("path",i),r.svg.appendChild(r.path),r.attachListeners(r.path,r)):u(r.path,i),s(r.svg,r.path,n,t,r)},this.reattachListeners=function(){r.bgPath&&r.reattachListenersForElement(r.bgPath,r),r.path&&r.reattachListenersForElement(r.path,r)}}),l=(jsPlumb.Connectors.svg.Bezier=function(t){jsPlumb.Connectors.Bezier.apply(this,arguments),r.apply(this,arguments),this.getPath=function(t){var n="M "+t[4]+" "+t[5];return n+=" C "+t[8]+" "+t[9]+" "+t[10]+" "+t[11]+" "+t[6]+" "+t[7]}},jsPlumb.Connectors.svg.Straight=function(t){jsPlumb.Connectors.Straight.apply(this,arguments),r.apply(this,arguments),this.getPath=function(t){return"M "+t[4]+" "+t[5]+" L "+t[6]+" "+t[7]}},jsPlumb.Connectors.svg.Flowchart=function(){jsPlumb.Connectors.Flowchart.apply(this,arguments),r.apply(this,arguments),this.getPath=function(t){for(var n="M "+t[4]+","+t[5],e=0;e<t[8];e++)n=n+" L "+t[9+2*e]+" "+t[10+2*e];return n=n+" "+t[6]+","+t[7]}},window.SvgEndpoint=function(t){var e=this;n.apply(this,[{cssClass:t._jsPlumb.endpointClass,originalArgs:arguments,pointerEventsSpec:"all",useDivWrapper:!0,_jsPlumb:t._jsPlumb}]),this._paint=function(t,n){n=jsPlumb.extend({},n);n.outlineColor&&(n.strokeWidth=n.outlineWidth,n.strokeStyle=jsPlumbUtil.convertStyle(n.outlineColor,!0)),null==e.node&&(e.node=e.makeNode(t,n),e.svg.appendChild(e.node),e.attachListeners(e.node,e)),s(e.svg,e.node,n,t,e),a(e.node)},this.reattachListeners=function(){e.node&&e.reattachListenersForElement(e.node,e)}});jsPlumb.Endpoints.svg.Dot=function(){jsPlumb.Endpoints.Dot.apply(this,arguments),l.apply(this,arguments),this.makeNode=function(t,n){return S("circle",{cx:t[2]/2,cy:t[3]/2,r:t[2]/2})}},jsPlumb.Endpoints.svg.Rectangle=function(){jsPlumb.Endpoints.Rectangle.apply(this,arguments),l.apply(this,arguments),this.makeNode=function(t,n){return S("rect",{width:t[2],height:t[3]})}},jsPlumb.Endpoints.svg.Image=jsPlumb.Endpoints.Image,jsPlumb.Endpoints.svg.Blank=jsPlumb.Endpoints.Blank,jsPlumb.Overlays.svg.Label=jsPlumb.Overlays.Label;jsPlumb.Overlays.svg.Arrow=function(){t.apply(this,[jsPlumb.Overlays.Arrow,arguments])},jsPlumb.Overlays.svg.PlainArrow=function(){t.apply(this,[jsPlumb.Overlays.PlainArrow,arguments])},jsPlumb.Overlays.svg.Diamond=function(){t.apply(this,[jsPlumb.Overlays.Diamond,arguments])},jsPlumb.Overlays.svg.GuideLines=function(){var r,s,a=null,l=this,c=(jsPlumb.Overlays.GuideLines.apply(this,arguments),this.paint=function(t,n,e,i,o){null==a&&(a=S("path"),t.svg.appendChild(a),l.attachListeners(a,t),l.attachListeners(a,l),r=S("path"),t.svg.appendChild(r),l.attachListeners(r,t),l.attachListeners(r,l),s=S("path"),t.svg.appendChild(s),l.attachListeners(s,t),l.attachListeners(s,l)),u(a,{d:c(n[0],n[1]),stroke:"red",fill:null}),u(r,{d:c(n[2][0],n[2][1]),stroke:"blue",fill:null}),u(s,{d:c(n[3][0],n[3][1]),stroke:"green",fill:null})},function(t,n){return"M "+t.x+","+t.y+" L"+n.x+","+n.y})}}(),function(){function e(){function i(t,n){return null!=t&&l(t,n)}var s=this,o=(s.overlayPlacements=[],jsPlumb.jsPlumbUIComponent.apply(this,arguments),jsPlumbUtil.EventGenerator.apply(this,arguments),!(this._over=function(t){var n=u(c(s.canvas)),t=h(t),e=t[0]-n.left,i=t[1]-n.top;if(0<e&&0<i&&e<s.canvas.width&&i<s.canvas.height){for(var o=0;o<s.overlayPlacements.length;o++){var r=s.overlayPlacements[o];if(r&&r[0]<=e&&r[1]>=e&&r[2]<=i&&r[3]>=i)return!0}t=s.canvas.getContext("2d").getImageData(parseInt(e),parseInt(i),1,1);return 0!=t.data[0]||0!=t.data[1]||0!=t.data[2]||0!=t.data[3]}return!1})),n=!1,e=!1;this.mousemove=function(t){h(t);var n=d(t),n=document.elementFromPoint(n[0],n[1]),e=i(n,"_jsPlumb_overlay"),n=null==r&&(i(n,"_jsPlumb_endpoint")||i(n,"_jsPlumb_connector"));if(!o&&n&&s._over(t))return o=!0,s.fire("mouseenter",s,t),!0;!o||s._over(t)&&n||e||(o=!1,s.fire("mouseexit",s,t)),s.fire("mousemove",s,t)},this.click=function(t){o&&s._over(t)&&!e&&s.fire("click",s,t),e=!1},this.dblclick=function(t){o&&s._over(t)&&!e&&s.fire("dblclick",s,t),e=!1},this.mousedown=function(t){s._over(t)&&!n&&(n=!0,u(c(s.canvas)),s.fire("mousedown",s,t))},this.mouseup=function(t){n=!1,s.fire("mouseup",s,t)},this.contextmenu=function(t){o&&s._over(t)&&!e&&s.fire("contextmenu",s,t),e=!1}}function s(t){var n=document.createElement("canvas");return t._jsPlumb.appendElement(n,t.parent),n.style.position="absolute",t.class&&(n.className=t.class),t._jsPlumb.getId(n,t.uuid),t.tooltip&&n.setAttribute("title",t.tooltip),n}function a(t){e.apply(this,arguments);var n=[];this.getDisplayElements=function(){return n},this.appendDisplayElement=function(t){n.push(t)}}function n(t){var r=this,n=(a.apply(this,arguments),{class:r._jsPlumb.endpointClass+" "+(t.cssClass||""),_jsPlumb:r._jsPlumb,parent:t.parent,tooltip:r.tooltip});r.canvas=s(n),r.ctx=r.canvas.getContext("2d"),r.appendDisplayElement(r.canvas),this.paint=function(t,n,e){var i,o;jsPlumb.sizeCanvas(r.canvas,t[0],t[1],t[2],t[3]),null!=n.outlineColor&&(i=n.outlineWidth||1,o=n.lineWidth+2*i,n.outlineColor),r._paint.apply(this,arguments)}}function t(t,n){t.apply(this,n),function(){jsPlumb.jsPlumbUIComponent.apply(this,arguments)}.apply(this,n),this.paint=function(t,n,e,i,o){t=t.ctx;t.lineWidth=e,t.beginPath(),t.moveTo(n.hxy.x,n.hxy.y),t.lineTo(n.tail[0].x,n.tail[0].y),t.lineTo(n.cxy.x,n.cxy.y),t.lineTo(n.tail[1].x,n.tail[1].y),t.lineTo(n.hxy.x,n.hxy.y),t.closePath(),i&&(t.strokeStyle=i,t.stroke()),o&&(t.fillStyle=o,t.fill())}}var r=null,l=function(t,n){return jsPlumb.CurrentLibrary.hasClass(c(t),n)},c=function(t){return jsPlumb.CurrentLibrary.getElementObject(t)},u=function(t){return jsPlumb.CurrentLibrary.getOffset(c(t))},h=function(t){return jsPlumb.CurrentLibrary.getPageXY(t)},d=function(t){return jsPlumb.CurrentLibrary.getClientXY(t)},o=jsPlumb.CanvasConnector=function(t){a.apply(this,arguments);function i(t,n){if(o.ctx.save(),jsPlumb.extend(o.ctx,n),n.gradient){for(var e=o.createGradient(t,o.ctx),i=0;i<n.gradient.stops.length;i++)e.addColorStop(n.gradient.stops[i][0],n.gradient.stops[i][1]);o.ctx.strokeStyle=e}o._paint(t,n),o.ctx.restore()}var o=this,n=o._jsPlumb.connectorClass+" "+(t.cssClass||"");o.canvas=s({class:n,_jsPlumb:o._jsPlumb,parent:t.parent,tooltip:t.tooltip}),o.ctx=o.canvas.getContext("2d"),o.appendDisplayElement(o.canvas),o.paint=function(t,n){var e;null!=n&&(jsPlumb.sizeCanvas(o.canvas,t[0],t[1],t[2],t[3]),null!=n.outlineColor&&(e=n.outlineWidth||1,e=n.lineWidth+2*e,e={strokeStyle:n.outlineColor,lineWidth:e},i(t,e)),i(t,n))}};jsPlumb.Endpoints.canvas.Dot=function(t){jsPlumb.Endpoints.Dot.apply(this,arguments),n.apply(this,arguments);var c=this,u=function(n){try{return parseInt(n)}catch(t){if("%"==n.substring(n.length-1))return parseInt(n.substring(0,n-1))}};this._paint=function(t,n,e){if(null!=n){var i=c.canvas.getContext("2d"),e=e.getOrientation(c);if(jsPlumb.extend(i,n),n.gradient){r=n.gradient,o=c.defaultOffset,s=c.defaultInnerRadius;for(var o=[o=r.offset?u(r.offset):o,s=r.innerRadius?u(r.innerRadius):s],r=1==e[1]?-1*o[0]:o[0],s=1==e[0]?-1*o[0]:o[0],a=i.createRadialGradient(t[4],t[4],t[4],t[4]+s,t[4]+r,o[1]),l=0;l<n.gradient.stops.length;l++)a.addColorStop(n.gradient.stops[l][0],n.gradient.stops[l][1]);i.fillStyle=a}i.beginPath(),i.arc(t[4],t[4],t[4],0,2*Math.PI,!0),i.closePath(),(n.fillStyle||n.gradient)&&i.fill(),n.strokeStyle&&i.stroke()}var r,o,s}},jsPlumb.Endpoints.canvas.Rectangle=function(t){var c=this;jsPlumb.Endpoints.Rectangle.apply(this,arguments),n.apply(this,arguments),this._paint=function(t,n,e){var i=c.canvas.getContext("2d"),e=e.getOrientation(c);if(jsPlumb.extend(i,n),n.gradient){for(var o=1==e[1]?t[3]:0==e[1]?t[3]/2:0,r=-1==e[1]?t[3]:0==e[1]?t[3]/2:0,s=1==e[0]?t[2]:0==e[0]?t[2]/2:0,e=-1==e[0]?t[2]:0==e[0]?t[2]/2:0,a=i.createLinearGradient(s,o,e,r),l=0;l<n.gradient.stops.length;l++)a.addColorStop(n.gradient.stops[l][0],n.gradient.stops[l][1]);i.fillStyle=a}i.beginPath(),i.rect(0,0,t[2],t[3]),i.closePath(),(n.fillStyle||n.gradient)&&i.fill(),n.strokeStyle&&i.stroke()}},jsPlumb.Endpoints.canvas.Triangle=function(t){var l=this;jsPlumb.Endpoints.Triangle.apply(this,arguments),n.apply(this,arguments),this._paint=function(t,n,e){var i=t[2],o=t[3],t=(t[0],t[1],l.canvas.getContext("2d")),r=0,s=0,a=0,e=e.getOrientation(l);1==e[0]&&(r=i,s=o,a=180),-1==e[1]&&(r=i,a=90),1==e[1]&&(s=o,a=-90),t.fillStyle=n.fillStyle,t.translate(r,s),t.rotate(a*Math.PI/180),t.beginPath(),t.moveTo(0,0),t.lineTo(i/2,o/2),t.lineTo(0,o),t.closePath(),(n.fillStyle||n.gradient)&&t.fill(),n.strokeStyle&&t.stroke()}},jsPlumb.Endpoints.canvas.Image=jsPlumb.Endpoints.Image,jsPlumb.Endpoints.canvas.Blank=jsPlumb.Endpoints.Blank,jsPlumb.Connectors.canvas.Bezier=function(){var i=this;jsPlumb.Connectors.Bezier.apply(this,arguments),o.apply(this,arguments),this._paint=function(t,n){i.ctx.beginPath(),i.ctx.moveTo(t[4],t[5]),i.ctx.bezierCurveTo(t[8],t[9],t[10],t[11],t[6],t[7]),i.ctx.stroke()},this.createGradient=function(t,n,e){return i.ctx.createLinearGradient(t[6],t[7],t[4],t[5])}},jsPlumb.Connectors.canvas.Straight=function(){var p=this,f=[null,[1,-1],[1,1],[-1,1],[-1,-1]];jsPlumb.Connectors.Straight.apply(this,arguments),o.apply(this,arguments),this._paint=function(t,n){if(p.ctx.beginPath(),n.dashstyle&&2==n.dashstyle.split(" ").length){for(var e=n.dashstyle.split(" "),i=[(e=2!=e.length?[2,2]:e)[0]*n.lineWidth,e[1]*n.lineWidth],e=(t[6]-t[4])/(t[7]-t[5]),n=jsPlumbUtil.segment([t[4],t[5]],[t[6],t[7]]),o=f[n],r=Math.atan(e),n=Math.sqrt(Math.pow(t[6]-t[4],2)+Math.pow(t[7]-t[5],2)),s=Math.floor(n/(i[0]+i[1])),a=[t[4],t[5]],l=0;l<s;l++){p.ctx.moveTo(a[0],a[1]);var c=a[0]+Math.abs(Math.sin(r)*i[0])*o[0],u=a[1]+Math.abs(Math.cos(r)*i[0])*o[1],h=a[0]+Math.abs(Math.sin(r)*(i[0]+i[1]))*o[0],d=a[1]+Math.abs(Math.cos(r)*(i[0]+i[1]))*o[1];p.ctx.lineTo(c,u),a=[h,d]}p.ctx.moveTo(a[0],a[1])}else p.ctx.moveTo(t[4],t[5]);p.ctx.lineTo(t[6],t[7]),p.ctx.stroke()},this.createGradient=function(t,n){return n.createLinearGradient(t[4],t[5],t[6],t[7])}},jsPlumb.Connectors.canvas.Flowchart=function(){var i=this;jsPlumb.Connectors.Flowchart.apply(this,arguments),o.apply(this,arguments),this._paint=function(t,n){i.ctx.beginPath(),i.ctx.moveTo(t[4],t[5]);for(var e=0;e<t[8];e++)i.ctx.lineTo(t[9+2*e],t[10+2*e]);i.ctx.lineTo(t[6],t[7]),i.ctx.stroke()},this.createGradient=function(t,n){return n.createLinearGradient(t[4],t[5],t[6],t[7])}},jsPlumb.Overlays.canvas.Label=jsPlumb.Overlays.Label;jsPlumb.Overlays.canvas.Arrow=function(){t.apply(this,[jsPlumb.Overlays.Arrow,arguments])},jsPlumb.Overlays.canvas.PlainArrow=function(){t.apply(this,[jsPlumb.Overlays.PlainArrow,arguments])},jsPlumb.Overlays.canvas.Diamond=function(){t.apply(this,[jsPlumb.Overlays.Diamond,arguments])}}(),function(e){jsPlumb.CurrentLibrary={addClass:function(t,n){t=jsPlumb.CurrentLibrary.getElementObject(t);try{t[0].className.constructor==SVGAnimatedString&&jsPlumb.util.svg.addClass(t[0],n)}catch(t){}t.addClass(n)},animate:function(t,n,e){t.animate(n,e)},appendElement:function(t,n){jsPlumb.CurrentLibrary.getElementObject(n).append(t)},ajax:function(t){(t=t||{}).type=t.type||"get",e.ajax(t)},bind:function(t,n,e){(t=jsPlumb.CurrentLibrary.getElementObject(t)).bind(n,e)},dragEvents:{start:"start",stop:"stop",drag:"drag",step:"step",over:"over",out:"out",drop:"drop",complete:"complete"},extend:function(t,n){return e.extend(t,n)},getAttribute:function(t,n){return t.attr(n)},getClientXY:function(t){return[t.clientX,t.clientY]},getDocumentElement:function(){return document},getDragObject:function(t){return t[1].draggable},getDragScope:function(t){return t.draggable("option","scope")},getDropEvent:function(t){return t[0]},getDropScope:function(t){return t.droppable("option","scope")},getDOMElement:function(t){return"string"==typeof t?document.getElementById(t):t.context?t[0]:t},getElementObject:function(t){return e("string"==typeof t?"#"+t:t)},getOffset:function(t){return t.offset()},getOriginalEvent:function(t){return t.originalEvent},getPageXY:function(t){return[t.pageX,t.pageY]},getParent:function(t){return jsPlumb.CurrentLibrary.getElementObject(t).parent()},getScrollLeft:function(t){return t.scrollLeft()},getScrollTop:function(t){return t.scrollTop()},getSelector:function(t){return e(t)},getSize:function(t){return[t.outerWidth(),t.outerHeight()]},getTagName:function(t){t=jsPlumb.CurrentLibrary.getElementObject(t);return 0<t.length?t[0].tagName:null},getUIPosition:function(t){return ret=1==t.length?{left:t[0].pageX,top:t[0].pageY}:(t=t[1]).offset||t.absolutePosition},hasClass:function(t,n){return t.hasClass(n)},initDraggable:function(t,n,e){(n=n||{}).helper=null,e&&(n.scope=n.scope||jsPlumb.Defaults.Scope),t.draggable(n)},initDroppable:function(t,n){n.scope=n.scope||jsPlumb.Defaults.Scope,t.droppable(n)},isAlreadyDraggable:function(t){return(t=jsPlumb.CurrentLibrary.getElementObject(t)).hasClass("ui-draggable")},isDragSupported:function(t,n){return t.draggable},isDropSupported:function(t,n){return t.droppable},removeClass:function(t,n){t=jsPlumb.CurrentLibrary.getElementObject(t);try{t[0].className.constructor==SVGAnimatedString&&jsPlumb.util.svg.removeClass(t[0],n)}catch(t){}t.removeClass(n)},removeElement:function(t,n){jsPlumb.CurrentLibrary.getElementObject(t).remove()},setAttribute:function(t,n,e){t.attr(n,e)},setDraggable:function(t,n){t.draggable("option","disabled",!n)},setDragScope:function(t,n){t.draggable("option","scope",n)},setOffset:function(t,n){jsPlumb.CurrentLibrary.getElementObject(t).offset(n)},trigger:function(t,n,e){jQuery._data(jsPlumb.CurrentLibrary.getElementObject(t)[0],"handle")(e)},unbind:function(t,n,e){(t=jsPlumb.CurrentLibrary.getElementObject(t)).unbind(n,e)}},e(document).ready(jsPlumb.init)}(jQuery),function(){void 0===Math.sgn&&(Math.sgn=function(t){return 0==t?0:0<t?1:-1});function e(t,n){for(var e=[],i=n.length-1,o=2*i-1,r=[],s=[],a=[],l=[],c=[[1,.6,.3,.1],[.4,.6,.6,.4],[.1,.3,.6,1]],u=0;u<=i;u++)r[u]=d(n[u],t);for(u=0;u<=i-1;u++)s[u]=d(n[u+1],n[u]),s[u]=m(s[u],3);for(u=0;u<=i-1;u++)for(var h=0;h<=i;h++)a[u]||(a[u]=[]),a[u][h]=p(s[u],r[h]);for(u=0;u<=o;u++)l[u]||(l[u]=[]),l[u].y=0,l[u].x=parseFloat(u)/o;for(o=i-1,r=0;r<=i+o;r++)for(u=Math.max(0,r-o),s=Math.min(r,i);u<=s;u++)l[u+(j=r-u)].y=l[u+j].y+a[j][u]*c[j][u];for(i=n.length-1,l=v(l,2*i-1,e,0),o=d(t,n[0]),a=f(o),u=c=0;u<l;u++)o=d(t,y(n,i,e[u],null,null)),(o=f(o))<a&&(a=o,c=e[u]);return o=d(t,n[i]),(o=f(o))<a&&(a=o,c=1),{location:c,distance:a}}function a(t,n){for(var e=s(t.length-1),i=0,o=0,r=0;r<t.length;r++)i+=t[r].x*e[r](n),o+=t[r].y*e[r](n);return{x:i,y:o}}function o(t,n,e){for(var i=a(t,n),o=0,r=0<e?1:-1,s=null;o<Math.abs(e);)s=a(t,n+=.005*r),o+=Math.sqrt(Math.pow(s.x-i.x,2)+Math.pow(s.y-i.y,2)),i=s;return{point:s,location:n}}function r(t,n){var e=a(t,n),n=(t=a(t.slice(0,t.length-1),n)).y-e.y,e=t.x-e.x;return 0==n?1/0:Math.atan(n/e)}var d=function(t,n){return{x:t.x-n.x,y:t.y-n.y}},p=function(t,n){return t.x*n.x+t.y*n.y},f=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},m=function(t,n){return{x:t.x*n,y:t.y*n}},g=Math.pow(2,-65),v=function(t,n,e,i){var o=[],r=[],s=[],a=[],l=0;u=Math.sgn(t[0].y);for(var c=1;c<=n;c++)(h=Math.sgn(t[c].y))!=u&&l++,u=h;switch(l){case 0:return 0;case 1:if(64<=i)return e[0]=(t[0].x+t[n].x)/2,1;for(var l=t[0].y-t[n].y,u=t[n].x-t[0].x,c=t[0].x*t[n].y-t[n].x*t[0].y,h=max_distance_below=0,d=1;d<n;d++){var p=l*t[d].x+u*t[d].y+c;h<p?h=p:p<max_distance_below&&(max_distance_below=p)}if(h=1/(0*(d=u)-+l)*(c-h-0*d),l=1/(0*(d=u)-+l)*(+(u=c-max_distance_below)-0*d),u=Math.min(h,l),Math.max(h,l)-u<g)return s=t[n].x-t[0].x,a=t[n].y-t[0].y,e[0]=0+(s*+t[0].y-a*+t[0].x)*(1/(0*s-+a)),1}for(y(t,n,.5,o,r),t=v(o,n,s,i+1),n=v(r,n,a,i+1),i=0;i<t;i++)e[i]=s[i];for(i=0;i<n;i++)e[i+t]=a[i];return t+n},y=function(t,n,e,i,o){for(var r=[[]],s=0;s<=n;s++)r[0][s]=t[s];for(t=1;t<=n;t++)for(s=0;s<=n-t;s++)r[t]||(r[t]=[]),r[t][s]||(r[t][s]={}),r[t][s].x=(1-e)*r[t-1][s].x+e*r[t-1][s+1].x,r[t][s].y=(1-e)*r[t-1][s].y+e*r[t-1][s+1].y;if(null!=i)for(s=0;s<=n;s++)i[s]=r[s][0];if(null!=o)for(s=0;s<=n;s++)o[s]=r[n-s][s];return r[n][0]},c={},s=function(n){if(!(r=c[n])){function t(t){return function(){return t}}function e(){return function(t){return t}}function i(){return function(t){return 1-t}}function o(i){return function(t){for(var n=1,e=0;e<i.length;e++)n*=i[e](t);return n}}var r;(r=[]).push(new function(){return function(t){return Math.pow(t,n)}});for(var s=1;s<n;s++){for(var a=[new t(n)],l=0;l<n-s;l++)a.push(new e);for(l=0;l<s;l++)a.push(new i);r.push(new o(a))}r.push(new function(){return function(t){return Math.pow(1-t,n)}}),c[n]=r}return r};window.jsBezier={distanceFromCurve:e,gradientAtPoint:r,gradientAtPointAlongCurveFrom:function(t,n,e){return 1<(n=o(t,n,e)).location&&(n.location=1),n.location<0&&(n.location=0),r(t,n.location)},nearestPointOnCurve:function(t,n){t=e(t,n);return{point:y(n,n.length-1,t.location,null,null),location:t.location}},pointOnCurve:a,pointAlongCurveFrom:function(t,n,e){return o(t,n,e).point},perpendicularToCurveAt:function(t,n,e,i){return n=o(t,n,null==i?0:i),t=r(t,n.location),i=Math.atan(-1/t),t=e/2*Math.sin(i),e=e/2*Math.cos(i),[{x:n.point.x+e,y:n.point.y+t},{x:n.point.x-e,y:n.point.y-t}]},locationAlongCurveFrom:function(t,n,e){return o(t,n,e).location}}}();
6
- !function(h,r){function s(t,e){var i,s,n,o=t.nodeName.toLowerCase();return"area"===o?(s=(i=t.parentNode).name,!(!t.href||!s||"map"!==i.nodeName.toLowerCase()||!(n=h("img[usemap=#"+s+"]")[0]))&&a(n)):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"==o&&t.href||e)&&a(t)}function a(t){return!h(t).parents().andSelf().filter(function(){return"hidden"===h.curCSS(this,"visibility")||h.expr.filters.hidden(this)}).length}h.ui=h.ui||{},h.ui.version||(h.extend(h.ui,{version:"1.8.24",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),h.fn.extend({propAttr:h.fn.prop||h.fn.attr,_focus:h.fn.focus,focus:function(e,i){return"number"==typeof e?this.each(function(){var t=this;setTimeout(function(){h(t).focus(),i&&i.call(t)},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var t=(h.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(h.curCSS(this,"position",1))&&/(auto|scroll)/.test(h.curCSS(this,"overflow",1)+h.curCSS(this,"overflow-y",1)+h.curCSS(this,"overflow-x",1))}):this.parents().filter(function(){return/(auto|scroll)/.test(h.curCSS(this,"overflow",1)+h.curCSS(this,"overflow-y",1)+h.curCSS(this,"overflow-x",1))})).eq(0);return/fixed/.test(this.css("position"))||!t.length?h(document):t},zIndex:function(t){if(t!==r)return this.css("zIndex",t);if(this.length)for(var e,i=h(this[0]);i.length&&i[0]!==document;){if(("absolute"===(e=i.css("position"))||"relative"===e||"fixed"===e)&&(e=parseInt(i.css("zIndex"),10),!isNaN(e))&&0!==e)return e;i=i.parent()}return 0},disableSelection:function(){return this.bind((h.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),h("<a>").outerWidth(1).jquery||h.each(["Width","Height"],function(t,i){function s(t,e,i,s){return h.each(n,function(){e-=parseFloat(h.curCSS(t,"padding"+this,!0))||0,i&&(e-=parseFloat(h.curCSS(t,"border"+this+"Width",!0))||0),s&&(e-=parseFloat(h.curCSS(t,"margin"+this,!0))||0)}),e}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:h.fn.innerWidth,innerHeight:h.fn.innerHeight,outerWidth:h.fn.outerWidth,outerHeight:h.fn.outerHeight};h.fn["inner"+i]=function(t){return t===r?a["inner"+i].call(this):this.each(function(){h(this).css(o,s(this,t)+"px")})},h.fn["outer"+i]=function(t,e){return"number"!=typeof t?a["outer"+i].call(this,t):this.each(function(){h(this).css(o,s(this,t,!0,e)+"px")})}}),h.extend(h.expr[":"],{data:h.expr.createPseudo?h.expr.createPseudo(function(e){return function(t){return!!h.data(t,e)}}):function(t,e,i){return!!h.data(t,i[3])},focusable:function(t){return s(t,!isNaN(h.attr(t,"tabindex")))},tabbable:function(t){var e=h.attr(t,"tabindex"),i=isNaN(e);return(i||0<=e)&&s(t,!i)}}),h(function(){var t=document.body,e=t.appendChild(document.createElement("div"));e.offsetHeight,h.extend(e.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),h.support.minHeight=100===e.offsetHeight,h.support.selectstart="onselectstart"in e,t.removeChild(e).style.display="none"}),h.curCSS||(h.curCSS=h.css),h.extend(h.ui,{plugin:{add:function(t,e,i){var s,n=h.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i){var s=t.plugins[e];if(s&&t.element[0].parentNode)for(var n=0;n<s.length;n++)t.options[s[n][0]]&&s[n][1].apply(t.element,i)}},contains:function(t,e){return document.compareDocumentPosition?16&t.compareDocumentPosition(e):t!==e&&t.contains(e)},hasScroll:function(t,e){var i;return"hidden"!==h(t).css("overflow")&&(i=!1,0<t[e=e&&"left"===e?"scrollLeft":"scrollTop"]||(t[e]=1,i=0<t[e],t[e]=0,i))},isOverAxis:function(t,e,i){return e<t&&t<e+i},isOver:function(t,e,i,s,n,o){return h.ui.isOverAxis(t,i,n)&&h.ui.isOverAxis(e,s,o)}}))}(jQuery),function(a){var s,i;a.cleanData?(s=a.cleanData,a.cleanData=function(t){for(var e,i=0;null!=(e=t[i]);i++)try{a(e).triggerHandler("remove")}catch(t){}s(t)}):(i=a.fn.remove,a.fn.remove=function(t,e){return this.each(function(){return e||(t&&!a.filter(t,[this]).length||a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(t){}})),i.call(a(this),t,e)})}),a.widget=function(e,t,i){var s,n=e.split(".")[0],t=(s=n+"-"+(e=e.split(".")[1]),i||(i=t,t=a.Widget),a.expr[":"][s]=function(t){return!!a.data(t,e)},a[n]=a[n]||{},a[n][e]=function(t,e){arguments.length&&this._createWidget(t,e)},new t);t.options=a.extend(!0,{},t.options),a[n][e].prototype=a.extend(!0,t,{namespace:n,widgetName:e,widgetEventPrefix:a[n][e].prototype.widgetEventPrefix||e,widgetBaseClass:s},i),a.widget.bridge(e,a[n][e])},a.widget.bridge=function(o,e){a.fn[o]=function(i){var t="string"==typeof i,s=Array.prototype.slice.call(arguments,1),n=this;return i=!t&&s.length?a.extend.apply(null,[!0,i].concat(s)):i,t&&"_"===i.charAt(0)||(t?this.each(function(){var t=a.data(this,o),e=t&&a.isFunction(t[i])?t[i].apply(t,s):t;if(e!==t&&void 0!==e)return n=e,!1}):this.each(function(){var t=a.data(this,o);t?t.option(i||{})._init():a.data(this,o,new e(i,this))})),n}},a.Widget=function(t,e){arguments.length&&this._createWidget(t,e)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(t,e){a.data(e,this.widgetName,this),this.element=a(e),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),t);var i=this;this.element.bind("remove."+this.widgetName,function(){i.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(t,e){var i=t;if(0===arguments.length)return a.extend({},this.options);if("string"==typeof t){if(void 0===e)return this.options[t];(i={})[t]=e}return this._setOptions(i),this},_setOptions:function(t){var i=this;return a.each(t,function(t,e){i._setOption(t,e)}),this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&this.widget()[e?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",e),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(t,e,i){var s,n,o=this.options[t];if(i=i||{},(e=a.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],n=e.originalEvent)for(s in n)s in e||(e[s]=n[s]);return this.element.trigger(e,i),!(a.isFunction(o)&&!1===o.call(this.element[0],e,i)||e.isDefaultPrevented())}}}(jQuery),function(n){var o=!1;n(document).mouseup(function(t){o=!1}),n.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(t){if(!0===n.data(t.target,e.widgetName+".preventClickEvent"))return n.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&n(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){var e,i,s;if(!o)return this._mouseStarted&&this._mouseUp(t),i=1==(this._mouseDownEvent=t).which,s=!("string"!=typeof(e=this).options.cancel||!t.target.nodeName)&&n(t.target).closest(this.options.cancel).length,i&&!s&&this._mouseCapture(t)&&(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?t.preventDefault():(!0===n.data(t.target,this.widgetName+".preventClickEvent")&&n.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},n(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),o=!0)),!0},_mouseMove:function(t){return!n.browser.msie||9<=document.documentMode||t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return n(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target==this._mouseDownEvent.target&&n.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(t){return this.mouseDelayMet},_mouseStart:function(t){},_mouseDrag:function(t){},_mouseStop:function(t){},_mouseCapture:function(t){return!0}})}(jQuery),function(g){g.ui=g.ui||{};var i=/left|center|right/,s=/top|center|bottom/,m="center",v={},n=g.fn.position,o=g.fn.offset;g.fn.position=function(l){if(!l||!l.of)return n.apply(this,arguments);l=g.extend({},l);var u,d,t=g(l.of),e=t[0],p=(l.collision||"flip").split(" "),c=l.offset?l.offset.split(" "):[0,0],f=9===e.nodeType?(u=t.width(),d=t.height(),{top:0,left:0}):e.setTimeout?(u=t.width(),d=t.height(),{top:t.scrollTop(),left:t.scrollLeft()}):e.preventDefault?(l.at="left top",u=d=0,{top:l.of.pageY,left:l.of.pageX}):(u=t.outerWidth(),d=t.outerHeight(),t.offset());return g.each(["my","at"],function(){var t=(l[this]||"").split(" ");(t=1===t.length?i.test(t[0])?t.concat([m]):s.test(t[0])?[m].concat(t):[m,m]:t)[0]=i.test(t[0])?t[0]:m,t[1]=s.test(t[1])?t[1]:m,l[this]=t}),1===p.length&&(p[1]=p[0]),c[0]=parseInt(c[0],10)||0,1===c.length&&(c[1]=c[0]),c[1]=parseInt(c[1],10)||0,"right"===l.at[0]?f.left+=u:l.at[0]===m&&(f.left+=u/2),"bottom"===l.at[1]?f.top+=d:l.at[1]===m&&(f.top+=d/2),f.left+=c[0],f.top+=c[1],this.each(function(){var i,t=g(this),s=t.outerWidth(),n=t.outerHeight(),e=parseInt(g.curCSS(this,"marginLeft",!0))||0,o=parseInt(g.curCSS(this,"marginTop",!0))||0,a=s+e+(parseInt(g.curCSS(this,"marginRight",!0))||0),h=n+o+(parseInt(g.curCSS(this,"marginBottom",!0))||0),r=g.extend({},f);"right"===l.my[0]?r.left-=s:l.my[0]===m&&(r.left-=s/2),"bottom"===l.my[1]?r.top-=n:l.my[1]===m&&(r.top-=n/2),v.fractions||(r.left=Math.round(r.left),r.top=Math.round(r.top)),i={left:r.left-e,top:r.top-o},g.each(["left","top"],function(t,e){g.ui.position[p[t]]&&g.ui.position[p[t]][e](r,{targetWidth:u,targetHeight:d,elemWidth:s,elemHeight:n,collisionPosition:i,collisionWidth:a,collisionHeight:h,offset:c,my:l.my,at:l.at})}),g.fn.bgiframe&&t.bgiframe(),t.offset(g.extend(r,{using:l.using}))})},g.ui.position={fit:{left:function(t,e){var i=g(window),i=e.collisionPosition.left+e.collisionWidth-i.width()-i.scrollLeft();t.left=0<i?t.left-i:Math.max(t.left-e.collisionPosition.left,t.left)},top:function(t,e){var i=g(window),i=e.collisionPosition.top+e.collisionHeight-i.height()-i.scrollTop();t.top=0<i?t.top-i:Math.max(t.top-e.collisionPosition.top,t.top)}},flip:{left:function(t,e){var i,s,n,o;e.at[0]!==m&&(i=g(window),i=e.collisionPosition.left+e.collisionWidth-i.width()-i.scrollLeft(),s="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,n="left"===e.at[0]?e.targetWidth:-e.targetWidth,o=-2*e.offset[0],t.left+=e.collisionPosition.left<0||0<i?s+n+o:0)},top:function(t,e){var i,s,n,o;e.at[1]!==m&&(i=g(window),i=e.collisionPosition.top+e.collisionHeight-i.height()-i.scrollTop(),s="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,n="top"===e.at[1]?e.targetHeight:-e.targetHeight,o=-2*e.offset[1],t.top+=e.collisionPosition.top<0||0<i?s+n+o:0)}}},g.offset.setOffset||(g.offset.setOffset=function(t,e){/static/.test(g.curCSS(t,"position"))&&(t.style.position="relative");var i=g(t),s=i.offset(),n=parseInt(g.curCSS(t,"top",!0),10)||0,o=parseInt(g.curCSS(t,"left",!0),10)||0,n={top:e.top-s.top+n,left:e.left-s.left+o};"using"in e?e.using.call(t,n):i.css(n)},g.fn.offset=function(e){var t=this[0];return t&&t.ownerDocument?e?g.isFunction(e)?this.each(function(t){g(this).offset(e.call(this,t,g(this).offset()))}):this.each(function(){g.offset.setOffset(this,e)}):o.call(this):null}),g.curCSS||(g.curCSS=g.css);var t,e,a=document.getElementsByTagName("body")[0],h=document.createElement("div"),r=document.createElement(a?"div":"body"),l={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(e in a&&g.extend(l,{position:"absolute",left:"-1000px",top:"-1000px"}),l)r.style[e]=l[e];r.appendChild(h),(t=a||document.documentElement).insertBefore(r,t.firstChild),h.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=g(h).offset(function(t,e){return e}).offset(),r.innerHTML="",t.removeChild(r),t=h.top+h.left+(a?2e3:0),v.fractions=21<t&&t<22}(jQuery),function(u){u.widget("ui.resizable",u.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var e=this,t=this.options;if(this.element.addClass("ui-resizable"),u.extend(this,{_aspectRatio:!!t.aspectRatio,aspectRatio:t.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:t.helper||t.ghost||t.animate?t.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(u('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=t.handles||(u(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor==String){"all"==this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");var i=this.handles.split(",");this.handles={};for(var s=0;s<i.length;s++){var n=u.trim(i[s]),o=u('<div class="ui-resizable-handle '+("ui-resizable-"+n)+'"></div>');o.css({zIndex:t.zIndex}),"se"==n&&o.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[n]=".ui-resizable-"+n,this.element.append(o)}}this._renderAxis=function(t){for(var e in t=t||this.element,this.handles){var i,s;this.handles[e].constructor==String&&(this.handles[e]=u(this.handles[e],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=u(this.handles[e],this.element),i=0,i=/sw|ne|nw|se|n|s/.test(e)?s.outerHeight():s.outerWidth(),s=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(s,i),this._proportionallyResize()),u(this.handles[e]).length}},this._renderAxis(this.element),this._handles=u(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){var t;e.resizing||(this.className&&(t=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),e.axis=t&&t[1]?t[1]:"se")}),t.autoHide&&(this._handles.hide(),u(this.element).addClass("ui-resizable-autohide").hover(function(){t.disabled||(u(this).removeClass("ui-resizable-autohide"),e._handles.show())},function(){t.disabled||e.resizing||(u(this).addClass("ui-resizable-autohide"),e._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();function t(t){u(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}var e;return this.elementIsWrapper&&(t(this.element),(e=this.element).after(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(t){var e,i=!1;for(e in this.handles)u(this.handles[e])[0]==t.target&&(i=!0);return!this.options.disabled&&i},_mouseStart:function(t){var e=this.options,i=this.element.position(),s=this.element,i=(this.resizing=!0,this.documentScroll={top:u(document).scrollTop(),left:u(document).scrollLeft()},(s.is(".ui-draggable")||/absolute/.test(s.css("position")))&&s.css({position:"absolute",top:i.top,left:i.left}),this._renderProxy(),l(this.helper.css("left"))),n=l(this.helper.css("top")),i=(e.containment&&(i+=u(e.containment).scrollLeft()||0,n+=u(e.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:n},this.size=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalPosition={left:i,top:n},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof e.aspectRatio?e.aspectRatio:this.originalSize.width/this.originalSize.height||1,u(".ui-resizable-"+this.axis).css("cursor"));return u("body").css("cursor","auto"==i?this.axis+"-resize":i),s.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.helper,i=(this.options,this.originalMousePosition),s=this.axis,n=t.pageX-i.left||0,i=t.pageY-i.top||0,s=this._change[s];return s&&(s=s.apply(this,[t,n,i]),u.browser.msie&&u.browser.version,this.sizeDiff,this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(s=this._updateRatio(s,t)),s=this._respectSize(s,t),this._propagate("resize",t),e.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(s),this._trigger("resize",t,this.ui())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(i=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&u.ui.hasScroll(i[0],"left")?0:o.sizeDiff.height,e=e?0:o.sizeDiff.width,e={width:o.helper.width()-e,height:o.helper.height()-i},i=parseInt(o.element.css("left"),10)+(o.position.left-o.originalPosition.left)||null,s=parseInt(o.element.css("top"),10)+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(u.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper)&&!n.animate&&this._proportionallyResize(),u("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,i,s,n=this.options,n={minWidth:d(n.minWidth)?n.minWidth:0,maxWidth:d(n.maxWidth)?n.maxWidth:1/0,minHeight:d(n.minHeight)?n.minHeight:0,maxHeight:d(n.maxHeight)?n.maxHeight:1/0};(this._aspectRatio||t)&&(t=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,e=n.maxHeight*this.aspectRatio,s=n.maxWidth/this.aspectRatio,n.minWidth<t&&(n.minWidth=t),n.minHeight<i&&(n.minHeight=i),e<n.maxWidth&&(n.maxWidth=e),s<n.maxHeight)&&(n.maxHeight=s),this._vBoundaries=n},_updateCache:function(t){this.options;this.offset=this.helper.offset(),d(t.left)&&(this.position.left=t.left),d(t.top)&&(this.position.top=t.top),d(t.height)&&(this.size.height=t.height),d(t.width)&&(this.size.width=t.width)},_updateRatio:function(t,e){this.options;var i=this.position,s=this.size,n=this.axis;return d(t.height)?t.width=t.height*this.aspectRatio:d(t.width)&&(t.height=t.width/this.aspectRatio),"sw"==n&&(t.left=i.left+(s.width-t.width),t.top=null),"nw"==n&&(t.top=i.top+(s.height-t.height),t.left=i.left+(s.width-t.width)),t},_respectSize:function(t,e){this.helper;var i=this._vBoundaries,e=(this._aspectRatio||e.shiftKey,this.axis),s=d(t.width)&&i.maxWidth&&i.maxWidth<t.width,n=d(t.height)&&i.maxHeight&&i.maxHeight<t.height,o=d(t.width)&&i.minWidth&&i.minWidth>t.width,a=d(t.height)&&i.minHeight&&i.minHeight>t.height,h=(o&&(t.width=i.minWidth),a&&(t.height=i.minHeight),s&&(t.width=i.maxWidth),n&&(t.height=i.maxHeight),this.originalPosition.left+this.originalSize.width),r=this.position.top+this.size.height,l=/sw|nw|w/.test(e),e=/nw|ne|n/.test(e),o=(o&&l&&(t.left=h-i.minWidth),s&&l&&(t.left=h-i.maxWidth),a&&e&&(t.top=r-i.minHeight),n&&e&&(t.top=r-i.maxHeight),!t.width&&!t.height);return o&&!t.left&&t.top?t.top=null:o&&!t.top&&t.left&&(t.left=null),t},_proportionallyResize:function(){this.options;if(this._proportionallyResizeElements.length)for(var t=this.helper||this.element,e=0;e<this._proportionallyResizeElements.length;e++){var i,s,n=this._proportionallyResizeElements[e];this.borderDif||(i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],this.borderDif=u.map(i,function(t,e){return(parseInt(t,10)||0)+(parseInt(s[e],10)||0)})),u.browser.msie&&(u(t).is(":hidden")||u(t).parents(":hidden").length)||n.css({height:t.height()-this.borderDif[0]-this.borderDif[2]||0,width:t.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var t,e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||u('<div style="overflow:hidden;"></div>'),t=(e=u.browser.msie&&u.browser.version<7)?1:0,e=e?2:-1,this.helper.addClass(this._helper).css({width:this.element.outerWidth()+e,height:this.element.outerHeight()+e,position:"absolute",left:this.elementOffset.left-t+"px",top:this.elementOffset.top-t+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e,i){return{width:this.originalSize.width+e}},w:function(t,e,i){this.options;var s=this.originalSize;return{left:this.originalPosition.left+e,width:s.width-e}},n:function(t,e,i){this.options;var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return u.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return u.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return u.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return u.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){u.ui.plugin.call(this,t,[e,this.ui()]),"resize"!=t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),u.extend(u.ui.resizable,{version:"1.8.24"}),u.ui.plugin.add("resizable","alsoResize",{start:function(t,e){function i(t){u(t).each(function(){var t=u(this);t.data("resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})}var s=u(this).data("resizable").options;"object"!=typeof s.alsoResize||s.alsoResize.parentNode?i(s.alsoResize):s.alsoResize.length?(s.alsoResize=s.alsoResize[0],i(s.alsoResize)):u.each(s.alsoResize,function(t){i(t)})},resize:function(t,o){function i(t,i){u(t).each(function(){var t=u(this),s=u(this).data("resizable-alsoresize"),n={},e=i&&i.length?i:t.parents(o.originalElement[0]).length?["width","height"]:["width","height","top","left"];u.each(e,function(t,e){var i=(s[e]||0)+(h[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})}var e=u(this).data("resizable"),s=e.options,n=e.originalSize,a=e.originalPosition,h={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-a.top||0,left:e.position.left-a.left||0};"object"!=typeof s.alsoResize||s.alsoResize.nodeType?i(s.alsoResize):u.each(s.alsoResize,function(t,e){i(t,e)})},stop:function(t,e){u(this).removeData("resizable-alsoresize")}}),u.ui.plugin.add("resizable","animate",{stop:function(e,t){var i=u(this).data("resizable"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&u.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,o=o?0:i.sizeDiff.width,o={width:i.size.width-o,height:i.size.height-a},a=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,h=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(u.extend(o,h&&a?{top:h,left:a}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var t={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&u(n[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),u.ui.plugin.add("resizable","containment",{start:function(t,e){var i,s,n,o,a=u(this).data("resizable"),h=a.options,r=a.element,h=h.containment,r=h instanceof u?h.get(0):/parent/.test(h)?r.parent().get(0):h;r&&(a.containerElement=u(r),/document/.test(h)||h==document?(a.containerOffset={left:0,top:0},a.containerPosition={left:0,top:0},a.parentData={element:u(document),left:0,top:0,width:u(document).width(),height:u(document).height()||document.body.parentNode.scrollHeight}):(i=u(r),s=[],u(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=l(i.css("padding"+e))}),a.containerOffset=i.offset(),a.containerPosition=i.position(),a.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},h=a.containerOffset,o=a.containerSize.height,n=a.containerSize.width,n=u.ui.hasScroll(r,"left")?r.scrollWidth:n,o=u.ui.hasScroll(r)?r.scrollHeight:o,a.parentData={element:r,left:h.left,top:h.top,width:n,height:o}))},resize:function(t,e){var i=u(this).data("resizable"),s=i.options,n=(i.containerSize,i.containerOffset),o=(i.size,i.position),t=i._aspectRatio||t.shiftKey,a={top:0,left:0},h=i.containerElement,h=(h[0]!=document&&/static/.test(h.css("position"))&&(a=n),o.left<(i._helper?n.left:0)&&(i.size.width=i.size.width+(i._helper?i.position.left-n.left:i.position.left-a.left),t&&(i.size.height=i.size.width/i.aspectRatio),i.position.left=s.helper?n.left:0),o.top<(i._helper?n.top:0)&&(i.size.height=i.size.height+(i._helper?i.position.top-n.top:i.position.top),t&&(i.size.width=i.size.height*i.aspectRatio),i.position.top=i._helper?n.top:0),i.offset.left=i.parentData.left+i.position.left,i.offset.top=i.parentData.top+i.position.top,Math.abs((i._helper,i.offset.left-a.left+i.sizeDiff.width))),s=Math.abs((i._helper?i.offset.top-a.top:i.offset.top-n.top)+i.sizeDiff.height),o=i.containerElement.get(0)==i.element.parent().get(0),a=/relative|absolute/.test(i.containerElement.css("position"));o&&a&&(h-=i.parentData.left),h+i.size.width>=i.parentData.width&&(i.size.width=i.parentData.width-h,t)&&(i.size.height=i.size.width/i.aspectRatio),s+i.size.height>=i.parentData.height&&(i.size.height=i.parentData.height-s,t)&&(i.size.width=i.size.height*i.aspectRatio)},stop:function(t,e){var i=u(this).data("resizable"),s=i.options,n=(i.position,i.containerOffset),o=i.containerPosition,a=i.containerElement,h=u(i.helper),r=h.offset(),l=h.outerWidth()-i.sizeDiff.width,h=h.outerHeight()-i.sizeDiff.height;i._helper&&!s.animate&&/relative/.test(a.css("position"))&&u(this).css({left:r.left-o.left-n.left,width:l,height:h}),i._helper&&!s.animate&&/static/.test(a.css("position"))&&u(this).css({left:r.left-o.left-n.left,width:l,height:h})}}),u.ui.plugin.add("resizable","ghost",{start:function(t,e){var i=u(this).data("resizable"),s=i.options,n=i.size;i.ghost=i.originalElement.clone(),i.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof s.ghost?s.ghost:""),i.ghost.appendTo(i.helper)},resize:function(t,e){var i=u(this).data("resizable");i.options;i.ghost&&i.ghost.css({position:"relative",height:i.size.height,width:i.size.width})},stop:function(t,e){var i=u(this).data("resizable");i.options;i.ghost&&i.helper&&i.helper.get(0).removeChild(i.ghost.get(0))}}),u.ui.plugin.add("resizable","grid",{resize:function(t,e){var i=u(this).data("resizable"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,h=i.axis,t=(s._aspectRatio||t.shiftKey,s.grid="number"==typeof s.grid?[s.grid,s.grid]:s.grid,Math.round((n.width-o.width)/(s.grid[0]||1))*(s.grid[0]||1)),n=Math.round((n.height-o.height)/(s.grid[1]||1))*(s.grid[1]||1);/^(se|s|e)$/.test(h)?(i.size.width=o.width+t,i.size.height=o.height+n):/^(ne)$/.test(h)?(i.size.width=o.width+t,i.size.height=o.height+n,i.position.top=a.top-n):(/^(sw)$/.test(h)?(i.size.width=o.width+t,i.size.height=o.height+n):(i.size.width=o.width+t,i.size.height=o.height+n,i.position.top=a.top-n),i.position.left=a.left-t)}});var l=function(t){return parseInt(t,10)||0},d=function(t){return!isNaN(parseInt(t,10))}}(jQuery),function(u){u.widget("ui.slider",u.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var o=this,t=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),i=t.values&&t.values.length||1,s=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"+(t.disabled?" ui-slider-disabled ui-disabled":"")),this.range=u([]),t.range&&(!0===t.range&&(t.values||(t.values=[this._valueMin(),this._valueMin()]),t.values.length)&&2!==t.values.length&&(t.values=[t.values[0],t.values[0]]),this.range=u("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:"")));for(var n=e.length;n<i;n+=1)s.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");this.handles=e.add(u(s.join("")).appendTo(o.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(t){t.preventDefault()}).hover(function(){t.disabled||u(this).addClass("ui-state-hover")},function(){u(this).removeClass("ui-state-hover")}).focus(function(){t.disabled?u(this).blur():(u(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),u(this).addClass("ui-state-focus"))}).blur(function(){u(this).removeClass("ui-state-focus")}),this.handles.each(function(t){u(this).data("index.ui-slider-handle",t)}),this.handles.keydown(function(t){var e,i,s,n=u(this).data("index.ui-slider-handle");if(!o.options.disabled){switch(t.keyCode){case u.ui.keyCode.HOME:case u.ui.keyCode.END:case u.ui.keyCode.PAGE_UP:case u.ui.keyCode.PAGE_DOWN:case u.ui.keyCode.UP:case u.ui.keyCode.RIGHT:case u.ui.keyCode.DOWN:case u.ui.keyCode.LEFT:if(t.preventDefault(),!o._keySliding&&(o._keySliding=!0,u(this).addClass("ui-state-active"),!1===o._start(t,n)))return}switch(s=o.options.step,e=i=o.options.values&&o.options.values.length?o.values(n):o.value(),t.keyCode){case u.ui.keyCode.HOME:i=o._valueMin();break;case u.ui.keyCode.END:i=o._valueMax();break;case u.ui.keyCode.PAGE_UP:i=o._trimAlignValue(e+(o._valueMax()-o._valueMin())/5);break;case u.ui.keyCode.PAGE_DOWN:i=o._trimAlignValue(e-(o._valueMax()-o._valueMin())/5);break;case u.ui.keyCode.UP:case u.ui.keyCode.RIGHT:if(e===o._valueMax())return;i=o._trimAlignValue(e+s);break;case u.ui.keyCode.DOWN:case u.ui.keyCode.LEFT:if(e===o._valueMin())return;i=o._trimAlignValue(e-s)}o._slide(t,n,i)}}).keyup(function(t){var e=u(this).data("index.ui-slider-handle");o._keySliding&&(o._keySliding=!1,o._stop(t,e),o._change(t,e),u(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){return this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouseCapture:function(t){var i,s,n,o,a,e,h=this.options;return!h.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e),s=this._valueMax()-this._valueMin()+1,(o=this).handles.each(function(t){var e=Math.abs(i-o.values(t));e<s&&(s=e,n=u(this),a=t)}),!0===h.range&&this.values(1)===h.min&&(a+=1,n=u(this.handles[a])),!1!==this._start(t,a))&&(this._mouseSliding=!0,o._handleIndex=a,n.addClass("ui-state-active").focus(),e=n.offset(),h=!u(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:t.pageX-e.left-n.width()/2,top:t.pageY-e.top-n.height()/2-(parseInt(n.css("borderTopWidth"),10)||0)-(parseInt(n.css("borderBottomWidth"),10)||0)+(parseInt(n.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,a,i),this._animateOff=!0)},_mouseStart:function(t){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},e=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,e),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,t="horizontal"===this.orientation?(e=this.elementSize.width,t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),t=t/e;return(t=1<t?1:t)<0&&(t=0),"vertical"===this.orientation&&(t=1-t),e=this._valueMax()-this._valueMin(),t=this._valueMin()+t*e,this._trimAlignValue(t)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n;this.options.values&&this.options.values.length?(s=this.values(e?0:1),(i=2===this.options.values.length&&!0===this.options.range&&(0===e&&s<i||1===e&&i<s)?s:i)!==this.values(e)&&((s=this.values())[e]=i,n=this._trigger("slide",t,{handle:this.handles[e],value:i,values:s}),this.values(e?0:1),!1!==n)&&this.values(e,i,!0)):i!==this.value()&&!1!==(n=this._trigger("slide",t,{handle:this.handles[e],value:i}))&&this.value(i)},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){var i;this._keySliding||this._mouseSliding||(i={handle:this.handles[e],value:this.value()},this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("change",t,i))},value:function(t){if(!arguments.length)return this._value();this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0)},values:function(t,e){var i,s,n;if(1<arguments.length)this.options.values[t]=this._trimAlignValue(e),this._refreshValue(),this._change(null,t);else{if(!arguments.length)return this._values();if(!u.isArray(t))return this.options.values&&this.options.values.length?this._values(t):this.value();for(i=this.options.values,s=t,n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(s[n]),this._change(null,n);this._refreshValue()}},_setOption:function(t,e){var i,s=0;switch(u.isArray(this.options.values)&&(s=this.options.values.length),u.Widget.prototype._setOption.apply(this,arguments),t){case"disabled":e?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=0;i<s;i+=1)this._change(null,i);this._animateOff=!1}},_value:function(){var t=this.options.value;return this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],this._trimAlignValue(e);for(i=this.options.values.slice(),s=0;s<i.length;s+=1)i[s]=this._trimAlignValue(i[s]);return i},_trimAlignValue:function(t){var e,i;return t<=this._valueMin()?this._valueMin():t>=this._valueMax()?this._valueMax():(e=0<this.options.step?this.options.step:1,i=t-(t=(t-this._valueMin())%e),2*Math.abs(t)>=e&&(i+=0<t?e:-e),parseFloat(i.toFixed(5)))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var i,s,t,e,n,o=this.options.range,a=this.options,h=this,r=!this._animateOff&&a.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(t,e){i=(h.values(t)-h._valueMin())/(h._valueMax()-h._valueMin())*100,l["horizontal"===h.orientation?"left":"bottom"]=i+"%",u(this).stop(1,1)[r?"animate":"css"](l,a.animate),!0===h.options.range&&("horizontal"===h.orientation?(0===t&&h.range.stop(1,1)[r?"animate":"css"]({left:i+"%"},a.animate),1===t&&h.range[r?"animate":"css"]({width:i-s+"%"},{queue:!1,duration:a.animate})):(0===t&&h.range.stop(1,1)[r?"animate":"css"]({bottom:i+"%"},a.animate),1===t&&h.range[r?"animate":"css"]({height:i-s+"%"},{queue:!1,duration:a.animate}))),s=i}):(t=this.value(),e=this._valueMin(),n=this._valueMax(),i=n!==e?(t-e)/(n-e)*100:0,l["horizontal"===h.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[r?"animate":"css"](l,a.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[r?"animate":"css"]({width:i+"%"},a.animate),"max"===o&&"horizontal"===this.orientation&&this.range[r?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:a.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[r?"animate":"css"]({height:i+"%"},a.animate),"max"===o&&"vertical"===this.orientation&&this.range[r?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:a.animate}))}}),u.extend(u.ui.slider,{version:"1.8.24"})}(jQuery);
7
- var SVG_ARROW_POLYGON="0,3 12,3 12,0 18,5 12,10 12,7 0,7",SVG_ARROW_HEIGHT=10,curVisualizerID=1;function ExecutionVisualizer(t,e,i){this.curInputCode=e.code.rtrim(),this.curTrace=e.trace,this.DEFAULT_EMBEDDED_CODE_DIV_WIDTH=350,this.DEFAULT_EMBEDDED_CODE_DIV_HEIGHT=400,0<this.curTrace.length&&("raw_input"==(e=this.curTrace[this.curTrace.length-1]).event?(this.promptForUserInput=!0,this.userInputPromptStr=htmlspecialchars(e.prompt),this.curTrace.pop()):"mouse_input"==e.event&&(this.promptForMouseInput=!0,this.userInputPromptStr=htmlspecialchars(e.prompt),this.curTrace.pop())),this.curInstr=0,this.params=i,this.params||(this.params={});var n,e=void 0!==this.params.arrowLines,i=void 0!==this.params.highlightLines;e||i?e&&i||(e?this.params.highlightLines=!this.params.arrowLines:this.params.arrowLines=!this.params.highlightLines):(this.params.highlightLines=!1,this.params.arrowLines=!0),this.compactFuncLabels=this.params.compactFuncLabels,this.params.pyCrazyMode&&(this.params.arrowLines=this.params.highlightLines=!1),this.params.visualizerIdOverride?this.visualizerID=this.params.visualizerIdOverride:(this.visualizerID=curVisualizerID,curVisualizerID++),this.leftGutterSvgInitialized=!1,this.arrowOffsetY=void 0,this.codeRowHeight=void 0,this.disableHeapNesting=1==this.params.disableHeapNesting,this.drawParentPointers=1==this.params.drawParentPointers,this.textualMemoryLabels=1==this.params.textualMemoryLabels,this.showOnlyOutputs=1==this.params.showOnlyOutputs,this.tabularView=1==this.params.tabularView,this.showAllFrameLabels=1==this.params.showAllFrameLabels,this.executeCodeWithRawInputFunc=this.params.executeCodeWithRawInputFunc,this.jsPlumbInstance=jsPlumb.getInstance({Endpoint:["Dot",{radius:3}],EndpointStyles:[{fillStyle:connectorBaseColor},{fillstyle:null}],Anchors:["RightMiddle","LeftMiddle"],PaintStyle:{lineWidth:1,strokeStyle:connectorBaseColor},Connector:["StateMachine"],Overlays:[["Arrow",{length:10,width:7,foldback:.55,location:1}]],EndpointHoverStyles:[{fillStyle:connectorHighlightColor},{fillstyle:null}],HoverPaintStyle:{lineWidth:1,strokeStyle:connectorHighlightColor}});this.domRoot=$("#"+t),this.domRoot.data("vis",this),this.domRootD3=d3.select("#"+t),this.domRoot.html('<div class="ExecutionVisualizer"></div>'),this.domRoot=this.domRoot.find("div.ExecutionVisualizer"),this.domRootD3=this.domRootD3.select("div.ExecutionVisualizer"),this.codeOutputLines=null,this.breakpoints=null,this.sortedBreakpointsList=[],this.classAttrsHidden={},this.pytutor_hooks={},"java"===this.params.lang&&this.activateJavaFrontend(),this.numStdoutLines=0;for(var r=this.curTrace.length-1;0<=r&&!(n=this.curTrace[r].stdout);r--);n&&(this.numStdoutLines=n.rtrim().split("\n").length),this.try_hook("end_constructor",{myViz:this}),this.hasRendered=!1,this.render()}function htmlWithHighlight(t,e,i,n){var r="",a=(0<e&&(r=t.slice(0,e)),t.slice(e,e+i)),s="";return e+i<t.length&&(s=t.slice(e+i,t.length)),htmlspecialchars(r)+'<span class="'+n+'">'+htmlspecialchars(a)+"</span>"+htmlspecialchars(s)}ExecutionVisualizer.prototype.add_pytutor_hook=function(t,e){this.pytutor_hooks[t]?this.pytutor_hooks[t].push(e):this.pytutor_hooks[t]=[e]},ExecutionVisualizer.prototype.try_hook=function(t,e){if(this.pytutor_hooks[t])for(var i=0;i<this.pytutor_hooks[t].length;i++){var n=this.pytutor_hooks[t][i].apply(null,[e]);if(n&&n[0])return n}return[!1]},ExecutionVisualizer.prototype.resetJsPlumbManager=function(){this.jsPlumbManager={heap_pointer_src_id:1,connectionEndpointIDs:d3.map(),heapConnectionEndpointIDs:d3.map(),parentPointerConnectionEndpointIDs:d3.map(),renderedHeapObjectIDs:d3.map()}},ExecutionVisualizer.prototype.generateID=function(t){return"v"+this.visualizerID+"__"+t},ExecutionVisualizer.prototype.generateHeapObjID=function(t,e){return this.generateID("heap_object_"+t+"_s"+e)},ExecutionVisualizer.prototype.render=function(){if(this.hasRendered)alert("ERROR: You should only call render() ONCE on an ExecutionVisualizer object.");else{var t,r=this,e='<div id="codeDisplayDiv"> <div id="langDisplayDiv"></div> <div id="pyCodeOutputDiv"/> <div id="editCodeLinkDiv"><a id="editBtn">Edit code</a> <span id="liveModeSpan" style="display: none;">| <a id="editLiveModeBtn" href="#">Live programming</a></a> </div> <div id="legendDiv"/> <div id="executionSliderDocs"></div> <div id="executionSlider"/> <div id="executionSliderFooter"/> <div id="vcrControls"> <button id="jmpFirstInstr", type="button">&lt;&lt; First</button> <button id="jmpStepBack", type="button">&lt; Back</button> <span id="curInstr">Step ? of ?</span> <button id="jmpStepFwd", type="button">Forward &gt;</button> <button id="jmpLastInstr", type="button">Last &gt;&gt;</button> </div> <div id="rawUserInputDiv"> <span id="userInputPromptStr"/> <input type="text" id="raw_input_textbox" size="30"/> <button id="raw_input_submit_btn">Submit</button> </div> <div id="errorOutput"/> <div id="stepAnnotationDiv"> <textarea class="annotationText" id="stepAnnotationEditor" cols="60" rows="3"></textarea> <div class="annotationText" id="stepAnnotationViewer"></div> </div> <div id="annotateLinkDiv"><button id="annotateBtn" type="button">Annotate this step</button></div> </div>',i='<div id="htmlOutputDiv"></div> <div id="progOutputs"> <div id="printOutputDocs">Print output (drag lower right corner to resize)</div>\n <textarea id="pyStdout" cols="40" rows="5" wrap="off" readonly></textarea> </div>',n='<div id="dataViz"> <table id="stackHeapTable"> <tr> <td id="stack_td"> <div id="globals_area"> <div id="stackHeader">Frames</div> </div> <div id="stack"></div> </td> <td id="heap_td"> <div id="heap"> <div id="heapHeader">Objects</div> </div> </td> </tr> </table> </div>',a=(r.tabularView&&(n='<div id="optTabularView"></div>'),'<div id="vizHeader"> <textarea class="vizTitleText" id="vizTitleEditor" cols="60" rows="1"></textarea> <div class="vizTitleText" id="vizTitleViewer"></div> <textarea class="vizDescriptionText" id="vizDescriptionEditor" cols="75" rows="2"></textarea> <div class="vizDescriptionText" id="vizDescriptionViewer"></div> </div>'),i=(this.params.verticalStack?this.domRoot.html(a+'<table border="0" class="visualizer"><tr><td class="vizLayoutTd" id="vizLayoutTdFirst"">'+e+'</td></tr><tr><td class="vizLayoutTd" id="vizLayoutTdSecond">'+n+"</td></tr></table>"):this.domRoot.html(a+'<table border="0" class="visualizer"><tr><td class="vizLayoutTd" id="vizLayoutTdFirst">'+e+'</td><td class="vizLayoutTd" id="vizLayoutTdSecond">'+n+"</td></tr></table>"),this.showOnlyOutputs?(r.domRoot.find("#dataViz").hide(),this.domRoot.find("#vizLayoutTdSecond").append(i),this.params.verticalStack?this.domRoot.find("#vizLayoutTdSecond").css("padding-top","25px"):this.domRoot.find("#vizLayoutTdSecond").css("padding-left","25px")):(a="75px",this.numStdoutLines<=3&&(a=18*this.numStdoutLines+"px"),this.params.embeddedMode&&(a="45px"),this.domRoot.find("#vizLayoutTdSecond").prepend(i),this.domRoot.find("#pyStdout").width("350px").height(a).resizable()),this.params.arrowLines?(this.domRoot.find("#legendDiv").append('<svg id="prevLegendArrowSVG"/> line that has just executed').append('<p style="margin-top: 4px"><svg id="curLegendArrowSVG"/> next line to execute</p>'),r.domRootD3.select("svg#prevLegendArrowSVG").append("polygon").attr("points",SVG_ARROW_POLYGON).attr("fill",lightArrowColor),r.domRootD3.select("svg#curLegendArrowSVG").append("polygon").attr("points",SVG_ARROW_POLYGON).attr("fill",darkArrowColor)):this.params.highlightLines?r.domRoot.find("#legendDiv").append('<span class="highlight-legend highlight-prev">line that has just executed</span> ').append('<span class="highlight-legend highlight-cur">next line to execute</span>'):this.params.pyCrazyMode&&r.domRoot.find("#legendDiv").append('<a href="https://github.com/pgbovine/Py2crazy">Py2crazy</a> mode!').append(" Stepping through (roughly) each executed expression. Color codes:<p/>").append('<span class="pycrazy-highlight-prev">expression that just executed</span><br/>').append('<span class="pycrazy-highlight-cur">next expression to execute</span>'),this.params.editCodeBaseURL?(e="2","js"===this.params.lang?e="js":"ts"===this.params.lang?e="ts":"java"===this.params.lang?e="java":"py3"===this.params.lang?e="3":"c"===this.params.lang?e="c":"cpp"===this.params.lang&&(e="cpp"),n=$.param.fragment(this.params.editCodeBaseURL,{code:this.curInputCode,py:e},2),this.domRoot.find("#editBtn").attr("href",n)):(this.domRoot.find("#editCodeLinkDiv").hide(),this.domRoot.find("#editBtn").attr("href","#"),this.domRoot.find("#editBtn").click(function(){return!1})),void 0!==this.params.lang&&("js"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("JavaScript"):"ts"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("TypeScript"):"ruby"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("Ruby"):"java"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("Java"):"py2"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("Python 2.7"):"py3"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("Python 3.3"):"c"===this.params.lang?this.domRoot.find("#langDisplayDiv").html('C (gcc 4.8, C11) <font color="#e93f34">EXPERIMENTAL!</font><br/>see <a href="https://github.com/pgbovine/opt-cpp-backend/issues" target="_blank">known bugs</a> and report to philip@pgbovine.net'):"cpp"===this.params.lang?this.domRoot.find("#langDisplayDiv").html('C++ (gcc 4.8, C++11) <font color="#e93f34">EXPERIMENTAL!</font><br/>see <a href="https://github.com/pgbovine/opt-cpp-backend/issues" target="_blank">known bugs</a> and report to philip@pgbovine.net'):this.domRoot.find("#langDisplayDiv").hide()),void 0!==this.params.allowEditAnnotations?this.allowEditAnnotations=this.params.allowEditAnnotations:this.allowEditAnnotations=!1,void 0!==this.params.pyCrazyMode?this.pyCrazyMode=this.params.pyCrazyMode:this.pyCrazyMode=!1,this.domRoot.find("#stepAnnotationEditor").hide(),this.params.embeddedMode&&(this.embeddedMode=!0,void 0===this.params.codeDivWidth&&(this.params.codeDivWidth=this.DEFAULT_EMBEDDED_CODE_DIV_WIDTH),void 0===this.params.codeDivHeight&&(this.params.codeDivHeight=this.DEFAULT_EMBEDDED_CODE_DIV_HEIGHT),this.allowEditAnnotations=!1,this.domRoot.find("#codeDisplayDiv").append('<div style="font-size: 8pt; margin-bottom: 20px;">Visualized using <a href="http://pythontutor.com" target="_blank" style="color: #3D58A2;">Online Python Tutor</a> by <a href="http://www.pgbovine.net/" target="_blank" style="color: #3D58A2;">Philip Guo</a></div>'),r.domRoot.find("#executionSliderDocs").hide()),r.editAnnotationMode=!1,this.allowEditAnnotations?(t=this.domRoot.find("#annotateBtn")).click(function(){r.editAnnotationMode?(r.enterViewAnnotationsMode(),r.domRoot.find("#jmpFirstInstr,#jmpLastInstr,#jmpStepBack,#jmpStepFwd,#executionSlider,#editCodeLinkDiv,#stepAnnotationViewer").show(),r.domRoot.find("#stepAnnotationEditor").hide(),t.html("Annotate this step")):(r.enterEditAnnotationsMode(),r.domRoot.find("#jmpFirstInstr,#jmpLastInstr,#jmpStepBack,#jmpStepFwd,#executionSlider,#editCodeLinkDiv,#stepAnnotationViewer").hide(),r.domRoot.find("#stepAnnotationEditor").show(),t.html("Done annotating"))}):this.domRoot.find("#annotateBtn").hide(),this.params.codeDivWidth&&this.params.codeDivWidth<470&&(this.domRoot.find("#jmpFirstInstr").hide(),this.domRoot.find("#jmpLastInstr").hide()),this.params.codeDivWidth&&this.domRoot.find("#codeDisplayDiv").width(this.params.codeDivWidth),this.domRoot.find("#codeDisplayDiv").resizable({handles:"e",minWidth:100,resize:function(t,e){r.domRoot.find("#codeDisplayDiv").css("height","auto"),r.renderSliderBreakpoints(),r.params.updateOutputCallback&&r.params.updateOutputCallback(this)}}),this.params.codeDivHeight&&this.domRoot.find("#pyCodeOutputDiv").css("max-height",this.params.codeDivHeight+"px"),this.domRoot.find("#globals_area").append('<div class="stackFrame" id="'+r.generateID("globals")+'"><div id="'+r.generateID("globals_header")+'" class="stackFrameHeader">'+this.getRealLabel("Global frame")+'</div><table class="stackFrameVarTable" id="'+r.generateID("global_table")+'"></table></div>'),this.params.hideOutput&&this.domRoot.find("#progOutputs").hide(),this.domRoot.find("#jmpFirstInstr").click(function(){r.renderStep(0)}),this.domRoot.find("#jmpLastInstr").click(function(){r.renderStep(r.curTrace.length-1)}),this.domRoot.find("#jmpStepBack").click(function(){r.stepBack()}),this.domRoot.find("#jmpStepFwd").click(function(){r.stepForward()}),this.domRoot.find("#vcrControls #jmpFirstInstr").attr("disabled",!0),this.domRoot.find("#vcrControls #jmpStepBack").attr("disabled",!0),this.domRoot.find("#vcrControls #jmpStepFwd").attr("disabled",!0),this.domRoot.find("#vcrControls #jmpLastInstr").attr("disabled",!0),this.curTrace[this.curTrace.length-1]),e=(this.instrLimitReached="instruction_limit_reached"==i.event,this.instrLimitReached&&(this.curTrace.pop(),a=i.exception_msg,this.instrLimitReachedWarningMsg=a,r.domRoot.find("#errorOutput").html(htmlspecialchars(a)),r.domRoot.find("#errorOutput").show()),this.domRoot.find("#executionSlider"));if(e.slider({min:0,max:this.curTrace.length-1,step:1}),e.find(".ui-slider-handle").unbind("keydown"),e.find(".ui-slider-handle").css("width","0.8em"),e.find(".ui-slider-handle").css("height","1.4em"),this.domRoot.find(".ui-widget-content").css("font-size","0.9em"),this.domRoot.find("#executionSlider").bind("slide",function(t,e){t.originalEvent&&r.renderStep(e.value)}),this.params.startingInstruction&&(this.params.jumpToEnd=!1,this.params.startingInstruction==this.curTrace.length&&this.params.startingInstruction--,this.params.startingInstruction<0&&(this.params.startingInstruction=0),this.params.startingInstruction>=this.curTrace.length&&(this.params.startingInstruction=this.curTrace.length-1),assert(0<=this.params.startingInstruction&&this.params.startingInstruction<this.curTrace.length),this.curInstr=this.params.startingInstruction),this.params.jumpToEnd){for(var s=-1,o=0;o<this.curTrace.length;o++){var d=this.curTrace[o];if("exception"==d.event||"uncaught_exception"==d.event){s=o;break}}this.curInstr=0<=s?s:this.curTrace.length-1}this.params.hideCode&&this.domRoot.find("#vizLayoutTdFirst").hide(),this.try_hook("end_render",{myViz:this}),this.precomputeCurTraceLayouts(),this.params.hideCode||this.renderPyCodeOutput(),this.tabularView&&(this.renderTabularView(),$(window).scroll(function(){var t=r.domRoot.find("#vizLayoutTdFirst"),e=$(document).scrollTop(),i=t.offset().top,e=e-i,n=(e<0&&(e=0),r.domRoot.find("#optTabularView"));e-i<n.height()+n.offset().top-r.domRoot.find("#codeDisplayDiv").height()&&t.css("padding-top",e)}));var l=r.domRoot.find("#rawUserInputDiv");l.find("#userInputPromptStr").html(r.userInputPromptStr),l.find("#raw_input_submit_btn").click(function(){var t=l.find("#raw_input_textbox").val();r.executeCodeWithRawInputFunc(t,r.curInstr+1)}),this.updateOutput(),this.hasRendered=!0}},ExecutionVisualizer.prototype.showVizHeaderViewMode=function(){var t=this.domRoot.find("#vizTitleEditor").val().trim(),e=this.domRoot.find("#vizDescriptionEditor").val().trim();this.domRoot.find("#vizTitleEditor,#vizDescriptionEditor").hide(),t||e?(this.domRoot.find("#vizHeader,#vizTitleViewer,#vizDescriptionViewer").show(),t&&this.domRoot.find("#vizTitleViewer").html(htmlsanitize(t)),e&&this.domRoot.find("#vizDescriptionViewer").html(htmlsanitize(e))):this.domRoot.find("#vizHeader").hide()},ExecutionVisualizer.prototype.showVizHeaderEditMode=function(){this.domRoot.find("#vizHeader").show(),this.domRoot.find("#vizTitleViewer,#vizDescriptionViewer").hide(),this.domRoot.find("#vizTitleEditor,#vizDescriptionEditor").show()},ExecutionVisualizer.prototype.destroyAllAnnotationBubbles=function(){var t=this;t.allAnnotationBubbles&&$.each(t.allAnnotationBubbles,function(t,e){e.destroyQTip()}),this.domRoot.find("#pyCodeOutputDiv").unbind("scroll"),t.allAnnotationBubbles=null},ExecutionVisualizer.prototype.initStepAnnotation=function(){var t=this.curTrace[this.curInstr];t.stepAnnotation?(this.domRoot.find("#stepAnnotationViewer").html(htmlsanitize(t.stepAnnotation)),this.domRoot.find("#stepAnnotationEditor").val(t.stepAnnotation)):(this.domRoot.find("#stepAnnotationViewer").html(""),this.domRoot.find("#stepAnnotationEditor").val(""))},ExecutionVisualizer.prototype.initAllAnnotationBubbles=function(){var i=this,n=(i.destroyAllAnnotationBubbles(),[]),r=($.each(this.domRoot.find("#pyCodeOutput .cod"),function(t,e){n.push($(e).attr("id"))}),[]),a=($.each(this.domRoot.find(".heapObject"),function(t,e){r.push($(e).attr("id"))}),[]),s=($.each(this.domRoot.find(".variableTr"),function(t,e){a.push($(e).attr("id"))}),[]);$.each(this.domRoot.find(".stackFrame"),function(t,e){s.push($(e).attr("id"))}),i.allAnnotationBubbles=[],$.each(n,function(t,e){i.allAnnotationBubbles.push(new AnnotationBubble(i,"codeline",e))}),$.each(r,function(t,e){i.allAnnotationBubbles.push(new AnnotationBubble(i,"object",e))}),$.each(a,function(t,e){i.allAnnotationBubbles.push(new AnnotationBubble(i,"variable",e))}),$.each(s,function(t,e){i.allAnnotationBubbles.push(new AnnotationBubble(i,"frame",e))}),this.domRoot.find("#pyCodeOutputDiv").scroll(function(){$.each(i.allAnnotationBubbles,function(t,e){"codeline"==e.type&&e.redrawCodelineBubble()})})},ExecutionVisualizer.prototype.enterViewAnnotationsMode=function(){this.editAnnotationMode=!1;var i,n=this.curTrace[this.curInstr],t=this,e=(t.allAnnotationBubbles||n.bubbleAnnotations&&(t.initAllAnnotationBubbles(),$.each(t.allAnnotationBubbles,function(t,e){var i=n.bubbleAnnotations[e.domID];i&&e.preseedText(i)})),t.allAnnotationBubbles&&(i={},$.each(t.allAnnotationBubbles,function(t,e){e.enterViewMode(),e.text&&(i[e.domID]=e.text)}),n.bubbleAnnotations=i),t.domRoot.find("#stepAnnotationEditor").val().trim());e?n.stepAnnotation=e:delete n.stepAnnotation,t.initStepAnnotation(),t.showVizHeaderViewMode(),t.redrawConnectors(),t.redrawAllAnnotationBubbles()},ExecutionVisualizer.prototype.enterEditAnnotationsMode=function(){this.editAnnotationMode=!0;var t=this,e=this.curTrace[this.curInstr];t.allAnnotationBubbles||t.initAllAnnotationBubbles(),$.each(t.allAnnotationBubbles,function(t,e){e.enterEditMode()}),e.stepAnnotation?t.domRoot.find("#stepAnnotationEditor").val(e.stepAnnotation):t.domRoot.find("#stepAnnotationEditor").val(""),t.showVizHeaderEditMode(),t.redrawConnectors(),t.redrawAllAnnotationBubbles()},ExecutionVisualizer.prototype.redrawAllAnnotationBubbles=function(){this.allAnnotationBubbles&&$.each(this.allAnnotationBubbles,function(t,e){e.redrawBubble()})},ExecutionVisualizer.prototype.findPrevBreakpoint=function(){var t=this,e=t.curInstr;if(0==t.sortedBreakpointsList.length)return-1;for(var i=1;i<t.sortedBreakpointsList.length;i++){var n=t.sortedBreakpointsList[i-1],r=t.sortedBreakpointsList[i];if(e<=n)return-1;if(e<=r)return n}var a=t.sortedBreakpointsList[t.sortedBreakpointsList.length-1];return a<e?a:-1},ExecutionVisualizer.prototype.findNextBreakpoint=function(){var t=this,e=t.curInstr;if(0==t.sortedBreakpointsList.length)return-1;if(0<=$.inArray(e,t.sortedBreakpointsList))return e+1;for(var i=0;i<t.sortedBreakpointsList.length-1;i++){var n=t.sortedBreakpointsList[i],r=t.sortedBreakpointsList[i+1];if(e<n)return n;if(n<=e&&e<r)return r}var a=t.sortedBreakpointsList[t.sortedBreakpointsList.length-1];return e<a?a:-1},ExecutionVisualizer.prototype.stepForward=function(){var t,e=this;if(!e.editAnnotationMode)return e.curInstr<e.curTrace.length-1&&(0<e.sortedBreakpointsList.length&&-1!=(t=e.findNextBreakpoint())?e.curInstr=t:e.curInstr+=1,e.updateOutput(!0),!0)},ExecutionVisualizer.prototype.stepBack=function(){var t,e=this;if(!e.editAnnotationMode)return 0<e.curInstr&&(0<e.sortedBreakpointsList.length&&-1!=(t=e.findPrevBreakpoint())?e.curInstr=t:--e.curInstr,e.updateOutput(),!0)},ExecutionVisualizer.prototype.renderSliderBreakpoints=function(){var t=this,e=(t.domRoot.find("#executionSliderFooter").empty(),t.domRoot.find("#executionSlider").width()),i=t.domRootD3.select("#executionSliderFooter").append("svg").attr("id","sliderOverlay").attr("width",e).attr("height",12),n=d3.scale.linear().domain([0,t.curTrace.length-1]).range([0,e]);i.selectAll("rect").data(t.sortedBreakpointsList).enter().append("rect").attr("x",function(t,e){return 0===t?0:n(t)-1}).attr("y",0).attr("width",2).attr("height",12).style("fill",function(t){return breakpointColor})},ExecutionVisualizer.prototype.renderPyCodeOutput=function(){var n=this;function i(){var i=[];return n.breakpoints.forEach(function(t,e){i.push(Number(t))}),i.sort(function(t,e){return t-e}),i}function r(t){$.each(t,function(t,e){n.breakpoints.set(e,1)}),n.sortedBreakpointsList=i()}function a(t,e){e=e.executionPoints,$.each(e,function(t,e){n.breakpoints.remove(e)}),n.sortedBreakpointsList=i(),d3.select(t.parentNode).select("td.lineNo").style("color",""),d3.select(t.parentNode).select("td.lineNo").style("font-weight",""),d3.select(t.parentNode).select("td.cod").style("color",""),n.renderSliderBreakpoints()}this.breakpoints=d3.map(),this.sortedBreakpointsList=[],this.codeOutputLines=[];for(var t=this.curInputCode.split("\n"),e=0;e<t.length;e++){for(var s=t[e],o={},d=(o.text=s,o.lineNumber=e+1,o.executionPoints=[],o.breakpointHere=!1,$.each(this.curTrace,function(t,e){e.line==o.lineNumber&&o.executionPoints.push(t)}),!1),l=s.split("#"),c=1;c<l.length;c++)-1!=l[c].indexOf("breakpoint")&&(d=!0);d&&0<o.executionPoints.length&&(o.breakpointHere=!0,r(o.executionPoints)),this.codeOutputLines.push(o)}n.domRoot.find("#pyCodeOutputDiv").empty();var p=this.domRootD3.select("#pyCodeOutputDiv").append("table").attr("id","pyCodeOutput").selectAll("tr").data(this.codeOutputLines).enter().append("tr").selectAll("td").data(function(t,e){return[t,t]}).enter().append("td").attr("class",function(t,e){return 0==e?"lineNo":"cod"}).attr("id",function(t,e){return 0==e?"lineNo"+t.lineNumber:n.generateID("cod"+t.lineNumber)}).html(function(t,e){return 0==e?t.lineNumber:htmlspecialchars(t.text)});n.params.arrowLines&&(n.domRoot.find("#pyCodeOutput tr:first").prepend('<td id="gutterTD" valign="top" rowspan="'+this.codeOutputLines.length+'"><svg id="leftCodeGutterSVG"/></td>'),n.domRootD3.select("svg#leftCodeGutterSVG").append("polygon").attr("id","prevLineArrow").attr("points",SVG_ARROW_POLYGON).attr("fill",lightArrowColor),n.domRootD3.select("svg#leftCodeGutterSVG").append("polygon").attr("id","curLineArrow").attr("points",SVG_ARROW_POLYGON).attr("fill",darkArrowColor)),p.style("cursor",function(t,e){t=t.executionPoints;if(t&&0!=t.length)return"pointer"}).on("click",function(t,e){var i=t.executionPoints;i&&0!=i.length&&(t.breakpointHere=!t.breakpointHere,t.breakpointHere?(i=this,r(t.executionPoints),d3.select(i.parentNode).select("td.lineNo").style("color",breakpointColor),d3.select(i.parentNode).select("td.lineNo").style("font-weight","bold"),d3.select(i.parentNode).select("td.cod").style("color",breakpointColor),n.renderSliderBreakpoints()):a(this,t))})},ExecutionVisualizer.prototype.renderStdout=function(){var t,e,i=this.curTrace[this.curInstr];!this.params.hideOutput&&0<this.numStdoutLines?(this.domRoot.find("#progOutputs").show(),e=(t=this.domRoot.find("#pyStdout")).scrollLeft(),t.val(i.stdout.rtrim()),t.scrollLeft(e),t.scrollTop(t[0].scrollHeight)):this.domRoot.find("#progOutputs").hide()},ExecutionVisualizer.prototype.updateCurPrevLines=function(){var t=this,e=t.curTrace.length,e=t.curInstr===e-1,e=!t.instrLimitReached&&e,i=null,n=null,r=t.curTrace[t.curInstr],a=!1,s="return"==r.event,o=!1;if(0<t.curInstr&&(n=t.curTrace[t.curInstr-1].line,o="return"==t.curTrace[t.curInstr-1].event)){for(var d=t.curInstr-1,l=t.curTrace[d].stack_to_render,c=(assert(0<l.length),l[l.length-1].frame_id);0<=d;){var p=t.curTrace[d];if("call"==p.event&&p.stack_to_render)if(p.stack_to_render[p.stack_to_render.length-1].frame_id==c)break;d--}0<d&&(n=t.curTrace[d-1].line,o=!1)}"exception"!=r.event&&"uncaught_exception"!=r.event||(assert(r.exception_msg),a=!0,t.curLineExceptionMsg=r.exception_msg),i=r.line,t.curLineNumber=i=e&&!a&&n==i?null:i,t.prevLineNumber=n,t.curLineIsReturn=s,t.prevLineIsReturn=o},ExecutionVisualizer.prototype.updateOutput=function(t){this.params.hideCode?this.updateOutputMini():this.updateOutputFull(t),this.renderStdout(),this.try_hook("end_updateOutput",{myViz:this})},ExecutionVisualizer.prototype.updateOutputFull=function(L){assert(this.curTrace),assert(!this.params.hideCode);var t,A,w,E,C,e,i,x=this;function n(){var t=!x.instrLimitReached&&E,e=x.domRoot.find("#pyCodeOutputDiv"),i=null,n=null,r=void 0,a=void 0,s="return"==C.event,o=!1;if(0<x.curInstr){if(n=x.curTrace[x.curInstr-1].line,o="return"==x.curTrace[x.curInstr-1].event){for(var d=x.curInstr-1,l=x.curTrace[d].stack_to_render,c=(assert(0<l.length),l[l.length-1].frame_id);0<=d;){var p=x.curTrace[d];if("call"==p.event&&p.stack_to_render)if(p.stack_to_render[p.stack_to_render.length-1].frame_id==c)break;d--}0<d&&(n=x.curTrace[d-1].line,L=o=!1)}x.pyCrazyMode&&((l=x.curTrace[x.curInstr-1]).column,r=void 0!==l.expr_start_col?l.expr_start_col:l.column,a=void 0!==l.expr_width?l.expr_width:1)}if(i=C.line,x.pyCrazyMode){var l=C.column,u=void 0!==C.expr_start_col?C.expr_start_col:l,h=void 0!==C.expr_width?C.expr_width:1,l=x.codeOutputLines[i-1],m=(assert(l.lineNumber==i),l.text);if($.each(x.codeOutputLines,function(t,e){var i=x.generateID("cod"+e.lineNumber);x.domRoot.find("#"+i).html(htmlspecialchars(e.text))}),n==i){for(var f="",b=0;b<m.length;b++){var v=u<=b&&b<u+h,g=r<=b&&b<r+a,y=htmlspecialchars(m[b]);f+=v&&g?'<span class="pycrazy-highlight-prev-and-cur">'+y+"</span>":g?'<span class="pycrazy-highlight-prev">'+y+"</span>":v?'<span class="pycrazy-highlight-cur">'+y+"</span>":y}assert(f)}else{n&&(l=htmlWithHighlight(x.codeOutputLines[n-1].text,r,a,"pycrazy-highlight-prev"),x.domRoot.find("#"+x.generateID("cod"+n)).html(l));f=htmlWithHighlight(m,u,h,"pycrazy-highlight-cur")}x.domRoot.find("#"+x.generateID("cod"+i)).html(f)}var I,_,R,T,l=o?Math.floor(x.codeRowHeight/3):0,D=s?Math.floor(x.codeRowHeight/3):0;t&&!w&&(n==i?i=null:D-=2),x.params.arrowLines&&(n?(I=x.domRootD3.select("#prevLineArrow"),_="translate(0, "+((n-1)*x.codeRowHeight+x.arrowOffsetY+l)+")",L?I.transition().duration(200).attr("fill","white").each("end",function(){I.attr("transform",_).attr("fill",lightArrowColor),A.find("#prevLineArrow").show()}):(I.attr("transform",_),A.find("#prevLineArrow").show())):A.find("#prevLineArrow").hide(),i?(t=x.domRootD3.select("#curLineArrow"),l="translate(0, "+((i-1)*x.codeRowHeight+x.arrowOffsetY+D)+")",(L?t.transition().delay(200).duration(250):t).attr("transform",l),A.find("#curLineArrow").show()):A.find("#curLineArrow").hide()),x.domRootD3.selectAll("#pyCodeOutputDiv td.cod").style("border-top",function(t){return w&&t.lineNumber==C.line?"1px solid "+errorColor:""}).style("border-bottom",function(t){return w&&t.lineNumber==C.line?"1px solid "+errorColor:""}),x.params.highlightLines&&(x.domRoot.find("#pyCodeOutputDiv td.cod").removeClass("highlight-prev"),x.domRoot.find("#pyCodeOutputDiv td.cod").removeClass("highlight-cur"),i&&x.domRoot.find("#"+x.generateID("cod"+i)).addClass("highlight-cur"),n)&&x.domRoot.find("#"+x.generateID("cod"+n)).addClass("highlight-prev"),D=C.line,D=x.domRoot.find("#lineNo"+D).offset().top,t=e.offset().top,e.scrollTop(),l=e.height(),t<=D&&D<t+l-30||(D=C.line,D=x.domRoot.find("#lineNo"+D).offset().top,t=e.offset().top,R=e.scrollTop(),T=e.height(),e.stop(),e.animate({scrollTop:R+(D-t-Math.round(T/2))},300)),x.curLineNumber=i,x.prevLineNumber=n,x.curLineIsReturn=s,x.prevLineIsReturn=o}x.domRoot.is(":visible")&&(x.curLineNumber=void 0,x.prevLineNumber=void 0,x.curLineIsReturn=void 0,x.prevLineIsReturn=void 0,x.curLineExceptionMsg=void 0,x.codeHorizontalOverflow=x.domRoot.find("#pyCodeOutput").width()-x.domRoot.find("#pyCodeOutputDiv").width(),x.codeHorizontalOverflow<0&&(x.codeHorizontalOverflow=0),t=x.domRoot.find("#dataViz").height(),A=x.domRoot.find("svg#leftCodeGutterSVG"),!x.leftGutterSvgInitialized&&x.params.arrowLines&&(A.height(A.parent().height()),e=x.domRoot.find("table#pyCodeOutput tr:first").offset().top,x.codeRowHeight=x.domRoot.find("table#pyCodeOutput td.cod:first").height(),this.codeOutputLines&&1<this.codeOutputLines.length&&(i=x.domRoot.find("table#pyCodeOutput tr:nth-child(2)").offset().top,x.codeRowHeight=i-e),assert(0<x.codeRowHeight),i=A.offset().top-e,x.arrowOffsetY=Math.floor(x.codeRowHeight/2-SVG_ARROW_HEIGHT/2)-i,x.leftGutterSvgInitialized=!0),x.params.arrowLines&&(assert(void 0!==x.arrowOffsetY),assert(void 0!==x.codeRowHeight),assert(0<=x.arrowOffsetY&&x.arrowOffsetY<=x.codeRowHeight)),this.params.updateOutputCallback&&this.params.updateOutputCallback(this),C=this.curTrace[this.curInstr],w=!1,C.question&&$("#"+C.question.div).modal({position:["25%","50%"]}),x.params.debugMode&&(console.log("updateOutputFull",C),x.debugMode=!0),e=this.curTrace.length,E=this.curInstr==e-1,i=x.domRoot.find("#vcrControls"),E?this.promptForUserInput||this.promptForMouseInput?i.find("#curInstr").html('<b><font color="'+brightRed+'">Enter user input below:</font></b>'):this.instrLimitReached?i.find("#curInstr").html("Instruction limit reached"):i.find("#curInstr").html("Program terminated"):i.find("#curInstr").html("Step "+String(this.curInstr+1)+" of "+String(e-1)),i.find("#jmpFirstInstr").attr("disabled",!1),i.find("#jmpStepBack").attr("disabled",!1),i.find("#jmpStepFwd").attr("disabled",!1),i.find("#jmpLastInstr").attr("disabled",!1),0==this.curInstr&&(i.find("#jmpFirstInstr").attr("disabled",!0),i.find("#jmpStepBack").attr("disabled",!0)),E&&(i.find("#jmpLastInstr").attr("disabled",!0),i.find("#jmpStepFwd").attr("disabled",!0)),x.domRoot.find("#executionSlider").slider("value",this.curInstr),"exception"==C.event||"uncaught_exception"==C.event?(assert(C.exception_msg),"Unknown error"==C.exception_msg?x.domRoot.find("#errorOutput").html("Unknown error: Please email a bug report to philip@pgbovine.net"):x.domRoot.find("#errorOutput").html(htmlspecialchars(C.exception_msg)),x.domRoot.find("#errorOutput").show(),w=!0,x.curLineExceptionMsg=C.exception_msg):this.instrLimitReached||x.domRoot.find("#errorOutput").hide(),C.line&&n(),x.domRoot.find("#htmlOutputDiv").empty(),C.html_output&&(C.css_output&&x.domRoot.find("#htmlOutputDiv").append('<style type="text/css">'+C.css_output+"</style>"),x.domRoot.find("#htmlOutputDiv").append(C.html_output),C.js_output)&&x.domRoot.find("#htmlOutputDiv").append('<script type="text/javascript">'+C.js_output+"<\/script>"),C=this.curTrace[this.curInstr],e=this.curTraceLayouts[this.curInstr],this.renderDataStructures(C,e),this.enterViewAnnotationsMode(),x.domRoot.find("#dataViz").height()!=t&&this.params.heightChangeCallback&&this.params.heightChangeCallback(this),(i=x.domRoot.find("#rawUserInputDiv")).hide(),E)&&x.executeCodeWithRawInputFunc&&x.promptForUserInput&&i.show()},ExecutionVisualizer.prototype.updateOutputMini=function(){assert(this.params.hideCode);var t=this.curTrace[this.curInstr],e=this.curTraceLayouts[this.curInstr];this.renderDataStructures(t,e),this.enterViewAnnotationsMode()},ExecutionVisualizer.prototype.renderStep=function(t){assert(0<=t),assert(t<this.curTrace.length),this.curInstr!=t&&(this.curInstr=t,this.updateOutput())},ExecutionVisualizer.prototype.isCppMode=function(){return"c"===this.params.lang||"cpp"===this.params.lang},ExecutionVisualizer.prototype.precomputeCurTraceLayouts=function(){this.curTraceLayouts=[],this.curTraceLayouts.push([]);var u=this;assert(0<this.curTrace.length),$.each(this.curTrace,function(t,a){var e=u.curTraceLayouts[u.curTraceLayouts.length-1],d=$.extend(!0,[],e),l=d3.map(),c=($.each(d,function(t,e){for(var i=1;i<e.length;i++)l.set(e[i],1)}),d3.map());function p(t,i,n){var e,r=a.heap[t];if(u.isCppMode()){if(!r)return}else assert(r);t=r,((e=u.try_hook("isLinearObj",{heapObj:t}))[0]?e[1]:"LIST"==t[0]||"TUPLE"==t[0]||"SET"==t[0])?$.each(r,function(t,e){t<1||u.isPrimitiveType(e)||(t=getRefID(e),u.disableHeapNesting?s(t,[],[]):s(t,i,n))}):"DICT"==r[0]?$.each(r,function(t,e){t<1||(u.disableHeapNesting&&(t=e[0],u.isPrimitiveType(t)||s(getRefID(t),[],[])),t=e[1],u.isPrimitiveType(t))||(e=getRefID(t),u.structurallyEquivalent(r,a.heap[e])?s(e,i,n):u.disableHeapNesting&&s(e,[],[]))}):"INSTANCE"==r[0]||"CLASS"==r[0]?jQuery.each(r,function(t,e){t<("INSTANCE"==r[0]?2:3)||(u.disableHeapNesting&&(t=e[0],u.isPrimitiveType(t)||s(getRefID(t),[],[])),t=e[1],u.isPrimitiveType(t))||(e=getRefID(t),u.structurallyEquivalent(r,a.heap[e])?s(e,i,n):u.disableHeapNesting&&s(e,[],[]))}):"C_ARRAY"!=r[0]&&"C_STRUCT"!=r[0]||o(r)}function s(t,e,i){if(!c.has(t)){var n=function(t){for(var e=0;e<d.length;e++){var i=d[e],n=i.indexOf(t);if(0<n)return{row:i,index:n}}return null}(t),r=c.has(t);if(c.set(t,1),n){var a=n.row,n=n.index;if(l.remove(t),!r&&1<i.length){for(var s=[n,0],o=1;o<i.length;o++)s.push(i[o]),l.remove(i[o]);a.splice.apply(a,s),i.splice(0,i.length)}p(t,a,[])}else if(0==i.length&&i.push("row"+t),i.push(t),p(t,e,i),0<i.length){if(e&&0<e.length)for(o=1;o<i.length;o++)e.push(i[o]);else d.push($.extend(!0,[],i));for(o=1;o<i.length;o++)l.remove(i[o]);i.splice(0,i.length)}}}function o(t){t&&(isHeapRef(t,a.heap)&&s(getRefID(t),null,[]),"C_ARRAY"===(t=t)[0]?$.each(t,function(t,e){t<2||o(e)}):"C_STRUCT"===t[0]&&$.each(t,function(t,e){t<3||o(e[1])}))}$.each(a.ordered_globals,function(t,e){e=a.globals[e];void 0!==e&&(u.isCppMode()?o(e):u.isPrimitiveType(e)||s(getRefID(e),null,[]))}),$.each(a.stack_to_render,function(t,i){$.each(i.ordered_varnames,function(t,e){e=i.encoded_locals[e];u.isCppMode()?o(e):u.isPrimitiveType(e)||s(getRefID(e),null,[])})}),l.forEach(function(n,t){n=Number(n),$.each(d,function(t,e){var i=e.indexOf(n);0<i&&e.splice(i,1)})}),d=d.filter(function(t){return 1<t.length}),u.curTraceLayouts.push(d)}),this.curTraceLayouts.splice(0,1),assert(this.curTrace.length==this.curTraceLayouts.length)};var heapPtrSrcRE=/__heap_pointer_src_/,rightwardNudgeHack=!0,highlightedLineColor=(ExecutionVisualizer.prototype.renderDataStructures=function(r,t){var a,n,i,s,e,l,o,d,c=this;function p(t,e){!c.isCppMode()||c.domRoot.find("#"+e).length?c.jsPlumbInstance.connect({source:t,target:e,scope:"varValuePointer"}):c.domRoot.find("#"+t).html("💩")}function u(t,e){0!=c.domRoot.find("#"+t).length&&0!=c.domRoot.find("#"+e).length&&(c.jsPlumbInstance.connect({source:t,target:e,anchors:["LeftMiddle","LeftMiddle"],connector:["Bezier",{curviness:45}],endpoint:["Dot",{radius:4}],scope:"frameParentPointer"}),0)}function h(i){c.jsPlumbInstance.select().each(function(t){var e=t.source.closest(".stackFrame");e.attr("id")==i?(t.setPaintStyle({lineWidth:1,strokeStyle:connectorBaseColor}),t.endpoints[0].setPaintStyle({fillStyle:connectorBaseColor}),$(t.canvas).css("z-index",1e3)):c.jsPlumbManager.heapConnectionEndpointIDs.has(t.endpoints[0].elementId)||0<e.length&&(t.setPaintStyle({lineWidth:1,strokeStyle:connectorInactiveColor}),t.endpoints[0].setPaintStyle({fillStyle:connectorInactiveColor}),$(t.canvas).css("z-index",0))}),c.domRoot.find(".stackFrame").removeClass("highlightedStackFrame"),c.domRoot.find("#"+i).addClass("highlightedStackFrame")}c.tabularView||(c.resetJsPlumbManager(),a=d3.map(),c.jsPlumbInstance.select({scope:"varValuePointer"}).each(function(t){t.sourceId.match(heapPtrSrcRE)||a.set(t.sourceId,t.targetId)}),n=d3.map(),c.jsPlumbInstance.select({scope:"frameParentPointer"}).each(function(t){n.set(t.sourceId,t.targetId)}),$.each(t,function(t,e){for(var i=0;i<e.length;i++){var n=e[i],n=c.generateHeapObjID(n,c.curInstr);c.jsPlumbManager.renderedHeapObjectIDs.set(n,1)}}),c.domRoot.find("#heap").empty().html('<div id="heapHeader">Objects</div>'),(t=c.domRootD3.select("#heap").selectAll("table.heapRow").attr("id",function(t,e){return"heapRow"+e}).data(t,function(t){return t[0]})).enter().append("table").attr("id",function(t,e){return"heapRow"+e}).attr("class","heapRow"),t.exit().each(function(t,e){$(this).empty()}).remove(),(t=t.selectAll("td.toplevelHeapObject").data(function(t,e){return t.slice(1,t.length)},function(t){return t})).enter().append("td").attr("class","toplevelHeapObject").attr("id",function(t,e){return"toplevel_heap_object_"+t}),t.order().each(function(t,e){$(this).empty(),c.isCppMode()&&void 0===r.heap[t]||c.renderCompoundObject(t,c.curInstr,$(this),!0)}),t.exit().each(function(t,e){$(this).empty()}).remove(),i=[],$.each(r.ordered_globals,function(t,e){void 0!==r.globals[e]&&i.push(e)}),s=c.generateID("globals"),t=c.generateID("global_table"),(t=c.domRootD3.select("#"+t).selectAll("tr").data(i,function(t){return t})).enter().append("tr").attr("class","variableTr").attr("id",function(t,e){return c.generateID(varnameToCssID("global__"+t+"_tr"))}),(e=t.selectAll("td.stackFrameVar,td.stackFrameValue").data(function(t,e){return[t,t]})).enter().append("td").attr("class",function(t,e){return 0==e?"stackFrameVar":"stackFrameValue"}),e.order().each(function(t,e){var i,n;0==e?$(this).html(t):($(this).empty(),e=c.generateID("global__"+varnameToCssID(t)),a.remove(e),t=r.globals[t],c.isPrimitiveType(t)?c.renderPrimitiveObject(t,$(this)):"C_STRUCT"===t[0]||"C_ARRAY"===t[0]?c.renderCStructArray(t,c.curInstr,$(this)):(i=c.generateHeapObjID(getRefID(t),c.curInstr),c.textualMemoryLabels?(n=e+"_text_label",$(this).append('<div class="objectIdLabel" id="'+n+'">id'+getRefID(t)+"</div>"),$(this).find("div#"+n).hover(function(){c.jsPlumbInstance.connect({source:n,target:i,scope:"varValuePointer"})},function(){c.jsPlumbInstance.select({source:n}).detach()})):($(this).append('<div class="stack_pointer" id="'+e+'">&nbsp;</div>'),assert(!c.jsPlumbManager.connectionEndpointIDs.has(e)),c.jsPlumbManager.connectionEndpointIDs.set(e,i))))}),e.exit().each(function(t,e){$(this).empty()}).remove(),t.exit().each(function(t,e){$(this).find(".stack_pointer").each(function(t,e){a.remove($(e).attr("id"))}),$(this).empty()}).remove(),0==r.ordered_globals.length?this.domRoot.find("#"+s).hide():this.domRoot.find("#"+s).show(),(t=(e=c.domRootD3.select("#stack").selectAll("div.stackFrame,div.zombieStackFrame").data(r.stack_to_render,function(t){return t.unique_hash})).enter().append("div").attr("class",function(t,e){return t.is_zombie?"zombieStackFrame":"stackFrame"}).attr("id",function(t,e){return t.is_zombie?c.generateID("zombie_stack"+e):c.generateID("stack"+e)}).attr("data-frame_id",function(t,e){return t.frame_id}).attr("data-parent_frame_id",function(t,e){return 0<t.parent_frame_id_list.length?t.parent_frame_id_list[0]:null}).each(function(t,e){var n,i;c.drawParentPointers&&(n=$(this).attr("id"),0<t.parent_frame_id_list.length?(i=t.parent_frame_id_list[0],c.domRoot.find("div#stack [data-frame_id="+i+"]").each(function(t,e){var i=$(this).attr("id");c.jsPlumbManager.parentPointerConnectionEndpointIDs.set(n,i)})):0<r.ordered_globals.length&&c.jsPlumbManager.parentPointerConnectionEndpointIDs.set(n,s),i=t.frame_id,c.domRoot.find("div#stack [data-parent_frame_id="+i+"]").each(function(t,e){var i=$(this).attr("id");c.jsPlumbManager.parentPointerConnectionEndpointIDs.set(i,n)}))})).append("div").attr("class","stackFrameHeader").html(function(t,e){var i=htmlspecialchars(t.func_name).replace("&lt;lambda&gt;","λ").replace("\n","<br/>");return(t.is_parent||c.showAllFrameLabels)&&(i="f"+t.frame_id+": "+i),0<t.parent_frame_id_list.length?i=i+" [parent=f"+t.parent_frame_id_list[0]+"]":c.showAllFrameLabels&&(i+=" [parent=Global]"),i}),t.append("table").attr("class","stackFrameVarTable"),(t=e.order().select("table").selectAll("tr").data(function(e){return e.ordered_varnames.map(function(t){return{varname:t,frame:e}})},function(t){if(t)return t.varname})).enter().append("tr").attr("class","variableTr").attr("id",function(t,e){return c.generateID(varnameToCssID(t.frame.unique_hash+"__"+t.varname+"_tr"))}),(o=t.selectAll("td.stackFrameVar,td.stackFrameValue").data(function(t,e){return[t,t]})).enter().append("td").attr("class",function(t,e){return 0==e?"stackFrameVar":"stackFrameValue"}),o.order().each(function(t,e){var i,n,r=t.varname,t=t.frame;0==e?"__return__"==r?$(this).html('<span class="retval">Return<br/>value</span>'):$(this).html(r):($(this).empty(),e=c.generateID(varnameToCssID(t.unique_hash+"__"+r)),a.remove(e),t=t.encoded_locals[r],c.isPrimitiveType(t)?c.renderPrimitiveObject(t,$(this)):"C_STRUCT"===t[0]||"C_ARRAY"===t[0]?c.renderCStructArray(t,c.curInstr,$(this)):(i=c.generateHeapObjID(getRefID(t),c.curInstr),c.textualMemoryLabels?(n=e+"_text_label",$(this).append('<div class="objectIdLabel" id="'+n+'">id'+getRefID(t)+"</div>"),$(this).find("div#"+n).hover(function(){c.jsPlumbInstance.connect({source:n,target:i,scope:"varValuePointer"})},function(){c.jsPlumbInstance.select({source:n}).detach()})):($(this).append('<div class="stack_pointer" id="'+e+'">&nbsp;</div>'),assert(!c.jsPlumbManager.connectionEndpointIDs.has(e)),c.jsPlumbManager.connectionEndpointIDs.set(e,i))))}),o.exit().each(function(t,e){$(this).empty()}).remove(),t.exit().each(function(t,e){$(this).find(".stack_pointer").each(function(t,e){a.remove($(e).attr("id"))}),$(this).empty()}).remove(),e.exit().each(function(t,e){$(this).find(".stack_pointer").each(function(t,e){a.remove($(e).attr("id"))});var i=$(this).attr("id");n.forEach(function(t,e){t!=i&&e!=i||n.remove(t)}),$(this).empty()}).remove(),rightwardNudgeHack&&(l={},(o=c.jsPlumbManager.heapConnectionEndpointIDs.keys()).sort(),$.each(o,function(t,e){var i,n,r=c.jsPlumbManager.heapConnectionEndpointIDs.get(e),e=c.domRoot.find("#"+e),a=e.closest(".heapObject"),r=c.domRoot.find("#"+r),s=(assert("heapObject"==r.attr("class")),a.closest(".heapRow")),o=r.closest(".heapRow"),d=s.attr("id"),s=o.attr("id");d!=s&&(o=e.offset().left,a.offset().left,(e=r.offset().left)<o)&&(r.css("margin-left","+="+(i=o-e+32)),void 0===(n=l[d])&&(n=d3.map(),l[d]=n),n.set(s,1),a=l[s])&&a.forEach(function(t,e){t!=d&&(c.domRoot.find("#"+t).css("margin-left","+="+i),n.set(t,1))})})),c.jsPlumbInstance.reset(),c.textualMemoryLabels||(c.isCppMode()||a.forEach(p),c.jsPlumbManager.connectionEndpointIDs.forEach(p)),c.drawParentPointers&&(n.forEach(u),c.jsPlumbManager.parentPointerConnectionEndpointIDs.forEach(u)),d=!1,$.each(r.stack_to_render,function(t,e){e.is_highlighted&&(h(c.generateID("stack"+t)),d=!0)}),d||h(c.generateID("globals")),c.try_hook("end_renderDataStructures",{myViz:c}))},ExecutionVisualizer.prototype.renderTabularView=function(){var n=this,s=(n.resetJsPlumbManager(),[]),o={},d=[],r=($.each(n.curTrace,function(t,e){$.each(e.ordered_globals,function(t,e){-1===$.inArray(e,s)&&s.push(e)}),$.each(e.stack_to_render,function(t,e){var i=o[e.func_name];void 0===i&&(i=[],o[e.func_name]=i,d.push(e.func_name)),$.each(e.ordered_varnames,function(t,e){-1===$.inArray(e,i)&&"__return__"!==e&&i.push(e)})})}),["Step"]);$.each(s,function(t,e){r.push(e)}),$.each(d,function(t,i){$.each(o[i],function(t,e){r.push(i+":"+e)})});var t=n.domRootD3.select("#optTabularView").append("table"),e=(t.attr("id","optTable"),t.append("thead").attr("class","stepTableThead").append("tr")),e=(e.attr("class","stepTableTr"),e.selectAll("thead td").data(r).enter().append("td").attr("class","stepTableTd").html(function(t){return t}),t.append("tbody")),i=(e.attr("class","stepTableTbody"),[]);$.each(n.curTrace,function(t,e){i.push([t,e])});e.selectAll("tbody tr").data(i).enter().append("tr").attr("step",function(t,e){return e}).attr("class","stepTableTr").selectAll("td").data(function(t){return i=t[1],r=[""],$.each(s,function(t,e){r.push(i.globals[e])}),a=null,$.each(i.stack_to_render,function(t,e){e.is_highlighted&&(a=e)}),$.each(d,function(t,n){$.each(o[n],function(t,e){var i=!1;a&&n==a.func_name&&(e=a.encoded_locals[e])&&(r.push(e),i=!0),i||r.push(void 0)})}),r;var i,r,a}).enter().append("td").attr("class","stepTableTd").each(function(t,e){$(this).empty();var i=parseInt($(this).closest("tr").attr("step"));0==e?$(this).html(i+1):void 0!==t&&n.renderNestedObject(t,i,$(this),"tabular")});n.jsPlumbInstance.reset(),n.jsPlumbManager.connectionEndpointIDs.forEach(function(t,e){n.jsPlumbInstance.connect({source:t,target:e,scope:"varValuePointer",anchors:["TopCenter","LeftMiddle"]})})},ExecutionVisualizer.prototype.renderPrimitiveObject=function(t,e){var i,n,r,a,s,o,d,l=this;this.try_hook("renderPrimitiveObject",{obj:t,d3DomElement:e})[0]||(i=typeof t,null==t?e.append('<span class="nullObj">'+this.getRealLabel("None")+"</span>"):"number"==i?e.append('<span class="numberObj">'+t+"</span>"):"boolean"==i?t?e.append('<span class="boolObj">'+this.getRealLabel("True")+"</span>"):e.append('<span class="boolObj">'+this.getRealLabel("False")+"</span>"):"string"==i?(o=(o=(o=htmlspecialchars(t)).replace(new RegExp("\n","g"),"<br/>")).replace(new RegExp('"',"g"),'\\"'),e.append('<span class="stringObj">'+(o='"'+o+'"')+"</span>")):"object"==i?"C_DATA"==t[0]?("short int"===(i=t[2])?i="short":"short unsigned int"===i?i="unsigned short":"long int"===i?i="long":"long long int"===i?i="long long":"long unsigned int"===i?i="unsigned long":"long long unsigned int"===i&&(i="unsigned long long int"),s="pointer"===i&&"<UNINITIALIZED>"!==t[3]&&"<UNALLOCATED>"!==t[3],a=t[1],n="",l.debugMode&&(n=a+"<br/>"),r=l.generateHeapObjID("cdata_"+a,l.curInstr),s?(e.append('<div id="'+r+'" class="cdataHeader">'+n+i+"</div>"),s=t[3],a=l.generateHeapObjID("ptrSrc_"+a,l.curInstr),s=l.generateHeapObjID("cdata_"+s,l.curInstr),d="",l.debugMode&&(d=s),e.append('<div style="width: 10px;" id="'+a+'" class="cdataElt">&nbsp;'+d+"</div>"),assert(!l.jsPlumbManager.connectionEndpointIDs.has(a)),l.jsPlumbManager.connectionEndpointIDs.set(a,s)):(e.append('<div class="cdataHeader">'+n+i+"</div>"),d="",d="string"==typeof t[3]?"<UNINITIALIZED>"===(o=t[3])?'<span class="cdataUninit">?</span>':"<UNALLOCATED>"==o?"💀":htmlspecialchars(o="'"+(o=(o=(o=o.replace(new RegExp("\n","g"),"\\n")).replace(new RegExp("\t","g"),"\\t")).replace(new RegExp('"',"g"),'\\"'))+"'"):htmlspecialchars(t[3]),e.append('<div id="'+r+'" class="cdataElt">'+d+"</div>"))):(assert("SPECIAL_FLOAT"==t[0]||"JS_SPECIAL_VAL"==t[0]),e.append('<span class="numberObj">'+t[1]+"</span>")):assert(!1))},ExecutionVisualizer.prototype.renderNestedObject=function(t,e,i){this.isPrimitiveType(t)?this.renderPrimitiveObject(t,i):"REF"===t[0]?this.renderCompoundObject(getRefID(t),e,i,!1):(assert("C_STRUCT"===t[0]||"C_ARRAY"===t[0]),this.renderCStructArray(t,e,i))},ExecutionVisualizer.prototype.renderCompoundObject=function(t,r,e,i){var n,a,s,o,d,l,c,p,u,h,m,f,b,v,g=this,y=g.generateHeapObjID(t,r);!i&&g.jsPlumbManager.renderedHeapObjectIDs.has(y)?(s=g.generateID("heap_pointer_src_"+g.jsPlumbManager.heap_pointer_src_id),g.jsPlumbManager.heap_pointer_src_id++,n=y,g.textualMemoryLabels?(e.append('<div class="objectIdLabel" id="'+(a=s+"_text_label")+'">id'+t+"</div>"),g.domRoot.find("div#"+a).hover(function(){g.jsPlumbInstance.connect({source:a,target:n,scope:"varValuePointer"})},function(){g.jsPlumbInstance.select({source:a}).detach()})):(e.append('<div id="'+s+'">&nbsp;</div>'),assert(!g.jsPlumbManager.connectionEndpointIDs.has(s)),g.jsPlumbManager.connectionEndpointIDs.set(s,n),assert(!g.jsPlumbManager.heapConnectionEndpointIDs.has(s)),g.jsPlumbManager.heapConnectionEndpointIDs.set(s,n))):(e.append('<div class="heapObject" id="'+y+'"></div>'),e=g.domRoot.find("#"+y),g.jsPlumbManager.renderedHeapObjectIDs.set(y,1),s=g.curTrace[r].heap[t],assert($.isArray(s)),y="",g.textualMemoryLabels&&(y="id"+t+":"),g.try_hook("renderCompoundObject",{objID:t,d3DomElement:e,isTopLevel:i,obj:s,typeLabelPrefix:y,stepNum:r,myViz:g})[0]||("LIST"==s[0]||"TUPLE"==s[0]||"SET"==s[0]||"DICT"==s[0]?(o=s[0].toLowerCase(),assert(1<=s.length),1==s.length?e.append('<div class="typeLabel">'+y+" empty "+g.getRealLabel(o)+"</div>"):(e.append('<div class="typeLabel">'+y+g.getRealLabel(o)+"</div>"),e.append('<table class="'+o+'Tbl"></table>'),m=e.children("table"),"LIST"==s[0]||"TUPLE"==s[0]?(m.append("<tr></tr><tr></tr>"),d=m.find("tr:first"),l=m.find("tr:last"),$.each(s,function(t,e){t<1||(d.append('<td class="'+o+'Header"></td>'),d.find("td:last").append(t-1),l.append('<td class="'+o+'Elt"></td>'),g.renderNestedObject(e,r,l.find("td:last")))})):"SET"==s[0]?(t=s.length-1,3<(i=Math.round(Math.sqrt(t)))&&--i,c=Math.round(t/i),t%i&&(c+=1),jQuery.each(s,function(t,e){t<1||((t-1)%c==0&&m.append("<tr></tr>"),(t=m.find("tr:last")).append('<td class="setElt"></td>'),g.renderNestedObject(e,r,t.find("td:last")))})):"DICT"==s[0]&&$.each(s,function(t,e){var i,n;t<1||(m.append('<tr class="dictEntry"><td class="dictKey"></td><td class="dictVal"></td></tr>'),i=(t=m.find("tr:last")).find("td:first"),t=t.find("td:last"),n=e[0],e=e[1],g.renderNestedObject(n,r,i),g.renderNestedObject(e,r,t))}))):"INSTANCE"==s[0]||"CLASS"==s[0]?(t="INSTANCE"==s[0],assert(s.length>=(p=t?2:3)),t?e.append('<div class="typeLabel">'+y+s[1]+" "+g.getRealLabel("instance")+"</div>"):(i="",0<s[2].length&&(i+="[extends "+s[2].join(", ")+"] "),e.append('<div class="typeLabel">'+y+s[1]+" class "+i+'<br/><a href="#" id="attrToggleLink">hide attributes</a></div>')),s.length>p&&(e.append('<table class="'+(u=t?"inst":"class")+'Tbl"></table>'),m=e.children("table"),$.each(s,function(t,e){var i,n;t<p||(m.append('<tr class="'+u+'Entry"><td class="'+u+'Key"></td><td class="'+u+'Val"></td></tr>'),i=(t=m.find("tr:last")).find("td:first"),t=t.find("td:last"),"string"==typeof e[0]?(n=htmlspecialchars(e[0]),i.append('<span class="keyObj">'+n+"</span>")):g.renderNestedObject(e[0],r,i),g.renderNestedObject(e[1],r,t))})),t||($(e.selector+" .typeLabel #attrToggleLink").click(function(){var t=$(e.selector+" .classTbl");return t.toggle(),$(this).html((t.is(":visible")?"hide":"show")+" attributes"),t.is(":visible")?(g.classAttrsHidden[e.selector]=!1,$(this).html("hide attributes")):(g.classAttrsHidden[e.selector]=!0,$(this).html("show attributes")),g.redrawConnectors(),!1}),g.classAttrsHidden[e.selector]&&($(e.selector+" .classTbl").hide(),$(e.selector+" .typeLabel #attrToggleLink").html("show attributes")))):"INSTANCE_PPRINT"==s[0]?(e.append('<div class="typeLabel">'+y+s[1]+" instance</div>"),v=htmlspecialchars(s[2]),e.append('<table class="customObjTbl"><tr><td class="customObjElt">'+v+"</td></tr></table>")):"FUNCTION"==s[0]?(assert(3==s.length),f=htmlspecialchars(s[1]).replace("&lt;lambda&gt;","λ"),h=s[2],g.compactFuncLabels||e.append('<div class="typeLabel">'+y+g.getRealLabel("function")+"</div>"),i=g.compactFuncLabels?"func":"",h?e.append('<div class="funcObj">'+i+" "+f+" [parent=f"+h+"]</div>"):g.showAllFrameLabels?e.append('<div class="funcObj">'+i+" "+f+" [parent=Global]</div>"):e.append('<div class="funcObj">'+i+" "+f+"</div>")):"JS_FUNCTION"==s[0]?(assert(5==s.length),f=htmlspecialchars(s[1]),t=y+htmlspecialchars(s[2]),i=s[3],h=s[4],i||h||g.showAllFrameLabels?(e.append('<table class="classTbl"></table>'),(m=e.children("table")).append('<tr><td class="funcCod" colspan="2"><pre class="funcCode">'+t+"</pre></td></tr>"),i&&(assert(0<i.length),$.each(i,function(t,e){m.append('<tr class="classEntry"><td class="classKey"></td><td class="classVal"></td></tr>');var i=m.find("tr:last"),n=i.find("td:first"),i=i.find("td:last");n.append('<span class="keyObj">'+htmlspecialchars(e[0])+"</span>"),g.renderNestedObject(e[1],r,i)})),h?m.append('<tr class="classEntry"><td class="classKey">parent</td><td class="classVal">f'+h+"</td></tr>"):g.showAllFrameLabels&&m.append('<tr class="classEntry"><td class="classKey">parent</td><td class="classVal">global</td></tr>')):e.append('<pre class="funcCode">'+t+"</pre>")):"HEAP_PRIMITIVE"==s[0]?(assert(3==s.length),b=s[1],f=s[2],e.append('<div class="heapPrimitive"></div>'),e.find("div.heapPrimitive").append('<div class="typeLabel">'+y+b+"</div>"),g.renderPrimitiveObject(f,e.find("div.heapPrimitive"))):"C_STRUCT"==s[0]||"C_ARRAY"==s[0]?g.renderCStructArray(s,r,e):(assert(2==s.length),b=s[0],v=htmlspecialchars(v=s[1]),e.append('<div class="typeLabel">'+y+b+"</div>"),e.append('<table class="customObjTbl"><tr><td class="customObjElt">'+v+"</td></tr></table>"))))},ExecutionVisualizer.prototype.renderCStructArray=function(t,r,e){var i,n,a,s,o,d,l=this;"C_STRUCT"==t[0]?(assert(3<=t.length),n=t[1],i=t[2],a="",l.debugMode&&(a=n+"<br/>"),"cpp"===l.params.lang?e.append('<div class="typeLabel">'+a+"object "+i+"</div>"):e.append('<div class="typeLabel">'+a+"struct "+i+"</div>"),3<t.length&&(e.append('<table class="instTbl"></table>'),s=e.children("table"),$.each(t,function(t,e){var i,n;t<3||(s.append('<tr class="instEntry"><td class="instKey"></td><td class="instVal"></td></tr>'),i=(t=s.find("tr:last")).find("td:first"),t=t.find("td:last"),assert("string"==typeof e[0]),n=htmlspecialchars(e[0]),i.append('<span class="keyObj">'+n+"</span>"),l.renderNestedObject(e[1],r,t))}))):(assert("C_ARRAY"==t[0]),assert(2<=t.length),n=t[1],a="",l.debugMode&&(a=n+"<br/>"),e.append('<div class="typeLabel">'+a+"array</div>"),e.append('<table class="cArrayTbl"></table>'),(s=e.children("table")).append("<tr></tr><tr></tr>"),o=s.find("tr:first"),d=s.find("tr:last"),$.each(t,function(t,e){t<2||(o.append('<td class="cArrayHeader"></td>'),o.find("td:last").append(t-2),d.append('<td class="cArrayElt"></td>'),l.renderNestedObject(e,r,d.find("td:last")))}))},ExecutionVisualizer.prototype.redrawConnectors=function(){this.jsPlumbInstance.repaintEverything()},ExecutionVisualizer.prototype.getRealLabel=function(t){if("js"===this.params.lang||"ts"===this.params.lang||"ruby"===this.params.lang){if("list"===t)return"array";if("instance"===t)return"object";if("True"===t)return"true";if("False"===t)return"false"}if("js"===this.params.lang){if("dict"===t)return"Map";if("set"===t)return"Set"}if("ruby"===this.params.lang){if("dict"===t)return"hash";if("set"===t)return"Set";if("function"===t)return"method";if("None"===t)return"nil";if("Global frame"===t)return"Global Object"}return t},"#e4faeb"),highlightedLineBorderColor="#005583",highlightedLineLighterColor="#e8fff0",funcCallLineColor="#a2eebd",brightRed="#e93f34",connectorBaseColor="#005583",connectorHighlightColor=brightRed,connectorInactiveColor="#cccccc",errorColor=brightRed,breakpointColor=brightRed,darkArrowColor=brightRed,lightArrowColor="#c9e6ca";function assert(t){if(!t)throw alert("Assertion Failure (see console log for backtrace)"),"Assertion Failure"}function htmlspecialchars(t){return t="string"==typeof t?(t=(t=(t=(t=t.replace(/&/g,"&amp;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;")).replace(/ /g,"&nbsp;")).replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;"):t}function htmlsanitize(t){return t="string"==typeof t?(t=(t=t.replace(/&/g,"&amp;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;"):t}String.prototype.rtrim=function(){return this.replace(/\s*$/g,"")};var lbRE=new RegExp("\\[|{|\\(|<","g"),rbRE=new RegExp("\\]|}|\\)|>","g");function varnameToCssID(t){return t.replace(lbRE,"LeftB_").replace(rbRE,"_RightB").replace(/[!]/g,"_BANG_").replace(/[?]/g,"_QUES_").replace(/[:]/g,"_COLON_").replace(/[=]/g,"_EQ_").replace(/[.]/g,"_DOT_").replace(/ /g,"_")}function isHeapRef(t,e){return"REF"===t[0]?void 0!==e[t[1]]:"C_DATA"===t[0]&&"pointer"===t[2]&&"<UNINITIALIZED>"!=t[3]&&"<UNALLOCATED>"!=t[3]&&void 0!==e[t[3]]}function getRefID(t){return"REF"==t[0]?t[1]:(assert("C_DATA"===t[0]&&"pointer"===t[2]),assert("<UNINITIALIZED>"!=t[3]&&"<UNALLOCATED>"!=t[3]),t[3])}ExecutionVisualizer.prototype.structurallyEquivalent=function(t,e){if(this.isPrimitiveType(t)||this.isPrimitiveType(e))return!1;if(t[0]!=e[0])return!1;if(t.length!=e.length)return!1;if("LIST"!=t[0]&&"TUPLE"!=t[0]){var i=-1;if("DICT"==t[0])i=2;else{if("INSTANCE"!=t[0])return!1;i=3}for(var n=d3.map(),r=i;r<t.length;r++)n.set(t[r][0],1);for(r=i;r<e.length;r++)if(!n.has(e[r][0]))return!1}return!0},ExecutionVisualizer.prototype.isPrimitiveType=function(t){var e=this.try_hook("isPrimitiveType",{obj:t});return e[0]?e[1]:null===t||"object"!=typeof t||"SPECIAL_FLOAT"==t[0]||"JS_SPECIAL_VAL"==t[0]||"C_DATA"==t[0]};var qtipShared={show:{ready:!0,delay:0,event:null,effect:function(){$(this).show()}},hide:{fixed:!0,event:null,effect:function(){$(this).hide()}},style:{classes:"ui-tooltip-pgbootstrap"}};function AnnotationBubble(t,e,i){this.parentViz=t,this.domID=i,this.hashID="#"+i,"codeline"==(this.type=e)?(this.my="left center",this.at="right center"):"frame"==e||"variable"==e?(this.my="right center",this.at="left center"):"object"==e?(this.my="bottom left",this.at="top center"):assert(!1),this.state="invisible",this.text="",this.qtipHidden=!1}function isOutputLineVisibleForBubbles(t){var e=$("#pyCodeOutputDiv"),t=$("#"+t).offset().top,i=e.offset().top,e=(e.scrollTop(),e.height());return i<=t&&t<i+e-25}function traceQCheckMe(t,e,i){var n,r=$("#"+e).data("vis"),a=r.curInstr,s=r.curTrace[a+1],t=$("#"+t).val(),o=i.split("."),d=s;for(n in o)d=d[o[n]];i=$("#"+e+"_feedbacktext");0<t.length&&t==d?i.html("Correct"):i.html(r.curTrace[a].question.feedback)}function closeModal(t){$.modal.close(),$("#"+t).data("vis").stepForward()}AnnotationBubble.prototype.showStub=function(){assert("invisible"==this.state||"edit"==this.state),assert(""==this.text);var t=this;this.destroyQTip(),$(this.hashID).qtip($.extend({},qtipShared,{content:" ",id:this.domID,position:{my:this.my,at:this.at,adjust:{x:"codeline"==t.type?-6:0},effect:null},style:{classes:"ui-tooltip-pgbootstrap ui-tooltip-pgbootstrap-stub"}})),$(this.qTipID()).unbind("click").click(function(){t.showEditor()}),this.state="stub"},AnnotationBubble.prototype.showEditor=function(){assert("stub"==this.state||"view"==this.state||"minimized"==this.state);var t=this,e='<textarea class="bubbleInputText">'+this.text+"</textarea>";this.destroyQTip(),$(this.hashID).qtip($.extend({},qtipShared,{content:e,id:this.domID,position:{my:this.my,at:this.at,adjust:{x:"codeline"==t.type?-6:0},effect:null}})),$(this.qTipContentID()).find("textarea.bubbleInputText").blur(function(){t.text=$(this).val().trim(),t.text?t.showViewer():t.showStub()}).focus(),this.state="edit"},AnnotationBubble.prototype.bindViewerClickHandler=function(){var t=this;$(this.qTipID()).unbind("click").click(function(){t.parentViz.editAnnotationMode?t.showEditor():t.minimizeViewer()})},AnnotationBubble.prototype.showViewer=function(){assert("edit"==this.state||"invisible"==this.state),assert(this.text);this.destroyQTip(),$(this.hashID).qtip($.extend({},qtipShared,{content:htmlsanitize(this.text),id:this.domID,position:{my:this.my,at:this.at,adjust:{x:"codeline"==this.type?-6:0},effect:null}})),this.bindViewerClickHandler(),this.state="view"},AnnotationBubble.prototype.minimizeViewer=function(){assert("view"==this.state);var t=this;$(this.hashID).qtip("option","content.text"," "),$(this.qTipID()).unbind("click").click(function(){t.parentViz.editAnnotationMode?t.showEditor():t.restoreViewer()}),this.state="minimized"},AnnotationBubble.prototype.restoreViewer=function(){assert("minimized"==this.state),$(this.hashID).qtip("option","content.text",htmlsanitize(this.text)),this.bindViewerClickHandler(),this.state="view"},AnnotationBubble.prototype.makeInvisible=function(){assert("stub"==this.state||"edit"==this.state),this.destroyQTip(),this.state="invisible"},AnnotationBubble.prototype.destroyQTip=function(){$(this.hashID).qtip("destroy")},AnnotationBubble.prototype.qTipContentID=function(){return"#ui-tooltip-"+this.domID+"-content"},AnnotationBubble.prototype.qTipID=function(){return"#ui-tooltip-"+this.domID},AnnotationBubble.prototype.enterEditMode=function(){assert(this.parentViz.editAnnotationMode),"invisible"==this.state&&(this.showStub(),"codeline"==this.type)&&this.redrawCodelineBubble()},AnnotationBubble.prototype.enterViewMode=function(){assert(!this.parentViz.editAnnotationMode),"stub"==this.state?this.makeInvisible():"edit"==this.state?(this.text=$(this.qTipContentID()).find("textarea.bubbleInputText").val().trim(),this.text?(this.showViewer(),"codeline"==this.type&&this.redrawCodelineBubble()):this.makeInvisible()):"invisible"==this.state&&this.text&&(this.showViewer(),"codeline"==this.type)&&this.redrawCodelineBubble()},AnnotationBubble.prototype.preseedText=function(t){assert("invisible"==this.state),this.text=t},AnnotationBubble.prototype.redrawCodelineBubble=function(){assert("codeline"==this.type),isOutputLineVisibleForBubbles(this.domID)?(this.qtipHidden?$(this.hashID).qtip("show"):$(this.hashID).qtip("reposition"),this.qtipHidden=!1):($(this.hashID).qtip("hide"),this.qtipHidden=!0)},AnnotationBubble.prototype.redrawBubble=function(){$(this.hashID).qtip("reposition")},ExecutionVisualizer.prototype.activateJavaFrontend=function(){var i=null,e=(this.curTrace.forEach(function(t,e){"exception"!==t.event||t.line||(t.line=i),void 0!==t.stack_to_render&&t.stack_to_render.reverse(),i=t.line}),this.add_pytutor_hook("renderPrimitiveObject",function(t){var e=t.obj,t=t.d3DomElement,i=typeof e;if(null==e)t.append('<span class="nullObj">null</span>');else if("number"==i)t.append('<span class="numberObj">'+e+"</span>");else if("boolean"==i)e?t.append('<span class="boolObj">true</span>'):t.append('<span class="boolObj">false</span>');else if(e instanceof Array&&"VOID"==e[0])t.append('<span class="voidObj">void</span>');else if(e instanceof Array&&"NUMBER-LITERAL"==e[0])t.append('<span class="numberObj">'+e[1]+"</span>");else{if(!(e instanceof Array&&"CHAR-LITERAL"==e[0]))return[!1];for(var i=e[1].charCodeAt(0),e=e[1],n=i.toString(16);n.length<4;)n="0"+n;n="\\u"+n,"\n"==e?n="\\n":"\r"==e?n="\\r":"\t"==e?n="\\t":"\b"==e?n="\\b":"\f"==e?n="\\f":"'"==e?n="\\'":'"'==e?n='\\"':"\\"==e?n="\\\\":32<=i&&(n=e),t.append('<span class="stringObj">\''+n+"'</span>")}return[!0]}),this.add_pytutor_hook("isPrimitiveType",function(t){t=t.obj;return t instanceof Array&&"VOID"==t[0]||t instanceof Array&&"NUMBER-LITERAL"==t[0]||t instanceof Array&&"CHAR-LITERAL"==t[0]||t instanceof Array&&"ELIDE"==t[0]?[!0,!0]:[!1]}),this.add_pytutor_hook("end_updateOutput",function(t){var t=t.myViz,e=t.curTrace[t.curInstr];return t.params.stdin&&""!=t.params.stdin&&(e=e.stdinPosition||0,e='<span style="color:lightgray;text-decoration: line-through">'+r(t.params.stdin.substr(0,e))+"</span>"+r(t.params.stdin.substr(e)),t.domRoot.find("#stdinShow").html(e)),[!1]}),this.add_pytutor_hook("end_constructor",function(t){var e=t.myViz;if(0<e.curTrace.length&&e.curTrace[e.curTrace.length-1]&&e.curTrace[e.curTrace.length-1].stdout?(e.hasStdout=!0,e.stdoutLines=e.curTrace[e.curTrace.length-1].stdout.split("\n").length):1<e.curTrace.length&&e.curTrace[e.curTrace.length-2]&&e.curTrace[e.curTrace.length-2].stdout?(e.hasStdout=!0,e.stdoutLines=e.curTrace[e.curTrace.length-2].stdout.split("\n").length):e.stdoutLines=-1,e.hasStdout)for(var i=0;i<e.curTrace.length;i++)e.curTrace[i].stdout||(e.curTrace[i].stdout=" ")}),this.add_pytutor_hook("end_render",function(t){t=t.myViz;t.params.stdin&&""!=t.params.stdin&&t.domRoot.find("#dataViz").append('<div id="stdinWrap">stdin:<pre id="stdinShow" style="border:1px solid gray"></pre></div>'),t.domRoot.find("#"+t.generateID("globals_header")).html("Static fields")}),this.add_pytutor_hook("isLinearObject",function(t){t=t.heapObj;return"STACK"==t[0]||"QUEUE"==t[0]?["true","true"]:["false"]}),this.add_pytutor_hook("renderCompoundObject",function(t){t.objID;var e=t.d3DomElement,i=t.obj,n=t.typeLabelPrefix,r=t.myViz,a=t.stepNum;if("LIST"!=i[0]&&"QUEUE"!=i[0]&&"STACK"!=i[0])return[!1];var s=i[0].toLowerCase(),t={list:"array",queue:"queue",stack:"stack"}[s];if(1==i.length)e.append('<div class="typeLabel">'+n+"empty "+t+"</div>");else{e.append('<div class="typeLabel">'+n+t+"</div>"),e.append('<table class="'+s+'Tbl"></table>');n=e.children("table");if("LIST"==i[0]){n.append("<tr></tr><tr></tr>");for(var o=n.find("tr:first"),d=n.find("tr:last"),l=1,c=0;l<i.length;l++){var p=i[l],u=p instanceof Array&&"ELIDE"==p[0];o.append('<td class="'+s+'Header"></td>'),o.find("td:last").append(u?"&hellip;":c),d.append('<td class="'+s+'Elt"></td>'),u?(d.find("td:last").append("&hellip;"),c+=p[1]):(r.renderNestedObject(p,a,d.find("td:last")),c++)}}"STACK"==i[0]&&(n.append("<tr></tr><tr></tr>"),(d=n.find("tr:last")).append('<td class="'+s+'FElt"><span class="stringObj symbolic">&#8596;</span></td>'),$.each(i,function(t,e){t<1||(d.append('<td class="'+s+'Elt"></td>'),r.renderNestedObject(e,a,d.find("td:last")))}),d.append('<td class="'+s+'LElt"></td>')),"QUEUE"==i[0]&&(n.append("<tr></tr><tr></tr>"),(d=n.find("tr:last")).append('<td class="'+s+'FElt"><span class="stringObj symbolic">&#8592;</span></td>'),$.each(i,function(t,e){t<1||(d.append('<td class="'+s+'Elt"></td>'),r.renderNestedObject(e,a,d.find("td:last")))}),d.append('<td class="'+s+'LElt"><span class="stringObj symbolic">&#8592;</span></td>'))}return[!0]}),this.add_pytutor_hook("end_renderDataStructures",function(t){t=t.myViz;t.domRoot.find("td.instKey:contains('___NO_LABEL!___')").hide(),t.domRoot.find(".typeLabel:contains('dict')").each(function(t){"dict"==$(this).html()&&$(this).html("symbol table"),"empty dict"==$(this).html()&&$(this).html("empty symbol table")})}),ExecutionVisualizer.prototype.generateID.bind(this)),n=(this.generateID=function(t){t=t.replace(/[^0-9a-zA-Z_]/g,function(t){return"-"+t.charCodeAt(0)+"-"});return e(t)},{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"}),r=function(t){return String(t).replace(/[&<>"'\/]/g,function(t){return n[t]})}};
8
- //# sourceMappingURL=pytutor-main.min.js.map
1
+ !function(){function t(){}function e(t){return t}function n(){return this}function i(){return!0}function r(t){return"function"==typeof t?t:function(){return t}}function o(t,e,n){return function(){var i=n.apply(e,arguments);return arguments.length?t:i}}function a(t){return null!=t&&!isNaN(t)}function s(t){return t.length}function l(t){return null==t}function u(t){return t.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")}function c(){}function d(e){function n(){for(var t,n=i,r=-1,o=n.length;++r<o;)(t=n[r].on)&&t.apply(this,arguments);return e}var i=[],r=new t;return n.on=function(t,n){var o,a=r.get(t);return arguments.length<2?a&&a.on:(a&&(a.on=null,i=i.slice(0,o=i.indexOf(a)).concat(i.slice(o+1)),r.remove(t)),n&&i.push(r.set(t,{on:n})),e)},n}function h(t,e){return e-(t?1+Math.floor(Math.log(t+Math.pow(10,1+Math.floor(Math.log(t)/Math.LN10)-e))/Math.LN10):1)}function f(t){return t+""}function p(t){for(var e=t.lastIndexOf("."),n=e>=0?t.substring(e):(e=t.length,""),i=[];e>0;)i.push(t.substring(e-=3,e+3));return i.reverse().join(",")+n}function g(t){return function(e){return 1-t(1-e)}}function m(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function v(t){return t}function y(t){return function(e){return Math.pow(e,t)}}function b(t){return 1-Math.cos(t*Math.PI/2)}function x(t){return Math.pow(2,10*(t-1))}function w(t){return 1-Math.sqrt(1-t*t)}function C(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function _(){d3.event.stopPropagation(),d3.event.preventDefault()}function E(){for(var t,e=d3.event;t=e.sourceEvent;)e=t;return e}function M(t){for(var e=new c,n=0,i=arguments.length;++n<i;)e[arguments[n]]=d(e);return e.of=function(n,i){return function(r){try{var o=r.sourceEvent=d3.event;r.target=t,d3.event=r,e[r.type].apply(n,i)}finally{d3.event=o}}},e}function S(t){return"transform"==t?d3.interpolateTransform:d3.interpolate}function D(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return(n-t)*e}}function P(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return Math.max(0,Math.min(1,(n-t)*e))}}function j(t,e,n){return new T(t,e,n)}function T(t,e,n){this.r=t,this.g=e,this.b=n}function A(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function k(t,e,n){var i,r,o,a=0,s=0,l=0;if(i=/([a-z]+)\((.*)\)/i.exec(t))switch(r=i[2].split(","),i[1]){case"hsl":return n(parseFloat(r[0]),parseFloat(r[1])/100,parseFloat(r[2])/100);case"rgb":return e(L(r[0]),L(r[1]),L(r[2]))}return(o=Vn.get(t))?e(o.r,o.g,o.b):(null!=t&&"#"===t.charAt(0)&&(4===t.length?(a=t.charAt(1),a+=a,s=t.charAt(2),s+=s,l=t.charAt(3),l+=l):7===t.length&&(a=t.substring(1,3),s=t.substring(3,5),l=t.substring(5,7)),a=parseInt(a,16),s=parseInt(s,16),l=parseInt(l,16)),e(a,s,l))}function I(t,e,n){var i,r,o=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),s=a-o,l=(a+o)/2;return s?(r=l<.5?s/(a+o):s/(2-a-o),i=t==a?(e-n)/s+(e<n?6:0):e==a?(n-t)/s+2:(t-e)/s+4,i*=60):r=i=0,O(i,r,l)}function L(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function O(t,e,n){return new N(t,e,n)}function N(t,e,n){this.h=t,this.s=e,this.l=n}function z(t,e,n){function i(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?r+(o-r)*t/60:t<180?o:t<240?r+(o-r)*(240-t)/60:r}(t))}var r,o;return(t%=360)<0&&(t+=360),e=e<0?0:e>1?1:e,r=2*(n=n<0?0:n>1?1:n)-(o=n<=.5?n*(1+e):n+e-n*e),j(i(t+120),i(t),i(t-120))}function R(t){return Sn(t,Gn),t}function H(t){return function(){return Bn(t,this)}}function F(t){return function(){return Wn(t,this)}}function V(t,e){function n(){if(e=this.classList)return e.add(t);var e=this.className,n=null!=e.baseVal,i=n?e.baseVal:e;r.lastIndex=0,r.test(i)||(i=u(i+" "+t),n?e.baseVal=i:this.className=i)}function i(){if(e=this.classList)return e.remove(t);var e=this.className,n=null!=e.baseVal,i=n?e.baseVal:e;i=u(i.replace(r," ")),n?e.baseVal=i:this.className=i}var r=new RegExp("(^|\\s+)"+d3.requote(t)+"(\\s+|$)","g");if(arguments.length<2){var o=this.node();if(a=o.classList)return a.contains(t);var a=o.className;return r.lastIndex=0,r.test(null!=a.baseVal?a.baseVal:a)}return this.each("function"==typeof e?function(){(e.apply(this,arguments)?n:i).call(this)}:e?n:i)}function B(t){return{__data__:t}}function W(t){return arguments.length||(t=d3.ascending),function(e,n){return t(e&&e.__data__,n&&n.__data__)}}function $(t,e){for(var n=0,i=t.length;n<i;n++)for(var r,o=t[n],a=0,s=o.length;a<s;a++)(r=o[a])&&e(r,a,n);return t}function U(t){return Sn(t,Xn),t}function q(e,n,i){Sn(e,Kn);var r=new t,o=d3.dispatch("start","end"),a=ii;return e.id=n,e.time=i,e.tween=function(t,n){return arguments.length<2?r.get(t):(null==n?r.remove(t):r.set(t,n),e)},e.ease=function(t){return arguments.length?(a="function"==typeof t?t:d3.ease.apply(d3,arguments),e):a},e.each=function(t,n){return arguments.length<2?X.call(e,t):(o.on(t,n),e)},d3.timer((function(t){return $(e,(function(e,s,l){function u(t){return g.active>n?d():(g.active=n,r.forEach((function(t,n){(n=n.call(e,m,s))&&h.push(n)})),o.start.call(e,m,s),c(t)||d3.timer(c,0,i),1)}function c(t){if(g.active!==n)return d();for(var i=(t-f)/p,r=a(i),l=h.length;l>0;)h[--l].call(e,r);return i>=1?(d(),Zn=n,o.end.call(e,m,s),Zn=0,1):void 0}function d(){return--g.count||delete e.__transition__,1}var h=[],f=e.delay,p=e.duration,g=(e=e.node).__transition__||(e.__transition__={active:0,count:0}),m=e.__data__;++g.count,f<=t?u(t):d3.timer(u,f,i)}))}),0,i),e}function G(t,e,n){return""!=n&&Qn}function Y(t,e){var n=S(t);return"function"==typeof e?function(t,i,r){var o=e.call(this,t,i);return null==o?""!=r&&Qn:r!=o&&n(r,o)}:null==e?G:(e+="",function(t,i,r){return r!=e&&n(r,e)})}function X(t){var e=Zn,n=ii,i=ei,r=ni;return Zn=this.id,ii=this.ease(),$(this,(function(e,n,i){ei=e.delay,ni=e.duration,t.call(e=e.node,e.__data__,n,i)})),Zn=e,ii=n,ei=i,ni=r,this}function Q(){for(var t,e=Date.now(),n=ai;n;)(t=e-n.then)>=n.delay&&(n.flush=n.callback(t)),n=n.next;var i=K()-e;i>24?(isFinite(i)&&(clearTimeout(oi),oi=setTimeout(Q,i)),ri=0):(ri=1,si(Q))}function K(){for(var t=null,e=ai,n=1/0;e;)e.flush?e=t?t.next=e.next:ai=e.next:(n=Math.min(n,e.then+e.delay),e=(t=e).next);return n}function J(t){var e=[t.a,t.b],n=[t.c,t.d],i=tt(e),r=Z(e,n),o=tt(function(t,e,n){return t[0]+=n*e[0],t[1]+=n*e[1],t}(n,e,-r))||0;e[0]*n[1]<n[0]*e[1]&&(e[0]*=-1,e[1]*=-1,i*=-1,r*=-1),this.rotate=(i?Math.atan2(e[1],e[0]):Math.atan2(-n[0],n[1]))*li,this.translate=[t.e,t.f],this.scale=[i,o],this.skew=o?Math.atan2(r,o)*li:0}function Z(t,e){return t[0]*e[0]+t[1]*e[1]}function tt(t){var e=Math.sqrt(Z(t,t));return e&&(t[0]/=e,t[1]/=e),e}function et(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(ui<0&&(window.scrollX||window.scrollY)){var r=(n=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0))[0][0].getScreenCTM();ui=!r.f&&!r.e,n.remove()}return ui?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),[(i=i.matrixTransform(t.getScreenCTM().inverse())).x,i.y]}var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}function nt(t){var e=t[0],n=t[t.length-1];return e<n?[e,n]:[n,e]}function it(t){return t.rangeExtent?t.rangeExtent():nt(t.range())}function rt(t,e){var n,i=0,r=t.length-1,o=t[i],a=t[r];return a<o&&(n=i,i=r,r=n,n=o,o=a,a=n),(n=a-o)&&(e=e(n),t[i]=e.floor(o),t[r]=e.ceil(a)),t}function ot(){return Math}function at(t,e,n,i){function r(){var r=Math.min(t.length,e.length)>2?ft:ht,l=i?P:D;return a=r(t,e,l,n),s=r(e,t,l,d3.interpolate),o}function o(t){return a(t)}var a,s;return o.invert=function(t){return s(t)},o.domain=function(e){return arguments.length?(t=e.map(Number),r()):t},o.range=function(t){return arguments.length?(e=t,r()):e},o.rangeRound=function(t){return o.range(t).interpolate(d3.interpolateRound)},o.clamp=function(t){return arguments.length?(i=t,r()):i},o.interpolate=function(t){return arguments.length?(n=t,r()):n},o.ticks=function(e){return ct(t,e)},o.tickFormat=function(e){return dt(t,e)},o.nice=function(){return rt(t,lt),r()},o.copy=function(){return at(t,e,n,i)},r()}function st(t,e){return d3.rebind(t,e,"range","rangeRound","interpolate","clamp")}function lt(t){return t=Math.pow(10,Math.round(Math.log(t)/Math.LN10)-1),{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}}function ut(t,e){var n=nt(t),i=n[1]-n[0],r=Math.pow(10,Math.floor(Math.log(i/e)/Math.LN10)),o=e/i*r;return o<=.15?r*=10:o<=.35?r*=5:o<=.75&&(r*=2),n[0]=Math.ceil(n[0]/r)*r,n[1]=Math.floor(n[1]/r)*r+.5*r,n[2]=r,n}function ct(t,e){return d3.range.apply(d3,ut(t,e))}function dt(t,e){return d3.format(",."+Math.max(0,-Math.floor(Math.log(ut(t,e)[2])/Math.LN10+.01))+"f")}function ht(t,e,n,i){var r=n(t[0],t[1]),o=i(e[0],e[1]);return function(t){return o(r(t))}}function ft(t,e,n,i){var r=[],o=[],a=0,s=Math.min(t.length,e.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<=s;)r.push(n(t[a-1],t[a])),o.push(i(e[a-1],e[a]));return function(e){var n=d3.bisect(t,e,1,s)-1;return o[n](r[n](e))}}function pt(t,e){function n(n){return t(e(n))}var i=e.pow;return n.invert=function(e){return i(t.invert(e))},n.domain=function(r){return arguments.length?(e=r[0]<0?mt:gt,i=e.pow,t.domain(r.map(e)),n):t.domain().map(i)},n.nice=function(){return t.domain(rt(t.domain(),ot)),n},n.ticks=function(){var n=nt(t.domain()),r=[];if(n.every(isFinite)){var o=Math.floor(n[0]),a=Math.ceil(n[1]),s=i(n[0]),l=i(n[1]);if(e===mt)for(r.push(i(o));o++<a;)for(var u=9;u>0;u--)r.push(i(o)*u);else{for(;o<a;o++)for(u=1;u<10;u++)r.push(i(o)*u);r.push(i(o))}for(o=0;r[o]<s;o++);for(a=r.length;r[a-1]>l;a--);r=r.slice(o,a)}return r},n.tickFormat=function(t,r){if(arguments.length<2&&(r=ci),arguments.length<1)return r;var o,a=Math.max(.1,t/n.ticks().length),s=e===mt?(o=-1e-12,Math.floor):(o=1e-12,Math.ceil);return function(t){return t/i(s(e(t)+o))<=a?r(t):""}},n.copy=function(){return pt(t.copy(),e)},st(n,t)}function gt(t){return Math.log(t<0?0:t)/Math.LN10}function mt(t){return-Math.log(t>0?0:-t)/Math.LN10}function vt(t,e){function n(e){return t(i(e))}var i=yt(e),r=yt(1/e);return n.invert=function(e){return r(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e.map(i)),n):t.domain().map(r)},n.ticks=function(t){return ct(n.domain(),t)},n.tickFormat=function(t){return dt(n.domain(),t)},n.nice=function(){return n.domain(rt(n.domain(),lt))},n.exponent=function(t){if(!arguments.length)return e;var o=n.domain();return i=yt(e=t),r=yt(1/e),n.domain(o)},n.copy=function(){return vt(t.copy(),e)},st(n,t)}function yt(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function bt(e,n){function i(t){return a[((o.get(t)||o.set(t,e.push(t)))-1)%a.length]}function r(t,n){return d3.range(e.length).map((function(e){return t+n*e}))}var o,a,s;return i.domain=function(r){if(!arguments.length)return e;e=[],o=new t;for(var a,s=-1,l=r.length;++s<l;)o.has(a=r[s])||o.set(a,e.push(a));return i[n.t](n.x,n.p)},i.range=function(t){return arguments.length?(a=t,s=0,n={t:"range",x:t},i):a},i.rangePoints=function(t,o){arguments.length<2&&(o=0);var l=t[0],u=t[1],c=(u-l)/(e.length-1+o);return a=r(e.length<2?(l+u)/2:l+c*o/2,c),s=0,n={t:"rangePoints",x:t,p:o},i},i.rangeBands=function(t,o){arguments.length<2&&(o=0);var l=t[1]<t[0],u=t[l-0],c=(t[1-l]-u)/(e.length+o);return a=r(u+c*o,c),l&&a.reverse(),s=c*(1-o),n={t:"rangeBands",x:t,p:o},i},i.rangeRoundBands=function(t,o){arguments.length<2&&(o=0);var l=t[1]<t[0],u=t[l-0],c=t[1-l],d=Math.floor((c-u)/(e.length+o)),h=c-u-(e.length-o)*d;return a=r(u+Math.round(h/2),d),l&&a.reverse(),s=Math.round(d*(1-o)),n={t:"rangeRoundBands",x:t,p:o},i},i.rangeBand=function(){return s},i.rangeExtent=function(){return nt(n.x)},i.copy=function(){return bt(e,n)},i.domain(e)}function xt(t,e){function n(){var n=0,o=(t.length,e.length);for(r=[];++n<o;)r[n-1]=d3.quantile(t,n/o);return i}function i(t){return isNaN(t=+t)?NaN:e[d3.bisect(r,t)]}var r;return i.domain=function(e){return arguments.length?(t=e.filter((function(t){return!isNaN(t)})).sort(d3.ascending),n()):t},i.range=function(t){return arguments.length?(e=t,n()):e},i.quantiles=function(){return r},i.copy=function(){return xt(t,e)},n()}function wt(t,e,n){function i(e){return n[Math.max(0,Math.min(a,Math.floor(o*(e-t))))]}function r(){return o=n.length/(e-t),a=n.length-1,i}var o,a;return i.domain=function(n){return arguments.length?(t=+n[0],e=+n[n.length-1],r()):[t,e]},i.range=function(t){return arguments.length?(n=t,r()):n},i.copy=function(){return wt(t,e,n)},r()}function Ct(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return ct(t,e)},e.tickFormat=function(e){return dt(t,e)},e.copy=function(){return Ct(t)},e}function _t(t){return t.innerRadius}function Et(t){return t.outerRadius}function Mt(t){return t.startAngle}function St(t){return t.endAngle}function Dt(t){function e(e){function i(){c.push("M",l(t(d),u))}for(var s,c=[],d=[],h=-1,f=e.length,p=r(n),g=r(o);++h<f;)a.call(this,s=e[h],h)?d.push([+p.call(this,s,h),+g.call(this,s,h)]):d.length&&(i(),d=[]);return d.length&&i(),c.length?c.join(""):null}var n=Pt,o=jt,a=i,s=vi,l=Tt,u=.7;return e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(o=t,e):o},e.defined=function(t){return arguments.length?(a=t,e):a},e.interpolate=function(t){return arguments.length?(yi.has(t+="")||(t=vi),l=yi.get(s=t),e):s},e.tension=function(t){return arguments.length?(u=t,e):u},e}function Pt(t){return t[0]}function jt(t){return t[1]}function Tt(t){for(var e=0,n=t.length,i=t[0],r=[i[0],",",i[1]];++e<n;)r.push("L",(i=t[e])[0],",",i[1]);return r.join("")}function At(t){for(var e=0,n=t.length,i=t[0],r=[i[0],",",i[1]];++e<n;)r.push("V",(i=t[e])[1],"H",i[0]);return r.join("")}function kt(t){for(var e=0,n=t.length,i=t[0],r=[i[0],",",i[1]];++e<n;)r.push("H",(i=t[e])[0],"V",i[1]);return r.join("")}function It(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Tt(t);var n=t.length!=e.length,i="",r=t[0],o=t[1],a=e[0],s=a,l=1;if(n&&(i+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1],r=t[1],l=2),e.length>1){s=e[1],o=t[l],l++,i+="C"+(r[0]+a[0])+","+(r[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var u=2;u<e.length;u++,l++)o=t[l],s=e[u],i+="S"+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1]}if(n){var c=t[l];i+="Q"+(o[0]+2*s[0]/3)+","+(o[1]+2*s[1]/3)+","+c[0]+","+c[1]}return i}function Lt(t,e){for(var n,i=[],r=(1-e)/2,o=t[0],a=t[1],s=1,l=t.length;++s<l;)n=o,o=a,a=t[s],i.push([r*(a[0]-n[0]),r*(a[1]-n[1])]);return i}function Ot(t){if(t.length<3)return Tt(t);var e=1,n=t.length,i=t[0],r=i[0],o=i[1],a=[r,r,r,(i=t[1])[0]],s=[o,o,o,i[1]],l=[r,",",o];for(zt(l,a,s);++e<n;)i=t[e],a.shift(),a.push(i[0]),s.shift(),s.push(i[1]),zt(l,a,s);for(e=-1;++e<2;)a.shift(),a.push(i[0]),s.shift(),s.push(i[1]),zt(l,a,s);return l.join("")}function Nt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function zt(t,e,n){t.push("C",Nt(bi,e),",",Nt(bi,n),",",Nt(xi,e),",",Nt(xi,n),",",Nt(wi,e),",",Nt(wi,n))}function Rt(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Ht(t){for(var e,n,i,r,o=[],a=function(t){for(var e=0,n=t.length-1,i=[],r=t[0],o=t[1],a=i[0]=Rt(r,o);++e<n;)i[e]=a+(a=Rt(r=o,o=t[e+1]));return i[e]=a,i}(t),s=-1,l=t.length-1;++s<l;)e=Rt(t[s],t[s+1]),Math.abs(e)<1e-6?a[s]=a[s+1]=0:(r=(n=a[s]/e)*n+(i=a[s+1]/e)*i)>9&&(r=3*e/Math.sqrt(r),a[s]=r*n,a[s+1]=r*i);for(s=-1;++s<=l;)r=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),o.push([r||0,a[s]*r||0]);return o}function Ft(t){for(var e,n,i,r=-1,o=t.length;++r<o;)n=(e=t[r])[0],i=e[1]+gi,e[0]=n*Math.cos(i),e[1]=n*Math.sin(i);return t}function Vt(t){function e(e){function i(){m.push("M",c(t(y),f),h,d(t(v.reverse()),f),"Z")}for(var u,p,g,m=[],v=[],y=[],b=-1,x=e.length,w=r(n),C=r(a),_=n===o?function(){return p}:r(o),E=a===s?function(){return g}:r(s);++b<x;)l.call(this,u=e[b],b)?(v.push([p=+w.call(this,u,b),g=+C.call(this,u,b)]),y.push([+_.call(this,u,b),+E.call(this,u,b)])):v.length&&(i(),v=[],y=[]);return v.length&&i(),m.length?m.join(""):null}var n=Pt,o=Pt,a=0,s=jt,l=i,u=vi,c=Tt,d=Tt,h="L",f=.7;return e.x=function(t){return arguments.length?(n=o=t,e):o},e.x0=function(t){return arguments.length?(n=t,e):n},e.x1=function(t){return arguments.length?(o=t,e):o},e.y=function(t){return arguments.length?(a=s=t,e):s},e.y0=function(t){return arguments.length?(a=t,e):a},e.y1=function(t){return arguments.length?(s=t,e):s},e.defined=function(t){return arguments.length?(l=t,e):l},e.interpolate=function(t){return arguments.length?(yi.has(t+="")||(t=vi),c=yi.get(u=t),d=c.reverse||c,h=/-closed$/.test(t)?"M":"L",e):u},e.tension=function(t){return arguments.length?(f=t,e):f},e}function Bt(t){return t.source}function Wt(t){return t.target}function $t(t){return t.radius}function Ut(t){return[t.x,t.y]}function qt(){return 64}function Gt(){return"circle"}function Yt(t){var e=Math.sqrt(t/Math.PI);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Xt(t,e){t.attr("transform",(function(t){return"translate("+e(t)+",0)"}))}function Qt(t,e){t.attr("transform",(function(t){return"translate(0,"+e(t)+")"}))}function Kt(t){for(var e=t.source,n=t.target,i=function(t,e){if(t===e)return t;var n=Jt(t),i=Jt(e),r=n.pop(),o=i.pop(),a=null;for(;r===o;)a=r,r=n.pop(),o=i.pop();return a}(e,n),r=[e];e!==i;)e=e.parent,r.push(e);for(var o=r.length;n!==i;)r.splice(o,0,n),n=n.parent;return r}function Jt(t){for(var e=[],n=t.parent;null!=n;)e.push(t),t=n,n=n.parent;return e.push(t),e}function Zt(t){t.fixed|=2}function te(t){t!==ji&&(t.fixed&=1)}function ee(){ji.fixed&=1,Pi=ji=null}function ne(){ji.px=d3.event.x,ji.py=d3.event.y,Pi.resume()}function ie(t,e,n){var i=0,r=0;if(t.charge=0,!t.leaf)for(var o,a=t.nodes,s=a.length,l=-1;++l<s;)null!=(o=a[l])&&(ie(o,e,n),t.charge+=o.charge,i+=o.charge*o.cx,r+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var u=e*n[t.point.index];t.charge+=t.pointCharge=u,i+=u*t.point.x,r+=u*t.point.y}t.cx=i/t.charge,t.cy=r/t.charge}function re(t){return 20}function oe(t){return 1}function ae(t){return t.x}function se(t){return t.y}function le(t,e,n){t.y0=e,t.y=n}function ue(t){return d3.range(t.length)}function ce(t){for(var e=-1,n=t[0].length,i=[];++e<n;)i[e]=0;return i}function de(t){for(var e,n=1,i=0,r=t[0][1],o=t.length;n<o;++n)(e=t[n][1])>r&&(i=n,r=e);return i}function he(t){return t.reduce(fe,0)}function fe(t,e){return t+e[1]}function pe(t,e){return ge(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function ge(t,e){for(var n=-1,i=+t[0],r=(t[1]-i)/e,o=[];++n<=e;)o[n]=r*n+i;return o}function me(t){return[d3.min(t),d3.max(t)]}function ve(t,e){return d3.rebind(t,e,"sort","children","value"),t.links=we,t.nodes=function(e){return Li=!0,(t.nodes=t)(e)},t}function ye(t){return t.children}function be(t){return t.value}function xe(t,e){return e.value-t.value}function we(t){return d3.merge(t.map((function(t){return(t.children||[]).map((function(e){return{source:t,target:e}}))})))}function Ce(t,e){return t.value-e.value}function _e(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function Ee(t,e){t._pack_next=e,e._pack_prev=t}function Me(t,e){var n=e.x-t.x,i=e.y-t.y,r=t.r+e.r;return r*r-n*n-i*i>.001}function Se(t){t._pack_next=t._pack_prev=t}function De(t){delete t._pack_next,delete t._pack_prev}function Pe(t){var e=t.children;e&&e.length?(e.forEach(Pe),t.r=function(t){function e(t){s=Math.min(t.x-t.r,s),l=Math.max(t.x+t.r,l),u=Math.min(t.y-t.r,u),c=Math.max(t.y+t.r,c)}var n,i,r,o,a,s=1/0,l=-1/0,u=1/0,c=-1/0,d=t.length;if(t.forEach(Se),(n=t[0]).x=-n.r,n.y=0,e(n),d>1&&((i=t[1]).x=i.r,i.y=0,e(i),d>2)){Te(n,i,r=t[2]),e(r),_e(n,r),n._pack_prev=r,_e(r,i),i=n._pack_next;for(var h=3;h<d;h++){Te(n,i,r=t[h]);var f=0,p=1,g=1;for(o=i._pack_next;o!==i;o=o._pack_next,p++)if(Me(o,r)){f=1;break}if(1==f)for(a=n._pack_prev;a!==o._pack_prev&&!Me(a,r);a=a._pack_prev,g++);f?(p<g||p==g&&i.r<n.r?Ee(n,i=o):Ee(n=a,i),h--):(_e(n,r),i=r,e(r))}}var m=(s+l)/2,v=(u+c)/2,y=0;for(h=0;h<d;h++){var b=t[h];b.x-=m,b.y-=v,y=Math.max(y,b.r+Math.sqrt(b.x*b.x+b.y*b.y))}return t.forEach(De),y}(e)):t.r=Math.sqrt(t.value)}function je(t,e,n,i){var r=t.children;if(t.x=e+=i*t.x,t.y=n+=i*t.y,t.r*=i,r)for(var o=-1,a=r.length;++o<a;)je(r[o],e,n,i)}function Te(t,e,n){var i=t.r+n.r,r=e.x-t.x,o=e.y-t.y;if(i&&(r||o)){var a=e.r+n.r,s=Math.sqrt(r*r+o*o),l=Math.max(-1,Math.min(1,(i*i+s*s-a*a)/(2*i*s))),u=Math.acos(l),c=l*(i/=s),d=Math.sin(u)*i;n.x=t.x+c*r+d*o,n.y=t.y+c*o-d*r}else n.x=t.x+i,n.y=t.y}function Ae(t){var e=t.children;return e&&e.length?Ae(e[0]):t}function ke(t){var e,n=t.children;return n&&(e=n.length)?ke(n[e-1]):t}function Ie(t,e){return t.parent==e.parent?1:2}function Le(t){var e=t.children;return e&&e.length?e[0]:t._tree.thread}function Oe(t){var e,n=t.children;return n&&(e=n.length)?n[e-1]:t._tree.thread}function Ne(t,e){var n=t.children;if(n&&(r=n.length))for(var i,r,o=-1;++o<r;)e(i=Ne(n[o],e),t)>0&&(t=i);return t}function ze(t,e){return t.x-e.x}function Re(t,e){return e.x-t.x}function He(t,e){return t.depth-e.depth}function Fe(t,e){!function t(n,i){var r=n.children;if(r&&(a=r.length))for(var o,a,s=null,l=-1;++l<a;)t(o=r[l],s),s=o;e(n,i)}(t,null)}function Ve(t,e,n){t=t._tree;var i=n/((e=e._tree).number-t.number);t.change+=i,e.change-=i,e.shift+=n,e.prelim+=n,e.mod+=n}function Be(t,e,n){return t._tree.ancestor.parent==e.parent?t._tree.ancestor:n}function We(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function $e(t,e){var n=t.x+e[3],i=t.y+e[0],r=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];return r<0&&(n+=r/2,r=0),o<0&&(i+=o/2,o=0),{x:n,y:i,dx:r,dy:o}}function Ue(t){return t.map(qe).join(",")}function qe(t){return/[",\n]/.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}function Ge(t,e){return function(n){return n&&t.hasOwnProperty(n.type)?t[n.type](n):e}}function Ye(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Xe(t,e){Ni.hasOwnProperty(t.type)&&Ni[t.type](t,e)}function Qe(t,e){for(var n=t.coordinates,i=0,r=n.length;i<r;i++)e.apply(null,n[i])}function Ke(t){return t.source}function Je(t){return t.target}function Ze(){function t(t){var e=Math.sin(t*=f)*p,n=Math.sin(f-t)*p,i=n*o+e*d,s=n*a+e*h,l=n*r+e*c;return[Math.atan2(s,i)/Oi,Math.atan2(l,Math.sqrt(i*i+s*s))/Oi]}var e,n,i,r,o,a,s,l,u,c,d,h,f,p;return t.distance=function(){return null==f&&(p=1/Math.sin(f=Math.acos(Math.max(-1,Math.min(1,r*c+i*u*Math.cos(s-e)))))),f},t.source=function(s){var l=Math.cos(e=s[0]*Oi),u=Math.sin(e);return i=Math.cos(n=s[1]*Oi),r=Math.sin(n),o=i*l,a=i*u,f=null,t},t.target=function(e){var n=Math.cos(s=e[0]*Oi),i=Math.sin(s);return u=Math.cos(l=e[1]*Oi),c=Math.sin(l),d=u*n,h=u*i,f=null,t},t}function tn(t,e){var n=Ze().source(t).target(e);return n.distance(),n}function en(t,e,n,i){var r,o,a,s,l,u;return o=(r=i[t])[0],a=r[1],s=(r=i[e])[0],l=r[1],u=(r=i[n])[0],(r[1]-a)*(s-o)-(l-a)*(u-o)>0}function nn(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function rn(t,e,n,i){var r=t[0],o=e[0],a=n[0],s=i[0],l=t[1],u=e[1],c=n[1],d=o-r,h=s-a,f=u-l,p=i[1]-c,g=(h*(l-c)-p*(r-a))/(p*d-h*f);return[r+g*d,l+g*f]}function on(t,e){var n={list:t.map((function(t,e){return{index:e,x:t[0],y:t[1]}})).sort((function(t,e){return t.y<e.y?-1:t.y>e.y?1:t.x<e.x?-1:t.x>e.x?1:0})),bottomSite:null},i={list:[],leftEnd:null,rightEnd:null,init:function(){i.leftEnd=i.createHalfEdge(null,"l"),i.rightEnd=i.createHalfEdge(null,"l"),i.leftEnd.r=i.rightEnd,i.rightEnd.l=i.leftEnd,i.list.unshift(i.leftEnd,i.rightEnd)},createHalfEdge:function(t,e){return{edge:t,side:e,vertex:null,l:null,r:null}},insert:function(t,e){e.l=t,e.r=t.r,t.r.l=e,t.r=e},leftBound:function(t){var e=i.leftEnd;do{e=e.r}while(e!=i.rightEnd&&r.rightOf(e,t));return e=e.l},del:function(t){t.l.r=t.r,t.r.l=t.l,t.edge=null},right:function(t){return t.r},left:function(t){return t.l},leftRegion:function(t){return null==t.edge?n.bottomSite:t.edge.region[t.side]},rightRegion:function(t){return null==t.edge?n.bottomSite:t.edge.region[Hi[t.side]]}},r={bisect:function(t,e){var n={region:{l:t,r:e},ep:{l:null,r:null}},i=e.x-t.x,r=e.y-t.y,o=i>0?i:-i,a=r>0?r:-r;return n.c=t.x*i+t.y*r+.5*(i*i+r*r),o>a?(n.a=1,n.b=r/i,n.c/=i):(n.b=1,n.a=i/r,n.c/=r),n},intersect:function(t,e){var n=t.edge,i=e.edge;if(!n||!i||n.region.r==i.region.r)return null;var r=n.a*i.b-n.b*i.a;if(Math.abs(r)<1e-10)return null;var o,a,s=(n.c*i.b-i.c*n.b)/r,l=(i.c*n.a-n.c*i.a)/r,u=n.region.r,c=i.region.r;u.y<c.y||u.y==c.y&&u.x<c.x?(o=t,a=n):(o=e,a=i);var d=s>=a.region.r.x;return d&&"l"===o.side||!d&&"r"===o.side?null:{x:s,y:l}},rightOf:function(t,e){var n=t.edge,i=n.region.r,r=e.x>i.x;if(r&&"l"===t.side)return 1;if(!r&&"r"===t.side)return 0;if(1===n.a){var o=e.y-i.y,a=e.x-i.x,s=0,l=0;if(!r&&n.b<0||r&&n.b>=0?l=s=o>=n.b*a:(l=e.x+e.y*n.b>n.c,n.b<0&&(l=!l),l||(s=1)),!s){var u=i.x-n.region.l.x;l=n.b*(a*a-o*o)<u*o*(1+2*a/u+n.b*n.b),n.b<0&&(l=!l)}}else{var c=n.c-n.a*e.x,d=e.y-c,h=e.x-i.x,f=c-i.y;l=d*d>h*h+f*f}return"l"===t.side?l:!l},endPoint:function(t,n,i){t.ep[n]=i,t.ep[Hi[n]]&&e(t)},distance:function(t,e){var n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)}},o={list:[],insert:function(t,e,n){t.vertex=e,t.ystar=e.y+n;for(var i=0,r=o.list,a=r.length;i<a;i++){var s=r[i];if(!(t.ystar>s.ystar||t.ystar==s.ystar&&e.x>s.vertex.x))break}r.splice(i,0,t)},del:function(t){for(var e=0,n=o.list,i=n.length;e<i&&n[e]!=t;++e);n.splice(e,1)},empty:function(){return 0===o.list.length},nextEvent:function(t){for(var e=0,n=o.list,i=n.length;e<i;++e)if(n[e]==t)return n[e+1];return null},min:function(){var t=o.list[0];return{x:t.vertex.x,y:t.ystar}},extractMin:function(){return o.list.shift()}};i.init(),n.bottomSite=n.list.shift();for(var a,s,l,u,c,d,h,f,p,g,m,v,y,b=n.list.shift();;)if(o.empty()||(a=o.min()),b&&(o.empty()||b.y<a.y||b.y==a.y&&b.x<a.x))s=i.leftBound(b),l=i.right(s),h=i.rightRegion(s),v=r.bisect(h,b),d=i.createHalfEdge(v,"l"),i.insert(s,d),(g=r.intersect(s,d))&&(o.del(s),o.insert(s,g,r.distance(g,b))),s=d,d=i.createHalfEdge(v,"r"),i.insert(s,d),(g=r.intersect(d,l))&&o.insert(d,g,r.distance(g,b)),b=n.list.shift();else{if(o.empty())break;s=o.extractMin(),u=i.left(s),l=i.right(s),c=i.right(l),h=i.leftRegion(s),f=i.rightRegion(l),m=s.vertex,r.endPoint(s.edge,s.side,m),r.endPoint(l.edge,l.side,m),i.del(s),o.del(l),i.del(l),y="l",h.y>f.y&&(p=h,h=f,f=p,y="r"),v=r.bisect(h,f),d=i.createHalfEdge(v,y),i.insert(u,d),r.endPoint(v,Hi[y],m),(g=r.intersect(u,d))&&(o.del(u),o.insert(u,g,r.distance(g,h))),(g=r.intersect(d,c))&&o.insert(d,g,r.distance(g,h))}for(s=i.right(i.leftEnd);s!=i.rightEnd;s=i.right(s))e(s.edge)}function an(t,e,n,i,r,o){if(!t(e,n,i,r,o)){var a=.5*(n+r),s=.5*(i+o),l=e.nodes;l[0]&&an(t,l[0],n,i,a,s),l[1]&&an(t,l[1],a,i,r,s),l[2]&&an(t,l[2],n,s,a,o),l[3]&&an(t,l[3],a,s,r,o)}}function sn(t){return{x:t[0],y:t[1]}}function ln(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function un(t,e,n,i){for(var r,o,a=0,s=e.length,l=n.length;a<s;){if(i>=l)return-1;if(37==(r=e.charCodeAt(a++))){if(!(o=Gi[e.charAt(a++)])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}function cn(t,e,n){er.lastIndex=0;var i=er.exec(e.substring(n,n+2));return i?(t.d=+i[0],n+=i[0].length):-1}function dn(t,e,n){er.lastIndex=0;var i=er.exec(e.substring(n,n+2));return i?(t.H=+i[0],n+=i[0].length):-1}function hn(t){return t.toISOString()}function fn(t,e,n){function i(e){var n=t(e),i=o(n,1);return e-n<i-e?n:i}function r(n){return e(n=t(new Fi(n-1)),1),n}function o(t,n){return e(t=new Fi(+t),n),t}function a(t,i,o){var a=r(t),s=[];if(o>1)for(;a<i;)n(a)%o||s.push(new Date(+a)),e(a,1);else for(;a<i;)s.push(new Date(+a)),e(a,1);return s}t.floor=t,t.round=i,t.ceil=r,t.offset=o,t.range=a;var s=t.utc=pn(t);return s.floor=s,s.round=pn(i),s.ceil=pn(r),s.offset=pn(o),s.range=function(t,e,n){try{Fi=ln;var i=new ln;return i._=t,a(i,e,n)}finally{Fi=Date}},t}function pn(t){return function(e,n){try{Fi=ln;var i=new ln;return i._=e,t(i,n)._}finally{Fi=Date}}}function gn(t,e,n){function i(e){return t(e)}return i.invert=function(e){return vn(t.invert(e))},i.domain=function(e){return arguments.length?(t.domain(e),i):t.domain().map(vn)},i.nice=function(t){var e=mn(i.domain());return i.domain([t.floor(e[0]),t.ceil(e[1])])},i.ticks=function(n,r){var o=mn(i.domain());if("function"!=typeof n){var a=(o[1]-o[0])/n,s=d3.bisect(rr,a);if(s==rr.length)return e.year(o,n);if(!s)return t.ticks(n).map(vn);Math.log(a/rr[s-1])<Math.log(rr[s]/a)&&--s,r=(n=e[s])[1],n=n[0].range}return n(o[0],new Date(+o[1]+1),r)},i.tickFormat=function(){return n},i.copy=function(){return gn(t.copy(),e,n)},d3.rebind(i,t,"range","rangeRound","interpolate","clamp")}function mn(t){var e=t[0],n=t[t.length-1];return e<n?[e,n]:[n,e]}function vn(t){return new Date(t)}function yn(t){return function(e){for(var n=t.length-1,i=t[n];!i[1](e);)i=t[--n];return i[0](e)}}function bn(t){var e=new Date(t,0,1);return e.setFullYear(t),e}function xn(t){var e=t.getFullYear(),n=bn(e);return e+(t-n)/(bn(e+1)-n)}function wn(t){var e=new Date(Date.UTC(t,0,1));return e.setUTCFullYear(t),e}function Cn(t){var e=t.getUTCFullYear(),n=wn(e);return e+(t-n)/(wn(e+1)-n)}Date.now||(Date.now=function(){return+new Date});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(t){var _n=CSSStyleDeclaration.prototype,En=_n.setProperty;_n.setProperty=function(t,e,n){En.call(this,t,e+"",n)}}d3={version:"2.9.6"};var Mn=function(t){return Array.prototype.slice.call(t)};try{Mn(document.documentElement.childNodes)[0].nodeType}catch(t){Mn=function(t){for(var e=-1,n=t.length,i=[];++e<n;)i.push(t[e]);return i}}var Sn=[].__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]};d3.map=function(e){var n=new t;for(var i in e)n.set(i,e[i]);return n},function(t,e){try{for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}catch(n){t.prototype=e}}(t,{has:function(t){return Dn+t in this},get:function(t){return this[Dn+t]},set:function(t,e){return this[Dn+t]=e},remove:function(t){return(t=Dn+t)in this&&delete this[t]},keys:function(){var t=[];return this.forEach((function(e){t.push(e)})),t},values:function(){var t=[];return this.forEach((function(e,n){t.push(n)})),t},entries:function(){var t=[];return this.forEach((function(e,n){t.push({key:e,value:n})})),t},forEach:function(t){for(var e in this)e.charCodeAt(0)===Pn&&t.call(this,e.substring(1),this[e])}});var Dn="\0",Pn=Dn.charCodeAt(0);d3.functor=r,d3.rebind=function(t,e){for(var n,i=1,r=arguments.length;++i<r;)t[n=arguments[i]]=o(t,e,e[n]);return t},d3.ascending=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},d3.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},d3.mean=function(t,e){var n,i=t.length,r=0,o=-1,s=0;if(1===arguments.length)for(;++o<i;)a(n=t[o])&&(r+=(n-r)/++s);else for(;++o<i;)a(n=e.call(t,t[o],o))&&(r+=(n-r)/++s);return s?r:void 0},d3.median=function(t,e){return arguments.length>1&&(t=t.map(e)),(t=t.filter(a)).length?d3.quantile(t.sort(d3.ascending),.5):void 0},d3.min=function(t,e){var n,i,r=-1,o=t.length;if(1===arguments.length){for(;++r<o&&(null==(n=t[r])||n!=n);)n=void 0;for(;++r<o;)null!=(i=t[r])&&n>i&&(n=i)}else{for(;++r<o&&(null==(n=e.call(t,t[r],r))||n!=n);)n=void 0;for(;++r<o;)null!=(i=e.call(t,t[r],r))&&n>i&&(n=i)}return n},d3.max=function(t,e){var n,i,r=-1,o=t.length;if(1===arguments.length){for(;++r<o&&(null==(n=t[r])||n!=n);)n=void 0;for(;++r<o;)null!=(i=t[r])&&i>n&&(n=i)}else{for(;++r<o&&(null==(n=e.call(t,t[r],r))||n!=n);)n=void 0;for(;++r<o;)null!=(i=e.call(t,t[r],r))&&i>n&&(n=i)}return n},d3.extent=function(t,e){var n,i,r,o=-1,a=t.length;if(1===arguments.length){for(;++o<a&&(null==(n=r=t[o])||n!=n);)n=r=void 0;for(;++o<a;)null!=(i=t[o])&&(n>i&&(n=i),r<i&&(r=i))}else{for(;++o<a&&(null==(n=r=e.call(t,t[o],o))||n!=n);)n=void 0;for(;++o<a;)null!=(i=e.call(t,t[o],o))&&(n>i&&(n=i),r<i&&(r=i))}return[n,r]},d3.random={normal:function(t,e){return arguments.length<2&&(e=1),arguments.length<1&&(t=0),function(){var n,i,r;do{r=(n=2*Math.random()-1)*n+(i=2*Math.random()-1)*i}while(!r||r>1);return t+e*n*Math.sqrt(-2*Math.log(r)/r)}}},d3.sum=function(t,e){var n,i=0,r=t.length,o=-1;if(1===arguments.length)for(;++o<r;)isNaN(n=+t[o])||(i+=n);else for(;++o<r;)isNaN(n=+e.call(t,t[o],o))||(i+=n);return i},d3.quantile=function(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=t[i-1],o=n-i;return o?r+o*(t[i]-r):r},d3.transpose=function(t){return d3.zip.apply(d3,t)},d3.zip=function(){if(!(i=arguments.length))return[];for(var t=-1,e=d3.min(arguments,s),n=new Array(e);++t<e;)for(var i,r=-1,o=n[t]=new Array(i);++r<i;)o[r]=arguments[r][t];return n},d3.bisector=function(t){return{left:function(e,n,i,r){for(arguments.length<3&&(i=0),arguments.length<4&&(r=e.length);i<r;){var o=i+r>>1;t.call(e,e[o],o)<n?i=o+1:r=o}return i},right:function(e,n,i,r){for(arguments.length<3&&(i=0),arguments.length<4&&(r=e.length);i<r;){var o=i+r>>1;n<t.call(e,e[o],o)?r=o:i=o+1}return i}}};var jn=d3.bisector((function(t){return t}));d3.bisectLeft=jn.left,d3.bisect=d3.bisectRight=jn.right,d3.first=function(t,e){var n,i=0,r=t.length,o=t[0];for(1===arguments.length&&(e=d3.ascending);++i<r;)e.call(t,o,n=t[i])>0&&(o=n);return o},d3.last=function(t,e){var n,i=0,r=t.length,o=t[0];for(1===arguments.length&&(e=d3.ascending);++i<r;)e.call(t,o,n=t[i])<=0&&(o=n);return o},d3.nest=function(){function e(n,s){if(s>=a.length)return r?r.call(o,n):i?n.sort(i):n;for(var l,u,c,d=-1,h=n.length,f=a[s++],p=new t,g={};++d<h;)(c=p.get(l=f(u=n[d])))?c.push(u):p.set(l,[u]);return p.forEach((function(t){g[t]=e(p.get(t),s)})),g}function n(t,e){if(e>=a.length)return t;var i,r=[],o=s[e++];for(i in t)r.push({key:i,values:n(t[i],e)});return o&&r.sort((function(t,e){return o(t.key,e.key)})),r}var i,r,o={},a=[],s=[];return o.map=function(t){return e(t,0)},o.entries=function(t){return n(e(t,0),0)},o.key=function(t){return a.push(t),o},o.sortKeys=function(t){return s[a.length-1]=t,o},o.sortValues=function(t){return i=t,o},o.rollup=function(t){return r=t,o},o},d3.keys=function(t){var e=[];for(var n in t)e.push(n);return e},d3.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},d3.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},d3.permute=function(t,e){for(var n=[],i=-1,r=e.length;++i<r;)n[i]=t[e[i]];return n},d3.merge=function(t){return Array.prototype.concat.apply([],t)},d3.split=function(t,e){var n,i=[],r=[],o=-1,a=t.length;for(arguments.length<2&&(e=l);++o<a;)e.call(r,n=t[o],o)?r=[]:(r.length||i.push(r),r.push(n));return i},d3.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n==1/0)throw new Error("infinite range");var i,r=[],o=function(t){for(var e=1;t*e%1;)e*=10;return e}(Math.abs(n)),a=-1;if(t*=o,e*=o,(n*=o)<0)for(;(i=t+n*++a)>e;)r.push(i/o);else for(;(i=t+n*++a)<e;)r.push(i/o);return r},d3.requote=function(t){return t.replace(Tn,"\\$&")};var Tn=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},d3.xhr=function(t,e,n){var i=new XMLHttpRequest;arguments.length<3?(n=e,e=null):e&&i.overrideMimeType&&i.overrideMimeType(e),i.open("GET",t,!0),e&&i.setRequestHeader("Accept",e),i.onreadystatechange=function(){if(4===i.readyState){var t=i.status;n(!t&&i.response||t>=200&&t<300||304===t?i:null)}},i.send(null)},d3.text=function(t,e,n){arguments.length<3&&(n=e,e=null),d3.xhr(t,e,(function(t){n(t&&t.responseText)}))},d3.json=function(t,e){d3.text(t,"application/json",(function(t){e(t?JSON.parse(t):null)}))},d3.html=function(t,e){d3.text(t,"text/html",(function(t){if(null!=t){var n=document.createRange();n.selectNode(document.body),t=n.createContextualFragment(t)}e(t)}))},d3.xml=function(t,e,n){arguments.length<3&&(n=e,e=null),d3.xhr(t,e,(function(t){n(t&&t.responseXML)}))};var An={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:An,qualify:function(t){var e=t.indexOf(":"),n=t;return e>=0&&(n=t.substring(0,e),t=t.substring(e+1)),An.hasOwnProperty(n)?{space:An[n],local:t}:t}},d3.dispatch=function(){for(var t=new c,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=d(t);return t},c.prototype.on=function(t,e){var n=t.indexOf("."),i="";return n>0&&(i=t.substring(n+1),t=t.substring(0,n)),arguments.length<2?this[t].on(i):this[t].on(i,e)},d3.format=function(t){var e=kn.exec(t),n=e[1]||" ",i=e[3]||"",r=e[5],o=+e[6],a=e[7],s=e[8],l=e[9],u=1,c="",d=!1;switch(s&&(s=+s.substring(1)),r&&(n="0",a&&(o-=Math.floor((o-1)/4))),l){case"n":a=!0,l="g";break;case"%":u=100,c="%",l="f";break;case"p":u=100,c="%",l="r";break;case"d":d=!0,s=0;break;case"s":u=-1,l="r"}return"r"==l&&!s&&(l="g"),l=In.get(l)||f,function(t){if(d&&t%1)return"";var e,h=t<0&&(t=-t)?"−":i;if(u<0){var f=d3.formatPrefix(t,s);t=f.scale(t),c=f.symbol}else t*=u;(t=l(t,s),r)?((e=t.length+h.length)<o&&(t=new Array(o-e+1).join(n)+t),a&&(t=p(t)),t=h+t):(a&&(t=p(t)),(e=(t=h+t).length)<o&&(t=new Array(o-e+1).join(n)+t));return t+c}};var kn=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,In=d3.map({g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return d3.round(t,e=h(t,e)).toFixed(Math.max(0,Math.min(20,e)))}}),Ln=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map((function(t,e){var n=Math.pow(10,3*Math.abs(8-e));return{scale:e>8?function(t){return t/n}:function(t){return t*n},symbol:t}}));d3.formatPrefix=function(t,e){var n=0;return t&&(t<0&&(t*=-1),e&&(t=d3.round(t,h(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n<=0?n+1:n-1)/3)))),Ln[8+n/3]};var On=y(2),Nn=y(3),zn=function(){return v},Rn=d3.map({linear:zn,poly:y,quad:function(){return On},cubic:function(){return Nn},sin:function(){return b},exp:function(){return x},circle:function(){return w},elastic:function(t,e){var n;return arguments.length<2&&(e=.45),arguments.length<1?(t=1,n=e/4):n=e/(2*Math.PI)*Math.asin(1/t),function(i){return 1+t*Math.pow(2,10*-i)*Math.sin(2*(i-n)*Math.PI/e)}},back:function(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}},bounce:function(){return C}}),Hn=d3.map({in:v,out:g,"in-out":m,"out-in":function(t){return m(g(t))}});d3.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.substring(0,e):t,i=e>=0?t.substring(e+1):"in";return n=Rn.get(n)||zn,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}((i=Hn.get(i)||v)(n.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(t,e){for(var n,i=d3.interpolators.length;--i>=0&&!(n=d3.interpolators[i](t,e)););return n},d3.interpolateNumber=function(t,e){return e-=t,function(n){return t+e*n}},d3.interpolateRound=function(t,e){return e-=t,function(n){return Math.round(t+e*n)}},d3.interpolateString=function(t,e){var n,i,r,o,a,s=0,l=[],u=[];for(Fn.lastIndex=0,i=0;n=Fn.exec(e);++i)n.index&&l.push(e.substring(s,n.index)),u.push({i:l.length,x:n[0]}),l.push(null),s=Fn.lastIndex;for(s<e.length&&l.push(e.substring(s)),i=0,o=u.length;(n=Fn.exec(t))&&i<o;++i)if((a=u[i]).x==n[0]){if(a.i)if(null==l[a.i+1])for(l[a.i-1]+=a.x,l.splice(a.i,1),r=i+1;r<o;++r)u[r].i--;else for(l[a.i-1]+=a.x+l[a.i+1],l.splice(a.i,2),r=i+1;r<o;++r)u[r].i-=2;else if(null==l[a.i+1])l[a.i]=a.x;else for(l[a.i]=a.x+l[a.i+1],l.splice(a.i+1,1),r=i+1;r<o;++r)u[r].i--;u.splice(i,1),o--,i--}else a.x=d3.interpolateNumber(parseFloat(n[0]),parseFloat(a.x));for(;i<o;)a=u.pop(),null==l[a.i+1]?l[a.i]=a.x:(l[a.i]=a.x+l[a.i+1],l.splice(a.i+1,1)),o--;return 1===l.length?null==l[0]?u[0].x:function(){return e}:function(t){for(i=0;i<o;++i)l[(a=u[i]).i]=a.x(t);return l.join("")}},d3.interpolateTransform=function(t,e){var n,i=[],r=[],o=d3.transform(t),a=d3.transform(e),s=o.translate,l=a.translate,u=o.rotate,c=a.rotate,d=o.skew,h=a.skew,f=o.scale,p=a.scale;return s[0]!=l[0]||s[1]!=l[1]?(i.push("translate(",null,",",null,")"),r.push({i:1,x:d3.interpolateNumber(s[0],l[0])},{i:3,x:d3.interpolateNumber(s[1],l[1])})):l[0]||l[1]?i.push("translate("+l+")"):i.push(""),u!=c?(u-c>180?c+=360:c-u>180&&(u+=360),r.push({i:i.push(i.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(u,c)})):c&&i.push(i.pop()+"rotate("+c+")"),d!=h?r.push({i:i.push(i.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(d,h)}):h&&i.push(i.pop()+"skewX("+h+")"),f[0]!=p[0]||f[1]!=p[1]?(n=i.push(i.pop()+"scale(",null,",",null,")"),r.push({i:n-4,x:d3.interpolateNumber(f[0],p[0])},{i:n-2,x:d3.interpolateNumber(f[1],p[1])})):(1!=p[0]||1!=p[1])&&i.push(i.pop()+"scale("+p+")"),n=r.length,function(t){for(var e,o=-1;++o<n;)i[(e=r[o]).i]=e.x(t);return i.join("")}},d3.interpolateRgb=function(t,e){t=d3.rgb(t),e=d3.rgb(e);var n=t.r,i=t.g,r=t.b,o=e.r-n,a=e.g-i,s=e.b-r;return function(t){return"#"+A(Math.round(n+o*t))+A(Math.round(i+a*t))+A(Math.round(r+s*t))}},d3.interpolateHsl=function(t,e){t=d3.hsl(t),e=d3.hsl(e);var n=t.h,i=t.s,r=t.l,o=e.h-n,a=e.s-i,s=e.l-r;return o>180?o-=360:o<-180&&(o+=360),function(t){return z(n+o*t,i+a*t,r+s*t).toString()}},d3.interpolateArray=function(t,e){var n,i=[],r=[],o=t.length,a=e.length,s=Math.min(t.length,e.length);for(n=0;n<s;++n)i.push(d3.interpolate(t[n],e[n]));for(;n<o;++n)r[n]=t[n];for(;n<a;++n)r[n]=e[n];return function(t){for(n=0;n<s;++n)r[n]=i[n](t);return r}},d3.interpolateObject=function(t,e){var n,i={},r={};for(n in t)n in e?i[n]=S(n)(t[n],e[n]):r[n]=t[n];for(n in e)n in t||(r[n]=e[n]);return function(t){for(n in i)r[n]=i[n](t);return r}};var Fn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(t,e){return e instanceof Array&&d3.interpolateArray(t,e)},function(t,e){return("string"==typeof t||"string"==typeof e)&&d3.interpolateString(t+"",e+"")},function(t,e){return("string"==typeof e?Vn.has(e)||/^(#|rgb\(|hsl\()/.test(e):e instanceof T||e instanceof N)&&d3.interpolateRgb(t,e)},function(t,e){return!isNaN(t=+t)&&!isNaN(e=+e)&&d3.interpolateNumber(t,e)}],d3.rgb=function(t,e,n){return 1===arguments.length?t instanceof T?j(t.r,t.g,t.b):k(""+t,j,z):j(~~t,~~e,~~n)},T.prototype.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,i=this.b,r=30;return e||n||i?(e&&e<r&&(e=r),n&&n<r&&(n=r),i&&i<r&&(i=r),j(Math.min(255,Math.floor(e/t)),Math.min(255,Math.floor(n/t)),Math.min(255,Math.floor(i/t)))):j(r,r,r)},T.prototype.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),j(Math.floor(t*this.r),Math.floor(t*this.g),Math.floor(t*this.b))},T.prototype.hsl=function(){return I(this.r,this.g,this.b)},T.prototype.toString=function(){return"#"+A(this.r)+A(this.g)+A(this.b)};var Vn=d3.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});Vn.forEach((function(t,e){Vn.set(t,k(e,j,z))})),d3.hsl=function(t,e,n){return 1===arguments.length?t instanceof N?O(t.h,t.s,t.l):k(""+t,I,O):O(+t,+e,+n)},N.prototype.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),O(this.h,this.s,this.l/t)},N.prototype.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),O(this.h,this.s,t*this.l)},N.prototype.rgb=function(){return z(this.h,this.s,this.l)},N.prototype.toString=function(){return this.rgb().toString()};var Bn=function(t,e){return e.querySelector(t)},Wn=function(t,e){return e.querySelectorAll(t)},$n=document.documentElement,Un=$n.matchesSelector||$n.webkitMatchesSelector||$n.mozMatchesSelector||$n.msMatchesSelector||$n.oMatchesSelector,qn=function(t,e){return Un.call(t,e)};"function"==typeof Sizzle&&(Bn=function(t,e){return Sizzle(t,e)[0]||null},Wn=function(t,e){return Sizzle.uniqueSort(Sizzle(t,e))},qn=Sizzle.matchesSelector);var Gn=[];d3.selection=function(){return Yn},d3.selection.prototype=Gn,Gn.select=function(t){var e,n,i,r,o=[];"function"!=typeof t&&(t=H(t));for(var a=-1,s=this.length;++a<s;){o.push(e=[]),e.parentNode=(i=this[a]).parentNode;for(var l=-1,u=i.length;++l<u;)(r=i[l])?(e.push(n=t.call(r,r.__data__,l)),n&&"__data__"in r&&(n.__data__=r.__data__)):e.push(null)}return R(o)},Gn.selectAll=function(t){var e,n,i=[];"function"!=typeof t&&(t=F(t));for(var r=-1,o=this.length;++r<o;)for(var a=this[r],s=-1,l=a.length;++s<l;)(n=a[s])&&(i.push(e=Mn(t.call(n,n.__data__,s))),e.parentNode=n);return R(i)},Gn.attr=function(t,e){if(t=d3.ns.qualify(t),arguments.length<2){var n=this.node();return t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}return this.each(null==e?t.local?function(){this.removeAttributeNS(t.space,t.local)}:function(){this.removeAttribute(t)}:"function"==typeof e?t.local?function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}:function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}:t.local?function(){this.setAttributeNS(t.space,t.local,e)}:function(){this.setAttribute(t,e)})},Gn.classed=function(t,e){var n=u(t).split(" "),i=n.length,r=-1;if(arguments.length>1){for(;++r<i;)V.call(this,n[r],e);return this}for(;++r<i;)if(!V.call(this,n[r]))return!1;return!0},Gn.style=function(t,e,n){return arguments.length<3&&(n=""),arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(t):this.each(null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}:function(){this.style.setProperty(t,e,n)})},Gn.property=function(t,e){return arguments.length<2?this.node()[t]:this.each(null==e?function(){delete this[t]}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}:function(){this[t]=e})},Gn.text=function(t){return arguments.length<1?this.node().textContent:this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t})},Gn.html=function(t){return arguments.length<1?this.node().innerHTML:this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t})},Gn.append=function(t){return t=d3.ns.qualify(t),this.select(t.local?function(){return this.appendChild(document.createElementNS(t.space,t.local))}:function(){return this.appendChild(document.createElementNS(this.namespaceURI,t))})},Gn.insert=function(t,e){return t=d3.ns.qualify(t),this.select(t.local?function(){return this.insertBefore(document.createElementNS(t.space,t.local),Bn(e,this))}:function(){return this.insertBefore(document.createElementNS(this.namespaceURI,t),Bn(e,this))})},Gn.remove=function(){return this.each((function(){var t=this.parentNode;t&&t.removeChild(this)}))},Gn.data=function(e,n){function i(e,i){var r,o,a,s=e.length,d=i.length,h=Math.min(s,d),f=Math.max(s,d),p=[],g=[],m=[];if(n){var v,y=new t,b=[],x=i.length;for(r=-1;++r<s;)v=n.call(o=e[r],o.__data__,r),y.has(v)?m[x++]=o:y.set(v,o),b.push(v);for(r=-1;++r<d;)v=n.call(i,a=i[r],r),y.has(v)?(p[r]=o=y.get(v),o.__data__=a,g[r]=m[r]=null):(g[r]=B(a),p[r]=m[r]=null),y.remove(v);for(r=-1;++r<s;)y.has(b[r])&&(m[r]=e[r])}else{for(r=-1;++r<h;)o=e[r],a=i[r],o?(o.__data__=a,p[r]=o,g[r]=m[r]=null):(g[r]=B(a),p[r]=m[r]=null);for(;r<d;++r)g[r]=B(i[r]),p[r]=m[r]=null;for(;r<f;++r)m[r]=e[r],g[r]=p[r]=null}g.update=p,g.parentNode=p.parentNode=m.parentNode=e.parentNode,l.push(g),u.push(p),c.push(m)}var r,o,a=-1,s=this.length;if(!arguments.length){for(e=new Array(s=(r=this[0]).length);++a<s;)(o=r[a])&&(e[a]=o.__data__);return e}var l=U([]),u=R([]),c=R([]);if("function"==typeof e)for(;++a<s;)i(r=this[a],e.call(r,r.parentNode.__data__,a));else for(;++a<s;)i(r=this[a],e);return u.enter=function(){return l},u.exit=function(){return c},u},Gn.datum=Gn.map=function(t){return arguments.length<1?this.property("__data__"):this.property("__data__",t)},Gn.filter=function(t){var e,n,i,r=[];"function"!=typeof t&&(t=function(t){return function(){return qn(this,t)}}(t));for(var o=0,a=this.length;o<a;o++){r.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var s=0,l=n.length;s<l;s++)(i=n[s])&&t.call(i,i.__data__,s)&&e.push(i)}return R(r)},Gn.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,i=this[t],r=i.length-1,o=i[r];--r>=0;)(n=i[r])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},Gn.sort=function(t){t=W.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()},Gn.on=function(t,e,n){arguments.length<3&&(n=!1);var i="__on"+t,r=t.indexOf(".");return r>0&&(t=t.substring(0,r)),arguments.length<2?(r=this.node()[i])&&r._:this.each((function(r,o){function a(t){var n=d3.event;d3.event=t;try{e.call(s,s.__data__,o)}finally{d3.event=n}}var s=this,l=s[i];l&&(s.removeEventListener(t,l,l.$),delete s[i]),e&&(s.addEventListener(t,s[i]=a,a.$=n),a._=e)}))},Gn.each=function(t){return $(this,(function(e,n,i){t.call(e,e.__data__,n,i)}))},Gn.call=function(t){return t.apply(this,(arguments[0]=this,arguments)),this},Gn.empty=function(){return!this.node()},Gn.node=function(t){for(var e=0,n=this.length;e<n;e++)for(var i=this[e],r=0,o=i.length;r<o;r++){var a=i[r];if(a)return a}return null},Gn.transition=function(){for(var t,e,n=[],i=-1,r=this.length;++i<r;){n.push(t=[]);for(var o=this[i],a=-1,s=o.length;++a<s;)t.push((e=o[a])?{node:e,delay:ei,duration:ni}:null)}return q(n,Zn||++Jn,Date.now())};var Yn=R([[document]]);Yn[0].parentNode=$n,d3.select=function(t){return"string"==typeof t?Yn.select(t):R([[t]])},d3.selectAll=function(t){return"string"==typeof t?Yn.selectAll(t):R([Mn(t)])};var Xn=[];d3.selection.enter=U,d3.selection.enter.prototype=Xn,Xn.append=Gn.append,Xn.insert=Gn.insert,Xn.empty=Gn.empty,Xn.node=Gn.node,Xn.select=function(t){for(var e,n,i,r,o,a=[],s=-1,l=this.length;++s<l;){i=(r=this[s]).update,a.push(e=[]),e.parentNode=r.parentNode;for(var u=-1,c=r.length;++u<c;)(o=r[u])?(e.push(i[u]=n=t.call(r.parentNode,o.__data__,u)),n.__data__=o.__data__):e.push(null)}return R(a)};var Qn={},Kn=[],Jn=0,Zn=0,ti=d3.ease("cubic-in-out"),ei=0,ni=250,ii=ti;Kn.call=Gn.call,d3.transition=function(t){return arguments.length?Zn?t.transition():t:Yn.transition()},d3.transition.prototype=Kn,Kn.select=function(t){var e,n,i,r=[];"function"!=typeof t&&(t=H(t));for(var o=-1,a=this.length;++o<a;){r.push(e=[]);for(var s=this[o],l=-1,u=s.length;++l<u;)(i=s[l])&&(n=t.call(i.node,i.node.__data__,l))?("__data__"in i.node&&(n.__data__=i.node.__data__),e.push({node:n,delay:i.delay,duration:i.duration})):e.push(null)}return q(r,this.id,this.time).ease(this.ease())},Kn.selectAll=function(t){var e,n,i,r=[];"function"!=typeof t&&(t=F(t));for(var o=-1,a=this.length;++o<a;)for(var s=this[o],l=-1,u=s.length;++l<u;)if(i=s[l]){n=t.call(i.node,i.node.__data__,l),r.push(e=[]);for(var c=-1,d=n.length;++c<d;)e.push({node:n[c],delay:i.delay,duration:i.duration})}return q(r,this.id,this.time).ease(this.ease())},Kn.attr=function(t,e){return this.attrTween(t,Y(t,e))},Kn.attrTween=function(t,e){var n=d3.ns.qualify(t);return this.tween("attr."+t,n.local?function(t,i){var r=e.call(this,t,i,this.getAttributeNS(n.space,n.local));return r===Qn?(this.removeAttributeNS(n.space,n.local),null):r&&function(t){this.setAttributeNS(n.space,n.local,r(t))}}:function(t,i){var r=e.call(this,t,i,this.getAttribute(n));return r===Qn?(this.removeAttribute(n),null):r&&function(t){this.setAttribute(n,r(t))}})},Kn.style=function(t,e,n){return arguments.length<3&&(n=""),this.styleTween(t,Y(t,e),n)},Kn.styleTween=function(t,e,n){return arguments.length<3&&(n=""),this.tween("style."+t,(function(i,r){var o=e.call(this,i,r,window.getComputedStyle(this,null).getPropertyValue(t));return o===Qn?(this.style.removeProperty(t),null):o&&function(e){this.style.setProperty(t,o(e),n)}}))},Kn.text=function(t){return this.tween("text",(function(e,n){this.textContent="function"==typeof t?t.call(this,e,n):t}))},Kn.remove=function(){return this.each("end.transition",(function(){var t;!this.__transition__&&(t=this.parentNode)&&t.removeChild(this)}))},Kn.delay=function(t){return $(this,"function"==typeof t?function(e,n,i){e.delay=0|t.call(e=e.node,e.__data__,n,i)}:(t|=0,function(e){e.delay=t}))},Kn.duration=function(t){return $(this,"function"==typeof t?function(e,n,i){e.duration=Math.max(1,0|t.call(e=e.node,e.__data__,n,i))}:(t=Math.max(1,0|t),function(e){e.duration=t}))},Kn.transition=function(){return this.select(n)};var ri,oi,ai=null;d3.timer=function(t,e,n){var i=!1,r=ai;if(arguments.length<3){if(arguments.length<2)e=0;else if(!isFinite(e))return;n=Date.now()}for(;r;){if(r.callback===t){r.then=n,r.delay=e,i=!0;break}r=r.next}i||(ai={callback:t,then:n,delay:e,next:ai}),ri||(oi=clearTimeout(oi),ri=1,si(Q))},d3.timer.flush=function(){for(var t,e=Date.now(),n=ai;n;)t=e-n.then,n.delay||(n.flush=n.callback(t)),n=n.next;K()};var si=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,17)};d3.transform=function(t){var e=document.createElementNS(d3.ns.prefix.svg,"g"),n={a:1,b:0,c:0,d:1,e:0,f:0};return(d3.transform=function(t){e.setAttribute("transform",t);var i=e.transform.baseVal.consolidate();return new J(i?i.matrix:n)})(t)},J.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var li=180/Math.PI;d3.mouse=function(t){return et(t,E())};var ui=/WebKit/.test(navigator.userAgent)?-1:0;d3.touches=function(t,e){return arguments.length<2&&(e=E().touches),e?Mn(e).map((function(e){var n=et(t,e);return n.identifier=e.identifier,n})):[]},d3.scale={},d3.scale.linear=function(){return at([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return pt(d3.scale.linear(),gt)};var ci=d3.format(".0e");gt.pow=function(t){return Math.pow(10,t)},mt.pow=function(t){return-Math.pow(10,-t)},d3.scale.pow=function(){return vt(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return bt([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(di)},d3.scale.category20=function(){return d3.scale.ordinal().range(hi)},d3.scale.category20b=function(){return d3.scale.ordinal().range(fi)},d3.scale.category20c=function(){return d3.scale.ordinal().range(pi)};var di=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],hi=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],fi=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],pi=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return xt([],[])},d3.scale.quantize=function(){return wt(0,1,[0,1])},d3.scale.identity=function(){return Ct([0,1])},d3.svg={},d3.svg.arc=function(){function t(){var t=e.apply(this,arguments),r=n.apply(this,arguments),a=i.apply(this,arguments)+gi,s=o.apply(this,arguments)+gi,l=(s<a&&(l=a,a=s,s=l),s-a),u=l<Math.PI?"0":"1",c=Math.cos(a),d=Math.sin(a),h=Math.cos(s),f=Math.sin(s);return l>=mi?t?"M0,"+r+"A"+r+","+r+" 0 1,1 0,"+-r+"A"+r+","+r+" 0 1,1 0,"+r+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+r+"A"+r+","+r+" 0 1,1 0,"+-r+"A"+r+","+r+" 0 1,1 0,"+r+"Z":t?"M"+r*c+","+r*d+"A"+r+","+r+" 0 "+u+",1 "+r*h+","+r*f+"L"+t*h+","+t*f+"A"+t+","+t+" 0 "+u+",0 "+t*c+","+t*d+"Z":"M"+r*c+","+r*d+"A"+r+","+r+" 0 "+u+",1 "+r*h+","+r*f+"L0,0Z"}var e=_t,n=Et,i=Mt,o=St;return t.innerRadius=function(n){return arguments.length?(e=r(n),t):e},t.outerRadius=function(e){return arguments.length?(n=r(e),t):n},t.startAngle=function(e){return arguments.length?(i=r(e),t):i},t.endAngle=function(e){return arguments.length?(o=r(e),t):o},t.centroid=function(){var t=(e.apply(this,arguments)+n.apply(this,arguments))/2,r=(i.apply(this,arguments)+o.apply(this,arguments))/2+gi;return[Math.cos(r)*t,Math.sin(r)*t]},t};var gi=-Math.PI/2,mi=2*Math.PI-1e-6;d3.svg.line=function(){return Dt(e)};var vi="linear",yi=d3.map({linear:Tt,"step-before":At,"step-after":kt,basis:Ot,"basis-open":function(t){if(t.length<4)return Tt(t);for(var e,n=[],i=-1,r=t.length,o=[0],a=[0];++i<3;)e=t[i],o.push(e[0]),a.push(e[1]);for(n.push(Nt(wi,o)+","+Nt(wi,a)),--i;++i<r;)e=t[i],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),zt(n,o,a);return n.join("")},"basis-closed":function(t){for(var e,n,i=-1,r=t.length,o=r+4,a=[],s=[];++i<4;)n=t[i%r],a.push(n[0]),s.push(n[1]);for(e=[Nt(wi,a),",",Nt(wi,s)],--i;++i<o;)n=t[i%r],a.shift(),a.push(n[0]),s.shift(),s.push(n[1]),zt(e,a,s);return e.join("")},bundle:function(t,e){var n=t.length-1;if(n)for(var i,r,o=t[0][0],a=t[0][1],s=t[n][0]-o,l=t[n][1]-a,u=-1;++u<=n;)r=u/n,(i=t[u])[0]=e*i[0]+(1-e)*(o+r*s),i[1]=e*i[1]+(1-e)*(a+r*l);return Ot(t)},cardinal:function(t,e,n){return t.length<3?Tt(t):t[0]+It(t,Lt(t,e))},"cardinal-open":function(t,e){return t.length<4?Tt(t):t[1]+It(t.slice(1,t.length-1),Lt(t,e))},"cardinal-closed":function(t,e){return t.length<3?Tt(t):t[0]+It((t.push(t[0]),t),Lt([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Tt(t):t[0]+It(t,Ht(t))}}),bi=[0,2/3,1/3,0],xi=[0,1/3,2/3,0],wi=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var t=Dt(Ft);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},At.reverse=kt,kt.reverse=At,d3.svg.area=function(){return Vt(Object)},d3.svg.area.radial=function(){var t=Vt(Ft);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},d3.svg.chord=function(){function t(t,r){var s=e(this,o,t,r),l=e(this,a,t,r);return"M"+s.p0+n(s.r,s.p1,s.a1-s.a0)+(function(t,e){return t.a0==e.a0&&t.a1==e.a1}(s,l)?i(s.r,s.p1,s.r,s.p0):i(s.r,s.p1,l.r,l.p0)+n(l.r,l.p1,l.a1-l.a0)+i(l.r,l.p1,s.r,s.p0))+"Z"}function e(t,e,n,i){var r=e.call(t,n,i),o=s.call(t,r,i),a=l.call(t,r,i)+gi,c=u.call(t,r,i)+gi;return{r:o,a0:a,a1:c,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(c),o*Math.sin(c)]}}function n(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Math.PI)+",1 "+e}function i(t,e,n,i){return"Q 0,0 "+i}var o=Bt,a=Wt,s=$t,l=Mt,u=St;return t.radius=function(e){return arguments.length?(s=r(e),t):s},t.source=function(e){return arguments.length?(o=r(e),t):o},t.target=function(e){return arguments.length?(a=r(e),t):a},t.startAngle=function(e){return arguments.length?(l=r(e),t):l},t.endAngle=function(e){return arguments.length?(u=r(e),t):u},t},d3.svg.diagonal=function(){function t(t,r){var o=e.call(this,t,r),a=n.call(this,t,r),s=(o.y+a.y)/2,l=[o,{x:o.x,y:s},{x:a.x,y:s},a];return"M"+(l=l.map(i))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=Bt,n=Wt,i=Ut;return t.source=function(n){return arguments.length?(e=r(n),t):e},t.target=function(e){return arguments.length?(n=r(e),t):n},t.projection=function(e){return arguments.length?(i=e,t):i},t},d3.svg.diagonal.radial=function(){var t=d3.svg.diagonal(),e=Ut,n=t.projection;return t.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),n=e[0],i=e[1]+gi;return[n*Math.cos(i),n*Math.sin(i)]}}(e=t)):e},t},d3.svg.mouse=d3.mouse,d3.svg.touches=d3.touches,d3.svg.symbol=function(){function t(t,i){return(Ci.get(e.call(this,t,i))||Yt)(n.call(this,t,i))}var e=Gt,n=qt;return t.type=function(n){return arguments.length?(e=r(n),t):e},t.size=function(e){return arguments.length?(n=r(e),t):n},t};var Ci=d3.map({circle:Yt,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Ei)),n=e*Ei;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/_i),n=e*_i/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/_i),n=e*_i/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});d3.svg.symbolTypes=Ci.keys();var _i=Math.sqrt(3),Ei=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function t(t){t.each((function(){var t,d=d3.select(this),h=null==u?n.ticks?n.ticks.apply(n,l):n.domain():u,f=null==e?n.tickFormat?n.tickFormat.apply(n,l):String:e,p=function(t,e,n){if(i=[],n&&e.length>1){for(var i,r,o,a=nt(t.domain()),s=-1,l=e.length,u=(e[1]-e[0])/++n;++s<l;)for(r=n;--r>0;)(o=+e[s]-r*u)>=a[0]&&i.push(o);for(--s,r=0;++r<n&&(o=+e[s]+r*u)<a[1];)i.push(o)}return i}(n,h,c),g=d.selectAll(".minor").data(p,String),m=g.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),v=d3.transition(g.exit()).style("opacity",1e-6).remove(),y=d3.transition(g).style("opacity",1),b=d.selectAll("g").data(h,String),x=b.enter().insert("g","path").style("opacity",1e-6),w=d3.transition(b.exit()).style("opacity",1e-6).remove(),C=d3.transition(b).style("opacity",1),_=it(n),E=d.selectAll(".domain").data([0]),M=(E.enter().append("path").attr("class","domain"),d3.transition(E)),S=n.copy(),D=this.__chart__||S;this.__chart__=S,x.append("line").attr("class","tick"),x.append("text");var P=x.select("line"),j=C.select("line"),T=b.select("text").text(f),A=x.select("text"),k=C.select("text");switch(i){case"bottom":t=Xt,m.attr("y2",o),y.attr("x2",0).attr("y2",o),P.attr("y2",r),A.attr("y",Math.max(r,0)+s),j.attr("x2",0).attr("y2",r),k.attr("x",0).attr("y",Math.max(r,0)+s),T.attr("dy",".71em").attr("text-anchor","middle"),M.attr("d","M"+_[0]+","+a+"V0H"+_[1]+"V"+a);break;case"top":t=Xt,m.attr("y2",-o),y.attr("x2",0).attr("y2",-o),P.attr("y2",-r),A.attr("y",-(Math.max(r,0)+s)),j.attr("x2",0).attr("y2",-r),k.attr("x",0).attr("y",-(Math.max(r,0)+s)),T.attr("dy","0em").attr("text-anchor","middle"),M.attr("d","M"+_[0]+","+-a+"V0H"+_[1]+"V"+-a);break;case"left":t=Qt,m.attr("x2",-o),y.attr("x2",-o).attr("y2",0),P.attr("x2",-r),A.attr("x",-(Math.max(r,0)+s)),j.attr("x2",-r).attr("y2",0),k.attr("x",-(Math.max(r,0)+s)).attr("y",0),T.attr("dy",".32em").attr("text-anchor","end"),M.attr("d","M"+-a+","+_[0]+"H0V"+_[1]+"H"+-a);break;case"right":t=Qt,m.attr("x2",o),y.attr("x2",o).attr("y2",0),P.attr("x2",r),A.attr("x",Math.max(r,0)+s),j.attr("x2",r).attr("y2",0),k.attr("x",Math.max(r,0)+s).attr("y",0),T.attr("dy",".32em").attr("text-anchor","start"),M.attr("d","M"+a+","+_[0]+"H0V"+_[1]+"H"+a)}if(n.ticks)x.call(t,D),C.call(t,S),w.call(t,S),m.call(t,D),y.call(t,S),v.call(t,S);else{var I=S.rangeBand()/2,L=function(t){return S(t)+I};x.call(t,L),C.call(t,L)}}))}var e,n=d3.scale.linear(),i="bottom",r=6,o=6,a=6,s=3,l=[10],u=null,c=0;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(i=e,t):i},t.ticks=function(){return arguments.length?(l=arguments,t):l},t.tickValues=function(e){return arguments.length?(u=e,t):u},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e,n,i){if(!arguments.length)return r;var s=arguments.length-1;return r=+e,o=s>1?+n:r,a=s>0?+arguments[s]:r,t},t.tickPadding=function(e){return arguments.length?(s=+e,t):s},t.tickSubdivide=function(e){return arguments.length?(c=+e,t):c},t},d3.svg.brush=function(){function t(o){o.each((function(){var o,a=d3.select(this),c=a.selectAll(".background").data([0]),d=a.selectAll(".extent").data([0]),h=a.selectAll(".resize").data(u,String);a.style("pointer-events","all").on("mousedown.brush",r).on("touchstart.brush",r),c.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),d.enter().append("rect").attr("class","extent").style("cursor","move"),h.enter().append("g").attr("class",(function(t){return"resize "+t})).style("cursor",(function(t){return Mi[t]})).append("rect").attr("x",(function(t){return/[ew]$/.test(t)?-3:null})).attr("y",(function(t){return/^[ns]/.test(t)?-3:null})).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",t.empty()?"none":null),h.exit().remove(),s&&(o=it(s),c.attr("x",o[0]).attr("width",o[1]-o[0]),n(a)),l&&(o=it(l),c.attr("y",o[0]).attr("height",o[1]-o[0]),i(a)),e(a)}))}function e(t){t.selectAll(".resize").attr("transform",(function(t){return"translate("+c[+/e$/.test(t)][0]+","+c[+/^s/.test(t)][1]+")"}))}function n(t){t.select(".extent").attr("x",c[0][0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",c[1][0]-c[0][0])}function i(t){t.select(".extent").attr("y",c[0][1]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",c[1][1]-c[0][1])}function r(){function r(){var t=d3.event.changedTouches;return t?d3.touches(g,t)[0]:d3.mouse(g)}function u(){var t=r(),o=!1;p&&(t[0]+=p[0],t[1]+=p[1]),C||(d3.event.altKey?(f||(f=[(c[0][0]+c[1][0])/2,(c[0][1]+c[1][1])/2]),E[0]=c[+(t[0]<f[0])][0],E[1]=c[+(t[1]<f[1])][1]):f=null),x&&d(t,s,0)&&(n(y),o=!0),w&&d(t,l,1)&&(i(y),o=!0),o&&(e(y),v({type:"brush",mode:C?"move":"resize"}))}function d(t,e,n){var i,r,a=it(e),s=a[0],l=a[1],u=E[n],d=c[1][n]-c[0][n];if(C&&(s-=u,l-=d+u),i=Math.max(s,Math.min(l,t[n])),C?r=(i+=u)+d:(f&&(u=Math.max(s,Math.min(l,2*f[n]-i))),u<i?(r=i,i=u):r=u),c[0][n]!==i||c[1][n]!==r)return o=null,c[0][n]=i,c[1][n]=r,!0}function h(){u(),y.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),d3.select("body").style("cursor",null),M.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),v({type:"brushend"}),_()}var f,p,g=this,m=d3.select(d3.event.target),v=a.of(g,arguments),y=d3.select(g),b=m.datum(),x=!/^(n|s)$/.test(b)&&s,w=!/^(e|w)$/.test(b)&&l,C=m.classed("extent"),E=r(),M=d3.select(window).on("mousemove.brush",u).on("mouseup.brush",h).on("touchmove.brush",u).on("touchend.brush",h).on("keydown.brush",(function(){32==d3.event.keyCode&&(C||(f=null,E[0]-=c[1][0],E[1]-=c[1][1],C=2),_())})).on("keyup.brush",(function(){32==d3.event.keyCode&&2==C&&(E[0]+=c[1][0],E[1]+=c[1][1],C=0,_())}));if(C)E[0]=c[0][0]-E[0],E[1]=c[0][1]-E[1];else if(b){var S=+/w$/.test(b),D=+/^n/.test(b);p=[c[1-S][0]-E[0],c[1-D][1]-E[1]],E[0]=c[S][0],E[1]=c[D][1]}else d3.event.altKey&&(f=E.slice());y.style("pointer-events","none").selectAll(".resize").style("display",null),d3.select("body").style("cursor",m.style("cursor")),v({type:"brushstart"}),u(),_()}var o,a=M(t,"brushstart","brush","brushend"),s=null,l=null,u=Si[0],c=[[0,0],[0,0]];return t.x=function(e){return arguments.length?(u=Si[!(s=e)<<1|!l],t):s},t.y=function(e){return arguments.length?(u=Si[!s<<1|!(l=e)],t):l},t.extent=function(e){var n,i,r,a,u;return arguments.length?(o=[[0,0],[0,0]],s&&(n=e[0],i=e[1],l&&(n=n[0],i=i[0]),o[0][0]=n,o[1][0]=i,s.invert&&(n=s(n),i=s(i)),i<n&&(u=n,n=i,i=u),c[0][0]=0|n,c[1][0]=0|i),l&&(r=e[0],a=e[1],s&&(r=r[1],a=a[1]),o[0][1]=r,o[1][1]=a,l.invert&&(r=l(r),a=l(a)),a<r&&(u=r,r=a,a=u),c[0][1]=0|r,c[1][1]=0|a),t):(e=o||c,s&&(n=e[0][0],i=e[1][0],o||(n=c[0][0],i=c[1][0],s.invert&&(n=s.invert(n),i=s.invert(i)),i<n&&(u=n,n=i,i=u))),l&&(r=e[0][1],a=e[1][1],o||(r=c[0][1],a=c[1][1],l.invert&&(r=l.invert(r),a=l.invert(a)),a<r&&(u=r,r=a,a=u))),s&&l?[[n,r],[i,a]]:s?[n,i]:l&&[r,a])},t.clear=function(){return o=null,c[0][0]=c[0][1]=c[1][0]=c[1][1]=0,t},t.empty=function(){return s&&c[0][0]===c[1][0]||l&&c[0][1]===c[1][1]},d3.rebind(t,a,"on")};var Mi={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Si=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];d3.behavior={},d3.behavior.drag=function(){function t(){this.on("mousedown.drag",e).on("touchstart.drag",e)}function e(){function t(){var t=s.parentNode,e=d3.event.changedTouches;return e?d3.touches(t,e)[0]:d3.mouse(t)}function e(){if(!s.parentNode)return r();var e=t(),n=e[0]-c[0],i=e[1]-c[1];d|=n|i,c=e,_(),l({type:"drag",x:e[0]+a[0],y:e[1]+a[1],dx:n,dy:i})}function r(){l({type:"dragend"}),d&&(_(),d3.event.target===u&&h.on("click.drag",o,!0)),h.on("mousemove.drag",null).on("touchmove.drag",null).on("mouseup.drag",null).on("touchend.drag",null)}function o(){_(),h.on("click.drag",null)}var a,s=this,l=n.of(s,arguments),u=d3.event.target,c=t(),d=0,h=d3.select(window).on("mousemove.drag",e).on("touchmove.drag",e).on("mouseup.drag",r,!0).on("touchend.drag",r,!0);i?a=[(a=i.apply(s,arguments)).x-c[0],a.y-c[1]]:a=[0,0],_(),l({type:"dragstart"})}var n=M(t,"drag","dragstart","dragend"),i=null;return t.origin=function(e){return arguments.length?(i=e,t):i},d3.rebind(t,n,"on")},d3.behavior.zoom=function(){function t(){this.on("mousedown.zoom",a).on("mousewheel.zoom",s).on("mousemove.zoom",l).on("DOMMouseScroll.zoom",s).on("dblclick.zoom",u).on("touchstart.zoom",c).on("touchmove.zoom",d).on("touchend.zoom",c)}function e(t){return[(t[0]-b[0])/x,(t[1]-b[1])/x]}function n(t){return[t[0]*x+b[0],t[1]*x+b[1]]}function i(t){x=Math.max(w[0],Math.min(w[1],t))}function r(t,e){e=n(e),b[0]+=t[0]-e[0],b[1]+=t[1]-e[1]}function o(t){g&&g.domain(p.range().map((function(t){return(t-b[0])/x})).map(p.invert)),v&&v.domain(m.range().map((function(t){return(t-b[1])/x})).map(m.invert)),d3.event.preventDefault(),t({type:"zoom",scale:x,translate:b})}function a(){function t(){_(),l.on("click.zoom",null)}var n=this,i=C.of(n,arguments),a=d3.event.target,s=0,l=d3.select(window).on("mousemove.zoom",(function(){s=1,r(d3.mouse(n),u),o(i)})).on("mouseup.zoom",(function(){s&&_(),l.on("mousemove.zoom",null).on("mouseup.zoom",null),s&&d3.event.target===a&&l.on("click.zoom",t,!0)})),u=e(d3.mouse(n));window.focus(),_()}function s(){h||(h=e(d3.mouse(this))),i(Math.pow(2,.002*function(){Di||(Di=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var t,e=d3.event;try{Di.scrollTop=1e3,Di.dispatchEvent(e),t=1e3-Di.scrollTop}catch(n){t=e.wheelDelta||5*-e.detail}return t}())*x),r(d3.mouse(this),h),o(C.of(this,arguments))}function l(){h=null}function u(){var t=d3.mouse(this),n=e(t);i(d3.event.shiftKey?x/2:2*x),r(t,n),o(C.of(this,arguments))}function c(){var t=d3.touches(this),n=Date.now();if(f=x,h={},t.forEach((function(t){h[t.identifier]=e(t)})),_(),1===t.length&&n-y<500){var a=t[0],s=e(t[0]);i(2*x),r(a,s),o(C.of(this,arguments))}y=n}function d(){var t=d3.touches(this),e=t[0],n=h[e.identifier];if(a=t[1]){var a,s=h[a.identifier];e=[(e[0]+a[0])/2,(e[1]+a[1])/2],n=[(n[0]+s[0])/2,(n[1]+s[1])/2],i(d3.event.scale*f)}r(e,n),o(C.of(this,arguments))}var h,f,p,g,m,v,y,b=[0,0],x=1,w=Ti,C=M(t,"zoom");return t.translate=function(e){return arguments.length?(b=e.map(Number),t):b},t.scale=function(e){return arguments.length?(x=+e,t):x},t.scaleExtent=function(e){return arguments.length?(w=null==e?Ti:e.map(Number),t):w},t.x=function(e){return arguments.length?(g=e,p=e.copy(),t):g},t.y=function(e){return arguments.length?(v=e,m=e.copy(),t):v},d3.rebind(t,C,"on")};var Di,Pi,ji,Ti=[0,1/0];d3.layout={},d3.layout.bundle=function(){return function(t){for(var e=[],n=-1,i=t.length;++n<i;)e.push(Kt(t[n]));return e}},d3.layout.chord=function(){function t(){var t,u,d,h,f,p={},g=[],m=d3.range(o),v=[];for(n=[],i=[],t=0,h=-1;++h<o;){for(u=0,f=-1;++f<o;)u+=r[h][f];g.push(u),v.push(d3.range(o)),t+=u}for(a&&m.sort((function(t,e){return a(g[t],g[e])})),s&&v.forEach((function(t,e){t.sort((function(t,n){return s(r[e][t],r[e][n])}))})),t=(2*Math.PI-c*o)/t,u=0,h=-1;++h<o;){for(d=u,f=-1;++f<o;){var y=m[h],b=v[y][f],x=r[y][b],w=u,C=u+=x*t;p[y+"-"+b]={index:y,subindex:b,startAngle:w,endAngle:C,value:x}}i[y]={index:y,startAngle:d,endAngle:u,value:(u-d)/t},u+=c}for(h=-1;++h<o;)for(f=h-1;++f<o;){var _=p[h+"-"+f],E=p[f+"-"+h];(_.value||E.value)&&n.push(_.value<E.value?{source:E,target:_}:{source:_,target:E})}l&&e()}function e(){n.sort((function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)}))}var n,i,r,o,a,s,l,u={},c=0;return u.matrix=function(t){return arguments.length?(o=(r=t)&&r.length,n=i=null,u):r},u.padding=function(t){return arguments.length?(c=t,n=i=null,u):c},u.sortGroups=function(t){return arguments.length?(a=t,n=i=null,u):a},u.sortSubgroups=function(t){return arguments.length?(s=t,n=null,u):s},u.sortChords=function(t){return arguments.length?(l=t,n&&e(),u):l},u.chords=function(){return n||t(),n},u.groups=function(){return i||t(),i},u},d3.layout.force=function(){function t(t){return function(e,n,i,r,o){if(e.point!==t){var a=e.cx-t.x,s=e.cy-t.y,l=1/Math.sqrt(a*a+s*s);if((r-n)*l<v){var u=e.charge*l*l;return t.px-=a*u,t.py-=s*u,!0}if(e.point&&isFinite(l)){u=e.pointCharge*l*l;t.px-=a*u,t.py-=s*u}}return!e.charge}}function n(t){Zt(ji=t),Pi=u}var i,o,a,s,l,u={},c=d3.dispatch("start","tick","end"),d=[1,1],h=.9,f=re,p=oe,g=-30,m=.1,v=.8,y=[],b=[];return u.tick=function(){if((o*=.99)<.005)return c.end({type:"end",alpha:o=0}),!0;var e,n,i,r,u,f,p,v,x,w=y.length,C=b.length;for(n=0;n<C;++n)r=(i=b[n]).source,(f=(v=(u=i.target).x-r.x)*v+(x=u.y-r.y)*x)&&(v*=f=o*s[n]*((f=Math.sqrt(f))-a[n])/f,x*=f,u.x-=v*(p=r.weight/(u.weight+r.weight)),u.y-=x*p,r.x+=v*(p=1-p),r.y+=x*p);if((p=o*m)&&(v=d[0]/2,x=d[1]/2,n=-1,p))for(;++n<w;)(i=y[n]).x+=(v-i.x)*p,i.y+=(x-i.y)*p;if(g)for(ie(e=d3.geom.quadtree(y),o,l),n=-1;++n<w;)(i=y[n]).fixed||e.visit(t(i));for(n=-1;++n<w;)(i=y[n]).fixed?(i.x=i.px,i.y=i.py):(i.x-=(i.px-(i.px=i.x))*h,i.y-=(i.py-(i.py=i.y))*h);c.tick({type:"tick",alpha:o})},u.nodes=function(t){return arguments.length?(y=t,u):y},u.links=function(t){return arguments.length?(b=t,u):b},u.size=function(t){return arguments.length?(d=t,u):d},u.linkDistance=function(t){return arguments.length?(f=r(t),u):f},u.distance=u.linkDistance,u.linkStrength=function(t){return arguments.length?(p=r(t),u):p},u.friction=function(t){return arguments.length?(h=t,u):h},u.charge=function(t){return arguments.length?(g="function"==typeof t?t:+t,u):g},u.gravity=function(t){return arguments.length?(m=t,u):m},u.theta=function(t){return arguments.length?(v=t,u):v},u.alpha=function(t){return arguments.length?(o?o=t>0?t:0:t>0&&(c.start({type:"start",alpha:o=t}),d3.timer(u.tick)),u):o},u.start=function(){function t(t,n){for(var i,r=e(),o=-1,a=r.length;++o<a;)if(!isNaN(i=r[o][t]))return i;return Math.random()*n}function e(){if(!r){for(r=[],i=0;i<c;++i)r[i]=[];for(i=0;i<h;++i){var t=b[i];r[t.source.index].push(t.target),r[t.target.index].push(t.source)}}return r[n]}var n,i,r,o,c=y.length,h=b.length,m=d[0],v=d[1];for(n=0;n<c;++n)(o=y[n]).index=n,o.weight=0;for(a=[],s=[],n=0;n<h;++n)"number"==typeof(o=b[n]).source&&(o.source=y[o.source]),"number"==typeof o.target&&(o.target=y[o.target]),a[n]=f.call(this,o,n),s[n]=p.call(this,o,n),++o.source.weight,++o.target.weight;for(n=0;n<c;++n)o=y[n],isNaN(o.x)&&(o.x=t("x",m)),isNaN(o.y)&&(o.y=t("y",v)),isNaN(o.px)&&(o.px=o.x),isNaN(o.py)&&(o.py=o.y);if(l=[],"function"==typeof g)for(n=0;n<c;++n)l[n]=+g.call(this,y[n],n);else for(n=0;n<c;++n)l[n]=g;return u.resume()},u.resume=function(){return u.alpha(.1)},u.stop=function(){return u.alpha(0)},u.drag=function(){i||(i=d3.behavior.drag().origin(e).on("dragstart",n).on("drag",ne).on("dragend",ee)),this.on("mouseover.force",Zt).on("mouseout.force",te).call(i)},d3.rebind(u,c,"on")},d3.layout.partition=function(){function t(e,n,i,r){var o=e.children;if(e.x=n,e.y=e.depth*r,e.dx=i,e.dy=r,o&&(a=o.length)){var a,s,l,u=-1;for(i=e.value?i/e.value:0;++u<a;)t(s=o[u],n,l=s.value*i,r),n+=l}}function e(t){var n=t.children,i=0;if(n&&(r=n.length))for(var r,o=-1;++o<r;)i=Math.max(i,e(n[o]));return 1+i}function n(n,o){var a=i.call(this,n,o);return t(a[0],0,r[0],r[1]/e(a[0])),a}var i=d3.layout.hierarchy(),r=[1,1];return n.size=function(t){return arguments.length?(r=t,n):r},ve(n,i)},d3.layout.pie=function(){function t(o,a){var s=o.map((function(n,i){return+e.call(t,n,i)})),l=+("function"==typeof i?i.apply(this,arguments):i),u=(("function"==typeof r?r.apply(this,arguments):r)-i)/d3.sum(s),c=d3.range(o.length);null!=n&&c.sort(n===Ai?function(t,e){return s[e]-s[t]}:function(t,e){return n(o[t],o[e])});var d=[];return c.forEach((function(t){var e;d[t]={data:o[t],value:e=s[t],startAngle:l,endAngle:l+=e*u}})),d}var e=Number,n=Ai,i=0,r=2*Math.PI;return t.value=function(n){return arguments.length?(e=n,t):e},t.sort=function(e){return arguments.length?(n=e,t):n},t.startAngle=function(e){return arguments.length?(i=e,t):i},t.endAngle=function(e){return arguments.length?(r=e,t):r},t};var Ai={};d3.layout.stack=function(){function t(e,l){var u=e.map((function(e,i){return n.call(t,e,i)})),c=u.map((function(e,n){return e.map((function(e,n){return[a.call(t,e,n),s.call(t,e,n)]}))})),d=i.call(t,c,l);u=d3.permute(u,d),c=d3.permute(c,d);var h,f,p,g=r.call(t,c,l),m=u.length,v=u[0].length;for(f=0;f<v;++f)for(o.call(t,u[0][f],p=g[f],c[0][f][1]),h=1;h<m;++h)o.call(t,u[h][f],p+=c[h-1][f][1],c[h][f][1]);return e}var n=e,i=ue,r=ce,o=le,a=ae,s=se;return t.values=function(e){return arguments.length?(n=e,t):n},t.order=function(e){return arguments.length?(i="function"==typeof e?e:ki.get(e)||ue,t):i},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:Ii.get(e)||ce,t):r},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(s=e,t):s},t.out=function(e){return arguments.length?(o=e,t):o},t};var ki=d3.map({"inside-out":function(t){var e,n,i=t.length,r=t.map(de),o=t.map(he),a=d3.range(i).sort((function(t,e){return r[t]-r[e]})),s=0,l=0,u=[],c=[];for(e=0;e<i;++e)n=a[e],s<l?(s+=o[n],u.push(n)):(l+=o[n],c.push(n));return c.reverse().concat(u)},reverse:function(t){return d3.range(t.length).reverse()},default:ue}),Ii=d3.map({silhouette:function(t){var e,n,i,r=t.length,o=t[0].length,a=[],s=0,l=[];for(n=0;n<o;++n){for(e=0,i=0;e<r;e++)i+=t[e][n][1];i>s&&(s=i),a.push(i)}for(n=0;n<o;++n)l[n]=(s-a[n])/2;return l},wiggle:function(t){var e,n,i,r,o,a,s,l,u,c=t.length,d=t[0],h=d.length,f=[];for(f[0]=l=u=0,n=1;n<h;++n){for(e=0,r=0;e<c;++e)r+=t[e][n][1];for(e=0,o=0,s=d[n][0]-d[n-1][0];e<c;++e){for(i=0,a=(t[e][n][1]-t[e][n-1][1])/(2*s);i<e;++i)a+=(t[i][n][1]-t[i][n-1][1])/s;o+=a*t[e][n][1]}f[n]=l-=r?o/r*s:0,l<u&&(u=l)}for(n=0;n<h;++n)f[n]-=u;return f},expand:function(t){var e,n,i,r=t.length,o=t[0].length,a=1/r,s=[];for(n=0;n<o;++n){for(e=0,i=0;e<r;e++)i+=t[e][n][1];if(i)for(e=0;e<r;e++)t[e][n][1]/=i;else for(e=0;e<r;e++)t[e][n][1]=a}for(n=0;n<o;++n)s[n]=0;return s},zero:ce});d3.layout.histogram=function(){function t(t,r){for(var a,s,l=[],u=t.map(n,this),c=i.call(this,u,r),d=o.call(this,c,u,r),h=(r=-1,u.length),f=d.length-1,p=e?1:1/h;++r<f;)(a=l[r]=[]).dx=d[r+1]-(a.x=d[r]),a.y=0;if(f>0)for(r=-1;++r<h;)(s=u[r])>=c[0]&&s<=c[1]&&((a=l[d3.bisect(d,s,1,f)-1]).y+=p,a.push(t[r]));return l}var e=!0,n=Number,i=me,o=pe;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(i=r(e),t):i},t.bins=function(e){return arguments.length?(o="number"==typeof e?function(t){return ge(t,e)}:r(e),t):o},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},d3.layout.hierarchy=function(){function t(e,a,s){var l=r.call(n,e,a),u=Li?e:{data:e};if(u.depth=a,s.push(u),l&&(c=l.length)){for(var c,d,h=-1,f=u.children=[],p=0,g=a+1;++h<c;)(d=t(l[h],g,s)).parent=u,f.push(d),p+=d.value;i&&f.sort(i),o&&(u.value=p)}else o&&(u.value=+o.call(n,e,a)||0);return u}function e(t,i){var r=t.children,a=0;if(r&&(s=r.length))for(var s,l=-1,u=i+1;++l<s;)a+=e(r[l],u);else o&&(a=+o.call(n,Li?t:t.data,i)||0);return o&&(t.value=a),a}function n(e){var n=[];return t(e,0,n),n}var i=xe,r=ye,o=be;return n.sort=function(t){return arguments.length?(i=t,n):i},n.children=function(t){return arguments.length?(r=t,n):r},n.value=function(t){return arguments.length?(o=t,n):o},n.revalue=function(t){return e(t,0),t},n};var Li=!1;d3.layout.pack=function(){function t(t,i){var r=e.call(this,t,i),o=r[0];o.x=0,o.y=0,Pe(o);var a=n[0],s=n[1];return je(o,a/2,s/2,1/Math.max(2*o.r/a,2*o.r/s)),r}var e=d3.layout.hierarchy().sort(Ce),n=[1,1];return t.size=function(e){return arguments.length?(n=e,t):n},ve(t,e)},d3.layout.cluster=function(){function t(t,r){var o,a=e.call(this,t,r),s=a[0],l=0;Fe(s,(function(t){var e=t.children;e&&e.length?(t.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(e),t.y=function(t){return 1+d3.max(t,(function(t){return t.y}))}(e)):(t.x=o?l+=n(t,o):0,t.y=0,o=t)}));var u=Ae(s),c=ke(s),d=u.x-n(u,c)/2,h=c.x+n(c,u)/2;return Fe(s,(function(t){t.x=(t.x-d)/(h-d)*i[0],t.y=(1-(s.y?t.y/s.y:1))*i[1]})),a}var e=d3.layout.hierarchy().sort(null).value(null),n=Ie,i=[1,1];return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=e,t):i},ve(t,e)},d3.layout.tree=function(){function t(t,r){function o(t,e,i){if(e){for(var r,o=t,a=t,s=e,l=t.parent.children[0],u=o._tree.mod,c=a._tree.mod,d=s._tree.mod,h=l._tree.mod;s=Oe(s),o=Le(o),s&&o;)l=Le(l),(a=Oe(a))._tree.ancestor=t,(r=s._tree.prelim+d-o._tree.prelim-u+n(s,o))>0&&(Ve(Be(s,t,i),t,r),u+=r,c+=r),d+=s._tree.mod,u+=o._tree.mod,h+=l._tree.mod,c+=a._tree.mod;s&&!Oe(a)&&(a._tree.thread=s,a._tree.mod+=d-c),o&&!Le(l)&&(l._tree.thread=o,l._tree.mod+=u-h,i=t)}return i}var a=e.call(this,t,r),s=a[0];Fe(s,(function(t,e){t._tree={ancestor:t,prelim:0,mod:0,change:0,shift:0,number:e?e._tree.number+1:0}})),function t(e,i){var r=e.children,a=e._tree;if(r&&(s=r.length)){for(var s,l,u,c=r[0],d=c,h=-1;++h<s;)t(u=r[h],l),d=o(u,l,d),l=u;!function(t){for(var e,n=0,i=0,r=t.children,o=r.length;--o>=0;)(e=r[o]._tree).prelim+=n,e.mod+=n,n+=e.shift+(i+=e.change)}(e);var f=.5*(c._tree.prelim+u._tree.prelim);i?(a.prelim=i._tree.prelim+n(e,i),a.mod=a.prelim-f):a.prelim=f}else i&&(a.prelim=i._tree.prelim+n(e,i))}(s),function t(e,n){e.x=e._tree.prelim+n;var i=e.children;if(i&&(r=i.length)){var r,o=-1;for(n+=e._tree.mod;++o<r;)t(i[o],n)}}(s,-s._tree.prelim);var l=Ne(s,Re),u=Ne(s,ze),c=Ne(s,He),d=l.x-n(l,u)/2,h=u.x+n(u,l)/2,f=c.depth||1;return Fe(s,(function(t){t.x=(t.x-d)/(h-d)*i[0],t.y=t.depth/f*i[1],delete t._tree})),a}var e=d3.layout.hierarchy().sort(null).value(null),n=Ie,i=[1,1];return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=e,t):i},ve(t,e)},d3.layout.treemap=function(){function t(t,e){for(var n,i,r=-1,o=t.length;++r<o;)i=(n=t[r]).value*(e<0?0:e),n.area=isNaN(i)||i<=0?0:i}function e(n){var o=n.children;if(o&&o.length){var a,s,l,u=d(n),c=[],h=o.slice(),f=1/0,p=Math.min(u.dx,u.dy);for(t(h,u.dx*u.dy/n.value),c.area=0;(l=h.length)>0;)c.push(a=h[l-1]),c.area+=a.area,(s=i(c,p))<=f?(h.pop(),f=s):(c.area-=c.pop().area,r(c,p,u,!1),p=Math.min(u.dx,u.dy),c.length=c.area=0,f=1/0);c.length&&(r(c,p,u,!0),c.length=c.area=0),o.forEach(e)}}function n(e){var i=e.children;if(i&&i.length){var o,a=d(e),s=i.slice(),l=[];for(t(s,a.dx*a.dy/e.value),l.area=0;o=s.pop();)l.push(o),l.area+=o.area,null!=o.z&&(r(l,o.z?a.dx:a.dy,a,!s.length),l.length=l.area=0);i.forEach(n)}}function i(t,e){for(var n,i=t.area,r=0,o=1/0,a=-1,s=t.length;++a<s;)(n=t[a].area)&&(n<o&&(o=n),n>r&&(r=n));return e*=e,(i*=i)?Math.max(e*r*f/i,i/(e*o*f)):1/0}function r(t,e,n,i){var r,o=-1,a=t.length,s=n.x,u=n.y,c=e?l(t.area/e):0;if(e==n.dx){for((i||c>n.dy)&&(c=n.dy);++o<a;)(r=t[o]).x=s,r.y=u,r.dy=c,s+=r.dx=Math.min(n.x+n.dx-s,c?l(r.area/c):0);r.z=!0,r.dx+=n.x+n.dx-s,n.y+=c,n.dy-=c}else{for((i||c>n.dx)&&(c=n.dx);++o<a;)(r=t[o]).x=s,r.y=u,r.dx=c,u+=r.dy=Math.min(n.y+n.dy-u,c?l(r.area/c):0);r.z=!1,r.dy+=n.y+n.dy-u,n.x+=c,n.dx-=c}}function o(i){var r=a||s(i),o=r[0];return o.x=0,o.y=0,o.dx=u[0],o.dy=u[1],a&&s.revalue(o),t([o],o.dx*o.dy/o.value),(a?n:e)(o),h&&(a=r),r}var a,s=d3.layout.hierarchy(),l=Math.round,u=[1,1],c=null,d=We,h=!1,f=.5*(1+Math.sqrt(5));return o.size=function(t){return arguments.length?(u=t,o):u},o.padding=function(t){function e(e){return $e(e,t)}return arguments.length?(d=null==(c=t)?We:"function"==(n=typeof t)?function(e){var n=t.call(o,e,e.depth);return null==n?We(e):$e(e,"number"==typeof n?[n,n,n,n]:n)}:"number"===n?(t=[t,t,t,t],e):e,o):c;var n},o.round=function(t){return arguments.length?(l=t?Math.round:Number,o):l!=Number},o.sticky=function(t){return arguments.length?(h=t,a=null,o):h},o.ratio=function(t){return arguments.length?(f=t,o):f},ve(o,s)},d3.csv=function(t,e){d3.text(t,"text/csv",(function(t){e(t&&d3.csv.parse(t))}))},d3.csv.parse=function(t){var e;return d3.csv.parseRows(t,(function(t,n){if(n){for(var i={},r=-1,o=e.length;++r<o;)i[e[r]]=t[r];return i}return e=t,null}))},d3.csv.parseRows=function(t,e){function n(){if(l.lastIndex>=t.length)return a;if(r)return r=!1,o;var e=l.lastIndex;if(34===t.charCodeAt(e)){for(var n=e;n++<t.length;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;n++}l.lastIndex=n+2;var i=t.charCodeAt(n+1);return 13===i?(r=!0,10===t.charCodeAt(n+2)&&l.lastIndex++):10===i&&(r=!0),t.substring(e+1,n).replace(/""/g,'"')}var s=l.exec(t);return s?(r=44!==s[0].charCodeAt(0),t.substring(e,s.index)):(l.lastIndex=t.length,t.substring(e))}var i,r,o={},a={},s=[],l=/\r\n|[,\r\n]/g,u=0;for(l.lastIndex=0;(i=n())!==a;){for(var c=[];i!==o&&i!==a;)c.push(i),i=n();e&&!(c=e(c,u++))||s.push(c)}return s},d3.csv.format=function(t){return t.map(Ue).join("\n")},d3.geo={};var Oi=Math.PI/180;d3.geo.azimuthal=function(){function t(t){var e,i=t[0]*Oi-n,u=t[1]*Oi,c=Math.cos(i),d=Math.sin(i),h=Math.cos(u),f=Math.sin(u),p="orthographic"!==a?o*f+r*h*c:null,g="stereographic"===a?1/(1+p):"gnomonic"===a?1/p:"equidistant"===a?(e=Math.acos(p))?e/Math.sin(e):0:"equalarea"===a?Math.sqrt(2/(1+p)):1,m=g*(o*h*c-r*f);return[s*(g*h*d)+l[0],s*m+l[1]]}var e,n,i,r,o,a="orthographic",s=200,l=[480,250];return t.invert=function(t){var e=(t[0]-l[0])/s,i=(t[1]-l[1])/s,u=Math.sqrt(e*e+i*i),c="stereographic"===a?2*Math.atan(u):"gnomonic"===a?Math.atan(u):"equidistant"===a?u:"equalarea"===a?2*Math.asin(.5*u):Math.asin(u),d=Math.sin(c),h=Math.cos(c);return[(n+Math.atan2(e*d,u*r*h+i*o*d))/Oi,Math.asin(h*o-(u?i*d*r/u:0))/Oi]},t.mode=function(e){return arguments.length?(a=e+"",t):a},t.origin=function(a){return arguments.length?(n=(e=a)[0]*Oi,i=e[1]*Oi,r=Math.cos(i),o=Math.sin(i),t):e},t.scale=function(e){return arguments.length?(s=+e,t):s},t.translate=function(e){return arguments.length?(l=[+e[0],+e[1]],t):l},t.origin([0,0])},d3.geo.albers=function(){function t(t){var e=i*(Oi*t[0]-n),a=Math.sqrt(r-2*i*Math.sin(Oi*t[1]))/i;return[l*a*Math.sin(e)+u[0],l*(a*Math.cos(e)-o)+u[1]]}function e(){var e=Oi*s[0],l=Oi*s[1],u=Oi*a[1],c=Math.sin(e),d=Math.cos(e);return n=Oi*a[0],i=.5*(c+Math.sin(l)),r=d*d+2*i*c,o=Math.sqrt(r-2*i*Math.sin(u))/i,t}var n,i,r,o,a=[-98,38],s=[29.5,45.5],l=1e3,u=[480,250];return t.invert=function(t){var e=(t[0]-u[0])/l,a=(t[1]-u[1])/l,s=o+a,c=Math.atan2(e,s),d=Math.sqrt(e*e+s*s);return[(n+c/i)/Oi,Math.asin((r-d*d*i*i)/(2*i))/Oi]},t.origin=function(t){return arguments.length?(a=[+t[0],+t[1]],e()):a},t.parallels=function(t){return arguments.length?(s=[+t[0],+t[1]],e()):s},t.scale=function(e){return arguments.length?(l=+e,t):l},t.translate=function(e){return arguments.length?(u=[+e[0],+e[1]],t):u},e()},d3.geo.albersUsa=function(){function t(t){var o=t[0],a=t[1];return(a>50?n:o<-140?i:a<21?r:e)(t)}var e=d3.geo.albers(),n=d3.geo.albers().origin([-160,60]).parallels([55,65]),i=d3.geo.albers().origin([-160,20]).parallels([8,18]),r=d3.geo.albers().origin([-60,10]).parallels([8,18]);return t.scale=function(o){return arguments.length?(e.scale(o),n.scale(.6*o),i.scale(o),r.scale(1.5*o),t.translate(e.translate())):e.scale()},t.translate=function(o){if(!arguments.length)return e.translate();var a=e.scale()/1e3,s=o[0],l=o[1];return e.translate(o),n.translate([s-400*a,l+170*a]),i.translate([s-190*a,l+200*a]),r.translate([s+580*a,l+430*a]),t},t.scale(e.scale())},d3.geo.bonne=function(){function t(t){var s=t[0]*Oi-e,l=t[1]*Oi-n;if(i){var u=r+i-l,c=s*Math.cos(l)/u;s=u*Math.sin(c),l=u*Math.cos(c)-r}else s*=Math.cos(l),l*=-1;return[o*s+a[0],o*l+a[1]]}var e,n,i,r,o=200,a=[480,250];return t.invert=function(t){var n=(t[0]-a[0])/o,s=(t[1]-a[1])/o;if(i){var l=r+s,u=Math.sqrt(n*n+l*l);s=r+i-u,n=e+u*Math.atan2(n,l)/Math.cos(s)}else s*=-1,n/=Math.cos(s);return[n/Oi,s/Oi]},t.parallel=function(e){return arguments.length?(r=1/Math.tan(i=e*Oi),t):i/Oi},t.origin=function(i){return arguments.length?(e=i[0]*Oi,n=i[1]*Oi,t):[e/Oi,n/Oi]},t.scale=function(e){return arguments.length?(o=+e,t):o},t.translate=function(e){return arguments.length?(a=[+e[0],+e[1]],t):a},t.origin([0,0]).parallel(45)},d3.geo.equirectangular=function(){function t(t){var i=t[0]/360,r=-t[1]/360;return[e*i+n[0],e*r+n[1]]}var e=500,n=[480,250];return t.invert=function(t){return[360*((t[0]-n[0])/e),-360*((t[1]-n[1])/e)]},t.scale=function(n){return arguments.length?(e=+n,t):e},t.translate=function(e){return arguments.length?(n=[+e[0],+e[1]],t):n},t},d3.geo.mercator=function(){function t(t){var i=t[0]/360,r=-Math.log(Math.tan(Math.PI/4+t[1]*Oi/2))/Oi/360;return[e*i+n[0],e*Math.max(-.5,Math.min(.5,r))+n[1]]}var e=500,n=[480,250];return t.invert=function(t){var i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return[360*i,2*Math.atan(Math.exp(-360*r*Oi))/Oi-90]},t.scale=function(n){return arguments.length?(e=+n,t):e},t.translate=function(e){return arguments.length?(n=[+e[0],+e[1]],t):n},t},d3.geo.path=function(){function t(t,e){"function"==typeof o&&(a=Ye(o.apply(this,arguments))),u(t);var n=l.length?l.join(""):null;return l=[],n}function e(t){return s(t).join(",")}function n(t){for(var e=r(t[0]),n=0,i=t.length;++n<i;)e-=r(t[n]);return e}function i(t){for(var e=d3.geom.polygon(t[0].map(s)),n=e.area(),i=e.centroid(n<0?(n*=-1,1):-1),r=i[0],o=i[1],a=n,l=0,u=t.length;++l<u;)n=(e=d3.geom.polygon(t[l].map(s))).area(),r-=(i=e.centroid(n<0?(n*=-1,1):-1))[0],o-=i[1],a-=n;return[r,o,6*a]}function r(t){return Math.abs(d3.geom.polygon(t.map(s)).area())}var o=4.5,a=Ye(o),s=d3.geo.albersUsa(),l=[],u=Ge({FeatureCollection:function(t){for(var e=t.features,n=-1,i=e.length;++n<i;)l.push(u(e[n].geometry))},Feature:function(t){u(t.geometry)},Point:function(t){l.push("M",e(t.coordinates),a)},MultiPoint:function(t){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)l.push("M",e(n[i]),a)},LineString:function(t){var n=t.coordinates,i=-1,r=n.length;for(l.push("M");++i<r;)l.push(e(n[i]),"L");l.pop()},MultiLineString:function(t){for(var n,i,r,o=t.coordinates,a=-1,s=o.length;++a<s;){for(i=-1,r=(n=o[a]).length,l.push("M");++i<r;)l.push(e(n[i]),"L");l.pop()}},Polygon:function(t){for(var n,i,r,o=t.coordinates,a=-1,s=o.length;++a<s;)if(i=-1,(r=(n=o[a]).length-1)>0){for(l.push("M");++i<r;)l.push(e(n[i]),"L");l[l.length-1]="Z"}},MultiPolygon:function(t){for(var n,i,r,o,a,s,u=t.coordinates,c=-1,d=u.length;++c<d;)for(i=-1,r=(n=u[c]).length;++i<r;)if(a=-1,(s=(o=n[i]).length-1)>0){for(l.push("M");++a<s;)l.push(e(o[a]),"L");l[l.length-1]="Z"}},GeometryCollection:function(t){for(var e=t.geometries,n=-1,i=e.length;++n<i;)l.push(u(e[n]))}}),c=t.area=Ge({FeatureCollection:function(t){for(var e=0,n=t.features,i=-1,r=n.length;++i<r;)e+=c(n[i]);return e},Feature:function(t){return c(t.geometry)},Polygon:function(t){return n(t.coordinates)},MultiPolygon:function(t){for(var e=0,i=t.coordinates,r=-1,o=i.length;++r<o;)e+=n(i[r]);return e},GeometryCollection:function(t){for(var e=0,n=t.geometries,i=-1,r=n.length;++i<r;)e+=c(n[i]);return e}},0),d=t.centroid=Ge({Feature:function(t){return d(t.geometry)},Polygon:function(t){var e=i(t.coordinates);return[e[0]/e[2],e[1]/e[2]]},MultiPolygon:function(t){for(var e,n=t.coordinates,r=0,o=0,a=0,s=-1,l=n.length;++s<l;)r+=(e=i(n[s]))[0],o+=e[1],a+=e[2];return[r/a,o/a]}});return t.projection=function(e){return s=e,t},t.pointRadius=function(e){return"function"==typeof e?o=e:a=Ye(o=+e),t},t},d3.geo.bounds=function(t){var e=1/0,n=1/0,i=-1/0,r=-1/0;return Xe(t,(function(t,o){t<e&&(e=t),t>i&&(i=t),o<n&&(n=o),o>r&&(r=o)})),[[e,n],[i,r]]};var Ni={Feature:function(t,e){Xe(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=0,r=n.length;i<r;i++)Xe(n[i].geometry,e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=0,r=n.length;i<r;i++)Xe(n[i],e)},LineString:Qe,MultiLineString:function(t,e){for(var n=t.coordinates,i=0,r=n.length;i<r;i++)for(var o=n[i],a=0,s=o.length;a<s;a++)e.apply(null,o[a])},MultiPoint:Qe,MultiPolygon:function(t,e){for(var n=t.coordinates,i=0,r=n.length;i<r;i++)for(var o=n[i][0],a=0,s=o.length;a<s;a++)e.apply(null,o[a])},Point:function(t,e){e.apply(null,t.coordinates)},Polygon:function(t,e){for(var n=t.coordinates[0],i=0,r=n.length;i<r;i++)e.apply(null,n[i])}};d3.geo.circle=function(){function t(){}function n(t){return s.distance(t)<a}function i(t){for(var e,n,i,r,o,l=-1,u=t.length,c=[];++l<u;)(o=s.distance(i=t[l]))<a?(n&&c.push(tn(n,i)((r-a)/(r-o))),c.push(i),e=n=null):(n=i,!e&&c.length&&(c.push(tn(c[c.length-1],n)((a-r)/(o-r))),e=n)),r=o;return e=t[0],(n=c[0])&&i[0]===e[0]&&i[1]===e[1]&&(i[0]!==n[0]||i[1]!==n[1])&&c.push(n),function(t){var e,n,i,r=0,o=t.length,a=o?[t[0]]:t,l=s.source();for(;++r<o;)for(e=0,n=(i=s.source(t[r-1])(t[r]).coordinates).length;++e<n;)a.push(i[e]);return s.source(l),a}(c)}var r=[0,0],o=89.99,a=o*Oi,s=d3.geo.greatArc().source(r).target(e);t.clip=function(t){return"function"==typeof r&&s.source(r.apply(this,arguments)),l(t)||null};var l=Ge({FeatureCollection:function(t){var n=t.features.map(l).filter(e);return n&&((t=Object.create(t)).features=n,t)},Feature:function(t){var e=l(t.geometry);return e&&((t=Object.create(t)).geometry=e,t)},Point:function(t){return n(t.coordinates)&&t},MultiPoint:function(t){var e=t.coordinates.filter(n);return e.length&&{type:t.type,coordinates:e}},LineString:function(t){var e=i(t.coordinates);return e.length&&((t=Object.create(t)).coordinates=e,t)},MultiLineString:function(t){var e=t.coordinates.map(i).filter((function(t){return t.length}));return e.length&&((t=Object.create(t)).coordinates=e,t)},Polygon:function(t){var e=t.coordinates.map(i);return e[0].length&&((t=Object.create(t)).coordinates=e,t)},MultiPolygon:function(t){var e=t.coordinates.map((function(t){return t.map(i)})).filter((function(t){return t[0].length}));return e.length&&((t=Object.create(t)).coordinates=e,t)},GeometryCollection:function(t){var n=t.geometries.map(l).filter(e);return n.length&&((t=Object.create(t)).geometries=n,t)}});return t.origin=function(e){return arguments.length?("function"!=typeof(r=e)&&s.source(r),t):r},t.angle=function(e){return arguments.length?(a=(o=+e)*Oi,t):o},d3.rebind(t,s,"precision")},d3.geo.greatArc=function(){function t(){for(var i=t.distance.apply(this,arguments),r=0,s=o/i,l=[e];(r+=s)<1;)l.push(a(r));return l.push(n),{type:"LineString",coordinates:l}}var e,n,i=Ke,r=Je,o=6*Oi,a=Ze();return t.distance=function(){return"function"==typeof i&&a.source(e=i.apply(this,arguments)),"function"==typeof r&&a.target(n=r.apply(this,arguments)),a.distance()},t.source=function(n){return arguments.length?("function"!=typeof(i=n)&&a.source(e=i),t):i},t.target=function(e){return arguments.length?("function"!=typeof(r=e)&&a.target(n=r),t):r},t.precision=function(e){return arguments.length?(o=e*Oi,t):o/Oi},t},d3.geo.greatCircle=d3.geo.circle,d3.geom={},d3.geom.contour=function(t,e){var n=e||function(t){for(var e=0,n=0;;){if(t(e,n))return[e,n];0===e?(e=n+1,n=0):(e-=1,n+=1)}}(t),i=[],r=n[0],o=n[1],a=0,s=0,l=NaN,u=NaN,c=0;do{c=0,t(r-1,o-1)&&(c+=1),t(r,o-1)&&(c+=2),t(r-1,o)&&(c+=4),t(r,o)&&(c+=8),6===c?(a=-1===u?-1:1,s=0):9===c?(a=0,s=1===l?-1:1):(a=zi[c],s=Ri[c]),a!=l&&s!=u&&(i.push([r,o]),l=a,u=s),r+=a,o+=s}while(n[0]!=r||n[1]!=o);return i};var zi=[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN],Ri=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN];d3.geom.hull=function(t){if(t.length<3)return[];var e,n,i,r,o,a,s,l,u,c,d=t.length,h=d-1,f=[],p=[],g=0;for(e=1;e<d;++e)t[e][1]<t[g][1]?g=e:t[e][1]==t[g][1]&&(g=t[e][0]<t[g][0]?e:g);for(e=0;e<d;++e)e!==g&&(r=t[e][1]-t[g][1],i=t[e][0]-t[g][0],f.push({angle:Math.atan2(r,i),index:e}));for(f.sort((function(t,e){return t.angle-e.angle})),u=f[0].angle,l=f[0].index,s=0,e=1;e<h;++e)n=f[e].index,u==f[e].angle?(i=t[l][0]-t[g][0])*i+(r=t[l][1]-t[g][1])*r>=(o=t[n][0]-t[g][0])*o+(a=t[n][1]-t[g][1])*a?f[e].index=-1:(f[s].index=-1,u=f[e].angle,s=e,l=n):(u=f[e].angle,s=e,l=n);for(p.push(g),e=0,n=0;e<2;++n)-1!==f[n].index&&(p.push(f[n].index),e++);for(c=p.length;n<h;++n)if(-1!==f[n].index){for(;!en(p[c-2],p[c-1],f[n].index,t);)--c;p[c++]=f[n].index}var m=[];for(e=0;e<c;++e)m.push(t[p[e]]);return m},d3.geom.polygon=function(t){return t.area=function(){for(var e=0,n=t.length,i=t[n-1][0]*t[0][1],r=t[n-1][1]*t[0][0];++e<n;)i+=t[e-1][0]*t[e][1],r+=t[e-1][1]*t[e][0];return.5*(r-i)},t.centroid=function(e){var n,i,r=-1,o=t.length,a=0,s=0,l=t[o-1];for(arguments.length||(e=-1/(6*t.area()));++r<o;)n=l,l=t[r],i=n[0]*l[1]-l[0]*n[1],a+=(n[0]+l[0])*i,s+=(n[1]+l[1])*i;return[a*e,s*e]},t.clip=function(e){for(var n,i,r,o,a,s,l=-1,u=t.length,c=t[u-1];++l<u;){for(n=e.slice(),e.length=0,o=t[l],a=n[(r=n.length)-1],i=-1;++i<r;)nn(s=n[i],c,o)?(nn(a,c,o)||e.push(rn(a,s,c,o)),e.push(s)):nn(a,c,o)&&e.push(rn(a,s,c,o)),a=s;c=o}return e},t},d3.geom.voronoi=function(t){var e=t.map((function(){return[]}));return on(t,(function(t){var n,i,r,o,a,s;1===t.a&&t.b>=0?(n=t.ep.r,i=t.ep.l):(n=t.ep.l,i=t.ep.r),1===t.a?(a=n?n.y:-1e6,r=t.c-t.b*a,s=i?i.y:1e6,o=t.c-t.b*s):(r=n?n.x:-1e6,a=t.c-t.a*r,o=i?i.x:1e6,s=t.c-t.a*o);var l=[r,a],u=[o,s];e[t.region.l.index].push(l,u),e[t.region.r.index].push(l,u)})),e.map((function(e,n){var i=t[n][0],r=t[n][1];return e.forEach((function(t){t.angle=Math.atan2(t[0]-i,t[1]-r)})),e.sort((function(t,e){return t.angle-e.angle})).filter((function(t,n){return!n||t.angle-e[n-1].angle>1e-10}))}))};var Hi={l:"r",r:"l"};d3.geom.delaunay=function(t){var e=t.map((function(){return[]})),n=[];return on(t,(function(n){e[n.region.l.index].push(t[n.region.r.index])})),e.forEach((function(e,i){var r=t[i],o=r[0],a=r[1];e.forEach((function(t){t.angle=Math.atan2(t[0]-o,t[1]-a)})),e.sort((function(t,e){return t.angle-e.angle}));for(var s=0,l=e.length-1;s<l;s++)n.push([r,e[s],e[s+1]])})),n},d3.geom.quadtree=function(t,e,n,i,r){function o(t,e,n,i,r,o){if(!isNaN(e.x)&&!isNaN(e.y))if(t.leaf){var s=t.point;s?(Math.abs(s.x-e.x)+Math.abs(s.y-e.y)<.01||(t.point=null,a(t,s,n,i,r,o)),a(t,e,n,i,r,o)):t.point=e}else a(t,e,n,i,r,o)}function a(t,e,n,i,r,a){var s=.5*(n+r),l=.5*(i+a),u=e.x>=s,c=e.y>=l,d=(c<<1)+u;t.leaf=!1,u?n=s:r=s,c?i=l:a=l,o(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null}),e,n,i,r,a)}var s,l=-1,u=t.length;if(u&&isNaN(t[0].x)&&(t=t.map(sn)),arguments.length<5)if(3===arguments.length)r=i=n,n=e;else{for(e=n=1/0,i=r=-1/0;++l<u;)(s=t[l]).x<e&&(e=s.x),s.y<n&&(n=s.y),s.x>i&&(i=s.x),s.y>r&&(r=s.y);var c=i-e,d=r-n;c>d?r=n+c:i=e+d}var h={leaf:!0,nodes:[],point:null,add:function(t){o(h,t,e,n,i,r)}};return h.visit=function(t){an(t,h,e,n,i,r)},t.forEach(h.add),h},d3.time={};var Fi=Date;ln.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Vi.setUTCDate.apply(this._,arguments)},setDay:function(){Vi.setUTCDay.apply(this._,arguments)},setFullYear:function(){Vi.setUTCFullYear.apply(this._,arguments)},setHours:function(){Vi.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Vi.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Vi.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Vi.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Vi.setUTCSeconds.apply(this._,arguments)},setTime:function(){Vi.setTime.apply(this._,arguments)}};var Vi=Date.prototype;d3.time.format=function(t){function e(e){for(var i,r,o=[],a=-1,s=0;++a<n;)37==t.charCodeAt(a)&&(o.push(t.substring(s,a),(r=qi[i=t.charAt(++a)])?r(e):i),s=a+1);return o.push(t.substring(s,a)),o.join("")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0};if(un(n,t,e,0)!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var i=new Fi;return i.setFullYear(n.y,n.m,n.d),i.setHours(n.H,n.M,n.S,n.L),i},e.toString=function(){return t},e};var Bi=d3.format("02d"),Wi=d3.format("03d"),$i=d3.format("04d"),Ui=d3.format("2d"),qi={a:function(t){return Qi[t.getDay()].substring(0,3)},A:function(t){return Qi[t.getDay()]},b:function(t){return tr[t.getMonth()].substring(0,3)},B:function(t){return tr[t.getMonth()]},c:d3.time.format("%a %b %e %H:%M:%S %Y"),d:function(t){return Bi(t.getDate())},e:function(t){return Ui(t.getDate())},H:function(t){return Bi(t.getHours())},I:function(t){return Bi(t.getHours()%12||12)},j:function(t){return Wi(1+d3.time.dayOfYear(t))},L:function(t){return Wi(t.getMilliseconds())},m:function(t){return Bi(t.getMonth()+1)},M:function(t){return Bi(t.getMinutes())},p:function(t){return t.getHours()>=12?"PM":"AM"},S:function(t){return Bi(t.getSeconds())},U:function(t){return Bi(d3.time.sundayOfYear(t))},w:function(t){return t.getDay()},W:function(t){return Bi(d3.time.mondayOfYear(t))},x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(t){return Bi(t.getFullYear()%100)},Y:function(t){return $i(t.getFullYear()%1e4)},Z:function(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",i=~~(Math.abs(e)/60),r=Math.abs(e)%60;return n+Bi(i)+Bi(r)},"%":function(t){return"%"}},Gi={a:function(t,e,n){return Yi.test(e.substring(n,n+=3))?n:-1},A:function(t,e,n){Xi.lastIndex=0;var i=Xi.exec(e.substring(n,n+10));return i?n+=i[0].length:-1},b:function(t,e,n){var i=Ki.get(e.substring(n,n+=3).toLowerCase());return null==i?-1:(t.m=i,n)},B:function(t,e,n){Ji.lastIndex=0;var i=Ji.exec(e.substring(n,n+12));return i?(t.m=Zi.get(i[0].toLowerCase()),n+=i[0].length):-1},c:function(t,e,n){return un(t,qi.c.toString(),e,n)},d:cn,e:cn,H:dn,I:dn,L:function(t,e,n){er.lastIndex=0;var i=er.exec(e.substring(n,n+3));return i?(t.L=+i[0],n+=i[0].length):-1},m:function(t,e,n){er.lastIndex=0;var i=er.exec(e.substring(n,n+2));return i?(t.m=i[0]-1,n+=i[0].length):-1},M:function(t,e,n){er.lastIndex=0;var i=er.exec(e.substring(n,n+2));return i?(t.M=+i[0],n+=i[0].length):-1},p:function(t,e,n){var i=nr.get(e.substring(n,n+=2).toLowerCase());return null==i?-1:(t.p=i,n)},S:function(t,e,n){er.lastIndex=0;var i=er.exec(e.substring(n,n+2));return i?(t.S=+i[0],n+=i[0].length):-1},x:function(t,e,n){return un(t,qi.x.toString(),e,n)},X:function(t,e,n){return un(t,qi.X.toString(),e,n)},y:function(t,e,n){er.lastIndex=0;var i=er.exec(e.substring(n,n+2));return i?(t.y=1e3*~~((new Date).getFullYear()/1e3)+ +i[0],n+=i[0].length):-1},Y:function(t,e,n){er.lastIndex=0;var i=er.exec(e.substring(n,n+4));return i?(t.y=+i[0],n+=i[0].length):-1}},Yi=/^(?:sun|mon|tue|wed|thu|fri|sat)/i,Xi=/^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/i,Qi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ki=d3.map({jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11}),Ji=/^(?:January|February|March|April|May|June|July|August|September|October|November|December)/gi,Zi=d3.map({january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11}),tr=["January","February","March","April","May","June","July","August","September","October","November","December"],er=/\s*\d+/,nr=d3.map({am:0,pm:1});d3.time.format.utc=function(t){function e(t){try{var e=new(Fi=ln);return e._=t,n(e)}finally{Fi=Date}}var n=d3.time.format(t);return e.parse=function(t){try{Fi=ln;var e=n.parse(t);return e&&e._}finally{Fi=Date}},e.toString=n.toString,e};var ir=d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");d3.time.format.iso=Date.prototype.toISOString?hn:ir,hn.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},hn.toString=ir.toString,d3.time.second=fn((function(t){return new Fi(1e3*Math.floor(t/1e3))}),(function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))}),(function(t){return t.getSeconds()})),d3.time.seconds=d3.time.second.range,d3.time.seconds.utc=d3.time.second.utc.range,d3.time.minute=fn((function(t){return new Fi(6e4*Math.floor(t/6e4))}),(function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))}),(function(t){return t.getMinutes()})),d3.time.minutes=d3.time.minute.range,d3.time.minutes.utc=d3.time.minute.utc.range,d3.time.hour=fn((function(t){var e=t.getTimezoneOffset()/60;return new Fi(36e5*(Math.floor(t/36e5-e)+e))}),(function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))}),(function(t){return t.getHours()})),d3.time.hours=d3.time.hour.range,d3.time.hours.utc=d3.time.hour.utc.range,d3.time.day=fn((function(t){return new Fi(t.getFullYear(),t.getMonth(),t.getDate())}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t){return t.getDate()-1})),d3.time.days=d3.time.day.range,d3.time.days.utc=d3.time.day.utc.range,d3.time.dayOfYear=function(t){var e=d3.time.year(t);return Math.floor((t-e)/864e5-(t.getTimezoneOffset()-e.getTimezoneOffset())/1440)},Qi.forEach((function(t,e){t=t.toLowerCase(),e=7-e;var n=d3.time[t]=fn((function(t){return(t=d3.time.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t}),(function(t,e){t.setDate(t.getDate()+7*Math.floor(e))}),(function(t){var n=d3.time.year(t).getDay();return Math.floor((d3.time.dayOfYear(t)+(n+e)%7)/7)-(n!==e)}));d3.time[t+"s"]=n.range,d3.time[t+"s"].utc=n.utc.range,d3.time[t+"OfYear"]=function(t){var n=d3.time.year(t).getDay();return Math.floor((d3.time.dayOfYear(t)+(n+e)%7)/7)}})),d3.time.week=d3.time.sunday,d3.time.weeks=d3.time.sunday.range,d3.time.weeks.utc=d3.time.sunday.utc.range,d3.time.weekOfYear=d3.time.sundayOfYear,d3.time.month=fn((function(t){return new Fi(t.getFullYear(),t.getMonth(),1)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t){return t.getMonth()})),d3.time.months=d3.time.month.range,d3.time.months.utc=d3.time.month.utc.range,d3.time.year=fn((function(t){return new Fi(t.getFullYear(),0,1)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t){return t.getFullYear()})),d3.time.years=d3.time.year.range,d3.time.years.utc=d3.time.year.utc.range;var rr=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],or=[[d3.time.second,1],[d3.time.second,5],[d3.time.second,15],[d3.time.second,30],[d3.time.minute,1],[d3.time.minute,5],[d3.time.minute,15],[d3.time.minute,30],[d3.time.hour,1],[d3.time.hour,3],[d3.time.hour,6],[d3.time.hour,12],[d3.time.day,1],[d3.time.day,2],[d3.time.week,1],[d3.time.month,1],[d3.time.month,3],[d3.time.year,1]],ar=[[d3.time.format("%Y"),function(t){return!0}],[d3.time.format("%B"),function(t){return t.getMonth()}],[d3.time.format("%b %d"),function(t){return 1!=t.getDate()}],[d3.time.format("%a %d"),function(t){return t.getDay()&&1!=t.getDate()}],[d3.time.format("%I %p"),function(t){return t.getHours()}],[d3.time.format("%I:%M"),function(t){return t.getMinutes()}],[d3.time.format(":%S"),function(t){return t.getSeconds()}],[d3.time.format(".%L"),function(t){return t.getMilliseconds()}]],sr=d3.scale.linear(),lr=yn(ar);or.year=function(t,e){return sr.domain(t.map(xn)).ticks(e).map(bn)},d3.time.scale=function(){return gn(d3.scale.linear(),or,lr)};var ur=or.map((function(t){return[t[0].utc,t[1]]})),cr=yn([[d3.time.format.utc("%Y"),function(t){return!0}],[d3.time.format.utc("%B"),function(t){return t.getUTCMonth()}],[d3.time.format.utc("%b %d"),function(t){return 1!=t.getUTCDate()}],[d3.time.format.utc("%a %d"),function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[d3.time.format.utc("%I %p"),function(t){return t.getUTCHours()}],[d3.time.format.utc("%I:%M"),function(t){return t.getUTCMinutes()}],[d3.time.format.utc(":%S"),function(t){return t.getUTCSeconds()}],[d3.time.format.utc(".%L"),function(t){return t.getUTCMilliseconds()}]]);ur.year=function(t,e){return sr.domain(t.map(Cn)).ticks(e).map(wn)},d3.time.scale.utc=function(){return gn(d3.scale.linear(),ur,cr)}}(),/*! jQuery v1.8.2 jquery.com | jquery.org/license */
2
+ function(t,e){function n(t,n,i){if(i===e&&1===t.nodeType){var r="data-"+n.replace(ut,"-$1").toLowerCase();if("string"==typeof(i=t.getAttribute(r))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:lt.test(i)?U.parseJSON(i):i)}catch(t){}U.data(t,n,i)}else i=e}return i}function i(t){var e;for(e in t)if(("data"!==e||!U.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function r(){return!1}function o(){return!0}function a(t){return!t||!t.parentNode||11===t.parentNode.nodeType}function s(t,e){do{t=t[e]}while(t&&1!==t.nodeType);return t}function l(t,e,n){if(e=e||0,U.isFunction(e))return U.grep(t,(function(t,i){return!!e.call(t,i,t)===n}));if(e.nodeType)return U.grep(t,(function(t,i){return t===e===n}));if("string"==typeof e){var i=U.grep(t,(function(t){return 1===t.nodeType}));if(jt.test(e))return U.filter(e,i,!n);e=U.filter(e,i)}return U.grep(t,(function(t,i){return U.inArray(t,e)>=0===n}))}function u(t){var e=kt.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function c(t,e){return t.getElementsByTagName(e)[0]||t.appendChild(t.ownerDocument.createElement(e))}function d(t,e){if(1===e.nodeType&&U.hasData(t)){var n,i,r,o=U._data(t),a=U._data(e,o),s=o.events;if(s)for(n in delete a.handle,a.events={},s)for(i=0,r=s[n].length;i<r;i++)U.event.add(e,n,s[n][i]);a.data&&(a.data=U.extend({},a.data))}}function h(t,e){var n;1===e.nodeType&&(e.clearAttributes&&e.clearAttributes(),e.mergeAttributes&&e.mergeAttributes(t),"object"===(n=e.nodeName.toLowerCase())?(e.parentNode&&(e.outerHTML=t.outerHTML),U.support.html5Clone&&t.innerHTML&&!U.trim(e.innerHTML)&&(e.innerHTML=t.innerHTML)):"input"===n&&Bt.test(t.type)?(e.defaultChecked=e.checked=t.checked,e.value!==t.value&&(e.value=t.value)):"option"===n?e.selected=t.defaultSelected:"input"===n||"textarea"===n?e.defaultValue=t.defaultValue:"script"===n&&e.text!==t.text&&(e.text=t.text),e.removeAttribute(U.expando))}function f(t){return void 0!==t.getElementsByTagName?t.getElementsByTagName("*"):void 0!==t.querySelectorAll?t.querySelectorAll("*"):[]}function p(t){Bt.test(t.type)&&(t.defaultChecked=t.checked)}function g(t,e){if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),i=e,r=ce.length;r--;)if((e=ce[r]+n)in t)return e;return i}function m(t,e){return t=e||t,"none"===U.css(t,"display")||!U.contains(t.ownerDocument,t)}function v(t,e){for(var n,i,r=[],o=0,a=t.length;o<a;o++)(n=t[o]).style&&(r[o]=U._data(n,"olddisplay"),e?(!r[o]&&"none"===n.style.display&&(n.style.display=""),""===n.style.display&&m(n)&&(r[o]=U._data(n,"olddisplay",w(n.nodeName)))):(i=Xt(n,"display"),!r[o]&&"none"!==i&&U._data(n,"olddisplay",i)));for(o=0;o<a;o++)(n=t[o]).style&&(e&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=e?r[o]||"":"none"));return t}function y(t,e,n){var i=ie.exec(e);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):e}function b(t,e,n,i){for(var r=n===(i?"border":"content")?4:"width"===e?1:0,o=0;r<4;r+=2)"margin"===n&&(o+=U.css(t,n+ue[r],!0)),i?("content"===n&&(o-=parseFloat(Xt(t,"padding"+ue[r]))||0),"margin"!==n&&(o-=parseFloat(Xt(t,"border"+ue[r]+"Width"))||0)):(o+=parseFloat(Xt(t,"padding"+ue[r]))||0,"padding"!==n&&(o+=parseFloat(Xt(t,"border"+ue[r]+"Width"))||0));return o}function x(t,e,n){var i="width"===e?t.offsetWidth:t.offsetHeight,r=!0,o=U.support.boxSizing&&"border-box"===U.css(t,"boxSizing");if(i<=0||null==i){if(((i=Xt(t,e))<0||null==i)&&(i=t.style[e]),re.test(i))return i;r=o&&(U.support.boxSizingReliable||i===t.style[e]),i=parseFloat(i)||0}return i+b(t,e,n||(o?"border":"content"),r)+"px"}function w(t){if(ae[t])return ae[t];var e=U("<"+t+">").appendTo(L.body),n=e.css("display");return e.remove(),"none"!==n&&""!==n||(Qt=L.body.appendChild(Qt||U.extend(L.createElement("iframe"),{frameBorder:0,width:0,height:0})),Kt&&Qt.createElement||((Kt=(Qt.contentWindow||Qt.contentDocument).document).write("<!doctype html><html><body>"),Kt.close()),e=Kt.body.appendChild(Kt.createElement(t)),n=Xt(e,"display"),L.body.removeChild(Qt)),ae[t]=n,n}function C(t,e,n,i){var r;if(U.isArray(e))U.each(e,(function(e,r){n||fe.test(t)?i(t,r):C(t+"["+("object"==typeof r?e:"")+"]",r,n,i)}));else if(n||"object"!==U.type(e))i(t,e);else for(r in e)C(t+"["+r+"]",e[r],n,i)}function _(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r,o=e.toLowerCase().split(Y),a=0,s=o.length;if(U.isFunction(n))for(;a<s;a++)i=o[a],(r=/^\+/.test(i))&&(i=i.substr(1)||"*"),(t[i]=t[i]||[])[r?"unshift":"push"](n)}}function E(t,n,i,r,o,a){(a=a||{})[o=o||n.dataTypes[0]]=!0;for(var s,l=t[o],u=0,c=l?l.length:0,d=t===Pe;u<c&&(d||!s);u++)"string"==typeof(s=l[u](n,i,r))&&(!d||a[s]?s=e:(n.dataTypes.unshift(s),s=E(t,n,i,r,s,a)));return(d||!s)&&!a["*"]&&(s=E(t,n,i,r,"*",a)),s}function M(t,n){var i,r,o=U.ajaxSettings.flatOptions||{};for(i in n)n[i]!==e&&((o[i]?t:r||(r={}))[i]=n[i]);r&&U.extend(!0,t,r)}function S(){try{return new t.XMLHttpRequest}catch(t){}}function D(){return setTimeout((function(){Re=e}),0),Re=U.now()}function P(t,e,n){var i,r=0,o=We.length,a=U.Deferred().always((function(){delete s.elem})),s=function(){for(var e=Re||D(),n=Math.max(0,l.startTime+l.duration-e),i=1-(n/l.duration||0),r=0,o=l.tweens.length;r<o;r++)l.tweens[r].run(i);return a.notifyWith(t,[l,i,n]),i<1&&o?n:(a.resolveWith(t,[l]),!1)},l=a.promise({elem:t,props:U.extend({},e),opts:U.extend(!0,{specialEasing:{}},n),originalProperties:e,originalOptions:n,startTime:Re||D(),duration:n.duration,tweens:[],createTween:function(e,n,i){var r=U.Tween(t,l.opts,e,n,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(r),r},stop:function(e){for(var n=0,i=e?l.tweens.length:0;n<i;n++)l.tweens[n].run(1);return e?a.resolveWith(t,[l,e]):a.rejectWith(t,[l,e]),this}}),u=l.props;for(!function(t,e){var n,i,r,o,a;for(n in t)if(r=e[i=U.camelCase(n)],o=t[n],U.isArray(o)&&(r=o[1],o=t[n]=o[0]),n!==i&&(t[i]=o,delete t[n]),(a=U.cssHooks[i])&&"expand"in a)for(n in o=a.expand(o),delete t[i],o)n in t||(t[n]=o[n],e[n]=r);else e[i]=r}(u,l.opts.specialEasing);r<o;r++)if(i=We[r].call(l,t,u,l.opts))return i;return function(t,e){U.each(e,(function(e,n){for(var i=($e[e]||[]).concat($e["*"]),r=0,o=i.length;r<o;r++)if(i[r].call(t,e,n))return}))}(l,u),U.isFunction(l.opts.start)&&l.opts.start.call(t,l),U.fx.timer(U.extend(s,{anim:l,queue:l.opts.queue,elem:t})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function j(t,e,n,i,r){return new j.prototype.init(t,e,n,i,r)}function T(t,e){var n,i={height:t},r=0;for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=ue[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function A(t){return U.isWindow(t)?t:9===t.nodeType&&(t.defaultView||t.parentWindow)}var k,I,L=t.document,O=t.location,N=t.navigator,z=t.jQuery,R=t.$,H=Array.prototype.push,F=Array.prototype.slice,V=Array.prototype.indexOf,B=Object.prototype.toString,W=Object.prototype.hasOwnProperty,$=String.prototype.trim,U=function(t,e){return new U.fn.init(t,e,k)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,G=/\S/,Y=/\s+/,X=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,Q=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,K=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,J=/^[\],:{}\s]*$/,Z=/(?:^|:|,)(?:\s*\[)+/g,tt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,et=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,nt=/^-ms-/,it=/-([\da-z])/gi,rt=function(t,e){return(e+"").toUpperCase()},ot=function(){L.addEventListener?(L.removeEventListener("DOMContentLoaded",ot,!1),U.ready()):"complete"===L.readyState&&(L.detachEvent("onreadystatechange",ot),U.ready())},at={};U.fn=U.prototype={constructor:U,init:function(t,n,i){var r,o,a;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if("string"==typeof t){if((r="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Q.exec(t))&&(r[1]||!n)){if(r[1])return a=(n=n instanceof U?n[0]:n)&&n.nodeType?n.ownerDocument||n:L,t=U.parseHTML(r[1],a,!0),K.test(r[1])&&U.isPlainObject(n)&&this.attr.call(t,n,!0),U.merge(this,t);if((o=L.getElementById(r[2]))&&o.parentNode){if(o.id!==r[2])return i.find(t);this.length=1,this[0]=o}return this.context=L,this.selector=t,this}return!n||n.jquery?(n||i).find(t):this.constructor(n).find(t)}return U.isFunction(t)?i.ready(t):(t.selector!==e&&(this.selector=t.selector,this.context=t.context),U.makeArray(t,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this)},get:function(t){return null==t?this.toArray():t<0?this[this.length+t]:this[t]},pushStack:function(t,e,n){var i=U.merge(this.constructor(),t);return i.prevObject=this,i.context=this.context,"find"===e?i.selector=this.selector+(this.selector?" ":"")+n:e&&(i.selector=this.selector+"."+e+"("+n+")"),i},each:function(t,e){return U.each(this,t,e)},ready:function(t){return U.ready.promise().done(t),this},eq:function(t){return-1===(t=+t)?this.slice(t):this.slice(t,t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(t){return this.pushStack(U.map(this,(function(e,n){return t.call(e,n,e)})))},end:function(){return this.prevObject||this.constructor(null)},push:H,sort:[].sort,splice:[].splice},U.fn.init.prototype=U.fn,U.extend=U.fn.extend=function(){var t,n,i,r,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"!=typeof s&&!U.isFunction(s)&&(s={}),u===l&&(s=this,--l);l<u;l++)if(null!=(t=arguments[l]))for(n in t)i=s[n],s!==(r=t[n])&&(c&&r&&(U.isPlainObject(r)||(o=U.isArray(r)))?(o?(o=!1,a=i&&U.isArray(i)?i:[]):a=i&&U.isPlainObject(i)?i:{},s[n]=U.extend(c,a,r)):r!==e&&(s[n]=r));return s},U.extend({noConflict:function(e){return t.$===U&&(t.$=R),e&&t.jQuery===U&&(t.jQuery=z),U},isReady:!1,readyWait:1,holdReady:function(t){t?U.readyWait++:U.ready(!0)},ready:function(t){if(!(!0===t?--U.readyWait:U.isReady)){if(!L.body)return setTimeout(U.ready,1);U.isReady=!0,!0!==t&&--U.readyWait>0||(I.resolveWith(L,[U]),U.fn.trigger&&U(L).trigger("ready").off("ready"))}},isFunction:function(t){return"function"===U.type(t)},isArray:Array.isArray||function(t){return"array"===U.type(t)},isWindow:function(t){return null!=t&&t==t.window},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},type:function(t){return null==t?String(t):at[B.call(t)]||"object"},isPlainObject:function(t){if(!t||"object"!==U.type(t)||t.nodeType||U.isWindow(t))return!1;try{if(t.constructor&&!W.call(t,"constructor")&&!W.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}var n;for(n in t);return n===e||W.call(t,n)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},error:function(t){throw new Error(t)},parseHTML:function(t,e,n){var i;return t&&"string"==typeof t?("boolean"==typeof e&&(n=e,e=0),e=e||L,(i=K.exec(t))?[e.createElement(i[1])]:(i=U.buildFragment([t],e,n?null:[]),U.merge([],(i.cacheable?U.clone(i.fragment):i.fragment).childNodes))):null},parseJSON:function(e){return e&&"string"==typeof e?(e=U.trim(e),t.JSON&&t.JSON.parse?t.JSON.parse(e):J.test(e.replace(tt,"@").replace(et,"]").replace(Z,""))?new Function("return "+e)():void U.error("Invalid JSON: "+e)):null},parseXML:function(n){var i;if(!n||"string"!=typeof n)return null;try{t.DOMParser?i=(new DOMParser).parseFromString(n,"text/xml"):((i=new ActiveXObject("Microsoft.XMLDOM")).async="false",i.loadXML(n))}catch(t){i=e}return(!i||!i.documentElement||i.getElementsByTagName("parsererror").length)&&U.error("Invalid XML: "+n),i},noop:function(){},globalEval:function(e){e&&G.test(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(t){return t.replace(nt,"ms-").replace(it,rt)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,n,i){var r,o=0,a=t.length,s=a===e||U.isFunction(t);if(i)if(s){for(r in t)if(!1===n.apply(t[r],i))break}else for(;o<a&&!1!==n.apply(t[o++],i););else if(s){for(r in t)if(!1===n.call(t[r],r,t[r]))break}else for(;o<a&&!1!==n.call(t[o],o,t[o++]););return t},trim:$&&!$.call("\ufeff ")?function(t){return null==t?"":$.call(t)}:function(t){return null==t?"":(t+"").replace(X,"")},makeArray:function(t,e){var n,i=e||[];return null!=t&&(n=U.type(t),null==t.length||"string"===n||"function"===n||"regexp"===n||U.isWindow(t)?H.call(i,t):U.merge(i,t)),i},inArray:function(t,e,n){var i;if(e){if(V)return V.call(e,t,n);for(i=e.length,n=n?n<0?Math.max(0,i+n):n:0;n<i;n++)if(n in e&&e[n]===t)return n}return-1},merge:function(t,n){var i=n.length,r=t.length,o=0;if("number"==typeof i)for(;o<i;o++)t[r++]=n[o];else for(;n[o]!==e;)t[r++]=n[o++];return t.length=r,t},grep:function(t,e,n){var i=[],r=0,o=t.length;for(n=!!n;r<o;r++)n!==!!e(t[r],r)&&i.push(t[r]);return i},map:function(t,n,i){var r,o,a=[],s=0,l=t.length;if(t instanceof U||l!==e&&"number"==typeof l&&(l>0&&t[0]&&t[l-1]||0===l||U.isArray(t)))for(;s<l;s++)null!=(r=n(t[s],s,i))&&(a[a.length]=r);else for(o in t)null!=(r=n(t[o],o,i))&&(a[a.length]=r);return a.concat.apply([],a)},guid:1,proxy:function(t,n){var i,r,o;return"string"==typeof n&&(i=t[n],n=t,t=i),U.isFunction(t)?(r=F.call(arguments,2),o=function(){return t.apply(n,r.concat(F.call(arguments)))},o.guid=t.guid=t.guid||U.guid++,o):e},access:function(t,n,i,r,o,a,s){var l,u=null==i,c=0,d=t.length;if(i&&"object"==typeof i){for(c in i)U.access(t,n,c,i[c],1,a,r);o=1}else if(r!==e){if(l=s===e&&U.isFunction(r),u&&(l?(l=n,n=function(t,e,n){return l.call(U(t),n)}):(n.call(t,r),n=null)),n)for(;c<d;c++)n(t[c],i,l?r.call(t[c],c,n(t[c],i)):r,s);o=1}return o?t:u?n.call(t):d?n(t[0],i):a},now:function(){return(new Date).getTime()}}),U.ready.promise=function(e){if(!I)if(I=U.Deferred(),"complete"===L.readyState)setTimeout(U.ready,1);else if(L.addEventListener)L.addEventListener("DOMContentLoaded",ot,!1),t.addEventListener("load",U.ready,!1);else{L.attachEvent("onreadystatechange",ot),t.attachEvent("onload",U.ready);var n=!1;try{n=null==t.frameElement&&L.documentElement}catch(t){}n&&n.doScroll&&function t(){if(!U.isReady){try{n.doScroll("left")}catch(e){return setTimeout(t,50)}U.ready()}}()}return I.promise(e)},U.each("Boolean Number String Function Array Date RegExp Object".split(" "),(function(t,e){at["[object "+e+"]"]=e.toLowerCase()})),k=U(L);var st={};U.Callbacks=function(t){t="string"==typeof t?st[t]||function(t){var e=st[t]={};return U.each(t.split(Y),(function(t,n){e[n]=!0})),e}(t):U.extend({},t);var n,i,r,o,a,s,l=[],u=!t.once&&[],c=function(e){for(n=t.memory&&e,i=!0,s=o||0,o=0,a=l.length,r=!0;l&&s<a;s++)if(!1===l[s].apply(e[0],e[1])&&t.stopOnFalse){n=!1;break}r=!1,l&&(u?u.length&&c(u.shift()):n?l=[]:d.disable())},d={add:function(){if(l){var e=l.length;(function e(n){U.each(n,(function(n,i){var r=U.type(i);"function"!==r||t.unique&&d.has(i)?i&&i.length&&"string"!==r&&e(i):l.push(i)}))})(arguments),r?a=l.length:n&&(o=e,c(n))}return this},remove:function(){return l&&U.each(arguments,(function(t,e){for(var n;(n=U.inArray(e,l,n))>-1;)l.splice(n,1),r&&(n<=a&&a--,n<=s&&s--)})),this},has:function(t){return U.inArray(t,l)>-1},empty:function(){return l=[],this},disable:function(){return l=u=n=e,this},disabled:function(){return!l},lock:function(){return u=e,n||d.disable(),this},locked:function(){return!u},fireWith:function(t,e){return e=[t,(e=e||[]).slice?e.slice():e],l&&(!i||u)&&(r?u.push(e):c(e)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!i}};return d},U.extend({Deferred:function(t){var e=[["resolve","done",U.Callbacks("once memory"),"resolved"],["reject","fail",U.Callbacks("once memory"),"rejected"],["notify","progress",U.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var t=arguments;return U.Deferred((function(n){U.each(e,(function(e,i){var o=i[0],a=t[e];r[i[1]](U.isFunction(a)?function(){var t=a.apply(this,arguments);t&&U.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===r?n:this,[t])}:n[o])})),t=null})).promise()},promise:function(t){return null!=t?U.extend(t,i):i}},r={};return i.pipe=i.then,U.each(e,(function(t,o){var a=o[2],s=o[3];i[o[1]]=a.add,s&&a.add((function(){n=s}),e[1^t][2].disable,e[2][2].lock),r[o[0]]=a.fire,r[o[0]+"With"]=a.fireWith})),i.promise(r),t&&t.call(r,r),r},when:function(t){var e,n,i,r=0,o=F.call(arguments),a=o.length,s=1!==a||t&&U.isFunction(t.promise)?a:0,l=1===s?t:U.Deferred(),u=function(t,n,i){return function(r){n[t]=this,i[t]=arguments.length>1?F.call(arguments):r,i===e?l.notifyWith(n,i):--s||l.resolveWith(n,i)}};if(a>1)for(e=new Array(a),n=new Array(a),i=new Array(a);r<a;r++)o[r]&&U.isFunction(o[r].promise)?o[r].promise().done(u(r,i,o)).fail(l.reject).progress(u(r,n,e)):--s;return s||l.resolveWith(i,o),l.promise()}}),U.support=function(){var e,n,i,r,o,a,s,l,u,c,d,h=L.createElement("div");if(h.setAttribute("className","t"),h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=h.getElementsByTagName("*"),(i=h.getElementsByTagName("a")[0]).style.cssText="top:1px;float:left;opacity:.5",!n||!n.length)return{};o=(r=L.createElement("select")).appendChild(L.createElement("option")),a=h.getElementsByTagName("input")[0],e={leadingWhitespace:3===h.firstChild.nodeType,tbody:!h.getElementsByTagName("tbody").length,htmlSerialize:!!h.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.5/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:"on"===a.value,optSelected:o.selected,getSetAttribute:"t"!==h.className,enctype:!!L.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==L.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===L.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,e.noCloneChecked=a.cloneNode(!0).checked,r.disabled=!0,e.optDisabled=!o.disabled;try{delete h.test}catch(t){e.deleteExpando=!1}if(!h.addEventListener&&h.attachEvent&&h.fireEvent&&(h.attachEvent("onclick",d=function(){e.noCloneEvent=!1}),h.cloneNode(!0).fireEvent("onclick"),h.detachEvent("onclick",d)),(a=L.createElement("input")).value="t",a.setAttribute("type","radio"),e.radioValue="t"===a.value,a.setAttribute("checked","checked"),a.setAttribute("name","t"),h.appendChild(a),(s=L.createDocumentFragment()).appendChild(h.lastChild),e.checkClone=s.cloneNode(!0).cloneNode(!0).lastChild.checked,e.appendChecked=a.checked,s.removeChild(a),s.appendChild(h),h.attachEvent)for(u in{submit:!0,change:!0,focusin:!0})(c=(l="on"+u)in h)||(h.setAttribute(l,"return;"),c="function"==typeof h[l]),e[u+"Bubbles"]=c;return U((function(){var n,i,r,o,a="padding:0;margin:0;border:0;display:block;overflow:hidden;",s=L.getElementsByTagName("body")[0];s&&((n=L.createElement("div")).style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",s.insertBefore(n,s.firstChild),i=L.createElement("div"),n.appendChild(i),i.innerHTML="<table><tr><td></td><td>t</td></tr></table>",(r=i.getElementsByTagName("td"))[0].style.cssText="padding:0;margin:0;border:0;display:none",c=0===r[0].offsetHeight,r[0].style.display="",r[1].style.display="none",e.reliableHiddenOffsets=c&&0===r[0].offsetHeight,i.innerHTML="",i.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",e.boxSizing=4===i.offsetWidth,e.doesNotIncludeMarginInBodyOffset=1!==s.offsetTop,t.getComputedStyle&&(e.pixelPosition="1%"!==(t.getComputedStyle(i,null)||{}).top,e.boxSizingReliable="4px"===(t.getComputedStyle(i,null)||{width:"4px"}).width,(o=L.createElement("div")).style.cssText=i.style.cssText=a,o.style.marginRight=o.style.width="0",i.style.width="1px",i.appendChild(o),e.reliableMarginRight=!parseFloat((t.getComputedStyle(o,null)||{}).marginRight)),void 0!==i.style.zoom&&(i.innerHTML="",i.style.cssText=a+"width:1px;padding:1px;display:inline;zoom:1",e.inlineBlockNeedsLayout=3===i.offsetWidth,i.style.display="block",i.style.overflow="visible",i.innerHTML="<div></div>",i.firstChild.style.width="5px",e.shrinkWrapBlocks=3!==i.offsetWidth,n.style.zoom=1),s.removeChild(n),n=i=r=o=null)})),s.removeChild(h),n=i=r=o=a=s=h=null,e}();var lt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,ut=/([A-Z])/g;U.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(U.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(t){return!!(t=t.nodeType?U.cache[t[U.expando]]:t[U.expando])&&!i(t)},data:function(t,n,i,r){if(U.acceptData(t)){var o,a,s=U.expando,l="string"==typeof n,u=t.nodeType,c=u?U.cache:t,d=u?t[s]:t[s]&&s;if(d&&c[d]&&(r||c[d].data)||!l||i!==e)return d||(u?t[s]=d=U.deletedIds.pop()||U.guid++:d=s),c[d]||(c[d]={},u||(c[d].toJSON=U.noop)),"object"!=typeof n&&"function"!=typeof n||(r?c[d]=U.extend(c[d],n):c[d].data=U.extend(c[d].data,n)),o=c[d],r||(o.data||(o.data={}),o=o.data),i!==e&&(o[U.camelCase(n)]=i),l?null==(a=o[n])&&(a=o[U.camelCase(n)]):a=o,a}},removeData:function(t,e,n){if(U.acceptData(t)){var r,o,a,s=t.nodeType,l=s?U.cache:t,u=s?t[U.expando]:U.expando;if(l[u]){if(e&&(r=n?l[u]:l[u].data)){U.isArray(e)||(e in r?e=[e]:e=(e=U.camelCase(e))in r?[e]:e.split(" "));for(o=0,a=e.length;o<a;o++)delete r[e[o]];if(!(n?i:U.isEmptyObject)(r))return}(n||(delete l[u].data,i(l[u])))&&(s?U.cleanData([t],!0):U.support.deleteExpando||l!=l.window?delete l[u]:l[u]=null)}}},_data:function(t,e,n){return U.data(t,e,n,!0)},acceptData:function(t){var e=t.nodeName&&U.noData[t.nodeName.toLowerCase()];return!e||!0!==e&&t.getAttribute("classid")===e}}),U.fn.extend({data:function(t,i){var r,o,a,s,l,u=this[0],c=0,d=null;if(t===e){if(this.length&&(d=U.data(u),1===u.nodeType&&!U._data(u,"parsedAttrs"))){for(l=(a=u.attributes).length;c<l;c++)(s=a[c].name).indexOf("data-")||(s=U.camelCase(s.substring(5)),n(u,s,d[s]));U._data(u,"parsedAttrs",!0)}return d}return"object"==typeof t?this.each((function(){U.data(this,t)})):((r=t.split(".",2))[1]=r[1]?"."+r[1]:"",o=r[1]+"!",U.access(this,(function(i){if(i===e)return(d=this.triggerHandler("getData"+o,[r[0]]))===e&&u&&(d=U.data(u,t),d=n(u,t,d)),d===e&&r[1]?this.data(r[0]):d;r[1]=i,this.each((function(){var e=U(this);e.triggerHandler("setData"+o,r),U.data(this,t,i),e.triggerHandler("changeData"+o,r)}))}),null,i,arguments.length>1,null,!1))},removeData:function(t){return this.each((function(){U.removeData(this,t)}))}}),U.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=U._data(t,e),n&&(!i||U.isArray(n)?i=U._data(t,e,U.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=U.queue(t,e),i=n.length,r=n.shift(),o=U._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,(function(){U.dequeue(t,e)}),o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return U._data(t,n)||U._data(t,n,{empty:U.Callbacks("once memory").add((function(){U.removeData(t,e+"queue",!0),U.removeData(t,n,!0)}))})}}),U.fn.extend({queue:function(t,n){var i=2;return"string"!=typeof t&&(n=t,t="fx",i--),arguments.length<i?U.queue(this[0],t):n===e?this:this.each((function(){var e=U.queue(this,t,n);U._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&U.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){U.dequeue(this,t)}))},delay:function(t,e){return t=U.fx&&U.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,n){var i=setTimeout(e,t);n.stop=function(){clearTimeout(i)}}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,n){var i,r=1,o=U.Deferred(),a=this,s=this.length,l=function(){--r||o.resolveWith(a,[a])};for("string"!=typeof t&&(n=t,t=e),t=t||"fx";s--;)(i=U._data(a[s],t+"queueHooks"))&&i.empty&&(r++,i.empty.add(l));return l(),o.promise(n)}});var ct,dt,ht,ft=/[\t\r\n]/g,pt=/\r/g,gt=/^(?:button|input)$/i,mt=/^(?:button|input|object|select|textarea)$/i,vt=/^a(?:rea|)$/i,yt=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,bt=U.support.getSetAttribute;U.fn.extend({attr:function(t,e){return U.access(this,U.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){U.removeAttr(this,t)}))},prop:function(t,e){return U.access(this,U.prop,t,e,arguments.length>1)},removeProp:function(t){return t=U.propFix[t]||t,this.each((function(){try{this[t]=e,delete this[t]}catch(t){}}))},addClass:function(t){var e,n,i,r,o,a,s;if(U.isFunction(t))return this.each((function(e){U(this).addClass(t.call(this,e,this.className))}));if(t&&"string"==typeof t)for(e=t.split(Y),n=0,i=this.length;n<i;n++)if(1===(r=this[n]).nodeType)if(r.className||1!==e.length){for(o=" "+r.className+" ",a=0,s=e.length;a<s;a++)o.indexOf(" "+e[a]+" ")<0&&(o+=e[a]+" ");r.className=U.trim(o)}else r.className=t;return this},removeClass:function(t){var n,i,r,o,a,s,l;if(U.isFunction(t))return this.each((function(e){U(this).removeClass(t.call(this,e,this.className))}));if(t&&"string"==typeof t||t===e)for(n=(t||"").split(Y),s=0,l=this.length;s<l;s++)if(1===(r=this[s]).nodeType&&r.className){for(i=(" "+r.className+" ").replace(ft," "),o=0,a=n.length;o<a;o++)for(;i.indexOf(" "+n[o]+" ")>=0;)i=i.replace(" "+n[o]+" "," ");r.className=t?U.trim(i):""}return this},toggleClass:function(t,e){var n=typeof t,i="boolean"==typeof e;return U.isFunction(t)?this.each((function(n){U(this).toggleClass(t.call(this,n,this.className,e),e)})):this.each((function(){if("string"===n)for(var r,o=0,a=U(this),s=e,l=t.split(Y);r=l[o++];)s=i?s:!a.hasClass(r),a[s?"addClass":"removeClass"](r);else"undefined"!==n&&"boolean"!==n||(this.className&&U._data(this,"__className__",this.className),this.className=this.className||!1===t?"":U._data(this,"__className__")||"")}))},hasClass:function(t){for(var e=" "+t+" ",n=0,i=this.length;n<i;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(ft," ").indexOf(e)>=0)return!0;return!1},val:function(t){var n,i,r,o=this[0];return arguments.length?(r=U.isFunction(t),this.each((function(i){var o,a=U(this);1===this.nodeType&&(null==(o=r?t.call(this,i,a.val()):t)?o="":"number"==typeof o?o+="":U.isArray(o)&&(o=U.map(o,(function(t){return null==t?"":t+""}))),(n=U.valHooks[this.type]||U.valHooks[this.nodeName.toLowerCase()])&&"set"in n&&n.set(this,o,"value")!==e||(this.value=o))}))):o?(n=U.valHooks[o.type]||U.valHooks[o.nodeName.toLowerCase()])&&"get"in n&&(i=n.get(o,"value"))!==e?i:"string"==typeof(i=o.value)?i.replace(pt,""):null==i?"":i:void 0}}),U.extend({valHooks:{option:{get:function(t){var e=t.attributes.value;return!e||e.specified?t.value:t.text}},select:{get:function(t){var e,n,i,r,o=t.selectedIndex,a=[],s=t.options,l="select-one"===t.type;if(o<0)return null;for(n=l?o:0,i=l?o+1:s.length;n<i;n++)if((r=s[n]).selected&&(U.support.optDisabled?!r.disabled:null===r.getAttribute("disabled"))&&(!r.parentNode.disabled||!U.nodeName(r.parentNode,"optgroup"))){if(e=U(r).val(),l)return e;a.push(e)}return l&&!a.length&&s.length?U(s[o]).val():a},set:function(t,e){var n=U.makeArray(e);return U(t).find("option").each((function(){this.selected=U.inArray(U(this).val(),n)>=0})),n.length||(t.selectedIndex=-1),n}}},attrFn:{},attr:function(t,n,i,r){var o,a,s,l=t.nodeType;if(t&&3!==l&&8!==l&&2!==l)return r&&U.isFunction(U.fn[n])?U(t)[n](i):void 0===t.getAttribute?U.prop(t,n,i):((s=1!==l||!U.isXMLDoc(t))&&(n=n.toLowerCase(),a=U.attrHooks[n]||(yt.test(n)?dt:ct)),i!==e?null===i?void U.removeAttr(t,n):a&&"set"in a&&s&&(o=a.set(t,i,n))!==e?o:(t.setAttribute(n,i+""),i):a&&"get"in a&&s&&null!==(o=a.get(t,n))?o:null===(o=t.getAttribute(n))?e:o)},removeAttr:function(t,e){var n,i,r,o,a=0;if(e&&1===t.nodeType)for(i=e.split(Y);a<i.length;a++)(r=i[a])&&(n=U.propFix[r]||r,(o=yt.test(r))||U.attr(t,r,""),t.removeAttribute(bt?r:n),o&&n in t&&(t[n]=!1))},attrHooks:{type:{set:function(t,e){if(gt.test(t.nodeName)&&t.parentNode)U.error("type property can't be changed");else if(!U.support.radioValue&&"radio"===e&&U.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}},value:{get:function(t,e){return ct&&U.nodeName(t,"button")?ct.get(t,e):e in t?t.value:null},set:function(t,e,n){if(ct&&U.nodeName(t,"button"))return ct.set(t,e,n);t.value=e}}},propFix:{tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(t,n,i){var r,o,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a)return(1!==a||!U.isXMLDoc(t))&&(n=U.propFix[n]||n,o=U.propHooks[n]),i!==e?o&&"set"in o&&(r=o.set(t,i,n))!==e?r:t[n]=i:o&&"get"in o&&null!==(r=o.get(t,n))?r:t[n]},propHooks:{tabIndex:{get:function(t){var n=t.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):mt.test(t.nodeName)||vt.test(t.nodeName)&&t.href?0:e}}}}),dt={get:function(t,n){var i,r=U.prop(t,n);return!0===r||"boolean"!=typeof r&&(i=t.getAttributeNode(n))&&!1!==i.nodeValue?n.toLowerCase():e},set:function(t,e,n){var i;return!1===e?U.removeAttr(t,n):((i=U.propFix[n]||n)in t&&(t[i]=!0),t.setAttribute(n,n.toLowerCase())),n}},bt||(ht={name:!0,id:!0,coords:!0},ct=U.valHooks.button={get:function(t,n){var i;return(i=t.getAttributeNode(n))&&(ht[n]?""!==i.value:i.specified)?i.value:e},set:function(t,e,n){var i=t.getAttributeNode(n);return i||(i=L.createAttribute(n),t.setAttributeNode(i)),i.value=e+""}},U.each(["width","height"],(function(t,e){U.attrHooks[e]=U.extend(U.attrHooks[e],{set:function(t,n){if(""===n)return t.setAttribute(e,"auto"),n}})})),U.attrHooks.contenteditable={get:ct.get,set:function(t,e,n){""===e&&(e="false"),ct.set(t,e,n)}}),U.support.hrefNormalized||U.each(["href","src","width","height"],(function(t,n){U.attrHooks[n]=U.extend(U.attrHooks[n],{get:function(t){var i=t.getAttribute(n,2);return null===i?e:i}})})),U.support.style||(U.attrHooks.style={get:function(t){return t.style.cssText.toLowerCase()||e},set:function(t,e){return t.style.cssText=e+""}}),U.support.optSelected||(U.propHooks.selected=U.extend(U.propHooks.selected,{get:function(t){var e=t.parentNode;return e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex),null}})),U.support.enctype||(U.propFix.enctype="encoding"),U.support.checkOn||U.each(["radio","checkbox"],(function(){U.valHooks[this]={get:function(t){return null===t.getAttribute("value")?"on":t.value}}})),U.each(["radio","checkbox"],(function(){U.valHooks[this]=U.extend(U.valHooks[this],{set:function(t,e){if(U.isArray(e))return t.checked=U.inArray(U(t).val(),e)>=0}})}));var xt=/^(?:textarea|input|select)$/i,wt=/^([^\.]*|)(?:\.(.+)|)$/,Ct=/(?:^|\s)hover(\.\S+|)\b/,_t=/^key/,Et=/^(?:mouse|contextmenu)|click/,Mt=/^(?:focusinfocus|focusoutblur)$/,St=function(t){return U.event.special.hover?t:t.replace(Ct,"mouseenter$1 mouseleave$1")};U.event={add:function(t,n,i,r,o){var a,s,l,u,c,d,h,f,p,g,m;if(3!==t.nodeType&&8!==t.nodeType&&n&&i&&(a=U._data(t))){for(i.handler&&(i=(p=i).handler,o=p.selector),i.guid||(i.guid=U.guid++),(l=a.events)||(a.events=l={}),(s=a.handle)||(a.handle=s=function(t){return void 0===U||t&&U.event.triggered===t.type?e:U.event.dispatch.apply(s.elem,arguments)},s.elem=t),n=U.trim(St(n)).split(" "),u=0;u<n.length;u++)d=(c=wt.exec(n[u])||[])[1],h=(c[2]||"").split(".").sort(),m=U.event.special[d]||{},d=(o?m.delegateType:m.bindType)||d,m=U.event.special[d]||{},f=U.extend({type:d,origType:c[1],data:r,handler:i,guid:i.guid,selector:o,needsContext:o&&U.expr.match.needsContext.test(o),namespace:h.join(".")},p),(g=l[d])||((g=l[d]=[]).delegateCount=0,m.setup&&!1!==m.setup.call(t,r,h,s)||(t.addEventListener?t.addEventListener(d,s,!1):t.attachEvent&&t.attachEvent("on"+d,s))),m.add&&(m.add.call(t,f),f.handler.guid||(f.handler.guid=i.guid)),o?g.splice(g.delegateCount++,0,f):g.push(f),U.event.global[d]=!0;t=null}},global:{},remove:function(t,e,n,i,r){var o,a,s,l,u,c,d,h,f,p,g,m=U.hasData(t)&&U._data(t);if(m&&(h=m.events)){for(e=U.trim(St(e||"")).split(" "),o=0;o<e.length;o++)if(s=l=(a=wt.exec(e[o])||[])[1],u=a[2],s){for(f=U.event.special[s]||{},c=(p=h[s=(i?f.delegateType:f.bindType)||s]||[]).length,u=u?new RegExp("(^|\\.)"+u.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,d=0;d<p.length;d++)g=p[d],(r||l===g.origType)&&(!n||n.guid===g.guid)&&(!u||u.test(g.namespace))&&(!i||i===g.selector||"**"===i&&g.selector)&&(p.splice(d--,1),g.selector&&p.delegateCount--,f.remove&&f.remove.call(t,g));0===p.length&&c!==p.length&&((!f.teardown||!1===f.teardown.call(t,u,m.handle))&&U.removeEvent(t,s,m.handle),delete h[s])}else for(s in h)U.event.remove(t,s+e[o],n,i,!0);U.isEmptyObject(h)&&(delete m.handle,U.removeData(t,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,i,r,o){if(!r||3!==r.nodeType&&8!==r.nodeType){var a,s,l,u,c,d,h,f,p,g,m=n.type||n,v=[];if(Mt.test(m+U.event.triggered))return;if(m.indexOf("!")>=0&&(m=m.slice(0,-1),s=!0),m.indexOf(".")>=0&&(v=m.split("."),m=v.shift(),v.sort()),(!r||U.event.customEvent[m])&&!U.event.global[m])return;if((n="object"==typeof n?n[U.expando]?n:new U.Event(m,n):new U.Event(m)).type=m,n.isTrigger=!0,n.exclusive=s,n.namespace=v.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,d=m.indexOf(":")<0?"on"+m:"",!r){for(l in a=U.cache)a[l].events&&a[l].events[m]&&U.event.trigger(n,i,a[l].handle.elem,!0);return}if(n.result=e,n.target||(n.target=r),(i=null!=i?U.makeArray(i):[]).unshift(n),(h=U.event.special[m]||{}).trigger&&!1===h.trigger.apply(r,i))return;if(p=[[r,h.bindType||m]],!o&&!h.noBubble&&!U.isWindow(r)){for(g=h.delegateType||m,u=Mt.test(g+m)?r:r.parentNode,c=r;u;u=u.parentNode)p.push([u,g]),c=u;c===(r.ownerDocument||L)&&p.push([c.defaultView||c.parentWindow||t,g])}for(l=0;l<p.length&&!n.isPropagationStopped();l++)u=p[l][0],n.type=p[l][1],(f=(U._data(u,"events")||{})[n.type]&&U._data(u,"handle"))&&f.apply(u,i),(f=d&&u[d])&&U.acceptData(u)&&f.apply&&!1===f.apply(u,i)&&n.preventDefault();return n.type=m,!o&&!n.isDefaultPrevented()&&(!h._default||!1===h._default.apply(r.ownerDocument,i))&&("click"!==m||!U.nodeName(r,"a"))&&U.acceptData(r)&&d&&r[m]&&("focus"!==m&&"blur"!==m||0!==n.target.offsetWidth)&&!U.isWindow(r)&&((c=r[d])&&(r[d]=null),U.event.triggered=m,r[m](),U.event.triggered=e,c&&(r[d]=c)),n.result}},dispatch:function(n){n=U.event.fix(n||t.event);var i,r,o,a,s,l,u,c,d,h=(U._data(this,"events")||{})[n.type]||[],f=h.delegateCount,p=F.call(arguments),g=!n.exclusive&&!n.namespace,m=U.event.special[n.type]||{},v=[];if(p[0]=n,n.delegateTarget=this,!m.preDispatch||!1!==m.preDispatch.call(this,n)){if(f&&(!n.button||"click"!==n.type))for(o=n.target;o!=this;o=o.parentNode||this)if(!0!==o.disabled||"click"!==n.type){for(s={},u=[],i=0;i<f;i++)s[d=(c=h[i]).selector]===e&&(s[d]=c.needsContext?U(d,this).index(o)>=0:U.find(d,this,null,[o]).length),s[d]&&u.push(c);u.length&&v.push({elem:o,matches:u})}for(h.length>f&&v.push({elem:this,matches:h.slice(f)}),i=0;i<v.length&&!n.isPropagationStopped();i++)for(l=v[i],n.currentTarget=l.elem,r=0;r<l.matches.length&&!n.isImmediatePropagationStopped();r++)c=l.matches[r],(g||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))&&(n.data=c.data,n.handleObj=c,(a=((U.event.special[c.origType]||{}).handle||c.handler).apply(l.elem,p))!==e&&(n.result=a,!1===a&&(n.preventDefault(),n.stopPropagation())));return m.postDispatch&&m.postDispatch.call(this,n),n.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,n){var i,r,o,a=n.button,s=n.fromElement;return null==t.pageX&&null!=n.clientX&&(r=(i=t.target.ownerDocument||L).documentElement,o=i.body,t.pageX=n.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),t.pageY=n.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),!t.relatedTarget&&s&&(t.relatedTarget=s===t.target?n.toElement:s),!t.which&&a!==e&&(t.which=1&a?1:2&a?3:4&a?2:0),t}},fix:function(t){if(t[U.expando])return t;var e,n,i=t,r=U.event.fixHooks[t.type]||{},o=r.props?this.props.concat(r.props):this.props;for(t=U.Event(i),e=o.length;e;)t[n=o[--e]]=i[n];return t.target||(t.target=i.srcElement||L),3===t.target.nodeType&&(t.target=t.target.parentNode),t.metaKey=!!t.metaKey,r.filter?r.filter(t,i):t},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(t,e,n){U.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(t,e){this.onbeforeunload===e&&(this.onbeforeunload=null)}}},simulate:function(t,e,n,i){var r=U.extend(new U.Event,n,{type:t,isSimulated:!0,originalEvent:{}});i?U.event.trigger(r,null,e):U.event.dispatch.call(e,r),r.isDefaultPrevented()&&n.preventDefault()}},U.event.handle=U.event.dispatch,U.removeEvent=L.removeEventListener?function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1)}:function(t,e,n){var i="on"+e;t.detachEvent&&(void 0===t[i]&&(t[i]=null),t.detachEvent(i,n))},U.Event=function(t,e){if(!(this instanceof U.Event))return new U.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||!1===t.returnValue||t.getPreventDefault&&t.getPreventDefault()?o:r):this.type=t,e&&U.extend(this,e),this.timeStamp=t&&t.timeStamp||U.now(),this[U.expando]=!0},U.Event.prototype={preventDefault:function(){this.isDefaultPrevented=o;var t=this.originalEvent;t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=o;var t=this.originalEvent;t&&(t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=o,this.stopPropagation()},isDefaultPrevented:r,isPropagationStopped:r,isImmediatePropagationStopped:r},U.each({mouseenter:"mouseover",mouseleave:"mouseout"},(function(t,e){U.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=t.relatedTarget,r=t.handleObj;r.selector;return i&&(i===this||U.contains(this,i))||(t.type=r.origType,n=r.handler.apply(this,arguments),t.type=e),n}}})),U.support.submitBubbles||(U.event.special.submit={setup:function(){if(U.nodeName(this,"form"))return!1;U.event.add(this,"click._submit keypress._submit",(function(t){var n=t.target,i=U.nodeName(n,"input")||U.nodeName(n,"button")?n.form:e;i&&!U._data(i,"_submit_attached")&&(U.event.add(i,"submit._submit",(function(t){t._submit_bubble=!0})),U._data(i,"_submit_attached",!0))}))},postDispatch:function(t){t._submit_bubble&&(delete t._submit_bubble,this.parentNode&&!t.isTrigger&&U.event.simulate("submit",this.parentNode,t,!0))},teardown:function(){if(U.nodeName(this,"form"))return!1;U.event.remove(this,"._submit")}}),U.support.changeBubbles||(U.event.special.change={setup:function(){if(xt.test(this.nodeName))return"checkbox"!==this.type&&"radio"!==this.type||(U.event.add(this,"propertychange._change",(function(t){"checked"===t.originalEvent.propertyName&&(this._just_changed=!0)})),U.event.add(this,"click._change",(function(t){this._just_changed&&!t.isTrigger&&(this._just_changed=!1),U.event.simulate("change",this,t,!0)}))),!1;U.event.add(this,"beforeactivate._change",(function(t){var e=t.target;xt.test(e.nodeName)&&!U._data(e,"_change_attached")&&(U.event.add(e,"change._change",(function(t){this.parentNode&&!t.isSimulated&&!t.isTrigger&&U.event.simulate("change",this.parentNode,t,!0)})),U._data(e,"_change_attached",!0))}))},handle:function(t){var e=t.target;if(this!==e||t.isSimulated||t.isTrigger||"radio"!==e.type&&"checkbox"!==e.type)return t.handleObj.handler.apply(this,arguments)},teardown:function(){return U.event.remove(this,"._change"),!xt.test(this.nodeName)}}),U.support.focusinBubbles||U.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=0,i=function(t){U.event.simulate(e,t.target,U.event.fix(t),!0)};U.event.special[e]={setup:function(){0==n++&&L.addEventListener(t,i,!0)},teardown:function(){0==--n&&L.removeEventListener(t,i,!0)}}})),U.fn.extend({on:function(t,n,i,o,a){var s,l;if("object"==typeof t){for(l in"string"!=typeof n&&(i=i||n,n=e),t)this.on(l,n,i,t[l],a);return this}if(null==i&&null==o?(o=n,i=n=e):null==o&&("string"==typeof n?(o=i,i=e):(o=i,i=n,n=e)),!1===o)o=r;else if(!o)return this;return 1===a&&(s=o,o=function(t){return U().off(t),s.apply(this,arguments)},o.guid=s.guid||(s.guid=U.guid++)),this.each((function(){U.event.add(this,t,o,i,n)}))},one:function(t,e,n,i){return this.on(t,e,n,i,1)},off:function(t,n,i){var o,a;if(t&&t.preventDefault&&t.handleObj)return o=t.handleObj,U(t.delegateTarget).off(o.namespace?o.origType+"."+o.namespace:o.origType,o.selector,o.handler),this;if("object"==typeof t){for(a in t)this.off(a,n,t[a]);return this}return!1!==n&&"function"!=typeof n||(i=n,n=e),!1===i&&(i=r),this.each((function(){U.event.remove(this,t,i,n)}))},bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},live:function(t,e,n){return U(this.context).on(t,this.selector,e,n),this},die:function(t,e){return U(this.context).off(t,this.selector||"**",e),this},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},trigger:function(t,e){return this.each((function(){U.event.trigger(t,e,this)}))},triggerHandler:function(t,e){if(this[0])return U.event.trigger(t,e,this[0],!0)},toggle:function(t){var e=arguments,n=t.guid||U.guid++,i=0,r=function(n){var r=(U._data(this,"lastToggle"+t.guid)||0)%i;return U._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),e[r].apply(this,arguments)||!1};for(r.guid=n;i<e.length;)e[i++].guid=n;return this.click(r)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),U.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(t,e){U.fn[e]=function(t,n){return null==n&&(n=t,t=null),arguments.length>0?this.on(e,null,t,n):this.trigger(e)},_t.test(e)&&(U.event.fixHooks[e]=U.event.keyHooks),Et.test(e)&&(U.event.fixHooks[e]=U.event.mouseHooks)})),function(t){function e(t,e,n,i){n=n||[];var r,o,a,s,l=(e=e||j).nodeType;if(!t||"string"!=typeof t)return n;if(1!==l&&9!==l)return[];if(!(a=b(e))&&!i&&(r=Z.exec(t)))if(s=r[1]){if(9===l){if(!(o=e.getElementById(s))||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(e.ownerDocument&&(o=e.ownerDocument.getElementById(s))&&x(e,o)&&o.id===s)return n.push(o),n}else{if(r[2])return L.apply(n,O.call(e.getElementsByTagName(t),0)),n;if((s=r[3])&&ut&&e.getElementsByClassName)return L.apply(n,O.call(e.getElementsByClassName(s),0)),n}return f(t.replace(X,"$1"),e,n,i,a)}function n(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function i(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function r(t){return z((function(e){return e=+e,z((function(n,i){for(var r,o=t([],n.length,e),a=o.length;a--;)n[r=o[a]]&&(n[r]=!(i[r]=n[r]))}))}))}function o(t,e,n){if(t===e)return n;for(var i=t.nextSibling;i;){if(i===e)return-1;i=i.nextSibling}return 1}function a(t,n){var i,r,o,a,s,l,u,c=F[D][t];if(c)return n?0:c.slice(0);for(s=t,l=[],u=v.preFilter;s;){for(a in i&&!(r=Q.exec(s))||(r&&(s=s.slice(r[0].length)),l.push(o=[])),i=!1,(r=K.exec(s))&&(o.push(i=new P(r.shift())),s=s.slice(i.length),i.type=r[0].replace(X," ")),v.filter)(r=rt[a].exec(s))&&(!u[a]||(r=u[a](r,j,!0)))&&(o.push(i=new P(r.shift())),s=s.slice(i.length),i.type=a,i.matches=r);if(!i)break}return n?s.length:s?e.error(t):F(t,l).slice(0)}function s(t,e,n){var i=e.dir,r=n&&"parentNode"===e.dir,o=k++;return e.first?function(e,n,o){for(;e=e[i];)if(r||1===e.nodeType)return t(e,n,o)}:function(e,n,a){if(a){for(;e=e[i];)if((r||1===e.nodeType)&&t(e,n,a))return e}else for(var s,l=A+" "+o+" ",u=l+g;e=e[i];)if(r||1===e.nodeType){if((s=e[D])===u)return e.sizset;if("string"==typeof s&&0===s.indexOf(l)){if(e.sizset)return e}else{if(e[D]=u,t(e,n,a))return e.sizset=!0,e;e.sizset=!1}}}}function l(t){return t.length>1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function u(t,e,n,i,r){for(var o,a=[],s=0,l=t.length,u=null!=e;s<l;s++)(o=t[s])&&(n&&!n(o,i,r)||(a.push(o),u&&e.push(s)));return a}function c(t,n,i,r,o,a){return r&&!r[D]&&(r=c(r)),o&&!o[D]&&(o=c(o,a)),z((function(a,s,l,c){if(!a||!o){var d,h,f,p=[],g=[],m=s.length,v=a||function(t,n,i,r){for(var o=0,a=n.length;o<a;o++)e(t,n[o],i,r);return i}(n||"*",l.nodeType?[l]:l,[],a),y=!t||!a&&n?v:u(v,p,t,l,c),b=i?o||(a?t:m||r)?[]:s:y;if(i&&i(y,b,l,c),r)for(f=u(b,g),r(f,[],l,c),d=f.length;d--;)(h=f[d])&&(b[g[d]]=!(y[g[d]]=h));if(a)for(d=t&&b.length;d--;)(h=b[d])&&(a[p[d]]=!(s[p[d]]=h));else b=u(b===s?b.splice(m,b.length):b),o?o(null,s,b,c):L.apply(s,b)}}))}function d(t){for(var e,n,i,r=t.length,o=v.relative[t[0].type],a=o||v.relative[" "],u=o?1:0,h=s((function(t){return t===e}),a,!0),f=s((function(t){return N.call(e,t)>-1}),a,!0),p=[function(t,n,i){return!o&&(i||n!==E)||((e=n).nodeType?h(t,n,i):f(t,n,i))}];u<r;u++)if(n=v.relative[t[u].type])p=[s(l(p),n)];else{if((n=v.filter[t[u].type].apply(null,t[u].matches))[D]){for(i=++u;i<r&&!v.relative[t[i].type];i++);return c(u>1&&l(p),u>1&&t.slice(0,u-1).join("").replace(X,"$1"),n,u<i&&d(t.slice(u,i)),i<r&&d(t=t.slice(i)),i<r&&t.join(""))}p.push(n)}return l(p)}function h(t,n){var i=n.length>0,r=t.length>0,o=function(a,s,l,c,d){var h,f,p,m=[],y=0,b="0",x=a&&[],w=null!=d,C=E,_=a||r&&v.find.TAG("*",d&&s.parentNode||s),M=A+=null==C?1:Math.E;for(w&&(E=s!==j&&s,g=o.el);null!=(h=_[b]);b++){if(r&&h){for(f=0;p=t[f];f++)if(p(h,s,l)){c.push(h);break}w&&(A=M,g=++o.el)}i&&((h=!p&&h)&&y--,a&&x.push(h))}if(y+=b,i&&b!==y){for(f=0;p=n[f];f++)p(x,m,s,l);if(a){if(y>0)for(;b--;)!x[b]&&!m[b]&&(m[b]=I.call(c));m=u(m)}L.apply(c,m),w&&!a&&m.length>0&&y+n.length>1&&e.uniqueSort(c)}return w&&(A=M,E=C),x};return o.el=0,i?z(o):o}function f(t,e,n,i,r){var o,s,l,u,c,d=a(t);d.length;if(!i&&1===d.length){if((s=d[0]=d[0].slice(0)).length>2&&"ID"===(l=s[0]).type&&9===e.nodeType&&!r&&v.relative[s[1].type]){if(!(e=v.find.ID(l.matches[0].replace(it,""),e,r)[0]))return n;t=t.slice(s.shift().length)}for(o=rt.POS.test(t)?-1:s.length-1;o>=0&&(l=s[o],!v.relative[u=l.type]);o--)if((c=v.find[u])&&(i=c(l.matches[0].replace(it,""),tt.test(s[0].type)&&e.parentNode||e,r))){if(s.splice(o,1),!(t=i.length&&s.join("")))return L.apply(n,O.call(i,0)),n;break}}return w(t,d)(i,e,r,n,tt.test(t)),n}function p(){}var g,m,v,y,b,x,w,C,_,E,M,S="undefined",D=("sizcache"+Math.random()).replace(".",""),P=String,j=t.document,T=j.documentElement,A=0,k=0,I=[].pop,L=[].push,O=[].slice,N=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},z=function(t,e){return t[D]=null==e||e,t},R=function(){var t={},e=[];return z((function(n,i){return e.push(n)>v.cacheLength&&delete t[e.shift()],t[n]=i}),t)},H=R(),F=R(),V=R(),B="[\\x20\\t\\r\\n\\f]",W="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",$=W.replace("w","w#"),q="\\["+B+"*("+W+")"+B+"*(?:([*^$|!~]?=)"+B+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+$+")|)|)"+B+"*\\]",G=":("+W+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+q+")|[^:]|\\\\.)*|.*))\\)|)",Y=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)",X=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),Q=new RegExp("^"+B+"*,"+B+"*"),K=new RegExp("^"+B+"*([\\x20\\t\\r\\n\\f>+~])"+B+"*"),J=new RegExp(G),Z=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,tt=/[\x20\t\r\n\f]*[+~]/,et=/h\d/i,nt=/input|select|textarea|button/i,it=/\\(?!\\)/g,rt={ID:new RegExp("^#("+W+")"),CLASS:new RegExp("^\\.("+W+")"),NAME:new RegExp("^\\[name=['\"]?("+W+")['\"]?\\]"),TAG:new RegExp("^("+W.replace("w","w*")+")"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+G),POS:new RegExp(Y,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),needsContext:new RegExp("^"+B+"*[>+~]|"+Y,"i")},ot=function(t){var e=j.createElement("div");try{return t(e)}catch(t){return!1}finally{e=null}},at=ot((function(t){return t.appendChild(j.createComment("")),!t.getElementsByTagName("*").length})),st=ot((function(t){return t.innerHTML="<a href='#'></a>",t.firstChild&&typeof t.firstChild.getAttribute!==S&&"#"===t.firstChild.getAttribute("href")})),lt=ot((function(t){t.innerHTML="<select></select>";var e=typeof t.lastChild.getAttribute("multiple");return"boolean"!==e&&"string"!==e})),ut=ot((function(t){return t.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!(!t.getElementsByClassName||!t.getElementsByClassName("e").length)&&(t.lastChild.className="e",2===t.getElementsByClassName("e").length)})),ct=ot((function(t){t.id=D+0,t.innerHTML="<a name='"+D+"'></a><div name='"+D+"'></div>",T.insertBefore(t,T.firstChild);var e=j.getElementsByName&&j.getElementsByName(D).length===2+j.getElementsByName(D+0).length;return m=!j.getElementById(D),T.removeChild(t),e}));try{O.call(T.childNodes,0)[0].nodeType}catch(t){O=function(t){for(var e,n=[];e=this[t];t++)n.push(e);return n}}e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){return e(n,null,null,[t]).length>0},y=e.getText=function(t){var e,n="",i=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=y(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[i];i++)n+=y(e);return n},b=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},x=e.contains=T.contains?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!!(i&&1===i.nodeType&&n.contains&&n.contains(i))}:T.compareDocumentPosition?function(t,e){return e&&!!(16&t.compareDocumentPosition(e))}:function(t,e){for(;e=e.parentNode;)if(e===t)return!0;return!1},e.attr=function(t,e){var n,i=b(t);return i||(e=e.toLowerCase()),(n=v.attrHandle[e])?n(t):i||lt?t.getAttribute(e):(n=t.getAttributeNode(e))?"boolean"==typeof t[e]?t[e]?e:null:n.specified?n.value:null:null},v=e.selectors={cacheLength:50,createPseudo:z,match:rt,attrHandle:st?{}:{href:function(t){return t.getAttribute("href",2)},type:function(t){return t.getAttribute("type")}},find:{ID:m?function(t,e,n){if(typeof e.getElementById!==S&&!n){var i=e.getElementById(t);return i&&i.parentNode?[i]:[]}}:function(t,e,n){if(typeof e.getElementById!==S&&!n){var i=e.getElementById(t);return i?i.id===t||typeof i.getAttributeNode!==S&&i.getAttributeNode("id").value===t?[i]:undefined:[]}},TAG:at?function(t,e){if(typeof e.getElementsByTagName!==S)return e.getElementsByTagName(t)}:function(t,e){var n=e.getElementsByTagName(t);if("*"===t){for(var i,r=[],o=0;i=n[o];o++)1===i.nodeType&&r.push(i);return r}return n},NAME:ct&&function(t,e){if(typeof e.getElementsByName!==S)return e.getElementsByName(name)},CLASS:ut&&function(t,e,n){if(typeof e.getElementsByClassName!==S&&!n)return e.getElementsByClassName(t)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(it,""),t[3]=(t[4]||t[5]||"").replace(it,""),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1]?(t[2]||e.error(t[0]),t[3]=+(t[3]?t[4]+(t[5]||1):2*("even"===t[2]||"odd"===t[2])),t[4]=+(t[6]+t[7]||"odd"===t[2])):t[2]&&e.error(t[0]),t},PSEUDO:function(t){var e,n;return rt.CHILD.test(t[0])?null:(t[3]?t[2]=t[3]:(e=t[4])&&(J.test(e)&&(n=a(e,!0))&&(n=e.indexOf(")",e.length-n)-e.length)&&(e=e.slice(0,n),t[0]=t[0].slice(0,n)),t[2]=e),t.slice(0,3))}},filter:{ID:m?function(t){return t=t.replace(it,""),function(e){return e.getAttribute("id")===t}}:function(t){return t=t.replace(it,""),function(e){var n=typeof e.getAttributeNode!==S&&e.getAttributeNode("id");return n&&n.value===t}},TAG:function(t){return"*"===t?function(){return!0}:(t=t.replace(it,"").toLowerCase(),function(e){return e.nodeName&&e.nodeName.toLowerCase()===t})},CLASS:function(t){var e=H[D][t];return e||(e=H(t,new RegExp("(^|"+B+")"+t+"("+B+"|$)"))),function(t){return e.test(t.className||typeof t.getAttribute!==S&&t.getAttribute("class")||"")}},ATTR:function(t,n,i){return function(r,o){var a=e.attr(r,t);return null==a?"!="===n:!n||(a+="","="===n?a===i:"!="===n?a!==i:"^="===n?i&&0===a.indexOf(i):"*="===n?i&&a.indexOf(i)>-1:"$="===n?i&&a.substr(a.length-i.length)===i:"~="===n?(" "+a+" ").indexOf(i)>-1:"|="===n&&(a===i||a.substr(0,i.length+1)===i+"-"))}},CHILD:function(t,e,n,i){return"nth"===t?function(t){var e,r,o=t.parentNode;if(1===n&&0===i)return!0;if(o)for(r=0,e=o.firstChild;e&&(1!==e.nodeType||(r++,t!==e));e=e.nextSibling);return(r-=i)===n||r%n==0&&r/n>=0}:function(e){var n=e;switch(t){case"only":case"first":for(;n=n.previousSibling;)if(1===n.nodeType)return!1;if("first"===t)return!0;n=e;case"last":for(;n=n.nextSibling;)if(1===n.nodeType)return!1;return!0}}},PSEUDO:function(t,n){var i,r=v.pseudos[t]||v.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return r[D]?r(n):r.length>1?(i=[t,t,"",n],v.setFilters.hasOwnProperty(t.toLowerCase())?z((function(t,e){for(var i,o=r(t,n),a=o.length;a--;)t[i=N.call(t,o[a])]=!(e[i]=o[a])})):function(t){return r(t,0,i)}):r}},pseudos:{not:z((function(t){var e=[],n=[],i=w(t.replace(X,"$1"));return i[D]?z((function(t,e,n,r){for(var o,a=i(t,null,r,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,r,o){return e[0]=t,i(e,null,o,n),!n.pop()}})),has:z((function(t){return function(n){return e(t,n).length>0}})),contains:z((function(t){return function(e){return(e.textContent||e.innerText||y(e)).indexOf(t)>-1}})),enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},parent:function(t){return!v.pseudos.empty(t)},empty:function(t){var e;for(t=t.firstChild;t;){if(t.nodeName>"@"||3===(e=t.nodeType)||4===e)return!1;t=t.nextSibling}return!0},header:function(t){return et.test(t.nodeName)},text:function(t){var e,n;return"input"===t.nodeName.toLowerCase()&&"text"===(e=t.type)&&(null==(n=t.getAttribute("type"))||n.toLowerCase()===e)},radio:n("radio"),checkbox:n("checkbox"),file:n("file"),password:n("password"),image:n("image"),submit:i("submit"),reset:i("reset"),button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},input:function(t){return nt.test(t.nodeName)},focus:function(t){var e=t.ownerDocument;return t===e.activeElement&&(!e.hasFocus||e.hasFocus())&&(!!t.type||!!t.href)},active:function(t){return t===t.ownerDocument.activeElement},first:r((function(t,e,n){return[0]})),last:r((function(t,e,n){return[e-1]})),eq:r((function(t,e,n){return[n<0?n+e:n]})),even:r((function(t,e,n){for(var i=0;i<e;i+=2)t.push(i);return t})),odd:r((function(t,e,n){for(var i=1;i<e;i+=2)t.push(i);return t})),lt:r((function(t,e,n){for(var i=n<0?n+e:n;--i>=0;)t.push(i);return t})),gt:r((function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t}))}},C=T.compareDocumentPosition?function(t,e){return t===e?(_=!0,0):(t.compareDocumentPosition&&e.compareDocumentPosition?4&t.compareDocumentPosition(e):t.compareDocumentPosition)?-1:1}:function(t,e){if(t===e)return _=!0,0;if(t.sourceIndex&&e.sourceIndex)return t.sourceIndex-e.sourceIndex;var n,i,r=[],a=[],s=t.parentNode,l=e.parentNode,u=s;if(s===l)return o(t,e);if(!s)return-1;if(!l)return 1;for(;u;)r.unshift(u),u=u.parentNode;for(u=l;u;)a.unshift(u),u=u.parentNode;n=r.length,i=a.length;for(var c=0;c<n&&c<i;c++)if(r[c]!==a[c])return o(r[c],a[c]);return c===n?o(t,a[c],-1):o(r[c],e,1)},[0,0].sort(C),M=!_,e.uniqueSort=function(t){var e,n=1;if(_=M,t.sort(C),_)for(;e=t[n];n++)e===t[n-1]&&t.splice(n--,1);return t},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},w=e.compile=function(t,e){var n,i=[],r=[],o=V[D][t];if(!o){for(e||(e=a(t)),n=e.length;n--;)(o=d(e[n]))[D]?i.push(o):r.push(o);o=V(t,h(r,i))}return o},j.querySelectorAll&&function(){var t,n=f,i=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,o=[":focus"],s=[":active",":focus"],l=T.matchesSelector||T.mozMatchesSelector||T.webkitMatchesSelector||T.oMatchesSelector||T.msMatchesSelector;ot((function(t){t.innerHTML="<select><option selected=''></option></select>",t.querySelectorAll("[selected]").length||o.push("\\["+B+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),t.querySelectorAll(":checked").length||o.push(":checked")})),ot((function(t){t.innerHTML="<p test=''></p>",t.querySelectorAll("[test^='']").length&&o.push("[*^$]="+B+"*(?:\"\"|'')"),t.innerHTML="<input type='hidden'/>",t.querySelectorAll(":enabled").length||o.push(":enabled",":disabled")})),o=new RegExp(o.join("|")),f=function(t,e,r,s,l){if(!(s||l||o&&o.test(t))){var u,c,d=!0,h=D,f=e,p=9===e.nodeType&&t;if(1===e.nodeType&&"object"!==e.nodeName.toLowerCase()){for(u=a(t),(d=e.getAttribute("id"))?h=d.replace(i,"\\$&"):e.setAttribute("id",h),h="[id='"+h+"'] ",c=u.length;c--;)u[c]=h+u[c].join("");f=tt.test(t)&&e.parentNode||e,p=u.join(",")}if(p)try{return L.apply(r,O.call(f.querySelectorAll(p),0)),r}catch(t){}finally{d||e.removeAttribute("id")}}return n(t,e,r,s,l)},l&&(ot((function(e){t=l.call(e,"div");try{l.call(e,"[test!='']:sizzle"),s.push("!=",G)}catch(t){}})),s=new RegExp(s.join("|")),e.matchesSelector=function(n,i){if(i=i.replace(r,"='$1']"),!(b(n)||s.test(i)||o&&o.test(i)))try{var a=l.call(n,i);if(a||t||n.document&&11!==n.document.nodeType)return a}catch(t){}return e(i,null,null,[n]).length>0})}(),v.pseudos.nth=v.pseudos.eq,v.filters=p.prototype=v.pseudos,v.setFilters=new p,e.attr=U.attr,U.find=e,U.expr=e.selectors,U.expr[":"]=U.expr.pseudos,U.unique=e.uniqueSort,U.text=e.getText,U.isXMLDoc=e.isXML,U.contains=e.contains}(t);var Dt=/Until$/,Pt=/^(?:parents|prev(?:Until|All))/,jt=/^.[^:#\[\.,]*$/,Tt=U.expr.match.needsContext,At={children:!0,contents:!0,next:!0,prev:!0};U.fn.extend({find:function(t){var e,n,i,r,o,a,s=this;if("string"!=typeof t)return U(t).filter((function(){for(e=0,n=s.length;e<n;e++)if(U.contains(s[e],this))return!0}));for(a=this.pushStack("","find",t),e=0,n=this.length;e<n;e++)if(i=a.length,U.find(t,this[e],a),e>0)for(r=i;r<a.length;r++)for(o=0;o<i;o++)if(a[o]===a[r]){a.splice(r--,1);break}return a},has:function(t){var e,n=U(t,this),i=n.length;return this.filter((function(){for(e=0;e<i;e++)if(U.contains(this,n[e]))return!0}))},not:function(t){return this.pushStack(l(this,t,!1),"not",t)},filter:function(t){return this.pushStack(l(this,t,!0),"filter",t)},is:function(t){return!!t&&("string"==typeof t?Tt.test(t)?U(t,this.context).index(this[0])>=0:U.filter(t,this).length>0:this.filter(t).length>0)},closest:function(t,e){for(var n,i=0,r=this.length,o=[],a=Tt.test(t)||"string"!=typeof t?U(t,e||this.context):0;i<r;i++)for(n=this[i];n&&n.ownerDocument&&n!==e&&11!==n.nodeType;){if(a?a.index(n)>-1:U.find.matchesSelector(n,t)){o.push(n);break}n=n.parentNode}return o=o.length>1?U.unique(o):o,this.pushStack(o,"closest",t)},index:function(t){return t?"string"==typeof t?U.inArray(this[0],U(t)):U.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(t,e){var n="string"==typeof t?U(t,e):U.makeArray(t&&t.nodeType?[t]:t),i=U.merge(this.get(),n);return this.pushStack(a(n[0])||a(i[0])?i:U.unique(i))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),U.fn.andSelf=U.fn.addBack,U.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return U.dir(t,"parentNode")},parentsUntil:function(t,e,n){return U.dir(t,"parentNode",n)},next:function(t){return s(t,"nextSibling")},prev:function(t){return s(t,"previousSibling")},nextAll:function(t){return U.dir(t,"nextSibling")},prevAll:function(t){return U.dir(t,"previousSibling")},nextUntil:function(t,e,n){return U.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return U.dir(t,"previousSibling",n)},siblings:function(t){return U.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return U.sibling(t.firstChild)},contents:function(t){return U.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:U.merge([],t.childNodes)}},(function(t,e){U.fn[t]=function(n,i){var r=U.map(this,e,n);return Dt.test(t)||(i=n),i&&"string"==typeof i&&(r=U.filter(i,r)),r=this.length>1&&!At[t]?U.unique(r):r,this.length>1&&Pt.test(t)&&(r=r.reverse()),this.pushStack(r,t,F.call(arguments).join(","))}})),U.extend({filter:function(t,e,n){return n&&(t=":not("+t+")"),1===e.length?U.find.matchesSelector(e[0],t)?[e[0]]:[]:U.find.matches(t,e)},dir:function(t,n,i){for(var r=[],o=t[n];o&&9!==o.nodeType&&(i===e||1!==o.nodeType||!U(o).is(i));)1===o.nodeType&&r.push(o),o=o[n];return r},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}});var kt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",It=/ jQuery\d+="(?:null|\d+)"/g,Lt=/^\s+/,Ot=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Nt=/<([\w:]+)/,zt=/<tbody/i,Rt=/<|&#?\w+;/,Ht=/<(?:script|style|link)/i,Ft=/<(?:script|object|embed|option|style)/i,Vt=new RegExp("<(?:"+kt+")[\\s/>]","i"),Bt=/^(?:checkbox|radio)$/,Wt=/checked\s*(?:[^=]|=\s*.checked.)/i,$t=/\/(java|ecma)script/i,Ut=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,qt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Gt=u(L),Yt=Gt.appendChild(L.createElement("div"));qt.optgroup=qt.option,qt.tbody=qt.tfoot=qt.colgroup=qt.caption=qt.thead,qt.th=qt.td,U.support.htmlSerialize||(qt._default=[1,"X<div>","</div>"]),U.fn.extend({text:function(t){return U.access(this,(function(t){return t===e?U.text(this):this.empty().append((this[0]&&this[0].ownerDocument||L).createTextNode(t))}),null,t,arguments.length)},wrapAll:function(t){if(U.isFunction(t))return this.each((function(e){U(this).wrapAll(t.call(this,e))}));if(this[0]){var e=U(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t})).append(this)}return this},wrapInner:function(t){return U.isFunction(t)?this.each((function(e){U(this).wrapInner(t.call(this,e))})):this.each((function(){var e=U(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=U.isFunction(t);return this.each((function(n){U(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(){return this.parent().each((function(){U.nodeName(this,"body")||U(this).replaceWith(this.childNodes)})).end()},append:function(){return this.domManip(arguments,!0,(function(t){(1===this.nodeType||11===this.nodeType)&&this.appendChild(t)}))},prepend:function(){return this.domManip(arguments,!0,(function(t){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(t,this.firstChild)}))},before:function(){if(!a(this[0]))return this.domManip(arguments,!1,(function(t){this.parentNode.insertBefore(t,this)}));if(arguments.length){var t=U.clean(arguments);return this.pushStack(U.merge(t,this),"before",this.selector)}},after:function(){if(!a(this[0]))return this.domManip(arguments,!1,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}));if(arguments.length){var t=U.clean(arguments);return this.pushStack(U.merge(this,t),"after",this.selector)}},remove:function(t,e){for(var n,i=0;null!=(n=this[i]);i++)t&&!U.filter(t,[n]).length||(!e&&1===n.nodeType&&(U.cleanData(n.getElementsByTagName("*")),U.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)for(1===t.nodeType&&U.cleanData(t.getElementsByTagName("*"));t.firstChild;)t.removeChild(t.firstChild);return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return U.clone(this,t,e)}))},html:function(t){return U.access(this,(function(t){var n=this[0]||{},i=0,r=this.length;if(t===e)return 1===n.nodeType?n.innerHTML.replace(It,""):e;if("string"==typeof t&&!Ht.test(t)&&(U.support.htmlSerialize||!Vt.test(t))&&(U.support.leadingWhitespace||!Lt.test(t))&&!qt[(Nt.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(Ot,"<$1></$2>");try{for(;i<r;i++)1===(n=this[i]||{}).nodeType&&(U.cleanData(n.getElementsByTagName("*")),n.innerHTML=t);n=0}catch(t){}}n&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(t){return a(this[0])?this.length?this.pushStack(U(U.isFunction(t)?t():t),"replaceWith",t):this:U.isFunction(t)?this.each((function(e){var n=U(this),i=n.html();n.replaceWith(t.call(this,e,i))})):("string"!=typeof t&&(t=U(t).detach()),this.each((function(){var e=this.nextSibling,n=this.parentNode;U(this).remove(),e?U(e).before(t):U(n).append(t)})))},detach:function(t){return this.remove(t,!0)},domManip:function(t,n,i){var r,o,a,s,l=0,u=(t=[].concat.apply([],t))[0],d=[],h=this.length;if(!U.support.checkClone&&h>1&&"string"==typeof u&&Wt.test(u))return this.each((function(){U(this).domManip(t,n,i)}));if(U.isFunction(u))return this.each((function(r){var o=U(this);t[0]=u.call(this,r,n?o.html():e),o.domManip(t,n,i)}));if(this[0]){if(o=(a=(r=U.buildFragment(t,this,d)).fragment).firstChild,1===a.childNodes.length&&(a=o),o)for(n=n&&U.nodeName(o,"tr"),s=r.cacheable||h-1;l<h;l++)i.call(n&&U.nodeName(this[l],"table")?c(this[l],"tbody"):this[l],l===s?a:U.clone(a,!0,!0));a=o=null,d.length&&U.each(d,(function(t,e){e.src?U.ajax?U.ajax({url:e.src,type:"GET",dataType:"script",async:!1,global:!1,throws:!0}):U.error("no ajax"):U.globalEval((e.text||e.textContent||e.innerHTML||"").replace(Ut,"")),e.parentNode&&e.parentNode.removeChild(e)}))}return this}}),U.buildFragment=function(t,n,i){var r,o,a,s=t[0];return n=(n=!(n=n||L).nodeType&&n[0]||n).ownerDocument||n,1===t.length&&"string"==typeof s&&s.length<512&&n===L&&"<"===s.charAt(0)&&!Ft.test(s)&&(U.support.checkClone||!Wt.test(s))&&(U.support.html5Clone||!Vt.test(s))&&(o=!0,a=(r=U.fragments[s])!==e),r||(r=n.createDocumentFragment(),U.clean(t,n,r,i),o&&(U.fragments[s]=a&&r)),{fragment:r,cacheable:o}},U.fragments={},U.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){U.fn[t]=function(n){var i,r=0,o=[],a=U(n),s=a.length,l=1===this.length&&this[0].parentNode;if((null==l||l&&11===l.nodeType&&1===l.childNodes.length)&&1===s)return a[e](this[0]),this;for(;r<s;r++)i=(r>0?this.clone(!0):this).get(),U(a[r])[e](i),o=o.concat(i);return this.pushStack(o,t,a.selector)}})),U.extend({clone:function(t,e,n){var i,r,o,a;if(U.support.html5Clone||U.isXMLDoc(t)||!Vt.test("<"+t.nodeName+">")?a=t.cloneNode(!0):(Yt.innerHTML=t.outerHTML,Yt.removeChild(a=Yt.firstChild)),!(U.support.noCloneEvent&&U.support.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||U.isXMLDoc(t)))for(h(t,a),i=f(t),r=f(a),o=0;i[o];++o)r[o]&&h(i[o],r[o]);if(e&&(d(t,a),n))for(i=f(t),r=f(a),o=0;i[o];++o)d(i[o],r[o]);return i=r=null,a},clean:function(t,e,n,i){var r,o,a,s,l,c,d,h,f,g,m,v=e===L&&Gt,y=[];for(e&&void 0!==e.createDocumentFragment||(e=L),r=0;null!=(a=t[r]);r++)if("number"==typeof a&&(a+=""),a){if("string"==typeof a)if(Rt.test(a)){for(v=v||u(e),d=e.createElement("div"),v.appendChild(d),a=a.replace(Ot,"<$1></$2>"),s=(Nt.exec(a)||["",""])[1].toLowerCase(),c=(l=qt[s]||qt._default)[0],d.innerHTML=l[1]+a+l[2];c--;)d=d.lastChild;if(!U.support.tbody)for(h=zt.test(a),o=(f="table"!==s||h?"<table>"!==l[1]||h?[]:d.childNodes:d.firstChild&&d.firstChild.childNodes).length-1;o>=0;--o)U.nodeName(f[o],"tbody")&&!f[o].childNodes.length&&f[o].parentNode.removeChild(f[o]);!U.support.leadingWhitespace&&Lt.test(a)&&d.insertBefore(e.createTextNode(Lt.exec(a)[0]),d.firstChild),a=d.childNodes,d.parentNode.removeChild(d)}else a=e.createTextNode(a);a.nodeType?y.push(a):U.merge(y,a)}if(d&&(a=d=v=null),!U.support.appendChecked)for(r=0;null!=(a=y[r]);r++)U.nodeName(a,"input")?p(a):void 0!==a.getElementsByTagName&&U.grep(a.getElementsByTagName("input"),p);if(n)for(g=function(t){if(!t.type||$t.test(t.type))return i?i.push(t.parentNode?t.parentNode.removeChild(t):t):n.appendChild(t)},r=0;null!=(a=y[r]);r++)U.nodeName(a,"script")&&g(a)||(n.appendChild(a),void 0!==a.getElementsByTagName&&(m=U.grep(U.merge([],a.getElementsByTagName("script")),g),y.splice.apply(y,[r+1,0].concat(m)),r+=m.length));return y},cleanData:function(t,e){for(var n,i,r,o,a=0,s=U.expando,l=U.cache,u=U.support.deleteExpando,c=U.event.special;null!=(r=t[a]);a++)if((e||U.acceptData(r))&&(n=(i=r[s])&&l[i])){if(n.events)for(o in n.events)c[o]?U.event.remove(r,o):U.removeEvent(r,o,n.handle);l[i]&&(delete l[i],u?delete r[s]:r.removeAttribute?r.removeAttribute(s):r[s]=null,U.deletedIds.push(i))}}}),function(){var t,e;U.uaMatch=function(t){t=t.toLowerCase();var e=/(chrome)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[];return{browser:e[1]||"",version:e[2]||"0"}},e={},(t=U.uaMatch(N.userAgent)).browser&&(e[t.browser]=!0,e.version=t.version),e.chrome?e.webkit=!0:e.webkit&&(e.safari=!0),U.browser=e,U.sub=function(){function t(e,n){return new t.fn.init(e,n)}U.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(n,i){return i&&i instanceof U&&!(i instanceof t)&&(i=t(i)),U.fn.init.call(this,n,i,e)},t.fn.init.prototype=t.fn;var e=t(L);return t}}();var Xt,Qt,Kt,Jt=/alpha\([^)]*\)/i,Zt=/opacity=([^)]*)/,te=/^(top|right|bottom|left)$/,ee=/^(none|table(?!-c[ea]).+)/,ne=/^margin/,ie=new RegExp("^("+q+")(.*)$","i"),re=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),oe=new RegExp("^([-+])=("+q+")","i"),ae={},se={position:"absolute",visibility:"hidden",display:"block"},le={letterSpacing:0,fontWeight:400},ue=["Top","Right","Bottom","Left"],ce=["Webkit","O","Moz","ms"],de=U.fn.toggle;U.fn.extend({css:function(t,n){return U.access(this,(function(t,n,i){return i!==e?U.style(t,n,i):U.css(t,n)}),t,n,arguments.length>1)},show:function(){return v(this,!0)},hide:function(){return v(this)},toggle:function(t,e){var n="boolean"==typeof t;return U.isFunction(t)&&U.isFunction(e)?de.apply(this,arguments):this.each((function(){(n?t:m(this))?U(this).show():U(this).hide()}))}}),U.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Xt(t,"opacity");return""===n?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:U.support.cssFloat?"cssFloat":"styleFloat"},style:function(t,n,i,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,a,s,l=U.camelCase(n),u=t.style;if(n=U.cssProps[l]||(U.cssProps[l]=g(u,l)),s=U.cssHooks[n]||U.cssHooks[l],i===e)return s&&"get"in s&&(o=s.get(t,!1,r))!==e?o:u[n];if("string"===(a=typeof i)&&(o=oe.exec(i))&&(i=(o[1]+1)*o[2]+parseFloat(U.css(t,n)),a="number"),!(null==i||"number"===a&&isNaN(i)||("number"===a&&!U.cssNumber[l]&&(i+="px"),s&&"set"in s&&(i=s.set(t,i,r))===e)))try{u[n]=i}catch(t){}}},css:function(t,n,i,r){var o,a,s,l=U.camelCase(n);return n=U.cssProps[l]||(U.cssProps[l]=g(t.style,l)),(s=U.cssHooks[n]||U.cssHooks[l])&&"get"in s&&(o=s.get(t,!0,r)),o===e&&(o=Xt(t,n)),"normal"===o&&n in le&&(o=le[n]),i||r!==e?(a=parseFloat(o),i||U.isNumeric(a)?a||0:o):o},swap:function(t,e,n){var i,r,o={};for(r in e)o[r]=t.style[r],t.style[r]=e[r];for(r in i=n.call(t),e)t.style[r]=o[r];return i}}),t.getComputedStyle?Xt=function(e,n){var i,r,o,a,s=t.getComputedStyle(e,null),l=e.style;return s&&(""===(i=s[n])&&!U.contains(e.ownerDocument,e)&&(i=U.style(e,n)),re.test(i)&&ne.test(n)&&(r=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=i,i=s.width,l.width=r,l.minWidth=o,l.maxWidth=a)),i}:L.documentElement.currentStyle&&(Xt=function(t,e){var n,i,r=t.currentStyle&&t.currentStyle[e],o=t.style;return null==r&&o&&o[e]&&(r=o[e]),re.test(r)&&!te.test(e)&&(n=o.left,(i=t.runtimeStyle&&t.runtimeStyle.left)&&(t.runtimeStyle.left=t.currentStyle.left),o.left="fontSize"===e?"1em":r,r=o.pixelLeft+"px",o.left=n,i&&(t.runtimeStyle.left=i)),""===r?"auto":r}),U.each(["height","width"],(function(t,e){U.cssHooks[e]={get:function(t,n,i){if(n)return 0===t.offsetWidth&&ee.test(Xt(t,"display"))?U.swap(t,se,(function(){return x(t,e,i)})):x(t,e,i)},set:function(t,n,i){return y(0,n,i?b(t,e,i,U.support.boxSizing&&"border-box"===U.css(t,"boxSizing")):0)}}})),U.support.opacity||(U.cssHooks.opacity={get:function(t,e){return Zt.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var n=t.style,i=t.currentStyle,r=U.isNumeric(e)?"alpha(opacity="+100*e+")":"",o=i&&i.filter||n.filter||"";n.zoom=1,e>=1&&""===U.trim(o.replace(Jt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),i&&!i.filter)||(n.filter=Jt.test(o)?o.replace(Jt,r):o+" "+r)}}),U((function(){U.support.reliableMarginRight||(U.cssHooks.marginRight={get:function(t,e){return U.swap(t,{display:"inline-block"},(function(){if(e)return Xt(t,"marginRight")}))}}),!U.support.pixelPosition&&U.fn.position&&U.each(["top","left"],(function(t,e){U.cssHooks[e]={get:function(t,n){if(n){var i=Xt(t,e);return re.test(i)?U(t).position()[e]+"px":i}}}}))})),U.expr&&U.expr.filters&&(U.expr.filters.hidden=function(t){return 0===t.offsetWidth&&0===t.offsetHeight||!U.support.reliableHiddenOffsets&&"none"===(t.style&&t.style.display||Xt(t,"display"))},U.expr.filters.visible=function(t){return!U.expr.filters.hidden(t)}),U.each({margin:"",padding:"",border:"Width"},(function(t,e){U.cssHooks[t+e]={expand:function(n){var i,r="string"==typeof n?n.split(" "):[n],o={};for(i=0;i<4;i++)o[t+ue[i]+e]=r[i]||r[i-2]||r[0];return o}},ne.test(t)||(U.cssHooks[t+e].set=y)}));var he=/%20/g,fe=/\[\]$/,pe=/\r?\n/g,ge=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,me=/^(?:select|textarea)/i;U.fn.extend({serialize:function(){return U.param(this.serializeArray())},serializeArray:function(){return this.map((function(){return this.elements?U.makeArray(this.elements):this})).filter((function(){return this.name&&!this.disabled&&(this.checked||me.test(this.nodeName)||ge.test(this.type))})).map((function(t,e){var n=U(this).val();return null==n?null:U.isArray(n)?U.map(n,(function(t,n){return{name:e.name,value:t.replace(pe,"\r\n")}})):{name:e.name,value:n.replace(pe,"\r\n")}})).get()}}),U.param=function(t,n){var i,r=[],o=function(t,e){e=U.isFunction(e)?e():null==e?"":e,r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(n===e&&(n=U.ajaxSettings&&U.ajaxSettings.traditional),U.isArray(t)||t.jquery&&!U.isPlainObject(t))U.each(t,(function(){o(this.name,this.value)}));else for(i in t)C(i,t[i],n,o);return r.join("&").replace(he,"+")};var ve,ye,be=/#.*$/,xe=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,we=/^(?:GET|HEAD)$/,Ce=/^\/\//,_e=/\?/,Ee=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,Me=/([?&])_=[^&]*/,Se=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,De=U.fn.load,Pe={},je={},Te=["*/"]+["*"];try{ye=O.href}catch(t){(ye=L.createElement("a")).href="",ye=ye.href}ve=Se.exec(ye.toLowerCase())||[],U.fn.load=function(t,n,i){if("string"!=typeof t&&De)return De.apply(this,arguments);if(!this.length)return this;var r,o,a,s=this,l=t.indexOf(" ");return l>=0&&(r=t.slice(l,t.length),t=t.slice(0,l)),U.isFunction(n)?(i=n,n=e):n&&"object"==typeof n&&(o="POST"),U.ajax({url:t,type:o,dataType:"html",data:n,complete:function(t,e){i&&s.each(i,a||[t.responseText,e,t])}}).done((function(t){a=arguments,s.html(r?U("<div>").append(t.replace(Ee,"")).find(r):t)})),this},U.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),(function(t,e){U.fn[e]=function(t){return this.on(e,t)}})),U.each(["get","post"],(function(t,n){U[n]=function(t,i,r,o){return U.isFunction(i)&&(o=o||r,r=i,i=e),U.ajax({type:n,url:t,data:i,success:r,dataType:o})}})),U.extend({getScript:function(t,n){return U.get(t,e,n,"script")},getJSON:function(t,e,n){return U.get(t,e,n,"json")},ajaxSetup:function(t,e){return e?M(t,U.ajaxSettings):(e=t,t=U.ajaxSettings),M(t,e),t},ajaxSettings:{url:ye,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(ve[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Te},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":t.String,"text html":!0,"text json":U.parseJSON,"text xml":U.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:_(Pe),ajaxTransport:_(je),ajax:function(t,n){function i(t,n,i,a){var u,d,y,b,w,_=n;2!==x&&(x=2,l&&clearTimeout(l),s=e,o=a||"",C.readyState=t>0?4:0,i&&(b=function(t,n,i){var r,o,a,s,l=t.contents,u=t.dataTypes,c=t.responseFields;for(o in c)o in i&&(n[c[o]]=i[o]);for(;"*"===u[0];)u.shift(),r===e&&(r=t.mimeType||n.getResponseHeader("content-type"));if(r)for(o in l)if(l[o]&&l[o].test(r)){u.unshift(o);break}if(u[0]in i)a=u[0];else{for(o in i){if(!u[0]||t.converters[o+" "+u[0]]){a=o;break}s||(s=o)}a=a||s}if(a)return a!==u[0]&&u.unshift(a),i[a]}(h,C,i)),t>=200&&t<300||304===t?(h.ifModified&&((w=C.getResponseHeader("Last-Modified"))&&(U.lastModified[r]=w),(w=C.getResponseHeader("Etag"))&&(U.etag[r]=w)),304===t?(_="notmodified",u=!0):(u=function(t,e){var n,i,r,o,a=t.dataTypes.slice(),s=a[0],l={},u=0;if(t.dataFilter&&(e=t.dataFilter(e,t.dataType)),a[1])for(n in t.converters)l[n.toLowerCase()]=t.converters[n];for(;r=a[++u];)if("*"!==r){if("*"!==s&&s!==r){if(!(n=l[s+" "+r]||l["* "+r]))for(i in l)if((o=i.split(" "))[1]===r&&(n=l[s+" "+o[0]]||l["* "+o[0]])){!0===n?n=l[i]:!0!==l[i]&&(r=o[0],a.splice(u--,0,r));break}if(!0!==n)if(n&&t.throws)e=n(e);else try{e=n(e)}catch(t){return{state:"parsererror",error:n?t:"No conversion from "+s+" to "+r}}}s=r}return{state:"success",data:e}}(h,b),_=u.state,d=u.data,u=!(y=u.error))):(y=_,_&&!t||(_="error",t<0&&(t=0))),C.status=t,C.statusText=(n||_)+"",u?g.resolveWith(f,[d,_,C]):g.rejectWith(f,[C,_,y]),C.statusCode(v),v=e,c&&p.trigger("ajax"+(u?"Success":"Error"),[C,h,u?d:y]),m.fireWith(f,[C,_]),c&&(p.trigger("ajaxComplete",[C,h]),--U.active||U.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=e),n=n||{};var r,o,a,s,l,u,c,d,h=U.ajaxSetup({},n),f=h.context||h,p=f!==h&&(f.nodeType||f instanceof U)?U(f):U.event,g=U.Deferred(),m=U.Callbacks("once memory"),v=h.statusCode||{},y={},b={},x=0,w="canceled",C={readyState:0,setRequestHeader:function(t,e){if(!x){var n=t.toLowerCase();t=b[n]=b[n]||t,y[t]=e}return this},getAllResponseHeaders:function(){return 2===x?o:null},getResponseHeader:function(t){var n;if(2===x){if(!a)for(a={};n=xe.exec(o);)a[n[1].toLowerCase()]=n[2];n=a[t.toLowerCase()]}return n===e?null:n},overrideMimeType:function(t){return x||(h.mimeType=t),this},abort:function(t){return t=t||w,s&&s.abort(t),i(0,t),this}};if(g.promise(C),C.success=C.done,C.error=C.fail,C.complete=m.add,C.statusCode=function(t){var e;if(t)if(x<2)for(e in t)v[e]=[v[e],t[e]];else e=t[C.status],C.always(e);return this},h.url=((t||h.url)+"").replace(be,"").replace(Ce,ve[1]+"//"),h.dataTypes=U.trim(h.dataType||"*").toLowerCase().split(Y),null==h.crossDomain&&(u=Se.exec(h.url.toLowerCase())||!1,h.crossDomain=u&&u.join(":")+(u[3]?"":"http:"===u[1]?80:443)!==ve.join(":")+(ve[3]?"":"http:"===ve[1]?80:443)),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=U.param(h.data,h.traditional)),E(Pe,h,n,C),2===x)return C;if(c=h.global,h.type=h.type.toUpperCase(),h.hasContent=!we.test(h.type),c&&0==U.active++&&U.event.trigger("ajaxStart"),!h.hasContent&&(h.data&&(h.url+=(_e.test(h.url)?"&":"?")+h.data,delete h.data),r=h.url,!1===h.cache)){var _=U.now(),M=h.url.replace(Me,"$1_="+_);h.url=M+(M===h.url?(_e.test(h.url)?"&":"?")+"_="+_:"")}for(d in(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&C.setRequestHeader("Content-Type",h.contentType),h.ifModified&&(r=r||h.url,U.lastModified[r]&&C.setRequestHeader("If-Modified-Since",U.lastModified[r]),U.etag[r]&&C.setRequestHeader("If-None-Match",U.etag[r])),C.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Te+"; q=0.01":""):h.accepts["*"]),h.headers)C.setRequestHeader(d,h.headers[d]);if(!h.beforeSend||!1!==h.beforeSend.call(f,C,h)&&2!==x){for(d in w="abort",{success:1,error:1,complete:1})C[d](h[d]);if(s=E(je,h,n,C)){C.readyState=1,c&&p.trigger("ajaxSend",[C,h]),h.async&&h.timeout>0&&(l=setTimeout((function(){C.abort("timeout")}),h.timeout));try{x=1,s.send(y,i)}catch(t){if(!(x<2))throw t;i(-1,t)}}else i(-1,"No Transport");return C}return C.abort()},active:0,lastModified:{},etag:{}});var Ae=[],ke=/\?/,Ie=/(=)\?(?=&|$)|\?\?/,Le=U.now();U.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ae.pop()||U.expando+"_"+Le++;return this[t]=!0,t}}),U.ajaxPrefilter("json jsonp",(function(n,i,r){var o,a,s,l=n.data,u=n.url,c=!1!==n.jsonp,d=c&&Ie.test(u),h=c&&!d&&"string"==typeof l&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ie.test(l);if("jsonp"===n.dataTypes[0]||d||h)return o=n.jsonpCallback=U.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a=t[o],d?n.url=u.replace(Ie,"$1"+o):h?n.data=l.replace(Ie,"$1"+o):c&&(n.url+=(ke.test(u)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||U.error(o+" was not called"),s[0]},n.dataTypes[0]="json",t[o]=function(){s=arguments},r.always((function(){t[o]=a,n[o]&&(n.jsonpCallback=i.jsonpCallback,Ae.push(o)),s&&U.isFunction(a)&&a(s[0]),s=a=e})),"script"})),U.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(t){return U.globalEval(t),t}}}),U.ajaxPrefilter("script",(function(t){t.cache===e&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)})),U.ajaxTransport("script",(function(t){if(t.crossDomain){var n,i=L.head||L.getElementsByTagName("head")[0]||L.documentElement;return{send:function(r,o){(n=L.createElement("script")).async="async",t.scriptCharset&&(n.charset=t.scriptCharset),n.src=t.url,n.onload=n.onreadystatechange=function(t,r){(r||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,i&&n.parentNode&&i.removeChild(n),n=e,r||o(200,"success"))},i.insertBefore(n,i.firstChild)},abort:function(){n&&n.onload(0,1)}}}}));var Oe,Ne=!!t.ActiveXObject&&function(){for(var t in Oe)Oe[t](0,1)},ze=0;U.ajaxSettings.xhr=t.ActiveXObject?function(){return!this.isLocal&&S()||function(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}()}:S,function(t){U.extend(U.support,{ajax:!!t,cors:!!t&&"withCredentials"in t})}(U.ajaxSettings.xhr()),U.support.ajax&&U.ajaxTransport((function(n){var i;if(!n.crossDomain||U.support.cors)return{send:function(r,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),!n.crossDomain&&!r["X-Requested-With"]&&(r["X-Requested-With"]="XMLHttpRequest");try{for(s in r)l.setRequestHeader(s,r[s])}catch(t){}l.send(n.hasContent&&n.data||null),i=function(t,r){var s,u,c,d,h;try{if(i&&(r||4===l.readyState))if(i=e,a&&(l.onreadystatechange=U.noop,Ne&&delete Oe[a]),r)4!==l.readyState&&l.abort();else{s=l.status,c=l.getAllResponseHeaders(),d={},(h=l.responseXML)&&h.documentElement&&(d.xml=h);try{d.text=l.responseText}catch(t){}try{u=l.statusText}catch(t){u=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=d.text?200:404}}catch(t){r||o(-1,t)}d&&o(s,u,d,c)},n.async?4===l.readyState?setTimeout(i,0):(a=++ze,Ne&&(Oe||(Oe={},U(t).unload(Ne)),Oe[a]=i),l.onreadystatechange=i):i()},abort:function(){i&&i(0,1)}}}));var Re,He,Fe=/^(?:toggle|show|hide)$/,Ve=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),Be=/queueHooks$/,We=[function(t,e,n){var i,r,o,a,s,l,u,c,d=this,h=t.style,f={},p=[],g=t.nodeType&&m(t);for(i in n.queue||(null==(u=U._queueHooks(t,"fx")).unqueued&&(u.unqueued=0,c=u.empty.fire,u.empty.fire=function(){u.unqueued||c()}),u.unqueued++,d.always((function(){d.always((function(){u.unqueued--,U.queue(t,"fx").length||u.empty.fire()}))}))),1===t.nodeType&&("height"in e||"width"in e)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],"inline"===U.css(t,"display")&&"none"===U.css(t,"float")&&(U.support.inlineBlockNeedsLayout&&"inline"!==w(t.nodeName)?h.zoom=1:h.display="inline-block")),n.overflow&&(h.overflow="hidden",U.support.shrinkWrapBlocks||d.done((function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}))),e)if(o=e[i],Fe.exec(o)){if(delete e[i],o===(g?"hide":"show"))continue;p.push(i)}if(a=p.length)for(s=U._data(t,"fxshow")||U._data(t,"fxshow",{}),g?U(t).show():d.done((function(){U(t).hide()})),d.done((function(){var e;for(e in U.removeData(t,"fxshow",!0),f)U.style(t,e,f[e])})),i=0;i<a;i++)r=p[i],l=d.createTween(r,g?s[r]:0),f[r]=s[r]||U.style(t,r),r in s||(s[r]=l.start,g&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}],$e={"*":[function(t,e){var n,i,r=this.createTween(t,e),o=Ve.exec(e),a=r.cur(),s=+a||0,l=1,u=20;if(o){if(n=+o[2],"px"!==(i=o[3]||(U.cssNumber[t]?"":"px"))&&s){s=U.css(r.elem,t,!0)||n||1;do{s/=l=l||".5",U.style(r.elem,t,s+i)}while(l!==(l=r.cur()/a)&&1!==l&&--u)}r.unit=i,r.start=s,r.end=o[1]?s+(o[1]+1)*n:n}return r}]};U.Animation=U.extend(P,{tweener:function(t,e){U.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var n,i=0,r=t.length;i<r;i++)n=t[i],$e[n]=$e[n]||[],$e[n].unshift(e)},prefilter:function(t,e){e?We.unshift(t):We.push(t)}}),U.Tween=j,j.prototype={constructor:j,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||"swing",this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(U.cssNumber[n]?"":"px")},cur:function(){var t=j.propHooks[this.prop];return t&&t.get?t.get(this):j.propHooks._default.get(this)},run:function(t){var e,n=j.propHooks[this.prop];return this.options.duration?this.pos=e=U.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):j.propHooks._default.set(this),this}},j.prototype.init.prototype=j.prototype,j.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=U.css(t.elem,t.prop,!1,""))&&"auto"!==e?e:0:t.elem[t.prop]},set:function(t){U.fx.step[t.prop]?U.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[U.cssProps[t.prop]]||U.cssHooks[t.prop])?U.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},j.propHooks.scrollTop=j.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},U.each(["toggle","show","hide"],(function(t,e){var n=U.fn[e];U.fn[e]=function(i,r,o){return null==i||"boolean"==typeof i||!t&&U.isFunction(i)&&U.isFunction(r)?n.apply(this,arguments):this.animate(T(e,!0),i,r,o)}})),U.fn.extend({fadeTo:function(t,e,n,i){return this.filter(m).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var r=U.isEmptyObject(t),o=U.speed(e,n,i),a=function(){var e=P(this,U.extend({},t),o);r&&e.stop(!0)};return r||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(t,n,i){var r=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=n,n=t,t=e),n&&!1!==t&&this.queue(t||"fx",[]),this.each((function(){var e=!0,n=null!=t&&t+"queueHooks",o=U.timers,a=U._data(this);if(n)a[n]&&a[n].stop&&r(a[n]);else for(n in a)a[n]&&a[n].stop&&Be.test(n)&&r(a[n]);for(n=o.length;n--;)o[n].elem===this&&(null==t||o[n].queue===t)&&(o[n].anim.stop(i),e=!1,o.splice(n,1));(e||!i)&&U.dequeue(this,t)}))}}),U.each({slideDown:T("show"),slideUp:T("hide"),slideToggle:T("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){U.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),U.speed=function(t,e,n){var i=t&&"object"==typeof t?U.extend({},t):{complete:n||!n&&e||U.isFunction(t)&&t,duration:t,easing:n&&e||e&&!U.isFunction(e)&&e};return i.duration=U.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in U.fx.speeds?U.fx.speeds[i.duration]:U.fx.speeds._default,null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){U.isFunction(i.old)&&i.old.call(this),i.queue&&U.dequeue(this,i.queue)},i},U.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},U.timers=[],U.fx=j.prototype.init,U.fx.tick=function(){for(var t,e=U.timers,n=0;n<e.length;n++)!(t=e[n])()&&e[n]===t&&e.splice(n--,1);e.length||U.fx.stop()},U.fx.timer=function(t){t()&&U.timers.push(t)&&!He&&(He=setInterval(U.fx.tick,U.fx.interval))},U.fx.interval=13,U.fx.stop=function(){clearInterval(He),He=null},U.fx.speeds={slow:600,fast:200,_default:400},U.fx.step={},U.expr&&U.expr.filters&&(U.expr.filters.animated=function(t){return U.grep(U.timers,(function(e){return t===e.elem})).length});var Ue=/^(?:body|html)$/i;U.fn.offset=function(t){if(arguments.length)return t===e?this:this.each((function(e){U.offset.setOffset(this,t,e)}));var n,i,r,o,a,s,l,u={top:0,left:0},c=this[0],d=c&&c.ownerDocument;return d?(i=d.body)===c?U.offset.bodyOffset(c):(n=d.documentElement,U.contains(n,c)?(void 0!==c.getBoundingClientRect&&(u=c.getBoundingClientRect()),r=A(d),o=n.clientTop||i.clientTop||0,a=n.clientLeft||i.clientLeft||0,s=r.pageYOffset||n.scrollTop,l=r.pageXOffset||n.scrollLeft,{top:u.top+s-o,left:u.left+l-a}):u):void 0},U.offset={bodyOffset:function(t){var e=t.offsetTop,n=t.offsetLeft;return U.support.doesNotIncludeMarginInBodyOffset&&(e+=parseFloat(U.css(t,"marginTop"))||0,n+=parseFloat(U.css(t,"marginLeft"))||0),{top:e,left:n}},setOffset:function(t,e,n){var i=U.css(t,"position");"static"===i&&(t.style.position="relative");var r,o,a=U(t),s=a.offset(),l=U.css(t,"top"),u=U.css(t,"left"),c={},d={};("absolute"===i||"fixed"===i)&&U.inArray("auto",[l,u])>-1?(r=(d=a.position()).top,o=d.left):(r=parseFloat(l)||0,o=parseFloat(u)||0),U.isFunction(e)&&(e=e.call(t,n,s)),null!=e.top&&(c.top=e.top-s.top+r),null!=e.left&&(c.left=e.left-s.left+o),"using"in e?e.using.call(t,c):a.css(c)}},U.fn.extend({position:function(){if(this[0]){var t=this[0],e=this.offsetParent(),n=this.offset(),i=Ue.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(U.css(t,"marginTop"))||0,n.left-=parseFloat(U.css(t,"marginLeft"))||0,i.top+=parseFloat(U.css(e[0],"borderTopWidth"))||0,i.left+=parseFloat(U.css(e[0],"borderLeftWidth"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent||L.body;t&&!Ue.test(t.nodeName)&&"static"===U.css(t,"position");)t=t.offsetParent;return t||L.body}))}}),U.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,n){var i=/Y/.test(n);U.fn[t]=function(r){return U.access(this,(function(t,r,o){var a=A(t);if(o===e)return a?n in a?a[n]:a.document.documentElement[r]:t[r];a?a.scrollTo(i?U(a).scrollLeft():o,i?o:U(a).scrollTop()):t[r]=o}),t,r,arguments.length,null)}})),U.each({Height:"height",Width:"width"},(function(t,n){U.each({padding:"inner"+t,content:n,"":"outer"+t},(function(i,r){U.fn[r]=function(r,o){var a=arguments.length&&(i||"boolean"!=typeof r),s=i||(!0===r||!0===o?"margin":"border");return U.access(this,(function(n,i,r){var o;return U.isWindow(n)?n.document.documentElement["client"+t]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+t],o["scroll"+t],n.body["offset"+t],o["offset"+t],o["client"+t])):r===e?U.css(n,i,r,s):U.style(n,i,r,s)}),n,a?r:e,a,null)}}))})),t.jQuery=t.$=U,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],(function(){return U}))}(window),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}((function(t){var e=[],n=t(document),i=t.browser.msie&&6===parseInt(t.browser.version)&&"object"!=typeof window.XMLHttpRequest,r=t.browser.msie&&7===parseInt(t.browser.version),o=null,a=t(window),s=[];t.modal=function(e,n){return t.modal.impl.init(e,n)},t.modal.close=function(){t.modal.impl.close()},t.modal.focus=function(e){t.modal.impl.focus(e)},t.modal.setContainerDimensions=function(){t.modal.impl.setContainerDimensions()},t.modal.setPosition=function(){t.modal.impl.setPosition()},t.modal.update=function(e,n){t.modal.impl.update(e,n)},t.fn.modal=function(e){return t.modal.impl.init(this,e)},t.modal.defaults={appendTo:"body",focus:!0,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:!1,autoPosition:!0,zIndex:1e3,close:!0,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:!0,overlayClose:!1,fixed:!0,position:null,persist:!1,modal:!0,onOpen:null,onShow:null,onClose:null},t.modal.impl={d:{},init:function(e,n){if(this.d.data)return!1;if(o=t.browser.msie&&!t.support.boxModel,this.o=t.extend({},t.modal.defaults,n),this.zIndex=this.o.zIndex,this.occb=!1,"object"==typeof e)e=e instanceof t?e:t(e),this.d.placeholder=!1,0<e.parent().parent().size()&&(e.before(t("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"})),this.d.placeholder=!0,this.display=e.css("display"),!this.o.persist)&&(this.d.orig=e.clone(!0));else{if("string"!=typeof e&&"number"!=typeof e)return alert("SimpleModal Error: Unsupported data type: "+typeof e),this;e=t("<div></div>").html(e)}return this.create(e),this.open(),t.isFunction(this.o.onShow)&&this.o.onShow.apply(this,[this.d]),this},create:function(n){this.getDimensions(),this.o.modal&&i&&(this.d.iframe=t('<iframe src="javascript:false;"></iframe>').css(t.extend(this.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:s[0],width:s[1],zIndex:this.o.zIndex,top:0,left:0})).appendTo(this.o.appendTo)),this.d.overlay=t("<div></div>").attr("id",this.o.overlayId).addClass("simplemodal-overlay").css(t.extend(this.o.overlayCss,{display:"none",opacity:this.o.opacity/100,height:this.o.modal?e[0]:0,width:this.o.modal?e[1]:0,position:"fixed",left:0,top:0,zIndex:this.o.zIndex+1})).appendTo(this.o.appendTo),this.d.container=t("<div></div>").attr("id",this.o.containerId).addClass("simplemodal-container").css(t.extend({position:this.o.fixed?"fixed":"absolute"},this.o.containerCss,{display:"none",zIndex:this.o.zIndex+2})).append(this.o.close&&this.o.closeHTML?t(this.o.closeHTML).addClass(this.o.closeClass):"").appendTo(this.o.appendTo),this.d.wrap=t("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(this.d.container),this.d.data=n.attr("id",n.attr("id")||this.o.dataId).addClass("simplemodal-data").css(t.extend(this.o.dataCss,{display:"none"})).appendTo("body"),this.setContainerDimensions(),this.d.data.appendTo(this.d.wrap),(i||o)&&this.fixIE()},bindEvents:function(){var r=this;t("."+r.o.closeClass).bind("click.simplemodal",(function(t){t.preventDefault(),r.close()})),r.o.modal&&r.o.close&&r.o.overlayClose&&r.d.overlay.bind("click.simplemodal",(function(t){t.preventDefault(),r.close()})),n.bind("keydown.simplemodal",(function(t){r.o.modal&&9===t.keyCode?r.watchTab(t):r.o.close&&r.o.escClose&&27===t.keyCode&&(t.preventDefault(),r.close())})),a.bind("resize.simplemodal orientationchange.simplemodal",(function(){r.getDimensions(),r.o.autoResize?r.setContainerDimensions():r.o.autoPosition&&r.setPosition(),i||o?r.fixIE():r.o.modal&&(r.d.iframe&&r.d.iframe.css({height:s[0],width:s[1]}),r.d.overlay.css({height:e[0],width:e[1]}))}))},unbindEvents:function(){t("."+this.o.closeClass).unbind("click.simplemodal"),n.unbind("keydown.simplemodal"),a.unbind(".simplemodal"),this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var e=this.o.position;t.each([this.d.iframe||null,this.o.modal?this.d.overlay:null,"fixed"===this.d.container.css("position")?this.d.container:null],(function(t,n){if(n){var i,r,o=n[0].style;if(o.position="absolute",2>t)o.removeExpression("height"),o.removeExpression("width"),o.setExpression("height",'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'),o.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"');else e&&e.constructor===Array?(i=-1===(i=e[0]?"number"==typeof e[0]?e[0].toString():e[0].replace(/px/,""):n.css("top").replace(/px/,"")).indexOf("%")?i+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':parseInt(i.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',e[1]&&(r=-1===(r="number"==typeof e[1]?e[1].toString():e[1].replace(/px/,"")).indexOf("%")?r+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(r.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')):(i='(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',r='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'),o.removeExpression("top"),o.removeExpression("left"),o.setExpression("top",i),o.setExpression("left",r)}}))},focus:function(e){var n=this,i=(e=e&&-1!==t.inArray(e,["first","last"])?e:"first",t(":input:enabled:visible:"+e,n.d.wrap));setTimeout((function(){0<i.length?i.focus():n.d.wrap.focus()}),10)},getDimensions:function(){var t=void 0===window.innerHeight?a.height():window.innerHeight;e=[n.height(),n.width()],s=[t,a.width()]},getVal:function(t,e){return t?"number"==typeof t?t:"auto"===t?0:0<t.indexOf("%")?parseInt(t.replace(/%/,""))/100*("h"===e?s[0]:s[1]):parseInt(t.replace(/px/,"")):null},update:function(t,e){if(!this.d.data)return!1;this.d.origHeight=this.getVal(t,"h"),this.d.origWidth=this.getVal(e,"w"),this.d.data.hide(),t&&this.d.container.css("height",t),e&&this.d.container.css("width",e),this.setContainerDimensions(),this.d.data.show(),this.o.focus&&this.focus(),this.unbindEvents(),this.bindEvents()},setContainerDimensions:function(){var e=i||r,n=this.d.origHeight?this.d.origHeight:t.browser.opera?this.d.container.height():this.getVal(e?this.d.container[0].currentStyle.height:this.d.container.css("height"),"h"),o=(e=this.d.origWidth?this.d.origWidth:t.browser.opera?this.d.container.width():this.getVal(e?this.d.container[0].currentStyle.width:this.d.container.css("width"),"w"),this.d.data.outerHeight(!0)),a=this.d.data.outerWidth(!0);this.d.origHeight=this.d.origHeight||n,this.d.origWidth=this.d.origWidth||e;var l=this.o.maxHeight?this.getVal(this.o.maxHeight,"h"):null,u=this.o.maxWidth?this.getVal(this.o.maxWidth,"w"):null,c=(l=l&&l<s[0]?l:s[0],u=u&&u<s[1]?u:s[1],this.o.minHeight?this.getVal(this.o.minHeight,"h"):"auto");n=n?this.o.autoResize&&n>l?l:n<c?c:n:o?o>l?l:this.o.minHeight&&"auto"!==c&&o<c?c:o:c,l=this.o.minWidth?this.getVal(this.o.minWidth,"w"):"auto",e=e?this.o.autoResize&&e>u?u:e<l?l:e:a?a>u?u:this.o.minWidth&&"auto"!==l&&a<l?l:a:l;this.d.container.css({height:n,width:e}),this.d.wrap.css({overflow:o>n||a>e?"auto":"visible"}),this.o.autoPosition&&this.setPosition()},setPosition:function(){var t,e;t=s[0]/2-this.d.container.outerHeight(!0)/2,e=s[1]/2-this.d.container.outerWidth(!0)/2;var n="fixed"!==this.d.container.css("position")?a.scrollTop():0;this.o.position&&"[object Array]"===Object.prototype.toString.call(this.o.position)?(t=n+(this.o.position[0]||t),e=this.o.position[1]||e):t=n+t,this.d.container.css({left:e,top:t})},watchTab:function(e){0<t(e.target).parents(".simplemodal-container").length?(this.inputs=t(":input:enabled:visible:first, :input:enabled:visible:last",this.d.data[0]),(!e.shiftKey&&e.target===this.inputs[this.inputs.length-1]||e.shiftKey&&e.target===this.inputs[0]||0===this.inputs.length)&&(e.preventDefault(),this.focus(e.shiftKey?"last":"first"))):(e.preventDefault(),this.focus())},open:function(){this.d.iframe&&this.d.iframe.show(),t.isFunction(this.o.onOpen)?this.o.onOpen.apply(this,[this.d]):(this.d.overlay.show(),this.d.container.show(),this.d.data.show()),this.o.focus&&this.focus(),this.bindEvents()},close:function(){if(!this.d.data)return!1;if(this.unbindEvents(),t.isFunction(this.o.onClose)&&!this.occb)this.occb=!0,this.o.onClose.apply(this,[this.d]);else{if(this.d.placeholder){var e=t("#simplemodal-placeholder");this.o.persist?e.replaceWith(this.d.data.removeClass("simplemodal-data").css("display",this.display)):(this.d.data.hide().remove(),e.replaceWith(this.d.orig))}else this.d.data.hide().remove();this.d.container.hide().remove(),this.d.overlay.hide(),this.d.iframe&&this.d.iframe.hide().remove(),this.d.overlay.remove(),this.d={}}}}})),function(t,e){var n,i,r,o,a,s,l,u,c=Array.prototype.slice,d=decodeURIComponent,h=t.param,f=t.bbq=t.bbq||{},p=t.event.special,g="hashchange",m="querystring",v="fragment",y="elemUrlAttr",b="location",x="href",w="src",C=/^.*\?|#.*$/g,_=/^.*\#/,E={};function M(t){return"string"==typeof t}function S(t){var e=c.call(arguments,1);return function(){return t.apply(this,e.concat(c.call(arguments)))}}function D(i,o,a,s,l){var c,f,p,g,y;return s!==n?(y=(p=a.match(i?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/))[3]||"",2===l&&M(s)?f=s.replace(i?_:C,""):(g=r(p[2]),s=M(s)?r[i?v:m](s):s,f=2===l?s:1===l?t.extend({},s,g):t.extend({},g,s),f=h(f),i&&(f=f.replace(u,d))),c=p[1]+(i?"#":f||!p[1]?"?":"")+f+y):c=o(a!==n?a:e[b][x]),c}function P(t,e,i){return e===n||"boolean"==typeof e?(i=e,e=h[t?v:m]()):e=M(e)?e.replace(t?_:C,""):e,r(e,i)}function j(e,i,r,o){return M(r)||"object"==typeof r||(o=r,r=i,i=n),this.each((function(){var n=t(this),a=i||l()[(this.nodeName||"").toLowerCase()]||"",s=a&&n.attr(a)||"";n.attr(a,h[e](s,r,o))}))}h[m]=S(D,0,(function(t){return t.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")})),h[v]=i=S(D,1,(function(t){return t.replace(/^[^#]*#?(.*)$/,"$1")})),i.noEscape=function(e){e=e||"";var n=t.map(e.split(""),encodeURIComponent);u=new RegExp(n.join("|"),"g")},i.noEscape(",/"),t.deparam=r=function(e,i){var r={},o={true:!0,false:!1,null:null};return t.each(e.replace(/\+/g," ").split("&"),(function(e,a){var s,l=a.split("="),u=d(l[0]),c=r,h=0,f=u.split("]["),p=f.length-1;if(/\[/.test(f[0])&&/\]$/.test(f[p])?(f[p]=f[p].replace(/\]$/,""),p=(f=f.shift().split("[").concat(f)).length-1):p=0,2===l.length)if(s=d(l[1]),i&&(s=s&&!isNaN(s)?+s:"undefined"===s?n:o[s]!==n?o[s]:s),p)for(;h<=p;h++)c=c[u=""===f[h]?c.length:f[h]]=h<p?c[u]||(f[h+1]&&isNaN(f[h+1])?{}:[]):s;else t.isArray(r[u])?r[u].push(s):r[u]!==n?r[u]=[r[u],s]:r[u]=s;else u&&(r[u]=i?n:"")})),r},r[m]=S(P,0),r[v]=o=S(P,1),t[y]||(t[y]=function(e){return t.extend(E,e)})({a:x,base:x,iframe:w,img:w,input:w,form:"action",link:x,script:w}),l=t[y],t.fn[m]=S(j,m),t.fn[v]=S(j,v),f.pushState=a=function(t,r){M(t)&&/^#/.test(t)&&r===n&&(r=2);var o=t!==n,a=i(e[b][x],o?t:{},o?r:2);e[b][x]=a+(/#/.test(a)?"":"#")},f.getState=s=function(t,e){return t===n||"boolean"==typeof t?o(t):o(e)[t]},f.removeState=function(e){var i={};e!==n&&(i=s(),t.each(t.isArray(e)?e:arguments,(function(t,e){delete i[e]}))),a(i,2)},p[g]=t.extend(p[g],{add:function(e){var o;function a(t){var e=t[v]=i();t.getState=function(t,i){return t===n||"boolean"==typeof t?r(e,t):r(e,i)[t]},o.apply(this,arguments)}if(t.isFunction(e))return o=e,a;o=e.handler,e.handler=a}})}(jQuery,this),function(t,e){var n,i,r,o,a,s,l=t.event.special,u="location",c="hashchange",d="href",h=t.browser,f=document.documentMode,p=h.msie&&(void 0===f||f<8),g="on"+c in e&&!p;function m(t){return(t=t||e[u][d]).replace(/^[^#]*#?(.*)$/,"$1")}t[c+"Delay"]=100,l[c]=t.extend(l[c],{setup:function(){if(g)return!1;t(n.start)},teardown:function(){if(g)return!1;t(n.stop)}}),(s={}).start=function(){if(!i){var n=m();o||(o=a=function(t){return t},p&&(r=t('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow,a=function(){return m(r.document[u][d])},(o=function(t,e){if(t!==e){var n=r.document;n.open().close(),n[u].hash="#"+t}})(m()))),function r(){var s=m(),l=a(n);s!==n?(o(n=s,l),t(e).trigger(c)):l!==n&&(e[u][d]=e[u][d].replace(/#.*/,"")+"#"+l),i=setTimeout(r,t[c+"Delay"])}()}},s.stop=function(){r||(i&&clearTimeout(i),i=0)},n=s}(jQuery,this),jsPlumbUtil={isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isString:function(t){return"string"==typeof t},isObject:function(t){return"[object Object]"===Object.prototype.toString.call(t)},convertStyle:function(t,e){if("transparent"===t)return t;var n=t,i=function(t){return function(t){return 1==t.length?"0"+t:t}(Number(t).toString(16))},r=/(rgb[a]?\()(.*)(\))/;if(t.match(r)){var o=t.match(r)[2].split(",");n="#"+i(o[0])+i(o[1])+i(o[2]),e||4!=o.length||(n+=i(o[3]))}return n},gradient:function(t,e){return t=jsPlumbUtil.isArray(t)?t:[t.x,t.y],((e=jsPlumbUtil.isArray(e)?e:[e.x,e.y])[1]-t[1])/(e[0]-t[0])},normal:function(t,e){return-1/jsPlumbUtil.gradient(t,e)},lineLength:function(t,e){return t=jsPlumbUtil.isArray(t)?t:[t.x,t.y],e=jsPlumbUtil.isArray(e)?e:[e.x,e.y],Math.sqrt(Math.pow(e[1]-t[1],2)+Math.pow(e[0]-t[0],2))},segment:function(t,e){return t=jsPlumbUtil.isArray(t)?t:[t.x,t.y],(e=jsPlumbUtil.isArray(e)?e:[e.x,e.y])[0]>t[0]?e[1]>t[1]?2:1:e[1]>t[1]?3:4},intersects:function(t,e){var n=t.x,i=t.x+t.w,r=t.y,o=t.y+t.h,a=e.x,s=e.x+e.w,l=e.y,u=e.y+e.h;return n<=a&&a<=i&&r<=l&&l<=o||n<=s&&s<=i&&r<=l&&l<=o||n<=a&&a<=i&&r<=u&&u<=o||n<=s&&a<=i&&r<=u&&u<=o||a<=n&&n<=s&&l<=r&&r<=u||a<=i&&i<=s&&l<=r&&r<=u||a<=n&&n<=s&&l<=o&&o<=u||a<=i&&n<=s&&l<=o&&o<=u},segmentMultipliers:[null,[1,-1],[1,1],[-1,1],[-1,-1]],inverseSegmentMultipliers:[null,[-1,-1],[-1,1],[1,1],[1,-1]],pointOnLine:function(t,e,n){var i=jsPlumbUtil.gradient(t,e),r=jsPlumbUtil.segment(t,e),o=n>0?jsPlumbUtil.segmentMultipliers[r]:jsPlumbUtil.inverseSegmentMultipliers[r],a=Math.atan(i),s=Math.abs(n*Math.sin(a))*o[1],l=Math.abs(n*Math.cos(a))*o[0];return{x:t.x+l,y:t.y+s}},perpendicularLineTo:function(t,e,n){var i=jsPlumbUtil.gradient(t,e),r=Math.atan(-1/i),o=n/2*Math.sin(r),a=n/2*Math.cos(r);return[{x:e.x+a,y:e.y+o},{x:e.x-a,y:e.y-o}]},findWithFunction:function(t,e){if(t)for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1},indexOf:function(t,e){return jsPlumbUtil.findWithFunction(t,(function(t){return t==e}))},removeWithFunction:function(t,e){var n=jsPlumbUtil.findWithFunction(t,e);return n>-1&&t.splice(n,1),-1!=n},remove:function(t,e){var n=jsPlumbUtil.indexOf(t,e);return n>-1&&t.splice(n,1),-1!=n},addWithFunction:function(t,e,n){-1==jsPlumbUtil.findWithFunction(t,n)&&t.push(e)},addToList:function(t,e,n){var i=t[e];return null==i&&(i=[],t[e]=i),i.push(n),i},EventGenerator:function(){var t={},e=this,n=["ready"];this.bind=function(n,i){return jsPlumbUtil.addToList(t,n,i),e},this.fire=function(i,r,o){if(t[i])for(var a=0;a<t[i].length;a++)if(-1!=jsPlumbUtil.findWithFunction(n,(function(t){return t===i})))t[i][a](r,o);else try{t[i][a](r,o)}catch(t){jsPlumbUtil.log("jsPlumb: fire failed for event "+i+" : "+t)}return e},this.unbind=function(n){return n?delete t[n]:(delete t,t={}),e},this.getListener=function(e){return t[e]}},logEnabled:!0,log:function(){if(jsPlumbUtil.logEnabled&&"undefined"!=typeof console)try{var t=arguments[arguments.length-1];console.log(t)}catch(t){}},group:function(t){jsPlumbUtil.logEnabled&&"undefined"!=typeof console&&console.group(t)},groupEnd:function(t){jsPlumbUtil.logEnabled&&"undefined"!=typeof console&&console.groupEnd(t)},time:function(t){jsPlumbUtil.logEnabled&&"undefined"!=typeof console&&console.time(t)},timeEnd:function(t){jsPlumbUtil.logEnabled&&"undefined"!=typeof console&&console.timeEnd(t)}},function(){var t=!!document.createElement("canvas").getContext,e=!!window.SVGAngle||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),n=function(){if(null==n.vml){var t=document.body.appendChild(document.createElement("div"));t.innerHTML='<v:shape id="vml_flag1" adj="1" />';var e=t.firstChild;e.style.behavior="url(#default#VML)",n.vml=!e||"object"==typeof e.adj,t.parentNode.removeChild(t)}return n.vml},i=jsPlumbUtil.findWithFunction,r=jsPlumbUtil.indexOf,o=jsPlumbUtil.removeWithFunction,a=(jsPlumbUtil.remove,jsPlumbUtil.addWithFunction),s=(jsPlumbUtil.addToList,jsPlumbUtil.isArray),l=jsPlumbUtil.isString,u=jsPlumbUtil.isObject;window.console||(window.console={time:function(){},timeEnd:function(){},group:function(){},groupEnd:function(){},log:function(){}});var c=function(t,e){return C.CurrentLibrary.getAttribute(h(t),e)},d=function(t,e,n){C.CurrentLibrary.setAttribute(h(t),e,n)},h=function(t){return C.CurrentLibrary.getElementObject(t)},f=function(t){return C.CurrentLibrary.getOffset(h(t))},p=function(t){return C.CurrentLibrary.getSize(h(t))},g=jsPlumbUtil.log,m=(jsPlumbUtil.group,jsPlumbUtil.groupEnd,jsPlumbUtil.time,jsPlumbUtil.timeEnd,function(){return""+(new Date).getTime()}),v=function(t){var e=this,n=arguments,i=!1,r=t.parameters||{},o=e.idPrefix+(new Date).getTime(),a=null,s=null;e._jsPlumb=t._jsPlumb,e.getId=function(){return o},e.tooltip=t.tooltip,e.hoverClass=t.hoverClass||e._jsPlumb.Defaults.HoverClass||C.Defaults.HoverClass,jsPlumbUtil.EventGenerator.apply(this),this.clone=function(){var t=new Object;return e.constructor.apply(t,n),t},this.getParameter=function(t){return r[t]},this.getParameters=function(){return r},this.setParameter=function(t,e){r[t]=e},this.setParameters=function(t){r=t},this.overlayPlacements=[];var l=t.beforeDetach;this.isDetachAllowed=function(t){var n=e._jsPlumb.checkCondition("beforeDetach",t);if(l)try{n=l(t)}catch(t){g("jsPlumb: beforeDetach callback failed",t)}return n};var u=t.beforeDrop;this.isDropAllowed=function(t,n,i,r,o){var a=e._jsPlumb.checkCondition("beforeDrop",{sourceId:t,targetId:n,scope:i,connection:r,dropEndpoint:o});if(u)try{a=u({sourceId:t,targetId:n,scope:i,connection:r,dropEndpoint:o})}catch(t){g("jsPlumb: beforeDrop callback failed",t)}return a};var c=function(){if(a&&s){var t={};C.extend(t,a),C.extend(t,s),delete e.hoverPaintStyle,t.gradient&&a.fillStyle&&delete t.gradient,s=t}};this.setPaintStyle=function(t,n){a=t,e.paintStyleInUse=a,c(),n||e.repaint()},this.getPaintStyle=function(){return a},this.setHoverPaintStyle=function(t,n){s=t,c(),n||e.repaint()},this.getHoverPaintStyle=function(){return s},this.setHover=function(t,n,r){e._jsPlumb.currentlyDragging||e._jsPlumb.isHoverSuspended()||(i=t,null!=e.hoverClass&&null!=e.canvas&&(t?d.addClass(e.canvas,e.hoverClass):d.removeClass(e.canvas,e.hoverClass)),null!=s&&(e.paintStyleInUse=t?s:a,r=r||m(),e.repaint({timestamp:r,recalc:!1})),e.getAttachedElements&&!n&&y(t,m(),e))},this.isHover=function(){return i};var d=C.CurrentLibrary,h=["click","dblclick","mouseenter","mouseout","mousemove","mousedown","mouseup","contextmenu"],f={mouseout:"mouseexit"},p=function(t,e,n){var i=f[n]||n;d.bind(t,n,(function(t){e.fire(i,e,t)}))},v=function(t,e){d.unbind(t,e)};this.attachListeners=function(t,e){for(var n=0;n<h.length;n++)p(t,e,h[n])};var y=function(t,n,i){var r=e.getAttachedElements();if(r)for(var o=0;o<r.length;o++)i&&i==r[o]||r[o].setHover(t,!0,n)};this.reattachListenersForElement=function(t){if(arguments.length>1){for(var n=0;n<h.length;n++)v(t,h[n]);for(n=1;n<arguments.length;n++)e.attachListeners(t,arguments[n])}}},y=function(t){v.apply(this,arguments);var e=this;this.overlays=[];var n=function(t){var n=null;if(s(t)){var i=t[0],r=C.extend({component:e,_jsPlumb:e._jsPlumb},t[1]);if(3==t.length&&C.extend(r,t[2]),n=new(C.Overlays[e._jsPlumb.getRenderMode()][i])(r),r.events)for(var o in r.events)n.bind(o,r.events[o])}else n=t.constructor==String?new(C.Overlays[e._jsPlumb.getRenderMode()][t])({component:e,_jsPlumb:e._jsPlumb}):t;e.overlays.push(n)},i=function(t){var n,i=e.defaultOverlayKeys||[],r=t.overlays;r||(r=[]);for(var o=0;o<i.length;o++)r.unshift.apply(r,(n=i[o],e._jsPlumb.Defaults[n]||C.Defaults[n]||[]));return r}(t);if(i)for(var r=0;r<i.length;r++)n(i[r]);var o=function(t){for(var n=-1,i=0;i<e.overlays.length;i++)if(t===e.overlays[i].id){n=i;break}return n};this.addOverlay=function(t){n(t),e.repaint()},this.getOverlay=function(t){var n=o(t);return n>=0?e.overlays[n]:null},this.getOverlays=function(){return e.overlays},this.hideOverlay=function(t){var n=e.getOverlay(t);n&&n.hide()},this.hideOverlays=function(){for(var t=0;t<e.overlays.length;t++)e.overlays[t].hide()},this.showOverlay=function(t){var n=e.getOverlay(t);n&&n.show()},this.showOverlays=function(){for(var t=0;t<e.overlays.length;t++)e.overlays[t].show()},this.removeAllOverlays=function(){for(var t in e.overlays)e.overlays[t].cleanup();e.overlays.splice(0,e.overlays.length),e.repaint()},this.removeOverlay=function(t){var n=o(t);-1!=n&&(e.overlays[n].cleanup(),e.overlays.splice(n,1))},this.removeOverlays=function(){for(var t=0;t<arguments.length;t++)e.removeOverlay(arguments[t])};var a="__label",l=function(t){var n={cssClass:t.cssClass,labelStyle:this.labelStyle,id:a,component:e,_jsPlumb:e._jsPlumb},i=C.extend(n,t);return new(C.Overlays[e._jsPlumb.getRenderMode()].Label)(i)};if(t.label){var u=t.labelLocation||e.defaultLabelLocation||.5,c=t.labelStyle||e._jsPlumb.Defaults.LabelStyle||C.Defaults.LabelStyle;this.overlays.push(l({label:t.label,location:u,labelStyle:c}))}this.setLabel=function(t){var n=e.getOverlay(a);if(n)t.constructor==String||t.constructor==Function?n.setLabel(t):(t.label&&n.setLabel(t.label),t.location&&n.setLocation(t.location));else{var i=t.constructor==String||t.constructor==Function?{label:t}:t;n=l(i),this.overlays.push(n)}e.repaint()},this.getLabel=function(){var t=e.getOverlay(a);return null!=t?t.getLabel():null},this.getLabelOverlay=function(){return e.getOverlay(a)}},b=function(t,e,n){t.bind("click",(function(t,n){e.fire("click",e,n)})),t.bind("dblclick",(function(t,n){e.fire("dblclick",e,n)})),t.bind("contextmenu",(function(t,n){e.fire("contextmenu",e,n)})),t.bind("mouseenter",(function(t,i){e.isHover()||(n(!0),e.fire("mouseenter",e,i))})),t.bind("mouseexit",(function(t,i){e.isHover()&&(n(!1),e.fire("mouseexit",e,i))}))},x=0,w=function(w){this.Defaults={Anchor:"BottomCenter",Anchors:[null,null],ConnectionsDetachable:!0,ConnectionOverlays:[],Connector:"Bezier",Container:null,DragOptions:{},DropOptions:{},Endpoint:"Dot",EndpointOverlays:[],Endpoints:[null,null],EndpointStyle:{fillStyle:"#456"},EndpointStyles:[null,null],EndpointHoverStyle:null,EndpointHoverStyles:[null,null],HoverPaintStyle:null,LabelStyle:{color:"black"},LogEnabled:!1,Overlays:[],MaxConnections:1,PaintStyle:{lineWidth:8,strokeStyle:"#456"},RenderMode:"svg",Scope:"jsPlumb_DefaultScope"},w&&C.extend(this.Defaults,w),this.logEnabled=this.Defaults.LogEnabled,jsPlumbUtil.EventGenerator.apply(this);var _=this,E=function(){var t=x+1;return x++,t}(),M=_.bind,S={};for(var D in this.Defaults)S[D]=this.Defaults[D];this.bind=function(t,e){"ready"===t&&j?e():M.apply(_,[t,e])},_.importDefaults=function(t){for(var e in t)_.Defaults[e]=t[e]},_.restoreDefaults=function(){_.Defaults=C.extend({},S)};var P=null,j=!1,T={},A={},k={},I={},L={},O={},N={},z=[],R=this.Defaults.Scope,H=null,F=function(t,e,n){var i=t[e];return null==i&&(i=[],t[e]=i),i.push(n),i},V=function(t,e){_.Defaults.Container?C.CurrentLibrary.appendElement(t,_.Defaults.Container):e?C.CurrentLibrary.appendElement(t,e):document.body.appendChild(t)},B=1,W=function(){return""+B++},$=function(t){return t._nodes?t._nodes:t},U=!1,q=function(t,e,n){if(!U){var i=c(t,"id"),r=_.dragManager.getElementsForDraggable(i);if(null==n&&(n=m()),_.anchorManager.redraw(i,e,n),r)for(var o in r)_.anchorManager.redraw(r[o].id,e,n,r[o].offset)}},G=function(t,e){var n=null;if(s(t)){n=[];for(var i=0;i<t.length;i++){var r=h(t[i]),o=c(r,"id");n.push(e(r,o))}}else{n=e(r=h(t),o=c(r,"id"))}return n},Y=function(t){return k[t]},X=function(t,e,n){var i=null!=e&&e,r=C.CurrentLibrary;if(i&&r.isDragSupported(t)&&!r.isAlreadyDraggable(t)){var o=n||_.Defaults.DragOptions||C.Defaults.DragOptions;o=C.extend({},o);var a=r.dragEvents.drag,s=r.dragEvents.stop,l=r.dragEvents.start;o[l]=ut(o[l],(function(){_.setHoverSuspended(!0)})),o[a]=ut(o[a],(function(){var e=r.getUIPosition(arguments);q(t,e),function(t,e){C.CurrentLibrary.addClass(h(t),e)}(t,"jsPlumb_dragged")})),o[s]=ut(o[s],(function(){var e=r.getUIPosition(arguments);q(t,e),function(t,e){C.CurrentLibrary.removeClass(h(t),e)}(t,"jsPlumb_dragged"),_.setHoverSuspended(!1)}));var u=lt(t);N[u]=!0;i=N[u];o.disabled=null!=i&&!i,r.initDraggable(t,o,!1),_.dragManager.register(t)}},Q=function(t){var e=_.Defaults.ConnectionType||_.getDefaultConnectionType(),n=_.Defaults.EndpointType||$t,i=C.CurrentLibrary.getParent;t.container?t.parent=t.container:t.sourceEndpoint?t.parent=t.sourceEndpoint.parent:t.source.constructor==n?t.parent=t.source.parent:t.parent=i(t.source),t._jsPlumb=_;var r=new e(t);return r.id="con_"+W(),J("click","click",r),J("dblclick","dblclick",r),J("contextmenu","contextmenu",r),r},K=function(t,e,n){e=e||{},t.suspendedEndpoint||F(T,t.scope,t),e.doNotFireConnectionEvent||!1===e.fireEvent||_.fire("jsPlumbConnection",{connection:t,source:t.source,target:t.target,sourceId:t.sourceId,targetId:t.targetId,sourceEndpoint:t.endpoints[0],targetEndpoint:t.endpoints[1]},n),_.anchorManager.newConnection(t),q(t.source)},J=function(t,e,n){n.bind(t,(function(t,i){_.fire(e,n,i)}))},Z=function(t){if(t.container)return t.container;var e=C.CurrentLibrary.getTagName(t.source),n=C.CurrentLibrary.getParent(t.source);return e&&"td"===e.toLowerCase()?C.CurrentLibrary.getParent(n):n},tt=function(t){var e=_.Defaults.EndpointType||$t;t.parent=Z(t),t._jsPlumb=_;var n=new e(t);return n.id="ep_"+W(),J("click","endpointClick",n),J("dblclick","endpointDblClick",n),J("contextmenu","contextmenu",n),n},et=function(t,e,n){var i=A[t];if(i&&i.length)for(var r=0;r<i.length;r++){for(var o=0;o<i[r].connections.length;o++){if(e(i[r].connections[o]))return}n&&n(i[r])}},nt=function(t,e){null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t)},it=function(t,e){for(var n=0;n<t.length;n++)nt(t[n])},rt=function(t,e,n){e="block"===e;var i=null;n&&(i=e?function(t){t.setVisible(!0,!0,!0)}:function(t){t.setVisible(!1,!0,!0)});var r=c(t,"id");et(r,(function(t){if(e&&n){var i=t.sourceId===r?1:0;t.endpoints[i].isVisible()&&t.setVisible(!0)}else t.setVisible(e)}),i)},ot=function(t,e){var n=null;e&&(n=function(t){var e=t.isVisible();t.setVisible(!e)}),et(t,(function(t){var e=t.isVisible();t.setVisible(!e)}),n)},at=function(t){var e,n=t.timestamp,i=t.recalc,r=t.offset,o=t.elId;if(!i&&n&&n===L[o])return I[o];i||!r?null!=(e=h(o))&&(z[o]=p(e),I[o]=f(e),L[o]=n):(I[o]=r,null==z[o]&&null!=(e=h(o))&&(z[o]=p(e)));return I[o]&&!I[o].right&&(I[o].right=I[o].left+z[o][0],I[o].bottom=I[o].top+z[o][1],I[o].width=z[o][0],I[o].height=z[o][1],I[o].centerx=I[o].left+I[o].width/2,I[o].centery=I[o].top+I[o].height/2),I[o]},st=function(t){var e=I[t];return e||(e=at({elId:t})),{o:e,s:z[t]}},lt=function(t,e,n){var i=h(t),r=c(i,"id");return r&&"undefined"!=r||(2==arguments.length&&null!=arguments[1]?r=e:(1==arguments.length||3==arguments.length&&!arguments[2])&&(r="jsPlumb_"+E+"_"+W()),d(i,"id",r)),r},ut=function(t,e,n){return t=t||function(){},e=e||function(){},function(){var i=null;try{i=e.apply(this,arguments)}catch(t){g(_,"jsPlumb function failed : "+t)}if(null==n||i!==n)try{t.apply(this,arguments)}catch(t){g(_,"wrapped function failed : "+t)}return i}};this.connectorClass="_jsPlumb_connector",this.endpointClass="_jsPlumb_endpoint",this.overlayClass="_jsPlumb_overlay",this.Anchors={},this.Connectors={canvas:{},svg:{},vml:{}},this.Endpoints={canvas:{},svg:{},vml:{}},this.Overlays={canvas:{},svg:{},vml:{}},this.addClass=function(t,e){return C.CurrentLibrary.addClass(t,e)},this.removeClass=function(t,e){return C.CurrentLibrary.removeClass(t,e)},this.hasClass=function(t,e){return C.CurrentLibrary.hasClass(t,e)},this.addEndpoint=function(t,e,n){n=n||{};var i=C.extend({},n);C.extend(i,e),i.endpoint=i.endpoint||_.Defaults.Endpoint||C.Defaults.Endpoint,i.paintStyle=i.paintStyle||_.Defaults.EndpointStyle||C.Defaults.EndpointStyle;for(var r=[],o=(t=$(t)).length&&t.constructor!=String?t:[t],a=0;a<o.length;a++){var s=h(o[a]),l=lt(s);i.source=s,at({elId:l});var u=tt(i);i.parentAnchor&&(u.parentAnchor=i.parentAnchor),F(A,l,u);var c=I[l],d=z[l],f=u.anchor.compute({xy:[c.left,c.top],wh:d,element:u});u.paint({anchorLoc:f}),r.push(u),_.dragManager.endpointAdded(s)}return 1==r.length?r[0]:r},this.addEndpoints=function(t,e,n){for(var i=[],r=0;r<e.length;r++){var o=_.addEndpoint(t,e[r],n);s(o)?Array.prototype.push.apply(i,o):i.push(o)}return i},this.animate=function(t,e,n){var i=h(t),r=c(t,"id");n=n||{};var o=C.CurrentLibrary.dragEvents.step,a=C.CurrentLibrary.dragEvents.complete;n[o]=ut(n[o],(function(){_.repaint(r)})),n[a]=ut(n[a],(function(){_.repaint(r)})),C.CurrentLibrary.animate(i,e,n)},this.checkCondition=function(t,e){var n=_.getListener(t),i=!0;if(n&&n.length>0)try{for(var r=0;r<n.length;r++)i=i&&n[r](e)}catch(e){g(_,"cannot check condition ["+t+"]"+e)}return i},this.connect=function(t,e){var n=function(t,e){var n=C.extend({},t);if(e&&C.extend(n,e),n.source&&n.source.endpoint&&(n.sourceEndpoint=n.source),n.source&&n.target.endpoint&&(n.targetEndpoint=n.target),t.uuids&&(n.sourceEndpoint=Y(t.uuids[0]),n.targetEndpoint=Y(t.uuids[1])),n.sourceEndpoint&&n.sourceEndpoint.isFull())g(_,"could not add connection; source endpoint is full");else{if(!n.targetEndpoint||!n.targetEndpoint.isFull()){if(n.sourceEndpoint&&n.sourceEndpoint.connectorOverlays){n.overlays=n.overlays||[];for(var i=0;i<n.sourceEndpoint.connectorOverlays.length;i++)n.overlays.push(n.sourceEndpoint.connectorOverlays[i])}if(n.tooltip=t.tooltip,!n.tooltip&&n.sourceEndpoint&&n.sourceEndpoint.connectorTooltip&&(n.tooltip=n.sourceEndpoint.connectorTooltip),n.target&&!n.target.endpoint&&!n.targetEndpoint&&!n.newConnection){var r=lt(n.target),o=gt[r],a=mt[r];if(o){if(!Mt[r])return;var s=null!=a?a:_.addEndpoint(n.target,o);vt[r]&&(mt[r]=s),n.targetEndpoint=s,s._makeTargetCreator=!0}}if(n.source&&!n.source.endpoint&&!n.sourceEndpoint&&!n.newConnection&&(r=lt(n.source),o=xt[r],a=wt[r],o)){if(!_t[r])return;s=null!=a?a:_.addEndpoint(n.source,o),Ct[r]&&(wt[r]=s),n.sourceEndpoint=s}return n}g(_,"could not add connection; target endpoint is full")}}(t,e);if(n){null==n.deleteEndpointsOnDetach&&(n.deleteEndpointsOnDetach=!0);var i=Q(n);return K(i,n),i}},this.deleteEndpoint=function(t){var e="string"==typeof t?k[t]:t;if(e){var n=e.getUuid();for(var i in n&&(k[n]=null),e.detachAll(),it(e.endpoint.getDisplayElements()),_.anchorManager.deleteEndpoint(e),A){var r=A[i];if(r){for(var o=[],a=0;a<r.length;a++)r[a]!=e&&o.push(r[a]);A[i]=o}}_.dragManager.endpointDeleted(e)}},this.deleteEveryEndpoint=function(){for(var t in A){var e=A[t];if(e&&e.length)for(var n=0;n<e.length;n++)_.deleteEndpoint(e[n])}delete A,A={},delete k,k={}};var ct=function(t,e,n){var i=_.Defaults.ConnectionType||_.getDefaultConnectionType(),r=t.constructor==i?{connection:t,source:t.source,target:t.target,sourceId:t.sourceId,targetId:t.targetId,sourceEndpoint:t.endpoints[0],targetEndpoint:t.endpoints[1]}:t;e&&_.fire("jsPlumbConnectionDetached",r,n),_.anchorManager.connectionDetached(r)};this.detach=function(){if(0!=arguments.length){var t=_.Defaults.ConnectionType||_.getDefaultConnectionType(),e=arguments[0].constructor==t,n=2==arguments.length&&e?arguments[1]||{}:arguments[0],i=!1!==n.fireEvent,r=n.forceDetach,o=e?arguments[0]:n.connection;if(o)(r||o.isDetachAllowed(o)&&o.endpoints[0].isDetachAllowed(o)&&o.endpoints[1].isDetachAllowed(o))&&(r||_.checkCondition("beforeDetach",o))&&o.endpoints[0].detach(o,!1,!0,i);else{var a=C.extend({},n);if(a.uuids)Y(a.uuids[0]).detachFrom(Y(a.uuids[1]),i);else if(a.sourceEndpoint&&a.targetEndpoint)a.sourceEndpoint.detachFrom(a.targetEndpoint);else{var s=lt(a.source),l=lt(a.target);et(s,(function(t){(t.sourceId==s&&t.targetId==l||t.targetId==s&&t.sourceId==l)&&_.checkCondition("beforeDetach",t)&&t.endpoints[0].detach(t,!1,!0,i)}))}}}},this.detachAllConnections=function(t,e){e=e||{},t=h(t);var n=c(t,"id"),i=A[n];if(i&&i.length)for(var r=0;r<i.length;r++)i[r].detachAll(e.fireEvent)},this.detachEveryConnection=function(t){for(var e in t=t||{},A){var n=A[e];if(n&&n.length)for(var i=0;i<n.length;i++)n[i].detachAll(t.fireEvent)}delete T,T={}},this.draggable=function(t,e){if("object"==typeof t&&t.length)for(var n=0;n<t.length;n++){(i=h(t[n]))&&X(i,!0,e)}else if(t._nodes)for(n=0;n<t._nodes.length;n++){var i;(i=h(t._nodes[n]))&&X(i,!0,e)}else(i=h(t))&&X(i,!0,e)},this.extend=function(t,e){return C.CurrentLibrary.extend(t,e)},this.getDefaultEndpointType=function(){return $t},this.getDefaultConnectionType=function(){return Wt};var dt=function(t,e,n){return function(){return function(t,e,n,i){for(var r=0;r<t.length;r++)t[r][e].apply(t[r],n);return i(t)}(t,e,arguments,n)}},ht=function(t,e){return function(){return function(t,e,n){for(var i=[],r=0;r<t.length;r++)i.push([t[r][e].apply(t[r],n),t[r]]);return i}(t,e,arguments)}};this.getConnections=function(t,e){t?t.constructor==String&&(t={scope:t}):t={};var n=function(t){var e=[];if(t)if("string"==typeof t){if("*"===t)return t;e.push(t)}else e=t;return e},i=n(t.scope||_.getDefaultScope()),o=n(t.source),a=n(t.target),s=function(t,e){return"*"===t||(!(t.length>0)||-1!=r(t,e))},l=!e&&i.length>1?{}:[],u=function(t,n){if(!e&&i.length>1){var r=l[t];null==r&&(r=[],l[t]=r),r.push(n)}else l.push(n)};for(var c in T)if(s(i,c))for(var d=0;d<T[c].length;d++){var h=T[c][d];s(o,h.sourceId)&&s(a,h.targetId)&&u(c,h)}return l};var ft=function(t){return{setHover:dt(t,"setHover",ft),removeAllOverlays:dt(t,"removeAllOverlays",ft),setLabel:dt(t,"setLabel",ft),addOverlay:dt(t,"addOverlay",ft),removeOverlay:dt(t,"removeOverlay",ft),removeOverlays:dt(t,"removeOverlays",ft),showOverlay:dt(t,"showOverlay",ft),hideOverlay:dt(t,"hideOverlay",ft),showOverlays:dt(t,"showOverlays",ft),hideOverlays:dt(t,"hideOverlays",ft),setPaintStyle:dt(t,"setPaintStyle",ft),setHoverPaintStyle:dt(t,"setHoverPaintStyle",ft),setDetachable:dt(t,"setDetachable",ft),setConnector:dt(t,"setConnector",ft),setParameter:dt(t,"setParameter",ft),setParameters:dt(t,"setParameters",ft),detach:function(){for(var e=0;e<t.length;e++)_.detach(t[e])},getLabel:ht(t,"getLabel"),getOverlay:ht(t,"getOverlay"),isHover:ht(t,"isHover"),isDetachable:ht(t,"isDetachable"),getParameter:ht(t,"getParameter"),getParameters:ht(t,"getParameters"),getPaintStyle:ht(t,"getPaintStyle"),getHoverPaintStyle:ht(t,"getHoverPaintStyle"),length:t.length,each:function(e){for(var n=0;n<t.length;n++)e(t[n]);return ft(t)},get:function(e){return t[e]}}};this.select=function(t){(t=t||{}).scope=t.scope||"*";var e=_.getConnections(t,!0);return ft(e)},this.getAllConnections=function(){return T},this.getDefaultScope=function(){return R},this.getEndpoint=Y,this.getEndpoints=function(t){return A[lt(t)]},this.getId=lt,this.getOffset=function(t){I[t];return at({elId:t})},this.getSelector=function(t){return C.CurrentLibrary.getSelector(t)},this.getSize=function(t){return z[t]||at({elId:t}),z[t]},this.appendElement=V;var pt=!1;this.isHoverSuspended=function(){return pt},this.setHoverSuspended=function(t){pt=t},this.isCanvasAvailable=function(){return t},this.isSVGAvailable=function(){return e},this.isVMLAvailable=n,this.hide=function(t,e){rt(t,"none",e)},this.idstamp=W,this.init=function(){if(!j){_.setRenderMode(_.Defaults.RenderMode);var t=function(t){C.CurrentLibrary.bind(document,t,(function(e){if(!_.currentlyDragging&&H==C.CANVAS){for(var n in T)for(var i=T[n],r=0;r<i.length;r++){if(i[r].connector[t](e))return}for(var o in A){var a=A[o];for(r=0;r<a.length;r++)if(a[r].endpoint[t](e))return}}}))};t("click"),t("dblclick"),t("mousemove"),t("mousedown"),t("mouseup"),t("contextmenu"),j=!0,_.fire("ready")}},this.log=P,this.jsPlumbUIComponent=v,this.makeAnchor=function(){if(0==arguments.length)return null;var t=arguments[0],e=arguments[1],n=null;if(t.compute&&t.getOrientation)return t;if("string"==typeof t)n=C.Anchors[arguments[0]]({elementId:e,jsPlumbInstance:_});else if(s(t))if(s(t[0])||l(t[0]))if(2==t.length&&l(t[0])&&u(t[1])){var i=C.extend({elementId:e,jsPlumbInstance:_},t[1]);n=C.Anchors[t[0]](i)}else n=new At(t,null,e);else{var r={x:t[0],y:t[1],orientation:t.length>=4?[t[2],t[3]]:[0,0],offsets:6==t.length?[t[4],t[5]]:[0,0],elementId:e};(n=new jt(r)).clone=function(){return new jt(r)}}return n.id||(n.id="anchor_"+W()),n},this.makeAnchors=function(t,e,n){for(var i=[],r=0;r<t.length;r++)"string"==typeof t[r]?i.push(C.Anchors[t[r]]({elementId:e,jsPlumbInstance:n})):s(t[r])&&i.push(_.makeAnchor(t[r],e,n));return i},this.makeDynamicAnchor=function(t,e){return new At(t,e)};var gt={},mt={},vt={},yt={},bt=function(t,e){t.paintStyle=t.paintStyle||_.Defaults.EndpointStyles[e]||_.Defaults.EndpointStyle||C.Defaults.EndpointStyles[e]||C.Defaults.EndpointStyle,t.hoverPaintStyle=t.hoverPaintStyle||_.Defaults.EndpointHoverStyles[e]||_.Defaults.EndpointHoverStyle||C.Defaults.EndpointHoverStyles[e]||C.Defaults.EndpointHoverStyle,t.anchor=t.anchor||_.Defaults.Anchors[e]||_.Defaults.Anchor||C.Defaults.Anchors[e]||C.Defaults.Anchor,t.endpoint=t.endpoint||_.Defaults.Endpoints[e]||_.Defaults.Endpoint||C.Defaults.Endpoints[e]||C.Defaults.Endpoint};this.makeTarget=function(t,e,n){var i=C.extend({_jsPlumb:_},n);C.extend(i,e),bt(i,1);for(var r=C.CurrentLibrary,o=i.scope||_.Defaults.Scope,a=!(!1===i.deleteEndpointsOnDetach),s=i.maxConnections||-1,l=function(t){var e=lt(t);gt[e]=i,vt[e]=i.uniqueEndpoint,yt[e]=s,Mt[e]=!0,proxyComponent=new v(i);var n=C.extend({},i.dropOptions||{}),l=r.dragEvents.drop;n.scope=n.scope||o,n[l]=ut(n[l],(function(){var n=C.CurrentLibrary.getDropEvent(arguments),o=_.select({target:e}).length;if(!Mt[e]||yt[e]>0&&o>=yt[e])return console.log("target element "+e+" is full."),!1;_.currentlyDragging=!1;var s=h(r.getDragObject(arguments)),l=c(s,"dragId"),u=c(s,"originalScope"),d=O[l],f=d.endpoints[0];i.endpoint&&C.extend({},i.endpoint);f.anchor.locked=!1,u&&r.setDragScope(s,u);var p=proxyComponent.isDropAllowed(d.sourceId,lt(t),d.scope,d,null);if(d.endpointsToDeleteOnDetach&&(f===d.endpointsToDeleteOnDetach[0]?d.endpointsToDeleteOnDetach[0]=null:f===d.endpointsToDeleteOnDetach[1]&&(d.endpointsToDeleteOnDetach[1]=null)),d.suspendedEndpoint&&(d.targetId=d.suspendedEndpoint.elementId,d.target=r.getElementObject(d.suspendedEndpoint.elementId),d.endpoints[1]=d.suspendedEndpoint),p){f.detach(d,!1,!0,!1);var g=mt[e]||_.addEndpoint(t,i);if(i.uniqueEndpoint&&(mt[e]=g),g._makeTargetCreator=!0,null!=g.anchor.positionFinder){var m=r.getUIPosition(arguments),v=r.getOffset(t),y=r.getSize(t),b=g.anchor.positionFinder(m,v,y,g.anchor.constructorParams);g.anchor.x=b[0],g.anchor.y=b[1]}var x=_.connect({source:f,target:g,scope:u,previousConnection:d,container:d.parent,deleteEndpointsOnDetach:a,doNotFireConnectionEvent:f.endpointWillMoveAfterConnection});d.endpoints[1]._makeTargetCreator&&d.endpoints[1].connections.length<2&&_.deleteEndpoint(d.endpoints[1]),a&&(x.endpointsToDeleteOnDetach=[f,g]),x.repaint()}else d.suspendedEndpoint&&(f.isReattach?(d.setHover(!1),d.floatingAnchorIndex=null,d.suspendedEndpoint.addConnection(d),_.repaint(f.elementId)):f.detach(d,!1,!0,!0,n))})),r.initDroppable(t,n,!0)},u=(t=$(t)).length&&t.constructor!=String?t:[t],d=0;d<u.length;d++)l(h(u[d]));return _},this.unmakeTarget=function(t,e){t=C.CurrentLibrary.getElementObject(t);var n=lt(t);return e||(delete gt[n],delete vt[n],delete yt[n],delete Mt[n]),_},this.makeTargets=function(t,e,n){for(var i=0;i<t.length;i++)_.makeTarget(t[i],e,n)};var xt={},wt={},Ct={},_t={},Et={},Mt={};this.makeSource=function(t,e,n){var i=C.extend({},n);C.extend(i,e),bt(i,0);for(var r=C.CurrentLibrary,a=function(t){var n=lt(t),a=i.parent,s=null!=a?_.getId(r.getElementObject(a)):n;xt[s]=i,Ct[s]=i.uniqueEndpoint,_t[s]=!0;var l=r.dragEvents.stop,u=r.dragEvents.drag,c=C.extend({},i.dragOptions||{}),d=c.drag,h=c.stop,f=null,p=!1;c.scope=c.scope||i.scope,c[u]=ut(c[u],(function(){d&&d.apply(this,arguments),p=!1})),c[l]=ut(c[l],(function(){if(h&&h.apply(this,arguments),_.currentlyDragging=!1,0==f.connections.length)_.deleteEndpoint(f);else{r.unbind(f.canvas,"mousedown");var t=i.anchor||_.Defaults.Anchor,e=(f.anchor,f.connections[0]);if(f.anchor=_.makeAnchor(t,n,_),i.parent){var a=r.getElementObject(i.parent);if(a){var s=f.elementId,l=i.container||_.Defaults.Container||C.Defaults.Container;f.setElement(a,l),f.endpointWillMoveAfterConnection=!1,_.anchorManager.rehomeEndpoint(s,a),e.previousConnection=null,o(T[e.scope],(function(t){return t.id===e.id})),_.anchorManager.connectionDetached({sourceId:e.sourceId,targetId:e.targetId,connection:e}),K(e)}}f.repaint(),_.repaint(f.elementId),_.repaint(e.targetId)}}));var g=function(o){if(_t[s]){if(e.filter)if(!1===e.filter(r.getOriginalEvent(o),t))return;var a=at({elId:n}),l=((o.pageX||o.page.x)-a.left)/a.width,u=((o.pageY||o.page.y)-a.top)/a.height,d=l,h=u;if(i.parent){var g=r.getElementObject(i.parent),m=lt(g);a=at({elId:m}),d=((o.pageX||o.page.x)-a.left)/a.width,h=((o.pageY||o.page.y)-a.top)/a.height}var v={};if(C.extend(v,i),v.isSource=!0,v.anchor=[l,u,0,0],v.parentAnchor=[d,h,0,0],v.dragOptions=c,i.parent){var y=v.container||_.Defaults.Container||C.Defaults.Container;v.container=y||C.CurrentLibrary.getParent(i.parent)}f=_.addEndpoint(n,v),p=!0,f.endpointWillMoveAfterConnection=null!=i.parent,f.endpointWillMoveTo=i.parent?r.getElementObject(i.parent):null;var b=function(){p&&_.deleteEndpoint(f)};_.registerListener(f.canvas,"mouseup",b),_.registerListener(t,"mouseup",b),r.trigger(f.canvas,"mousedown",o)}};_.registerListener(t,"mousedown",g),Et[n]=g},s=(t=$(t)).length&&t.constructor!=String?t:[t],l=0;l<s.length;l++)a(h(s[l]));return _},this.unmakeSource=function(t,e){t=C.CurrentLibrary.getElementObject(t);var n=lt(t),i=Et[n];return i&&_.unregisterListener(_el,"mousedown",i),e||(delete xt[n],delete Ct[n],delete _t[n],delete Et[n]),_},this.unmakeEverySource=function(){for(var t in _t)_.unmakeSource(t,!0);xt={},Ct={},_t={},Et={}},this.unmakeEveryTarget=function(){for(var t in Mt)_.unmakeTarget(t,!0);return gt={},vt={},yt={},Mt={},_},this.makeSources=function(t,e,n){for(var i=0;i<t.length;i++)_.makeSource(t[i],e,n);return _};var St=function(t,e,n,i){var r="source"==t?_t:Mt;if(l(e))r[e]=i?!r[e]:n;else if(e.length){e=$(e);for(var o=0;o<e.length;o++){var a=_el=C.CurrentLibrary.getElementObject(e[o]);r[a=lt(_el)]=i?!r[a]:n}}return _};this.setSourceEnabled=function(t,e){return St("source",t,e)},this.toggleSourceEnabled=function(t){return St("source",t,null,!0),_.isSourceEnabled(t)},this.isSource=function(t){return t=C.CurrentLibrary.getElementObject(t),null!=_t[lt(t)]},this.isSourceEnabled=function(t){return t=C.CurrentLibrary.getElementObject(t),!0===_t[lt(t)]},this.setTargetEnabled=function(t,e){return St("target",t,e)},this.toggleTargetEnabled=function(t){return St("target",t,null,!0)},this.isTarget=function(t){return t=C.CurrentLibrary.getElementObject(t),null!=Mt[lt(t)]},this.isTargetEnabled=function(t){return t=C.CurrentLibrary.getElementObject(t),!0===Mt[lt(t)]},this.ready=function(t){_.bind("ready",t)},this.repaint=function(t){var e=function(t){q(h(t))};if("object"==typeof t)for(var n=0;n<t.length;n++)e(t[n]);else e(t)},this.repaintEverything=function(){for(var t in A)q(h(t),null,null)},this.removeAllEndpoints=function(t){var e=c(t,"id"),n=A[e];if(n)for(var i=0;i<n.length;i++)_.deleteEndpoint(n[i]);A[e]=[]},this.removeEveryEndpoint=this.deleteEveryEndpoint,this.removeEndpoint=function(t,e){_.deleteEndpoint(e)};var Dt={};this.registerListener=function(t,e,n){C.CurrentLibrary.bind(t,e,n),F(Dt,e,{el:t,event:e,listener:n})},this.unregisterListener=function(t,e,n){C.CurrentLibrary.unbind(t,e,n),o(Dt,(function(t){return t.type==e&&t.listener==n}))},this.reset=function(){_.deleteEveryEndpoint(),_.unbind(),gt={},mt={},vt={},yt={},xt={},wt={},Ct={},function(){for(var t in Dt)for(var e=0;e<Dt[t].length;e++){var n=Dt[t][e];C.CurrentLibrary.unbind(n.el,n.event,n.listener)}Dt={}}(),_.anchorManager.reset(),_.dragManager.reset()},this.setDefaultScope=function(t){R=t},this.setDraggable=function(t,e){return G(t,(function(t,n){N[n]=e,C.CurrentLibrary.isDragSupported(t)&&C.CurrentLibrary.setDraggable(t,e)}))},this.setId=function(t,e,n){var i=t.constructor==String?t:_.getId(t),r=_.getConnections({source:i,scope:"*"},!0),o=_.getConnections({target:i,scope:"*"},!0);e=""+e,n||(t=C.CurrentLibrary.getElementObject(i),C.CurrentLibrary.setAttribute(t,"id",e)),t=C.CurrentLibrary.getElementObject(e),A[e]=A[i]||[];for(var a=0;a<A[e].length;a++)A[e][a].elementId=e,A[e][a].element=t,A[e][a].anchor.elementId=e;delete A[i],_.anchorManager.changeId(i,e);var s=function(n,i,r){for(var o=0;o<n.length;o++)n[o].endpoints[i].elementId=e,n[o].endpoints[i].element=t,n[o][r+"Id"]=e,n[o][r]=t};s(r,0,"source"),s(o,1,"target")},this.setIdChanged=function(t,e){_.setId(t,e,!0)},this.setDebugLog=function(t){P=t},this.setRepaintFunction=function(t){t},this.setSuspendDrawing=function(t,e){U=t,e&&_.repaintEverything()},this.CANVAS="canvas",this.SVG="svg",this.VML="vml",this.setRenderMode=function(i){if(i){if((i=i.toLowerCase())!==C.CANVAS&&i!==C.SVG&&i!==C.VML)throw new Error("render mode must be one of jsPlumb.CANVAS, jsPlumb.SVG or jsPlumb.VML");return i===C.SVG?e?H=C.SVG:t?H=C.CANVAS:n()&&(H=C.VML):i===C.CANVAS&&t?H=C.CANVAS:n()&&(H=C.VML),H}},this.getRenderMode=function(){return H},this.show=function(t,e){rt(t,"block",e)},this.sizeCanvas=function(t,e,n,i,r){t&&(t.style.height=r+"px",t.height=r,t.style.width=i+"px",t.width=i,t.style.left=e+"px",t.style.top=n+"px")},this.getTestHarness=function(){return{endpointsByElement:A,endpointCount:function(t){var e=A[t];return e?e.length:0},connectionCount:function(t){var e=T[t=t||R];return e?e.length:0},getId:lt,makeAnchor:self.makeAnchor,makeDynamicAnchor:self.makeDynamicAnchor}},this.toggle=ot,this.toggleVisible=ot,this.toggleDraggable=function(t){return G(t,(function(t,e){var n=null!=N[e]&&N[e];return n=!n,N[e]=n,C.CurrentLibrary.setDraggable(t,n),n}))},this.unload=function(){},this.wrap=ut,this.addListener=this.bind;var Pt=function(t,e){var n=null,i=t;if("svg"===e.tagName.toLowerCase()&&e.parentNode?n=e.parentNode:e.offsetParent&&(n=e.offsetParent),null!=n){var r="body"===n.tagName.toLowerCase()?{left:0,top:0}:f(n),o="body"===n.tagName.toLowerCase()?{left:0,top:0}:{left:n.scrollLeft,top:n.scrollTop};i[0]=t[0]-r.left+o.left,i[1]=t[1]-r.top+o.top}return i},jt=function(t){var e=this;this.x=t.x||0,this.y=t.y||0,this.elementId=t.elementId;var n=t.orientation||[0,0],i=null;this.offsets=t.offsets||[0,0],e.timestamp=null,this.compute=function(t){var n=t.xy,r=t.wh,o=t.element,a=t.timestamp;return a&&a===e.timestamp||(i=[n[0]+e.x*r[0]+e.offsets[0],n[1]+e.y*r[1]+e.offsets[1]],i=Pt(i,o.canvas),e.timestamp=a),i},this.getOrientation=function(t){return n},this.equals=function(t){if(!t)return!1;var e=t.getOrientation(),n=this.getOrientation();return this.x==t.x&&this.y==t.y&&this.offsets[0]==t.offsets[0]&&this.offsets[1]==t.offsets[1]&&n[0]==e[0]&&n[1]==e[1]},this.getCurrentLocation=function(){return i}},Tt=function(t){var e=t.reference,n=t.referenceCanvas,i=p(h(n)),r=null,o=null;this.x=0,this.y=0,this.isFloating=!0,this.compute=function(t){var e=t.xy,n=t.element,r=[e[0]+i[0]/2,e[1]+i[1]/2];return r=Pt(r,n.canvas),o=r,r},this.getOrientation=function(t){if(r)return r;var n=e.getOrientation(t);return[0*Math.abs(n[0])*-1,0*Math.abs(n[1])*-1]},this.over=function(t){r=t.getOrientation()},this.out=function(){r=null},this.getCurrentLocation=function(){return o}},At=function(t,e,n){this.isSelective=!0,this.isDynamic=!0;for(var i=[],r=function(t){return t.constructor==jt?t:_.makeAnchor(t,n,_)},o=0;o<t.length;o++)i[o]=r(t[o]);this.addAnchor=function(t){i.push(r(t))},this.getAnchors=function(){return i},this.locked=!1;var a=i.length>0?i[0]:null,s=(i.length,this),l=function(t,e,n,i,r){var o=i[0]+t.x*r[0],a=i[1]+t.y*r[1];return Math.sqrt(Math.pow(e-o,2)+Math.pow(n-a,2))},u=e||function(t,e,n,i,r){for(var o=n[0]+i[0]/2,a=n[1]+i[1]/2,s=-1,u=1/0,c=0;c<r.length;c++){var d=l(r[c],o,a,t,e);d<u&&(s=c+0,u=d)}return r[s]};this.compute=function(t){var e=t.xy,n=t.wh,r=(t.timestamp,t.txy),o=t.twh;return s.locked||null==r||null==o||(t.timestamp=null,a=u(e,n,r,o,i),s.x=a.x,s.y=a.y),a.compute(t)},this.getCurrentLocation=function(){return null!=a?a.getCurrentLocation():null},this.getOrientation=function(t){return null!=a?a.getOrientation(t):[0,0]},this.over=function(t){null!=a&&a.over(t)},this.out=function(){null!=a&&a.out()}},kt={},It={},Lt={},Ot="horizontal",Nt="vertical",zt="diagonal",Rt="identity",Ht=function(t,e,n,i){if(t===e)return{orientation:Rt,a:["top","top"]};var r=Math.atan2(i.centery-n.centery,i.centerx-n.centerx),o=Math.atan2(n.centery-i.centery,n.centerx-i.centerx),a=n.left<=i.left&&n.right>=i.left||n.left<=i.right&&n.right>=i.right||n.left<=i.left&&n.right>=i.right||i.left<=n.left&&i.right>=n.right,s=n.top<=i.top&&n.bottom>=i.top||n.top<=i.bottom&&n.bottom>=i.bottom||n.top<=i.top&&n.bottom>=i.bottom||i.top<=n.top&&i.bottom>=n.bottom;if(a||s)return a?{orientation:Ot,a:n.top<i.top?["bottom","top"]:["top","bottom"],theta:r,theta2:o}:{orientation:Nt,a:n.left<i.left?["right","left"]:["left","right"],theta:r,theta2:o};var l=null;return i.left>n.left&&i.top>n.top?l=["right","top"]:i.left>n.left&&n.top>i.top?l=["top","left"]:i.left<n.left&&i.top<n.top?l=["top","right"]:i.left<n.left&&i.top>n.top&&(l=["left","top"]),{orientation:zt,a:l,theta:r,theta2:o}},Ft=function(t){return function(e,n){return!1===(t?e[0][0]<n[0][0]||e[0][1]>n[0][1]:e[0][0]>n[0][0]||e[0][1]>n[0][1])?-1:1}},Vt={top:function(t,e){return t[0]>e[0]?1:-1},right:Ft(!0),bottom:Ft(!0),left:function(t,e){return(t[0][0]<0?-Math.PI-t[0][0]:Math.PI-t[0][0])>(e[0][0]<0?-Math.PI-e[0][0]:Math.PI-e[0][0])||t[0][1]>e[0][1]?1:-1}},Bt=function(t,e){var n=z[t],i=I[t],r=function(e,n,i,r,o,a,s){if(r.length>0)for(var l=function(t,e){return t.sort(e)}(r,Vt[e]),u=function(t,e,n,i,r,o,a){for(var s=[],l=e[r?0:1]/(i.length+1),u=0;u<i.length;u++){var c=(u+1)*l,d=o*e[r?1:0];a&&(c=e[r?0:1]-c);var h=r?c:d,f=n[0]+h,p=h/e[0],g=r?d:c,m=n[1]+g,v=g/e[1];s.push([f,m,p,v,i[u][1],i[u][2]])}return s}(0,n,i,l,o,a,"right"===e||"top"===e),c=function(t,e){var n=Pt([e[0],e[1]],t.canvas);It[t.id]=[n[0],n[1],e[2],e[3]],Lt[t.id]=s},d=0;d<u.length;d++){var h=u[d][4],f=h.endpoints[0].elementId===t,p=h.endpoints[1].elementId===t;f?c(h.endpoints[0],u[d]):p&&c(h.endpoints[1],u[d])}};r("bottom",n,[i.left,i.top],e.bottom,!0,1,[0,1]),r("top",n,[i.left,i.top],e.top,!0,0,[0,-1]),r("left",n,[i.left,i.top],e.left,!1,0,[-1,0]),r("right",n,[i.left,i.top],e.right,!1,1,[1,0])};_.anchorManager=new function(){var t={},e={},n=this,r={};this.reset=function(){t={},e={},r={}},this.newConnection=function(t){var n=t.sourceId,i=t.targetId,r=t.endpoints,o=!0,a=function(t,a,s,l,u){n==i&&s.isContinuous&&(C.CurrentLibrary.removeElement(r[1].canvas),o=!1),F(e,l,[u,a,s.constructor==At])};a(0,r[0],r[0].anchor,i,t),o&&a(0,r[1],r[1].anchor,n,t)},this.connectionDetached=function(t){var i=t.connection||t,a=i.sourceId,s=i.targetId,l=i.endpoints,u=function(t,n,i,r,a){i.constructor==Tt||o(e[r],(function(t){return t[0].id==a.id}))};u(0,l[1],l[1].anchor,a,i),u(0,l[0],l[0].anchor,s,i);var c=i.sourceId,d=i.targetId,h=i.endpoints[0].id,f=i.endpoints[1].id,p=function(t,e){if(t){var n=function(t){return t[4]==e};o(t.top,n),o(t.left,n),o(t.bottom,n),o(t.right,n)}};p(r[c],h),p(r[d],f),n.redraw(c),n.redraw(d)},this.add=function(e,n){F(t,n,e)},this.changeId=function(n,i){e[i]=e[n],t[i]=t[n],delete e[n],delete t[n]},this.getConnectionsFor=function(t){return e[t]||[]},this.getEndpointsFor=function(e){return t[e]||[]},this.deleteEndpoint=function(e){o(t[e.elementId],(function(t){return t.id==e.id}))},this.clearFor=function(e){delete t[e],t[e]=[]};var s=function(t,e,n,r,o,s,l,u,c,d,h,f){var p=-1,g=r.endpoints[l],m=g.id,v=[[e,n],r,o,s,m],y=t[c],b=g._continuousAnchorEdge?t[g._continuousAnchorEdge]:null;if(b){var x=i(b,(function(t){return t[4]==m}));if(-1!=x){b.splice(x,1);for(var w=0;w<b.length;w++)a(h,b[w][1],(function(t){return t.id==b[w][1].id})),a(f,b[w][1].endpoints[l],(function(t){return t.id==b[w][1].endpoints[l].id}))}}for(w=0;w<y.length;w++)1==l&&y[w][3]===s&&-1==p&&(p=w),a(h,y[w][1],(function(t){return t.id==y[w][1].id})),a(f,y[w][1].endpoints[l],(function(t){return t.id==y[w][1].endpoints[l].id}));var C=u?-1!=p?p:0:y.length;y.splice(C,0,v),g._continuousAnchorEdge=c};this.redraw=function(n,i,o,l){var u=t[n]||[],c=e[n]||[],d=[],h=[],f=[];o=o||m(),l=l||{left:0,top:0},i&&(i={left:i.left+l.left,top:i.top+l.top}),at({elId:n,offset:i,recalc:!1,timestamp:o});for(var p=I[n],g=z[n],v={},y=0;y<c.length;y++){var b=c[y][0],x=b.sourceId,w=b.targetId,C=b.endpoints[0].anchor.isContinuous,_=b.endpoints[1].anchor.isContinuous;if(C||_){var E=x+"_"+w,M=v[E],S=b.sourceId==n?1:0;C&&!r[x]&&(r[x]={top:[],right:[],bottom:[],left:[]}),_&&!r[w]&&(r[w]={top:[],right:[],bottom:[],left:[]}),n!=w&&at({elId:w,timestamp:o}),n!=x&&at({elId:x,timestamp:o});var D=st(w),P=st(x);w==x&&(C||_)?s(r[x],-Math.PI/2,0,b,!1,w,0,!1,"top",0,d,h):(M||(M=Ht(x,w,P.o,D.o),v[E]=M),C&&s(r[x],M.theta,0,b,!1,w,0,!1,M.a[0],0,d,h),_&&s(r[w],M.theta2,-1,b,!0,x,1,!0,M.a[1],0,d,h)),C&&a(f,x,(function(t){return t===x})),_&&a(f,w,(function(t){return t===w})),a(d,b,(function(t){return t.id==b.id})),(C&&0==S||_&&1==S)&&a(h,b.endpoints[S],(function(t){return t.id==b.endpoints[S].id}))}}for(y=0;y<f.length;y++)Bt(f[y],r[f[y]]);for(y=0;y<u.length;y++)u[y].paint({timestamp:o,offset:p,dimensions:g});for(y=0;y<h.length;y++)h[y].paint({timestamp:o,offset:p,dimensions:g});for(y=0;y<c.length;y++){var j=c[y][1];if(j.anchor.constructor==At){j.paint({elementWithPrecedence:n}),a(d,c[y][0],(function(t){return t.id==c[y][0].id}));for(var T=0;T<j.connections.length;T++)j.connections[T]!==c[y][0]&&a(d,j.connections[T],(function(t){return t.id==j.connections[T].id}))}else j.anchor.constructor==jt&&a(d,c[y][0],(function(t){return t.id==c[y][0].id}))}var A=O[n];A&&A.paint({timestamp:o,recalc:!1,elId:n});for(y=0;y<d.length;y++)d[y].paint({elId:n,timestamp:o,recalc:!1})},this.rehomeEndpoint=function(e,i){for(var r=t[e]||[],o=_.getId(i),a=0;a<r.length;a++)n.add(r[a],o);r.splice(0,r.length)}},_.continuousAnchorFactory={get:function(t){var e=kt[t.elementId];return e||(e={type:"Continuous",compute:function(t){return It[t.element.id]||[0,0]},getCurrentLocation:function(t){return It[t.id]||[0,0]},getOrientation:function(t){return Lt[t.id]||[0,0]},isDynamic:!0,isContinuous:!0},kt[t.elementId]=e),e}};_.dragManager=new function(){var t={},e=[],n={},i={};this.register=function(r){var o=C.CurrentLibrary;r=o.getElementObject(r);var a=_.getId(r),s=o.getDOMElement(r);t[a]||(t[a]=r,e.push(r),n[a]={});!function(t){for(var e=o.getElementObject(t),r=o.getOffset(e),s=0;s<t.childNodes.length;s++)if(3!=t.childNodes[s].nodeType){var l=o.getElementObject(t.childNodes[s]),u=_.getId(l,null,!0);if(u&&i[u]&&i[u]>0){var c=o.getOffset(l);n[a][u]={id:u,offset:{left:c.left-r.left,top:c.top-r.top}}}}}(s)},this.endpointAdded=function(e){var r=C.CurrentLibrary,o=document.body,a=_.getId(e),s=r.getDOMElement(e).parentNode;for(i[a]=i[a]?i[a]+1:1;s!=o;){var l=_.getId(s);if(t[l]){var u=r.getElementObject(s),c=r.getOffset(u);if(null==n[l][a]){var d=C.CurrentLibrary.getOffset(e);n[l][a]={id:a,offset:{left:d.left-c.left,top:d.top-c.top}}}break}s=s.parentNode}},this.endpointDeleted=function(t){if(i[t.elementId]&&(i[t.elementId]--,i[t.elementId]<=0))for(var e in n)delete n[e][t.elementId]},this.getElementsForDraggable=function(t){return n[t]},this.reset=function(){t={},e=[],n={},i={}}};var Wt=function(t){var e=this,n=!0;e.idPrefix="_jsplumb_c_",e.defaultLabelLocation=.5,e.defaultOverlayKeys=["Overlays","ConnectionOverlays"],this.parent=t.parent,y.apply(this,arguments),this.isVisible=function(){return n},this.setVisible=function(t){n=t,e[t?"showOverlays":"hideOverlays"](),e.connector&&e.connector.canvas&&(e.connector.canvas.style.display=t?"block":"none")},this.source=h(t.source),this.target=h(t.target),t.sourceEndpoint&&(this.source=t.sourceEndpoint.endpointWillMoveTo||t.sourceEndpoint.getElement()),t.targetEndpoint&&(this.target=t.targetEndpoint.getElement()),e.previousConnection=t.previousConnection;var i=t.cost;e.getCost=function(){return i},e.setCost=function(t){i=t};var r=!1!==t.bidirectional;e.isBidirectional=function(){return r},this.sourceId=c(this.source,"id"),this.targetId=c(this.target,"id"),this.getAttachedElements=function(){return e.endpoints},this.scope=t.scope,this.endpoints=[],this.endpointStyles=[];var o=function(t,e){if(t)return _.makeAnchor(t,e,_)},a=function(t,n,i,r,a,s,l){if(!t){i.endpoints||(i.endpoints=[null,null]);var u=i.endpoints[n]||i.endpoint||_.Defaults.Endpoints[n]||C.Defaults.Endpoints[n]||_.Defaults.Endpoint||C.Defaults.Endpoint;i.endpointStyles||(i.endpointStyles=[null,null]),i.endpointHoverStyles||(i.endpointHoverStyles=[null,null]);var c=i.endpointStyles[n]||i.endpointStyle||_.Defaults.EndpointStyles[n]||C.Defaults.EndpointStyles[n]||_.Defaults.EndpointStyle||C.Defaults.EndpointStyle;null==c.fillStyle&&null!=s&&(c.fillStyle=s.strokeStyle),null==c.outlineColor&&null!=s&&(c.outlineColor=s.outlineColor),null==c.outlineWidth&&null!=s&&(c.outlineWidth=s.outlineWidth);var d=i.endpointHoverStyles[n]||i.endpointHoverStyle||_.Defaults.EndpointHoverStyles[n]||C.Defaults.EndpointHoverStyles[n]||_.Defaults.EndpointHoverStyle||C.Defaults.EndpointHoverStyle;null!=l&&(null==d&&(d={}),null==d.fillStyle&&(d.fillStyle=l.strokeStyle));var h=i.anchors?i.anchors[n]:i.anchor?i.anchor:o(_.Defaults.Anchors[n],a)||o(C.Defaults.Anchors[n],a)||o(_.Defaults.Anchor,a)||o(C.Defaults.Anchor,a),f=i.uuids?i.uuids[n]:null,p=tt({paintStyle:c,hoverPaintStyle:d,endpoint:u,connections:[e],uuid:f,anchor:h,source:r,scope:i.scope,container:i.container,reattach:i.reattach,detachable:i.detachable});return e.endpoints[n]=p,!1===i.drawEndpoints&&p.setVisible(!1,!0,!0),p}e.endpoints[n]=t,t.addConnection(e)},u=a(t.sourceEndpoint,0,t,e.source,e.sourceId,t.paintStyle,t.hoverPaintStyle);u&&F(A,this.sourceId,u);var d=a(e.sourceId==e.targetId&&null==t.targetEndpoint?u:t.targetEndpoint,1,t,e.target,e.targetId,t.paintStyle,t.hoverPaintStyle);d&&F(A,this.targetId,d),this.scope||(this.scope=this.endpoints[0].scope),t.deleteEndpointsOnDetach&&(e.endpointsToDeleteOnDetach=[u,d]);var f=_.Defaults.ConnectionsDetachable;!1===t.detachable&&(f=!1),!1===e.endpoints[0].connectionsDetachable&&(f=!1),!1===e.endpoints[1].connectionsDetachable&&(f=!1),null==i&&(i=e.endpoints[0].getConnectionCost()),null==t.bidirectional&&(r=e.endpoints[0].areConnectionsBidirectional()),this.isDetachable=function(){return!0===f},this.setDetachable=function(t){f=!0===t};var p=C.extend({},this.endpoints[0].getParameters());C.extend(p,this.endpoints[1].getParameters()),C.extend(p,e.getParameters()),e.setParameters(p);var g=e.setHover;e.setHover=function(t){e.connector.setHover.apply(e.connector,arguments),g.apply(e,arguments)};var v=function(t){e.setHover(t,!1)};this.setConnector=function(n,i){null!=e.connector&&it(e.connector.getDisplayElements(),e.parent);var r={_jsPlumb:e._jsPlumb,parent:t.parent,cssClass:t.cssClass,container:t.container,tooltip:e.tooltip};l(n)?this.connector=new C.Connectors[H][n](r):s(n)&&(this.connector=new C.Connectors[H][n[0]](C.extend(n[1],r))),e.canvas=e.connector.canvas,b(e.connector,e,v),i||e.repaint()},e.setConnector(this.endpoints[0].connector||this.endpoints[1].connector||t.connector||_.Defaults.Connector||C.Defaults.Connector,!0),this.setPaintStyle(this.endpoints[0].connectorStyle||this.endpoints[1].connectorStyle||t.paintStyle||_.Defaults.PaintStyle||C.Defaults.PaintStyle,!0),this.setHoverPaintStyle(this.endpoints[0].connectorHoverStyle||this.endpoints[1].connectorHoverStyle||t.hoverPaintStyle||_.Defaults.HoverPaintStyle||C.Defaults.HoverPaintStyle,!0),this.paintStyleInUse=this.getPaintStyle(),this.moveParent=function(t){var n=C.CurrentLibrary,i=n.getParent(e.connector.canvas);e.connector.bgCanvas&&(n.removeElement(e.connector.bgCanvas,i),n.appendElement(e.connector.bgCanvas,t)),n.removeElement(e.connector.canvas,i),n.appendElement(e.connector.canvas,t);for(var r=0;r<e.overlays.length;r++)e.overlays[r].isAppendedAtTopLevel&&(n.removeElement(e.overlays[r].canvas,i),n.appendElement(e.overlays[r].canvas,t),e.overlays[r].reattachListeners&&e.overlays[r].reattachListeners(e.connector));e.connector.reattachListeners&&e.connector.reattachListeners()},at({elId:this.sourceId}),at({elId:this.targetId});var x=I[this.sourceId],w=z[this.sourceId],E=I[this.targetId],M=z[this.targetId],S=m(),D=this.endpoints[0].anchor.compute({xy:[x.left,x.top],wh:w,element:this.endpoints[0],elementId:this.endpoints[0].elementId,txy:[E.left,E.top],twh:M,tElement:this.endpoints[1],timestamp:S});this.endpoints[0].paint({anchorLoc:D,timestamp:S}),D=this.endpoints[1].anchor.compute({xy:[E.left,E.top],wh:M,element:this.endpoints[1],elementId:this.endpoints[1].elementId,txy:[x.left,x.top],twh:w,tElement:this.endpoints[0],timestamp:S}),this.endpoints[1].paint({anchorLoc:D,timestamp:S}),this.paint=function(t){for(var n=(t=t||{}).elId,i=t.ui,r=t.recalc,o=t.timestamp,a=this.targetId,s=(this.sourceId,at({elId:n,offset:i,recalc:r,timestamp:o})),l=at({elId:a,timestamp:o}),u=this.endpoints[0],c=this.endpoints[1],d=u.anchor.getCurrentLocation(u),h=c.anchor.getCurrentLocation(c),f=0,p=0;p<e.overlays.length;p++){(m=e.overlays[p]).isVisible()&&(f=Math.max(f,m.computeMaxSize(e.connector)))}var g=this.connector.compute(d,h,this.endpoints[0],this.endpoints[1],this.endpoints[0].anchor,this.endpoints[1].anchor,e.paintStyleInUse.lineWidth,f,s,l);e.connector.paint(g,e.paintStyleInUse);for(p=0;p<e.overlays.length;p++){var m;(m=e.overlays[p]).isVisible&&(e.overlayPlacements[p]=m.draw(e.connector,e.paintStyleInUse,g))}},this.repaint=function(t){var e=!(!1===(t=t||{}).recalc);this.paint({elId:this.sourceId,recalc:e,timestamp:t.timestamp})}},$t=function(t){var e=this;e.idPrefix="_jsplumb_e_",e.defaultLabelLocation=[.5,.5],e.defaultOverlayKeys=["Overlays","EndpointOverlays"],this.parent=t.parent,y.apply(this,arguments);var n=!0,r=!(!1===(t=t||{}).enabled);this.isVisible=function(){return n},this.setVisible=function(t,i,r){if(n=t,e.canvas&&(e.canvas.style.display=t?"block":"none"),e[t?"showOverlays":"hideOverlays"](),!i)for(var o=0;o<e.connections.length;o++)if(e.connections[o].setVisible(t),!r){var a=e===e.connections[o].endpoints[0]?1:0;1==e.connections[o].endpoints[a].connections.length&&e.connections[o].endpoints[a].setVisible(t,!0,!0)}},this.isEnabled=function(){return r},this.setEnabled=function(t){r=t};var a=t.source,u=t.uuid,f=null,p=null;u&&(k[u]=e);var g=c(a,"id");this.elementId=g,this.element=a;var m=t.connectionCost;this.getConnectionCost=function(){return m},this.setConnectionCost=function(t){m=t};var v=!1!==t.connectionsBidirectional;this.areConnectionsBidirectional=function(){return v},this.setConnectionsBidirectional=function(t){v=t},e.anchor=t.anchor?_.makeAnchor(t.anchor,g,_):t.anchors?_.makeAnchor(t.anchors,g,_):_.makeAnchor("TopCenter",g,_),t._transient||_.anchorManager.add(e,g);var x=null;this.setEndpoint=function(n){var i={_jsPlumb:e._jsPlumb,parent:t.parent,container:t.container,tooltip:t.tooltip,connectorTooltip:t.connectorTooltip,endpoint:e};l(n)?x=new C.Endpoints[H][n](i):s(n)?(i=C.extend(n[1],i),x=new C.Endpoints[H][n[0]](i)):x=n.clone();var r=C.extend({},i);x.clone=function(){var t=new Object;return x.constructor.apply(t,[r]),t},e.endpoint=x,e.type=e.endpoint.type},this.setEndpoint(t.endpoint||_.Defaults.Endpoint||C.Defaults.Endpoint||"Dot");var w=e.setHover;e.setHover=function(){e.endpoint.setHover.apply(e.endpoint,arguments),w.apply(e,arguments)};b(e.endpoint,e,(function(t){e.connections.length>0?e.connections[0].setHover(t,!1):e.setHover(t)})),this.setPaintStyle(t.paintStyle||t.style||_.Defaults.EndpointStyle||C.Defaults.EndpointStyle,!0),this.setHoverPaintStyle(t.hoverPaintStyle||_.Defaults.EndpointHoverStyle||C.Defaults.EndpointHoverStyle,!0),this.paintStyleInUse=this.getPaintStyle();var E=this.getPaintStyle();this.connectorStyle=t.connectorStyle,this.connectorHoverStyle=t.connectorHoverStyle,this.connectorOverlays=t.connectorOverlays,this.connector=t.connector,this.connectorTooltip=t.connectorTooltip,this.isSource=t.isSource||!1,this.isTarget=t.isTarget||!1;var M=t.maxConnections||_.Defaults.MaxConnections;this.getAttachedElements=function(){return e.connections},this.canvas=this.endpoint.canvas,this.connections=t.connections||[],this.scope=t.scope||R,this.timestamp=null,e.isReattach=t.reattach||!1,e.connectionsDetachable=_.Defaults.ConnectionsDetachable,!1!==t.connectionsDetachable&&!1!==t.detachable||(e.connectionsDetachable=!1);var S=t.dragAllowedWhenFull||!0;this.computeAnchor=function(t){return e.anchor.compute(t)},this.addConnection=function(t){e.connections.push(t)},this.detach=function(t,n,r,a,s){var l=i(e.connections,(function(e){return e.id==t.id})),u=!1;if(a=!1!==a,l>=0&&(r||t._forceDetach||t.isDetachable()||t.isDetachAllowed(t))){var c=t.endpoints[0]==e?t.endpoints[1]:t.endpoints[0];if(r||t._forceDetach||e.isDetachAllowed(t)){if(e.connections.splice(l,1),!n&&(c.detach(t,!0,r),t.endpointsToDeleteOnDetach))for(var d=0;d<t.endpointsToDeleteOnDetach.length;d++){var h=t.endpointsToDeleteOnDetach[d];h&&0==h.connections.length&&_.deleteEndpoint(h)}it(t.connector.getDisplayElements(),t.parent),o(T[t.scope],(function(e){return e.id==t.id})),u=!0,ct(t,!n&&a,s)}}return u},this.detachAll=function(t,n){for(;e.connections.length>0;)e.detach(e.connections[0],!1,!0,t,n)},this.detachFrom=function(t,n,i){for(var r=[],o=0;o<e.connections.length;o++)e.connections[o].endpoints[1]!=t&&e.connections[o].endpoints[0]!=t||r.push(e.connections[o]);for(o=0;o<r.length;o++)e.detach(r[o],!1,!0,n,i)&&r[o].setHover(!1,!1)},this.detachFromConnection=function(t){var n=i(e.connections,(function(e){return e.id==t.id}));n>=0&&e.connections.splice(n,1)},this.getElement=function(){return a},this.setElement=function(t,n){var i=lt(t);o(A[e.elementId],(function(t){return t.id==e.id})),a=h(t),g=lt(a),e.elementId=g;var r=Z({source:i,container:n}),s=B.getParent(e.canvas);B.removeElement(e.canvas,s),B.appendElement(e.canvas,r);for(var l=0;l<e.connections.length;l++)e.connections[l].moveParent(r),e.connections[l].sourceId=g,e.connections[l].source=a;F(A,i,e)},this.getUuid=function(){return u},this.makeInPlaceCopy=function(){var t=e.anchor.getCurrentLocation(e),n=e.anchor.getOrientation(e);return tt({anchor:{compute:function(){return[t[0],t[1]]},getCurrentLocation:function(){return[t[0],t[1]]},getOrientation:function(){return n}},source:a,paintStyle:this.getPaintStyle(),endpoint:x,_transient:!0,scope:e.scope})},this.isConnectedTo=function(t){var n=!1;if(t)for(var i=0;i<e.connections.length;i++)if(e.connections[i].endpoints[1]==t){n=!0;break}return n},this.isFloating=function(){return null!=f},this.connectorSelector=function(){var t=e.connections[0];return e.isTarget&&t?t:e.connections.length<M||-1==M?null:t},this.isFull=function(){return!(e.isFloating()||M<1||e.connections.length<M)},this.setDragAllowedWhenFull=function(t){S=t},this.setStyle=e.setPaintStyle,this.equals=function(t){return this.anchor.equals(t.anchor)};if(this.paint=function(t){var n=(t=t||{}).timestamp,i=!(!1===t.recalc);if(!n||e.timestamp!==n){at({elId:g,timestamp:n,recalc:i});var r=t.offset||I[g];if(r){var o=t.anchorPoint,a=t.connectorPaintStyle;if(null==o){var s=t.dimensions||z[g];null!=r&&null!=s||(at({elId:g,timestamp:n}),r=I[g],s=z[g]);var l={xy:[r.left,r.top],wh:s,element:e,timestamp:n};if(i&&e.anchor.isDynamic&&e.connections.length>0){var u=function(t){var n=0;if(null!=t)for(var i=0;i<e.connections.length;i++)if(e.connections[i].sourceId==t||e.connections[i].targetId==t){n=i;break}return e.connections[n]}(t.elementWithPrecedence),c=u.endpoints[0]==e?1:0,d=0==c?u.sourceId:u.targetId,h=I[d],f=z[d];l.txy=[h.left,h.top],l.twh=f,l.tElement=u.endpoints[c]}o=e.anchor.compute(l)}var p=x.compute(o,e.anchor.getOrientation(e),e.paintStyleInUse,a||e.paintStyleInUse);x.paint(p,e.paintStyleInUse,e.anchor),e.timestamp=n;for(var m=0;m<e.overlays.length;m++){var v=e.overlays[m];v.isVisible&&(e.overlayPlacements[m]=v.draw(e.endpoint,e.paintStyleInUse,p))}}}},this.repaint=this.paint,this.removeConnection=this.detach,C.CurrentLibrary.isDragSupported(a)){var D={id:null,element:null},P=null,j=!1,L=null,N=function(t){var e=!1;return{drag:function(){if(e)return e=!1,!0;var n=C.CurrentLibrary.getUIPosition(arguments),i=t.element;i&&(C.CurrentLibrary.setOffset(i,n),q(h(i),n))},stopDrag:function(){e=!0}}}(D),B=C.CurrentLibrary,W=t.dragOptions||{},$=C.extend({},B.defaultDragOptions),U=B.dragEvents.start,G=B.dragEvents.stop,Y=B.dragEvents.drag;(W=C.extend($,W)).scope=W.scope||e.scope,W[U]=ut(W[U],(function(){P=e.connectorSelector();var n=!0;if(e.isEnabled()||(n=!1),null!=P||t.isSource||(n=!1),t.isSource&&e.isFull()&&!S&&(n=!1),null==P||P.isDetachable()||(n=!1),!1===n)return C.CurrentLibrary.stopDrag&&C.CurrentLibrary.stopDrag(),N.stopDrag(),!1;P&&!e.isFull()&&t.isSource&&(P=null),at({elId:g}),(p=e.makeInPlaceCopy()).paint(),function(t,e){var n=document.createElement("div");n.style.position="absolute";var i=h(n);V(n,e);var r=lt(i);at({elId:r}),t.id=r,t.element=i}(D,e.parent);var i=h(p.canvas),r=C.CurrentLibrary.getOffset(i),o=Pt([r.left,r.top],p.canvas);if(C.CurrentLibrary.setOffset(D.element,{left:o[0],top:o[1]}),e.parentAnchor&&(e.anchor=_.makeAnchor(e.parentAnchor,e.elementId,_)),d(h(e.canvas),"dragId",D.id),d(h(e.canvas),"elId",g),t.proxy&&e.setPaintStyle(t.proxy.paintStyle),f=function(t,e,n,i,r){var o=new Tt({reference:e,referenceCanvas:i});return tt({paintStyle:t,endpoint:n,anchor:o,source:r,scope:"__floating"})}(e.getPaintStyle(),e.anchor,x,e.canvas,D.element),null==P)e.anchor.locked=!0,e.setHover(!1,!1),P=Q({sourceEndpoint:e,targetEndpoint:f,source:e.endpointWillMoveTo||h(a),target:D.element,anchors:[e.anchor,f.anchor],paintStyle:t.connectorStyle,hoverPaintStyle:t.connectorHoverStyle,connector:t.connector,overlays:t.connectorOverlays});else{j=!0,P.connector.setHover(!1,!1),J(h(p.canvas),!1,!0);var s=P.endpoints[0].id==e.id?0:1;P.floatingAnchorIndex=s,e.detachFromConnection(P);var l=h(e.canvas),u=C.CurrentLibrary.getDragScope(l);d(l,"originalScope",u);var c=C.CurrentLibrary.getDropScope(l);C.CurrentLibrary.setDragScope(l,c),0==s?(L=[P.source,P.sourceId,X,u],P.source=D.element,P.sourceId=D.id):(L=[P.target,P.targetId,X,u],P.target=D.element,P.targetId=D.id),P.endpoints[0==s?1:0].anchor.locked=!0,P.suspendedEndpoint=P.endpoints[s],P.suspendedEndpoint.setHover(!1),P.endpoints[s]=f,function(t){_.fire("connectionDrag",t)}(P)}O[D.id]=P,f.addConnection(P),F(A,D.id,f),_.currentlyDragging=!0})),W[Y]=ut(W[Y],N.drag),W[G]=ut(W[G],(function(){var t=B.getDropEvent(arguments);_.currentlyDragging=!1,o(A[D.id],(function(t){return t.id==f.id})),it([D.element[0],f.canvas]),nt(p.canvas),_.anchorManager.clearFor(D.id);var n=null==P.floatingAnchorIndex?1:P.floatingAnchorIndex;P.endpoints[0==n?1:0].anchor.locked=!1,e.setPaintStyle(E),P.endpoints[n]==f&&(j&&P.suspendedEndpoint?(0==n?(P.source=L[0],P.sourceId=L[1]):(P.target=L[0],P.targetId=L[1]),C.CurrentLibrary.setDragScope(L[2],L[3]),P.endpoints[n]=P.suspendedEndpoint,(e.isReattach||P._forceDetach||!P.endpoints[0==n?1:0].detach(P,!1,!1,!0,t))&&(P.setHover(!1),P.floatingAnchorIndex=null,P.suspendedEndpoint.addConnection(P),_.repaint(L[1])),P._forceDetach=null):(it(P.connector.getDisplayElements(),e.parent),e.detachFromConnection(P))),e.anchor.locked=!1,e.paint({recalc:!1}),P.setHover(!1,!1),function(t){_.fire("connectionDragStop",t)}(P),P=null,p=null,delete A[f.elementId],f.anchor=null,f=null,_.currentlyDragging=!1}));var X=h(e.canvas);C.CurrentLibrary.initDraggable(X,W,!0)}var J=function(n,i,r,o){if((t.isTarget||i)&&C.CurrentLibrary.isDropSupported(a)){var s=t.dropOptions||_.Defaults.DropOptions||C.Defaults.DropOptions;(s=C.extend({},s)).scope=s.scope||e.scope;var l=C.CurrentLibrary.dragEvents.drop,u=C.CurrentLibrary.dragEvents.over,d=C.CurrentLibrary.dragEvents.out;s[l]=ut(s[l],(function(){var t=C.CurrentLibrary.getDropEvent(arguments),n=h(C.CurrentLibrary.getDragObject(arguments)),i=c(n,"dragId"),r=(c(n,"elId"),c(n,"originalScope")),a=O[i];if(null!=a){var s=null==a.floatingAnchorIndex?1:a.floatingAnchorIndex;r&&C.CurrentLibrary.setDragScope(n,r);var l=null==o||o.isEnabled();if(!e.isFull()&&(0!=s||e.isSource)&&(1!=s||e.isTarget)&&l){var u=!0;if(a.suspendedEndpoint&&a.suspendedEndpoint.id!=e.id&&(0==s?(a.source=a.suspendedEndpoint.element,a.sourceId=a.suspendedEndpoint.elementId):(a.target=a.suspendedEndpoint.element,a.targetId=a.suspendedEndpoint.elementId),a.isDetachAllowed(a)&&a.endpoints[s].isDetachAllowed(a)&&a.suspendedEndpoint.isDetachAllowed(a)&&_.checkCondition("beforeDetach",a)||(u=!1)),0==s?(a.source=e.element,a.sourceId=e.elementId):(a.target=e.element,a.targetId=e.elementId),u=u&&e.isDropAllowed(a.sourceId,a.targetId,a.scope,a,e)){a.endpoints[s].detachFromConnection(a),a.suspendedEndpoint&&a.suspendedEndpoint.detachFromConnection(a),a.endpoints[s]=e,e.addConnection(a);var d=e.getParameters();for(var f in d)a.setParameter(f,d[f]);if(a.suspendedEndpoint){var p=a.suspendedEndpoint.getElement(),g=a.suspendedEndpoint.elementId;ct({source:0==s?p:a.source,target:1==s?p:a.target,sourceId:0==s?g:a.sourceId,targetId:1==s?g:a.targetId,sourceEndpoint:0==s?a.suspendedEndpoint:a.endpoints[0],targetEndpoint:1==s?a.suspendedEndpoint:a.endpoints[1],connection:a},!0,t)}else d.draggable&&C.CurrentLibrary.initDraggable(e.element,W,!0);K(a,null,t)}else a.suspendedEndpoint&&(a.endpoints[s]=a.suspendedEndpoint,a.setHover(!1),a._forceDetach=!0,0==s?(a.source=a.suspendedEndpoint.element,a.sourceId=a.suspendedEndpoint.elementId):(a.target=a.suspendedEndpoint.element,a.targetId=a.suspendedEndpoint.elementId),a.suspendedEndpoint.addConnection(a),a.endpoints[0].repaint(),a.repaint(),_.repaint(a.source.elementId),a._forceDetach=!1);a.floatingAnchorIndex=null}_.currentlyDragging=!1,delete O[i]}})),s[u]=ut(s[u],(function(){if(e.isTarget){var t=C.CurrentLibrary.getDragObject(arguments),n=c(h(t),"dragId"),i=O[n];if(null!=i){var r=null==i.floatingAnchorIndex?1:i.floatingAnchorIndex;i.endpoints[r].anchor.over(e.anchor)}}})),s[d]=ut(s[d],(function(){if(e.isTarget){var t=C.CurrentLibrary.getDragObject(arguments),n=c(h(t),"dragId"),i=O[n];if(null!=i){var r=null==i.floatingAnchorIndex?1:i.floatingAnchorIndex;i.endpoints[r].anchor.out()}}})),C.CurrentLibrary.initDroppable(n,s,!0,r)}};return J(h(e.canvas),!0,!(t._transient||e.anchor.isFloating),e),e}},C=window.jsPlumb=new w;C.getInstance=function(t){var e=new w(t);return e.init(),e};var _=function(t,e,n,i,r,o){return function(a){var s=(a=a||{}).jsPlumbInstance.makeAnchor([t,e,n,i,0,0],a.elementId,a.jsPlumbInstance);return s.type=r,o&&o(s,a),s}};C.Anchors.TopCenter=_(.5,0,0,-1,"TopCenter"),C.Anchors.BottomCenter=_(.5,1,0,1,"BottomCenter"),C.Anchors.LeftMiddle=_(0,.5,-1,0,"LeftMiddle"),C.Anchors.RightMiddle=_(1,.5,1,0,"RightMiddle"),C.Anchors.Center=_(.5,.5,0,0,"Center"),C.Anchors.TopRight=_(1,0,0,-1,"TopRight"),C.Anchors.BottomRight=_(1,1,0,1,"BottomRight"),C.Anchors.TopLeft=_(0,0,0,-1,"TopLeft"),C.Anchors.BottomLeft=_(0,1,0,1,"BottomLeft"),C.Defaults.DynamicAnchors=function(t){return t.jsPlumbInstance.makeAnchors(["TopCenter","RightMiddle","BottomCenter","LeftMiddle"],t.elementId,t.jsPlumbInstance)},C.Anchors.AutoDefault=function(t){var e=t.jsPlumbInstance.makeDynamicAnchor(C.Defaults.DynamicAnchors(t));return e.type="AutoDefault",e},C.Anchors.Assign=_(0,0,0,0,"Assign",(function(t,e){var n=e.position||"Fixed";t.positionFinder=n.constructor==String?e.jsPlumbInstance.AnchorPositionFinders[n]:n,t.constructorParams=e})),C.Anchors.Continuous=function(t){return t.jsPlumbInstance.continuousAnchorFactory.get(t)},C.AnchorPositionFinders={Fixed:function(t,e,n,i){return[(t.left-e.left)/n[0],(t.top-e.top)/n[1]]},Grid:function(t,e,n,i){var r=t.left-e.left,o=t.top-e.top,a=n[0]/i.grid[0],s=n[1]/i.grid[1],l=Math.floor(r/a),u=Math.floor(o/s);return[(l*a+a/2)/n[0],(u*s+s/2)/n[1]]}}}(),function(){jsPlumb.DOMElementComponent=function(t){jsPlumb.jsPlumbUIComponent.apply(this,arguments),this.mousemove=this.dblclick=this.click=this.mousedown=this.mouseup=function(t){}},jsPlumb.Connectors.Straight=function(){this.type="Straight";var t,e,n,i,r,o,a,s,l,u=this,c=null;this.compute=function(u,d,h,f,p,g,m,v){var y=Math.abs(u[0]-d[0]),b=Math.abs(u[1]-d[1]),x=.45*y,w=.45*b;y*=1.9,b*=1.9;var C=Math.min(u[0],d[0])-x,_=Math.min(u[1],d[1])-w,E=Math.max(2*m,v);return y<E&&(y=E,C=u[0]+(d[0]-u[0])/2-E/2,x=(y-Math.abs(u[0]-d[0]))/2),b<E&&(b=E,_=u[1]+(d[1]-u[1])/2-E/2,w=(b-Math.abs(u[1]-d[1]))/2),r=u[0]<d[0]?x:y-x,o=u[1]<d[1]?w:b-w,a=u[0]<d[0]?y-x:x,s=u[1]<d[1]?b-w:w,c=[C,_,y,b,r,o,a,s],n=a-r,i=s-o,t=jsPlumbUtil.gradient({x:r,y:o},{x:a,y:s}),e=-1/t,Math.atan(t),Math.atan(e),l=Math.sqrt(n*n+i*i),c},this.pointOnPath=function(t,e){if(0!=t||e){if(1!=t||e){var n=e?t>0?t:l+t:t*l;return jsPlumbUtil.pointOnLine({x:r,y:o},{x:a,y:s},n)}return{x:a,y:s}}return{x:r,y:o}},this.gradientAtPoint=function(e){return t},this.pointAlongPathFrom=function(t,e,n){var i=u.pointOnPath(t,n),l=1==t?{x:r+10*(a-r),y:o+10*(o-s)}:{x:a,y:s};return jsPlumbUtil.pointOnLine(i,l,e)}},jsPlumb.Connectors.Bezier=function(t){var e=this;t=t||{},this.majorAnchor=t.curviness||150,this.minorAnchor=10;var n,i,r,o,a,s,l,u,c,d;this.type="Bezier",this._findControlPoint=function(t,n,i,r,o,a,s){var l=a.getOrientation(r),u=s.getOrientation(o),c=l[0]!=u[0]||l[1]==u[1],d=[],h=e.majorAnchor,f=e.minorAnchor;return c?(0==u[0]?d.push(i[0]<n[0]?t[0]+f:t[0]-f):d.push(t[0]+h*u[0]),0==u[1]?d.push(i[1]<n[1]?t[1]+f:t[1]-f):d.push(t[1]+h*l[1])):(0==l[0]?d.push(n[0]<i[0]?t[0]+f:t[0]-f):d.push(t[0]-h*l[0]),0==l[1]?d.push(n[1]<i[1]?t[1]+f:t[1]-f):d.push(t[1]+h*u[1])),d},this.compute=function(t,h,f,p,g,m,v,y){v=v||0,c=Math.abs(t[0]-h[0])+v,d=Math.abs(t[1]-h[1])+v,l=Math.min(t[0],h[0])-v/2,u=Math.min(t[1],h[1])-v/2,a=t[0]<h[0]?c-v/2:v/2,s=t[1]<h[1]?d-v/2:v/2,r=t[0]<h[0]?v/2:c-v/2,o=t[1]<h[1]?v/2:d-v/2,n=e._findControlPoint([a,s],t,h,f,p,g,m),i=e._findControlPoint([r,o],h,t,p,f,m,g);var b=Math.min(a,r),x=Math.min(n[0],i[0]),w=Math.min(b,x),C=Math.max(a,r),_=Math.max(n[0],i[0]),E=Math.max(C,_);if(E>c&&(c=E),w<0){l+=w;var M=Math.abs(w);c+=M,n[0]+=M,a+=M,r+=M,i[0]+=M}var S=Math.min(s,o),D=Math.min(n[1],i[1]),P=Math.min(S,D),j=Math.max(s,o),T=Math.max(n[1],i[1]),A=Math.max(j,T);if(A>d&&(d=A),P<0){u+=P;var k=Math.abs(P);d+=k,n[1]+=k,s+=k,o+=k,i[1]+=k}if(y&&c<y){var I=(y-c)/2;c=y,l-=I,a+=I,r+=I,n[0]=n[0]+I,i[0]=i[0]+I}if(y&&d<y){I=(y-d)/2;d=y,u-=I,s+=I,o+=I,n[1]=n[1]+I,i[1]=i[1]+I}return[l,u,c,d,a,s,r,o,n[0],n[1],i[0],i[1]]};var h=function(){return[{x:a,y:s},{x:n[0],y:n[1]},{x:i[0],y:i[1]},{x:r,y:o}]},f=function(t,e,n){return n&&(e=jsBezier.locationAlongCurveFrom(t,e>0?0:1,e)),e};this.pointOnPath=function(t,e){var n=h();return t=f(n,t,e),jsBezier.pointOnCurve(n,t)},this.gradientAtPoint=function(t,e){var n=h();return t=f(n,t,e),jsBezier.gradientAtPoint(n,t)},this.pointAlongPathFrom=function(t,e,n){var i=h();return t=f(i,t,n),jsBezier.pointAlongCurveFrom(i,t,e)}},jsPlumb.Connectors.Flowchart=function(t){this.type="Flowchart";var e,n,i=this,r=(t=t||{}).stub||t.minStubLength||30,o=jsPlumbUtil.isArray(r)?r[0]:r,a=jsPlumbUtil.isArray(r)?r[1]:r,s=t.gap||0,l=[],u=0,c=[],d=[],h=[],f=-1/0,p=-1/0,g=1/0,m=1/0,v=function(t,e,n,i,r,o){var a=0==l.length?n:l[l.length-1][0],s=0==l.length?i:l[l.length-1][1],c=t==a?1/0:0,d=Math.abs(t==a?e-s:t-a);l.push([t,e,a,s,c,d]),u+=d,f=Math.max(f,t),p=Math.max(p,e),g=Math.min(g,t),m=Math.min(m,e)},y=function(t,e){e&&(t=t>0?t/u:(u+t)/u);for(var n=c.length-1,i=1,r=0;r<c.length;r++)if(c[r][1]>=t){n=r,i=(t-c[r][0])/d[r];break}return{segment:l[n],proportion:i,index:n}};this.compute=function(t,i,r,y,b,x,w,C,_,E){l=[],c=[],u=0,d=[],f=p=-1/0,g=m=1/0,e=i[0]<t[0],n=i[1]<t[1];var M=w||1,S=M/2+(o+a),D=M/2+(a+o),P=M/2+(o+a),j=M/2+(a+o),T=b.orientation||b.getOrientation(r),A=x.orientation||x.getOrientation(y),k=e?i[0]:t[0],I=n?i[1]:t[1],L=Math.abs(i[0]-t[0])+S+D,O=Math.abs(i[1]-t[1])+P+j;if(0==T[0]&&0==T[1]||0==A[0]&&0==A[1]){var N=L>O?0:1,z=[1,0][N];A=[],(T=[])[N]=t[N]>i[N]?-1:1,A[N]=t[N]>i[N]?1:-1,T[z]=0,A[z]=0}L<C&&(S+=(C-L)/2,L=C),O<C&&(P+=(C-O)/2,O=C);var R=e?L-D+s*T[0]:S+s*T[0],H=n?O-j+s*T[1]:P+s*T[1],F=e?S+s*A[0]:L-D+s*A[0],V=n?P+s*A[1]:O-j+s*A[1],B=R+T[0]*o,W=H+T[1]*o,$=F+A[0]*a,U=V+A[1]*a,q=Math.abs(R-F)>o+a,G=Math.abs(H-V)>o+a,Y=B+($-B)/2,X=W+(U-W)/2,Q=T[0]*A[0]+T[1]*A[1],K=-1==Q,J=1==Q;h=[k-=S,I-=P,L,O,R,H,F,V];var Z=0==T[0]?"y":"x",tt=K?"opposite":J?"orthogonal":"perpendicular",et=jsPlumbUtil.segment([R,H],[F,V]);-1==T["x"==Z?0:1]&&(et={x:[null,4,3,2,1],y:[null,2,1,4,3]}[Z][et]),v(B,W,R,H);var nt={oppositex:function(){if(r.elementId==y.elementId){var t=W+(1-b.y)*_.height+Math.max(o,a);return[[B,t],[$,t]]}return!q||1!=et&&2!=et?[[B,X],[$,X]]:[[Y,H],[Y,V]]},orthogonalx:function(){return 1==et||2==et?[[$,W]]:[[B,U]]},perpendicularx:function(){var t=(V+H)/2;return 1==et&&1==A[1]||2==et&&-1==A[1]?Math.abs(F-R)>Math.max(o,a)?[[$,W]]:[[B,W],[B,t],[$,t]]:3==et&&-1==A[1]||4==et&&1==A[1]?[[B,t],[$,t]]:3==et&&1==A[1]||4==et&&-1==A[1]?[[B,U]]:1==et&&-1==A[1]||2==et&&1==A[1]?Math.abs(F-R)>Math.max(o,a)?[[Y,W],[Y,U]]:[[B,U]]:void 0},oppositey:function(){if(r.elementId==y.elementId){var t=B+(1-b.x)*_.width+Math.max(o,a);return[[t,W],[t,U]]}return!G||2!=et&&3!=et?[[Y,W],[Y,U]]:[[R,X],[F,X]]},orthogonaly:function(){return 2==et||3==et?[[B,U]]:[[$,W]]},perpendiculary:function(){var t=(F+R)/2;return 2==et&&-1==A[0]||3==et&&1==A[0]?Math.abs(F-R)>Math.max(o,a)?[[B,U]]:[[B,X],[$,X]]:1==et&&-1==A[0]||4==et&&1==A[0]?[[t=(F+R)/2,W],[t,U]]:1==et&&1==A[0]||4==et&&-1==A[0]?[[$,W]]:2==et&&1==A[0]||3==et&&-1==A[0]?Math.abs(V-H)>Math.max(o,a)?[[B,X],[$,X]]:[[$,W]]:void 0}}[tt+Z]();if(nt)for(var it=0;it<nt.length;it++)v(nt[it][0],nt[it][1],R,H);return v($,U,R,H),v(F,V,R,H),function(){h.push(l.length);for(var t=0;t<l.length;t++)h.push(l[t][0]),h.push(l[t][1])}(),function(){for(var t=0,e=0;e<l.length;e++)d[e]=l[e][5]/u,c[e]=[t,t+=l[e][5]/u]}(),p>h[3]&&(h[3]=p+2*w),f>h[2]&&(h[2]=f+2*w),h},this.pointOnPath=function(t,e){return i.pointAlongPathFrom(t,0,e)},this.gradientAtPoint=function(t,e){return l[y(t,e).index][4]},this.pointAlongPathFrom=function(t,e,n){var i=y(t,n),r=i.segment,o=i.proportion,a=l[i.index][5],s=l[i.index][4];return{x:s==1/0?r[2]:r[2]>r[0]?r[0]+(1-o)*a-e:r[2]+o*a+e,y:0==s?r[3]:r[3]>r[1]?r[1]+(1-o)*a-e:r[3]+o*a+e,segmentInfo:i}}},jsPlumb.Endpoints.Dot=function(t){this.type="Dot";var e=this;t=t||{},this.radius=t.radius||10,this.defaultOffset=.5*this.radius,this.defaultInnerRadius=this.radius/3,this.compute=function(t,n,i,r){var o=i.radius||e.radius;return[t[0]-o,t[1]-o,2*o,2*o,o]}},jsPlumb.Endpoints.Rectangle=function(t){this.type="Rectangle";var e=this;t=t||{},this.width=t.width||20,this.height=t.height||20,this.compute=function(t,n,i,r){var o=i.width||e.width,a=i.height||e.height;return[t[0]-o/2,t[1]-a/2,o,a]}};var t=function(t){jsPlumb.DOMElementComponent.apply(this,arguments);var e=[];this.getDisplayElements=function(){return e},this.appendDisplayElement=function(t){e.push(t)}};jsPlumb.Endpoints.Image=function(e){this.type="Image",t.apply(this,arguments);var n=this,i=!1,r=e.width,o=e.height,a=null,s=e.endpoint;this.img=new Image,n.ready=!1,this.img.onload=function(){n.ready=!0,r=r||n.img.width,o=o||n.img.height,a&&a(n)},s.setImage=function(t,e){t.constructor==String||t.src;a=e,n.img.src=t,null!=n.canvas&&n.canvas.setAttribute("src",t)},s.setImage(e.src||e.url,e.onload),this.compute=function(t,e,i,a){return n.anchorPoint=t,n.ready?[t[0]-r/2,t[1]-o/2,r,o]:[0,0,0,0]},n.canvas=document.createElement("img"),i=!1,n.canvas.style.margin=0,n.canvas.style.padding=0,n.canvas.style.outline=0,n.canvas.style.position="absolute";var l=e.cssClass?" "+e.cssClass:"";n.canvas.className=jsPlumb.endpointClass+l,r&&n.canvas.setAttribute("width",r),o&&n.canvas.setAttribute("height",o),jsPlumb.appendElement(n.canvas,e.parent),n.attachListeners(n.canvas,n);this.paint=function(t,e,a){n.ready?function(){i||(n.canvas.setAttribute("src",n.img.src),n.appendDisplayElement(n.canvas),i=!0);var t=n.anchorPoint[0]-r/2,e=n.anchorPoint[1]-o/2;jsPlumb.sizeCanvas(n.canvas,t,e,r,o)}():window.setTimeout((function(){n.paint(t,e,a)}),200)}},jsPlumb.Endpoints.Blank=function(e){var n=this;this.type="Blank",t.apply(this,arguments),this.compute=function(t,e,n,i){return[t[0],t[1],10,0]},n.canvas=document.createElement("div"),n.canvas.style.display="block",n.canvas.style.width="1px",n.canvas.style.height="1px",n.canvas.style.background="transparent",n.canvas.style.position="absolute",n.canvas.className=n._jsPlumb.endpointClass,jsPlumb.appendElement(n.canvas,e.parent),this.paint=function(t,e,i){jsPlumb.sizeCanvas(n.canvas,t[0],t[1],t[2],t[3])}},jsPlumb.Endpoints.Triangle=function(t){this.type="Triangle",(t=t||{}).width=t.width||55,t.height=t.height||55,this.width=t.width,this.height=t.height,this.compute=function(t,e,n,i){var r=n.width||self.width,o=n.height||self.height;return[t[0]-r/2,t[1]-o/2,r,o]}};var e=function(t){var e=!0,n=this;this.isAppendedAtTopLevel=!0,this.component=t.component,this.loc=null==t.location?.5:t.location,this.endpointLoc=null==t.endpointLocation?[.5,.5]:t.endpointLocation,this.setVisible=function(t){e=t,n.component.repaint()},this.isVisible=function(){return e},this.hide=function(){n.setVisible(!1)},this.show=function(){n.setVisible(!0)},this.incrementLocation=function(t){n.loc+=t,n.component.repaint()},this.setLocation=function(t){n.loc=t,n.component.repaint()},this.getLocation=function(){return n.loc}};jsPlumb.Overlays.Arrow=function(t){this.type="Arrow",e.apply(this,arguments),this.isAppendedAtTopLevel=!1,t=t||{};var n=this;this.length=t.length||20,this.width=t.width||20,this.id=t.id;var i=(t.direction||1)<0?-1:1,r=t.paintStyle||{lineWidth:1},o=t.foldback||.623;this.computeMaxSize=function(){return 1.5*n.width},this.cleanup=function(){},this.draw=function(t,e,a){var s,l,u,c,d;if(t.pointAlongPathFrom){if(jsPlumbUtil.isString(n.loc)||n.loc>1||n.loc<0){var h=parseInt(n.loc);s=t.pointAlongPathFrom(h,i*n.length/2,!0),l=t.pointOnPath(h,!0),u=jsPlumbUtil.pointOnLine(s,l,n.length)}else 1==n.loc?(s=t.pointOnPath(n.loc),l=t.pointAlongPathFrom(n.loc,-1),u=jsPlumbUtil.pointOnLine(s,l,n.length)):0==n.loc?(u=t.pointOnPath(n.loc),l=t.pointAlongPathFrom(n.loc,1),s=jsPlumbUtil.pointOnLine(u,l,n.length)):(s=t.pointAlongPathFrom(n.loc,i*n.length/2),l=t.pointOnPath(n.loc),u=jsPlumbUtil.pointOnLine(s,l,n.length));c=jsPlumbUtil.perpendicularLineTo(s,u,n.width),d=jsPlumbUtil.pointOnLine(s,u,o*n.length);var f=Math.min(s.x,c[0].x,c[1].x),p=Math.max(s.x,c[0].x,c[1].x),g=Math.min(s.y,c[0].y,c[1].y),m=Math.max(s.y,c[0].y,c[1].y),v={hxy:s,tail:c,cxy:d},y=r.strokeStyle||e.strokeStyle,b=r.fillStyle||e.strokeStyle,x=r.lineWidth||e.lineWidth;return n.paint(t,v,x,y,b,a),[f,p,g,m]}return[0,0,0,0]}},jsPlumb.Overlays.PlainArrow=function(t){t=t||{};var e=jsPlumb.extend(t,{foldback:1});jsPlumb.Overlays.Arrow.call(this,e),this.type="PlainArrow"},jsPlumb.Overlays.Diamond=function(t){var e=(t=t||{}).length||40,n=jsPlumb.extend(t,{length:e/2,foldback:2});jsPlumb.Overlays.Arrow.call(this,n),this.type="Diamond"},jsPlumb.Overlays.Label=function(t){this.type="Label",jsPlumb.DOMElementComponent.apply(this,arguments),e.apply(this,arguments),this.labelStyle=t.labelStyle||jsPlumb.Defaults.LabelStyle,this.id=t.id,this.cachedDimensions=null;var n=t.label||"",i=this,r=!1,o=document.createElement("div"),a=null;o.style.position="absolute";var s=t._jsPlumb.overlayClass+" "+(i.labelStyle.cssClass?i.labelStyle.cssClass:t.cssClass?t.cssClass:"");o.className=s,jsPlumb.appendElement(o,t.component.parent),jsPlumb.getId(o),i.attachListeners(o,i),i.canvas=o;var l=i.setVisible;i.setVisible=function(t){l(t),o.style.display=t?"block":"none"},this.getElement=function(){return o},this.cleanup=function(){null!=o&&jsPlumb.CurrentLibrary.removeElement(o)},this.setLabel=function(t){n=t,a=null,i.component.repaint()},this.getLabel=function(){return n},this.paint=function(t,e,n){r||(t.appendDisplayElement(o),i.attachListeners(o,t),r=!0),o.style.left=n[0]+e.minx+"px",o.style.top=n[1]+e.miny+"px"},this.getTextDimensions=function(){if("function"==typeof n){var t=n(i);o.innerHTML=t.replace(/\r\n/g,"<br/>")}else null==a&&(a=n,o.innerHTML=a.replace(/\r\n/g,"<br/>"));var e=jsPlumb.CurrentLibrary.getElementObject(o),r=jsPlumb.CurrentLibrary.getSize(e);return{width:r[0],height:r[1]}},this.computeMaxSize=function(t){var e=i.getTextDimensions(t);return e.width?1.5*Math.max(e.width,e.height):0},this.draw=function(t,e,n){var r=i.getTextDimensions(t);if(null!=r.width){var o={x:0,y:0};if(t.pointOnPath){var a=i.loc,s=!1;(jsPlumbUtil.isString(i.loc)||i.loc<0||i.loc>1)&&(a=parseInt(i.loc),s=!0),o=t.pointOnPath(a,s)}else{var l=i.loc.constructor==Array?i.loc:i.endpointLoc;o={x:l[0]*n[2],y:l[1]*n[3]}}return minx=o.x-r.width/2,miny=o.y-r.height/2,i.paint(t,{minx:minx,miny:miny,td:r,cxy:o},n),[minx,minx+r.width,miny,miny+r.height]}return[0,0,0,0]},this.reattachListeners=function(t){o&&i.reattachListenersForElement(o,i,t)}},jsPlumb.Overlays.GuideLines=function(){var t=this;t.length=50,t.lineWidth=5,this.type="GuideLines",e.apply(this,arguments),jsPlumb.jsPlumbUIComponent.apply(this,arguments),this.draw=function(e,n,i){var r=e.pointAlongPathFrom(t.loc,t.length/2),o=e.pointOnPath(t.loc),a=jsPlumbUtil.pointOnLine(r,o,t.length),s=jsPlumbUtil.perpendicularLineTo(r,a,40),l=jsPlumbUtil.perpendicularLineTo(a,r,20);return t.paint(e,[r,a,s,l],t.lineWidth,"red",null,i),[Math.min(r.x,a.x),Math.min(r.y,a.y),Math.max(r.x,a.x),Math.max(r.y,a.y)]},this.computeMaxSize=function(){return 50},this.cleanup=function(){}}}(),jsPlumb.Connectors.StateMachine=function(t){var e,n,i,r,o=null,a=[],s=t.curviness||10,l=t.margin||5,u=t.proximityLimit||80,c=t.orientation&&"clockwise"==t.orientation,d=t.loopbackRadius||25,h=!1,f=!1!==t.showLoopback;this.type="StateMachine",t=t||{},this.compute=function(t,p,g,m,v,y,b,x){var w=Math.abs(t[0]-p[0]),C=Math.abs(t[1]-p[1]),_=.45*w,E=.45*C;w*=1.9,C*=1.9,b=b||1;var M=Math.min(t[0],p[0])-_,S=Math.min(t[1],p[1])-E;if(f&&g.elementId==m.elementId){h=!0;var D=t[0],P=t[0],j=t[1]-l,T=t[1]-l,A=j-d;o=[M=D-d-b-d,S=A-d-b-d,w=2*b+4*d,C=2*b+4*d,D-M,A-S,d,c,D-M,j-S,P-M,T-S]}else{h=!1,e=t[0]<p[0]?_:w-_,n=t[1]<p[1]?E:C-E,i=t[0]<p[0]?w-_:_,r=t[1]<p[1]?C-E:E,0==t[2]&&(e-=l),1==t[2]&&(e+=l),0==t[3]&&(n-=l),1==t[3]&&(n+=l),0==p[2]&&(i-=l),1==p[2]&&(i+=l),0==p[3]&&(r-=l),1==p[3]&&(r+=l);var k=(e+i)/2,I=(n+r)/2,L=-1*k/I,O=Math.atan(L),N=(L==1/0||L==-1/0||Math.abs(s/2*Math.sin(O)),L==1/0||L==-1/0||Math.abs(s/2*Math.cos(O)),function(t,e,n,i){return t<=n&&i<=e?1:t<=n&&e<=i?2:n<=t&&i>=e?3:4}(e,n,i,r)),z=Math.sqrt(Math.pow(i-e,2)+Math.pow(r-n,2));a=function(t,e,n,i,r,o,a,s,l){return s<=l?[t,e]:1==n?i[3]<=0&&r[3]>=1?[t+(i[2]<.5?-1*o:o),e]:i[2]>=1&&r[2]<=0?[t,e+(i[3]<.5?-1*a:a)]:[t+-1*o,e+-1*a]:2==n?i[3]>=1&&r[3]<=0?[t+(i[2]<.5?-1*o:o),e]:i[2]>=1&&r[2]<=0?[t,e+(i[3]<.5?-1*a:a)]:[t+1*o,e+-1*a]:3==n?i[3]>=1&&r[3]<=0?[t+(i[2]<.5?-1*o:o),e]:i[2]<=0&&r[2]>=1?[t,e+(i[3]<.5?-1*a:a)]:[t+-1*o,e+-1*a]:4==n?i[3]<=0&&r[3]>=1?[t+(i[2]<.5?-1*o:o),e]:i[2]<=0&&r[2]>=1?[t,e+(i[3]<.5?-1*a:a)]:[t+1*o,e+-1*a]:void 0}(k,I,N,t,p,s,s,z,u);var R=Math.max(3*Math.abs(a[0]-e),3*Math.abs(a[0]-i),Math.abs(i-e),2*b,x),H=Math.max(3*Math.abs(a[1]-n),3*Math.abs(a[1]-r),Math.abs(r-n),2*b,x);if(w<R){var F=R-w;M-=F/2,e+=F/2,i+=F/2,w=R,a[0]+=F/2}if(C<H){var V=H-C;S-=V/2,n+=V/2,r+=V/2,C=H,a[1]+=V/2}o=[M,S,w,C,e,n,i,r,a[0],a[1]]}return o};var p=function(){return[{x:i,y:r},{x:a[0],y:a[1]},{x:a[0]+1,y:a[1]+1},{x:e,y:n}]},g=function(t,e,n){return n&&(e=jsBezier.locationAlongCurveFrom(t,e>0?0:1,e)),e};this.pointOnPath=function(t,e){if(h){e&&(t/=2*Math.PI*d),t>0&&t<1&&(t=1-t);var n=2*t*Math.PI+Math.PI/2;return{x:o[4]+o[6]*Math.cos(n),y:o[5]+o[6]*Math.sin(n)}}var i=p();return t=g(i,t,e),jsBezier.pointOnCurve(i,t)},this.gradientAtPoint=function(t,e){if(h)return e&&(t/=2*Math.PI*d),Math.atan(2*t*Math.PI);var n=p();return t=g(n,t,e),jsBezier.gradientAtPoint(n,t)},this.pointAlongPathFrom=function(t,e,n){if(h){n&&(t/=2*Math.PI*d),t>0&&t<1&&(t=1-t);var i=e/(2*Math.PI*o[6])*2*Math.PI,r=2*t*Math.PI-i+Math.PI/2;return{x:o[4]+o[6]*Math.cos(r),y:o[5]+o[6]*Math.sin(r)}}var a=p();return t=g(a,t,n),jsBezier.pointAlongCurveFrom(a,t,e)}},jsPlumb.Connectors.canvas.StateMachine=function(t){var e=this;(t=t||{}).drawGuideline,t.avoidSelector,jsPlumb.Connectors.StateMachine.apply(this,arguments),jsPlumb.CanvasConnector.apply(this,arguments),this._paint=function(t){if(10==t.length)e.ctx.beginPath(),e.ctx.moveTo(t[4],t[5]),e.ctx.bezierCurveTo(t[8],t[9],t[8],t[9],t[6],t[7]),e.ctx.stroke();else{e.ctx.save(),e.ctx.beginPath();var n=2*Math.PI,i=t[7];e.ctx.arc(t[4],t[5],t[6],0,n,i),e.ctx.stroke(),e.ctx.closePath(),e.ctx.restore()}},this.createGradient=function(t,e){return e.createLinearGradient(t[4],t[5],t[6],t[7])}},jsPlumb.Connectors.svg.StateMachine=function(){jsPlumb.Connectors.StateMachine.apply(this,arguments),jsPlumb.SvgConnector.apply(this,arguments),this.getPath=function(t){return 10==t.length?"M "+t[4]+" "+t[5]+" C "+t[8]+" "+t[9]+" "+t[8]+" "+t[9]+" "+t[6]+" "+t[7]:"M"+(t[8]+4)+" "+t[9]+" A "+t[6]+" "+t[6]+" 0 1,0 "+(t[8]-4)+" "+t[9]}},jsPlumb.Connectors.vml.StateMachine=function(){jsPlumb.Connectors.StateMachine.apply(this,arguments),jsPlumb.VmlConnector.apply(this,arguments);var t=jsPlumb.vml.convertValue;this.getPath=function(e){if(10==e.length)return"m"+t(e[4])+","+t(e[5])+" c"+t(e[8])+","+t(e[9])+","+t(e[8])+","+t(e[9])+","+t(e[6])+","+t(e[7])+" e";var n=t(e[8]-e[6]),i=t(e[9]-2*e[6]);return"ar "+n+","+i+","+(n+t(2*e[6]))+","+(i+t(2*e[6]))+","+t(e[8])+","+t(e[9])+","+t(e[8])+","+t(e[9])+" e"}},function(){var t={"stroke-linejoin":"joinstyle",joinstyle:"joinstyle",endcap:"endcap",miterlimit:"miterlimit"},e=null;if(document.createStyleSheet&&document.namespaces){var n=[".jsplumb_vml","jsplumb\\:textbox","jsplumb\\:oval","jsplumb\\:rect","jsplumb\\:stroke","jsplumb\\:shape","jsplumb\\:group"];e=document.createStyleSheet();for(var i=0;i<n.length;i++)e.addRule(n[i],"behavior:url(#default#VML);position:absolute;");document.namespaces.add("jsplumb","urn:schemas-microsoft-com:vml")}jsPlumb.vml={};var r=1e3,o=function(t,e){for(var n in e)t[n]=e[n]},a=function(t,e,n,i,r){n=n||{};var a=document.createElement("jsplumb:"+t);return r.appendElement(a,i),a.className=(n.class?n.class+" ":"")+"jsplumb_vml",s(a,e),o(a,n),a},s=function(t,e){t.style.left=e[0]+"px",t.style.top=e[1]+"px",t.style.width=e[2]+"px",t.style.height=e[3]+"px",t.style.position="absolute"},l=jsPlumb.vml.convertValue=function(t){return Math.floor(t*r)},u=function(t,e,n,i){"transparent"===e?i.setOpacity(n,"0.0"):i.setOpacity(n,"1.0")},c=function(t,e,n,i){var r={};if(e.strokeStyle){r.stroked="true";var s=jsPlumbUtil.convertStyle(e.strokeStyle,!0);r.strokecolor=s,u(0,s,"stroke",n),r.strokeweight=e.lineWidth+"px"}else r.stroked="false";if(e.fillStyle){r.filled="true";var l=jsPlumbUtil.convertStyle(e.fillStyle,!0);r.fillcolor=l,u(0,l,"fill",n)}else r.filled="false";if(e.dashstyle)null==n.strokeNode?n.strokeNode=a("stroke",[0,0,0,0],{dashstyle:e.dashstyle},t,i):n.strokeNode.dashstyle=e.dashstyle;else if(e["stroke-dasharray"]&&e.lineWidth){for(var c=-1==e["stroke-dasharray"].indexOf(",")?" ":",",d=e["stroke-dasharray"].split(c),h="",f=0;f<d.length;f++)h+=Math.floor(d[f]/e.lineWidth)+c;null==n.strokeNode?n.strokeNode=a("stroke",[0,0,0,0],{dashstyle:h},t,i):n.strokeNode.dashstyle=h}o(t,r)},d=function(){var t=this;jsPlumb.jsPlumbUIComponent.apply(this,arguments),this.opacityNodes={stroke:null,fill:null},this.initOpacityNodes=function(e){t.opacityNodes.stroke=a("stroke",[0,0,1,1],{opacity:"0.0"},e,t._jsPlumb),t.opacityNodes.fill=a("fill",[0,0,1,1],{opacity:"0.0"},e,t._jsPlumb)},this.setOpacity=function(e,n){var i=t.opacityNodes[e];i&&(i.opacity=""+n)};var e=[];this.getDisplayElements=function(){return e},this.appendDisplayElement=function(n,i){i||t.canvas.parentNode.appendChild(n),e.push(n)}},h=jsPlumb.VmlConnector=function(e){var n=this;n.strokeNode=null,n.canvas=null,d.apply(this,arguments);var i=n._jsPlumb.connectorClass+(e.cssClass?" "+e.cssClass:"");this.paint=function(l,u,d){if(null!=u){var h={path:n.getPath(l)};if(u.outlineColor){var f=u.outlineWidth||1,p=u.lineWidth+2*f,g={strokeStyle:jsPlumbUtil.convertStyle(u.outlineColor),lineWidth:p};for(var m in t)g[m]=u[m];null==n.bgCanvas?(h.class=i,h.coordsize=l[2]*r+","+l[3]*r,n.bgCanvas=a("shape",l,h,e.parent,n._jsPlumb),s(n.bgCanvas,l),n.appendDisplayElement(n.bgCanvas,!0),n.attachListeners(n.bgCanvas,n),n.initOpacityNodes(n.bgCanvas,["stroke"])):(h.coordsize=l[2]*r+","+l[3]*r,s(n.bgCanvas,l),o(n.bgCanvas,h)),c(n.bgCanvas,g,n)}null==n.canvas?(h.class=i,h.coordsize=l[2]*r+","+l[3]*r,n.tooltip&&(h.label=n.tooltip),n.canvas=a("shape",l,h,e.parent,n._jsPlumb),n.appendDisplayElement(n.canvas,!0),n.attachListeners(n.canvas,n),n.initOpacityNodes(n.canvas,["stroke"])):(h.coordsize=l[2]*r+","+l[3]*r,s(n.canvas,l),o(n.canvas,h)),c(n.canvas,u,n,n._jsPlumb)}},this.reattachListeners=function(){n.canvas&&n.reattachListenersForElement(n.canvas,n)}},f=window.VmlEndpoint=function(t){d.apply(this,arguments);var e=null,n=this;n.canvas=document.createElement("div"),n.canvas.style.position="absolute";var i=n._jsPlumb.endpointClass+(t.cssClass?" "+t.cssClass:"");t._jsPlumb.appendElement(n.canvas,t.parent),n.tooltip&&n.canvas.setAttribute("label",n.tooltip),this.paint=function(t,r,a){var l={};jsPlumb.sizeCanvas(n.canvas,t[0],t[1],t[2],t[3]),null==e?(l.class=i,e=n.getVml([0,0,t[2],t[3]],l,a,n.canvas,n._jsPlumb),n.attachListeners(e,n),n.appendDisplayElement(e,!0),n.appendDisplayElement(n.canvas,!0),n.initOpacityNodes(e,["fill"])):(s(e,[0,0,t[2],t[3]]),o(e,l)),c(e,r,n)},this.reattachListeners=function(){e&&n.reattachListenersForElement(e,n)}};jsPlumb.Connectors.vml.Bezier=function(){jsPlumb.Connectors.Bezier.apply(this,arguments),h.apply(this,arguments),this.getPath=function(t){return"m"+l(t[4])+","+l(t[5])+" c"+l(t[8])+","+l(t[9])+","+l(t[10])+","+l(t[11])+","+l(t[6])+","+l(t[7])+" e"}},jsPlumb.Connectors.vml.Straight=function(){jsPlumb.Connectors.Straight.apply(this,arguments),h.apply(this,arguments),this.getPath=function(t){return"m"+l(t[4])+","+l(t[5])+" l"+l(t[6])+","+l(t[7])+" e"}},jsPlumb.Connectors.vml.Flowchart=function(){jsPlumb.Connectors.Flowchart.apply(this,arguments),h.apply(this,arguments),this.getPath=function(t){for(var e="m "+l(t[4])+","+l(t[5])+" l",n=0;n<t[8];n++)e=e+" "+l(t[9+2*n])+","+l(t[10+2*n]);return e=e+" "+l(t[6])+","+l(t[7])+" e"}},jsPlumb.Endpoints.vml.Dot=function(){jsPlumb.Endpoints.Dot.apply(this,arguments),f.apply(this,arguments),this.getVml=function(t,e,n,i,r){return a("oval",t,e,i,r)}},jsPlumb.Endpoints.vml.Rectangle=function(){jsPlumb.Endpoints.Rectangle.apply(this,arguments),f.apply(this,arguments),this.getVml=function(t,e,n,i,r){return a("rect",t,e,i,r)}},jsPlumb.Endpoints.vml.Image=jsPlumb.Endpoints.Image,jsPlumb.Endpoints.vml.Blank=jsPlumb.Endpoints.Blank,jsPlumb.Overlays.vml.Label=jsPlumb.Overlays.Label;var p=function(t,e){t.apply(this,e),d.apply(this,e);var n=this;n.canvas=null,n.isAppendedAtTopLevel=!0;this.paint=function(t,e,i,u,c,d){var h={};u&&(h.stroked="true",h.strokecolor=jsPlumbUtil.convertStyle(u,!0)),i&&(h.strokeweight=i+"px"),c&&(h.filled="true",h.fillcolor=c);var f=Math.min(e.hxy.x,e.tail[0].x,e.tail[1].x,e.cxy.x),p=Math.min(e.hxy.y,e.tail[0].y,e.tail[1].y,e.cxy.y),g=Math.max(e.hxy.x,e.tail[0].x,e.tail[1].x,e.cxy.x),m=Math.max(e.hxy.y,e.tail[0].y,e.tail[1].y,e.cxy.y),v=[f,p,Math.abs(g-f),Math.abs(m-p)];h.path=function(t){return"m "+l(t.hxy.x)+","+l(t.hxy.y)+" l "+l(t.tail[0].x)+","+l(t.tail[0].y)+" "+l(t.cxy.x)+","+l(t.cxy.y)+" "+l(t.tail[1].x)+","+l(t.tail[1].y)+" x e"}(e),h.coordsize=d[2]*r+","+d[3]*r,v[0]=d[0],v[1]=d[1],v[2]=d[2],v[3]=d[3],null==n.canvas?(n.canvas=a("shape",v,h,t.canvas.parentNode,t._jsPlumb),t.appendDisplayElement(n.canvas,!0),n.attachListeners(n.canvas,t),n.attachListeners(n.canvas,n)):(s(n.canvas,v),o(n.canvas,h))},this.reattachListeners=function(){n.canvas&&n.reattachListenersForElement(n.canvas,n)},this.cleanup=function(){null!=n.canvas&&jsPlumb.CurrentLibrary.removeElement(n.canvas)}};jsPlumb.Overlays.vml.Arrow=function(){p.apply(this,[jsPlumb.Overlays.Arrow,arguments])},jsPlumb.Overlays.vml.PlainArrow=function(){p.apply(this,[jsPlumb.Overlays.PlainArrow,arguments])},jsPlumb.Overlays.vml.Diamond=function(){p.apply(this,[jsPlumb.Overlays.Diamond,arguments])}}(),function(){var t={joinstyle:"stroke-linejoin","stroke-linejoin":"stroke-linejoin","stroke-dashoffset":"stroke-dashoffset","stroke-linecap":"stroke-linecap"},e="stroke-dasharray",n="dashstyle",i="linearGradient",r="radialGradient",o="fill",a="stroke",s="style",l="none",u="http://www.w3.org/2000/svg",c="http://www.w3.org/1999/xhtml",d=function(t,e){for(var n in e)t.setAttribute(n,""+e[n])},h=function(t,e){var n=document.createElementNS(u,t);return(e=e||{}).version="1.1",e.xmlns=c,d(n,e),n},f=function(t){return"position:absolute;left:"+t[0]+"px;top:"+t[1]+"px"},p=function(t){for(var e=0;e<t.childNodes.length;e++)t.childNodes[e].tagName!=i&&t.childNodes[e].tagName!=r||t.removeChild(t.childNodes[e])},g=function(u,c,d,f,g){if(d.gradient?function(t,e,n,l,u){var c="jsplumb_gradient_"+u._jsPlumb.idstamp();if(p(t),n.gradient.offset)d=h(r,{id:c}),t.appendChild(d);else{var d=h(i,{id:c,gradientUnits:"userSpaceOnUse"});t.appendChild(d)}for(var f=0;f<n.gradient.stops.length;f++){var g=f;g=8==l.length?l[4]<l[6]?f:n.gradient.stops.length-1-f:l[4]<l[6]?n.gradient.stops.length-1-f:f;var m=jsPlumbUtil.convertStyle(n.gradient.stops[g][1],!0),v=h("stop",{offset:Math.floor(100*n.gradient.stops[f][0])+"%","stop-color":m});d.appendChild(v)}var y=n.strokeStyle?a:o;e.setAttribute(s,y+":url(#"+c+")")}(u,c,d,f,g):(p(u),c.setAttribute(s,"")),c.setAttribute(o,d.fillStyle?jsPlumbUtil.convertStyle(d.fillStyle,!0):l),c.setAttribute(a,d.strokeStyle?jsPlumbUtil.convertStyle(d.strokeStyle,!0):l),d.lineWidth&&c.setAttribute("stroke-width",d.lineWidth),d[n]&&d.lineWidth&&!d[e]){var m=-1==d[n].indexOf(",")?" ":",",v=d[n].split(m),y="";v.forEach((function(t){y+=Math.floor(t*d.lineWidth)+m})),c.setAttribute(e,y)}else d[e]&&c.setAttribute(e,d[e]);for(var b in t)d[b]&&c.setAttribute(t[b],d[b])},m=function(t,e,n){for(var i=n.split(" "),r=t.className.baseVal.split(" "),o=0;o<i.length;o++)if(e)-1==r.indexOf(i[o])&&r.push(i[o]);else{var a=r.indexOf(i[o]);-1!=a&&r.splice(a,1)}t.className.baseVal=r.join(" ")};jsPlumbUtil.svg={addClass:function(t,e){m(t,!0,e)},removeClass:function(t,e){m(t,!1,e)},node:h,attr:d,pos:f};var v=function(t){var e=this,n=t.pointerEventsSpec||"all";jsPlumb.jsPlumbUIComponent.apply(this,t.originalArgs),e.canvas=null,e.path=null,e.svg=null;var i=t.cssClass+" "+(t.originalArgs[0].cssClass||""),r={style:"",width:0,height:0,"pointer-events":n,position:"absolute"};e.tooltip&&(r.title=e.tooltip),e.svg=h("svg",r),t.useDivWrapper?(e.canvas=document.createElement("div"),e.canvas.style.position="absolute",jsPlumb.sizeCanvas(e.canvas,0,0,1,1),e.canvas.className=i,e.tooltip&&e.canvas.setAttribute("title",e.tooltip)):(d(e.svg,{class:i}),e.canvas=e.svg),t._jsPlumb.appendElement(e.canvas,t.originalArgs[0].parent),t.useDivWrapper&&e.canvas.appendChild(e.svg);var o=[e.canvas];this.getDisplayElements=function(){return o},this.appendDisplayElement=function(t){o.push(t)},this.paint=function(n,i,r){if(null!=i){var o=n[0],a=n[1];t.useDivWrapper&&(jsPlumb.sizeCanvas(e.canvas,n[0],n[1],n[2],n[3]),o=0,a=0),d(e.svg,{style:f([o,a,n[2],n[3]]),width:n[2],height:n[3]}),e._paint.apply(this,arguments)}}},y=jsPlumb.SvgConnector=function(t){var e=this;v.apply(this,[{cssClass:t._jsPlumb.connectorClass,originalArgs:arguments,pointerEventsSpec:"none",tooltip:t.tooltip,_jsPlumb:t._jsPlumb}]),this._paint=function(t,n){var i={d:e.getPath(t)},r=null;if(i["pointer-events"]="all",n.outlineColor){var o=n.outlineWidth||1,a=n.lineWidth+2*o;(r=jsPlumb.CurrentLibrary.extend({},n)).strokeStyle=jsPlumbUtil.convertStyle(n.outlineColor),r.lineWidth=a,null==e.bgPath?(e.bgPath=h("path",i),e.svg.appendChild(e.bgPath),e.attachListeners(e.bgPath,e)):d(e.bgPath,i),g(e.svg,e.bgPath,r,t,e)}null==e.path?(e.path=h("path",i),e.svg.appendChild(e.path),e.attachListeners(e.path,e)):d(e.path,i),g(e.svg,e.path,n,t,e)},this.reattachListeners=function(){e.bgPath&&e.reattachListenersForElement(e.bgPath,e),e.path&&e.reattachListenersForElement(e.path,e)}};jsPlumb.Connectors.svg.Bezier=function(t){jsPlumb.Connectors.Bezier.apply(this,arguments),y.apply(this,arguments),this.getPath=function(t){var e="M "+t[4]+" "+t[5];return e+=" C "+t[8]+" "+t[9]+" "+t[10]+" "+t[11]+" "+t[6]+" "+t[7]}},jsPlumb.Connectors.svg.Straight=function(t){jsPlumb.Connectors.Straight.apply(this,arguments),y.apply(this,arguments),this.getPath=function(t){return"M "+t[4]+" "+t[5]+" L "+t[6]+" "+t[7]}},jsPlumb.Connectors.svg.Flowchart=function(){jsPlumb.Connectors.Flowchart.apply(this,arguments),y.apply(this,arguments),this.getPath=function(t){for(var e="M "+t[4]+","+t[5],n=0;n<t[8];n++)e=e+" L "+t[9+2*n]+" "+t[10+2*n];return e=e+" "+t[6]+","+t[7]}};var b=window.SvgEndpoint=function(t){var e=this;v.apply(this,[{cssClass:t._jsPlumb.endpointClass,originalArgs:arguments,pointerEventsSpec:"all",useDivWrapper:!0,_jsPlumb:t._jsPlumb}]),this._paint=function(t,n){var i=jsPlumb.extend({},n);i.outlineColor&&(i.strokeWidth=i.outlineWidth,i.strokeStyle=jsPlumbUtil.convertStyle(i.outlineColor,!0)),null==e.node&&(e.node=e.makeNode(t,i),e.svg.appendChild(e.node),e.attachListeners(e.node,e)),g(e.svg,e.node,i,t,e),f(e.node)},this.reattachListeners=function(){e.node&&e.reattachListenersForElement(e.node,e)}};jsPlumb.Endpoints.svg.Dot=function(){jsPlumb.Endpoints.Dot.apply(this,arguments),b.apply(this,arguments),this.makeNode=function(t,e){return h("circle",{cx:t[2]/2,cy:t[3]/2,r:t[2]/2})}},jsPlumb.Endpoints.svg.Rectangle=function(){jsPlumb.Endpoints.Rectangle.apply(this,arguments),b.apply(this,arguments),this.makeNode=function(t,e){return h("rect",{width:t[2],height:t[3]})}},jsPlumb.Endpoints.svg.Image=jsPlumb.Endpoints.Image,jsPlumb.Endpoints.svg.Blank=jsPlumb.Endpoints.Blank,jsPlumb.Overlays.svg.Label=jsPlumb.Overlays.Label;var x=function(t,e){t.apply(this,e),jsPlumb.jsPlumbUIComponent.apply(this,e),this.isAppendedAtTopLevel=!1;var n=this,i=null;this.paint=function(t,o,a,s,l){null==i&&(i=h("path",{"pointer-events":"all"}),t.svg.appendChild(i),n.attachListeners(i,t),n.attachListeners(i,n));var u=e&&1==e.length&&e[0].cssClass||"";d(i,{d:r(o),class:u,stroke:s||null,fill:l||null})};var r=function(t){return"M"+t.hxy.x+","+t.hxy.y+" L"+t.tail[0].x+","+t.tail[0].y+" L"+t.cxy.x+","+t.cxy.y+" L"+t.tail[1].x+","+t.tail[1].y+" L"+t.hxy.x+","+t.hxy.y};this.reattachListeners=function(){i&&n.reattachListenersForElement(i,n)},this.cleanup=function(){null!=i&&jsPlumb.CurrentLibrary.removeElement(i)}};jsPlumb.Overlays.svg.Arrow=function(){x.apply(this,[jsPlumb.Overlays.Arrow,arguments])},jsPlumb.Overlays.svg.PlainArrow=function(){x.apply(this,[jsPlumb.Overlays.PlainArrow,arguments])},jsPlumb.Overlays.svg.Diamond=function(){x.apply(this,[jsPlumb.Overlays.Diamond,arguments])},jsPlumb.Overlays.svg.GuideLines=function(){var t,e,n=null,i=this;jsPlumb.Overlays.GuideLines.apply(this,arguments),this.paint=function(o,a,s,l,u){null==n&&(n=h("path"),o.svg.appendChild(n),i.attachListeners(n,o),i.attachListeners(n,i),t=h("path"),o.svg.appendChild(t),i.attachListeners(t,o),i.attachListeners(t,i),e=h("path"),o.svg.appendChild(e),i.attachListeners(e,o),i.attachListeners(e,i)),d(n,{d:r(a[0],a[1]),stroke:"red",fill:null}),d(t,{d:r(a[2][0],a[2][1]),stroke:"blue",fill:null}),d(e,{d:r(a[3][0],a[3][1]),stroke:"green",fill:null})};var r=function(t,e){return"M "+t.x+","+t.y+" L"+e.x+","+e.y}}}(),function(){var t=function(t){return jsPlumb.CurrentLibrary.getElementObject(t)},e=function(e){return jsPlumb.CurrentLibrary.getOffset(t(e))},n=function(t){return jsPlumb.CurrentLibrary.getPageXY(t)},i=function(){var i=this;i.overlayPlacements=[],jsPlumb.jsPlumbUIComponent.apply(this,arguments),jsPlumbUtil.EventGenerator.apply(this,arguments),this._over=function(r){var o=e(t(i.canvas)),a=n(r),s=a[0]-o.left,l=a[1]-o.top;if(s>0&&l>0&&s<i.canvas.width&&l<i.canvas.height){for(var u=0;u<i.overlayPlacements.length;u++){var c=i.overlayPlacements[u];if(c&&c[0]<=s&&c[1]>=s&&c[2]<=l&&c[3]>=l)return!0}var d=i.canvas.getContext("2d").getImageData(parseInt(s),parseInt(l),1,1);return 0!=d.data[0]||0!=d.data[1]||0!=d.data[2]||0!=d.data[3]}return!1};var r=!1,o=!1,a=!1,s=function(e,n){return null!=e&&function(e,n){return jsPlumb.CurrentLibrary.hasClass(t(e),n)}(e,n)};this.mousemove=function(t){n(t);var e=function(t){return jsPlumb.CurrentLibrary.getClientXY(t)}(t),o=document.elementFromPoint(e[0],e[1]),a=s(o,"_jsPlumb_overlay"),l=s(o,"_jsPlumb_endpoint")||s(o,"_jsPlumb_connector");if(!r&&l&&i._over(t))return r=!0,i.fire("mouseenter",i,t),!0;!r||i._over(t)&&l||a||(r=!1,i.fire("mouseexit",i,t)),i.fire("mousemove",i,t)},this.click=function(t){r&&i._over(t)&&!a&&i.fire("click",i,t),a=!1},this.dblclick=function(t){r&&i._over(t)&&!a&&i.fire("dblclick",i,t),a=!1},this.mousedown=function(n){i._over(n)&&!o&&(o=!0,e(t(i.canvas)),i.fire("mousedown",i,n))},this.mouseup=function(t){o=!1,i.fire("mouseup",i,t)},this.contextmenu=function(t){r&&i._over(t)&&!a&&i.fire("contextmenu",i,t),a=!1}},r=function(t){var e=document.createElement("canvas");return t._jsPlumb.appendElement(e,t.parent),e.style.position="absolute",t.class&&(e.className=t.class),t._jsPlumb.getId(e,t.uuid),t.tooltip&&e.setAttribute("title",t.tooltip),e},o=function(t){i.apply(this,arguments);var e=[];this.getDisplayElements=function(){return e},this.appendDisplayElement=function(t){e.push(t)}},a=jsPlumb.CanvasConnector=function(t){o.apply(this,arguments);var e=function(t,e){if(n.ctx.save(),jsPlumb.extend(n.ctx,e),e.gradient){for(var i=n.createGradient(t,n.ctx),r=0;r<e.gradient.stops.length;r++)i.addColorStop(e.gradient.stops[r][0],e.gradient.stops[r][1]);n.ctx.strokeStyle=i}n._paint(t,e),n.ctx.restore()},n=this,i=n._jsPlumb.connectorClass+" "+(t.cssClass||"");n.canvas=r({class:i,_jsPlumb:n._jsPlumb,parent:t.parent,tooltip:t.tooltip}),n.ctx=n.canvas.getContext("2d"),n.appendDisplayElement(n.canvas),n.paint=function(t,i){if(null!=i){if(jsPlumb.sizeCanvas(n.canvas,t[0],t[1],t[2],t[3]),null!=i.outlineColor){var r=i.outlineWidth||1,o=i.lineWidth+2*r,a={strokeStyle:i.outlineColor,lineWidth:o};e(t,a)}e(t,i)}}},s=function(t){var e=this;o.apply(this,arguments);var n={class:e._jsPlumb.endpointClass+" "+(t.cssClass||""),_jsPlumb:e._jsPlumb,parent:t.parent,tooltip:e.tooltip};e.canvas=r(n),e.ctx=e.canvas.getContext("2d"),e.appendDisplayElement(e.canvas),this.paint=function(t,n,i){if(jsPlumb.sizeCanvas(e.canvas,t[0],t[1],t[2],t[3]),null!=n.outlineColor){var r=n.outlineWidth||1,o=n.lineWidth+2*r;n.outlineColor}e._paint.apply(this,arguments)}};jsPlumb.Endpoints.canvas.Dot=function(t){jsPlumb.Endpoints.Dot.apply(this,arguments),s.apply(this,arguments);var e=this,n=function(t){try{return parseInt(t)}catch(e){if("%"==t.substring(t.length-1))return parseInt(t.substring(0,t-1))}};this._paint=function(t,i,r){if(null!=i){var o=e.canvas.getContext("2d"),a=r.getOrientation(e);if(jsPlumb.extend(o,i),i.gradient){for(var s=function(t){var i=e.defaultOffset,r=e.defaultInnerRadius;return t.offset&&(i=n(t.offset)),t.innerRadius&&(r=n(t.innerRadius)),[i,r]}(i.gradient),l=1==a[1]?-1*s[0]:s[0],u=1==a[0]?-1*s[0]:s[0],c=o.createRadialGradient(t[4],t[4],t[4],t[4]+u,t[4]+l,s[1]),d=0;d<i.gradient.stops.length;d++)c.addColorStop(i.gradient.stops[d][0],i.gradient.stops[d][1]);o.fillStyle=c}o.beginPath(),o.arc(t[4],t[4],t[4],0,2*Math.PI,!0),o.closePath(),(i.fillStyle||i.gradient)&&o.fill(),i.strokeStyle&&o.stroke()}}},jsPlumb.Endpoints.canvas.Rectangle=function(t){var e=this;jsPlumb.Endpoints.Rectangle.apply(this,arguments),s.apply(this,arguments),this._paint=function(t,n,i){var r=e.canvas.getContext("2d"),o=i.getOrientation(e);if(jsPlumb.extend(r,n),n.gradient){for(var a=1==o[1]?t[3]:0==o[1]?t[3]/2:0,s=-1==o[1]?t[3]:0==o[1]?t[3]/2:0,l=1==o[0]?t[2]:0==o[0]?t[2]/2:0,u=-1==o[0]?t[2]:0==o[0]?t[2]/2:0,c=r.createLinearGradient(l,a,u,s),d=0;d<n.gradient.stops.length;d++)c.addColorStop(n.gradient.stops[d][0],n.gradient.stops[d][1]);r.fillStyle=c}r.beginPath(),r.rect(0,0,t[2],t[3]),r.closePath(),(n.fillStyle||n.gradient)&&r.fill(),n.strokeStyle&&r.stroke()}},jsPlumb.Endpoints.canvas.Triangle=function(t){var e=this;jsPlumb.Endpoints.Triangle.apply(this,arguments),s.apply(this,arguments),this._paint=function(t,n,i){var r=t[2],o=t[3],a=(t[0],t[1],e.canvas.getContext("2d")),s=0,l=0,u=0,c=i.getOrientation(e);1==c[0]&&(s=r,l=o,u=180),-1==c[1]&&(s=r,u=90),1==c[1]&&(l=o,u=-90),a.fillStyle=n.fillStyle,a.translate(s,l),a.rotate(u*Math.PI/180),a.beginPath(),a.moveTo(0,0),a.lineTo(r/2,o/2),a.lineTo(0,o),a.closePath(),(n.fillStyle||n.gradient)&&a.fill(),n.strokeStyle&&a.stroke()}},jsPlumb.Endpoints.canvas.Image=jsPlumb.Endpoints.Image,jsPlumb.Endpoints.canvas.Blank=jsPlumb.Endpoints.Blank,jsPlumb.Connectors.canvas.Bezier=function(){var t=this;jsPlumb.Connectors.Bezier.apply(this,arguments),a.apply(this,arguments),this._paint=function(e,n){t.ctx.beginPath(),t.ctx.moveTo(e[4],e[5]),t.ctx.bezierCurveTo(e[8],e[9],e[10],e[11],e[6],e[7]),t.ctx.stroke()},this.createGradient=function(e,n,i){return t.ctx.createLinearGradient(e[6],e[7],e[4],e[5])}},jsPlumb.Connectors.canvas.Straight=function(){var t=this,e=[null,[1,-1],[1,1],[-1,1],[-1,-1]];jsPlumb.Connectors.Straight.apply(this,arguments),a.apply(this,arguments),this._paint=function(n,i){if(t.ctx.beginPath(),i.dashstyle&&2==i.dashstyle.split(" ").length){var r=i.dashstyle.split(" ");2!=r.length&&(r=[2,2]);for(var o=[r[0]*i.lineWidth,r[1]*i.lineWidth],a=(n[6]-n[4])/(n[7]-n[5]),s=jsPlumbUtil.segment([n[4],n[5]],[n[6],n[7]]),l=e[s],u=Math.atan(a),c=Math.sqrt(Math.pow(n[6]-n[4],2)+Math.pow(n[7]-n[5],2)),d=Math.floor(c/(o[0]+o[1])),h=[n[4],n[5]],f=0;f<d;f++){t.ctx.moveTo(h[0],h[1]);var p=h[0]+Math.abs(Math.sin(u)*o[0])*l[0],g=h[1]+Math.abs(Math.cos(u)*o[0])*l[1],m=h[0]+Math.abs(Math.sin(u)*(o[0]+o[1]))*l[0],v=h[1]+Math.abs(Math.cos(u)*(o[0]+o[1]))*l[1];t.ctx.lineTo(p,g),h=[m,v]}t.ctx.moveTo(h[0],h[1]),t.ctx.lineTo(n[6],n[7])}else t.ctx.moveTo(n[4],n[5]),t.ctx.lineTo(n[6],n[7]);t.ctx.stroke()},this.createGradient=function(t,e){return e.createLinearGradient(t[4],t[5],t[6],t[7])}},jsPlumb.Connectors.canvas.Flowchart=function(){var t=this;jsPlumb.Connectors.Flowchart.apply(this,arguments),a.apply(this,arguments),this._paint=function(e,n){t.ctx.beginPath(),t.ctx.moveTo(e[4],e[5]);for(var i=0;i<e[8];i++)t.ctx.lineTo(e[9+2*i],e[10+2*i]);t.ctx.lineTo(e[6],e[7]),t.ctx.stroke()},this.createGradient=function(t,e){return e.createLinearGradient(t[4],t[5],t[6],t[7])}},jsPlumb.Overlays.canvas.Label=jsPlumb.Overlays.Label;var l=function(){jsPlumb.jsPlumbUIComponent.apply(this,arguments)},u=function(t,e){t.apply(this,e),l.apply(this,e),this.paint=function(t,e,n,i,r){var o=t.ctx;o.lineWidth=n,o.beginPath(),o.moveTo(e.hxy.x,e.hxy.y),o.lineTo(e.tail[0].x,e.tail[0].y),o.lineTo(e.cxy.x,e.cxy.y),o.lineTo(e.tail[1].x,e.tail[1].y),o.lineTo(e.hxy.x,e.hxy.y),o.closePath(),i&&(o.strokeStyle=i,o.stroke()),r&&(o.fillStyle=r,o.fill())}};jsPlumb.Overlays.canvas.Arrow=function(){u.apply(this,[jsPlumb.Overlays.Arrow,arguments])},jsPlumb.Overlays.canvas.PlainArrow=function(){u.apply(this,[jsPlumb.Overlays.PlainArrow,arguments])},jsPlumb.Overlays.canvas.Diamond=function(){u.apply(this,[jsPlumb.Overlays.Diamond,arguments])}}(),function(t){jsPlumb.CurrentLibrary={addClass:function(t,e){t=jsPlumb.CurrentLibrary.getElementObject(t);try{t[0].className.constructor==SVGAnimatedString&&jsPlumb.util.svg.addClass(t[0],e)}catch(t){}t.addClass(e)},animate:function(t,e,n){t.animate(e,n)},appendElement:function(t,e){jsPlumb.CurrentLibrary.getElementObject(e).append(t)},ajax:function(e){(e=e||{}).type=e.type||"get",t.ajax(e)},bind:function(t,e,n){(t=jsPlumb.CurrentLibrary.getElementObject(t)).bind(e,n)},dragEvents:{start:"start",stop:"stop",drag:"drag",step:"step",over:"over",out:"out",drop:"drop",complete:"complete"},extend:function(e,n){return t.extend(e,n)},getAttribute:function(t,e){return t.attr(e)},getClientXY:function(t){return[t.clientX,t.clientY]},getDocumentElement:function(){return document},getDragObject:function(t){return t[1].draggable},getDragScope:function(t){return t.draggable("option","scope")},getDropEvent:function(t){return t[0]},getDropScope:function(t){return t.droppable("option","scope")},getDOMElement:function(t){return"string"==typeof t?document.getElementById(t):t.context?t[0]:t},getElementObject:function(e){return t("string"==typeof e?"#"+e:e)},getOffset:function(t){return t.offset()},getOriginalEvent:function(t){return t.originalEvent},getPageXY:function(t){return[t.pageX,t.pageY]},getParent:function(t){return jsPlumb.CurrentLibrary.getElementObject(t).parent()},getScrollLeft:function(t){return t.scrollLeft()},getScrollTop:function(t){return t.scrollTop()},getSelector:function(e){return t(e)},getSize:function(t){return[t.outerWidth(),t.outerHeight()]},getTagName:function(t){var e=jsPlumb.CurrentLibrary.getElementObject(t);return e.length>0?e[0].tagName:null},getUIPosition:function(t){if(1==t.length)ret={left:t[0].pageX,top:t[0].pageY};else{var e=t[1],n=e.offset;ret=n||e.absolutePosition}return ret},hasClass:function(t,e){return t.hasClass(e)},initDraggable:function(t,e,n){(e=e||{}).helper=null,n&&(e.scope=e.scope||jsPlumb.Defaults.Scope),t.draggable(e)},initDroppable:function(t,e){e.scope=e.scope||jsPlumb.Defaults.Scope,t.droppable(e)},isAlreadyDraggable:function(t){return(t=jsPlumb.CurrentLibrary.getElementObject(t)).hasClass("ui-draggable")},isDragSupported:function(t,e){return t.draggable},isDropSupported:function(t,e){return t.droppable},removeClass:function(t,e){t=jsPlumb.CurrentLibrary.getElementObject(t);try{t[0].className.constructor==SVGAnimatedString&&jsPlumb.util.svg.removeClass(t[0],e)}catch(t){}t.removeClass(e)},removeElement:function(t,e){jsPlumb.CurrentLibrary.getElementObject(t).remove()},setAttribute:function(t,e,n){t.attr(e,n)},setDraggable:function(t,e){t.draggable("option","disabled",!e)},setDragScope:function(t,e){t.draggable("option","scope",e)},setOffset:function(t,e){jsPlumb.CurrentLibrary.getElementObject(t).offset(e)},trigger:function(t,e,n){jQuery._data(jsPlumb.CurrentLibrary.getElementObject(t)[0],"handle")(n)},unbind:function(t,e,n){(t=jsPlumb.CurrentLibrary.getElementObject(t)).unbind(e,n)}},t(document).ready(jsPlumb.init)}(jQuery),function(){void 0===Math.sgn&&(Math.sgn=function(t){return 0==t?0:0<t?1:-1});var t=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},e=function(t,e){return t.x*e.x+t.y*e.y},n=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i=function(t,e){return{x:t.x*e,y:t.y*e}},r=Math.pow(2,-65),o=function(r,o){for(var l=[],u=o.length-1,c=2*u-1,d=[],h=[],f=[],p=[],g=[[1,.6,.3,.1],[.4,.6,.6,.4],[.1,.3,.6,1]],m=0;m<=u;m++)d[m]=t(o[m],r);for(m=0;m<=u-1;m++)h[m]=t(o[m+1],o[m]),h[m]=i(h[m],3);for(m=0;m<=u-1;m++)for(var v=0;v<=u;v++)f[m]||(f[m]=[]),f[m][v]=e(h[m],d[v]);for(m=0;m<=c;m++)p[m]||(p[m]=[]),p[m].y=0,p[m].x=parseFloat(m)/c;for(c=u-1,d=0;d<=u+c;d++)for(m=Math.max(0,d-c),h=Math.min(d,u);m<=h;m++)j=d-m,p[m+j].y=p[m+j].y+f[j][m]*g[j][m];for(u=o.length-1,p=a(p,2*u-1,l,0),c=t(r,o[0]),f=n(c),m=g=0;m<p;m++)c=t(r,s(o,u,l[m],null,null)),(c=n(c))<f&&(f=c,g=l[m]);return c=t(r,o[u]),(c=n(c))<f&&(f=c,g=1),{location:g,distance:f}},a=function(t,e,n,i){var o,l,u=[],c=[],d=[],h=[],f=0;l=Math.sgn(t[0].y);for(var p=1;p<=e;p++)(o=Math.sgn(t[p].y))!=l&&f++,l=o;switch(f){case 0:return 0;case 1:if(i>=64)return n[0]=(t[0].x+t[e].x)/2,1;var g;f=t[0].y-t[e].y;for(l=t[e].x-t[0].x,p=t[0].x*t[e].y-t[e].x*t[0].y,o=max_distance_below=0,g=1;g<e;g++){var m=f*t[g].x+l*t[g].y+p;m>o?o=m:m<max_distance_below&&(max_distance_below=m)}if(o=1/(0*(g=l)-1*f)*(1*(p-o)-0*g),f=1/(0*(g=l)-1*f)*(1*(l=p-max_distance_below)-0*g),l=Math.min(o,f),Math.max(o,f)-l<r)return d=t[e].x-t[0].x,h=t[e].y-t[0].y,n[0]=0+1*(d*(t[0].y-0)-h*(t[0].x-0))*(1/(0*d-1*h)),1}for(s(t,e,.5,u,c),t=a(u,e,d,i+1),e=a(c,e,h,i+1),i=0;i<t;i++)n[i]=d[i];for(i=0;i<e;i++)n[i+t]=h[i];return t+e},s=function(t,e,n,i,r){for(var o=[[]],a=0;a<=e;a++)o[0][a]=t[a];for(t=1;t<=e;t++)for(a=0;a<=e-t;a++)o[t]||(o[t]=[]),o[t][a]||(o[t][a]={}),o[t][a].x=(1-n)*o[t-1][a].x+n*o[t-1][a+1].x,o[t][a].y=(1-n)*o[t-1][a].y+n*o[t-1][a+1].y;if(null!=i)for(a=0;a<=e;a++)i[a]=o[a][0];if(null!=r)for(a=0;a<=e;a++)r[a]=o[e-a][a];return o[e][0]},l={},u=function(t,e){for(var n=function(t){if(!(e=l[t])){var e,n=function(t){return function(){return t}},i=function(){return function(t){return t}},r=function(){return function(t){return 1-t}},o=function(t){return function(e){for(var n=1,i=0;i<t.length;i++)n*=t[i](e);return n}};(e=[]).push(new function(){return function(e){return Math.pow(e,t)}});for(var a=1;a<t;a++){for(var s=[new n(t)],u=0;u<t-a;u++)s.push(new i);for(u=0;u<a;u++)s.push(new r);e.push(new o(s))}e.push(new function(){return function(e){return Math.pow(1-e,t)}}),l[t]=e}return e}(t.length-1),i=0,r=0,o=0;o<t.length;o++)i+=t[o].x*n[o](e),r+=t[o].y*n[o](e);return{x:i,y:r}},c=function(t,e,n){for(var i=u(t,e),r=0,o=n>0?1:-1,a=null;r<Math.abs(n);)a=u(t,e+=.005*o),r+=Math.sqrt(Math.pow(a.x-i.x,2)+Math.pow(a.y-i.y,2)),i=a;return{point:a,location:e}},d=function(t,e){var n=u(t,e),i=u(t.slice(0,t.length-1),e),r=i.y-n.y;n=i.x-n.x;return 0==r?1/0:Math.atan(r/n)};window.jsBezier={distanceFromCurve:o,gradientAtPoint:d,gradientAtPointAlongCurveFrom:function(t,e,n){return(e=c(t,e,n)).location>1&&(e.location=1),e.location<0&&(e.location=0),d(t,e.location)},nearestPointOnCurve:function(t,e){var n=o(t,e);return{point:s(e,e.length-1,n.location,null,null),location:n.location}},pointOnCurve:u,pointAlongCurveFrom:function(t,e,n){return c(t,e,n).point},perpendicularToCurveAt:function(t,e,n,i){return e=c(t,e,null==i?0:i),t=d(t,e.location),i=Math.atan(-1/t),t=n/2*Math.sin(i),n=n/2*Math.cos(i),[{x:e.point.x+n,y:e.point.y+t},{x:e.point.x-n,y:e.point.y-t}]},locationAlongCurveFrom:function(t,e,n){return c(t,e,n).location}}}(),
3
+ /*! jQuery UI - v1.8.24 - 2012-09-28
4
+ * https://github.com/jquery/jquery-ui
5
+ * Includes: jquery.ui.core.js
6
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
7
+ function(t,e){function n(e,n){var r=e.nodeName.toLowerCase();if("area"===r){var o,a=e.parentNode,s=a.name;return!(!e.href||!s||"map"!==a.nodeName.toLowerCase())&&(!!(o=t("img[usemap=#"+s+"]")[0])&&i(o))}return(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"==r&&e.href||n)&&i(e)}function i(e){return!t(e).parents().andSelf().filter((function(){return"hidden"===t.curCSS(this,"visibility")||t.expr.filters.hidden(this)})).length}t.ui=t.ui||{},t.ui.version||(t.extend(t.ui,{version:"1.8.24",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),t.fn.extend({propAttr:t.fn.prop||t.fn.attr,_focus:t.fn.focus,focus:function(e,n){return"number"==typeof e?this.each((function(){var i=this;setTimeout((function(){t(i).focus(),n&&n.call(i)}),e)})):this._focus.apply(this,arguments)},scrollParent:function(){var e;return e=t.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter((function(){return/(relative|absolute|fixed)/.test(t.curCSS(this,"position",1))&&/(auto|scroll)/.test(t.curCSS(this,"overflow",1)+t.curCSS(this,"overflow-y",1)+t.curCSS(this,"overflow-x",1))})).eq(0):this.parents().filter((function(){return/(auto|scroll)/.test(t.curCSS(this,"overflow",1)+t.curCSS(this,"overflow-y",1)+t.curCSS(this,"overflow-x",1))})).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(n){if(n!==e)return this.css("zIndex",n);if(this.length)for(var i,r,o=t(this[0]);o.length&&o[0]!==document;){if(("absolute"===(i=o.css("position"))||"relative"===i||"fixed"===i)&&(r=parseInt(o.css("zIndex"),10),!isNaN(r)&&0!==r))return r;o=o.parent()}return 0},disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",(function(t){t.preventDefault()}))},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],(function(n,i){function r(e,n,i,r){return t.each(o,(function(){n-=parseFloat(t.curCSS(e,"padding"+this,!0))||0,i&&(n-=parseFloat(t.curCSS(e,"border"+this+"Width",!0))||0),r&&(n-=parseFloat(t.curCSS(e,"margin"+this,!0))||0)})),n}var o="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),s={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(n){return n===e?s["inner"+i].call(this):this.each((function(){t(this).css(a,r(this,n)+"px")}))},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?s["outer"+i].call(this,e):this.each((function(){t(this).css(a,r(this,e,!0,n)+"px")}))}})),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo((function(e){return function(n){return!!t.data(n,e)}})):function(e,n,i){return!!t.data(e,i[3])},focusable:function(e){return n(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var i=t.attr(e,"tabindex"),r=isNaN(i);return(r||i>=0)&&n(e,!r)}}),t((function(){var e=document.body,n=e.appendChild(n=document.createElement("div"));n.offsetHeight,t.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),t.support.minHeight=100===n.offsetHeight,t.support.selectstart="onselectstart"in n,e.removeChild(n).style.display="none"})),t.curCSS||(t.curCSS=t.css),t.extend(t.ui,{plugin:{add:function(e,n,i){var r=t.ui[e].prototype;for(var o in i)r.plugins[o]=r.plugins[o]||[],r.plugins[o].push([n,i[o]])},call:function(t,e,n){var i=t.plugins[e];if(i&&t.element[0].parentNode)for(var r=0;r<i.length;r++)t.options[i[r][0]]&&i[r][1].apply(t.element,n)}},contains:function(t,e){return document.compareDocumentPosition?16&t.compareDocumentPosition(e):t!==e&&t.contains(e)},hasScroll:function(e,n){if("hidden"===t(e).css("overflow"))return!1;var i=n&&"left"===n?"scrollLeft":"scrollTop",r=!1;return e[i]>0||(e[i]=1,r=e[i]>0,e[i]=0,r)},isOverAxis:function(t,e,n){return t>e&&t<e+n},isOver:function(e,n,i,r,o,a){return t.ui.isOverAxis(e,i,o)&&t.ui.isOverAxis(n,r,a)}}))}(jQuery),
8
+ /*! jQuery UI - v1.8.24 - 2012-09-28
9
+ * https://github.com/jquery/jquery-ui
10
+ * Includes: jquery.ui.widget.js
11
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
12
+ function(t,e){if(t.cleanData){var n=t.cleanData;t.cleanData=function(e){for(var i,r=0;null!=(i=e[r]);r++)try{t(i).triggerHandler("remove")}catch(t){}n(e)}}else{var i=t.fn.remove;t.fn.remove=function(e,n){return this.each((function(){return n||(!e||t.filter(e,[this]).length)&&t("*",this).add([this]).each((function(){try{t(this).triggerHandler("remove")}catch(t){}})),i.call(t(this),e,n)}))}}t.widget=function(e,n,i){var r,o=e.split(".")[0];r=o+"-"+(e=e.split(".")[1]),i||(i=n,n=t.Widget),t.expr[":"][r]=function(n){return!!t.data(n,e)},t[o]=t[o]||{},t[o][e]=function(t,e){arguments.length&&this._createWidget(t,e)};var a=new n;a.options=t.extend(!0,{},a.options),t[o][e].prototype=t.extend(!0,a,{namespace:o,widgetName:e,widgetEventPrefix:t[o][e].prototype.widgetEventPrefix||e,widgetBaseClass:r},i),t.widget.bridge(e,t[o][e])},t.widget.bridge=function(n,i){t.fn[n]=function(r){var o="string"==typeof r,a=Array.prototype.slice.call(arguments,1),s=this;return r=!o&&a.length?t.extend.apply(null,[!0,r].concat(a)):r,o&&"_"===r.charAt(0)||(o?this.each((function(){var i=t.data(this,n),o=i&&t.isFunction(i[r])?i[r].apply(i,a):i;if(o!==i&&o!==e)return s=o,!1})):this.each((function(){var e=t.data(this,n);e?e.option(r||{})._init():t.data(this,n,new i(r,this))}))),s}},t.Widget=function(t,e){arguments.length&&this._createWidget(t,e)},t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(e,n){t.data(n,this.widgetName,this),this.element=t(n),this.options=t.extend(!0,{},this.options,this._getCreateOptions(),e);var i=this;this.element.bind("remove."+this.widgetName,(function(){i.destroy()})),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return t.metadata&&t.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(n,i){var r=n;if(0===arguments.length)return t.extend({},this.options);if("string"==typeof n){if(i===e)return this.options[n];(r={})[n]=i}return this._setOptions(r),this},_setOptions:function(e){var n=this;return t.each(e,(function(t,e){n._setOption(t,e)})),this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&this.widget()[e?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",e),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(e,n,i){var r,o,a=this.options[e];if(i=i||{},(n=t.Event(n)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),n.target=this.element[0],o=n.originalEvent)for(r in o)r in n||(n[r]=o[r]);return this.element.trigger(n,i),!(t.isFunction(a)&&!1===a.call(this.element[0],n,i)||n.isDefaultPrevented())}}}(jQuery),
13
+ /*! jQuery UI - v1.8.24 - 2012-09-28
14
+ * https://github.com/jquery/jquery-ui
15
+ * Includes: jquery.ui.mouse.js
16
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
17
+ function(t){var e=!1;t(document).mouseup((function(t){e=!1})),t.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,(function(t){return e._mouseDown(t)})).bind("click."+this.widgetName,(function(n){if(!0===t.data(n.target,e.widgetName+".preventClickEvent"))return t.removeData(n.target,e.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1})),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(n){if(!e){this._mouseStarted&&this._mouseUp(n),this._mouseDownEvent=n;var i=this,r=1==n.which,o=!("string"!=typeof this.options.cancel||!n.target.nodeName)&&t(n.target).closest(this.options.cancel).length;return!(r&&!o&&this._mouseCapture(n))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout((function(){i.mouseDelayMet=!0}),this.options.delay)),this._mouseDistanceMet(n)&&this._mouseDelayMet(n)&&(this._mouseStarted=!1!==this._mouseStart(n),!this._mouseStarted)?(n.preventDefault(),!0):(!0===t.data(n.target,this.widgetName+".preventClickEvent")&&t.removeData(n.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),n.preventDefault(),e=!0,!0))}},_mouseMove:function(e){return!t.browser.msie||document.documentMode>=9||e.button?this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted):this._mouseUp(e)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target==this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(t){return this.mouseDelayMet},_mouseStart:function(t){},_mouseDrag:function(t){},_mouseStop:function(t){},_mouseCapture:function(t){return!0}})}(jQuery),
18
+ /*! jQuery UI - v1.8.24 - 2012-09-28
19
+ * https://github.com/jquery/jquery-ui
20
+ * Includes: jquery.ui.position.js
21
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
22
+ function(t){t.ui=t.ui||{};var e=/left|center|right/,n=/top|center|bottom/,i="center",r={},o=t.fn.position,a=t.fn.offset;t.fn.position=function(a){if(!a||!a.of)return o.apply(this,arguments);a=t.extend({},a);var s,l,u,c=t(a.of),d=c[0],h=(a.collision||"flip").split(" "),f=a.offset?a.offset.split(" "):[0,0];return 9===d.nodeType?(s=c.width(),l=c.height(),u={top:0,left:0}):d.setTimeout?(s=c.width(),l=c.height(),u={top:c.scrollTop(),left:c.scrollLeft()}):d.preventDefault?(a.at="left top",s=l=0,u={top:a.of.pageY,left:a.of.pageX}):(s=c.outerWidth(),l=c.outerHeight(),u=c.offset()),t.each(["my","at"],(function(){var t=(a[this]||"").split(" ");1===t.length&&(t=e.test(t[0])?t.concat([i]):n.test(t[0])?[i].concat(t):[i,i]),t[0]=e.test(t[0])?t[0]:i,t[1]=n.test(t[1])?t[1]:i,a[this]=t})),1===h.length&&(h[1]=h[0]),f[0]=parseInt(f[0],10)||0,1===f.length&&(f[1]=f[0]),f[1]=parseInt(f[1],10)||0,"right"===a.at[0]?u.left+=s:a.at[0]===i&&(u.left+=s/2),"bottom"===a.at[1]?u.top+=l:a.at[1]===i&&(u.top+=l/2),u.left+=f[0],u.top+=f[1],this.each((function(){var e,n=t(this),o=n.outerWidth(),c=n.outerHeight(),d=parseInt(t.curCSS(this,"marginLeft",!0))||0,p=parseInt(t.curCSS(this,"marginTop",!0))||0,g=o+d+(parseInt(t.curCSS(this,"marginRight",!0))||0),m=c+p+(parseInt(t.curCSS(this,"marginBottom",!0))||0),v=t.extend({},u);"right"===a.my[0]?v.left-=o:a.my[0]===i&&(v.left-=o/2),"bottom"===a.my[1]?v.top-=c:a.my[1]===i&&(v.top-=c/2),r.fractions||(v.left=Math.round(v.left),v.top=Math.round(v.top)),e={left:v.left-d,top:v.top-p},t.each(["left","top"],(function(n,i){t.ui.position[h[n]]&&t.ui.position[h[n]][i](v,{targetWidth:s,targetHeight:l,elemWidth:o,elemHeight:c,collisionPosition:e,collisionWidth:g,collisionHeight:m,offset:f,my:a.my,at:a.at})})),t.fn.bgiframe&&n.bgiframe(),n.offset(t.extend(v,{using:a.using}))}))},t.ui.position={fit:{left:function(e,n){var i=t(window),r=n.collisionPosition.left+n.collisionWidth-i.width()-i.scrollLeft();e.left=r>0?e.left-r:Math.max(e.left-n.collisionPosition.left,e.left)},top:function(e,n){var i=t(window),r=n.collisionPosition.top+n.collisionHeight-i.height()-i.scrollTop();e.top=r>0?e.top-r:Math.max(e.top-n.collisionPosition.top,e.top)}},flip:{left:function(e,n){if(n.at[0]!==i){var r=t(window),o=n.collisionPosition.left+n.collisionWidth-r.width()-r.scrollLeft(),a="left"===n.my[0]?-n.elemWidth:"right"===n.my[0]?n.elemWidth:0,s="left"===n.at[0]?n.targetWidth:-n.targetWidth,l=-2*n.offset[0];e.left+=n.collisionPosition.left<0||o>0?a+s+l:0}},top:function(e,n){if(n.at[1]!==i){var r=t(window),o=n.collisionPosition.top+n.collisionHeight-r.height()-r.scrollTop(),a="top"===n.my[1]?-n.elemHeight:"bottom"===n.my[1]?n.elemHeight:0,s="top"===n.at[1]?n.targetHeight:-n.targetHeight,l=-2*n.offset[1];e.top+=n.collisionPosition.top<0||o>0?a+s+l:0}}}},t.offset.setOffset||(t.offset.setOffset=function(e,n){/static/.test(t.curCSS(e,"position"))&&(e.style.position="relative");var i=t(e),r=i.offset(),o=parseInt(t.curCSS(e,"top",!0),10)||0,a=parseInt(t.curCSS(e,"left",!0),10)||0,s={top:n.top-r.top+o,left:n.left-r.left+a};"using"in n?n.using.call(e,s):i.css(s)},t.fn.offset=function(e){var n=this[0];return n&&n.ownerDocument?e?t.isFunction(e)?this.each((function(n){t(this).offset(e.call(this,n,t(this).offset()))})):this.each((function(){t.offset.setOffset(this,e)})):a.call(this):null}),t.curCSS||(t.curCSS=t.css),function(){var e,n,i,o,a,s=document.getElementsByTagName("body")[0],l=document.createElement("div");for(var u in e=document.createElement(s?"div":"body"),i={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},s&&t.extend(i,{position:"absolute",left:"-1000px",top:"-1000px"}),i)e.style[u]=i[u];e.appendChild(l),(n=s||document.documentElement).insertBefore(e,n.firstChild),l.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",o=t(l).offset((function(t,e){return e})).offset(),e.innerHTML="",n.removeChild(e),a=o.top+o.left+(s?2e3:0),r.fractions=a>21&&a<22}()}(jQuery),
23
+ /*! jQuery UI - v1.8.24 - 2012-09-28
24
+ * https://github.com/jquery/jquery-ui
25
+ * Includes: jquery.ui.resizable.js
26
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
27
+ function(t){t.widget("ui.resizable",t.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var e=this,n=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=n.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor==String){"all"==this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");var i=this.handles.split(",");this.handles={};for(var r=0;r<i.length;r++){var o=t.trim(i[r]),a=t('<div class="ui-resizable-handle '+("ui-resizable-"+o)+'"></div>');a.css({zIndex:n.zIndex}),"se"==o&&a.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[o]=".ui-resizable-"+o,this.element.append(a)}}this._renderAxis=function(e){for(var n in e=e||this.element,this.handles){if(this.handles[n].constructor==String&&(this.handles[n]=t(this.handles[n],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var i,r=t(this.handles[n],this.element);i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth();var o=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");e.css(o,i),this._proportionallyResize()}t(this.handles[n]).length}},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover((function(){if(!e.resizing){if(this.className)var t=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);e.axis=t&&t[1]?t[1]:"se"}})),n.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").hover((function(){n.disabled||(t(this).removeClass("ui-resizable-autohide"),e._handles.show())}),(function(){n.disabled||e.resizing||(t(this).addClass("ui-resizable-autohide"),e._handles.hide())}))),this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var n=this.element;n.after(this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")})).remove()}return this.originalElement.css("resize",this.originalResizeStyle),e(this.originalElement),this},_mouseCapture:function(e){var n=!1;for(var i in this.handles)t(this.handles[i])[0]==e.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(n){var i=this.options,r=this.element.position(),o=this.element;this.resizing=!0,this.documentScroll={top:t(document).scrollTop(),left:t(document).scrollLeft()},(o.is(".ui-draggable")||/absolute/.test(o.css("position")))&&o.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy();var a=e(this.helper.css("left")),s=e(this.helper.css("top"));i.containment&&(a+=t(i.containment).scrollLeft()||0,s+=t(i.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:a,top:s},this.size=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.originalPosition={left:a,top:s},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalMousePosition={left:n.pageX,top:n.pageY},this.aspectRatio="number"==typeof i.aspectRatio?i.aspectRatio:this.originalSize.width/this.originalSize.height||1;var l=t(".ui-resizable-"+this.axis).css("cursor");return t("body").css("cursor","auto"==l?this.axis+"-resize":l),o.addClass("ui-resizable-resizing"),this._propagate("start",n),!0},_mouseDrag:function(e){var n=this.helper,i=(this.options,this.originalMousePosition),r=this.axis,o=e.pageX-i.left||0,a=e.pageY-i.top||0,s=this._change[r];if(!s)return!1;var l=s.apply(this,[e,o,a]);t.browser.msie&&t.browser.version,this.sizeDiff;return this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(l=this._updateRatio(l,e)),l=this._respectSize(l,e),this._propagate("resize",e),n.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",e,this.ui()),!1},_mouseStop:function(e){this.resizing=!1;var n=this.options,i=this;if(this._helper){var r=this._proportionallyResizeElements,o=r.length&&/textarea/i.test(r[0].nodeName),a=o&&t.ui.hasScroll(r[0],"left")?0:i.sizeDiff.height,s=o?0:i.sizeDiff.width,l={width:i.helper.width()-s,height:i.helper.height()-a},u=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;n.animate||this.element.css(t.extend(l,{top:c,left:u})),i.helper.height(i.size.height),i.helper.width(i.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,i,r,o,a,s=this.options;a={minWidth:n(s.minWidth)?s.minWidth:0,maxWidth:n(s.maxWidth)?s.maxWidth:1/0,minHeight:n(s.minHeight)?s.minHeight:0,maxHeight:n(s.maxHeight)?s.maxHeight:1/0},(this._aspectRatio||t)&&(e=a.minHeight*this.aspectRatio,r=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,o=a.maxWidth/this.aspectRatio,e>a.minWidth&&(a.minWidth=e),r>a.minHeight&&(a.minHeight=r),i<a.maxWidth&&(a.maxWidth=i),o<a.maxHeight&&(a.maxHeight=o)),this._vBoundaries=a},_updateCache:function(t){this.options;this.offset=this.helper.offset(),n(t.left)&&(this.position.left=t.left),n(t.top)&&(this.position.top=t.top),n(t.height)&&(this.size.height=t.height),n(t.width)&&(this.size.width=t.width)},_updateRatio:function(t,e){this.options;var i=this.position,r=this.size,o=this.axis;return n(t.height)?t.width=t.height*this.aspectRatio:n(t.width)&&(t.height=t.width/this.aspectRatio),"sw"==o&&(t.left=i.left+(r.width-t.width),t.top=null),"nw"==o&&(t.top=i.top+(r.height-t.height),t.left=i.left+(r.width-t.width)),t},_respectSize:function(t,e){this.helper;var i=this._vBoundaries,r=(this._aspectRatio||e.shiftKey,this.axis),o=n(t.width)&&i.maxWidth&&i.maxWidth<t.width,a=n(t.height)&&i.maxHeight&&i.maxHeight<t.height,s=n(t.width)&&i.minWidth&&i.minWidth>t.width,l=n(t.height)&&i.minHeight&&i.minHeight>t.height;s&&(t.width=i.minWidth),l&&(t.height=i.minHeight),o&&(t.width=i.maxWidth),a&&(t.height=i.maxHeight);var u=this.originalPosition.left+this.originalSize.width,c=this.position.top+this.size.height,d=/sw|nw|w/.test(r),h=/nw|ne|n/.test(r);s&&d&&(t.left=u-i.minWidth),o&&d&&(t.left=u-i.maxWidth),l&&h&&(t.top=c-i.minHeight),a&&h&&(t.top=c-i.maxHeight);var f=!t.width&&!t.height;return f&&!t.left&&t.top?t.top=null:f&&!t.top&&t.left&&(t.left=null),t},_proportionallyResize:function(){this.options;if(this._proportionallyResizeElements.length)for(var e=this.helper||this.element,n=0;n<this._proportionallyResizeElements.length;n++){var i=this._proportionallyResizeElements[n];if(!this.borderDif){var r=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],o=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")];this.borderDif=t.map(r,(function(t,e){return(parseInt(t,10)||0)+(parseInt(o[e],10)||0)}))}t.browser.msie&&(t(e).is(":hidden")||t(e).parents(":hidden").length)||i.css({height:e.height()-this.borderDif[0]-this.borderDif[2]||0,width:e.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var e=this.element,n=this.options;if(this.elementOffset=e.offset(),this._helper){this.helper=this.helper||t('<div style="overflow:hidden;"></div>');var i=t.browser.msie&&t.browser.version<7,r=i?1:0,o=i?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+o,height:this.element.outerHeight()+o,position:"absolute",left:this.elementOffset.left-r+"px",top:this.elementOffset.top-r+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(t,e,n){return{width:this.originalSize.width+e}},w:function(t,e,n){this.options;var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,n){this.options;var i=this.originalSize;return{top:this.originalPosition.top+n,height:i.height-n}},s:function(t,e,n){return{height:this.originalSize.height+n}},se:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,n,i]))},sw:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,n,i]))},ne:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,n,i]))},nw:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,n,i]))}},_propagate:function(e,n){t.ui.plugin.call(this,e,[n,this.ui()]),"resize"!=e&&this._trigger(e,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.extend(t.ui.resizable,{version:"1.8.24"}),t.ui.plugin.add("resizable","alsoResize",{start:function(e,n){var i=t(this).data("resizable").options,r=function(e){t(e).each((function(){var e=t(this);e.data("resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})}))};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?r(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],r(i.alsoResize)):t.each(i.alsoResize,(function(t){r(t)}))},resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.originalSize,a=i.originalPosition,s={height:i.size.height-o.height||0,width:i.size.width-o.width||0,top:i.position.top-a.top||0,left:i.position.left-a.left||0},l=function(e,i){t(e).each((function(){var e=t(this),r=t(this).data("resizable-alsoresize"),o={},a=i&&i.length?i:e.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(a,(function(t,e){var n=(r[e]||0)+(s[e]||0);n&&n>=0&&(o[e]=n||null)})),e.css(o)}))};"object"!=typeof r.alsoResize||r.alsoResize.nodeType?l(r.alsoResize):t.each(r.alsoResize,(function(t,e){l(t,e)}))},stop:function(e,n){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","animate",{stop:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i._proportionallyResizeElements,a=o.length&&/textarea/i.test(o[0].nodeName),s=a&&t.ui.hasScroll(o[0],"left")?0:i.sizeDiff.height,l=a?0:i.sizeDiff.width,u={width:i.size.width-l,height:i.size.height-s},c=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,d=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(u,d&&c?{top:d,left:c}:{}),{duration:r.animateDuration,easing:r.animateEasing,step:function(){var n={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};o&&o.length&&t(o[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(n,i){var r=t(this).data("resizable"),o=r.options,a=r.element,s=o.containment,l=s instanceof t?s.get(0):/parent/.test(s)?a.parent().get(0):s;if(l)if(r.containerElement=t(l),/document/.test(s)||s==document)r.containerOffset={left:0,top:0},r.containerPosition={left:0,top:0},r.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight};else{var u=t(l),c=[];t(["Top","Right","Left","Bottom"]).each((function(t,n){c[t]=e(u.css("padding"+n))})),r.containerOffset=u.offset(),r.containerPosition=u.position(),r.containerSize={height:u.innerHeight()-c[3],width:u.innerWidth()-c[1]};var d=r.containerOffset,h=r.containerSize.height,f=r.containerSize.width,p=t.ui.hasScroll(l,"left")?l.scrollWidth:f,g=t.ui.hasScroll(l)?l.scrollHeight:h;r.parentData={element:l,left:d.left,top:d.top,width:p,height:g}}},resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=(i.containerSize,i.containerOffset),a=(i.size,i.position),s=i._aspectRatio||e.shiftKey,l={top:0,left:0},u=i.containerElement;u[0]!=document&&/static/.test(u.css("position"))&&(l=o),a.left<(i._helper?o.left:0)&&(i.size.width=i.size.width+(i._helper?i.position.left-o.left:i.position.left-l.left),s&&(i.size.height=i.size.width/i.aspectRatio),i.position.left=r.helper?o.left:0),a.top<(i._helper?o.top:0)&&(i.size.height=i.size.height+(i._helper?i.position.top-o.top:i.position.top),s&&(i.size.width=i.size.height*i.aspectRatio),i.position.top=i._helper?o.top:0),i.offset.left=i.parentData.left+i.position.left,i.offset.top=i.parentData.top+i.position.top;var c=Math.abs((i._helper,i.offset.left-l.left+i.sizeDiff.width)),d=Math.abs((i._helper?i.offset.top-l.top:i.offset.top-o.top)+i.sizeDiff.height),h=i.containerElement.get(0)==i.element.parent().get(0),f=/relative|absolute/.test(i.containerElement.css("position"));h&&f&&(c-=i.parentData.left),c+i.size.width>=i.parentData.width&&(i.size.width=i.parentData.width-c,s&&(i.size.height=i.size.width/i.aspectRatio)),d+i.size.height>=i.parentData.height&&(i.size.height=i.parentData.height-d,s&&(i.size.width=i.size.height*i.aspectRatio))},stop:function(e,n){var i=t(this).data("resizable"),r=i.options,o=(i.position,i.containerOffset),a=i.containerPosition,s=i.containerElement,l=t(i.helper),u=l.offset(),c=l.outerWidth()-i.sizeDiff.width,d=l.outerHeight()-i.sizeDiff.height;i._helper&&!r.animate&&/relative/.test(s.css("position"))&&t(this).css({left:u.left-a.left-o.left,width:c,height:d}),i._helper&&!r.animate&&/static/.test(s.css("position"))&&t(this).css({left:u.left-a.left-o.left,width:c,height:d})}}),t.ui.plugin.add("resizable","ghost",{start:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.size;i.ghost=i.originalElement.clone(),i.ghost.css({opacity:.25,display:"block",position:"relative",height:o.height,width:o.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof r.ghost?r.ghost:""),i.ghost.appendTo(i.helper)},resize:function(e,n){var i=t(this).data("resizable");i.options;i.ghost&&i.ghost.css({position:"relative",height:i.size.height,width:i.size.width})},stop:function(e,n){var i=t(this).data("resizable");i.options;i.ghost&&i.helper&&i.helper.get(0).removeChild(i.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.size,a=i.originalSize,s=i.originalPosition,l=i.axis;r._aspectRatio||e.shiftKey;r.grid="number"==typeof r.grid?[r.grid,r.grid]:r.grid;var u=Math.round((o.width-a.width)/(r.grid[0]||1))*(r.grid[0]||1),c=Math.round((o.height-a.height)/(r.grid[1]||1))*(r.grid[1]||1);/^(se|s|e)$/.test(l)?(i.size.width=a.width+u,i.size.height=a.height+c):/^(ne)$/.test(l)?(i.size.width=a.width+u,i.size.height=a.height+c,i.position.top=s.top-c):/^(sw)$/.test(l)?(i.size.width=a.width+u,i.size.height=a.height+c,i.position.left=s.left-u):(i.size.width=a.width+u,i.size.height=a.height+c,i.position.top=s.top-c,i.position.left=s.left-u)}});var e=function(t){return parseInt(t,10)||0},n=function(t){return!isNaN(parseInt(t,10))}}(jQuery),
28
+ /*! jQuery UI - v1.8.24 - 2012-09-28
29
+ * https://github.com/jquery/jquery-ui
30
+ * Includes: jquery.ui.slider.js
31
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
32
+ function(t){t.widget("ui.slider",t.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var e=this,n=this.options,i=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),r=n.values&&n.values.length||1,o=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"+(n.disabled?" ui-slider-disabled ui-disabled":"")),this.range=t([]),n.range&&(!0===n.range&&(n.values||(n.values=[this._valueMin(),this._valueMin()]),n.values.length&&2!==n.values.length&&(n.values=[n.values[0],n.values[0]])),this.range=t("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+("min"===n.range||"max"===n.range?" ui-slider-range-"+n.range:"")));for(var a=i.length;a<r;a+=1)o.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");this.handles=i.add(t(o.join("")).appendTo(e.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click((function(t){t.preventDefault()})).hover((function(){n.disabled||t(this).addClass("ui-state-hover")}),(function(){t(this).removeClass("ui-state-hover")})).focus((function(){n.disabled?t(this).blur():(t(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),t(this).addClass("ui-state-focus"))})).blur((function(){t(this).removeClass("ui-state-focus")})),this.handles.each((function(e){t(this).data("index.ui-slider-handle",e)})),this.handles.keydown((function(n){var i,r,o,a=t(this).data("index.ui-slider-handle");if(!e.options.disabled){switch(n.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n.preventDefault(),!e._keySliding&&(e._keySliding=!0,t(this).addClass("ui-state-active"),!1===e._start(n,a)))return}switch(o=e.options.step,i=r=e.options.values&&e.options.values.length?e.values(a):e.value(),n.keyCode){case t.ui.keyCode.HOME:r=e._valueMin();break;case t.ui.keyCode.END:r=e._valueMax();break;case t.ui.keyCode.PAGE_UP:r=e._trimAlignValue(i+(e._valueMax()-e._valueMin())/5);break;case t.ui.keyCode.PAGE_DOWN:r=e._trimAlignValue(i-(e._valueMax()-e._valueMin())/5);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(i===e._valueMax())return;r=e._trimAlignValue(i+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i===e._valueMin())return;r=e._trimAlignValue(i-o)}e._slide(n,a,r)}})).keyup((function(n){var i=t(this).data("index.ui-slider-handle");e._keySliding&&(e._keySliding=!1,e._stop(n,i),e._change(n,i),t(this).removeClass("ui-state-active"))})),this._refreshValue(),this._animateOff=!1},destroy:function(){return this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouseCapture:function(e){var n,i,r,o,a,s,l,u,c=this.options;return!c.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(n),r=this._valueMax()-this._valueMin()+1,a=this,this.handles.each((function(e){var n=Math.abs(i-a.values(e));r>n&&(r=n,o=t(this),s=e)})),!0===c.range&&this.values(1)===c.min&&(s+=1,o=t(this.handles[s])),!1!==this._start(e,s)&&(this._mouseSliding=!0,a._handleIndex=s,o.addClass("ui-state-active").focus(),l=o.offset(),u=!t(e.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=u?{left:0,top:0}:{left:e.pageX-l.left-o.width()/2,top:e.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,s,i),this._animateOff=!0,!0))},_mouseStart:function(t){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},n=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,n),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,n,i,r,o;return"horizontal"===this.orientation?(e=this.elementSize.width,n=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,n=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),(i=n/e)>1&&(i=1),i<0&&(i=0),"vertical"===this.orientation&&(i=1-i),r=this._valueMax()-this._valueMin(),o=this._valueMin()+i*r,this._trimAlignValue(o)},_start:function(t,e){var n={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(e),n.values=this.values()),this._trigger("start",t,n)},_slide:function(t,e,n){var i,r,o;this.options.values&&this.options.values.length?(i=this.values(e?0:1),2===this.options.values.length&&!0===this.options.range&&(0===e&&n>i||1===e&&n<i)&&(n=i),n!==this.values(e)&&((r=this.values())[e]=n,o=this._trigger("slide",t,{handle:this.handles[e],value:n,values:r}),i=this.values(e?0:1),!1!==o&&this.values(e,n,!0))):n!==this.value()&&(!1!==(o=this._trigger("slide",t,{handle:this.handles[e],value:n}))&&this.value(n))},_stop:function(t,e){var n={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(e),n.values=this.values()),this._trigger("stop",t,n)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(e),n.values=this.values()),this._trigger("change",t,n)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(e,n){var i,r,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(n),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(i=this.options.values,r=arguments[0],o=0;o<i.length;o+=1)i[o]=this._trimAlignValue(r[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,n){var i,r=0;switch(t.isArray(this.options.values)&&(r=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"disabled":n?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=0;i<r;i+=1)this._change(null,i);this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,n,i;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);for(n=this.options.values.slice(),i=0;i<n.length;i+=1)n[i]=this._trimAlignValue(n[i]);return n},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,n=(t-this._valueMin())%e,i=t-n;return 2*Math.abs(n)>=e&&(i+=n>0?e:-e),parseFloat(i.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,n,i,r,o,a=this.options.range,s=this.options,l=this,u=!this._animateOff&&s.animate,c={};this.options.values&&this.options.values.length?this.handles.each((function(i,r){e=(l.values(i)-l._valueMin())/(l._valueMax()-l._valueMin())*100,c["horizontal"===l.orientation?"left":"bottom"]=e+"%",t(this).stop(1,1)[u?"animate":"css"](c,s.animate),!0===l.options.range&&("horizontal"===l.orientation?(0===i&&l.range.stop(1,1)[u?"animate":"css"]({left:e+"%"},s.animate),1===i&&l.range[u?"animate":"css"]({width:e-n+"%"},{queue:!1,duration:s.animate})):(0===i&&l.range.stop(1,1)[u?"animate":"css"]({bottom:e+"%"},s.animate),1===i&&l.range[u?"animate":"css"]({height:e-n+"%"},{queue:!1,duration:s.animate}))),n=e})):(i=this.value(),r=this._valueMin(),o=this._valueMax(),e=o!==r?(i-r)/(o-r)*100:0,c["horizontal"===l.orientation?"left":"bottom"]=e+"%",this.handle.stop(1,1)[u?"animate":"css"](c,s.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({width:e+"%"},s.animate),"max"===a&&"horizontal"===this.orientation&&this.range[u?"animate":"css"]({width:100-e+"%"},{queue:!1,duration:s.animate}),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({height:e+"%"},s.animate),"max"===a&&"vertical"===this.orientation&&this.range[u?"animate":"css"]({height:100-e+"%"},{queue:!1,duration:s.animate}))}}),t.extend(t.ui.slider,{version:"1.8.24"})}(jQuery);var SVG_ARROW_POLYGON="0,3 12,3 12,0 18,5 12,10 12,7 0,7",SVG_ARROW_HEIGHT=10,curVisualizerID=1;function ExecutionVisualizer(t,e,n){if(this.curInputCode=e.code.rtrim(),this.curTrace=e.trace,this.DEFAULT_EMBEDDED_CODE_DIV_WIDTH=350,this.DEFAULT_EMBEDDED_CODE_DIV_HEIGHT=400,this.curTrace.length>0){var i=this.curTrace[this.curTrace.length-1];"raw_input"==i.event?(this.promptForUserInput=!0,this.userInputPromptStr=htmlspecialchars(i.prompt),this.curTrace.pop()):"mouse_input"==i.event&&(this.promptForMouseInput=!0,this.userInputPromptStr=htmlspecialchars(i.prompt),this.curTrace.pop())}this.curInstr=0,this.params=n,this.params||(this.params={});var r=void 0!==this.params.arrowLines,o=void 0!==this.params.highlightLines;r||o?r&&o||(r?this.params.highlightLines=!this.params.arrowLines:this.params.arrowLines=!this.params.highlightLines):(this.params.highlightLines=!1,this.params.arrowLines=!0),this.compactFuncLabels=this.params.compactFuncLabels,this.params.pyCrazyMode&&(this.params.arrowLines=this.params.highlightLines=!1),this.params.visualizerIdOverride?this.visualizerID=this.params.visualizerIdOverride:(this.visualizerID=curVisualizerID,curVisualizerID++),this.leftGutterSvgInitialized=!1,this.arrowOffsetY=void 0,this.codeRowHeight=void 0,this.disableHeapNesting=1==this.params.disableHeapNesting,this.drawParentPointers=1==this.params.drawParentPointers,this.textualMemoryLabels=1==this.params.textualMemoryLabels,this.showOnlyOutputs=1==this.params.showOnlyOutputs,this.tabularView=1==this.params.tabularView,this.showAllFrameLabels=1==this.params.showAllFrameLabels,this.executeCodeWithRawInputFunc=this.params.executeCodeWithRawInputFunc,this.jsPlumbInstance=jsPlumb.getInstance({Endpoint:["Dot",{radius:3}],EndpointStyles:[{fillStyle:connectorBaseColor},{fillstyle:null}],Anchors:["RightMiddle","LeftMiddle"],PaintStyle:{lineWidth:1,strokeStyle:connectorBaseColor},Connector:["StateMachine"],Overlays:[["Arrow",{length:10,width:7,foldback:.55,location:1}]],EndpointHoverStyles:[{fillStyle:connectorHighlightColor},{fillstyle:null}],HoverPaintStyle:{lineWidth:1,strokeStyle:connectorHighlightColor}});var a;this.domRoot=$("#"+t),this.domRoot.data("vis",this),this.domRootD3=d3.select("#"+t),this.domRoot.html('<div class="ExecutionVisualizer"></div>'),this.domRoot=this.domRoot.find("div.ExecutionVisualizer"),this.domRootD3=this.domRootD3.select("div.ExecutionVisualizer"),this.codeOutputLines=null,this.breakpoints=null,this.sortedBreakpointsList=[],this.classAttrsHidden={},this.pytutor_hooks={},"java"===this.params.lang&&this.activateJavaFrontend(),this.numStdoutLines=0;for(var s=this.curTrace.length-1;s>=0&&!(a=this.curTrace[s].stdout);s--);a&&(this.numStdoutLines=a.rtrim().split("\n").length),this.try_hook("end_constructor",{myViz:this}),this.hasRendered=!1,this.render()}function htmlWithHighlight(t,e,n,i){var r="";e>0&&(r=t.slice(0,e));var o=t.slice(e,e+n),a="";return e+n<t.length&&(a=t.slice(e+n,t.length)),htmlspecialchars(r)+'<span class="'+i+'">'+htmlspecialchars(o)+"</span>"+htmlspecialchars(a)}ExecutionVisualizer.prototype.add_pytutor_hook=function(t,e){this.pytutor_hooks[t]?this.pytutor_hooks[t].push(e):this.pytutor_hooks[t]=[e]},ExecutionVisualizer.prototype.try_hook=function(t,e){if(this.pytutor_hooks[t])for(var n=0;n<this.pytutor_hooks[t].length;n++){var i=this.pytutor_hooks[t][n].apply(null,[e]);if(i&&i[0])return i}return[!1]},ExecutionVisualizer.prototype.resetJsPlumbManager=function(){this.jsPlumbManager={heap_pointer_src_id:1,connectionEndpointIDs:d3.map(),heapConnectionEndpointIDs:d3.map(),parentPointerConnectionEndpointIDs:d3.map(),renderedHeapObjectIDs:d3.map()}},ExecutionVisualizer.prototype.generateID=function(t){return"v"+this.visualizerID+"__"+t},ExecutionVisualizer.prototype.generateHeapObjID=function(t,e){return this.generateID("heap_object_"+t+"_s"+e)},ExecutionVisualizer.prototype.render=function(){if(this.hasRendered)alert("ERROR: You should only call render() ONCE on an ExecutionVisualizer object.");else{var t=this,e='<div id="codeDisplayDiv"> <div id="langDisplayDiv"></div> <div id="pyCodeOutputDiv"/> <div id="editCodeLinkDiv"><a id="editBtn">Edit code</a> <span id="liveModeSpan" style="display: none;">| <a id="editLiveModeBtn" href="#">Live programming</a></a> </div> <div id="legendDiv"/> <div id="executionSliderDocs"></div> <div id="executionSlider"/> <div id="executionSliderFooter"/> <div id="vcrControls"> <button id="jmpFirstInstr", type="button">&lt;&lt; First</button> <button id="jmpStepBack", type="button">&lt; Back</button> <span id="curInstr">Step ? of ?</span> <button id="jmpStepFwd", type="button">Forward &gt;</button> <button id="jmpLastInstr", type="button">Last &gt;&gt;</button> </div> <div id="rawUserInputDiv"> <span id="userInputPromptStr"/> <input type="text" id="raw_input_textbox" size="30"/> <button id="raw_input_submit_btn">Submit</button> </div> <div id="errorOutput"/> <div id="stepAnnotationDiv"> <textarea class="annotationText" id="stepAnnotationEditor" cols="60" rows="3"></textarea> <div class="annotationText" id="stepAnnotationViewer"></div> </div> <div id="annotateLinkDiv"><button id="annotateBtn" type="button">Annotate this step</button></div> </div>',n='<div id="htmlOutputDiv"></div> <div id="progOutputs"> <div id="printOutputDocs">Print output (drag lower right corner to resize)</div>\n <textarea id="pyStdout" cols="40" rows="5" wrap="off" readonly></textarea> </div>',i='<div id="dataViz"> <table id="stackHeapTable"> <tr> <td id="stack_td"> <div id="globals_area"> <div id="stackHeader">Frames</div> </div> <div id="stack"></div> </td> <td id="heap_td"> <div id="heap"> <div id="heapHeader">Objects</div> </div> </td> </tr> </table> </div>';t.tabularView&&(i='<div id="optTabularView"></div>');var r='<div id="vizHeader"> <textarea class="vizTitleText" id="vizTitleEditor" cols="60" rows="1"></textarea> <div class="vizTitleText" id="vizTitleViewer"></div> <textarea class="vizDescriptionText" id="vizDescriptionEditor" cols="75" rows="2"></textarea> <div class="vizDescriptionText" id="vizDescriptionViewer"></div> </div>';if(this.params.verticalStack?this.domRoot.html(r+'<table border="0" class="visualizer"><tr><td class="vizLayoutTd" id="vizLayoutTdFirst"">'+e+'</td></tr><tr><td class="vizLayoutTd" id="vizLayoutTdSecond">'+i+"</td></tr></table>"):this.domRoot.html(r+'<table border="0" class="visualizer"><tr><td class="vizLayoutTd" id="vizLayoutTdFirst">'+e+'</td><td class="vizLayoutTd" id="vizLayoutTdSecond">'+i+"</td></tr></table>"),this.showOnlyOutputs)t.domRoot.find("#dataViz").hide(),this.domRoot.find("#vizLayoutTdSecond").append(n),this.params.verticalStack?this.domRoot.find("#vizLayoutTdSecond").css("padding-top","25px"):this.domRoot.find("#vizLayoutTdSecond").css("padding-left","25px");else{var o="75px";this.numStdoutLines<=3&&(o=18*this.numStdoutLines+"px"),this.params.embeddedMode&&(o="45px"),this.domRoot.find("#vizLayoutTdSecond").prepend(n),this.domRoot.find("#pyStdout").width("350px").height(o).resizable()}if(this.params.arrowLines?(this.domRoot.find("#legendDiv").append('<svg id="prevLegendArrowSVG"/> line that has just executed').append('<p style="margin-top: 4px"><svg id="curLegendArrowSVG"/> next line to execute</p>'),t.domRootD3.select("svg#prevLegendArrowSVG").append("polygon").attr("points",SVG_ARROW_POLYGON).attr("fill",lightArrowColor),t.domRootD3.select("svg#curLegendArrowSVG").append("polygon").attr("points",SVG_ARROW_POLYGON).attr("fill",darkArrowColor)):this.params.highlightLines?t.domRoot.find("#legendDiv").append('<span class="highlight-legend highlight-prev">line that has just executed</span> ').append('<span class="highlight-legend highlight-cur">next line to execute</span>'):this.params.pyCrazyMode&&t.domRoot.find("#legendDiv").append('<a href="https://github.com/pgbovine/Py2crazy">Py2crazy</a> mode!').append(" Stepping through (roughly) each executed expression. Color codes:<p/>").append('<span class="pycrazy-highlight-prev">expression that just executed</span><br/>').append('<span class="pycrazy-highlight-cur">next expression to execute</span>'),this.params.editCodeBaseURL){var a="2";"js"===this.params.lang?a="js":"ts"===this.params.lang?a="ts":"java"===this.params.lang?a="java":"py3"===this.params.lang?a="3":"c"===this.params.lang?a="c":"cpp"===this.params.lang&&(a="cpp");var s=$.param.fragment(this.params.editCodeBaseURL,{code:this.curInputCode,py:a},2);this.domRoot.find("#editBtn").attr("href",s)}else this.domRoot.find("#editCodeLinkDiv").hide(),this.domRoot.find("#editBtn").attr("href","#"),this.domRoot.find("#editBtn").click((function(){return!1}));if(void 0!==this.params.lang&&("js"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("JavaScript"):"ts"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("TypeScript"):"ruby"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("Ruby"):"java"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("Java"):"py2"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("Python 2.7"):"py3"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("Python 3.3"):"c"===this.params.lang?this.domRoot.find("#langDisplayDiv").html('C (gcc 4.8, C11) <font color="#e93f34">EXPERIMENTAL!</font><br/>see <a href="https://github.com/pgbovine/opt-cpp-backend/issues" target="_blank">known bugs</a> and report to philip@pgbovine.net'):"cpp"===this.params.lang?this.domRoot.find("#langDisplayDiv").html('C++ (gcc 4.8, C++11) <font color="#e93f34">EXPERIMENTAL!</font><br/>see <a href="https://github.com/pgbovine/opt-cpp-backend/issues" target="_blank">known bugs</a> and report to philip@pgbovine.net'):this.domRoot.find("#langDisplayDiv").hide()),void 0!==this.params.allowEditAnnotations?this.allowEditAnnotations=this.params.allowEditAnnotations:this.allowEditAnnotations=!1,void 0!==this.params.pyCrazyMode?this.pyCrazyMode=this.params.pyCrazyMode:this.pyCrazyMode=!1,this.domRoot.find("#stepAnnotationEditor").hide(),this.params.embeddedMode&&(this.embeddedMode=!0,void 0===this.params.codeDivWidth&&(this.params.codeDivWidth=this.DEFAULT_EMBEDDED_CODE_DIV_WIDTH),void 0===this.params.codeDivHeight&&(this.params.codeDivHeight=this.DEFAULT_EMBEDDED_CODE_DIV_HEIGHT),this.allowEditAnnotations=!1,this.domRoot.find("#codeDisplayDiv").append('<div style="font-size: 8pt; margin-bottom: 20px;">Visualized using <a href="http://pythontutor.com" target="_blank" style="color: #3D58A2;">Online Python Tutor</a> by <a href="http://www.pgbovine.net/" target="_blank" style="color: #3D58A2;">Philip Guo</a></div>'),t.domRoot.find("#executionSliderDocs").hide()),t.editAnnotationMode=!1,this.allowEditAnnotations){var l=this.domRoot.find("#annotateBtn");l.click((function(){t.editAnnotationMode?(t.enterViewAnnotationsMode(),t.domRoot.find("#jmpFirstInstr,#jmpLastInstr,#jmpStepBack,#jmpStepFwd,#executionSlider,#editCodeLinkDiv,#stepAnnotationViewer").show(),t.domRoot.find("#stepAnnotationEditor").hide(),l.html("Annotate this step")):(t.enterEditAnnotationsMode(),t.domRoot.find("#jmpFirstInstr,#jmpLastInstr,#jmpStepBack,#jmpStepFwd,#executionSlider,#editCodeLinkDiv,#stepAnnotationViewer").hide(),t.domRoot.find("#stepAnnotationEditor").show(),l.html("Done annotating"))}))}else this.domRoot.find("#annotateBtn").hide();this.params.codeDivWidth&&this.params.codeDivWidth<470&&(this.domRoot.find("#jmpFirstInstr").hide(),this.domRoot.find("#jmpLastInstr").hide()),this.params.codeDivWidth&&this.domRoot.find("#codeDisplayDiv").width(this.params.codeDivWidth),this.domRoot.find("#codeDisplayDiv").resizable({handles:"e",minWidth:100,resize:function(e,n){t.domRoot.find("#codeDisplayDiv").css("height","auto"),t.renderSliderBreakpoints(),t.params.updateOutputCallback&&t.params.updateOutputCallback(this)}}),this.params.codeDivHeight&&this.domRoot.find("#pyCodeOutputDiv").css("max-height",this.params.codeDivHeight+"px"),this.domRoot.find("#globals_area").append('<div class="stackFrame" id="'+t.generateID("globals")+'"><div id="'+t.generateID("globals_header")+'" class="stackFrameHeader">'+this.getRealLabel("Global frame")+'</div><table class="stackFrameVarTable" id="'+t.generateID("global_table")+'"></table></div>'),this.params.hideOutput&&this.domRoot.find("#progOutputs").hide(),this.domRoot.find("#jmpFirstInstr").click((function(){t.renderStep(0)})),this.domRoot.find("#jmpLastInstr").click((function(){t.renderStep(t.curTrace.length-1)})),this.domRoot.find("#jmpStepBack").click((function(){t.stepBack()})),this.domRoot.find("#jmpStepFwd").click((function(){t.stepForward()})),this.domRoot.find("#vcrControls #jmpFirstInstr").attr("disabled",!0),this.domRoot.find("#vcrControls #jmpStepBack").attr("disabled",!0),this.domRoot.find("#vcrControls #jmpStepFwd").attr("disabled",!0),this.domRoot.find("#vcrControls #jmpLastInstr").attr("disabled",!0);var u=this.curTrace[this.curTrace.length-1];if(this.instrLimitReached="instruction_limit_reached"==u.event,this.instrLimitReached){this.curTrace.pop();var c=u.exception_msg;this.instrLimitReachedWarningMsg=c,t.domRoot.find("#errorOutput").html(htmlspecialchars(c)),t.domRoot.find("#errorOutput").show()}var d=this.domRoot.find("#executionSlider");if(d.slider({min:0,max:this.curTrace.length-1,step:1}),d.find(".ui-slider-handle").unbind("keydown"),d.find(".ui-slider-handle").css("width","0.8em"),d.find(".ui-slider-handle").css("height","1.4em"),this.domRoot.find(".ui-widget-content").css("font-size","0.9em"),this.domRoot.find("#executionSlider").bind("slide",(function(e,n){e.originalEvent&&t.renderStep(n.value)})),this.params.startingInstruction&&(this.params.jumpToEnd=!1,this.params.startingInstruction==this.curTrace.length&&this.params.startingInstruction--,this.params.startingInstruction<0&&(this.params.startingInstruction=0),this.params.startingInstruction>=this.curTrace.length&&(this.params.startingInstruction=this.curTrace.length-1),assert(0<=this.params.startingInstruction&&this.params.startingInstruction<this.curTrace.length),this.curInstr=this.params.startingInstruction),this.params.jumpToEnd){for(var h=-1,f=0;f<this.curTrace.length;f++){var p=this.curTrace[f];if("exception"==p.event||"uncaught_exception"==p.event){h=f;break}}this.curInstr=h>=0?h:this.curTrace.length-1}this.params.hideCode&&this.domRoot.find("#vizLayoutTdFirst").hide(),this.try_hook("end_render",{myViz:this}),this.precomputeCurTraceLayouts(),this.params.hideCode||this.renderPyCodeOutput(),this.tabularView&&(this.renderTabularView(),$(window).scroll((function(){var e=t.domRoot.find("#vizLayoutTdFirst"),n=$(document).scrollTop(),i=e.offset().top,r=n-i;r<0&&(r=0);var o=t.domRoot.find("#optTabularView");r-i<o.height()+o.offset().top-t.domRoot.find("#codeDisplayDiv").height()&&e.css("padding-top",r)})));var g=t.domRoot.find("#rawUserInputDiv");g.find("#userInputPromptStr").html(t.userInputPromptStr),g.find("#raw_input_submit_btn").click((function(){var e=g.find("#raw_input_textbox").val();t.executeCodeWithRawInputFunc(e,t.curInstr+1)})),this.updateOutput(),this.hasRendered=!0}},ExecutionVisualizer.prototype.showVizHeaderViewMode=function(){var t=this.domRoot.find("#vizTitleEditor").val().trim(),e=this.domRoot.find("#vizDescriptionEditor").val().trim();this.domRoot.find("#vizTitleEditor,#vizDescriptionEditor").hide(),t||e?(this.domRoot.find("#vizHeader,#vizTitleViewer,#vizDescriptionViewer").show(),t&&this.domRoot.find("#vizTitleViewer").html(htmlsanitize(t)),e&&this.domRoot.find("#vizDescriptionViewer").html(htmlsanitize(e))):this.domRoot.find("#vizHeader").hide()},ExecutionVisualizer.prototype.showVizHeaderEditMode=function(){this.domRoot.find("#vizHeader").show(),this.domRoot.find("#vizTitleViewer,#vizDescriptionViewer").hide(),this.domRoot.find("#vizTitleEditor,#vizDescriptionEditor").show()},ExecutionVisualizer.prototype.destroyAllAnnotationBubbles=function(){var t=this;t.allAnnotationBubbles&&$.each(t.allAnnotationBubbles,(function(t,e){e.destroyQTip()})),this.domRoot.find("#pyCodeOutputDiv").unbind("scroll"),t.allAnnotationBubbles=null},ExecutionVisualizer.prototype.initStepAnnotation=function(){var t=this.curTrace[this.curInstr];t.stepAnnotation?(this.domRoot.find("#stepAnnotationViewer").html(htmlsanitize(t.stepAnnotation)),this.domRoot.find("#stepAnnotationEditor").val(t.stepAnnotation)):(this.domRoot.find("#stepAnnotationViewer").html(""),this.domRoot.find("#stepAnnotationEditor").val(""))},ExecutionVisualizer.prototype.initAllAnnotationBubbles=function(){var t=this;t.destroyAllAnnotationBubbles();var e=[];$.each(this.domRoot.find("#pyCodeOutput .cod"),(function(t,n){e.push($(n).attr("id"))}));var n=[];$.each(this.domRoot.find(".heapObject"),(function(t,e){n.push($(e).attr("id"))}));var i=[];$.each(this.domRoot.find(".variableTr"),(function(t,e){i.push($(e).attr("id"))}));var r=[];$.each(this.domRoot.find(".stackFrame"),(function(t,e){r.push($(e).attr("id"))})),t.allAnnotationBubbles=[],$.each(e,(function(e,n){t.allAnnotationBubbles.push(new AnnotationBubble(t,"codeline",n))})),$.each(n,(function(e,n){t.allAnnotationBubbles.push(new AnnotationBubble(t,"object",n))})),$.each(i,(function(e,n){t.allAnnotationBubbles.push(new AnnotationBubble(t,"variable",n))})),$.each(r,(function(e,n){t.allAnnotationBubbles.push(new AnnotationBubble(t,"frame",n))})),this.domRoot.find("#pyCodeOutputDiv").scroll((function(){$.each(t.allAnnotationBubbles,(function(t,e){"codeline"==e.type&&e.redrawCodelineBubble()}))}))},ExecutionVisualizer.prototype.enterViewAnnotationsMode=function(){this.editAnnotationMode=!1;var t=this.curTrace[this.curInstr],e=this;if(e.allAnnotationBubbles||t.bubbleAnnotations&&(e.initAllAnnotationBubbles(),$.each(e.allAnnotationBubbles,(function(e,n){var i=t.bubbleAnnotations[n.domID];i&&n.preseedText(i)}))),e.allAnnotationBubbles){var n={};$.each(e.allAnnotationBubbles,(function(t,e){e.enterViewMode(),e.text&&(n[e.domID]=e.text)})),t.bubbleAnnotations=n}var i=e.domRoot.find("#stepAnnotationEditor").val().trim();i?t.stepAnnotation=i:delete t.stepAnnotation,e.initStepAnnotation(),e.showVizHeaderViewMode(),e.redrawConnectors(),e.redrawAllAnnotationBubbles()},ExecutionVisualizer.prototype.enterEditAnnotationsMode=function(){this.editAnnotationMode=!0;var t=this,e=this.curTrace[this.curInstr];t.allAnnotationBubbles||t.initAllAnnotationBubbles(),$.each(t.allAnnotationBubbles,(function(t,e){e.enterEditMode()})),e.stepAnnotation?t.domRoot.find("#stepAnnotationEditor").val(e.stepAnnotation):t.domRoot.find("#stepAnnotationEditor").val(""),t.showVizHeaderEditMode(),t.redrawConnectors(),t.redrawAllAnnotationBubbles()},ExecutionVisualizer.prototype.redrawAllAnnotationBubbles=function(){this.allAnnotationBubbles&&$.each(this.allAnnotationBubbles,(function(t,e){e.redrawBubble()}))},ExecutionVisualizer.prototype.findPrevBreakpoint=function(){var t=this,e=t.curInstr;if(0==t.sortedBreakpointsList.length)return-1;for(var n=1;n<t.sortedBreakpointsList.length;n++){var i=t.sortedBreakpointsList[n-1],r=t.sortedBreakpointsList[n];if(e<=i)return-1;if(r>=e)return i}var o=t.sortedBreakpointsList[t.sortedBreakpointsList.length-1];return o<e?o:-1},ExecutionVisualizer.prototype.findNextBreakpoint=function(){var t=this,e=t.curInstr;if(0==t.sortedBreakpointsList.length)return-1;if($.inArray(e,t.sortedBreakpointsList)>=0)return e+1;for(var n=0;n<t.sortedBreakpointsList.length-1;n++){var i=t.sortedBreakpointsList[n],r=t.sortedBreakpointsList[n+1];if(e<i)return i;if(i<=e&&e<r)return r}var o=t.sortedBreakpointsList[t.sortedBreakpointsList.length-1];return o>e?o:-1},ExecutionVisualizer.prototype.stepForward=function(){var t=this;if(!t.editAnnotationMode){if(t.curInstr<t.curTrace.length-1){if(t.sortedBreakpointsList.length>0){var e=t.findNextBreakpoint();-1!=e?t.curInstr=e:t.curInstr+=1}else t.curInstr+=1;return t.updateOutput(!0),!0}return!1}},ExecutionVisualizer.prototype.stepBack=function(){var t=this;if(!t.editAnnotationMode){if(t.curInstr>0){if(t.sortedBreakpointsList.length>0){var e=t.findPrevBreakpoint();-1!=e?t.curInstr=e:t.curInstr-=1}else t.curInstr-=1;return t.updateOutput(),!0}return!1}},ExecutionVisualizer.prototype.renderSliderBreakpoints=function(){var t=this;t.domRoot.find("#executionSliderFooter").empty();var e=t.domRoot.find("#executionSlider").width(),n=t.domRootD3.select("#executionSliderFooter").append("svg").attr("id","sliderOverlay").attr("width",e).attr("height",12),i=d3.scale.linear().domain([0,t.curTrace.length-1]).range([0,e]);n.selectAll("rect").data(t.sortedBreakpointsList).enter().append("rect").attr("x",(function(t,e){return 0===t?0:i(t)-1})).attr("y",0).attr("width",2).attr("height",12).style("fill",(function(t){return breakpointColor}))},ExecutionVisualizer.prototype.renderPyCodeOutput=function(){var t=this;function e(){var e=[];return t.breakpoints.forEach((function(t,n){e.push(Number(t))})),e.sort((function(t,e){return t-e})),e}function n(n){$.each(n,(function(e,n){t.breakpoints.set(n,1)})),t.sortedBreakpointsList=e()}function i(n,i){var r;r=i.executionPoints,$.each(r,(function(e,n){t.breakpoints.remove(n)})),t.sortedBreakpointsList=e(),d3.select(n.parentNode).select("td.lineNo").style("color",""),d3.select(n.parentNode).select("td.lineNo").style("font-weight",""),d3.select(n.parentNode).select("td.cod").style("color",""),t.renderSliderBreakpoints()}this.breakpoints=d3.map(),this.sortedBreakpointsList=[],this.codeOutputLines=[];for(var r=this.curInputCode.split("\n"),o=0;o<r.length;o++){var a=r[o],s={};s.text=a,s.lineNumber=o+1,s.executionPoints=[],s.breakpointHere=!1,$.each(this.curTrace,(function(t,e){e.line==s.lineNumber&&s.executionPoints.push(t)}));for(var l=!1,u=a.split("#"),c=1;c<u.length;c++)-1!=u[c].indexOf("breakpoint")&&(l=!0);l&&s.executionPoints.length>0&&(s.breakpointHere=!0,n(s.executionPoints)),this.codeOutputLines.push(s)}t.domRoot.find("#pyCodeOutputDiv").empty();var d=this.domRootD3.select("#pyCodeOutputDiv").append("table").attr("id","pyCodeOutput").selectAll("tr").data(this.codeOutputLines).enter().append("tr").selectAll("td").data((function(t,e){return[t,t]})).enter().append("td").attr("class",(function(t,e){return 0==e?"lineNo":"cod"})).attr("id",(function(e,n){return 0==n?"lineNo"+e.lineNumber:t.generateID("cod"+e.lineNumber)})).html((function(t,e){return 0==e?t.lineNumber:htmlspecialchars(t.text)}));t.params.arrowLines&&(t.domRoot.find("#pyCodeOutput tr:first").prepend('<td id="gutterTD" valign="top" rowspan="'+this.codeOutputLines.length+'"><svg id="leftCodeGutterSVG"/></td>'),t.domRootD3.select("svg#leftCodeGutterSVG").append("polygon").attr("id","prevLineArrow").attr("points",SVG_ARROW_POLYGON).attr("fill",lightArrowColor),t.domRootD3.select("svg#leftCodeGutterSVG").append("polygon").attr("id","curLineArrow").attr("points",SVG_ARROW_POLYGON).attr("fill",darkArrowColor)),d.style("cursor",(function(t,e){var n=t.executionPoints;return n&&0!=n.length?"pointer":void 0})).on("click",(function(e,r){var o=e.executionPoints;o&&0!=o.length&&(e.breakpointHere=!e.breakpointHere,e.breakpointHere?function(e,i){n(i.executionPoints),d3.select(e.parentNode).select("td.lineNo").style("color",breakpointColor),d3.select(e.parentNode).select("td.lineNo").style("font-weight","bold"),d3.select(e.parentNode).select("td.cod").style("color",breakpointColor),t.renderSliderBreakpoints()}(this,e):i(this,e))}))},ExecutionVisualizer.prototype.renderStdout=function(){var t=this.curTrace[this.curInstr];if(!this.params.hideOutput&&this.numStdoutLines>0){this.domRoot.find("#progOutputs").show();var e=this.domRoot.find("#pyStdout"),n=e.scrollLeft();e.val(t.stdout.rtrim()),e.scrollLeft(n),e.scrollTop(e[0].scrollHeight)}else this.domRoot.find("#progOutputs").hide()},ExecutionVisualizer.prototype.updateCurPrevLines=function(){var t=this,e=t.curTrace.length,n=t.curInstr===e-1,i=!t.instrLimitReached&&n,r=null,o=null,a=t.curTrace[t.curInstr],s=!1,l="return"==a.event,u=!1;if(t.curInstr>0&&(o=t.curTrace[t.curInstr-1].line,u="return"==t.curTrace[t.curInstr-1].event)){var c=t.curInstr-1,d=t.curTrace[c].stack_to_render;assert(d.length>0);for(var h=d[d.length-1].frame_id;c>=0;){var f=t.curTrace[c];if("call"==f.event&&f.stack_to_render)if(f.stack_to_render[f.stack_to_render.length-1].frame_id==h)break;c--}if(c>0)o=t.curTrace[c-1].line,u=!1}"exception"!=a.event&&"uncaught_exception"!=a.event||(assert(a.exception_msg),s=!0,t.curLineExceptionMsg=a.exception_msg),r=a.line,i&&!s&&o==r&&(r=null),t.curLineNumber=r,t.prevLineNumber=o,t.curLineIsReturn=l,t.prevLineIsReturn=u},ExecutionVisualizer.prototype.updateOutput=function(t){this.params.hideCode?this.updateOutputMini():this.updateOutputFull(t),this.renderStdout(),this.try_hook("end_updateOutput",{myViz:this})},ExecutionVisualizer.prototype.updateOutputFull=function(t){assert(this.curTrace),assert(!this.params.hideCode);var e=this;if(e.domRoot.is(":visible")){e.curLineNumber=void 0,e.prevLineNumber=void 0,e.curLineIsReturn=void 0,e.prevLineIsReturn=void 0,e.curLineExceptionMsg=void 0,e.codeHorizontalOverflow=e.domRoot.find("#pyCodeOutput").width()-e.domRoot.find("#pyCodeOutputDiv").width(),e.codeHorizontalOverflow<0&&(e.codeHorizontalOverflow=0);var n=e.domRoot.find("#dataViz").height(),i=e.domRoot.find("svg#leftCodeGutterSVG");if(!e.leftGutterSvgInitialized&&e.params.arrowLines){i.height(i.parent().height());var r=e.domRoot.find("table#pyCodeOutput tr:first").offset().top;if(e.codeRowHeight=e.domRoot.find("table#pyCodeOutput td.cod:first").height(),this.codeOutputLines&&this.codeOutputLines.length>1){var o=e.domRoot.find("table#pyCodeOutput tr:nth-child(2)").offset().top;e.codeRowHeight=o-r}assert(e.codeRowHeight>0);var a=i.offset().top-r;e.arrowOffsetY=Math.floor(e.codeRowHeight/2-SVG_ARROW_HEIGHT/2)-a,e.leftGutterSvgInitialized=!0}e.params.arrowLines&&(assert(void 0!==e.arrowOffsetY),assert(void 0!==e.codeRowHeight),assert(0<=e.arrowOffsetY&&e.arrowOffsetY<=e.codeRowHeight)),this.params.updateOutputCallback&&this.params.updateOutputCallback(this);var s=this.curTrace[this.curInstr],l=!1;s.question&&$("#"+s.question.div).modal({position:["25%","50%"]}),e.params.debugMode&&(console.log("updateOutputFull",s),e.debugMode=!0);var u=this.curTrace.length,c=this.curInstr==u-1,d=e.domRoot.find("#vcrControls");c?this.promptForUserInput||this.promptForMouseInput?d.find("#curInstr").html('<b><font color="'+brightRed+'">Enter user input below:</font></b>'):this.instrLimitReached?d.find("#curInstr").html("Instruction limit reached"):d.find("#curInstr").html("Program terminated"):d.find("#curInstr").html("Step "+String(this.curInstr+1)+" of "+String(u-1)),d.find("#jmpFirstInstr").attr("disabled",!1),d.find("#jmpStepBack").attr("disabled",!1),d.find("#jmpStepFwd").attr("disabled",!1),d.find("#jmpLastInstr").attr("disabled",!1),0==this.curInstr&&(d.find("#jmpFirstInstr").attr("disabled",!0),d.find("#jmpStepBack").attr("disabled",!0)),c&&(d.find("#jmpLastInstr").attr("disabled",!0),d.find("#jmpStepFwd").attr("disabled",!0)),e.domRoot.find("#executionSlider").slider("value",this.curInstr),"exception"==s.event||"uncaught_exception"==s.event?(assert(s.exception_msg),"Unknown error"==s.exception_msg?e.domRoot.find("#errorOutput").html("Unknown error: Please email a bug report to philip@pgbovine.net"):e.domRoot.find("#errorOutput").html(htmlspecialchars(s.exception_msg)),e.domRoot.find("#errorOutput").show(),l=!0,e.curLineExceptionMsg=s.exception_msg):this.instrLimitReached||e.domRoot.find("#errorOutput").hide(),s.line&&function(){var n=!e.instrLimitReached&&c,r=e.domRoot.find("#pyCodeOutputDiv"),o=null,a=null,u=void 0,d=void 0,h="return"==s.event,f=!1;if(e.curInstr>0){if(a=e.curTrace[e.curInstr-1].line,f="return"==e.curTrace[e.curInstr-1].event){var p=e.curInstr-1,g=e.curTrace[p].stack_to_render;assert(g.length>0);for(var m=g[g.length-1].frame_id;p>=0;){var v=e.curTrace[p];if("call"==v.event&&v.stack_to_render&&v.stack_to_render[v.stack_to_render.length-1].frame_id==m)break;p--}p>0&&(a=e.curTrace[p-1].line,f=!1,t=!1)}if(e.pyCrazyMode){var y=e.curTrace[e.curInstr-1];y.column,u=void 0!==y.expr_start_col?y.expr_start_col:y.column,d=void 0!==y.expr_width?y.expr_width:1}}if(o=s.line,e.pyCrazyMode){var b=s.column,x=void 0!==s.expr_start_col?s.expr_start_col:b,w=void 0!==s.expr_width?s.expr_width:1,C=e.codeOutputLines[o-1];assert(C.lineNumber==o);var _=C.text;if($.each(e.codeOutputLines,(function(t,n){var i=e.generateID("cod"+n.lineNumber);e.domRoot.find("#"+i).html(htmlspecialchars(n.text))})),a==o){for(var E="",M=0;M<_.length;M++){var S=x<=M&&M<x+w,D=u<=M&&M<u+d,P=htmlspecialchars(_[M]);E+=S&&D?'<span class="pycrazy-highlight-prev-and-cur">'+P+"</span>":D?'<span class="pycrazy-highlight-prev">'+P+"</span>":S?'<span class="pycrazy-highlight-cur">'+P+"</span>":P}assert(E),e.domRoot.find("#"+e.generateID("cod"+o)).html(E)}else{if(a){var j=htmlWithHighlight(e.codeOutputLines[a-1].text,u,d,"pycrazy-highlight-prev");e.domRoot.find("#"+e.generateID("cod"+a)).html(j)}E=htmlWithHighlight(_,x,w,"pycrazy-highlight-cur"),e.domRoot.find("#"+e.generateID("cod"+o)).html(E)}}var T,A,k,I,L=f?Math.floor(e.codeRowHeight/3):0,O=h?Math.floor(e.codeRowHeight/3):0;if(n&&!l&&(a==o?o=null:O-=2),e.params.arrowLines){if(a){var N=e.domRootD3.select("#prevLineArrow"),z="translate(0, "+((a-1)*e.codeRowHeight+e.arrowOffsetY+L)+")";t?N.transition().duration(200).attr("fill","white").each("end",(function(){N.attr("transform",z).attr("fill",lightArrowColor),i.find("#prevLineArrow").show()})):(N.attr("transform",z),i.find("#prevLineArrow").show())}else i.find("#prevLineArrow").hide();if(o){var R=e.domRootD3.select("#curLineArrow"),H="translate(0, "+((o-1)*e.codeRowHeight+e.arrowOffsetY+O)+")";t?R.transition().delay(200).duration(250).attr("transform",H):R.attr("transform",H),i.find("#curLineArrow").show()}else i.find("#curLineArrow").hide()}e.domRootD3.selectAll("#pyCodeOutputDiv td.cod").style("border-top",(function(t){return l&&t.lineNumber==s.line?"1px solid "+errorColor:""})).style("border-bottom",(function(t){return l&&t.lineNumber==s.line?"1px solid "+errorColor:""})),e.params.highlightLines&&(e.domRoot.find("#pyCodeOutputDiv td.cod").removeClass("highlight-prev"),e.domRoot.find("#pyCodeOutputDiv td.cod").removeClass("highlight-cur"),o&&e.domRoot.find("#"+e.generateID("cod"+o)).addClass("highlight-cur"),a&&e.domRoot.find("#"+e.generateID("cod"+a)).addClass("highlight-prev")),T=s.line,A=e.domRoot.find("#lineNo"+T).offset().top,k=r.offset().top,r.scrollTop(),I=r.height(),k<=A&&A<k+I-30||function(t){var n=e.domRoot.find("#lineNo"+t).offset().top,i=r.offset().top,o=r.scrollTop(),a=r.height();r.stop(),r.animate({scrollTop:o+(n-i-Math.round(a/2))},300)}(s.line),e.curLineNumber=o,e.prevLineNumber=a,e.curLineIsReturn=h,e.prevLineIsReturn=f}(),e.domRoot.find("#htmlOutputDiv").empty(),s.html_output&&(s.css_output&&e.domRoot.find("#htmlOutputDiv").append('<style type="text/css">'+s.css_output+"</style>"),e.domRoot.find("#htmlOutputDiv").append(s.html_output),s.js_output&&e.domRoot.find("#htmlOutputDiv").append('<script type="text/javascript">'+s.js_output+"<\/script>"));s=this.curTrace[this.curInstr];var h=this.curTraceLayouts[this.curInstr];this.renderDataStructures(s,h),this.enterViewAnnotationsMode(),e.domRoot.find("#dataViz").height()!=n&&this.params.heightChangeCallback&&this.params.heightChangeCallback(this);var f=e.domRoot.find("#rawUserInputDiv");f.hide(),c&&e.executeCodeWithRawInputFunc&&e.promptForUserInput&&f.show()}},ExecutionVisualizer.prototype.updateOutputMini=function(){assert(this.params.hideCode);var t=this.curTrace[this.curInstr],e=this.curTraceLayouts[this.curInstr];this.renderDataStructures(t,e),this.enterViewAnnotationsMode()},ExecutionVisualizer.prototype.renderStep=function(t){assert(0<=t),assert(t<this.curTrace.length),this.curInstr!=t&&(this.curInstr=t,this.updateOutput())},ExecutionVisualizer.prototype.isCppMode=function(){return"c"===this.params.lang||"cpp"===this.params.lang},ExecutionVisualizer.prototype.precomputeCurTraceLayouts=function(){this.curTraceLayouts=[],this.curTraceLayouts.push([]);var t=this;assert(this.curTrace.length>0),$.each(this.curTrace,(function(e,n){var i=t.curTraceLayouts[t.curTraceLayouts.length-1],r=$.extend(!0,[],i),o=d3.map();$.each(r,(function(t,e){for(var n=1;n<e.length;n++)o.set(e[n],1)}));var a=d3.map();function s(e,i,r){var o=n.heap[e];if(t.isCppMode()){if(!o)return}else assert(o);!function(e){var n=t.try_hook("isLinearObj",{heapObj:e});return n[0]?n[1]:"LIST"==e[0]||"TUPLE"==e[0]||"SET"==e[0]}(o)?"DICT"==o[0]?$.each(o,(function(e,a){if(!(e<1)){if(t.disableHeapNesting){var s=a[0];if(!t.isPrimitiveType(s))l(getRefID(s),[],[])}var u=a[1];if(!t.isPrimitiveType(u)){var c=getRefID(u);t.structurallyEquivalent(o,n.heap[c])?l(c,i,r):t.disableHeapNesting&&l(c,[],[])}}})):"INSTANCE"==o[0]||"CLASS"==o[0]?jQuery.each(o,(function(e,a){if(!(e<("INSTANCE"==o[0]?2:3))){if(t.disableHeapNesting){var s=a[0];if(!t.isPrimitiveType(s))l(getRefID(s),[],[])}var u=a[1];if(!t.isPrimitiveType(u)){var c=getRefID(u);t.structurallyEquivalent(o,n.heap[c])?l(c,i,r):t.disableHeapNesting&&l(c,[],[])}}})):"C_ARRAY"!=o[0]&&"C_STRUCT"!=o[0]||u(o):$.each(o,(function(e,n){if(!(e<1||t.isPrimitiveType(n))){var o=getRefID(n);t.disableHeapNesting?l(o,[],[]):l(o,i,r)}}))}function l(t,e,n){if(!a.has(t)){var i=function(t){for(var e=0;e<r.length;e++){var n=r[e],i=n.indexOf(t);if(i>0)return{row:n,index:i}}return null}(t),l=a.has(t);if(a.set(t,1),i){var u=i.row,c=i.index;if(o.remove(t),!l&&n.length>1){for(var d=[c,0],h=1;h<n.length;h++)d.push(n[h]),o.remove(n[h]);u.splice.apply(u,d),n.splice(0,n.length)}s(t,u,[])}else if(0==n.length&&n.push("row"+t),n.push(t),s(t,e,n),n.length>0){if(e&&e.length>0)for(h=1;h<n.length;h++)e.push(n[h]);else r.push($.extend(!0,[],n));for(h=1;h<n.length;h++)o.remove(n[h]);n.splice(0,n.length)}}}function u(t){if(t){var e;if(isHeapRef(t,n.heap))l(getRefID(t),null,[]);"C_ARRAY"===(e=t)[0]?$.each(e,(function(t,e){t<2||u(e)})):"C_STRUCT"===e[0]&&$.each(e,(function(t,e){t<3||u(e[1])}))}}$.each(n.ordered_globals,(function(e,i){var r=n.globals[i];void 0!==r&&(t.isCppMode()?u(r):t.isPrimitiveType(r)||l(getRefID(r),null,[]))})),$.each(n.stack_to_render,(function(e,n){$.each(n.ordered_varnames,(function(e,i){var r=n.encoded_locals[i];t.isCppMode()?u(r):t.isPrimitiveType(r)||l(getRefID(r),null,[])}))})),o.forEach((function(t,e){t=Number(t),$.each(r,(function(e,n){var i=n.indexOf(t);i>0&&n.splice(i,1)}))})),r=r.filter((function(t){return t.length>1})),t.curTraceLayouts.push(r)})),this.curTraceLayouts.splice(0,1),assert(this.curTrace.length==this.curTraceLayouts.length)};var heapPtrSrcRE=/__heap_pointer_src_/,rightwardNudgeHack=!0;ExecutionVisualizer.prototype.renderDataStructures=function(t,e){var n=this;if(!n.tabularView){n.resetJsPlumbManager();var i=d3.map();n.jsPlumbInstance.select({scope:"varValuePointer"}).each((function(t){t.sourceId.match(heapPtrSrcRE)||i.set(t.sourceId,t.targetId)}));var r=d3.map();n.jsPlumbInstance.select({scope:"frameParentPointer"}).each((function(t){r.set(t.sourceId,t.targetId)})),$.each(e,(function(t,e){for(var i=0;i<e.length;i++){var r=e[i],o=n.generateHeapObjID(r,n.curInstr);n.jsPlumbManager.renderedHeapObjectIDs.set(o,1)}})),n.domRoot.find("#heap").empty().html('<div id="heapHeader">Objects</div>');var o=n.domRootD3.select("#heap").selectAll("table.heapRow").attr("id",(function(t,e){return"heapRow"+e})).data(e,(function(t){return t[0]}));o.enter().append("table").attr("id",(function(t,e){return"heapRow"+e})).attr("class","heapRow"),o.exit().each((function(t,e){$(this).empty()})).remove();var a=o.selectAll("td.toplevelHeapObject").data((function(t,e){return t.slice(1,t.length)}),(function(t){return t}));a.enter().append("td").attr("class","toplevelHeapObject").attr("id",(function(t,e){return"toplevel_heap_object_"+t}));a.order().each((function(e,i){$(this).empty(),n.isCppMode()?void 0!==t.heap[e]&&n.renderCompoundObject(e,n.curInstr,$(this),!0):n.renderCompoundObject(e,n.curInstr,$(this),!0)})),a.exit().each((function(t,e){$(this).empty()})).remove();var s=[];$.each(t.ordered_globals,(function(e,n){void 0!==t.globals[n]&&s.push(n)}));var l=n.generateID("globals"),u=n.generateID("global_table"),c=n.domRootD3.select("#"+u).selectAll("tr").data(s,(function(t){return t}));c.enter().append("tr").attr("class","variableTr").attr("id",(function(t,e){return n.generateID(varnameToCssID("global__"+t+"_tr"))}));var d=c.selectAll("td.stackFrameVar,td.stackFrameValue").data((function(t,e){return[t,t]}));d.enter().append("td").attr("class",(function(t,e){return 0==e?"stackFrameVar":"stackFrameValue"})),d.order().each((function(e,r){if(0==r)$(this).html(e);else{$(this).empty();var o=n.generateID("global__"+varnameToCssID(e));i.remove(o);var a=t.globals[e];if(n.isPrimitiveType(a))n.renderPrimitiveObject(a,$(this));else if("C_STRUCT"===a[0]||"C_ARRAY"===a[0])n.renderCStructArray(a,n.curInstr,$(this));else{var s=n.generateHeapObjID(getRefID(a),n.curInstr);if(n.textualMemoryLabels){var l=o+"_text_label";$(this).append('<div class="objectIdLabel" id="'+l+'">id'+getRefID(a)+"</div>"),$(this).find("div#"+l).hover((function(){n.jsPlumbInstance.connect({source:l,target:s,scope:"varValuePointer"})}),(function(){n.jsPlumbInstance.select({source:l}).detach()}))}else $(this).append('<div class="stack_pointer" id="'+o+'">&nbsp;</div>'),assert(!n.jsPlumbManager.connectionEndpointIDs.has(o)),n.jsPlumbManager.connectionEndpointIDs.set(o,s)}}})),d.exit().each((function(t,e){$(this).empty()})).remove(),c.exit().each((function(t,e){$(this).find(".stack_pointer").each((function(t,e){i.remove($(e).attr("id"))})),$(this).empty()})).remove(),0==t.ordered_globals.length?this.domRoot.find("#"+l).hide():this.domRoot.find("#"+l).show();var h=n.domRootD3.select("#stack").selectAll("div.stackFrame,div.zombieStackFrame").data(t.stack_to_render,(function(t){return t.unique_hash})),f=h.enter().append("div").attr("class",(function(t,e){return t.is_zombie?"zombieStackFrame":"stackFrame"})).attr("id",(function(t,e){return t.is_zombie?n.generateID("zombie_stack"+e):n.generateID("stack"+e)})).attr("data-frame_id",(function(t,e){return t.frame_id})).attr("data-parent_frame_id",(function(t,e){return t.parent_frame_id_list.length>0?t.parent_frame_id_list[0]:null})).each((function(e,i){if(n.drawParentPointers){var r=$(this).attr("id");if(e.parent_frame_id_list.length>0){var o=e.parent_frame_id_list[0];n.domRoot.find("div#stack [data-frame_id="+o+"]").each((function(t,e){var i=$(this).attr("id");n.jsPlumbManager.parentPointerConnectionEndpointIDs.set(r,i)}))}else t.ordered_globals.length>0&&n.jsPlumbManager.parentPointerConnectionEndpointIDs.set(r,l);var a=e.frame_id;n.domRoot.find("div#stack [data-parent_frame_id="+a+"]").each((function(t,e){var i=$(this).attr("id");n.jsPlumbManager.parentPointerConnectionEndpointIDs.set(i,r)}))}}));f.append("div").attr("class","stackFrameHeader").html((function(t,e){var i=htmlspecialchars(t.func_name).replace("&lt;lambda&gt;","λ").replace("\n","<br/>");((t.is_parent||n.showAllFrameLabels)&&(i="f"+t.frame_id+": "+i),t.parent_frame_id_list.length>0)?i=i+" [parent=f"+t.parent_frame_id_list[0]+"]":n.showAllFrameLabels&&(i+=" [parent=Global]");return i})),f.append("table").attr("class","stackFrameVarTable");var p=h.order().select("table").selectAll("tr").data((function(t){return t.ordered_varnames.map((function(e){return{varname:e,frame:t}}))}),(function(t){if(t)return t.varname}));p.enter().append("tr").attr("class","variableTr").attr("id",(function(t,e){return n.generateID(varnameToCssID(t.frame.unique_hash+"__"+t.varname+"_tr"))}));var g=p.selectAll("td.stackFrameVar,td.stackFrameValue").data((function(t,e){return[t,t]}));if(g.enter().append("td").attr("class",(function(t,e){return 0==e?"stackFrameVar":"stackFrameValue"})),g.order().each((function(t,e){var r=t.varname,o=t.frame;if(0==e)"__return__"==r?$(this).html('<span class="retval">Return<br/>value</span>'):$(this).html(r);else{$(this).empty();var a=n.generateID(varnameToCssID(o.unique_hash+"__"+r));i.remove(a);var s=o.encoded_locals[r];if(n.isPrimitiveType(s))n.renderPrimitiveObject(s,$(this));else if("C_STRUCT"===s[0]||"C_ARRAY"===s[0])n.renderCStructArray(s,n.curInstr,$(this));else{var l=n.generateHeapObjID(getRefID(s),n.curInstr);if(n.textualMemoryLabels){var u=a+"_text_label";$(this).append('<div class="objectIdLabel" id="'+u+'">id'+getRefID(s)+"</div>"),$(this).find("div#"+u).hover((function(){n.jsPlumbInstance.connect({source:u,target:l,scope:"varValuePointer"})}),(function(){n.jsPlumbInstance.select({source:u}).detach()}))}else $(this).append('<div class="stack_pointer" id="'+a+'">&nbsp;</div>'),assert(!n.jsPlumbManager.connectionEndpointIDs.has(a)),n.jsPlumbManager.connectionEndpointIDs.set(a,l)}}})),g.exit().each((function(t,e){$(this).empty()})).remove(),p.exit().each((function(t,e){$(this).find(".stack_pointer").each((function(t,e){i.remove($(e).attr("id"))})),$(this).empty()})).remove(),h.exit().each((function(t,e){$(this).find(".stack_pointer").each((function(t,e){i.remove($(e).attr("id"))}));var n=$(this).attr("id");r.forEach((function(t,e){t!=n&&e!=n||r.remove(t)})),$(this).empty()})).remove(),rightwardNudgeHack){var m={},v=n.jsPlumbManager.heapConnectionEndpointIDs.keys();v.sort(),$.each(v,(function(t,e){var i=n.jsPlumbManager.heapConnectionEndpointIDs.get(e),r=n.domRoot.find("#"+e),o=r.closest(".heapObject"),a=n.domRoot.find("#"+i);assert("heapObject"==a.attr("class"));var s=o.closest(".heapRow"),l=a.closest(".heapRow"),u=s.attr("id"),c=l.attr("id");if(u!=c){var d=r.offset().left,h=(o.offset().left,a.offset().left);if(d>h){var f=d-h+32;a.css("margin-left","+="+f);var p=m[u];void 0===p&&(p=d3.map(),m[u]=p),p.set(c,1);var g=m[c];g&&g.forEach((function(t,e){t!=u&&(n.domRoot.find("#"+t).css("margin-left","+="+f),p.set(t,1))}))}}}))}n.jsPlumbInstance.reset();n.textualMemoryLabels||(n.isCppMode()||i.forEach(b),n.jsPlumbManager.connectionEndpointIDs.forEach(b)),n.drawParentPointers&&(r.forEach(x),n.jsPlumbManager.parentPointerConnectionEndpointIDs.forEach(x));var y=!1;$.each(t.stack_to_render,(function(t,e){e.is_highlighted&&(w(n.generateID("stack"+t)),y=!0)})),y||w(n.generateID("globals")),n.try_hook("end_renderDataStructures",{myViz:n})}function b(t,e){n.isCppMode()?n.domRoot.find("#"+e).length?n.jsPlumbInstance.connect({source:t,target:e,scope:"varValuePointer"}):n.domRoot.find("#"+t).html("💩"):n.jsPlumbInstance.connect({source:t,target:e,scope:"varValuePointer"})}function x(t,e){0!=n.domRoot.find("#"+t).length&&0!=n.domRoot.find("#"+e).length&&n.jsPlumbInstance.connect({source:t,target:e,anchors:["LeftMiddle","LeftMiddle"],connector:["Bezier",{curviness:45}],endpoint:["Dot",{radius:4}],scope:"frameParentPointer"})}function w(t){n.jsPlumbInstance.select().each((function(e){var i=e.source.closest(".stackFrame");i.attr("id")==t?(e.setPaintStyle({lineWidth:1,strokeStyle:connectorBaseColor}),e.endpoints[0].setPaintStyle({fillStyle:connectorBaseColor}),$(e.canvas).css("z-index",1e3)):n.jsPlumbManager.heapConnectionEndpointIDs.has(e.endpoints[0].elementId)||i.length>0&&(e.setPaintStyle({lineWidth:1,strokeStyle:connectorInactiveColor}),e.endpoints[0].setPaintStyle({fillStyle:connectorInactiveColor}),$(e.canvas).css("z-index",0))})),n.domRoot.find(".stackFrame").removeClass("highlightedStackFrame"),n.domRoot.find("#"+t).addClass("highlightedStackFrame")}},ExecutionVisualizer.prototype.renderTabularView=function(){var t=this;t.resetJsPlumbManager();var e=[],n={},i=[];$.each(t.curTrace,(function(t,r){$.each(r.ordered_globals,(function(t,n){-1===$.inArray(n,e)&&e.push(n)})),$.each(r.stack_to_render,(function(t,e){var r=n[e.func_name];void 0===r&&(r=[],n[e.func_name]=r,i.push(e.func_name)),$.each(e.ordered_varnames,(function(t,e){-1===$.inArray(e,r)&&"__return__"!==e&&r.push(e)}))}))}));var r=["Step"];$.each(e,(function(t,e){r.push(e)})),$.each(i,(function(t,e){$.each(n[e],(function(t,n){r.push(e+":"+n)}))}));var o=t.domRootD3.select("#optTabularView").append("table");o.attr("id","optTable");var a=o.append("thead").attr("class","stepTableThead").append("tr");a.attr("class","stepTableTr"),a.selectAll("thead td").data(r).enter().append("td").attr("class","stepTableTd").html((function(t){return t}));var s=o.append("tbody");s.attr("class","stepTableTbody");var l=[];$.each(t.curTrace,(function(t,e){l.push([t,e])}));s.selectAll("tbody tr").data(l).enter().append("tr").attr("step",(function(t,e){return e})).attr("class","stepTableTr").selectAll("td").data((function(t){return function(t){var r=[""];$.each(e,(function(e,n){r.push(t.globals[n])}));var o=null;return $.each(t.stack_to_render,(function(t,e){e.is_highlighted&&(o=e)})),$.each(i,(function(t,e){$.each(n[e],(function(t,n){var i=!1;if(o&&e==o.func_name){var a=o.encoded_locals[n];a&&(r.push(a),i=!0)}i||r.push(void 0)}))})),r}(t[1])})).enter().append("td").attr("class","stepTableTd").each((function(e,n){$(this).empty();var i=parseInt($(this).closest("tr").attr("step"));0==n?$(this).html(i+1):void 0===e||t.renderNestedObject(e,i,$(this),"tabular")}));t.jsPlumbInstance.reset(),t.jsPlumbManager.connectionEndpointIDs.forEach((function(e,n){t.jsPlumbInstance.connect({source:e,target:n,scope:"varValuePointer",anchors:["TopCenter","LeftMiddle"]})}))},ExecutionVisualizer.prototype.renderPrimitiveObject=function(t,e){var n=this;if(!this.try_hook("renderPrimitiveObject",{obj:t,d3DomElement:e})[0]){var i=typeof t;if(null==t)e.append('<span class="nullObj">'+this.getRealLabel("None")+"</span>");else if("number"==i)e.append('<span class="numberObj">'+t+"</span>");else if("boolean"==i)t?e.append('<span class="boolObj">'+this.getRealLabel("True")+"</span>"):e.append('<span class="boolObj">'+this.getRealLabel("False")+"</span>");else if("string"==i){f='"'+(f=(f=(f=htmlspecialchars(t)).replace(new RegExp("\n","g"),"<br/>")).replace(new RegExp('"',"g"),'\\"'))+'"',e.append('<span class="stringObj">'+f+"</span>")}else if("object"==i)if("C_DATA"==t[0]){var r=t[2];"short int"===r?r="short":"short unsigned int"===r?r="unsigned short":"long int"===r?r="long":"long long int"===r?r="long long":"long unsigned int"===r?r="unsigned long":"long long unsigned int"===r&&(r="unsigned long long int");var o="pointer"===r&&"<UNINITIALIZED>"!==t[3]&&"<UNALLOCATED>"!==t[3],a=t[1],s="";n.debugMode&&(s=a+"<br/>");var l=n.generateHeapObjID("cdata_"+a,n.curInstr);if(o){e.append('<div id="'+l+'" class="cdataHeader">'+s+r+"</div>");var u=t[3],c=n.generateHeapObjID("ptrSrc_"+a,n.curInstr),d=n.generateHeapObjID("cdata_"+u,n.curInstr),h="";n.debugMode&&(h=d),e.append('<div style="width: 10px;" id="'+c+'" class="cdataElt">&nbsp;'+h+"</div>"),assert(!n.jsPlumbManager.connectionEndpointIDs.has(c)),n.jsPlumbManager.connectionEndpointIDs.set(c,d)}else{e.append('<div class="cdataHeader">'+s+r+"</div>");var f,p="";if("string"==typeof t[3])p="<UNINITIALIZED>"===(f=t[3])?'<span class="cdataUninit">?</span>':"<UNALLOCATED>"==f?"💀":htmlspecialchars(f="'"+(f=(f=(f=f.replace(new RegExp("\n","g"),"\\n")).replace(new RegExp("\t","g"),"\\t")).replace(new RegExp('"',"g"),'\\"'))+"'");else p=htmlspecialchars(t[3]);e.append('<div id="'+l+'" class="cdataElt">'+p+"</div>")}}else assert("SPECIAL_FLOAT"==t[0]||"JS_SPECIAL_VAL"==t[0]),e.append('<span class="numberObj">'+t[1]+"</span>");else assert(!1)}},ExecutionVisualizer.prototype.renderNestedObject=function(t,e,n){this.isPrimitiveType(t)?this.renderPrimitiveObject(t,n):"REF"===t[0]?this.renderCompoundObject(getRefID(t),e,n,!1):(assert("C_STRUCT"===t[0]||"C_ARRAY"===t[0]),this.renderCStructArray(t,e,n))},ExecutionVisualizer.prototype.renderCompoundObject=function(t,e,n,i){var r=this,o=r.generateHeapObjID(t,e);if(i||!r.jsPlumbManager.renderedHeapObjectIDs.has(o)){n.append('<div class="heapObject" id="'+o+'"></div>'),n=r.domRoot.find("#"+o),r.jsPlumbManager.renderedHeapObjectIDs.set(o,1);var a=r.curTrace[e].heap[t];assert($.isArray(a));var s="";if(r.textualMemoryLabels&&(s="id"+t+":"),!r.try_hook("renderCompoundObject",{objID:t,d3DomElement:n,isTopLevel:i,obj:a,typeLabelPrefix:s,stepNum:e,myViz:r})[0])if("LIST"==a[0]||"TUPLE"==a[0]||"SET"==a[0]||"DICT"==a[0]){var l=a[0].toLowerCase();if(assert(a.length>=1),1==a.length)n.append('<div class="typeLabel">'+s+" empty "+r.getRealLabel(l)+"</div>");else{n.append('<div class="typeLabel">'+s+r.getRealLabel(l)+"</div>"),n.append('<table class="'+l+'Tbl"></table>');var u=n.children("table");if("LIST"==a[0]||"TUPLE"==a[0]){u.append("<tr></tr><tr></tr>");var c=u.find("tr:first"),d=u.find("tr:last");$.each(a,(function(t,n){t<1||(c.append('<td class="'+l+'Header"></td>'),c.find("td:last").append(t-1),d.append('<td class="'+l+'Elt"></td>'),r.renderNestedObject(n,e,d.find("td:last")))}))}else if("SET"==a[0]){var h=a.length-1,f=Math.round(Math.sqrt(h));f>3&&(f-=1);var p=Math.round(h/f);h%f&&(p+=1),jQuery.each(a,(function(t,n){if(!(t<1)){(t-1)%p==0&&u.append("<tr></tr>");var i=u.find("tr:last");i.append('<td class="setElt"></td>'),r.renderNestedObject(n,e,i.find("td:last"))}}))}else"DICT"==a[0]&&$.each(a,(function(t,n){if(!(t<1)){u.append('<tr class="dictEntry"><td class="dictKey"></td><td class="dictVal"></td></tr>');var i=u.find("tr:last"),o=i.find("td:first"),a=i.find("td:last"),s=n[0],l=n[1];r.renderNestedObject(s,e,o),r.renderNestedObject(l,e,a)}}))}}else if("INSTANCE"==a[0]||"CLASS"==a[0]){var g="INSTANCE"==a[0],m=g?2:3;if(assert(a.length>=m),g)n.append('<div class="typeLabel">'+s+a[1]+" "+r.getRealLabel("instance")+"</div>");else{var v="";a[2].length>0&&(v+="[extends "+a[2].join(", ")+"] "),n.append('<div class="typeLabel">'+s+a[1]+" class "+v+'<br/><a href="#" id="attrToggleLink">hide attributes</a></div>')}if(a.length>m){var y=g?"inst":"class";n.append('<table class="'+y+'Tbl"></table>');u=n.children("table");$.each(a,(function(t,n){if(!(t<m)){u.append('<tr class="'+y+'Entry"><td class="'+y+'Key"></td><td class="'+y+'Val"></td></tr>');var i=u.find("tr:last"),o=i.find("td:first"),a=i.find("td:last");if("string"==typeof n[0]){var s=htmlspecialchars(n[0]);o.append('<span class="keyObj">'+s+"</span>")}else r.renderNestedObject(n[0],e,o);r.renderNestedObject(n[1],e,a)}}))}g||($(n.selector+" .typeLabel #attrToggleLink").click((function(){var t=$(n.selector+" .classTbl");return t.toggle(),$(this).html((t.is(":visible")?"hide":"show")+" attributes"),t.is(":visible")?(r.classAttrsHidden[n.selector]=!1,$(this).html("hide attributes")):(r.classAttrsHidden[n.selector]=!0,$(this).html("show attributes")),r.redrawConnectors(),!1})),r.classAttrsHidden[n.selector]&&($(n.selector+" .classTbl").hide(),$(n.selector+" .typeLabel #attrToggleLink").html("show attributes")))}else if("INSTANCE_PPRINT"==a[0])n.append('<div class="typeLabel">'+s+a[1]+" instance</div>"),S=htmlspecialchars(a[2]),n.append('<table class="customObjTbl"><tr><td class="customObjElt">'+S+"</td></tr></table>");else if("FUNCTION"==a[0]){assert(3==a.length);var b=htmlspecialchars(a[1]).replace("&lt;lambda&gt;","λ"),x=a[2];r.compactFuncLabels||n.append('<div class="typeLabel">'+s+r.getRealLabel("function")+"</div>");var w=r.compactFuncLabels?"func":"";x?n.append('<div class="funcObj">'+w+" "+b+" [parent=f"+x+"]</div>"):r.showAllFrameLabels?n.append('<div class="funcObj">'+w+" "+b+" [parent=Global]</div>"):n.append('<div class="funcObj">'+w+" "+b+"</div>")}else if("JS_FUNCTION"==a[0]){assert(5==a.length);b=htmlspecialchars(a[1]);var C=s+htmlspecialchars(a[2]),_=a[3];x=a[4];if(_||x||r.showAllFrameLabels)n.append('<table class="classTbl"></table>'),(u=n.children("table")).append('<tr><td class="funcCod" colspan="2"><pre class="funcCode">'+C+"</pre></td></tr>"),_&&(assert(_.length>0),$.each(_,(function(t,n){u.append('<tr class="classEntry"><td class="classKey"></td><td class="classVal"></td></tr>');var i=u.find("tr:last"),o=i.find("td:first"),a=i.find("td:last");o.append('<span class="keyObj">'+htmlspecialchars(n[0])+"</span>"),r.renderNestedObject(n[1],e,a)}))),x?u.append('<tr class="classEntry"><td class="classKey">parent</td><td class="classVal">f'+x+"</td></tr>"):r.showAllFrameLabels&&u.append('<tr class="classEntry"><td class="classKey">parent</td><td class="classVal">global</td></tr>');else n.append('<pre class="funcCode">'+C+"</pre>")}else if("HEAP_PRIMITIVE"==a[0]){assert(3==a.length);var E=a[1],M=a[2];n.append('<div class="heapPrimitive"></div>'),n.find("div.heapPrimitive").append('<div class="typeLabel">'+s+E+"</div>"),r.renderPrimitiveObject(M,n.find("div.heapPrimitive"))}else if("C_STRUCT"==a[0]||"C_ARRAY"==a[0])r.renderCStructArray(a,e,n);else{assert(2==a.length);E=a[0];var S=a[1];S=htmlspecialchars(S),n.append('<div class="typeLabel">'+s+E+"</div>"),n.append('<table class="customObjTbl"><tr><td class="customObjElt">'+S+"</td></tr></table>")}}else{var D=r.generateID("heap_pointer_src_"+r.jsPlumbManager.heap_pointer_src_id);r.jsPlumbManager.heap_pointer_src_id++;var P=o;if(r.textualMemoryLabels){var j=D+"_text_label";n.append('<div class="objectIdLabel" id="'+j+'">id'+t+"</div>"),r.domRoot.find("div#"+j).hover((function(){r.jsPlumbInstance.connect({source:j,target:P,scope:"varValuePointer"})}),(function(){r.jsPlumbInstance.select({source:j}).detach()}))}else n.append('<div id="'+D+'">&nbsp;</div>'),assert(!r.jsPlumbManager.connectionEndpointIDs.has(D)),r.jsPlumbManager.connectionEndpointIDs.set(D,P),assert(!r.jsPlumbManager.heapConnectionEndpointIDs.has(D)),r.jsPlumbManager.heapConnectionEndpointIDs.set(D,P)}},ExecutionVisualizer.prototype.renderCStructArray=function(t,e,n){var i=this;if("C_STRUCT"==t[0]){assert(t.length>=3);var r=t[1],o=t[2],a="";if(i.debugMode&&(a=r+"<br/>"),"cpp"===i.params.lang?n.append('<div class="typeLabel">'+a+"object "+o+"</div>"):n.append('<div class="typeLabel">'+a+"struct "+o+"</div>"),t.length>3){n.append('<table class="instTbl"></table>');var s=n.children("table");$.each(t,(function(t,n){if(!(t<3)){s.append('<tr class="instEntry"><td class="instKey"></td><td class="instVal"></td></tr>');var r=s.find("tr:last"),o=r.find("td:first"),a=r.find("td:last");assert("string"==typeof n[0]);var l=htmlspecialchars(n[0]);o.append('<span class="keyObj">'+l+"</span>"),i.renderNestedObject(n[1],e,a)}}))}}else{assert("C_ARRAY"==t[0]),assert(t.length>=2);r=t[1],a="";i.debugMode&&(a=r+"<br/>"),n.append('<div class="typeLabel">'+a+"array</div>"),n.append('<table class="cArrayTbl"></table>'),(s=n.children("table")).append("<tr></tr><tr></tr>");var l=s.find("tr:first"),u=s.find("tr:last");$.each(t,(function(t,n){t<2||(l.append('<td class="cArrayHeader"></td>'),l.find("td:last").append(t-2),u.append('<td class="cArrayElt"></td>'),i.renderNestedObject(n,e,u.find("td:last")))}))}},ExecutionVisualizer.prototype.redrawConnectors=function(){this.jsPlumbInstance.repaintEverything()},ExecutionVisualizer.prototype.getRealLabel=function(t){if("js"===this.params.lang||"ts"===this.params.lang||"ruby"===this.params.lang){if("list"===t)return"array";if("instance"===t)return"object";if("True"===t)return"true";if("False"===t)return"false"}if("js"===this.params.lang){if("dict"===t)return"Map";if("set"===t)return"Set"}if("ruby"===this.params.lang){if("dict"===t)return"hash";if("set"===t)return"Set";if("function"===t)return"method";if("None"===t)return"nil";if("Global frame"===t)return"Global Object"}return t};var highlightedLineColor="#e4faeb",highlightedLineBorderColor="#005583",highlightedLineLighterColor="#e8fff0",funcCallLineColor="#a2eebd",brightRed="#e93f34",connectorBaseColor="#005583",connectorHighlightColor=brightRed,connectorInactiveColor="#cccccc",errorColor=brightRed,breakpointColor=brightRed,darkArrowColor=brightRed,lightArrowColor="#c9e6ca";function assert(t){if(!t)throw alert("Assertion Failure (see console log for backtrace)"),"Assertion Failure"}function htmlspecialchars(t){return"string"==typeof t&&(t=(t=(t=(t=(t=t.replace(/&/g,"&amp;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;")).replace(/ /g,"&nbsp;")).replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;")),t}function htmlsanitize(t){return"string"==typeof t&&(t=(t=(t=t.replace(/&/g,"&amp;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;")),t}String.prototype.rtrim=function(){return this.replace(/\s*$/g,"")};var lbRE=new RegExp("\\[|{|\\(|<","g"),rbRE=new RegExp("\\]|}|\\)|>","g");function varnameToCssID(t){return t.replace(lbRE,"LeftB_").replace(rbRE,"_RightB").replace(/[!]/g,"_BANG_").replace(/[?]/g,"_QUES_").replace(/[:]/g,"_COLON_").replace(/[=]/g,"_EQ_").replace(/[.]/g,"_DOT_").replace(/ /g,"_")}function isHeapRef(t,e){return"REF"===t[0]?void 0!==e[t[1]]:"C_DATA"===t[0]&&"pointer"===t[2]&&"<UNINITIALIZED>"!=t[3]&&"<UNALLOCATED>"!=t[3]&&void 0!==e[t[3]]}function getRefID(t){return"REF"==t[0]?t[1]:(assert("C_DATA"===t[0]&&"pointer"===t[2]),assert("<UNINITIALIZED>"!=t[3]&&"<UNALLOCATED>"!=t[3]),t[3])}ExecutionVisualizer.prototype.structurallyEquivalent=function(t,e){if(this.isPrimitiveType(t)||this.isPrimitiveType(e))return!1;if(t[0]!=e[0])return!1;if(t.length!=e.length)return!1;if("LIST"==t[0]||"TUPLE"==t[0])return!0;var n=-1;if("DICT"==t[0])n=2;else{if("INSTANCE"!=t[0])return!1;n=3}for(var i=d3.map(),r=n;r<t.length;r++)i.set(t[r][0],1);for(r=n;r<e.length;r++)if(!i.has(e[r][0]))return!1;return!0},ExecutionVisualizer.prototype.isPrimitiveType=function(t){var e=this.try_hook("isPrimitiveType",{obj:t});return e[0]?e[1]:null===t||("object"!=typeof t||("SPECIAL_FLOAT"==t[0]||"JS_SPECIAL_VAL"==t[0]||"C_DATA"==t[0]))};var qtipShared={show:{ready:!0,delay:0,event:null,effect:function(){$(this).show()}},hide:{fixed:!0,event:null,effect:function(){$(this).hide()}},style:{classes:"ui-tooltip-pgbootstrap"}};function AnnotationBubble(t,e,n){this.parentViz=t,this.domID=n,this.hashID="#"+n,this.type=e,"codeline"==e?(this.my="left center",this.at="right center"):"frame"==e||"variable"==e?(this.my="right center",this.at="left center"):"object"==e?(this.my="bottom left",this.at="top center"):assert(!1),this.state="invisible",this.text="",this.qtipHidden=!1}function isOutputLineVisibleForBubbles(t){var e=$("#pyCodeOutputDiv"),n=$("#"+t).offset().top,i=e.offset().top,r=(e.scrollTop(),e.height());return i<=n&&n<i+r-25}function traceQCheckMe(t,e,n){var i=$("#"+e).data("vis"),r=i.curInstr,o=i.curTrace[r+1],a=$("#"+t).val(),s=n.split("."),l=o;for(var u in s)l=l[s[u]];var c=$("#"+e+"_feedbacktext");a.length>0&&a==l?c.html("Correct"):c.html(i.curTrace[r].question.feedback)}function closeModal(t){$.modal.close(),$("#"+t).data("vis").stepForward()}AnnotationBubble.prototype.showStub=function(){assert("invisible"==this.state||"edit"==this.state),assert(""==this.text);var t=this;this.destroyQTip(),$(this.hashID).qtip($.extend({},qtipShared,{content:" ",id:this.domID,position:{my:this.my,at:this.at,adjust:{x:"codeline"==t.type?-6:0},effect:null},style:{classes:"ui-tooltip-pgbootstrap ui-tooltip-pgbootstrap-stub"}})),$(this.qTipID()).unbind("click").click((function(){t.showEditor()})),this.state="stub"},AnnotationBubble.prototype.showEditor=function(){assert("stub"==this.state||"view"==this.state||"minimized"==this.state);var t=this,e='<textarea class="bubbleInputText">'+this.text+"</textarea>";this.destroyQTip(),$(this.hashID).qtip($.extend({},qtipShared,{content:e,id:this.domID,position:{my:this.my,at:this.at,adjust:{x:"codeline"==t.type?-6:0},effect:null}})),$(this.qTipContentID()).find("textarea.bubbleInputText").blur((function(){t.text=$(this).val().trim(),t.text?t.showViewer():t.showStub()})).focus(),this.state="edit"},AnnotationBubble.prototype.bindViewerClickHandler=function(){var t=this;$(this.qTipID()).unbind("click").click((function(){t.parentViz.editAnnotationMode?t.showEditor():t.minimizeViewer()}))},AnnotationBubble.prototype.showViewer=function(){assert("edit"==this.state||"invisible"==this.state),assert(this.text);this.destroyQTip(),$(this.hashID).qtip($.extend({},qtipShared,{content:htmlsanitize(this.text),id:this.domID,position:{my:this.my,at:this.at,adjust:{x:"codeline"==this.type?-6:0},effect:null}})),this.bindViewerClickHandler(),this.state="view"},AnnotationBubble.prototype.minimizeViewer=function(){assert("view"==this.state);var t=this;$(this.hashID).qtip("option","content.text"," "),$(this.qTipID()).unbind("click").click((function(){t.parentViz.editAnnotationMode?t.showEditor():t.restoreViewer()})),this.state="minimized"},AnnotationBubble.prototype.restoreViewer=function(){assert("minimized"==this.state),$(this.hashID).qtip("option","content.text",htmlsanitize(this.text)),this.bindViewerClickHandler(),this.state="view"},AnnotationBubble.prototype.makeInvisible=function(){assert("stub"==this.state||"edit"==this.state),this.destroyQTip(),this.state="invisible"},AnnotationBubble.prototype.destroyQTip=function(){$(this.hashID).qtip("destroy")},AnnotationBubble.prototype.qTipContentID=function(){return"#ui-tooltip-"+this.domID+"-content"},AnnotationBubble.prototype.qTipID=function(){return"#ui-tooltip-"+this.domID},AnnotationBubble.prototype.enterEditMode=function(){assert(this.parentViz.editAnnotationMode),"invisible"==this.state&&(this.showStub(),"codeline"==this.type&&this.redrawCodelineBubble())},AnnotationBubble.prototype.enterViewMode=function(){assert(!this.parentViz.editAnnotationMode),"stub"==this.state?this.makeInvisible():"edit"==this.state?(this.text=$(this.qTipContentID()).find("textarea.bubbleInputText").val().trim(),this.text?(this.showViewer(),"codeline"==this.type&&this.redrawCodelineBubble()):this.makeInvisible()):"invisible"==this.state&&this.text&&(this.showViewer(),"codeline"==this.type&&this.redrawCodelineBubble())},AnnotationBubble.prototype.preseedText=function(t){assert("invisible"==this.state),this.text=t},AnnotationBubble.prototype.redrawCodelineBubble=function(){assert("codeline"==this.type),isOutputLineVisibleForBubbles(this.domID)?(this.qtipHidden?$(this.hashID).qtip("show"):$(this.hashID).qtip("reposition"),this.qtipHidden=!1):($(this.hashID).qtip("hide"),this.qtipHidden=!0)},AnnotationBubble.prototype.redrawBubble=function(){$(this.hashID).qtip("reposition")},ExecutionVisualizer.prototype.activateJavaFrontend=function(){var t=null;this.curTrace.forEach((function(e,n){"exception"!==e.event||e.line||(e.line=t),void 0!==e.stack_to_render&&e.stack_to_render.reverse(),t=e.line})),this.add_pytutor_hook("renderPrimitiveObject",(function(t){var e=t.obj,n=t.d3DomElement,i=typeof e;if(null==e)n.append('<span class="nullObj">null</span>');else if("number"==i)n.append('<span class="numberObj">'+e+"</span>");else if("boolean"==i)e?n.append('<span class="boolObj">true</span>'):n.append('<span class="boolObj">false</span>');else if(e instanceof Array&&"VOID"==e[0])n.append('<span class="voidObj">void</span>');else if(e instanceof Array&&"NUMBER-LITERAL"==e[0])n.append('<span class="numberObj">'+e[1]+"</span>");else{if(!(e instanceof Array&&"CHAR-LITERAL"==e[0]))return[!1];for(var r=e[1].charCodeAt(0),o=e[1],a=r.toString(16);a.length<4;)a="0"+a;a="\\u"+a,"\n"==o?a="\\n":"\r"==o?a="\\r":"\t"==o?a="\\t":"\b"==o?a="\\b":"\f"==o?a="\\f":"'"==o?a="\\'":'"'==o?a='\\"':"\\"==o?a="\\\\":r>=32&&(a=o),n.append('<span class="stringObj">\''+a+"'</span>")}return[!0]})),this.add_pytutor_hook("isPrimitiveType",(function(t){var e=t.obj;return e instanceof Array&&"VOID"==e[0]||e instanceof Array&&"NUMBER-LITERAL"==e[0]||e instanceof Array&&"CHAR-LITERAL"==e[0]||e instanceof Array&&"ELIDE"==e[0]?[!0,!0]:[!1]})),this.add_pytutor_hook("end_updateOutput",(function(t){var e=t.myViz,n=e.curTrace[e.curInstr];if(e.params.stdin&&""!=e.params.stdin){var r=n.stdinPosition||0,o='<span style="color:lightgray;text-decoration: line-through">'+i(e.params.stdin.substr(0,r))+"</span>"+i(e.params.stdin.substr(r));e.domRoot.find("#stdinShow").html(o)}return[!1]})),this.add_pytutor_hook("end_constructor",(function(t){var e=t.myViz;if(e.curTrace.length>0&&e.curTrace[e.curTrace.length-1]&&e.curTrace[e.curTrace.length-1].stdout?(e.hasStdout=!0,e.stdoutLines=e.curTrace[e.curTrace.length-1].stdout.split("\n").length):e.curTrace.length>1&&e.curTrace[e.curTrace.length-2]&&e.curTrace[e.curTrace.length-2].stdout?(e.hasStdout=!0,e.stdoutLines=e.curTrace[e.curTrace.length-2].stdout.split("\n").length):e.stdoutLines=-1,e.hasStdout)for(var n=0;n<e.curTrace.length;n++)e.curTrace[n].stdout||(e.curTrace[n].stdout=" ")})),this.add_pytutor_hook("end_render",(function(t){var e=t.myViz;if(e.params.stdin&&""!=e.params.stdin){e.domRoot.find("#dataViz").append('<div id="stdinWrap">stdin:<pre id="stdinShow" style="border:1px solid gray"></pre></div>')}e.domRoot.find("#"+e.generateID("globals_header")).html("Static fields")})),this.add_pytutor_hook("isLinearObject",(function(t){var e=t.heapObj;return"STACK"==e[0]||"QUEUE"==e[0]?["true","true"]:["false"]})),this.add_pytutor_hook("renderCompoundObject",(function(t){t.objID;var e=t.d3DomElement,n=t.obj,i=t.typeLabelPrefix,r=t.myViz,o=t.stepNum;if("LIST"!=n[0]&&"QUEUE"!=n[0]&&"STACK"!=n[0])return[!1];var a=n[0].toLowerCase(),s={list:"array",queue:"queue",stack:"stack"}[a];if(1==n.length)return e.append('<div class="typeLabel">'+i+"empty "+s+"</div>"),[!0];e.append('<div class="typeLabel">'+i+s+"</div>"),e.append('<table class="'+a+'Tbl"></table>');var l=e.children("table");if("LIST"==n[0]){l.append("<tr></tr><tr></tr>");for(var u=l.find("tr:first"),c=l.find("tr:last"),d=1,h=0;d<n.length;d++){var f=n[d],p=f instanceof Array&&"ELIDE"==f[0];u.append('<td class="'+a+'Header"></td>'),u.find("td:last").append(p?"&hellip;":h),c.append('<td class="'+a+'Elt"></td>'),p?(c.find("td:last").append("&hellip;"),h+=f[1]):(r.renderNestedObject(f,o,c.find("td:last")),h++)}}"STACK"==n[0]&&(l.append("<tr></tr><tr></tr>"),(c=l.find("tr:last")).append('<td class="'+a+'FElt"><span class="stringObj symbolic">&#8596;</span></td>'),$.each(n,(function(t,e){t<1||(c.append('<td class="'+a+'Elt"></td>'),r.renderNestedObject(e,o,c.find("td:last")))})),c.append('<td class="'+a+'LElt"></td>'));"QUEUE"==n[0]&&(l.append("<tr></tr><tr></tr>"),(c=l.find("tr:last")).append('<td class="'+a+'FElt"><span class="stringObj symbolic">&#8592;</span></td>'),$.each(n,(function(t,e){t<1||(c.append('<td class="'+a+'Elt"></td>'),r.renderNestedObject(e,o,c.find("td:last")))})),c.append('<td class="'+a+'LElt"><span class="stringObj symbolic">&#8592;</span></td>'));return[!0]})),this.add_pytutor_hook("end_renderDataStructures",(function(t){var e=t.myViz;e.domRoot.find("td.instKey:contains('___NO_LABEL!___')").hide(),e.domRoot.find(".typeLabel:contains('dict')").each((function(t){"dict"==$(this).html()&&$(this).html("symbol table"),"empty dict"==$(this).html()&&$(this).html("empty symbol table")}))}));var e=ExecutionVisualizer.prototype.generateID.bind(this);this.generateID=function(t){var n=t.replace(/[^0-9a-zA-Z_]/g,(function(t){return"-"+t.charCodeAt(0)+"-"}));return e(n)};var n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},i=function(t){return String(t).replace(/[&<>"'\/]/g,(function(t){return n[t]}))}};