@basthon/browser-bundle 0.60.6 → 0.61.1

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.
Files changed (40) hide show
  1. package/lib/{0.60.6 → 0.61.1}/python3/basthon.tar +0 -0
  2. package/lib/{0.60.6/python3-old → 0.61.1/python3}/modules/IPython-0.0.1-py3-none-any.whl +0 -0
  3. package/lib/0.61.1/python3/modules/extern/pytutor-main.min.js +1 -0
  4. package/lib/{0.60.6 → 0.61.1}/python3/modules/graphviz-0.0.1-py3-none-any.whl +0 -0
  5. package/lib/{0.60.6 → 0.61.1}/python3/modules/p5-0.0.1-py3-none-any.whl +0 -0
  6. package/lib/{0.60.6/python3-old → 0.61.1/python3}/modules/proj4py-0.0.1-py3-none-any.whl +0 -0
  7. package/lib/{0.60.6 → 0.61.1}/python3/modules/rcviz-0.0.1-py3-none-any.whl +0 -0
  8. package/lib/{0.60.6 → 0.61.1}/python3/modules/requests-0.0.1-py3-none-any.whl +0 -0
  9. package/lib/{0.60.6/python3-old → 0.61.1/python3}/modules/turtle-0.0.1-py3-none-any.whl +0 -0
  10. package/lib/{0.60.6 → 0.61.1}/python3/modules/tutor-0.0.1-py3-none-any.whl +0 -0
  11. package/lib/0.61.1/python3/repodata.json +1 -0
  12. package/lib/{0.60.6 → 0.61.1}/python3-old/basthon.js +1 -1
  13. package/lib/{0.60.6/python3 → 0.61.1/python3-old}/modules/IPython-0.0.1-py3-none-any.whl +0 -0
  14. package/lib/0.61.1/python3-old/modules/extern/pytutor-main.min.js +1 -0
  15. package/lib/{0.60.6 → 0.61.1}/python3-old/modules/graphviz-0.0.1-py3-none-any.whl +0 -0
  16. package/lib/{0.60.6 → 0.61.1}/python3-old/modules/ipythonblocks-0.0.1-py3-none-any.whl +0 -0
  17. package/lib/{0.60.6 → 0.61.1}/python3-old/modules/ivp-0.0.1-py3-none-any.whl +0 -0
  18. package/lib/{0.60.6 → 0.61.1}/python3-old/modules/lolviz-0.0.1-py3-none-any.whl +0 -0
  19. package/lib/{0.60.6 → 0.61.1}/python3-old/modules/p5-0.0.1-py3-none-any.whl +0 -0
  20. package/lib/{0.60.6/python3 → 0.61.1/python3-old}/modules/proj4py-0.0.1-py3-none-any.whl +0 -0
  21. package/lib/{0.60.6 → 0.61.1}/python3-old/modules/rcviz-0.0.1-py3-none-any.whl +0 -0
  22. package/lib/{0.60.6 → 0.61.1}/python3-old/modules/requests-0.0.1-py3-none-any.whl +0 -0
  23. package/lib/{0.60.6/python3 → 0.61.1/python3-old}/modules/turtle-0.0.1-py3-none-any.whl +0 -0
  24. package/lib/{0.60.6 → 0.61.1}/python3-old/modules/tutor-0.0.1-py3-none-any.whl +0 -0
  25. package/lib/bundle.js +1 -1
  26. package/lib/bundle.js.map +1 -1
  27. package/lib/kernel-base_lib_index_js.js +1 -1
  28. package/lib/kernel-base_lib_index_js.js.map +1 -1
  29. package/lib/kernel-python3_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_mod-1ab697.js +1 -1
  30. package/lib/kernel-python3_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_mod-1ab697.js.map +1 -1
  31. package/lib/vendors-node_modules_sql_js_dist_sql-wasm_js-node_modules_sql_js_dist_sql-wasm_wasm_asset-url-ea4ee4.js.map +1 -1
  32. package/package.json +3 -3
  33. package/lib/0.60.6/python3/modules/extern/pytutor-main.min.js +0 -1
  34. package/lib/0.60.6/python3/repodata.json +0 -1
  35. package/lib/0.60.6/python3-old/modules/extern/pytutor-main.min.js +0 -1
  36. /package/lib/{0.60.6 → 0.61.1}/python3/modules/extern/pytutor-main.min.css +0 -0
  37. /package/lib/{0.60.6 → 0.61.1}/python3/modules/extern/pytutor-main.min.js.map +0 -0
  38. /package/lib/{0.60.6 → 0.61.1}/python3-old/basthon.data +0 -0
  39. /package/lib/{0.60.6 → 0.61.1}/python3-old/modules/extern/pytutor-main.min.css +0 -0
  40. /package/lib/{0.60.6 → 0.61.1}/python3-old/modules/extern/pytutor-main.min.js.map +0 -0
@@ -1 +0,0 @@
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){return null!=t&&!isNaN(t)}function a(t){return t.length}function s(t){return null==t}function l(t){return t.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")}function u(){}function c(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=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,i=i.slice(0,o=i.indexOf(o)).concat(i.slice(o+1)),r.remove(t)),n&&i.push(r.set(t,{on:n})),e)},n}function d(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 h(t){return t+""}function p(t){for(var e=t.lastIndexOf("."),n=0<=e?t.substring(e):(e=t.length,""),i=[];0<e;)i.push(t.substring(e-=3,e+3));return i.reverse().join(",")+n}function f(t){return function(e){return 1-t(1-e)}}function g(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function m(t){return t}function v(t){return function(e){return Math.pow(e,t)}}function y(t){return 1-Math.cos(t*Math.PI/2)}function b(t){return Math.pow(2,10*(t-1))}function x(t){return 1-Math.sqrt(1-t*t)}function w(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 C(){d3.event.stopPropagation(),d3.event.preventDefault()}function _(){for(var t,e=d3.event;t=e.sourceEvent;)e=t;return e}function E(t){for(var e=new u,n=0,i=arguments.length;++n<i;)e[arguments[n]]=c(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 M(t){return"transform"==t?d3.interpolateTransform:d3.interpolate}function S(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return(n-t)*e}}function D(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return Math.max(0,Math.min(1,(n-t)*e))}}function P(t,e,n){return new j(t,e,n)}function j(t,e,n){this.r=t,this.g=e,this.b=n}function T(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function A(t,e,n){var i,r=0,o=0,a=0,s=/([a-z]+)\((.*)\)/i.exec(t);if(s)switch(i=s[2].split(","),s[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(I(i[0]),I(i[1]),I(i[2]))}return(s=Sn.get(t))?e(s.r,s.g,s.b):(null!=t&&"#"===t.charAt(0)&&(4===t.length?(r=t.charAt(1),r+=r,o=t.charAt(2),o+=o,a=t.charAt(3),a+=a):7===t.length&&(r=t.substring(1,3),o=t.substring(3,5),a=t.substring(5,7)),r=parseInt(r,16),o=parseInt(o,16),a=parseInt(a,16)),e(r,o,a))}function k(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,L(i,r,l)}function I(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function L(t,e,n){return new O(t,e,n)}function O(t,e,n){this.h=t,this.s=e,this.l=n}function N(t,e,n){function i(t){return Math.round(255*(360<t?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))}var r,o;return(t%=360)<0&&(t+=360),e=e<0?0:1<e?1:e,r=2*(n=n<0?0:1<n?1:n)-(o=n<=.5?n*(1+e):n+e-n*e),P(i(t+120),i(t),i(t-120))}function z(t){return an(t,An),t}function R(t){return function(){return Dn(t,this)}}function H(t){return function(){return Pn(t,this)}}function F(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;a.lastIndex=0,a.test(i)||(i=l(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=l((i=n?e.baseVal:e).replace(a," "));n?e.baseVal=i:this.className=i}var r,o,a=new RegExp("(^|\\s+)"+d3.requote(t)+"(\\s+|$)","g");return arguments.length<2?(o=(r=this.node()).classList)?o.contains(t):(o=r.className,a.lastIndex=0,a.test(null!=o.baseVal?o.baseVal:o)):this.each("function"==typeof e?function(){(e.apply(this,arguments)?n:i).call(this)}:e?n:i)}function V(t){return{__data__:t}}function B(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 W(t){return an(t,In),t}function $(e,n,i){an(e,On);var r=new t,o=d3.dispatch("start","end"),a=Fn;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?function(t){var e=zn,n=Fn,i=Rn,r=Hn;return zn=this.id,Fn=this.ease(),B(this,(function(e,n,i){Rn=e.delay,Hn=e.duration,t.call(e=e.node,e.__data__,n,i)})),zn=e,Fn=n,Rn=i,Hn=r,this}.call(e,t):(o.on(t,n),e)},d3.timer((function(t){return B(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=a(t=(t-p)/f),r=h.length;0<r;)h[--r].call(e,i);return 1<=t?(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=[],p=e.delay,f=e.duration,g=(e=e.node).__transition__||(e.__transition__={active:0,count:0}),m=e.__data__;++g.count,p<=t?u(t):d3.timer(u,p,i)}))}),0,i),e}function U(t,e,n){return""!=n&&Ln}function q(t,e){var n=M(t);return"function"==typeof e?function(t,i,r){return null==(t=e.call(this,t,i))?""!=r&&Ln:r!=t&&n(r,t)}:null==e?U:(e+="",function(t,i,r){return r!=e&&n(r,e)})}function G(){for(var t,e=Date.now(),n=Vn;n;)(t=e-n.then)>=n.delay&&(n.flush=n.callback(t)),n=n.next;var i=Y()-e;24<i?(isFinite(i)&&(clearTimeout(hn),hn=setTimeout(G,i)),dn=0):(dn=1,Bn(G))}function Y(){for(var t=null,e=Vn,n=1/0;e;)e=e.flush?t?t.next=e.next:Vn=e.next:(n=Math.min(n,e.then+e.delay),(t=e).next);return n}function X(t){var e,n,i=[t.a,t.b],r=[t.c,t.d],o=K(i),a=Q(i,r),s=K(((e=r)[0]+=(s=-a)*(n=i)[0],e[1]+=s*n[1],e))||0;i[0]*r[1]<r[0]*i[1]&&(i[0]*=-1,i[1]*=-1,o*=-1,a*=-1),this.rotate=(o?Math.atan2(i[1],i[0]):Math.atan2(-r[0],r[1]))*Wn,this.translate=[t.e,t.f],this.scale=[o,s],this.skew=s?Math.atan2(a,s)*Wn:0}function Q(t,e){return t[0]*e[0]+t[1]*e[1]}function K(t){var e=Math.sqrt(Q(t,t));return e&&(t[0]/=e,t[1]/=e),e}function J(t,e){var n,i,r=t.ownerSVGElement||t;return r.createSVGPoint?(n=r.createSVGPoint(),$n<0&&(window.scrollX||window.scrollY)&&(i=(r=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0))[0][0].getScreenCTM(),$n=!i.f&&!i.e,r.remove()),$n?(n.x=e.pageX,n.y=e.pageY):(n.x=e.clientX,n.y=e.clientY),[(n=n.matrixTransform(t.getScreenCTM().inverse())).x,n.y]):(i=t.getBoundingClientRect(),[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop])}function Z(t){var e=t[0];return e<(t=t[t.length-1])?[e,t]:[t,e]}function tt(t){return t.rangeExtent?t.rangeExtent():Z(t.range())}function et(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 nt(){return Math}function it(t,e){return d3.rebind(t,e,"range","rangeRound","interpolate","clamp")}function rt(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 ot(t,e){var n=(t=Z(t))[1]-t[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10));return(e=e/n*i)<=.15?i*=10:e<=.35?i*=5:e<=.75&&(i*=2),t[0]=Math.ceil(t[0]/i)*i,t[1]=Math.floor(t[1]/i)*i+.5*i,t[2]=i,t}function at(t,e){return d3.range.apply(d3,ot(t,e))}function st(t,e){return d3.format(",."+Math.max(0,-Math.floor(Math.log(ot(t,e)[2])/Math.LN10+.01))+"f")}function lt(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 ut(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 ct(t){return Math.log(t<0?0:t)/Math.LN10}function dt(t){return-Math.log(0<t?0:-t)/Math.LN10}function ht(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function pt(t){return t.innerRadius}function ft(t){return t.outerRadius}function gt(t){return t.startAngle}function mt(t){return t.endAngle}function vt(t){function e(e){function i(){c.push("M",l(t(d),u))}for(var s,c=[],d=[],h=-1,p=e.length,f=r(n),g=r(o);++h<p;)a.call(this,s=e[h],h)?d.push([+f.call(this,s,h),+g.call(this,s,h)]):d.length&&(i(),d=[]);return d.length&&i(),c.length?c.join(""):null}var n=yt,o=bt,a=i,s=Jn,l=xt,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?(Zn.has(t+="")||(t=Jn),l=Zn.get(s=t),e):s},e.tension=function(t){return arguments.length?(u=t,e):u},e}function yt(t){return t[0]}function bt(t){return t[1]}function xt(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 wt(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 Ct(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 _t(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return xt(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),1<e.length){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]}return n&&(r=t[l],i+="Q"+(o[0]+2*s[0]/3)+","+(o[1]+2*s[1]/3)+","+r[0]+","+r[1]),i}function Et(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 Mt(t){if(t.length<3)return xt(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(Dt(l,a,s);++e<n;)i=t[e],a.shift(),a.push(i[0]),s.shift(),s.push(i[1]),Dt(l,a,s);for(e=-1;++e<2;)a.shift(),a.push(i[0]),s.shift(),s.push(i[1]),Dt(l,a,s);return l.join("")}function St(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Dt(t,e,n){t.push("C",St(ti,e),",",St(ti,n),",",St(ei,e),",",St(ei,n),",",St(ni,e),",",St(ni,n))}function Pt(t,e){return(e[1]-t[1])/(e[0]-t[0])}function jt(t){for(var e,n,i,r=-1,o=t.length;++r<o;)n=(e=t[r])[0],i=e[1]+Qn,e[0]=n*Math.cos(i),e[1]=n*Math.sin(i);return t}function Tt(t){function e(e){function i(){m.push("M",c(t(y),p),h,d(t(v.reverse()),p),"Z")}for(var u,f,g,m=[],v=[],y=[],b=-1,x=e.length,w=r(n),C=r(a),_=n===o?function(){return f}:r(o),E=a===s?function(){return g}:r(s);++b<x;)l.call(this,u=e[b],b)?(v.push([f=+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=yt,o=yt,a=0,s=bt,l=i,u=Jn,c=xt,d=xt,h="L",p=.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?(Zn.has(t+="")||(t=Jn),c=Zn.get(u=t),d=c.reverse||c,h=/-closed$/.test(t)?"M":"L",e):u},e.tension=function(t){return arguments.length?(p=t,e):p},e}function At(t){return t.source}function kt(t){return t.target}function It(t){return t.radius}function Lt(t){return[t.x,t.y]}function Ot(){return 64}function Nt(){return"circle"}function zt(t){return"M0,"+(t=Math.sqrt(t/Math.PI))+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Rt(t,e){t.attr("transform",(function(t){return"translate("+e(t)+",0)"}))}function Ht(t,e){t.attr("transform",(function(t){return"translate(0,"+e(t)+")"}))}function Ft(t){for(var e=t.source,n=t.target,i=function(t,e){if(t===e)return t;for(var n=Vt(t),i=Vt(e),r=n.pop(),o=i.pop(),a=null;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 Vt(t){for(var e=[],n=t.parent;null!=n;)e.push(t),n=(t=n).parent;return e.push(t),e}function Bt(t){t.fixed|=2}function Wt(t){t!==ci&&(t.fixed&=1)}function $t(){ci.fixed&=1,ui=ci=null}function Ut(){ci.px=d3.event.x,ci.py=d3.event.y,ui.resume()}function qt(t){return 20}function Gt(t){return 1}function Yt(t){return t.x}function Xt(t){return t.y}function Qt(t,e,n){t.y0=e,t.y=n}function Kt(t){return d3.range(t.length)}function Jt(t){for(var e=-1,n=t[0].length,i=[];++e<n;)i[e]=0;return i}function Zt(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 te(t){return t.reduce(ee,0)}function ee(t,e){return t+e[1]}function ne(t,e){return ie(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function ie(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 re(t){return[d3.min(t),d3.max(t)]}function oe(t,e){return d3.rebind(t,e,"sort","children","value"),t.links=ue,t.nodes=function(e){return gi=!0,(t.nodes=t)(e)},t}function ae(t){return t.children}function se(t){return t.value}function le(t,e){return e.value-t.value}function ue(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 de(t,e){var n=t._pack_next;(t._pack_next=e)._pack_prev=t,(e._pack_next=n)._pack_prev=e}function he(t,e){(t._pack_next=e)._pack_prev=t}function pe(t,e){var n=e.x-t.x,i=e.y-t.y;return.001<(t=t.r+e.r)*t-n*n-i*i}function fe(t){t._pack_next=t._pack_prev=t}function ge(t){delete t._pack_next,delete t._pack_prev}function me(t){var e=t.children;e&&e.length?(e.forEach(me),t.r=function(t){function e(t){o=Math.min(t.x-t.r,o),a=Math.max(t.x+t.r,a),s=Math.min(t.y-t.r,s),l=Math.max(t.y+t.r,l)}var n,i,r,o=1/0,a=-1/0,s=1/0,l=-1/0,u=t.length;if(t.forEach(fe),(n=t[0]).x=-n.r,n.y=0,e(n),1<u&&((c=t[1]).x=c.r,c.y=0,e(c),2<u)){ve(n,c,i=t[2]),e(i),de(n,i),de(n._pack_prev=i,c);for(var c=n._pack_next,d=3;d<u;d++){ve(n,c,i=t[d]);for(var h=0,p=1,f=1,g=c._pack_next;g!==c;g=g._pack_next,p++)if(pe(g,i)){h=1;break}if(1==h)for(r=n._pack_prev;r!==g._pack_prev&&!pe(r,i);r=r._pack_prev,f++);h?(p<f||p==f&&c.r<n.r?he(n,c=g):he(n=r,c),d--):(de(n,i),e(c=i))}}var m=(o+a)/2,v=(s+l)/2,y=0;for(d=0;d<u;d++){var b=t[d];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(ge),y}(e)):t.r=Math.sqrt(t.value)}function ve(t,e,n){var i,r,o=t.r+n.r,a=e.x-t.x,s=e.y-t.y;o&&(a||s)?(e=e.r+n.r,r=Math.sqrt(a*a+s*s),e=Math.max(-1,Math.min(1,(o*o+r*r-e*e)/(2*o*r))),i=Math.acos(e),e*=o/=r,r=Math.sin(i)*o,n.x=t.x+e*a+r*s,n.y=t.y+e*s-r*a):(n.x=t.x+o,n.y=t.y)}function ye(t,e){return t.parent==e.parent?1:2}function be(t){var e=t.children;return e&&e.length?e[0]:t._tree.thread}function xe(t){var e,n=t.children;return n&&(e=n.length)?n[e-1]:t._tree.thread}function we(t,e){var n=t.children;if(n&&(r=n.length))for(var i,r,o=-1;++o<r;)0<e(i=we(n[o],e),t)&&(t=i);return t}function Ce(t,e){return t.x-e.x}function _e(t,e){return e.x-t.x}function Ee(t,e){return t.depth-e.depth}function Me(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 Se(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function De(t,e){var n=t.x+e[3],i=t.y+e[0],r=t.dx-e[1]-e[3];return r<0&&(n+=r/2,r=0),(t=t.dy-e[0]-e[2])<0&&(i+=t/2,t=0),{x:n,y:i,dx:r,dy:t}}function Pe(t){return t.map(je).join(",")}function je(t){return/[",\n]/.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}function Te(t,e){return function(n){return n&&t.hasOwnProperty(n.type)?t[n.type](n):e}}function Ae(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ke(t,e){vi.hasOwnProperty(t.type)&&vi[t.type](t,e)}function Ie(t,e){for(var n=t.coordinates,i=0,r=n.length;i<r;i++)e.apply(null,n[i])}function Le(t){return t.source}function Oe(t){return t.target}function Ne(){function t(t){var e=Math.sin(t*=p)*f,n=(t=Math.sin(p-t)*f)*o+e*d,i=t*a+e*h;t=t*r+e*c;return[Math.atan2(i,n)/mi,Math.atan2(t,Math.sqrt(n*n+i*i))/mi]}var e,n,i,r,o,a,s,l,u,c,d,h,p,f;return t.distance=function(){return null==p&&(f=1/Math.sin(p=Math.acos(Math.max(-1,Math.min(1,r*c+i*u*Math.cos(s-e)))))),p},t.source=function(s){var l=Math.cos(e=s[0]*mi),u=Math.sin(e);return i=Math.cos(n=s[1]*mi),r=Math.sin(n),o=i*l,a=i*u,p=null,t},t.target=function(e){var n=Math.cos(s=e[0]*mi),i=Math.sin(s);return u=Math.cos(l=e[1]*mi),c=Math.sin(l),d=u*n,h=u*i,p=null,t},t}function ze(t,e){return(t=Ne().source(t).target(e)).distance(),t}function Re(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function He(t,e,n,i){var r=t[0],o=e[0],a=n[0],s=i[0];t=t[1],o-=r,e=(e=e[1])-t;return[r+(n=((s=s-a)*(t-(n=n[1]))-(i=i[1]-n)*(r-a))/(i*o-s*e))*o,t+n*e]}function Fe(t,e){for(var n,i,r,o,a,s,l,u,c,d,h,p,f,g={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},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,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){for(var e=m.leftEnd;(e=e.r)!=m.rightEnd&&v.rightOf(e,t););return 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?g.bottomSite:t.edge.region[t.side]},rightRegion:function(t){return null==t.edge?g.bottomSite:t.edge.region[xi[t.side]]}},v={bisect:function(t,e){var n={region:{l:t,r:e},ep:{l:null,r:null}},i=e.x-t.x,r=0<i?i:-i,o=0<(e=e.y-t.y)?e:-e;return n.c=t.x*i+t.y*e+.5*(i*i+e*e),o<r?(n.a=1,n.b=e/i,n.c/=i):(n.b=1,n.a=i/e,n.c/=e),n},intersect:function(t,e){var n,i,r,o,a,s=t.edge,l=e.edge;return!s||!l||s.region.r==l.region.r||(i=s.a*l.b-s.b*l.a,Math.abs(i)<1e-10)||(n=(s.c*l.b-l.c*s.b)/i,i=(l.c*s.a-s.c*l.a)/i,a=s.region.r,r=l.region.r,(a=n>=(a.y<r.y||a.y==r.y&&a.x<r.x?(o=t,s):(o=e,l)).region.r.x)&&"l"===o.side)||!a&&"r"===o.side?null:{x:n,y:i}},rightOf:function(t,e){var n,i,r,o,a=t.edge,s=a.region.r,l=e.x>s.x;return l&&"l"===t.side?1:l||"r"!==t.side?(1===a.a?(r=e.y-s.y,o=e.x-s.x,n=i=0,!l&&a.b<0||l&&0<=a.b?n=i=r>=a.b*o:(n=e.x+e.y*a.b>a.c,(n=a.b<0?!n:n)||(i=1)),i||(l=s.x-a.region.l.x,n=a.b*(o*o-r*r)<l*r*(1+2*o/l+a.b*a.b),a.b<0&&(n=!n))):(i=a.c-a.a*e.x,r=e.y-i,n=(o=e.x-s.x)*o+(l=i-s.y)*l<r*r),"l"===t.side?n:!n):0},endPoint:function(t,n,i){t.ep[n]=i,t.ep[xi[n]]&&e(t)},distance:function(t,e){var n=t.x-e.x;t=t.y-e.y;return Math.sqrt(n*n+t*t)}},y={list:[],insert:function(t,e,n){t.vertex=e,t.ystar=e.y+n;for(var i=0,r=y.list,o=r.length;i<o;i++){var a=r[i];if(!(t.ystar>a.ystar||t.ystar==a.ystar&&e.x>a.vertex.x))break}r.splice(i,0,t)},del:function(t){for(var e=0,n=y.list,i=n.length;e<i&&n[e]!=t;++e);n.splice(e,1)},empty:function(){return 0===y.list.length},nextEvent:function(t){for(var e=0,n=y.list,i=n.length;e<i;++e)if(n[e]==t)return n[e+1];return null},min:function(){var t=y.list[0];return{x:t.vertex.x,y:t.ystar}},extractMin:function(){return y.list.shift()}},b=(m.init(),g.bottomSite=g.list.shift(),g.list.shift());;)if(y.empty()||(n=y.min()),b&&(y.empty()||b.y<n.y||b.y==n.y&&b.x<n.x))i=m.leftBound(b),r=m.right(i),l=m.rightRegion(i),p=v.bisect(l,b),s=m.createHalfEdge(p,"l"),m.insert(i,s),(d=v.intersect(i,s))&&(y.del(i),y.insert(i,d,v.distance(d,b))),i=s,s=m.createHalfEdge(p,"r"),m.insert(i,s),(d=v.intersect(s,r))&&y.insert(s,d,v.distance(d,b)),b=g.list.shift();else{if(y.empty())break;i=y.extractMin(),o=m.left(i),r=m.right(i),a=m.right(r),l=m.leftRegion(i),u=m.rightRegion(r),h=i.vertex,v.endPoint(i.edge,i.side,h),v.endPoint(r.edge,r.side,h),m.del(i),y.del(r),m.del(r),f="l",l.y>u.y&&(c=l,l=u,u=c,f="r"),p=v.bisect(l,u),s=m.createHalfEdge(p,f),m.insert(o,s),v.endPoint(p,xi[f],h),(d=v.intersect(o,s))&&(y.del(o),y.insert(o,d,v.distance(d,l))),(d=v.intersect(s,a))&&y.insert(s,d,v.distance(d,l))}for(i=m.right(m.leftEnd);i!=m.rightEnd;i=m.right(i))e(i.edge)}function Ve(t){return{x:t[0],y:t[1]}}function Be(){this._=new Date(1<arguments.length?Date.UTC.apply(this,arguments):arguments[0])}function We(t,e,n,i){for(var r,o,a=0,s=e.length,l=n.length;a<s;){if(l<=i)return-1;if(37==(r=e.charCodeAt(a++))){if(!(o=Pi[e.charAt(a++)])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}function $e(t,e,n){return Ni.lastIndex=0,(e=Ni.exec(e.substring(n,n+2)))?(t.d=+e[0],n+e[0].length):-1}function Ue(t,e,n){return Ni.lastIndex=0,(e=Ni.exec(e.substring(n,n+2)))?(t.H=+e[0],n+e[0].length):-1}function qe(t){return t.toISOString()}function Ge(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 wi(n-1)),1),n}function o(t,n){return e(t=new wi(+t),n),t}function a(t,i,o){var a=r(t),s=[];if(1<o)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).round=i,t.ceil=r,t.offset=o,t.range=a;var s=t.utc=Ye(t);return(s.floor=s).round=Ye(i),s.ceil=Ye(r),s.offset=Ye(o),s.range=function(t,e,n){try{var i=new(wi=Be);return i._=t,a(i,e,n)}finally{wi=Date}},t}function Ye(t){return function(e,n){try{var i=new(wi=Be);return i._=e,t(i,n)._}finally{wi=Date}}}function Xe(t,e,n){function i(e){return t(e)}return i.invert=function(e){return Ke(t.invert(e))},i.domain=function(e){return arguments.length?(t.domain(e),i):t.domain().map(Ke)},i.nice=function(t){var e=Qe(i.domain());return i.domain([t.floor(e[0]),t.ceil(e[1])])},i.ticks=function(n,r){var o=Qe(i.domain());if("function"!=typeof n){var a=(o[1]-o[0])/n,s=d3.bisect(Ri,a);if(s==Ri.length)return e.year(o,n);if(!s)return t.ticks(n).map(Ke);Math.log(a/Ri[s-1])<Math.log(Ri[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 Xe(t.copy(),e,n)},d3.rebind(i,t,"range","rangeRound","interpolate","clamp")}function Qe(t){var e=t[0];return e<(t=t[t.length-1])?[e,t]:[t,e]}function Ke(t){return new Date(t)}function Je(t){return function(e){for(var n=t.length-1,i=t[n];!i[1](e);)i=t[--n];return i[0](e)}}function Ze(t){var e=new Date(t,0,1);return e.setFullYear(t),e}function tn(t){var e=t.getFullYear(),n=Ze(e);return e+(t-n)/(Ze(e+1)-n)}function en(t){var e=new Date(Date.UTC(t,0,1));return e.setUTCFullYear(t),e}function nn(t){var e=t.getUTCFullYear(),n=en(e);return e+(t-n)/(en(e+1)-n)}Date.now||(Date.now=function(){return+new Date});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(oe){var rn=(gn=CSSStyleDeclaration.prototype).setProperty;gn.setProperty=function(t,e,n){rn.call(this,t,e+"",n)}}d3={version:"2.9.6"};var on=function(t){return Array.prototype.slice.call(t)};try{on(document.documentElement.childNodes)[0].nodeType}catch(oe){on=function(t){for(var e=-1,n=t.length,i=[];++e<n;)i.push(t[e]);return i}}var an=[].__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},sn=(d3.map=function(e){var n,i=new t;for(n in e)i.set(n,e[n]);return i},t),ln={has:function(t){return pn+t in this},get:function(t){return this[pn+t]},set:function(t,e){return this[pn+t]=e},remove:function(t){return(t=pn+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)===fn&&t.call(this,e.substring(1),this[e])}};try{for(var un in ln)Object.defineProperty(sn.prototype,un,{value:ln[un],enumerable:!1})}catch(oe){sn.prototype=ln}function cn(){return m}var dn,hn,pn="\0",fn=pn.charCodeAt(0),gn=(d3.functor=r,d3.rebind=function(t,e){for(var n,i=1,r=arguments.length;++i<r;)t[n=arguments[i]]=function(t,e,n){return function(){var i=n.apply(e,arguments);return arguments.length?t:i}}(t,e,e[n]);return t},d3.ascending=function(t,e){return t<e?-1:e<t?1:e<=t?0:NaN},d3.descending=function(t,e){return e<t?-1:t<e?1:t<=e?0:NaN},d3.mean=function(t,e){var n,i=t.length,r=0,a=-1,s=0;if(1===arguments.length)for(;++a<i;)o(n=t[a])&&(r+=(n-r)/++s);else for(;++a<i;)o(n=e.call(t,t[a],a))&&(r+=(n-r)/++s);return s?r:void 0},d3.median=function(t,e){return(t=(t=1<arguments.length?t.map(e):t).filter(o)).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])&&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.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])&&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.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])&&(i<n&&(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))&&(i<n&&(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(){for(var n,i,r;!(r=(n=2*Math.random()-1)*n+(i=2*Math.random()-1)*i)||1<r;);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){e=(t.length-1)*e+1;var n=Math.floor(e),i=t[n-1];return(e=e-n)?i+e*(t[n]-i):i},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,a),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=1+o: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=1+o}return i}}},d3.bisector((function(t){return t}))),mn=(d3.bisectLeft=gn.left,d3.bisect=d3.bisectRight=gn.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;)0<e.call(t,o,n=t[i])&&(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(a,s){if(s>=o.length)return i?i.call(r,a):n?a.sort(n):a;for(var l,u,c,d=-1,h=a.length,p=o[s++],f=new t,g={};++d<h;)(c=f.get(l=p(u=a[d])))?c.push(u):f.set(l,[u]);return f.forEach((function(t){g[t]=e(f.get(t),s)})),g}var n,i,r={},o=[],a=[];return r.map=function(t){return e(t,0)},r.entries=function(t){return function t(e,n){if(n>=o.length)return e;var i,r=[],s=a[n++];for(i in e)r.push({key:i,values:t(e[i],n)});return s&&r.sort((function(t,e){return s(t.key,e.key)})),r}(e(t,0),0)},r.key=function(t){return o.push(t),r},r.sortKeys=function(t){return a[o.length-1]=t,r},r.sortValues=function(t){return n=t,r},r.rollup=function(t){return i=t,r},r},d3.keys=function(t){var e,n=[];for(e in t)n.push(e);return n},d3.values=function(t){var e,n=[];for(e in t)n.push(t[e]);return n},d3.entries=function(t){var e,n=[];for(e in t)n.push({key:e,value:t[e]});return n},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=s);++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(mn,"\\$&")},/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g),vn=(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(){var t;4===i.readyState&&(t=i.status,n(!t&&i.response||200<=t&&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){var n;null!=t&&((n=document.createRange()).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)}))},{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/"}),yn=(d3.ns={prefix:vn,qualify:function(t){var e=t.indexOf(":"),n=t;return 0<=e&&(n=t.substring(0,e),t=t.substring(e+1)),vn.hasOwnProperty(n)?{space:vn[n],local:t}:t}},d3.dispatch=function(){for(var t=new u,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=c(t);return t},u.prototype.on=function(t,e){var n=t.indexOf("."),i="";return 0<n&&(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=(t=yn.exec(t))[1]||" ",n=t[3]||"",i=t[5],r=+t[6],o=t[7],a=t[8],s=t[9],l=1,u="",c=!1;a=a&&+a.substring(1);switch(i&&(e="0",o)&&(r-=Math.floor((r-1)/4)),s){case"n":o=!0,s="g";break;case"%":l=100,u="%",s="f";break;case"p":l=100,u="%",s="r";break;case"d":c=!0,a=0;break;case"s":l=-1,s="r"}return"r"!=s||a||(s="g"),s=bn.get(s)||h,function(t){var d,h,f;return c&&t%1?"":(d=t<0&&(t=-t)?"−":n,l<0?(t=(h=d3.formatPrefix(t,a)).scale(t),u=h.symbol):t*=l,t=s(t,a),i?((f=t.length+d.length)<r&&(t=new Array(r-f+1).join(e)+t),t=d+(t=o?p(t):t)):(f=(t=d+(t=o?p(t):t)).length)<r&&(t=new Array(r-f+1).join(e)+t),t+u)}},/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/),bn=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=d(t,e)).toFixed(Math.max(0,Math.min(20,e)))}}),xn=["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:8<e?function(t){return t/n}:function(t){return t*n},symbol:t}})),wn=(d3.formatPrefix=function(t,e){var n=0;return t&&(t<0&&(t*=-1),e&&(t=d3.round(t,d(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)))),xn[8+n/3]},v(2)),Cn=v(3),_n=d3.map({linear:cn,poly:v,quad:function(){return wn},cubic:function(){return Cn},sin:function(){return y},exp:function(){return b},circle:function(){return x},elastic:function(t,e){var n;return arguments.length<2&&(e=.45),n=arguments.length<1?(t=1,e/4):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 w}}),En=d3.map({in:m,out:f,"in-out":g,"out-in":function(t){return g(f(t))}}),Mn=(d3.ease=function(t){var e,n=0<=(i=t.indexOf("-"))?t.substring(0,i):t,i=0<=i?t.substring(i+1):"in";n=_n.get(n)||cn,i=En.get(i)||m;return e=i(n.apply(null,Array.prototype.slice.call(arguments,1))),function(t){return t<=0?0:1<=t?1:e(t)}},d3.event=null,d3.interpolate=function(t,e){for(var n,i=d3.interpolators.length;0<=--i&&!(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(Mn.lastIndex=0,i=0;n=Mn.exec(e);++i)n.index&&l.push(e.substring(s,n.index)),u.push({i:l.length,x:n[0]}),l.push(null),s=Mn.lastIndex;for(s<e.length&&l.push(e.substring(s)),i=0,o=u.length;(n=Mn.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=(t=d3.transform(t),e=d3.transform(e),t.translate),a=e.translate,s=t.rotate,l=e.rotate,u=t.skew,c=e.skew;t=t.scale,e=e.scale;return o[0]!=a[0]||o[1]!=a[1]?(i.push("translate(",null,",",null,")"),r.push({i:1,x:d3.interpolateNumber(o[0],a[0])},{i:3,x:d3.interpolateNumber(o[1],a[1])})):a[0]||a[1]?i.push("translate("+a+")"):i.push(""),s!=l?(180<s-l?l+=360:180<l-s&&(s+=360),r.push({i:i.push(i.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(s,l)})):l&&i.push(i.pop()+"rotate("+l+")"),u!=c?r.push({i:i.push(i.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(u,c)}):c&&i.push(i.pop()+"skewX("+c+")"),t[0]!=e[0]||t[1]!=e[1]?(n=i.push(i.pop()+"scale(",null,",",null,")"),r.push({i:n-4,x:d3.interpolateNumber(t[0],e[0])},{i:n-2,x:d3.interpolateNumber(t[1],e[1])})):1==e[0]&&1==e[1]||i.push(i.pop()+"scale("+e+")"),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"#"+T(Math.round(n+o*t))+T(Math.round(i+a*t))+T(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 180<o?o-=360:o<-180&&(o+=360),function(t){return N(n+o*t,i+a*t,r+s*t).toString()}},d3.interpolateArray=function(t,e){for(var n=[],i=[],r=t.length,o=e.length,a=Math.min(t.length,e.length),s=0;s<a;++s)n.push(d3.interpolate(t[s],e[s]));for(;s<r;++s)i[s]=t[s];for(;s<o;++s)i[s]=e[s];return function(t){for(s=0;s<a;++s)i[s]=n[s](t);return i}},d3.interpolateObject=function(t,e){var n,i={},r={};for(n in t)n in e?i[n]=M(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}},/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g),Sn=(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?Sn.has(e)||/^(#|rgb\(|hsl\()/.test(e):e instanceof j||e instanceof O)&&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 j?P(t.r,t.g,t.b):A(""+t,P,N):P(~~t,~~e,~~n)},j.prototype.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,i=this.b;return e||n||i?(e&&e<30&&(e=30),n&&n<30&&(n=30),i&&i<30&&(i=30),P(Math.min(255,Math.floor(e/t)),Math.min(255,Math.floor(n/t)),Math.min(255,Math.floor(i/t)))):P(30,30,30)},j.prototype.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),P(Math.floor(t*this.r),Math.floor(t*this.g),Math.floor(t*this.b))},j.prototype.hsl=function(){return k(this.r,this.g,this.b)},j.prototype.toString=function(){return"#"+T(this.r)+T(this.g)+T(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"})),Dn=(Sn.forEach((function(t,e){Sn.set(t,A(e,P,N))})),d3.hsl=function(t,e,n){return 1===arguments.length?t instanceof O?L(t.h,t.s,t.l):A(""+t,k,L):L(+t,+e,+n)},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 N(this.h,this.s,this.l)},O.prototype.toString=function(){return this.rgb().toString()},function(t,e){return e.querySelector(t)}),Pn=function(t,e){return e.querySelectorAll(t)},jn=(gn=document.documentElement).matchesSelector||gn.webkitMatchesSelector||gn.mozMatchesSelector||gn.msMatchesSelector||gn.oMatchesSelector,Tn=function(t,e){return jn.call(t,e)},An=("function"==typeof Sizzle&&(Dn=function(t,e){return Sizzle(t,e)[0]||null},Pn=function(t,e){return Sizzle.uniqueSort(Sizzle(t,e))},Tn=Sizzle.matchesSelector),[]),kn=(d3.selection=function(){return kn},(d3.selection.prototype=An).select=function(t){var e,n,i,r,o=[];"function"!=typeof t&&(t=R(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 z(o)},An.selectAll=function(t){var e,n,i=[];"function"!=typeof t&&(t=H(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=on(t.call(n,n.__data__,s))),e.parentNode=n);return z(i)},An.attr=function(t,e){var n;return t=d3.ns.qualify(t),arguments.length<2?(n=this.node(),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)):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)})},An.classed=function(t,e){var n=l(t).split(" "),i=n.length,r=-1;if(1<arguments.length){for(;++r<i;)F.call(this,n[r],e);return this}for(;++r<i;)if(!F.call(this,n[r]))return!1;return!0},An.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)})},An.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})},An.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})},An.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})},An.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))})},An.insert=function(t,e){return t=d3.ns.qualify(t),this.select(t.local?function(){return this.insertBefore(document.createElementNS(t.space,t.local),Dn(e,this))}:function(){return this.insertBefore(document.createElementNS(this.namespaceURI,t),Dn(e,this))})},An.remove=function(){return this.each((function(){var t=this.parentNode;t&&t.removeChild(this)}))},An.data=function(e,n){function i(e,i){var r,o,a=e.length,s=i.length,d=Math.min(a,s),h=Math.max(a,s),p=[],f=[],g=[];if(n){for(var m,v=new t,y=[],b=i.length,x=-1;++x<a;)m=n.call(r=e[x],r.__data__,x),v.has(m)?g[b++]=r:v.set(m,r),y.push(m);for(x=-1;++x<s;)m=n.call(i,o=i[x],x),v.has(m)?(p[x]=r=v.get(m),r.__data__=o,f[x]=g[x]=null):(f[x]=V(o),p[x]=g[x]=null),v.remove(m);for(x=-1;++x<a;)v.has(y[x])&&(g[x]=e[x])}else{for(x=-1;++x<d;)r=e[x],o=i[x],r?(r.__data__=o,p[x]=r,f[x]=g[x]=null):(f[x]=V(o),p[x]=g[x]=null);for(;x<s;++x)f[x]=V(i[x]),p[x]=g[x]=null;for(;x<h;++x)g[x]=e[x],f[x]=p[x]=null}f.update=p,f.parentNode=p.parentNode=g.parentNode=e.parentNode,l.push(f),u.push(p),c.push(g)}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=W([]),u=z([]),c=z([]);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},An.datum=An.map=function(t){return arguments.length<1?this.property("__data__"):this.property("__data__",t)},An.filter=function(t){var e,n,i,r,o=[];"function"!=typeof t&&(r=t,t=function(){return Tn(this,r)});for(var a=0,s=this.length;a<s;a++){o.push(e=[]),e.parentNode=(n=this[a]).parentNode;for(var l=0,u=n.length;l<u;l++)(i=n[l])&&t.call(i,i.__data__,l)&&e.push(i)}return z(o)},An.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,i=this[t],r=i.length-1,o=i[r];0<=--r;)(n=i[r])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},An.sort=function(t){t=function(t){return arguments.length||(t=d3.ascending),function(e,n){return t(e&&e.__data__,n&&n.__data__)}}.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()},An.on=function(t,e,n){arguments.length<3&&(n=!1);var i="__on"+t,r=t.indexOf(".");return 0<r&&(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)}))},An.each=function(t){return B(this,(function(e,n,i){t.call(e,e.__data__,n,i)}))},An.call=function(t){return t.apply(this,(arguments[0]=this,arguments)),this},An.empty=function(){return!this.node()},An.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},An.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:Rn,duration:Hn}:null)}return $(n,zn||++Nn,Date.now())},z([[document]])),In=(kn[0].parentNode=gn,d3.select=function(t){return"string"==typeof t?kn.select(t):z([[t]])},d3.selectAll=function(t){return"string"==typeof t?kn.selectAll(t):z([on(t)])},[]),Ln=(d3.selection.enter=W,(d3.selection.enter.prototype=In).append=An.append,In.insert=An.insert,In.empty=An.empty,In.node=An.node,In.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 z(a)},{}),On=[],Nn=0,zn=0,Rn=(gn=d3.ease("cubic-in-out"),0),Hn=250,Fn=gn,Vn=(On.call=An.call,d3.transition=function(t){return arguments.length?zn?t.transition():t:kn.transition()},(d3.transition.prototype=On).select=function(t){var e,n,i,r=[];"function"!=typeof t&&(t=R(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 $(r,this.id,this.time).ease(this.ease())},On.selectAll=function(t){var e,n,i,r=[];"function"!=typeof t&&(t=H(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 $(r,this.id,this.time).ease(this.ease())},On.attr=function(t,e){return this.attrTween(t,q(t,e))},On.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===Ln?(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===Ln?(this.removeAttribute(n),null):r&&function(t){this.setAttribute(n,r(t))}})},On.style=function(t,e,n){return arguments.length<3&&(n=""),this.styleTween(t,q(t,e),n)},On.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===Ln?(this.style.removeProperty(t),null):o&&function(e){this.style.setProperty(t,o(e),n)}}))},On.text=function(t){return this.tween("text",(function(e,n){this.textContent="function"==typeof t?t.call(this,e,n):t}))},On.remove=function(){return this.each("end.transition",(function(){var t;!this.__transition__&&(t=this.parentNode)&&t.removeChild(this)}))},On.delay=function(t){return B(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}))},On.duration=function(t){return B(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}))},On.transition=function(){return this.select(n)},null),Bn=(d3.timer=function(t,e,n){var i=!1,r=Vn;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||(Vn={callback:t,then:n,delay:e,next:Vn}),dn||(hn=clearTimeout(hn),dn=1,Bn(G))},d3.timer.flush=function(){for(var t,e=Date.now(),n=Vn;n;)t=e-n.then,n.delay||(n.flush=n.callback(t)),n=n.next;Y()},window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,17)}),Wn=(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){return e.setAttribute("transform",t),new X((t=e.transform.baseVal.consolidate())?t.matrix:n)})(t)},X.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"},180/Math.PI),$n=(d3.mouse=function(t){return J(t,_())},/WebKit/.test(navigator.userAgent)?-1:0),Un=(d3.touches=function(t,e){return(e=arguments.length<2?_().touches:e)?on(e).map((function(e){var n=J(t,e);return n.identifier=e.identifier,n})):[]},d3.scale={},d3.scale.linear=function(){return function t(e,n,i,r){function o(){var t=2<Math.min(e.length,n.length)?ut:lt,o=r?D:S;return s=t(e,n,o,i),l=t(n,e,o,d3.interpolate),a}function a(t){return s(t)}var s,l;return a.invert=function(t){return l(t)},a.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},a.range=function(t){return arguments.length?(n=t,o()):n},a.rangeRound=function(t){return a.range(t).interpolate(d3.interpolateRound)},a.clamp=function(t){return arguments.length?(r=t,o()):r},a.interpolate=function(t){return arguments.length?(i=t,o()):i},a.ticks=function(t){return at(e,t)},a.tickFormat=function(t){return st(e,t)},a.nice=function(){return et(e,rt),o()},a.copy=function(){return t(e,n,i,r)},o()}([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return function t(e,n){function i(t){return e(n(t))}var r=n.pow;return i.invert=function(t){return r(e.invert(t))},i.domain=function(t){return arguments.length?(n=t[0]<0?dt:ct,r=n.pow,e.domain(t.map(n)),i):e.domain().map(r)},i.nice=function(){return e.domain(et(e.domain(),nt)),i},i.ticks=function(){var t=Z(e.domain()),i=[];if(t.every(isFinite)){var o=Math.floor(t[0]),a=Math.ceil(t[1]),s=r(t[0]),l=r(t[1]);if(n===dt)for(i.push(r(o));o++<a;)for(var u=9;0<u;u--)i.push(r(o)*u);else{for(;o<a;o++)for(u=1;u<10;u++)i.push(r(o)*u);i.push(r(o))}for(o=0;i[o]<s;o++);for(a=i.length;i[a-1]>l;a--);i=i.slice(o,a)}return i},i.tickFormat=function(t,e){var o,a,s;return arguments.length<2&&(e=Un),arguments.length<1?e:(o=Math.max(.1,t/i.ticks().length),a=n===dt?(s=-1e-12,Math.floor):(s=1e-12,Math.ceil),function(t){return t/r(a(n(t)+s))<=o?e(t):""})},i.copy=function(){return t(e.copy(),n)},it(i,e)}(d3.scale.linear(),ct)},d3.format(".0e")),qn=(ct.pow=function(t){return Math.pow(10,t)},dt.pow=function(t){return-Math.pow(10,-t)},d3.scale.pow=function(){return function t(e,n){function i(t){return e(r(t))}var r=ht(n),o=ht(1/n);return i.invert=function(t){return o(e.invert(t))},i.domain=function(t){return arguments.length?(e.domain(t.map(r)),i):e.domain().map(o)},i.ticks=function(t){return at(i.domain(),t)},i.tickFormat=function(t){return st(i.domain(),t)},i.nice=function(){return i.domain(et(i.domain(),rt))},i.exponent=function(t){var e;return arguments.length?(e=i.domain(),r=ht(n=t),o=ht(1/n),i.domain(e)):n},i.copy=function(){return t(e.copy(),n)},it(i,e)}(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return function e(n,i){function r(t){return s[((a.get(t)||a.set(t,n.push(t)))-1)%s.length]}function o(t,e){return d3.range(n.length).map((function(n){return t+e*n}))}var a,s,l;return r.domain=function(e){if(!arguments.length)return n;n=[],a=new t;for(var o,s=-1,l=e.length;++s<l;)a.has(o=e[s])||a.set(o,n.push(o));return r[i.t](i.x,i.p)},r.range=function(t){return arguments.length?(l=0,i={t:"range",x:s=t},r):s},r.rangePoints=function(t,e){var a=t[0],u=t[1],c=(u-a)/(n.length-1+(e=arguments.length<2?0:e));return s=o(n.length<2?(a+u)/2:a+c*e/2,c),l=0,i={t:"rangePoints",x:t,p:e},r},r.rangeBands=function(t,e){var a=t[1]<t[0],u=t[+a],c=(t[1-a]-u)/(n.length+(e=arguments.length<2?0:e));return s=o(u+c*e,c),a&&s.reverse(),l=c*(1-e),i={t:"rangeBands",x:t,p:e},r},r.rangeRoundBands=function(t,e){arguments.length<2&&(e=0);var a=t[1]<t[0],u=t[+a],c=t[1-a],d=Math.floor((c-u)/(n.length+e));c=c-u-(n.length-e)*d;return s=o(u+Math.round(c/2),d),a&&s.reverse(),l=Math.round(d*(1-e)),i={t:"rangeRoundBands",x:t,p:e},r},r.rangeBand=function(){return l},r.rangeExtent=function(){return Z(i.x)},r.copy=function(){return e(n,i)},r.domain(n)}([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(qn)},d3.scale.category20=function(){return d3.scale.ordinal().range(Gn)},d3.scale.category20b=function(){return d3.scale.ordinal().range(Yn)},d3.scale.category20c=function(){return d3.scale.ordinal().range(Xn)},["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"]),Gn=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],Yn=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],Xn=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"],Qn=(d3.scale.quantile=function(){return function t(e,n){function i(){var t=0,i=(e.length,n.length);for(o=[];++t<i;)o[t-1]=d3.quantile(e,t/i);return r}function r(t){return isNaN(t=+t)?NaN:n[d3.bisect(o,t)]}var o;return r.domain=function(t){return arguments.length?(e=t.filter((function(t){return!isNaN(t)})).sort(d3.ascending),i()):e},r.range=function(t){return arguments.length?(n=t,i()):n},r.quantiles=function(){return o},r.copy=function(){return t(e,n)},i()}([],[])},d3.scale.quantize=function(){return function t(e,n,i){function r(t){return i[Math.max(0,Math.min(s,Math.floor(a*(t-e))))]}function o(){return a=i.length/(n-e),s=i.length-1,r}var a,s;return r.domain=function(t){return arguments.length?(e=+t[0],n=+t[t.length-1],o()):[e,n]},r.range=function(t){return arguments.length?(i=t,o()):i},r.copy=function(){return t(e,n,i)},o()}(0,1,[0,1])},d3.scale.identity=function(){return function t(e){function n(t){return+t}return(n.invert=n).domain=n.range=function(t){return arguments.length?(e=t.map(n),n):e},n.ticks=function(t){return at(e,t)},n.tickFormat=function(t){return st(e,t)},n.copy=function(){return t(e)},n}([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)+Qn,s=((d=o.apply(this,arguments)+Qn)<a&&(s=a,a=d,d=s),d-a),l=s<Math.PI?"0":"1",u=Math.cos(a),c=(a=Math.sin(a),Math.cos(d)),d=Math.sin(d);return Kn<=s?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*u+","+r*a+"A"+r+","+r+" 0 "+l+",1 "+r*c+","+r*d+"L"+t*c+","+t*d+"A"+t+","+t+" 0 "+l+",0 "+t*u+","+t*a+"Z":"M"+r*u+","+r*a+"A"+r+","+r+" 0 "+l+",1 "+r*c+","+r*d+"L0,0Z"}var e=pt,n=ft,i=gt,o=mt;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+Qn;return[Math.cos(r)*t,Math.sin(r)*t]},t},-Math.PI/2),Kn=2*Math.PI-1e-6,Jn=(d3.svg.line=function(){return vt(e)},"linear"),Zn=d3.map({linear:xt,"step-before":wt,"step-after":Ct,basis:Mt,"basis-open":function(t){if(t.length<4)return xt(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(St(ni,o)+","+St(ni,a)),--i;++i<r;)e=t[i],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Dt(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=[St(ni,a),",",St(ni,s)],--i;++i<o;)n=t[i%r],a.shift(),a.push(n[0]),s.shift(),s.push(n[1]),Dt(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;)(i=t[u])[0]=e*i[0]+(1-e)*(o+(r=u/n)*s),i[1]=e*i[1]+(1-e)*(a+r*l);return Mt(t)},cardinal:function(t,e,n){return t.length<3?xt(t):t[0]+_t(t,Et(t,e))},"cardinal-open":function(t,e){return t.length<4?xt(t):t[1]+_t(t.slice(1,t.length-1),Et(t,e))},"cardinal-closed":function(t,e){return t.length<3?xt(t):t[0]+_t((t.push(t[0]),t),Et([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?xt(t):t[0]+_t(t,function(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]=Pt(r,o);++e<n;)i[e]=a+(a=Pt(o,o=t[e+1]));return i[e]=a,i}(t),s=-1,l=t.length-1;++s<l;)e=Pt(t[s],t[s+1]),Math.abs(e)<1e-6?a[s]=a[s+1]=0:9<(r=(n=a[s]/e)*n+(i=a[s+1]/e)*i)&&(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}(t))}}),ti=[0,2/3,1/3,0],ei=[0,1/3,2/3,0],ni=[0,1/6,2/3,1/6],ii=(d3.svg.line.radial=function(){var t=vt(jt);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},(wt.reverse=Ct).reverse=wt,d3.svg.area=function(){return Tt(Object)},d3.svg.area.radial=function(){var t=Tt(jt);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,l=e(this,o,t,r);t=e(this,a,t,r);return"M"+l.p0+n(l.r,l.p1,l.a1-l.a0)+(r=t,((s=l).a0==r.a0&&s.a1==r.a1?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,t.r,t.p0)+n(t.r,t.p1,t.a1-t.a0)+i(t.r,t.p1,l.r,l.p0))+"Z")}function e(t,e,n,i){e=e.call(t,n,i),n=s.call(t,e,i);var r=l.call(t,e,i)+Qn;return{r:n,a0:r,a1:t=u.call(t,e,i)+Qn,p0:[n*Math.cos(r),n*Math.sin(r)],p1:[n*Math.cos(t),n*Math.sin(t)]}}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=At,a=kt,s=It,l=gt,u=mt;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);t=n.call(this,t,r),r=(o.y+t.y)/2;return"M"+(o=(o=[o,{x:o.x,y:r},{x:t.x,y:r},t]).map(i))[0]+"C"+o[1]+" "+o[2]+" "+o[3]}var e=At,n=kt,i=Lt;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=Lt,n=t.projection;return t.projection=function(t){return arguments.length?n((i=e=t,function(){var t=(e=i.apply(this,arguments))[0],e=e[1]+Qn;return[t*Math.cos(e),t*Math.sin(e)]})):e;var i},t},d3.svg.mouse=d3.mouse,d3.svg.touches=d3.touches,d3.svg.symbol=function(){function t(t,i){return(ii.get(e.call(this,t,i))||zt)(n.call(this,t,i))}var e=Nt,n=Ot;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},d3.map({circle:zt,cross:function(t){return"M"+-3*(t=Math.sqrt(t/5)/2)+","+-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 e=(t=Math.sqrt(t/(2*oi)))*oi;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(t){return"M"+-(t=Math.sqrt(t)/2)+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(t){var e=(t=Math.sqrt(t/ri))*ri/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(t){var e=(t=Math.sqrt(t/ri))*ri/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}})),ri=(d3.svg.symbolTypes=ii.keys(),Math.sqrt(3)),oi=Math.tan(30*Math.PI/180),ai=(d3.svg.axis=function(){function t(t){t.each((function(){var t,d,h=d3.select(this),p=null==u?n.ticks?n.ticks.apply(n,l):n.domain():u,f=null==e?n.tickFormat?n.tickFormat.apply(n,l):String:e,g=function(t,e,n){if(i=[],n&&1<e.length){for(var i,r,o,a=Z(t.domain()),s=-1,l=e.length,u=(e[1]-e[0])/++n;++s<l;)for(r=n;0<--r;)(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,p,c),m=(g=h.selectAll(".minor").data(g,String)).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=(p=(g=h.selectAll("g").data(p,String)).enter().insert("g","path").style("opacity",1e-6),d3.transition(g.exit()).style("opacity",1e-6).remove()),x=d3.transition(g).style("opacity",1),w=tt(n),C=((h=h.selectAll(".domain").data([0])).enter().append("path").attr("class","domain"),d3.transition(h)),_=n.copy(),E=(h=this.__chart__||_,this.__chart__=_,p.append("line").attr("class","tick"),p.append("text"),p.select("line")),M=x.select("line"),S=g.select("text").text(f),D=p.select("text"),P=x.select("text");switch(i){case"bottom":t=Rt,m.attr("y2",o),y.attr("x2",0).attr("y2",o),E.attr("y2",r),D.attr("y",Math.max(r,0)+s),M.attr("x2",0).attr("y2",r),P.attr("x",0).attr("y",Math.max(r,0)+s),S.attr("dy",".71em").attr("text-anchor","middle"),C.attr("d","M"+w[0]+","+a+"V0H"+w[1]+"V"+a);break;case"top":t=Rt,m.attr("y2",-o),y.attr("x2",0).attr("y2",-o),E.attr("y2",-r),D.attr("y",-(Math.max(r,0)+s)),M.attr("x2",0).attr("y2",-r),P.attr("x",0).attr("y",-(Math.max(r,0)+s)),S.attr("dy","0em").attr("text-anchor","middle"),C.attr("d","M"+w[0]+","+-a+"V0H"+w[1]+"V"+-a);break;case"left":t=Ht,m.attr("x2",-o),y.attr("x2",-o).attr("y2",0),E.attr("x2",-r),D.attr("x",-(Math.max(r,0)+s)),M.attr("x2",-r).attr("y2",0),P.attr("x",-(Math.max(r,0)+s)).attr("y",0),S.attr("dy",".32em").attr("text-anchor","end"),C.attr("d","M"+-a+","+w[0]+"H0V"+w[1]+"H"+-a);break;case"right":t=Ht,m.attr("x2",o),y.attr("x2",o).attr("y2",0),E.attr("x2",r),D.attr("x",Math.max(r,0)+s),M.attr("x2",r).attr("y2",0),P.attr("x",Math.max(r,0)+s).attr("y",0),S.attr("dy",".32em").attr("text-anchor","start"),C.attr("d","M"+a+","+w[0]+"H0V"+w[1]+"H"+a)}n.ticks?(p.call(t,h),x.call(t,_),b.call(t,_),m.call(t,h),y.call(t,_),v.call(t,_)):(d=_.rangeBand()/2,p.call(t,g=function(t){return _(t)+d}),x.call(t,g))}))}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){var s;return arguments.length?(r=+e,o=1<(s=arguments.length-1)?+n:r,a=0<s?+arguments[s]:r,t):r},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 ai[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=tt(s),c.attr("x",o[0]).attr("width",o[1]-o[0]),n(a)),l&&(o=tt(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(m,t)[0]:d3.mouse(m)}function u(){var t=r(),o=!1;g&&(t[0]+=g[0],t[1]+=g[1]),E||(d3.event.altKey?(p=p||[(c[0][0]+c[1][0])/2,(c[0][1]+c[1][1])/2],M[0]=c[+(t[0]<p[0])][0],M[1]=c[+(t[1]<p[1])][1]):p=null),w&&d(t,s,0)&&(n(b),o=!0),_&&d(t,l,1)&&(i(b),o=!0),o&&(e(b),y({type:"brush",mode:E?"move":"resize"}))}function d(t,e,n){var i,r=(e=tt(e))[0],a=(e=e[1],M[n]),s=c[1][n]-c[0][n];return E&&(r-=a,e-=s+a),t=Math.max(r,Math.min(e,t[n])),E?i=(t+=a)+s:(a=p?Math.max(r,Math.min(e,2*p[n]-t)):a)<t?(i=t,t=a):i=a,(c[0][n]!==t||c[1][n]!==i)&&(o=null,c[0][n]=t,c[1][n]=i,1)}function h(){u(),b.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),d3.select("body").style("cursor",null),S.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),y({type:"brushend"}),C()}var p,f,g,m=this,v=d3.select(d3.event.target),y=a.of(m,arguments),b=d3.select(m),x=v.datum(),w=!/^(n|s)$/.test(x)&&s,_=!/^(e|w)$/.test(x)&&l,E=v.classed("extent"),M=r(),S=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&&(E||(p=null,M[0]-=c[1][0],M[1]-=c[1][1],E=2),C())})).on("keyup.brush",(function(){32==d3.event.keyCode&&2==E&&(M[0]+=c[1][0],M[1]+=c[1][1],E=0,C())}));E?(M[0]=c[0][0]-M[0],M[1]=c[0][1]-M[1]):x?(f=+/w$/.test(x),x=+/^n/.test(x),g=[c[1-f][0]-M[0],c[1-x][1]-M[1]],M[0]=c[f][0],M[1]=c[x][1]):d3.event.altKey&&(p=M.slice()),b.style("pointer-events","none").selectAll(".resize").style("display",null),d3.select("body").style("cursor",v.style("cursor")),y({type:"brushstart"}),u(),C()}var o,a=E(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")},{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=a.parentNode,e=d3.event.changedTouches;return e?d3.touches(t,e)[0]:d3.mouse(t)}function e(){if(!a.parentNode)return r();var e=t(),n=e[0]-u[0],i=e[1]-u[1];c|=n|i,u=e,C(),s({type:"drag",x:e[0]+h[0],y:e[1]+h[1],dx:n,dy:i})}function r(){s({type:"dragend"}),c&&(C(),d3.event.target===l)&&d.on("click.drag",o,!0),d.on("mousemove.drag",null).on("touchmove.drag",null).on("mouseup.drag",null).on("touchend.drag",null)}function o(){C(),d.on("click.drag",null)}var a=this,s=n.of(a,arguments),l=d3.event.target,u=t(),c=0,d=d3.select(window).on("mousemove.drag",e).on("touchmove.drag",e).on("mouseup.drag",r,!0).on("touchend.drag",r,!0),h=i?[(h=i.apply(a,arguments)).x-u[0],h.y-u[1]]:[0,0];C(),s({type:"dragstart"})}var n=E(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",o).on("mousewheel.zoom",a).on("mousemove.zoom",s).on("DOMMouseScroll.zoom",a).on("dblclick.zoom",l).on("touchstart.zoom",u).on("touchmove.zoom",c).on("touchend.zoom",u)}function e(t){return[(t[0]-y[0])/b,(t[1]-y[1])/b]}function n(t){b=Math.max(x[0],Math.min(x[1],t))}function i(t,e){var n;e=[(n=e)[0]*b+y[0],n[1]*b+y[1]],y[0]+=t[0]-e[0],y[1]+=t[1]-e[1]}function r(t){f&&f.domain(p.range().map((function(t){return(t-y[0])/b})).map(p.invert)),m&&m.domain(g.range().map((function(t){return(t-y[1])/b})).map(g.invert)),d3.event.preventDefault(),t({type:"zoom",scale:b,translate:y})}function o(){function t(){C(),l.on("click.zoom",null)}var n=this,o=w.of(n,arguments),a=d3.event.target,s=0,l=d3.select(window).on("mousemove.zoom",(function(){s=1,i(d3.mouse(n),u),r(o)})).on("mouseup.zoom",(function(){s&&C(),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(),C()}function a(){d=d||e(d3.mouse(this)),n(Math.pow(2,.002*function(){li=li||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{li.scrollTop=1e3,li.dispatchEvent(e),t=1e3-li.scrollTop}catch(n){t=e.wheelDelta||5*-e.detail}return t}())*b),i(d3.mouse(this),d),r(w.of(this,arguments))}function s(){d=null}function l(){var t=d3.mouse(this),o=e(t);n(d3.event.shiftKey?b/2:2*b),i(t,o),r(w.of(this,arguments))}function u(){var t,o=d3.touches(this),a=Date.now();h=b,d={},o.forEach((function(t){d[t.identifier]=e(t)})),C(),1===o.length&&a-v<500&&(t=o[0],o=e(o[0]),n(2*b),i(t,o),r(w.of(this,arguments))),v=a}function c(){var t,e=d3.touches(this),o=e[0],a=d[o.identifier];(e=e[1])&&(t=d[e.identifier],o=[(o[0]+e[0])/2,(o[1]+e[1])/2],a=[(a[0]+t[0])/2,(a[1]+t[1])/2],n(d3.event.scale*h)),i(o,a),r(w.of(this,arguments))}var d,h,p,f,g,m,v,y=[0,0],b=1,x=di,w=E(t,"zoom");return t.translate=function(e){return arguments.length?(y=e.map(Number),t):y},t.scale=function(e){return arguments.length?(b=+e,t):b},t.scaleExtent=function(e){return arguments.length?(x=null==e?di:e.map(Number),t):x},t.x=function(e){return arguments.length?(p=(f=e).copy(),t):f},t.y=function(e){return arguments.length?(g=(m=e).copy(),t):m},d3.rebind(t,w,"on")};var li,ui,ci,di=[0,1/0],hi=(d3.layout={},d3.layout.bundle=function(){return function(t){for(var e=[],n=-1,i=t.length;++n<i;)e.push(Ft(t[n]));return e}},d3.layout.chord=function(){function t(){var t,u,d,h,p,f={},g=[],m=d3.range(o),v=[];for(n=[],i=[],t=0,h=-1;++h<o;){for(u=0,p=-1;++p<o;)u+=r[h][p];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,p=-1;++p<o;){var y=m[h],b=v[y][p],x=r[y][b],w=u,C=u+=x*t;f[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(p=h-1;++p<o;){var _=f[h+"-"+p],E=f[p+"-"+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){Bt(ci=t),ui=l}var n,i,o,a,s,l={},u=d3.dispatch("start","tick","end"),c=[1,1],d=.9,h=qt,p=Gt,f=-30,g=.1,m=.8,v=[],y=[];return l.tick=function(){if((i*=.99)<.005)return u.end({type:"end",alpha:i=0}),!0;for(var t,e,n,r,l,h,p,b,x=v.length,w=y.length,C=0;C<w;++C)n=(e=y[C]).source,(l=(p=(r=e.target).x-n.x)*p+(b=r.y-n.y)*b)&&(p*=l=i*a[C]*((l=Math.sqrt(l))-o[C])/l,b*=l,r.x-=p*(h=n.weight/(r.weight+n.weight)),r.y-=b*h,n.x+=p*(h=1-h),n.y+=b*h);if((h=i*g)&&(p=c[0]/2,b=c[1]/2,C=-1,h))for(;++C<x;)(e=v[C]).x+=(p-e.x)*h,e.y+=(b-e.y)*h;if(f)for(function t(e,n,i){var r,o=0,a=0;if(e.charge=0,!e.leaf)for(var s,l=e.nodes,u=l.length,c=-1;++c<u;)null!=(s=l[c])&&(t(s,n,i),e.charge+=s.charge,o+=s.charge*s.cx,a+=s.charge*s.cy);e.point&&(e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5),r=n*i[e.point.index],e.charge+=e.pointCharge=r,o+=r*e.point.x,a+=r*e.point.y),e.cx=o/e.charge,e.cy=a/e.charge}(t=d3.geom.quadtree(v),i,s),C=-1;++C<x;)(e=v[C]).fixed||t.visit(function(t){return function(e,n,i,r,o){if(e.point!==t){var a,s=e.cx-t.x,l=e.cy-t.y,u=1/Math.sqrt(s*s+l*l);if((r-n)*u<m)return a=e.charge*u*u,t.px-=s*a,t.py-=l*a,!0;e.point&&isFinite(u)&&(a=e.pointCharge*u*u,t.px-=s*a,t.py-=l*a)}return!e.charge}}(e));for(C=-1;++C<x;)(e=v[C]).fixed?(e.x=e.px,e.y=e.py):(e.x-=(e.px-(e.px=e.x))*d,e.y-=(e.py-(e.py=e.y))*d);u.tick({type:"tick",alpha:i})},l.nodes=function(t){return arguments.length?(v=t,l):v},l.links=function(t){return arguments.length?(y=t,l):y},l.size=function(t){return arguments.length?(c=t,l):c},l.linkDistance=function(t){return arguments.length?(h=r(t),l):h},l.distance=l.linkDistance,l.linkStrength=function(t){return arguments.length?(p=r(t),l):p},l.friction=function(t){return arguments.length?(d=t,l):d},l.charge=function(t){return arguments.length?(f="function"==typeof t?t:+t,l):f},l.gravity=function(t){return arguments.length?(g=t,l):g},l.theta=function(t){return arguments.length?(m=t,l):m},l.alpha=function(t){return arguments.length?(i?i=0<t?t:0:0<t&&(u.start({type:"start",alpha:i=t}),d3.timer(l.tick)),l):i},l.start=function(){function t(t,i){for(var o,a=function(){if(!n){for(n=[],e=0;e<r;++e)n[e]=[];for(e=0;e<u;++e){var t=y[e];n[t.source.index].push(t.target),n[t.target.index].push(t.source)}}return n[m]}(),s=-1,l=a.length;++s<l;)if(!isNaN(o=a[s][t]))return o;return Math.random()*i}for(var e,n,i,r=v.length,u=y.length,d=c[0],g=c[1],m=0;m<r;++m)(i=v[m]).index=m,i.weight=0;for(o=[],a=[],m=0;m<u;++m)"number"==typeof(i=y[m]).source&&(i.source=v[i.source]),"number"==typeof i.target&&(i.target=v[i.target]),o[m]=h.call(this,i,m),a[m]=p.call(this,i,m),++i.source.weight,++i.target.weight;for(m=0;m<r;++m)i=v[m],isNaN(i.x)&&(i.x=t("x",d)),isNaN(i.y)&&(i.y=t("y",g)),isNaN(i.px)&&(i.px=i.x),isNaN(i.py)&&(i.py=i.y);if(s=[],"function"==typeof f)for(m=0;m<r;++m)s[m]=+f.call(this,v[m],m);else for(m=0;m<r;++m)s[m]=f;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){n=n||d3.behavior.drag().origin(e).on("dragstart",t).on("drag",Ut).on("dragend",$t),this.on("mouseover.force",Bt).on("mouseout.force",Wt).call(n)},d3.rebind(l,u,"on")},d3.layout.partition=function(){function t(t,i){return 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=-1;for(i=e.value?i/e.value:0;++l<a;)t(s=o[l],n,s=s.value*i,r),n+=s}}((t=e.call(this,t,i))[0],0,n[0],n[1]/function t(e){var n=e.children,i=0;if(n&&(r=n.length))for(var r,o=-1;++o<r;)i=Math.max(i,t(n[o]));return 1+i}(t[0])),t}var e=d3.layout.hierarchy(),n=[1,1];return t.size=function(e){return arguments.length?(n=e,t):n},oe(t,e)},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),d=(null!=n&&c.sort(n===hi?function(t,e){return s[e]-s[t]}:function(t,e){return n(o[t],o[e])}),[]);return c.forEach((function(t){d[t]={data:o[t],value:t=s[t],startAngle:l,endAngle:l+=t*u}})),d}var e=Number,n=hi,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},{}),pi=(d3.layout.stack=function(){function t(e,l){for(var u,c,d=(p=e.map((function(e,i){return n.call(t,e,i)}))).map((function(e,n){return e.map((function(e,n){return[a.call(t,e,n),s.call(t,e,n)]}))})),h=i.call(t,d,l),p=d3.permute(p,h),f=(d=d3.permute(d,h),r.call(t,d,l)),g=p.length,m=p[0].length,v=0;v<m;++v)for(o.call(t,p[0][v],c=f[v],d[0][v][1]),u=1;u<g;++u)o.call(t,p[u][v],c+=d[u-1][v][1],d[u][v][1]);return e}var n=e,i=Kt,r=Jt,o=Qt,a=Yt,s=Xt;return t.values=function(e){return arguments.length?(n=e,t):n},t.order=function(e){return arguments.length?(i="function"==typeof e?e:pi.get(e)||Kt,t):i},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:fi.get(e)||Jt,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},d3.map({"inside-out":function(t){for(var e,n=t.length,i=t.map(Zt),r=t.map(te),o=d3.range(n).sort((function(t,e){return i[t]-i[e]})),a=0,s=0,l=[],u=[],c=0;c<n;++c)e=o[c],(a<s?(a+=r[e],l):(s+=r[e],u)).push(e);return u.reverse().concat(l)},reverse:function(t){return d3.range(t.length).reverse()},default:Kt})),fi=d3.map({silhouette:function(t){for(var e,n,i=t.length,r=t[0].length,o=[],a=0,s=[],l=0;l<r;++l){for(n=e=0;e<i;e++)n+=t[e][l][1];a<n&&(a=n),o.push(n)}for(l=0;l<r;++l)s[l]=(a-o[l])/2;return s},wiggle:function(t){var e,n,i,r,o,a,s,l,u,c=t.length,d=t[0],h=d.length,p=[];for(p[0]=l=u=0,n=1;n<h;++n){for(r=e=0;e<c;++e)r+=t[e][n][1];for(s=d[n][o=e=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]}p[n]=l-=r?o/r*s:0,l<u&&(u=l)}for(n=0;n<h;++n)p[n]-=u;return p},expand:function(t){for(var e,n,i=t.length,r=t[0].length,o=1/i,a=[],s=0;s<r;++s){for(n=e=0;e<i;e++)n+=t[e][s][1];if(n)for(e=0;e<i;e++)t[e][s][1]/=n;else for(e=0;e<i;e++)t[e][s][1]=o}for(s=0;s<r;++s)a[s]=0;return a},zero:Jt}),gi=(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),p=d.length-1,f=e?1:1/h;++r<p;)(a=l[r]=[]).dx=d[r+1]-(a.x=d[r]),a.y=0;if(0<p)for(r=-1;++r<h;)(s=u[r])>=c[0]&&s<=c[1]&&((a=l[d3.bisect(d,s,1,p)-1]).y+=f,a.push(t[r]));return l}var e=!0,n=Number,i=re,o=ne;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 ie(t,e)}:r(e),t):o},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},!(d3.layout.hierarchy=function(){function t(r){var o=[];return function r(o,a,s){var l=n.call(t,o,a),u=gi?o:{data:o};if(u.depth=a,s.push(u),l&&(c=l.length)){for(var c,d,h=-1,p=u.children=[],f=0,g=a+1;++h<c;)(d=r(l[h],g,s)).parent=u,p.push(d),f+=d.value;e&&p.sort(e),i&&(u.value=f)}else i&&(u.value=+i.call(t,o,a)||0);return u}(r,0,o),o}var e=le,n=ae,i=se;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(i=e,t):i},t.revalue=function(e){return function e(n,r){var o=n.children,a=0;if(o&&(s=o.length))for(var s,l=-1,u=r+1;++l<s;)a+=e(o[l],u);else i&&(a=+i.call(t,gi?n:n.data,r)||0);return i&&(n.value=a),a}(e,0),e},t})),mi=(d3.layout.pack=function(){function t(t,i){var r=((i=(t=e.call(this,t,i))[0]).x=0,i.y=0,me(i),n[0]),o=n[1];return function t(e,n,i,r){var o=e.children;if(e.x=n+=r*e.x,e.y=i+=r*e.y,e.r*=r,o)for(var a=-1,s=o.length;++a<s;)t(o[a],n,i,r)}(i,r/2,o/2,1/Math.max(2*i.r/r,2*i.r/o)),t}var e=d3.layout.hierarchy().sort(ce),n=[1,1];return t.size=function(e){return arguments.length?(n=e,t):n},oe(t,e)},d3.layout.cluster=function(){function t(t,r){var o,a=(t=e.call(this,t,r))[0],s=0,l=(r=(Me(a,(function(t){var e,i=t.children;i&&i.length?(t.x=(e=i).reduce((function(t,e){return t+e.x}),0)/e.length,t.y=1+d3.max(i,(function(t){return t.y}))):(t.x=o?s+=n(t,o):0,t.y=0,o=t)})),function t(e){var n=e.children;return n&&n.length?t(n[0]):e}(a)),function t(e){var n,i=e.children;return i&&(n=i.length)?t(i[n-1]):e}(a)),u=r.x-n(r,l)/2,c=l.x+n(l,r)/2;return Me(a,(function(t){t.x=(t.x-u)/(c-u)*i[0],t.y=(1-(a.y?t.y/a.y:1))*i[1]})),t}var e=d3.layout.hierarchy().sort(null).value(null),n=ye,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},oe(t,e)},d3.layout.tree=function(){function t(t,r){var o=(Me(r=(t=e.call(this,t,r))[0],(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,o=e._tree;if(r&&(a=r.length)){for(var a,s,l,u=r[0],c=u,d=-1;++d<a;)t(l=r[d],s),c=function(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=xe(s),o=be(o),s&&o;)l=be(l),(a=xe(a))._tree.ancestor=t,0<(r=s._tree.prelim+d-o._tree.prelim-u+n(s,o))&&(function(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(t,e,n){return t._tree.ancestor.parent==e.parent?t._tree.ancestor:n}(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&&!xe(a)&&(a._tree.thread=s,a._tree.mod+=d-c),o&&!be(l)&&(l._tree.thread=o,l._tree.mod+=u-h,i=t)}return i}(l,s,c),s=l;for(var h,p=0,f=0,g=e.children,m=g.length;0<=--m;)(h=g[m]._tree).prelim+=p,h.mod+=p,p+=h.shift+(f+=h.change);u=.5*(u._tree.prelim+l._tree.prelim),i?(o.prelim=i._tree.prelim+n(e,i),o.mod=o.prelim-u):o.prelim=u}else i&&(o.prelim=i._tree.prelim+n(e,i))}(r),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)}}(r,-r._tree.prelim),we(r,_e)),a=we(r,Ce),s=we(r,Ee),l=o.x-n(o,a)/2,u=a.x+n(a,o)/2,c=s.depth||1;return Me(r,(function(t){t.x=(t.x-l)/(u-l)*i[0],t.y=t.depth/c*i[1],delete t._tree})),t}var e=d3.layout.hierarchy().sort(null).value(null),n=ye,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},oe(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 r=n.children;if(r&&r.length){var o,a=c(n),s=[],l=r.slice(),u=1/0,d=Math.min(a.dx,a.dy);for(t(l,a.dx*a.dy/n.value),s.area=0;0<(o=l.length);)s.push(o=l[o-1]),s.area+=o.area,u=(o=function(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),r<n)&&(r=n);return e*=e,(i*=i)?Math.max(e*r*h/i,i/(e*o*h)):1/0}(s,d))<=u?(l.pop(),o):(s.area-=s.pop().area,i(s,d,a,!1),d=Math.min(a.dx,a.dy),1/(s.length=s.area=0));s.length&&(i(s,d,a,!0),s.length=s.area=0),r.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var o,a=c(e),s=r.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&&(i(l,o.z?a.dx:a.dy,a,!s.length),l.length=l.area=0);r.forEach(n)}}function i(t,e,n,i){var r,o=-1,a=t.length,l=n.x,u=n.y,c=e?s(t.area/e):0;if(e==n.dx){for((i||c>n.dy)&&(c=n.dy);++o<a;)(r=t[o]).x=l,r.y=u,r.dy=c,l+=r.dx=Math.min(n.x+n.dx-l,c?s(r.area/c):0);r.z=!0,r.dx+=n.x+n.dx-l,n.y+=c,n.dy-=c}else{for((i||c>n.dx)&&(c=n.dx);++o<a;)(r=t[o]).x=l,r.y=u,r.dx=c,u+=r.dy=Math.min(n.y+n.dy-u,c?s(r.area/c):0);r.z=!1,r.dy+=n.y+n.dy-u,n.x+=c,n.dx-=c}}function r(i){var r=(i=o||a(i))[0];return r.x=0,r.y=0,r.dx=l[0],r.dy=l[1],o&&a.revalue(r),t([r],r.dx*r.dy/r.value),(o?n:e)(r),d&&(o=i),i}var o,a=d3.layout.hierarchy(),s=Math.round,l=[1,1],u=null,c=Se,d=!1,h=.5*(1+Math.sqrt(5));return r.size=function(t){return arguments.length?(l=t,r):l},r.padding=function(t){var e;return arguments.length?(c=null==(u=t)?Se:"function"==(e=typeof t)?function(e){var n=t.call(r,e,e.depth);return null==n?Se(e):De(e,"number"==typeof n?[n,n,n,n]:n)}:("number"==e&&(t=[t,t,t,t]),function(e){return De(e,t)}),r):u},r.round=function(t){return arguments.length?(s=t?Math.round:Number,r):s!=Number},r.sticky=function(t){return arguments.length?(d=t,o=null,r):d},r.ratio=function(t){return arguments.length?(h=t,r):h},oe(r,a)},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,'"')}return(i=l.exec(t))?(r=44!==i[0].charCodeAt(0),t.substring(e,i.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(Pe).join("\n")},d3.geo={},Math.PI/180),vi=(d3.geo.azimuthal=function(){function t(t){var e=t[0]*mi-n,i=(t=t[1]*mi,Math.cos(e)),u=(e=Math.sin(e),Math.cos(t)),c=(t=Math.sin(t),"orthographic"!==a?o*t+r*u*i:null),d="stereographic"===a?1/(1+c):"gnomonic"===a?1/c:"equidistant"===a?(d=Math.acos(c))?d/Math.sin(d):0:"equalarea"===a?Math.sqrt(2/(1+c)):1;c=d*(o*u*i-r*t);return[s*(d*u*e)+l[0],s*c+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=(t[1]-l[1])/s,Math.sqrt(e*e+t*t)),u="stereographic"===a?2*Math.atan(i):"gnomonic"===a?Math.atan(i):"equidistant"===a?i:"equalarea"===a?2*Math.asin(.5*i):Math.asin(i),c=Math.sin(u);u=Math.cos(u);return[(n+Math.atan2(e*c,i*r*u+t*o*c))/mi,Math.asin(u*o-(i?t*c*r/i:0))/mi]},t.mode=function(e){return arguments.length?(a=e+"",t):a},t.origin=function(a){return arguments.length?(n=(e=a)[0]*mi,i=e[1]*mi,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*(mi*t[0]-n);t=Math.sqrt(r-2*i*Math.sin(mi*t[1]))/i;return[l*t*Math.sin(e)+u[0],l*(t*Math.cos(e)-o)+u[1]]}function e(){var e=mi*s[0],l=mi*s[1],u=mi*a[1],c=Math.sin(e);e=Math.cos(e);return n=mi*a[0],i=.5*(c+Math.sin(l)),r=e*e+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=(t[1]-u[1])/l,t=o+t,Math.atan2(e,t));e=Math.sqrt(e*e+t*t);return[(n+a/i)/mi,Math.asin((r-e*e*i*i)/(2*i))/mi]},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(50<a?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){var a,s,l;return arguments.length?(a=e.scale()/1e3,s=o[0],l=o[1],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):e.translate()},t.scale(e.scale())},d3.geo.bonne=function(){function t(t){var s,l,u=t[0]*mi-e;t=t[1]*mi-n;return i?(s=r+i-t,l=u*Math.cos(t)/s,u=s*Math.sin(l),t=s*Math.cos(l)-r):(u*=Math.cos(t),t*=-1),[o*u+a[0],o*t+a[1]]}var e,n,i,r,o=200,a=[480,250];return t.invert=function(t){var n,s,l=(t[0]-a[0])/o;t=(t[1]-a[1])/o;return i?(n=r+t,s=Math.sqrt(l*l+n*n),t=r+i-s,l=e+s*Math.atan2(l,n)/Math.cos(t)):(t*=-1,l/=Math.cos(t)),[l/mi,t/mi]},t.parallel=function(e){return arguments.length?(r=1/Math.tan(i=e*mi),t):i/mi},t.origin=function(i){return arguments.length?(e=i[0]*mi,n=i[1]*mi,t):[e/mi,n/mi]},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;t=-t[1]/360;return[e*i+n[0],e*t+n[1]]}var e=500,n=[480,250];return t.invert=function(t){return[(t[0]-n[0])/e*360,(t[1]-n[1])/e*-360]},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;t=-Math.log(Math.tan(Math.PI/4+t[1]*mi/2))/mi/360;return[e*i+n[0],e*Math.max(-.5,Math.min(.5,t))+n[1]]}var e=500,n=[480,250];return t.invert=function(t){var i=(t[0]-n[0])/e;t=(t[1]-n[1])/e;return[360*i,2*Math.atan(Math.exp(-360*t*mi))/mi-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=Ae(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=Ae(o),s=d3.geo.albersUsa(),l=[],u=Te({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,0<(r=(n=o[a]).length-1)){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,0<(s=(o=n[i]).length-1)){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=Te({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=Te({Feature:function(t){return d(t.geometry)},Polygon:function(t){return[(t=i(t.coordinates))[0]/t[2],t[1]/t[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=Ae(o=+e),t},t},d3.geo.bounds=function(t){var e=1/0,n=1/0,i=-1/0,r=-1/0;return ke(t,(function(t,o){t<e&&(e=t),i<t&&(i=t),o<n&&(n=o),r<o&&(r=o)})),[[e,n],[i,r]]},{Feature:function(t,e){ke(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=0,r=n.length;i<r;i++)ke(n[i].geometry,e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=0,r=n.length;i<r;i++)ke(n[i],e)},LineString:Ie,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:Ie,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])}}),yi=(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(ze(n,i)((r-a)/(r-o))),c.push(i),e=n=null):(n=i,!e&&c.length&&(c.push(ze(c[c.length-1],n)((a-r)/(o-r))),e=n)),r=o;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);for(var d,h,p,f=c,g=0,m=f.length,v=m?[f[0]]:f,y=s.source();++g<m;)for(d=0,h=(p=s.source(f[g-1])(f[g]).coordinates).length;++d<h;)v.push(p[d]);return s.source(y),v}var r=[0,0],o=89.99,a=o*mi,s=d3.geo.greatArc().source(r).target(e),l=(t.clip=function(t){return"function"==typeof r&&s.source(r.apply(this,arguments)),l(t)||null},Te({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)*mi,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=Le,r=Oe,o=6*mi,a=Ne();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*mi,t):o/mi},t},d3.geo.greatCircle=d3.geo.circle,d3.geom={},d3.geom.contour=function(t,e){for(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,n+=1)}}(t),i=[],r=n[0],o=n[1],a=0,s=0,l=NaN,u=NaN,c=0;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),s=6===c?(a=-1===u?-1:1,0):9===c?(a=0,1===l?-1:1):(a=yi[c],bi[c]),a!=l&&s!=u&&(i.push([r,o]),l=a,u=s),o+=s,n[0]!=(r+=a)||n[1]!=o;);return i},[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN]),bi=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN],xi=(d3.geom.hull=function(t){if(t.length<3)return[];for(var e,n,i,r,o,a,s,l,u,c,d,h,p,f,g,m=t.length,v=m-1,y=[],b=[],x=0,w=1;w<m;++w)t[w][1]<t[x][1]?x=w:t[w][1]==t[x][1]&&(x=t[w][0]<t[x][0]?w:x);for(w=0;w<m;++w)w!==x&&(i=t[w][1]-t[x][1],n=t[w][0]-t[x][0],y.push({angle:Math.atan2(i,n),index:w}));for(y.sort((function(t,e){return t.angle-e.angle})),s=y[0].angle,a=y[0].index,o=0,w=1;w<v;++w)e=y[w].index,s==y[w].angle?(n=t[a][0]-t[x][0],i=t[a][1]-t[x][1],(r=t[e][0]-t[x][0])*r+(r=t[e][1]-t[x][1])*r<=n*n+i*i?y[w].index=-1:(y[o].index=-1,s=y[w].angle,o=w,a=e)):(s=y[w].angle,o=w,a=e);for(b.push(x),e=w=0;w<2;++e)-1!==y[e].index&&(b.push(y[e].index),w++);for(l=b.length;e<v;++e)if(-1!==y[e].index){for(;u=b[l-2],c=b[l-1],d=y[e].index,void 0,p=(u=t[u])[0],f=u[1],c=(u=t[c])[0],g=u[1],h=(u=t[d])[0],!(0<(u[1]-f)*(c-p)-(g-f)*(h-p));)--l;b[l++]=y[e].index}var C=[];for(w=0;w<l;++w)C.push(t[b[w]]);return C},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;)Re(s=n[i],c,o)?(Re(a,c,o)||e.push(He(a,s,c,o)),e.push(s)):Re(a,c,o)&&e.push(He(a,s,c,o)),a=s;c=o}return e},t},d3.geom.voronoi=function(t){var e=t.map((function(){return[]}));return Fe(t,(function(t){var n,i,r,o,a=1===t.a&&0<=t.b?(s=t.ep.r,t.ep.l):(s=t.ep.l,t.ep.r),s=(1===t.a?(r=s?s.y:-1e6,n=t.c-t.b*r,o=a?a.y:1e6,i=t.c-t.b*o):(n=s?s.x:-1e6,r=t.c-t.a*n,i=a?a.x:1e6,o=t.c-t.a*i),[n,r]);a=[i,o];e[t.region.l.index].push(s,a),e[t.region.r.index].push(s,a)})),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||1e-10<t.angle-e[n-1].angle}))}))},{l:"r",r:"l"}),wi=(d3.geom.delaunay=function(t){var e=t.map((function(){return[]})),n=[];return Fe(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){var s;isNaN(e.x)||isNaN(e.y)||(t.leaf?(s=t.point)?(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: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(Ve)),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;d<c?r=n+c:i=e+d}var h={leaf:!0,nodes:[],point:null,add:function(t){o(h,t,e,n,i,r)},visit:function(t){!function t(e,n,i,r,o,a){var s,l;e(n,i,r,o,a)||(s=.5*(i+o),l=.5*(r+a),(n=n.nodes)[0]&&t(e,n[0],i,r,s,l),n[1]&&t(e,n[1],s,r,o,l),n[2]&&t(e,n[2],i,l,s,a),n[3]&&t(e,n[3],s,l,o,a))}(t,h,e,n,i,r)}};return t.forEach(h.add),h},d3.time={},Date),Ci=(Be.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(){Ci.setUTCDate.apply(this._,arguments)},setDay:function(){Ci.setUTCDay.apply(this._,arguments)},setFullYear:function(){Ci.setUTCFullYear.apply(this._,arguments)},setHours:function(){Ci.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Ci.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Ci.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Ci.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Ci.setUTCSeconds.apply(this._,arguments)},setTime:function(){Ci.setTime.apply(this._,arguments)}},Date.prototype),_i=(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=Di[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};return We(n,t,e,0)!=e.length?null:("p"in n&&(n.H=n.H%12+12*n.p),(e=new wi).setFullYear(n.y,n.m,n.d),e.setHours(n.H,n.M,n.S,n.L),e)},e.toString=function(){return t},e},d3.format("02d")),Ei=d3.format("03d"),Mi=d3.format("04d"),Si=d3.format("2d"),Di={a:function(t){return Ai[t.getDay()].substring(0,3)},A:function(t){return Ai[t.getDay()]},b:function(t){return Oi[t.getMonth()].substring(0,3)},B:function(t){return Oi[t.getMonth()]},c:d3.time.format("%a %b %e %H:%M:%S %Y"),d:function(t){return _i(t.getDate())},e:function(t){return Si(t.getDate())},H:function(t){return _i(t.getHours())},I:function(t){return _i(t.getHours()%12||12)},j:function(t){return Ei(1+d3.time.dayOfYear(t))},L:function(t){return Ei(t.getMilliseconds())},m:function(t){return _i(t.getMonth()+1)},M:function(t){return _i(t.getMinutes())},p:function(t){return 12<=t.getHours()?"PM":"AM"},S:function(t){return _i(t.getSeconds())},U:function(t){return _i(d3.time.sundayOfYear(t))},w:function(t){return t.getDay()},W:function(t){return _i(d3.time.mondayOfYear(t))},x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(t){return _i(t.getFullYear()%100)},Y:function(t){return Mi(t.getFullYear()%1e4)},Z:function(t){var e=0<(t=t.getTimezoneOffset())?"-":"+",n=~~(Math.abs(t)/60);t=Math.abs(t)%60;return e+_i(n)+_i(t)},"%":function(t){return"%"}},Pi={a:function(t,e,n){return ji.test(e.substring(n,n+=3))?n:-1},A:function(t,e,n){return Ti.lastIndex=0,(e=Ti.exec(e.substring(n,n+10)))?n+e[0].length:-1},b:function(t,e,n){return null==(e=ki.get(e.substring(n,n+=3).toLowerCase()))?-1:(t.m=e,n)},B:function(t,e,n){return Ii.lastIndex=0,(e=Ii.exec(e.substring(n,n+12)))?(t.m=Li.get(e[0].toLowerCase()),n+e[0].length):-1},c:function(t,e,n){return We(t,Di.c.toString(),e,n)},d:$e,e:$e,H:Ue,I:Ue,L:function(t,e,n){return Ni.lastIndex=0,(e=Ni.exec(e.substring(n,n+3)))?(t.L=+e[0],n+e[0].length):-1},m:function(t,e,n){return Ni.lastIndex=0,(e=Ni.exec(e.substring(n,n+2)))?(t.m=e[0]-1,n+e[0].length):-1},M:function(t,e,n){return Ni.lastIndex=0,(e=Ni.exec(e.substring(n,n+2)))?(t.M=+e[0],n+e[0].length):-1},p:function(t,e,n){return null==(e=zi.get(e.substring(n,n+=2).toLowerCase()))?-1:(t.p=e,n)},S:function(t,e,n){return Ni.lastIndex=0,(e=Ni.exec(e.substring(n,n+2)))?(t.S=+e[0],n+e[0].length):-1},x:function(t,e,n){return We(t,Di.x.toString(),e,n)},X:function(t,e,n){return We(t,Di.X.toString(),e,n)},y:function(t,e,n){return Ni.lastIndex=0,(e=Ni.exec(e.substring(n,n+2)))?(t.y=1e3*~~((new Date).getFullYear()/1e3)+ +e[0],n+e[0].length):-1},Y:function(t,e,n){return Ni.lastIndex=0,(e=Ni.exec(e.substring(n,n+4)))?(t.y=+e[0],n+e[0].length):-1}},ji=/^(?:sun|mon|tue|wed|thu|fri|sat)/i,Ti=/^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/i,Ai=["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}),Ii=/^(?:January|February|March|April|May|June|July|August|September|October|November|December)/gi,Li=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}),Oi=["January","February","March","April","May","June","July","August","September","October","November","December"],Ni=/\s*\d+/,zi=d3.map({am:0,pm:1}),Ri=(gn=(d3.time.format.utc=function(t){function e(t){try{var e=new(wi=Be);return e._=t,n(e)}finally{wi=Date}}var n=d3.time.format(t);return e.parse=function(t){try{wi=Be;var e=n.parse(t);return e&&e._}finally{wi=Date}},e.toString=n.toString,e},d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ")),d3.time.format.iso=Date.prototype.toISOString?qe:gn,qe.parse=function(t){return t=new Date(t),isNaN(t)?null:t},qe.toString=gn.toString,d3.time.second=Ge((function(t){return new wi(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=Ge((function(t){return new wi(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=Ge((function(t){var e=t.getTimezoneOffset()/60;return new wi(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=Ge((function(t){return new wi(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)},Ai.forEach((function(t,e){t=t.toLowerCase(),e=7-e;var n=d3.time[t]=Ge((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=Ge((function(t){return new wi(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=Ge((function(t){return new wi(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,[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6]),Hi=[[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]],Fi=(gn=[[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()}]],d3.scale.linear()),Vi=Je(gn),Bi=(Hi.year=function(t,e){return Fi.domain(t.map(tn)).ticks(e).map(Ze)},d3.time.scale=function(){return Xe(d3.scale.linear(),Hi,Vi)},Hi.map((function(t){return[t[0].utc,t[1]]}))),Wi=Je([[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()}]]);Bi.year=function(t,e){return Fi.domain(t.map(nn)).ticks(e).map(en)},d3.time.scale.utc=function(){return Xe(d3.scale.linear(),Bi,Wi)}}(),function(t,e){function n(t,n,i){if(i===e&&1===t.nodeType){var r="data-"+n.replace(st,"-$1").toLowerCase();if("string"==typeof(i=t.getAttribute(r))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:at.test(i)?U.parseJSON(i):i)}catch(t){}U.data(t,n,i)}else i=e}return i}function i(t){for(var e in t)if(("data"!==e||!U.isEmptyObject(t[e]))&&"toJSON"!==e)return;return 1}function r(){return!1}function o(){return!0}function a(t){return!t||!t.parentNode||11===t.parentNode.nodeType}function s(t,e){for(;(t=t[e])&&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(ze.test(e))return U.filter(e,i,!n);e=U.filter(e,i)}return U.grep(t,(function(t,i){return 0<=U.inArray(t,e)===n}))}function u(t){var e=Fe.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function c(t,e){if(1===e.nodeType&&U.hasData(t)){t=U._data(t);var n,i,r,o=U._data(e,t),a=t.events;if(a)for(n in delete o.handle,o.events={},a)for(i=0,r=a[n].length;i<r;i++)U.event.add(e,n,a[n][i]);o.data&&(o.data=U.extend({},o.data))}}function d(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&&Qe.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 h(t){return void 0!==t.getElementsByTagName?t.getElementsByTagName("*"):void 0!==t.querySelectorAll?t.querySelectorAll("*"):[]}function p(t){Qe.test(t.type)&&(t.defaultChecked=t.checked)}function f(t,e){if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),i=e,r=bn.length;r--;)if((e=bn[r]+n)in t)return e;return i}function g(t,e){return"none"===U.css(t=e||t,"display")||!U.contains(t.ownerDocument,t)}function m(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&&g(n)&&(r[o]=U._data(n,"olddisplay",x(n.nodeName)))):(i=rn(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 v(t,e,n){var i=hn.exec(e);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):e}function y(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+yn[r],!0)),i?("content"===n&&(o-=parseFloat(rn(t,"padding"+yn[r]))||0),"margin"!==n&&(o-=parseFloat(rn(t,"border"+yn[r]+"Width"))||0)):(o+=parseFloat(rn(t,"padding"+yn[r]))||0,"padding"!==n&&(o+=parseFloat(rn(t,"border"+yn[r]+"Width"))||0));return o}function b(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=rn(t,e))<0||null==i)&&(i=t.style[e]),pn.test(i))return i;r=o&&(U.support.boxSizingReliable||i===t.style[e]),i=parseFloat(i)||0}return i+y(t,e,n||(o?"border":"content"),r)+"px"}function x(t){var e,n;return gn[t]||(n=(e=U("<"+t+">").appendTo(L.body)).css("display"),e.remove(),"none"!==n&&""!==n||(on=L.body.appendChild(on||U.extend(L.createElement("iframe"),{frameBorder:0,width:0,height:0})),an&&on.createElement||((an=(on.contentWindow||on.contentDocument).document).write("<!doctype html><html><body>"),an.close()),e=an.body.appendChild(an.createElement(t)),n=rn(e,"display"),L.body.removeChild(on)),gn[t]=n)}function w(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 C(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===zn;u<c&&(d||!s);u++)"string"==typeof(s=l[u](n,i,r))&&(s=!d||a[s]?e:(n.dataTypes.unshift(s),C(t,n,i,r,s,a)));return!d&&s||a["*"]?s:C(t,n,i,r,"*",a)}function _(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 E(){try{return new t.XMLHttpRequest}catch(t){}}function M(){return setTimeout((function(){Gn=e}),0),Gn=U.now()}function S(t,e,n){var i,r,o,a,s,l,u,c=0,d=Jn.length,h=U.Deferred().always((function(){delete p.elem})),p=function(){for(var e=Gn||M(),n=1-((e=Math.max(0,f.startTime+f.duration-e))/f.duration||0),i=0,r=f.tweens.length;i<r;i++)f.tweens[i].run(n);return h.notifyWith(t,[f,n,e]),n<1&&r?e:(h.resolveWith(t,[f]),!1)},f=h.promise({elem:t,props:U.extend({},e),opts:U.extend(!0,{specialEasing:{}},n),originalProperties:e,originalOptions:n,startTime:Gn||M(),duration:n.duration,tweens:[],createTween:function(e,n,i){return n=U.Tween(t,f.opts,e,n,f.opts.specialEasing[e]||f.opts.easing),f.tweens.push(n),n},stop:function(e){for(var n=0,i=e?f.tweens.length:0;n<i;n++)f.tweens[n].run(1);return e?h.resolveWith(t,[f,e]):h.rejectWith(t,[f,e]),this}}),g=f.props,m=g,v=f.opts.specialEasing;for(r in m)if(a=v[o=U.camelCase(r)],s=m[r],U.isArray(s)&&(a=s[1],s=m[r]=s[0]),r!==o&&(m[o]=s,delete m[r]),(l=U.cssHooks[o])&&"expand"in l)for(r in s=l.expand(s),delete m[o],s)r in m||(m[r]=s[r],v[r]=a);else v[o]=a;for(;c<d;c++)if(i=Jn[c].call(f,t,g,f.opts))return i;return u=f,U.each(g,(function(t,e){for(var n=(Zn[t]||[]).concat(Zn["*"]),i=0,r=n.length;i<r;i++)if(n[i].call(u,t,e))return})),U.isFunction(f.opts.start)&&f.opts.start.call(t,f),U.fx.timer(U.extend(p,{anim:f,queue:f.opts.queue,elem:t})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function D(t,e,n,i,r){return new D.prototype.init(t,e,n,i,r)}function P(t,e){var n,i={height:t},r=0;for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=yn[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function j(t){return U.isWindow(t)?t:9===t.nodeType&&(t.defaultView||t.parentWindow)}function T(t,e){return(e+"").toUpperCase()}function A(){L.addEventListener?(L.removeEventListener("DOMContentLoaded",A,!1),U.ready()):"complete"===L.readyState&&(L.detachEvent("onreadystatechange",A),U.ready())}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={},ot=(U.fn=U.prototype={constructor:U,init:function(t,n,i){var r,o;if(t)if(t.nodeType)this.context=this[0]=t,this.length=1;else{if("string"!=typeof t)return U.isFunction(t)?i.ready(t):(t.selector!==e&&(this.selector=t.selector,this.context=t.context),U.makeArray(t,this));if(!(r="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&3<=t.length?[null,t,null]:Q.exec(t))||!r[1]&&n)return(!n||n.jquery?n||i:this.constructor(n)).find(t);if(r[1])return o=(n=n instanceof U?n[0]:n)&&n.nodeType?n.ownerDocument||n:L,t=U.parseHTML(r[1],o,!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}this.context=L,this.selector=t}return 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){return(t=U.merge(this.constructor(),t)).prevObject=this,t.context=this.context,"find"===e?t.selector=this.selector+(this.selector?" ":"")+n:e&&(t.selector=this.selector+"."+e+"("+n+")"),t},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=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},s=2),"object"==typeof a||U.isFunction(a)||(a={}),l===s&&(a=this,--s);s<l;s++)if(null!=(t=arguments[s]))for(n in t)o=a[n],a!==(i=t[n])&&(u&&i&&(U.isPlainObject(i)||(r=U.isArray(i)))?(o=r?(r=!1,o&&U.isArray(o)?o:[]):o&&U.isPlainObject(o)?o:{},a[n]=U.extend(u,o,i)):i!==e&&(a[n]=i));return a},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)!==t&&0<--U.readyWait||(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):rt[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}for(var n in t);return n===e||W.call(t,n)},isEmptyObject:function(t){for(var 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(n){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,T)},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;e=e||[];return null!=t&&(n=U.type(t),null==t.length||"string"===n||"function"===n||"regexp"===n||U.isWindow(t)?H.call(e,t):U.merge(e,t)),e},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&&(0<l&&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;return"string"==typeof n&&(r=t[n],n=t,t=r),U.isFunction(t)?(i=F.call(arguments,2),(r=function(){return t.apply(n,i.concat(F.call(arguments)))}).guid=t.guid=t.guid||U.guid++,r):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),n=u?l?(l=n,function(t,e,n){return l.call(U(t),n)}):(n.call(t,r),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",A,!1),t.addEventListener("load",U.ready,!1);else{L.attachEvent("onreadystatechange",A),t.attachEvent("onload",U.ready);var n=!1;try{n=null==t.frameElement&&L.documentElement}catch(e){}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){rt["[object "+e+"]"]=e.toLowerCase()})),k=U(L),{}),at=(U.Callbacks=function(t){var n,i;function r(e){for(o=t.memory&&e,a=!0,c=l||0,l=0,u=d.length,s=!0;d&&c<u;c++)if(!1===d[c].apply(e[0],e[1])&&t.stopOnFalse){o=!1;break}s=!1,d&&(h?h.length&&r(h.shift()):o?d=[]:p.disable())}t="string"==typeof t?ot[t]||(i=ot[n=t]={},U.each(n.split(Y),(function(t,e){i[e]=!0})),i):U.extend({},t);var o,a,s,l,u,c,d=[],h=!t.once&&[],p={add:function(){var e;return d&&(e=d.length,function e(n){U.each(n,(function(n,i){var r=U.type(i);"function"!==r||t.unique&&p.has(i)?i&&i.length&&"string"!==r&&e(i):d.push(i)}))}(arguments),s?u=d.length:o&&(l=e,r(o))),this},remove:function(){return d&&U.each(arguments,(function(t,e){for(var n;-1<(n=U.inArray(e,d,n));)d.splice(n,1),s&&(n<=u&&u--,n<=c)&&c--})),this},has:function(t){return-1<U.inArray(t,d)},empty:function(){return d=[],this},disable:function(){return d=h=o=e,this},disabled:function(){return!d},lock:function(){return h=e,o||p.disable(),this},locked:function(){return!h},fireWith:function(t,e){return e=[t,(e=e||[]).slice?e.slice():e],!d||a&&!h||(s?h.push(e):r(e)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!a}};return p},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){function e(t,e,i){return function(r){e[t]=this,i[t]=1<arguments.length?F.call(arguments):r,i===n?u.notifyWith(e,i):--l||u.resolveWith(e,i)}}var n,i,r,o=0,a=F.call(arguments),s=a.length,l=1!==s||t&&U.isFunction(t.promise)?s:0,u=1===l?t:U.Deferred();if(1<s)for(n=new Array(s),i=new Array(s),r=new Array(s);o<s;o++)a[o]&&U.isFunction(a[o].promise)?a[o].promise().done(e(o,r,a)).fail(u.reject).progress(e(o,i,n)):--l;return l||u.resolveWith(r,a),u.promise()}}),U.support=function(){var e,n,i,r,o,a,s,l,u=L.createElement("div");if(u.setAttribute("className","t"),u.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",i=u.getElementsByTagName("*"),(n=u.getElementsByTagName("a")[0]).style.cssText="top:1px;float:left;opacity:.5",!i||!i.length)return{};l=(i=L.createElement("select")).appendChild(L.createElement("option")),r=u.getElementsByTagName("input")[0],e={leadingWhitespace:3===u.firstChild.nodeType,tbody:!u.getElementsByTagName("tbody").length,htmlSerialize:!!u.getElementsByTagName("link").length,style:/top/.test(n.getAttribute("style")),hrefNormalized:"/a"===n.getAttribute("href"),opacity:/^0.5/.test(n.style.opacity),cssFloat:!!n.style.cssFloat,checkOn:"on"===r.value,optSelected:l.selected,getSetAttribute:"t"!==u.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},r.checked=!0,e.noCloneChecked=r.cloneNode(!0).checked,i.disabled=!0,e.optDisabled=!l.disabled;try{delete u.test}catch(n){e.deleteExpando=!1}if(!u.addEventListener&&u.attachEvent&&u.fireEvent&&(u.attachEvent("onclick",l=function(){e.noCloneEvent=!1}),u.cloneNode(!0).fireEvent("onclick"),u.detachEvent("onclick",l)),(r=L.createElement("input")).value="t",r.setAttribute("type","radio"),e.radioValue="t"===r.value,r.setAttribute("checked","checked"),r.setAttribute("name","t"),u.appendChild(r),(l=L.createDocumentFragment()).appendChild(u.lastChild),e.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,e.appendChecked=r.checked,l.removeChild(r),l.appendChild(u),u.attachEvent)for(a in{submit:!0,change:!0,focusin:!0})(s=(o="on"+a)in u)||(u.setAttribute(o,"return;"),s="function"==typeof u[o]),e[a+"Bubbles"]=s;return U((function(){var n,i,r,o="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=L.getElementsByTagName("body")[0];a&&((n=L.createElement("div")).style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.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",s=0===r[0].offsetHeight,r[0].style.display="",r[1].style.display="none",e.reliableHiddenOffsets=s&&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!==a.offsetTop,t.getComputedStyle&&(e.pixelPosition="1%"!==(t.getComputedStyle(i,null)||{}).top,e.boxSizingReliable="4px"===(t.getComputedStyle(i,null)||{width:"4px"}).width,(r=L.createElement("div")).style.cssText=i.style.cssText=o,r.style.marginRight=r.style.width="0",i.style.width="1px",i.appendChild(r),e.reliableMarginRight=!parseFloat((t.getComputedStyle(r,null)||{}).marginRight)),void 0!==i.style.zoom&&(i.innerHTML="",i.style.cssText=o+"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),a.removeChild(n))})),l.removeChild(u),n=i=r=l=u=null,e}(),/(?:\{[\s\S]*\}|\[[\s\S]*\])$/),st=/([A-Z])/g;function lt(t){return U.event.special.hover?t:t.replace(wt,"mouseenter$1 mouseleave$1")}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=U.expando,s="string"==typeof n,l=t.nodeType,u=l?U.cache:t,c=l?t[a]:t[a]&&a;if(c&&u[c]&&(r||u[c].data)||!s||i!==e)return c||(l?t[a]=c=U.deletedIds.pop()||U.guid++:c=a),u[c]||(u[c]={},l)||(u[c].toJSON=U.noop),"object"!=typeof n&&"function"!=typeof n||(r?u[c]=U.extend(u[c],n):u[c].data=U.extend(u[c].data,n)),t=u[c],r||(t.data||(t.data={}),t=t.data),i!==e&&(t[U.camelCase(n)]=i),s?null==(o=t[n])&&(o=t[U.camelCase(n)]):o=t,o}},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)){for((o=0,a=(e=U.isArray(e)?e:e in r||(e=U.camelCase(e))in r?[e]:e.split(" ")).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)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,1<arguments.length,null,!1));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},removeData:function(t){return this.each((function(){U.removeData(this,t)}))}}),U.extend({queue:function(t,e,n){var i;if(t)return i=U._data(t,e=(e||"fx")+"queue"),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,this.queue(e=e||"fx",(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){function i(){--o||a.resolveWith(s,[s])}var r,o=1,a=U.Deferred(),s=this,l=this.length;for("string"!=typeof t&&(n=t,t=e),t=t||"fx";l--;)(r=U._data(s[l],t+"queueHooks"))&&r.empty&&(o++,r.empty.add(i));return i(),a.promise(n)}});var ut,ct,dt,ht=/[\t\r\n]/g,pt=/\r/g,ft=/^(?:button|input)$/i,gt=/^(?:button|input|object|select|textarea)$/i,mt=/^a(?:rea|)$/i,vt=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,yt=U.support.getSetAttribute,bt=(U.fn.extend({attr:function(t,e){return U.access(this,U.attr,t,e,1<arguments.length)},removeAttr:function(t){return this.each((function(){U.removeAttr(this,t)}))},prop:function(t,e){return U.access(this,U.prop,t,e,1<arguments.length)},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(ht," "),o=0,a=n.length;o<a;o++)for(;0<=i.indexOf(" "+n[o]+" ");)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&&0<=(" "+this[n].className+" ").replace(ht," ").indexOf(e))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=U(this);1!==this.nodeType||(null==(i=r?t.call(this,i,o.val()):t)?i="":"number"==typeof i?i+="":U.isArray(i)&&(i=U.map(i,(function(t){return null==t?"":t+""}))),(n=U.valHooks[this.type]||U.valHooks[this.nodeName.toLowerCase()])&&"set"in n&&n.set(this,i,"value")!==e)||(this.value=i)}))):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=t.selectedIndex,o=[],a=t.options,s="select-one"===t.type;if(r<0)return null;for(e=s?r:0,n=s?r+1:a.length;e<n;e++)if((i=a[e]).selected&&(U.support.optDisabled?!i.disabled:null===i.getAttribute("disabled"))&&(!i.parentNode.disabled||!U.nodeName(i.parentNode,"optgroup"))){if(i=U(i).val(),s)return i;o.push(i)}return s&&!o.length&&a.length?U(a[r]).val():o},set:function(t,e){var n=U.makeArray(e);return U(t).find("option").each((function(){this.selected=0<=U.inArray(U(this).val(),n)})),n.length||(t.selectedIndex=-1),n}}},attrFn:{},attr:function(t,n,i,r){var o,a,s=t.nodeType;if(t&&3!==s&&8!==s&&2!==s)return r&&U.isFunction(U.fn[n])?U(t)[n](i):void 0===t.getAttribute?U.prop(t,n,i):((r=1!==s||!U.isXMLDoc(t))&&(n=n.toLowerCase(),a=U.attrHooks[n]||(vt.test(n)?ct:ut)),i!==e?null===i?void U.removeAttr(t,n):a&&"set"in a&&r&&(o=a.set(t,i,n))!==e?o:(t.setAttribute(n,i+""),i):a&&"get"in a&&r&&null!==(o=a.get(t,n))||null!==(o=t.getAttribute(n))?o:e)},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=vt.test(r))||U.attr(t,r,""),t.removeAttribute(yt?r:n),o)&&n in t&&(t[n]=!1)},attrHooks:{type:{set:function(t,e){var n;if(ft.test(t.nodeName)&&t.parentNode)U.error("type property can't be changed");else if(!U.support.radioValue&&"radio"===e&&U.nodeName(t,"input"))return n=t.value,t.setAttribute("type",e),n&&(t.value=n),e}},value:{get:function(t,e){return ut&&U.nodeName(t,"button")?ut.get(t,e):e in t?t.value:null},set:function(t,e,n){if(ut&&U.nodeName(t,"button"))return ut.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):gt.test(t.nodeName)||mt.test(t.nodeName)&&t.href?0:e}}}}),ct={get:function(t,n){var i=U.prop(t,n);return!0===i||"boolean"!=typeof i&&(i=t.getAttributeNode(n))&&!1!==i.nodeValue?n.toLowerCase():e},set:function(t,e,n){return!1===e?U.removeAttr(t,n):((e=U.propFix[n]||n)in t&&(t[e]=!0),t.setAttribute(n,n.toLowerCase())),n}},yt||(dt={name:!0,id:!0,coords:!0},ut=U.valHooks.button={get:function(t,n){return(t=t.getAttributeNode(n))&&(dt[n]?""!==t.value:t.specified)?t.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:ut.get,set:function(t,e,n){ut.set(t,e=""===e?"false":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){return null===(t=t.getAttribute(n,2))?e:t}})})),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){return(t=t.parentNode)&&(t.selectedIndex,t.parentNode)&&t.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=0<=U.inArray(U(t).val(),e)}})})),/^(?:textarea|input|select)$/i),xt=/^([^\.]*|)(?:\.(.+)|)$/,wt=/(?:^|\s)hover(\.\S+|)\b/,Ct=/^key/,_t=/^(?:mouse|contextmenu)|click/,Et=/^(?:focusinfocus|focusoutblur)$/,Mt=(U.event={add:function(t,n,i,r,o){var a,s,l,u,c,d,h,p,f,g;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(lt(n)).split(" "),u=0;u<n.length;u++)c=(h=xt.exec(n[u])||[])[1],d=(h[2]||"").split(".").sort(),g=U.event.special[c]||{},c=(o?g.delegateType:g.bindType)||c,g=U.event.special[c]||{},h=U.extend({type:c,origType:h[1],data:r,handler:i,guid:i.guid,selector:o,needsContext:o&&U.expr.match.needsContext.test(o),namespace:d.join(".")},p),(f=l[c])||((f=l[c]=[]).delegateCount=0,g.setup&&!1!==g.setup.call(t,r,d,s))||(t.addEventListener?t.addEventListener(c,s,!1):t.attachEvent&&t.attachEvent("on"+c,s)),g.add&&(g.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),o?f.splice(f.delegateCount++,0,h):f.push(h),U.event.global[c]=!0},global:{},remove:function(t,e,n,i,r){var o,a,s,l,u,c,d,h,p,f,g=U.hasData(t)&&U._data(t);if(g&&(d=g.events)){for(e=U.trim(lt(e||"")).split(" "),o=0;o<e.length;o++)if(a=s=(u=xt.exec(e[o])||[])[1],l=u[2],a){for(h=U.event.special[a]||{},u=(p=d[a=(i?h.delegateType:h.bindType)||a]||[]).length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c=0;c<p.length;c++)f=p[c],!r&&s!==f.origType||n&&n.guid!==f.guid||l&&!l.test(f.namespace)||i&&i!==f.selector&&("**"!==i||!f.selector)||(p.splice(c--,1),f.selector&&p.delegateCount--,!h.remove)||h.remove.call(t,f);0===p.length&&u!==p.length&&(h.teardown&&!1!==h.teardown.call(t,l,g.handle)||U.removeEvent(t,a,g.handle),delete d[a])}else for(a in d)U.event.remove(t,a+e[o],n,i,!0);U.isEmptyObject(d)&&(delete g.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,p,f,g=n.type||n,m=[];if(Et.test(g+U.event.triggered))return;if(0<=g.indexOf("!")&&(g=g.slice(0,-1),d=!0),0<=g.indexOf(".")&&(g=(m=g.split(".")).shift(),m.sort()),(!r||U.event.customEvent[g])&&!U.event.global[g])return;if((n="object"==typeof n?n[U.expando]?n:new U.Event(g,n):new U.Event(g)).type=g,n.isTrigger=!0,n.exclusive=d,n.namespace=m.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c=g.indexOf(":")<0?"on"+g:"",!r){for(s in a=U.cache)a[s].events&&a[s].events[g]&&U.event.trigger(n,i,a[s].handle.elem,!0);return}if(n.result=e,n.target||(n.target=r),(i=null!=i?U.makeArray(i):[]).unshift(n),(d=U.event.special[g]||{}).trigger&&!1===d.trigger.apply(r,i))return;if(p=[[r,d.bindType||g]],!o&&!d.noBubble&&!U.isWindow(r)){for(f=d.delegateType||g,l=Et.test(f+g)?r:r.parentNode,u=r;l;l=l.parentNode)p.push([l,f]),u=l;u===(r.ownerDocument||L)&&p.push([u.defaultView||u.parentWindow||t,f])}for(s=0;s<p.length&&!n.isPropagationStopped();s++)l=p[s][0],n.type=p[s][1],(h=(U._data(l,"events")||{})[n.type]&&U._data(l,"handle"))&&h.apply(l,i),(h=c&&l[c])&&U.acceptData(l)&&h.apply&&!1===h.apply(l,i)&&n.preventDefault();return n.type=g,o||n.isDefaultPrevented()||d._default&&!1!==d._default.apply(r.ownerDocument,i)||"click"===g&&U.nodeName(r,"a")||!U.acceptData(r)||!c||!r[g]||("focus"===g||"blur"===g)&&0===n.target.offsetWidth||U.isWindow(r)||((u=r[c])&&(r[c]=null),r[U.event.triggered=g](),U.event.triggered=e,!u)||(r[c]=u),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]||[],p=h.delegateCount,f=F.call(arguments),g=!n.exclusive&&!n.namespace,m=U.event.special[n.type]||{},v=[];if((f[0]=n).delegateTarget=this,!m.preDispatch||!1!==m.preDispatch.call(this,n)){if(p&&(!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<p;i++)s[d=(c=h[i]).selector]===e&&(s[d]=c.needsContext?0<=U(d,this).index(o):U.find(d,this,null,[o]).length),s[d]&&u.push(c);u.length&&v.push({elem:o,matches:u})}for(h.length>p&&v.push({elem:this,matches:h.slice(p)}),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,f))!==e)&&!1===(n.result=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=n.button,a=n.fromElement;return null==t.pageX&&null!=n.clientX&&(i=(r=t.target.ownerDocument||L).documentElement,r=r.body,t.pageX=n.clientX+(i&&i.scrollLeft||r&&r.scrollLeft||0)-(i&&i.clientLeft||r&&r.clientLeft||0),t.pageY=n.clientY+(i&&i.scrollTop||r&&r.scrollTop||0)-(i&&i.clientTop||r&&r.clientTop||0)),!t.relatedTarget&&a&&(t.relatedTarget=a===t.target?n.toElement:a),t.which||o===e||(t.which=1&o?1:2&o?3:4&o?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){t=U.extend(new U.Event,n,{type:t,isSimulated:!0,originalEvent:{}}),i?U.event.trigger(t,null,e):U.event.dispatch.call(e,t),t.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){e="on"+e,t.detachEvent&&(void 0===t[e]&&(t[e]=null),t.detachEvent(e,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;return r.selector,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){t=t.target,(t=U.nodeName(t,"input")||U.nodeName(t,"button")?t.form:e)&&!U._data(t,"_submit_attached")&&(U.event.add(t,"submit._submit",(function(t){t._submit_bubble=!0})),U._data(t,"_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(bt.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){t=t.target,bt.test(t.nodeName)&&!U._data(t,"_change_attached")&&(U.event.add(t,"change._change",(function(t){!this.parentNode||t.isSimulated||t.isTrigger||U.event.simulate("change",this.parentNode,t,!0)})),U._data(t,"_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"),!bt.test(this.nodeName)}}),U.support.focusinBubbles||U.each({focus:"focusin",blur:"focusout"},(function(t,e){function n(t){U.event.simulate(e,t.target,U.event.fix(t),!0)}var i=0;U.event.special[e]={setup:function(){0==i++&&L.addEventListener(t,n,!0)},teardown:function(){0==--i&&L.removeEventListener(t,n,!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)}).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)o=t.handleObj,U(t.delegateTarget).off(o.namespace?o.origType+"."+o.namespace:o.origType,o.selector,o.handler);else{if("object"!=typeof t)return!1!==n&&"function"!=typeof n||(i=n,n=e),!1===i&&(i=r),this.each((function(){U.event.remove(this,t,i,n)}));for(a in t)this.off(a,n,t[a])}return this},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){function e(e){var i=(U._data(this,"lastToggle"+t.guid)||0)%r;return U._data(this,"lastToggle"+t.guid,1+i),e.preventDefault(),n[i].apply(this,arguments)||!1}var n=arguments,i=t.guid||U.guid++,r=0;for(e.guid=i;r<n.length;)n[r++].guid=i;return this.click(e)},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),0<arguments.length?this.on(e,null,t,n):this.trigger(e)},Ct.test(e)&&(U.event.fixHooks[e]=U.event.keyHooks),_t.test(e)&&(U.event.fixHooks[e]=U.event.mouseHooks)})),t);function St(t,e,n,i){n=n||[];var r,o,a,s,l=(e=e||se).nodeType;if(!t||"string"!=typeof t)return n;if(1!==l&&9!==l)return[];if(!(a=$t(e))&&!i&&(r=De.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))&&Ut(e,o)&&o.id===s)return n.push(o),n}else{if(r[2])return he.apply(n,pe.call(e.getElementsByTagName(t),0)),n;if((s=r[3])&&Le&&e.getElementsByClassName)return he.apply(n,pe.call(e.getElementsByClassName(s),0)),n}return Nt(t.replace(_e,"$1"),e,n,i,a)}function Dt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Pt(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function jt(t){return ge((function(e){return e=+e,ge((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 Tt(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 At(t,e){var n,i,r,o,a,s,l,u=ve[oe][t];if(u)return e?0:u.slice(0);for(a=t,s=[],l=Bt.preFilter;a;){for(o in n&&!(i=Ee.exec(a))||(i&&(a=a.slice(i[0].length)),s.push(r=[])),n=!1,(i=Me.exec(a))&&(r.push(n=new ae(i.shift())),a=a.slice(n.length),n.type=i[0].replace(_e," ")),Bt.filter)!(i=ke[o].exec(a))||l[o]&&!(i=l[o](i,se,!0))||(r.push(n=new ae(i.shift())),a=a.slice(n.length),n.type=o,n.matches=i);if(!n)break}return e?a.length:a?St.error(t):ve(t,s).slice(0)}function kt(t,e,n){var i=e.dir,r=n&&"parentNode"===e.dir,o=ce++;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=ue+" "+o+" ",u=l+Ft;e=e[i];)if(r||1===e.nodeType){if((s=e[oe])===u)return e.sizset;if("string"==typeof s&&0===s.indexOf(l)){if(e.sizset)return e}else{if(e[oe]=u,t(e,n,a))return e.sizset=!0,e;e.sizset=!1}}}}function It(t){return 1<t.length?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function Lt(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 Ot(t,e,n,i,r,o){return i&&!i[oe]&&(i=Ot(i)),r&&!r[oe]&&(r=Ot(r,o)),ge((function(o,a,s,l){if(!o||!r){var u,c,d,h=[],p=[],f=a.length,g=o||function(t,e,n,i){for(var r=0,o=e.length;r<o;r++)St(t,e[r],n,i);return n}(e||"*",s.nodeType?[s]:s,[],o),m=!t||!o&&e?g:Lt(g,h,t,s,l),v=n?r||(o?t:f||i)?[]:a:m;if(n&&n(m,v,s,l),i)for(d=Lt(v,p),i(d,[],s,l),u=d.length;u--;)(c=d[u])&&(v[p[u]]=!(m[p[u]]=c));if(o)for(u=t&&v.length;u--;)(c=v[u])&&(o[h[u]]=!(a[h[u]]=c));else v=Lt(v===a?v.splice(f,v.length):v),r?r(null,a,v,l):he.apply(a,v)}}))}function Nt(t,e,n,i,r){var o,a,s,l,u,c=At(t);if(c.length,!i&&1===c.length){if(2<(a=c[0]=c[0].slice(0)).length&&"ID"===(s=a[0]).type&&9===e.nodeType&&!r&&Bt.relative[a[1].type]){if(!(e=Bt.find.ID(s.matches[0].replace(Ae,""),e,r)[0]))return n;t=t.slice(a.shift().length)}for(o=ke.POS.test(t)?-1:a.length-1;0<=o&&(s=a[o],!Bt.relative[l=s.type]);o--)if((u=Bt.find[l])&&(i=u(s.matches[0].replace(Ae,""),Pe.test(a[0].type)&&e.parentNode||e,r))){if(a.splice(o,1),t=i.length&&a.join(""))break;return he.apply(n,pe.call(i,0)),n}}return qt(t,c)(i,e,r,n,Pe.test(t)),n}function zt(){}function Rt(){var t={},e=[];return ge((function(n,i){return e.push(n)>Bt.cacheLength&&delete t[e.shift()],t[n]=i}),t)}function Ht(t){var e=se.createElement("div");try{return t(e)}catch(t){return!1}}var Ft,Vt,Bt,Wt,$t,Ut,qt,Gt,Yt,Xt,Qt,Kt,Jt,Zt,te,ee,ne,ie,re="undefined",oe=("sizcache"+Math.random()).replace(".",""),ae=String,se=Mt.document,le=se.documentElement,ue=0,ce=0,de=[].pop,he=[].push,pe=[].slice,fe=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},ge=function(t,e){return t[oe]=null==e||e,t},me=Rt(),ve=Rt(),ye=Rt(),be="[\\x20\\t\\r\\n\\f]",xe=(Mt="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+").replace("w","w#"),we=":("+Mt+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+(xe="\\["+be+"*("+Mt+")"+be+"*(?:([*^$|!~]?=)"+be+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+xe+")|)|)"+be+"*\\]")+")|[^:]|\\\\.)*|.*))\\)|)",Ce=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+be+"*((?:-\\d)?\\d*)"+be+"*\\)|)(?=[^-]|$)",_e=new RegExp("^"+be+"+|((?:^|[^\\\\])(?:\\\\.)*)"+be+"+$","g"),Ee=new RegExp("^"+be+"*,"+be+"*"),Me=new RegExp("^"+be+"*([\\x20\\t\\r\\n\\f>+~])"+be+"*"),Se=new RegExp(we),De=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Pe=/[\x20\t\r\n\f]*[+~]/,je=/h\d/i,Te=/input|select|textarea|button/i,Ae=/\\(?!\\)/g,ke={ID:new RegExp("^#("+Mt+")"),CLASS:new RegExp("^\\.("+Mt+")"),NAME:new RegExp("^\\[name=['\"]?("+Mt+")['\"]?\\]"),TAG:new RegExp("^("+Mt.replace("w","w*")+")"),ATTR:new RegExp("^"+xe),PSEUDO:new RegExp("^"+we),POS:new RegExp(Ce,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+be+"*(even|odd|(([+-]|)(\\d*)n|)"+be+"*(?:([+-]|)"+be+"*(\\d+)|))"+be+"*\\)|)","i"),needsContext:new RegExp("^"+be+"*[>+~]|"+Ce,"i")},Ie=(Mt=Ht((function(t){return t.appendChild(se.createComment("")),!t.getElementsByTagName("*").length})),xe=Ht((function(t){return t.innerHTML="<a href='#'></a>",t.firstChild&&typeof t.firstChild.getAttribute!=re&&"#"===t.firstChild.getAttribute("href")})),Ht((function(t){return t.innerHTML="<select></select>","boolean"!=(t=typeof t.lastChild.getAttribute("multiple"))&&"string"!=t}))),Le=Ht((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)}));Ce=Ht((function(t){t.id=oe+0,t.innerHTML="<a name='"+oe+"'></a><div name='"+oe+"'></div>",le.insertBefore(t,le.firstChild);var e=se.getElementsByName&&se.getElementsByName(oe).length===2+se.getElementsByName(oe+0).length;return Vt=!se.getElementById(oe),le.removeChild(t),e}));try{pe.call(le.childNodes,0)[0].nodeType}catch(Mt){pe=function(t){for(var e,n=[];e=this[t];t++)n.push(e);return n}}St.matches=function(t,e){return St(t,null,null,e)},St.matchesSelector=function(t,e){return 0<St(e,null,null,[t]).length},Wt=St.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+=Wt(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[i];i++)n+=Wt(e);return n},$t=St.isXML=function(t){return!!(t=t&&(t.ownerDocument||t).documentElement)&&"HTML"!==t.nodeName},Ut=St.contains=le.contains?function(t,e){var n=9===t.nodeType?t.documentElement:t;return t===(e=e&&e.parentNode)||!!(e&&1===e.nodeType&&n.contains&&n.contains(e))}:le.compareDocumentPosition?function(t,e){return e&&!!(16&t.compareDocumentPosition(e))}:function(t,e){for(;e=e.parentNode;)if(e===t)return!0;return!1},St.attr=function(t,e){var n,i=$t(t);return i||(e=e.toLowerCase()),(n=Bt.attrHandle[e])?n(t):i||Ie?t.getAttribute(e):(n=t.getAttributeNode(e))?"boolean"==typeof t[e]?t[e]?e:null:n.specified?n.value:null:null},Bt=St.selectors={cacheLength:50,createPseudo:ge,match:ke,attrHandle:xe?{}:{href:function(t){return t.getAttribute("href",2)},type:function(t){return t.getAttribute("type")}},find:{ID:Vt?function(t,e,n){if(typeof e.getElementById!=re&&!n)return(n=e.getElementById(t))&&n.parentNode?[n]:[]}:function(t,e,n){if(typeof e.getElementById!=re&&!n)return(n=e.getElementById(t))?n.id===t||typeof n.getAttributeNode!=re&&n.getAttributeNode("id").value===t?[n]:void 0:[]},TAG:Mt?function(t,e){if(typeof e.getElementsByTagName!=re)return e.getElementsByTagName(t)}:function(t,e){var n=e.getElementsByTagName(t);if("*"!==t)return n;for(var i,r=[],o=0;i=n[o];o++)1===i.nodeType&&r.push(i);return r},NAME:Ce&&function(t,e){if(typeof e.getElementsByName!=re)return e.getElementsByName(name)},CLASS:Le&&function(t,e,n){if(typeof e.getElementsByClassName!=re&&!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(Ae,""),t[3]=(t[4]||t[5]||"").replace(Ae,""),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1]?(t[2]||St.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]&&St.error(t[0]),t},PSEUDO:function(t){var e,n;return ke.CHILD.test(t[0])?null:(t[3]?t[2]=t[3]:(e=t[4])&&(Se.test(e)&&(n=(n=At(e,!0))&&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:Vt?function(t){return t=t.replace(Ae,""),function(e){return e.getAttribute("id")===t}}:function(t){return t=t.replace(Ae,""),function(e){return(e=typeof e.getAttributeNode!=re&&e.getAttributeNode("id"))&&e.value===t}},TAG:function(t){return"*"===t?function(){return!0}:(t=t.replace(Ae,"").toLowerCase(),function(e){return e.nodeName&&e.nodeName.toLowerCase()===t})},CLASS:function(t){var e=(e=me[oe][t])||me(t,new RegExp("(^|"+be+")"+t+"("+be+"|$)"));return function(t){return e.test(t.className||typeof t.getAttribute!=re&&t.getAttribute("class")||"")}},ATTR:function(t,e,n){return function(i,r){return null==(i=St.attr(i,t))?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&-1<i.indexOf(n):"$="===e?n&&i.substr(i.length-n.length)===n:"~="===e?-1<(" "+i+" ").indexOf(n):"|="===e&&(i===n||i.substr(0,n.length+1)===n+"-"))}},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&&0<=r/n}: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,e){var n,i=Bt.pseudos[t]||Bt.setFilters[t.toLowerCase()]||St.error("unsupported pseudo: "+t);return i[oe]?i(e):1<i.length?(n=[t,t,"",e],Bt.setFilters.hasOwnProperty(t.toLowerCase())?ge((function(t,n){for(var r,o=i(t,e),a=o.length;a--;)t[r=fe.call(t,o[a])]=!(n[r]=o[a])})):function(t){return i(t,0,n)}):i}},pseudos:{not:ge((function(t){var e=[],n=[],i=qt(t.replace(_e,"$1"));return i[oe]?ge((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:ge((function(t){return function(e){return 0<St(t,e).length}})),contains:ge((function(t){return function(e){return-1<(e.textContent||e.innerText||Wt(e)).indexOf(t)}})),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!Bt.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 je.test(t.nodeName)},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===(e=t.type)&&(null==(t=t.getAttribute("type"))||t.toLowerCase()===e)},radio:Dt("radio"),checkbox:Dt("checkbox"),file:Dt("file"),password:Dt("password"),image:Dt("image"),submit:Pt("submit"),reset:Pt("reset"),button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},input:function(t){return Te.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:jt((function(t,e,n){return[0]})),last:jt((function(t,e,n){return[e-1]})),eq:jt((function(t,e,n){return[n<0?n+e:n]})),even:jt((function(t,e,n){for(var i=0;i<e;i+=2)t.push(i);return t})),odd:jt((function(t,e,n){for(var i=1;i<e;i+=2)t.push(i);return t})),lt:jt((function(t,e,n){for(var i=n<0?n+e:n;0<=--i;)t.push(i);return t})),gt:jt((function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t}))}},Gt=le.compareDocumentPosition?function(t,e){return t===e?(Yt=!0,0):(t.compareDocumentPosition&&e.compareDocumentPosition?4&t.compareDocumentPosition(e):t.compareDocumentPosition)?-1:1}:function(t,e){if(t===e)return Yt=!0,0;if(t.sourceIndex&&e.sourceIndex)return t.sourceIndex-e.sourceIndex;var n=[],i=[],r=t.parentNode,o=e.parentNode,a=r;if(r===o)return Tt(t,e);if(!r)return-1;if(!o)return 1;for(;a;)n.unshift(a),a=a.parentNode;for(a=o;a;)i.unshift(a),a=a.parentNode;for(var s=n.length,l=i.length,u=0;u<s&&u<l;u++)if(n[u]!==i[u])return Tt(n[u],i[u]);return u===s?Tt(t,i[u],-1):Tt(n[u],e,1)},[0,0].sort(Gt),Qt=!Yt,St.uniqueSort=function(t){var e,n=1;if(Yt=Qt,t.sort(Gt),Yt)for(;e=t[n];n++)e===t[n-1]&&t.splice(n--,1);return t},St.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},qt=St.compile=function(t,e){var n,i=[],r=[],o=ye[oe][t];if(!o){for(n=(e=e||At(t)).length;n--;)((o=function t(e){for(var n,i,r,o=e.length,a=Bt.relative[e[0].type],s=a||Bt.relative[" "],l=a?1:0,u=kt((function(t){return t===n}),s,!0),c=kt((function(t){return-1<fe.call(n,t)}),s,!0),d=[function(t,e,i){return!a&&(i||e!==Xt)||((n=e).nodeType?u:c)(t,e,i)}];l<o;l++)if(i=Bt.relative[e[l].type])d=[kt(It(d),i)];else{if((i=Bt.filter[e[l].type].apply(null,e[l].matches))[oe]){for(r=++l;r<o&&!Bt.relative[e[r].type];r++);return Ot(1<l&&It(d),1<l&&e.slice(0,l-1).join("").replace(_e,"$1"),i,l<r&&t(e.slice(l,r)),r<o&&t(e=e.slice(r)),r<o&&e.join(""))}d.push(i)}return It(d)}(e[n]))[oe]?i:r).push(o);o=ye(t,function(t,e){function n(o,a,s,l,u){var c,d,h,p=[],f=0,g="0",m=o&&[],v=null!=u,y=Xt,b=o||r&&Bt.find.TAG("*",u&&a.parentNode||a),x=ue+=null==y?1:Math.E;for(v&&(Xt=a!==se&&a,Ft=n.el);null!=(c=b[g]);g++){if(r&&c){for(d=0;h=t[d];d++)if(h(c,a,s)){l.push(c);break}v&&(ue=x,Ft=++n.el)}i&&((c=!h&&c)&&f--,o)&&m.push(c)}if(f+=g,i&&g!==f){for(d=0;h=e[d];d++)h(m,p,a,s);if(o){if(0<f)for(;g--;)m[g]||p[g]||(p[g]=de.call(l));p=Lt(p)}he.apply(l,p),v&&!o&&0<p.length&&1<f+e.length&&St.uniqueSort(l)}return v&&(ue=x,Xt=y),m}var i=0<e.length,r=0<t.length;return n.el=0,i?ge(n):n}(r,i))}return o},se.querySelectorAll&&(Jt=Nt,Zt=/'|\\/g,te=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,ee=[":focus"],ne=[":active",":focus"],ie=le.matchesSelector||le.mozMatchesSelector||le.webkitMatchesSelector||le.oMatchesSelector||le.msMatchesSelector,Ht((function(t){t.innerHTML="<select><option selected=''></option></select>",t.querySelectorAll("[selected]").length||ee.push("\\["+be+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),t.querySelectorAll(":checked").length||ee.push(":checked")})),Ht((function(t){t.innerHTML="<p test=''></p>",t.querySelectorAll("[test^='']").length&&ee.push("[*^$]="+be+"*(?:\"\"|'')"),t.innerHTML="<input type='hidden'/>",t.querySelectorAll(":enabled").length||ee.push(":enabled",":disabled")})),ee=new RegExp(ee.join("|")),Nt=function(t,e,n,i,r){if(!(i||r||ee&&ee.test(t))){var o,a,s=!0,l=oe,u=e,c=9===e.nodeType&&t;if(1===e.nodeType&&"object"!==e.nodeName.toLowerCase()){for(o=At(t),(s=e.getAttribute("id"))?l=s.replace(Zt,"\\$&"):e.setAttribute("id",l),l="[id='"+l+"'] ",a=o.length;a--;)o[a]=l+o[a].join("");u=Pe.test(t)&&e.parentNode||e,c=o.join(",")}if(c)try{return he.apply(n,pe.call(u.querySelectorAll(c),0)),n}catch(t){}finally{s||e.removeAttribute("id")}}return Jt(t,e,n,i,r)},ie)&&(Ht((function(t){Kt=ie.call(t,"div");try{ie.call(t,"[test!='']:sizzle"),ne.push("!=",we)}catch(t){}})),ne=new RegExp(ne.join("|")),St.matchesSelector=function(t,e){if(e=e.replace(te,"='$1']"),!($t(t)||ne.test(e)||ee&&ee.test(e)))try{var n=ie.call(t,e);if(n||Kt||t.document&&11!==t.document.nodeType)return n}catch(t){}return 0<St(e,null,null,[t]).length}),Bt.pseudos.nth=Bt.pseudos.eq,Bt.filters=zt.prototype=Bt.pseudos,Bt.setFilters=new zt,St.attr=U.attr,U.find=St,U.expr=St.selectors,U.expr[":"]=U.expr.pseudos,U.unique=St.uniqueSort,U.text=St.getText,U.isXMLDoc=St.isXML,U.contains=St.contains;var Oe=/Until$/,Ne=/^(?:parents|prev(?:Until|All))/,ze=/^.[^:#\[\.,]*$/,Re=U.expr.match.needsContext,He={children:!0,contents:!0,next:!0,prev:!0},Fe=(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),0<e)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?Re.test(t)?0<=U(t,this.context).index(this[0]):0<U.filter(t,this).length:0<this.filter(t).length)},closest:function(t,e){for(var n,i=0,r=this.length,o=[],a=Re.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?-1<a.index(n):U.find.matchesSelector(n,t)){o.push(n);break}n=n.parentNode}return o=1<o.length?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){return e="string"==typeof t?U(t,e):U.makeArray(t&&t.nodeType?[t]:t),t=U.merge(this.get(),e),this.pushStack(a(e[0])||a(t[0])?t:U.unique(t))},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){return(t=t.parentNode)&&11!==t.nodeType?t: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(i=Oe.test(t)?i:n)&&"string"==typeof i&&(r=U.filter(i,r)),r=1<this.length&&!He[t]?U.unique(r):r,1<this.length&&Ne.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}}),"abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video"),Ve=/ jQuery\d+="(?:null|\d+)"/g,Be=/^\s+/,We=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,$e=/<([\w:]+)/,Ue=/<tbody/i,qe=/<|&#?\w+;/,Ge=/<(?:script|style|link)/i,Ye=/<(?:script|object|embed|option|style)/i,Xe=new RegExp("<(?:"+Fe+")[\\s/>]","i"),Qe=/^(?:checkbox|radio)$/,Ke=/checked\s*(?:[^=]|=\s*.checked.)/i,Je=/\/(java|ecma)script/i,Ze=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,tn={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,"",""]},en=u(L),nn=en.appendChild(L.createElement("div"));tn.optgroup=tn.option,tn.tbody=tn.tfoot=tn.colgroup=tn.caption=tn.thead,tn.th=tn.td,U.support.htmlSerialize||(tn._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){var e;return U.isFunction(t)?this.each((function(e){U(this).wrapAll(t.call(this,e))})):(this[0]&&(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)),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(){var t;return a(this[0])?arguments.length?(t=U.clean(arguments),this.pushStack(U.merge(t,this),"before",this.selector)):void 0:this.domManip(arguments,!1,(function(t){this.parentNode.insertBefore(t,this)}))},after:function(){var t;return a(this[0])?arguments.length?(t=U.clean(arguments),this.pushStack(U.merge(this,t),"after",this.selector)):void 0:this.domManip(arguments,!1,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}))},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(Ve,""):e;if("string"==typeof t&&!Ge.test(t)&&(U.support.htmlSerialize||!Xe.test(t))&&(U.support.leadingWhitespace||!Be.test(t))&&!tn[($e.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(We,"<$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,u,c=0,d=(t=[].concat.apply([],t))[0],h=[],p=this.length;if(!U.support.checkClone&&1<p&&"string"==typeof d&&Ke.test(d))return this.each((function(){U(this).domManip(t,n,i)}));if(U.isFunction(d))return this.each((function(r){var o=U(this);t[0]=d.call(this,r,n?o.html():e),o.domManip(t,n,i)}));if(this[0]){if(o=(a=(r=U.buildFragment(t,this,h)).fragment).firstChild,1===a.childNodes.length&&(a=o),o)for(n=n&&U.nodeName(o,"tr"),s=r.cacheable||p-1;c<p;c++)i.call(n&&U.nodeName(this[c],"table")?(u="tbody",(l=this[c]).getElementsByTagName(u)[0]||l.appendChild(l.ownerDocument.createElement(u))):this[c],c===s?a:U.clone(a,!0,!0));a=null,h.length&&U.each(h,(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(Ze,"")),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))||Ye.test(s)||!U.support.checkClone&&Ke.test(s)||!U.support.html5Clone&&Xe.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;if((null==(n=1===this.length&&this[0].parentNode)||n&&11===n.nodeType&&1===n.childNodes.length)&&1===s)return a[e](this[0]),this;for(;r<s;r++)i=(0<r?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)||!Xe.test("<"+t.nodeName+">")?a=t.cloneNode(!0):(nn.innerHTML=t.outerHTML,nn.removeChild(a=nn.firstChild)),!(U.support.noCloneEvent&&U.support.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||U.isXMLDoc(t)))for(d(t,a),i=h(t),r=h(a),o=0;i[o];++o)r[o]&&d(i[o],r[o]);if(e&&(c(t,a),n))for(i=h(t),r=h(a),o=0;i[o];++o)c(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&&en,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(qe.test(a)){for(v=v||u(e),d=e.createElement("div"),v.appendChild(d),a=a.replace(We,"<$1></$2>"),s=($e.exec(a)||["",""])[1].toLowerCase(),c=(l=tn[s]||tn._default)[0],d.innerHTML=l[1]+a+l[2];c--;)d=d.lastChild;if(!U.support.tbody)for(h=Ue.test(a),o=(f="table"!==s||h?"<table>"!==l[1]||h?[]:d.childNodes:d.firstChild&&d.firstChild.childNodes).length-1;0<=o;--o)U.nodeName(f[o],"tbody")&&!f[o].childNodes.length&&f[o].parentNode.removeChild(f[o]);!U.support.leadingWhitespace&&Be.test(a)&&d.insertBefore(e.createTextNode(Be.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||Je.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))}}}),U.uaMatch=function(t){return t=t.toLowerCase(),{browser:(t=/(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)||[])[1]||"",version:t[2]||"0"}},xe={},(Mt=U.uaMatch(N.userAgent)).browser&&(xe[Mt.browser]=!0,xe.version=Mt.version),xe.chrome?xe.webkit=!0:xe.webkit&&(xe.safari=!0),U.browser=xe,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()).constructor=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 rn,on,an,sn=/alpha\([^)]*\)/i,ln=/opacity=([^)]*)/,un=/^(top|right|bottom|left)$/,cn=/^(none|table(?!-c[ea]).+)/,dn=/^margin/,hn=new RegExp("^("+q+")(.*)$","i"),pn=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),fn=new RegExp("^([-+])=("+q+")","i"),gn={},mn={position:"absolute",visibility:"hidden",display:"block"},vn={letterSpacing:0,fontWeight:400},yn=["Top","Right","Bottom","Left"],bn=["Webkit","O","Moz","ms"],xn=U.fn.toggle,wn=(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,1<arguments.length)},show:function(){return m(this,!0)},hide:function(){return m(this)},toggle:function(t,e){var n="boolean"==typeof t;return U.isFunction(t)&&U.isFunction(e)?xn.apply(this,arguments):this.each((function(){(n?t:g(this))?U(this).show():U(this).hide()}))}}),U.extend({cssHooks:{opacity:{get:function(t,e){if(e)return""===(e=rn(t,"opacity"))?"1":e}}},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]=f(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=fn.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=U.camelCase(n);return n=U.cssProps[a]||(U.cssProps[a]=f(t.style,a)),"normal"===(o=(o=(a=U.cssHooks[n]||U.cssHooks[a])&&"get"in a?a.get(t,!0,r):o)===e?rn(t,n):o)&&n in vn&&(o=vn[n]),(i||r!==e)&&(a=parseFloat(o),i||U.isNumeric(a))?a||0:o},swap:function(t,e,n){var i,r={};for(i in e)r[i]=t.style[i],t.style[i]=e[i];for(i in n=n.call(t),e)t.style[i]=r[i];return n}}),t.getComputedStyle?rn=function(e,n){var i,r,o=t.getComputedStyle(e,null),a=e.style;return o&&(""!==(i=o[n])||U.contains(e.ownerDocument,e)||(i=U.style(e,n)),pn.test(i))&&dn.test(n)&&(e=a.width,n=a.minWidth,r=a.maxWidth,a.minWidth=a.maxWidth=a.width=i,i=o.width,a.width=e,a.minWidth=n,a.maxWidth=r),i}:L.documentElement.currentStyle&&(rn=function(t,e){var n,i,r=t.currentStyle&&t.currentStyle[e],o=t.style;return null==r&&o&&o[e]&&(r=o[e]),pn.test(r)&&!un.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&&cn.test(rn(t,"display"))?U.swap(t,mn,(function(){return b(t,e,i)})):b(t,e,i)},set:function(t,n,i){return v(0,n,i?y(t,e,i,U.support.boxSizing&&"border-box"===U.css(t,"boxSizing")):0)}}})),U.support.opacity||(U.cssHooks.opacity={get:function(t,e){return ln.test((e&&t.currentStyle?t.currentStyle:t.style).filter||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var n=t.style,i=(t=t.currentStyle,U.isNumeric(e)?"alpha(opacity="+100*e+")":""),r=t&&t.filter||n.filter||"";(n.zoom=1)<=e&&""===U.trim(r.replace(sn,""))&&n.removeAttribute&&(n.removeAttribute("filter"),t)&&!t.filter||(n.filter=sn.test(r)?r.replace(sn,i):r+" "+i)}}),U((function(){U.support.reliableMarginRight||(U.cssHooks.marginRight={get:function(t,e){return U.swap(t,{display:"inline-block"},(function(){if(e)return rn(t,"marginRight")}))}}),!U.support.pixelPosition&&U.fn.position&&U.each(["top","left"],(function(t,e){U.cssHooks[e]={get:function(t,n){if(n)return n=rn(t,e),pn.test(n)?U(t).position()[e]+"px":n}}}))})),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||rn(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){for(var i="string"==typeof n?n.split(" "):[n],r={},o=0;o<4;o++)r[t+yn[o]+e]=i[o]||i[o-2]||i[0];return r}},dn.test(t)||(U.cssHooks[t+e].set=v)})),/%20/g),Cn=/\[\]$/,_n=/\r?\n/g,En=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Mn=/^(?: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||Mn.test(this.nodeName)||En.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(_n,"\r\n")}})):{name:e.name,value:n.replace(_n,"\r\n")}})).get()}}),U.param=function(t,n){function i(t,e){e=U.isFunction(e)?e():null==e?"":e,o[o.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)}var r,o=[];if(n===e&&(n=U.ajaxSettings&&U.ajaxSettings.traditional),U.isArray(t)||t.jquery&&!U.isPlainObject(t))U.each(t,(function(){i(this.name,this.value)}));else for(r in t)!function t(e,n,i,r){if(U.isArray(n))U.each(n,(function(n,o){i||Cn.test(e)?r(e,o):t(e+"["+("object"==typeof o?n:"")+"]",o,i,r)}));else if(i||"object"!==U.type(n))r(e,n);else for(var o in n)t(e+"["+o+"]",n[o],i,r)}(r,t[r],n,i);return o.join("&").replace(wn,"+")};var Sn,Dn,Pn=/#.*$/,jn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Tn=/^(?:GET|HEAD)$/,An=/^\/\//,kn=/\?/,In=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,Ln=/([?&])_=[^&]*/,On=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Nn=U.fn.load,zn={},Rn={},Hn=["*/"]+["*"];try{Dn=O.href}catch(Mt){(Dn=L.createElement("a")).href="",Dn=Dn.href}Sn=On.exec(Dn.toLowerCase())||[],U.fn.load=function(t,n,i){var r,o,a,s,l;return"string"!=typeof t&&Nn?Nn.apply(this,arguments):(this.length&&(s=this,0<=(l=t.indexOf(" "))&&(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(In,"")).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?_(t,U.ajaxSettings):(e=t,t=U.ajaxSettings),_(t,e),t},ajaxSettings:{url:Dn,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(Sn[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","*":Hn},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:w(zn),ajaxTransport:w(Rn),ajax:function(t,n){function i(t,n,i,a){var c,d,y,b,w=n;2!==x&&(x=2,l&&clearTimeout(l),s=e,o=a||"",_.readyState=0<t?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,_,i)),200<=t&&t<300||304===t?(h.ifModified&&((a=_.getResponseHeader("Last-Modified"))&&(U.lastModified[r]=a),a=_.getResponseHeader("Etag"))&&(U.etag[r]=a),c=304===t?(w="notmodified",!0):(w=(c=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)).state,d=c.data,!(y=c.error))):(y=w)&&!t||(w="error",t<0&&(t=0)),_.status=t,_.statusText=(n||w)+"",c?g.resolveWith(p,[d,w,_]):g.rejectWith(p,[_,w,y]),_.statusCode(v),v=e,u&&f.trigger("ajax"+(c?"Success":"Error"),[_,h,c?d:y]),m.fireWith(p,[_,w]),u)&&(f.trigger("ajaxComplete",[_,h]),--U.active||U.event.trigger("ajaxStop"))}"object"==typeof t&&(n=t,t=e);var r,o,a,s,l,u,c,d,h=U.ajaxSetup({},n=n||{}),p=h.context||h,f=p!==h&&(p.nodeType||p instanceof U)?U(p):U.event,g=U.Deferred(),m=U.Callbacks("once memory"),v=h.statusCode||{},y={},b={},x=0,w="canceled",_={readyState:0,setRequestHeader:function(t,e){var n;return x||(n=t.toLowerCase(),t=b[n]=b[n]||t,y[t]=e),this},getAllResponseHeaders:function(){return 2===x?o:null},getResponseHeader:function(t){var n;if(2===x){if(!a)for(a={};n=jn.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(_),_.success=_.done,_.error=_.fail,_.complete=m.add,_.statusCode=function(t){if(t)if(x<2)for(var e in t)v[e]=[v[e],t[e]];else e=t[_.status],_.always(e);return this},h.url=((t||h.url)+"").replace(Pn,"").replace(An,Sn[1]+"//"),h.dataTypes=U.trim(h.dataType||"*").toLowerCase().split(Y),null==h.crossDomain&&(t=On.exec(h.url.toLowerCase())||!1,h.crossDomain=t&&t.join(":")+(t[3]?"":"http:"===t[1]?80:443)!==Sn.join(":")+(Sn[3]?"":"http:"===Sn[1]?80:443)),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=U.param(h.data,h.traditional)),C(zn,h,n,_),2===x)return _;for(c in u=h.global,h.type=h.type.toUpperCase(),h.hasContent=!Tn.test(h.type),u&&0==U.active++&&U.event.trigger("ajaxStart"),h.hasContent||(h.data&&(h.url+=(kn.test(h.url)?"&":"?")+h.data,delete h.data),r=h.url,!1===h.cache&&(t=U.now(),d=h.url.replace(Ln,"$1_="+t),h.url=d+(d===h.url?(kn.test(h.url)?"&":"?")+"_="+t:""))),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&_.setRequestHeader("Content-Type",h.contentType),h.ifModified&&(r=r||h.url,U.lastModified[r]&&_.setRequestHeader("If-Modified-Since",U.lastModified[r]),U.etag[r])&&_.setRequestHeader("If-None-Match",U.etag[r]),_.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Hn+"; q=0.01":""):h.accepts["*"]),h.headers)_.setRequestHeader(c,h.headers[c]);if(!h.beforeSend||!1!==h.beforeSend.call(p,_,h)&&2!==x){for(c in w="abort",{success:1,error:1,complete:1})_[c](h[c]);if(s=C(Rn,h,n,_)){_.readyState=1,u&&f.trigger("ajaxSend",[_,h]),h.async&&0<h.timeout&&(l=setTimeout((function(){_.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 _}return _.abort()},active:0,lastModified:{},etag:{}});var Fn=[],Vn=/\?/,Bn=/(=)\?(?=&|$)|\?\?/,Wn=U.now();U.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Fn.pop()||U.expando+"_"+Wn++;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&&Bn.test(u),h=c&&!d&&"string"==typeof l&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.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(Bn,"$1"+o):h?n.data=l.replace(Bn,"$1"+o):c&&(n.url+=(Vn.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,Fn.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){var n,i;if(t.crossDomain)return i=L.head||L.getElementsByTagName("head")[0]||L.documentElement,{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 $n,Un=!!t.ActiveXObject&&function(){for(var t in $n)$n[t](0,1)},qn=0;U.ajaxSettings.xhr=t.ActiveXObject?function(){return!this.isLocal&&E()||function(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}()}:E,Ce=U.ajaxSettings.xhr(),U.extend(U.support,{ajax:!!Ce,cors:!!Ce&&"withCredentials"in Ce}),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(r){}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,Un)&&delete $n[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=++qn,Un&&($n||($n={},U(t).unload(Un)),$n[a]=i),l.onreadystatechange=i):i()},abort:function(){i&&i(0,1)}}}));var Gn,Yn,Xn=/^(?:toggle|show|hide)$/,Qn=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),Kn=/queueHooks$/,Jn=[function(t,e,n){var i,r,o,a,s,l,u,c,d=this,h=t.style,p={},f=[],m=t.nodeType&&g(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"!==x(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)o=e[i],Xn.exec(o)&&(delete e[i],o!==(m?"hide":"show"))&&f.push(i);if(a=f.length)for(s=U._data(t,"fxshow")||U._data(t,"fxshow",{}),m?U(t).show():d.done((function(){U(t).hide()})),d.done((function(){for(var e in U.removeData(t,"fxshow",!0),p)U.style(t,e,p[e])})),i=0;i<a;i++)l=d.createTween(r=f[i],m?s[r]:0),p[r]=s[r]||U.style(t,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}],Zn={"*":[function(t,e){var n,i,r=this.createTween(t,e),o=(e=Qn.exec(e),r.cur()),a=+o||0,s=1,l=20;if(e){if(n=+e[2],"px"!==(i=e[3]||(U.cssNumber[t]?"":"px"))&&a)for(a=U.css(r.elem,t,!0)||n||1;U.style(r.elem,t,(a/=s=s||".5")+i),s!==(s=r.cur()/o)&&1!==s&&--l;);r.unit=i,r.start=a,r.end=e[1]?a+(e[1]+1)*n:n}return r}]},ti=(U.Animation=U.extend(S,{tweener:function(t,e){for(var n,i=0,r=(t=U.isFunction(t)?(e=t,["*"]):t.split(" ")).length;i<r;i++)n=t[i],Zn[n]=Zn[n]||[],Zn[n].unshift(e)},prefilter:function(t,e){e?Jn.unshift(t):Jn.push(t)}}),((U.Tween=D).prototype={constructor:D,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=D.propHooks[this.prop];return(t&&t.get?t:D.propHooks._default).get(this)},run:function(t){var e,n=D.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:D.propHooks._default).set(this),this}}).init.prototype=D.prototype,(D.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}}}).scrollTop=D.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(P(e,!0),i,r,o)}})),U.fn.extend({fadeTo:function(t,e,n,i){return this.filter(g).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){function r(){var e=S(this,U.extend({},t),a);o&&e.stop(!0)}var o=U.isEmptyObject(t),a=U.speed(e,n,i);return o||!1===a.queue?this.each(r):this.queue(a.queue,r)},stop:function(t,n,i){function r(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&&Kn.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:P("show"),slideUp:P("hide"),slideToggle:P("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=D.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)&&!Yn&&(Yn=setInterval(U.fx.tick,U.fx.interval))},U.fx.interval=13,U.fx.stop=function(){clearInterval(Yn),Yn=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}),/^(?:body|html)$/i);U.fn.offset=function(t){var n,i,r,o,a,s;return arguments.length?t===e?this:this.each((function(e){U.offset.setOffset(this,t,e)})):(o={top:0,left:0},(s=(a=this[0])&&a.ownerDocument)?(i=s.body)===a?U.offset.bodyOffset(a):(n=s.documentElement,U.contains(n,a)?(void 0!==a.getBoundingClientRect&&(o=a.getBoundingClientRect()),a=j(s),s=n.clientTop||i.clientTop||0,i=n.clientLeft||i.clientLeft||0,r=a.pageYOffset||n.scrollTop,a=a.pageXOffset||n.scrollLeft,{top:o.top+r-s,left:o.left+a-i}):o):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,r=("static"===(u=U.css(t,"position"))&&(t.style.position="relative"),U(t)),o=r.offset(),a=U.css(t,"top"),s=U.css(t,"left"),l={},u=("absolute"===u||"fixed"===u)&&-1<U.inArray("auto",[a,s])?(i=(u=r.position()).top,u.left):(i=parseFloat(a)||0,parseFloat(s)||0);null!=(e=U.isFunction(e)?e.call(t,n,o):e).top&&(l.top=e.top-o.top+i),null!=e.left&&(l.left=e.left-o.left+u),"using"in e?e.using.call(t,l):r.css(l)}},U.fn.extend({position:function(){var t,e,n,i;if(this[0])return t=this[0],e=this.offsetParent(),n=this.offset(),i=ti.test(e[0].nodeName)?{top:0,left:0}:e.offset(),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&&!ti.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=j(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){var i,r,o;n&&((i=n[0].style).position="absolute",t<2?(i.removeExpression("height"),i.removeExpression("width"),i.setExpression("height",'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'),i.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"')):(e&&e.constructor===Array?(r=-1===(r=e[0]?"number"==typeof e[0]?e[0].toString():e[0].replace(/px/,""):n.css("top").replace(/px/,"")).indexOf("%")?r+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':parseInt(r.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',e[1]&&(o=-1===(o="number"==typeof e[1]?e[1].toString():e[1].replace(/px/,"")).indexOf("%")?o+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(o.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')):(r='(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',o='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'),i.removeExpression("top"),i.removeExpression("left"),i.setExpression("top",r),i.setExpression("left",o)))}))},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: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||(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||(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),l=(this.d.origHeight=this.d.origHeight||n,this.d.origWidth=this.d.origWidth||e,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&&l<n?l:n<c?c:n:o?l<o?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&&u<e?u:e<l?l:e:a?u<a?u:this.o.minWidth&&"auto"!==l&&a<l?l:a:l;this.d.container.css({height:n,width:e}),this.d.wrap.css({overflow:n<o||e<a?"auto":"visible"}),this.o.autoPosition&&this.setPosition()},setPosition:function(){var t=s[0]/2-this.d.container.outerHeight(!0)/2,e=s[1]/2-this.d.container.outerWidth(!0)/2,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;var e;this.unbindEvents(),t.isFunction(this.o.onClose)&&!this.occb?(this.occb=!0,this.o.onClose.apply(this,[this.d])):(this.d.placeholder?(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))):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,p=t.bbq=t.bbq||{},f=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,p,f,g;return l=s!==n?(g=(p=a.match(i?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/))[3]||"",2===l&&M(s)?c=s.replace(i?_:C,""):(f=r(p[2]),s=M(s)?r[i?v:m](s):s,c=2===l?s:1===l?t.extend({},s,f):t.extend({},f,s),c=h(c),i&&(c=c.replace(u,d))),p[1]+(i?"#":c||!p[1]?"?":"")+c+g):o(a!==n?a:e[b][x])}function P(t,e,i){return e=e===n||"boolean"==typeof e?(i=e,h[t?v:m]()):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=t.map((e=e||"").split(""),encodeURIComponent),u=new RegExp(e.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){a=a.split("=");var s,l=d(a[0]),u=r,c=0,h=l.split("]["),p=h.length-1;p=/\[/.test(h[0])&&/\]$/.test(h[p])?(h[p]=h[p].replace(/\]$/,""),(h=h.shift().split("[").concat(h)).length-1):0;if(2===a.length)if(s=d(a[1]),i&&(s=s&&!isNaN(s)?+s:"undefined"===s?n:o[s]!==n?o[s]:s),p)for(;c<=p;c++)u=u[l=""===h[c]?u.length:h[c]]=c<p?u[l]||(h[c+1]&&isNaN(h[c+1])?{}:[]):s;else t.isArray(r[l])?r[l].push(s):r[l]!==n?r[l]=[r[l],s]:r[l]=s;else l&&(r[l]=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),p.pushState=a=function(t,r){M(t)&&/^#/.test(t)&&r===n&&(r=2);var o=t!==n;t=i(e[b][x],o?t:{},o?r:2);e[b][x]=t+(/#/.test(t)?"":"#")},p.getState=s=function(t,e){return t===n||"boolean"==typeof t?o(t):o(e)[t]},p.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)},f[g]=t.extend(f[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=t.event.special,l="location",u="hashchange",c="href",d=t.browser,h=document.documentMode,p=d.msie&&(void 0===h||h<8),f="on"+u in e&&!p;function g(t){return(t=t||e[l][c]).replace(/^[^#]*#?(.*)$/,"$1")}t[u+"Delay"]=100,s[u]=t.extend(s[u],{setup:function(){if(f)return!1;t(n.start)},teardown:function(){if(f)return!1;t(n.stop)}}),(d={}).start=function(){var n;i||(n=g(),o||(o=a=function(t){return t},p&&(r=t('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow,a=function(){return g(r.document[l][c])},(o=function(t,e){t!==e&&((e=r.document).open().close(),e[l].hash="#"+t)})(g()))),function r(){var s=g(),d=a(n);s!==n?(o(n=s,d),t(e).trigger(u)):d!==n&&(e[l][c]=e[l][c].replace(/#.*/,"")+"#"+d),i=setTimeout(r,t[u+"Delay"])}())},d.stop=function(){r||(i&&clearTimeout(i),i=0)},n=d}(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){var n,i,r;return"transparent"===t?t:(n=function(t){return 1==(t=Number(t).toString(16)).length?"0"+t:t},(r=t).match(i=/(rgb[a]?\()(.*)(\))/)&&(r="#"+n((t=t.match(i)[2].split(","))[0])+n(t[1])+n(t[2]),e||4!=t.length||(r+=n(t[3]))),r)},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=t.y+t.h,e.x),a=e.x+e.w,s=e.y;e=e.y+e.h;return n<=o&&o<=i&&r<=s&&s<=t||n<=a&&a<=i&&r<=s&&s<=t||n<=o&&o<=i&&r<=e&&e<=t||n<=a&&o<=i&&r<=e&&e<=t||o<=n&&n<=a&&s<=r&&r<=e||o<=i&&i<=a&&s<=r&&r<=e||o<=n&&n<=a&&s<=t&&t<=e||o<=i&&n<=a&&s<=t&&t<=e},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=(e=jsPlumbUtil.segment(t,e),e=(0<n?jsPlumbUtil.segmentMultipliers:jsPlumbUtil.inverseSegmentMultipliers)[e],i=Math.atan(i),Math.abs(n*Math.sin(i))*e[1]);n=Math.abs(n*Math.cos(i))*e[0];return{x:t.x+n,y:t.y+r}},perpendicularLineTo:function(t,e,n){t=jsPlumbUtil.gradient(t,e),t=Math.atan(-1/t);var i=n/2*Math.sin(t);n=n/2*Math.cos(t);return[{x:e.x+n,y:e.y+i},{x:e.x-n,y:e.y-i}]},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){return-1<(e=jsPlumbUtil.findWithFunction(t,e))&&t.splice(e,1),-1!=e},remove:function(t,e){return-1<(e=jsPlumbUtil.indexOf(t,e))&&t.splice(e,1),-1!=e},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&&(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(r){jsPlumbUtil.log("jsPlumb: fire failed for event "+i+" : "+r)}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(){function t(t,e){return _.CurrentLibrary.getAttribute(y(t),e)}function e(t,e,n){_.CurrentLibrary.setAttribute(y(t),e,n)}function n(t){return _.CurrentLibrary.getOffset(y(t))}function i(t){return _.CurrentLibrary.getSize(y(t))}function r(t){function e(t){var e=null;if(g(t)){var i=t[0],r=_.extend({component:n,_jsPlumb:n._jsPlumb},t[1]);if(3==t.length&&_.extend(r,t[2]),e=new(_.Overlays[n._jsPlumb.getRenderMode()][i])(r),r.events)for(var o in r.events)e.bind(o,r.events[o])}else e=t.constructor==String?new(_.Overlays[n._jsPlumb.getRenderMode()][t])({component:n,_jsPlumb:n._jsPlumb}):t;n.overlays.push(e)}w.apply(this,arguments);var n=this,i=(this.overlays=[],function(t){for(var e,i=n.defaultOverlayKeys||[],r=(r=t.overlays)||[],o=0;o<i.length;o++)r.unshift.apply(r,(e=i[o],n._jsPlumb.Defaults[e]||_.Defaults[e]||[]));return r}(t));if(i)for(var r=0;r<i.length;r++)e(i[r]);function o(t){for(var e=-1,i=0;i<n.overlays.length;i++)if(t===n.overlays[i].id){e=i;break}return e}function a(t){var e={cssClass:t.cssClass,labelStyle:this.labelStyle,id:u,component:n,_jsPlumb:n._jsPlumb};e=_.extend(e,t);return new(_.Overlays[n._jsPlumb.getRenderMode()].Label)(e)}this.addOverlay=function(t){e(t),n.repaint()},this.getOverlay=function(t){return 0<=(t=o(t))?n.overlays[t]:null},this.getOverlays=function(){return n.overlays},this.hideOverlay=function(t){(t=n.getOverlay(t))&&t.hide()},this.hideOverlays=function(){for(var t=0;t<n.overlays.length;t++)n.overlays[t].hide()},this.showOverlay=function(t){(t=n.getOverlay(t))&&t.show()},this.showOverlays=function(){for(var t=0;t<n.overlays.length;t++)n.overlays[t].show()},this.removeAllOverlays=function(){for(var t in n.overlays)n.overlays[t].cleanup();n.overlays.splice(0,n.overlays.length),n.repaint()},this.removeOverlay=function(t){-1!=(t=o(t))&&(n.overlays[t].cleanup(),n.overlays.splice(t,1))},this.removeOverlays=function(){for(var t=0;t<arguments.length;t++)n.removeOverlay(arguments[t])};var s,l,u="__label";t.label&&(s=t.labelLocation||n.defaultLabelLocation||.5,l=t.labelStyle||n._jsPlumb.Defaults.LabelStyle||_.Defaults.LabelStyle,this.overlays.push(a({label:t.label,location:s,labelStyle:l}))),this.setLabel=function(t){var e=n.getOverlay(u);e?t.constructor==String||t.constructor==Function?e.setLabel(t):(t.label&&e.setLabel(t.label),t.location&&e.setLocation(t.location)):(e=a(t=t.constructor==String||t.constructor==Function?{label:t}:t),this.overlays.push(e)),n.repaint()},this.getLabel=function(){var t=n.getOverlay(u);return null!=t?t.getLabel():null},this.getLabelOverlay=function(){return n.getOverlay(u)}}function o(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))}))}function a(a){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"},a&&_.extend(this.Defaults,a),this.logEnabled=this.Defaults.LogEnabled,jsPlumbUtil.EventGenerator.apply(this);var s,E=this,M=(a=C+1,C++,a),S=E.bind,D={};for(s in this.Defaults)D[s]=this.Defaults[s];function P(t,e,n){e=null!=e&&e;var i,r,o,a=_.CurrentLibrary;e&&a.isDragSupported(t)&&!a.isAlreadyDraggable(t)&&(n=n||E.Defaults.DragOptions||_.Defaults.DragOptions,n=_.extend({},n),i=a.dragEvents.drag,r=a.dragEvents.stop,n[o=a.dragEvents.start]=dt(n[o],(function(){E.setHoverSuspended(!0)})),n[i]=dt(n[i],(function(){var e=a.getUIPosition(arguments);K(t,e),e=t,_.CurrentLibrary.addClass(y(e),"jsPlumb_dragged")})),n[r]=dt(n[r],(function(){var e=a.getUIPosition(arguments);K(t,e),e=t,_.CurrentLibrary.removeClass(y(e),"jsPlumb_dragged"),E.setHoverSuspended(!1)})),o=ct(t),V[o]=!0,e=V[o],n.disabled=null!=e&&!e,a.initDraggable(t,n,!1),E.dragManager.register(t))}function j(e,n,i){n="block"===n;var r=null,o=(i&&(r=n?function(t){t.setVisible(!0,!0,!0)}:function(t){t.setVisible(!1,!0,!0)}),t(e,"id"));ot(o,(function(t){var e;n&&i?(e=t.sourceId===o?1:0,t.endpoints[e].isVisible()&&t.setVisible(!0)):t.setVisible(n)}),r)}function T(t,e){ot(t,(function(t){var e=t.isVisible();t.setVisible(!e)}),e?function(t){var e=t.isVisible();t.setVisible(!e)}:null)}function A(t,e){t.paintStyle=t.paintStyle||E.Defaults.EndpointStyles[e]||E.Defaults.EndpointStyle||_.Defaults.EndpointStyles[e]||_.Defaults.EndpointStyle,t.hoverPaintStyle=t.hoverPaintStyle||E.Defaults.EndpointHoverStyles[e]||E.Defaults.EndpointHoverStyle||_.Defaults.EndpointHoverStyles[e]||_.Defaults.EndpointHoverStyle,t.anchor=t.anchor||E.Defaults.Anchors[e]||E.Defaults.Anchor||_.Defaults.Anchors[e]||_.Defaults.Anchor,t.endpoint=t.endpoint||E.Defaults.Endpoints[e]||E.Defaults.Endpoint||_.Defaults.Endpoints[e]||_.Defaults.Endpoint}function k(t,e,n,i){var r,o="source"==t?Mt:Dt;if(m(e))o[e]=i?!o[e]:n;else if(e.length){e=X(e);for(var a=0;a<e.length;a++)_el=_.CurrentLibrary.getElementObject(e[a]),o[r=ct(_el)]=i?!o[r]:n}return E}function I(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}}this.bind=function(t,e){"ready"===t&&L?e():S.apply(E,[t,e])},E.importDefaults=function(t){for(var e in t)E.Defaults[e]=t[e]};var L=!(E.restoreDefaults=function(){E.Defaults=_.extend({},D)}),O={},N={},z={},R={},H={},F={},V={},B=[],W=this.Defaults.Scope,$=null,U=function(t,e,n){var i=t[e];return null==i&&(t[e]=i=[]),i.push(n),i},q=function(t,e){E.Defaults.Container?_.CurrentLibrary.appendElement(t,E.Defaults.Container):e?_.CurrentLibrary.appendElement(t,e):document.body.appendChild(t)},G=1,Y=function(){return""+G++},X=function(t){return t._nodes||t},Q=!1,K=function(e,n,i){if(!Q){e=t(e,"id");var r=E.dragManager.getElementsForDraggable(e);if(null==i&&(i=x()),E.anchorManager.redraw(e,n,i),r)for(var o in r)E.anchorManager.redraw(r[o].id,n,i,r[o].offset)}},J=function(e,n){var i=null;if(g(e)){i=[];for(var r=0;r<e.length;r++){var o=y(e[r]),a=t(o,"id");i.push(n(o,a))}}else i=n(o=y(e),a=t(o,"id"));return i},Z=function(t){return z[t]},tt=function(t){var e=E.Defaults.ConnectionType||E.getDefaultConnectionType(),n=E.Defaults.EndpointType||Ut,i=_.CurrentLibrary.getParent;return(n=(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=E,new e(t))).id="con_"+Y(),nt("click","click",n),nt("dblclick","dblclick",n),nt("contextmenu","contextmenu",n),n},et=function(t,e,n){e=e||{},t.suspendedEndpoint||U(O,t.scope,t),e.doNotFireConnectionEvent||!1===e.fireEvent||E.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),E.anchorManager.newConnection(t),K(t.source)},nt=function(t,e,n){n.bind(t,(function(t,i){E.fire(e,n,i)}))},it=function(t){var e;return t.container||(e=_.CurrentLibrary.getTagName(t.source),t=_.CurrentLibrary.getParent(t.source),e&&"td"===e.toLowerCase()?_.CurrentLibrary.getParent(t):t)},rt=function(t){var e=E.Defaults.EndpointType||Ut;return(e=(t.parent=it(t),t._jsPlumb=E,new e(t))).id="ep_"+Y(),nt("click","endpointClick",e),nt("dblclick","endpointDblClick",e),nt("contextmenu","contextmenu",e),e},ot=function(t,e,n){var i=N[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])}},at=function(t,e){null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t)},st=function(t,e){for(var n=0;n<t.length;n++)at(t[n])},lt=function(t){var e,r=t.timestamp,o=t.recalc,a=t.offset;t=t.elId;return!o&&r&&r===H[t]||(o||!a?null!=(e=y(t))&&(B[t]=i(e),R[t]=n(e),H[t]=r):(R[t]=a,null==B[t]&&null!=(e=y(t))&&(B[t]=i(e))),R[t]&&!R[t].right&&(R[t].right=R[t].left+B[t][0],R[t].bottom=R[t].top+B[t][1],R[t].width=B[t][0],R[t].height=B[t][1],R[t].centerx=R[t].left+R[t].width/2,R[t].centery=R[t].top+R[t].height/2)),R[t]},ut=function(t){return{o:R[t]||lt({elId:t}),s:B[t]}},ct=function(n,i,r){var o=y(n),a=t(o,"id");return a&&"undefined"!=a||(2==arguments.length&&null!=i?a=i:1!=arguments.length&&(3!=arguments.length||r)||(a="jsPlumb_"+M+"_"+Y()),e(o,"id",a)),a},dt=function(t,e,n){return t=t||function(){},e=e||function(){},function(){var i=null;try{i=e.apply(this,arguments)}catch(i){b(E,"jsPlumb function failed : "+i)}if(null==n||i!==n)try{t.apply(this,arguments)}catch(i){b(E,"wrapped function failed : "+i)}return i}},ht=(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 _.CurrentLibrary.addClass(t,e)},this.removeClass=function(t,e){return _.CurrentLibrary.removeClass(t,e)},this.hasClass=function(t,e){return _.CurrentLibrary.hasClass(t,e)},this.addEndpoint=function(t,e,n){for(var i=_.extend({},n=n||{}),r=(_.extend(i,e),i.endpoint=i.endpoint||E.Defaults.Endpoint||_.Defaults.Endpoint,i.paintStyle=i.paintStyle||E.Defaults.EndpointStyle||_.Defaults.EndpointStyle,[]),o=(t=X(t)).length&&t.constructor!=String?t:[t],a=0;a<o.length;a++){var s=y(o[a]),l=ct(s),u=(i.source=s,lt({elId:l}),rt(i)),c=(i.parentAnchor&&(u.parentAnchor=i.parentAnchor),U(N,l,u),R[l]);l=B[l],c=u.anchor.compute({xy:[c.left,c.top],wh:l,element:u});u.paint({anchorLoc:c}),r.push(u),E.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=E.addEndpoint(t,e[r],n);g(o)?Array.prototype.push.apply(i,o):i.push(o)}return i},this.animate=function(e,n,i){var r=y(e),o=t(e,"id"),a=(e=_.CurrentLibrary.dragEvents.step,_.CurrentLibrary.dragEvents.complete);(i=i||{})[e]=dt(i[e],(function(){E.repaint(o)})),i[a]=dt(i[a],(function(){E.repaint(o)})),_.CurrentLibrary.animate(r,n,i)},this.checkCondition=function(t,e){var n=E.getListener(t),i=!0;if(n&&0<n.length)try{for(var r=0;r<n.length;r++)i=i&&n[r](e)}catch(e){b(E,"cannot check condition ["+t+"]"+e)}return i},this.connect=function(t,e){if(t=function(t,e){var n=_.extend({},t);if(e&&_.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=Z(t.uuids[0]),n.targetEndpoint=Z(t.uuids[1])),n.sourceEndpoint&&n.sourceEndpoint.isFull())b(E,"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=ct(n.target),o=yt[r],a=bt[r];if(o){if(!Dt[r])return;var s=null!=a?a:E.addEndpoint(n.target,o);xt[r]&&(bt[r]=s),(n.targetEndpoint=s)._makeTargetCreator=!0}}if(n.source&&!n.source.endpoint&&!n.sourceEndpoint&&!n.newConnection&&(r=ct(n.source),o=Ct[r],a=_t[r],o)){if(!Mt[r])return;s=null!=a?a:E.addEndpoint(n.source,o),Et[r]&&(_t[r]=s),n.sourceEndpoint=s}return n}b(E,"could not add connection; target endpoint is full")}}(t,e),t)return null==t.deleteEndpointsOnDetach&&(t.deleteEndpointsOnDetach=!0),e=tt(t),et(e,t),e},this.deleteEndpoint=function(t){var e="string"==typeof t?z[t]:t;if(e){var n;t=e.getUuid();for(n in t&&(z[t]=null),e.detachAll(),st(e.endpoint.getDisplayElements()),E.anchorManager.deleteEndpoint(e),N){var i=N[n];if(i){for(var r=[],o=0;o<i.length;o++)i[o]!=e&&r.push(i[o]);N[n]=r}}E.dragManager.endpointDeleted(e)}},this.deleteEveryEndpoint=function(){for(var t in N){var e=N[t];if(e&&e.length)for(var n=0;n<e.length;n++)E.deleteEndpoint(e[n])}delete N,N={},delete z,z={}},function(t,e,n){var i=E.Defaults.ConnectionType||E.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;e&&E.fire("jsPlumbConnectionDetached",i,n),E.anchorManager.connectionDetached(i)}),pt=(this.detach=function(){var t,e,n,i,r,o;0!=arguments.length&&(n=E.Defaults.ConnectionType||E.getDefaultConnectionType(),n=arguments[0].constructor==n,e=!1!==(t=2==arguments.length&&n?arguments[1]||{}:arguments[0]).fireEvent,i=t.forceDetach,(n=n?arguments[0]:t.connection)?(i||n.isDetachAllowed(n)&&n.endpoints[0].isDetachAllowed(n)&&n.endpoints[1].isDetachAllowed(n))&&(i||E.checkCondition("beforeDetach",n))&&n.endpoints[0].detach(n,!1,!0,e):(i=_.extend({},t)).uuids?Z(i.uuids[0]).detachFrom(Z(i.uuids[1]),e):i.sourceEndpoint&&i.targetEndpoint?i.sourceEndpoint.detachFrom(i.targetEndpoint):(r=ct(i.source),o=ct(i.target),ot(r,(function(t){(t.sourceId==r&&t.targetId==o||t.targetId==r&&t.sourceId==o)&&E.checkCondition("beforeDetach",t)&&t.endpoints[0].detach(t,!1,!0,e)}))))},this.detachAllConnections=function(e,n){n=n||{};e=t(e=y(e),"id");var i=N[e];if(i&&i.length)for(var r=0;r<i.length;r++)i[r].detachAll(n.fireEvent)},this.detachEveryConnection=function(t){for(var e in t=t||{},N){var n=N[e];if(n&&n.length)for(var i=0;i<n.length;i++)n[i].detachAll(t.fireEvent)}delete O,O={}},this.draggable=function(t,e){if("object"==typeof t&&t.length)for(var n=0;n<t.length;n++)(i=y(t[n]))&&P(i,!0,e);else if(t._nodes){var i;for(n=0;n<t._nodes.length;n++)(i=y(t._nodes[n]))&&P(i,!0,e)}else(i=y(t))&&P(i,!0,e)},this.extend=function(t,e){return _.CurrentLibrary.extend(t,e)},this.getDefaultEndpointType=function(){return Ut},this.getDefaultConnectionType=function(){return Wt},function(t,e,n,i){for(var r=0;r<t.length;r++)t[r][e].apply(t[r],n);return i(t)}),ft=function(t,e,n){return function(){return pt(t,e,arguments,n)}},gt=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)}},mt=(this.getConnections=function(t,e){function n(t){var e=[];if(t)if("string"==typeof t){if("*"===t)return t;e.push(t)}else e=t;return e}function i(t,e){return"*"===t||!(0<t.length)||-1!=h(t,e)}t?t.constructor==String&&(t={scope:t}):t={};var r,o,a,s=n(t.scope||E.getDefaultScope()),l=n(t.source),u=n(t.target),c=!e&&1<s.length?{}:[];for(r in O)if(i(s,r))for(var d=0;d<O[r].length;d++){var p=O[r][d];i(l,p.sourceId)&&i(u,p.targetId)&&(o=r,a=void 0,(!e&&1<s.length?(null==(a=c[o])&&(c[o]=a=[]),a):c).push(p))}return c},function(t){return{setHover:ft(t,"setHover",mt),removeAllOverlays:ft(t,"removeAllOverlays",mt),setLabel:ft(t,"setLabel",mt),addOverlay:ft(t,"addOverlay",mt),removeOverlay:ft(t,"removeOverlay",mt),removeOverlays:ft(t,"removeOverlays",mt),showOverlay:ft(t,"showOverlay",mt),hideOverlay:ft(t,"hideOverlay",mt),showOverlays:ft(t,"showOverlays",mt),hideOverlays:ft(t,"hideOverlays",mt),setPaintStyle:ft(t,"setPaintStyle",mt),setHoverPaintStyle:ft(t,"setHoverPaintStyle",mt),setDetachable:ft(t,"setDetachable",mt),setConnector:ft(t,"setConnector",mt),setParameter:ft(t,"setParameter",mt),setParameters:ft(t,"setParameters",mt),detach:function(){for(var e=0;e<t.length;e++)E.detach(t[e])},getLabel:gt(t,"getLabel"),getOverlay:gt(t,"getOverlay"),isHover:gt(t,"isHover"),isDetachable:gt(t,"isDetachable"),getParameter:gt(t,"getParameter"),getParameters:gt(t,"getParameters"),getPaintStyle:gt(t,"getPaintStyle"),getHoverPaintStyle:gt(t,"getHoverPaintStyle"),length:t.length,each:function(e){for(var n=0;n<t.length;n++)e(t[n]);return mt(t)},get:function(e){return t[e]}}}),vt=(this.select=function(t){return(t=t||{}).scope=t.scope||"*",t=E.getConnections(t,!0),mt(t)},this.getAllConnections=function(){return O},this.getDefaultScope=function(){return W},this.getEndpoint=Z,this.getEndpoints=function(t){return N[ct(t)]},this.getId=ct,this.getOffset=function(t){return R[t],lt({elId:t})},this.getSelector=function(t){return _.CurrentLibrary.getSelector(t)},this.getSize=function(t){return B[t]||lt({elId:t}),B[t]},this.appendElement=q,!1),yt=(this.isHoverSuspended=function(){return vt},this.setHoverSuspended=function(t){vt=t},this.isCanvasAvailable=function(){return l},this.isSVGAvailable=function(){return u},this.isVMLAvailable=c,this.hide=function(t,e){j(t,"none",e)},this.idstamp=Y,this.init=function(){var t;L||(E.setRenderMode(E.Defaults.RenderMode),(t=function(t){_.CurrentLibrary.bind(document,t,(function(e){if(!E.currentlyDragging&&$==_.CANVAS){for(var n in O)for(var i=O[n],r=0;r<i.length;r++)if(i[r].connector[t](e))return;for(var o in N){var a=N[o];for(r=0;r<a.length;r++)if(a[r].endpoint[t](e))return}}}))})("click"),t("dblclick"),t("mousemove"),t("mousedown"),t("mouseup"),t("contextmenu"),L=!0,E.fire("ready"))},this.log=null,this.jsPlumbUIComponent=w,this.makeAnchor=function(){var t,e,n,i,r;return 0==arguments.length?null:(e=arguments[1],i=null,(t=arguments[0]).compute&&t.getOrientation?t:("string"==typeof t?i=_.Anchors[arguments[0]]({elementId:e,jsPlumbInstance:E}):g(t)&&(g(t[0])||m(t[0])?i=2==t.length&&m(t[0])&&v(t[1])?(n=_.extend({elementId:e,jsPlumbInstance:E},t[1]),_.Anchors[t[0]](n)):new kt(t,null,e):(r={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:e},(i=new Tt(r)).clone=function(){return new Tt(r)})),i.id||(i.id="anchor_"+Y()),i))},this.makeAnchors=function(t,e,n){for(var i=[],r=0;r<t.length;r++)"string"==typeof t[r]?i.push(_.Anchors[t[r]]({elementId:e,jsPlumbInstance:n})):g(t[r])&&i.push(E.makeAnchor(t[r],e,n));return i},this.makeDynamicAnchor=function(t,e){return new kt(t,e)},{}),bt={},xt={},wt={},Ct=(this.makeTarget=function(e,n,i){for(var r=_.extend({_jsPlumb:E},i),o=(_.extend(r,n),A(r,1),_.CurrentLibrary),a=r.scope||E.Defaults.Scope,s=!(!1===r.deleteEndpointsOnDetach),l=r.maxConnections||-1,u=(e=X(e)).length&&e.constructor!=String?e:[e],c=0;c<u.length;c++)!function(e){var n=ct(e),i=(yt[n]=r,xt[n]=r.uniqueEndpoint,wt[n]=l,Dt[n]=!0,proxyComponent=new w(r),_.extend({},r.dropOptions||{})),u=o.dragEvents.drop;i.scope=i.scope||a,i[u]=dt(i[u],(function(){var i=_.CurrentLibrary.getDropEvent(arguments),a=E.select({target:n}).length;if(!Dt[n]||0<wt[n]&&a>=wt[n])return console.log("target element "+n+" is full."),!1;E.currentlyDragging=!1;var l,u,c,d=t(a=y(o.getDragObject(arguments)),"dragId"),h=t(a,"originalScope"),p=(d=F[d]).endpoints[0];r.endpoint&&_.extend({},r.endpoint),p.anchor.locked=!1,h&&o.setDragScope(a,h),a=proxyComponent.isDropAllowed(d.sourceId,ct(e),d.scope,d,null);d.endpointsToDeleteOnDetach&&(p===d.endpointsToDeleteOnDetach[0]?d.endpointsToDeleteOnDetach[0]=null:p===d.endpointsToDeleteOnDetach[1]&&(d.endpointsToDeleteOnDetach[1]=null)),d.suspendedEndpoint&&(d.targetId=d.suspendedEndpoint.elementId,d.target=o.getElementObject(d.suspendedEndpoint.elementId),d.endpoints[1]=d.suspendedEndpoint),a?(p.detach(d,!1,!0,!1),a=bt[n]||E.addEndpoint(e,r),r.uniqueEndpoint&&(bt[n]=a),a._makeTargetCreator=!0,null!=a.anchor.positionFinder&&(u=o.getUIPosition(arguments),c=o.getOffset(e),l=o.getSize(e),u=a.anchor.positionFinder(u,c,l,a.anchor.constructorParams),a.anchor.x=u[0],a.anchor.y=u[1]),c=E.connect({source:p,target:a,scope:h,previousConnection:d,container:d.parent,deleteEndpointsOnDetach:s,doNotFireConnectionEvent:p.endpointWillMoveAfterConnection}),d.endpoints[1]._makeTargetCreator&&d.endpoints[1].connections.length<2&&E.deleteEndpoint(d.endpoints[1]),s&&(c.endpointsToDeleteOnDetach=[p,a]),c.repaint()):d.suspendedEndpoint&&(p.isReattach?(d.setHover(!1),d.floatingAnchorIndex=null,d.suspendedEndpoint.addConnection(d),E.repaint(p.elementId)):p.detach(d,!1,!0,!0,i))})),o.initDroppable(e,i,!0)}(y(u[c]));return E},this.unmakeTarget=function(t,e){return t=_.CurrentLibrary.getElementObject(t),t=ct(t),e||(delete yt[t],delete xt[t],delete wt[t],delete Dt[t]),E},this.makeTargets=function(t,e,n){for(var i=0;i<t.length;i++)E.makeTarget(t[i],e,n)},{}),_t={},Et={},Mt={},St={},Dt={},Pt=(this.makeSource=function(t,e,n){function i(t){function n(n){if(Mt[a]){if(e.filter&&!1===e.filter(o.getOriginalEvent(n),t))return;function s(){f&&E.deleteEndpoint(h)}var l=lt({elId:i}),c=((n.pageX||n.page.x)-l.left)/l.width,d=((n.pageY||n.page.y)-l.top)/l.height,p=c,g=d,m=(r.parent&&(m=o.getElementObject(r.parent),m=ct(m),l=lt({elId:m}),p=((n.pageX||n.page.x)-l.left)/l.width,g=((n.pageY||n.page.y)-l.top)/l.height),{});_.extend(m,r),m.isSource=!0,m.anchor=[c,d,0,0],m.parentAnchor=[p,g,0,0],m.dragOptions=u,r.parent&&(l=m.container||E.Defaults.Container||_.Defaults.Container,m.container=l||_.CurrentLibrary.getParent(r.parent)),h=E.addEndpoint(i,m),f=!0,h.endpointWillMoveAfterConnection=null!=r.parent,h.endpointWillMoveTo=r.parent?o.getElementObject(r.parent):null,E.registerListener(h.canvas,"mouseup",s),E.registerListener(t,"mouseup",s),o.trigger(h.canvas,"mousedown",n)}}var i=ct(t),a=null!=(s=r.parent)?E.getId(o.getElementObject(s)):i,s=(Ct[a]=r,Et[a]=r.uniqueEndpoint,Mt[a]=!0,o.dragEvents.stop),l=o.dragEvents.drag,u=_.extend({},r.dragOptions||{}),c=u.drag,d=u.stop,h=null,f=!1;u.scope=u.scope||r.scope,u[l]=dt(u[l],(function(){c&&c.apply(this,arguments),f=!1})),u[s]=dt(u[s],(function(){var t,e,n,a;d&&d.apply(this,arguments),E.currentlyDragging=!1,0==h.connections.length?E.deleteEndpoint(h):(o.unbind(h.canvas,"mousedown"),e=r.anchor||E.Defaults.Anchor,h.anchor,t=h.connections[0],h.anchor=E.makeAnchor(e,i,E),r.parent&&(e=o.getElementObject(r.parent))&&(n=h.elementId,a=r.container||E.Defaults.Container||_.Defaults.Container,h.setElement(e,a),h.endpointWillMoveAfterConnection=!1,E.anchorManager.rehomeEndpoint(n,e),t.previousConnection=null,p(O[t.scope],(function(e){return e.id===t.id})),E.anchorManager.connectionDetached({sourceId:t.sourceId,targetId:t.targetId,connection:t}),et(t)),h.repaint(),E.repaint(h.elementId),E.repaint(t.targetId))})),E.registerListener(t,"mousedown",n),St[i]=n}for(var r=_.extend({},n),o=(_.extend(r,e),A(r,0),_.CurrentLibrary),a=(t=X(t)).length&&t.constructor!=String?t:[t],s=0;s<a.length;s++)i(y(a[s]));return E},this.unmakeSource=function(t,e){t=_.CurrentLibrary.getElementObject(t);t=ct(t);var n=St[t];return n&&E.unregisterListener(_el,"mousedown",n),e||(delete Ct[t],delete Et[t],delete Mt[t],delete St[t]),E},this.unmakeEverySource=function(){for(var t in Mt)E.unmakeSource(t,!0);Ct={},Et={},Mt={},St={}},this.unmakeEveryTarget=function(){for(var t in Dt)E.unmakeTarget(t,!0);return yt={},xt={},wt={},Dt={},E},this.makeSources=function(t,e,n){for(var i=0;i<t.length;i++)E.makeSource(t[i],e,n);return E},this.setSourceEnabled=function(t,e){return k("source",t,e)},this.toggleSourceEnabled=function(t){return k("source",t,null,!0),E.isSourceEnabled(t)},this.isSource=function(t){return t=_.CurrentLibrary.getElementObject(t),null!=Mt[ct(t)]},this.isSourceEnabled=function(t){return t=_.CurrentLibrary.getElementObject(t),!0===Mt[ct(t)]},this.setTargetEnabled=function(t,e){return k("target",t,e)},this.toggleTargetEnabled=function(t){return k("target",t,null,!0)},this.isTarget=function(t){return t=_.CurrentLibrary.getElementObject(t),null!=Dt[ct(t)]},this.isTargetEnabled=function(t){return t=_.CurrentLibrary.getElementObject(t),!0===Dt[ct(t)]},this.ready=function(t){E.bind("ready",t)},this.repaint=function(t){function e(t){K(y(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 N)K(y(t),null,null)},this.removeAllEndpoints=function(e){e=t(e,"id");var n=N[e];if(n)for(var i=0;i<n.length;i++)E.deleteEndpoint(n[i]);N[e]=[]},this.removeEveryEndpoint=this.deleteEveryEndpoint,this.removeEndpoint=function(t,e){E.deleteEndpoint(e)},{}),jt=(this.registerListener=function(t,e,n){_.CurrentLibrary.bind(t,e,n),U(Pt,e,{el:t,event:e,listener:n})},this.unregisterListener=function(t,e,n){_.CurrentLibrary.unbind(t,e,n),p(Pt,(function(t){return t.type==e&&t.listener==n}))},this.reset=function(){for(var t in E.deleteEveryEndpoint(),E.unbind(),yt={},bt={},xt={},wt={},Ct={},_t={},Et={},Pt)for(var e=0;e<Pt[t].length;e++){var n=Pt[t][e];_.CurrentLibrary.unbind(n.el,n.event,n.listener)}Pt={},E.anchorManager.reset(),E.dragManager.reset()},this.setDefaultScope=function(t){W=t},this.setDraggable=function(t,e){return J(t,(function(t,n){V[n]=e,_.CurrentLibrary.isDragSupported(t)&&_.CurrentLibrary.setDraggable(t,e)}))},this.setId=function(t,e,n){var i=t.constructor==String?t:E.getId(t),r=E.getConnections({source:i,scope:"*"},!0),o=E.getConnections({target:i,scope:"*"},!0);e=""+e,n||(t=_.CurrentLibrary.getElementObject(i),_.CurrentLibrary.setAttribute(t,"id",e)),t=_.CurrentLibrary.getElementObject(e),N[e]=N[i]||[];for(var a=0;a<N[e].length;a++)N[e][a].elementId=e,N[e][a].element=t,N[e][a].anchor.elementId=e;function s(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}delete N[i],E.anchorManager.changeId(i,e),s(r,0,"source"),s(o,1,"target")},this.setIdChanged=function(t,e){E.setId(t,e,!0)},this.setDebugLog=function(t){},this.setRepaintFunction=function(t){},this.setSuspendDrawing=function(t,e){Q=t,e&&E.repaintEverything()},this.CANVAS="canvas",this.SVG="svg",this.VML="vml",this.setRenderMode=function(t){if(t){if((t=t.toLowerCase())!==_.CANVAS&&t!==_.SVG&&t!==_.VML)throw new Error("render mode must be one of jsPlumb.CANVAS, jsPlumb.SVG or jsPlumb.VML");return t===_.SVG?u?$=_.SVG:l?$=_.CANVAS:c()&&($=_.VML):t===_.CANVAS&&l?$=_.CANVAS:c()&&($=_.VML),$}},this.getRenderMode=function(){return $},this.show=function(t,e){j(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:N,endpointCount:function(t){return(t=N[t])?t.length:0},connectionCount:function(t){return(t=O[t=t||W])?t.length:0},getId:ct,makeAnchor:self.makeAnchor,makeDynamicAnchor:self.makeDynamicAnchor}},this.toggle=T,this.toggleVisible=T,this.toggleDraggable=function(t){return J(t,(function(t,e){var n=null!=V[e]&&V[e];return V[e]=n=!n,_.CurrentLibrary.setDraggable(t,n),n}))},this.unload=function(){},this.wrap=dt,this.addListener=this.bind,function(t,e){var i=null,r=t;return"svg"===e.tagName.toLowerCase()&&e.parentNode?i=e.parentNode:e.offsetParent&&(i=e.offsetParent),null!=i&&(e="body"===i.tagName.toLowerCase()?{left:0,top:0}:n(i),i="body"===i.tagName.toLowerCase()?{left:0,top:0}:{left:i.scrollLeft,top:i.scrollTop},r[0]=t[0]-e.left+i.left,r[1]=t[1]-e.top+i.top),r}),Tt=function(t){var e=this,n=(this.x=t.x||0,this.y=t.y||0,this.elementId=t.elementId,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;return(t=t.timestamp)&&t===e.timestamp||(i=[n[0]+e.x*r[0]+e.offsets[0],n[1]+e.y*r[1]+e.offsets[1]],i=jt(i,o.canvas),e.timestamp=t),i},this.getOrientation=function(t){return n},this.equals=function(t){var e,n;return!!t&&(e=t.getOrientation(),n=this.getOrientation(),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}},At=function(t){var e=t.reference,n=(t=t.referenceCanvas,i(y(t))),r=null,o=null;this.x=0,this.y=0,this.isFloating=!0,this.compute=function(t){var e=t.xy;t=t.element,e=[e[0]+n[0]/2,e[1]+n[1]/2],e=jt(e,t.canvas);return o=e},this.getOrientation=function(t){return r||(t=e.getOrientation(t),[0*Math.abs(t[0])*-1,0*Math.abs(t[1])*-1])},this.over=function(t){r=t.getOrientation()},this.out=function(){r=null},this.getCurrentLocation=function(){return o}},kt=function(t,e,n){function i(t){return t.constructor==Tt?t:E.makeAnchor(t,n,E)}this.isSelective=!0,this.isDynamic=!0;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 a=0<r.length?r[0]:null,s=this,l=e||function(t,e,n,i,r){for(var o,a,s,l=n[0]+i[0]/2,u=n[1]+i[1]/2,c=-1,d=1/0,h=0;h<r.length;h++){p=r[h],o=u,void 0,s=t[0]+p.x*e[0],a=t[1]+p.y*e[1];var p=Math.sqrt(Math.pow(l-s,2)+Math.pow(o-a,2));p<d&&(c=h+0,d=p)}return r[c]};this.compute=function(t){var e=t.xy,n=t.wh,i=(t.timestamp,t.txy),o=t.twh;return s.locked||null==i||null==o||(t.timestamp=null,a=l(e,n,i,o,r),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()}},It={},Lt={},Ot={},Nt="horizontal",zt="vertical",Rt="diagonal",Ht="identity",Ft=function(t,e,n,i){var r,o;return t===e?{orientation:Ht,a:["top","top"]}:(t=Math.atan2(i.centery-n.centery,i.centerx-n.centerx),e=Math.atan2(n.centery-i.centery,n.centerx-i.centerx),r=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,o=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,r||o?r?{orientation:Nt,a:n.top<i.top?["bottom","top"]:["top","bottom"],theta:t,theta2:e}:{orientation:zt,a:n.left<i.left?["right","left"]:["left","right"],theta:t,theta2:e}:(o=null,i.left>n.left&&i.top>n.top?o=["right","top"]:i.left>n.left&&n.top>i.top?o=["top","left"]:i.left<n.left&&i.top<n.top?o=["top","right"]:i.left<n.left&&i.top>n.top&&(o=["left","top"]),{orientation:Rt,a:o,theta:t,theta2:e}))},Vt={top:function(t,e){return t[0]>e[0]?1:-1},right:I(!0),bottom:I(!0),left:function(t,e){var n=t[0][0]<0?-Math.PI-t[0][0]:Math.PI-t[0][0];return(e[0][0]<0?-Math.PI-e[0][0]:Math.PI-e[0][0])<n||t[0][1]>e[0][1]?1:-1}},Bt=function(t,e){function n(e,n,i,r,o,a,s){if(0<r.length){function l(t,e){var n=jt([e[0],e[1]],t.canvas);Lt[t.id]=[n[0],n[1],e[2],e[3]],Ot[t.id]=s}r=function(t,e){return t.sort(e)}(r,Vt[e]);for(var 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],h=(a&&(c=e[r?0:1]-c),r?c:d),p=n[0]+h;h/=e[0],d=r?d:c,c=n[1]+d,d/=e[1],s.push([p,c,h,d,i[u][1],i[u][2]])}return s}(0,n,i,r,o,a,"right"===e||"top"===e),c=0;c<u.length;c++){var d=u[c][4],h=d.endpoints[0].elementId===t,p=d.endpoints[1].elementId===t;h?l(d.endpoints[0],u[c]):p&&l(d.endpoints[1],u[c])}}}var i=B[t],r=R[t];n("bottom",i,[r.left,r.top],e.bottom,!0,1,[0,1]),n("top",i,[r.left,r.top],e.top,!0,0,[0,-1]),n("left",i,[r.left,r.top],e.left,!1,0,[-1,0]),n("right",i,[r.left,r.top],e.right,!1,1,[1,0])},Wt=(E.anchorManager=new function(){function t(t,e,n,i,r,o,a,s,l,u,c,h){var p=-1,g=i.endpoints[a],m=g.id,v=(e=[[e,n],i,r,o,m],t[l]),y=g._continuousAnchorEdge?t[g._continuousAnchorEdge]:null;if(y&&(n=d(y,(function(t){return t[4]==m})),-1!=n)){y.splice(n,1);for(var b=0;b<y.length;b++)f(c,y[b][1],(function(t){return t.id==y[b][1].id})),f(h,y[b][1].endpoints[a],(function(t){return t.id==y[b][1].endpoints[a].id}))}for(b=0;b<v.length;b++)1==a&&v[b][3]===o&&-1==p&&(p=b),f(c,v[b][1],(function(t){return t.id==v[b][1].id})),f(h,v[b][1].endpoints[a],(function(t){return t.id==v[b][1].endpoints[a].id}));i=s?-1!=p?p:0:v.length,v.splice(i,0,e),g._continuousAnchorEdge=l}var e={},n={},i=this,r={};this.reset=function(){e={},n={},r={}},this.newConnection=function(t){function e(t,e,s,l,u){i==r&&s.isContinuous&&(_.CurrentLibrary.removeElement(o[1].canvas),a=!1),U(n,l,[u,e,s.constructor==kt])}var i=t.sourceId,r=t.targetId,o=t.endpoints,a=!0;e(0,o[0],o[0].anchor,r,t),a&&e(0,o[1],o[1].anchor,i,t)},this.connectionDetached=function(t){function e(t,e,i,r,o){i.constructor!=At&&p(n[r],(function(t){return t[0].id==o.id}))}function o(t,e){var n;t&&(p(t.top,n=function(t){return t[4]==e}),p(t.left,n),p(t.bottom,n),p(t.right,n))}var a=(t=t.connection||t).sourceId,s=t.targetId,l=(a=(e(0,(l=t.endpoints)[1],l[1].anchor,a,t),e(0,l[0],l[0].anchor,s,t),t.sourceId),t.targetId);s=t.endpoints[0].id,t=t.endpoints[1].id;o(r[a],s),o(r[l],t),i.redraw(a),i.redraw(l)},this.add=function(t,n){U(e,n,t)},this.changeId=function(t,i){n[i]=n[t],e[i]=e[t],delete n[t],delete e[t]},this.getConnectionsFor=function(t){return n[t]||[]},this.getEndpointsFor=function(t){return e[t]||[]},this.deleteEndpoint=function(t){p(e[t.elementId],(function(e){return e.id==t.id}))},this.clearFor=function(t){delete e[t],e[t]=[]},this.redraw=function(i,o,a,s){for(var l=e[i]||[],u=n[i]||[],c=[],d=[],h=[],p=(a=a||x(),s=s||{left:0,top:0},o=o&&{left:o.left+s.left,top:o.top+s.top},lt({elId:i,offset:o,recalc:!1,timestamp:a}),R[i]),g=B[i],m={},v=0;v<u.length;v++){var y,b,w,C,_,E=u[v][0],M=E.sourceId,S=E.targetId,D=E.endpoints[0].anchor.isContinuous,P=E.endpoints[1].anchor.isContinuous;(D||P)&&(b=m[y=M+"_"+S],w=E.sourceId==i?1:0,D&&!r[M]&&(r[M]={top:[],right:[],bottom:[],left:[]}),P&&!r[S]&&(r[S]={top:[],right:[],bottom:[],left:[]}),i!=S&&lt({elId:S,timestamp:a}),i!=M&&lt({elId:M,timestamp:a}),C=ut(S),_=ut(M),S==M&&(D||P)?t(r[M],-Math.PI/2,0,E,!1,S,0,!1,"top",0,c,d):(b||(b=Ft(M,S,_.o,C.o),m[y]=b),D&&t(r[M],b.theta,0,E,!1,S,0,!1,b.a[0],0,c,d),P&&t(r[S],b.theta2,-1,E,!0,M,1,!0,b.a[1],0,c,d)),D&&f(h,M,(function(t){return t===M})),P&&f(h,S,(function(t){return t===S})),f(c,E,(function(t){return t.id==E.id})),D&&0==w||P&&1==w)&&f(d,E.endpoints[w],(function(t){return t.id==E.endpoints[w].id}))}for(v=0;v<h.length;v++)Bt(h[v],r[h[v]]);for(v=0;v<l.length;v++)l[v].paint({timestamp:a,offset:p,dimensions:g});for(v=0;v<d.length;v++)d[v].paint({timestamp:a,offset:p,dimensions:g});for(v=0;v<u.length;v++){var j=u[v][1];if(j.anchor.constructor==kt){j.paint({elementWithPrecedence:i}),f(c,u[v][0],(function(t){return t.id==u[v][0].id}));for(var T=0;T<j.connections.length;T++)j.connections[T]!==u[v][0]&&f(c,j.connections[T],(function(t){return t.id==j.connections[T].id}))}else j.anchor.constructor==Tt&&f(c,u[v][0],(function(t){return t.id==u[v][0].id}))}for((s=F[i])&&s.paint({timestamp:a,recalc:!1,elId:i}),v=0;v<c.length;v++)c[v].paint({elId:i,timestamp:a,recalc:!1})},this.rehomeEndpoint=function(t,n){for(var r=e[t]||[],o=E.getId(n),a=0;a<r.length;a++)i.add(r[a],o);r.splice(0,r.length)}},E.continuousAnchorFactory={get:function(t){var e=It[t.elementId];return e||(It[t.elementId]=e={type:"Continuous",compute:function(t){return Lt[t.element.id]||[0,0]},getCurrentLocation:function(t){return Lt[t.id]||[0,0]},getOrientation:function(t){return Ot[t.id]||[0,0]},isDynamic:!0,isContinuous:!0}),e}},E.dragManager=new function(){var t={},e=[],n={},i={};this.register=function(r){for(var o,a,s=_.CurrentLibrary,l=(r=s.getElementObject(r),E.getId(r)),u=s.getDOMElement(r),c=(t[l]||(t[l]=r,e.push(r),n[l]={}),u),d=(r=s.getElementObject(c),s.getOffset(r)),h=0;h<c.childNodes.length;h++)3!=c.childNodes[h].nodeType&&(a=s.getElementObject(c.childNodes[h]),o=E.getId(a,null,!0))&&i[o]&&0<i[o]&&(a=s.getOffset(a),n[l][o]={id:o,offset:{left:a.left-d.left,top:a.top-d.top}})},this.endpointAdded=function(e){var r=_.CurrentLibrary,o=document.body,a=E.getId(e),s=r.getDOMElement(e).parentNode;for(i[a]=i[a]?i[a]+1:1;s!=o;){var l=E.getId(s);if(t[l]){var u,c=r.getElementObject(s);c=r.getOffset(c);null==n[l][a]&&(u=_.CurrentLibrary.getOffset(e),n[l][a]={id:a,offset:{left:u.left-c.left,top:u.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={}}},function(e){function n(t,e,n,r,o,a,s){var l,c;if(!t)return n.endpoints||(n.endpoints=[null,null]),l=n.endpoints[e]||n.endpoint||E.Defaults.Endpoints[e]||_.Defaults.Endpoints[e]||E.Defaults.Endpoint||_.Defaults.Endpoint,n.endpointStyles||(n.endpointStyles=[null,null]),n.endpointHoverStyles||(n.endpointHoverStyles=[null,null]),null==(c=n.endpointStyles[e]||n.endpointStyle||E.Defaults.EndpointStyles[e]||_.Defaults.EndpointStyles[e]||E.Defaults.EndpointStyle||_.Defaults.EndpointStyle).fillStyle&&null!=a&&(c.fillStyle=a.strokeStyle),null==c.outlineColor&&null!=a&&(c.outlineColor=a.outlineColor),null==c.outlineWidth&&null!=a&&(c.outlineWidth=a.outlineWidth),a=n.endpointHoverStyles[e]||n.endpointHoverStyle||E.Defaults.EndpointHoverStyles[e]||_.Defaults.EndpointHoverStyles[e]||E.Defaults.EndpointHoverStyle||_.Defaults.EndpointHoverStyle,null!=s&&null==(a=null==a?{}:a).fillStyle&&(a.fillStyle=s.strokeStyle),s=n.anchors?n.anchors[e]:n.anchor||u(E.Defaults.Anchors[e],o)||u(_.Defaults.Anchors[e],o)||u(E.Defaults.Anchor,o)||u(_.Defaults.Anchor,o),o=n.uuids?n.uuids[e]:null,c=rt({paintStyle:c,hoverPaintStyle:a,endpoint:l,connections:[i],uuid:o,anchor:s,source:r,scope:n.scope,container:n.container,reattach:n.reattach,detachable:n.detachable}),i.endpoints[e]=c,!1===n.drawEndpoints&&c.setVisible(!1,!0,!0),c;(i.endpoints[e]=t).addConnection(i)}var i=this,a=!0,s=(i.idPrefix="_jsplumb_c_",i.defaultLabelLocation=.5,i.defaultOverlayKeys=["Overlays","ConnectionOverlays"],this.parent=e.parent,r.apply(this,arguments),this.isVisible=function(){return a},this.setVisible=function(t){i[(a=t)?"showOverlays":"hideOverlays"](),i.connector&&i.connector.canvas&&(i.connector.canvas.style.display=t?"block":"none")},this.source=y(e.source),this.target=y(e.target),e.sourceEndpoint&&(this.source=e.sourceEndpoint.endpointWillMoveTo||e.sourceEndpoint.getElement()),e.targetEndpoint&&(this.target=e.targetEndpoint.getElement()),i.previousConnection=e.previousConnection,e.cost),l=(i.getCost=function(){return s},!(i.setCost=function(t){s=t})!==e.bidirectional),u=(i.isBidirectional=function(){return l},this.sourceId=t(this.source,"id"),this.targetId=t(this.target,"id"),this.getAttachedElements=function(){return i.endpoints},this.scope=e.scope,this.endpoints=[],this.endpointStyles=[],function(t,e){if(t)return E.makeAnchor(t,e,E)});function c(t){i.setHover(t,!1)}(h=n(e.sourceEndpoint,0,e,i.source,i.sourceId,e.paintStyle,e.hoverPaintStyle))&&U(N,this.sourceId,h);var d=((f=n(i.sourceId==i.targetId&&null==e.targetEndpoint?h:e.targetEndpoint,1,e,i.target,i.targetId,e.paintStyle,e.hoverPaintStyle))&&U(N,this.targetId,f),this.scope||(this.scope=this.endpoints[0].scope),e.deleteEndpointsOnDetach&&(i.endpointsToDeleteOnDetach=[h,f]),E.Defaults.ConnectionsDetachable),h=(!1===e.detachable&&(d=!1),!1===i.endpoints[0].connectionsDetachable&&(d=!1),!1===i.endpoints[1].connectionsDetachable&&(d=!1),null==s&&(s=i.endpoints[0].getConnectionCost()),null==e.bidirectional&&(l=i.endpoints[0].areConnectionsBidirectional()),this.isDetachable=function(){return!0===d},this.setDetachable=function(t){d=!0===t},_.extend({},this.endpoints[0].getParameters())),p=(_.extend(h,this.endpoints[1].getParameters()),_.extend(h,i.getParameters()),i.setParameters(h),i.setHover),f=(i.setHover=function(t){i.connector.setHover.apply(i.connector,arguments),p.apply(i,arguments)},this.setConnector=function(t,n){null!=i.connector&&st(i.connector.getDisplayElements(),i.parent);var r={_jsPlumb:i._jsPlumb,parent:e.parent,cssClass:e.cssClass,container:e.container,tooltip:i.tooltip};m(t)?this.connector=new _.Connectors[$][t](r):g(t)&&(this.connector=new _.Connectors[$][t[0]](_.extend(t[1],r))),i.canvas=i.connector.canvas,o(i.connector,i,c),n||i.repaint()},i.setConnector(this.endpoints[0].connector||this.endpoints[1].connector||e.connector||E.Defaults.Connector||_.Defaults.Connector,!0),this.setPaintStyle(this.endpoints[0].connectorStyle||this.endpoints[1].connectorStyle||e.paintStyle||E.Defaults.PaintStyle||_.Defaults.PaintStyle,!0),this.setHoverPaintStyle(this.endpoints[0].connectorHoverStyle||this.endpoints[1].connectorHoverStyle||e.hoverPaintStyle||E.Defaults.HoverPaintStyle||_.Defaults.HoverPaintStyle,!0),this.paintStyleInUse=this.getPaintStyle(),this.moveParent=function(t){var e=_.CurrentLibrary,n=e.getParent(i.connector.canvas);i.connector.bgCanvas&&(e.removeElement(i.connector.bgCanvas,n),e.appendElement(i.connector.bgCanvas,t)),e.removeElement(i.connector.canvas,n),e.appendElement(i.connector.canvas,t);for(var r=0;r<i.overlays.length;r++)i.overlays[r].isAppendedAtTopLevel&&(e.removeElement(i.overlays[r].canvas,n),e.appendElement(i.overlays[r].canvas,t),i.overlays[r].reattachListeners)&&i.overlays[r].reattachListeners(i.connector);i.connector.reattachListeners&&i.connector.reattachListeners()},lt({elId:this.sourceId}),lt({elId:this.targetId}),R[this.sourceId]),v=(h=B[this.sourceId],R[this.targetId]),b=B[this.targetId],w=x(),C=this.endpoints[0].anchor.compute({xy:[f.left,f.top],wh:h,element:this.endpoints[0],elementId:this.endpoints[0].elementId,txy:[v.left,v.top],twh:b,tElement:this.endpoints[1],timestamp:w});this.endpoints[0].paint({anchorLoc:C,timestamp:w}),C=this.endpoints[1].anchor.compute({xy:[v.left,v.top],wh:b,element:this.endpoints[1],elementId:this.endpoints[1].elementId,txy:[f.left,f.top],twh:h,tElement:this.endpoints[0],timestamp:w}),this.endpoints[1].paint({anchorLoc:C,timestamp:w}),this.paint=function(t){for(var e=(t=t||{}).elId,n=t.ui,r=t.recalc,o=(t=t.timestamp,this.targetId),a=(e=(this.sourceId,lt({elId:e,offset:n,recalc:r,timestamp:t})),n=lt({elId:o,timestamp:t}),r=this.endpoints[0],o=this.endpoints[1],t=r.anchor.getCurrentLocation(r),r=o.anchor.getCurrentLocation(o),0),s=0;s<i.overlays.length;s++)(u=i.overlays[s]).isVisible()&&(a=Math.max(a,u.computeMaxSize(i.connector)));var l=this.connector.compute(t,r,this.endpoints[0],this.endpoints[1],this.endpoints[0].anchor,this.endpoints[1].anchor,i.paintStyleInUse.lineWidth,a,e,n);i.connector.paint(l,i.paintStyleInUse);var u;for(s=0;s<i.overlays.length;s++)(u=i.overlays[s]).isVisible&&(i.overlayPlacements[s]=u.draw(i.connector,i.paintStyleInUse,l))},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=!1;return{drag:function(){if(e)return!(e=!1);var n=_.CurrentLibrary.getUIPosition(arguments),i=t.element;i&&(_.CurrentLibrary.setOffset(i,n),K(y(i),n))},stopDrag:function(){e=!0}}},Ut=function(n){var i,a,s,l,u,c,h,f,v,b,x,w,C=this,M=(C.idPrefix="_jsplumb_e_",C.defaultLabelLocation=[.5,.5],C.defaultOverlayKeys=["Overlays","EndpointOverlays"],this.parent=n.parent,r.apply(this,arguments),!0),S=!(!1===(n=n||{}).enabled),D=(this.isVisible=function(){return M},this.setVisible=function(t,e,n){if(M=t,C.canvas&&(C.canvas.style.display=t?"block":"none"),C[t?"showOverlays":"hideOverlays"](),!e)for(var i,r=0;r<C.connections.length;r++)C.connections[r].setVisible(t),n||(i=C===C.connections[r].endpoints[0]?1:0,1==C.connections[r].endpoints[i].connections.length&&C.connections[r].endpoints[i].setVisible(t,!0,!0))},this.isEnabled=function(){return S},this.setEnabled=function(t){S=t},n.source),P=n.uuid,j=null,T=null,A=(P&&(z[P]=C),t(D,"id")),k=(this.elementId=A,this.element=D,n.connectionCost),I=(this.getConnectionCost=function(){return k},!(this.setConnectionCost=function(t){k=t})!==n.connectionsBidirectional),L=(this.areConnectionsBidirectional=function(){return I},this.setConnectionsBidirectional=function(t){I=t},C.anchor=n.anchor?E.makeAnchor(n.anchor,A,E):n.anchors?E.makeAnchor(n.anchors,A,E):E.makeAnchor("TopCenter",A,E),n._transient||E.anchorManager.add(C,A),null),H=(this.setEndpoint=function(t){var e={_jsPlumb:C._jsPlumb,parent:n.parent,container:n.container,tooltip:n.tooltip,connectorTooltip:n.connectorTooltip,endpoint:C},i=(L=m(t)?new _.Endpoints[$][t](e):g(t)?(e=_.extend(t[1],e),new _.Endpoints[$][t[0]](e)):t.clone(),_.extend({},e));L.clone=function(){var t=new Object;return L.constructor.apply(t,[i]),t},C.endpoint=L,C.type=C.endpoint.type},this.setEndpoint(n.endpoint||E.Defaults.Endpoint||_.Defaults.Endpoint||"Dot"),C.setHover),V=(C.setHover=function(){C.endpoint.setHover.apply(C.endpoint,arguments),H.apply(C,arguments)},o(C.endpoint,C,(function(t){0<C.connections.length?C.connections[0].setHover(t,!1):C.setHover(t)})),this.setPaintStyle(n.paintStyle||n.style||E.Defaults.EndpointStyle||_.Defaults.EndpointStyle,!0),this.setHoverPaintStyle(n.hoverPaintStyle||E.Defaults.EndpointHoverStyle||_.Defaults.EndpointHoverStyle,!0),this.paintStyleInUse=this.getPaintStyle(),this.getPaintStyle()),G=(this.connectorStyle=n.connectorStyle,this.connectorHoverStyle=n.connectorHoverStyle,this.connectorOverlays=n.connectorOverlays,this.connector=n.connector,this.connectorTooltip=n.connectorTooltip,this.isSource=n.isSource||!1,this.isTarget=n.isTarget||!1,n.maxConnections||E.Defaults.MaxConnections),Y=(this.getAttachedElements=function(){return C.connections},this.canvas=this.endpoint.canvas,this.connections=n.connections||[],this.scope=n.scope||W,this.timestamp=null,C.isReattach=n.reattach||!1,C.connectionsDetachable=E.Defaults.ConnectionsDetachable,!1!==n.connectionsDetachable&&!1!==n.detachable||(C.connectionsDetachable=!1),n.dragAllowedWhenFull||!0),X=(this.computeAnchor=function(t){return C.anchor.compute(t)},this.addConnection=function(t){C.connections.push(t)},this.detach=function(t,e,n,i,r){var o=d(C.connections,(function(e){return e.id==t.id})),a=!1;if(i=!1!==i,0<=o&&(n||t._forceDetach||t.isDetachable()||t.isDetachAllowed(t))){var s=t.endpoints[0]==C?t.endpoints[1]:t.endpoints[0];if(n||t._forceDetach||C.isDetachAllowed(t)){if(C.connections.splice(o,1),!e&&(s.detach(t,!0,n),t.endpointsToDeleteOnDetach))for(var l=0;l<t.endpointsToDeleteOnDetach.length;l++){var u=t.endpointsToDeleteOnDetach[l];u&&0==u.connections.length&&E.deleteEndpoint(u)}st(t.connector.getDisplayElements(),t.parent),p(O[t.scope],(function(e){return e.id==t.id})),a=!0,ht(t,!e&&i,r)}}return a},this.detachAll=function(t,e){for(;0<C.connections.length;)C.detach(C.connections[0],!1,!0,t,e)},this.detachFrom=function(t,e,n){for(var i=[],r=0;r<C.connections.length;r++)C.connections[r].endpoints[1]!=t&&C.connections[r].endpoints[0]!=t||i.push(C.connections[r]);for(r=0;r<i.length;r++)C.detach(i[r],!1,!0,e,n)&&i[r].setHover(!1,!1)},this.detachFromConnection=function(t){var e=d(C.connections,(function(e){return e.id==t.id}));0<=e&&C.connections.splice(e,1)},this.getElement=function(){return D},this.setElement=function(t,e){var n=ct(t),i=(p(N[C.elementId],(function(t){return t.id==C.id})),D=y(t),A=ct(D),C.elementId=A,it({source:n,container:e}));t=c.getParent(C.canvas);c.removeElement(C.canvas,t),c.appendElement(C.canvas,i);for(var r=0;r<C.connections.length;r++)C.connections[r].moveParent(i),C.connections[r].sourceId=A,C.connections[r].source=D;U(N,n,C)},this.getUuid=function(){return P},this.makeInPlaceCopy=function(){var t=C.anchor.getCurrentLocation(C),e=C.anchor.getOrientation(C);return rt({anchor:{compute:function(){return[t[0],t[1]]},getCurrentLocation:function(){return[t[0],t[1]]},getOrientation:function(){return e}},source:D,paintStyle:this.getPaintStyle(),endpoint:L,_transient:!0,scope:C.scope})},this.isConnectedTo=function(t){var e=!1;if(t)for(var n=0;n<C.connections.length;n++)if(C.connections[n].endpoints[1]==t){e=!0;break}return e},this.isFloating=function(){return null!=j},this.connectorSelector=function(){var t=C.connections[0];return C.isTarget&&t||!(C.connections.length<G||-1==G)?t:null},this.isFull=function(){return!(C.isFloating()||G<1||C.connections.length<G)},this.setDragAllowedWhenFull=function(t){Y=t},this.setStyle=C.setPaintStyle,this.equals=function(t){return this.anchor.equals(t.anchor)},this.paint=function(t){var e=(t=t||{}).timestamp,n=!(!1===t.recalc);if(!e||C.timestamp!==e){lt({elId:A,timestamp:e,recalc:n});var i=t.offset||R[A];if(i){var r,o,a=t.anchorPoint,s=t.connectorPaintStyle,l=(null==a&&(r=t.dimensions||B[A],null!=i&&null!=r||(lt({elId:A,timestamp:e}),i=R[A],r=B[A]),i={xy:[i.left,i.top],wh:r,element:C,timestamp:e},n&&C.anchor.isDynamic&&0<C.connections.length&&(t=0==(n=(r=function(t){var e=0;if(null!=t)for(var n=0;n<C.connections.length;n++)if(C.connections[n].sourceId==t||C.connections[n].targetId==t){e=n;break}return C.connections[e]}(t.elementWithPrecedence)).endpoints[0]==C?1:0)?r.sourceId:r.targetId,o=R[t],t=B[t],i.txy=[o.left,o.top],i.twh=t,i.tElement=r.endpoints[n]),a=C.anchor.compute(i)),L.compute(a,C.anchor.getOrientation(C),C.paintStyleInUse,s||C.paintStyleInUse));L.paint(l,C.paintStyleInUse,C.anchor),C.timestamp=e;for(var u=0;u<C.overlays.length;u++){var c=C.overlays[u];c.isVisible&&(C.overlayPlacements[u]=c.draw(C.endpoint,C.paintStyleInUse,l))}}}},this.repaint=this.paint,this.removeConnection=this.detach,_.CurrentLibrary.isDragSupported(D)&&(s=!(i={id:null,element:null}),l=a=null,u=$t(i),c=_.CurrentLibrary,x=n.dragOptions||{},h=_.extend({},c.defaultDragOptions),f=c.dragEvents.start,v=c.dragEvents.stop,b=c.dragEvents.drag,(x=_.extend(h,x)).scope=x.scope||C.scope,x[f]=dt(x[f],(function(){a=C.connectorSelector();var t=!0;if(C.isEnabled()||(t=!1),null!=a||n.isSource||(t=!1),n.isSource&&C.isFull()&&!Y&&(t=!1),!1===(t=!(null!=a&&!a.isDetachable())&&t))return _.CurrentLibrary.stopDrag&&_.CurrentLibrary.stopDrag(),u.stopDrag(),!1;a&&!C.isFull()&&n.isSource&&(a=null),lt({elId:A}),(T=C.makeInPlaceCopy()).paint(),function(t,e){var n=((i=document.createElement("div")).style.position="absolute",y(i)),i=(q(i,e),ct(n));lt({elId:i}),t.id=i,t.element=n}(i,C.parent);var r,o,c;t=y(T.canvas),t=_.CurrentLibrary.getOffset(t),t=jt([t.left,t.top],T.canvas);_.CurrentLibrary.setOffset(i.element,{left:t[0],top:t[1]}),C.parentAnchor&&(C.anchor=E.makeAnchor(C.parentAnchor,C.elementId,E)),e(y(C.canvas),"dragId",i.id),e(y(C.canvas),"elId",A),n.proxy&&C.setPaintStyle(n.proxy.paintStyle),j=function(t,e,n,i,r){return e=new At({reference:e,referenceCanvas:i}),rt({paintStyle:t,endpoint:n,anchor:e,source:r,scope:"__floating"})}(C.getPaintStyle(),C.anchor,L,C.canvas,i.element),null==a?(C.anchor.locked=!0,C.setHover(!1,!1),a=tt({sourceEndpoint:C,targetEndpoint:j,source:C.endpointWillMoveTo||y(D),target:i.element,anchors:[C.anchor,j.anchor],paintStyle:n.connectorStyle,hoverPaintStyle:n.connectorHoverStyle,connector:n.connector,overlays:n.connectorOverlays})):(s=!0,a.connector.setHover(!1,!1),X(y(T.canvas),!1,!0),t=a.endpoints[0].id==C.id?0:1,a.floatingAnchorIndex=t,C.detachFromConnection(a),e(r=y(C.canvas),"originalScope",o=_.CurrentLibrary.getDragScope(r)),c=_.CurrentLibrary.getDropScope(r),_.CurrentLibrary.setDragScope(r,c),0==t?(l=[a.source,a.sourceId,w,o],a.source=i.element,a.sourceId=i.id):(l=[a.target,a.targetId,w,o],a.target=i.element,a.targetId=i.id),a.endpoints[0==t?1:0].anchor.locked=!0,a.suspendedEndpoint=a.endpoints[t],a.suspendedEndpoint.setHover(!1),a.endpoints[t]=j,function(t){E.fire("connectionDrag",t)}(a)),F[i.id]=a,j.addConnection(a),U(N,i.id,j),E.currentlyDragging=!0})),x[b]=dt(x[b],u.drag),x[v]=dt(x[v],(function(){var t=c.getDropEvent(arguments),e=(E.currentlyDragging=!1,p(N[i.id],(function(t){return t.id==j.id})),st([i.element[0],j.canvas]),at(T.canvas),E.anchorManager.clearFor(i.id),null==a.floatingAnchorIndex?1:a.floatingAnchorIndex);a.endpoints[0==e?1:0].anchor.locked=!1,C.setPaintStyle(V),a.endpoints[e]==j&&(s&&a.suspendedEndpoint?(0==e?(a.source=l[0],a.sourceId=l[1]):(a.target=l[0],a.targetId=l[1]),_.CurrentLibrary.setDragScope(l[2],l[3]),a.endpoints[e]=a.suspendedEndpoint,!C.isReattach&&!a._forceDetach&&a.endpoints[0==e?1:0].detach(a,!1,!1,!0,t)||(a.setHover(!1),a.floatingAnchorIndex=null,a.suspendedEndpoint.addConnection(a),E.repaint(l[1])),a._forceDetach=null):(st(a.connector.getDisplayElements(),C.parent),C.detachFromConnection(a))),C.anchor.locked=!1,C.paint({recalc:!1}),a.setHover(!1,!1),function(t){E.fire("connectionDragStop",t)}(a),T=a=null,delete N[j.elementId],j.anchor=null,j=null,E.currentlyDragging=!1})),w=y(C.canvas),_.CurrentLibrary.initDraggable(w,x,!0)),function(e,i,r,o){var a,s,l;(n.isTarget||i)&&_.CurrentLibrary.isDropSupported(D)&&(i=n.dropOptions||E.Defaults.DropOptions||_.Defaults.DropOptions,(i=_.extend({},i)).scope=i.scope||C.scope,a=_.CurrentLibrary.dragEvents.drop,s=_.CurrentLibrary.dragEvents.over,l=_.CurrentLibrary.dragEvents.out,i[a]=dt(i[a],(function(){var e=_.CurrentLibrary.getDropEvent(arguments),n=t(s=y(_.CurrentLibrary.getDragObject(arguments)),"dragId"),i=(t(s,"elId"),t(s,"originalScope")),r=F[n];if(null!=r){var a=null==r.floatingAnchorIndex?1:r.floatingAnchorIndex,s=(i&&_.CurrentLibrary.setDragScope(s,i),null==o||o.isEnabled());if(!C.isFull()&&(0!=a||C.isSource)&&(1!=a||C.isTarget)&&s){if(i=!0,r.suspendedEndpoint&&r.suspendedEndpoint.id!=C.id&&(0==a?(r.source=r.suspendedEndpoint.element,r.sourceId=r.suspendedEndpoint.elementId):(r.target=r.suspendedEndpoint.element,r.targetId=r.suspendedEndpoint.elementId),r.isDetachAllowed(r)&&r.endpoints[a].isDetachAllowed(r)&&r.suspendedEndpoint.isDetachAllowed(r)&&E.checkCondition("beforeDetach",r)||(i=!1)),0==a?(r.source=C.element,r.sourceId=C.elementId):(r.target=C.element,r.targetId=C.elementId),i=i&&C.isDropAllowed(r.sourceId,r.targetId,r.scope,r,C)){r.endpoints[a].detachFromConnection(r),r.suspendedEndpoint&&r.suspendedEndpoint.detachFromConnection(r),(r.endpoints[a]=C).addConnection(r);var l,u=C.getParameters();for(l in u)r.setParameter(l,u[l]);r.suspendedEndpoint?(s=r.suspendedEndpoint.getElement(),i=r.suspendedEndpoint.elementId,ht({source:0==a?s:r.source,target:1==a?s:r.target,sourceId:0==a?i:r.sourceId,targetId:1==a?i:r.targetId,sourceEndpoint:0==a?r.suspendedEndpoint:r.endpoints[0],targetEndpoint:1==a?r.suspendedEndpoint:r.endpoints[1],connection:r},!0,e)):u.draggable&&_.CurrentLibrary.initDraggable(C.element,x,!0),et(r,null,e)}else r.suspendedEndpoint&&(r.endpoints[a]=r.suspendedEndpoint,r.setHover(!1),r._forceDetach=!0,0==a?(r.source=r.suspendedEndpoint.element,r.sourceId=r.suspendedEndpoint.elementId):(r.target=r.suspendedEndpoint.element,r.targetId=r.suspendedEndpoint.elementId),r.suspendedEndpoint.addConnection(r),r.endpoints[0].repaint(),r.repaint(),E.repaint(r.source.elementId),r._forceDetach=!1);r.floatingAnchorIndex=null}E.currentlyDragging=!1,delete F[n]}})),i[s]=dt(i[s],(function(){var e,n;C.isTarget&&(e=_.CurrentLibrary.getDragObject(arguments),e=t(y(e),"dragId"),null!=(e=F[e]))&&(n=null==e.floatingAnchorIndex?1:e.floatingAnchorIndex,e.endpoints[n].anchor.over(C.anchor))})),i[l]=dt(i[l],(function(){var e,n;C.isTarget&&(e=_.CurrentLibrary.getDragObject(arguments),e=t(y(e),"dragId"),null!=(e=F[e]))&&(n=null==e.floatingAnchorIndex?1:e.floatingAnchorIndex,e.endpoints[n].anchor.out())})),_.CurrentLibrary.initDroppable(e,i,!0,r))});return X(y(C.canvas),!0,!(n._transient||C.anchor.isFloating),C),C}}function s(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}}var l=!!document.createElement("canvas").getContext,u=!!window.SVGAngle||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),c=function(){var t,e;return null==c.vml&&((t=document.body.appendChild(document.createElement("div"))).innerHTML='<v:shape id="vml_flag1" adj="1" />',(e=t.firstChild).style.behavior="url(#default#VML)",c.vml=!e||"object"==typeof e.adj,t.parentNode.removeChild(t)),c.vml},d=jsPlumbUtil.findWithFunction,h=jsPlumbUtil.indexOf,p=jsPlumbUtil.removeWithFunction,f=(jsPlumbUtil.remove,jsPlumbUtil.addWithFunction),g=(jsPlumbUtil.addToList,jsPlumbUtil.isArray),m=jsPlumbUtil.isString,v=jsPlumbUtil.isObject,y=(window.console||(window.console={time:function(){},timeEnd:function(){},group:function(){},groupEnd:function(){},log:function(){}}),function(t){return _.CurrentLibrary.getElementObject(t)}),b=jsPlumbUtil.log,x=(jsPlumbUtil.group,jsPlumbUtil.groupEnd,jsPlumbUtil.time,jsPlumbUtil.timeEnd,function(){return""+(new Date).getTime()}),w=function(t){function e(){var t;s&&l&&(_.extend(t={},s),_.extend(t,l),delete n.hoverPaintStyle,t.gradient&&s.fillStyle&&delete t.gradient,l=t)}var n=this,i=arguments,r=!1,o=t.parameters||{},a=n.idPrefix+(new Date).getTime(),s=null,l=null,u=(n._jsPlumb=t._jsPlumb,n.getId=function(){return a},n.tooltip=t.tooltip,n.hoverClass=t.hoverClass||n._jsPlumb.Defaults.HoverClass||_.Defaults.HoverClass,jsPlumbUtil.EventGenerator.apply(this),this.clone=function(){var t=new Object;return n.constructor.apply(t,i),t},this.getParameter=function(t){return o[t]},this.getParameters=function(){return o},this.setParameter=function(t,e){o[t]=e},this.setParameters=function(t){o=t},this.overlayPlacements=[],t.beforeDetach),c=(this.isDetachAllowed=function(t){var e=n._jsPlumb.checkCondition("beforeDetach",t);if(u)try{e=u(t)}catch(t){b("jsPlumb: beforeDetach callback failed",t)}return e},t.beforeDrop),d=(this.isDropAllowed=function(t,e,i,r,o){var a=n._jsPlumb.checkCondition("beforeDrop",{sourceId:t,targetId:e,scope:i,connection:r,dropEndpoint:o});if(c)try{a=c({sourceId:t,targetId:e,scope:i,connection:r,dropEndpoint:o})}catch(t){b("jsPlumb: beforeDrop callback failed",t)}return a},this.setPaintStyle=function(t,i){s=t,n.paintStyleInUse=s,e(),i||n.repaint()},this.getPaintStyle=function(){return s},this.setHoverPaintStyle=function(t,i){l=t,e(),i||n.repaint()},this.getHoverPaintStyle=function(){return l},this.setHover=function(t,e,i){n._jsPlumb.currentlyDragging||n._jsPlumb.isHoverSuspended()||(r=t,null!=n.hoverClass&&null!=n.canvas&&(t?d.addClass(n.canvas,n.hoverClass):d.removeClass(n.canvas,n.hoverClass)),null!=l&&(n.paintStyleInUse=t?l:s,i=i||x(),n.repaint({timestamp:i,recalc:!1})),n.getAttachedElements&&!e&&f(t,x(),n))},this.isHover=function(){return r},_.CurrentLibrary),h=["click","dblclick","mouseenter","mouseout","mousemove","mousedown","mouseup","contextmenu"],p={mouseout:"mouseexit"},f=(this.attachListeners=function(t,e){for(var n=0;n<h.length;n++)!function(t,e,n){var i=p[n]||n;d.bind(t,n,(function(t){e.fire(i,e,t)}))}(t,e,h[n])},function(t,e,i){var r=n.getAttachedElements();if(r)for(var o=0;o<r.length;o++)i&&i==r[o]||r[o].setHover(t,!0,e)});this.reattachListenersForElement=function(t){if(1<arguments.length){for(var e=0;e<h.length;e++){var i=t,r=h[e];d.unbind(i,r)}for(e=1;e<arguments.length;e++)n.attachListeners(t,arguments[e])}}},C=0,_=window.jsPlumb=new a;_.getInstance=function(t){return(t=new a(t)).init(),t},_.Anchors.TopCenter=s(.5,0,0,-1,"TopCenter"),_.Anchors.BottomCenter=s(.5,1,0,1,"BottomCenter"),_.Anchors.LeftMiddle=s(0,.5,-1,0,"LeftMiddle"),_.Anchors.RightMiddle=s(1,.5,1,0,"RightMiddle"),_.Anchors.Center=s(.5,.5,0,0,"Center"),_.Anchors.TopRight=s(1,0,0,-1,"TopRight"),_.Anchors.BottomRight=s(1,1,0,1,"BottomRight"),_.Anchors.TopLeft=s(0,0,0,-1,"TopLeft"),_.Anchors.BottomLeft=s(0,1,0,1,"BottomLeft"),_.Defaults.DynamicAnchors=function(t){return t.jsPlumbInstance.makeAnchors(["TopCenter","RightMiddle","BottomCenter","LeftMiddle"],t.elementId,t.jsPlumbInstance)},_.Anchors.AutoDefault=function(t){return(t=t.jsPlumbInstance.makeDynamicAnchor(_.Defaults.DynamicAnchors(t))).type="AutoDefault",t},_.Anchors.Assign=s(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})),_.Anchors.Continuous=function(t){return t.jsPlumbInstance.continuousAnchorFactory.get(t)},_.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;t=t.top-e.top,e=n[0]/i.grid[0],i=n[1]/i.grid[1],r=Math.floor(r/e),t=Math.floor(t/i);return[(r*e+e/2)/n[0],(t*i+i/2)/n[1]]}}}(),function(){function t(t){jsPlumb.DOMElementComponent.apply(this,arguments);var e=[];this.getDisplayElements=function(){return e},this.appendDisplayElement=function(t){e.push(t)}}function e(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.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,c=this;this.compute=function(c,d,h,p,f,g,m,v){var y=Math.abs(c[0]-d[0]),b=Math.abs(c[1]-d[1]),x=.45*y,w=.45*b,C=(y*=1.9,b*=1.9,Math.min(c[0],d[0])-x),_=Math.min(c[1],d[1])-w;return y<(m=Math.max(2*m,v))&&(C=c[0]+(d[0]-c[0])/2-(y=m)/2,x=(y-Math.abs(c[0]-d[0]))/2),b<m&&(_=c[1]+(d[1]-c[1])/2-(b=m)/2,w=(b-Math.abs(c[1]-d[1]))/2),o=c[0]<d[0]?x:y-x,a=c[1]<d[1]?w:b-w,s=c[0]<d[0]?y-x:x,l=c[1]<d[1]?b-w:w,t=[C,_,y,b,o,a,s,l],i=s-o,r=l-a,e=jsPlumbUtil.gradient({x:o,y:a},{x:s,y:l}),n=-1/e,Math.atan(e),Math.atan(n),u=Math.sqrt(i*i+r*r),t},this.pointOnPath=function(t,e){return 0!=t||e?1!=t||e?(e=e?0<t?t:u+t:t*u,jsPlumbUtil.pointOnLine({x:o,y:a},{x:s,y:l},e)):{x:s,y:l}:{x:o,y:a}},this.gradientAtPoint=function(t){return e},this.pointAlongPathFrom=function(t,e,n){return n=c.pointOnPath(t,n),t=1==t?{x:o+10*(s-o),y:a+10*(a-l)}:{x:s,y:l},jsPlumbUtil.pointOnLine(n,t,e)}},jsPlumb.Connectors.Bezier=function(t){function e(){return[{x:s,y:l},{x:i[0],y:i[1]},{x:r[0],y:r[1]},{x:o,y:a}]}function n(t,e,n){return n?jsBezier.locationAlongCurveFrom(t,0<e?0:1,e):e}var i,r,o,a,s,l,u,c,d,h,p=this;this.majorAnchor=(t=t||{}).curviness||150,this.minorAnchor=10,this.type="Bezier",this._findControlPoint=function(t,e,n,i,r,o,a){o=o.getOrientation(i),i=a.getOrientation(r),a=o[0]!=i[0]||o[1]==i[1],r=[];var s=p.majorAnchor,l=p.minorAnchor;return a?(0==i[0]?r.push(n[0]<e[0]?t[0]+l:t[0]-l):r.push(t[0]+s*i[0]),0==i[1]?r.push(n[1]<e[1]?t[1]+l:t[1]-l):r.push(t[1]+s*o[1])):(0==o[0]?r.push(e[0]<n[0]?t[0]+l:t[0]-l):r.push(t[0]-s*o[0]),0==o[1]?r.push(e[1]<n[1]?t[1]+l:t[1]-l):r.push(t[1]+s*i[1])),r},this.compute=function(t,e,n,f,g,m,v,y){v=v||0,d=Math.abs(t[0]-e[0])+v,h=Math.abs(t[1]-e[1])+v,u=Math.min(t[0],e[0])-v/2,c=Math.min(t[1],e[1])-v/2,s=t[0]<e[0]?d-v/2:v/2,l=t[1]<e[1]?h-v/2:v/2,o=t[0]<e[0]?v/2:d-v/2,a=t[1]<e[1]?v/2:h-v/2,i=p._findControlPoint([s,l],t,e,n,f,g,m),r=p._findControlPoint([o,a],e,t,f,n,m,g);var b;v=Math.min(s,o),e=Math.min(i[0],r[0]),t=Math.min(v,e),f=Math.max(s,o),n=Math.max(i[0],r[0]),m=Math.max(f,n),d<m&&(d=m),t<0&&(u+=t,g=Math.abs(t),d+=g,i[0]+=g,s+=g,o+=g,r[0]+=g),v=Math.min(l,a),e=Math.min(i[1],r[1]),f=Math.min(v,e),n=Math.max(l,a),m=Math.max(i[1],r[1]),t=Math.max(n,m);return h<t&&(h=t),f<0&&(c+=f,g=Math.abs(f),h+=g,i[1]+=g,l+=g,a+=g,r[1]+=g),y&&d<y&&(b=(y-d)/2,d=y,u-=b,s+=b,o+=b,i[0]=i[0]+b,r[0]=r[0]+b),y&&h<y&&(b=(y-h)/2,h=y,c-=b,l+=b,a+=b,i[1]=i[1]+b,r[1]=r[1]+b),[u,c,d,h,s,l,o,a,i[0],i[1],r[0],r[1]]},this.pointOnPath=function(t,i){var r=e();return t=n(r,t,i),jsBezier.pointOnCurve(r,t)},this.gradientAtPoint=function(t,i){var r=e();return t=n(r,t,i),jsBezier.gradientAtPoint(r,t)},this.pointAlongPathFrom=function(t,i,r){var o=e();return t=n(o,t,r),jsBezier.pointAlongCurveFrom(o,t,i)}},jsPlumb.Connectors.Flowchart=function(t){function e(t,e,n,i,r,o){n=0==c.length?n:c[c.length-1][0],i=0==c.length?i:c[c.length-1][1];var a=t==n?1/0:0,s=Math.abs(t==n?e-i:t-n);c.push([t,e,n,i,a,s]),d+=s,g=Math.max(g,t),m=Math.max(m,e),v=Math.min(v,t),y=Math.min(y,e)}function n(t,e){e&&(t=0<t?t/d:(d+t)/d);for(var n=h.length-1,i=1,r=0;r<h.length;r++)if(h[r][1]>=t){i=(t-h[n=r][0])/p[r];break}return{segment:c[n],proportion:i,index:n}}this.type="Flowchart";var i,r,o=this,a=(t=t||{}).stub||t.minStubLength||30,s=jsPlumbUtil.isArray(a)?a[0]:a,l=jsPlumbUtil.isArray(a)?a[1]:a,u=t.gap||0,c=[],d=0,h=[],p=[],f=[],g=-1/0,m=-1/0,v=1/0,y=1/0;this.compute=function(t,n,o,a,b,x,w,C,_,E){c=[],h=[],p=[],g=m=-1/(d=0),v=y=1/0,i=n[0]<t[0],r=n[1]<t[1];var M,S=(j=w||1)/2+(s+l),D=j/2+(l+s),P=j/2+(s+l),j=j/2+(l+s),T=b.orientation||b.getOrientation(o),A=x.orientation||x.getOrientation(a),k=(x=(i?n:t)[0],(r?n:t)[1]),I=Math.abs(n[0]-t[0])+S+D,L=Math.abs(n[1]-t[1])+P+j,O=((0==T[0]&&0==T[1]||0==A[0]&&0==A[1])&&(M=[1,0][G=L<I?0:1],A=[],(T=[])[G]=t[G]>n[G]?-1:1,A[G]=t[G]>n[G]?1:-1,T[M]=0,A[M]=0),I<C&&(S+=(C-I)/2,I=C),L<C&&(P+=(C-L)/2,L=C),i?I-D+u*T[0]:S+u*T[0]),N=r?L-j+u*T[1]:P+u*T[1],z=i?S+u*A[0]:I-D+u*A[0],R=r?P+u*A[1]:L-j+u*A[1],H=O+T[0]*s,F=N+T[1]*s,V=z+A[0]*l,B=R+A[1]*l,W=Math.abs(O-z)>s+l,$=Math.abs(N-R)>s+l,U=H+(V-H)/2,q=F+(B-F)/2,G=(t=T[0]*A[0]+T[1]*A[1],n=(f=[x-=S,k-=P,I,L,O,N,z,R],0==T[0]?"y":"x"),-1==t?"opposite":1==t?"orthogonal":"perpendicular"),Y=jsPlumbUtil.segment([O,N],[z,R]),X=(-1==T["x"==n?0:1]&&(Y={x:[null,4,3,2,1],y:[null,2,1,4,3]}[n][Y]),e(H,F,O,N),{oppositex:function(){var t;return o.elementId==a.elementId?(t=F+(1-b.y)*_.height+Math.max(s,l),[[H,t],[V,t]]):!W||1!=Y&&2!=Y?[[H,q],[V,q]]:[[U,N],[U,R]]},orthogonalx:function(){return 1==Y||2==Y?[[V,F]]:[[H,B]]},perpendicularx:function(){var t=(R+N)/2;return 1==Y&&1==A[1]||2==Y&&-1==A[1]?Math.abs(z-O)>Math.max(s,l)?[[V,F]]:[[H,F],[H,t],[V,t]]:3==Y&&-1==A[1]||4==Y&&1==A[1]?[[H,t],[V,t]]:3==Y&&1==A[1]||4==Y&&-1==A[1]?[[H,B]]:1==Y&&-1==A[1]||2==Y&&1==A[1]?Math.abs(z-O)>Math.max(s,l)?[[U,F],[U,B]]:[[H,B]]:void 0},oppositey:function(){var t;return o.elementId==a.elementId?[[t=H+(1-b.x)*_.width+Math.max(s,l),F],[t,B]]:!$||2!=Y&&3!=Y?[[U,F],[U,B]]:[[O,q],[z,q]]},orthogonaly:function(){return 2==Y||3==Y?[[H,B]]:[[V,F]]},perpendiculary:function(){var t;return 2==Y&&-1==A[0]||3==Y&&1==A[0]?Math.abs(z-O)>Math.max(s,l)?[[H,B]]:[[H,q],[V,q]]:1==Y&&-1==A[0]||4==Y&&1==A[0]?[[t=(z+O)/2,F],[t,B]]:1==Y&&1==A[0]||4==Y&&-1==A[0]?[[V,F]]:2==Y&&1==A[0]||3==Y&&-1==A[0]?Math.abs(R-N)>Math.max(s,l)?[[H,q],[V,q]]:[[V,F]]:void 0}}[G+n]());if(X)for(var Q=0;Q<X.length;Q++)e(X[Q][0],X[Q][1],O,N);e(V,B,O,N),e(z,R,O,N),f.push(c.length);for(var K=0;K<c.length;K++)f.push(c[K][0]),f.push(c[K][1]);for(var J=0,Z=0;Z<c.length;Z++)p[Z]=c[Z][5]/d,h[Z]=[J,J+=c[Z][5]/d];return m>f[3]&&(f[3]=m+2*w),g>f[2]&&(f[2]=g+2*w),f},this.pointOnPath=function(t,e){return o.pointAlongPathFrom(t,0,e)},this.gradientAtPoint=function(t,e){return c[n(t,e).index][4]},this.pointAlongPathFrom=function(t,e,i){i=(t=n(t,i)).segment;var r=t.proportion,o=c[t.index][5],a=c[t.index][4];return{x:a==1/0?i[2]:i[2]>i[0]?i[0]+(1-r)*o-e:i[2]+r*o+e,y:0==a?i[3]:i[3]>i[1]?i[1]+(1-r)*o-e:i[3]+r*o+e,segmentInfo:t}}},jsPlumb.Endpoints.Dot=function(t){this.type="Dot";var e=this;this.radius=(t=t||{}).radius||10,this.defaultOffset=.5*this.radius,this.defaultInnerRadius=this.radius/3,this.compute=function(t,n,i,r){return i=i.radius||e.radius,[t[0]-i,t[1]-i,2*i,2*i,i]}},jsPlumb.Endpoints.Rectangle=function(t){this.type="Rectangle";var e=this;this.width=(t=t||{}).width||20,this.height=t.height||20,this.compute=function(t,n,i,r){var o=i.width||e.width;i=i.height||e.height;return[t[0]-o/2,t[1]-i/2,o,i]}},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",s=e.cssClass?" "+e.cssClass:"";n.canvas.className=jsPlumb.endpointClass+s,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){var s,l;n.ready?(i||(n.canvas.setAttribute("src",n.img.src),n.appendDisplayElement(n.canvas),i=!0),s=n.anchorPoint[0]-r/2,l=n.anchorPoint[1]-o/2,jsPlumb.sizeCanvas(n.canvas,s,l,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;n=n.height||self.height;return[t[0]-r/2,t[1]-n/2,r,n]}},jsPlumb.Overlays.Arrow=function(t){this.type="Arrow",e.apply(this,arguments),this.isAppendedAtTopLevel=!1;var n=this,i=(this.length=(t=t||{}).length||20,this.width=t.width||20,this.id=t.id,(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,h,p,f,g;return t.pointAlongPathFrom?(jsPlumbUtil.isString(n.loc)||1<n.loc||n.loc<0?(l=parseInt(n.loc),s=t.pointAlongPathFrom(l,i*n.length/2,!0),l=t.pointOnPath(l,!0),u=jsPlumbUtil.pointOnLine(s,l,n.length)):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)),l=jsPlumbUtil.perpendicularLineTo(s,u,n.width),u=jsPlumbUtil.pointOnLine(s,u,o*n.length),c=Math.min(s.x,l[0].x,l[1].x),d=Math.max(s.x,l[0].x,l[1].x),h=Math.min(s.y,l[0].y,l[1].y),p=Math.max(s.y,l[0].y,l[1].y),f=r.strokeStyle||e.strokeStyle,g=r.fillStyle||e.strokeStyle,e=r.lineWidth||e.lineWidth,n.paint(t,{hxy:s,tail:l,cxy:u},e,f,g,a),[c,d,h,p]):[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 e=(t=t||{}).length||40;t=jsPlumb.extend(t,{length:e/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),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,s=(o.style.position="absolute",t._jsPlumb.overlayClass+" "+(i.labelStyle.cssClass||t.cssClass||"")),l=(o.className=s,jsPlumb.appendElement(o,t.component.parent),jsPlumb.getId(o),i.attachListeners(o,i),i.canvas=o,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(){"function"==typeof n?(t=n(i),o.innerHTML=t.replace(/\r\n/g,"<br/>")):null==a&&(a=n,o.innerHTML=a.replace(/\r\n/g,"<br/>"));var t=jsPlumb.CurrentLibrary.getElementObject(o);return{width:(t=jsPlumb.CurrentLibrary.getSize(t))[0],height:t[1]}},this.computeMaxSize=function(t){return(t=i.getTextDimensions(t)).width?1.5*Math.max(t.width,t.height):0},this.draw=function(t,e,n){var r,o,a,s=i.getTextDimensions(t);return null!=s.width?({x:0,y:0},a=t.pointOnPath?(o=i.loc,r=!1,(jsPlumbUtil.isString(i.loc)||i.loc<0||1<i.loc)&&(o=parseInt(i.loc),r=!0),t.pointOnPath(o,r)):{x:(o=i.loc.constructor==Array?i.loc:i.endpointLoc)[0]*n[2],y:o[1]*n[3]},minx=a.x-s.width/2,miny=a.y-s.height/2,i.paint(t,{minx,miny,td:s,cxy:a},n),[minx,minx+s.width,miny,miny+s.height]):[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=(o=jsPlumbUtil.pointOnLine(r,o,t.length),jsPlumbUtil.perpendicularLineTo(r,o,40)),s=jsPlumbUtil.perpendicularLineTo(o,r,20);return t.paint(e,[r,o,a,s],t.lineWidth,"red",null,i),[Math.min(r.x,o.x),Math.min(r.y,o.y),Math.max(r.x,o.x),Math.max(r.y,o.y)]},this.computeMaxSize=function(){return 50},this.cleanup=function(){}}}(),jsPlumb.Connectors.StateMachine=function(t){function e(){return[{x:o,y:a},{x:l[0],y:l[1]},{x:l[0]+1,y:l[1]+1},{x:i,y:r}]}function n(t,e,n){return n?jsBezier.locationAlongCurveFrom(t,0<e?0:1,e):e}var i,r,o,a,s=null,l=[],u=t.curviness||10,c=t.margin||5,d=t.proximityLimit||80,h=t.orientation&&"clockwise"==t.orientation,p=t.loopbackRadius||25,f=!1,g=!1!==t.showLoopback;this.type="StateMachine",t=t||{},this.compute=function(t,e,n,m,v,y,b,x){var w,C,_,E=Math.abs(t[0]-e[0]),M=Math.abs(t[1]-e[1]),S=.45*E,D=.45*M,P=(E*=1.9,M*=1.9,b=b||1,Math.min(t[0],e[0])-S),j=Math.min(t[1],e[1])-D;return s=g&&n.elementId==m.elementId?(f=!0,n=t[0],m=t[0],_=t[1]-c,C=t[1]-c,[P=n-p-b-p,j=(w=_-p)-p-b-p,E=2*b+4*p,M=2*b+4*p,n-P,w-j,p,h,n-P,_-j,m-P,C-j]):(f=!1,i=t[0]<e[0]?S:E-S,r=t[1]<e[1]?D:M-D,o=t[0]<e[0]?E-S:S,a=t[1]<e[1]?M-D:D,0==t[2]&&(i-=c),1==t[2]&&(i+=c),0==t[3]&&(r-=c),1==t[3]&&(r+=c),0==e[2]&&(o-=c),1==e[2]&&(o+=c),0==e[3]&&(a-=c),1==e[3]&&(a+=c),_=-1*(w=(i+o)/2)/(n=(r+a)/2),m=Math.atan(_),_==1/0||_==-1/0||Math.abs(u/2*Math.sin(m)),_==1/0||_==-1/0||Math.abs(u/2*Math.cos(m)),C=r,S=a,m=(D=i)<=(_=o)&&S<=C?1:D<=_&&C<=S?2:_<=D&&C<=S?3:4,_=Math.sqrt(Math.pow(o-i,2)+Math.pow(a-r,2)),D=w,C=n,S=m,w=t,n=e,t=m=u,l=_<=d?[D,C]:1==S?w[3]<=0&&1<=n[3]?[D+(w[2]<.5?-1*m:m),C]:1<=w[2]&&n[2]<=0?[D,C+(w[3]<.5?-1*t:t)]:[D+-1*m,C+-1*t]:2==S?1<=w[3]&&n[3]<=0?[D+(w[2]<.5?-1*m:m),C]:1<=w[2]&&n[2]<=0?[D,C+(w[3]<.5?-1*t:t)]:[D+ +m,C+-1*t]:3==S?1<=w[3]&&n[3]<=0?[D+(w[2]<.5?-1*m:m),C]:w[2]<=0&&1<=n[2]?[D,C+(w[3]<.5?-1*t:t)]:[D+-1*m,C+-1*t]:4==S?w[3]<=0&&1<=n[3]?[D+(w[2]<.5?-1*m:m),C]:w[2]<=0&&1<=n[2]?[D,C+(w[3]<.5?-1*t:t)]:[D+ +m,C+-1*t]:void 0,e=Math.max(3*Math.abs(l[0]-i),3*Math.abs(l[0]-o),Math.abs(o-i),2*b,x),_=Math.max(3*Math.abs(l[1]-r),3*Math.abs(l[1]-a),Math.abs(a-r),2*b,x),E<e&&(P-=(S=e-E)/2,i+=S/2,o+=S/2,E=e,l[0]+=S/2),M<_&&(j-=(n=_-M)/2,r+=n/2,a+=n/2,M=_,l[1]+=n/2),[P,j,E,M,i,r,o,a,l[0],l[1]])},this.pointOnPath=function(t,i){var r;return f?(i&&(t/=2*Math.PI*p),r=2*(t=0<t&&t<1?1-t:t)*Math.PI+Math.PI/2,{x:s[4]+s[6]*Math.cos(r),y:s[5]+s[6]*Math.sin(r)}):(t=n(r=e(),t,i),jsBezier.pointOnCurve(r,t))},this.gradientAtPoint=function(t,i){var r;return f?(i&&(t/=2*Math.PI*p),Math.atan(2*t*Math.PI)):(t=n(r=e(),t,i),jsBezier.gradientAtPoint(r,t))},this.pointAlongPathFrom=function(t,i,r){var o;return f?(r&&(t/=2*Math.PI*p),0<t&&t<1&&(t=1-t),o=i/(2*Math.PI*s[6])*2*Math.PI,o=2*t*Math.PI-o+Math.PI/2,{x:s[4]+s[6]*Math.cos(o),y:s[5]+s[6]*Math.sin(o)}):(t=n(o=e(),t,r),jsBezier.pointAlongCurveFrom(o,t,i))}},jsPlumb.Connectors.canvas.StateMachine=function(t){var e=this;(t=t||{}).avoidSelector,jsPlumb.Connectors.StateMachine.apply(this,arguments),jsPlumb.CanvasConnector.apply(this,arguments),this._paint=function(t){var n,i;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()):(e.ctx.save(),e.ctx.beginPath(),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){var n,i;return 10==e.length?"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":"ar "+(n=t(e[8]-e[6]))+","+(i=t(e[9]-2*e[6]))+","+(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){for(var n=[".jsplumb_vml","jsplumb\\:textbox","jsplumb\\:oval","jsplumb\\:rect","jsplumb\\:stroke","jsplumb\\:shape","jsplumb\\:group"],i=(e=document.createStyleSheet(),0);i<n.length;i++)e.addRule(n[i],"behavior:url(#default#VML);position:absolute;");document.namespaces.add("jsplumb","urn:schemas-microsoft-com:vml")}function r(t,e,n,i,r){return n=n||{},t=document.createElement("jsplumb:"+t),r.appendElement(t,i),t.className=(n.class?n.class+" ":"")+"jsplumb_vml",d(t,e),c(t,n),t}function o(t,e,n,i){"transparent"===e?i.setOpacity(n,"0.0"):i.setOpacity(n,"1.0")}function a(t,e,n,i){var a,s={};if(e.strokeStyle?(s.stroked="true",a=jsPlumbUtil.convertStyle(e.strokeStyle,!0),o(0,s.strokecolor=a,"stroke",n),s.strokeweight=e.lineWidth+"px"):s.stroked="false",e.fillStyle?(s.filled="true",a=jsPlumbUtil.convertStyle(e.fillStyle,!0),o(0,s.fillcolor=a,"fill",n)):s.filled="false",e.dashstyle)null==n.strokeNode?n.strokeNode=r("stroke",[0,0,0,0],{dashstyle:e.dashstyle},t,i):n.strokeNode.dashstyle=e.dashstyle;else if(e["stroke-dasharray"]&&e.lineWidth){for(var l=-1==e["stroke-dasharray"].indexOf(",")?" ":",",u=e["stroke-dasharray"].split(l),d="",h=0;h<u.length;h++)d+=Math.floor(u[h]/e.lineWidth)+l;null==n.strokeNode?n.strokeNode=r("stroke",[0,0,0,0],{dashstyle:d},t,i):n.strokeNode.dashstyle=d}c(t,s)}function s(){var t=this,e=(jsPlumb.jsPlumbUIComponent.apply(this,arguments),this.opacityNodes={stroke:null,fill:null},this.initOpacityNodes=function(e){t.opacityNodes.stroke=r("stroke",[0,0,1,1],{opacity:"0.0"},e,t._jsPlumb),t.opacityNodes.fill=r("fill",[0,0,1,1],{opacity:"0.0"},e,t._jsPlumb)},this.setOpacity=function(e,n){(e=t.opacityNodes[e])&&(e.opacity=""+n)},[]);this.getDisplayElements=function(){return e},this.appendDisplayElement=function(n,i){i||t.canvas.parentNode.appendChild(n),e.push(n)}}function l(t,e){t.apply(this,e),s.apply(this,e);var n=this;n.canvas=null,n.isAppendedAtTopLevel=!0,this.paint=function(t,e,i,o,a,s){var l={},p=(o=(o&&(l.stroked="true",l.strokecolor=jsPlumbUtil.convertStyle(o,!0)),i&&(l.strokeweight=i+"px"),a&&(l.filled="true",l.fillcolor=a),Math.min(e.hxy.x,e.tail[0].x,e.tail[1].x,e.cxy.x)),i=Math.min(e.hxy.y,e.tail[0].y,e.tail[1].y,e.cxy.y),a=Math.max(e.hxy.x,e.tail[0].x,e.tail[1].x,e.cxy.x),Math.max(e.hxy.y,e.tail[0].y,e.tail[1].y,e.cxy.y));a=[o,i,Math.abs(a-o),Math.abs(p-i)];l.path="m "+h((o=e).hxy.x)+","+h(o.hxy.y)+" l "+h(o.tail[0].x)+","+h(o.tail[0].y)+" "+h(o.cxy.x)+","+h(o.cxy.y)+" "+h(o.tail[1].x)+","+h(o.tail[1].y)+" x e",l.coordsize=s[2]*u+","+s[3]*u,a[0]=s[0],a[1]=s[1],a[2]=s[2],a[3]=s[3],null==n.canvas?(n.canvas=r("shape",a,l,t.canvas.parentNode,t._jsPlumb),t.appendDisplayElement(n.canvas,!0),n.attachListeners(n.canvas,t),n.attachListeners(n.canvas,n)):(d(n.canvas,a),c(n.canvas,l))},this.reattachListeners=function(){n.canvas&&n.reattachListenersForElement(n.canvas,n)},this.cleanup=function(){null!=n.canvas&&jsPlumb.CurrentLibrary.removeElement(n.canvas)}}jsPlumb.vml={};var u=1e3,c=function(t,e){for(var n in e)t[n]=e[n]},d=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"},h=jsPlumb.vml.convertValue=function(t){return Math.floor(t*u)},p=jsPlumb.VmlConnector=function(e){var n=this,i=(n.strokeNode=null,n.canvas=null,s.apply(this,arguments),n._jsPlumb.connectorClass+(e.cssClass?" "+e.cssClass:""));this.paint=function(o,s,l){if(null!=s){var h={path:n.getPath(o)};if(s.outlineColor){var p,f=s.outlineWidth||1,g=(f=s.lineWidth+2*f,{strokeStyle:jsPlumbUtil.convertStyle(s.outlineColor),lineWidth:f});for(p in t)g[p]=s[p];null==n.bgCanvas?(h.class=i,h.coordsize=o[2]*u+","+o[3]*u,n.bgCanvas=r("shape",o,h,e.parent,n._jsPlumb),d(n.bgCanvas,o),n.appendDisplayElement(n.bgCanvas,!0),n.attachListeners(n.bgCanvas,n),n.initOpacityNodes(n.bgCanvas,["stroke"])):(h.coordsize=o[2]*u+","+o[3]*u,d(n.bgCanvas,o),c(n.bgCanvas,h)),a(n.bgCanvas,g,n)}null==n.canvas?(h.class=i,h.coordsize=o[2]*u+","+o[3]*u,n.tooltip&&(h.label=n.tooltip),n.canvas=r("shape",o,h,e.parent,n._jsPlumb),n.appendDisplayElement(n.canvas,!0),n.attachListeners(n.canvas,n),n.initOpacityNodes(n.canvas,["stroke"])):(h.coordsize=o[2]*u+","+o[3]*u,d(n.canvas,o),c(n.canvas,h)),a(n.canvas,s,n,n._jsPlumb)}},this.reattachListeners=function(){n.canvas&&n.reattachListenersForElement(n.canvas,n)}},f=window.VmlEndpoint=function(t){s.apply(this,arguments);var e=null,n=this,i=(n.canvas=document.createElement("div"),n.canvas.style.position="absolute",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,o){var s={};jsPlumb.sizeCanvas(n.canvas,t[0],t[1],t[2],t[3]),null==e?(s.class=i,e=n.getVml([0,0,t[2],t[3]],s,o,n.canvas,n._jsPlumb),n.attachListeners(e,n),n.appendDisplayElement(e,!0),n.appendDisplayElement(n.canvas,!0),n.initOpacityNodes(e,["fill"])):(d(e,[0,0,t[2],t[3]]),c(e,s)),a(e,r,n)},this.reattachListeners=function(){e&&n.reattachListenersForElement(e,n)}};jsPlumb.Connectors.vml.Bezier=function(){jsPlumb.Connectors.Bezier.apply(this,arguments),p.apply(this,arguments),this.getPath=function(t){return"m"+h(t[4])+","+h(t[5])+" c"+h(t[8])+","+h(t[9])+","+h(t[10])+","+h(t[11])+","+h(t[6])+","+h(t[7])+" e"}},jsPlumb.Connectors.vml.Straight=function(){jsPlumb.Connectors.Straight.apply(this,arguments),p.apply(this,arguments),this.getPath=function(t){return"m"+h(t[4])+","+h(t[5])+" l"+h(t[6])+","+h(t[7])+" e"}},jsPlumb.Connectors.vml.Flowchart=function(){jsPlumb.Connectors.Flowchart.apply(this,arguments),p.apply(this,arguments),this.getPath=function(t){for(var e="m "+h(t[4])+","+h(t[5])+" l",n=0;n<t[8];n++)e=e+" "+h(t[9+2*n])+","+h(t[10+2*n]);return e+" "+h(t[6])+","+h(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,o){return r("oval",t,e,i,o)}},jsPlumb.Endpoints.vml.Rectangle=function(){jsPlumb.Endpoints.Rectangle.apply(this,arguments),f.apply(this,arguments),this.getVml=function(t,e,n,i,o){return r("rect",t,e,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(){l.apply(this,[jsPlumb.Overlays.Arrow,arguments])},jsPlumb.Overlays.vml.PlainArrow=function(){l.apply(this,[jsPlumb.Overlays.PlainArrow,arguments])},jsPlumb.Overlays.vml.Diamond=function(){l.apply(this,[jsPlumb.Overlays.Diamond,arguments])}}(),function(){function t(t,e){for(var n in e)t.setAttribute(n,""+e[n])}function e(t){return"position:absolute;left:"+t[0]+"px;top:"+t[1]+"px"}function n(t,e,n,i,r){if(n.gradient){var o,y=t,b=e,x=n,w=i;i=g+(i=r)._jsPlumb.idstamp();v(y),o=x.gradient.offset?m(c,{id:i}):m(u,{id:i,gradientUnits:"userSpaceOnUse"}),y.appendChild(o);for(var C=0;C<x.gradient.stops.length;C++){var _=C;_=8==w.length?w[4]<w[6]?C:x.gradient.stops.length-1-C:w[4]<w[6]?x.gradient.stops.length-1-C:C,_=jsPlumbUtil.convertStyle(x.gradient.stops[_][1],!0),_=m(h,{offset:Math.floor(100*x.gradient.stops[C][0])+"%","stop-color":_});o.appendChild(_)}y=x.strokeStyle?p:d,b.setAttribute(f,y+":url(#"+i+")")}else v(t),e.setAttribute(f,"");var E,M,S;for(S in e.setAttribute(d,n.fillStyle?jsPlumbUtil.convertStyle(n.fillStyle,!0):"none"),e.setAttribute(p,n.strokeStyle?jsPlumbUtil.convertStyle(n.strokeStyle,!0):"none"),n.lineWidth&&e.setAttribute("stroke-width",n.lineWidth),n[l]&&n.lineWidth&&!n[s]?(E=-1==n[l].indexOf(",")?" ":",",r=n[l].split(E),M="",r.forEach((function(t){M+=Math.floor(t*n.lineWidth)+E})),e.setAttribute(s,M)):n[s]&&e.setAttribute(s,n[s]),a)n[S]&&e.setAttribute(a[S],n[S])}function i(t,e,n){for(var i,r=n.split(" "),o=t.className.baseVal.split(" "),a=0;a<r.length;a++)e?-1==o.indexOf(r[a])&&o.push(r[a]):-1!=(i=o.indexOf(r[a]))&&o.splice(i,1);t.className.baseVal=o.join(" ")}function r(n){var i=this,r=n.pointerEventsSpec||"all",o=(jsPlumb.jsPlumbUIComponent.apply(this,n.originalArgs),i.canvas=null,i.path=null,i.svg=null,n.cssClass+" "+(n.originalArgs[0].cssClass||"")),a=(r={style:"",width:0,height:0,"pointer-events":r,position:"absolute"},i.tooltip&&(r.title=i.tooltip),i.svg=m("svg",r),n.useDivWrapper?(i.canvas=document.createElement("div"),i.canvas.style.position="absolute",jsPlumb.sizeCanvas(i.canvas,0,0,1,1),i.canvas.className=o,i.tooltip&&i.canvas.setAttribute("title",i.tooltip)):(t(i.svg,{class:o}),i.canvas=i.svg),n._jsPlumb.appendElement(i.canvas,n.originalArgs[0].parent),n.useDivWrapper&&i.canvas.appendChild(i.svg),[i.canvas]);this.getDisplayElements=function(){return a},this.appendDisplayElement=function(t){a.push(t)},this.paint=function(r,o,a){var s,l;null!=o&&(s=r[0],l=r[1],n.useDivWrapper&&(jsPlumb.sizeCanvas(i.canvas,r[0],r[1],r[2],r[3]),l=s=0),t(i.svg,{style:e([s,l,r[2],r[3]]),width:r[2],height:r[3]}),i._paint.apply(this,arguments))}}function o(e,n){e.apply(this,n),jsPlumb.jsPlumbUIComponent.apply(this,n),this.isAppendedAtTopLevel=!1;var i=this,r=null,o=(this.paint=function(e,a,s,l,u){null==r&&(r=m("path",{"pointer-events":"all"}),e.svg.appendChild(r),i.attachListeners(r,e),i.attachListeners(r,i)),e=n&&1==n.length&&n[0].cssClass||"",t(r,{d:o(a),class:e,stroke:l||null,fill:u||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(){r&&i.reattachListenersForElement(r,i)},this.cleanup=function(){null!=r&&jsPlumb.CurrentLibrary.removeElement(r)}}var a={joinstyle:"stroke-linejoin","stroke-linejoin":"stroke-linejoin","stroke-dashoffset":"stroke-dashoffset","stroke-linecap":"stroke-linecap"},s="stroke-dasharray",l="dashstyle",u="linearGradient",c="radialGradient",d="fill",h="stop",p="stroke",f="style",g="jsplumb_gradient_",m=function(e,n){return e=document.createElementNS("http://www.w3.org/2000/svg",e),(n=n||{}).version="1.1",n.xmlns="http://www.w3.org/1999/xhtml",t(e,n),e},v=function(t){for(var e=0;e<t.childNodes.length;e++)t.childNodes[e].tagName!=u&&t.childNodes[e].tagName!=c||t.removeChild(t.childNodes[e])},y=(jsPlumbUtil.svg={addClass:function(t,e){i(t,!0,e)},removeClass:function(t,e){i(t,!1,e)},node:m,attr:t,pos:e},jsPlumb.SvgConnector=function(e){var i=this;r.apply(this,[{cssClass:e._jsPlumb.connectorClass,originalArgs:arguments,pointerEventsSpec:"none",tooltip:e.tooltip,_jsPlumb:e._jsPlumb}]),this._paint=function(e,r){var o,a={d:i.getPath(e)},s=null;a["pointer-events"]="all",r.outlineColor&&(o=r.outlineWidth||1,o=r.lineWidth+2*o,(s=jsPlumb.CurrentLibrary.extend({},r)).strokeStyle=jsPlumbUtil.convertStyle(r.outlineColor),s.lineWidth=o,null==i.bgPath?(i.bgPath=m("path",a),i.svg.appendChild(i.bgPath),i.attachListeners(i.bgPath,i)):t(i.bgPath,a),n(i.svg,i.bgPath,s,e,i)),null==i.path?(i.path=m("path",a),i.svg.appendChild(i.path),i.attachListeners(i.path,i)):t(i.path,a),n(i.svg,i.path,r,e,i)},this.reattachListeners=function(){i.bgPath&&i.reattachListenersForElement(i.bgPath,i),i.path&&i.reattachListenersForElement(i.path,i)}}),b=(jsPlumb.Connectors.svg.Bezier=function(t){jsPlumb.Connectors.Bezier.apply(this,arguments),y.apply(this,arguments),this.getPath=function(t){return"M "+t[4]+" "+t[5]+" 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+" "+t[6]+","+t[7]}},window.SvgEndpoint=function(t){var i=this;r.apply(this,[{cssClass:t._jsPlumb.endpointClass,originalArgs:arguments,pointerEventsSpec:"all",useDivWrapper:!0,_jsPlumb:t._jsPlumb}]),this._paint=function(t,r){(r=jsPlumb.extend({},r)).outlineColor&&(r.strokeWidth=r.outlineWidth,r.strokeStyle=jsPlumbUtil.convertStyle(r.outlineColor,!0)),null==i.node&&(i.node=i.makeNode(t,r),i.svg.appendChild(i.node),i.attachListeners(i.node,i)),n(i.svg,i.node,r,t,i),e(i.node)},this.reattachListeners=function(){i.node&&i.reattachListenersForElement(i.node,i)}});jsPlumb.Endpoints.svg.Dot=function(){jsPlumb.Endpoints.Dot.apply(this,arguments),b.apply(this,arguments),this.makeNode=function(t,e){return m("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 m("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(){o.apply(this,[jsPlumb.Overlays.Arrow,arguments])},jsPlumb.Overlays.svg.PlainArrow=function(){o.apply(this,[jsPlumb.Overlays.PlainArrow,arguments])},jsPlumb.Overlays.svg.Diamond=function(){o.apply(this,[jsPlumb.Overlays.Diamond,arguments])},jsPlumb.Overlays.svg.GuideLines=function(){var e,n,i=null,r=this,o=(jsPlumb.Overlays.GuideLines.apply(this,arguments),this.paint=function(a,s,l,u,c){null==i&&(i=m("path"),a.svg.appendChild(i),r.attachListeners(i,a),r.attachListeners(i,r),e=m("path"),a.svg.appendChild(e),r.attachListeners(e,a),r.attachListeners(e,r),n=m("path"),a.svg.appendChild(n),r.attachListeners(n,a),r.attachListeners(n,r)),t(i,{d:o(s[0],s[1]),stroke:"red",fill:null}),t(e,{d:o(s[2][0],s[2][1]),stroke:"blue",fill:null}),t(n,{d:o(s[3][0],s[3][1]),stroke:"green",fill:null})},function(t,e){return"M "+t.x+","+t.y+" L"+e.x+","+e.y})}}(),function(){function t(){function t(t,e){return null!=t&&a(t,e)}var e=this,n=(e.overlayPlacements=[],jsPlumb.jsPlumbUIComponent.apply(this,arguments),jsPlumbUtil.EventGenerator.apply(this,arguments),!(this._over=function(t){var n=l(s(e.canvas)),i=(t=u(t))[0]-n.left,r=t[1]-n.top;if(0<i&&0<r&&i<e.canvas.width&&r<e.canvas.height){for(var o=0;o<e.overlayPlacements.length;o++){var a=e.overlayPlacements[o];if(a&&a[0]<=i&&a[1]>=i&&a[2]<=r&&a[3]>=r)return!0}return 0!=(t=e.canvas.getContext("2d").getImageData(parseInt(i),parseInt(r),1,1)).data[0]||0!=t.data[1]||0!=t.data[2]||0!=t.data[3]}return!1})),i=!1,r=!1;this.mousemove=function(i){u(i);var r=c(i),a=t(r=document.elementFromPoint(r[0],r[1]),"_jsPlumb_overlay");r=null==o&&(t(r,"_jsPlumb_endpoint")||t(r,"_jsPlumb_connector"));if(!n&&r&&e._over(i))return n=!0,e.fire("mouseenter",e,i),!0;!n||e._over(i)&&r||a||(n=!1,e.fire("mouseexit",e,i)),e.fire("mousemove",e,i)},this.click=function(t){n&&e._over(t)&&!r&&e.fire("click",e,t),r=!1},this.dblclick=function(t){n&&e._over(t)&&!r&&e.fire("dblclick",e,t),r=!1},this.mousedown=function(t){e._over(t)&&!i&&(i=!0,l(s(e.canvas)),e.fire("mousedown",e,t))},this.mouseup=function(t){i=!1,e.fire("mouseup",e,t)},this.contextmenu=function(t){n&&e._over(t)&&!r&&e.fire("contextmenu",e,t),r=!1}}function e(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}function n(e){t.apply(this,arguments);var n=[];this.getDisplayElements=function(){return n},this.appendDisplayElement=function(t){n.push(t)}}function i(t){var i=this,r=(n.apply(this,arguments),{class:i._jsPlumb.endpointClass+" "+(t.cssClass||""),_jsPlumb:i._jsPlumb,parent:t.parent,tooltip:i.tooltip});i.canvas=e(r),i.ctx=i.canvas.getContext("2d"),i.appendDisplayElement(i.canvas),this.paint=function(t,e,n){var r;jsPlumb.sizeCanvas(i.canvas,t[0],t[1],t[2],t[3]),null!=e.outlineColor&&(r=e.outlineWidth||1,e.lineWidth+2*r,e.outlineColor),i._paint.apply(this,arguments)}}function r(t,e){t.apply(this,e),function(){jsPlumb.jsPlumbUIComponent.apply(this,arguments)}.apply(this,e),this.paint=function(t,e,n,i,r){(t=t.ctx).lineWidth=n,t.beginPath(),t.moveTo(e.hxy.x,e.hxy.y),t.lineTo(e.tail[0].x,e.tail[0].y),t.lineTo(e.cxy.x,e.cxy.y),t.lineTo(e.tail[1].x,e.tail[1].y),t.lineTo(e.hxy.x,e.hxy.y),t.closePath(),i&&(t.strokeStyle=i,t.stroke()),r&&(t.fillStyle=r,t.fill())}}var o=null,a=function(t,e){return jsPlumb.CurrentLibrary.hasClass(s(t),e)},s=function(t){return jsPlumb.CurrentLibrary.getElementObject(t)},l=function(t){return jsPlumb.CurrentLibrary.getOffset(s(t))},u=function(t){return jsPlumb.CurrentLibrary.getPageXY(t)},c=function(t){return jsPlumb.CurrentLibrary.getClientXY(t)},d=jsPlumb.CanvasConnector=function(t){function i(t,e){if(r.ctx.save(),jsPlumb.extend(r.ctx,e),e.gradient){for(var n=r.createGradient(t,r.ctx),i=0;i<e.gradient.stops.length;i++)n.addColorStop(e.gradient.stops[i][0],e.gradient.stops[i][1]);r.ctx.strokeStyle=n}r._paint(t,e),r.ctx.restore()}n.apply(this,arguments);var r=this,o=r._jsPlumb.connectorClass+" "+(t.cssClass||"");r.canvas=e({class:o,_jsPlumb:r._jsPlumb,parent:t.parent,tooltip:t.tooltip}),r.ctx=r.canvas.getContext("2d"),r.appendDisplayElement(r.canvas),r.paint=function(t,e){var n;null!=e&&(jsPlumb.sizeCanvas(r.canvas,t[0],t[1],t[2],t[3]),null!=e.outlineColor&&(n=e.outlineWidth||1,n=e.lineWidth+2*n,i(t,n={strokeStyle:e.outlineColor,lineWidth:n})),i(t,e))}};jsPlumb.Endpoints.canvas.Dot=function(t){jsPlumb.Endpoints.Dot.apply(this,arguments),i.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");r=r.getOrientation(e);if(jsPlumb.extend(o,i),i.gradient){s=i.gradient,a=e.defaultOffset,l=e.defaultInnerRadius;for(var a=[a=s.offset?n(s.offset):a,l=s.innerRadius?n(s.innerRadius):l],s=1==r[1]?-1*a[0]:a[0],l=1==r[0]?-1*a[0]:a[0],u=o.createRadialGradient(t[4],t[4],t[4],t[4]+l,t[4]+s,a[1]),c=0;c<i.gradient.stops.length;c++)u.addColorStop(i.gradient.stops[c][0],i.gradient.stops[c][1]);o.fillStyle=u}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),i.apply(this,arguments),this._paint=function(t,n,i){var r=e.canvas.getContext("2d");i=i.getOrientation(e);if(jsPlumb.extend(r,n),n.gradient){for(var o=1==i[1]?t[3]:0==i[1]?t[3]/2:0,a=-1==i[1]?t[3]:0==i[1]?t[3]/2:0,s=1==i[0]?t[2]:0==i[0]?t[2]/2:0,l=(i=-1==i[0]?t[2]:0==i[0]?t[2]/2:0,r.createLinearGradient(s,o,i,a)),u=0;u<n.gradient.stops.length;u++)l.addColorStop(n.gradient.stops[u][0],n.gradient.stops[u][1]);r.fillStyle=l}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),i.apply(this,arguments),this._paint=function(t,n,i){var r=t[2],o=t[3],a=(t=(t[0],t[1],e.canvas.getContext("2d")),0),s=0,l=0;1==(i=i.getOrientation(e))[0]&&(a=r,s=o,l=180),-1==i[1]&&(a=r,l=90),1==i[1]&&(s=o,l=-90),t.fillStyle=n.fillStyle,t.translate(a,s),t.rotate(l*Math.PI/180),t.beginPath(),t.moveTo(0,0),t.lineTo(r/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 t=this;jsPlumb.Connectors.Bezier.apply(this,arguments),d.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),d.apply(this,arguments),this._paint=function(n,i){if(t.ctx.beginPath(),i.dashstyle&&2==i.dashstyle.split(" ").length){for(var r=[(o=2!=(o=i.dashstyle.split(" ")).length?[2,2]:o)[0]*i.lineWidth,o[1]*i.lineWidth],o=(n[6]-n[4])/(n[7]-n[5]),a=(i=jsPlumbUtil.segment([n[4],n[5]],[n[6],n[7]]),e[i]),s=Math.atan(o),l=(i=Math.sqrt(Math.pow(n[6]-n[4],2)+Math.pow(n[7]-n[5],2)),Math.floor(i/(r[0]+r[1]))),u=[n[4],n[5]],c=0;c<l;c++){t.ctx.moveTo(u[0],u[1]);var d=u[0]+Math.abs(Math.sin(s)*r[0])*a[0],h=u[1]+Math.abs(Math.cos(s)*r[0])*a[1],p=u[0]+Math.abs(Math.sin(s)*(r[0]+r[1]))*a[0],f=u[1]+Math.abs(Math.cos(s)*(r[0]+r[1]))*a[1];t.ctx.lineTo(d,h),u=[p,f]}t.ctx.moveTo(u[0],u[1])}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),d.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,jsPlumb.Overlays.canvas.Arrow=function(){r.apply(this,[jsPlumb.Overlays.Arrow,arguments])},jsPlumb.Overlays.canvas.PlainArrow=function(){r.apply(this,[jsPlumb.Overlays.PlainArrow,arguments])},jsPlumb.Overlays.canvas.Diamond=function(){r.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){return 0<(t=jsPlumb.CurrentLibrary.getElementObject(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,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(){function t(t,e){for(var n=[],i=e.length-1,l=2*i-1,d=[],h=[],p=[],f=[],g=[[1,.6,.3,.1],[.4,.6,.6,.4],[.1,.3,.6,1]],m=0;m<=i;m++)d[m]=r(e[m],t);for(m=0;m<=i-1;m++)h[m]=r(e[m+1],e[m]),h[m]=s(h[m],3);for(m=0;m<=i-1;m++)for(var v=0;v<=i;v++)p[m]||(p[m]=[]),p[m][v]=o(h[m],d[v]);for(m=0;m<=l;m++)f[m]||(f[m]=[]),f[m].y=0,f[m].x=parseFloat(m)/l;for(l=i-1,d=0;d<=i+l;d++)for(m=Math.max(0,d-l),h=Math.min(d,i);m<=h;m++)f[m+(j=d-m)].y=f[m+j].y+p[j][m]*g[j][m];for(i=e.length-1,f=u(f,2*i-1,n,0),l=r(t,e[0]),p=a(l),m=g=0;m<f;m++)l=r(t,c(e,i,n[m],null,null)),(l=a(l))<p&&(p=l,g=n[m]);return l=r(t,e[i]),(l=a(l))<p&&(p=l,g=1),{location:g,distance:p}}function e(t,e){for(var n=h(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}}function n(t,n,i){for(var r=e(t,n),o=0,a=0<i?1:-1,s=null;o<Math.abs(i);)s=e(t,n+=.005*a),o+=Math.sqrt(Math.pow(s.x-r.x,2)+Math.pow(s.y-r.y,2)),r=s;return{point:s,location:n}}function i(t,n){var i=e(t,n);n=(t=e(t.slice(0,t.length-1),n)).y-i.y,i=t.x-i.x;return 0==n?1/0:Math.atan(n/i)}void 0===Math.sgn&&(Math.sgn=function(t){return 0==t?0:0<t?1:-1});var r=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},o=function(t,e){return t.x*e.x+t.y*e.y},a=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},s=function(t,e){return{x:t.x*e,y:t.y*e}},l=Math.pow(2,-65),u=function(t,e,n,i){var r=[],o=[],a=[],s=[],d=0;p=Math.sgn(t[0].y);for(var h=1;h<=e;h++)(f=Math.sgn(t[h].y))!=p&&d++,p=f;switch(d){case 0:return 0;case 1:if(64<=i)return n[0]=(t[0].x+t[e].x)/2,1;d=t[0].y-t[e].y;for(var p=t[e].x-t[0].x,f=(h=t[0].x*t[e].y-t[e].x*t[0].y,max_distance_below=0),g=1;g<e;g++){var m=d*t[g].x+p*t[g].y+h;f<m?f=m:m<max_distance_below&&(max_distance_below=m)}if(f=1/(0*(g=p)-+d)*(h-f-0*g),d=1/(0*(g=p)-+d)*(+(p=h-max_distance_below)-0*g),p=Math.min(f,d),Math.max(f,d)-p<l)return a=t[e].x-t[0].x,s=t[e].y-t[0].y,n[0]=0+(a*+t[0].y-s*+t[0].x)*(1/(0*a-+s)),1}for(c(t,e,.5,r,o),t=u(r,e,a,i+1),e=u(o,e,s,i+1),i=0;i<t;i++)n[i]=a[i];for(i=0;i<e;i++)n[i+t]=s[i];return t+e},c=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]},d={},h=function(t){if(!(o=d[t])){function e(t){return function(){return t}}function n(){return function(t){return t}}function i(){return function(t){return 1-t}}function r(t){return function(e){for(var n=1,i=0;i<t.length;i++)n*=t[i](e);return n}}var o;(o=[]).push(new function(){return function(e){return Math.pow(e,t)}});for(var a=1;a<t;a++){for(var s=[new e(t)],l=0;l<t-a;l++)s.push(new n);for(l=0;l<a;l++)s.push(new i);o.push(new r(s))}o.push(new function(){return function(e){return Math.pow(1-e,t)}}),d[t]=o}return o};window.jsBezier={distanceFromCurve:t,gradientAtPoint:i,gradientAtPointAlongCurveFrom:function(t,e,r){return 1<(e=n(t,e,r)).location&&(e.location=1),e.location<0&&(e.location=0),i(t,e.location)},nearestPointOnCurve:function(e,n){return e=t(e,n),{point:c(n,n.length-1,e.location,null,null),location:e.location}},pointOnCurve:e,pointAlongCurveFrom:function(t,e,i){return n(t,e,i).point},perpendicularToCurveAt:function(t,e,r,o){return t=i(t,(e=n(t,e,null==o?0:o)).location),o=Math.atan(-1/t),t=r/2*Math.sin(o),r=r/2*Math.cos(o),[{x:e.point.x+r,y:e.point.y+t},{x:e.point.x-r,y:e.point.y-t}]},locationAlongCurveFrom:function(t,e,i){return n(t,e,i).location}}}(),function(t,e){function n(e,n){var r,o,a,s=e.nodeName.toLowerCase();return"area"===s?(o=(r=e.parentNode).name,!(!e.href||!o||"map"!==r.nodeName.toLowerCase()||!(a=t("img[usemap=#"+o+"]")[0]))&&i(a)):(/input|select|textarea|button|object/.test(s)?!e.disabled:"a"==s&&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=(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))})):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);return/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=t(this[0]);r.length&&r[0]!==document;){if(("absolute"===(i=r.css("position"))||"relative"===i||"fixed"===i)&&(i=parseInt(r.css("zIndex"),10),!isNaN(i))&&0!==i)return i;r=r.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||0<=i)&&n(e,!r)}}),t((function(){var e=document.body,n=e.appendChild(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,o=t.ui[e].prototype;for(r in i)o.plugins[r]=o.plugins[r]||[],o.plugins[r].push([n,i[r]])},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){var i;return"hidden"!==t(e).css("overflow")&&(i=!1,0<e[n=n&&"left"===n?"scrollLeft":"scrollTop"]||(e[n]=1,i=0<e[n],e[n]=0,i))},isOverAxis:function(t,e,n){return e<t&&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),function(t){var e,n;t.cleanData?(e=t.cleanData,t.cleanData=function(n){for(var i,r=0;null!=(i=n[r]);r++)try{t(i).triggerHandler("remove")}catch(n){}e(n)}):(n=t.fn.remove,t.fn.remove=function(e,i){return this.each((function(){return i||e&&!t.filter(e,[this]).length||t("*",this).add([this]).each((function(){try{t(this).triggerHandler("remove")}catch(t){}})),n.call(t(this),e,i)}))}),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)},n=new n;n.options=t.extend(!0,{},n.options),t[o][e].prototype=t.extend(!0,n,{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(e,n){t.fn[e]=function(i){var r="string"==typeof i,o=Array.prototype.slice.call(arguments,1),a=this;return i=!r&&o.length?t.extend.apply(null,[!0,i].concat(o)):i,r&&"_"===i.charAt(0)||(r?this.each((function(){var n=t.data(this,e),r=n&&t.isFunction(n[i])?n[i].apply(n,o):n;if(r!==n&&void 0!==r)return a=r,!1})):this.each((function(){var r=t.data(this,e);r?r.option(i||{})._init():t.data(this,e,new n(i,this))}))),a}},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(e,n){var i=e;if(0===arguments.length)return t.extend({},this.options);if("string"==typeof e){if(void 0===n)return this.options[e];(i={})[e]=n}return this._setOptions(i),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),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){var i,r,o;if(!e)return this._mouseStarted&&this._mouseUp(n),r=1==(this._mouseDownEvent=n).which,o=!("string"!=typeof(i=this).options.cancel||!n.target.nodeName)&&t(n.target).closest(this.options.cancel).length,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===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||9<=document.documentMode||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),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=t(a.of),c=u[0],d=(a.collision||"flip").split(" "),h=a.offset?a.offset.split(" "):[0,0],p=9===c.nodeType?(s=u.width(),l=u.height(),{top:0,left:0}):c.setTimeout?(s=u.width(),l=u.height(),{top:u.scrollTop(),left:u.scrollLeft()}):c.preventDefault?(a.at="left top",s=l=0,{top:a.of.pageY,left:a.of.pageX}):(s=u.outerWidth(),l=u.outerHeight(),u.offset());return t.each(["my","at"],(function(){var t=(a[this]||"").split(" ");(t=1===t.length?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===d.length&&(d[1]=d[0]),h[0]=parseInt(h[0],10)||0,1===h.length&&(h[1]=h[0]),h[1]=parseInt(h[1],10)||0,"right"===a.at[0]?p.left+=s:a.at[0]===i&&(p.left+=s/2),"bottom"===a.at[1]?p.top+=l:a.at[1]===i&&(p.top+=l/2),p.left+=h[0],p.top+=h[1],this.each((function(){var e,n=t(this),o=n.outerWidth(),u=n.outerHeight(),c=parseInt(t.curCSS(this,"marginLeft",!0))||0,f=parseInt(t.curCSS(this,"marginTop",!0))||0,g=o+c+(parseInt(t.curCSS(this,"marginRight",!0))||0),m=u+f+(parseInt(t.curCSS(this,"marginBottom",!0))||0),v=t.extend({},p);"right"===a.my[0]?v.left-=o:a.my[0]===i&&(v.left-=o/2),"bottom"===a.my[1]?v.top-=u:a.my[1]===i&&(v.top-=u/2),r.fractions||(v.left=Math.round(v.left),v.top=Math.round(v.top)),e={left:v.left-c,top:v.top-f},t.each(["left","top"],(function(n,i){t.ui.position[d[n]]&&t.ui.position[d[n]][i](v,{targetWidth:s,targetHeight:l,elemWidth:o,elemHeight:u,collisionPosition:e,collisionWidth:g,collisionHeight:m,offset:h,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);i=n.collisionPosition.left+n.collisionWidth-i.width()-i.scrollLeft();e.left=0<i?e.left-i:Math.max(e.left-n.collisionPosition.left,e.left)},top:function(e,n){var i=t(window);i=n.collisionPosition.top+n.collisionHeight-i.height()-i.scrollTop();e.top=0<i?e.top-i:Math.max(e.top-n.collisionPosition.top,e.top)}},flip:{left:function(e,n){var r,o,a,s;n.at[0]!==i&&(r=t(window),r=n.collisionPosition.left+n.collisionWidth-r.width()-r.scrollLeft(),o="left"===n.my[0]?-n.elemWidth:"right"===n.my[0]?n.elemWidth:0,a="left"===n.at[0]?n.targetWidth:-n.targetWidth,s=-2*n.offset[0],e.left+=n.collisionPosition.left<0||0<r?o+a+s:0)},top:function(e,n){var r,o,a,s;n.at[1]!==i&&(r=t(window),r=n.collisionPosition.top+n.collisionHeight-r.height()-r.scrollTop(),o="top"===n.my[1]?-n.elemHeight:"bottom"===n.my[1]?n.elemHeight:0,a="top"===n.at[1]?n.targetHeight:-n.targetHeight,s=-2*n.offset[1],e.top+=n.collisionPosition.top<0||0<r?o+a+s: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;o={top:n.top-r.top+o,left:n.left-r.left+a};"using"in n?n.using.call(e,o):i.css(o)},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);var s,l,u=document.getElementsByTagName("body")[0],c=document.createElement("div"),d=document.createElement(u?"div":"body"),h={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(l in u&&t.extend(h,{position:"absolute",left:"-1000px",top:"-1000px"}),h)d.style[l]=h[l];d.appendChild(c),(s=u||document.documentElement).insertBefore(d,s.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",c=t(c).offset((function(t,e){return e})).offset(),d.innerHTML="",s.removeChild(d),s=c.top+c.left+(u?2e3:0),r.fractions=21<s&&s<22}(jQuery),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){var i,r;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)&&(r=t(this.handles[n],this.element),0,i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth(),r=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join(""),e.css(r,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(){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")})),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(){function e(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}var n;return this._mouseDestroy(),this.elementIsWrapper&&(e(this.element),(n=this.element).after(this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")})).remove()),this.originalElement.css("resize",this.originalResizeStyle),e(this.originalElement),this},_mouseCapture:function(e){var n,i=!1;for(n in this.handles)t(this.handles[n])[0]==e.target&&(i=!0);return!this.options.disabled&&i},_mouseStart:function(n){var i=this.options,r=this.element.position(),o=this.element,a=(r=(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(),e(this.helper.css("left"))),e(this.helper.css("top")));i.containment&&(r+=t(i.containment).scrollLeft()||0,a+=t(i.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:r,top:a},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:r,top:a},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,r=t(".ui-resizable-"+this.axis).css("cursor");return t("body").css("cursor","auto"==r?this.axis+"-resize":r),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;i=e.pageY-i.top||0;return(r=this._change[r])&&(r=r.apply(this,[e,o,i]),t.browser.msie&&t.browser.version,this.sizeDiff,this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(r=this._updateRatio(r,e)),r=this._respectSize(r,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(r),this._trigger("resize",e,this.ui())),!1},_mouseStop:function(e){this.resizing=!1;var n,i,r,o=this.options,a=this;return this._helper&&(i=(n=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&t.ui.hasScroll(i[0],"left")?0:a.sizeDiff.height,n=n?0:a.sizeDiff.width,n={width:a.helper.width()-n,height:a.helper.height()-i},i=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null,r=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null,o.animate||this.element.css(t.extend(n,{top:r,left:i})),a.helper.height(a.size.height),a.helper.width(a.size.width),this._helper)&&!o.animate&&this._proportionallyResize(),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=this.options;o={minWidth:n(o.minWidth)?o.minWidth:0,maxWidth:n(o.maxWidth)?o.maxWidth:1/0,minHeight:n(o.minHeight)?o.minHeight:0,maxHeight:n(o.maxHeight)?o.maxHeight:1/0};(this._aspectRatio||t)&&(t=o.minHeight*this.aspectRatio,i=o.minWidth/this.aspectRatio,e=o.maxHeight*this.aspectRatio,r=o.maxWidth/this.aspectRatio,o.minWidth<t&&(o.minWidth=t),o.minHeight<i&&(o.minHeight=i),e<o.maxWidth&&(o.maxWidth=e),r<o.maxHeight)&&(o.maxHeight=r),this._vBoundaries=o},_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=(e=(this._aspectRatio||e.shiftKey,this.axis),n(t.width)&&i.maxWidth&&i.maxWidth<t.width),o=n(t.height)&&i.maxHeight&&i.maxHeight<t.height,a=n(t.width)&&i.minWidth&&i.minWidth>t.width,s=n(t.height)&&i.minHeight&&i.minHeight>t.height,l=(a&&(t.width=i.minWidth),s&&(t.height=i.minHeight),r&&(t.width=i.maxWidth),o&&(t.height=i.maxHeight),this.originalPosition.left+this.originalSize.width),u=this.position.top+this.size.height,c=/sw|nw|w/.test(e);e=/nw|ne|n/.test(e);return(a=(a&&c&&(t.left=l-i.minWidth),r&&c&&(t.left=l-i.maxWidth),s&&e&&(t.top=u-i.minHeight),o&&e&&(t.top=u-i.maxHeight),!t.width&&!t.height))&&!t.left&&t.top?t.top=null:a&&!t.top&&t.left&&(t.left=null),t},_proportionallyResize:function(){if(this.options,this._proportionallyResizeElements.length)for(var e=this.helper||this.element,n=0;n<this._proportionallyResizeElements.length;n++){var i,r,o=this._proportionallyResizeElements[n];this.borderDif||(i=[o.css("borderTopWidth"),o.css("borderRightWidth"),o.css("borderBottomWidth"),o.css("borderLeftWidth")],r=[o.css("paddingTop"),o.css("paddingRight"),o.css("paddingBottom"),o.css("paddingLeft")],this.borderDif=t.map(i,(function(t,e){return(parseInt(t,10)||0)+(parseInt(r[e],10)||0)}))),t.browser.msie&&(t(e).is(":hidden")||t(e).parents(":hidden").length)||o.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,n=this.element,i=this.options;this.elementOffset=n.offset(),this._helper?(this.helper=this.helper||t('<div style="overflow:hidden;"></div>'),e=(n=t.browser.msie&&t.browser.version<7)?1:0,n=n?2:-1,this.helper.addClass(this._helper).css({width:this.element.outerWidth()+n,height:this.element.outerHeight()+n,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):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){function i(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)})}))}var r=t(this).data("resizable").options;"object"!=typeof r.alsoResize||r.alsoResize.parentNode?i(r.alsoResize):r.alsoResize.length?(r.alsoResize=r.alsoResize[0],i(r.alsoResize)):t.each(r.alsoResize,(function(t){i(t)}))},resize:function(e,n){function i(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)+(l[e]||0);n&&0<=n&&(o[e]=n||null)})),e.css(o)}))}var r=t(this).data("resizable"),o=r.options,a=r.originalSize,s=r.originalPosition,l={height:r.size.height-a.height||0,width:r.size.width-a.width||0,top:r.position.top-s.top||0,left:r.position.left-s.left||0};"object"!=typeof o.alsoResize||o.alsoResize.nodeType?i(o.alsoResize):t.each(o.alsoResize,(function(t,e){i(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=(s=o.length&&/textarea/i.test(o[0].nodeName))&&t.ui.hasScroll(o[0],"left")?0:i.sizeDiff.height,s=s?0:i.sizeDiff.width,l=(s={width:i.size.width-s,height:i.size.height-a},a=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null);i.element.animate(t.extend(s,l&&a?{top:l,left:a}:{}),{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,o,a,s,l=t(this).data("resizable"),u=l.options,c=l.element;(c=(u=u.containment)instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u)&&(l.containerElement=t(c),/document/.test(u)||u==document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(r=t(c),o=[],t(["Top","Right","Left","Bottom"]).each((function(t,n){o[t]=e(r.css("padding"+n))})),l.containerOffset=r.offset(),l.containerPosition=r.position(),l.containerSize={height:r.innerHeight()-o[3],width:r.innerWidth()-o[1]},u=l.containerOffset,s=l.containerSize.height,a=l.containerSize.width,a=t.ui.hasScroll(c,"left")?c.scrollWidth:a,s=t.ui.hasScroll(c)?c.scrollHeight:s,l.parentData={element:c,left:u.left,top:u.top,width:a,height:s}))},resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=(i.containerSize,i.containerOffset),a=(i.size,i.position),s=(e=i._aspectRatio||e.shiftKey,{top:0,left:0}),l=((l=i.containerElement)[0]!=document&&/static/.test(l.css("position"))&&(s=o),a.left<(i._helper?o.left:0)&&(i.size.width=i.size.width+(i._helper?i.position.left-o.left:i.position.left-s.left),e&&(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),e&&(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,Math.abs((i._helper,i.offset.left-s.left+i.sizeDiff.width)));r=Math.abs((i._helper?i.offset.top-s.top:i.offset.top-o.top)+i.sizeDiff.height),a=i.containerElement.get(0)==i.element.parent().get(0),s=/relative|absolute/.test(i.containerElement.css("position"));a&&s&&(l-=i.parentData.left),l+i.size.width>=i.parentData.width&&(i.size.width=i.parentData.width-l,e)&&(i.size.height=i.size.width/i.aspectRatio),r+i.size.height>=i.parentData.height&&(i.size.height=i.parentData.height-r,e)&&(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=(c=t(i.helper)).offset(),u=c.outerWidth()-i.sizeDiff.width,c=c.outerHeight()-i.sizeDiff.height;i._helper&&!r.animate&&/relative/.test(s.css("position"))&&t(this).css({left:l.left-a.left-o.left,width:u,height:c}),i._helper&&!r.animate&&/static/.test(s.css("position"))&&t(this).css({left:l.left-a.left-o.left,width:u,height:c})}}),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,e=Math.round((o.width-a.width)/(r.grid[0]||1))*(r.grid[0]||1),o=Math.round((o.height-a.height)/(r.grid[1]||1))*(r.grid[1]||1);/^(se|s|e)$/.test(l)?(i.size.width=a.width+e,i.size.height=a.height+o):/^(ne)$/.test(l)?(i.size.width=a.width+e,i.size.height=a.height+o,i.position.top=s.top-o):(/^(sw)$/.test(l)?(i.size.width=a.width+e,i.size.height=a.height+o):(i.size.width=a.width+e,i.size.height=a.height+o,i.position.top=s.top-o),i.position.left=s.left-e)}});var e=function(t){return parseInt(t,10)||0},n=function(t){return!isNaN(parseInt(t,10))}}(jQuery),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=this.options;return!l.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),s={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(s),i=this._valueMax()-this._valueMin()+1,(o=this).handles.each((function(e){var s=Math.abs(n-o.values(e));s<i&&(i=s,r=t(this),a=e)})),!0===l.range&&this.values(1)===l.min&&(a+=1,r=t(this.handles[a])),!1!==this._start(e,a))&&(this._mouseSliding=!0,o._handleIndex=a,r.addClass("ui-state-active").focus(),s=r.offset(),l=!t(e.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-s.left-r.width()/2,top:e.pageY-s.top-r.height()/2-(parseInt(r.css("borderTopWidth"),10)||0)-(parseInt(r.css("borderBottomWidth"),10)||0)+(parseInt(r.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,n),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;return(t=1<(t=(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)))/e)?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 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;this.options.values&&this.options.values.length?(i=this.values(e?0:1),(n=2===this.options.values.length&&!0===this.options.range&&(0===e&&i<n||1===e&&n<i)?i:n)!==this.values(e)&&((i=this.values())[e]=n,r=this._trigger("slide",t,{handle:this.handles[e],value:n,values:i}),this.values(e?0:1),!1!==r)&&this.values(e,n,!0)):n!==this.value()&&!1!==(r=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){var n;this._keySliding||this._mouseSliding||(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){if(!arguments.length)return this._value();this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0)},values:function(e,n){var i,r,o;if(1<arguments.length)this.options.values[e]=this._trimAlignValue(n),this._refreshValue(),this._change(null,e);else{if(!arguments.length)return this._values();if(!t.isArray(e))return this.options.values&&this.options.values.length?this._values(e):this.value();for(i=this.options.values,r=e,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 this._trimAlignValue(t)},_values:function(t){var e,n,i;if(arguments.length)return e=this.options.values[t],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){var e,n;return t<=this._valueMin()?this._valueMin():t>=this._valueMax()?this._valueMax():(e=0<this.options.step?this.options.step:1,n=t-(t=(t-this._valueMin())%e),2*Math.abs(t)>=e&&(n+=0<t?e:-e),parseFloat(n.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){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=n,this.params||(this.params={});var i;e=void 0!==this.params.arrowLines,n=void 0!==this.params.highlightLines;e||n?e&&n||(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&&!(i=this.curTrace[r].stdout);r--);i&&(this.numStdoutLines=i.rtrim().split("\n").length),this.try_hook("end_constructor",{myViz:this}),this.hasRendered=!1,this.render()}function htmlWithHighlight(t,e,n,i){var r="",o=(0<e&&(r=t.slice(0,e)),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,e=this,n='<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>',r='<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>',o=(e.tabularView&&(r='<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(o+'<table border="0" class="visualizer"><tr><td class="vizLayoutTd" id="vizLayoutTdFirst"">'+n+'</td></tr><tr><td class="vizLayoutTd" id="vizLayoutTdSecond">'+r+"</td></tr></table>"):this.domRoot.html(o+'<table border="0" class="visualizer"><tr><td class="vizLayoutTd" id="vizLayoutTdFirst">'+n+'</td><td class="vizLayoutTd" id="vizLayoutTdSecond">'+r+"</td></tr></table>"),this.showOnlyOutputs?(e.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")):(o="75px",this.numStdoutLines<=3&&(o=18*this.numStdoutLines+"px"),this.params.embeddedMode&&(o="45px"),this.domRoot.find("#vizLayoutTdSecond").prepend(i),this.domRoot.find("#pyStdout").width("350px").height(o).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>'),e.domRootD3.select("svg#prevLegendArrowSVG").append("polygon").attr("points",SVG_ARROW_POLYGON).attr("fill",lightArrowColor),e.domRootD3.select("svg#curLegendArrowSVG").append("polygon").attr("points",SVG_ARROW_POLYGON).attr("fill",darkArrowColor)):this.params.highlightLines?e.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&&e.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?(n="2","js"===this.params.lang?n="js":"ts"===this.params.lang?n="ts":"java"===this.params.lang?n="java":"py3"===this.params.lang?n="3":"c"===this.params.lang?n="c":"cpp"===this.params.lang&&(n="cpp"),r=$.param.fragment(this.params.editCodeBaseURL,{code:this.curInputCode,py:n},2),this.domRoot.find("#editBtn").attr("href",r)):(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>'),e.domRoot.find("#executionSliderDocs").hide()),e.editAnnotationMode=!1,this.allowEditAnnotations?(t=this.domRoot.find("#annotateBtn")).click((function(){e.editAnnotationMode?(e.enterViewAnnotationsMode(),e.domRoot.find("#jmpFirstInstr,#jmpLastInstr,#jmpStepBack,#jmpStepFwd,#executionSlider,#editCodeLinkDiv,#stepAnnotationViewer").show(),e.domRoot.find("#stepAnnotationEditor").hide(),t.html("Annotate this step")):(e.enterEditAnnotationsMode(),e.domRoot.find("#jmpFirstInstr,#jmpLastInstr,#jmpStepBack,#jmpStepFwd,#executionSlider,#editCodeLinkDiv,#stepAnnotationViewer").hide(),e.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,n){e.domRoot.find("#codeDisplayDiv").css("height","auto"),e.renderSliderBreakpoints(),e.params.updateOutputCallback&&e.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="'+e.generateID("globals")+'"><div id="'+e.generateID("globals_header")+'" class="stackFrameHeader">'+this.getRealLabel("Global frame")+'</div><table class="stackFrameVarTable" id="'+e.generateID("global_table")+'"></table></div>'),this.params.hideOutput&&this.domRoot.find("#progOutputs").hide(),this.domRoot.find("#jmpFirstInstr").click((function(){e.renderStep(0)})),this.domRoot.find("#jmpLastInstr").click((function(){e.renderStep(e.curTrace.length-1)})),this.domRoot.find("#jmpStepBack").click((function(){e.stepBack()})),this.domRoot.find("#jmpStepFwd").click((function(){e.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]);if((n=(this.instrLimitReached="instruction_limit_reached"==i.event,this.instrLimitReached&&(this.curTrace.pop(),o=i.exception_msg,this.instrLimitReachedWarningMsg=o,e.domRoot.find("#errorOutput").html(htmlspecialchars(o)),e.domRoot.find("#errorOutput").show()),this.domRoot.find("#executionSlider"))).slider({min:0,max:this.curTrace.length-1,step:1}),n.find(".ui-slider-handle").unbind("keydown"),n.find(".ui-slider-handle").css("width","0.8em"),n.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,n){t.originalEvent&&e.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 a=-1,s=0;s<this.curTrace.length;s++){var l=this.curTrace[s];if("exception"==l.event||"uncaught_exception"==l.event){a=s;break}}this.curInstr=0<=a?a: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=e.domRoot.find("#vizLayoutTdFirst"),n=$(document).scrollTop(),i=t.offset().top,r=((n=n-i)<0&&(n=0),e.domRoot.find("#optTabularView"));n-i<r.height()+r.offset().top-e.domRoot.find("#codeDisplayDiv").height()&&t.css("padding-top",n)})));var u=e.domRoot.find("#rawUserInputDiv");u.find("#userInputPromptStr").html(e.userInputPromptStr),u.find("#raw_input_submit_btn").click((function(){var t=u.find("#raw_input_textbox").val();e.executeCodeWithRawInputFunc(t,e.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,e=(t.destroyAllAnnotationBubbles(),[]),n=($.each(this.domRoot.find("#pyCodeOutput .cod"),(function(t,n){e.push($(n).attr("id"))})),[]),i=($.each(this.domRoot.find(".heapObject"),(function(t,e){n.push($(e).attr("id"))})),[]),r=($.each(this.domRoot.find(".variableTr"),(function(t,e){i.push($(e).attr("id"))})),[]);$.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,e=this.curTrace[this.curInstr],n=this,i=(n.allAnnotationBubbles||e.bubbleAnnotations&&(n.initAllAnnotationBubbles(),$.each(n.allAnnotationBubbles,(function(t,n){var i=e.bubbleAnnotations[n.domID];i&&n.preseedText(i)}))),n.allAnnotationBubbles&&(t={},$.each(n.allAnnotationBubbles,(function(e,n){n.enterViewMode(),n.text&&(t[n.domID]=n.text)})),e.bubbleAnnotations=t),n.domRoot.find("#stepAnnotationEditor").val().trim());i?e.stepAnnotation=i:delete e.stepAnnotation,n.initStepAnnotation(),n.showVizHeaderViewMode(),n.redrawConnectors(),n.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(e<=r)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(0<=$.inArray(e,t.sortedBreakpointsList))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 e<o?o:-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()),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){i=i.executionPoints,$.each(i,(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++){for(var a=r[o],s={},l=(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)})),!1),u=a.split("#"),c=1;c<u.length;c++)-1!=u[c].indexOf("breakpoint")&&(l=!0);l&&0<s.executionPoints.length&&(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){if((t=t.executionPoints)&&0!=t.length)return"pointer"})).on("click",(function(e,r){var o=e.executionPoints;o&&0!=o.length&&(e.breakpointHere=!e.breakpointHere,e.breakpointHere?(o=this,n(e.executionPoints),d3.select(o.parentNode).select("td.lineNo").style("color",breakpointColor),d3.select(o.parentNode).select("td.lineNo").style("font-weight","bold"),d3.select(o.parentNode).select("td.cod").style("color",breakpointColor),t.renderSliderBreakpoints()):i(this,e))}))},ExecutionVisualizer.prototype.renderStdout=function(){var t,e,n=this.curTrace[this.curInstr];!this.params.hideOutput&&0<this.numStdoutLines?(this.domRoot.find("#progOutputs").show(),e=(t=this.domRoot.find("#pyStdout")).scrollLeft(),t.val(n.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,n=(e=t.curInstr===e-1,e=!t.instrLimitReached&&e,null),i=null,r=t.curTrace[t.curInstr],o=!1,a="return"==r.event,s=!1;if(0<t.curInstr&&(i=t.curTrace[t.curInstr-1].line,s="return"==t.curTrace[t.curInstr-1].event)){for(var l=t.curInstr-1,u=t.curTrace[l].stack_to_render,c=(assert(0<u.length),u[u.length-1].frame_id);0<=l;){var d=t.curTrace[l];if("call"==d.event&&d.stack_to_render&&d.stack_to_render[d.stack_to_render.length-1].frame_id==c)break;l--}0<l&&(i=t.curTrace[l-1].line,s=!1)}"exception"!=r.event&&"uncaught_exception"!=r.event||(assert(r.exception_msg),o=!0,t.curLineExceptionMsg=r.exception_msg),n=r.line,t.curLineNumber=n=e&&!o&&i==n?null:n,t.prevLineNumber=i,t.curLineIsReturn=a,t.prevLineIsReturn=s},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,n,i,r,o,a,s,l=this;l.domRoot.is(":visible")&&(l.curLineNumber=void 0,l.prevLineNumber=void 0,l.curLineIsReturn=void 0,l.prevLineIsReturn=void 0,l.curLineExceptionMsg=void 0,l.codeHorizontalOverflow=l.domRoot.find("#pyCodeOutput").width()-l.domRoot.find("#pyCodeOutputDiv").width(),l.codeHorizontalOverflow<0&&(l.codeHorizontalOverflow=0),e=l.domRoot.find("#dataViz").height(),n=l.domRoot.find("svg#leftCodeGutterSVG"),!l.leftGutterSvgInitialized&&l.params.arrowLines&&(n.height(n.parent().height()),a=l.domRoot.find("table#pyCodeOutput tr:first").offset().top,l.codeRowHeight=l.domRoot.find("table#pyCodeOutput td.cod:first").height(),this.codeOutputLines&&1<this.codeOutputLines.length&&(s=l.domRoot.find("table#pyCodeOutput tr:nth-child(2)").offset().top,l.codeRowHeight=s-a),assert(0<l.codeRowHeight),s=n.offset().top-a,l.arrowOffsetY=Math.floor(l.codeRowHeight/2-SVG_ARROW_HEIGHT/2)-s,l.leftGutterSvgInitialized=!0),l.params.arrowLines&&(assert(void 0!==l.arrowOffsetY),assert(void 0!==l.codeRowHeight),assert(0<=l.arrowOffsetY&&l.arrowOffsetY<=l.codeRowHeight)),this.params.updateOutputCallback&&this.params.updateOutputCallback(this),o=this.curTrace[this.curInstr],i=!1,o.question&&$("#"+o.question.div).modal({position:["25%","50%"]}),l.params.debugMode&&(console.log("updateOutputFull",o),l.debugMode=!0),a=this.curTrace.length,r=this.curInstr==a-1,s=l.domRoot.find("#vcrControls"),r?this.promptForUserInput||this.promptForMouseInput?s.find("#curInstr").html('<b><font color="'+brightRed+'">Enter user input below:</font></b>'):this.instrLimitReached?s.find("#curInstr").html("Instruction limit reached"):s.find("#curInstr").html("Program terminated"):s.find("#curInstr").html("Step "+String(this.curInstr+1)+" of "+String(a-1)),s.find("#jmpFirstInstr").attr("disabled",!1),s.find("#jmpStepBack").attr("disabled",!1),s.find("#jmpStepFwd").attr("disabled",!1),s.find("#jmpLastInstr").attr("disabled",!1),0==this.curInstr&&(s.find("#jmpFirstInstr").attr("disabled",!0),s.find("#jmpStepBack").attr("disabled",!0)),r&&(s.find("#jmpLastInstr").attr("disabled",!0),s.find("#jmpStepFwd").attr("disabled",!0)),l.domRoot.find("#executionSlider").slider("value",this.curInstr),"exception"==o.event||"uncaught_exception"==o.event?(assert(o.exception_msg),"Unknown error"==o.exception_msg?l.domRoot.find("#errorOutput").html("Unknown error: Please email a bug report to philip@pgbovine.net"):l.domRoot.find("#errorOutput").html(htmlspecialchars(o.exception_msg)),l.domRoot.find("#errorOutput").show(),i=!0,l.curLineExceptionMsg=o.exception_msg):this.instrLimitReached||l.domRoot.find("#errorOutput").hide(),o.line&&function(){var e=!l.instrLimitReached&&r,a=l.domRoot.find("#pyCodeOutputDiv"),s=null,u=null,c=void 0,d=void 0,h="return"==o.event,p=!1;if(0<l.curInstr){if(u=l.curTrace[l.curInstr-1].line,p="return"==l.curTrace[l.curInstr-1].event){for(var f=l.curInstr-1,g=(assert(0<(v=l.curTrace[f].stack_to_render).length),v[v.length-1].frame_id);0<=f;){var m=l.curTrace[f];if("call"==m.event&&m.stack_to_render&&m.stack_to_render[m.stack_to_render.length-1].frame_id==g)break;f--}0<f&&(u=l.curTrace[f-1].line,t=p=!1)}l.pyCrazyMode&&((v=l.curTrace[l.curInstr-1]).column,c=void 0!==v.expr_start_col?v.expr_start_col:v.column,d=void 0!==v.expr_width?v.expr_width:1)}if(s=o.line,l.pyCrazyMode){var v=o.column,y=void 0!==o.expr_start_col?o.expr_start_col:v,b=void 0!==o.expr_width?o.expr_width:1,x=(assert((v=l.codeOutputLines[s-1]).lineNumber==s),v.text);if($.each(l.codeOutputLines,(function(t,e){var n=l.generateID("cod"+e.lineNumber);l.domRoot.find("#"+n).html(htmlspecialchars(e.text))})),u==s){for(var w="",C=0;C<x.length;C++){var _=y<=C&&C<y+b,E=c<=C&&C<c+d,M=htmlspecialchars(x[C]);w+=_&&E?'<span class="pycrazy-highlight-prev-and-cur">'+M+"</span>":E?'<span class="pycrazy-highlight-prev">'+M+"</span>":_?'<span class="pycrazy-highlight-cur">'+M+"</span>":M}assert(w)}else u&&(v=htmlWithHighlight(l.codeOutputLines[u-1].text,c,d,"pycrazy-highlight-prev"),l.domRoot.find("#"+l.generateID("cod"+u)).html(v)),w=htmlWithHighlight(x,y,b,"pycrazy-highlight-cur");l.domRoot.find("#"+l.generateID("cod"+s)).html(w)}v=p?Math.floor(l.codeRowHeight/3):0;var S,D,P,j,T=h?Math.floor(l.codeRowHeight/3):0;e&&!i&&(u==s?s=null:T-=2),l.params.arrowLines&&(u?(S=l.domRootD3.select("#prevLineArrow"),D="translate(0, "+((u-1)*l.codeRowHeight+l.arrowOffsetY+v)+")",t?S.transition().duration(200).attr("fill","white").each("end",(function(){S.attr("transform",D).attr("fill",lightArrowColor),n.find("#prevLineArrow").show()})):(S.attr("transform",D),n.find("#prevLineArrow").show())):n.find("#prevLineArrow").hide(),s?(e=l.domRootD3.select("#curLineArrow"),v="translate(0, "+((s-1)*l.codeRowHeight+l.arrowOffsetY+T)+")",(t?e.transition().delay(200).duration(250):e).attr("transform",v),n.find("#curLineArrow").show()):n.find("#curLineArrow").hide()),l.domRootD3.selectAll("#pyCodeOutputDiv td.cod").style("border-top",(function(t){return i&&t.lineNumber==o.line?"1px solid "+errorColor:""})).style("border-bottom",(function(t){return i&&t.lineNumber==o.line?"1px solid "+errorColor:""})),l.params.highlightLines&&(l.domRoot.find("#pyCodeOutputDiv td.cod").removeClass("highlight-prev"),l.domRoot.find("#pyCodeOutputDiv td.cod").removeClass("highlight-cur"),s&&l.domRoot.find("#"+l.generateID("cod"+s)).addClass("highlight-cur"),u)&&l.domRoot.find("#"+l.generateID("cod"+u)).addClass("highlight-prev"),T=o.line,T=l.domRoot.find("#lineNo"+T).offset().top,e=a.offset().top,a.scrollTop(),v=a.height(),e<=T&&T<e+v-30||(T=o.line,T=l.domRoot.find("#lineNo"+T).offset().top,e=a.offset().top,P=a.scrollTop(),j=a.height(),a.stop(),a.animate({scrollTop:P+(T-e-Math.round(j/2))},300)),l.curLineNumber=s,l.prevLineNumber=u,l.curLineIsReturn=h,l.prevLineIsReturn=p}(),l.domRoot.find("#htmlOutputDiv").empty(),o.html_output&&(o.css_output&&l.domRoot.find("#htmlOutputDiv").append('<style type="text/css">'+o.css_output+"</style>"),l.domRoot.find("#htmlOutputDiv").append(o.html_output),o.js_output)&&l.domRoot.find("#htmlOutputDiv").append('<script type="text/javascript">'+o.js_output+"<\/script>"),o=this.curTrace[this.curInstr],a=this.curTraceLayouts[this.curInstr],this.renderDataStructures(o,a),this.enterViewAnnotationsMode(),l.domRoot.find("#dataViz").height()!=e&&this.params.heightChangeCallback&&this.params.heightChangeCallback(this),(s=l.domRoot.find("#rawUserInputDiv")).hide(),r)&&l.executeCodeWithRawInputFunc&&l.promptForUserInput&&s.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(0<this.curTrace.length),$.each(this.curTrace,(function(e,n){var i=t.curTraceLayouts[t.curTraceLayouts.length-1],r=$.extend(!0,[],i),o=d3.map(),a=($.each(r,(function(t,e){for(var n=1;n<e.length;n++)o.set(e[n],1)})),d3.map());function s(e,i,r){var o,a=n.heap[e];if(t.isCppMode()){if(!a)return}else assert(a);e=a,((o=t.try_hook("isLinearObj",{heapObj:e}))[0]?o[1]:"LIST"==e[0]||"TUPLE"==e[0]||"SET"==e[0])?$.each(a,(function(e,n){e<1||t.isPrimitiveType(n)||(e=getRefID(n),t.disableHeapNesting?l(e,[],[]):l(e,i,r))})):"DICT"==a[0]?$.each(a,(function(e,o){e<1||(t.disableHeapNesting&&(e=o[0],t.isPrimitiveType(e)||l(getRefID(e),[],[])),e=o[1],t.isPrimitiveType(e))||(o=getRefID(e),t.structurallyEquivalent(a,n.heap[o])?l(o,i,r):t.disableHeapNesting&&l(o,[],[]))})):"INSTANCE"==a[0]||"CLASS"==a[0]?jQuery.each(a,(function(e,o){e<("INSTANCE"==a[0]?2:3)||(t.disableHeapNesting&&(e=o[0],t.isPrimitiveType(e)||l(getRefID(e),[],[])),e=o[1],t.isPrimitiveType(e))||(o=getRefID(e),t.structurallyEquivalent(a,n.heap[o])?l(o,i,r):t.disableHeapNesting&&l(o,[],[]))})):"C_ARRAY"!=a[0]&&"C_STRUCT"!=a[0]||u(a)}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(0<i)return{row:n,index:i}}return null}(t),l=a.has(t);if(a.set(t,1),i){var u=i.row;i=i.index;if(o.remove(t),!l&&1<n.length){for(var c=[i,0],d=1;d<n.length;d++)c.push(n[d]),o.remove(n[d]);u.splice.apply(u,c),n.splice(0,n.length)}s(t,u,[])}else if(0==n.length&&n.push("row"+t),n.push(t),s(t,e,n),0<n.length){if(e&&0<e.length)for(d=1;d<n.length;d++)e.push(n[d]);else r.push($.extend(!0,[],n));for(d=1;d<n.length;d++)o.remove(n[d]);n.splice(0,n.length)}}}function u(t){t&&(isHeapRef(t,n.heap)&&l(getRefID(t),null,[]),"C_ARRAY"===t[0]?$.each(t,(function(t,e){t<2||u(e)})):"C_STRUCT"===t[0]&&$.each(t,(function(t,e){t<3||u(e[1])})))}$.each(n.ordered_globals,(function(e,i){void 0!==(i=n.globals[i])&&(t.isCppMode()?u(i):t.isPrimitiveType(i)||l(getRefID(i),null,[]))})),$.each(n.stack_to_render,(function(e,n){$.each(n.ordered_varnames,(function(e,i){i=n.encoded_locals[i],t.isCppMode()?u(i):t.isPrimitiveType(i)||l(getRefID(i),null,[])}))})),o.forEach((function(t,e){t=Number(t),$.each(r,(function(e,n){var i=n.indexOf(t);0<i&&n.splice(i,1)}))})),r=r.filter((function(t){return 1<t.length})),t.curTraceLayouts.push(r)})),this.curTraceLayouts.splice(0,1),assert(this.curTrace.length==this.curTraceLayouts.length)};var heapPtrSrcRE=/__heap_pointer_src_/,rightwardNudgeHack=!0,highlightedLineColor=(ExecutionVisualizer.prototype.renderDataStructures=function(t,e){var n,i,r,o,a,s,l,u,c=this;function d(t,e){!c.isCppMode()||c.domRoot.find("#"+e).length?c.jsPlumbInstance.connect({source:t,target:e,scope:"varValuePointer"}):c.domRoot.find("#"+t).html("💩")}function h(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"})}function p(t){c.jsPlumbInstance.select().each((function(e){var n=e.source.closest(".stackFrame");n.attr("id")==t?(e.setPaintStyle({lineWidth:1,strokeStyle:connectorBaseColor}),e.endpoints[0].setPaintStyle({fillStyle:connectorBaseColor}),$(e.canvas).css("z-index",1e3)):c.jsPlumbManager.heapConnectionEndpointIDs.has(e.endpoints[0].elementId)||0<n.length&&(e.setPaintStyle({lineWidth:1,strokeStyle:connectorInactiveColor}),e.endpoints[0].setPaintStyle({fillStyle:connectorInactiveColor}),$(e.canvas).css("z-index",0))})),c.domRoot.find(".stackFrame").removeClass("highlightedStackFrame"),c.domRoot.find("#"+t).addClass("highlightedStackFrame")}c.tabularView||(c.resetJsPlumbManager(),n=d3.map(),c.jsPlumbInstance.select({scope:"varValuePointer"}).each((function(t){t.sourceId.match(heapPtrSrcRE)||n.set(t.sourceId,t.targetId)})),i=d3.map(),c.jsPlumbInstance.select({scope:"frameParentPointer"}).each((function(t){i.set(t.sourceId,t.targetId)})),$.each(e,(function(t,e){for(var n=0;n<e.length;n++){var i=e[n];i=c.generateHeapObjID(i,c.curInstr);c.jsPlumbManager.renderedHeapObjectIDs.set(i,1)}})),c.domRoot.find("#heap").empty().html('<div id="heapHeader">Objects</div>'),(e=c.domRootD3.select("#heap").selectAll("table.heapRow").attr("id",(function(t,e){return"heapRow"+e})).data(e,(function(t){return t[0]}))).enter().append("table").attr("id",(function(t,e){return"heapRow"+e})).attr("class","heapRow"),e.exit().each((function(t,e){$(this).empty()})).remove(),(e=e.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})),e.order().each((function(e,n){$(this).empty(),c.isCppMode()&&void 0===t.heap[e]||c.renderCompoundObject(e,c.curInstr,$(this),!0)})),e.exit().each((function(t,e){$(this).empty()})).remove(),r=[],$.each(t.ordered_globals,(function(e,n){void 0!==t.globals[n]&&r.push(n)})),o=c.generateID("globals"),e=c.generateID("global_table"),(e=c.domRootD3.select("#"+e).selectAll("tr").data(r,(function(t){return t}))).enter().append("tr").attr("class","variableTr").attr("id",(function(t,e){return c.generateID(varnameToCssID("global__"+t+"_tr"))})),(a=e.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"})),a.order().each((function(e,i){var r,o;0==i?$(this).html(e):($(this).empty(),i=c.generateID("global__"+varnameToCssID(e)),n.remove(i),e=t.globals[e],c.isPrimitiveType(e)?c.renderPrimitiveObject(e,$(this)):"C_STRUCT"===e[0]||"C_ARRAY"===e[0]?c.renderCStructArray(e,c.curInstr,$(this)):(r=c.generateHeapObjID(getRefID(e),c.curInstr),c.textualMemoryLabels?(o=i+"_text_label",$(this).append('<div class="objectIdLabel" id="'+o+'">id'+getRefID(e)+"</div>"),$(this).find("div#"+o).hover((function(){c.jsPlumbInstance.connect({source:o,target:r,scope:"varValuePointer"})}),(function(){c.jsPlumbInstance.select({source:o}).detach()}))):($(this).append('<div class="stack_pointer" id="'+i+'">&nbsp;</div>'),assert(!c.jsPlumbManager.connectionEndpointIDs.has(i)),c.jsPlumbManager.connectionEndpointIDs.set(i,r))))})),a.exit().each((function(t,e){$(this).empty()})).remove(),e.exit().each((function(t,e){$(this).find(".stack_pointer").each((function(t,e){n.remove($(e).attr("id"))})),$(this).empty()})).remove(),0==t.ordered_globals.length?this.domRoot.find("#"+o).hide():this.domRoot.find("#"+o).show(),(e=(a=c.domRootD3.select("#stack").selectAll("div.stackFrame,div.zombieStackFrame").data(t.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(e,n){var i,r;c.drawParentPointers&&(i=$(this).attr("id"),0<e.parent_frame_id_list.length?(r=e.parent_frame_id_list[0],c.domRoot.find("div#stack [data-frame_id="+r+"]").each((function(t,e){var n=$(this).attr("id");c.jsPlumbManager.parentPointerConnectionEndpointIDs.set(i,n)}))):0<t.ordered_globals.length&&c.jsPlumbManager.parentPointerConnectionEndpointIDs.set(i,o),r=e.frame_id,c.domRoot.find("div#stack [data-parent_frame_id="+r+"]").each((function(t,e){var n=$(this).attr("id");c.jsPlumbManager.parentPointerConnectionEndpointIDs.set(n,i)})))}))).append("div").attr("class","stackFrameHeader").html((function(t,e){var n=htmlspecialchars(t.func_name).replace("&lt;lambda&gt;","λ").replace("\n","<br/>");return(t.is_parent||c.showAllFrameLabels)&&(n="f"+t.frame_id+": "+n),0<t.parent_frame_id_list.length?n=n+" [parent=f"+t.parent_frame_id_list[0]+"]":c.showAllFrameLabels&&(n+=" [parent=Global]"),n})),e.append("table").attr("class","stackFrameVarTable"),(e=a.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}))).enter().append("tr").attr("class","variableTr").attr("id",(function(t,e){return c.generateID(varnameToCssID(t.frame.unique_hash+"__"+t.varname+"_tr"))})),(l=e.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"})),l.order().each((function(t,e){var i,r,o=t.varname;t=t.frame;0==e?"__return__"==o?$(this).html('<span class="retval">Return<br/>value</span>'):$(this).html(o):($(this).empty(),e=c.generateID(varnameToCssID(t.unique_hash+"__"+o)),n.remove(e),t=t.encoded_locals[o],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?(r=e+"_text_label",$(this).append('<div class="objectIdLabel" id="'+r+'">id'+getRefID(t)+"</div>"),$(this).find("div#"+r).hover((function(){c.jsPlumbInstance.connect({source:r,target:i,scope:"varValuePointer"})}),(function(){c.jsPlumbInstance.select({source:r}).detach()}))):($(this).append('<div class="stack_pointer" id="'+e+'">&nbsp;</div>'),assert(!c.jsPlumbManager.connectionEndpointIDs.has(e)),c.jsPlumbManager.connectionEndpointIDs.set(e,i))))})),l.exit().each((function(t,e){$(this).empty()})).remove(),e.exit().each((function(t,e){$(this).find(".stack_pointer").each((function(t,e){n.remove($(e).attr("id"))})),$(this).empty()})).remove(),a.exit().each((function(t,e){$(this).find(".stack_pointer").each((function(t,e){n.remove($(e).attr("id"))}));var r=$(this).attr("id");i.forEach((function(t,e){t!=r&&e!=r||i.remove(t)})),$(this).empty()})).remove(),rightwardNudgeHack&&(s={},(l=c.jsPlumbManager.heapConnectionEndpointIDs.keys()).sort(),$.each(l,(function(t,e){var n,i,r=c.jsPlumbManager.heapConnectionEndpointIDs.get(e),o=(e=c.domRoot.find("#"+e)).closest(".heapObject"),a=(assert("heapObject"==(r=c.domRoot.find("#"+r)).attr("class")),o.closest(".heapRow")),l=r.closest(".heapRow"),u=a.attr("id");a=l.attr("id");u!=a&&(l=e.offset().left,o.offset().left,(e=r.offset().left)<l)&&(r.css("margin-left","+="+(n=l-e+32)),void 0===(i=s[u])&&(i=d3.map(),s[u]=i),i.set(a,1),o=s[a])&&o.forEach((function(t,e){t!=u&&(c.domRoot.find("#"+t).css("margin-left","+="+n),i.set(t,1))}))}))),c.jsPlumbInstance.reset(),c.textualMemoryLabels||(c.isCppMode()||n.forEach(d),c.jsPlumbManager.connectionEndpointIDs.forEach(d)),c.drawParentPointers&&(i.forEach(h),c.jsPlumbManager.parentPointerConnectionEndpointIDs.forEach(h)),u=!1,$.each(t.stack_to_render,(function(t,e){e.is_highlighted&&(p(c.generateID("stack"+t)),u=!0)})),u||p(c.generateID("globals")),c.try_hook("end_renderDataStructures",{myViz:c}))},ExecutionVisualizer.prototype.renderTabularView=function(){var t=this,e=(t.resetJsPlumbManager(),[]),n={},i=[],r=($.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)}))}))})),["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,a=t.domRootD3.select("#optTabularView").append("table"),s=((o=((o=(a.attr("id","optTable"),a.append("thead").attr("class","stepTableThead").append("tr"))).attr("class","stepTableTr"),o.selectAll("thead td").data(r).enter().append("td").attr("class","stepTableTd").html((function(t){return t})),a.append("tbody"))).attr("class","stepTableTbody"),[]);$.each(t.curTrace,(function(t,e){s.push([t,e])})),o.selectAll("tbody tr").data(s).enter().append("tr").attr("step",(function(t,e){return e})).attr("class","stepTableTr").selectAll("td").data((function(t){return r=t[1],o=[""],$.each(e,(function(t,e){o.push(r.globals[e])})),a=null,$.each(r.stack_to_render,(function(t,e){e.is_highlighted&&(a=e)})),$.each(i,(function(t,e){$.each(n[e],(function(t,n){var i=!1;a&&e==a.func_name&&(n=a.encoded_locals[n])&&(o.push(n),i=!0),i||o.push(void 0)}))})),o;var r,o,a})).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,i,r,o,a,s,l,u=this;this.try_hook("renderPrimitiveObject",{obj:t,d3DomElement:e})[0]||(n=typeof t,null==t?e.append('<span class="nullObj">'+this.getRealLabel("None")+"</span>"):"number"==n?e.append('<span class="numberObj">'+t+"</span>"):"boolean"==n?t?e.append('<span class="boolObj">'+this.getRealLabel("True")+"</span>"):e.append('<span class="boolObj">'+this.getRealLabel("False")+"</span>"):"string"==n?(s=(s=(s=htmlspecialchars(t)).replace(new RegExp("\n","g"),"<br/>")).replace(new RegExp('"',"g"),'\\"'),e.append('<span class="stringObj">'+(s='"'+s+'"')+"</span>")):"object"==n?"C_DATA"==t[0]?("short int"===(n=t[2])?n="short":"short unsigned int"===n?n="unsigned short":"long int"===n?n="long":"long long int"===n?n="long long":"long unsigned int"===n?n="unsigned long":"long long unsigned int"===n&&(n="unsigned long long int"),a="pointer"===n&&"<UNINITIALIZED>"!==t[3]&&"<UNALLOCATED>"!==t[3],o=t[1],i="",u.debugMode&&(i=o+"<br/>"),r=u.generateHeapObjID("cdata_"+o,u.curInstr),a?(e.append('<div id="'+r+'" class="cdataHeader">'+i+n+"</div>"),a=t[3],o=u.generateHeapObjID("ptrSrc_"+o,u.curInstr),a=u.generateHeapObjID("cdata_"+a,u.curInstr),l="",u.debugMode&&(l=a),e.append('<div style="width: 10px;" id="'+o+'" class="cdataElt">&nbsp;'+l+"</div>"),assert(!u.jsPlumbManager.connectionEndpointIDs.has(o)),u.jsPlumbManager.connectionEndpointIDs.set(o,a)):(e.append('<div class="cdataHeader">'+i+n+"</div>"),l="",l="string"==typeof t[3]?"<UNINITIALIZED>"===(s=t[3])?'<span class="cdataUninit">?</span>':"<UNALLOCATED>"==s?"💀":htmlspecialchars(s="'"+(s=(s=(s=s.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">'+l+"</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,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,o,a,s,l,u,c,d,h,p,f,g,m,v,y=this,b=y.generateHeapObjID(t,e);!i&&y.jsPlumbManager.renderedHeapObjectIDs.has(b)?(a=y.generateID("heap_pointer_src_"+y.jsPlumbManager.heap_pointer_src_id),y.jsPlumbManager.heap_pointer_src_id++,r=b,y.textualMemoryLabels?(n.append('<div class="objectIdLabel" id="'+(o=a+"_text_label")+'">id'+t+"</div>"),y.domRoot.find("div#"+o).hover((function(){y.jsPlumbInstance.connect({source:o,target:r,scope:"varValuePointer"})}),(function(){y.jsPlumbInstance.select({source:o}).detach()}))):(n.append('<div id="'+a+'">&nbsp;</div>'),assert(!y.jsPlumbManager.connectionEndpointIDs.has(a)),y.jsPlumbManager.connectionEndpointIDs.set(a,r),assert(!y.jsPlumbManager.heapConnectionEndpointIDs.has(a)),y.jsPlumbManager.heapConnectionEndpointIDs.set(a,r))):(n.append('<div class="heapObject" id="'+b+'"></div>'),n=y.domRoot.find("#"+b),y.jsPlumbManager.renderedHeapObjectIDs.set(b,1),a=y.curTrace[e].heap[t],assert($.isArray(a)),b="",y.textualMemoryLabels&&(b="id"+t+":"),y.try_hook("renderCompoundObject",{objID:t,d3DomElement:n,isTopLevel:i,obj:a,typeLabelPrefix:b,stepNum:e,myViz:y})[0]||("LIST"==a[0]||"TUPLE"==a[0]||"SET"==a[0]||"DICT"==a[0]?(s=a[0].toLowerCase(),assert(1<=a.length),1==a.length?n.append('<div class="typeLabel">'+b+" empty "+y.getRealLabel(s)+"</div>"):(n.append('<div class="typeLabel">'+b+y.getRealLabel(s)+"</div>"),n.append('<table class="'+s+'Tbl"></table>'),f=n.children("table"),"LIST"==a[0]||"TUPLE"==a[0]?(f.append("<tr></tr><tr></tr>"),l=f.find("tr:first"),u=f.find("tr:last"),$.each(a,(function(t,n){t<1||(l.append('<td class="'+s+'Header"></td>'),l.find("td:last").append(t-1),u.append('<td class="'+s+'Elt"></td>'),y.renderNestedObject(n,e,u.find("td:last")))}))):"SET"==a[0]?(t=a.length-1,3<(i=Math.round(Math.sqrt(t)))&&--i,c=Math.round(t/i),t%i&&(c+=1),jQuery.each(a,(function(t,n){t<1||((t-1)%c==0&&f.append("<tr></tr>"),(t=f.find("tr:last")).append('<td class="setElt"></td>'),y.renderNestedObject(n,e,t.find("td:last")))}))):"DICT"==a[0]&&$.each(a,(function(t,n){var i,r;t<1||(f.append('<tr class="dictEntry"><td class="dictKey"></td><td class="dictVal"></td></tr>'),i=(t=f.find("tr:last")).find("td:first"),t=t.find("td:last"),r=n[0],n=n[1],y.renderNestedObject(r,e,i),y.renderNestedObject(n,e,t))})))):"INSTANCE"==a[0]||"CLASS"==a[0]?(t="INSTANCE"==a[0],assert(a.length>=(d=t?2:3)),t?n.append('<div class="typeLabel">'+b+a[1]+" "+y.getRealLabel("instance")+"</div>"):(i="",0<a[2].length&&(i+="[extends "+a[2].join(", ")+"] "),n.append('<div class="typeLabel">'+b+a[1]+" class "+i+'<br/><a href="#" id="attrToggleLink">hide attributes</a></div>')),a.length>d&&(n.append('<table class="'+(h=t?"inst":"class")+'Tbl"></table>'),f=n.children("table"),$.each(a,(function(t,n){var i,r;t<d||(f.append('<tr class="'+h+'Entry"><td class="'+h+'Key"></td><td class="'+h+'Val"></td></tr>'),i=(t=f.find("tr:last")).find("td:first"),t=t.find("td:last"),"string"==typeof n[0]?(r=htmlspecialchars(n[0]),i.append('<span class="keyObj">'+r+"</span>")):y.renderNestedObject(n[0],e,i),y.renderNestedObject(n[1],e,t))}))),t||($(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")?(y.classAttrsHidden[n.selector]=!1,$(this).html("hide attributes")):(y.classAttrsHidden[n.selector]=!0,$(this).html("show attributes")),y.redrawConnectors(),!1})),y.classAttrsHidden[n.selector]&&($(n.selector+" .classTbl").hide(),$(n.selector+" .typeLabel #attrToggleLink").html("show attributes")))):"INSTANCE_PPRINT"==a[0]?(n.append('<div class="typeLabel">'+b+a[1]+" instance</div>"),v=htmlspecialchars(a[2]),n.append('<table class="customObjTbl"><tr><td class="customObjElt">'+v+"</td></tr></table>")):"FUNCTION"==a[0]?(assert(3==a.length),g=htmlspecialchars(a[1]).replace("&lt;lambda&gt;","λ"),p=a[2],y.compactFuncLabels||n.append('<div class="typeLabel">'+b+y.getRealLabel("function")+"</div>"),i=y.compactFuncLabels?"func":"",p?n.append('<div class="funcObj">'+i+" "+g+" [parent=f"+p+"]</div>"):y.showAllFrameLabels?n.append('<div class="funcObj">'+i+" "+g+" [parent=Global]</div>"):n.append('<div class="funcObj">'+i+" "+g+"</div>")):"JS_FUNCTION"==a[0]?(assert(5==a.length),g=htmlspecialchars(a[1]),t=b+htmlspecialchars(a[2]),i=a[3],p=a[4],i||p||y.showAllFrameLabels?(n.append('<table class="classTbl"></table>'),(f=n.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,n){f.append('<tr class="classEntry"><td class="classKey"></td><td class="classVal"></td></tr>');var i=(r=f.find("tr:last")).find("td:first"),r=r.find("td:last");i.append('<span class="keyObj">'+htmlspecialchars(n[0])+"</span>"),y.renderNestedObject(n[1],e,r)}))),p?f.append('<tr class="classEntry"><td class="classKey">parent</td><td class="classVal">f'+p+"</td></tr>"):y.showAllFrameLabels&&f.append('<tr class="classEntry"><td class="classKey">parent</td><td class="classVal">global</td></tr>')):n.append('<pre class="funcCode">'+t+"</pre>")):"HEAP_PRIMITIVE"==a[0]?(assert(3==a.length),m=a[1],g=a[2],n.append('<div class="heapPrimitive"></div>'),n.find("div.heapPrimitive").append('<div class="typeLabel">'+b+m+"</div>"),y.renderPrimitiveObject(g,n.find("div.heapPrimitive"))):"C_STRUCT"==a[0]||"C_ARRAY"==a[0]?y.renderCStructArray(a,e,n):(assert(2==a.length),m=a[0],v=htmlspecialchars(v=a[1]),n.append('<div class="typeLabel">'+b+m+"</div>"),n.append('<table class="customObjTbl"><tr><td class="customObjElt">'+v+"</td></tr></table>"))))},ExecutionVisualizer.prototype.renderCStructArray=function(t,e,n){var i,r,o,a,s,l,u=this;"C_STRUCT"==t[0]?(assert(3<=t.length),r=t[1],i=t[2],o="",u.debugMode&&(o=r+"<br/>"),"cpp"===u.params.lang?n.append('<div class="typeLabel">'+o+"object "+i+"</div>"):n.append('<div class="typeLabel">'+o+"struct "+i+"</div>"),3<t.length&&(n.append('<table class="instTbl"></table>'),a=n.children("table"),$.each(t,(function(t,n){var i,r;t<3||(a.append('<tr class="instEntry"><td class="instKey"></td><td class="instVal"></td></tr>'),i=(t=a.find("tr:last")).find("td:first"),t=t.find("td:last"),assert("string"==typeof n[0]),r=htmlspecialchars(n[0]),i.append('<span class="keyObj">'+r+"</span>"),u.renderNestedObject(n[1],e,t))})))):(assert("C_ARRAY"==t[0]),assert(2<=t.length),r=t[1],o="",u.debugMode&&(o=r+"<br/>"),n.append('<div class="typeLabel">'+o+"array</div>"),n.append('<table class="cArrayTbl"></table>'),(a=n.children("table")).append("<tr></tr><tr></tr>"),s=a.find("tr:first"),l=a.find("tr:last"),$.each(t,(function(t,n){t<2||(s.append('<td class="cArrayHeader"></td>'),s.find("td:last").append(t-2),l.append('<td class="cArrayElt"></td>'),u.renderNestedObject(n,e,l.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"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"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 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,"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"),n=(t=$("#"+t).offset().top,e.offset().top);e.scrollTop(),e=e.height();return n<=t&&t<n+e-25}function traceQCheckMe(t,e,n){var i,r=$("#"+e).data("vis"),o=r.curInstr,a=r.curTrace[o+1],s=(t=$("#"+t).val(),n.split(".")),l=a;for(i in s)l=l[s[i]];n=$("#"+e+"_feedbacktext"),0<t.length&&t==l?n.html("Correct"):n.html(r.curTrace[o].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,e=(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=t.d3DomElement,typeof e);if(null==e)t.append('<span class="nullObj">null</span>');else if("number"==n)t.append('<span class="numberObj">'+e+"</span>");else if("boolean"==n)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];n=e[1].charCodeAt(0),e=e[1];for(var i=n.toString(16);i.length<4;)i="0"+i;i="\\u"+i,"\n"==e?i="\\n":"\r"==e?i="\\r":"\t"==e?i="\\t":"\b"==e?i="\\b":"\f"==e?i="\\f":"'"==e?i="\\'":'"'==e?i='\\"':"\\"==e?i="\\\\":32<=n&&(i=e),t.append('<span class="stringObj">\''+i+"'</span>")}return[!0]})),this.add_pytutor_hook("isPrimitiveType",(function(t){return(t=t.obj)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 e=(t=t.myViz).curTrace[t.curInstr];return t.params.stdin&&""!=t.params.stdin&&(e=e.stdinPosition||0,e='<span style="color:lightgray;text-decoration: line-through">'+i(t.params.stdin.substr(0,e))+"</span>"+i(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 n=0;n<e.curTrace.length;n++)e.curTrace[n].stdout||(e.curTrace[n].stdout=" ")})),this.add_pytutor_hook("end_render",(function(t){(t=t.myViz).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){return"STACK"==(t=t.heapObj)[0]||"QUEUE"==t[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();t={list:"array",queue:"queue",stack:"stack"}[a];if(1==n.length)e.append('<div class="typeLabel">'+i+"empty "+t+"</div>");else{if(e.append('<div class="typeLabel">'+i+t+"</div>"),e.append('<table class="'+a+'Tbl"></table>'),i=e.children("table"),"LIST"==n[0]){i.append("<tr></tr><tr></tr>");for(var s=i.find("tr:first"),l=i.find("tr:last"),u=1,c=0;u<n.length;u++){var d=n[u],h=d instanceof Array&&"ELIDE"==d[0];s.append('<td class="'+a+'Header"></td>'),s.find("td:last").append(h?"&hellip;":c),l.append('<td class="'+a+'Elt"></td>'),h?(l.find("td:last").append("&hellip;"),c+=d[1]):(r.renderNestedObject(d,o,l.find("td:last")),c++)}}"STACK"==n[0]&&(i.append("<tr></tr><tr></tr>"),(l=i.find("tr:last")).append('<td class="'+a+'FElt"><span class="stringObj symbolic">&#8596;</span></td>'),$.each(n,(function(t,e){t<1||(l.append('<td class="'+a+'Elt"></td>'),r.renderNestedObject(e,o,l.find("td:last")))})),l.append('<td class="'+a+'LElt"></td>')),"QUEUE"==n[0]&&(i.append("<tr></tr><tr></tr>"),(l=i.find("tr:last")).append('<td class="'+a+'FElt"><span class="stringObj symbolic">&#8592;</span></td>'),$.each(n,(function(t,e){t<1||(l.append('<td class="'+a+'Elt"></td>'),r.renderNestedObject(e,o,l.find("td:last")))})),l.append('<td class="'+a+'LElt"><span class="stringObj symbolic">&#8592;</span></td>'))}return[!0]})),this.add_pytutor_hook("end_renderDataStructures",(function(t){(t=t.myViz).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){return t=t.replace(/[^0-9a-zA-Z_]/g,(function(t){return"-"+t.charCodeAt(0)+"-"})),e(t)},{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"}),i=function(t){return String(t).replace(/[&<>"'\/]/g,(function(t){return n[t]}))}};