diff --git a/dist/complexviewer.js b/dist/complexviewer.js index d146dae..9e7596c 100644 --- a/dist/complexviewer.js +++ b/dist/complexviewer.js @@ -1,4 +1,4 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.complexviewer=e():t.complexviewer=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){var r,i;!function(){var o={version:"3.5.17"},a=[].slice,s=function(t){return a.call(t)},u=this.document;function c(t){return t&&(t.ownerDocument||t.document||t).documentElement}function l(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(u)try{s(u.documentElement.childNodes)[0].nodeType}catch(t){s=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),u)try{u.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var f=this.Element.prototype,h=f.setAttribute,p=f.setAttributeNS,d=this.CSSStyleDeclaration.prototype,y=d.setProperty;f.setAttribute=function(t,e){h.call(this,t,e+"")},f.setAttributeNS=function(t,e,n){p.call(this,t,e,n+"")},d.setProperty=function(t,e,n){y.call(this,t,e+"",n)}}function g(t,e){return te?1:t>=e?0:NaN}function v(t){return null===t?NaN:+t}function x(t){return!isNaN(t)}function m(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);r>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);r>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}o.ascending=g,o.descending=function(t,e){return et?1:e>=t?0:NaN},o.min=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++ir&&(n=r)}else{for(;++i=r){n=r;break}for(;++ir&&(n=r)}return n},o.max=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++in&&(n=r)}else{for(;++i=r){n=r;break}for(;++in&&(n=r)}return n},o.extent=function(t,e){var n,r,i,o=-1,a=t.length;if(1===arguments.length){for(;++o=r){n=i=r;break}for(;++or&&(n=r),i=r){n=i=r;break}for(;++or&&(n=r),i1)return a/(u-1)},o.deviation=function(){var t=o.variance.apply(this,arguments);return t?Math.sqrt(t):t};var b=m(g);function w(t){return t.length}o.bisectLeft=b.left,o.bisect=o.bisectRight=b.right,o.bisector=function(t){return m(1===t.length?function(e,n){return g(t(e),n)}:t)},o.shuffle=function(t,e,n){(o=arguments.length)<3&&(n=t.length,o<2&&(e=0));for(var r,i,o=n-e;o;)i=Math.random()*o--|0,r=t[o+e],t[o+e]=t[i+e],t[i+e]=r;return t},o.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},o.pairs=function(t){for(var e=0,n=t.length-1,r=t[0],i=new Array(n<0?0:n);e=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n};var k=Math.abs;function S(t){for(var e=1;t*e%1;)e*=10;return e}function _(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function M(){this._=Object.create(null)}o.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 r,i=[],o=S(k(n)),a=-1;if(t*=o,e*=o,(n*=o)<0)for(;(r=t+n*++a)>e;)i.push(r/o);else for(;(r=t+n*++a)=r.length)return e?e.call(n,o):t?o.sort(t):o;for(var u,c,l,f,h=-1,p=o.length,d=r[s++],y=new M;++h=r.length)return e;var o=[],a=i[n++];return e.forEach((function(e,r){o.push({key:e,values:t(r,n)})})),a?o.sort((function(t,e){return a(t.key,e.key)})):o}(a(o.map,t,0),0)},n.key=function(t){return r.push(t),n},n.sortKeys=function(t){return i[r.length-1]=t,n},n.sortValues=function(e){return t=e,n},n.rollup=function(t){return e=t,n},n},o.set=function(t){var e=new O;if(t)for(var n=0,r=t.length;n=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},o.event=null,o.requote=function(t){return t.replace(F,"\\$&")};var F=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]};function X(t){return U(t,$),t}var W=function(t,e){return e.querySelector(t)},Y=function(t,e){return e.querySelectorAll(t)},Z=function(t,e){var n=t.matches||t[I(t,"matchesSelector")];return(Z=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(W=function(t,e){return Sizzle(t,e)[0]||null},Y=Sizzle,Z=Sizzle.matchesSelector),o.selection=function(){return o.select(u.documentElement)};var $=o.selection.prototype=[];function K(t){return"function"==typeof t?t:function(){return W(t,this)}}function J(t){return"function"==typeof t?t:function(){return Y(t,this)}}$.select=function(t){var e,n,r,i,o=[];t=K(t);for(var a=-1,s=this.length;++a=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),tt.hasOwnProperty(n)?{space:tt[n],local:t}:t}},$.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return(t=o.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(et(e,t[e]));return this}return this.each(et(t,e))},$.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=it(t)).length,i=-1;if(e=n.classList){for(;++i=0;)(n=r[i])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},$.sort=function(t){t=pt.apply(this,arguments);for(var e=-1,n=this.length;++e=e&&(e=i+1);!(a=s[e])&&++e0&&(t=t.slice(0,i));var u=mt.get(t);function c(){var e=this[r];e&&(this.removeEventListener(t,e,e.$),delete this[r])}return u&&(t=u,a=wt),i?e?function(){var i=a(e,s(arguments));c.call(this),this.addEventListener(t,this[r]=i,i.$=n),i._=e}:c:e?q:function(){var e,n=new RegExp("^__on([^.]+)"+o.requote(t)+"$");for(var r in this)if(e=r.match(n)){var i=this[r];this.removeEventListener(e[1],i,i.$),delete this[r]}}}o.selection.enter=yt,o.selection.enter.prototype=gt,gt.append=$.append,gt.empty=$.empty,gt.node=$.node,gt.call=$.call,gt.size=$.size,gt.select=function(t){for(var e,n,r,i,o,a=[],s=-1,u=this.length;++s0?1:t<0?-1:0}function Rt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function qt(t){return t>1?0:t<-1?Tt:Math.acos(t)}function zt(t){return t>1?Ot:t<-1?-Ot:Math.asin(t)}function Bt(t){return((t=Math.exp(t))+1/t)/2}function Ht(t){return(t=Math.sin(t/2))*t}var Gt=Math.SQRT2;o.interpolateZoom=function(t,e){var n,r,i=t[0],o=t[1],a=t[2],s=e[0],u=e[1],c=e[2],l=s-i,f=u-o,h=l*l+f*f;if(h0&&(t=t.transition().duration(y)),t.call(k.event)}function A(){s&&s.domain(a.range().map((function(t){return(t-h.x)/h.k})).map(a.invert)),f&&f.domain(c.range().map((function(t){return(t-h.y)/h.k})).map(c.invert))}function C(t){g++||t({type:"zoomstart"})}function L(t){A(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function T(t){--g||(t({type:"zoomend"}),e=null)}function N(){var t=this,e=w.of(t,arguments),n=0,r=o.select(l(t)).on(x,s).on(m,u),i=S(o.mouse(t)),a=_t(t);function s(){n=1,M(o.mouse(t),i),L(e)}function u(){r.on(x,null).on(m,null),a(n),T(e)}ws.call(t),C(e)}function P(){var t,e=this,n=w.of(e,arguments),r={},a=0,s=".zoom-"+o.event.changedTouches[0].identifier,u="touchmove"+s,c="touchend"+s,l=[],f=o.select(e),p=_t(e);function d(){var n=o.touches(e);return t=h.k,n.forEach((function(t){t.identifier in r&&(r[t.identifier]=S(t))})),n}function y(){var t=o.event.target;o.select(t).on(u,g).on(c,x),l.push(t);for(var n=o.event.changedTouches,s=0,f=n.length;s1){v=p[0];var m=p[1],b=v[0]-m[0],w=v[1]-m[1];a=b*b+w*w}}function g(){var s,u,c,l,f=o.touches(e);ws.call(e);for(var h=0,p=f.length;h360?t-=360:t<0&&(t+=360),t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,r=2*(n=n<0?0:n>1?1:n)-(i=n<=.5?n*(1+e):n+e-n*e),new se(o(t+120),o(t),o(t-120))}function $t(t,e,n){return this instanceof $t?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof $t?new $t(t.h,t.c,t.l):re(t instanceof Qt?t.l:(t=de((t=o.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new $t(t,e,n)}Yt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Wt(this.h,this.s,this.l/t)},Yt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Wt(this.h,this.s,t*this.l)},Yt.rgb=function(){return Zt(this.h,this.s,this.l)},o.hcl=$t;var Kt=$t.prototype=new Xt;function Jt(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Qt(n,Math.cos(t*=Dt)*e,Math.sin(t)*e)}function Qt(t,e,n){return this instanceof Qt?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof Qt?new Qt(t.l,t.a,t.b):t instanceof $t?Jt(t.h,t.c,t.l):de((t=se(t)).r,t.g,t.b):new Qt(t,e,n)}Kt.brighter=function(t){return new $t(this.h,this.c,Math.min(100,this.l+te*(arguments.length?t:1)))},Kt.darker=function(t){return new $t(this.h,this.c,Math.max(0,this.l-te*(arguments.length?t:1)))},Kt.rgb=function(){return Jt(this.h,this.c,this.l).rgb()},o.lab=Qt;var te=18,ee=Qt.prototype=new Xt;function ne(t,e,n){var r=(t+16)/116,i=r+e/500,o=r-n/200;return new se(ae(3.2404542*(i=.95047*ie(i))-1.5371385*(r=1*ie(r))-.4985314*(o=1.08883*ie(o))),ae(-.969266*i+1.8760108*r+.041556*o),ae(.0556434*i-.2040259*r+1.0572252*o))}function re(t,e,n){return t>0?new $t(Math.atan2(n,e)*jt,Math.sqrt(e*e+n*n),t):new $t(NaN,NaN,t)}function ie(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function oe(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ae(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function se(t,e,n){return this instanceof se?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof se?new se(t.r,t.g,t.b):he(""+t,se,Zt):new se(t,e,n)}function ue(t){return new se(t>>16,t>>8&255,255&t)}function ce(t){return ue(t)+""}ee.brighter=function(t){return new Qt(Math.min(100,this.l+te*(arguments.length?t:1)),this.a,this.b)},ee.darker=function(t){return new Qt(Math.max(0,this.l-te*(arguments.length?t:1)),this.a,this.b)},ee.rgb=function(){return ne(this.l,this.a,this.b)},o.rgb=se;var le=se.prototype=new Xt;function fe(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function he(t,e,n){var r,i,o,a=0,s=0,u=0;if(r=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(ge(i[0]),ge(i[1]),ge(i[2]))}return(o=ve.get(t))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(a=(3840&o)>>4,a|=a>>4,s=240&o,s|=s>>4,u=15&o,u|=u<<4):7===t.length&&(a=(16711680&o)>>16,s=(65280&o)>>8,u=255&o)),e(a,s,u))}function pe(t,e,n){var r,i,o=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),s=a-o,u=(a+o)/2;return s?(i=u<.5?s/(a+o):s/(2-a-o),r=t==a?(e-n)/s+(e0&&u<1?0:r),new Wt(r,i,u)}function de(t,e,n){var r=oe((.4124564*(t=ye(t))+.3575761*(e=ye(e))+.1804375*(n=ye(n)))/.95047),i=oe((.2126729*t+.7151522*e+.072175*n)/1);return Qt(116*i-16,500*(r-i),200*(i-oe((.0193339*t+.119192*e+.9503041*n)/1.08883)))}function ye(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ge(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}le.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;return e||n||r?(e&&e=200&&e<300||304===e){try{t=n.call(i,c)}catch(t){return void a.error.call(i,t)}a.load.call(i,t)}else a.error.call(i,c)}return this.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(t)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(t){var e=o.event;o.event=t;try{a.progress.call(i,c)}finally{o.event=e}},i.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?u[t]:(null==e?delete u[t]:u[t]=e+"",i)},i.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",i):e},i.responseType=function(t){return arguments.length?(l=t,i):l},i.response=function(t){return n=t,i},["get","post"].forEach((function(t){i[t]=function(){return i.send.apply(i,[t].concat(s(arguments)))}})),i.send=function(n,r,o){if(2===arguments.length&&"function"==typeof r&&(o=r,r=null),c.open(n,t,!0),null==e||"accept"in u||(u.accept=e+",*/*"),c.setRequestHeader)for(var s in u)c.setRequestHeader(s,u[s]);return null!=e&&c.overrideMimeType&&c.overrideMimeType(e),null!=l&&(c.responseType=l),null!=o&&i.on("error",o).on("load",(function(t){o(null,t)})),a.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},o.rebind(i,a,"on"),null==r?i:i.get(function(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}(r))}ve.forEach((function(t,e){ve.set(t,ue(e))})),o.functor=xe,o.xhr=me(D),o.dsv=function(t,e){var n=new RegExp('["'+t+"\n]"),r=t.charCodeAt(0);function i(t,n,r){arguments.length<3&&(r=n,n=null);var i=be(t,e,null==n?o:a(n),r);return i.row=function(t){return arguments.length?i.response(null==(n=t)?o:a(t)):n},i}function o(t){return i.parse(t.responseText)}function a(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(u).join(t)}function u(t){return n.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var n;return i.parseRows(t,(function(t,r){if(n)return n(t,r-1);var i=new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+"]"})).join(",")+"}");n=e?function(t,n){return e(i(t),n)}:i}))},i.parseRows=function(t,e){var n,i,o={},a={},s=[],u=t.length,c=0,l=0;function f(){if(c>=u)return a;if(i)return i=!1,o;var e=c;if(34===t.charCodeAt(e)){for(var n=e;n++24?(isFinite(e)&&(clearTimeout(_e),_e=setTimeout(Ae,e)),Se=0):(Se=1,Me(Ae))}function Ce(){for(var t=Date.now(),e=we;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Le(){for(var t,e=we,n=1/0;e;)e.c?(e.t8?function(t){return t/n}:function(t){return t*n},symbol:t}}));function Pe(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,a=r&&n?function(t,e){for(var i=t.length,o=[],a=0,s=r[0],u=0;i>0&&s>0&&(u+s+1>e&&(s=Math.max(1,e-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>e));)s=r[a=(a+1)%r.length];return o.reverse().join(n)}:D;return function(t){var n=Oe.exec(t),r=n[1]||" ",s=n[2]||">",u=n[3]||"-",c=n[4]||"",l=n[5],f=+n[6],h=n[7],p=n[8],d=n[9],y=1,g="",v="",x=!1,m=!0;switch(p&&(p=+p.substring(1)),(l||"0"===r&&"="===s)&&(l=r="0",s="="),d){case"n":h=!0,d="g";break;case"%":y=100,v="%",d="f";break;case"p":y=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===c&&(g="0"+d.toLowerCase());case"c":m=!1;case"d":x=!0,p=0;break;case"s":y=-1,d="r"}"$"===c&&(g=i[0],v=i[1]),"r"!=d||p||(d="g"),null!=p&&("g"==d?p=Math.max(1,Math.min(21,p)):"e"!=d&&"f"!=d||(p=Math.max(0,Math.min(20,p)))),d=De.get(d)||je;var b=l&&h;return function(t){var n=v;if(x&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===u?"":u;if(y<0){var c=o.formatPrefix(t,p);t=c.scale(t),n=c.symbol+v}else t*=y;var w,k,S=(t=d(t,p)).lastIndexOf(".");if(S<0){var _=m?t.lastIndexOf("e"):-1;_<0?(w=t,k=""):(w=t.substring(0,_),k=t.substring(_))}else w=t.substring(0,S),k=e+t.substring(S+1);!l&&h&&(w=a(w,1/0));var M=g.length+w.length+k.length+(b?0:i.length),E=M"===s?E+i+t:"^"===s?E.substring(0,M>>=1)+i+t+E.substring(M):i+(b?t:E+t))+n}}}o.formatPrefix=function(t,e){var n=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=o.round(t,Te(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Ne[8+n/3]};var Oe=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,De=o.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},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(t=o.round(t,Te(t,e))).toFixed(Math.max(0,Math.min(20,Te(t*(1+1e-15),e))))}});function je(t){return t+""}var Ie=o.time={},Re=Date;function qe(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}qe.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(){ze.setUTCDate.apply(this._,arguments)},setDay:function(){ze.setUTCDay.apply(this._,arguments)},setFullYear:function(){ze.setUTCFullYear.apply(this._,arguments)},setHours:function(){ze.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){ze.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){ze.setUTCMinutes.apply(this._,arguments)},setMonth:function(){ze.setUTCMonth.apply(this._,arguments)},setSeconds:function(){ze.setUTCSeconds.apply(this._,arguments)},setTime:function(){ze.setTime.apply(this._,arguments)}};var ze=Date.prototype;function Be(t,e,n){function r(e){var n=t(e),r=o(n,1);return e-n1)for(;a=c)return-1;if(37===(i=e.charCodeAt(s++))){if(a=e.charAt(s++),!(o=k[a in Ve?e.charAt(s++):a])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}l.utc=function(t){var e=l(t);function n(t){try{var n=new(Re=qe);return n._=t,e(n)}finally{Re=Date}}return n.parse=function(t){try{Re=qe;var n=e.parse(t);return n&&n._}finally{Re=Date}},n.toString=e.toString,n},l.multi=l.utc.multi=fn;var h=o.map(),p=We(a),d=Ye(a),y=We(s),g=Ye(s),v=We(u),x=Ye(u),m=We(c),b=Ye(c);i.forEach((function(t,e){h.set(t.toLowerCase(),e)}));var w={a:function(t){return s[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:l(e),d:function(t,e){return Xe(t.getDate(),e,2)},e:function(t,e){return Xe(t.getDate(),e,2)},H:function(t,e){return Xe(t.getHours(),e,2)},I:function(t,e){return Xe(t.getHours()%12||12,e,2)},j:function(t,e){return Xe(1+Ie.dayOfYear(t),e,3)},L:function(t,e){return Xe(t.getMilliseconds(),e,3)},m:function(t,e){return Xe(t.getMonth()+1,e,2)},M:function(t,e){return Xe(t.getMinutes(),e,2)},p:function(t){return i[+(t.getHours()>=12)]},S:function(t,e){return Xe(t.getSeconds(),e,2)},U:function(t,e){return Xe(Ie.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Xe(Ie.mondayOfYear(t),e,2)},x:l(n),X:l(r),y:function(t,e){return Xe(t.getFullYear()%100,e,2)},Y:function(t,e){return Xe(t.getFullYear()%1e4,e,4)},Z:cn,"%":function(){return"%"}},k={a:function(t,e,n){y.lastIndex=0;var r=y.exec(e.slice(n));return r?(t.w=g.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){p.lastIndex=0;var r=p.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){m.lastIndex=0;var r=m.exec(e.slice(n));return r?(t.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){v.lastIndex=0;var r=v.exec(e.slice(n));return r?(t.m=x.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,e,n){return f(t,w.c.toString(),e,n)},d:nn,e:nn,H:on,I:on,j:rn,L:un,m:en,M:an,p:function(t,e,n){var r=h.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)},S:sn,U:$e,w:Ze,W:Ke,x:function(t,e,n){return f(t,w.x.toString(),e,n)},X:function(t,e,n){return f(t,w.X.toString(),e,n)},y:Qe,Y:Je,Z:tn,"%":ln};return l}Ie.year=Be((function(t){return(t=Ie.day(t)).setMonth(0,1),t}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t){return t.getFullYear()})),Ie.years=Ie.year.range,Ie.years.utc=Ie.year.utc.range,Ie.day=Be((function(t){var e=new Re(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t){return t.getDate()-1})),Ie.days=Ie.day.range,Ie.days.utc=Ie.day.utc.range,Ie.dayOfYear=function(t){var e=Ie.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach((function(t,e){e=7-e;var n=Ie[t]=Be((function(t){return(t=Ie.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=Ie.year(t).getDay();return Math.floor((Ie.dayOfYear(t)+(n+e)%7)/7)-(n!==e)}));Ie[t+"s"]=n.range,Ie[t+"s"].utc=n.utc.range,Ie[t+"OfYear"]=function(t){var n=Ie.year(t).getDay();return Math.floor((Ie.dayOfYear(t)+(n+e)%7)/7)}})),Ie.week=Ie.sunday,Ie.weeks=Ie.sunday.range,Ie.weeks.utc=Ie.sunday.utc.range,Ie.weekOfYear=Ie.sundayOfYear;var Ve={"-":"",_:" ",0:"0"},Fe=/^\s*\d+/,Ue=/^%/;function Xe(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),n+i[0].length):-1}function tn(t,e,n){return/^[+-]\d{4}$/.test(e=e.slice(n,n+5))?(t.Z=-e,n+5):-1}function en(t,e,n){Fe.lastIndex=0;var r=Fe.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function nn(t,e,n){Fe.lastIndex=0;var r=Fe.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function rn(t,e,n){Fe.lastIndex=0;var r=Fe.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function on(t,e,n){Fe.lastIndex=0;var r=Fe.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function an(t,e,n){Fe.lastIndex=0;var r=Fe.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function sn(t,e,n){Fe.lastIndex=0;var r=Fe.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function un(t,e,n){Fe.lastIndex=0;var r=Fe.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function cn(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=k(e)/60|0,i=k(e)%60;return n+Xe(r,"0",2)+Xe(i,"0",2)}function ln(t,e,n){Ue.lastIndex=0;var r=Ue.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function fn(t){for(var e=t.length,n=-1;++n=0?1:-1,s=a*o,u=Math.cos(e),c=Math.sin(e),l=i*c,f=r*u+l*Math.cos(s),h=l*a*Math.sin(s);On.add(Math.atan2(h,f)),n=t,r=u,i=c}Dn.point=function(a,s){Dn.point=o,n=(t=a)*Dt,r=Math.cos(s=(e=s)*Dt/2+Tt/4),i=Math.sin(s)},Dn.lineEnd=function(){o(t,e)}}function In(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function Rn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function qn(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function zn(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Bn(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Hn(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Gn(t){return[Math.atan2(t[1],t[0]),zt(t[2])]}function Vn(t,e){return k(t[0]-e[0])Ct?r=90:c<-Ct&&(e=-90),f[0]=t,f[1]=n}};function p(i,o){l.push(f=[t=i,n=i]),or&&(r=o)}function d(o,a){var s=In([o*Dt,a*Dt]);if(u){var c=qn(u,s),l=qn([c[1],-c[0],0],c);Hn(l),l=Gn(l);var f=o-i,h=f>0?1:-1,d=l[0]*jt*h,y=k(f)>180;if(y^(h*ir&&(r=g);else if(y^(h*i<(d=(d+360)%360-180)&&dr&&(r=a);y?ob(t,n)&&(n=o):b(o,n)>b(t,n)&&(t=o):n>=t?(on&&(n=o)):o>i?b(t,o)>b(t,n)&&(n=o):b(o,n)>b(t,n)&&(t=o)}else p(o,a);u=s,i=o}function y(){h.point=d}function g(){f[0]=t,f[1]=n,h.point=p,u=null}function v(t,e){if(u){var n=t-i;c+=k(n)>180?n+(n>0?360:-360):n}else a=t,s=e;Dn.point(t,e),d(t,e)}function x(){Dn.lineStart()}function m(){v(a,s),Dn.lineEnd(),k(c)>Ct&&(t=-(n=180)),f[0]=t,f[1]=n,u=null}function b(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function S(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tb(y[0],y[1])&&(y[1]=p[1]),b(p[0],y[1])>b(y[0],y[1])&&(y[0]=p[0])):s.push(y=p);for(var u,c,p,d=-1/0,y=(a=0,s[c=s.length-1]);a<=c;y=p,++a)p=s[a],(u=b(y[1],p[0]))>d&&(d=u,t=p[0],n=y[1])}return l=f=null,t===1/0||e===1/0?[[NaN,NaN],[NaN,NaN]]:[[t,e],[n,r]]}}(),o.geo.centroid=function(t){kn=Sn=_n=Mn=En=An=Cn=Ln=Tn=Nn=Pn=0,o.geo.stream(t,Fn);var e=Tn,n=Nn,r=Pn,i=e*e+n*n+r*r;return i=0;--s)i.point((f=l[s])[0],f[1]);else r(p.x,p.p.x,-1,i);p=p.p}l=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}}function Qn(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,S=k*w,_=S>Tt,M=d*m;if(On.add(Math.atan2(M*k*Math.sin(S),y*b+M*Math.cos(S))),o+=_?w+k*Nt:w,_^h>=n^v>=n){var E=qn(In(f),In(t));Hn(E);var A=qn(i,E);Hn(A);var C=(_^w>=0?-1:1)*zt(A[2]);(r>C||r===C&&(E[0]||E[1]))&&(a+=_^w>=0?1:-1)}if(!g++)break;h=v,d=m,y=b,f=t}}return(o<-Ct||o0){for(m||(a.polygonStart(),m=!0),a.lineStart();++o1&&2&e&&n.push(n.pop().concat(n.shift())),s.push(n.filter(nr))}return l}}function nr(t){return t.length>1}function rr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:q,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function ir(t,e){return((t=t.x)[0]<0?t[1]-Ot-Ct:Ot-t[1])-((e=e.x)[0]<0?e[1]-Ot-Ct:Ot-e[1])}var or=er(Kn,(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?Tt:-Tt,u=k(o-n);k(u-Tt)0?Ot:-Ot),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=Tt&&(k(n-i)Ct?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Ot,r.point(-Tt,i),r.point(0,i),r.point(Tt,i),r.point(Tt,0),r.point(Tt,-i),r.point(0,-i),r.point(-Tt,-i),r.point(-Tt,0),r.point(-Tt,i);else if(k(t[0]-e[0])>Ct){var o=t[0]0,r=k(e)>Ct;return er(i,(function(t){var e,s,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(f,h){var p,d=[f,h],y=i(f,h),g=n?y?0:a(f,h):y?a(f+(f<0?Tt:-Tt),h):0;if(!e&&(c=u=y)&&t.lineStart(),y!==u&&(p=o(e,d),(Vn(e,p)||Vn(d,p))&&(d[0]+=Ct,d[1]+=Ct,y=i(d[0],d[1]))),y!==u)l=0,y?(t.lineStart(),p=o(d,e),t.point(p[0],p[1])):(p=o(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(r&&e&&n^y){var v;g&s||!(v=o(d,e,!0))||(l=0,n?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!y||e&&Vn(e,d)||t.point(d[0],d[1]),e=d,u=y,s=g},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),Gr(t,6*Dt),n?[0,-t]:[-Tt,t-Tt]);function i(t,n){return Math.cos(t)*Math.cos(n)>e}function o(t,n,r){var i=[1,0,0],o=qn(In(t),In(n)),a=Rn(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var c=e*a/u,l=-e*s/u,f=qn(i,o),h=Bn(i,c);zn(h,Bn(o,l));var p=f,d=Rn(h,p),y=Rn(p,p),g=d*d-y*(Rn(h,h)-1);if(!(g<0)){var v=Math.sqrt(g),x=Bn(p,(-d-v)/y);if(zn(x,h),x=Gn(x),!r)return x;var m,b=t[0],w=n[0],S=t[1],_=n[1];w0^x[1]<(k(x[0]-b)Tt^(b<=x[0]&&x[0]<=w)){var A=Bn(p,(-d+v)/y);return zn(A,h),[x,Gn(A)]}}}function a(e,r){var i=n?t:Tt-t,o=0;return e<-i?o|=1:e>i&&(o|=2),r<-i?o|=4:r>i&&(o|=8),o}}function sr(t,e,n,r){return function(i){var o,a=i.a,s=i.b,u=a.x,c=a.y,l=0,f=1,h=s.x-u,p=s.y-c;if(o=t-u,h||!(o>0)){if(o/=h,h<0){if(o0){if(o>f)return;o>l&&(l=o)}if(o=n-u,h||!(o<0)){if(o/=h,h<0){if(o>f)return;o>l&&(l=o)}else if(h>0){if(o0)){if(o/=p,p<0){if(o0){if(o>f)return;o>l&&(l=o)}if(o=r-c,p||!(o<0)){if(o/=p,p<0){if(o>f)return;o>l&&(l=o)}else if(p>0){if(o0&&(i.a={x:u+l*h,y:c+l*p}),f<1&&(i.b={x:u+f*h,y:c+f*p}),i}}}}}}function ur(t,e,n,r){return function(u){var c,l,f,h,p,d,y,g,v,x,m,b=u,w=rr(),k=sr(t,e,n,r),S={point:E,lineStart:function(){S.point=A,l&&l.push(f=[]);x=!0,v=!1,y=g=NaN},lineEnd:function(){c&&(A(h,p),d&&v&&w.rejoin(),c.push(w.buffer()));S.point=E,v&&u.lineEnd()},polygonStart:function(){u=w,c=[],l=[],m=!0},polygonEnd:function(){u=b,c=o.merge(c);var e=function(t){for(var e=0,n=l.length,r=t[1],i=0;ir&&Rt(c,o,t)>0&&++e:o[1]<=r&&Rt(c,o,t)<0&&--e,c=o;return 0!==e}([t,r]),n=m&&e,i=c.length;(n||i)&&(u.polygonStart(),n&&(u.lineStart(),_(null,null,1,u),u.lineEnd()),i&&Jn(c,a,e,_,u),u.polygonEnd()),c=l=f=null}};function _(o,a,u,c){var l=0,f=0;if(null==o||(l=i(o,u))!==(f=i(a,u))||s(o,a)<0^u>0)do{c.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+u+4)%4)!==f);else c.point(a[0],a[1])}function M(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function E(t,e){M(t,e)&&u.point(t,e)}function A(t,e){var n=M(t=Math.max(-1e9,Math.min(1e9,t)),e=Math.max(-1e9,Math.min(1e9,e)));if(l&&f.push([t,e]),x)h=t,p=e,d=n,x=!1,n&&(u.lineStart(),u.point(t,e));else if(n&&v)u.point(t,e);else{var r={a:{x:y,y:g},b:{x:t,y:e}};k(r)?(v||(u.lineStart(),u.point(r.a.x,r.a.y)),u.point(r.b.x,r.b.y),n||u.lineEnd(),m=!1):n&&(u.lineStart(),u.point(t,e),m=!1)}y=t,g=e,v=n}return S};function i(r,i){return k(r[0]-t)0?0:3:k(r[0]-n)0?2:1:k(r[1]-e)0?1:0:i>0?3:2}function a(t,e){return s(t.x,e.x)}function s(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}}function cr(t){var e=0,n=Tt/3,r=Dr(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Tt/180,n=t[1]*Tt/180):[e/Tt*180,n/Tt*180]},i}function lr(t,e){var n=Math.sin(t),r=(n+Math.sin(e))/2,i=1+n*(2*r-n),o=Math.sqrt(i)/r;function a(t,e){var n=Math.sqrt(i-2*r*Math.sin(e))/r;return[n*Math.sin(t*=r),o-n*Math.cos(t)]}return a.invert=function(t,e){var n=o-e;return[Math.atan2(t,n)/r,zt((i-(t*t+n*n)*r*r)/(2*r))]},a}o.geo.clipExtent=function(){var t,e,n,r,i,o,a={stream:function(t){return i&&(i.valid=!1),(i=o(t)).valid=!0,i},extent:function(s){return arguments.length?(o=ur(t=+s[0][0],e=+s[0][1],n=+s[1][0],r=+s[1][1]),i&&(i.valid=!1,i=null),a):[[t,e],[n,r]]}};return a.extent([[0,0],[960,500]])},(o.geo.conicEqualArea=function(){return cr(lr)}).raw=lr,o.geo.albers=function(){return o.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},o.geo.albersUsa=function(){var t,e,n,r,i=o.geo.albers(),a=o.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=o.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,n){t=[e,n]}};function c(i){var o=i[0],a=i[1];return t=null,e(o,a),t||(n(o,a),t)||r(o,a),t}return c.invert=function(t){var e=i.scale(),n=i.translate(),r=(t[0]-n[0])/e,o=(t[1]-n[1])/e;return(o>=.12&&o<.234&&r>=-.425&&r<-.214?a:o>=.166&&o<.234&&r>=-.214&&r<-.115?s:i).invert(t)},c.stream=function(t){var e=i.stream(t),n=a.stream(t),r=s.stream(t);return{point:function(t,i){e.point(t,i),n.point(t,i),r.point(t,i)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},c.precision=function(t){return arguments.length?(i.precision(t),a.precision(t),s.precision(t),c):i.precision()},c.scale=function(t){return arguments.length?(i.scale(t),a.scale(.35*t),s.scale(t),c.translate(i.translate())):i.scale()},c.translate=function(t){if(!arguments.length)return i.translate();var o=i.scale(),l=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[l-.455*o,f-.238*o],[l+.455*o,f+.238*o]]).stream(u).point,n=a.translate([l-.307*o,f+.201*o]).clipExtent([[l-.425*o+Ct,f+.12*o+Ct],[l-.214*o-Ct,f+.234*o-Ct]]).stream(u).point,r=s.translate([l-.205*o,f+.212*o]).clipExtent([[l-.214*o+Ct,f+.166*o+Ct],[l-.115*o-Ct,f+.234*o-Ct]]).stream(u).point,c},c.scale(1070)};var fr,hr,pr,dr,yr,gr,vr={point:q,lineStart:q,lineEnd:q,polygonStart:function(){hr=0,vr.lineStart=xr},polygonEnd:function(){vr.lineStart=vr.lineEnd=vr.point=q,fr+=k(hr/2)}};function xr(){var t,e,n,r;function i(t,e){hr+=r*t-n*e,n=t,r=e}vr.point=function(o,a){vr.point=i,t=n=o,e=r=a},vr.lineEnd=function(){i(t,e)}}var mr={point:function(t,e){tyr&&(yr=t);egr&&(gr=e)},lineStart:q,lineEnd:q,polygonStart:q,polygonEnd:q};function br(){var t=wr(4.5),e=[],n={point:r,lineStart:function(){n.point=i},lineEnd:a,polygonStart:function(){n.lineEnd=s},polygonEnd:function(){n.lineEnd=a,n.point=r},pointRadius:function(e){return t=wr(e),n},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function r(n,r){e.push("M",n,",",r,t)}function i(t,r){e.push("M",t,",",r),n.point=o}function o(t,n){e.push("L",t,",",n)}function a(){n.point=r}function s(){e.push("Z")}return n}function wr(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var kr,Sr={point:_r,lineStart:Mr,lineEnd:Er,polygonStart:function(){Sr.lineStart=Ar},polygonEnd:function(){Sr.point=_r,Sr.lineStart=Mr,Sr.lineEnd=Er}};function _r(t,e){_n+=t,Mn+=e,++En}function Mr(){var t,e;function n(n,r){var i=n-t,o=r-e,a=Math.sqrt(i*i+o*o);An+=a*(t+n)/2,Cn+=a*(e+r)/2,Ln+=a,_r(t=n,e=r)}Sr.point=function(r,i){Sr.point=n,_r(t=r,e=i)}}function Er(){Sr.point=_r}function Ar(){var t,e,n,r;function i(t,e){var i=t-n,o=e-r,a=Math.sqrt(i*i+o*o);An+=a*(n+t)/2,Cn+=a*(r+e)/2,Ln+=a,Tn+=(a=r*t-n*e)*(n+t),Nn+=a*(r+e),Pn+=3*a,_r(n=t,r=e)}Sr.point=function(o,a){Sr.point=i,_r(t=n=o,e=r=a)},Sr.lineEnd=function(){i(t,e)}}function Cr(t){var e=4.5,n={point:r,lineStart:function(){n.point=i},lineEnd:a,polygonStart:function(){n.lineEnd=s},polygonEnd:function(){n.lineEnd=a,n.point=r},pointRadius:function(t){return e=t,n},result:q};function r(n,r){t.moveTo(n+e,r),t.arc(n,r,e,0,Nt)}function i(e,r){t.moveTo(e,r),n.point=o}function o(e,n){t.lineTo(e,n)}function a(){n.point=r}function s(){t.closePath()}return n}function Lr(t){var e=.5,n=Math.cos(30*Dt),r=16;function i(t){return(r?a:o)(t)}function o(e){return Pr(e,(function(n,r){n=t(n,r),e.point(n[0],n[1])}))}function a(e){var n,i,o,a,u,c,l,f,h,p,d,y,g={point:v,lineStart:x,lineEnd:b,polygonStart:function(){e.polygonStart(),g.lineStart=w},polygonEnd:function(){e.polygonEnd(),g.lineStart=x}};function v(n,r){n=t(n,r),e.point(n[0],n[1])}function x(){f=NaN,g.point=m,e.lineStart()}function m(n,i){var o=In([n,i]),a=t(n,i);s(f,h,l,p,d,y,f=a[0],h=a[1],l=n,p=o[0],d=o[1],y=o[2],r,e),e.point(f,h)}function b(){g.point=v,e.lineEnd()}function w(){x(),g.point=k,g.lineEnd=S}function k(t,e){m(n=t,e),i=f,o=h,a=p,u=d,c=y,g.point=m}function S(){s(f,h,l,p,d,y,i,o,n,a,u,c,r,e),g.lineEnd=b,b()}return g}function s(r,i,o,a,u,c,l,f,h,p,d,y,g,v){var x=l-r,m=f-i,b=x*x+m*m;if(b>4*e&&g--){var w=a+p,S=u+d,_=c+y,M=Math.sqrt(w*w+S*S+_*_),E=Math.asin(_/=M),A=k(k(_)-1)e||k((x*N+m*P)/b-.5)>.3||a*p+u*d+c*y0&&16,i):Math.sqrt(e)},i}function Tr(t){var e=Lr((function(e,n){return t([e*jt,n*jt])}));return function(t){return jr(e(t))}}function Nr(t){this.stream=t}function Pr(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Or(t){return Dr((function(){return t}))()}function Dr(t){var e,n,r,i,a,s,u=Lr((function(t,n){return[(t=e(t,n))[0]*c+i,a-t[1]*c]})),c=150,l=480,f=250,h=0,p=0,d=0,y=0,g=0,v=or,x=D,m=null,b=null;function w(t){return[(t=r(t[0]*Dt,t[1]*Dt))[0]*c+i,a-t[1]*c]}function k(t){return(t=r.invert((t[0]-i)/c,(a-t[1])/c))&&[t[0]*jt,t[1]*jt]}function S(){r=$n(n=qr(d,y,g),e);var t=e(h,p);return i=l-t[0]*c,a=f+t[1]*c,_()}function _(){return s&&(s.valid=!1,s=null),w}return w.stream=function(t){return s&&(s.valid=!1),(s=jr(v(n,u(x(t))))).valid=!0,s},w.clipAngle=function(t){return arguments.length?(v=null==t?(m=t,or):ar((m=+t)*Dt),_()):m},w.clipExtent=function(t){return arguments.length?(b=t,x=t?ur(t[0][0],t[0][1],t[1][0],t[1][1]):D,_()):b},w.scale=function(t){return arguments.length?(c=+t,S()):c},w.translate=function(t){return arguments.length?(l=+t[0],f=+t[1],S()):[l,f]},w.center=function(t){return arguments.length?(h=t[0]%360*Dt,p=t[1]%360*Dt,S()):[h*jt,p*jt]},w.rotate=function(t){return arguments.length?(d=t[0]%360*Dt,y=t[1]%360*Dt,g=t.length>2?t[2]%360*Dt:0,S()):[d*jt,y*jt,g*jt]},o.rebind(w,u,"precision"),function(){return e=t.apply(this,arguments),w.invert=e.invert&&k,S()}}function jr(t){return Pr(t,(function(e,n){t.point(e*Dt,n*Dt)}))}function Ir(t,e){return[t,e]}function Rr(t,e){return[t>Tt?t-Nt:t<-Tt?t+Nt:t,e]}function qr(t,e,n){return t?e||n?$n(Br(t),Hr(e,n)):Br(t):e||n?Hr(e,n):Rr}function zr(t){return function(e,n){return[(e+=t)>Tt?e-Nt:e<-Tt?e+Nt:e,n]}}function Br(t){var e=zr(t);return e.invert=zr(-t),e}function Hr(t,e){var n=Math.cos(t),r=Math.sin(t),i=Math.cos(e),o=Math.sin(e);function a(t,e){var a=Math.cos(e),s=Math.cos(t)*a,u=Math.sin(t)*a,c=Math.sin(e),l=c*n+s*r;return[Math.atan2(u*i-l*o,s*n-c*r),zt(l*i+u*o)]}return a.invert=function(t,e){var a=Math.cos(e),s=Math.cos(t)*a,u=Math.sin(t)*a,c=Math.sin(e),l=c*i-u*o;return[Math.atan2(u*i+c*o,s*n+l*r),zt(l*n-s*r)]},a}function Gr(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,o,a,s){var u=a*e;null!=i?(i=Vr(n,i),o=Vr(n,o),(a>0?io)&&(i+=a*Nt)):(i=t+a*Nt,o=t-.5*u);for(var c,l=i;a>0?l>o:l2?t[2]*Dt:0),e.invert=function(e){return(e=t.invert(e[0]*Dt,e[1]*Dt))[0]*=jt,e[1]*=jt,e},e},Rr.invert=Ir,o.geo.circle=function(){var t,e,n=[0,0],r=6;function i(){var t="function"==typeof n?n.apply(this,arguments):n,r=qr(-t[0]*Dt,-t[1]*Dt,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=r(t,e)),t[0]*=jt,t[1]*=jt}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(t){return arguments.length?(n=t,i):n},i.angle=function(n){return arguments.length?(e=Gr((t=+n)*Dt,r*Dt),i):t},i.precision=function(n){return arguments.length?(e=Gr(t*Dt,(r=+n)*Dt),i):r},i.angle(90)},o.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Dt,i=t[1]*Dt,o=e[1]*Dt,a=Math.sin(r),s=Math.cos(r),u=Math.sin(i),c=Math.cos(i),l=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((n=f*a)*n+(n=c*l-u*f*s)*n),u*l+c*f*s)},o.geo.graticule=function(){var t,e,n,r,i,a,s,u,c,l,f,h,p=10,d=p,y=90,g=360,v=2.5;function x(){return{type:"MultiLineString",coordinates:m()}}function m(){return o.range(Math.ceil(r/y)*y,n,y).map(f).concat(o.range(Math.ceil(u/g)*g,s,g).map(h)).concat(o.range(Math.ceil(e/p)*p,t,p).filter((function(t){return k(t%y)>Ct})).map(c)).concat(o.range(Math.ceil(a/d)*d,i,d).filter((function(t){return k(t%g)>Ct})).map(l))}return x.lines=function(){return m().map((function(t){return{type:"LineString",coordinates:t}}))},x.outline=function(){return{type:"Polygon",coordinates:[f(r).concat(h(s).slice(1),f(n).reverse().slice(1),h(u).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],u=+t[0][1],s=+t[1][1],r>n&&(t=r,r=n,n=t),u>s&&(t=u,u=s,s=t),x.precision(v)):[[r,u],[n,s]]},x.minorExtent=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),x.precision(v)):[[e,a],[t,i]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(y=+t[0],g=+t[1],x):[y,g]},x.minorStep=function(t){return arguments.length?(p=+t[0],d=+t[1],x):[p,d]},x.precision=function(o){return arguments.length?(v=+o,c=Fr(a,i,90),l=Ur(e,t,v),f=Fr(u,s,90),h=Ur(r,n,v),x):v},x.majorExtent([[-180,-90+Ct],[180,90-Ct]]).minorExtent([[-180,-80-Ct],[180,80+Ct]])},o.geo.greatArc=function(){var t,e,n=Xr,r=Wr;function i(){return{type:"LineString",coordinates:[t||n.apply(this,arguments),e||r.apply(this,arguments)]}}return i.distance=function(){return o.geo.distance(t||n.apply(this,arguments),e||r.apply(this,arguments))},i.source=function(e){return arguments.length?(n=e,t="function"==typeof e?null:e,i):n},i.target=function(t){return arguments.length?(r=t,e="function"==typeof t?null:t,i):r},i.precision=function(){return arguments.length?i:0},i},o.geo.interpolate=function(t,e){return n=t[0]*Dt,r=t[1]*Dt,i=e[0]*Dt,o=e[1]*Dt,a=Math.cos(r),s=Math.sin(r),u=Math.cos(o),c=Math.sin(o),l=a*Math.cos(n),f=a*Math.sin(n),h=u*Math.cos(i),p=u*Math.sin(i),d=2*Math.asin(Math.sqrt(Ht(o-r)+a*u*Ht(i-n))),y=1/Math.sin(d),(g=d?function(t){var e=Math.sin(t*=d)*y,n=Math.sin(d-t)*y,r=n*l+e*h,i=n*f+e*p,o=n*s+e*c;return[Math.atan2(i,r)*jt,Math.atan2(o,Math.sqrt(r*r+i*i))*jt]}:function(){return[n*jt,r*jt]}).distance=d,g;var n,r,i,o,a,s,u,c,l,f,h,p,d,y,g},o.geo.length=function(t){return kr=0,o.geo.stream(t,Yr),kr};var Yr={sphere:q,point:q,lineStart:function(){var t,e,n;function r(r,i){var o=Math.sin(i*=Dt),a=Math.cos(i),s=k((r*=Dt)-t),u=Math.cos(s);kr+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=n*o-e*a*u)*s),e*o+n*a*u),t=r,e=o,n=a}Yr.point=function(i,o){t=i*Dt,e=Math.sin(o*=Dt),n=Math.cos(o),Yr.point=r},Yr.lineEnd=function(){Yr.point=Yr.lineEnd=q}},lineEnd:q,polygonStart:q,polygonEnd:q};function Zr(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),o=t(r*i);return[o*i*Math.sin(e),o*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*o,r*a),Math.asin(r&&n*o/r)]},n}var $r=Zr((function(t){return Math.sqrt(2/(1+t))}),(function(t){return 2*Math.asin(t/2)}));(o.geo.azimuthalEqualArea=function(){return Or($r)}).raw=$r;var Kr=Zr((function(t){var e=Math.acos(t);return e&&e/Math.sin(e)}),D);function Jr(t,e){var n=Math.cos(t),r=function(t){return Math.tan(Tt/4+t/2)},i=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(r(e)/r(t)),o=n*Math.pow(r(t),i)/i;if(!i)return ei;function a(t,e){o>0?e<-Ot+Ct&&(e=-Ot+Ct):e>Ot-Ct&&(e=Ot-Ct);var n=o/Math.pow(r(e),i);return[n*Math.sin(i*t),o-n*Math.cos(i*t)]}return a.invert=function(t,e){var n=o-e,r=It(i)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/i,2*Math.atan(Math.pow(o/r,1/i))-Ot]},a}function Qr(t,e){var n=Math.cos(t),r=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),i=n/r+t;if(k(r)1&&Rt(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function ci(t,e){return t[0]-e[0]||t[1]-e[1]}(o.geo.stereographic=function(){return Or(ii)}).raw=ii,oi.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ot]},(o.geo.transverseMercator=function(){var t=ni(oi),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90])}).raw=oi,o.geom={},o.geom.hull=function(t){var e=ai,n=si;if(arguments.length)return r(t);function r(t){if(t.length<3)return[];var r,i=xe(e),o=xe(n),a=t.length,s=[],u=[];for(r=0;r=0;--r)p.push(t[s[c[r]][2]]);for(r=+f;rCt)s=s.L;else{if(!((i=o-Ai(s,a))>Ct)){r>-Ct?(e=s.P,n=s):i>-Ct?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}var u=ki(t);if(gi.insert(e,u),e||n){if(e===n)return Pi(e),n=ki(e.site),gi.insert(u,n),u.edge=n.edge=ji(e.site,u.site),Ni(e),void Ni(n);if(n){Pi(e),Pi(n);var c=e.site,l=c.x,f=c.y,h=t.x-l,p=t.y-f,d=n.site,y=d.x-l,g=d.y-f,v=2*(h*g-p*y),x=h*h+p*p,m=y*y+g*g,b={x:(g*x-p*m)/v+l,y:(h*m-y*x)/v+f};Ri(n.edge,c,d,b),u.edge=ji(c,t,null,b),n.edge=ji(t,d,null,b),Ni(e),Ni(n)}else u.edge=ji(e.site,u.site)}}function Ei(t,e){var n=t.site,r=n.x,i=n.y,o=i-e;if(!o)return r;var a=t.P;if(!a)return-1/0;var s=(n=a.site).x,u=n.y,c=u-e;if(!c)return s;var l=s-r,f=1/o-1/c,h=l/c;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*c)-u+c/2+i-o/2)))/f+r:(r+s)/2}function Ai(t,e){var n=t.N;if(n)return Ei(n,e);var r=t.site;return r.y===e?r.x:1/0}function Ci(t){this.site=t,this.edges=[]}function Li(t,e){return e.angle-t.angle}function Ti(){Bi(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ni(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var a=i.x,s=i.y,u=r.x-a,c=r.y-s,l=o.x-a,f=2*(u*(g=o.y-s)-c*l);if(!(f>=-Lt)){var h=u*u+c*c,p=l*l+g*g,d=(g*h-c*p)/f,y=(u*p-l*h)/f,g=y+s,v=bi.pop()||new Ti;v.arc=t,v.site=i,v.x=d+a,v.y=g+Math.sqrt(d*d+y*y),v.cy=g,t.circle=v;for(var x=null,m=xi._;m;)if(v.y=s)return;if(h>d){if(o){if(o.y>=c)return}else o={x:g,y:u};n={x:g,y:c}}else{if(o){if(o.y1)if(h>d){if(o){if(o.y>=c)return}else o={x:(u-i)/r,y:u};n={x:(c-i)/r,y:c}}else{if(o){if(o.y=s)return}else o={x:a,y:r*a+i};n={x:s,y:r*s+i}}else{if(o){if(o.xCt||k(i-n)>Ct)&&(s.splice(a,0,new qi(Ii(o.site,l,k(r-f)Ct?{x:f,y:k(e-f)Ct?{x:k(n-d)Ct?{x:h,y:k(e-h)Ct?{x:k(n-p)=n&&c.x<=i&&c.y>=r&&c.y<=a?[[n,a],[i,a],[i,r],[n,r]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(r(t,e)/Ct)*Ct,y:Math.round(i(t,e)/Ct)*Ct,i:e}}))}return a.links=function(t){return Fi(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},a.triangles=function(t){var e=[];return Fi(s(t)).cells.forEach((function(n,r){for(var i,o,a,s,u=n.site,c=n.edges.sort(Li),l=-1,f=c.length,h=c[f-1].edge,p=h.l===u?h.r:h.l;++lo||f>a||h=w)<<1|e>=b,S=k+4;ko&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Qi(n,r)})),o=no.lastIndex;return oy&&(y=u.x),u.y>g&&(g=u.y),c.push(u.x),l.push(u.y);else for(f=0;fy&&(y=m),b>g&&(g=b),c.push(m),l.push(b)}var w=y-p,S=g-d;function _(t,e,n,r,i,o,a,s){if(!isNaN(n)&&!isNaN(r))if(t.leaf){var u=t.x,c=t.y;if(null!=u)if(k(u-n)+k(c-r)<.01)M(t,e,n,r,i,o,a,s);else{var l=t.point;t.x=t.y=t.point=null,M(t,l,u,c,i,o,a,s),M(t,e,n,r,i,o,a,s)}else t.x=n,t.y=r,t.point=e}else M(t,e,n,r,i,o,a,s)}function M(t,e,n,r,i,o,a,s){var u=.5*(i+a),c=.5*(o+s),l=n>=u,f=r>=c,h=f<<1|l;t.leaf=!1,l?i=u:a=u,f?o=c:s=c,_(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,n,r,i,o,a,s)}w>S?g=d+w:y=p+S;var E={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){_(E,t,+v(t,++f),+x(t,f),p,d,y,g)},visit:function(t){Zi(t,E,p,d,y,g)},find:function(t){return $i(E,t[0],t[1],p,d,y,g)}};if(f=-1,null==e){for(;++f=0&&!(n=o.interpolators[r](t,e)););return n}function io(t,e){var n,r=[],i=[],o=t.length,a=e.length,s=Math.min(t.length,e.length);for(n=0;n=1?1:t(e)}}function co(t){return function(e){return 1-t(1-e)}}function lo(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function fo(t){return t*t}function ho(t){return t*t*t}function po(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}function yo(t){return 1-Math.cos(t*Ot)}function go(t){return Math.pow(2,10*(t-1))}function vo(t){return 1-Math.sqrt(1-t*t)}function xo(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 mo(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function bo(t){var e,n,r,i=[t.a,t.b],o=[t.c,t.d],a=ko(i),s=wo(i,o),u=ko(((e=o)[0]+=(r=-s)*(n=i)[0],e[1]+=r*n[1],e))||0;i[0]*o[1]=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=ao.get(n)||oo,uo((r=so.get(r)||D)(n.apply(null,a.call(arguments,1))))},o.interpolateHcl=function(t,e){t=o.hcl(t),e=o.hcl(e);var n=t.h,r=t.c,i=t.l,a=e.h-n,s=e.c-r,u=e.l-i;isNaN(s)&&(s=0,r=isNaN(r)?e.c:r);isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:a<-180&&(a+=360);return function(t){return Jt(n+a*t,r+s*t,i+u*t)+""}},o.interpolateHsl=function(t,e){t=o.hsl(t),e=o.hsl(e);var n=t.h,r=t.s,i=t.l,a=e.h-n,s=e.s-r,u=e.l-i;isNaN(s)&&(s=0,r=isNaN(r)?e.s:r);isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:a<-180&&(a+=360);return function(t){return Zt(n+a*t,r+s*t,i+u*t)+""}},o.interpolateLab=function(t,e){t=o.lab(t),e=o.lab(e);var n=t.l,r=t.a,i=t.b,a=e.l-n,s=e.a-r,u=e.b-i;return function(t){return ne(n+a*t,r+s*t,i+u*t)+""}},o.interpolateRound=mo,o.transform=function(t){var e=u.createElementNS(o.ns.prefix.svg,"g");return(o.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new bo(n?n.matrix:So)})(t)},bo.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var So={a:1,b:0,c:0,d:1,e:0,f:0};function _o(t){return t.length?t.pop()+",":""}function Mo(t,e){var n=[],r=[];return t=o.transform(t),e=o.transform(e),function(t,e,n,r){if(t[0]!==e[0]||t[1]!==e[1]){var i=n.push("translate(",null,",",null,")");r.push({i:i-4,x:Qi(t[0],e[0])},{i:i-2,x:Qi(t[1],e[1])})}else(e[0]||e[1])&&n.push("translate("+e+")")}(t.translate,e.translate,n,r),function(t,e,n,r){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),r.push({i:n.push(_o(n)+"rotate(",null,")")-2,x:Qi(t,e)})):e&&n.push(_o(n)+"rotate("+e+")")}(t.rotate,e.rotate,n,r),function(t,e,n,r){t!==e?r.push({i:n.push(_o(n)+"skewX(",null,")")-2,x:Qi(t,e)}):e&&n.push(_o(n)+"skewX("+e+")")}(t.skew,e.skew,n,r),function(t,e,n,r){if(t[0]!==e[0]||t[1]!==e[1]){var i=n.push(_o(n)+"scale(",null,",",null,")");r.push({i:i-4,x:Qi(t[0],e[0])},{i:i-2,x:Qi(t[1],e[1])})}else 1===e[0]&&1===e[1]||n.push(_o(n)+"scale("+e+")")}(t.scale,e.scale,n,r),t=e=null,function(t){for(var e,i=-1,o=r.length;++i0?n=e:(t.c=null,t.t=NaN,t=null,u.end({type:"end",alpha:n=0})):e>0&&(u.start({type:"start",alpha:n=e}),t=Ee(s.tick)),s):n},s.start=function(){var t,e,n,o=v.length,u=x.length,l=c[0],d=c[1];for(t=0;t=0;)n.push(i[r])}function zo(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(o=t.children)&&(i=o.length))for(var i,o,a=-1;++a=0;)a.push(l=c[u]),l.parent=o,l.depth=o.depth+1;n&&(o.value=0),o.children=c}else n&&(o.value=+n.call(r,o,o.depth)||0),delete o.children;return zo(i,(function(e){var r,i;t&&(r=e.children)&&r.sort(t),n&&(i=e.parent)&&(i.value+=e.value)})),s}return r.sort=function(e){return arguments.length?(t=e,r):t},r.children=function(t){return arguments.length?(e=t,r):e},r.value=function(t){return arguments.length?(n=t,r):n},r.revalue=function(t){return n&&(qo(t,(function(t){t.children&&(t.value=0)})),zo(t,(function(t){var e;t.children||(t.value=+n.call(r,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},r},o.layout.partition=function(){var t=o.layout.hierarchy(),e=[1,1];function n(n,r){var i=t.call(this,n,r);return function t(e,n,r,i){var o=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,o&&(a=o.length)){var a,s,u,c=-1;for(r=e.value?r/e.value:0;++cs&&(s=r),a.push(r)}for(n=0;ni&&(r=n,i=e);return r}function Qo(t){return t.reduce(ta,0)}function ta(t,e){return t+e[1]}function ea(t,e){return na(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function na(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,o=[];++n<=e;)o[n]=i*n+r;return o}function ra(t){return[o.min(t),o.max(t)]}function ia(t,e){return t.value-e.value}function oa(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function aa(t,e){t._pack_next=e,e._pack_prev=t}function sa(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function ua(t){if((e=t.children)&&(u=e.length)){var e,n,r,i,o,a,s,u,c=1/0,l=-1/0,f=1/0,h=-1/0;if(e.forEach(ca),(n=e[0]).x=-n.r,n.y=0,m(n),u>1&&((r=e[1]).x=r.r,r.y=0,m(r),u>2))for(fa(n,r,i=e[2]),m(i),oa(n,i),n._pack_prev=i,oa(i,r),r=n._pack_next,o=3;o0)for(a=-1;++a=f[0]&&u<=f[1]&&((s=c[o.bisect(h,u,1,d)-1]).y+=y,s.push(i[a]));return c}return i.value=function(t){return arguments.length?(e=t,i):e},i.range=function(t){return arguments.length?(n=xe(t),i):n},i.bins=function(t){return arguments.length?(r="number"==typeof t?function(e){return na(e,t)}:xe(t),i):r},i.frequency=function(e){return arguments.length?(t=!!e,i):t},i},o.layout.pack=function(){var t,e=o.layout.hierarchy().sort(ia),n=0,r=[1,1];function i(i,o){var a=e.call(this,i,o),s=a[0],u=r[0],c=r[1],l=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(s.x=s.y=0,zo(s,(function(t){t.r=+l(t.value)})),zo(s,ua),n){var f=n*(t?1:Math.max(2*s.r/u,2*s.r/c))/2;zo(s,(function(t){t.r+=f})),zo(s,ua),zo(s,(function(t){t.r-=f}))}return function t(e,n,r,i){var o=e.children;if(e.x=n+=i*e.x,e.y=r+=i*e.y,e.r*=i,o)for(var a=-1,s=o.length;++ap.x&&(p=t),t.depth>d.depth&&(d=t)}));var y=e(h,p)/2-h.x,g=n[0]/(p.x+e(p,h)/2+y),v=n[1]/(d.depth||1);qo(l,(function(t){t.x=(t.x+y)*g,t.y=t.depth*v}))}return c}function a(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n.length){!function(t){var e,n=0,r=0,i=t.children,o=i.length;for(;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(t);var o=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-o):t.z=o}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,n,r){if(n){for(var i,o=t,a=t,s=n,u=o.parent.children[0],c=o.m,l=a.m,f=s.m,h=u.m;s=da(s),o=pa(o),s&&o;)u=pa(u),(a=da(a)).a=t,(i=s.z+f-o.z-c+e(s._,o._))>0&&(ya(ga(s,t,r),t,i),c+=i,l+=i),f+=s.m,c+=o.m,h+=u.m,l+=a.m;s&&!da(a)&&(a.t=s,a.m+=f-l),o&&!pa(u)&&(u.t=o,u.m+=c-h,r=t)}return r}(t,i,t.parent.A||r[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(t){return arguments.length?(r=null==(n=t)?u:null,i):r?null:n},i.nodeSize=function(t){return arguments.length?(r=null==(n=t)?null:u,i):r?n:null},Ro(i,t)},o.layout.cluster=function(){var t=o.layout.hierarchy().sort(null).value(null),e=ha,n=[1,1],r=!1;function i(i,a){var s,u=t.call(this,i,a),c=u[0],l=0;zo(c,(function(t){var n=t.children;n&&n.length?(t.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),t.y=function(t){return 1+o.max(t,(function(t){return t.y}))}(n)):(t.x=s?l+=e(t,s):0,t.y=0,s=t)}));var f=function t(e){var n=e.children;return n&&n.length?t(n[0]):e}(c),h=function t(e){var n,r=e.children;return r&&(n=r.length)?t(r[n-1]):e}(c),p=f.x-e(f,h)/2,d=h.x+e(h,f)/2;return zo(c,r?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),u}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(t){return arguments.length?(r=null==(n=t),i):r?null:n},i.nodeSize=function(t){return arguments.length?(r=null!=(n=t),i):r?n:null},Ro(i,t)},o.layout.treemap=function(){var t,e=o.layout.hierarchy(),n=Math.round,r=[1,1],i=null,a=va,s=!1,u="squarify",c=.5*(1+Math.sqrt(5));function l(t,e){for(var n,r,i=-1,o=t.length;++i0;)s.push(n=c[i-1]),s.area+=n.area,"squarify"!==u||(r=p(s,y))<=h?(c.pop(),h=r):(s.area-=s.pop().area,d(s,y,o,!1),y=Math.min(o.dx,o.dy),s.length=s.area=0,h=1/0);s.length&&(d(s,y,o,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var n,r=a(t),i=e.slice(),o=[];for(l(i,r.dx*r.dy/t.value),o.area=0;n=i.pop();)o.push(n),o.area+=n.area,null!=n.z&&(d(o,n.z?r.dx:r.dy,r,!i.length),o.length=o.area=0);e.forEach(h)}}function p(t,e){for(var n,r=t.area,i=0,o=1/0,a=-1,s=t.length;++ai&&(i=n));return e*=e,(r*=r)?Math.max(e*i*c/r,r/(e*o*c)):1/0}function d(t,e,r,i){var o,a=-1,s=t.length,u=r.x,c=r.y,l=e?n(t.area/e):0;if(e==r.dx){for((i||l>r.dy)&&(l=r.dy);++ar.dx)&&(l=r.dx);++a1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=o.random.normal.apply(o,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=o.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;n2?Ma:wa,s=i?Ao:Eo;return o=t(e,n,s,r),a=t(n,e,s,ro),u}function u(t){return o(t)}return u.invert=function(t){return a(t)},u.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},u.range=function(t){return arguments.length?(n=t,s()):n},u.rangeRound=function(t){return u.range(t).interpolate(mo)},u.clamp=function(t){return arguments.length?(i=t,s()):i},u.interpolate=function(t){return arguments.length?(r=t,s()):r},u.ticks=function(t){return La(e,t)},u.tickFormat=function(t,n){return Ta(e,t,n)},u.nice=function(t){return Aa(e,t),s()},u.copy=function(){return t(e,n,r,i)},s()}([0,1],[0,1],ro,!1)};var Na={s:1,g:1,p:1,r:1,e:1};function Pa(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}o.scale.log=function(){return function t(e,n,r,i){function a(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return r?Math.pow(n,t):-Math.pow(n,-t)}function u(t){return e(a(t))}return u.invert=function(t){return s(e.invert(t))},u.domain=function(t){return arguments.length?(r=t[0]>=0,e.domain((i=t.map(Number)).map(a)),u):i},u.base=function(t){return arguments.length?(n=+t,e.domain(i.map(a)),u):n},u.nice=function(){var t=ka(i.map(a),r?Math:Da);return e.domain(t),i=t.map(s),u},u.ticks=function(){var t=ma(i),e=[],o=t[0],u=t[1],c=Math.floor(a(o)),l=Math.ceil(a(u)),f=n%1?2:n;if(isFinite(l-c)){if(r){for(;c0;h--)e.push(s(c)*h);for(c=0;e[c]u;l--);e=e.slice(c,l)}return e},u.tickFormat=function(t,e){if(!arguments.length)return Oa;arguments.length<2?e=Oa:"function"!=typeof e&&(e=o.format(e));var r=Math.max(1,n*t/u.ticks().length);return function(t){var i=t/s(Math.round(a(t)));return i*n0?r[t-1]:e[0],tf?0:1;if(c=Pt)return u(c,p)+(s?u(s,1-p):"")+"Z";var d,y,g,v,x,m,b,w,k,S,_,M,E=0,A=0,C=[];if((v=(+a.apply(this,arguments)||0)/2)&&(g=r===Ha?Math.sqrt(s*s+c*c):+r.apply(this,arguments),p||(A*=-1),c&&(A=zt(g/c*Math.sin(v))),s&&(E=zt(g/s*Math.sin(v)))),c){x=c*Math.cos(l+A),m=c*Math.sin(l+A),b=c*Math.cos(f-A),w=c*Math.sin(f-A);var L=Math.abs(f-l-2*A)<=Tt?0:1;if(A&&Wa(x,m,b,w)===p^L){var T=(l+f)/2;x=c*Math.cos(T),m=c*Math.sin(T),b=w=null}}else x=m=0;if(s){k=s*Math.cos(f-E),S=s*Math.sin(f-E),_=s*Math.cos(l+E),M=s*Math.sin(l+E);var N=Math.abs(l-f+2*E)<=Tt?0:1;if(E&&Wa(k,S,_,M)===1-p^N){var P=(l+f)/2;k=s*Math.cos(P),S=s*Math.sin(P),_=M=null}}else k=S=0;if(h>Ct&&(d=Math.min(Math.abs(c-s)/2,+n.apply(this,arguments)))>.001){y=s0?0:1}function Ya(t,e,n,r,i){var o=t[0]-e[0],a=t[1]-e[1],s=(i?r:-r)/Math.sqrt(o*o+a*a),u=s*a,c=-s*o,l=t[0]+u,f=t[1]+c,h=e[0]+u,p=e[1]+c,d=(l+h)/2,y=(f+p)/2,g=h-l,v=p-f,x=g*g+v*v,m=n-r,b=l*p-h*f,w=(v<0?-1:1)*Math.sqrt(Math.max(0,m*m*x-b*b)),k=(b*v-g*w)/x,S=(-b*g-v*w)/x,_=(b*v+g*w)/x,M=(-b*g+v*w)/x,E=k-d,A=S-y,C=_-d,L=M-y;return E*E+A*A>C*C+L*L&&(k=_,S=M),[[k-u,S-c],[k*n/m,S*n/m]]}function Za(t){var e=ai,n=si,r=Kn,i=Ka,o=i.key,a=.7;function s(o){var s,u=[],c=[],l=-1,f=o.length,h=xe(e),p=xe(n);function d(){u.push("M",i(t(c),a))}for(;++l1&&i.push("H",r[0]);return i.join("")},"step-before":Qa,"step-after":ts,basis:rs,"basis-open":function(t){if(t.length<4)return Ka(t);var e,n=[],r=-1,i=t.length,o=[0],a=[0];for(;++r<3;)e=t[r],o.push(e[0]),a.push(e[1]);n.push(is(ss,o)+","+is(ss,a)),--r;for(;++r9&&(i=3*e/Math.sqrt(i),a[s]=i*n,a[s+1]=i*r));s=-1;for(;++s<=u;)i=(t[Math.min(u,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),o.push([i||0,a[s]*i||0]);return o}(t))}});function Ka(t){return t.length>1?t.join("L"):t+"Z"}function Ja(t){return t.join("L")+"Z"}function Qa(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e1){s=e[1],o=t[u],u++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var c=2;cTt)+",1 "+e}function u(t,e,n,r){return"Q 0,0 "+r}return o.radius=function(t){return arguments.length?(n=xe(t),o):n},o.source=function(e){return arguments.length?(t=xe(e),o):t},o.target=function(t){return arguments.length?(e=xe(t),o):e},o.startAngle=function(t){return arguments.length?(r=xe(t),o):r},o.endAngle=function(t){return arguments.length?(i=xe(t),o):i},o},o.svg.diagonal=function(){var t=Xr,e=Wr,n=ps;function r(r,i){var o=t.call(this,r,i),a=e.call(this,r,i),s=(o.y+a.y)/2,u=[o,{x:o.x,y:s},{x:a.x,y:s},a];return"M"+(u=u.map(n))[0]+"C"+u[1]+" "+u[2]+" "+u[3]}return r.source=function(e){return arguments.length?(t=xe(e),r):t},r.target=function(t){return arguments.length?(e=xe(t),r):e},r.projection=function(t){return arguments.length?(n=t,r):n},r},o.svg.diagonal.radial=function(){var t=o.svg.diagonal(),e=ps,n=t.projection;return t.projection=function(t){return arguments.length?n(ds(e=t)):e},t},o.svg.symbol=function(){var t=gs,e=ys;function n(n,r){return(xs.get(t.call(this,n,r))||vs)(e.call(this,n,r))}return n.type=function(e){return arguments.length?(t=xe(e),n):t},n.size=function(t){return arguments.length?(e=xe(t),n):e},n};var xs=o.map({circle:vs,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*bs)),n=e*bs;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/ms),n=e*ms/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/ms),n=e*ms/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});o.svg.symbolTypes=xs.keys();var ms=Math.sqrt(3),bs=Math.tan(30*Dt);$.transition=function(t){for(var e,n,r=_s||++As,i=Ts(t),o=[],a=Ms||{time:Date.now(),ease:po,delay:0,duration:250},s=-1,u=this.length;++s0;)c[--h].call(t,a);if(o>=1)return f.event&&f.event.end.call(t,t.__data__,e),--l.count?delete l[r]:delete t[n],1}f||(o=i.time,a=Ee((function(t){var e=f.delay;if(a.t=e+o,e<=t)return h(t-e);a.c=h}),0,o),f=l[r]={tween:new M,time:o,timer:a,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++l.count)}Es.call=$.call,Es.empty=$.empty,Es.node=$.node,Es.size=$.size,o.transition=function(t,e){return t&&t.transition?_s?t.transition(e):t:o.selection().transition(t)},o.transition.prototype=Es,Es.select=function(t){var e,n,r,i=this.id,o=this.namespace,a=[];t=K(t);for(var s=-1,u=this.length;++srect,.s>rect").attr("width",a[1]-a[0])}function y(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function g(){var f,g,v=this,x=o.select(o.event.target),m=n.of(v,arguments),b=o.select(v),w=x.datum(),k=!/^(n|s)$/.test(w)&&r,S=!/^(e|w)$/.test(w)&&i,_=x.classed("extent"),M=_t(v),E=o.mouse(v),A=o.select(l(v)).on("keydown.brush",T).on("keyup.brush",N);if(o.event.changedTouches?A.on("touchmove.brush",P).on("touchend.brush",D):A.on("mousemove.brush",P).on("mouseup.brush",D),b.interrupt().selectAll("*").interrupt(),_)E[0]=a[0]-E[0],E[1]=s[0]-E[1];else if(w){var C=+/w$/.test(w),L=+/^n/.test(w);g=[a[1-C]-E[0],s[1-L]-E[1]],E[0]=a[C],E[1]=s[L]}else o.event.altKey&&(f=E.slice());function T(){32==o.event.keyCode&&(_||(f=null,E[0]-=a[1],E[1]-=s[1],_=2),H())}function N(){32==o.event.keyCode&&2==_&&(E[0]+=a[1],E[1]+=s[1],_=0,H())}function P(){var t=o.mouse(v),e=!1;g&&(t[0]+=g[0],t[1]+=g[1]),_||(o.event.altKey?(f||(f=[(a[0]+a[1])/2,(s[0]+s[1])/2]),E[0]=a[+(t[0]1?{floor:function(e){for(;s(e=t.floor(e));)e=Vs(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Vs(+e+1);return e}}:t))},r.ticks=function(t,e){var n=ma(r.domain()),o=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];return o&&(t=o[0],e=o[1]),t.range(n[0],Vs(+n[1]+1),e<1?1:e)},r.tickFormat=function(){return n},r.copy=function(){return Gs(t.copy(),e,n)},Ea(r,t)}function Vs(t){return new Date(t)}qs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Hs:Bs,Hs.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Hs.toString=Bs.toString,Ie.second=Be((function(t){return new Re(1e3*Math.floor(t/1e3))}),(function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))}),(function(t){return t.getSeconds()})),Ie.seconds=Ie.second.range,Ie.seconds.utc=Ie.second.utc.range,Ie.minute=Be((function(t){return new Re(6e4*Math.floor(t/6e4))}),(function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))}),(function(t){return t.getMinutes()})),Ie.minutes=Ie.minute.range,Ie.minutes.utc=Ie.minute.utc.range,Ie.hour=Be((function(t){var e=t.getTimezoneOffset()/60;return new Re(36e5*(Math.floor(t/36e5-e)+e))}),(function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))}),(function(t){return t.getHours()})),Ie.hours=Ie.hour.range,Ie.hours.utc=Ie.hour.utc.range,Ie.month=Be((function(t){return(t=Ie.day(t)).setDate(1),t}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t){return t.getMonth()})),Ie.months=Ie.month.range,Ie.months.utc=Ie.month.utc.range;var Fs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Us=[[Ie.second,1],[Ie.second,5],[Ie.second,15],[Ie.second,30],[Ie.minute,1],[Ie.minute,5],[Ie.minute,15],[Ie.minute,30],[Ie.hour,1],[Ie.hour,3],[Ie.hour,6],[Ie.hour,12],[Ie.day,1],[Ie.day,2],[Ie.week,1],[Ie.month,1],[Ie.month,3],[Ie.year,1]],Xs=qs.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Kn]]),Ws={range:function(t,e,n){return o.range(Math.ceil(t/n)*n,+e,n).map(Vs)},floor:D,ceil:D};Us.year=Ie.year,Ie.scale=function(){return Gs(o.scale.linear(),Us,Xs)};var Ys=Us.map((function(t){return[t[0].utc,t[1]]})),Zs=zs.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Kn]]);function $s(t){return JSON.parse(t.responseText)}function Ks(t){var e=u.createRange();return e.selectNode(u.body),e.createContextualFragment(t.responseText)}Ys.year=Ie.year.utc,Ie.scale.utc=function(){return Gs(o.scale.linear(),Ys,Zs)},o.text=me((function(t){return t.responseText})),o.json=function(t,e){return be(t,"application/json",$s,e)},o.html=function(t,e){return be(t,"text/html",Ks,e)},o.xml=me((function(t){return t.responseXML})),this.d3=o,void 0===(i="function"==typeof(r=o)?r.call(e,n,e,t):r)||(t.exports=i)}()},function(t,e){function n(t,e){this.x=t||0,this.y=e||0,Object.freeze(this)}n.prototype.distance=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},n.prototype.manhattanDistance=function(t){var e=this.sub(t).abs();return e.x+e.y},n.prototype.abs=function(){return new n(Math.abs(this.x),Math.abs(this.y))},n.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},n.prototype.add=function(t){return new n(this.x+t.x,this.y+t.y)},n.prototype.sub=function(t){return new n(this.x-t.x,this.y-t.y)},t.exports=n},function(t,e,n){var r=n(1);function i(t){arguments.length>0&&this.init(t)}i.prototype.init=function(t){this.status=t,this.points=new Array},i.prototype.appendPoint=function(t){this.points.push(t)},i.prototype.appendPoints=function(t){this.points=this.points.concat(t)},i.intersectShapes=function(t,e){var n,r=t.getIntersectionParams(),o=e.getIntersectionParams();if(null!=r&&null!=o)if("Path"==r.name)n=i.intersectPathShape(t,e);else if("Path"==o.name)n=i.intersectPathShape(e,t);else{var a,s;if(r.name0&&L.length>0){t:for(var T=0;T0&&(v.status="Intersection"),v},i.intersectBezier2Bezier3=function(t,e,n,o,a,s,u){var c,l,f,h,p,d,y,g,v,x,m,b=new i("No Intersection");c=e.multiply(-2),p=t.add(c.add(n)),c=t.multiply(-2),l=e.multiply(2),d=c.add(l),y=new r(t.x,t.y),c=o.multiply(-1),l=a.multiply(3),f=s.multiply(-3),h=c.add(l.add(f.add(u))),g=new Vector2D(h.x,h.y),c=o.multiply(3),l=a.multiply(-6),f=s.multiply(3),h=c.add(l.add(f)),v=new Vector2D(h.x,h.y),c=o.multiply(-3),l=a.multiply(3),f=c.add(l),x=new Vector2D(f.x,f.y),m=new Vector2D(o.x,o.y);for(var w=y.x*y.x,k=y.y*y.y,S=d.x*d.x,_=d.y*d.y,M=p.x*p.x,E=p.y*p.y,A=m.x*m.x,C=m.y*m.y,L=x.x*x.x,T=x.y*x.y,N=v.x*v.x,P=v.y*v.y,O=g.x*g.x,D=g.y*g.y,j=new Polynomial(-2*p.x*p.y*g.x*g.y+M*D+E*O,-2*p.x*p.y*v.x*g.y-2*p.x*p.y*v.y*g.x+2*E*v.x*g.x+2*M*v.y*g.y,-2*p.x*x.x*p.y*g.y-2*p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f,h,p=new i("No Intersection");u=e.multiply(-2),l=t.add(u.add(n)),u=t.multiply(-2),c=e.multiply(2),f=u.add(c),h=new r(t.x,t.y);for(var d=a*a,y=s*s,g=new Polynomial(y*l.x*l.x+d*l.y*l.y,2*(y*l.x*f.x+d*l.y*f.y),y*(2*l.x*h.x+f.x*f.x)+d*(2*l.y*h.y+f.y*f.y)-2*(y*o.x*l.x+d*o.y*l.y),2*(y*f.x*(h.x-o.x)+d*f.y*(h.y-o.y)),y*(h.x*h.x+o.x*o.x)+d*(h.y*h.y+o.y*o.y)-2*(y*o.x*h.x+d*o.y*h.y)-d*y).getRoots(),v=0;v0&&(p.status="Intersection"),p},i.intersectBezier2Line=function(t,e,n,o,a){var s,u,c,l,f,h,p,d=o.min(a),y=o.max(a),g=new i("No Intersection");s=e.multiply(-2),c=t.add(s.add(n)),s=t.multiply(-2),u=e.multiply(2),l=s.add(u),f=new r(t.x,t.y),p=new Vector2D(o.y-a.y,a.x-o.x),h=o.x*a.y-a.x*o.y,roots=new Polynomial(p.dot(c),p.dot(l),p.dot(f)+h).getRoots();for(var v=0;v0&&(o.status="Intersection"),o},i.intersectBezier2Rectangle=function(t,e,n,o,a){var s=o.min(a),u=o.max(a),c=new r(u.x,s.y),l=new r(s.x,u.y),f=i.intersectBezier2Line(t,e,n,s,c),h=i.intersectBezier2Line(t,e,n,c,u),p=i.intersectBezier2Line(t,e,n,u,l),d=i.intersectBezier2Line(t,e,n,l,s),y=new i("No Intersection");return y.appendPoints(f.points),y.appendPoints(h.points),y.appendPoints(p.points),y.appendPoints(d.points),y.points.length>0&&(y.status="Intersection"),y},i.intersectBezier3Bezier3=function(t,e,n,r,o,a,s,u){var c,l,f,h,p,d,y,g,v,x,m,b,w=new i("No Intersection");c=t.multiply(-1),l=e.multiply(3),f=n.multiply(-3),h=c.add(l.add(f.add(r))),p=new Vector2D(h.x,h.y),c=t.multiply(3),l=e.multiply(-6),f=n.multiply(3),h=c.add(l.add(f)),d=new Vector2D(h.x,h.y),c=t.multiply(-3),l=e.multiply(3),f=c.add(l),y=new Vector2D(f.x,f.y),g=new Vector2D(t.x,t.y),c=o.multiply(-1),l=a.multiply(3),f=s.multiply(-3),h=c.add(l.add(f.add(u))),v=new Vector2D(h.x,h.y),c=o.multiply(3),l=a.multiply(-6),f=s.multiply(3),h=c.add(l.add(f)),x=new Vector2D(h.x,h.y),c=o.multiply(-3),l=a.multiply(3),f=c.add(l),m=new Vector2D(f.x,f.y),b=new Vector2D(o.x,o.y);for(var k=g.x*g.x,S=g.x*g.x*g.x,_=g.y*g.y,M=g.y*g.y*g.y,E=y.x*y.x,A=y.x*y.x*y.x,C=y.y*y.y,L=y.y*y.y*y.y,T=d.x*d.x,N=d.x*d.x*d.x,P=d.y*d.y,O=d.y*d.y*d.y,D=p.x*p.x,j=p.x*p.x*p.x,I=p.y*p.y,R=p.y*p.y*p.y,q=b.x*b.x,z=b.x*b.x*b.x,B=b.y*b.y,H=b.y*b.y*b.y,G=m.x*m.x,V=m.x*m.x*m.x,F=m.y*m.y,U=x.x*x.x,X=x.x*x.x*x.x,W=x.y*x.y,Y=v.x*v.x,Z=v.x*v.x*v.x,$=v.y*v.y,K=v.y*v.y*v.y,J=new Polynomial(-j*K+R*Z-3*p.x*I*Y*v.y+3*D*p.y*v.x*$,-6*p.x*x.x*I*v.x*v.y+6*D*p.y*x.y*v.x*v.y+3*x.x*R*Y-3*j*x.y*$-3*p.x*I*x.y*Y+3*D*x.x*p.y*$,-6*m.x*p.x*I*v.x*v.y-6*p.x*x.x*I*x.y*v.x+6*D*x.x*p.y*x.y*v.y+3*m.x*R*Y+3*U*R*v.x+3*m.x*D*p.y*$-3*p.x*m.y*I*Y-3*p.x*U*I*v.y+D*p.y*v.x*(6*m.y*v.y+3*W)+j*(-m.y*$-2*W*v.y-v.y*(2*m.y*v.y+W)),y.x*d.y*p.x*p.y*v.x*v.y-y.y*d.x*p.x*p.y*v.x*v.y+6*m.x*x.x*R*v.x+3*y.x*d.x*p.x*p.y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.y*I-2*g.x*T*b.y*d.y*p.y-6*g.y*b.x*b.y*D*p.y-2*g.y*b.x*T*d.y*p.y-2*g.y*E*y.y*p.x*p.y-g.y*E*d.x*d.y*p.y-2*g.y*T*b.y*d.y*p.x-2*y.x*b.x*C*p.x*p.y-y.x*y.y*T*b.y*p.y+3*b.x*y.y*b.y*d.y*D-2*b.x*d.x*b.y*P*p.x-b.x*C*d.x*d.y*p.x+3*_*y.x*d.x*p.x*p.y+3*y.x*d.x*B*p.x*p.y+2*b.x*T*b.y*d.y*p.y-3*k*y.y*d.y*p.x*p.y+2*E*y.y*b.y*p.x*p.y+E*d.x*b.y*d.y*p.y-3*q*y.y*d.y*p.x*p.y-S*R+M*j+z*R-H*j-3*g.x*q*R-g.x*L*D+3*k*b.x*R+g.y*A*I+3*g.y*B*j+b.x*L*D+k*O*p.x-3*_*b.y*j-_*N*p.y+q*O*p.x-A*b.y*I-N*B*p.y-g.x*E*y.y*I+g.y*y.x*C*D-3*g.x*_*D*p.y-g.x*C*T*p.y+g.y*E*P*p.x-y.x*C*b.y*D+3*k*g.y*p.x*I+k*y.x*d.y*I+2*k*y.y*d.x*I-2*_*y.x*d.y*D-_*y.y*d.x*D+E*b.x*y.y*I-3*g.x*B*D*p.y+3*g.y*q*p.x*I+y.x*q*d.y*I-2*y.x*B*d.y*D+b.x*C*T*p.y-y.y*d.x*B*D-k*d.x*P*p.y-3*k*b.y*p.x*I+3*_*b.x*D*p.y+_*T*d.y*p.x-E*b.y*P*p.x+2*q*y.y*d.x*I+3*b.x*B*D*p.y-q*d.x*P*p.y-3*q*b.y*p.x*I+T*B*d.y*p.x).getRootsInInterval(0,1),Q=0;Q0&&nt.length>0){t:for(var rt=0;rt0&&(w.status="Intersection"),w},i.intersectBezier3Circle=function(t,e,n,r,o,a){return i.intersectBezier3Ellipse(t,e,n,r,o,a,a)},i.intersectBezier3Ellipse=function(t,e,n,r,o,a,s){var u,c,l,f,h,p,d,y,g=new i("No Intersection");u=t.multiply(-1),c=e.multiply(3),l=n.multiply(-3),f=u.add(c.add(l.add(r))),h=new Vector2D(f.x,f.y),u=t.multiply(3),c=e.multiply(-6),l=n.multiply(3),f=u.add(c.add(l)),p=new Vector2D(f.x,f.y),u=t.multiply(-3),c=e.multiply(3),l=u.add(c),d=new Vector2D(l.x,l.y),y=new Vector2D(t.x,t.y);for(var v=a*a,x=s*s,m=new Polynomial(h.x*h.x*x+h.y*h.y*v,2*(h.x*p.x*x+h.y*p.y*v),2*(h.x*d.x*x+h.y*d.y*v)+p.x*p.x*x+p.y*p.y*v,2*h.x*x*(y.x-o.x)+2*h.y*v*(y.y-o.y)+2*(p.x*d.x*x+p.y*d.y*v),2*p.x*x*(y.x-o.x)+2*p.y*v*(y.y-o.y)+d.x*d.x*x+d.y*d.y*v,2*d.x*x*(y.x-o.x)+2*d.y*v*(y.y-o.y),y.x*y.x*x-2*y.y*o.y*v-2*y.x*o.x*x+y.y*y.y*v+o.x*o.x*x+o.y*o.y*v-v*x).getRootsInInterval(0,1),b=0;b0&&(g.status="Intersection"),g},i.intersectBezier3Line=function(t,e,n,r,o,a){var s,u,c,l,f,h,p,d,y,g,v=o.min(a),x=o.max(a),m=new i("No Intersection");s=t.multiply(-1),u=e.multiply(3),c=n.multiply(-3),l=s.add(u.add(c.add(r))),f=new Vector2D(l.x,l.y),s=t.multiply(3),u=e.multiply(-6),c=n.multiply(3),l=s.add(u.add(c)),h=new Vector2D(l.x,l.y),s=t.multiply(-3),u=e.multiply(3),c=s.add(u),p=new Vector2D(c.x,c.y),d=new Vector2D(t.x,t.y),g=new Vector2D(o.y-a.y,a.x-o.x),y=o.x*a.y-a.x*o.y,roots=new Polynomial(g.dot(f),g.dot(h),g.dot(p),g.dot(d)+y).getRoots();for(var b=0;b0&&(a.status="Intersection"),a},i.intersectBezier3Rectangle=function(t,e,n,o,a,s){var u=a.min(s),c=a.max(s),l=new r(c.x,u.y),f=new r(u.x,c.y),h=i.intersectBezier3Line(t,e,n,o,u,l),p=i.intersectBezier3Line(t,e,n,o,l,c),d=i.intersectBezier3Line(t,e,n,o,c,f),y=i.intersectBezier3Line(t,e,n,o,f,u),g=new i("No Intersection");return g.appendPoints(h.points),g.appendPoints(p.points),g.appendPoints(d.points),g.appendPoints(y.points),g.points.length>0&&(g.status="Intersection"),g},i.intersectCircleCircle=function(t,e,n,o){var a,s=e+o,u=Math.abs(e-o),c=t.distanceFrom(n);if(c>s)a=new i("Outside");else if(c1)&&(f<0||f>1)?o=new i(l<0&&f<0||l>1&&f>1?"Outside":"Inside"):(o=new i("Intersection"),0<=l&&l<=1&&o.points.push(n.lerp(r,l)),0<=f&&f<=1&&o.points.push(n.lerp(r,f)))}return o},i.intersectCirclePolygon=function(t,e,n){for(var r,o=new i("No Intersection"),a=n.length,s=0;s0?o.status="Intersection":o.status=r.status,o},i.intersectCircleRectangle=function(t,e,n,o){var a=n.min(o),s=n.max(o),u=new r(s.x,a.y),c=new r(a.x,s.y),l=i.intersectCircleLine(t,e,a,u),f=i.intersectCircleLine(t,e,u,s),h=i.intersectCircleLine(t,e,s,c),p=i.intersectCircleLine(t,e,c,a),d=new i("No Intersection");return d.appendPoints(l.points),d.appendPoints(f.points),d.appendPoints(h.points),d.appendPoints(p.points),d.points.length>0?d.status="Intersection":d.status=l.status,d},i.intersectEllipseEllipse=function(t,e,n,o,a,s){for(var u=[n*n,0,e*e,-2*n*n*t.x,-2*e*e*t.y,n*n*t.x*t.x+e*e*t.y*t.y-e*e*n*n],c=[s*s,0,a*a,-2*s*s*o.x,-2*a*a*o.y,s*s*o.x*o.x+a*a*o.y*o.y-a*a*s*s],l=i.bezout(u,c).getRoots(),f=.001*(u[0]*u[0]+2*u[1]*u[1]+u[2]*u[2]),h=.001*(c[0]*c[0]+2*c[1]*c[1]+c[2]*c[2]),p=new i("No Intersection"),d=0;d0&&(p.status="Intersection"),p},i.intersectEllipseLine=function(t,e,n,r,o){var a,s=new Vector2D(r.x,r.y),u=Vector2D.fromPoints(r,o),c=new Vector2D(t.x,t.y),l=s.subtract(c),f=new Vector2D(u.x/(e*e),u.y/(n*n)),h=new Vector2D(l.x/(e*e),l.y/(n*n)),p=u.dot(f),d=u.dot(h),y=d*d-p*(t=l.dot(h)-1);if(y<0)a=new i("Outside");else if(y>0){var g=Math.sqrt(y),v=(-d-g)/p,x=(-d+g)/p;(v<0||11&&x>1?"Outside":"Inside"):(a=new i("Intersection"),0<=v&&v<=1&&a.appendPoint(r.lerp(o,v)),0<=x&&x<=1&&a.appendPoint(r.lerp(o,x)))}else{var m=-d/p;0<=m&&m<=1?(a=new i("Intersection")).appendPoint(r.lerp(o,m)):a=new i("Outside")}return a},i.intersectEllipsePolygon=function(t,e,n,r){for(var o=new i("No Intersection"),a=r.length,s=0;s0&&(o.status="Intersection"),o},i.intersectEllipseRectangle=function(t,e,n,o,a){var s=o.min(a),u=o.max(a),c=new r(u.x,s.y),l=new r(s.x,u.y),f=i.intersectEllipseLine(t,e,n,s,c),h=i.intersectEllipseLine(t,e,n,c,u),p=i.intersectEllipseLine(t,e,n,u,l),d=i.intersectEllipseLine(t,e,n,l,s),y=new i("No Intersection");return y.appendPoints(f.points),y.appendPoints(h.points),y.appendPoints(p.points),y.appendPoints(d.points),y.points.length>0&&(y.status="Intersection"),y},i.intersectLineLine=function(t,e,n,o){var a,s=(o.x-n.x)*(t.y-n.y)-(o.y-n.y)*(t.x-n.x),u=(e.x-t.x)*(t.y-n.y)-(e.y-t.y)*(t.x-n.x),c=(o.y-n.y)*(e.x-t.x)-(o.x-n.x)*(e.y-t.y);if(0!=c){var l=s/c,f=u/c;0<=l&&l<=1&&0<=f&&f<=1?(a=new i("Intersection")).points.push(new r(t.x+l*(e.x-t.x),t.y+l*(e.y-t.y))):a=new i("No Intersection")}else a=new i(0==s||0==u?"Coincident":"Parallel");return a},i.intersectLinePolygon=function(t,e,n){for(var r=new i("No Intersection"),o=n.length,a=0;a0&&(r.status="Intersection"),r},i.intersectLineRectangle=function(t,e,n,o){var a=n.min(o),s=n.max(o),u=new r(s.x,a.y),c=new r(a.x,s.y),l=i.intersectLineLine(a,u,t,e),f=i.intersectLineLine(u,s,t,e),h=i.intersectLineLine(s,c,t,e),p=i.intersectLineLine(c,a,t,e),d=new i("No Intersection");return d.appendPoints(l.points),d.appendPoints(f.points),d.appendPoints(h.points),d.appendPoints(p.points),d.points.length>0&&(d.status="Intersection"),d},i.intersectPolygonPolygon=function(t,e){for(var n=new i("No Intersection"),r=t.length,o=0;o0&&(n.status="Intersection"),n},i.intersectPolygonRectangle=function(t,e,n){var o=e.min(n),a=e.max(n),s=new r(a.x,o.y),u=new r(o.x,a.y),c=i.intersectLinePolygon(o,s,t),l=i.intersectLinePolygon(s,a,t),f=i.intersectLinePolygon(a,u,t),h=i.intersectLinePolygon(u,o,t),p=new i("No Intersection");return p.appendPoints(c.points),p.appendPoints(l.points),p.appendPoints(f.points),p.appendPoints(h.points),p.points.length>0&&(p.status="Intersection"),p},i.intersectRayRay=function(t,e,n,o){var a,s=(o.x-n.x)*(t.y-n.y)-(o.y-n.y)*(t.x-n.x),u=(e.x-t.x)*(t.y-n.y)-(e.y-t.y)*(t.x-n.x),c=(o.y-n.y)*(e.x-t.x)-(o.x-n.x)*(e.y-t.y);if(0!=c){var l=s/c;(a=new i("Intersection")).points.push(new r(t.x+l*(e.x-t.x),t.y+l*(e.y-t.y)))}else a=new i(0==s||0==u?"Coincident":"Parallel");return a},i.intersectRectangleRectangle=function(t,e,n,o){var a=t.min(e),s=t.max(e),u=new r(s.x,a.y),c=new r(a.x,s.y),l=i.intersectLineRectangle(a,u,n,o),f=i.intersectLineRectangle(u,s,n,o),h=i.intersectLineRectangle(s,c,n,o),p=i.intersectLineRectangle(c,a,n,o),d=new i("No Intersection");return d.appendPoints(l.points),d.appendPoints(f.points),d.appendPoints(h.points),d.appendPoints(p.points),d.points.length>0&&(d.status="Intersection"),d},i.bezout=function(t,e){var n=t[0]*e[1]-e[0]*t[1],r=t[0]*e[2]-e[0]*t[2],i=t[0]*e[3]-e[0]*t[3],o=t[0]*e[4]-e[0]*t[4],a=t[0]*e[5]-e[0]*t[5],s=t[1]*e[2]-e[1]*t[2],u=t[1]*e[4]-e[1]*t[4],c=t[1]*e[5]-e[1]*t[5],l=t[2]*e[3]-e[2]*t[3],f=t[3]*e[4]-e[3]*t[4],h=t[3]*e[5]-e[3]*t[5],p=c+f,d=u-l;return new Polynomial(n*s-r*r,n*d+i*s-2*r*o,n*p+i*d-o*o-2*r*a,n*h+i*p-2*o*a,i*h-a*a)},t.exports=i},function(t,e,n){t.exports=function(){"use strict";var t={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",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",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",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",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:"d87093",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",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},e=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function t(t,e){for(var n=0;n255&&(this.r=255),this.g<0||Number.isNaN(this.g)||void 0===this.g?this.g=0:this.g>255&&(this.g=255),this.b<0||Number.isNaN(this.b)||void 0===this.b?this.b=0:this.b>255&&(this.b=255)}}return r(i,[{key:"isValid",value:function(){return this.ok}},{key:"rgb",value:function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"}},{key:"hex",value:function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1===t.length&&(t="0"+t),1===e.length&&(e="0"+e),1===n.length&&(n="0"+n),"#"+t+e+n}},{key:"channels",value:function(){return{r:this.r,g:this.g,b:this.b}}}]),i}();return function(t){return new i(t)}}()},function(t,e,n){var r; +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.complexviewer=e():t.complexviewer=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e){function n(t,e){this.x=t||0,this.y=e||0,Object.freeze(this)}n.prototype.distance=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},n.prototype.manhattanDistance=function(t){var e=this.sub(t).abs();return e.x+e.y},n.prototype.abs=function(){return new n(Math.abs(this.x),Math.abs(this.y))},n.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},n.prototype.add=function(t){return new n(this.x+t.x,this.y+t.y)},n.prototype.sub=function(t){return new n(this.x-t.x,this.y-t.y)},t.exports=n},,function(t,e,n){var r=n(0);function i(t){arguments.length>0&&this.init(t)}i.prototype.init=function(t){this.status=t,this.points=new Array},i.prototype.appendPoint=function(t){this.points.push(t)},i.prototype.appendPoints=function(t){this.points=this.points.concat(t)},i.intersectShapes=function(t,e){var n,r=t.getIntersectionParams(),o=e.getIntersectionParams();if(null!=r&&null!=o)if("Path"==r.name)n=i.intersectPathShape(t,e);else if("Path"==o.name)n=i.intersectPathShape(e,t);else{var a,u;if(r.name0&&N.length>0){t:for(var C=0;C0&&(v.status="Intersection"),v},i.intersectBezier2Bezier3=function(t,e,n,o,a,u,s){var c,f,l,h,d,p,y,g,v,x,m,b=new i("No Intersection");c=e.multiply(-2),d=t.add(c.add(n)),c=t.multiply(-2),f=e.multiply(2),p=c.add(f),y=new r(t.x,t.y),c=o.multiply(-1),f=a.multiply(3),l=u.multiply(-3),h=c.add(f.add(l.add(s))),g=new Vector2D(h.x,h.y),c=o.multiply(3),f=a.multiply(-6),l=u.multiply(3),h=c.add(f.add(l)),v=new Vector2D(h.x,h.y),c=o.multiply(-3),f=a.multiply(3),l=c.add(f),x=new Vector2D(l.x,l.y),m=new Vector2D(o.x,o.y);for(var _=y.x*y.x,w=y.y*y.y,k=p.x*p.x,S=p.y*p.y,M=d.x*d.x,E=d.y*d.y,A=m.x*m.x,T=m.y*m.y,N=x.x*x.x,C=x.y*x.y,P=v.x*v.x,L=v.y*v.y,O=g.x*g.x,D=g.y*g.y,j=new Polynomial(-2*d.x*d.y*g.x*g.y+M*D+E*O,-2*d.x*d.y*v.x*g.y-2*d.x*d.y*v.y*g.x+2*E*v.x*g.x+2*M*v.y*g.y,-2*d.x*x.x*d.y*g.y-2*d.x*d.y*x.y*g.x-2*d.x*d.y*v.x*v.y+2*x.x*E*g.x+E*P+M*(2*x.y*g.y+L),2*y.x*d.x*d.y*g.y+2*y.y*d.x*d.y*g.x+p.x*p.y*d.x*g.y+p.x*p.y*d.y*g.x-2*m.x*d.x*d.y*g.y-2*d.x*m.y*d.y*g.x-2*d.x*x.x*d.y*v.y-2*d.x*d.y*x.y*v.x-2*y.x*E*g.x-2*y.y*M*g.y+2*m.x*E*g.x+2*x.x*E*v.x-S*d.x*g.x-k*d.y*g.y+M*(2*m.y*g.y+2*x.y*v.y),2*y.x*d.x*d.y*v.y+2*y.y*d.x*d.y*v.x+p.x*p.y*d.x*v.y+p.x*p.y*d.y*v.x-2*m.x*d.x*d.y*v.y-2*d.x*m.y*d.y*v.x-2*d.x*x.x*d.y*x.y-2*y.x*E*v.x-2*y.y*M*v.y+2*m.x*E*v.x-S*d.x*v.x-k*d.y*v.y+N*E+M*(2*m.y*v.y+C),2*y.x*d.x*d.y*x.y+2*y.y*d.x*x.x*d.y+p.x*p.y*d.x*x.y+p.x*p.y*x.x*d.y-2*m.x*d.x*d.y*x.y-2*d.x*m.y*x.x*d.y-2*y.x*x.x*E-2*y.y*M*x.y+2*m.x*x.x*E-S*d.x*x.x-k*d.y*x.y+2*M*m.y*x.y,-2*y.x*y.y*d.x*d.y-y.x*p.x*p.y*d.y-y.y*p.x*p.y*d.x+2*y.x*d.x*m.y*d.y+2*y.y*m.x*d.x*d.y+p.x*m.x*p.y*d.y+p.x*p.y*d.x*m.y-2*m.x*d.x*m.y*d.y-2*y.x*m.x*E+y.x*S*d.x+y.y*k*d.y-2*y.y*M*m.y-m.x*S*d.x-k*m.y*d.y+_*E+w*M+A*E+M*T).getRootsInInterval(0,1),I=0;I0&&z.length>0){t:for(var B=0;B0&&(b.status="Intersection"),b},i.intersectBezier2Circle=function(t,e,n,r,o){return i.intersectBezier2Ellipse(t,e,n,r,o,o)},i.intersectBezier2Ellipse=function(t,e,n,o,a,u){var s,c,f,l,h,d=new i("No Intersection");s=e.multiply(-2),f=t.add(s.add(n)),s=t.multiply(-2),c=e.multiply(2),l=s.add(c),h=new r(t.x,t.y);for(var p=a*a,y=u*u,g=new Polynomial(y*f.x*f.x+p*f.y*f.y,2*(y*f.x*l.x+p*f.y*l.y),y*(2*f.x*h.x+l.x*l.x)+p*(2*f.y*h.y+l.y*l.y)-2*(y*o.x*f.x+p*o.y*f.y),2*(y*l.x*(h.x-o.x)+p*l.y*(h.y-o.y)),y*(h.x*h.x+o.x*o.x)+p*(h.y*h.y+o.y*o.y)-2*(y*o.x*h.x+p*o.y*h.y)-p*y).getRoots(),v=0;v0&&(d.status="Intersection"),d},i.intersectBezier2Line=function(t,e,n,o,a){var u,s,c,f,l,h,d,p=o.min(a),y=o.max(a),g=new i("No Intersection");u=e.multiply(-2),c=t.add(u.add(n)),u=t.multiply(-2),s=e.multiply(2),f=u.add(s),l=new r(t.x,t.y),d=new Vector2D(o.y-a.y,a.x-o.x),h=o.x*a.y-a.x*o.y,roots=new Polynomial(d.dot(c),d.dot(f),d.dot(l)+h).getRoots();for(var v=0;v0&&(o.status="Intersection"),o},i.intersectBezier2Rectangle=function(t,e,n,o,a){var u=o.min(a),s=o.max(a),c=new r(s.x,u.y),f=new r(u.x,s.y),l=i.intersectBezier2Line(t,e,n,u,c),h=i.intersectBezier2Line(t,e,n,c,s),d=i.intersectBezier2Line(t,e,n,s,f),p=i.intersectBezier2Line(t,e,n,f,u),y=new i("No Intersection");return y.appendPoints(l.points),y.appendPoints(h.points),y.appendPoints(d.points),y.appendPoints(p.points),y.points.length>0&&(y.status="Intersection"),y},i.intersectBezier3Bezier3=function(t,e,n,r,o,a,u,s){var c,f,l,h,d,p,y,g,v,x,m,b,_=new i("No Intersection");c=t.multiply(-1),f=e.multiply(3),l=n.multiply(-3),h=c.add(f.add(l.add(r))),d=new Vector2D(h.x,h.y),c=t.multiply(3),f=e.multiply(-6),l=n.multiply(3),h=c.add(f.add(l)),p=new Vector2D(h.x,h.y),c=t.multiply(-3),f=e.multiply(3),l=c.add(f),y=new Vector2D(l.x,l.y),g=new Vector2D(t.x,t.y),c=o.multiply(-1),f=a.multiply(3),l=u.multiply(-3),h=c.add(f.add(l.add(s))),v=new Vector2D(h.x,h.y),c=o.multiply(3),f=a.multiply(-6),l=u.multiply(3),h=c.add(f.add(l)),x=new Vector2D(h.x,h.y),c=o.multiply(-3),f=a.multiply(3),l=c.add(f),m=new Vector2D(l.x,l.y),b=new Vector2D(o.x,o.y);for(var w=g.x*g.x,k=g.x*g.x*g.x,S=g.y*g.y,M=g.y*g.y*g.y,E=y.x*y.x,A=y.x*y.x*y.x,T=y.y*y.y,N=y.y*y.y*y.y,C=p.x*p.x,P=p.x*p.x*p.x,L=p.y*p.y,O=p.y*p.y*p.y,D=d.x*d.x,j=d.x*d.x*d.x,I=d.y*d.y,R=d.y*d.y*d.y,q=b.x*b.x,z=b.x*b.x*b.x,B=b.y*b.y,F=b.y*b.y*b.y,H=m.x*m.x,G=m.x*m.x*m.x,V=m.y*m.y,U=x.x*x.x,Y=x.x*x.x*x.x,X=x.y*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I+w*y.x*p.y*I+2*w*y.y*p.x*I-2*S*y.x*p.y*D-S*y.y*p.x*D+E*b.x*y.y*I-3*g.x*B*D*d.y+3*g.y*q*d.x*I+y.x*q*p.y*I-2*y.x*B*p.y*D+b.x*T*C*d.y-y.y*p.x*B*D-w*p.x*L*d.y-3*w*b.y*d.x*I+3*S*b.x*D*d.y+S*C*p.y*d.x-E*b.y*L*d.x+2*q*y.y*p.x*I+3*b.x*B*D*d.y-q*p.x*L*d.y-3*q*b.y*d.x*I+C*B*p.y*d.x).getRootsInInterval(0,1),J=0;J0&&nt.length>0){t:for(var rt=0;rt0&&(_.status="Intersection"),_},i.intersectBezier3Circle=function(t,e,n,r,o,a){return i.intersectBezier3Ellipse(t,e,n,r,o,a,a)},i.intersectBezier3Ellipse=function(t,e,n,r,o,a,u){var s,c,f,l,h,d,p,y,g=new i("No Intersection");s=t.multiply(-1),c=e.multiply(3),f=n.multiply(-3),l=s.add(c.add(f.add(r))),h=new Vector2D(l.x,l.y),s=t.multiply(3),c=e.multiply(-6),f=n.multiply(3),l=s.add(c.add(f)),d=new Vector2D(l.x,l.y),s=t.multiply(-3),c=e.multiply(3),f=s.add(c),p=new Vector2D(f.x,f.y),y=new Vector2D(t.x,t.y);for(var v=a*a,x=u*u,m=new Polynomial(h.x*h.x*x+h.y*h.y*v,2*(h.x*d.x*x+h.y*d.y*v),2*(h.x*p.x*x+h.y*p.y*v)+d.x*d.x*x+d.y*d.y*v,2*h.x*x*(y.x-o.x)+2*h.y*v*(y.y-o.y)+2*(d.x*p.x*x+d.y*p.y*v),2*d.x*x*(y.x-o.x)+2*d.y*v*(y.y-o.y)+p.x*p.x*x+p.y*p.y*v,2*p.x*x*(y.x-o.x)+2*p.y*v*(y.y-o.y),y.x*y.x*x-2*y.y*o.y*v-2*y.x*o.x*x+y.y*y.y*v+o.x*o.x*x+o.y*o.y*v-v*x).getRootsInInterval(0,1),b=0;b0&&(g.status="Intersection"),g},i.intersectBezier3Line=function(t,e,n,r,o,a){var u,s,c,f,l,h,d,p,y,g,v=o.min(a),x=o.max(a),m=new i("No Intersection");u=t.multiply(-1),s=e.multiply(3),c=n.multiply(-3),f=u.add(s.add(c.add(r))),l=new Vector2D(f.x,f.y),u=t.multiply(3),s=e.multiply(-6),c=n.multiply(3),f=u.add(s.add(c)),h=new Vector2D(f.x,f.y),u=t.multiply(-3),s=e.multiply(3),c=u.add(s),d=new Vector2D(c.x,c.y),p=new Vector2D(t.x,t.y),g=new Vector2D(o.y-a.y,a.x-o.x),y=o.x*a.y-a.x*o.y,roots=new Polynomial(g.dot(l),g.dot(h),g.dot(d),g.dot(p)+y).getRoots();for(var b=0;b0&&(a.status="Intersection"),a},i.intersectBezier3Rectangle=function(t,e,n,o,a,u){var s=a.min(u),c=a.max(u),f=new r(c.x,s.y),l=new r(s.x,c.y),h=i.intersectBezier3Line(t,e,n,o,s,f),d=i.intersectBezier3Line(t,e,n,o,f,c),p=i.intersectBezier3Line(t,e,n,o,c,l),y=i.intersectBezier3Line(t,e,n,o,l,s),g=new i("No Intersection");return g.appendPoints(h.points),g.appendPoints(d.points),g.appendPoints(p.points),g.appendPoints(y.points),g.points.length>0&&(g.status="Intersection"),g},i.intersectCircleCircle=function(t,e,n,o){var a,u=e+o,s=Math.abs(e-o),c=t.distanceFrom(n);if(c>u)a=new i("Outside");else if(c1)&&(l<0||l>1)?o=new i(f<0&&l<0||f>1&&l>1?"Outside":"Inside"):(o=new i("Intersection"),0<=f&&f<=1&&o.points.push(n.lerp(r,f)),0<=l&&l<=1&&o.points.push(n.lerp(r,l)))}return o},i.intersectCirclePolygon=function(t,e,n){for(var r,o=new i("No Intersection"),a=n.length,u=0;u0?o.status="Intersection":o.status=r.status,o},i.intersectCircleRectangle=function(t,e,n,o){var a=n.min(o),u=n.max(o),s=new r(u.x,a.y),c=new r(a.x,u.y),f=i.intersectCircleLine(t,e,a,s),l=i.intersectCircleLine(t,e,s,u),h=i.intersectCircleLine(t,e,u,c),d=i.intersectCircleLine(t,e,c,a),p=new i("No Intersection");return p.appendPoints(f.points),p.appendPoints(l.points),p.appendPoints(h.points),p.appendPoints(d.points),p.points.length>0?p.status="Intersection":p.status=f.status,p},i.intersectEllipseEllipse=function(t,e,n,o,a,u){for(var s=[n*n,0,e*e,-2*n*n*t.x,-2*e*e*t.y,n*n*t.x*t.x+e*e*t.y*t.y-e*e*n*n],c=[u*u,0,a*a,-2*u*u*o.x,-2*a*a*o.y,u*u*o.x*o.x+a*a*o.y*o.y-a*a*u*u],f=i.bezout(s,c).getRoots(),l=.001*(s[0]*s[0]+2*s[1]*s[1]+s[2]*s[2]),h=.001*(c[0]*c[0]+2*c[1]*c[1]+c[2]*c[2]),d=new i("No Intersection"),p=0;p0&&(d.status="Intersection"),d},i.intersectEllipseLine=function(t,e,n,r,o){var a,u=new Vector2D(r.x,r.y),s=Vector2D.fromPoints(r,o),c=new Vector2D(t.x,t.y),f=u.subtract(c),l=new Vector2D(s.x/(e*e),s.y/(n*n)),h=new Vector2D(f.x/(e*e),f.y/(n*n)),d=s.dot(l),p=s.dot(h),y=p*p-d*(t=f.dot(h)-1);if(y<0)a=new i("Outside");else if(y>0){var g=Math.sqrt(y),v=(-p-g)/d,x=(-p+g)/d;(v<0||11&&x>1?"Outside":"Inside"):(a=new i("Intersection"),0<=v&&v<=1&&a.appendPoint(r.lerp(o,v)),0<=x&&x<=1&&a.appendPoint(r.lerp(o,x)))}else{var m=-p/d;0<=m&&m<=1?(a=new i("Intersection")).appendPoint(r.lerp(o,m)):a=new i("Outside")}return a},i.intersectEllipsePolygon=function(t,e,n,r){for(var o=new i("No Intersection"),a=r.length,u=0;u0&&(o.status="Intersection"),o},i.intersectEllipseRectangle=function(t,e,n,o,a){var u=o.min(a),s=o.max(a),c=new r(s.x,u.y),f=new r(u.x,s.y),l=i.intersectEllipseLine(t,e,n,u,c),h=i.intersectEllipseLine(t,e,n,c,s),d=i.intersectEllipseLine(t,e,n,s,f),p=i.intersectEllipseLine(t,e,n,f,u),y=new i("No Intersection");return y.appendPoints(l.points),y.appendPoints(h.points),y.appendPoints(d.points),y.appendPoints(p.points),y.points.length>0&&(y.status="Intersection"),y},i.intersectLineLine=function(t,e,n,o){var a,u=(o.x-n.x)*(t.y-n.y)-(o.y-n.y)*(t.x-n.x),s=(e.x-t.x)*(t.y-n.y)-(e.y-t.y)*(t.x-n.x),c=(o.y-n.y)*(e.x-t.x)-(o.x-n.x)*(e.y-t.y);if(0!=c){var f=u/c,l=s/c;0<=f&&f<=1&&0<=l&&l<=1?(a=new i("Intersection")).points.push(new r(t.x+f*(e.x-t.x),t.y+f*(e.y-t.y))):a=new i("No Intersection")}else a=new i(0==u||0==s?"Coincident":"Parallel");return a},i.intersectLinePolygon=function(t,e,n){for(var r=new i("No Intersection"),o=n.length,a=0;a0&&(r.status="Intersection"),r},i.intersectLineRectangle=function(t,e,n,o){var a=n.min(o),u=n.max(o),s=new r(u.x,a.y),c=new r(a.x,u.y),f=i.intersectLineLine(a,s,t,e),l=i.intersectLineLine(s,u,t,e),h=i.intersectLineLine(u,c,t,e),d=i.intersectLineLine(c,a,t,e),p=new i("No Intersection");return p.appendPoints(f.points),p.appendPoints(l.points),p.appendPoints(h.points),p.appendPoints(d.points),p.points.length>0&&(p.status="Intersection"),p},i.intersectPolygonPolygon=function(t,e){for(var n=new i("No Intersection"),r=t.length,o=0;o0&&(n.status="Intersection"),n},i.intersectPolygonRectangle=function(t,e,n){var o=e.min(n),a=e.max(n),u=new r(a.x,o.y),s=new r(o.x,a.y),c=i.intersectLinePolygon(o,u,t),f=i.intersectLinePolygon(u,a,t),l=i.intersectLinePolygon(a,s,t),h=i.intersectLinePolygon(s,o,t),d=new i("No Intersection");return d.appendPoints(c.points),d.appendPoints(f.points),d.appendPoints(l.points),d.appendPoints(h.points),d.points.length>0&&(d.status="Intersection"),d},i.intersectRayRay=function(t,e,n,o){var a,u=(o.x-n.x)*(t.y-n.y)-(o.y-n.y)*(t.x-n.x),s=(e.x-t.x)*(t.y-n.y)-(e.y-t.y)*(t.x-n.x),c=(o.y-n.y)*(e.x-t.x)-(o.x-n.x)*(e.y-t.y);if(0!=c){var f=u/c;(a=new i("Intersection")).points.push(new r(t.x+f*(e.x-t.x),t.y+f*(e.y-t.y)))}else a=new i(0==u||0==s?"Coincident":"Parallel");return a},i.intersectRectangleRectangle=function(t,e,n,o){var a=t.min(e),u=t.max(e),s=new r(u.x,a.y),c=new r(a.x,u.y),f=i.intersectLineRectangle(a,s,n,o),l=i.intersectLineRectangle(s,u,n,o),h=i.intersectLineRectangle(u,c,n,o),d=i.intersectLineRectangle(c,a,n,o),p=new i("No Intersection");return p.appendPoints(f.points),p.appendPoints(l.points),p.appendPoints(h.points),p.appendPoints(d.points),p.points.length>0&&(p.status="Intersection"),p},i.bezout=function(t,e){var n=t[0]*e[1]-e[0]*t[1],r=t[0]*e[2]-e[0]*t[2],i=t[0]*e[3]-e[0]*t[3],o=t[0]*e[4]-e[0]*t[4],a=t[0]*e[5]-e[0]*t[5],u=t[1]*e[2]-e[1]*t[2],s=t[1]*e[4]-e[1]*t[4],c=t[1]*e[5]-e[1]*t[5],f=t[2]*e[3]-e[2]*t[3],l=t[3]*e[4]-e[3]*t[4],h=t[3]*e[5]-e[3]*t[5],d=c+l,p=s-f;return new Polynomial(n*u-r*r,n*p+i*u-2*r*o,n*d+i*p-o*o-2*r*a,n*h+i*d-2*o*a,i*h-a*a)},t.exports=i},function(t,e,n){t.exports=function(){"use strict";var t={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",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",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",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",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:"d87093",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",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},e=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function t(t,e){for(var n=0;n255&&(this.r=255),this.g<0||Number.isNaN(this.g)||void 0===this.g?this.g=0:this.g>255&&(this.g=255),this.b<0||Number.isNaN(this.b)||void 0===this.b?this.b=0:this.b>255&&(this.b=255)}}return r(i,[{key:"isValid",value:function(){return this.ok}},{key:"rgb",value:function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"}},{key:"hex",value:function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1===t.length&&(t="0"+t),1===e.length&&(e="0"+e),1===n.length&&(n="0"+n),"#"+t+e+n}},{key:"channels",value:function(){return{r:this.r,g:this.g,b:this.b}}}]),i}();return function(t){return new i(t)}}()},function(t,e,n){var r; /*! * jQuery JavaScript Library v3.6.0 * https://jquery.com/ @@ -11,7 +11,7 @@ * https://jquery.org/license * * Date: 2021-03-02T17:08Z - */!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(n,i){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,u=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},c=o.push,l=o.indexOf,f={},h=f.toString,p=f.hasOwnProperty,d=p.toString,y=d.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},x=function(t){return null!=t&&t===t.window},m=n.document,b={type:!0,src:!0,nonce:!0,noModule:!0};function w(t,e,n){var r,i,o=(n=n||m).createElement("script");if(o.text=t,e)for(r in b)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function k(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?f[h.call(t)]||"object":typeof t}var S=function(t,e){return new S.fn.init(t,e)};function _(t){var e=!!t&&"length"in t&&t.length,n=k(t);return!v(t)&&!x(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}S.fn=S.prototype={jquery:"3.6.0",constructor:S,length:0,toArray:function(){return s.call(this)},get:function(t){return null==t?s.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n0&&e-1 in t)}k.fn=k.prototype={jquery:"3.6.0",constructor:k,length:0,toArray:function(){return u.call(this)},get:function(t){return null==t?u.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=k.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return k.each(this,t)},map:function(t){return this.pushStack(k.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(k.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(k.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+R+")"+R+"*"),U=new RegExp(R+"|>"),X=new RegExp(B),W=new RegExp("^"+q+"$"),Y={ID:new RegExp("^#("+q+")"),CLASS:new RegExp("^\\.("+q+")"),TAG:new RegExp("^("+q+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},Z=/HTML$/i,$=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+R+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"๏ฟฝ":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){h()},at=bt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{O.apply(T=D.call(w.childNodes),w.childNodes),T[w.childNodes.length].nodeType}catch(t){O={apply:T.length?function(t,e){P.apply(t,D.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function st(t,e,r,i){var o,s,c,l,f,d,v,x=e&&e.ownerDocument,w=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return r;if(!i&&(h(e),e=e||p,y)){if(11!==w&&(f=Q.exec(t)))if(o=f[1]){if(9===w){if(!(c=e.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(x&&(c=x.getElementById(o))&&m(e,c)&&c.id===o)return r.push(c),r}else{if(f[2])return O.apply(r,e.getElementsByTagName(t)),r;if((o=f[3])&&n.getElementsByClassName&&e.getElementsByClassName)return O.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!A[t+" "]&&(!g||!g.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(v=t,x=e,1===w&&(U.test(t)||F.test(t))){for((x=tt.test(t)&&vt(e.parentNode)||e)===e&&n.scope||((l=e.getAttribute("id"))?l=l.replace(rt,it):e.setAttribute("id",l=b)),s=(d=a(t)).length;s--;)d[s]=(l?"#"+l:":scope")+" "+mt(d[s]);v=d.join(",")}try{return O.apply(r,x.querySelectorAll(v)),r}catch(e){A(t,!0)}finally{l===b&&e.removeAttribute("id")}}}return u(t.replace(G,"$1"),e,r,i)}function ut(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function ct(t){return t[b]=!0,t}function lt(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ft(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function ht(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function dt(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function yt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return ct((function(e){return e=+e,ct((function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function vt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=st.support={},o=st.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!Z.test(e||n&&n.nodeName||"HTML")},h=st.setDocument=function(t){var e,i,a=t?t.ownerDocument||t:w;return a!=p&&9===a.nodeType&&a.documentElement?(d=(p=a).documentElement,y=!o(p),w!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),n.scope=lt((function(t){return d.appendChild(t).appendChild(p.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=lt((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=lt((function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=J.test(p.getElementsByClassName),n.getById=lt((function(t){return d.appendChild(t).id=b,!p.getElementsByName||!p.getElementsByName(b).length})),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&y){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&y){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&y)return e.getElementsByClassName(t)},v=[],g=[],(n.qsa=J.test(p.querySelectorAll))&&(lt((function(t){var e;d.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+R+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+R+"*(?:value|"+I+")"),t.querySelectorAll("[id~="+b+"-]").length||g.push("~="),(e=p.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\["+R+"*name"+R+"*="+R+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),lt((function(t){t.innerHTML="";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+R+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),d.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=J.test(x=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&<((function(t){n.disconnectedMatch=x.call(t,"*"),x.call(t,"[s!='']:x"),v.push("!=",B)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),e=J.test(d.compareDocumentPosition),m=e||J.test(d.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},C=e?function(t,e){if(t===e)return f=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t==p||t.ownerDocument==w&&m(w,t)?-1:e==p||e.ownerDocument==w&&m(w,e)?1:l?j(l,t)-j(l,e):0:4&r?-1:1)}:function(t,e){if(t===e)return f=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!i||!o)return t==p?-1:e==p?1:i?-1:o?1:l?j(l,t)-j(l,e):0;if(i===o)return ht(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ht(a[r],s[r]):a[r]==w?-1:s[r]==w?1:0},p):p},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if(h(t),n.matchesSelector&&y&&!A[e+" "]&&(!v||!v.test(e))&&(!g||!g.test(e)))try{var r=x.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){A(e,!0)}return st(e,p,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!=p&&h(t),m(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!=p&&h(t);var i=r.attrHandle[e.toLowerCase()],o=i&&L.call(r.attrHandle,e.toLowerCase())?i(t,e,!y):void 0;return void 0!==o?o:n.attributes||!y?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},st.escape=function(t){return(t+"").replace(rt,it)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,r=[],i=0,o=0;if(f=!n.detectDuplicates,l=!n.sortStable&&t.slice(0),t.sort(C),f){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return l=null,t},i=st.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=st.selectors={cacheLength:50,createPseudo:ct,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||st.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&st.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Y.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&X.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=_[t+" "];return e||(e=new RegExp("(^|"+R+")"+t+"("+R+"|$)"))&&_(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var i=st.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(H," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,u){var c,l,f,h,p,d,y=o!==a?"nextSibling":"previousSibling",g=e.parentNode,v=s&&e.nodeName.toLowerCase(),x=!u&&!s,m=!1;if(g){if(o){for(;y;){for(h=e;h=h[y];)if(s?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;d=y="only"===t&&!d&&"nextSibling"}return!0}if(d=[a?g.firstChild:g.lastChild],a&&x){for(m=(p=(c=(l=(f=(h=g)[b]||(h[b]={}))[h.uniqueID]||(f[h.uniqueID]={}))[t]||[])[0]===k&&c[1])&&c[2],h=p&&g.childNodes[p];h=++p&&h&&h[y]||(m=p=0)||d.pop();)if(1===h.nodeType&&++m&&h===e){l[t]=[k,p,m];break}}else if(x&&(m=p=(c=(l=(f=(h=e)[b]||(h[b]={}))[h.uniqueID]||(f[h.uniqueID]={}))[t]||[])[0]===k&&c[1]),!1===m)for(;(h=++p&&h&&h[y]||(m=p=0)||d.pop())&&((s?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++m||(x&&((l=(f=h[b]||(h[b]={}))[h.uniqueID]||(f[h.uniqueID]={}))[t]=[k,m]),h!==e)););return(m-=i)===r||m%r==0&&m/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return i[b]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ct((function(t,n){for(var r,o=i(t,e),a=o.length;a--;)t[r=j(t,o[a])]=!(n[r]=o[a])})):function(t){return i(t,0,n)}):i}},pseudos:{not:ct((function(t){var e=[],n=[],r=s(t.replace(G,"$1"));return r[b]?ct((function(t,e,n,i){for(var o,a=r(t,null,i,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}})),has:ct((function(t){return function(e){return st(t,e).length>0}})),contains:ct((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}})),lang:ct((function(t){return W.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=y?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===d},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:yt(!1),disabled:yt(!0),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},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return K.test(t.nodeName)},input:function(t){return $.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:gt((function(){return[0]})),last:gt((function(t,e){return[e-1]})),eq:gt((function(t,e,n){return[n<0?n+e:n]})),even:gt((function(t,e){for(var n=0;ne?e:n;--r>=0;)t.push(r);return t})),gt:gt((function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function kt(t,e,n,r,i){for(var o,a=[],s=0,u=t.length,c=null!=e;s-1&&(o[c]=!(a[c]=f))}}else v=kt(v===a?v.splice(d,v.length):v),i?i(null,a,v,u):O.apply(a,v)}))}function _t(t){for(var e,n,i,o=t.length,a=r.relative[t[0].type],s=a||r.relative[" "],u=a?1:0,l=bt((function(t){return t===e}),s,!0),f=bt((function(t){return j(e,t)>-1}),s,!0),h=[function(t,n,r){var i=!a&&(r||n!==c)||((e=n).nodeType?l(t,n,r):f(t,n,r));return e=null,i}];u1&&wt(h),u>1&&mt(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(G,"$1"),n,u0,i=t.length>0,o=function(o,a,s,u,l){var f,d,g,v=0,x="0",m=o&&[],b=[],w=c,S=o||i&&r.find.TAG("*",l),_=k+=null==w?1:Math.random()||.1,M=S.length;for(l&&(c=a==p||a||l);x!==M&&null!=(f=S[x]);x++){if(i&&f){for(d=0,a||f.ownerDocument==p||(h(f),s=!y);g=t[d++];)if(g(f,a||p,s)){u.push(f);break}l&&(k=_)}n&&((f=!g&&f)&&v--,o&&m.push(f))}if(v+=x,n&&x!==v){for(d=0;g=e[d++];)g(m,b,a,s);if(o){if(v>0)for(;x--;)m[x]||b[x]||(b[x]=N.call(u));b=kt(b)}O.apply(u,b),l&&!o&&b.length>0&&v+e.length>1&&st.uniqueSort(u)}return l&&(k=_,c=w),m};return n?ct(o):o}(o,i))).selector=t}return s},u=st.select=function(t,e,n,i){var o,u,c,l,f,h="function"==typeof t&&t,p=!i&&a(t=h.selector||t);if(n=n||[],1===p.length){if((u=p[0]=p[0].slice(0)).length>2&&"ID"===(c=u[0]).type&&9===e.nodeType&&y&&r.relative[u[1].type]){if(!(e=(r.find.ID(c.matches[0].replace(et,nt),e)||[])[0]))return n;h&&(e=e.parentNode),t=t.slice(u.shift().value.length)}for(o=Y.needsContext.test(t)?0:u.length;o--&&(c=u[o],!r.relative[l=c.type]);)if((f=r.find[l])&&(i=f(c.matches[0].replace(et,nt),tt.test(u[0].type)&&vt(e.parentNode)||e))){if(u.splice(o,1),!(t=i.length&&mt(u)))return O.apply(n,i),n;break}}return(h||s(t,p))(i,e,!y,n,!e||tt.test(t)&&vt(e.parentNode)||e),n},n.sortStable=b.split("").sort(C).join("")===b,n.detectDuplicates=!!f,h(),n.sortDetached=lt((function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))})),lt((function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")}))||ft("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&<((function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ft("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),lt((function(t){return null==t.getAttribute("disabled")}))||ft(I,(function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null})),st}(n);S.find=M,S.expr=M.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=M.uniqueSort,S.text=M.getText,S.isXMLDoc=M.isXML,S.contains=M.contains,S.escapeSelector=M.escape;var E=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&S(t).is(n))break;r.push(t)}return r},A=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},C=S.expr.match.needsContext;function L(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var T=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function N(t,e,n){return v(e)?S.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?S.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?S.grep(t,(function(t){return l.call(e,t)>-1!==n})):S.filter(e,t,n)}S.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?S.find.matchesSelector(r,t)?[r]:[]:S.find.matches(t,S.grep(e,(function(t){return 1===t.nodeType})))},S.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(S(t).filter((function(){for(e=0;e1?S.uniqueSort(n):n},filter:function(t){return this.pushStack(N(this,t||[],!1))},not:function(t){return this.pushStack(N(this,t||[],!0))},is:function(t){return!!N(this,"string"==typeof t&&C.test(t)?S(t):t||[],!1).length}});var P,O=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||P,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:O.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:m,!0)),T.test(r[1])&&S.isPlainObject(e))for(r in e)v(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=m.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==n.ready?n.ready(t):t(S):S.makeArray(t,this)}).prototype=S.fn,P=S(m);var D=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function I(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&S.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?l.call(S(t),this[0]):l.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return E(t,"parentNode")},parentsUntil:function(t,e,n){return E(t,"parentNode",n)},next:function(t){return I(t,"nextSibling")},prev:function(t){return I(t,"previousSibling")},nextAll:function(t){return E(t,"nextSibling")},prevAll:function(t){return E(t,"previousSibling")},nextUntil:function(t,e,n){return E(t,"nextSibling",n)},prevUntil:function(t,e,n){return E(t,"previousSibling",n)},siblings:function(t){return A((t.parentNode||{}).firstChild,t)},children:function(t){return A(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(L(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},(function(t,e){S.fn[t]=function(n,r){var i=S.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=S.filter(r,i)),this.length>1&&(j[t]||S.uniqueSort(i),D.test(t)&&i.reverse()),this.pushStack(i)}}));var R=/[^\x20\t\r\n\f]+/g;function q(t){return t}function z(t){throw t}function B(t,e,n,r){var i;try{t&&v(i=t.promise)?i.call(t).done(e).fail(n):t&&v(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}S.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return S.each(t.match(R)||[],(function(t,n){e[n]=!0})),e}(t):S.extend({},t);var e,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||t.once,r=e=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--})),this},has:function(t){return t?S.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||u()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return S.Deferred((function(n){S.each(e,(function(e,r){var i=v(t[r[4]])&&t[r[4]];o[r[1]]((function(){var t=i&&i.apply(this,arguments);t&&v(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)}))})),t=null})).promise()},then:function(t,r,i){var o=0;function a(t,e,r,i){return function(){var s=this,u=arguments,c=function(){var n,c;if(!(t=o&&(r!==z&&(s=void 0,u=[n]),e.rejectWith(s,u))}};t?l():(S.Deferred.getStackHook&&(l.stackTrace=S.Deferred.getStackHook()),n.setTimeout(l))}}return S.Deferred((function(n){e[0][3].add(a(0,n,v(i)?i:q,n.notifyWith)),e[1][3].add(a(0,n,v(t)?t:q)),e[2][3].add(a(0,n,v(r)?r:z))})).promise()},promise:function(t){return null!=t?S.extend(t,i):i}},o={};return S.each(e,(function(t,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add((function(){r=s}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?s.call(arguments):n,--e||o.resolveWith(r,i)}};if(e<=1&&(B(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||v(i[n]&&i[n].then)))return o.then();for(;n--;)B(i[n],a(n),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&H.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){n.setTimeout((function(){throw t}))};var G=S.Deferred();function V(){m.removeEventListener("DOMContentLoaded",V),n.removeEventListener("load",V),S.ready()}S.fn.ready=function(t){return G.then(t).catch((function(t){S.readyException(t)})),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||G.resolveWith(m,[S]))}}),S.ready.then=G.then,"complete"===m.readyState||"loading"!==m.readyState&&!m.documentElement.doScroll?n.setTimeout(S.ready):(m.addEventListener("DOMContentLoaded",V),n.addEventListener("load",V));var F=function(t,e,n,r,i,o,a){var s=0,u=t.length,c=null==n;if("object"===k(n))for(s in i=!0,n)F(t,e,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(S(t),n)})),e))for(;s1,null,!0)},removeData:function(t){return this.each((function(){J.remove(this,t)}))}}),S.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=K.get(t,e),n&&(!r||Array.isArray(n)?r=K.access(t,e,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=S.queue(t,e),r=n.length,i=n.shift(),o=S._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,(function(){S.dequeue(t,e)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return K.get(t,n)||K.access(t,n,{empty:S.Callbacks("once memory").add((function(){K.remove(t,[e+"queue",n])}))})}}),S.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,vt=/^$|^module$|\/(?:java|ecma)script/i;pt=m.createDocumentFragment().appendChild(m.createElement("div")),(dt=m.createElement("input")).setAttribute("type","radio"),dt.setAttribute("checked","checked"),dt.setAttribute("name","t"),pt.appendChild(dt),g.checkClone=pt.cloneNode(!0).cloneNode(!0).lastChild.checked,pt.innerHTML="",g.noCloneChecked=!!pt.cloneNode(!0).lastChild.defaultValue,pt.innerHTML="",g.option=!!pt.lastChild;var xt={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function mt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&L(t,e)?S.merge([t],n):n}function bt(t,e){for(var n=0,r=t.length;n",""]);var wt=/<|&#?\w+;/;function kt(t,e,n,r,i){for(var o,a,s,u,c,l,f=e.createDocumentFragment(),h=[],p=0,d=t.length;p-1)i&&i.push(o);else if(c=at(o),a=mt(f.appendChild(o),"script"),c&&bt(a),n)for(l=0;o=a[l++];)vt.test(o.type||"")&&n.push(o);return f}var St=/^([^.]*)(?:\.(.+)|)/;function _t(){return!0}function Mt(){return!1}function Et(t,e){return t===function(){try{return m.activeElement}catch(t){}}()==("focus"===e)}function At(t,e,n,r,i,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof n&&(r=r||n,n=void 0),e)At(t,s,n,r,e[s],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Mt;else if(!i)return t;return 1===o&&(a=i,(i=function(t){return S().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),t.each((function(){S.event.add(this,e,i,r,n)}))}function Ct(t,e,n){n?(K.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var r,i,o=K.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=s.call(arguments),K.set(this,e,o),r=n(this,e),this[e](),o!==(i=K.get(this,e))||r?K.set(this,e,!1):i={},o!==i)return t.stopImmediatePropagation(),t.preventDefault(),i&&i.value}else o.length&&(K.set(this,e,{value:S.event.trigger(S.extend(o[0],S.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===K.get(t,e)&&S.event.add(t,e,_t)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,c,l,f,h,p,d,y,g=K.get(t);if(Z(t))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(ot,i),n.guid||(n.guid=S.guid++),(u=g.events)||(u=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(R)||[""]).length;c--;)p=y=(s=St.exec(e[c])||[])[1],d=(s[2]||"").split(".").sort(),p&&(f=S.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=S.event.special[p]||{},l=S.extend({type:p,origType:y,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:d.join(".")},o),(h=u[p])||((h=u[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,d,a)||t.addEventListener&&t.addEventListener(p,a)),f.add&&(f.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,l):h.push(l),S.event.global[p]=!0)},remove:function(t,e,n,r,i){var o,a,s,u,c,l,f,h,p,d,y,g=K.hasData(t)&&K.get(t);if(g&&(u=g.events)){for(c=(e=(e||"").match(R)||[""]).length;c--;)if(p=y=(s=St.exec(e[c])||[])[1],d=(s[2]||"").split(".").sort(),p){for(f=S.event.special[p]||{},h=u[p=(r?f.delegateType:f.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)l=h[o],!i&&y!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(h.splice(o,1),l.selector&&h.delegateCount--,f.remove&&f.remove.call(t,l));a&&!h.length&&(f.teardown&&!1!==f.teardown.call(t,d,g.handle)||S.removeEvent(t,p,g.handle),delete u[p])}else for(p in u)S.event.remove(t,p+e[c],n,r,!0);S.isEmptyObject(u)&&K.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(t),c=(K.get(this,"events")||Object.create(null))[u.type]||[],l=S.event.special[u.type]||{};for(s[0]=u,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(o=[],a={},n=0;n-1:S.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,u\s*$/g;function Pt(t,e){return L(t,"table")&&L(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Ot(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Dt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function jt(t,e){var n,r,i,o,a,s;if(1===e.nodeType){if(K.hasData(t)&&(s=K.get(t).events))for(i in K.remove(e,"handle events"),s)for(n=0,r=s[i].length;n1&&"string"==typeof d&&!g.checkClone&&Tt.test(d))return t.each((function(i){var o=t.eq(i);y&&(e[0]=d.call(this,i,o.html())),Rt(o,e,n,r)}));if(h&&(o=(i=kt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=S.map(mt(i,"script"),Ot)).length;f0&&bt(a,!u&&mt(t,"script")),s},cleanData:function(t){for(var e,n,r,i=S.event.special,o=0;void 0!==(n=t[o]);o++)if(Z(n)){if(e=n[K.expando]){if(e.events)for(r in e.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,e.handle);n[K.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),S.fn.extend({detach:function(t){return qt(this,t,!0)},remove:function(t){return qt(this,t)},text:function(t){return F(this,(function(t){return void 0===t?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Rt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Pt(this,t).appendChild(t)}))},prepend:function(){return Rt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Pt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Rt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Rt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(mt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return F(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Lt.test(t)&&!xt[(gt.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;n=0&&(u+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-u-s-.5))||0),u}function ee(t,e,n){var r=Bt(t),i=(!g.boxSizingReliable()||n)&&"border-box"===S.css(t,"boxSizing",!1,r),o=i,a=Vt(t,e,r),s="offset"+e[0].toUpperCase()+e.slice(1);if(zt.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&i||!g.reliableTrDimensions()&&L(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(t,"display",!1,r))&&t.getClientRects().length&&(i="border-box"===S.css(t,"boxSizing",!1,r),(o=s in t)&&(a=t[s])),(a=parseFloat(a)||0)+te(t,e,n||(i?"border":"content"),o,r,a)+"px"}function ne(t,e,n,r,i){return new ne.prototype.init(t,e,n,r,i)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Vt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,s=Y(e),u=$t.test(e),c=t.style;if(u||(e=Yt(s)),a=S.cssHooks[e]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:c[e];"string"===(o=typeof n)&&(i=rt.exec(n))&&i[1]&&(n=ct(t,e,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(u?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var i,o,a,s=Y(e);return $t.test(e)||(e=Yt(s)),(a=S.cssHooks[e]||S.cssHooks[s])&&"get"in a&&(i=a.get(t,!0,n)),void 0===i&&(i=Vt(t,e,r)),"normal"===i&&e in Jt&&(i=Jt[e]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,n,r){if(n)return!Zt.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ee(t,e,r):Ht(t,Kt,(function(){return ee(t,e,r)}))},set:function(t,n,r){var i,o=Bt(t),a=!g.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===S.css(t,"boxSizing",!1,o),u=r?te(t,e,r,s,o):0;return s&&a&&(u-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-te(t,e,"border",!1,o)-.5)),u&&(i=rt.exec(n))&&"px"!==(i[3]||"px")&&(t.style[e]=n,n=S.css(t,e)),Qt(0,n,u)}}})),S.cssHooks.marginLeft=Ft(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Vt(t,"marginLeft"))||t.getBoundingClientRect().left-Ht(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[t+it[r]+e]=o[r]||o[r-2]||o[0];return i}},"margin"!==t&&(S.cssHooks[t+e].set=Qt)})),S.fn.extend({css:function(t,e){return F(this,(function(t,e,n){var r,i,o={},a=0;if(Array.isArray(e)){for(r=Bt(t),i=e.length;a1)}}),S.Tween=ne,ne.prototype={constructor:ne,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var t=ne.propHooks[this.prop];return t&&t.get?t.get(this):ne.propHooks._default.get(this)},run:function(t){var e,n=ne.propHooks[this.prop];return this.options.duration?this.pos=e=S.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ne.propHooks._default.set(this),this}},ne.prototype.init.prototype=ne.prototype,ne.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=S.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[Yt(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},ne.propHooks.scrollTop=ne.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=ne.prototype.init,S.fx.step={};var re,ie,oe=/^(?:toggle|show|hide)$/,ae=/queueHooks$/;function se(){ie&&(!1===m.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(se):n.setTimeout(se,S.fx.interval),S.fx.tick())}function ue(){return n.setTimeout((function(){re=void 0})),re=Date.now()}function ce(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=it[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function le(t,e,n){for(var r,i=(fe.tweeners[e]||[]).concat(fe.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?S.prop(t,e,n):(1===o&&S.isXMLDoc(t)||(i=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?he:void 0)),void 0!==n?null===n?void S.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=S.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&L(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(R);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),he={set:function(t,e,n){return!1===e?S.removeAttr(t,n):t.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=pe[e]||S.find.attr;pe[e]=function(t,e,r){var i,o,a=e.toLowerCase();return r||(o=pe[a],pe[a]=i,i=null!=n(t,e,r)?a:null,pe[a]=o),i}}));var de=/^(?:input|select|textarea|button)$/i,ye=/^(?:a|area)$/i;function ge(t){return(t.match(R)||[]).join(" ")}function ve(t){return t.getAttribute&&t.getAttribute("class")||""}function xe(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(R)||[]}S.fn.extend({prop:function(t,e){return F(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(t)||(e=S.propFix[e]||e,i=S.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):de.test(t.nodeName)||ye.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(S.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(v(t))return this.each((function(e){S(this).addClass(t.call(this,e,ve(this)))}));if((e=xe(t)).length)for(;n=this[u++];)if(i=ve(n),r=1===n.nodeType&&" "+ge(i)+" "){for(a=0;o=e[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=ge(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(v(t))return this.each((function(e){S(this).removeClass(t.call(this,e,ve(this)))}));if(!arguments.length)return this.attr("class","");if((e=xe(t)).length)for(;n=this[u++];)if(i=ve(n),r=1===n.nodeType&&" "+ge(i)+" "){for(a=0;o=e[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=ge(r))&&n.setAttribute("class",s)}return this},toggleClass:function(t,e){var n=typeof t,r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):v(t)?this.each((function(n){S(this).toggleClass(t.call(this,n,ve(this),e),e)})):this.each((function(){var e,i,o,a;if(r)for(i=0,o=S(this),a=xe(t);e=a[i++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=ve(this))&&K.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":K.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+ge(ve(n))+" ").indexOf(e)>-1)return!0;return!1}});var me=/\r/g;S.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=v(t),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,S(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=S.map(i,(function(t){return null==t?"":t+""}))),(e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))}))):i?(e=S.valHooks[i.type]||S.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(me,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:ge(S.text(t))}},select:{get:function(t){var e,n,r,i=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},g.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),g.focusin="onfocusin"in n;var be=/^(?:focusinfocus|focusoutblur)$/,we=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,r,i){var o,a,s,u,c,l,f,h,d=[r||m],y=p.call(t,"type")?t.type:t,g=p.call(t,"namespace")?t.namespace.split("."):[];if(a=h=s=r=r||m,3!==r.nodeType&&8!==r.nodeType&&!be.test(y+S.event.triggered)&&(y.indexOf(".")>-1&&(g=y.split("."),y=g.shift(),g.sort()),c=y.indexOf(":")<0&&"on"+y,(t=t[S.expando]?t:new S.Event(y,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),e=null==e?[t]:S.makeArray(e,[t]),f=S.event.special[y]||{},i||!f.trigger||!1!==f.trigger.apply(r,e))){if(!i&&!f.noBubble&&!x(r)){for(u=f.delegateType||y,be.test(u+y)||(a=a.parentNode);a;a=a.parentNode)d.push(a),s=a;s===(r.ownerDocument||m)&&d.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=d[o++])&&!t.isPropagationStopped();)h=a,t.type=o>1?u:f.bindType||y,(l=(K.get(a,"events")||Object.create(null))[t.type]&&K.get(a,"handle"))&&l.apply(a,e),(l=c&&a[c])&&l.apply&&Z(a)&&(t.result=l.apply(a,e),!1===t.result&&t.preventDefault());return t.type=y,i||t.isDefaultPrevented()||f._default&&!1!==f._default.apply(d.pop(),e)||!Z(r)||c&&v(r[y])&&!x(r)&&((s=r[c])&&(r[c]=null),S.event.triggered=y,t.isPropagationStopped()&&h.addEventListener(y,we),r[y](),t.isPropagationStopped()&&h.removeEventListener(y,we),S.event.triggered=void 0,s&&(r[c]=s)),t.result}},simulate:function(t,e,n){var r=S.extend(new S.Event,n,{type:t,isSimulated:!0});S.event.trigger(r,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return S.event.trigger(t,e,n,!0)}}),g.focusin||S.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){S.event.simulate(e,t.target,S.event.fix(t))};S.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,i=K.access(r,e);i||r.addEventListener(t,n,!0),K.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=K.access(r,e)-1;i?K.access(r,e,i):(r.removeEventListener(t,n,!0),K.remove(r,e))}}}));var ke=n.location,Se={guid:Date.now()},_e=/\?/;S.parseXML=function(t){var e,r;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){}return r=e&&e.getElementsByTagName("parsererror")[0],e&&!r||S.error("Invalid XML: "+(r?S.map(r.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Me=/\[\]$/,Ee=/\r?\n/g,Ae=/^(?:submit|button|image|reset|file)$/i,Ce=/^(?:input|select|textarea|keygen)/i;function Le(t,e,n,r){var i;if(Array.isArray(e))S.each(e,(function(e,i){n||Me.test(t)?r(t,i):Le(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)}));else if(n||"object"!==k(e))r(t,e);else for(i in e)Le(t+"["+i+"]",e[i],n,r)}S.param=function(t,e){var n,r=[],i=function(t,e){var n=v(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){i(this.name,this.value)}));else for(n in t)Le(n,t[n],e,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&Ce.test(this.nodeName)&&!Ae.test(t)&&(this.checked||!yt.test(t))})).map((function(t,e){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(t){return{name:e.name,value:t.replace(Ee,"\r\n")}})):{name:e.name,value:n.replace(Ee,"\r\n")}})).get()}});var Te=/%20/g,Ne=/#.*$/,Pe=/([?&])_=[^&]*/,Oe=/^(.*?):[ \t]*([^\r\n]*)$/gm,De=/^(?:GET|HEAD)$/,je=/^\/\//,Ie={},Re={},qe="*/".concat("*"),ze=m.createElement("a");function Be(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(R)||[];if(v(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function He(t,e,n,r){var i={},o=t===Re;function a(s){var u;return i[s]=!0,S.each(t[s]||[],(function(t,s){var c=s(e,n,r);return"string"!=typeof c||o||i[c]?o?!(u=c):void 0:(e.dataTypes.unshift(c),a(c),!1)})),u}return a(e.dataTypes[0])||!i["*"]&&a("*")}function Ge(t,e){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&S.extend(!0,t,r),t}ze.href=ke.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ke.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ke.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":qe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ge(Ge(t,S.ajaxSettings),e):Ge(S.ajaxSettings,t)},ajaxPrefilter:Be(Ie),ajaxTransport:Be(Re),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,i,o,a,s,u,c,l,f,h,p=S.ajaxSetup({},e),d=p.context||p,y=p.context&&(d.nodeType||d.jquery)?S(d):S.event,g=S.Deferred(),v=S.Callbacks("once memory"),x=p.statusCode||{},b={},w={},k="canceled",_={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=Oe.exec(o);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(t,e){return null==c&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)_.always(t[_.status]);else for(e in t)x[e]=[x[e],t[e]];return this},abort:function(t){var e=t||k;return r&&r.abort(e),M(0,e),this}};if(g.promise(_),p.url=((t||p.url||ke.href)+"").replace(je,ke.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(R)||[""],null==p.crossDomain){u=m.createElement("a");try{u.href=p.url,u.href=u.href,p.crossDomain=ze.protocol+"//"+ze.host!=u.protocol+"//"+u.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=S.param(p.data,p.traditional)),He(Ie,p,e,_),c)return _;for(f in(l=S.event&&p.global)&&0==S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!De.test(p.type),i=p.url.replace(Ne,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Te,"+")):(h=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(_e.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(Pe,"$1"),h=(_e.test(i)?"&":"?")+"_="+Se.guid+++h),p.url=i+h),p.ifModified&&(S.lastModified[i]&&_.setRequestHeader("If-Modified-Since",S.lastModified[i]),S.etag[i]&&_.setRequestHeader("If-None-Match",S.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&_.setRequestHeader("Content-Type",p.contentType),_.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+qe+"; q=0.01":""):p.accepts["*"]),p.headers)_.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(d,_,p)||c))return _.abort();if(k="abort",v.add(p.complete),_.done(p.success),_.fail(p.error),r=He(Re,p,e,_)){if(_.readyState=1,l&&y.trigger("ajaxSend",[_,p]),c)return _;p.async&&p.timeout>0&&(s=n.setTimeout((function(){_.abort("timeout")}),p.timeout));try{c=!1,r.send(b,M)}catch(t){if(c)throw t;M(-1,t)}}else M(-1,"No Transport");function M(t,e,a,u){var f,h,m,b,w,k=e;c||(c=!0,s&&n.clearTimeout(s),r=void 0,o=u||"",_.readyState=t>0?4:0,f=t>=200&&t<300||304===t,a&&(b=function(t,e,n){for(var r,i,o,a,s=t.contents,u=t.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||t.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(p,_,a)),!f&&S.inArray("script",p.dataTypes)>-1&&S.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),b=function(t,e,n,r){var i,o,a,s,u,c={},l=t.dataTypes.slice();if(l[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(o=l.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!u&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),u=o,o=l.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=c[u+" "+o]||c["* "+o]))for(i in c)if((s=i.split(" "))[1]===o&&(a=c[u+" "+s[0]]||c["* "+s[0]])){!0===a?a=c[i]:!0!==c[i]&&(o=s[0],l.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+u+" to "+o}}}return{state:"success",data:e}}(p,b,_,f),f?(p.ifModified&&((w=_.getResponseHeader("Last-Modified"))&&(S.lastModified[i]=w),(w=_.getResponseHeader("etag"))&&(S.etag[i]=w)),204===t||"HEAD"===p.type?k="nocontent":304===t?k="notmodified":(k=b.state,h=b.data,f=!(m=b.error))):(m=k,!t&&k||(k="error",t<0&&(t=0))),_.status=t,_.statusText=(e||k)+"",f?g.resolveWith(d,[h,k,_]):g.rejectWith(d,[_,k,m]),_.statusCode(x),x=void 0,l&&y.trigger(f?"ajaxSuccess":"ajaxError",[_,p,f?h:m]),v.fireWith(d,[_,k]),l&&(y.trigger("ajaxComplete",[_,p]),--S.active||S.event.trigger("ajaxStop")))}return _},getJSON:function(t,e,n){return S.get(t,e,n,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,n,r,i){return v(n)&&(i=i||r,r=n,n=void 0),S.ajax(S.extend({url:t,type:e,dataType:i,data:n,success:r},S.isPlainObject(t)&&t))}})),S.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),S._evalUrl=function(t,e,n){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,n)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(n){S(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Ve={0:200,1223:204},Fe=S.ajaxSettings.xhr();g.cors=!!Fe&&"withCredentials"in Fe,g.ajax=Fe=!!Fe,S.ajaxTransport((function(t){var e,r;if(g.cors||Fe&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);e=function(t){return function(){e&&(e=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Ve[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),r=s.onerror=s.ontimeout=e("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout((function(){e&&r()}))},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,i){e=S(" diff --git a/package.json b/package.json index ccf5f40..c264d72 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "complexviewer", - "version": "2.1.17", + "version": "2.2.0", "description": "A network visualisation that displays molecular interaction data, including detailed residue-level information such as binding sites. Used in EBI's Complex Portal and elsewhere.", "author": { "name": "Colin Combe", @@ -22,6 +22,10 @@ { "name": "Marine Dumousseau", "email": "" + }, + { + "name": "Eliot Ragueneau", + "email": "eragueneau@ebi.ac.uk" } ], "license": "Apache-2.0", @@ -54,13 +58,19 @@ "node": ">=14.0.0" }, "dependencies": { - "colorbrewer": "^1.3.0", + "colorbrewer": "1.3.0", "core-js": "^3.15.2", - "d3": "~3.5.5", - "d3-scale-chromatic": "^1.5.0", - "intersectionjs": "^1.0.1", + "d3": "~7.1.1", + "d3-ease": "~3.0.1", + "d3-polygon": "~3.0.1", + "d3-fetch": "~3.0.1", + "d3-scale-chromatic": "~1.5.0", + "d3-scale": "~4.0.2", + "d3-interpolate": "^3.0.1", + "d3-selection": "^3.0.0", + "intersectionjs": "1.0.1", "jquery": "^3.6.0", - "point2d": "^0.0.1", + "point2d": "0.0.1", "rgb-color": "2.1.2" }, "keywords": [ diff --git a/src/js/annotation-utils.js b/src/js/annotation-utils.js index 9225820..cfc881d 100644 --- a/src/js/annotation-utils.js +++ b/src/js/annotation-utils.js @@ -35,18 +35,15 @@ export function fetchAnnotations(/*App*/ app, callback) { function getUniProtFeatures(prot, callback) { const url = "https://www.ebi.ac.uk/proteins/api/proteins/" + prot.json.identifier.id.trim(); - d3.json(url, function (json) { + d3.json(url).then(json => { let annotations = prot.annotationSets.get("UniprotKB"); if (typeof annotations === "undefined") { annotations = []; prot.annotationSets.set("UniprotKB", annotations); } if (json) { - const uniprotJsonFeatures = json.features.filter(function (ft) { - return ft.type === "DOMAIN"; - }); - for (let feature of uniprotJsonFeatures) { - const anno = new Annotation(feature.description, new SequenceDatum(null, feature.begin + "-" + feature.end)); + for (let feature of json.features.filter(ft => ft.type === "DOMAIN")) { + const anno = new Annotation(feature.description, new SequenceDatum(null, `${feature.begin}-${feature.end}`)); annotations.push(anno); } } @@ -54,28 +51,46 @@ function getUniProtFeatures(prot, callback) { }); } + function getSuperFamFeatures(prot, callback) { const url = "https://supfam.mrc-lmb.cam.ac.uk/SUPERFAMILY/cgi-bin/das/up/features?segment=" + prot.json.identifier.id.trim(); - d3.xml(url, function (xml) { + d3.xml(url).then(xml => { let annotations = prot.annotationSets.get("Superfamily"); if (typeof annotations === "undefined") { annotations = []; prot.annotationSets.set("Superfamily", annotations); } if (xml) { - const xmlDoc = new DOMParser().parseFromString(new XMLSerializer().serializeToString(xml), "text/xml"); - const xmlFeatures = xmlDoc.getElementsByTagName("FEATURE"); + const xmlFeatures = xml.getElementsByTagName("FEATURE"); for (let xmlFeature of xmlFeatures) { const type = xmlFeature.getElementsByTagName("TYPE")[0]; //might need to watch for text nodes getting mixed in here const category = type.getAttribute("category"); if (category === "miscellaneous") { - const name = type.getAttribute("id"); + const name = decodeHTML(type.getAttribute("id")); const start = xmlFeature.getElementsByTagName("START")[0].textContent; const end = xmlFeature.getElementsByTagName("END")[0].textContent; - annotations.push(new Annotation(name, new SequenceDatum(null, start + "-" + end))); + annotations.push(new Annotation(name, new SequenceDatum(null, `${start}-${end}`))); } } } callback(); }); -} \ No newline at end of file +} + + +function decodeHTML(text) { + return text.replace(/&([^;]+);/gm, (match, entity) => entities[entity] || match) +} + +const entities = { + 'amp': '&', + 'apos': '\'', + '#x27': '\'', + '#x2F': '/', + '#39': '\'', + '#47': '/', + 'lt': '<', + 'gt': '>', + 'nbsp': ' ', + 'quot': '"' +} diff --git a/src/js/app.js b/src/js/app.js index 92ede1b..93ece6f 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,6 +1,7 @@ import "../css/xinet.css"; import packageInfo from "../../package.json"; import * as d3 from "d3"; +import {scaleOrdinal} from "d3-scale"; import * as d3_chromatic from "d3-scale-chromatic"; import * as cola from "./cola"; import * as Rgb_color from "rgb-color"; @@ -21,7 +22,7 @@ export class App { //avoids prob with 'save - web page complete' this.el.textContent = ""; //https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript this.maxCountInitiallyExpanded = maxCountInitiallyExpanded; - this.d3cola = cola.d3adaptor().groupCompactness(Number.MIN_VALUE).avoidOverlaps(true); //1e-5 + this.d3cola = cola.d3adaptor(d3).groupCompactness(Number.MIN_VALUE).avoidOverlaps(true); //1e-5 const customMenuSel = d3.select(this.el) .append("div").classed("custom-menu-margin", true) @@ -31,7 +32,7 @@ export class App { const self = this; const collapse = customMenuSel.append("li").classed("collapse", true); //.append("button"); collapse.text("Collapse"); - collapse[0][0].onclick = function (evt) { + collapse.node().onclick = function (evt) { self.collapseProtein(evt); }; const scaleButtonsListItemSel = customMenuSel.append("li").text("Scale: "); @@ -54,7 +55,7 @@ export class App { }) .attr("name", "scaleButtons") .attr("type", "radio") - .on("change", function (d) { + .on("change", function (e, d) { self.preventDefaultsAndStopPropagation(d); self.contextMenuProt.setStickScale(d, self.contextMenuPoint); }); @@ -75,27 +76,13 @@ export class App { this.svgElement.classList.add("complexViewerSVG"); //add listeners - this.svgElement.onmousedown = function (evt) { - self.mouseDown(evt); - }; - this.svgElement.onmousemove = function (evt) { - self.move(evt); - }; - this.svgElement.onmouseup = function (evt) { - self.mouseUp(evt); - }; - this.svgElement.onmouseout = function (evt) { - self.mouseOut(evt); - }; - this.svgElement.ontouchstart = function (evt) { - self.touchStart(evt); - }; - this.svgElement.ontouchmove = function (evt) { - self.move(evt); - }; - this.svgElement.ontouchend = function (evt) { - self.mouseUp(evt); - }; + this.svgElement.onmousedown = evt => self.mouseDown(evt); + this.svgElement.onmousemove = evt => self.move(evt); + this.svgElement.onmouseup = evt => self.mouseUp(evt); + this.svgElement.onmouseout = evt => self.mouseOut(evt); + this.svgElement.ontouchstart = evt => self.touchStart(evt); + this.svgElement.ontouchmove = evt => self.move(evt); + this.svgElement.ontouchend = evt => self.mouseUp(evt); this.lastMouseUp = new Date().getTime(); this.el.oncontextmenu = function (evt) { @@ -230,7 +217,7 @@ export class App { hsl.l = 0.9; complexColors.push(hsl + ""); } - NaryLink.naryColors = d3.scale.ordinal().range(complexColors); + NaryLink.naryColors = scaleOrdinal().range(complexColors); this.z = 1; this.hideTooltip(); @@ -648,10 +635,31 @@ export class App { } //choose appropriate color scheme let colorScheme; - if (categories.size < 11) { - colorScheme = d3.scale.ordinal().range(d3_chromatic.schemeTableau10); + if (categories.size <= 10) { + colorScheme = scaleOrdinal().range(d3_chromatic.schemeTableau10); } else { - colorScheme = d3.scale.category20(); + colorScheme = d3.scaleOrdinal().range([ + "#38cae3", + "#d4582b", + "#7d5fd7", + "#7cd352", + "#ce4bbb", + "#5aa33c", + "#93539d", + "#d2c33b", + "#5c83d4", + "#e19a46", + "#d891d7", + "#65da9a", + "#9d772f", + "#d43f4c", + "#4db186", + "#cf4b7e", + "#477c3a", + "#c46d5c", + "#b6c671", + "#798126" + ]); // Generated from https://medialab.github.io/iwanthue/ } const self = this; diff --git a/src/js/transform.js b/src/js/transform.js new file mode 100644 index 0000000..b914b2c --- /dev/null +++ b/src/js/transform.js @@ -0,0 +1,51 @@ +// Taken from https://stackoverflow.com/a/38230545/11028828 +export function transform(transform) { + // Create a dummy g for calculation purposes only. This will never + // be appended to the DOM and will be discarded once this function + // returns. + const g = document.createElementNS("http://www.w3.org/2000/svg", "g"); + + // Set the transform attribute to the provided string value. + g.setAttributeNS(null, "transform", transform); + + // consolidate the SVGTransformList containing all transformations + // to a single SVGTransform of type SVG_TRANSFORM_MATRIX and get + // its SVGMatrix. + const matrix = g.transform.baseVal.consolidate().matrix; + + // Below calculations are taken and adapted from the private function + // transform/decompose.js of D3's module d3-interpolate. + let {a, b, c, d, e, f} = matrix; // ES6, if this doesn't work, use below assignment + // var a=matrix.a, b=matrix.b, c=matrix.c, d=matrix.d, e=matrix.e, f=matrix.f; // ES5 + let scaleX = Math.sqrt(a * a + b * b), + scaleY = Math.sqrt(c * c + d * d), + skewX = a * c + b * d; + if (scaleX) { + a /= scaleX; + b /= scaleX; + } + if (skewX) { + c -= a * skewX; + d -= b * skewX; + } + if (scaleY) { + c /= scaleY; + d /= scaleY; + skewX /= scaleY; + } + if (a * d < b * c) { + a = -a; + b = -b; + skewX = -skewX; + scaleX = -scaleX; + } + return { + translate: [e,f], + translateX: e, + translateY: f, + rotate: Math.atan2(b, a) * 180 / Math.PI, + skewX: Math.atan(skewX) * 180 / Math.PI, + scaleX: scaleX, + scaleY: scaleY + }; +} diff --git a/src/js/viz/interactor/polymer.js b/src/js/viz/interactor/polymer.js index 8340812..93f3558 100644 --- a/src/js/viz/interactor/polymer.js +++ b/src/js/viz/interactor/polymer.js @@ -1,4 +1,6 @@ import * as d3 from "d3"; // transitions and other stuff +import {transform} from "../../transform"; +import {easeCubicInOut} from "d3-ease"; import {rotatePointAboutPoint} from "../../geom"; import {svgns} from "../../svgns"; import {Interactor} from "./interactor"; @@ -45,8 +47,8 @@ export class Polymer extends Interactor { scale() { const protLength = (this.size) * this.stickZoom; if (this.expanded) { - const labelTransform = d3.transform(this.labelSVG.getAttribute("transform")); - const k = this.app.svgElement.createSVGMatrix().rotate(labelTransform.rotate) + const labelTransform = transform(this.labelSVG.getAttribute("transform")); + const k = this.app.svgElement.createSVGMatrix() .translate((-(((this.size / 2) * this.stickZoom) + (this.nTermFeatures.length > 0 ? 25 : 10))), this.labelY); //.scale(z).translate(-c.x, -c.y); this.labelSVG.transform.baseVal.initialize(this.app.svgElement.createSVGTransformFromMatrix(k)); this.updateAnnotationRectanglesNoTransition(); @@ -159,7 +161,6 @@ export class Polymer extends Interactor { } toCircle(transition = true, svgP) { - if (!svgP) { const width = this.app.svgElement.parentNode.clientWidth; const ctm = this.app.container.getCTM().inverse(); @@ -196,7 +197,7 @@ export class Polymer extends Interactor { .duration(transitionTime); const stickZoomInterpol = d3.interpolate(this.stickZoom, 0); - const labelTransform = d3.transform(this.labelSVG.getAttribute("transform")); + const labelTransform = transform(this.labelSVG.getAttribute("transform")); const labelStartPoint = labelTransform.translate[0]; const labelTranslateInterpol = d3.interpolate(labelStartPoint, -(r + 5)); @@ -209,7 +210,7 @@ export class Polymer extends Interactor { const self = this; d3.select(this.ticks).transition().attr("opacity", 0).duration(transitionTime / 4) - .each("end", + .on("end", function () { d3.select(this).selectAll("*").remove(); } @@ -217,7 +218,7 @@ export class Polymer extends Interactor { const originalStickZoom = this.stickZoom; const originalRotation = this.rotation; - const cubicInOut = d3.ease("cubic-in-out"); + const cubicInOut = easeCubicInOut; if (transition) { for (let [annotationType, annotations] of this.annotationSets) { if (this.app.annotationSetsShown.get(annotationType) === true) { @@ -242,16 +243,15 @@ export class Polymer extends Interactor { } } } - d3.timer(function (elapsed) { - return update(elapsed / transitionTime); + const t = d3.timer(function (elapsed) { + if (update(elapsed / transitionTime)) t.stop(); }); } else { update(1); } function update(interp) { - const labelTransform = d3.transform(self.labelSVG.getAttribute("transform")); - const k = self.app.svgElement.createSVGMatrix().rotate(labelTransform.rotate).translate(labelTranslateInterpol(cubicInOut(interp)), self.labelY); //.scale(z).translate(-c.x, -c.y); + const k = self.app.svgElement.createSVGMatrix().translate(labelTranslateInterpol(cubicInOut(interp)), self.labelY); //.scale(z).translate(-c.x, -c.y); self.labelSVG.transform.baseVal.initialize(self.app.svgElement.createSVGTransformFromMatrix(k)); if (xInterpol !== null) { @@ -339,7 +339,7 @@ export class Polymer extends Interactor { const self = this; - const cubicInOut = d3.ease("cubic-in-out"); + const cubicInOut = easeCubicInOut; if (transition) { for (let [annotationType, annotations] of this.annotationSets) { if (this.app.annotationSetsShown.get(annotationType) === true) { @@ -374,16 +374,16 @@ export class Polymer extends Interactor { } } } - d3.timer(function (elapsed) { - return update(elapsed / transitionTime); + const t = d3.timer(function (elapsed) { + if (update(elapsed / transitionTime)) t.stop(); }); } else { update(1); } function update(interp) { - const labelTransform = d3.transform(self.labelSVG.getAttribute("transform")); - const k = self.app.svgElement.createSVGMatrix().rotate(labelTransform.rotate).translate(labelTranslateInterpol(cubicInOut(interp)), self.labelY); //.scale(z).translate(-c.x, -c.y); + const labelTransform = transform(self.labelSVG.getAttribute("transform")); + const k = self.app.svgElement.createSVGMatrix().rotate(labelTransform.rotate).translate(labelTranslateInterpol(cubicInOut(interp)), self.labelY) self.labelSVG.transform.baseVal.initialize(self.app.svgElement.createSVGTransformFromMatrix(k)); const currentLength = lengthInterpol(cubicInOut(interp)); diff --git a/src/js/viz/link/nary-link.js b/src/js/viz/link/nary-link.js index 76d8779..911d351 100644 --- a/src/js/viz/link/nary-link.js +++ b/src/js/viz/link/nary-link.js @@ -1,4 +1,5 @@ -import * as d3 from "d3"; //used for d3.geom.hull +// import * as d3 from "d3"; //used for d3.geom.hull +import {polygonHull} from "d3-polygon"; import {Link} from "./link"; import {rotatePointAboutPoint} from "../../geom"; import {svgns} from "../../svgns"; @@ -88,7 +89,7 @@ export class NaryLink extends Link { setLinkCoordinates(dontPropogate) { // Uses d3.geom.hull to calculate a bounding path around an array of vertices const calculateHullPath = function (values) { - const hullPath = d3.geom.hull(values); + const hullPath = polygonHull(values); self.hull = hullPath; //hack? return "M" + hullPath.join("L") + "Z"; };