@rnacanvas/draw 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Drawing.d.ts +20 -11
- package/dist/Drawing.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/Drawing.d.ts
CHANGED
|
@@ -1,31 +1,40 @@
|
|
|
1
|
-
import * as SVG from '@svgdotjs/svg.js';
|
|
2
1
|
/**
|
|
3
2
|
* A two-dimensional nucleic acid structure drawing.
|
|
4
3
|
*/
|
|
5
4
|
export declare class Drawing {
|
|
6
5
|
/**
|
|
7
|
-
* The SVG document
|
|
6
|
+
* The actual DOM node of the SVG document that is the drawing.
|
|
8
7
|
*
|
|
9
8
|
* Nucleic acid structures are to be drawn on this.
|
|
10
9
|
*/
|
|
11
|
-
readonly
|
|
10
|
+
readonly domNode: SVGSVGElement;
|
|
12
11
|
/**
|
|
13
|
-
*
|
|
12
|
+
* Appends the SVG document that is the drawing to the container node.
|
|
14
13
|
*/
|
|
15
|
-
|
|
14
|
+
appendTo(container: Node): void;
|
|
16
15
|
/**
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Removes the drawing from its parent container node.
|
|
16
|
+
* Removes the SVG document that is the drawing from its parent container node.
|
|
17
|
+
*
|
|
18
|
+
* Has no effect if the SVG document that is the drawing had no parent container node to begin with.
|
|
22
19
|
*/
|
|
23
20
|
remove(): void;
|
|
24
21
|
/**
|
|
25
22
|
* Sets the horizontal and vertical scaling of the drawing
|
|
26
|
-
* (as determined by the view box and width and height attributes of
|
|
23
|
+
* (as determined by the view box and width and height attributes of the SVG document that is the drawing)
|
|
27
24
|
* to the specified scaling factor.
|
|
28
25
|
*/
|
|
29
26
|
setScaling(scaling: number): void;
|
|
27
|
+
/**
|
|
28
|
+
* The horizontal scaling factor of the drawing
|
|
29
|
+
* going from the coordinate system of the SVG document that is the drawing (as determined by its view box)
|
|
30
|
+
* to the client coordinate system (i.e., the coordinate system used by methods such as `getBoundingClientRect`).
|
|
31
|
+
*/
|
|
32
|
+
get horizontalClientScaling(): number;
|
|
33
|
+
/**
|
|
34
|
+
* The vertical scaling factor of the drawing
|
|
35
|
+
* going from the coordinate system of the SVG document that is the drawing (as determined by its view box)
|
|
36
|
+
* to the client coordinate system (i.e., the coordinate system used by methods such as `getBoundingClientRect`).
|
|
37
|
+
*/
|
|
38
|
+
get verticalClientScaling(): number;
|
|
30
39
|
}
|
|
31
40
|
//# sourceMappingURL=Drawing.d.ts.map
|
package/dist/Drawing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawing.d.ts","sourceRoot":"","sources":["../src/Drawing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Drawing.d.ts","sourceRoot":"","sources":["../src/Drawing.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,qBAAa,OAAO;IAClB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,gBAAwB;IAExC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,IAAI,GAAG,IAAI;IAI/B;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAId;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM;IAI1B;;;;OAIG;IACH,IAAI,uBAAuB,IAAI,MAAM,CAEpC;IAED;;;;OAIG;IACH,IAAI,qBAAqB,IAAI,MAAM,CAElC;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.draw=e():t.draw=e()}(this,(()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>l,Scaling:()=>a,VerticalClientScaling:()=>c,assignUUID:()=>u});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let i;const r=new Uint8Array(16);function s(){if(!i&&(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!i))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(r)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const h=function(t,e,i){if(n.randomUUID&&!e&&!t)return n.randomUUID();const r=(t=t||{}).random||(t.rng||s)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){i=i||0;for(let t=0;t<16;++t)e[i+t]=r[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(r)};function u(t){t.attr("id","uuid-"+h())}var a=function(){function t(t){this.targetSVGDoc=t}return t.prototype.set=function(t){var e=this.targetSVGDoc.viewbox();this.targetSVGDoc.attr({width:t*e.width+"px",height:t*e.height+"px"})},t}(),l=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.node.getBoundingClientRect(),e=this.targetSVGDoc.viewbox();return t.width/e.width},t}(),c=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.node.getBoundingClientRect(),e=this.targetSVGDoc.viewbox();return t.height/e.height},t}();return e})(),t.exports=e()}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{Drawing:()=>Qe});const t={},e=[];function r(e,n){if(Array.isArray(e))for(const t of e)r(t,n);else if("object"!=typeof e)o(Object.getOwnPropertyNames(n)),t[e]=Object.assign(t[e]||{},n);else for(const t in e)r(t,e[t])}function s(e){return t[e]||{}}function o(t){e.push(...t)}function h(t,e){let n;const i=t.length,r=[];for(n=0;n<i;n++)r.push(e(t[n]));return r}function u(t){return t%360*Math.PI/180}function a(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,n,i){return null!=e&&null!=n||(i=i||t.bbox(),null==e?e=i.width/i.height*n:null==n&&(n=i.height/i.width*e)),{width:e,height:n}}function f(t,e){const n=t.origin;let i=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",r=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([i,r]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof i,o="string"==typeof r;if(s||o){const{height:t,width:n,x:h,y:u}=e.bbox();s&&(i=i.includes("left")?h:i.includes("right")?h+n:h+n/2),o&&(r=r.includes("top")?u:r.includes("bottom")?u+t:u+t/2)}return[i,r]}const d="http://www.w3.org/2000/svg",p="http://www.w3.org/2000/xmlns/",m="http://www.w3.org/1999/xlink",y={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class g{}const w={},_="___SYMBOL___ROOT___";function x(t,e=d){return y.document.createElementNS(e,t)}function b(t,e=!1){if(t instanceof g)return t;if("object"==typeof t)return O(t);if(null==t)return new w[_];if("string"==typeof t&&"<"!==t.charAt(0))return O(y.document.querySelector(t));const n=e?y.document.createElement("div"):x("svg");return n.innerHTML=t,t=O(n.firstChild),n.removeChild(n.firstChild),t}function v(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:x(t)}function M(t){if(!t)return null;if(t.instance instanceof g)return t.instance;if("#document-fragment"===t.nodeName)return new w.Fragment(t);let e=l(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":w[e]||(e="Dom"),new w[e](t)}let O=M;function A(t,e=t.name,n=!1){return w[e]=t,n&&(w[_]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let S=1e3;function k(t){return"Svgjs"+l(t)+S++}function T(t){for(let e=t.children.length-1;e>=0;e--)T(t.children[e]);return t.id?(t.id=k(t.nodeName),t):t}function C(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 N(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)}}r("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=b(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=b(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=b(t)).before(this),this},insertAfter:function(t){return(t=b(t)).after(this),this}});const j=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,D=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,E=/rgb\((\d+),(\d+),(\d+)\)/,I=/(#[a-z_][a-z0-9\-_]*)/i,R=/\)\s*,?\s*/,z=/\s/g,L=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,P=/^rgb\(/,q=/^(\s+)?$/,F=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,X=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Y=/[\s,]+/,V=/[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 B(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}r("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Y)},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)}}),r("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]||q.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[a(t)]=null==e||q.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),r("Dom",{data:function(t,e,n){if(null==t)return this.data(h(function(t,e){let n;const i=t.length,r=[];for(n=0;n<i;n++)e(t[n])&&r.push(t[n]);return r}(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}}),r("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 H{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof H||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:r,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*i()+57,e=38*i()+45,n=360*i();return new H(t,e,n,"lch")}if("sine"===t){const t=r(80*s(2*o*(e=null==e?i():e)/.5+.01)+150),n=r(50*s(2*o*e/.5+4.6)+200),h=r(100*s(2*o*e/.5+2.3)+150);return new H(t,n,h)}if("pastel"===t){const t=8*i()+86,e=17*i()+9,n=360*i();return new H(t,e,n,"lch")}if("dark"===t){const t=10+10*i(),e=50*i()+86,n=360*i();return new H(t,e,n,"lch")}if("rgb"===t){const t=255*i(),e=255*i(),n=255*i();return new H(t,e,n)}if("lab"===t){const t=100*i(),e=256*i()-128,n=256*i()-128;return new H(t,e,n,"lab")}if("grey"===t){const t=255*i();return new H(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(L.test(t)||P.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-i,1-r,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-i-o)/(1-o),(1-r-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,s]=[t,e,n].map((t=>t/255)),o=Math.max(i,r,s),h=Math.min(i,r,s),u=(o+h)/2,a=o===h,l=o-h;return new H(360*(a?0:o===i?((r-s)/l+(r<s?6:0))/6:o===r?((s-i)/l+2)/6:o===s?((i-r)/l+4)/6:0),100*(a?0:u>.5?l/(2-o-h):l/(o+h)),100*u,"hsl")}init(t=0,e=0,n=0,i=0,r="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)r="string"==typeof i?i:r,i="string"==typeof i?0:i,Object.assign(this,{_a:t,_b:e,_c:n,_d:i,space:r});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(z,""),[n,i,r]=E.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:i,_c:r,_d:0,space:"rgb"})}else{if(!L.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,i,r]=D.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:r,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:h,_d:u}=this,a="rgb"===this.space?{r:s,g:o,b:h}:"xyz"===this.space?{x:s,y:o,z:h}:"hsl"===this.space?{h:s,s:o,l:h}:"lab"===this.space?{l:s,a:o,b:h}:"lch"===this.space?{l:s,c:o,h}:"cmyk"===this.space?{c:s,m:o,y:h,k:u}:{};Object.assign(this,a)}lab(){const{x:t,y:e,z:n}=this.xyz();return new H(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 r=180*Math.atan2(n,e)/Math.PI;return r<0&&(r*=-1,r=360-r),new H(t,i,r,"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:r,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;r=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(i+16)/116,h=r/500+o,u=o-s/200,a=16/116,l=.008856,c=7.787;t=.95047*(h**3>l?h**3:(h-a)/c),e=1*(o**3>l?o**3:(o-a)/c),n=1.08883*(u**3>l?u**3:(u-a)/c)}const i=3.2406*t+-1.5372*e+-.4986*n,r=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,h=.0031308,u=i>h?1.055*o(i,1/2.4)-.055:12.92*i,a=r>h?1.055*o(r,1/2.4)-.055:12.92*r,l=s>h?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*u,255*a,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 H(n,n,n);const i=n<.5?n*(1+e):n+e-n*e,r=2*n-i,s=255*B(r,i,t+1/3),o=255*B(r,i,t),h=255*B(r,i,t-1/3);return new H(s,o,h)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:i}=this,r=255*(1-Math.min(1,t*(1-i)+i)),s=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,n*(1-i)+i));return new H(r,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:i,space:r}=this;return[t,e,n,i,r]}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,r,s]=[t,e,n].map((t=>t/255)),o=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,a=(.4124*o+.3576*h+.1805*u)/.95047,l=(.2126*o+.7152*h+.0722*u)/1,c=(.0193*o+.1192*h+.9505*u)/1.08883,f=a>.008856?Math.pow(a,1/3):7.787*a+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 H(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:i,min:r,round:s}=Math;return[t,e,n].map((t=>i(0,r(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(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){W.isMatrixLike(t)||(t=new W(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 Q(t,e,n){return Math.abs(e-t)<(n||1e-6)}class W{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,r=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=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,u=t.shear||0,a=t.rotate||t.theta||0,l=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new $(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,y=new $(t.translate||t.tx||t.translateX,t.ty||t.translateY),g=y.x,w=y.y,_=new $(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:h,skewX:r,skewY:s,shear:u,theta:a,rx:_.x,ry:_.y,tx:g,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,r=t.b*e.a+t.d*e.b,s=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,u=t.f+t.b*e.e+t.d*e.f;return n.a=i,n.b=r,n.c=s,n.d=o,n.e=h,n.f=u,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const i=t||0,r=e||0;return this.translateO(-i,-r).lmultiplyO(n).translateO(i,r)}clone(){return new W(this)}decompose(t=0,e=0){const n=this.a,i=this.b,r=this.c,s=this.d,o=this.e,h=this.f,u=n*s-i*r,a=u>0?1:-1,l=a*Math.sqrt(n*n+i*i),c=Math.atan2(a*i,a*n),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(n*r+i*s)/u,y=r*l/(m*n-i)||s*l/(m*i+n);return{scaleX:l,scaleY:y,shear:m,rotate:f,translateX:o-t+t*d*l+e*(m*d*l-p*y),translateY:h-e+t*p*l+e*(m*p*l+d*y),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 W(t);return Q(this.a,e.a)&&Q(this.b,e.b)&&Q(this.c,e.c)&&Q(this.d,e.d)&&Q(this.e,e.e)&&Q(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=W.fromArray([1,0,0,1,0,0]);return t=t instanceof xt?t.matrixify():"string"==typeof t?W.fromArray(t.split(Y).map(parseFloat)):Array.isArray(t)?W.fromArray(t):"object"==typeof t&&W.isMatrixLike(t)?t:"object"==typeof t?(new W).transform(t):6===arguments.length?W.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,r=this.e,s=this.f,o=t*i-e*n;if(!o)throw new Error("Cannot invert "+this);const h=i/o,u=-e/o,a=-n/o,l=t/o,c=-(h*r+a*s),f=-(u*r+l*s);return this.a=h,this.b=u,this.c=a,this.d=l,this.e=c,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof W?t:new W(t);return W.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof W?t:new W(t);return W.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=u(t);const i=Math.cos(t),r=Math.sin(t),{a:s,b:o,c:h,d:a,e:l,f:c}=this;return this.a=s*i-o*r,this.b=o*i+s*r,this.c=h*i-a*r,this.d=a*i+h*r,this.e=l*i-c*r+n*r-e*i+e,this.f=c*i+l*r-e*r-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:r,b:s,c:o,d:h,e:u,f:a}=this;return this.a=r*t,this.b=s*e,this.c=o*t,this.d=h*e,this.e=u*t-n*t+n,this.f=a*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:r,c:s,d:o,e:h,f:u}=this;return this.a=i+r*t,this.c=s+o*t,this.e=h+u*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=u(t),e=u(e);const r=Math.tan(t),s=Math.tan(e),{a:o,b:h,c:a,d:l,e:c,f}=this;return this.a=o+h*r,this.b=h+o*s,this.c=a+l*r,this.d=l+a*s,this.e=c+f*r-i*r,this.f=f+c*s-n*s,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(W.isMatrixLike(t))return new W(t).multiplyO(this);const e=W.formatTransforms(t),{x:n,y:i}=new $(e.ox,e.oy).transform(this),r=(new W).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 $(n,i).transform(r),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;r.translateO(s,o)}return r.translateO(e.tx,e.ty),r}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 J(){if(!J.nodes){const t=b().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;J.nodes={svg:t,path:e}}if(!J.nodes.svg.node.parentNode){const t=y.document.body||y.document.documentElement;J.nodes.svg.addTo(t)}return J.nodes}function Z(t){return!(t.width||t.height||t.x||t.y)}A(W,"Matrix");class K{constructor(...t){this.init(...t)}addOffset(){return this.x+=y.window.pageXOffset,this.y+=y.window.pageYOffset,new K(this)}init(t){return t="string"==typeof t?t.split(Y).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 Z(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,r=Math.max(this.y+this.height,t.y+t.height)-n;return new K(e,n,i,r)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof W||(t=new W(t));let e=1/0,n=-1/0,i=1/0,r=-1/0;return[new $(this.x,this.y),new $(this.x2,this.y),new $(this.x,this.y2),new $(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),i=Math.min(i,s.y),r=Math.max(r,s.y)})),new K(e,i,n-e,r-i)}}function tt(t,e,n){let i;try{if(i=e(t.node),Z(i)&&(r=t.node)!==y.document&&!(y.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===y.document}).call(y.document.documentElement,r))throw new Error("Element not in the dom")}catch(e){i=n(t)}var r;return i}r({viewbox:{viewbox(t,e,n,i){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(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 r=this.viewbox(),s=n/r.width,o=i/r.height,h=Math.min(s,o);if(null==t)return h;let u=h/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new $(n/2/s+r.x,i/2/o+r.y);const a=new K(r).transform(new W({scale:u,origin:e}));return this.viewbox(a)}}}),A(K,"Box");class et extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}C([et],{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 nt=["toArray","constructor","each"];function it(t,e){return new et(h((e||y.document).querySelectorAll(t),(function(t){return M(t)})))}et.extend=function(t){t=t.reduce(((t,e)=>(nt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),C([et],t)};let rt=0;const st={};function ot(t){let e=t.getEventHolder();return e===y.window&&(e=st),e.events||(e.events={}),e.events}function ht(t){return t.getEventTarget()}function ut(t,e,n,i,r){const s=n.bind(i||t),o=b(t),h=ot(o),u=ht(o);e=Array.isArray(e)?e:e.split(Y),n._svgjsListenerId||(n._svgjsListenerId=++rt),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]=s,u.addEventListener(e,s,r||!1)}))}function at(t,e,n,i){const r=b(t),s=ot(r),o=ht(r);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Y)).forEach((function(t){const e=t&&t.split(".")[0],h=t&&t.split(".")[1];let u,a;if(n)s[e]&&s[e][h||"*"]&&(o.removeEventListener(e,s[e][h||"*"][n],i||!1),delete s[e][h||"*"][n]);else if(e&&h){if(s[e]&&s[e][h]){for(a in s[e][h])at(o,[e,h].join("."),a);delete s[e][h]}}else if(h)for(t in s)for(u in s[t])h===u&&at(o,[t,h].join("."));else if(e){if(s[e]){for(u in s[e])at(o,[e,u].join("."));delete s[e]}}else{for(t in s)at(o,t);!function(t){let e=t.getEventHolder();e===y.window&&(e=st),e.events&&(e.events={})}(r)}}))}class lt extends g{addEventListener(){}dispatch(t,e,n){return function(t,e,n,i){const r=ht(t);return e instanceof y.window.Event||(e=new y.window.CustomEvent(e,{detail:n,cancelable:!0,...i})),r.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 at(this,t,e,n),this}on(t,e,n,i){return ut(this,t,e,n,i),this}removeEventListener(){}}function ct(){}A(lt,"EventTarget");const ft=400,dt=">",pt=0,mt={"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 yt 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(Y).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 gt{constructor(...t){this.init(...t)}convert(t){return new gt(this.value,t)}divide(t){return t=new gt(t),new gt(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(j))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof gt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new gt(t),new gt(this-t,this.unit||t.unit)}plus(t){return t=new gt(t),new gt(this+t,this.unit||t.unit)}times(t){return t=new gt(t),new gt(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 wt=[];class _t extends lt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=b(t)).removeNamespace&&this.node instanceof y.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 b(t).put(this,e)}children(){return new et(h(this.node.children,(function(t){return M(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=T(n)),new this.constructor(n)}each(t,e){const n=this.children();let i,r;for(i=0,r=n.length;i<r;i++)t.apply(n[i],[i,n]),e&&n[i].each(t,e);return this}element(t,e){return this.put(new _t(x(t),e))}first(){return M(this.node.firstChild)}get(t){return M(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=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=k(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return M(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=M(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=M(e.node.parentNode));return e}put(t,e){return t=b(t),this.add(t,e),t}putIn(t,e){return b(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=b(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,d)}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=M(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=x("wrapper",n),r=y.document.createDocumentFragment();i.innerHTML=t;for(let t=i.children.length;t--;)r.appendChild(i.firstElementChild);const s=this.parent();return e?this.replace(r)&&s:this.add(r)}}C(_t,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=F.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))?mt[t]:F.test(e)?parseFloat(e):e;"number"==typeof(e=wt.reduce(((e,n)=>n(t,e,this)),e))?e=new gt(e):H.isColor(e)?e=new H(e):e.constructor===Array&&(e=new yt(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 it(t,this.node)},findOne:function(t){return M(this.node.querySelector(t))}}),A(_t,"Dom");class xt extends _t{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 gt(t).plus(this.x()))}dy(t=0){return this.y(new gt(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=b(t));const n=new et;let i=this;for(;(i=i.parent())&&i.node!==y.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?b(e[1]):null}root(){const t=this.parent(w[_]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=c(this,t,e);return this.width(new gt(n.width)).height(new gt(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)}}C(xt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().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 K(t)},rbox:function(t){const e=tt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new K(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<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new $(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new W(this.node.getCTM())},screenCTM:function(){if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new W(e)}return new W(this.node.getScreenCTM())}}),A(xt,"Element");const bt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof H||H.isRgb(e)||e instanceof xt)this.attr(t,e);else for(n=bt[t].length-1;n>=0;n--)null!=e[bt[t][n]]&&this.attr(bt.prefix(t,bt[t][n]),e[bt[t][n]]);return this},r(["Element","Runner"],e)})),r(["Element","Runner"],{matrix:function(t,e,n,i,r,s){return null==t?new W(this):this.attr("transform",new W(t,e,n,i,r,s))},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)}}),r("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new gt(t)):this.rx(t).ry(e)}}),r("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new $(this.node.getPointAtLength(t))}}),r(["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)}}),r("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}),{})),r("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(Y).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(W.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new W)},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 W(this).decompose();return null==t?e:e[t]}W.isMatrixLike(t)||(t={...t,origin:f(t,this)});const n=new W(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class vt extends xt{flatten(t=this,e){return this.each((function(){if(this instanceof vt)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(vt,"Container");class Mt extends vt{constructor(t,e=t){super(v("defs",t),e)}flatten(){return this}ungroup(){return this}}A(Mt,"Defs");class Ot extends xt{}function At(t){return this.attr("rx",t)}function St(t){return this.attr("ry",t)}function kt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Tt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Ct(t){return this.attr("cx",t)}function Nt(t){return this.attr("cy",t)}function jt(t){return null==t?2*this.rx():this.rx(new gt(t).divide(2))}function Dt(t){return null==t?2*this.ry():this.ry(new gt(t).divide(2))}A(Ot,"Shape");var Et={__proto__:null,rx:At,ry:St,x:kt,y:Tt,cx:Ct,cy:Nt,width:jt,height:Dt};class It extends Ot{constructor(t,e=t){super(v("ellipse",t),e)}size(t,e){const n=c(this,t,e);return this.rx(new gt(n.width).divide(2)).ry(new gt(n.height).divide(2))}}C(It,Et),r("Container",{ellipse:N((function(t=0,e=t){return this.put(new It).size(t,e).move(0,0)}))}),A(It,"Ellipse");class Rt extends _t{constructor(t=y.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 _t(x("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function zt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new gt(t),fy:new gt(e)}):this.attr({x1:new gt(t),y1:new gt(e)})}function Lt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new gt(t),cy:new gt(e)}):this.attr({x2:new gt(t),y2:new gt(e)})}A(Rt,"Fragment");var Pt,qt={__proto__:null,from:zt,to:Lt};class Ft extends vt{constructor(t,e){super(v(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 K}targets(){return it("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()+")"}}C(Ft,qt),r({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:N((function(t,e){return this.put(new Ft(t)).update(e)}))}}),A(Ft,"Gradient");class Xt extends vt{constructor(t,e=t){super(v("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return it("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()+")"}}r({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:N((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 Yt extends Ot{constructor(t,e=t){super(v("image",t),e)}load(t,e){if(!t)return this;const n=new y.window.Image;return ut(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),ut(n,"load error",(function(){at(n)})),this.attr("href",n.src=t,m)}}Pt=function(t,e,n){return"fill"!==t&&"stroke"!==t||X.test(e)&&(e=n.root().defs().image(e)),e instanceof Yt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},wt.push(Pt),r({Container:{image:N((function(t,e){return this.put(new Yt).size(0,0).load(t,e)}))}}),A(Yt,"Image");class Vt extends yt{bbox(){let t=-1/0,e=-1/0,n=1/0,i=1/0;return this.forEach((function(r){t=Math.max(r[0],t),e=Math.max(r[1],e),n=Math.min(r[0],n),i=Math.min(r[1],i)})),new K(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(Y).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,i=t.length;n<i;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const i=this.bbox();for(n=this.length-1;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<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){W.isMatrixLike(t)||(t=new W(t));for(let e=this.length;e--;){const[n,i]=this[e];this[e][0]=t.a*n+t.c*i+t.e,this[e][1]=t.b*n+t.d*i+t.f}return this}}var Gt={__proto__:null,MorphArray:Vt,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}};class Ut extends Ot{constructor(t,e=t){super(v("line",t),e)}array(){return new Vt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,i){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:i}:new Vt(t).toLine(),this.attr(t))}size(t,e){const n=c(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}C(Ut,Gt),r({Container:{line:N((function(...t){return Ut.prototype.plot.apply(this.put(new Ut),null!=t[0]?t:[0,0,0,0])}))}}),A(Ut,"Line");class Bt extends vt{constructor(t,e=t){super(v("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Ht(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}r({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:N((function(t,e,n){return this.put(new Bt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,i){let r=["marker"];return"all"!==t&&r.push(t),r=r.join("-"),t=arguments[1]instanceof Bt?arguments[1]:this.defs().marker(e,n,i),this.attr(r,t)}}}),A(Bt,"Marker");const $t={"-":function(t){return t},"<>":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(r){return r<0?t>0?e/t*r:n>0?i/n*r:0:r>1?n<1?(1-i)/(1-n)*r+(i-n)/(1-n):t<1?(1-e)/(1-t)*r+(e-t)/(1-t):1:3*r*(1-r)**2*e+3*r**2*(1-r)*i+r**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(i,r=!1)=>{let s=Math.floor(i*t);const o=i*s%1==0;return"start"!==e&&"both"!==e||++s,r&&o&&--s,i>=0&&s<0&&(s=0),i<=1&&s>n&&(s=n),s/n}}};class Qt{done(){return!1}}class Wt extends Qt{constructor(t=dt){super(),this.ease=$t[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class Jt extends Qt{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,i){return this.stepper(t,e,n,i)}}function Zt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,i=Math.log(e/100+1e-10),r=-i/Math.sqrt(n*n+i*i),s=3.9/(r*t);this.d=2*r*s,this.k=s*s}C(class extends Jt{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 r=i.velocity||0,s=-this.d*r-this.k*(t-e),o=t+r*n+s*n*n/2;return i.velocity=r+s*n,i.done=Math.abs(e-o)+Math.abs(r)<.002,i.done?e:o}},{duration:Ht("_duration",Zt),overshoot:Ht("_overshoot",Zt)}),C(class extends Jt{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 r=e-t;let s=(i.integral||0)+r*n;const o=(r-(i.error||0))/n,h=this._windup;return!1!==h&&(s=Math.max(-h,Math.min(s,h))),i.error=r,i.integral=s,i.done=Math.abs(r)<.001,i.done?e:t+(this.P*r+this.I*s+this.D*o)}},{windup:Ht("_windup"),p:Ht("P"),i:Ht("I"),d:Ht("D")});const Kt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},te={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]]}},ee="mlhvqtcsaz".split("");for(let t=0,e=ee.length;t<e;++t)te[ee[t]]=function(t){return function(e,n,i){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,i=e.length;t<i;++t)e[t]=e[t]+(t%2?n.y:n.x);return te[t](e,n,i)}}(ee[t].toUpperCase());function ne(t){return t.segment.length&&t.segment.length-1===Kt[t.segment[0].toUpperCase()]}function ie(t,e){t.inNumber&&re(t,!1);const n=V.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),i=e===n;t.segment=["m"===n?i?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function re(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,ne(t)&&se(t)}function se(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return te[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function oe(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function he(t){return"E"===t.lastToken.toUpperCase()}class ue extends yt{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,i=this.length-1;i>=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 r={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;r.lastToken=i,i=t.charAt(n++);)if(r.inSegment||!ie(r,i))if("."!==i)if(isNaN(parseInt(i)))if(" "!==i&&","!==i)if("-"!==i)if("E"!==i.toUpperCase()){if(V.test(i)){if(r.inNumber)re(r,!1);else{if(!ne(r))throw new Error("parser Error");se(r)}--n}}else r.number+=i,r.hasExponent=!0;else{if(r.inNumber&&!he(r)){re(r,!1),--n;continue}r.number+=i,r.inNumber=!0}else r.inNumber&&re(r,!1);else{if("0"===r.number||oe(r)){r.inNumber=!0,r.number=i,re(r,!0);continue}r.inNumber=!0,r.number+=i}else{if(r.pointSeen||r.hasExponent){re(r,!1),--n;continue}r.inNumber=!0,r.pointSeen=!0,r.number+=i}return r.inNumber&&re(r,!1),r.inSegment&&ne(r)&&se(r),r.segments}(t)}size(t,e){const n=this.bbox();let i,r;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(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"===r?this[i][1]=(this[i][1]-n.x)*t/n.width+n.x:"V"===r?this[i][1]=(this[i][1]-n.y)*e/n.height+n.y:"C"===r||"S"===r||"Q"===r?(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"===r&&(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"===r&&(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<i;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const ae=t=>{const e=typeof t;return"number"===e?gt:"string"===e?H.isColor(t)?H:Y.test(t)?V.test(t)?ue:yt:j.test(t)?gt:ce:me.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?yt:"object"===e?pe:ce};class le{constructor(t){this._stepper=t||new Wt("-"),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(ae(t));let e=new this._type(t);return this._type===H&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===pe&&(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 ce{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 fe{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,fe.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}fe.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const de=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class pe{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,i=e.length;n<i;++n){if(e[n+1]===t[n+1]){if(e[n+1]===H&&t[n+7]!==e[n+7]){const e=t[n+7],i=new H(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...i)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const i=(new t[n+1]).toArray(),r=e[n+2]+3;e.splice(n,r,t[n],t[n+1],t[n+2],...i),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const i=ae(t[n]),r=new i(t[n]).toArray();e.push([n,i,r.length,...r])}return e.sort(de),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),i=e.shift(),r=e.shift(),s=e.splice(0,r);t[n]=new i(s)}return t}}const me=[ce,fe,pe];class ye extends Ot{constructor(t,e=t){super(v("path",t),e)}array(){return this._array||(this._array=new ue(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 ue(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)}}ye.prototype.MorphArray=ue,r({Container:{path:N((function(t){return this.put(new ye).plot(t||new ue)}))}}),A(ye,"Path");var ge={__proto__:null,array:function(){return this._array||(this._array=new Vt(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 Vt(t))},size:function(t,e){const n=c(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class we extends Ot{constructor(t,e=t){super(v("polygon",t),e)}}r({Container:{polygon:N((function(t){return this.put(new we).plot(t||new Vt)}))}}),C(we,Gt),C(we,ge),A(we,"Polygon");class _e extends Ot{constructor(t,e=t){super(v("polyline",t),e)}}r({Container:{polyline:N((function(t){return this.put(new _e).plot(t||new Vt)}))}}),C(_e,Gt),C(_e,ge),A(_e,"Polyline");class xe extends Ot{constructor(t,e=t){super(v("rect",t),e)}}C(xe,{rx:At,ry:St}),r({Container:{rect:N((function(t,e){return this.put(new xe).size(t,e)}))}}),A(xe,"Rect");class be{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 ve={nextDraw:null,frames:new be,timeouts:new be,immediates:new be,timer:()=>y.window.performance||y.window.Date,transforms:[],frame(t){const e=ve.frames.push({run:t});return null===ve.nextDraw&&(ve.nextDraw=y.window.requestAnimationFrame(ve._draw)),e},timeout(t,e){e=e||0;const n=ve.timer().now()+e,i=ve.timeouts.push({run:t,time:n});return null===ve.nextDraw&&(ve.nextDraw=y.window.requestAnimationFrame(ve._draw)),i},immediate(t){const e=ve.immediates.push(t);return null===ve.nextDraw&&(ve.nextDraw=y.window.requestAnimationFrame(ve._draw)),e},cancelFrame(t){null!=t&&ve.frames.remove(t)},clearTimeout(t){null!=t&&ve.timeouts.remove(t)},cancelImmediate(t){null!=t&&ve.immediates.remove(t)},_draw(t){let e=null;const n=ve.timeouts.last();for(;(e=ve.timeouts.shift())&&(t>=e.time?e.run():ve.timeouts.push(e),e!==n););let i=null;const r=ve.frames.last();for(;i!==r&&(i=ve.frames.shift());)i.run(t);let s=null;for(;s=ve.immediates.shift();)s();ve.nextDraw=ve.timeouts.first()||ve.frames.first()?y.window.requestAnimationFrame(ve._draw):null}},Me=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=y.window;return(t.performance||t.Date).now()};class Ae extends lt{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(Me);let i=0;const r=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)i=r;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 s=t.persist(),o={persist:null===s?this._persist:s,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 ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=ve.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 r=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],s=n.runner;let o=i;const h=this._time-n.start;h<=0?r=!0:(h<o&&(o=h),s.active()&&(s.step(o).done?!0!==n.persist&&s.duration()-s.time()+this._time+n.persist<this._time&&(s.unschedule(),--t,--e):r=!0))}return r&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}}r({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Ae,this._timeline):(this._timeline=t,this)}}});class Se extends lt{constructor(t){super(),this.id=Se.id++,t="function"==typeof(t=null==t?ft:t)?new Jt(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof Jt,this._stepper=this._isDeclarative?t:new Wt,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new W,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,r=!1,s=0;return e=e||pt,n=n||"last","object"!=typeof(t=t||ft)||t instanceof Qt||(e=t.delay||e,n=t.when||n,r=t.swing||r,i=t.times||i,s=t.wait||s,t=t.duration||ft),{duration:t,delay:e,swing:r,times:i,wait:s,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=Se.sanitise(t,e,n),r=new Se(i.duration);return this._timeline&&r.timeline(this._timeline),this._element&&r.element(this._element),r.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new W,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 Wt(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,r=this._times,s=this._swing,o=this._reverse;let h;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(i+n))/(i+n)),r=e&&!o||!e&&o,h=Math.pow(-1,r)*(t%(i+n))/n+r;return Math.max(Math.min(h,1),0)},u=r*(i+n)-i;return h=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),h}const u=Math.floor(this.loops()),a=s&&u%2==0;return h=u+(a&&!o||o&&a?t:1-t),this.loops(h)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,i){return this._queue.push({initialiser:t||ct,runner:e||ct,retarget:n,isTransform:i,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof Ae||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const i=this.duration(),r=this._lastTime<=0&&this._time>0,s=this._lastTime<i&&this._time>=i;this._lastTime=this._time,r&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=i,this._reseted=!1;let h=!1;return(n||o)&&(this._initialise(n),this.transforms=new W,h=this._run(o?t:e),this.fire("step",this)),this.done=this.done||h&&o,s&&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;e<n;++e){const n=this._queue[e],i=this._isDeclarative||!n.initialised&&t;t=!n.finished,i&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,i=this._queue.length;n<i;++n){const i=this._queue[n],r=i.runner.call(this,t);i.finished=i.finished||!0===r,e=e&&i.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const i=this.timeline();return i&&i.play(),!0}return!1}}Se.id=0;class ke{constructor(t=new W,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}C([Se,ke],{mergeWith(t){return new ke(t.transforms.lmultiply(this.transforms),t.id)}});const Te=(t,e)=>t.lmultiplyO(e),Ce=t=>t.transforms;function Ne(){const t=this._transformationRunners.runners.map(Ce).reduce(Te,new W);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class je{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 ke).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;e<this.runners.length;++e){const n=this.runners[e];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const i=n.mergeWith(t);this.edit(t.id,i),t=i,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}r({Element:{animate(t,e,n){const i=Se.sanitise(t,e,n),r=this.timeline();return new Se(i.duration).loop(i).element(this).timeline(r.play()).schedule(i.delay,i.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Ce).reduce(Te,new W)},_addRunner(t){this._transformationRunners.add(t),ve.cancelImmediate(this._frameId),this._frameId=ve.immediate(Ne.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new je).add(new ke(new W(this))))}}}),C(Se,{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 r=new le(this._stepper).to(i),s=Object.keys(i);return this.queue((function(){r=r.from(this.element()[t](s))}),(function(e){return this.element()[t](r.at(e).valueOf()),r.done()}),(function(e){const n=Object.keys(e),o=(h=s,n.filter((t=>!h.includes(t))));var h;if(o.length){const e=this.element()[t](o),n=new pe(r.from()).valueOf();Object.assign(n,e),r.from(n)}const u=new pe(r.to()).valueOf();Object.assign(u,e),r.to(u),s=n,i=e})),this._rememberMorpher(t,r),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new le(this._stepper).to(new gt(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=W.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!i;const r=new le(this._stepper).type(n?fe:W);let s,o,h,u,a;return this.queue((function(){o=o||this.element(),s=s||f(t,o),a=new W(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:f}=new $(s).transform(o._currentTransform(this));let d=new W({...t,origin:[c,f]}),p=this._isDeclarative&&h?h:a;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))),r=Math.min(...i),s=i.indexOf(r);d.rotate=n[s]}e&&(i||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),r.from(p),r.to(d);const m=r.at(l);return u=m.rotate,h=new W(m),this.addTransform(h),o._addRunner(this),r.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=f(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",r),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 gt(e),this._tryRetarget(t,e))return this;const n=new le(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 gt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new le(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 gt(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 r=new le(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){r.from(this._element.array())}),(function(t){return this._element.plot(r.at(t)),r.done()})),this._rememberMorpher("plot",r),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,i){return this._queueObject("viewbox",new K(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)}}),C(Se,{rx:At,ry:St,from:zt,to:Lt}),A(Se,"Runner");class De extends vt{constructor(t,e=t){super(v("svg",t),e),this.namespace()}defs(){return this.isRoot()?M(this.node.querySelector("defs"))||this.put(new Mt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof y.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:d,version:"1.1"}).attr("xmlns:xlink",m,p).attr("xmlns:svgjs","http://svgjs.dev/svgjs",p):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,p).attr("xmlns:svgjs",null,p)}root(){return this.isRoot()?this:super.root()}}r({Container:{nested:N((function(){return this.put(new De)}))}}),A(De,"Svg",!0);class Ee extends vt{constructor(t,e=t){super(v("symbol",t),e)}}r({Container:{symbol:N((function(){return this.put(new Ee)}))}}),A(Ee,"Symbol");var Ie={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(y.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(v("text",t),e),this.dom.leading=new gt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new gt(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 r=y.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new gt(r);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",i?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new gt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let i=0,r=e.length;i<r;++i)"textPath"!==e[i].nodeName?(i!==n&&3!==e[i].nodeType&&!0===M(e[i]).dom.newLined&&(t+="\n"),t+=e[i].textContent):0===i&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}C(Re,Ie),r({Container:{text:N((function(t=""){return this.put(new Re).text(t)})),plain:N((function(t=""){return this.put(new Re).plain(t)}))}}),A(Re,"Text");class ze extends Ot{constructor(t,e=t){super(v("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof Re))return this;const e=t.index(this),n=y.window.getComputedStyle(this.node).getPropertyValue("font-size"),i=t.dom.leading*new gt(n);return this.dy(e?i:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}C(ze,Ie),r({Tspan:{tspan:N((function(t=""){const e=new ze;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),A(ze,"Tspan");class Le extends Ot{constructor(t,e=t){super(v("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new gt(t).divide(2))}}C(Le,{x:kt,y:Tt,cx:Ct,cy:Nt,width:jt,height:Dt}),r({Container:{circle:N((function(t=0){return this.put(new Le).size(t).move(0,0)}))}}),A(Le,"Circle");class Pe extends vt{constructor(t,e=t){super(v("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return it("svg [clip-path*="+this.id()+"]")}}r({Container:{clip:N((function(){return this.defs().put(new Pe)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Pe?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),A(Pe,"ClipPath");class qe extends xt{constructor(t,e=t){super(v("foreignObject",t),e)}}r({Container:{foreignObject:N((function(t,e){return this.put(new qe).size(t,e)}))}}),A(qe,"ForeignObject");var Fe={__proto__:null,dmove:function(t,e){return this.children().forEach(((n,i)=>{let r;try{r=n.bbox()}catch(t){return}const s=new W(n),o=s.translate(t,e).transform(s.inverse()),h=new $(r.x,r.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,r=e-n.y;return this.dmove(i,r)},size:function(t,e,n=this.bbox()){const i=c(this,t,e,n),r=i.width/n.width,s=i.height/n.height;return this.children().forEach(((t,e)=>{const i=new $(n).transform(new W(t).inverse());t.scale(r,s,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 vt{constructor(t,e=t){super(v("g",t),e)}}C(Xe,Fe),r({Container:{group:N((function(){return this.put(new Xe)}))}}),A(Xe,"G");class Ye extends vt{constructor(t,e=t){super(v("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,m)}}C(Ye,Fe),r({Container:{link:N((function(t){return this.put(new Ye).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 Ye,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(Ye,"A");class Ve extends vt{constructor(t,e=t){super(v("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return it("svg [mask*="+this.id()+"]")}}r({Container:{mask:N((function(){return this.defs().put(new Ve)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Ve?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),A(Ve,"Mask");class Ge extends xt{constructor(t,e=t){super(v("stop",t),e)}update(t){return("number"==typeof t||t instanceof gt)&&(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 gt(t.offset)),this}}r({Gradient:{stop:function(t,e,n){return this.put(new Ge).update(t,e,n)}}}),A(Ge,"Stop");class Ue extends xt{constructor(t,e=t){super(v("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+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}r("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 Be extends Re{constructor(t,e=t){super(v("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")}}r({Container:{textPath:N((function(t,e){return t instanceof Re||(t=this.text(t)),t.path(e)}))},Text:{path:N((function(t,e=!0){const n=new Be;let i;if(t instanceof ye||(t=this.defs().path(t)),n.attr("href","#"+t,m),e)for(;i=this.node.firstChild;)n.node.appendChild(i);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:N((function(t){return t instanceof Re||(t=(new Re).addTo(this.parent()).text(t)),t.path(this)})),targets(){return it("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Be.prototype.MorphArray=ue,A(Be,"TextPath");class He extends Ot{constructor(t,e=t){super(v("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}r({Container:{use:N((function(t,e){return this.put(new He).use(t,e)}))}}),A(He,"Use"),C([De,Ee,Yt,Xt,Bt],s("viewbox")),C([Ut,_e,we,ye],s("marker")),C(Re,s("Text")),C(ye,s("Path")),C(Mt,s("Defs")),C([Re,ze],s("Tspan")),C([xe,It,Ft,Se],s("radius")),C(lt,s("EventTarget")),C(_t,s("Dom")),C(xt,s("Element")),C(Ot,s("Shape")),C([vt,Rt],s("Container")),C(Ft,s("Gradient")),C(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){me.push(...[].concat(t))}([gt,H,K,W,yt,Vt,ue,$]),C(me,{to(t){return(new le).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,i,r){return this.fromArray(t.map((function(t,s){return i.step(t,e[s],n,r[s],r)})))}});var $e=n(726),Qe=function(){function t(){this.svgDoc=new De}return Object.defineProperty(t.prototype,"svgDocDOMNode",{get:function(){return this.svgDoc.node},enumerable:!1,configurable:!0}),t.prototype.appendTo=function(t){this.svgDoc.addTo(t)},t.prototype.remove=function(){this.svgDoc.remove()},t.prototype.setScaling=function(t){new $e.Scaling(this.svgDoc).set(t)},t}()})(),i})()));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.draw=e():t.draw=e()}(this,(()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>l,Scaling:()=>a,VerticalClientScaling:()=>c,assignUUID:()=>u});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let i;const r=new Uint8Array(16);function s(){if(!i&&(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!i))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(r)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const h=function(t,e,i){if(n.randomUUID&&!e&&!t)return n.randomUUID();const r=(t=t||{}).random||(t.rng||s)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){i=i||0;for(let t=0;t<16;++t)e[i+t]=r[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(r)};function u(t){t.id="uuid-"+h()}var a=function(){function t(t){this.targetSVGDoc=t}return t.prototype.set=function(t){var e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")},t}(),l=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width},t}(),c=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height},t}();return e})(),t.exports=e()}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{Drawing:()=>Qe});const t={},e=[];function r(e,n){if(Array.isArray(e))for(const t of e)r(t,n);else if("object"!=typeof e)o(Object.getOwnPropertyNames(n)),t[e]=Object.assign(t[e]||{},n);else for(const t in e)r(t,e[t])}function s(e){return t[e]||{}}function o(t){e.push(...t)}function h(t,e){let n;const i=t.length,r=[];for(n=0;n<i;n++)r.push(e(t[n]));return r}function u(t){return t%360*Math.PI/180}function a(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,n,i){return null!=e&&null!=n||(i=i||t.bbox(),null==e?e=i.width/i.height*n:null==n&&(n=i.height/i.width*e)),{width:e,height:n}}function f(t,e){const n=t.origin;let i=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",r=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([i,r]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof i,o="string"==typeof r;if(s||o){const{height:t,width:n,x:h,y:u}=e.bbox();s&&(i=i.includes("left")?h:i.includes("right")?h+n:h+n/2),o&&(r=r.includes("top")?u:r.includes("bottom")?u+t:u+t/2)}return[i,r]}const d="http://www.w3.org/2000/svg",p="http://www.w3.org/2000/xmlns/",m="http://www.w3.org/1999/xlink",y={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class g{}const w={},_="___SYMBOL___ROOT___";function x(t,e=d){return y.document.createElementNS(e,t)}function b(t,e=!1){if(t instanceof g)return t;if("object"==typeof t)return O(t);if(null==t)return new w[_];if("string"==typeof t&&"<"!==t.charAt(0))return O(y.document.querySelector(t));const n=e?y.document.createElement("div"):x("svg");return n.innerHTML=t,t=O(n.firstChild),n.removeChild(n.firstChild),t}function v(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:x(t)}function M(t){if(!t)return null;if(t.instance instanceof g)return t.instance;if("#document-fragment"===t.nodeName)return new w.Fragment(t);let e=l(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":w[e]||(e="Dom"),new w[e](t)}let O=M;function A(t,e=t.name,n=!1){return w[e]=t,n&&(w[_]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let S=1e3;function k(t){return"Svgjs"+l(t)+S++}function C(t){for(let e=t.children.length-1;e>=0;e--)C(t.children[e]);return t.id?(t.id=k(t.nodeName),t):t}function T(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 N(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)}}r("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=b(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=b(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=b(t)).before(this),this},insertAfter:function(t){return(t=b(t)).after(this),this}});const j=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,E=/^#?([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,z=/\)\s*,?\s*/,R=/\s/g,L=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,P=/^rgb\(/,q=/^(\s+)?$/,F=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,V=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,X=/[\s,]+/,Y=/[MLHVCSQTAZ]/i;function B(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function G(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function U(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}r("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(X)},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)}}),r("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]||q.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[a(t)]=null==e||q.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),r("Dom",{data:function(t,e,n){if(null==t)return this.data(h(function(t,e){let n;const i=t.length,r=[];for(n=0;n<i;n++)e(t[n])&&r.push(t[n]);return r}(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}}),r("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 H{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof H||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:r,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*i()+57,e=38*i()+45,n=360*i();return new H(t,e,n,"lch")}if("sine"===t){const t=r(80*s(2*o*(e=null==e?i():e)/.5+.01)+150),n=r(50*s(2*o*e/.5+4.6)+200),h=r(100*s(2*o*e/.5+2.3)+150);return new H(t,n,h)}if("pastel"===t){const t=8*i()+86,e=17*i()+9,n=360*i();return new H(t,e,n,"lch")}if("dark"===t){const t=10+10*i(),e=50*i()+86,n=360*i();return new H(t,e,n,"lch")}if("rgb"===t){const t=255*i(),e=255*i(),n=255*i();return new H(t,e,n)}if("lab"===t){const t=100*i(),e=256*i()-128,n=256*i()-128;return new H(t,e,n,"lab")}if("grey"===t){const t=255*i();return new H(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(L.test(t)||P.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-i,1-r,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-i-o)/(1-o),(1-r-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,s]=[t,e,n].map((t=>t/255)),o=Math.max(i,r,s),h=Math.min(i,r,s),u=(o+h)/2,a=o===h,l=o-h;return new H(360*(a?0:o===i?((r-s)/l+(r<s?6:0))/6:o===r?((s-i)/l+2)/6:o===s?((i-r)/l+4)/6:0),100*(a?0:u>.5?l/(2-o-h):l/(o+h)),100*u,"hsl")}init(t=0,e=0,n=0,i=0,r="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)r="string"==typeof i?i:r,i="string"==typeof i?0:i,Object.assign(this,{_a:t,_b:e,_c:n,_d:i,space:r});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=G(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:G(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:G(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:G(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:G(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:G(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(R,""),[n,i,r]=D.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:i,_c:r,_d:0,space:"rgb"})}else{if(!L.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,i,r]=E.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:r,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:h,_d:u}=this,a="rgb"===this.space?{r:s,g:o,b:h}:"xyz"===this.space?{x:s,y:o,z:h}:"hsl"===this.space?{h:s,s:o,l:h}:"lab"===this.space?{l:s,a:o,b:h}:"lch"===this.space?{l:s,c:o,h}:"cmyk"===this.space?{c:s,m:o,y:h,k:u}:{};Object.assign(this,a)}lab(){const{x:t,y:e,z:n}=this.xyz();return new H(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 r=180*Math.atan2(n,e)/Math.PI;return r<0&&(r*=-1,r=360-r),new H(t,i,r,"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:r,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;r=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(i+16)/116,h=r/500+o,u=o-s/200,a=16/116,l=.008856,c=7.787;t=.95047*(h**3>l?h**3:(h-a)/c),e=1*(o**3>l?o**3:(o-a)/c),n=1.08883*(u**3>l?u**3:(u-a)/c)}const i=3.2406*t+-1.5372*e+-.4986*n,r=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,h=.0031308,u=i>h?1.055*o(i,1/2.4)-.055:12.92*i,a=r>h?1.055*o(r,1/2.4)-.055:12.92*r,l=s>h?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*u,255*a,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 H(n,n,n);const i=n<.5?n*(1+e):n+e-n*e,r=2*n-i,s=255*U(r,i,t+1/3),o=255*U(r,i,t),h=255*U(r,i,t-1/3);return new H(s,o,h)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:i}=this,r=255*(1-Math.min(1,t*(1-i)+i)),s=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,n*(1-i)+i));return new H(r,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:i,space:r}=this;return[t,e,n,i,r]}toHex(){const[t,e,n]=this._clamped().map(B);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,r,s]=[t,e,n].map((t=>t/255)),o=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,a=(.4124*o+.3576*h+.1805*u)/.95047,l=(.2126*o+.7152*h+.0722*u)/1,c=(.0193*o+.1192*h+.9505*u)/1.08883,f=a>.008856?Math.pow(a,1/3):7.787*a+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 H(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:i,min:r,round:s}=Math;return[t,e,n].map((t=>i(0,r(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(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){W.isMatrixLike(t)||(t=new W(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 Q(t,e,n){return Math.abs(e-t)<(n||1e-6)}class W{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,r=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=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,u=t.shear||0,a=t.rotate||t.theta||0,l=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new $(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,y=new $(t.translate||t.tx||t.translateX,t.ty||t.translateY),g=y.x,w=y.y,_=new $(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:h,skewX:r,skewY:s,shear:u,theta:a,rx:_.x,ry:_.y,tx:g,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,r=t.b*e.a+t.d*e.b,s=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,u=t.f+t.b*e.e+t.d*e.f;return n.a=i,n.b=r,n.c=s,n.d=o,n.e=h,n.f=u,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const i=t||0,r=e||0;return this.translateO(-i,-r).lmultiplyO(n).translateO(i,r)}clone(){return new W(this)}decompose(t=0,e=0){const n=this.a,i=this.b,r=this.c,s=this.d,o=this.e,h=this.f,u=n*s-i*r,a=u>0?1:-1,l=a*Math.sqrt(n*n+i*i),c=Math.atan2(a*i,a*n),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(n*r+i*s)/u,y=r*l/(m*n-i)||s*l/(m*i+n);return{scaleX:l,scaleY:y,shear:m,rotate:f,translateX:o-t+t*d*l+e*(m*d*l-p*y),translateY:h-e+t*p*l+e*(m*p*l+d*y),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 W(t);return Q(this.a,e.a)&&Q(this.b,e.b)&&Q(this.c,e.c)&&Q(this.d,e.d)&&Q(this.e,e.e)&&Q(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=W.fromArray([1,0,0,1,0,0]);return t=t instanceof xt?t.matrixify():"string"==typeof t?W.fromArray(t.split(X).map(parseFloat)):Array.isArray(t)?W.fromArray(t):"object"==typeof t&&W.isMatrixLike(t)?t:"object"==typeof t?(new W).transform(t):6===arguments.length?W.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,r=this.e,s=this.f,o=t*i-e*n;if(!o)throw new Error("Cannot invert "+this);const h=i/o,u=-e/o,a=-n/o,l=t/o,c=-(h*r+a*s),f=-(u*r+l*s);return this.a=h,this.b=u,this.c=a,this.d=l,this.e=c,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof W?t:new W(t);return W.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof W?t:new W(t);return W.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=u(t);const i=Math.cos(t),r=Math.sin(t),{a:s,b:o,c:h,d:a,e:l,f:c}=this;return this.a=s*i-o*r,this.b=o*i+s*r,this.c=h*i-a*r,this.d=a*i+h*r,this.e=l*i-c*r+n*r-e*i+e,this.f=c*i+l*r-e*r-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:r,b:s,c:o,d:h,e:u,f:a}=this;return this.a=r*t,this.b=s*e,this.c=o*t,this.d=h*e,this.e=u*t-n*t+n,this.f=a*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:r,c:s,d:o,e:h,f:u}=this;return this.a=i+r*t,this.c=s+o*t,this.e=h+u*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=u(t),e=u(e);const r=Math.tan(t),s=Math.tan(e),{a:o,b:h,c:a,d:l,e:c,f}=this;return this.a=o+h*r,this.b=h+o*s,this.c=a+l*r,this.d=l+a*s,this.e=c+f*r-i*r,this.f=f+c*s-n*s,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(W.isMatrixLike(t))return new W(t).multiplyO(this);const e=W.formatTransforms(t),{x:n,y:i}=new $(e.ox,e.oy).transform(this),r=(new W).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 $(n,i).transform(r),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;r.translateO(s,o)}return r.translateO(e.tx,e.ty),r}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 J(){if(!J.nodes){const t=b().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;J.nodes={svg:t,path:e}}if(!J.nodes.svg.node.parentNode){const t=y.document.body||y.document.documentElement;J.nodes.svg.addTo(t)}return J.nodes}function Z(t){return!(t.width||t.height||t.x||t.y)}A(W,"Matrix");class K{constructor(...t){this.init(...t)}addOffset(){return this.x+=y.window.pageXOffset,this.y+=y.window.pageYOffset,new K(this)}init(t){return t="string"==typeof t?t.split(X).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 Z(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,r=Math.max(this.y+this.height,t.y+t.height)-n;return new K(e,n,i,r)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof W||(t=new W(t));let e=1/0,n=-1/0,i=1/0,r=-1/0;return[new $(this.x,this.y),new $(this.x2,this.y),new $(this.x,this.y2),new $(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),i=Math.min(i,s.y),r=Math.max(r,s.y)})),new K(e,i,n-e,r-i)}}function tt(t,e,n){let i;try{if(i=e(t.node),Z(i)&&(r=t.node)!==y.document&&!(y.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===y.document}).call(y.document.documentElement,r))throw new Error("Element not in the dom")}catch(e){i=n(t)}var r;return i}r({viewbox:{viewbox(t,e,n,i){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(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 r=this.viewbox(),s=n/r.width,o=i/r.height,h=Math.min(s,o);if(null==t)return h;let u=h/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new $(n/2/s+r.x,i/2/o+r.y);const a=new K(r).transform(new W({scale:u,origin:e}));return this.viewbox(a)}}}),A(K,"Box");class et extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}T([et],{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 nt=["toArray","constructor","each"];function it(t,e){return new et(h((e||y.document).querySelectorAll(t),(function(t){return M(t)})))}et.extend=function(t){t=t.reduce(((t,e)=>(nt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),T([et],t)};let rt=0;const st={};function ot(t){let e=t.getEventHolder();return e===y.window&&(e=st),e.events||(e.events={}),e.events}function ht(t){return t.getEventTarget()}function ut(t,e,n,i,r){const s=n.bind(i||t),o=b(t),h=ot(o),u=ht(o);e=Array.isArray(e)?e:e.split(X),n._svgjsListenerId||(n._svgjsListenerId=++rt),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]=s,u.addEventListener(e,s,r||!1)}))}function at(t,e,n,i){const r=b(t),s=ot(r),o=ht(r);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(X)).forEach((function(t){const e=t&&t.split(".")[0],h=t&&t.split(".")[1];let u,a;if(n)s[e]&&s[e][h||"*"]&&(o.removeEventListener(e,s[e][h||"*"][n],i||!1),delete s[e][h||"*"][n]);else if(e&&h){if(s[e]&&s[e][h]){for(a in s[e][h])at(o,[e,h].join("."),a);delete s[e][h]}}else if(h)for(t in s)for(u in s[t])h===u&&at(o,[t,h].join("."));else if(e){if(s[e]){for(u in s[e])at(o,[e,u].join("."));delete s[e]}}else{for(t in s)at(o,t);!function(t){let e=t.getEventHolder();e===y.window&&(e=st),e.events&&(e.events={})}(r)}}))}class lt extends g{addEventListener(){}dispatch(t,e,n){return function(t,e,n,i){const r=ht(t);return e instanceof y.window.Event||(e=new y.window.CustomEvent(e,{detail:n,cancelable:!0,...i})),r.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 at(this,t,e,n),this}on(t,e,n,i){return ut(this,t,e,n,i),this}removeEventListener(){}}function ct(){}A(lt,"EventTarget");const ft=400,dt=">",pt=0,mt={"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 yt 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(X).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 gt{constructor(...t){this.init(...t)}convert(t){return new gt(this.value,t)}divide(t){return t=new gt(t),new gt(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(j))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof gt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new gt(t),new gt(this-t,this.unit||t.unit)}plus(t){return t=new gt(t),new gt(this+t,this.unit||t.unit)}times(t){return t=new gt(t),new gt(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 wt=[];class _t extends lt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=b(t)).removeNamespace&&this.node instanceof y.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 b(t).put(this,e)}children(){return new et(h(this.node.children,(function(t){return M(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=C(n)),new this.constructor(n)}each(t,e){const n=this.children();let i,r;for(i=0,r=n.length;i<r;i++)t.apply(n[i],[i,n]),e&&n[i].each(t,e);return this}element(t,e){return this.put(new _t(x(t),e))}first(){return M(this.node.firstChild)}get(t){return M(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=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=k(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return M(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=M(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=M(e.node.parentNode));return e}put(t,e){return t=b(t),this.add(t,e),t}putIn(t,e){return b(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=b(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,d)}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=M(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=x("wrapper",n),r=y.document.createDocumentFragment();i.innerHTML=t;for(let t=i.children.length;t--;)r.appendChild(i.firstElementChild);const s=this.parent();return e?this.replace(r)&&s:this.add(r)}}T(_t,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=F.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))?mt[t]:F.test(e)?parseFloat(e):e;"number"==typeof(e=wt.reduce(((e,n)=>n(t,e,this)),e))?e=new gt(e):H.isColor(e)?e=new H(e):e.constructor===Array&&(e=new yt(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 it(t,this.node)},findOne:function(t){return M(this.node.querySelector(t))}}),A(_t,"Dom");class xt extends _t{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 gt(t).plus(this.x()))}dy(t=0){return this.y(new gt(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=b(t));const n=new et;let i=this;for(;(i=i.parent())&&i.node!==y.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?b(e[1]):null}root(){const t=this.parent(w[_]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=c(this,t,e);return this.width(new gt(n.width)).height(new gt(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)}}T(xt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().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 K(t)},rbox:function(t){const e=tt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new K(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<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new $(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new W(this.node.getCTM())},screenCTM:function(){if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new W(e)}return new W(this.node.getScreenCTM())}}),A(xt,"Element");const bt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof H||H.isRgb(e)||e instanceof xt)this.attr(t,e);else for(n=bt[t].length-1;n>=0;n--)null!=e[bt[t][n]]&&this.attr(bt.prefix(t,bt[t][n]),e[bt[t][n]]);return this},r(["Element","Runner"],e)})),r(["Element","Runner"],{matrix:function(t,e,n,i,r,s){return null==t?new W(this):this.attr("transform",new W(t,e,n,i,r,s))},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)}}),r("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new gt(t)):this.rx(t).ry(e)}}),r("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new $(this.node.getPointAtLength(t))}}),r(["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)}}),r("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}),{})),r("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(z).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(X).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(W.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new W)},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 W(this).decompose();return null==t?e:e[t]}W.isMatrixLike(t)||(t={...t,origin:f(t,this)});const n=new W(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class vt extends xt{flatten(t=this,e){return this.each((function(){if(this instanceof vt)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(vt,"Container");class Mt extends vt{constructor(t,e=t){super(v("defs",t),e)}flatten(){return this}ungroup(){return this}}A(Mt,"Defs");class Ot extends xt{}function At(t){return this.attr("rx",t)}function St(t){return this.attr("ry",t)}function kt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Ct(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Tt(t){return this.attr("cx",t)}function Nt(t){return this.attr("cy",t)}function jt(t){return null==t?2*this.rx():this.rx(new gt(t).divide(2))}function Et(t){return null==t?2*this.ry():this.ry(new gt(t).divide(2))}A(Ot,"Shape");var Dt={__proto__:null,rx:At,ry:St,x:kt,y:Ct,cx:Tt,cy:Nt,width:jt,height:Et};class It extends Ot{constructor(t,e=t){super(v("ellipse",t),e)}size(t,e){const n=c(this,t,e);return this.rx(new gt(n.width).divide(2)).ry(new gt(n.height).divide(2))}}T(It,Dt),r("Container",{ellipse:N((function(t=0,e=t){return this.put(new It).size(t,e).move(0,0)}))}),A(It,"Ellipse");class zt extends _t{constructor(t=y.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 _t(x("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Rt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new gt(t),fy:new gt(e)}):this.attr({x1:new gt(t),y1:new gt(e)})}function Lt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new gt(t),cy:new gt(e)}):this.attr({x2:new gt(t),y2:new gt(e)})}A(zt,"Fragment");var Pt,qt={__proto__:null,from:Rt,to:Lt};class Ft extends vt{constructor(t,e){super(v(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 K}targets(){return it("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()+")"}}T(Ft,qt),r({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:N((function(t,e){return this.put(new Ft(t)).update(e)}))}}),A(Ft,"Gradient");class Vt extends vt{constructor(t,e=t){super(v("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return it("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()+")"}}r({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:N((function(t,e,n){return this.put(new Vt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),A(Vt,"Pattern");class Xt extends Ot{constructor(t,e=t){super(v("image",t),e)}load(t,e){if(!t)return this;const n=new y.window.Image;return ut(n,"load",(function(t){const i=this.parent(Vt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),i instanceof Vt&&0===i.width()&&0===i.height()&&i.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ut(n,"load error",(function(){at(n)})),this.attr("href",n.src=t,m)}}Pt=function(t,e,n){return"fill"!==t&&"stroke"!==t||V.test(e)&&(e=n.root().defs().image(e)),e instanceof Xt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},wt.push(Pt),r({Container:{image:N((function(t,e){return this.put(new Xt).size(0,0).load(t,e)}))}}),A(Xt,"Image");class Yt extends yt{bbox(){let t=-1/0,e=-1/0,n=1/0,i=1/0;return this.forEach((function(r){t=Math.max(r[0],t),e=Math.max(r[1],e),n=Math.min(r[0],n),i=Math.min(r[1],i)})),new K(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(X).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,i=t.length;n<i;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const i=this.bbox();for(n=this.length-1;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<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){W.isMatrixLike(t)||(t=new W(t));for(let e=this.length;e--;){const[n,i]=this[e];this[e][0]=t.a*n+t.c*i+t.e,this[e][1]=t.b*n+t.d*i+t.f}return this}}var Bt={__proto__:null,MorphArray:Yt,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}};class Gt extends Ot{constructor(t,e=t){super(v("line",t),e)}array(){return new Yt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,i){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:i}:new Yt(t).toLine(),this.attr(t))}size(t,e){const n=c(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}T(Gt,Bt),r({Container:{line:N((function(...t){return Gt.prototype.plot.apply(this.put(new Gt),null!=t[0]?t:[0,0,0,0])}))}}),A(Gt,"Line");class Ut extends vt{constructor(t,e=t){super(v("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Ht(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}r({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:N((function(t,e,n){return this.put(new Ut).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,i){let r=["marker"];return"all"!==t&&r.push(t),r=r.join("-"),t=arguments[1]instanceof Ut?arguments[1]:this.defs().marker(e,n,i),this.attr(r,t)}}}),A(Ut,"Marker");const $t={"-":function(t){return t},"<>":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(r){return r<0?t>0?e/t*r:n>0?i/n*r:0:r>1?n<1?(1-i)/(1-n)*r+(i-n)/(1-n):t<1?(1-e)/(1-t)*r+(e-t)/(1-t):1:3*r*(1-r)**2*e+3*r**2*(1-r)*i+r**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(i,r=!1)=>{let s=Math.floor(i*t);const o=i*s%1==0;return"start"!==e&&"both"!==e||++s,r&&o&&--s,i>=0&&s<0&&(s=0),i<=1&&s>n&&(s=n),s/n}}};class Qt{done(){return!1}}class Wt extends Qt{constructor(t=dt){super(),this.ease=$t[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class Jt extends Qt{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,i){return this.stepper(t,e,n,i)}}function Zt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,i=Math.log(e/100+1e-10),r=-i/Math.sqrt(n*n+i*i),s=3.9/(r*t);this.d=2*r*s,this.k=s*s}T(class extends Jt{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 r=i.velocity||0,s=-this.d*r-this.k*(t-e),o=t+r*n+s*n*n/2;return i.velocity=r+s*n,i.done=Math.abs(e-o)+Math.abs(r)<.002,i.done?e:o}},{duration:Ht("_duration",Zt),overshoot:Ht("_overshoot",Zt)}),T(class extends Jt{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 r=e-t;let s=(i.integral||0)+r*n;const o=(r-(i.error||0))/n,h=this._windup;return!1!==h&&(s=Math.max(-h,Math.min(s,h))),i.error=r,i.integral=s,i.done=Math.abs(r)<.001,i.done?e:t+(this.P*r+this.I*s+this.D*o)}},{windup:Ht("_windup"),p:Ht("P"),i:Ht("I"),d:Ht("D")});const Kt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},te={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]]}},ee="mlhvqtcsaz".split("");for(let t=0,e=ee.length;t<e;++t)te[ee[t]]=function(t){return function(e,n,i){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,i=e.length;t<i;++t)e[t]=e[t]+(t%2?n.y:n.x);return te[t](e,n,i)}}(ee[t].toUpperCase());function ne(t){return t.segment.length&&t.segment.length-1===Kt[t.segment[0].toUpperCase()]}function ie(t,e){t.inNumber&&re(t,!1);const n=Y.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),i=e===n;t.segment=["m"===n?i?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function re(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,ne(t)&&se(t)}function se(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return te[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function oe(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function he(t){return"E"===t.lastToken.toUpperCase()}class ue extends yt{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,i=this.length-1;i>=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 r={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;r.lastToken=i,i=t.charAt(n++);)if(r.inSegment||!ie(r,i))if("."!==i)if(isNaN(parseInt(i)))if(" "!==i&&","!==i)if("-"!==i)if("E"!==i.toUpperCase()){if(Y.test(i)){if(r.inNumber)re(r,!1);else{if(!ne(r))throw new Error("parser Error");se(r)}--n}}else r.number+=i,r.hasExponent=!0;else{if(r.inNumber&&!he(r)){re(r,!1),--n;continue}r.number+=i,r.inNumber=!0}else r.inNumber&&re(r,!1);else{if("0"===r.number||oe(r)){r.inNumber=!0,r.number=i,re(r,!0);continue}r.inNumber=!0,r.number+=i}else{if(r.pointSeen||r.hasExponent){re(r,!1),--n;continue}r.inNumber=!0,r.pointSeen=!0,r.number+=i}return r.inNumber&&re(r,!1),r.inSegment&&ne(r)&&se(r),r.segments}(t)}size(t,e){const n=this.bbox();let i,r;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(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"===r?this[i][1]=(this[i][1]-n.x)*t/n.width+n.x:"V"===r?this[i][1]=(this[i][1]-n.y)*e/n.height+n.y:"C"===r||"S"===r||"Q"===r?(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"===r&&(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"===r&&(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<i;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const ae=t=>{const e=typeof t;return"number"===e?gt:"string"===e?H.isColor(t)?H:X.test(t)?Y.test(t)?ue:yt:j.test(t)?gt:ce:me.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?yt:"object"===e?pe:ce};class le{constructor(t){this._stepper=t||new Wt("-"),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(ae(t));let e=new this._type(t);return this._type===H&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===pe&&(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 ce{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 fe{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,fe.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}fe.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const de=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class pe{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,i=e.length;n<i;++n){if(e[n+1]===t[n+1]){if(e[n+1]===H&&t[n+7]!==e[n+7]){const e=t[n+7],i=new H(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...i)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const i=(new t[n+1]).toArray(),r=e[n+2]+3;e.splice(n,r,t[n],t[n+1],t[n+2],...i),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const i=ae(t[n]),r=new i(t[n]).toArray();e.push([n,i,r.length,...r])}return e.sort(de),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),i=e.shift(),r=e.shift(),s=e.splice(0,r);t[n]=new i(s)}return t}}const me=[ce,fe,pe];class ye extends Ot{constructor(t,e=t){super(v("path",t),e)}array(){return this._array||(this._array=new ue(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 ue(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)}}ye.prototype.MorphArray=ue,r({Container:{path:N((function(t){return this.put(new ye).plot(t||new ue)}))}}),A(ye,"Path");var ge={__proto__:null,array:function(){return this._array||(this._array=new Yt(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 Yt(t))},size:function(t,e){const n=c(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class we extends Ot{constructor(t,e=t){super(v("polygon",t),e)}}r({Container:{polygon:N((function(t){return this.put(new we).plot(t||new Yt)}))}}),T(we,Bt),T(we,ge),A(we,"Polygon");class _e extends Ot{constructor(t,e=t){super(v("polyline",t),e)}}r({Container:{polyline:N((function(t){return this.put(new _e).plot(t||new Yt)}))}}),T(_e,Bt),T(_e,ge),A(_e,"Polyline");class xe extends Ot{constructor(t,e=t){super(v("rect",t),e)}}T(xe,{rx:At,ry:St}),r({Container:{rect:N((function(t,e){return this.put(new xe).size(t,e)}))}}),A(xe,"Rect");class be{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 ve={nextDraw:null,frames:new be,timeouts:new be,immediates:new be,timer:()=>y.window.performance||y.window.Date,transforms:[],frame(t){const e=ve.frames.push({run:t});return null===ve.nextDraw&&(ve.nextDraw=y.window.requestAnimationFrame(ve._draw)),e},timeout(t,e){e=e||0;const n=ve.timer().now()+e,i=ve.timeouts.push({run:t,time:n});return null===ve.nextDraw&&(ve.nextDraw=y.window.requestAnimationFrame(ve._draw)),i},immediate(t){const e=ve.immediates.push(t);return null===ve.nextDraw&&(ve.nextDraw=y.window.requestAnimationFrame(ve._draw)),e},cancelFrame(t){null!=t&&ve.frames.remove(t)},clearTimeout(t){null!=t&&ve.timeouts.remove(t)},cancelImmediate(t){null!=t&&ve.immediates.remove(t)},_draw(t){let e=null;const n=ve.timeouts.last();for(;(e=ve.timeouts.shift())&&(t>=e.time?e.run():ve.timeouts.push(e),e!==n););let i=null;const r=ve.frames.last();for(;i!==r&&(i=ve.frames.shift());)i.run(t);let s=null;for(;s=ve.immediates.shift();)s();ve.nextDraw=ve.timeouts.first()||ve.frames.first()?y.window.requestAnimationFrame(ve._draw):null}},Me=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=y.window;return(t.performance||t.Date).now()};class Ae extends lt{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(Me);let i=0;const r=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)i=r;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 s=t.persist(),o={persist:null===s?this._persist:s,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 ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=ve.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 r=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],s=n.runner;let o=i;const h=this._time-n.start;h<=0?r=!0:(h<o&&(o=h),s.active()&&(s.step(o).done?!0!==n.persist&&s.duration()-s.time()+this._time+n.persist<this._time&&(s.unschedule(),--t,--e):r=!0))}return r&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}}r({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Ae,this._timeline):(this._timeline=t,this)}}});class Se extends lt{constructor(t){super(),this.id=Se.id++,t="function"==typeof(t=null==t?ft:t)?new Jt(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof Jt,this._stepper=this._isDeclarative?t:new Wt,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new W,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,r=!1,s=0;return e=e||pt,n=n||"last","object"!=typeof(t=t||ft)||t instanceof Qt||(e=t.delay||e,n=t.when||n,r=t.swing||r,i=t.times||i,s=t.wait||s,t=t.duration||ft),{duration:t,delay:e,swing:r,times:i,wait:s,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=Se.sanitise(t,e,n),r=new Se(i.duration);return this._timeline&&r.timeline(this._timeline),this._element&&r.element(this._element),r.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new W,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 Wt(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,r=this._times,s=this._swing,o=this._reverse;let h;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(i+n))/(i+n)),r=e&&!o||!e&&o,h=Math.pow(-1,r)*(t%(i+n))/n+r;return Math.max(Math.min(h,1),0)},u=r*(i+n)-i;return h=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),h}const u=Math.floor(this.loops()),a=s&&u%2==0;return h=u+(a&&!o||o&&a?t:1-t),this.loops(h)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,i){return this._queue.push({initialiser:t||ct,runner:e||ct,retarget:n,isTransform:i,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof Ae||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const i=this.duration(),r=this._lastTime<=0&&this._time>0,s=this._lastTime<i&&this._time>=i;this._lastTime=this._time,r&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=i,this._reseted=!1;let h=!1;return(n||o)&&(this._initialise(n),this.transforms=new W,h=this._run(o?t:e),this.fire("step",this)),this.done=this.done||h&&o,s&&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;e<n;++e){const n=this._queue[e],i=this._isDeclarative||!n.initialised&&t;t=!n.finished,i&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,i=this._queue.length;n<i;++n){const i=this._queue[n],r=i.runner.call(this,t);i.finished=i.finished||!0===r,e=e&&i.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const i=this.timeline();return i&&i.play(),!0}return!1}}Se.id=0;class ke{constructor(t=new W,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}T([Se,ke],{mergeWith(t){return new ke(t.transforms.lmultiply(this.transforms),t.id)}});const Ce=(t,e)=>t.lmultiplyO(e),Te=t=>t.transforms;function Ne(){const t=this._transformationRunners.runners.map(Te).reduce(Ce,new W);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class je{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 ke).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;e<this.runners.length;++e){const n=this.runners[e];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const i=n.mergeWith(t);this.edit(t.id,i),t=i,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}r({Element:{animate(t,e,n){const i=Se.sanitise(t,e,n),r=this.timeline();return new Se(i.duration).loop(i).element(this).timeline(r.play()).schedule(i.delay,i.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Te).reduce(Ce,new W)},_addRunner(t){this._transformationRunners.add(t),ve.cancelImmediate(this._frameId),this._frameId=ve.immediate(Ne.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new je).add(new ke(new W(this))))}}}),T(Se,{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 r=new le(this._stepper).to(i),s=Object.keys(i);return this.queue((function(){r=r.from(this.element()[t](s))}),(function(e){return this.element()[t](r.at(e).valueOf()),r.done()}),(function(e){const n=Object.keys(e),o=(h=s,n.filter((t=>!h.includes(t))));var h;if(o.length){const e=this.element()[t](o),n=new pe(r.from()).valueOf();Object.assign(n,e),r.from(n)}const u=new pe(r.to()).valueOf();Object.assign(u,e),r.to(u),s=n,i=e})),this._rememberMorpher(t,r),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new le(this._stepper).to(new gt(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=W.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!i;const r=new le(this._stepper).type(n?fe:W);let s,o,h,u,a;return this.queue((function(){o=o||this.element(),s=s||f(t,o),a=new W(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:f}=new $(s).transform(o._currentTransform(this));let d=new W({...t,origin:[c,f]}),p=this._isDeclarative&&h?h:a;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))),r=Math.min(...i),s=i.indexOf(r);d.rotate=n[s]}e&&(i||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),r.from(p),r.to(d);const m=r.at(l);return u=m.rotate,h=new W(m),this.addTransform(h),o._addRunner(this),r.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=f(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",r),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 gt(e),this._tryRetarget(t,e))return this;const n=new le(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 gt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new le(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 gt(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 r=new le(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){r.from(this._element.array())}),(function(t){return this._element.plot(r.at(t)),r.done()})),this._rememberMorpher("plot",r),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,i){return this._queueObject("viewbox",new K(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)}}),T(Se,{rx:At,ry:St,from:Rt,to:Lt}),A(Se,"Runner");class Ee extends vt{constructor(t,e=t){super(v("svg",t),e),this.namespace()}defs(){return this.isRoot()?M(this.node.querySelector("defs"))||this.put(new Mt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof y.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:d,version:"1.1"}).attr("xmlns:xlink",m,p).attr("xmlns:svgjs","http://svgjs.dev/svgjs",p):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,p).attr("xmlns:svgjs",null,p)}root(){return this.isRoot()?this:super.root()}}r({Container:{nested:N((function(){return this.put(new Ee)}))}}),A(Ee,"Svg",!0);class De extends vt{constructor(t,e=t){super(v("symbol",t),e)}}r({Container:{symbol:N((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(y.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 ze extends Ot{constructor(t,e=t){super(v("text",t),e),this.dom.leading=new gt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new gt(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 r=y.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new gt(r);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",i?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new gt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let i=0,r=e.length;i<r;++i)"textPath"!==e[i].nodeName?(i!==n&&3!==e[i].nodeType&&!0===M(e[i]).dom.newLined&&(t+="\n"),t+=e[i].textContent):0===i&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}T(ze,Ie),r({Container:{text:N((function(t=""){return this.put(new ze).text(t)})),plain:N((function(t=""){return this.put(new ze).plain(t)}))}}),A(ze,"Text");class Re extends Ot{constructor(t,e=t){super(v("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof ze))return this;const e=t.index(this),n=y.window.getComputedStyle(this.node).getPropertyValue("font-size"),i=t.dom.leading*new gt(n);return this.dy(e?i:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}T(Re,Ie),r({Tspan:{tspan:N((function(t=""){const e=new Re;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),A(Re,"Tspan");class Le extends Ot{constructor(t,e=t){super(v("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new gt(t).divide(2))}}T(Le,{x:kt,y:Ct,cx:Tt,cy:Nt,width:jt,height:Et}),r({Container:{circle:N((function(t=0){return this.put(new Le).size(t).move(0,0)}))}}),A(Le,"Circle");class Pe extends vt{constructor(t,e=t){super(v("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return it("svg [clip-path*="+this.id()+"]")}}r({Container:{clip:N((function(){return this.defs().put(new Pe)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Pe?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),A(Pe,"ClipPath");class qe extends xt{constructor(t,e=t){super(v("foreignObject",t),e)}}r({Container:{foreignObject:N((function(t,e){return this.put(new qe).size(t,e)}))}}),A(qe,"ForeignObject");var Fe={__proto__:null,dmove:function(t,e){return this.children().forEach(((n,i)=>{let r;try{r=n.bbox()}catch(t){return}const s=new W(n),o=s.translate(t,e).transform(s.inverse()),h=new $(r.x,r.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,r=e-n.y;return this.dmove(i,r)},size:function(t,e,n=this.bbox()){const i=c(this,t,e,n),r=i.width/n.width,s=i.height/n.height;return this.children().forEach(((t,e)=>{const i=new $(n).transform(new W(t).inverse());t.scale(r,s,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 Ve extends vt{constructor(t,e=t){super(v("g",t),e)}}T(Ve,Fe),r({Container:{group:N((function(){return this.put(new Ve)}))}}),A(Ve,"G");class Xe extends vt{constructor(t,e=t){super(v("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,m)}}T(Xe,Fe),r({Container:{link:N((function(t){return this.put(new Xe).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 Xe,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(Xe,"A");class Ye extends vt{constructor(t,e=t){super(v("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return it("svg [mask*="+this.id()+"]")}}r({Container:{mask:N((function(){return this.defs().put(new Ye)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Ye?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),A(Ye,"Mask");class Be extends xt{constructor(t,e=t){super(v("stop",t),e)}update(t){return("number"==typeof t||t instanceof gt)&&(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 gt(t.offset)),this}}r({Gradient:{stop:function(t,e,n){return this.put(new Be).update(t,e,n)}}}),A(Be,"Stop");class Ge extends xt{constructor(t,e=t){super(v("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+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}r("Dom",{style(t,e){return this.put(new Ge).rule(t,e)},fontface(t,e,n){return this.put(new Ge).font(t,e,n)}}),A(Ge,"Style");class Ue extends ze{constructor(t,e=t){super(v("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")}}r({Container:{textPath:N((function(t,e){return t instanceof ze||(t=this.text(t)),t.path(e)}))},Text:{path:N((function(t,e=!0){const n=new Ue;let i;if(t instanceof ye||(t=this.defs().path(t)),n.attr("href","#"+t,m),e)for(;i=this.node.firstChild;)n.node.appendChild(i);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:N((function(t){return t instanceof ze||(t=(new ze).addTo(this.parent()).text(t)),t.path(this)})),targets(){return it("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Ue.prototype.MorphArray=ue,A(Ue,"TextPath");class He extends Ot{constructor(t,e=t){super(v("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}r({Container:{use:N((function(t,e){return this.put(new He).use(t,e)}))}}),A(He,"Use"),T([Ee,De,Xt,Vt,Ut],s("viewbox")),T([Gt,_e,we,ye],s("marker")),T(ze,s("Text")),T(ye,s("Path")),T(Mt,s("Defs")),T([ze,Re],s("Tspan")),T([xe,It,Ft,Se],s("radius")),T(lt,s("EventTarget")),T(_t,s("Dom")),T(xt,s("Element")),T(Ot,s("Shape")),T([vt,zt],s("Container")),T(Ft,s("Gradient")),T(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){me.push(...[].concat(t))}([gt,H,K,W,yt,Yt,ue,$]),T(me,{to(t){return(new le).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,i,r){return this.fromArray(t.map((function(t,s){return i.step(t,e[s],n,r[s],r)})))}});var $e=n(726),Qe=function(){function t(){this.domNode=(new Ee).node}return t.prototype.appendTo=function(t){t.appendChild(this.domNode)},t.prototype.remove=function(){this.domNode.remove()},t.prototype.setScaling=function(t){new $e.Scaling(this.domNode).set(t)},Object.defineProperty(t.prototype,"horizontalClientScaling",{get:function(){return new $e.HorizontalClientScaling(this.domNode).get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalClientScaling",{get:function(){return new $e.VerticalClientScaling(this.domNode).get()},enumerable:!1,configurable:!0}),t}()})(),i})()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rnacanvas/draw",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Make 2D nucleic acid structure drawings",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"webpack-cli": "^5.1.4"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@rnacanvas/draw.svg": "^
|
|
29
|
+
"@rnacanvas/draw.svg": "^2.0.1",
|
|
30
30
|
"@svgdotjs/svg.js": "^3.2.0"
|
|
31
31
|
}
|
|
32
32
|
}
|