diff --git a/bundle.js b/bundle.js new file mode 100644 index 00000000..83f7654b --- /dev/null +++ b/bundle.js @@ -0,0 +1 @@ +(()=>{"use strict";const t={},e=[];function n(e,i){if(Array.isArray(e))for(const t of e)n(t,i);else if("object"!=typeof e)s(Object.getOwnPropertyNames(i)),t[e]=Object.assign(t[e]||{},i);else for(const t in e)n(t,e[t])}function i(e){return t[e]||{}}function s(t){e.push(...t)}function r(t,e){let n;const i=t.length,s=[];for(n=0;n=0;e--)E(t.children[e]);return t.id?(t.id=S(t.nodeName),t):t}function N(t,e){let n,i;for(i=(t=Array.isArray(t)?t:[t]).length-1;i>=0;i--)for(n in e)t[i].prototype[n]=e[n]}function j(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}n("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=k(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=k(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=k(t)).before(this),this},insertAfter:function(t){return(t=k(t)).after(this),this}});const z=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,L=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,D=/rgb\((\d+),(\d+),(\d+)\)/,I=/(#[a-z_][a-z0-9\-_]*)/i,R=/\)\s*,?\s*/,F=/\s/g,q=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,P=/^rgb\(/,B=/^(\s+)?$/,Y=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,X=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,$=/[\s,]+/,H=/[MLHVCSQTAZ]/i;function G(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function U(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function V(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}n("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split($)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),n("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=a(e);n[e]=this.node.style[t]}return n}if("string"==typeof t)return this.node.style[a(t)];if("object"==typeof t)for(const e in t)this.node.style[a(e)]=null==t[e]||B.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[a(t)]=null==e||B.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),n("Dom",{data:function(t,e,n){if(null==t)return this.data(r(o(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),n("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class W{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof W||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,n){const{random:i,round:s,sin:r,PI:o}=Math;if("vibrant"===t){const t=24*i()+57,e=38*i()+45,n=360*i();return new W(t,e,n,"lch")}if("sine"===t){const t=s(80*r(2*o*(e=null==e?i():e)/.5+.01)+150),n=s(50*r(2*o*e/.5+4.6)+200),h=s(100*r(2*o*e/.5+2.3)+150);return new W(t,n,h)}if("pastel"===t){const t=8*i()+86,e=17*i()+9,n=360*i();return new W(t,e,n,"lch")}if("dark"===t){const t=10+10*i(),e=50*i()+86,n=360*i();return new W(t,e,n,"lch")}if("rgb"===t){const t=255*i(),e=255*i(),n=255*i();return new W(t,e,n)}if("lab"===t){const t=100*i(),e=256*i()-128,n=256*i()-128;return new W(t,e,n,"lab")}if("grey"===t){const t=255*i();return new W(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(q.test(t)||P.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,s,r]=[t,e,n].map((t=>t/255)),o=Math.min(1-i,1-s,1-r);return 1===o?new W(0,0,0,1,"cmyk"):new W((1-i-o)/(1-o),(1-s-o)/(1-o),(1-r-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,s,r]=[t,e,n].map((t=>t/255)),o=Math.max(i,s,r),h=Math.min(i,s,r),a=(o+h)/2,u=o===h,l=o-h;return new W(360*(u?0:o===i?((s-r)/l+(s.5?l/(2-o-h):l/(o+h)),100*a,"hsl")}init(t=0,e=0,n=0,i=0,s="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)s="string"==typeof i?i:s,i="string"==typeof i?0:i,Object.assign(this,{_a:t,_b:e,_c:n,_d:i,space:s});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=U(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:U(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:U(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:U(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:U(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:U(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(P.test(t)){const e=t.replace(F,""),[n,i,s]=D.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:i,_c:s,_d:0,space:"rgb"})}else{if(!q.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,i,s]=L.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:i,_c:s,_d:0,space:"rgb"})}}const{_a:r,_b:o,_c:h,_d:a}=this,u="rgb"===this.space?{r,g:o,b:h}:"xyz"===this.space?{x:r,y:o,z:h}:"hsl"===this.space?{h:r,s:o,l:h}:"lab"===this.space?{l:r,a:o,b:h}:"lch"===this.space?{l:r,c:o,h}:"cmyk"===this.space?{c:r,m:o,y:h,k:a}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:n}=this.xyz();return new W(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),i=Math.sqrt(e**2+n**2);let s=180*Math.atan2(n,e)/Math.PI;return s<0&&(s*=-1,s=360-s),new W(t,i,s,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:i,a:s,b:r}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;s=t*Math.cos(n*e),r=t*Math.sin(n*e)}const o=(i+16)/116,h=s/500+o,a=o-r/200,u=16/116,l=.008856,c=7.787;t=.95047*(h**3>l?h**3:(h-u)/c),e=1*(o**3>l?o**3:(o-u)/c),n=1.08883*(a**3>l?a**3:(a-u)/c)}const i=3.2406*t+-1.5372*e+-.4986*n,s=-.9689*t+1.8758*e+.0415*n,r=.0557*t+-.204*e+1.057*n,o=Math.pow,h=.0031308,a=i>h?1.055*o(i,1/2.4)-.055:12.92*i,u=s>h?1.055*o(s,1/2.4)-.055:12.92*s,l=r>h?1.055*o(r,1/2.4)-.055:12.92*r;return new W(255*a,255*u,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e)return n*=255,new W(n,n,n);const i=n<.5?n*(1+e):n+e-n*e,s=2*n-i,r=255*V(s,i,t+1/3),o=255*V(s,i,t),h=255*V(s,i,t-1/3);return new W(r,o,h)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:i}=this,s=255*(1-Math.min(1,t*(1-i)+i)),r=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,n*(1-i)+i));return new W(s,r,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:i,space:s}=this;return[t,e,n,i,s]}toHex(){const[t,e,n]=this._clamped().map(G);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,s,r]=[t,e,n].map((t=>t/255)),o=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,a=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,u=(.4124*o+.3576*h+.1805*a)/.95047,l=(.2126*o+.7152*h+.0722*a)/1,c=(.0193*o+.1192*h+.9505*a)/1.08883,f=u>.008856?Math.pow(u,1/3):7.787*u+16/116,d=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new W(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:i,min:s,round:r}=Math;return[t,e,n].map((t=>i(0,s(r(t),255))))}}class Q{constructor(...t){this.init(...t)}clone(){return new Q(this)}init(t,e){const n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Z.isMatrixLike(t)||(t=new Z(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function J(t,e,n){return Math.abs(e-t)<(n||1e-6)}class Z{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,i=t.flip&&(e||"y"===t.flip)?-1:1,s=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,r=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,h=t.scale&&t.scale.length?t.scale[1]*i:isFinite(t.scale)?t.scale*i:isFinite(t.scaleY)?t.scaleY*i:i,a=t.shear||0,u=t.rotate||t.theta||0,l=new Q(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new Q(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new Q(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,w=g.y,x=new Q(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:h,skewX:s,skewY:r,shear:a,theta:u,rx:x.x,ry:x.y,tx:y,ty:w,ox:c,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const i=t.a*e.a+t.c*e.b,s=t.b*e.a+t.d*e.b,r=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,h=t.e+t.a*e.e+t.c*e.f,a=t.f+t.b*e.e+t.d*e.f;return n.a=i,n.b=s,n.c=r,n.d=o,n.e=h,n.f=a,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const i=t||0,s=e||0;return this.translateO(-i,-s).lmultiplyO(n).translateO(i,s)}clone(){return new Z(this)}decompose(t=0,e=0){const n=this.a,i=this.b,s=this.c,r=this.d,o=this.e,h=this.f,a=n*r-i*s,u=a>0?1:-1,l=u*Math.sqrt(n*n+i*i),c=Math.atan2(u*i,u*n),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(n*s+i*r)/a,g=s*l/(m*n-i)||r*l/(m*i+n);return{scaleX:l,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*l+e*(m*d*l-p*g),translateY:h-e+t*p*l+e*(m*p*l+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new Z(t);return J(this.a,e.a)&&J(this.b,e.b)&&J(this.c,e.c)&&J(this.d,e.d)&&J(this.e,e.e)&&J(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=Z.fromArray([1,0,0,1,0,0]);return t=t instanceof vt?t.matrixify():"string"==typeof t?Z.fromArray(t.split($).map(parseFloat)):Array.isArray(t)?Z.fromArray(t):"object"==typeof t&&Z.isMatrixLike(t)?t:"object"==typeof t?(new Z).transform(t):6===arguments.length?Z.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,i=this.d,s=this.e,r=this.f,o=t*i-e*n;if(!o)throw new Error("Cannot invert "+this);const h=i/o,a=-e/o,u=-n/o,l=t/o,c=-(h*s+u*r),f=-(a*s+l*r);return this.a=h,this.b=a,this.c=u,this.d=l,this.e=c,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof Z?t:new Z(t);return Z.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof Z?t:new Z(t);return Z.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=h(t);const i=Math.cos(t),s=Math.sin(t),{a:r,b:o,c:a,d:u,e:l,f:c}=this;return this.a=r*i-o*s,this.b=o*i+r*s,this.c=a*i-u*s,this.d=u*i+a*s,this.e=l*i-c*s+n*s-e*i+e,this.f=c*i+l*s-e*s-n*i+n,this}scale(t,e,n,i){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,i=0){3===arguments.length&&(i=n,n=e,e=t);const{a:s,b:r,c:o,d:h,e:a,f:u}=this;return this.a=s*t,this.b=r*e,this.c=o*t,this.d=h*e,this.e=a*t-n*t+n,this.f=u*e-i*e+i,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:i,b:s,c:r,d:o,e:h,f:a}=this;return this.a=i+s*t,this.c=r+o*t,this.e=h+a*t-n*t,this}skew(t,e,n,i){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,i=0){3===arguments.length&&(i=n,n=e,e=t),t=h(t),e=h(e);const s=Math.tan(t),r=Math.tan(e),{a:o,b:a,c:u,d:l,e:c,f}=this;return this.a=o+a*s,this.b=a+o*r,this.c=u+l*s,this.d=l+u*r,this.e=c+f*s-i*s,this.f=f+c*r-n*r,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(Z.isMatrixLike(t))return new Z(t).multiplyO(this);const e=Z.formatTransforms(t),{x:n,y:i}=new Q(e.ox,e.oy).transform(this),s=(new Z).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-i).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,i);if(isFinite(e.px)||isFinite(e.py)){const t=new Q(n,i).transform(s),r=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;s.translateO(r,o)}return s.translateO(e.tx,e.ty),s}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function K(){if(!K.nodes){const t=k().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;K.nodes={svg:t,path:e}}if(!K.nodes.svg.node.parentNode){const t=w.document.body||w.document.documentElement;K.nodes.svg.addTo(t)}return K.nodes}function tt(t){return!(t.width||t.height||t.x||t.y)}A(Z,"Matrix");class et{constructor(...t){this.init(...t)}addOffset(){return this.x+=w.window.pageXOffset,this.y+=w.window.pageYOffset,new et(this)}init(t){return t="string"==typeof t?t.split($).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return tt(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width)-e,s=Math.max(this.y+this.height,t.y+t.height)-n;return new et(e,n,i,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof Z||(t=new Z(t));let e=1/0,n=-1/0,i=1/0,s=-1/0;return[new Q(this.x,this.y),new Q(this.x2,this.y),new Q(this.x,this.y2),new Q(this.x2,this.y2)].forEach((function(r){r=r.transform(t),e=Math.min(e,r.x),n=Math.max(n,r.x),i=Math.min(i,r.y),s=Math.max(s,r.y)})),new et(e,i,n-e,s-i)}}function nt(t,e,n){let i;try{if(i=e(t.node),tt(i)&&(s=t.node)!==w.document&&!(w.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===w.document}).call(w.document.documentElement,s))throw new Error("Element not in the dom")}catch(e){i=n(t)}var s;return i}n({viewbox:{viewbox(t,e,n,i){return null==t?new et(this.attr("viewBox")):this.attr("viewBox",new et(t,e,n,i))},zoom(t,e){let{width:n,height:i}=this.attr(["width","height"]);if((n||i)&&"string"!=typeof n&&"string"!=typeof i||(n=this.node.clientWidth,i=this.node.clientHeight),!n||!i)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const s=this.viewbox(),r=n/s.width,o=i/s.height,h=Math.min(r,o);if(null==t)return h;let a=h/t;a===1/0&&(a=Number.MAX_SAFE_INTEGER/100),e=e||new Q(n/2/r+s.x,i/2/o+s.y);const u=new et(s).transform(new Z({scale:a,origin:e}));return this.viewbox(u)}}}),A(et,"Box");class it extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}N([it],{each(t,...e){return"function"==typeof t?this.map(((e,n,i)=>t.call(e,e,n,i))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const st=["toArray","constructor","each"];function rt(t,e){return new it(r((e||w.document).querySelectorAll(t),(function(t){return C(t)})))}it.extend=function(t){t=t.reduce(((t,e)=>(st.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),N([it],t)};let ot=0;const ht={};function at(t){let e=t.getEventHolder();return e===w.window&&(e=ht),e.events||(e.events={}),e.events}function ut(t){return t.getEventTarget()}function lt(t,e,n,i,s){const r=n.bind(i||t),o=k(t),h=at(o),a=ut(o);e=Array.isArray(e)?e:e.split($),n._svgjsListenerId||(n._svgjsListenerId=++ot),e.forEach((function(t){const e=t.split(".")[0],i=t.split(".")[1]||"*";h[e]=h[e]||{},h[e][i]=h[e][i]||{},h[e][i][n._svgjsListenerId]=r,a.addEventListener(e,r,s||!1)}))}function ct(t,e,n,i){const s=k(t),r=at(s),o=ut(s);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split($)).forEach((function(t){const e=t&&t.split(".")[0],h=t&&t.split(".")[1];let a,u;if(n)r[e]&&r[e][h||"*"]&&(o.removeEventListener(e,r[e][h||"*"][n],i||!1),delete r[e][h||"*"][n]);else if(e&&h){if(r[e]&&r[e][h]){for(u in r[e][h])ct(o,[e,h].join("."),u);delete r[e][h]}}else if(h)for(t in r)for(a in r[t])h===a&&ct(o,[t,h].join("."));else if(e){if(r[e]){for(a in r[e])ct(o,[e,a].join("."));delete r[e]}}else{for(t in r)ct(o,t);!function(t){let e=t.getEventHolder();e===w.window&&(e=ht),e.events&&(e.events={})}(s)}}))}class ft extends x{addEventListener(){}dispatch(t,e,n){return function(t,e,n,i){const s=ut(t);return e instanceof w.window.Event||(e=new w.window.CustomEvent(e,{detail:n,cancelable:!0,...i})),s.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const i in n[e])n[e][i](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return ct(this,t,e,n),this}on(t,e,n,i){return lt(this,t,e,n,i),this}removeEventListener(){}}function dt(){}A(ft,"EventTarget");const pt=400,mt=">",gt=0,yt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class wt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split($).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class xt{constructor(...t){this.init(...t)}convert(t){return new xt(this.value,t)}divide(t){return t=new xt(t),new xt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(z))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof xt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new xt(t),new xt(this-t,this.unit||t.unit)}plus(t){return t=new xt(t),new xt(this+t,this.unit||t.unit)}times(t){return t=new xt(t),new xt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const _t=[];class bt extends ft{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=k(t)).removeNamespace&&this.node instanceof w.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return k(t).put(this,e)}children(){return new it(r(this.node.children,(function(t){return C(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=E(n)),new this.constructor(n)}each(t,e){const n=this.children();let i,s;for(i=0,s=n.length;i=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=S(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return C(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=C(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=C(e.node.parentNode));return e}put(t,e){return t=k(t),this.add(t,e),t}putIn(t,e){return k(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=k(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,i=this.attr(e);for(const t in i)"number"==typeof i[t]&&(i[t]=Math.round(i[t]*n)/n);return this.attr(i),this}svg(t,e){return this.xml(t,e,p)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=C(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const i=v("wrapper",n),s=w.document.createDocumentFragment();i.innerHTML=t;for(let t=i.children.length;t--;)s.appendChild(i.firstElementChild);const r=this.parent();return e?this.replace(s)&&r:this.add(s)}}N(bt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=Y.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?yt[t]:Y.test(e)?parseFloat(e):e;"number"==typeof(e=_t.reduce(((e,n)=>n(t,e,this)),e))?e=new xt(e):W.isColor(e)?e=new W(e):e.constructor===Array&&(e=new wt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return rt(t,this.node)},findOne:function(t){return C(this.node.querySelector(t))}}),A(bt,"Dom");class vt extends bt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new xt(t).plus(this.x()))}dy(t=0){return this.y(new xt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=k(t));const n=new it;let i=this;for(;(i=i.parent())&&i.node!==w.document&&"#document-fragment"!==i.nodeName&&(n.push(i),e||i.node!==t.node)&&(!e||!i.matches(t));)if(i.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(I);return e?k(e[1]):null}root(){const t=this.parent(_[b]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=c(this,t,e);return this.width(new xt(n.width)).height(new xt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}N(vt,{bbox:function(){const t=nt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(K().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new et(t)},rbox:function(t){const e=nt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new et(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t=0;i--)null!=e[kt[t][i]]&&this.attr(kt.prefix(t,kt[t][i]),e[kt[t][i]]);return this},n(["Element","Runner"],e)})),n(["Element","Runner"],{matrix:function(t,e,n,i,s,r){return null==t?new Z(this):this.attr("transform",new Z(t,e,n,i,s,r))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:i},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:i},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),n("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new xt(t)):this.rx(t).ry(e)}}),n("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new Q(this.node.getPointAtLength(t))}}),n(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),n("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),n("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(R).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split($).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(Z.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new Z)},toParent:function(t,e){if(this===t)return this;const n=this.screenCTM(),i=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(i.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new Z(this).decompose();return null==t?e:e[t]}Z.isMatrixLike(t)||(t={...t,origin:f(t,this)});const n=new Z(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class Mt extends vt{flatten(t=this,e){return this.each((function(){if(this instanceof Mt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,i){return i[i.length-n-1].toParent(t,e)})),this.remove()}}A(Mt,"Container");class Ct extends Mt{constructor(t,e=t){super(M("defs",t),e)}flatten(){return this}ungroup(){return this}}A(Ct,"Defs");class Ot extends vt{}function At(t){return this.attr("rx",t)}function Tt(t){return this.attr("ry",t)}function St(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Et(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Nt(t){return this.attr("cx",t)}function jt(t){return this.attr("cy",t)}function zt(t){return null==t?2*this.rx():this.rx(new xt(t).divide(2))}function Lt(t){return null==t?2*this.ry():this.ry(new xt(t).divide(2))}A(Ot,"Shape");var Dt={__proto__:null,rx:At,ry:Tt,x:St,y:Et,cx:Nt,cy:jt,width:zt,height:Lt};class It extends Ot{constructor(t,e=t){super(M("ellipse",t),e)}size(t,e){const n=c(this,t,e);return this.rx(new xt(n.width).divide(2)).ry(new xt(n.height).divide(2))}}N(It,Dt),n("Container",{ellipse:j((function(t=0,e=t){return this.put(new It).size(t,e).move(0,0)}))}),A(It,"Ellipse");class Rt extends bt{constructor(t=w.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new bt(v("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Ft(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new xt(t),fy:new xt(e)}):this.attr({x1:new xt(t),y1:new xt(e)})}function qt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new xt(t),cy:new xt(e)}):this.attr({x2:new xt(t),y2:new xt(e)})}A(Rt,"Fragment");var Pt,Bt={__proto__:null,from:Ft,to:qt};class Yt extends Mt{constructor(t,e){super(M(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new et}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}N(Yt,Bt),n({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:j((function(t,e){return this.put(new Yt(t)).update(e)}))}}),A(Yt,"Gradient");class Xt extends Mt{constructor(t,e=t){super(M("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new et}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}n({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:j((function(t,e,n){return this.put(new Xt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),A(Xt,"Pattern");class $t extends Ot{constructor(t,e=t){super(M("image",t),e)}load(t,e){if(!t)return this;const n=new w.window.Image;return lt(n,"load",(function(t){const i=this.parent(Xt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),i instanceof Xt&&0===i.width()&&0===i.height()&&i.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),lt(n,"load error",(function(){ct(n)})),this.attr("href",n.src=t,g)}}Pt=function(t,e,n){return"fill"!==t&&"stroke"!==t||X.test(e)&&(e=n.root().defs().image(e)),e instanceof $t&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},_t.push(Pt),n({Container:{image:j((function(t,e){return this.put(new $t).size(0,0).load(t,e)}))}}),A($t,"Image");class Ht extends wt{bbox(){let t=-1/0,e=-1/0,n=1/0,i=1/0;return this.forEach((function(s){t=Math.max(s[0],t),e=Math.max(s[1],e),n=Math.min(s[0],n),i=Math.min(s[1],i)})),new et(n,i,t-n,e-i)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split($).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,i=t.length;n=0;n--)i.width&&(this[n][0]=(this[n][0]-i.x)*t/i.width+i.x),i.height&&(this[n][1]=(this[n][1]-i.y)*e/i.height+i.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,i){return function(s){return s<0?t>0?e/t*s:n>0?i/n*s:0:s>1?n<1?(1-i)/(1-n)*s+(i-n)/(1-n):t<1?(1-e)/(1-t)*s+(e-t)/(1-t):1:3*s*(1-s)**2*e+3*s**2*(1-s)*i+s**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(i,s=!1)=>{let r=Math.floor(i*t);const o=i*r%1==0;return"start"!==e&&"both"!==e||++r,s&&o&&--r,i>=0&&r<0&&(r=0),i<=1&&r>n&&(r=n),r/n}}};class Jt{done(){return!1}}class Zt extends Jt{constructor(t=mt){super(),this.ease=Qt[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class Kt extends Jt{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,i){return this.stepper(t,e,n,i)}}function te(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,i=Math.log(e/100+1e-10),s=-i/Math.sqrt(n*n+i*i),r=3.9/(s*t);this.d=2*s*r,this.k=r*r}N(class extends Kt{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const s=i.velocity||0,r=-this.d*s-this.k*(t-e),o=t+s*n+r*n*n/2;return i.velocity=s+r*n,i.done=Math.abs(e-o)+Math.abs(s)<.002,i.done?e:o}},{duration:Wt("_duration",te),overshoot:Wt("_overshoot",te)}),N(class extends Kt{constructor(t=.1,e=.01,n=0,i=1e3){super(),this.p(t).i(e).d(n).windup(i)}step(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;const s=e-t;let r=(i.integral||0)+s*n;const o=(s-(i.error||0))/n,h=this._windup;return!1!==h&&(r=Math.max(-h,Math.min(r,h))),i.error=s,i.integral=r,i.done=Math.abs(s)<.001,i.done?e:t+(this.P*s+this.I*r+this.D*o)}},{windup:Wt("_windup"),p:Wt("P"),i:Wt("I"),d:Wt("D")});const ee={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ne={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},ie="mlhvqtcsaz".split("");for(let t=0,e=ie.length;t=0;i--)n=this[i][0],"M"===n||"L"===n||"T"===n?(this[i][1]+=t,this[i][2]+=e):"H"===n?this[i][1]+=t:"V"===n?this[i][1]+=e:"C"===n||"S"===n||"Q"===n?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===n&&(this[i][5]+=t,this[i][6]+=e)):"A"===n&&(this[i][6]+=t,this[i][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,i="";const s={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new Q,p:new Q};for(;s.lastToken=i,i=t.charAt(n++);)if(s.inSegment||!re(s,i))if("."!==i)if(isNaN(parseInt(i)))if(" "!==i&&","!==i)if("-"!==i)if("E"!==i.toUpperCase()){if(H.test(i)){if(s.inNumber)oe(s,!1);else{if(!se(s))throw new Error("parser Error");he(s)}--n}}else s.number+=i,s.hasExponent=!0;else{if(s.inNumber&&!ue(s)){oe(s,!1),--n;continue}s.number+=i,s.inNumber=!0}else s.inNumber&&oe(s,!1);else{if("0"===s.number||ae(s)){s.inNumber=!0,s.number=i,oe(s,!0);continue}s.inNumber=!0,s.number+=i}else{if(s.pointSeen||s.hasExponent){oe(s,!1),--n;continue}s.inNumber=!0,s.pointSeen=!0,s.number+=i}return s.inNumber&&oe(s,!1),s.inSegment&&se(s)&&he(s),s.segments}(t)}size(t,e){const n=this.bbox();let i,s;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,i=this.length-1;i>=0;i--)s=this[i][0],"M"===s||"L"===s||"T"===s?(this[i][1]=(this[i][1]-n.x)*t/n.width+n.x,this[i][2]=(this[i][2]-n.y)*e/n.height+n.y):"H"===s?this[i][1]=(this[i][1]-n.x)*t/n.width+n.x:"V"===s?this[i][1]=(this[i][1]-n.y)*e/n.height+n.y:"C"===s||"S"===s||"Q"===s?(this[i][1]=(this[i][1]-n.x)*t/n.width+n.x,this[i][2]=(this[i][2]-n.y)*e/n.height+n.y,this[i][3]=(this[i][3]-n.x)*t/n.width+n.x,this[i][4]=(this[i][4]-n.y)*e/n.height+n.y,"C"===s&&(this[i][5]=(this[i][5]-n.x)*t/n.width+n.x,this[i][6]=(this[i][6]-n.y)*e/n.height+n.y)):"A"===s&&(this[i][1]=this[i][1]*t/n.width,this[i][2]=this[i][2]*e/n.height,this[i][6]=(this[i][6]-n.x)*t/n.width+n.x,this[i][7]=(this[i][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,i=t.length;n{const e=typeof t;return"number"===e?xt:"string"===e?W.isColor(t)?W:$.test(t)?H.test(t)?le:wt:z.test(t)?xt:de:ye.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?wt:"object"===e?ge:de};class fe{constructor(t){this._stepper=t||new Zt("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(ce(t));let e=new this._type(t);return this._type===W&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===ge&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class de{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class pe{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,pe.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}pe.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const me=(t,e)=>t[0]e[0]?1:0;class ge{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,i=e.length;nt.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),i=e.shift(),s=e.shift(),r=e.splice(0,s);t[n]=new i(r)}return t}}const ye=[de,pe,ge];class we extends Ot{constructor(t,e=t){super(M("path",t),e)}array(){return this._array||(this._array=new le(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new le(t))}size(t,e){const n=c(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}we.prototype.MorphArray=le,n({Container:{path:j((function(t){return this.put(new we).plot(t||new le)}))}}),A(we,"Path");var xe={__proto__:null,array:function(){return this._array||(this._array=new Ht(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Ht(t))},size:function(t,e){const n=c(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class _e extends Ot{constructor(t,e=t){super(M("polygon",t),e)}}n({Container:{polygon:j((function(t){return this.put(new _e).plot(t||new Ht)}))}}),N(_e,Gt),N(_e,xe),A(_e,"Polygon");class be extends Ot{constructor(t,e=t){super(M("polyline",t),e)}}n({Container:{polyline:j((function(t){return this.put(new be).plot(t||new Ht)}))}}),N(be,Gt),N(be,xe),A(be,"Polyline");class ve extends Ot{constructor(t,e=t){super(M("rect",t),e)}}N(ve,{rx:At,ry:Tt}),n({Container:{rect:j((function(t,e){return this.put(new ve).size(t,e)}))}}),A(ve,"Rect");class ke{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Me={nextDraw:null,frames:new ke,timeouts:new ke,immediates:new ke,timer:()=>w.window.performance||w.window.Date,transforms:[],frame(t){const e=Me.frames.push({run:t});return null===Me.nextDraw&&(Me.nextDraw=w.window.requestAnimationFrame(Me._draw)),e},timeout(t,e){e=e||0;const n=Me.timer().now()+e,i=Me.timeouts.push({run:t,time:n});return null===Me.nextDraw&&(Me.nextDraw=w.window.requestAnimationFrame(Me._draw)),i},immediate(t){const e=Me.immediates.push(t);return null===Me.nextDraw&&(Me.nextDraw=w.window.requestAnimationFrame(Me._draw)),e},cancelFrame(t){null!=t&&Me.frames.remove(t)},clearTimeout(t){null!=t&&Me.timeouts.remove(t)},cancelImmediate(t){null!=t&&Me.immediates.remove(t)},_draw(t){let e=null;const n=Me.timeouts.last();for(;(e=Me.timeouts.shift())&&(t>=e.time?e.run():Me.timeouts.push(e),e!==n););let i=null;const s=Me.frames.last();for(;i!==s&&(i=Me.frames.shift());)i.run(t);let r=null;for(;r=Me.immediates.shift();)r();Me.nextDraw=Me.timeouts.first()||Me.frames.first()?w.window.requestAnimationFrame(Me._draw):null}},Ce=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Oe=function(){const t=w.window;return(t.performance||t.Date).now()};class Ae extends ft{constructor(t=Oe){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(Ce);let i=0;const s=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)i=s;else if("absolute"===n||"start"===n)i=e,e=0;else if("now"===n)i=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(i=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();i=t?t.start:this._time}}t.unschedule(),t.timeline(this);const r=t.persist(),o={persist:null===r?this._persist:r,start:i+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Me.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Me.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const i=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=i,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let s=!1;for(let t=0,e=this._runners.length;t0?this._continue():(this.pause(),this.fire("finished")),this}}n({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Ae,this._timeline):(this._timeline=t,this)}}});class Te extends ft{constructor(t){super(),this.id=Te.id++,t="function"==typeof(t=null==t?pt:t)?new Kt(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof Kt,this._stepper=this._isDeclarative?t:new Zt,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Z,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let i=1,s=!1,r=0;return e=e||gt,n=n||"last","object"!=typeof(t=t||pt)||t instanceof Jt||(e=t.delay||e,n=t.when||n,s=t.swing||s,i=t.times||i,r=t.wait||r,t=t.duration||pt),{duration:t,delay:e,swing:s,times:i,wait:r,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const i=Te.sanitise(t,e,n),s=new Te(i.duration);return this._timeline&&s.timeline(this._timeline),this._element&&s.element(this._element),s.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new Z,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new Zt(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,i=e*Math.floor(t)+this._duration*n;return this.time(i)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,i=this._wait,s=this._times,r=this._swing,o=this._reverse;let h;if(null==t){const t=function(t){const e=r*Math.floor(t%(2*(i+n))/(i+n)),s=e&&!o||!e&&o,h=Math.pow(-1,s)*(t%(i+n))/n+s;return Math.max(Math.min(h,1),0)},a=s*(i+n)-i;return h=e<=0?Math.round(t(1e-5)):e=0;this._lastPosition=e;const i=this.duration(),s=this._lastTime<=0&&this._time>0,r=this._lastTime=i;this._lastTime=this._time,s&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!r&&this._time>=i,this._reseted=!1;let h=!1;return(n||o)&&(this._initialise(n),this.transforms=new Z,h=this._run(o?t:e),this.fire("step",this)),this.done=this.done||h&&o,r&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;et.lmultiplyO(e),Ne=t=>t.transforms;function je(){const t=this._transformationRunners.runners.map(Ne).reduce(Ee,new Z);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class ze{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Se).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;ee.id<=t.id)).map(Ne).reduce(Ee,new Z)},_addRunner(t){this._transformationRunners.add(t),Me.cancelImmediate(this._frameId),this._frameId=Me.immediate(je.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new ze).add(new Se(new Z(this))))}}}),N(Te,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let i=e;if(this._tryRetarget(t,i))return this;let s=new fe(this._stepper).to(i),r=Object.keys(i);return this.queue((function(){s=s.from(this.element()[t](r))}),(function(e){return this.element()[t](s.at(e).valueOf()),s.done()}),(function(e){const n=Object.keys(e),o=(h=r,n.filter((t=>!h.includes(t))));var h;if(o.length){const e=this.element()[t](o),n=new ge(s.from()).valueOf();Object.assign(n,e),s.from(n)}const a=new ge(s.to()).valueOf();Object.assign(a,e),s.to(a),r=n,i=e})),this._rememberMorpher(t,s),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new fe(this._stepper).to(new xt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,i){e=i,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const i=Z.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!i;const s=new fe(this._stepper).type(n?pe:Z);let r,o,h,a,u;return this.queue((function(){o=o||this.element(),r=r||f(t,o),u=new Z(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:f}=new Q(r).transform(o._currentTransform(this));let d=new Z({...t,origin:[c,f]}),p=this._isDeclarative&&h?h:u;if(n){d=d.decompose(c,f),p=p.decompose(c,f);const t=d.rotate,e=p.rotate,n=[t-360,t,t+360],i=n.map((t=>Math.abs(t-e))),s=Math.min(...i),r=i.indexOf(s);d.rotate=n[r]}e&&(i||(d.rotate=t.rotate||0),this._isDeclarative&&a&&(p.rotate=a)),s.from(p),s.to(d);const m=s.at(l);return a=m.rotate,h=new Z(m),this.addTransform(h),o._addRunner(this),s.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(r=f(e,o)),t={...e,origin:r}}),!0),this._isDeclarative&&this._rememberMorpher("transform",s),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new xt(e),this._tryRetarget(t,e))return this;const n=new fe(this._stepper).to(e);let i=null;return this.queue((function(){i=this.element()[t](),n.from(i),n.to(i+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(i+new xt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new fe(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new xt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,i){if(4===arguments.length)return this.plot([t,e,n,i]);if(this._tryRetarget("plot",t))return this;const s=new fe(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){s.from(this._element.array())}),(function(t){return this._element.plot(s.at(t)),s.done()})),this._rememberMorpher("plot",s),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,i){return this._queueObject("viewbox",new et(t,e,n,i))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),N(Te,{rx:At,ry:Tt,from:Ft,to:qt}),A(Te,"Runner");class Le extends Mt{constructor(t,e=t){super(M("svg",t),e),this.namespace()}defs(){return this.isRoot()?C(this.node.querySelector("defs"))||this.put(new Ct):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof w.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:p,version:"1.1"}).attr("xmlns:xlink",g,m).attr("xmlns:svgjs","http://svgjs.dev/svgjs",m):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,m).attr("xmlns:svgjs",null,m)}root(){return this.isRoot()?this:super.root()}}n({Container:{nested:j((function(){return this.put(new Le)}))}}),A(Le,"Svg",!0);class De extends Mt{constructor(t,e=t){super(M("symbol",t),e)}}n({Container:{symbol:j((function(){return this.put(new De)}))}}),A(De,"Symbol");var Ie={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(w.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class Re extends Ot{constructor(t,e=t){super(M("text",t),e),this.dom.leading=new xt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new xt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(i){const s=w.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=n*new xt(s);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=r:(this.attr("dy",i?r+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new xt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let i=0,s=e.length;i{let s;try{s=n.bbox()}catch(t){return}const r=new Z(n),o=r.translate(t,e).transform(r.inverse()),h=new Q(s.x,s.y).transform(o);n.move(h.x,h.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const i=t-n.x,s=e-n.y;return this.dmove(i,s)},size:function(t,e,n=this.bbox()){const i=c(this,t,e,n),s=i.width/n.width,r=i.height/n.height;return this.children().forEach(((t,e)=>{const i=new Q(n).transform(new Z(t).inverse());t.scale(s,r,i.x,i.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class Xe extends Mt{constructor(t,e=t){super(M("g",t),e)}}N(Xe,Ye),n({Container:{group:j((function(){return this.put(new Xe)}))}}),A(Xe,"G");class $e extends Mt{constructor(t,e=t){super(M("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,g)}}N($e,Ye),n({Container:{link:j((function(t){return this.put(new $e).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new $e,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),A($e,"A");class He extends Mt{constructor(t,e=t){super(M("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return rt("svg [mask*="+this.id()+"]")}}n({Container:{mask:j((function(){return this.defs().put(new He)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof He?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),A(He,"Mask");class Ge extends vt{constructor(t,e=t){super(M("stop",t),e)}update(t){return("number"==typeof t||t instanceof xt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new xt(t.offset)),this}}n({Gradient:{stop:function(t,e,n){return this.put(new Ge).update(t,e,n)}}}),A(Ge,"Stop");class Ue extends vt{constructor(t,e=t){super(M("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=u(t)+":"+e[t]+";";return n+="}",n}(t,e))}}n("Dom",{style(t,e){return this.put(new Ue).rule(t,e)},fontface(t,e,n){return this.put(new Ue).font(t,e,n)}}),A(Ue,"Style");class Ve extends Re{constructor(t,e=t){super(M("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}n({Container:{textPath:j((function(t,e){return t instanceof Re||(t=this.text(t)),t.path(e)}))},Text:{path:j((function(t,e=!0){const n=new Ve;let i;if(t instanceof we||(t=this.defs().path(t)),n.attr("href","#"+t,g),e)for(;i=this.node.firstChild;)n.node.appendChild(i);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:j((function(t){return t instanceof Re||(t=(new Re).addTo(this.parent()).text(t)),t.path(this)})),targets(){return rt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Ve.prototype.MorphArray=le,A(Ve,"TextPath");class We extends Ot{constructor(t,e=t){super(M("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,g)}}n({Container:{use:j((function(t,e){return this.put(new We).use(t,e)}))}}),A(We,"Use");const Qe=k;N([Le,De,$t,Xt,Vt],i("viewbox")),N([Ut,be,_e,we],i("marker")),N(Re,i("Text")),N(we,i("Path")),N(Ct,i("Defs")),N([Re,Fe],i("Tspan")),N([ve,It,Yt,Te],i("radius")),N(ft,i("EventTarget")),N(bt,i("Dom")),N(vt,i("Element")),N(Ot,i("Shape")),N([Mt,Rt],i("Container")),N(Yt,i("Gradient")),N(Te,i("Runner")),it.extend([...new Set(e)]),function(t=[]){ye.push(...[].concat(t))}([xt,W,et,Z,wt,Ht,le,Q]),N(ye,{to(t){return(new fe).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,i,s){return this.fromArray(t.map((function(t,r){return i.step(t,e[r],n,s[r],s)})))}});class Je extends vt{constructor(t){super(M("filter",t),t),this.$source="SourceGraphic",this.$sourceAlpha="SourceAlpha",this.$background="BackgroundImage",this.$backgroundAlpha="BackgroundAlpha",this.$fill="FillPaint",this.$stroke="StrokePaint",this.$autoSetIn=!0}put(t,e){return!(t=super.put(t,e)).attr("in")&&this.$autoSetIn&&t.attr("in",this.$source),t.attr("result")||t.attr("result",t.id()),t}remove(){return this.targets().each("unfilter"),super.remove()}targets(){return rt('svg [filter*="'+this.id()+'"]')}toString(){return"url(#"+this.id()+")"}}class Ze extends vt{constructor(t,e){super(t,e),this.result(this.id())}in(t){if(null==t){const t=this.attr("in");return this.parent()&&this.parent().find(`[result="${t}"]`)[0]||t}return this.attr("in",t)}result(t){return this.attr("result",t)}toString(){return this.result()}}const Ke=t=>function(...e){for(let n=t.length;n--;)null!=e[n]&&this.attr(t[n],e[n])},tn={blend:Ke(["in","in2","mode"]),colorMatrix:Ke(["type","values"]),composite:Ke(["in","in2","operator"]),convolveMatrix:function(t){t=new wt(t).toString(),this.attr({order:Math.sqrt(t.split(" ").length),kernelMatrix:t})},diffuseLighting:Ke(["surfaceScale","lightingColor","diffuseConstant","kernelUnitLength"]),displacementMap:Ke(["in","in2","scale","xChannelSelector","yChannelSelector"]),dropShadow:Ke(["in","dx","dy","stdDeviation"]),flood:Ke(["flood-color","flood-opacity"]),gaussianBlur:function(t=0,e=t){this.attr("stdDeviation",t+" "+e)},image:function(t){this.attr("href",t,y)},morphology:Ke(["operator","radius"]),offset:Ke(["dx","dy"]),specularLighting:Ke(["surfaceScale","lightingColor","diffuseConstant","specularExponent","kernelUnitLength"]),tile:Ke([]),turbulence:Ke(["baseFrequency","numOctaves","seed","stitchTiles","type"])};["blend","colorMatrix","componentTransfer","composite","convolveMatrix","diffuseLighting","displacementMap","dropShadow","flood","gaussianBlur","image","merge","morphology","offset","specularLighting","tile","turbulence"].forEach((t=>{const e=d.capitalize(t),n=tn[t];Je[e+"Effect"]=class extends Ze{constructor(t){super(M("fe"+e,t),t)}update(t){return n.apply(this,t),this}},Je.prototype[t]=j((function(t,...n){const i=new Je[e+"Effect"];return null==t?this.put(i):("function"==typeof t?t.call(i,i):n.unshift(t),this.put(i).update(n))}))})),N(Je,{merge(t){const e=this.put(new Je.MergeEffect);return"function"==typeof t?(t.call(e,e),e):((t instanceof Array?t:[...arguments]).forEach((t=>{t instanceof Je.MergeNode?e.put(t):e.mergeNode(t)})),e)},componentTransfer(t={}){const e=this.put(new Je.ComponentTransferEffect);if("function"==typeof t)return t.call(e,e),e;t.r||t.g||t.b||t.a||(t={r:t,g:t,b:t,a:t});for(const n in t)e.add(new(Je["Func"+n.toUpperCase()])(t[n]));return e}}),["distantLight","pointLight","spotLight","mergeNode","FuncR","FuncG","FuncB","FuncA"].forEach((t=>{const e=d.capitalize(t);Je[e]=class extends Ze{constructor(t){super(M("fe"+e,t),t)}}})),["funcR","funcG","funcB","funcA"].forEach((function(t){const e=Je[d.capitalize(t)],n=j((function(){return this.put(new e)}));Je.ComponentTransferEffect.prototype[t]=n})),["distantLight","pointLight","spotLight"].forEach((t=>{const e=Je[d.capitalize(t)],n=j((function(){return this.put(new e)}));Je.DiffuseLightingEffect.prototype[t]=n,Je.SpecularLightingEffect.prototype[t]=n})),N(Je.MergeEffect,{mergeNode(t){return this.put(new Je.MergeNode).attr("in",t)}}),N(Ct,{filter:function(t){const e=this.put(new Je);return"function"==typeof t&&t.call(e,e),e}}),N(Mt,{filter:function(t){return this.defs().filter(t)}}),N(vt,{filterWith:function(t){const e=t instanceof Je?t:this.defs().filter(t);return this.attr("filter",e)},unfilter:function(t){return this.attr("filter",null)},filterer(){return this.reference("filter")}});function en(t,e){const n=t.split(" "),i=[n[0]];for(const t of n.slice(1,-1))"."===t.slice(-1)?i.push(t):(!0===e&&(i.push("\n"),e=!1),"("!=t.at(0)&&i.push(t[0]+"."));return i.push(n.at(-1)),i.join(" ")}function nn(t){return t[0].map(((e,n)=>t.map((t=>t[n]))))}function sn(t,e){const n=(e-90)*Math.PI/180;return{x:200+t*Math.cos(n),y:200+t*Math.sin(n)}}function rn(t,e,n){const i=e>70&&n<290;i?t+=2:t-=3;const s=sn(t,e),r=sn(t,n);return i?["M",r.x,r.y,"A",t,t,0,0,0,s.x,s.y].join(" "):["M",s.x,s.y,"A",t,t,0,0,1,r.x,r.y].join(" ")}function on(t,e,n){const i=sn(t,e),s=sn(t,n),r=n=n-4)&&(i=2,s=1),1===t.y&&(s=0),t.y===n-4&&(i=e-1)),t.x12&&(a=3);let l=Math.floor((h+(a-1))/a);h>21&&(a=4,o.x=1,l=Math.floor((h+10+(a-1))/a),u=4.3/l*n,!0===ln&&(r.find(".iwr-vis-group-item-groupname").hide(),r.find(".iwr-vis-group-item-profname-small").hide(),r.find(".iwr-vis-group-item-profname-large").show()));const c=200*u,f=60*u,d=i-c*a/2,p=s-f*l/2;for(let n=0;n0&&(t[n].css({filter:"grayscale(0)"}),t[n].css({opacity:e[n]}))}const xn=function(){wn(Qe("#iwr-vis-menu-svg").find(".iwr-vis-method-item"),this.data("method_weights")),wn(Qe("#iwr-vis-menu-svg").find(".iwr-vis-application-item"),this.data("application_weights"))},_n=function(t){t.blend(t.$source,t.gaussianBlur(1).in(t.$sourceAlpha))};function bn(t,e,n,i,s,r,o,h){const a=360/(n.length+1);for(let e=0;e'+e.description+"",!0))}const Mn=function(t){const e=Qe("#iwr-vis-menu-svg").find(".iwr-vis-segment-item");if(e.hasClass("hovered").filter(Boolean).length!=e.length)return;const n=this.point(t.clientX,t.clientY);t.deltaY<0?dn(null,!0,2,200+-1*(n.x-200),200+-1*(n.y-200)):dn(null,!0,1,200,200)},Cn=function(){const t=Qe("#iwr-vis-menu-svg").find(".iwr-vis-settings-menu-sort-by-group"),e=Qe("#iwr-vis-menu-svg").find(".iwr-vis-settings-menu-sort-by-prof");null!=this.findOne(".iwr-vis-settings-menu-sort-by-prof")?(e.fill("#777777"),t.fill("#ffffff"),cn=!1):(t.fill("#777777"),e.fill("#ffffff"),cn=!0),pn()};window.onload=function(){fetch("fileadmin/templates/iwr_vis/data.json",{cache:"no-store"}).then((t=>t.json())).then((t=>function(t){un=function(t,e){const n=t.length,i=new Array(n);for(let t=0;tt[i][e]?1:0})),i}(t.members,"group"),ln=t.show_groups;const e=Qe("#iwr-vis-menu-svg"),n=e.group().addClass("iwr-vis-bg");n.click(pn),n.rect(400,400).cx(200).cy(200).fill("#ffffff").stroke("#ffffff");const i=e.circle(316).cx(200).cy(200).fill("none").stroke("none");e.on("wheel",Mn);const s=[],r=[];for(const e of t.members)s.push(e.method_weights),r.push(e.application_weights);const o=e.group();o.clipWith(i),function(t,e,n,i,s,r){for(let o=0;o + + + + + IWR Interactive Visualization prototype + + + + +
+
+ +
+
+ + diff --git a/style.css b/style.css new file mode 100644 index 00000000..8678d642 --- /dev/null +++ b/style.css @@ -0,0 +1,57 @@ +body { + margin: 0; +} + +.iwr-vis { + position: relative; + margin: 0 auto; + width: 100vmin; + height: 100vmin; + background: #ffffff; + font-family: Arial, Helvetica, sans-serif; +} + +a.iwr-vis:link { + text-decoration: none; +} + +a.iwr-vis:visited { + text-decoration: none; +} + +a.iwr-vis:hover { + text-decoration: none; +} + +a.iwr-vis:active { + text-decoration: none; +} + +.iwr-vis-group-card-html { + font-size: 6px; + line-height: 6px; +} + +.iwr-vis-menu { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.iwr-vis-segment-item { + cursor: pointer; +} + +.iwr-vis-group-item { + cursor: pointer; +} + +.iwr-vis-clickable { + cursor: pointer; +} + +.iwr-vis-group-item:hover .iwr-vis-group-item-box { + fill: #cccccc; +}