apextree 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/apextree.es.min.js +44 -9
- package/apextree.min.js +1 -1
- package/lib/utils/GraphUtils.d.ts +1 -1
- package/lib/utils/TooltipUtils.d.ts +0 -1
- package/package.json +1 -1
package/apextree.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexTree={})}(this,(function(t){"use strict";var e=Object.defineProperty,n=(t,n,r)=>(((t,n,r)=>{n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r})(t,"symbol"!=typeof n?n+"":n,r),r);class r{constructor(t,e){this.injectedStyles=new Set,this.chartContainer=null,this.instanceId=e||Math.random().toString(36).substr(2,9),this.context=this.detectContext(t),this.chartContainer=t}getChartContainer(){return this.chartContainer}getChartScopedContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.chartContainer||this.context}detectContext(t){const e=t.getRootNode();return e instanceof ShadowRoot?e:document}getContext(){return this.context}getInstanceId(){return this.instanceId}isShadowDOM(){return this.context instanceof ShadowRoot}createElement(t){return document.createElement(t)}createElementNS(t,e){return document.createElementNS(t,e)}createTextNode(t){return document.createTextNode(t)}getElementById(t){return this.context===document?document.getElementById(t):this.context.querySelector(`#${t}`)}getElementsByClassName(t){if(this.context===document)return document.getElementsByClassName(t);const e=this.context.querySelectorAll(`.${t}`),n=Array.from(e);return{item:t=>n[t]||null,get length(){return n.length},[Symbol.iterator]:()=>n[Symbol.iterator](),...Object.fromEntries(n.map(((t,e)=>[e,t])))}}querySelector(t){return this.context.querySelector(t)}querySelectorAll(t){return this.context.querySelectorAll(t)}getAppendContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.context}getChartBounds(){var t;return(null==(t=this.chartContainer)?void 0:t.getBoundingClientRect())||new DOMRect}getBody(){if(this.context===document)return document.body||document.getElementsByTagName("body")[0];return this.context.host}dispatchEvent(t){this.context===document?document.dispatchEvent(t):this.context.dispatchEvent(t)}addEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.addEventListener(t,e,n):this.context.addEventListener(t,e,n)}removeEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.removeEventListener(t,e,n):this.context.removeEventListener(t,e,n)}injectStyles(t,e,n={}){const{force:r=!1,priority:i="normal"}=n;if(!r&&this.injectedStyles.has(e))return;if(r){const t=this.context.querySelector(`#${e}`);t&&(t.remove(),this.injectedStyles.delete(e))}if(this.context.querySelector(`#${e}`)&&!r)return void this.injectedStyles.add(e);const s=document.createElement("style");if(s.id=e,s.textContent=t,"normal"!==i&&s.setAttribute("data-priority",i),this.context===document)document.head.appendChild(s);else{const t=this.context;"high"===i?t.insertBefore(s,t.firstChild):t.appendChild(s)}this.injectedStyles.add(e)}injectStylesheets(t){t.forEach((({content:t,id:e,options:n})=>{this.injectStyles(t,e,n)}))}hasInjectedStyles(t){return this.injectedStyles.has(t)}removeStyles(t){const e=this.context.querySelector(`#${t}`);e&&(e.remove(),this.injectedStyles.delete(t))}removeAllStyles(){this.injectedStyles.forEach((t=>{const e=this.context.querySelector(`#${t}`);e&&e.remove()})),this.injectedStyles.clear()}getInjectedStyleIds(){return Array.from(this.injectedStyles)}getActiveElement(){if(this.context===document)return document.activeElement;return this.context.activeElement||document.activeElement}destroy(){this.removeAllStyles(),this.injectedStyles.clear()}}class i{constructor(t,e){if(!t)throw new Error("Container element is required");this.element=t,this.chartContext=new r(t,e)}getContext(){return this.chartContext}isShadowDOM(){return this.chartContext.isShadowDOM()}getTooltipContainer(){return this.chartContext.getAppendContainer()}injectStyles(t,e){this.chartContext.injectStyles(t,e)}createElement(t){return this.chartContext.createElement(t)}querySelector(t){return this.chartContext.querySelector(t)}addEventListener(t,e,n){this.chartContext.addEventListener(t,e,n)}removeEventListener(t,e,n){this.chartContext.removeEventListener(t,e,n)}dispatchEvent(t){this.chartContext.dispatchEvent(t)}destroy(){this.chartContext.destroy()}getInstanceId(){return this.chartContext.getInstanceId()}}function s(){}class o{constructor(t,e="apex"){this.canvas=t,this.prefix=e}getSvgString(){return this.canvas.svg().replace(/(<img [\w\W]+?)(>)/g,"$1 />").replace(/(<br)(>)/g,"$1 />").replace(/(<hr)(>)/g,"$1 />")}svgUrl(){const t=this.getSvgString(),e=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)}triggerDownload(t,e){const n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}exportToSVG(){this.triggerDownload(this.svgUrl(),`${this.prefix}-${(new Date).getTime()}.svg`)}}const h=class{static decodeLicenseData(t){try{const e=window.atob(t),n=JSON.parse(e);return n.issueDate&&n.expiryDate&&n.plan?{expiryDate:n.expiryDate,issueDate:n.issueDate,plan:n.plan,valid:!0}:null}catch{return null}}static generateLicenseKey(t,e,n="standard"){const r={expiryDate:e,issueDate:t,plan:n};return`APEX-${window.btoa(JSON.stringify(r))}`}static getLicenseStatus(){return this.licenseKey?(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult):{expired:!1,valid:!1}}static isLicenseValid(){return!!this.licenseKey&&(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult.valid)}static setLicense(t){this.licenseKey=t,this.validationResult=this.validateLicense(t),this.validationResult.valid||console.error(`[Apex] ${this.validationResult.message}`)}static validateLicense(t){try{if(!t.startsWith("APEX-"))return{expired:!1,message:'Invalid license key format. License key must start with "APEX-".',valid:!1};const e=t.split("-");if(2!==e.length)return{expired:!1,message:"Invalid license key format. Expected format: APEX-{encoded-data}.",valid:!1};const n=e[1],r=this.decodeLicenseData(n);if(!r)return{expired:!1,message:"Invalid license key. Unable to decode license data.",valid:!1};const i=new Date;return new Date(r.expiryDate)<i?{data:r,expired:!0,message:`License expired on ${r.expiryDate}. Please renew your license.`,valid:!1}:{data:r,expired:!1,valid:!0}}catch{return{expired:!1,message:"Invalid license key format or corrupted data.",valid:!1}}}};h.licenseKey=null,h.validationResult=null;let a=h;const u={},l=[];function c(t,e){if(Array.isArray(t))for(const n of t)c(n,e);else if("object"!=typeof t)f(Object.getOwnPropertyNames(e)),u[t]=Object.assign(u[t]||{},e);else for(const n in t)c(n,t[n])}function d(t){return u[t]||{}}function f(t){l.push(...t)}function p(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function m(t){return t%360*Math.PI/180}function g(t){return t.charAt(0).toUpperCase()+t.slice(1)}function y(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function w(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:h,y:a}=e.bbox();s&&(r=r.includes("left")?h:r.includes("right")?h+n:h+n/2),o&&(i=i.includes("top")?a:i.includes("bottom")?a+t:a+t/2)}return[r,i]}const b=new Set(["desc","metadata","title"]),x=t=>b.has(t.nodeName),v=(t,e,n={})=>{const r={...e};for(const i in r)r[i].valueOf()===n[i]&&delete r[i];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},_="http://www.w3.org/2000/svg",E="http://www.w3.org/2000/xmlns/",C="http://www.w3.org/1999/xlink",O={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};let M=class{};const k={},S="___SYMBOL___ROOT___";function N(t,e=_){return O.document.createElementNS(e,t)}function A(t,e=!1){if(t instanceof M)return t;if("object"==typeof t)return I(t);if(null==t)return new k[S];if("string"==typeof t&&"<"!==t.charAt(0))return I(O.document.querySelector(t));const n=e?O.document.createElement("div"):N("svg");return n.innerHTML=t,t=I(n.firstChild),n.removeChild(n.firstChild),t}function T(t,e){return e&&(e instanceof O.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:N(t)}function j(t){if(!t)return null;if(t.instance instanceof M)return t.instance;if("#document-fragment"===t.nodeName)return new k.Fragment(t);let e=g(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":k[e]||(e="Dom"),new k[e](t)}let I=j;function L(t,e=t.name,n=!1){return k[e]=t,n&&(k[S]=t),f(Object.getOwnPropertyNames(t.prototype)),t}let R=1e3;function P(t){return"Svgjs"+g(t)+R++}function D(t){for(let e=t.children.length-1;e>=0;e--)D(t.children[e]);return t.id?(t.id=P(t.nodeName),t):t}function z(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function F(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)}}c("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=A(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=A(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=A(t)).before(this),this},insertAfter:function(t){return(t=A(t)).after(this),this}});const $=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,Y=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,X=/rgb\((\d+),(\d+),(\d+)\)/,G=/(#[a-z_][a-z0-9\-_]*)/i,q=/\)\s*,?\s*/,B=/\s/g,V=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,W=/^rgb\(/,H=/^(\s+)?$/,Z=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,U=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Q=/[\s,]+/,K=/[MLHVCSQTAZ]/i;function J(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function tt(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function et(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}c("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Q)},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)}}),c("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=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||H.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||H.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),c("Dom",{data:function(t,e,n){if(null==t)return this.data(p(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(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(r){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}}),c("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);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||{}}});let nt=class t{constructor(...t){this.init(...t)}static isColor(e){return e&&(e instanceof t||this.isRgb(e)||this.test(e))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(e="vibrant",n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===e){const e=24*r()+57,n=38*r()+45,i=360*r();return new t(e,n,i,"lch")}if("sine"===e){const e=i(80*s(2*o*(n=null==n?r():n)/.5+.01)+150),h=i(50*s(2*o*n/.5+4.6)+200),a=i(100*s(2*o*n/.5+2.3)+150);return new t(e,h,a)}if("pastel"===e){const e=8*r()+86,n=17*r()+9,i=360*r();return new t(e,n,i,"lch")}if("dark"===e){const e=10+10*r(),n=50*r()+86,i=360*r();return new t(e,n,i,"lch")}if("rgb"===e){const e=255*r(),n=255*r(),i=255*r();return new t(e,n,i)}if("lab"===e){const e=100*r(),n=256*r()-128,i=256*r()-128;return new t(e,n,i,"lab")}if("grey"===e){const e=255*r();return new t(e,e,e)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(V.test(t)||W.test(t))}cmyk(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),h=Math.min(1-i,1-s,1-o);if(1===h)return new t(0,0,0,1,"cmyk");return new t((1-i-h)/(1-h),(1-s-h)/(1-h),(1-o-h)/(1-h),h,"cmyk")}hsl(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),h=Math.max(i,s,o),a=Math.min(i,s,o),u=(h+a)/2,l=h===a,c=h-a;return new t(360*(l?0:h===i?((s-o)/c+(s<o?6:0))/6:h===s?((o-i)/c+2)/6:h===o?((i-s)/c+4)/6:0),100*(l?0:u>.5?c/(2-h-a):c/(h+a)),100*u,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const c in this.space)delete this[this.space[c]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});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=tt(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:tt(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:tt(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:tt(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:tt(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:tt(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(W.test(t)){const e=t.replace(B,""),[n,r,i]=X.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!V.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=Y.exec((s=t,4===s.length?["#",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(""):s)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var s;const{_a:o,_b:h,_c:a,_d:u}=this,l="rgb"===this.space?{r:o,g:h,b:a}:"xyz"===this.space?{x:o,y:h,z:a}:"hsl"===this.space?{h:o,s:h,l:a}:"lab"===this.space?{l:o,a:h,b:a}:"lch"===this.space?{l:o,c:h,h:a}:"cmyk"===this.space?{c:o,m:h,y:a,k:u}:{};Object.assign(this,l)}lab(){const{x:e,y:n,z:r}=this.xyz();return new t(116*n-16,500*(e-n),200*(n-r),"lab")}lch(){const{l:e,a:n,b:r}=this.lab(),i=Math.sqrt(n**2+r**2);let s=180*Math.atan2(r,n)/Math.PI;s<0&&(s*=-1,s=360-s);return new t(e,i,s,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(e=this.space)||"xyz"===e||"lch"===e){let{x:e,y:n,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:t,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(t+16)/116,h=i/500+o,a=o-s/200,u=16/116,l=.008856,c=7.787;e=.95047*(h**3>l?h**3:(h-u)/c),n=1*(o**3>l?o**3:(o-u)/c),r=1.08883*(a**3>l?a**3:(a-u)/c)}const i=3.2406*e+-1.5372*n+-.4986*r,s=-.9689*e+1.8758*n+.0415*r,o=.0557*e+-.204*n+1.057*r,h=Math.pow,a=.0031308,u=i>a?1.055*h(i,1/2.4)-.055:12.92*i,l=s>a?1.055*h(s,1/2.4)-.055:12.92*s,c=o>a?1.055*h(o,1/2.4)-.055:12.92*o;return new t(255*u,255*l,255*c)}if("hsl"===this.space){let{h:e,s:n,l:r}=this;if(e/=360,n/=100,r/=100,0===n){r*=255;return new t(r,r,r)}const i=r<.5?r*(1+n):r+n-r*n,s=2*r-i,o=255*et(s,i,e+1/3),h=255*et(s,i,e),a=255*et(s,i,e-1/3);return new t(o,h,a)}if("cmyk"===this.space){const{c:e,m:n,y:r,k:i}=this,s=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,n*(1-i)+i)),h=255*(1-Math.min(1,r*(1-i)+i));return new t(s,o,h)}return this;var e}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(J);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),h=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,l=(.4124*h+.3576*a+.1805*u)/.95047,c=(.2126*h+.7152*a+.0722*u)/1,d=(.0193*h+.1192*a+.9505*u)/1.08883,f=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,m=d>.008856?Math.pow(d,1/3):7.787*d+16/116;return new t(f,p,m,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}},rt=class t{constructor(...t){this.init(...t)}clone(){return new t(this)}init(t,e){const n=0,r=0,i=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==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){st.isMatrixLike(t)||(t=new st(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 it(t,e,n){return Math.abs(e-t)<1e-6}let st=class t{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,r=t.flip&&(e||"y"===t.flip)?-1:1,i=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]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,a=t.shear||0,u=t.rotate||t.theta||0,l=new rt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,d=l.y,f=new rt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new rt(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,w=g.y,b=new rt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:h,skewX:i,skewY:s,shear:a,theta:u,rx:b.x,ry:b.y,tx:y,ty:w,ox:c,oy:d,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 r=t.a*e.a+t.c*e.b,i=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,a=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=h,n.f=a,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new t(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,h=this.f,a=n*s-r*i,u=a>0?1:-1,l=u*Math.sqrt(n*n+r*r),c=Math.atan2(u*r,u*n),d=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/a,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*l+e*(m*f*l-p*g),translateY:h-e+t*p*l+e*(m*p*l+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;const n=new t(e);return it(this.a,n.a)&&it(this.b,n.b)&&it(this.c,n.c)&&it(this.d,n.d)&&it(this.e,n.e)&&it(this.f,n.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(e){const n=t.fromArray([1,0,0,1,0,0]);return e=e instanceof At?e.matrixify():"string"==typeof e?t.fromArray(e.split(Q).map(parseFloat)):Array.isArray(e)?t.fromArray(e):"object"==typeof e&&t.isMatrixLike(e)?e:"object"==typeof e?(new t).transform(e):6===arguments.length?t.fromArray([].slice.call(arguments)):n,this.a=null!=e.a?e.a:n.a,this.b=null!=e.b?e.b:n.b,this.c=null!=e.c?e.c:n.c,this.d=null!=e.d?e.d:n.d,this.e=null!=e.e?e.e:n.e,this.f=null!=e.f?e.f:n.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const h=r/o,a=-e/o,u=-n/o,l=t/o,c=-(h*i+u*s),d=-(a*i+l*s);return this.a=h,this.b=a,this.c=u,this.d=l,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(e){const n=e instanceof t?e:new t(e);return t.matrixMultiply(n,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(e){const n=e instanceof t?e:new t(e);return t.matrixMultiply(this,n,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=m(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:h,d:a,e:u,f:l}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=h*r-a*i,this.d=a*r+h*i,this.e=u*r-l*i+n*i-e*r+e,this.f=l*r+u*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:h,e:a,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=h*e,this.e=a*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:h,f:a}=this;return this.a=r+i*t,this.c=s+o*t,this.e=h+a*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=m(t),e=m(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:h,c:a,d:u,e:l,f:c}=this;return this.a=o+h*i,this.b=h+o*s,this.c=a+u*i,this.d=u+a*s,this.e=l+c*i-r*i,this.f=c+l*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(e){if(t.isMatrixLike(e)){return new t(e).multiplyO(this)}const n=t.formatTransforms(e),{x:r,y:i}=new rt(n.ox,n.oy).transform(this),s=(new t).translateO(n.rx,n.ry).lmultiplyO(this).translateO(-r,-i).scaleO(n.scaleX,n.scaleY).skewO(n.skewX,n.skewY).shearO(n.shear).rotateO(n.theta).translateO(r,i);if(isFinite(n.px)||isFinite(n.py)){const t=new rt(r,i).transform(s),e=isFinite(n.px)?n.px-t.x:0,o=isFinite(n.py)?n.py-t.y:0;s.translateO(e,o)}return s.translateO(n.tx,n.ty),s}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}};function ot(){if(!ot.nodes){const t=A().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;ot.nodes={svg:t,path:e}}if(!ot.nodes.svg.node.parentNode){const t=O.document.body||O.document.documentElement;ot.nodes.svg.addTo(t)}return ot.nodes}function ht(t){return!(t.width||t.height||t.x||t.y)}L(st,"Matrix");let at=class t{constructor(...t){this.init(...t)}addOffset(){return this.x+=O.window.pageXOffset,this.y+=O.window.pageYOffset,new t(this)}init(t){return t="string"==typeof t?t.split(Q).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 ht(this)}merge(e){const n=Math.min(this.x,e.x),r=Math.min(this.y,e.y),i=Math.max(this.x+this.width,e.x+e.width)-n,s=Math.max(this.y+this.height,e.y+e.height)-r;return new t(n,r,i,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof st||(e=new st(e));let n=1/0,r=-1/0,i=1/0,s=-1/0;return[new rt(this.x,this.y),new rt(this.x2,this.y),new rt(this.x,this.y2),new rt(this.x2,this.y2)].forEach((function(t){t=t.transform(e),n=Math.min(n,t.x),r=Math.max(r,t.x),i=Math.min(i,t.y),s=Math.max(s,t.y)})),new t(n,i,r-n,s-i)}};function ut(t,e,n){let r;try{if(r=e(t.node),ht(r)&&((i=t.node)!==O.document&&!(O.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===O.document}).call(O.document.documentElement,i)))throw new Error("Element not in the dom")}catch(s){r=n(t)}var i;return r}c({viewbox:{viewbox(t,e,n,r){return null==t?new at(this.attr("viewBox")):this.attr("viewBox",new at(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,h=Math.min(s,o);if(null==t)return h;let a=h/t;a===1/0&&(a=Number.MAX_SAFE_INTEGER/100),e=e||new rt(n/2/s+i.x,r/2/o+i.y);const u=new at(i).transform(new st({scale:a,origin:e}));return this.viewbox(u)}}}),L(at,"Box");let lt=class extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}};z([lt],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const ct=["toArray","constructor","each"];function dt(t,e){return new lt(p((e||O.document).querySelectorAll(t),(function(t){return j(t)})))}lt.extend=function(t){t=t.reduce(((t,e)=>(ct.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),z([lt],t)};let ft=0;const pt={};function mt(t){let e=t.getEventHolder();return e===O.window&&(e=pt),e.events||(e.events={}),e.events}function gt(t){return t.getEventTarget()}function yt(t,e,n,r,i){const s=n.bind(r||t),o=A(t),h=mt(o),a=gt(o);e=Array.isArray(e)?e:e.split(Q),n._svgjsListenerId||(n._svgjsListenerId=++ft),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";h[e]=h[e]||{},h[e][r]=h[e][r]||{},h[e][r][n._svgjsListenerId]=s,a.addEventListener(e,s,i||!1)}))}function wt(t,e,n,r){const i=A(t),s=mt(i),o=gt(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Q)).forEach((function(t){const e=t&&t.split(".")[0],h=t&&t.split(".")[1];let a,u;if(n)s[e]&&s[e][h||"*"]&&(o.removeEventListener(e,s[e][h||"*"][n],r||!1),delete s[e][h||"*"][n]);else if(e&&h){if(s[e]&&s[e][h]){for(u in s[e][h])wt(o,[e,h].join("."),u);delete s[e][h]}}else if(h)for(t in s)for(a in s[t])h===a&&wt(o,[t,h].join("."));else if(e){if(s[e]){for(a in s[e])wt(o,[e,a].join("."));delete s[e]}}else{for(t in s)wt(o,t);!function(t){let e=t.getEventHolder();e===O.window&&(e=pt),e.events&&(e.events={})}(i)}}))}let bt=class extends M{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=gt(t);return e instanceof O.window.Event||(e=new O.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.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 r in n)for(const e in n[r])n[r][e](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 wt(this,t,e,n),this}on(t,e,n,r){return yt(this,t,e,n,r),this}removeEventListener(){}};function xt(){}L(bt,"EventTarget");const vt=400,_t=">",Et=0,Ct={"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"};let Ot=class 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(Q).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}},Mt=class t{constructor(...t){this.init(...t)}convert(e){return new t(this.value,e)}divide(e){return e=new t(e),new t(this/e,this.unit||e.unit)}init(e,n){return n=Array.isArray(e)?e[1]:n,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=n||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(n=e.match($))&&(this.value=parseFloat(n[1]),"%"===n[5]?this.value/=100:"s"===n[5]&&(this.value*=1e3),this.unit=n[5]):e instanceof t&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new t(e),new t(this-e,this.unit||e.unit)}plus(e){return e=new t(e),new t(this+e,this.unit||e.unit)}times(e){return e=new t(e),new t(this*e,this.unit||e.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 kt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),St=[];let Nt=class t extends bt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=A(t)).removeNamespace&&this.node instanceof O.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 A(t).put(this,e)}children(){return new lt(p(this.node.children,(function(t){return j(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=D(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(e,n){return this.put(new t(N(e),n))}first(){return j(this.node.firstChild)}get(t){return j(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=P(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return j(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=j(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=j(e.node.parentNode));return e}put(t,e){return t=A(t),this.add(t,e),t}putIn(t,e){return A(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=A(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const i in r)"number"==typeof r[i]&&(r[i]=Math.round(r[i]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,_)}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=j(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 r=N("wrapper",n),i=O.document.createDocumentFragment();r.innerHTML=t;for(let o=r.children.length;o--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}};z(Nt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=Z.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))?Ct[t]:Z.test(e)?parseFloat(e):e;"number"==typeof(e=St.reduce(((e,n)=>n(t,e,this)),e))?e=new Mt(e):kt.has(t)&&nt.isColor(e)?e=new nt(e):e.constructor===Array&&(e=new Ot(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 dt(t,this.node)},findOne:function(t){return j(this.node.querySelector(t))}}),L(Nt,"Dom");let At=class extends Nt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??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 Mt(t).plus(this.x()))}dy(t=0){return this.y(new Mt(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=A(t));const n=new lt;let r=this;for(;(r=r.parent())&&r.node!==O.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(G);return e?A(e[1]):null}root(){const t=this.parent(k[S]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=y(this,t,e);return this.width(new Mt(n.width)).height(new Mt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return v(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}};z(At,{bbox:function(){const t=ut(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(ot().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 at(t)},rbox:function(t){const e=ut(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new at(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 rt(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new st(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new st(e)}return new st(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new st}}}),L(At,"Element");const Tt={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 nt||nt.isRgb(e)||e instanceof At)this.attr(t,e);else for(n=Tt[t].length-1;n>=0;n--)null!=e[Tt[t][n]]&&this.attr(Tt.prefix(t,Tt[t][n]),e[Tt[t][n]]);return this},c(["Element","Runner"],e)})),c(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new st(this):this.attr("transform",new st(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!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)}}),c("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Mt(t)):this.rx(t).ry(e)}}),c("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new rt(this.node.getPointAtLength(t))}}),c(["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)}});c("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),c("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(q).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(Q).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(st.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new st)},toParent:function(t,e){if(this===t)return this;if(x(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.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 st(this).decompose();return null==t?e:e[t]}st.isMatrixLike(t)||(t={...t,origin:w(t,this)});const n=new st(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});let jt=class t extends At{flatten(){return this.each((function(){if(this instanceof t)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,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}};L(jt,"Container");let It=class extends jt{constructor(t,e=t){super(T("defs",t),e)}flatten(){return this}ungroup(){return this}};L(It,"Defs");let Lt=class extends At{};function Rt(t){return this.attr("rx",t)}function Pt(t){return this.attr("ry",t)}function Dt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function zt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Ft(t){return this.attr("cx",t)}function $t(t){return this.attr("cy",t)}function Yt(t){return null==t?2*this.rx():this.rx(new Mt(t).divide(2))}function Xt(t){return null==t?2*this.ry():this.ry(new Mt(t).divide(2))}L(Lt,"Shape");const Gt=Object.freeze(Object.defineProperty({__proto__:null,cx:Ft,cy:$t,height:Xt,rx:Rt,ry:Pt,width:Yt,x:Dt,y:zt},Symbol.toStringTag,{value:"Module"}));let qt=class extends Lt{constructor(t,e=t){super(T("ellipse",t),e)}size(t,e){const n=y(this,t,e);return this.rx(new Mt(n.width).divide(2)).ry(new Mt(n.height).divide(2))}};z(qt,Gt),c("Container",{ellipse:F((function(t=0,e=t){return this.put(new qt).size(t,e).move(0,0)}))}),L(qt,"Ellipse");let Bt=class extends Nt{constructor(t=O.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 Nt(N("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}};function Vt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Mt(t),fy:new Mt(e)}):this.attr({x1:new Mt(t),y1:new Mt(e)})}function Wt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Mt(t),cy:new Mt(e)}):this.attr({x2:new Mt(t),y2:new Mt(e)})}L(Bt,"Fragment");const Ht=Object.freeze(Object.defineProperty({__proto__:null,from:Vt,to:Wt},Symbol.toStringTag,{value:"Module"}));let Zt=class extends jt{constructor(t,e){super(T(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 at}targets(){return dt("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()+")"}};z(Zt,Ht),c({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:F((function(t,e){return this.put(new Zt(t)).update(e)}))}}),L(Zt,"Gradient");let Ut=class extends jt{constructor(t,e=t){super(T("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new at}targets(){return dt("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({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:F((function(t,e,n){return this.put(new Ut).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),L(Ut,"Pattern");let Qt=class extends Lt{constructor(t,e=t){super(T("image",t),e)}load(t,e){if(!t)return this;const n=new O.window.Image;return yt(n,"load",(function(t){const r=this.parent(Ut);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof Ut&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),yt(n,"load error",(function(){wt(n)})),this.attr("href",n.src=t,C)}};var Kt;Kt=function(t,e,n){return"fill"!==t&&"stroke"!==t||U.test(e)&&(e=n.root().defs().image(e)),e instanceof Qt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},St.push(Kt),c({Container:{image:F((function(t,e){return this.put(new Qt).size(0,0).load(t,e)}))}}),L(Qt,"Image");let Jt=class extends Ot{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new at(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(Q).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.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){st.isMatrixLike(t)||(t=new st(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}};const te=Jt;const ee=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:te,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},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)}},Symbol.toStringTag,{value:"Module"}));let ne=class extends Lt{constructor(t,e=t){super(T("line",t),e)}array(){return new Jt([[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,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Jt(t).toLine(),this.attr(t))}size(t,e){const n=y(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}};z(ne,ee),c({Container:{line:F((function(...t){return ne.prototype.plot.apply(this.put(new ne),null!=t[0]?t:[0,0,0,0])}))}}),L(ne,"Line");let re=class extends jt{constructor(t,e=t){super(T("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 ie(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}c({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:F((function(t,e,n){return this.put(new re).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof re?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),L(re,"Marker");const se={"-":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,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};let oe=class{done(){return!1}},he=class extends oe{constructor(t=_t){super(),this.ease=se[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}},ae=class extends oe{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}};function ue(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}z(class extends ae{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:ie("_duration",ue),overshoot:ie("_overshoot",ue)});z(class extends ae{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,h=this._windup;return!1!==h&&(s=Math.max(-h,Math.min(s,h))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:ie("_windup"),p:ie("P"),i:ie("I"),d:ie("D")});const le={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ce={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]]}},de="mlhvqtcsaz".split("");for(let Mu=0,ku=de.length;Mu<ku;++Mu)ce[de[Mu]]=function(t){return function(e,n,r){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 ce[t](e,n,r)}}(de[Mu].toUpperCase());function fe(t){return t.segment.length&&t.segment.length-1===le[t.segment[0].toUpperCase()]}function pe(t,e){t.inNumber&&me(t,!1);const n=K.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function me(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,fe(t)&&ge(t)}function ge(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return ce[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function ye(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 we(t){return"E"===t.lastToken.toUpperCase()}const be=new Set([" ",",","\t","\n","\r","\f"]);let xe=class extends Ot{bbox(){return ot().path.setAttribute("d",this.toString()),new at(ot.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=t,this[i][2]+=e):"H"===r?this[i][1]+=t:"V"===r?this[i][1]+=e:"C"===r||"S"===r||"Q"===r?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===r&&(this[i][5]+=t,this[i][6]+=e)):"A"===r&&(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,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new rt,p:new rt};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!pe(i,r))if("."!==r)if(isNaN(parseInt(r)))if(be.has(r))i.inNumber&&me(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(K.test(r)){if(i.inNumber)me(i,!1);else{if(!fe(i))throw new Error("parser Error");ge(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!we(i)){me(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||ye(i)){i.inNumber=!0,i.number=r,me(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){me(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&me(i,!1),i.inSegment&&fe(i)&&ge(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;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 ve=t=>{const e=typeof t;return"number"===e?Mt:"string"===e?nt.isColor(t)?nt:Q.test(t)?K.test(t)?xe:Ot:$.test(t)?Mt:Ee:ke.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Ot:"object"===e?Me:Ee};let _e=class{constructor(t){this._stepper=t||new he("-"),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(ve(t));let e=new this._type(t);return this._type===nt&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Me&&(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}},Ee=class{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}},Ce=class t{constructor(...t){this.init(...t)}init(e){return Array.isArray(e)&&(e={scaleX:e[0],scaleY:e[1],shear:e[2],rotate:e[3],translateX:e[4],translateY:e[5],originX:e[6],originY:e[7]}),Object.assign(this,t.defaults,e),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}};Ce.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Oe=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;let Me=class{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===nt&&t[n+7]!==e[n+7]){const e=t[n+7],r=new nt(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),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 r=ve(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(Oe),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(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}};const ke=[Ee,Ce,Me];let Se=class extends Lt{constructor(t,e=t){super(T("path",t),e)}array(){return this._array||(this._array=new xe(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 xe(t))}size(t,e){const n=y(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)}};Se.prototype.MorphArray=xe,c({Container:{path:F((function(t){return this.put(new Se).plot(t||new xe)}))}}),L(Se,"Path");const Ne=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new Jt(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 Jt(t))},size:function(t,e){const n=y(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));let Ae=class extends Lt{constructor(t,e=t){super(T("polygon",t),e)}};c({Container:{polygon:F((function(t){return this.put(new Ae).plot(t||new Jt)}))}}),z(Ae,ee),z(Ae,Ne),L(Ae,"Polygon");let Te=class extends Lt{constructor(t,e=t){super(T("polyline",t),e)}};c({Container:{polyline:F((function(t){return this.put(new Te).plot(t||new Jt)}))}}),z(Te,ee),z(Te,Ne),L(Te,"Polyline");let je=class extends Lt{constructor(t,e=t){super(T("rect",t),e)}};z(je,{rx:Rt,ry:Pt}),c({Container:{rect:F((function(t,e){return this.put(new je).size(t,e)}))}}),L(je,"Rect");let Ie=class{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 Le={nextDraw:null,frames:new Ie,timeouts:new Ie,immediates:new Ie,timer:()=>O.window.performance||O.window.Date,transforms:[],frame(t){const e=Le.frames.push({run:t});return null===Le.nextDraw&&(Le.nextDraw=O.window.requestAnimationFrame(Le._draw)),e},timeout(t,e){e=e||0;const n=Le.timer().now()+e,r=Le.timeouts.push({run:t,time:n});return null===Le.nextDraw&&(Le.nextDraw=O.window.requestAnimationFrame(Le._draw)),r},immediate(t){const e=Le.immediates.push(t);return null===Le.nextDraw&&(Le.nextDraw=O.window.requestAnimationFrame(Le._draw)),e},cancelFrame(t){null!=t&&Le.frames.remove(t)},clearTimeout(t){null!=t&&Le.timeouts.remove(t)},cancelImmediate(t){null!=t&&Le.immediates.remove(t)},_draw(t){let e=null;const n=Le.timeouts.last();for(;(e=Le.timeouts.shift())&&(t>=e.time?e.run():Le.timeouts.push(e),e!==n););let r=null;const i=Le.frames.last();for(;r!==i&&(r=Le.frames.shift());)r.run(t);let s=null;for(;s=Le.immediates.shift();)s();Le.nextDraw=Le.timeouts.first()||Le.frames.first()?O.window.requestAnimationFrame(Le._draw):null}},Re=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Pe=function(){const t=O.window;return(t.performance||t.Date).now()};let De=class extends bt{constructor(t=Pe){super(),this._timeSource=t,this.terminate()}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(Re);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+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 Le.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Le.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let s=this._runners.length;s--;){const t=this._runners[s],e=t.runner;this._time-t.start<=0&&e.reset()}let i=!1;for(let s=0,o=this._runners.length;s<o;s++){const t=this._runners[s],e=t.runner;let n=r;const h=this._time-t.start;if(h<=0){i=!0;continue}if(h<n&&(n=h),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--s,--o)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){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)}};c({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new De,this._timeline):(this._timeline=t,this)}}});let ze=class t extends bt{constructor(e){super(),this.id=t.id++,e="function"==typeof(e=null==e?vt:e)?new ae(e):e,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof e&&e,this._isDeclarative=e instanceof ae,this._stepper=this._isDeclarative?e:new he,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new st,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 r=1,i=!1,s=0;return e=e??Et,n=n||"last","object"!=typeof(t=t??vt)||t instanceof oe||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,s=t.wait??s,t=t.duration??vt),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(e,n,r){const i=t.sanitise(e,n,r),s=new t(i.duration);return this._timeline&&s.timeline(this._timeline),this._element&&s.element(this._element),s.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new st,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 he(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,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let h;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,h=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(h,1),0)},a=i*(r+n)-r;return h=e<=0?Math.round(t(1e-5)):e<a?t(e):Math.round(t(a-1e-5)),h}const a=Math.floor(this.loops()),u=s&&a%2==0;return h=a+(u&&!o||o&&u?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,r){this._queue.push({initialiser:t||xt,runner:e||xt,retarget:n,isTransform:r,initialised:!1,finished:!1});return 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 De||(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 r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let h=!1;return(n||o)&&(this._initialise(n),this.transforms=new st,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],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&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,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.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 r=this.timeline();return r&&r.play(),!0}return!1}};ze.id=0;let Fe=class{constructor(t=new st,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}};z([ze,Fe],{mergeWith(t){return new Fe(t.transforms.lmultiply(this.transforms),t.id)}});const $e=(t,e)=>t.lmultiplyO(e),Ye=t=>t.transforms;function Xe(){const t=this._transformationRunners.runners.map(Ye).reduce($e,new st);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}let Ge=class{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 Fe).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))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}};c({Element:{animate(t,e,n){const r=ze.sanitise(t,e,n),i=this.timeline();return new ze(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.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(Ye).reduce($e,new st)},_addRunner(t){this._transformationRunners.add(t),Le.cancelImmediate(this._frameId),this._frameId=Le.immediate(Xe.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ge).add(new Fe(new st(this))))}}});z(ze,{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 r=e;if(this._tryRetarget(t,r))return this;let i=new _e(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.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 Me(i.from()).valueOf();Object.assign(n,e),i.from(n)}const a=new Me(i.to()).valueOf();Object.assign(a,e),i.to(a),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new _e(this._stepper).to(new Mt(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,r){e=r,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 r=st.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new _e(this._stepper).type(n?Ce:st);let s,o,h,a,u;return this.queue((function(){o=o||this.element(),s=s||w(t,o),u=new st(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:d}=new rt(s).transform(o._currentTransform(this));let f=new st({...t,origin:[c,d]}),p=this._isDeclarative&&h?h:u;if(n){f=f.decompose(c,d),p=p.decompose(c,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);f.rotate=n[s]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&a&&(p.rotate=a)),i.from(p),i.to(f);const m=i.at(l);return a=m.rotate,h=new st(m),this.addTransform(h),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=w(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",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 Mt(e),this._tryRetarget(t,e))return this;const n=new _e(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new Mt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new _e(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 Mt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(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,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new _e(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new at(t,e,n,r))},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)}}),z(ze,{rx:Rt,ry:Pt,from:Vt,to:Wt}),L(ze,"Runner");let qe=class extends jt{constructor(t,e=t){super(T("svg",t),e),this.namespace()}defs(){return this.isRoot()?j(this.node.querySelector("defs"))||this.put(new It):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof O.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:_,version:"1.1"}).attr("xmlns:xlink",C,E):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,E).attr("xmlns:svgjs",null,E)}root(){return this.isRoot()?this:super.root()}};c({Container:{nested:F((function(){return this.put(new qe)}))}}),L(qe,"Svg",!0);let Be=class extends jt{constructor(t,e=t){super(T("symbol",t),e)}};c({Container:{symbol:F((function(){return this.put(new Be)}))}}),L(Be,"Symbol");const Ve=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(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)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(O.document.createTextNode(t)),this},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)}},Symbol.toStringTag,{value:"Module"}));let We=class extends Lt{constructor(t,e=t){super(T("text",t),e),this.dom.leading=this.dom.leading??new Mt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Mt(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(r){if(x(this.node))return;const i=O.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new Mt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Mt(t.leading||1.3),this}writeDataToDom(){return v(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||x(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===j(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);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()}};z(We,Ve),c({Container:{text:F((function(t=""){return this.put(new We).text(t)})),plain:F((function(t=""){return this.put(new We).plain(t)}))}}),L(We,"Text");let He=class extends Lt{constructor(t,e=t){super(T("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 We))return this;const e=t.index(this),n=O.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new Mt(n);return this.dy(e?r: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)}};z(He,Ve),c({Tspan:{tspan:F((function(t=""){const e=new He;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),L(He,"Tspan");let Ze=class extends Lt{constructor(t,e=t){super(T("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 Mt(t).divide(2))}};z(Ze,{x:Dt,y:zt,cx:Ft,cy:$t,width:Yt,height:Xt}),c({Container:{circle:F((function(t=0){return this.put(new Ze).size(t).move(0,0)}))}}),L(Ze,"Circle");let Ue=class extends jt{constructor(t,e=t){super(T("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return dt("svg [clip-path*="+this.id()+"]")}};c({Container:{clip:F((function(){return this.defs().put(new Ue)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Ue?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),L(Ue,"ClipPath");let Qe=class extends At{constructor(t,e=t){super(T("foreignObject",t),e)}};c({Container:{foreignObject:F((function(t,e){return this.put(new Qe).size(t,e)}))}}),L(Qe,"ForeignObject");const Ke=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof O.window.SVGSVGElement?new at(n.attr(["x","y","width","height"])):n.bbox()}catch(h){return}const i=new st(n),s=i.translate(t,e).transform(i.inverse()),o=new rt(r.x,r.y).transform(s);n.move(o.x,o.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 r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=y(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach((t=>{const e=new rt(n).transform(new st(t).inverse());t.scale(i,s,e.x,e.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)}},Symbol.toStringTag,{value:"Module"}));let Je=class extends jt{constructor(t,e=t){super(T("g",t),e)}};z(Je,Ke),c({Container:{group:F((function(){return this.put(new Je)}))}}),L(Je,"G");let tn=class extends jt{constructor(t,e=t){super(T("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,C)}};z(tn,Ke),c({Container:{link:F((function(t){return this.put(new tn).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 tn,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}}}),L(tn,"A");let en=class extends jt{constructor(t,e=t){super(T("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return dt("svg [mask*="+this.id()+"]")}};c({Container:{mask:F((function(){return this.defs().put(new en)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof en?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),L(en,"Mask");let nn=class extends At{constructor(t,e=t){super(T("stop",t),e)}update(t){return("number"==typeof t||t instanceof Mt)&&(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 Mt(t.offset)),this}};c({Gradient:{stop:function(t,e,n){return this.put(new nn).update(t,e,n)}}}),L(nn,"Stop");let rn=class extends At{constructor(t,e=t){super(T("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 r in e)n+=r.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[r]+";";return n+="}",n}(t,e))}};c("Dom",{style(t,e){return this.put(new rn).rule(t,e)},fontface(t,e,n){return this.put(new rn).font(t,e,n)}}),L(rn,"Style");let sn=class extends We{constructor(t,e=t){super(T("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")}};c({Container:{textPath:F((function(t,e){return t instanceof We||(t=this.text(t)),t.path(e)}))},Text:{path:F((function(t,e=!0){const n=new sn;let r;if(t instanceof Se||(t=this.defs().path(t)),n.attr("href","#"+t,C),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:F((function(t){return t instanceof We||(t=(new We).addTo(this.parent()).text(t)),t.path(this)})),targets(){return dt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),sn.prototype.MorphArray=xe,L(sn,"TextPath");let on=class extends Lt{constructor(t,e=t){super(T("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,C)}};c({Container:{use:F((function(t,e){return this.put(new on).use(t,e)}))}}),L(on,"Use"),z([qe,Be,Qt,Ut,re],d("viewbox")),z([ne,Te,Ae,Se],d("marker")),z(We,d("Text")),z(Se,d("Path")),z(It,d("Defs")),z([We,He],d("Tspan")),z([je,qt,Zt,ze],d("radius")),z(bt,d("EventTarget")),z(Nt,d("Dom")),z(At,d("Element")),z(Lt,d("Shape")),z([jt,Bt],d("Container")),z(Zt,d("Gradient")),z(ze,d("Runner")),lt.extend([...new Set(l)]),function(t=[]){ke.push(...[].concat(t))}([Mt,nt,at,st,Ot,Jt,xe,rt]),z(ke,{to(t){return(new _e).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});const hn={export:"data:image/svg+xml,%3csvg%20fill='%23000000'%20width='20px'%20height='20px'%20viewBox='0%200%2024%2024'%20id='export-2'%20xmlns='http://www.w3.org/2000/svg'%20class='icon%20line'%3e%3cpolyline%20id='primary'%20points='15%203%2021%203%2021%209'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/polyline%3e%3cpath%20id='primary-2'%20data-name='primary'%20d='M21,13v7a1,1,0,0,1-1,1H4a1,1,0,0,1-1-1V4A1,1,0,0,1,4,3h7'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/path%3e%3cline%20id='primary-3'%20data-name='primary'%20x1='11'%20y1='13'%20x2='21'%20y2='3'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/line%3e%3c/svg%3e","fit-screen":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='8%202%202%202%202%208%204%208%204%204%208%204%208%202'/%3e%3cpolygon%20points='24%202%2030%202%2030%208%2028%208%2028%204%2024%204%2024%202'/%3e%3cpolygon%20points='8%2030%202%2030%202%2024%204%2024%204%2028%208%2028%208%2030'/%3e%3cpolygon%20points='24%2030%2030%2030%2030%2024%2028%2024%2028%2028%2024%2028%2024%2030'/%3e%3cpath%20d='M24,24H8a2.0023,2.0023,0,0,1-2-2V10A2.0023,2.0023,0,0,1,8,8H24a2.0023,2.0023,0,0,1,2,2V22A2.0023,2.0023,0,0,1,24,24ZM8,10V22H24V10Z'/%3e%3crect%20fill='none'%20width='32'%20height='32'/%3e%3c/svg%3e","zoom-in":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:sketch='http://www.bohemiancoding.com/sketch/ns'%3e%3cg%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20transform='translate(-308.000000,%20-1139.000000)'%20fill='%23000000'%3e%3cpath%20d='M321.46,1163.45%20C315.17,1163.45%20310.07,1158.44%20310.07,1152.25%20C310.07,1146.06%20315.17,1141.04%20321.46,1141.04%20C327.75,1141.04%20332.85,1146.06%20332.85,1152.25%20C332.85,1158.44%20327.75,1163.45%20321.46,1163.45%20L321.46,1163.45%20Z%20M339.688,1169.25%20L331.429,1161.12%20C333.592,1158.77%20334.92,1155.67%20334.92,1152.25%20C334.92,1144.93%20328.894,1139%20321.46,1139%20C314.026,1139%20308,1144.93%20308,1152.25%20C308,1159.56%20314.026,1165.49%20321.46,1165.49%20C324.672,1165.49%20327.618,1164.38%20329.932,1162.53%20L338.225,1170.69%20C338.629,1171.09%20339.284,1171.09%20339.688,1170.69%20C340.093,1170.3%20340.093,1169.65%20339.688,1169.25%20L339.688,1169.25%20Z%20M326.519,1151.41%20L322.522,1151.41%20L322.522,1147.41%20C322.522,1146.85%20322.075,1146.41%20321.523,1146.41%20C320.972,1146.41%20320.524,1146.85%20320.524,1147.41%20L320.524,1151.41%20L316.529,1151.41%20C315.978,1151.41%20315.53,1151.59%20315.53,1152.14%20C315.53,1152.7%20315.978,1153.41%20316.529,1153.41%20L320.524,1153.41%20L320.524,1157.41%20C320.524,1157.97%20320.972,1158.41%20321.523,1158.41%20C322.075,1158.41%20322.522,1157.97%20322.522,1157.41%20L322.522,1153.41%20L326.519,1153.41%20C327.07,1153.41%20327.518,1152.96%20327.518,1152.41%20C327.518,1151.86%20327.07,1151.41%20326.519,1151.41%20L326.519,1151.41%20Z'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e","zoom-out":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20%3e%3cg%20transform='translate(-360.000000,%20-1139.000000)'%20fill='%23000000'%3e%3cpath%20d='M373.46,1163.45%20C367.17,1163.45%20362.071,1158.44%20362.071,1152.25%20C362.071,1146.06%20367.17,1141.04%20373.46,1141.04%20C379.75,1141.04%20384.85,1146.06%20384.85,1152.25%20C384.85,1158.44%20379.75,1163.45%20373.46,1163.45%20L373.46,1163.45%20Z%20M391.688,1169.25%20L383.429,1161.12%20C385.592,1158.77%20386.92,1155.67%20386.92,1152.25%20C386.92,1144.93%20380.894,1139%20373.46,1139%20C366.026,1139%20360,1144.93%20360,1152.25%20C360,1159.56%20366.026,1165.49%20373.46,1165.49%20C376.672,1165.49%20379.618,1164.38%20381.932,1162.53%20L390.225,1170.69%20C390.629,1171.09%20391.284,1171.09%20391.688,1170.69%20C392.093,1170.3%20392.093,1169.65%20391.688,1169.25%20L391.688,1169.25%20Z%20M378.689,1151.41%20L368.643,1151.41%20C368.102,1151.41%20367.663,1151.84%20367.663,1152.37%20C367.663,1152.9%20368.102,1153.33%20368.643,1153.33%20L378.689,1153.33%20C379.23,1153.33%20379.669,1152.9%20379.669,1152.37%20C379.669,1151.84%20379.23,1151.41%20378.689,1151.41%20L378.689,1151.41%20Z'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e"};class an{constructor(t,e){this.element=t,t&&(this.chartContext=e||new r(t),this.injectStyles())}injectStyles(){const t=`toolbar-styles-${this.chartContext.getInstanceId()}`;this.chartContext.injectStyles("\n #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n \n .toolbar-item {\n align-items: center;\n background-color: var(--toolbar-bg-color, #FFFFFF);\n border: 1px solid var(--toolbar-border-color, #BCBCBC);\n cursor: pointer;\n display: flex;\n height: 30px;\n justify-content: center;\n width: 30px;\n border-radius: 3px;\n transition: all 0.2s ease;\n position: relative;\n }\n \n .toolbar-item:hover {\n background-color: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #999);\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:active {\n transform: translateY(0);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);\n }\n \n .toolbar-item img {\n width: 16px;\n height: 16px;\n pointer-events: none;\n filter: var(--toolbar-icon-filter, none);\n }\n \n .toolbar-item[disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n \n /* Tooltip styles */\n .toolbar-item::after {\n content: attr(data-tooltip);\n position: absolute;\n bottom: -35px;\n left: 50%;\n transform: translateX(-50%);\n background: var(--tooltip-bg-color, #333);\n color: var(--tooltip-text-color, white);\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 12px;\n white-space: nowrap;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item::before {\n content: '';\n position: absolute;\n bottom: -25px;\n left: 50%;\n transform: translateX(-50%);\n border: 5px solid transparent;\n border-bottom-color: var(--tooltip-bg-color, #333);\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item:hover::after,\n .toolbar-item:hover::before {\n opacity: 1;\n }\n \n /* Shadow DOM specific adjustments */\n :host #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n",t)}createToolbarItem(t,e,n){const r=this.chartContext.createElement("div"),i=new Image;return i.src=e,i.alt=n||t,r.id=t,r.className="toolbar-item",r.setAttribute("role","button"),r.setAttribute("tabindex","0"),n&&(r.setAttribute("data-tooltip",n),r.setAttribute("aria-label",n)),r.append(i),r.addEventListener("keydown",(t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r.click())})),r}render({enableExport:t=!1,enableFitscreen:e=!1,enableZoom:n=!1,onExport:r=s,onFitscreen:i=s,onZoom:o=s}){if(!this.element)return;const h=this.chartContext.querySelector("#toolbar");null==h||h.remove();const a=this.chartContext.createElement("div");if(a.id="toolbar",a.setAttribute("role","toolbar"),a.setAttribute("aria-label","Chart controls"),t){const t=this.createToolbarItem("export",hn.export,"Export chart");t.addEventListener("click",(()=>{r()})),a.append(t)}if(n){const t=this.createToolbarItem("zoom-in",hn["zoom-in"],"Zoom in"),e=this.createToolbarItem("zoom-out",hn["zoom-out"],"Zoom out");t.addEventListener("click",(()=>{o(.1)})),e.addEventListener("click",(()=>{o(-.1)})),a.append(t,e)}if(e){const t=this.createToolbarItem("fit-screen",hn["fit-screen"],"Fit to screen");t.addEventListener("click",(()=>{i()})),a.append(t)}this.element.append(a)}destroy(){const t=this.chartContext.querySelector("#toolbar");null==t||t.remove()}}const un=class{static add(t){this.remove(t);const e=document.createElement("div");e.className=this.WATERMARK_CLASS,e.textContent=this.WATERMARK_TEXT,Object.assign(e.style,{bottom:"5px",color:"#666",fontFamily:"Arial, sans-serif",fontSize:"14px",msUserSelect:"none",pointerEvents:"none",position:"absolute",right:"5px",userSelect:"none",webkitUserSelect:"none",zIndex:"1000"}),"static"===getComputedStyle(t).position&&(t.style.position="relative"),t.appendChild(e)}static exists(t){return!!t.querySelector(`.${this.WATERMARK_CLASS}`)}static remove(t){const e=t.querySelector(`.${this.WATERMARK_CLASS}`);e&&e.remove()}};un.WATERMARK_CLASS="apexgantt-watermark",un.WATERMARK_TEXT="Powered by apexcharts.com";let ln=un;var cn,dn=(cn={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},function(t){return null==cn?void 0:cn[t]}),fn="object"==typeof global&&global&&global.Object===Object&&global,pn="object"==typeof self&&self&&self.Object===Object&&self,mn=(fn||pn||Function("return this")()).Symbol;var gn=Array.isArray,yn=Object.prototype,wn=yn.hasOwnProperty,bn=yn.toString,xn=mn?mn.toStringTag:void 0;var vn=Object.prototype.toString;var _n="[object Null]",En="[object Undefined]",Cn=mn?mn.toStringTag:void 0;function On(t){return null==t?void 0===t?En:_n:Cn&&Cn in Object(t)?function(t){var e=wn.call(t,xn),n=t[xn];try{t[xn]=void 0;var r=!0}catch(s){}var i=bn.call(t);return r&&(e?t[xn]=n:delete t[xn]),i}(t):function(t){return vn.call(t)}(t)}var Mn="[object Symbol]";var kn=1/0,Sn=mn?mn.prototype:void 0,Nn=Sn?Sn.toString:void 0;function An(t){if("string"==typeof t)return t;if(gn(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,An)+"";if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&On(t)==Mn}(t))return Nn?Nn.call(t):"";var e=t+"";return"0"==e&&1/t==-kn?"-0":e}function Tn(t){return null==t?"":An(t)}var jn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,In=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var Ln=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Rn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Pn="\\ud800-\\udfff",Dn="\\u2700-\\u27bf",zn="a-z\\xdf-\\xf6\\xf8-\\xff",Fn="A-Z\\xc0-\\xd6\\xd8-\\xde",$n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Yn="["+$n+"]",Xn="\\d+",Gn="["+Dn+"]",qn="["+zn+"]",Bn="[^"+Pn+$n+Xn+Dn+zn+Fn+"]",Vn="(?:\\ud83c[\\udde6-\\uddff]){2}",Wn="[\\ud800-\\udbff][\\udc00-\\udfff]",Hn="["+Fn+"]",Zn="(?:"+qn+"|"+Bn+")",Un="(?:"+Hn+"|"+Bn+")",Qn="(?:['’](?:d|ll|m|re|s|t|ve))?",Kn="(?:['’](?:D|LL|M|RE|S|T|VE))?",Jn="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",tr="[\\ufe0e\\ufe0f]?",er=tr+Jn+("(?:\\u200d(?:"+["[^"+Pn+"]",Vn,Wn].join("|")+")"+tr+Jn+")*"),nr="(?:"+[Gn,Vn,Wn].join("|")+")"+er,rr=RegExp([Hn+"?"+qn+"+"+Qn+"(?="+[Yn,Hn,"$"].join("|")+")",Un+"+"+Kn+"(?="+[Yn,Hn+Zn,"$"].join("|")+")",Hn+"?"+Zn+"+"+Qn,Hn+"+"+Kn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Xn,nr].join("|"),"g");function ir(t,e,n){return t=Tn(t),void 0===e?function(t){return Rn.test(t)}(t)?function(t){return t.match(rr)||[]}(t):function(t){return t.match(Ln)||[]}(t):t.match(e)||[]}var sr=RegExp("['’]","g");var or,hr=(or=function(t,e,n){return t+(n?"-":"")+e.toLowerCase()},function(t){return function(t,e,n,r){for(var i=-1,s=null==t?0:t.length;++i<s;)n=e(n,t[i],i,t);return n}(ir(function(t){return(t=Tn(t))&&t.replace(jn,dn).replace(In,"")}(t).replace(sr,"")),or,"")});const ar=(t,e="apex-tooltip-container")=>{let n=t.getElementById(e);if(!n){n=t.createElement("div"),n.id=e,n.setAttribute("role","tooltip"),n.setAttribute("aria-hidden","true");t.getAppendContainer().appendChild(n)}return n},ur=(t,e="",n,r="")=>{const i=t.getElementById(e);if(!i)return console.warn("Tooltip: Element not found, creating it"),ar(t,e),ur(t,e,n,r);if(n&&r){const t=r.includes("tooltip-content"),e=n.match(/background-color:\s*([^;]+);?/),s=n.match(/color:\s*([^;]+);?/),o=e?e[1]:"#333",h=s?s[1]:"white";i.innerHTML=t?r:`<div class="tooltip-content" style="background-color: ${o}; color: ${h};">${r}</div>`;const a=n+"; display: block !important; visibility: visible !important; opacity: 1 !important;";i.setAttribute("style",a),i.classList.add("visible"),i.setAttribute("aria-hidden","false")}else i.removeAttribute("style"),i.classList.remove("visible"),i.setAttribute("aria-hidden","true"),i.innerHTML=""},lr=(t={})=>{const e=[];for(const n in t){const r=`${hr(n)}: ${t[n]};`;e.push(r)}return e.join(" ")};var cr="\0",dr="\0",fr="";function pr(t,e){t[e]?t[e]++:t[e]=1}function mr(t,e){--t[e]||delete t[e]}function gr(t,e,n,r){var i=""+e,s=""+n;if(!t&&i>s){var o=i;i=s,s=o}return i+fr+s+fr+(void 0===r?cr:r)}function yr(t,e){return gr(t,e.v,e.w,e.name)}var wr=class{constructor(t){n(this,"_isDirected",!0),n(this,"_isMultigraph",!1),n(this,"_isCompound",!1),n(this,"_label"),n(this,"_defaultNodeLabelFn",(()=>{})),n(this,"_defaultEdgeLabelFn",(()=>{})),n(this,"_nodes",{}),n(this,"_in",{}),n(this,"_preds",{}),n(this,"_out",{}),n(this,"_sucs",{}),n(this,"_edgeObjs",{}),n(this,"_edgeLabels",{}),n(this,"_nodeCount",0),n(this,"_edgeCount",0),n(this,"_parent"),n(this,"_children"),t&&(this._isDirected=!Object.hasOwn(t,"directed")||t.directed,this._isMultigraph=!!Object.hasOwn(t,"multigraph")&&t.multigraph,this._isCompound=!!Object.hasOwn(t,"compound")&&t.compound),this._isCompound&&(this._parent={},this._children={},this._children[dr]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return this._defaultNodeLabelFn=t,"function"!=typeof t&&(this._defaultNodeLabelFn=()=>t),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var t=this;return this.nodes().filter((e=>0===Object.keys(t._in[e]).length))}sinks(){var t=this;return this.nodes().filter((e=>0===Object.keys(t._out[e]).length))}setNodes(t,e){var n=arguments,r=this;return t.forEach((function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this}setNode(t,e){return Object.hasOwn(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=dr,this._children[t]={},this._children[dr][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.hasOwn(this._nodes,t)}removeNode(t){var e=this;if(Object.hasOwn(this._nodes,t)){var n=t=>e.removeEdge(e._edgeObjs[t]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach((function(t){e.setParent(t)})),delete this._children[t]),Object.keys(this._in[t]).forEach(n),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(void 0===e)e=dr;else{for(var n=e+="";void 0!==n;n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==dr)return e}}children(t=dr){if(this._isCompound){var e=this._children[t];if(e)return Object.keys(e)}else{if(t===dr)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var e=this._preds[t];if(e)return Object.keys(e)}successors(t){var e=this._sucs[t];if(e)return Object.keys(e)}neighbors(t){var e=this.predecessors(t);if(e){const r=new Set(e);for(var n of this.successors(t))r.add(n);return Array.from(r.values())}}isLeaf(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach((function([n,r]){t(n)&&e.setNode(n,r)})),Object.values(this._edgeObjs).forEach((function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function i(t){var s=n.parent(t);return void 0===s||e.hasNode(s)?(r[t]=s,s):s in r?r[s]:i(s)}return this._isCompound&&e.nodes().forEach((t=>e.setParent(t,i(t)))),e}setDefaultEdgeLabel(t){return this._defaultEdgeLabelFn=t,"function"!=typeof t&&(this._defaultEdgeLabelFn=()=>t),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,e){var n=this,r=arguments;return t.reduce((function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this}setEdge(){var t,e,n,r,i=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(t=s.v,e=s.w,n=s.name,2===arguments.length&&(r=arguments[1],i=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),t=""+t,e=""+e,void 0!==n&&(n=""+n);var o=gr(this._isDirected,t,e,n);if(Object.hasOwn(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(void 0!==n&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(t,e,n);var h=function(t,e,n,r){var i=""+e,s=""+n;if(!t&&i>s){var o=i;i=s,s=o}var h={v:i,w:s};r&&(h.name=r);return h}(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[o]=h,pr(this._preds[e],t),pr(this._sucs[t],e),this._in[e][o]=h,this._out[t][o]=h,this._edgeCount++,this}edge(t,e,n){var r=1===arguments.length?yr(this._isDirected,arguments[0]):gr(this._isDirected,t,e,n);return this._edgeLabels[r]}edgeAsObj(){const t=this.edge(...arguments);return"object"!=typeof t?{label:t}:t}hasEdge(t,e,n){var r=1===arguments.length?yr(this._isDirected,arguments[0]):gr(this._isDirected,t,e,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(t,e,n){var r=1===arguments.length?yr(this._isDirected,arguments[0]):gr(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],mr(this._preds[e],t),mr(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this}inEdges(t,e){var n=this._in[t];if(n){var r=Object.values(n);return e?r.filter((t=>t.v===e)):r}}outEdges(t,e){var n=this._out[t];if(n){var r=Object.values(n);return e?r.filter((t=>t.w===e)):r}}nodeEdges(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},br={Graph:wr,version:"2.2.4"},xr=wr,vr={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:_r(t),edges:Er(t)};void 0!==t.graph()&&(e.value=structuredClone(t.graph()));return e},read:function(t){var e=new xr(t.options).setGraph(t.value);return t.nodes.forEach((function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),t.edges.forEach((function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function _r(t){return t.nodes().map((function(e){var n=t.node(e),r=t.parent(e),i={v:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.parent=r),i}))}function Er(t){return t.edges().map((function(e){var n=t.edge(e),r={v:e.v,w:e.w};return void 0!==e.name&&(r.name=e.name),void 0!==n&&(r.value=n),r}))}var Cr=function(t){var e,n={},r=[];function i(r){Object.hasOwn(n,r)||(n[r]=!0,e.push(r),t.successors(r).forEach(i),t.predecessors(r).forEach(i))}return t.nodes().forEach((function(t){e=[],i(t),e.length&&r.push(e)})),r};var Or=class{constructor(){n(this,"_arr",[]),n(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map((function(t){return t.key}))}has(t){return Object.hasOwn(this._keyIndices,t)}priority(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority}min(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key}add(t,e){var n=this._keyIndices;if(t=String(t),!Object.hasOwn(n,t)){var r=this._arr,i=r.length;return n[t]=i,r.push({key:t,priority:e}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)}_heapify(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))}_decrease(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e}_swap(t,e){var n=this._arr,r=this._keyIndices,i=n[t],s=n[e];n[t]=s,n[e]=i,r[s.key]=t,r[i.key]=e}},Mr=Or,kr=function(t,e,n,r){return function(t,e,n,r){var i,s,o={},h=new Mr,a=function(t){var e=t.v!==i?t.v:t.w,r=o[e],a=n(t),u=s.distance+a;if(a<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);u<r.distance&&(r.distance=u,r.predecessor=i,h.decrease(e,u))};t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;o[t]={distance:n},h.add(t,n)}));for(;h.size()>0&&(i=h.removeMin(),(s=o[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(a);return o}(t,String(e),n||Sr,r||function(e){return t.outEdges(e)})},Sr=()=>1;var Nr=kr,Ar=function(t,e,n){return t.nodes().reduce((function(r,i){return r[i]=Nr(t,i,e,n),r}),{})};var Tr=function(t){var e=0,n=[],r={},i=[];function s(o){var h=r[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),t.successors(o).forEach((function(t){Object.hasOwn(r,t)?r[t].onStack&&(h.lowlink=Math.min(h.lowlink,r[t].index)):(s(t),h.lowlink=Math.min(h.lowlink,r[t].lowlink))})),h.lowlink===h.index){var a,u=[];do{a=n.pop(),r[a].onStack=!1,u.push(a)}while(o!==a);i.push(u)}}return t.nodes().forEach((function(t){Object.hasOwn(r,t)||s(t)})),i};var jr=Tr,Ir=function(t){return jr(t).filter((function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))};var Lr=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,s=e(n);r[t][i]={distance:s,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var s=r[n];i.forEach((function(n){var r=s[t],i=e[n],o=s[n],h=r.distance+i.distance;h<o.distance&&(o.distance=h,o.predecessor=i.predecessor)}))}))})),r}(t,e||Rr,n||function(e){return t.outEdges(e)})},Rr=()=>1;function Pr(t){var e={},n={},r=[];if(t.sinks().forEach((function i(s){if(Object.hasOwn(n,s))throw new Dr;Object.hasOwn(e,s)||(n[s]=!0,e[s]=!0,t.predecessors(s).forEach(i),delete n[s],r.push(s))})),Object.keys(e).length!==t.nodeCount())throw new Dr;return r}class Dr extends Error{constructor(){super(...arguments)}}var zr=Pr;Pr.CycleException=Dr;var Fr=zr;var $r=function(t,e,n){Array.isArray(e)||(e=[e]);var r=t.isDirected()?e=>t.successors(e):e=>t.neighbors(e),i="post"===n?Yr:Xr,s=[],o={};return e.forEach((e=>{if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);i(e,r,o,s)})),s};function Yr(t,e,n,r){for(var i=[[t,!1]];i.length>0;){var s=i.pop();s[1]?r.push(s[0]):Object.hasOwn(n,s[0])||(n[s[0]]=!0,i.push([s[0],!0]),Gr(e(s[0]),(t=>i.push([t,!1]))))}}function Xr(t,e,n,r){for(var i=[t];i.length>0;){var s=i.pop();Object.hasOwn(n,s)||(n[s]=!0,r.push(s),Gr(e(s),(t=>i.push(t))))}}function Gr(t,e){for(var n=t.length;n--;)e(t[n],n,t);return t}var qr=$r;var Br=$r;var Vr=wr,Wr=Or;var Hr={Graph:br.Graph,json:vr,alg:{components:Cr,dijkstra:kr,dijkstraAll:Ar,findCycles:Ir,floydWarshall:Lr,isAcyclic:function(t){try{Fr(t)}catch(e){if(e instanceof Fr.CycleException)return!1;throw e}return!0},postorder:function(t,e){return qr(t,e,"post")},preorder:function(t,e){return Br(t,e,"pre")},prim:function(t,e){var n,r=new Vr,i={},s=new Wr;function o(t){var r=t.v===n?t.w:t.v,o=s.priority(r);if(void 0!==o){var h=e(t);h<o&&(i[r]=n,s.decrease(r,h))}}if(0===t.nodeCount())return r;t.nodes().forEach((function(t){s.add(t,Number.POSITIVE_INFINITY),r.setNode(t)})),s.decrease(t.nodes()[0],0);var h=!1;for(;s.size()>0;){if(n=s.removeMin(),Object.hasOwn(i,n))r.setEdge(n,i[n]);else{if(h)throw new Error("Input graph is not connected: "+t);h=!0}t.nodeEdges(n).forEach(o)}return r},tarjan:Tr,topsort:zr},version:br.version};function Zr(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Ur(t,e){if("_next"!==t&&"_prev"!==t)return e}let Qr=Hr.Graph,Kr=class{constructor(){let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return Zr(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&Zr(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){let t=[],e=this._sentinel,n=e._prev;for(;n!==e;)t.push(JSON.stringify(n,Ur)),n=n._prev;return"["+t.join(", ")+"]"}};var Jr=function(t,e){if(t.nodeCount()<=1)return[];let n=function(t,e){let n=new Qr,r=0,i=0;t.nodes().forEach((t=>{n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((t=>{let s=n.edge(t.v,t.w)||0,o=e(t),h=s+o;n.setEdge(t.v,t.w,h),i=Math.max(i,n.node(t.v).out+=o),r=Math.max(r,n.node(t.w).in+=o)}));let s=function(t){const e=[];for(let n=0;n<t;n++)e.push(n);return e}(i+r+3).map((()=>new Kr)),o=r+1;return n.nodes().forEach((t=>{ni(s,o,n.node(t))})),{graph:n,buckets:s,zeroIdx:o}}(t,e||ti);return function(t,e,n){let r,i=[],s=e[e.length-1],o=e[0];for(;t.nodeCount();){for(;r=o.dequeue();)ei(t,e,n,r);for(;r=s.dequeue();)ei(t,e,n,r);if(t.nodeCount())for(let s=e.length-2;s>0;--s)if(r=e[s].dequeue(),r){i=i.concat(ei(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx).flatMap((e=>t.outEdges(e.v,e.w)))};let ti=()=>1;function ei(t,e,n,r,i){let s=i?[]:void 0;return t.inEdges(r.v).forEach((r=>{let o=t.edge(r),h=t.node(r.v);i&&s.push({v:r.v,w:r.w}),h.out-=o,ni(e,n,h)})),t.outEdges(r.v).forEach((r=>{let i=t.edge(r),s=r.w,o=t.node(s);o.in-=i,ni(e,n,o)})),t.removeNode(r.v),s}function ni(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}let ri=Hr.Graph;var ii={addBorderNode:function(t,e,n,r){let i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return si(t,"border",i,e)},addDummyNode:si,applyWithChunking:hi,asNonCompoundGraph:function(t){let e=new ri({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((n=>{t.children(n).length||e.setNode(n,t.node(n))})),t.edges().forEach((n=>{e.setEdge(n,t.edge(n))})),e},buildLayerMatrix:function(t){let e=ci(ai(t)+1).map((()=>[]));return t.nodes().forEach((n=>{let r=t.node(n),i=r.rank;void 0!==i&&(e[i][r.order]=n)})),e},intersectRect:function(t,e){let n,r,i=t.x,s=t.y,o=e.x-i,h=e.y-s,a=t.width/2,u=t.height/2;if(!o&&!h)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(h)*a>Math.abs(o)*u?(h<0&&(u=-u),n=u*o/h,r=u):(o<0&&(a=-a),n=a,r=a*h/o);return{x:i+n,y:s+r}},mapValues:function(t,e){let n=e;"string"==typeof e&&(n=t=>t[e]);return Object.entries(t).reduce(((t,[e,r])=>(t[e]=n(r,e),t)),{})},maxRank:ai,normalizeRanks:function(t){let e=t.nodes().map((e=>{let n=t.node(e).rank;return void 0===n?Number.MAX_VALUE:n})),n=hi(Math.min,e);t.nodes().forEach((e=>{let r=t.node(e);Object.hasOwn(r,"rank")&&(r.rank-=n)}))},notime:function(t,e){return e()},partition:function(t,e){let n={lhs:[],rhs:[]};return t.forEach((t=>{e(t)?n.lhs.push(t):n.rhs.push(t)})),n},pick:function(t,e){const n={};for(const r of e)void 0!==t[r]&&(n[r]=t[r]);return n},predecessorWeights:function(t){let e=t.nodes().map((e=>{let n={};return t.inEdges(e).forEach((e=>{n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return di(t.nodes(),e)},range:ci,removeEmptyRanks:function(t){let e=t.nodes().map((e=>t.node(e).rank)),n=hi(Math.min,e),r=[];t.nodes().forEach((e=>{let i=t.node(e).rank-n;r[i]||(r[i]=[]),r[i].push(e)}));let i=0,s=t.graph().nodeRankFactor;Array.from(r).forEach(((e,n)=>{void 0===e&&n%s!=0?--i:void 0!==e&&i&&e.forEach((e=>t.node(e).rank+=i))}))},simplify:function(t){let e=(new ri).setGraph(t.graph());return t.nodes().forEach((n=>e.setNode(n,t.node(n)))),t.edges().forEach((n=>{let r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},successorWeights:function(t){let e=t.nodes().map((e=>{let n={};return t.outEdges(e).forEach((e=>{n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return di(t.nodes(),e)},time:function(t,e){let n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}},uniqueId:li,zipObject:di};function si(t,e,n,r){let i;do{i=li(r)}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}const oi=65535;function hi(t,e){if(e.length>oi){const n=function(t,e=oi){const n=[];for(let r=0;r<t.length;r+=e){const i=t.slice(r,r+e);n.push(i)}return n}(e);return t.apply(null,n.map((e=>t.apply(null,e))))}return t.apply(null,e)}function ai(t){const e=t.nodes().map((e=>{let n=t.node(e).rank;return void 0===n?Number.MIN_VALUE:n}));return hi(Math.max,e)}let ui=0;function li(t){var e=++ui;return toString(t)+e}function ci(t,e,n=1){null==e&&(e=t,t=0);let r=t=>t<e;n<0&&(r=t=>e<t);const i=[];for(let s=t;r(s);s+=n)i.push(s);return i}function di(t,e){return t.reduce(((t,n,r)=>(t[n]=e[r],t)),{})}let fi=Jr,pi=ii.uniqueId;var mi={run:function(t){("greedy"===t.graph().acyclicer?fi(t,(e=t,t=>e.edge(t).weight)):function(t){let e=[],n={},r={};function i(s){Object.hasOwn(r,s)||(r[s]=!0,n[s]=!0,t.outEdges(s).forEach((t=>{Object.hasOwn(n,t.w)?e.push(t):i(t.w)})),delete n[s])}return t.nodes().forEach(i),e}(t)).forEach((e=>{let n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,pi("rev"))}));var e},undo:function(t){t.edges().forEach((e=>{let n=t.edge(e);if(n.reversed){t.removeEdge(e);let r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}};let gi=ii;var yi={run:function(t){t.graph().dummyChains=[],t.edges().forEach((e=>function(t,e){let n,r,i,s=e.v,o=t.node(s).rank,h=e.w,a=t.node(h).rank,u=e.name,l=t.edge(e),c=l.labelRank;if(a===o+1)return;for(t.removeEdge(e),i=0,++o;o<a;++i,++o)l.points=[],r={width:0,height:0,edgeLabel:l,edgeObj:e,rank:o},n=gi.addDummyNode(t,"edge",r,"_d"),o===c&&(r.width=l.width,r.height=l.height,r.dummy="edge-label",r.labelpos=l.labelpos),t.setEdge(s,n,{weight:l.weight},u),0===i&&t.graph().dummyChains.push(n),s=n;t.setEdge(s,h,{weight:l.weight},u)}(t,e)))},undo:function(t){t.graph().dummyChains.forEach((e=>{let n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}};const{applyWithChunking:wi}=ii;var bi={longestPath:function(t){var e={};t.sources().forEach((function n(r){var i=t.node(r);if(Object.hasOwn(e,r))return i.rank;e[r]=!0;let s=t.outEdges(r).map((e=>null==e?Number.POSITIVE_INFINITY:n(e.w)-t.edge(e).minlen));var o=wi(Math.min,s);return o===Number.POSITIVE_INFINITY&&(o=0),i.rank=o}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}};var xi=Hr.Graph,vi=bi.slack,_i=function(t){var e,n,r=new xi({directed:!1}),i=t.nodes()[0],s=t.nodeCount();r.setNode(i,{});for(;Ei(r,t)<s;)e=Ci(r,t),n=r.hasNode(e.v)?vi(t,e):-vi(t,e),Oi(r,t,n);return r};function Ei(t,e){return t.nodes().forEach((function n(r){e.nodeEdges(r).forEach((i=>{var s=i.v,o=r===s?i.w:s;t.hasNode(o)||vi(e,i)||(t.setNode(o,{}),t.setEdge(r,o,{}),n(o))}))})),t.nodeCount()}function Ci(t,e){return e.edges().reduce(((n,r)=>{let i=Number.POSITIVE_INFINITY;return t.hasNode(r.v)!==t.hasNode(r.w)&&(i=vi(e,r)),i<n[0]?[i,r]:n}),[Number.POSITIVE_INFINITY,null])[1]}function Oi(t,e,n){t.nodes().forEach((t=>e.node(t).rank+=n))}var Mi=_i,ki=bi.slack,Si=bi.longestPath,Ni=Hr.alg.preorder,Ai=Hr.alg.postorder,Ti=ii.simplify,ji=Ii;function Ii(t){t=Ti(t),Si(t);var e,n=Mi(t);for(Pi(n),Li(n,t);e=zi(n);)$i(n,t,e,Fi(n,t,e))}function Li(t,e){var n=Ai(t,t.nodes());(n=n.slice(0,n.length-1)).forEach((n=>function(t,e,n){var r=t.node(n),i=r.parent;t.edge(n,i).cutvalue=Ri(t,e,n)}(t,e,n)))}function Ri(t,e,n){var r=t.node(n).parent,i=!0,s=e.edge(n,r),o=0;return s||(i=!1,s=e.edge(r,n)),o=s.weight,e.nodeEdges(n).forEach((s=>{var h,a,u=s.v===n,l=u?s.w:s.v;if(l!==r){var c=u===i,d=e.edge(s).weight;if(o+=c?d:-d,h=n,a=l,t.hasEdge(h,a)){var f=t.edge(n,l).cutvalue;o+=c?-f:f}}})),o}function Pi(t,e){arguments.length<2&&(e=t.nodes()[0]),Di(t,{},1,e)}function Di(t,e,n,r,i){var s=n,o=t.node(r);return e[r]=!0,t.neighbors(r).forEach((i=>{Object.hasOwn(e,i)||(n=Di(t,e,n,i,r))})),o.low=s,o.lim=n++,i?o.parent=i:delete o.parent,n}function zi(t){return t.edges().find((e=>t.edge(e).cutvalue<0))}function Fi(t,e,n){var r=n.v,i=n.w;e.hasEdge(r,i)||(r=n.w,i=n.v);var s=t.node(r),o=t.node(i),h=s,a=!1;return s.lim>o.lim&&(h=o,a=!0),e.edges().filter((e=>a===Yi(t,t.node(e.v),h)&&a!==Yi(t,t.node(e.w),h))).reduce(((t,n)=>ki(e,n)<ki(e,t)?n:t))}function $i(t,e,n,r){var i=n.v,s=n.w;t.removeEdge(i,s),t.setEdge(r.v,r.w,{}),Pi(t),Li(t,e),function(t,e){var n=t.nodes().find((t=>!e.node(t).parent)),r=Ni(t,n);(r=r.slice(1)).forEach((n=>{var r=t.node(n).parent,i=e.edge(n,r),s=!1;i||(i=e.edge(r,n),s=!0),e.node(n).rank=e.node(r).rank+(s?i.minlen:-i.minlen)}))}(t,e)}function Yi(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}Ii.initLowLimValues=Pi,Ii.initCutValues=Li,Ii.calcCutValue=Ri,Ii.leaveEdge=zi,Ii.enterEdge=Fi,Ii.exchangeEdges=$i;var Xi=bi.longestPath,Gi=_i,qi=ji,Bi=function(t){switch(t.graph().ranker){case"network-simplex":default:Wi(t);break;case"tight-tree":!function(t){Xi(t),Gi(t)}(t);break;case"longest-path":Vi(t)}};var Vi=Xi;function Wi(t){qi(t)}let Hi=ii;function Zi(t,e,n,r,i,s,o){let h=t.children(o);if(!h.length)return void(o!==e&&t.setEdge(e,o,{weight:0,minlen:n}));let a=Hi.addBorderNode(t,"_bt"),u=Hi.addBorderNode(t,"_bb"),l=t.node(o);t.setParent(a,o),l.borderTop=a,t.setParent(u,o),l.borderBottom=u,h.forEach((h=>{Zi(t,e,n,r,i,s,h);let l=t.node(h),c=l.borderTop?l.borderTop:h,d=l.borderBottom?l.borderBottom:h,f=l.borderTop?r:2*r,p=c!==d?1:i-s[o]+1;t.setEdge(a,c,{weight:f,minlen:p,nestingEdge:!0}),t.setEdge(d,u,{weight:f,minlen:p,nestingEdge:!0})})),t.parent(o)||t.setEdge(e,a,{weight:0,minlen:i+s[o]})}let Ui=ii;function Qi(t,e,n,r,i,s){let o={width:0,height:0,rank:s,borderType:e},h=i[e][s-1],a=Ui.addDummyNode(t,"border",o,n);i[e][s]=a,t.setParent(a,r),h&&t.setEdge(h,a,{weight:1})}function Ki(t){t.nodes().forEach((e=>Ji(t.node(e)))),t.edges().forEach((e=>Ji(t.edge(e))))}function Ji(t){let e=t.width;t.width=t.height,t.height=e}function ts(t){t.y=-t.y}function es(t){let e=t.x;t.x=t.y,t.y=e}let ns=ii;let rs=ii.zipObject;function is(t,e,n){let r=rs(n,n.map(((t,e)=>e))),i=e.flatMap((e=>t.outEdges(e).map((e=>({pos:r[e.w],weight:t.edge(e).weight}))).sort(((t,e)=>t.pos-e.pos)))),s=1;for(;s<n.length;)s<<=1;let o=2*s-1;s-=1;let h=new Array(o).fill(0),a=0;return i.forEach((t=>{let e=t.pos+s;h[e]+=t.weight;let n=0;for(;e>0;)e%2&&(n+=h[e+1]),e=e-1>>1,h[e]+=t.weight;a+=t.weight*n})),a}let ss=ii;let os=ii;function hs(t,e,n){let r;for(;e.length&&(r=e[e.length-1]).i<=n;)e.pop(),t.push(r.vs),n++;return n}let as=function(t,e=[]){return e.map((e=>{let n=t.inEdges(e);if(n.length){let r=n.reduce(((e,n)=>{let r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))},us=function(t,e){let n={};return t.forEach(((t,e)=>{let r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};void 0!==t.barycenter&&(r.barycenter=t.barycenter,r.weight=t.weight)})),e.edges().forEach((t=>{let e=n[t.v],r=n[t.w];void 0!==e&&void 0!==r&&(r.indegree++,e.out.push(n[t.w]))})),function(t){let e=[];function n(t){return e=>{e.merged||(void 0===e.barycenter||void 0===t.barycenter||e.barycenter>=t.barycenter)&&function(t,e){let n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return n=>{n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){let i=t.pop();e.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return e.filter((t=>!t.merged)).map((t=>ss.pick(t,["vs","i","barycenter","weight"])))}(Object.values(n).filter((t=>!t.indegree)))},ls=function(t,e){let n=os.partition(t,(t=>Object.hasOwn(t,"barycenter"))),r=n.lhs,i=n.rhs.sort(((t,e)=>e.i-t.i)),s=[],o=0,h=0,a=0;r.sort((u=!!e,(t,e)=>t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:u?e.i-t.i:t.i-e.i)),a=hs(s,i,a),r.forEach((t=>{a+=t.vs.length,s.push(t.vs),o+=t.barycenter*t.weight,h+=t.weight,a=hs(s,i,a)}));var u;let l={vs:s.flat(!0)};h&&(l.barycenter=o/h,l.weight=h);return l};var cs=function t(e,n,r,i){let s=e.children(n),o=e.node(n),h=o?o.borderLeft:void 0,a=o?o.borderRight:void 0,u={};h&&(s=s.filter((t=>t!==h&&t!==a)));let l=as(e,s);l.forEach((n=>{if(e.children(n.v).length){let h=t(e,n.v,r,i);u[n.v]=h,Object.hasOwn(h,"barycenter")&&(o=h,void 0!==(s=n).barycenter?(s.barycenter=(s.barycenter*s.weight+o.barycenter*o.weight)/(s.weight+o.weight),s.weight+=o.weight):(s.barycenter=o.barycenter,s.weight=o.weight))}var s,o}));let c=us(l,r);!function(t,e){t.forEach((t=>{t.vs=t.vs.flatMap((t=>e[t]?e[t].vs:t))}))}(c,u);let d=ls(c,i);if(h&&(d.vs=[h,d.vs,a].flat(!0),e.predecessors(h).length)){let t=e.node(e.predecessors(h)[0]),n=e.node(e.predecessors(a)[0]);Object.hasOwn(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+t.order+n.order)/(d.weight+2),d.weight+=2}return d};let ds=Hr.Graph,fs=ii;let ps=function(t){let e={},n=t.nodes().filter((e=>!t.children(e).length)),r=n.map((e=>t.node(e).rank)),i=ns.applyWithChunking(Math.max,r),s=ns.range(i+1).map((()=>[]));return n.sort(((e,n)=>t.node(e).rank-t.node(n).rank)).forEach((function n(r){if(e[r])return;e[r]=!0;let i=t.node(r);s[i.rank].push(r),t.successors(r).forEach(n)})),s},ms=function(t,e){let n=0;for(let r=1;r<e.length;++r)n+=is(t,e[r-1],e[r]);return n},gs=cs,ys=function(t,e,n){let r=function(t){var e;for(;t.hasNode(e=fs.uniqueId("_root")););return e}(t),i=new ds({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((e=>t.node(e)));return t.nodes().forEach((s=>{let o=t.node(s),h=t.parent(s);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(s),i.setParent(s,h||r),t[n](s).forEach((e=>{let n=e.v===s?e.w:e.v,r=i.edge(n,s),o=void 0!==r?r.weight:0;i.setEdge(n,s,{weight:t.edge(e).weight+o})})),Object.hasOwn(o,"minRank")&&i.setNode(s,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))})),i},ws=function(t,e,n){let r,i={};n.forEach((n=>{let s,o,h=t.parent(n);for(;h;){if(s=t.parent(h),s?(o=i[s],i[s]=h):(o=r,r=h),o&&o!==h)return void e.setEdge(o,h);h=s}}))},bs=Hr.Graph,xs=ii;var vs=function t(e,n){if(n&&"function"==typeof n.customOrder)return void n.customOrder(e,t);let r=xs.maxRank(e),i=_s(e,xs.range(1,r+1),"inEdges"),s=_s(e,xs.range(r-1,-1,-1),"outEdges"),o=ps(e);if(Cs(e,o),n&&n.disableOptimalOrderHeuristic)return;let h,a=Number.POSITIVE_INFINITY;for(let u=0,l=0;l<4;++u,++l){Es(u%2?i:s,u%4>=2),o=xs.buildLayerMatrix(e);let t=ms(e,o);t<a&&(l=0,h=Object.assign({},o),a=t)}Cs(e,h)};function _s(t,e,n){return e.map((function(e){return ys(t,e,n)}))}function Es(t,e){let n=new bs;t.forEach((function(t){let r=t.graph().root,i=gs(t,r,n,e);i.vs.forEach(((e,n)=>t.node(e).order=n)),ws(t,n,i.vs)}))}function Cs(t,e){Object.values(e).forEach((e=>e.forEach(((e,n)=>t.node(e).order=n))))}let Os=Hr.Graph,Ms=ii;var ks=function(t){let e,n=Ms.buildLayerMatrix(t),r=Object.assign(Ss(t,n),Ns(t,n)),i={};["u","d"].forEach((s=>{e="u"===s?n:Object.values(n).reverse(),["l","r"].forEach((n=>{"r"===n&&(e=e.map((t=>Object.values(t).reverse())));let o=("u"===s?t.predecessors:t.successors).bind(t),h=js(t,e,r,o),a=Is(t,e,h.root,h.align,"r"===n);"r"===n&&(a=Ms.mapValues(a,(t=>-t))),i[s+n]=a}))}));let s=Ls(t,i);return Rs(i,s),Ps(i,t.graph().align)};function Ss(t,e){let n={};return e.length&&e.reduce((function(e,r){let i=0,s=0,o=e.length,h=r[r.length-1];return r.forEach(((e,a)=>{let u=function(t,e){if(t.node(e).dummy)return t.predecessors(e).find((e=>t.node(e).dummy))}(t,e),l=u?t.node(u).order:o;(u||e===h)&&(r.slice(s,a+1).forEach((e=>{t.predecessors(e).forEach((r=>{let s=t.node(r),o=s.order;!(o<i||l<o)||s.dummy&&t.node(e).dummy||As(n,r,e)}))})),s=a+1,i=l)})),r})),n}function Ns(t,e){let n={};function r(e,r,i,s,o){let h;Ms.range(r,i).forEach((r=>{h=e[r],t.node(h).dummy&&t.predecessors(h).forEach((e=>{let r=t.node(e);r.dummy&&(r.order<s||r.order>o)&&As(n,e,h)}))}))}return e.length&&e.reduce((function(e,n){let i,s=-1,o=0;return n.forEach(((h,a)=>{if("border"===t.node(h).dummy){let e=t.predecessors(h);e.length&&(i=t.node(e[0]).order,r(n,o,a,s,i),o=a,s=i)}r(n,o,n.length,i,e.length)})),n})),n}function As(t,e,n){if(e>n){let t=e;e=n,n=t}let r=t[e];r||(t[e]=r={}),r[n]=!0}function Ts(t,e,n){if(e>n){let t=e;e=n,n=t}return!!t[e]&&Object.hasOwn(t[e],n)}function js(t,e,n,r){let i={},s={},o={};return e.forEach((t=>{t.forEach(((t,e)=>{i[t]=t,s[t]=t,o[t]=e}))})),e.forEach((t=>{let e=-1;t.forEach((t=>{let h=r(t);if(h.length){h=h.sort(((t,e)=>o[t]-o[e]));let r=(h.length-1)/2;for(let a=Math.floor(r),u=Math.ceil(r);a<=u;++a){let r=h[a];s[t]===t&&e<o[r]&&!Ts(n,t,r)&&(s[r]=t,s[t]=i[t]=i[r],e=o[r])}}}))})),{root:i,align:s}}function Is(t,e,n,r,i){let s={},o=function(t,e,n,r){let i=new Os,s=t.graph(),o=function(t,e,n){return(r,i,s)=>{let o,h=r.node(i),a=r.node(s),u=0;if(u+=h.width/2,Object.hasOwn(h,"labelpos"))switch(h.labelpos.toLowerCase()){case"l":o=-h.width/2;break;case"r":o=h.width/2}if(o&&(u+=n?o:-o),o=0,u+=(h.dummy?e:t)/2,u+=(a.dummy?e:t)/2,u+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":o=a.width/2;break;case"r":o=-a.width/2}return o&&(u+=n?o:-o),o=0,u}}(s.nodesep,s.edgesep,r);return e.forEach((e=>{let r;e.forEach((e=>{let s=n[e];if(i.setNode(s),r){var h=n[r],a=i.edge(h,s);i.setEdge(h,s,Math.max(o(t,e,r),a||0))}r=e}))})),i}(t,e,n,i),h=i?"borderLeft":"borderRight";function a(t,e){let n=o.nodes(),r=n.pop(),i={};for(;r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return a((function(t){s[t]=o.inEdges(t).reduce(((t,e)=>Math.max(t,s[e.v]+o.edge(e))),0)}),o.predecessors.bind(o)),a((function(e){let n=o.outEdges(e).reduce(((t,e)=>Math.min(t,s[e.w]-o.edge(e))),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==h&&(s[e]=Math.max(s[e],n))}),o.successors.bind(o)),Object.keys(r).forEach((t=>s[t]=s[n[t]])),s}function Ls(t,e){return Object.values(e).reduce(((e,n)=>{let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(n).forEach((([e,n])=>{let s=function(t,e){return t.node(e).width}(t,e)/2;r=Math.max(n+s,r),i=Math.min(n-s,i)}));const s=r-i;return s<e[0]&&(e=[s,n]),e}),[Number.POSITIVE_INFINITY,null])[1]}function Rs(t,e){let n=Object.values(e),r=Ms.applyWithChunking(Math.min,n),i=Ms.applyWithChunking(Math.max,n);["u","d"].forEach((n=>{["l","r"].forEach((s=>{let o=n+s,h=t[o];if(h===e)return;let a=Object.values(h),u=r-Ms.applyWithChunking(Math.min,a);"l"!==s&&(u=i-Ms.applyWithChunking(Math.max,a)),u&&(t[o]=Ms.mapValues(h,(t=>t+u)))}))}))}function Ps(t,e){return Ms.mapValues(t.ul,((n,r)=>{if(e)return t[e.toLowerCase()][r];{let e=Object.values(t).map((t=>t[r])).sort(((t,e)=>t-e));return(e[1]+e[2])/2}}))}let Ds=ii,zs=ks;let Fs=mi,$s=yi,Ys=Bi,Xs=ii.normalizeRanks,Gs=function(t){let e=function(t){let e={},n=0;function r(i){let s=n;t.children(i).forEach(r),e[i]={low:s,lim:n++}}return t.children().forEach(r),e}(t);t.graph().dummyChains.forEach((n=>{let r=t.node(n),i=r.edgeObj,s=function(t,e,n,r){let i,s,o=[],h=[],a=Math.min(e[n].low,e[r].low),u=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),o.push(i)}while(i&&(e[i].low>a||u>e[i].lim));s=i,i=r;for(;(i=t.parent(i))!==s;)h.push(i);return{path:o.concat(h.reverse()),lca:s}}(t,e,i.v,i.w),o=s.path,h=s.lca,a=0,u=o[a],l=!0;for(;n!==i.w;){if(r=t.node(n),l){for(;(u=o[a])!==h&&t.node(u).maxRank<r.rank;)a++;u===h&&(l=!1)}if(!l){for(;a<o.length-1&&t.node(u=o[a+1]).minRank<=r.rank;)a++;u=o[a]}t.setParent(n,u),n=t.successors(n)[0]}}))},qs=ii.removeEmptyRanks,Bs={run:function(t){let e=Hi.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,i){var s=t.children(r);s&&s.length&&s.forEach((t=>n(t,i+1))),e[r]=i}return t.children().forEach((t=>n(t,1))),e}(t),r=Object.values(n),i=Hi.applyWithChunking(Math.max,r)-1,s=2*i+1;t.graph().nestingRoot=e,t.edges().forEach((e=>t.edge(e).minlen*=s));let o=function(t){return t.edges().reduce(((e,n)=>e+t.edge(n).weight),0)}(t)+1;t.children().forEach((r=>Zi(t,e,s,o,i,n,r))),t.graph().nodeRankFactor=s},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((e=>{t.edge(e).nestingEdge&&t.removeEdge(e)}))}},Vs=function(t){t.children().forEach((function e(n){let r=t.children(n),i=t.node(n);if(r.length&&r.forEach(e),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let e=i.minRank,r=i.maxRank+1;e<r;++e)Qi(t,"borderLeft","_bl",n,i,e),Qi(t,"borderRight","_br",n,i,e)}}))},Ws={adjust:function(t){let e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||Ki(t)},undo:function(t){let e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){t.nodes().forEach((e=>ts(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);n.points.forEach(ts),Object.hasOwn(n,"y")&&ts(n)}))}(t);"lr"!==e&&"rl"!==e||(!function(t){t.nodes().forEach((e=>es(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);n.points.forEach(es),Object.hasOwn(n,"x")&&es(n)}))}(t),Ki(t))}},Hs=vs,Zs=function(t){(function(t){let e=Ds.buildLayerMatrix(t),n=t.graph().ranksep,r=0;e.forEach((e=>{const i=e.reduce(((e,n)=>{const r=t.node(n).height;return e>r?e:r}),0);e.forEach((e=>t.node(e).y=r+i/2)),r+=i+n}))})(t=Ds.asNonCompoundGraph(t)),Object.entries(zs(t)).forEach((([e,n])=>t.node(e).x=n))},Us=ii,Qs=Hr.Graph;var Ks=function(t,e){let n=e&&e.debugTiming?Us.time:Us.notime;n("layout",(()=>{let r=n(" buildLayoutGraph",(()=>function(t){let e=new Qs({multigraph:!0,compound:!0}),n=ao(t.graph());return e.setGraph(Object.assign({},to,ho(n,Js),Us.pick(n,eo))),t.nodes().forEach((n=>{const r=ho(ao(t.node(n)),no);Object.keys(ro).forEach((t=>{void 0===r[t]&&(r[t]=ro[t])})),e.setNode(n,r),e.setParent(n,t.parent(n))})),t.edges().forEach((n=>{let r=ao(t.edge(n));e.setEdge(n,Object.assign({},so,ho(r,io),Us.pick(r,oo)))})),e}(t)));n(" runLayout",(()=>function(t,e,n){e(" makeSpaceForEdgeLabels",(()=>function(t){let e=t.graph();e.ranksep/=2,t.edges().forEach((n=>{let r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t))),e(" removeSelfEdges",(()=>function(t){t.edges().forEach((e=>{if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t))),e(" acyclic",(()=>Fs.run(t))),e(" nestingGraph.run",(()=>Bs.run(t))),e(" rank",(()=>Ys(Us.asNonCompoundGraph(t)))),e(" injectEdgeLabelProxies",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);if(n.width&&n.height){let n=t.node(e.v),r={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};Us.addDummyNode(t,"edge-proxy",r,"_ep")}}))}(t))),e(" removeEmptyRanks",(()=>qs(t))),e(" nestingGraph.cleanup",(()=>Bs.cleanup(t))),e(" normalizeRanks",(()=>Xs(t))),e(" assignRankMinMax",(()=>function(t){let e=0;t.nodes().forEach((n=>{let r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank))})),t.graph().maxRank=e}(t))),e(" removeEdgeLabelProxies",(()=>function(t){t.nodes().forEach((e=>{let n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t))),e(" normalize.run",(()=>$s.run(t))),e(" parentDummyChains",(()=>Gs(t))),e(" addBorderSegments",(()=>Vs(t))),e(" order",(()=>Hs(t,n))),e(" insertSelfEdges",(()=>function(t){var e=Us.buildLayerMatrix(t);e.forEach((e=>{var n=0;e.forEach(((e,r)=>{var i=t.node(e);i.order=r+n,(i.selfEdges||[]).forEach((e=>{Us.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))}(t))),e(" adjustCoordinateSystem",(()=>Ws.adjust(t))),e(" position",(()=>Zs(t))),e(" positionSelfEdges",(()=>function(t){t.nodes().forEach((e=>{var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,s=r.y,o=n.x-i,h=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*o/3,y:s-h},{x:i+5*o/6,y:s-h},{x:i+o,y:s},{x:i+5*o/6,y:s+h},{x:i+2*o/3,y:s+h}],n.label.x=n.x,n.label.y=n.y}}))}(t))),e(" removeBorderNodes",(()=>function(t){t.nodes().forEach((e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),s=t.node(n.borderLeft[n.borderLeft.length-1]),o=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-s.x),n.height=Math.abs(i.y-r.y),n.x=s.x+n.width/2,n.y=r.y+n.height/2}})),t.nodes().forEach((e=>{"border"===t.node(e).dummy&&t.removeNode(e)}))}(t))),e(" normalize.undo",(()=>$s.undo(t))),e(" fixupEdgeLabelCoords",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t))),e(" undoCoordinateSystem",(()=>Ws.undo(t))),e(" translateGraph",(()=>function(t){let e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,s=t.graph(),o=s.marginx||0,h=s.marginy||0;function a(t){let s=t.x,o=t.y,h=t.width,a=t.height;e=Math.min(e,s-h/2),n=Math.max(n,s+h/2),r=Math.min(r,o-a/2),i=Math.max(i,o+a/2)}t.nodes().forEach((e=>a(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);Object.hasOwn(n,"x")&&a(n)})),e-=o,r-=h,t.nodes().forEach((n=>{let i=t.node(n);i.x-=e,i.y-=r})),t.edges().forEach((n=>{let i=t.edge(n);i.points.forEach((t=>{t.x-=e,t.y-=r})),Object.hasOwn(i,"x")&&(i.x-=e),Object.hasOwn(i,"y")&&(i.y-=r)})),s.width=n-e+o,s.height=i-r+h}(t))),e(" assignNodeIntersects",(()=>function(t){t.edges().forEach((e=>{let n,r,i=t.edge(e),s=t.node(e.v),o=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=o,r=s),i.points.unshift(Us.intersectRect(s,n)),i.points.push(Us.intersectRect(o,r))}))}(t))),e(" reversePoints",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);n.reversed&&n.points.reverse()}))}(t))),e(" acyclic.undo",(()=>Fs.undo(t)))}(r,n,e))),n(" updateInputGraph",(()=>function(t,e){t.nodes().forEach((n=>{let r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,r.rank=i.rank,e.children(n).length&&(r.width=i.width,r.height=i.height))})),t.edges().forEach((n=>{let r=t.edge(n),i=e.edge(n);r.points=i.points,Object.hasOwn(i,"x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,r)))}))};let Js=["nodesep","edgesep","ranksep","marginx","marginy"],to={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},eo=["acyclicer","ranker","rankdir","align"],no=["width","height"],ro={width:0,height:0},io=["minlen","weight","width","height","labeloffset"],so={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},oo=["labelpos"];function ho(t,e){return Us.mapValues(Us.pick(t,e),Number)}function ao(t){var e={};return t&&Object.entries(t).forEach((([t,n])=>{"string"==typeof t&&(t=t.toLowerCase()),e[t]=n})),e}let uo=ii,lo=Hr.Graph;var co={graphlib:Hr,layout:Ks,debug:{debugOrdering:function(t){let e=uo.buildLayerMatrix(t),n=new lo({compound:!0,multigraph:!0}).setGraph({});return t.nodes().forEach((e=>{n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),t.edges().forEach((t=>n.setEdge(t.v,t.w,{},t.name))),e.forEach(((t,e)=>{let r="layer"+e;n.setNode(r,{rank:"same"}),t.reduce(((t,e)=>(n.setEdge(t,e,{style:"invis"}),e)))})),n}},util:{time:ii.time,notime:ii.notime},version:"1.1.4"};const fo=(t,e,n)=>{const{x:r,y:i}=t,s=e.x,o=e.y,h=(null==n?void 0:n.x)??r,a=(null==n?void 0:n.y)??i,u=s-r<0?-1:1,l=o-i<0?-1:1;let c=Math.abs(s-r)/2<35?Math.abs(s-r)/2:35;c=Math.abs(o-i)/2<c?Math.abs(o-i)/2:c;const d=Math.abs(s-r)/2-c;return[`M ${h} ${a}`,`L ${h} ${i}`,`L ${r} ${i}`,`L ${r+d*u} ${i}`,`C ${r+d*u+c*u} ${i} ${r+d*u+c*u} ${i} ${r+d*u+c*u} ${i+c*l}`,`L ${r+d*u+c*u} ${o-c*l}`,`C ${r+d*u+c*u} ${o} ${r+d*u+c*u} ${o} ${s-d*u} ${o}`,`L ${s} ${o}`].join(" ")},po=(t,e,n,r={sy:0})=>{const{x:i}=t;let{y:s}=t;const o=e.x,h=e.y,a=(null==n?void 0:n.x)??i,u=(null==n?void 0:n.y)??s,l=o-i<0?-1:1,c=h-s<0?-1:1;s+=r.sy;let d=Math.abs(o-i)/2<35?Math.abs(o-i)/2:35;d=Math.abs(h-s)/2<d?Math.abs(h-s)/2:d;const f=Math.abs(h-s)/2-d;return[`M ${a} ${u}`,`L ${i} ${u}`,`L ${i} ${s}`,`L ${i} ${s+f*c}`,`C ${i} ${s+f*c+d*c} ${i} ${s+f*c+d*c} ${i+d*l} ${s+f*c+d*c}`,`L ${i+(Math.abs(o-i)-2*d)*l+d*l} ${s+f*c+d*c}`,`C ${o} ${s+f*c+d*c} ${o} ${s+f*c+d*c} ${o} ${h-f*c}`,`L ${o} ${h}`].join(" ")},mo={bottom:{calculateEdge:po,edgeMidX:({node:t})=>t.x,edgeMidY:({node:t})=>t.y+t.height/2,edgeParentX:({parent:t})=>t.x,edgeParentY:({parent:t})=>t.y-t.height/2,edgeX:({node:t})=>t.x,edgeY:({node:t})=>t.y+t.height/2,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y,leafHeight:({childLength:t,childrenSpacing:e,nodeHeight:n})=>(n+e)*t,leafWidth:({nodeWidth:t})=>t,leafX:()=>0,leafY:({childrenSpacing:t,index:e,nodeHeight:n})=>(n+t)*-e},left:{calculateEdge:fo,edgeMidX:({node:t})=>t.x-t.width/2,edgeMidY:({node:t})=>t.y,edgeParentX:({parent:t})=>t.x+t.width/2,edgeParentY:({parent:t})=>t.y,edgeX:({node:t})=>t.x-t.width/2,edgeY:({node:t})=>t.y,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({nodeHeight:t})=>t,leafWidth:({childLength:t,nodeWidth:e})=>e*t,leafX:({childrenSpacing:t,index:e,nodeWidth:n})=>(n+t)*e,leafY:()=>0},right:{calculateEdge:fo,edgeMidX:({node:t})=>t.x+t.width/2,edgeMidY:({node:t})=>t.y,edgeParentX:({parent:t})=>t.x-t.width/2,edgeParentY:({parent:t})=>t.y,edgeX:({node:t})=>t.x+t.width/2,edgeY:({node:t})=>t.y,leafGroupX:({node:t})=>t.x,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({nodeHeight:t})=>t,leafWidth:({childLength:t,nodeWidth:e})=>e*t,leafX:({childrenSpacing:t,index:e,nodeWidth:n})=>(n+t)*-e,leafY:()=>0},top:{calculateEdge:po,edgeMidX:({node:t})=>t.x,edgeMidY:({node:t})=>t.y-t.height/2,edgeParentX:({parent:t})=>t.x,edgeParentY:({parent:t})=>t.y+t.height/2,edgeX:({node:t})=>t.x,edgeY:({node:t})=>t.y-t.height/2,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({childLength:t,childrenSpacing:e,nodeHeight:n})=>(n+e)*t,leafWidth:({nodeWidth:t})=>t,leafX:()=>0,leafY:({childrenSpacing:t,index:e,nodeHeight:n})=>(n+t)*e}},go={bottom:"BT",left:"LR",right:"RL",top:"TB"},yo={borderColor:"#BCBCBC",borderColorHover:"#5C6BC0",borderRadius:"5px",borderStyle:"solid",borderWidth:1,canvasStyle:"",childrenSpacing:50,containerClassName:"root",contentKey:"name",direction:"top",edgeColor:"#BCBCBC",edgeColorHover:"#5C6BC0",edgeWidth:1,enableExpandCollapse:!1,enableToolbar:!1,enableTooltip:!1,expandCollapseButtonBGColor:"#FFFFFF",expandCollapseButtonBorderColor:"#BCBCBC",fontColor:"#000000",fontFamily:"",fontSize:"14px",fontWeight:"400",groupLeafNodes:!1,groupLeafNodesSpacing:10,height:"auto",highlightOnHover:!0,nodeBGColor:"#FFFFFF",nodeBGColorHover:"#FFFFFF",nodeClassName:"apextree-node",nodeHeight:30,nodeStyle:"",nodeTemplate:t=>`<div style='display: flex;justify-content: center;align-items: center; text-align: center; height: 100%;'>${t}</div>`,nodeWidth:50,onNodeClick:void 0,siblingSpacing:50,tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#BCBCBC",tooltipFontColor:"#000000",tooltipFontSize:"12px",tooltipId:"apextree-tooltip-container",tooltipMaxWidth:void 0,tooltipMinWidth:100,tooltipPadding:8,tooltipOffset:10,viewPortHeight:600,viewPortWidth:800,width:"100%"},wo=(t,e={})=>{for(const n in e)null==t||t.setAttribute(n,e[n])},bo=(t,e,n,r,i)=>{const s=null==t?void 0:t.options,o=(null==s?void 0:s.borderWidth)||r.borderWidth;let h=(null==s?void 0:s.borderColor)||r.borderColor,a=(null==s?void 0:s.nodeBGColor)||r.nodeBGColor;n&&(h=(null==s?void 0:s.borderColorHover)||r.borderColorHover,a=(null==s?void 0:s.nodeBGColorHover)||r.nodeBGColorHover);const u=i.querySelector(`[data-self='${t.id}'] foreignObject div`);if(u&&!t.id.endsWith("_leafs")&&(u.style.borderWidth=`${o}px`,u.style.borderColor=h,u.style.backgroundColor=a),t.parent){const s=i.getElementById(`${t.parent}-${t.id}`);wo(s,n?{stroke:r.edgeColorHover,"stroke-width":r.edgeWidth+1}:{stroke:r.edgeColor,"stroke-width":r.edgeWidth}),t.parent&&bo(e[t.parent],e,n,r,i)}};function xo(t,e,n){const{children:r,...i}=t,s={...i,children:r?r.map((t=>t.id)):[],parent:e?e.id:void 0};if(n[s.id]=s,null==r?void 0:r.length)for(const o of r)xo(o,s,n)}function vo(t){const e={};return xo(t,void 0,e),e}function _o(t,e,n,r,i,s){const{bgColor:o,borderColor:h,fontColor:a,fontSize:u,fontFamily:l,maxWidth:c,minWidth:d,offset:f,padding:p,tooltipId:m}=e,g=document.createElement("div");g.style.position="absolute",g.style.visibility="hidden",g.style.width=`${c}px`,g.style.minWidth=`${d}px`,g.style.padding=`${p}px`,g.style.fontSize=u,g.style.fontFamily=l,g.style.wordWrap="break-word",g.style.whiteSpace="normal",g.innerHTML=n,document.body.appendChild(g);const y=g.offsetHeight,w=g.offsetWidth;document.body.removeChild(g);const b=function(t,e,n,r,i){const s=window.innerWidth,o=window.innerHeight,h=window.scrollX||document.documentElement.scrollLeft,a=window.scrollY||document.documentElement.scrollTop,u=10;let l="top",c=t,d=e-r-i;const f=e-a;f-r-i<u&&(l="bottom",d=e+i,f+i+r>o-u&&(l="top",d=a+u));const p=t-h;if(p+n>s-u&&(c=h+s-n-u),p<u&&(c=h+u),"top"===l||"bottom"===l){const e=t-n/2,r=e-h;r>=u&&r+n<=s-u&&(c=e)}return{placement:l,x:c,y:d}}(r,i,w,y,f),x=(({bgColor:t,borderColor:e,fontColor:n,fontFamily:r,fontSize:i,fontWeight:s,maxWidth:o,padding:h,placement:a="top",x:u,y:l})=>{const c=["position: absolute;","z-index: 1000;","pointer-events: none;"];return c.push("box-sizing: border-box;"),c.push("word-wrap: break-word;"),c.push("overflow-wrap: break-word;"),c.push(`left: ${u}px;`),c.push(`top: ${l}px;`),c.push(`data-placement: ${a};`),o&&(c.push(`width: ${o}px;`),c.push(`max-width: ${o}px;`)),e&&c.push(`border: 1px solid ${e};`),c.push("border-radius: 5px;"),n&&c.push(`color: ${n};`),r&&c.push(`font-family: ${r};`),s&&c.push(`font-weight: ${s};`),i&&c.push(`font-size: ${i};`),t&&c.push(`background-color: ${t};`),void 0!==h&&c.push(`padding: ${h}px;`),c.join(" ")})({bgColor:o,borderColor:h,fontColor:a,fontFamily:l,fontSize:u,fontWeight:"400",maxWidth:c,padding:p,placement:b.placement,x:b.x,y:b.y});ur(t,m,`${x} min-width: ${d}px; word-wrap: break-word; white-space: normal; overflow-wrap: break-word; line-height: 1.4;`,n)}function Eo(t,e){ur(t,e)}const Co={},Oo=[];function Mo(t,e){if(Array.isArray(t))for(const n of t)Mo(n,e);else if("object"!=typeof t)So(Object.getOwnPropertyNames(e)),Co[t]=Object.assign(Co[t]||{},e);else for(const n in t)Mo(n,t[n])}function ko(t){return Co[t]||{}}function So(t){Oo.push(...t)}function No(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function Ao(t){return t%360*Math.PI/180}function To(t){return t.charAt(0).toUpperCase()+t.slice(1)}function jo(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function Io(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:h,y:a}=e.bbox();s&&(r=r.includes("left")?h:r.includes("right")?h+n:h+n/2),o&&(i=i.includes("top")?a:i.includes("bottom")?a+t:a+t/2)}return[r,i]}const Lo=new Set(["desc","metadata","title"]),Ro=t=>Lo.has(t.nodeName),Po=(t,e,n={})=>{const r={...e};for(const i in r)r[i].valueOf()===n[i]&&delete r[i];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},Do="http://www.w3.org/2000/svg",zo="http://www.w3.org/2000/xmlns/",Fo="http://www.w3.org/1999/xlink",$o={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class Yo{}const Xo={},Go="___SYMBOL___ROOT___";function qo(t,e=Do){return $o.document.createElementNS(e,t)}function Bo(t,e=!1){if(t instanceof Yo)return t;if("object"==typeof t)return Ho(t);if(null==t)return new Xo[Go];if("string"==typeof t&&"<"!==t.charAt(0))return Ho($o.document.querySelector(t));const n=e?$o.document.createElement("div"):qo("svg");return n.innerHTML=t,t=Ho(n.firstChild),n.removeChild(n.firstChild),t}function Vo(t,e){return e&&(e instanceof $o.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:qo(t)}function Wo(t){if(!t)return null;if(t.instance instanceof Yo)return t.instance;if("#document-fragment"===t.nodeName)return new Xo.Fragment(t);let e=To(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":Xo[e]||(e="Dom"),new Xo[e](t)}let Ho=Wo;function Zo(t,e=t.name,n=!1){return Xo[e]=t,n&&(Xo[Go]=t),So(Object.getOwnPropertyNames(t.prototype)),t}let Uo=1e3;function Qo(t){return"Svgjs"+To(t)+Uo++}function Ko(t){for(let e=t.children.length-1;e>=0;e--)Ko(t.children[e]);return t.id?(t.id=Qo(t.nodeName),t):t}function Jo(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function th(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)}}Mo("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=Bo(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=Bo(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=Bo(t)).before(this),this},insertAfter:function(t){return(t=Bo(t)).after(this),this}});const eh=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,nh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rh=/rgb\((\d+),(\d+),(\d+)\)/,ih=/(#[a-z_][a-z0-9\-_]*)/i,sh=/\)\s*,?\s*/,oh=/\s/g,hh=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,ah=/^rgb\(/,uh=/^(\s+)?$/,lh=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ch=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,dh=/[\s,]+/,fh=/[MLHVCSQTAZ]/i;function ph(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function mh(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function gh(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}Mo("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(dh)},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)}}),Mo("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=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||uh.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||uh.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),Mo("Dom",{data:function(t,e,n){if(null==t)return this.data(No(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(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(r){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}}),Mo("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);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 yh{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof yh||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){const{random:n,round:r,sin:i,PI:s}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new yh(t,e,r,"lch")}if("sine"===t){const t=r(80*i(2*s*(e=null==e?n():e)/.5+.01)+150),o=r(50*i(2*s*e/.5+4.6)+200),h=r(100*i(2*s*e/.5+2.3)+150);return new yh(t,o,h)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new yh(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new yh(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new yh(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new yh(t,e,r,"lab")}if("grey"===t){const t=255*n();return new yh(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(hh.test(t)||ah.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);if(1===o)return new yh(0,0,0,1,"cmyk");return new yh((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),h=Math.min(r,i,s),a=(o+h)/2,u=o===h,l=o-h;return new yh(360*(u?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(u?0:a>.5?l/(2-o-h):l/(o+h)),100*a,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const c in this.space)delete this[this.space[c]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});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=mh(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:mh(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:mh(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:mh(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:mh(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:mh(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(ah.test(t)){const e=t.replace(oh,""),[n,r,i]=rh.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!hh.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=nh.exec((s=t,4===s.length?["#",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(""):s)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var s;const{_a:o,_b:h,_c:a,_d:u}=this,l="rgb"===this.space?{r:o,g:h,b:a}:"xyz"===this.space?{x:o,y:h,z:a}:"hsl"===this.space?{h:o,s:h,l:a}:"lab"===this.space?{l:o,a:h,b:a}:"lch"===this.space?{l:o,c:h,h:a}:"cmyk"===this.space?{c:o,m:h,y:a,k:u}:{};Object.assign(this,l)}lab(){const{x:t,y:e,z:n}=this.xyz();return new yh(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;i<0&&(i*=-1,i=360-i);return new yh(t,r,i,"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:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,h=i/500+o,a=o-s/200,u=16/116,l=.008856,c=7.787;t=.95047*(h**3>l?h**3:(h-u)/c),e=1*(o**3>l?o**3:(o-u)/c),n=1.08883*(a**3>l?a**3:(a-u)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,h=.0031308,a=r>h?1.055*o(r,1/2.4)-.055:12.92*r,u=i>h?1.055*o(i,1/2.4)-.055:12.92*i,l=s>h?1.055*o(s,1/2.4)-.055:12.92*s;return new yh(255*a,255*u,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e){n*=255;return new yh(n,n,n)}const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*gh(i,r,t+1/3),o=255*gh(i,r,t),h=255*gh(i,r,t-1/3);return new yh(s,o,h)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new yh(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(ph);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(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,h=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*h+.1805*a)/.95047,l=(.2126*o+.7152*h+.0722*a)/1,c=(.0193*o+.1192*h+.9505*a)/1.08883,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=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 yh(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class wh{constructor(...t){this.init(...t)}clone(){return new wh(this)}init(t,e){const n=0,r=0,i=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==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){xh.isMatrixLike(t)||(t=new xh(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 bh(t,e,n){return Math.abs(e-t)<1e-6}class xh{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,r=t.flip&&(e||"y"===t.flip)?-1:1,i=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]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,a=t.shear||0,u=t.rotate||t.theta||0,l=new wh(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,d=l.y,f=new wh(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new wh(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,w=g.y,b=new wh(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:h,skewX:i,skewY:s,shear:a,theta:u,rx:b.x,ry:b.y,tx:y,ty:w,ox:c,oy:d,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 r=t.a*e.a+t.c*e.b,i=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,a=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=h,n.f=a,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new xh(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,h=this.f,a=n*s-r*i,u=a>0?1:-1,l=u*Math.sqrt(n*n+r*r),c=Math.atan2(u*r,u*n),d=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/a,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*l+e*(m*f*l-p*g),translateY:h-e+t*p*l+e*(m*p*l+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new xh(t);return bh(this.a,e.a)&&bh(this.b,e.b)&&bh(this.c,e.c)&&bh(this.d,e.d)&&bh(this.e,e.e)&&bh(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=xh.fromArray([1,0,0,1,0,0]);return t=t instanceof Bh?t.matrixify():"string"==typeof t?xh.fromArray(t.split(dh).map(parseFloat)):Array.isArray(t)?xh.fromArray(t):"object"==typeof t&&xh.isMatrixLike(t)?t:"object"==typeof t?(new xh).transform(t):6===arguments.length?xh.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,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const h=r/o,a=-e/o,u=-n/o,l=t/o,c=-(h*i+u*s),d=-(a*i+l*s);return this.a=h,this.b=a,this.c=u,this.d=l,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof xh?t:new xh(t);return xh.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof xh?t:new xh(t);return xh.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=Ao(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:h,d:a,e:u,f:l}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=h*r-a*i,this.d=a*r+h*i,this.e=u*r-l*i+n*i-e*r+e,this.f=l*r+u*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:h,e:a,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=h*e,this.e=a*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:h,f:a}=this;return this.a=r+i*t,this.c=s+o*t,this.e=h+a*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=Ao(t),e=Ao(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:h,c:a,d:u,e:l,f:c}=this;return this.a=o+h*i,this.b=h+o*s,this.c=a+u*i,this.d=u+a*s,this.e=l+c*i-r*i,this.f=c+l*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(xh.isMatrixLike(t)){return new xh(t).multiplyO(this)}const e=xh.formatTransforms(t),{x:n,y:r}=new wh(e.ox,e.oy).transform(this),i=(new xh).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new wh(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}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 vh(){if(!vh.nodes){const t=Bo().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;vh.nodes={svg:t,path:e}}if(!vh.nodes.svg.node.parentNode){const t=$o.document.body||$o.document.documentElement;vh.nodes.svg.addTo(t)}return vh.nodes}function _h(t){return!(t.width||t.height||t.x||t.y)}Zo(xh,"Matrix");class Eh{constructor(...t){this.init(...t)}addOffset(){return this.x+=$o.window.pageXOffset,this.y+=$o.window.pageYOffset,new Eh(this)}init(t){return t="string"==typeof t?t.split(dh).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 _h(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new Eh(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof xh||(t=new xh(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new wh(this.x,this.y),new wh(this.x2,this.y),new wh(this.x,this.y2),new wh(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new Eh(e,r,n-e,i-r)}}function Ch(t,e,n){let r;try{if(r=e(t.node),_h(r)&&((i=t.node)!==$o.document&&!($o.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===$o.document}).call($o.document.documentElement,i)))throw new Error("Element not in the dom")}catch(s){r=n(t)}var i;return r}Mo({viewbox:{viewbox(t,e,n,r){return null==t?new Eh(this.attr("viewBox")):this.attr("viewBox",new Eh(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,h=Math.min(s,o);if(null==t)return h;let a=h/t;a===1/0&&(a=Number.MAX_SAFE_INTEGER/100),e=e||new wh(n/2/s+i.x,r/2/o+i.y);const u=new Eh(i).transform(new xh({scale:a,origin:e}));return this.viewbox(u)}}}),Zo(Eh,"Box");class Oh extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}Jo([Oh],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const Mh=["toArray","constructor","each"];function kh(t,e){return new Oh(No((e||$o.document).querySelectorAll(t),(function(t){return Wo(t)})))}Oh.extend=function(t){t=t.reduce(((t,e)=>(Mh.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),Jo([Oh],t)};let Sh=0;const Nh={};function Ah(t){let e=t.getEventHolder();return e===$o.window&&(e=Nh),e.events||(e.events={}),e.events}function Th(t){return t.getEventTarget()}function jh(t,e,n,r,i){const s=n.bind(r||t),o=Bo(t),h=Ah(o),a=Th(o);e=Array.isArray(e)?e:e.split(dh),n._svgjsListenerId||(n._svgjsListenerId=++Sh),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";h[e]=h[e]||{},h[e][r]=h[e][r]||{},h[e][r][n._svgjsListenerId]=s,a.addEventListener(e,s,i||!1)}))}function Ih(t,e,n,r){const i=Bo(t),s=Ah(i),o=Th(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(dh)).forEach((function(t){const e=t&&t.split(".")[0],h=t&&t.split(".")[1];let a,u;if(n)s[e]&&s[e][h||"*"]&&(o.removeEventListener(e,s[e][h||"*"][n],r||!1),delete s[e][h||"*"][n]);else if(e&&h){if(s[e]&&s[e][h]){for(u in s[e][h])Ih(o,[e,h].join("."),u);delete s[e][h]}}else if(h)for(t in s)for(a in s[t])h===a&&Ih(o,[t,h].join("."));else if(e){if(s[e]){for(a in s[e])Ih(o,[e,a].join("."));delete s[e]}}else{for(t in s)Ih(o,t);!function(t){let e=t.getEventHolder();e===$o.window&&(e=Nh),e.events&&(e.events={})}(i)}}))}class Lh extends Yo{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=Th(t);return e instanceof $o.window.Event||(e=new $o.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.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 r in n)for(const e in n[r])n[r][e](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 Ih(this,t,e,n),this}on(t,e,n,r){return jh(this,t,e,n,r),this}removeEventListener(){}}function Rh(){}Zo(Lh,"EventTarget");const Ph=400,Dh=">",zh=0,Fh={"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 $h 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(dh).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 Yh{constructor(...t){this.init(...t)}convert(t){return new Yh(this.value,t)}divide(t){return t=new Yh(t),new Yh(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(eh))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof Yh&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new Yh(t),new Yh(this-t,this.unit||t.unit)}plus(t){return t=new Yh(t),new Yh(this+t,this.unit||t.unit)}times(t){return t=new Yh(t),new Yh(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 Xh=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Gh=[];class qh extends Lh{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=Bo(t)).removeNamespace&&this.node instanceof $o.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 Bo(t).put(this,e)}children(){return new Oh(No(this.node.children,(function(t){return Wo(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=Ko(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new qh(qo(t),e))}first(){return Wo(this.node.firstChild)}get(t){return Wo(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=Qo(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return Wo(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=Wo(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=Wo(e.node.parentNode));return e}put(t,e){return t=Bo(t),this.add(t,e),t}putIn(t,e){return Bo(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=Bo(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const i in r)"number"==typeof r[i]&&(r[i]=Math.round(r[i]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,Do)}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=Wo(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 r=qo("wrapper",n),i=$o.document.createDocumentFragment();r.innerHTML=t;for(let o=r.children.length;o--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}Jo(qh,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=lh.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))?Fh[t]:lh.test(e)?parseFloat(e):e;"number"==typeof(e=Gh.reduce(((e,n)=>n(t,e,this)),e))?e=new Yh(e):Xh.has(t)&&yh.isColor(e)?e=new yh(e):e.constructor===Array&&(e=new $h(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 kh(t,this.node)},findOne:function(t){return Wo(this.node.querySelector(t))}}),Zo(qh,"Dom");class Bh extends qh{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??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 Yh(t).plus(this.x()))}dy(t=0){return this.y(new Yh(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=Bo(t));const n=new Oh;let r=this;for(;(r=r.parent())&&r.node!==$o.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(ih);return e?Bo(e[1]):null}root(){const t=this.parent(Xo[Go]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=jo(this,t,e);return this.width(new Yh(n.width)).height(new Yh(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return Po(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}Jo(Bh,{bbox:function(){const t=Ch(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(vh().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 Eh(t)},rbox:function(t){const e=Ch(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new Eh(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 wh(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new xh(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new xh(e)}return new xh(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new xh}}}),Zo(Bh,"Element");const Vh={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 yh||yh.isRgb(e)||e instanceof Bh)this.attr(t,e);else for(n=Vh[t].length-1;n>=0;n--)null!=e[Vh[t][n]]&&this.attr(Vh.prefix(t,Vh[t][n]),e[Vh[t][n]]);return this},Mo(["Element","Runner"],e)})),Mo(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new xh(this):this.attr("transform",new xh(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!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)}}),Mo("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Yh(t)):this.rx(t).ry(e)}}),Mo("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new wh(this.node.getPointAtLength(t))}}),Mo(["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)}});Mo("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),Mo("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(sh).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(dh).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(xh.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new xh)},toParent:function(t,e){if(this===t)return this;if(Ro(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.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 xh(this).decompose();return null==t?e:e[t]}xh.isMatrixLike(t)||(t={...t,origin:Io(t,this)});const n=new xh(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class Wh extends Bh{flatten(){return this.each((function(){if(this instanceof Wh)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,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}Zo(Wh,"Container");class Hh extends Wh{constructor(t,e=t){super(Vo("defs",t),e)}flatten(){return this}ungroup(){return this}}Zo(Hh,"Defs");class Zh extends Bh{}function Uh(t){return this.attr("rx",t)}function Qh(t){return this.attr("ry",t)}function Kh(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Jh(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function ta(t){return this.attr("cx",t)}function ea(t){return this.attr("cy",t)}function na(t){return null==t?2*this.rx():this.rx(new Yh(t).divide(2))}function ra(t){return null==t?2*this.ry():this.ry(new Yh(t).divide(2))}Zo(Zh,"Shape");const ia=Object.freeze(Object.defineProperty({__proto__:null,cx:ta,cy:ea,height:ra,rx:Uh,ry:Qh,width:na,x:Kh,y:Jh},Symbol.toStringTag,{value:"Module"}));class sa extends Zh{constructor(t,e=t){super(Vo("ellipse",t),e)}size(t,e){const n=jo(this,t,e);return this.rx(new Yh(n.width).divide(2)).ry(new Yh(n.height).divide(2))}}Jo(sa,ia),Mo("Container",{ellipse:th((function(t=0,e=t){return this.put(new sa).size(t,e).move(0,0)}))}),Zo(sa,"Ellipse");class oa extends qh{constructor(t=$o.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 qh(qo("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function ha(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Yh(t),fy:new Yh(e)}):this.attr({x1:new Yh(t),y1:new Yh(e)})}function aa(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Yh(t),cy:new Yh(e)}):this.attr({x2:new Yh(t),y2:new Yh(e)})}Zo(oa,"Fragment");const ua=Object.freeze(Object.defineProperty({__proto__:null,from:ha,to:aa},Symbol.toStringTag,{value:"Module"}));class la extends Wh{constructor(t,e){super(Vo(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 Eh}targets(){return kh("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()+")"}}Jo(la,ua),Mo({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:th((function(t,e){return this.put(new la(t)).update(e)}))}}),Zo(la,"Gradient");class ca extends Wh{constructor(t,e=t){super(Vo("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new Eh}targets(){return kh("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()+")"}}Mo({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:th((function(t,e,n){return this.put(new ca).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),Zo(ca,"Pattern");let da=class extends Zh{constructor(t,e=t){super(Vo("image",t),e)}load(t,e){if(!t)return this;const n=new $o.window.Image;return jh(n,"load",(function(t){const r=this.parent(ca);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof ca&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),jh(n,"load error",(function(){Ih(n)})),this.attr("href",n.src=t,Fo)}};!function(t){Gh.push(t)}((function(t,e,n){return"fill"!==t&&"stroke"!==t||ch.test(e)&&(e=n.root().defs().image(e)),e instanceof da&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e})),Mo({Container:{image:th((function(t,e){return this.put(new da).size(0,0).load(t,e)}))}}),Zo(da,"Image");class fa extends $h{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new Eh(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(dh).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.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){xh.isMatrixLike(t)||(t=new xh(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}const pa=fa;const ma=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:pa,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},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)}},Symbol.toStringTag,{value:"Module"}));class ga extends Zh{constructor(t,e=t){super(Vo("line",t),e)}array(){return new fa([[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,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new fa(t).toLine(),this.attr(t))}size(t,e){const n=jo(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}Jo(ga,ma),Mo({Container:{line:th((function(...t){return ga.prototype.plot.apply(this.put(new ga),null!=t[0]?t:[0,0,0,0])}))}}),Zo(ga,"Line");class ya extends Wh{constructor(t,e=t){super(Vo("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 wa(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}Mo({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:th((function(t,e,n){return this.put(new ya).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof ya?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),Zo(ya,"Marker");const ba={"-":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,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class xa{done(){return!1}}class va extends xa{constructor(t=Dh){super(),this.ease=ba[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class _a extends xa{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function Ea(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}Jo(class extends _a{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:wa("_duration",Ea),overshoot:wa("_overshoot",Ea)});Jo(class extends _a{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,h=this._windup;return!1!==h&&(s=Math.max(-h,Math.min(s,h))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:wa("_windup"),p:wa("P"),i:wa("I"),d:wa("D")});const Ca={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Oa={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]]}},Ma="mlhvqtcsaz".split("");for(let Mu=0,ku=Ma.length;Mu<ku;++Mu)Oa[Ma[Mu]]=function(t){return function(e,n,r){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 Oa[t](e,n,r)}}(Ma[Mu].toUpperCase());function ka(t){return t.segment.length&&t.segment.length-1===Ca[t.segment[0].toUpperCase()]}function Sa(t,e){t.inNumber&&Na(t,!1);const n=fh.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function Na(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,ka(t)&&Aa(t)}function Aa(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Oa[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function Ta(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 ja(t){return"E"===t.lastToken.toUpperCase()}const Ia=new Set([" ",",","\t","\n","\r","\f"]);class La extends $h{bbox(){return vh().path.setAttribute("d",this.toString()),new Eh(vh.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=t,this[i][2]+=e):"H"===r?this[i][1]+=t:"V"===r?this[i][1]+=e:"C"===r||"S"===r||"Q"===r?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===r&&(this[i][5]+=t,this[i][6]+=e)):"A"===r&&(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,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new wh,p:new wh};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!Sa(i,r))if("."!==r)if(isNaN(parseInt(r)))if(Ia.has(r))i.inNumber&&Na(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(fh.test(r)){if(i.inNumber)Na(i,!1);else{if(!ka(i))throw new Error("parser Error");Aa(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!ja(i)){Na(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||Ta(i)){i.inNumber=!0,i.number=r,Na(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){Na(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&Na(i,!1),i.inSegment&&ka(i)&&Aa(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;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 Ra=t=>{const e=typeof t;return"number"===e?Yh:"string"===e?yh.isColor(t)?yh:dh.test(t)?fh.test(t)?La:$h:eh.test(t)?Yh:Da:Ya.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?$h:"object"===e?$a:Da};class Pa{constructor(t){this._stepper=t||new va("-"),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(Ra(t));let e=new this._type(t);return this._type===yh&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===$a&&(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 Da{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 za{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,za.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}za.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Fa=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class $a{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===yh&&t[n+7]!==e[n+7]){const e=t[n+7],r=new yh(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),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 r=Ra(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(Fa),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(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const Ya=[Da,za,$a];class Xa extends Zh{constructor(t,e=t){super(Vo("path",t),e)}array(){return this._array||(this._array=new La(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 La(t))}size(t,e){const n=jo(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)}}Xa.prototype.MorphArray=La,Mo({Container:{path:th((function(t){return this.put(new Xa).plot(t||new La)}))}}),Zo(Xa,"Path");const Ga=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new fa(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 fa(t))},size:function(t,e){const n=jo(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));class qa extends Zh{constructor(t,e=t){super(Vo("polygon",t),e)}}Mo({Container:{polygon:th((function(t){return this.put(new qa).plot(t||new fa)}))}}),Jo(qa,ma),Jo(qa,Ga),Zo(qa,"Polygon");class Ba extends Zh{constructor(t,e=t){super(Vo("polyline",t),e)}}Mo({Container:{polyline:th((function(t){return this.put(new Ba).plot(t||new fa)}))}}),Jo(Ba,ma),Jo(Ba,Ga),Zo(Ba,"Polyline");class Va extends Zh{constructor(t,e=t){super(Vo("rect",t),e)}}Jo(Va,{rx:Uh,ry:Qh}),Mo({Container:{rect:th((function(t,e){return this.put(new Va).size(t,e)}))}}),Zo(Va,"Rect");class Wa{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 Ha={nextDraw:null,frames:new Wa,timeouts:new Wa,immediates:new Wa,timer:()=>$o.window.performance||$o.window.Date,transforms:[],frame(t){const e=Ha.frames.push({run:t});return null===Ha.nextDraw&&(Ha.nextDraw=$o.window.requestAnimationFrame(Ha._draw)),e},timeout(t,e){e=e||0;const n=Ha.timer().now()+e,r=Ha.timeouts.push({run:t,time:n});return null===Ha.nextDraw&&(Ha.nextDraw=$o.window.requestAnimationFrame(Ha._draw)),r},immediate(t){const e=Ha.immediates.push(t);return null===Ha.nextDraw&&(Ha.nextDraw=$o.window.requestAnimationFrame(Ha._draw)),e},cancelFrame(t){null!=t&&Ha.frames.remove(t)},clearTimeout(t){null!=t&&Ha.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ha.immediates.remove(t)},_draw(t){let e=null;const n=Ha.timeouts.last();for(;(e=Ha.timeouts.shift())&&(t>=e.time?e.run():Ha.timeouts.push(e),e!==n););let r=null;const i=Ha.frames.last();for(;r!==i&&(r=Ha.frames.shift());)r.run(t);let s=null;for(;s=Ha.immediates.shift();)s();Ha.nextDraw=Ha.timeouts.first()||Ha.frames.first()?$o.window.requestAnimationFrame(Ha._draw):null}},Za=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Ua=function(){const t=$o.window;return(t.performance||t.Date).now()};class Qa extends Lh{constructor(t=Ua){super(),this._timeSource=t,this.terminate()}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(Za);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+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 Ha.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ha.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let s=this._runners.length;s--;){const t=this._runners[s],e=t.runner;this._time-t.start<=0&&e.reset()}let i=!1;for(let s=0,o=this._runners.length;s<o;s++){const t=this._runners[s],e=t.runner;let n=r;const h=this._time-t.start;if(h<=0){i=!0;continue}if(h<n&&(n=h),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--s,--o)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){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)}}Mo({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Qa,this._timeline):(this._timeline=t,this)}}});class Ka extends Lh{constructor(t){super(),this.id=Ka.id++,t="function"==typeof(t=null==t?Ph:t)?new _a(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof _a,this._stepper=this._isDeclarative?t:new va,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new xh,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 r=1,i=!1,s=0;return e=e??zh,n=n||"last","object"!=typeof(t=t??Ph)||t instanceof xa||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,s=t.wait??s,t=t.duration??Ph),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Ka.sanitise(t,e,n),i=new Ka(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new xh,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 va(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,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let h;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,h=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(h,1),0)},a=i*(r+n)-r;return h=e<=0?Math.round(t(1e-5)):e<a?t(e):Math.round(t(a-1e-5)),h}const a=Math.floor(this.loops()),u=s&&a%2==0;return h=a+(u&&!o||o&&u?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,r){this._queue.push({initialiser:t||Rh,runner:e||Rh,retarget:n,isTransform:r,initialised:!1,finished:!1});return 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 Qa||(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 r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let h=!1;return(n||o)&&(this._initialise(n),this.transforms=new xh,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],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&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,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.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 r=this.timeline();return r&&r.play(),!0}return!1}}Ka.id=0;class Ja{constructor(t=new xh,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}Jo([Ka,Ja],{mergeWith(t){return new Ja(t.transforms.lmultiply(this.transforms),t.id)}});const tu=(t,e)=>t.lmultiplyO(e),eu=t=>t.transforms;function nu(){const t=this._transformationRunners.runners.map(eu).reduce(tu,new xh);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class ru{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 Ja).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))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}Mo({Element:{animate(t,e,n){const r=Ka.sanitise(t,e,n),i=this.timeline();return new Ka(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.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(eu).reduce(tu,new xh)},_addRunner(t){this._transformationRunners.add(t),Ha.cancelImmediate(this._frameId),this._frameId=Ha.immediate(nu.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new ru).add(new Ja(new xh(this))))}}});Jo(Ka,{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 r=e;if(this._tryRetarget(t,r))return this;let i=new Pa(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.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 $a(i.from()).valueOf();Object.assign(n,e),i.from(n)}const a=new $a(i.to()).valueOf();Object.assign(a,e),i.to(a),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new Pa(this._stepper).to(new Yh(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,r){e=r,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 r=xh.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new Pa(this._stepper).type(n?za:xh);let s,o,h,a,u;return this.queue((function(){o=o||this.element(),s=s||Io(t,o),u=new xh(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:d}=new wh(s).transform(o._currentTransform(this));let f=new xh({...t,origin:[c,d]}),p=this._isDeclarative&&h?h:u;if(n){f=f.decompose(c,d),p=p.decompose(c,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);f.rotate=n[s]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&a&&(p.rotate=a)),i.from(p),i.to(f);const m=i.at(l);return a=m.rotate,h=new xh(m),this.addTransform(h),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=Io(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",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 Yh(e),this._tryRetarget(t,e))return this;const n=new Pa(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new Yh(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new Pa(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 Yh(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(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,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new Pa(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new Eh(t,e,n,r))},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)}}),Jo(Ka,{rx:Uh,ry:Qh,from:ha,to:aa}),Zo(Ka,"Runner");class iu extends Wh{constructor(t,e=t){super(Vo("svg",t),e),this.namespace()}defs(){return this.isRoot()?Wo(this.node.querySelector("defs"))||this.put(new Hh):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof $o.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:Do,version:"1.1"}).attr("xmlns:xlink",Fo,zo):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,zo).attr("xmlns:svgjs",null,zo)}root(){return this.isRoot()?this:super.root()}}Mo({Container:{nested:th((function(){return this.put(new iu)}))}}),Zo(iu,"Svg",!0);let su=class extends Wh{constructor(t,e=t){super(Vo("symbol",t),e)}};Mo({Container:{symbol:th((function(){return this.put(new su)}))}}),Zo(su,"Symbol");const ou=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(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)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild($o.document.createTextNode(t)),this},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)}},Symbol.toStringTag,{value:"Module"}));class hu extends Zh{constructor(t,e=t){super(Vo("text",t),e),this.dom.leading=this.dom.leading??new Yh(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Yh(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(r){if(Ro(this.node))return;const i=$o.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new Yh(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Yh(t.leading||1.3),this}writeDataToDom(){return Po(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||Ro(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===Wo(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);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()}}Jo(hu,ou),Mo({Container:{text:th((function(t=""){return this.put(new hu).text(t)})),plain:th((function(t=""){return this.put(new hu).plain(t)}))}}),Zo(hu,"Text");class au extends Zh{constructor(t,e=t){super(Vo("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 hu))return this;const e=t.index(this),n=$o.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new Yh(n);return this.dy(e?r: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)}}Jo(au,ou),Mo({Tspan:{tspan:th((function(t=""){const e=new au;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),Zo(au,"Tspan");class uu extends Zh{constructor(t,e=t){super(Vo("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 Yh(t).divide(2))}}Jo(uu,{x:Kh,y:Jh,cx:ta,cy:ea,width:na,height:ra}),Mo({Container:{circle:th((function(t=0){return this.put(new uu).size(t).move(0,0)}))}}),Zo(uu,"Circle");class lu extends Wh{constructor(t,e=t){super(Vo("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return kh("svg [clip-path*="+this.id()+"]")}}Mo({Container:{clip:th((function(){return this.defs().put(new lu)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof lu?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),Zo(lu,"ClipPath");class cu extends Bh{constructor(t,e=t){super(Vo("foreignObject",t),e)}}Mo({Container:{foreignObject:th((function(t,e){return this.put(new cu).size(t,e)}))}}),Zo(cu,"ForeignObject");const du=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof $o.window.SVGSVGElement?new Eh(n.attr(["x","y","width","height"])):n.bbox()}catch(h){return}const i=new xh(n),s=i.translate(t,e).transform(i.inverse()),o=new wh(r.x,r.y).transform(s);n.move(o.x,o.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 r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=jo(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach((t=>{const e=new wh(n).transform(new xh(t).inverse());t.scale(i,s,e.x,e.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)}},Symbol.toStringTag,{value:"Module"}));class fu extends Wh{constructor(t,e=t){super(Vo("g",t),e)}}Jo(fu,du),Mo({Container:{group:th((function(){return this.put(new fu)}))}}),Zo(fu,"G");class pu extends Wh{constructor(t,e=t){super(Vo("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,Fo)}}Jo(pu,du),Mo({Container:{link:th((function(t){return this.put(new pu).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 pu,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}}}),Zo(pu,"A");class mu extends Wh{constructor(t,e=t){super(Vo("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return kh("svg [mask*="+this.id()+"]")}}Mo({Container:{mask:th((function(){return this.defs().put(new mu)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof mu?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),Zo(mu,"Mask");class gu extends Bh{constructor(t,e=t){super(Vo("stop",t),e)}update(t){return("number"==typeof t||t instanceof Yh)&&(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 Yh(t.offset)),this}}Mo({Gradient:{stop:function(t,e,n){return this.put(new gu).update(t,e,n)}}}),Zo(gu,"Stop");class yu extends Bh{constructor(t,e=t){super(Vo("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 r in e)n+=r.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[r]+";";return n+="}",n}(t,e))}}Mo("Dom",{style(t,e){return this.put(new yu).rule(t,e)},fontface(t,e,n){return this.put(new yu).font(t,e,n)}}),Zo(yu,"Style");class wu extends hu{constructor(t,e=t){super(Vo("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")}}Mo({Container:{textPath:th((function(t,e){return t instanceof hu||(t=this.text(t)),t.path(e)}))},Text:{path:th((function(t,e=!0){const n=new wu;let r;if(t instanceof Xa||(t=this.defs().path(t)),n.attr("href","#"+t,Fo),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:th((function(t){return t instanceof hu||(t=(new hu).addTo(this.parent()).text(t)),t.path(this)})),targets(){return kh("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),wu.prototype.MorphArray=La,Zo(wu,"TextPath");class bu extends Zh{constructor(t,e=t){super(Vo("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,Fo)}}Mo({Container:{use:th((function(t,e){return this.put(new bu).use(t,e)}))}}),Zo(bu,"Use");const xu=Bo;Jo([iu,su,da,ca,ya],ko("viewbox")),Jo([ga,Ba,qa,Xa],ko("marker")),Jo(hu,ko("Text")),Jo(Xa,ko("Path")),Jo(Hh,ko("Defs")),Jo([hu,au],ko("Tspan")),Jo([Va,sa,la,Ka],ko("radius")),Jo(Lh,ko("EventTarget")),Jo(qh,ko("Dom")),Jo(Bh,ko("Element")),Jo(Zh,ko("Shape")),Jo([Wh,oa],ko("Container")),Jo(la,ko("Gradient")),Jo(Ka,ko("Runner")),Oh.extend([...new Set(Oo)]),function(t=[]){Ya.push(...[].concat(t))}([Yh,yh,Eh,xh,$h,fa,La,wh]),Jo(Ya,{to(t){return(new Pa).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var vu=function(t){return t.touches||[{clientX:t.clientX,clientY:t.clientY}]};Jo(iu,{panZoom:function(t){var e,n,r,i,s,o,h,a,u,l,c,d,f=this;if(this.off(".panZoom"),!1===t)return this;var p,m,g=null!=(n=(t=null!=(e=t)?e:{}).zoomFactor)?n:2,y=null!=(r=t.zoomMin)?r:Number.MIN_VALUE,w=null!=(i=t.zoomMax)?i:Number.MAX_VALUE,b=null==(s=t.wheelZoom)||s,x=null==(o=t.pinchZoom)||o,v=null==(h=t.panning)||h,_=null!=(a=t.panButton)?a:0,E=null!=(u=t.oneFingerPan)&&u,C=null!=(l=t.margins)&&l,O=null!=(c=t.wheelZoomDeltaModeLinePixels)?c:17,M=null!=(d=t.wheelZoomDeltaModeScreenPixels)?d:53,k=!1,S=this.viewbox(),N=function(t){if(!C)return t;var e=C.top,n=C.left,r=C.bottom,i=C.right,s=f.attr(["width","height"]),o=s.width,h=s.height,a=f.node.preserveAspectRatio.baseVal,u=0,l=0,c=0,d=0;if(a.align!==a.SVG_PRESERVEASPECTRATIO_NONE){var p=o/h,m=S.width/S.height;if(m!==p){var g=a.meetOrSlice!==a.SVG_MEETORSLICE_SLICE,y=p>m?"width":"height",w="width"===y,b=g&&w||!g&&!w,x=b?p/m:m/p,v=t[y]-t[y]*x;b?a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMAX?(u=v/2,l=-v/2):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMAX?l=-v:a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMIN&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMID&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMAX||(u=v):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMAXYMID?(c=v/2,d=-v/2):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMAXYMIN?d=-v:a.align!==a.SVG_PRESERVEASPECTRATIO_XMINYMAX&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMIDYMAX&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMAX||(c=v)}}var _=S.width+S.x-n-u,E=S.x+i-t.width-l,O=S.height+S.y-e-c,M=S.y+r-t.height-d;return t.x=Math.min(_,Math.max(E,t.x)),t.y=Math.min(O,Math.max(M,t.y)),t},A=function t(e){(m=vu(e)).length<2?v&&E&&I.call(this,e):(v&&E&&L.call(this,e),e.preventDefault(),this.dispatch("pinchZoomStart",{event:e}).defaultPrevented||(this.off("touchstart.panZoom",t),k=!0,jh(document,"touchmove.panZoom",j,this,{passive:!1}),jh(document,"touchend.panZoom",T,this,{passive:!1})))},T=function t(e){e.preventDefault();var n=vu(e);n.length>1||(k=!1,this.dispatch("pinchZoomEnd",{event:e}),Ih(document,"touchmove.panZoom",j),Ih(document,"touchend.panZoom",t),this.on("touchstart.panZoom",A),n.length&&v&&E&&I.call(this,e))},j=function(t){t.preventDefault();var e=vu(t),n=this.zoom(),r=Math.sqrt(Math.pow(m[0].clientX-m[1].clientX,2)+Math.pow(m[0].clientY-m[1].clientY,2))/Math.sqrt(Math.pow(e[0].clientX-e[1].clientX,2)+Math.pow(e[0].clientY-e[1].clientY,2));(n<y&&r>1||n>w&&r<1)&&(r=1);var i={x:e[0].clientX+.5*(e[1].clientX-e[0].clientX),y:e[0].clientY+.5*(e[1].clientY-e[0].clientY)},s=m[0].clientX+.5*(m[1].clientX-m[0].clientX),o=m[0].clientY+.5*(m[1].clientY-m[0].clientY),h=this.point(i.x,i.y),a=this.point(2*i.x-s,2*i.y-o),u=new Eh(this.viewbox()).transform((new xh).translate(-a.x,-a.y).scale(r,0,0).translate(h.x,h.y));N(u),this.viewbox(u),m=e,this.dispatch("zoom",{box:u,focus:a})},I=function t(e){e.type.indexOf("mouse")>-1&&e.button!==_&&e.which!==_+1||(e.preventDefault(),this.off("mousedown.panZoom",t),m=vu(e),k||(this.dispatch("panStart",{event:e}),p={x:m[0].clientX,y:m[0].clientY},jh(document,"touchmove.panZoom mousemove.panZoom",R,this,{passive:!1}),jh(document,"touchend.panZoom mouseup.panZoom",L,this,{passive:!1})))},L=function t(e){e.preventDefault(),Ih(document,"touchmove.panZoom mousemove.panZoom",R),Ih(document,"touchend.panZoom mouseup.panZoom",t),this.on("mousedown.panZoom",I),this.dispatch("panEnd",{event:e})},R=function(t){t.preventDefault();var e=vu(t),n={x:e[0].clientX,y:e[0].clientY},r=this.point(n.x,n.y),i=this.point(p.x,p.y),s=[i.x-r.x,i.y-r.y];if(s[0]||s[1]){var o=new Eh(this.viewbox()).transform((new xh).translate(s[0],s[1]));p=n,N(o),this.dispatch("panning",{box:o,event:t}).defaultPrevented||this.viewbox(o)}};return b&&this.on("wheel.panZoom",(function(t){var e;switch(t.preventDefault(),t.deltaMode){case 1:e=t.deltaY*O;break;case 2:e=t.deltaY*M;break;default:e=t.deltaY}var n=Math.pow(1+g,-1*e/100)*this.zoom(),r=this.point(t.clientX,t.clientY);if(n>w&&(n=w),n<y&&(n=y),this.dispatch("zoom",{level:n,focus:r}).defaultPrevented)return this;if(this.zoom(n,r),C){var i=N(this.viewbox());this.viewbox(i)}}),this,{passive:!1}),x&&this.on("touchstart.panZoom",A,this,{passive:!1}),v&&this.on("mousedown.panZoom",I,this,{passive:!1}),this}});class _u{constructor(t,e,n,r,i){this.chartContext=i,this.width=e,this.height=n,this.containerElement=t,t.innerHTML="",this.canvas=xu().addTo(t).size("100%","100%").viewbox(`0 0 ${e} ${n}`).panZoom({zoomFactor:.2,zoomMin:.1}).attr({style:r})}static drawCircle(t={}){const e=new uu;return e.attr(t),e}static drawGroup(t=0,e=0,n,r){const i=new fu;return i.attr({"data-parent":r,"data-self":n,transform:`translate(${t}, ${e})`}),i}static drawPath(t,{borderColor:e=yo.borderColor,id:n=""}={}){const r=new Xa({d:t});return r.id(n),r.fill("none").stroke({color:e,width:1}),r}static drawRect({color:t="#fefefe",height:e=0,opacity:n=1,radius:r=0,width:i=0,x1:s,y1:o}={}){const h=new Va;return h.attr({height:e,opacity:n,rx:r,ry:r,width:i,x:s??void 0,y:o??void 0}),h.fill(t),h}static drawTemplate(t,{nodeHeight:e,nodeWidth:n}={}){const r=new cu({height:e,width:n}),i=document.createElement("div");return i.innerHTML=t,i.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),r.add(i),r}static drawText(t="",{dx:e,dy:n,x:r,y:i}){const s=new hu;return s.font({fill:"#f06"}),s.tspan(t),void 0!==r&&void 0!==i&&s.move(r,i),void 0!==e&&void 0!==n&&s.attr({dx:e,dy:n}),s}add(t){this.canvas.add(t)}clear(){this.canvas.clear().viewbox(`0 0 ${this.width} ${this.height}`)}exportToSvg(){new o(this.canvas,"apextree").exportToSVG()}resetViewBox(){this.canvas.viewbox(`0 0 ${this.width} ${this.height}`)}updateViewBox(t,e,n,r){this.canvas.viewbox(`${t} ${e} ${n} ${r}`)}zoom(t){const e=this.canvas.zoom()+t;e>=.1&&this.canvas.zoom(e)}getContainerElement(){return this.containerElement}}const Eu={marginx:100,marginy:100,rankdir:"TB"};class Cu extends _u{constructor(t,e,n){super(t,e.viewPortWidth,e.viewPortHeight,e.canvasStyle,n),this.options=e,this.preservedPositions=new Map}calculateLayout(){const{childrenSpacing:t,siblingSpacing:e}=this.options,n=go[this.options.direction];this.graph.setGraph({...Eu,nodesep:e,rankdir:n,ranksep:t}),co.layout(this.graph)}resetGraph(){this.graph=new co.graphlib.Graph,this.graph.setDefaultEdgeLabel((function(){return{}}))}setGraphNodesAndEdges(t){this.resetGraph(),this.setNodesRecursively(t)}setNodesRecursively(t,e){var n;const{direction:r,groupLeafNodesSpacing:i,nodeHeight:s,nodeWidth:o}=this.options,h=this.nodeMap[t],a={...h,parent:e||void 0};if(this.graph.setNode(t,{...a,height:s,width:o}),e&&this.graph.setEdge(e,t),h.onlyLeafNodes){const e=mo[r].leafWidth({childLength:h.children.length,childrenSpacing:i,nodeWidth:o}),n=mo[r].leafHeight({childLength:h.children.length,childrenSpacing:i,nodeHeight:s});this.graph.setNode(`${t}_leafs`,{...a,height:n,id:`${t}_leafs`,parent:t,width:e}),this.graph.setEdge(t,`${t}_leafs`)}else if(null==(n=h.children)?void 0:n.length)for(const u of h.children)this.setNodesRecursively(u,t)}changeLayout(t="top"){this.options={...this.options,direction:t},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!1})}collapse(t){const e=this.nodeMap[t];(null==e?void 0:e.children)&&(this.graph.nodes().forEach((t=>{const e=this.graph.node(t);void 0!==(null==e?void 0:e.x)&&void 0!==(null==e?void 0:e.y)&&this.preservedPositions.set(t,{x:e.x,y:e.y})})),this.nodeMap[t]={...e,children:void 0,hiddenChildren:e.children},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!0}))}construct(t){if(this.nodeMap=vo(t),this.data=t,this.options.groupLeafNodes){(function(t){const e=[];function n(t){return!t.children||0===t.children.length}return function t(r){if(r.children&&0!==r.children.length){r.children.every(n)&&e.push(r);for(const e of r.children)t(e)}}(t),e})(t).forEach((t=>{this.nodeMap[t.id]={...this.nodeMap[t.id],onlyLeafNodes:!0},this.nodeMap[`${t.id}_leafs`]={...this.nodeMap[t.id],id:`${t.id}_leafs`,onlyLeafNodes:!0,parent:t.id},this.nodeMap[t.id].children.forEach((e=>{this.nodeMap[e]={...this.nodeMap[e],parent:`${t.id}_leafs`}}))}))}this.setGraphNodesAndEdges(t.id)}expand(t){const e=this.nodeMap[t];(null==e?void 0:e.hiddenChildren)&&(this.graph.nodes().forEach((t=>{const e=this.graph.node(t);void 0!==(null==e?void 0:e.x)&&void 0!==(null==e?void 0:e.y)&&this.preservedPositions.set(t,{x:e.x,y:e.y})})),this.nodeMap[t]={...e,children:e.hiddenChildren,hiddenChildren:void 0},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!0}))}fitScreen(){const{height:t,width:e}=this.graph.graph();this.updateViewBox(0,0,e,t)}render({keepOldPosition:t=!1}={}){const e=this.canvas.viewbox();this.clear(),this.calculateLayout(),t&&this.preservedPositions.size>0&&this.graph.nodes().forEach((t=>{const e=this.preservedPositions.get(t);if(e){const n=this.graph.node(t);n&&(n.x=e.x,n.y=e.y,this.graph.setNode(t,n))}}));const{containerClassName:n,enableTooltip:r,fontColor:i,fontFamily:s,fontSize:o,fontWeight:h,tooltipId:a}=this.options,u=lr({color:i,fontFamily:s,fontSize:o,fontWeight:h}),l=_u.drawGroup(0,0,n);l.attr("style",u),l.id(n);const c=this.graph.nodes();if(this.graph.edges().forEach((t=>{this.renderEdge(t,l)})),c.forEach((t=>{t.endsWith("_leafs")?this.renderGroupedLeafNodes(t,l):this.renderNode(t,l)})),this.add(l),this.fitScreen(),t&&this.updateViewBox(e.x,e.y,e.width,e.height),r){const t=ar(this.chartContext,a);this.chartContext.getAppendContainer().appendChild(t)}}renderEdge(t,e){const n=this.graph.node(t.w),r=this.graph.node(t.v),{nodeHeight:i,nodeWidth:s}=this.options,o=((t,e,n,r,i)=>{if(!(null==t?void 0:t.parent))return null;const{calculateEdge:s,edgeMidX:o,edgeMidY:h,edgeParentX:a,edgeParentY:u,edgeX:l,edgeY:c}=mo[i];return s({x:l({node:t,nodeHeight:r,nodeWidth:n}),y:c({node:t,nodeHeight:r,nodeWidth:n})},{x:a({nodeHeight:r,nodeWidth:n,parent:e}),y:u({nodeHeight:r,nodeWidth:n,parent:e})},{x:o({node:t,nodeHeight:r,nodeWidth:n}),y:h({node:t,nodeHeight:r,nodeWidth:n})},{sy:0})})(n,r,s,i,this.options.direction);if(!o)return;const h=_u.drawPath(o,{id:`${t.v}-${t.w}`});e.add(h)}renderGroupedLeafNodes(t,e){const n=this.graph.node(t),{options:r}=this,{direction:i}=r,s=mo[i].leafGroupX({node:n}),o=mo[i].leafGroupY({node:n}),h=_u.drawGroup(s,o,n.id,n.parent);n.children.forEach(((t,e)=>{this.renderLeafNode(t,h,e)})),e.add(h)}renderLeafNode(t,e,n){const r=this.nodeMap[t],{options:i}=this,{contentKey:s,direction:o,enableTooltip:h,groupLeafNodesSpacing:a,highlightOnHover:u,nodeTemplate:l,tooltipTemplate:c}=i,{borderColor:d,borderStyle:f,borderRadius:p,borderWidth:m,fontColor:g,fontFamily:y,fontSize:w,fontWeight:b,nodeBGColor:x,nodeClassName:v,nodeHeight:_,nodeStyle:E,nodeWidth:C,tooltipBGColor:O,tooltipBorderColor:M,tooltipFontColor:k,tooltipFontSize:S,tooltipId:N,tooltipMaxWidth:A,tooltipMinWidth:T,tooltipOffset:j,tooltipPadding:I}={...i,...r.options},L=mo[o].leafX({childrenSpacing:a,index:n,nodeHeight:_,nodeWidth:C}),R=mo[o].leafY({childrenSpacing:a,index:n,nodeHeight:_,nodeWidth:C}),P=_u.drawGroup(L,R,r.id,r.parent),D=lr({background:x,borderColor:d,borderRadius:p,borderStyle:f,borderWidth:`${m}px`,color:g,fontFamily:y,fontSize:w,fontWeight:b}),z=l(r[s]),F=_u.drawTemplate(z,{nodeHeight:_,nodeWidth:C}),$=D+(E?"; "+E:"");F.attr("style",$),F.attr("class",v),P.add(F);const Y=this;if(u&&(P.on("mouseover",(function(){const{self:t}=this.node.dataset,e=Y.nodeMap[t];e&&bo(e,Y.nodeMap,!0,i,Y.chartContext)})),P.on("mouseout",(function(){const{self:t}=this.node.dataset,e=Y.nodeMap[t];e&&bo(e,Y.nodeMap,!1,i,Y.chartContext)}))),h){const t=c?c(r[s]):z;P.on("mousemove",(e=>{_o(Y.chartContext,{bgColor:O,borderColor:M,fontColor:k,fontSize:S,fontFamily:y,maxWidth:A,minWidth:T,offset:j,padding:c?0:I,tooltipId:N},t,e.pageX,e.pageY,Y.getContainerElement())})),P.on("mouseout",(t=>{var e;"svg"===(null==(e=t.relatedTarget)?void 0:e.tagName)&&Eo(Y.chartContext,N)}))}this.options.onNodeClick&&P.on("click",(()=>{this.options.onNodeClick(r)})),e.add(P)}renderNode(t,e){var n,r;const i=this.graph.node(t),{options:s}=this,{borderRadius:o,contentKey:h,direction:a,enableExpandCollapse:u,enableTooltip:l,highlightOnHover:c,nodeHeight:d,nodeTemplate:f,nodeWidth:p,tooltipTemplate:m}=s,{borderColor:g,borderStyle:y,borderWidth:w,fontColor:b,fontFamily:x,fontSize:v,fontWeight:_,nodeBGColor:E,nodeClassName:C,nodeStyle:O,tooltipBGColor:M,tooltipBorderColor:k,tooltipId:S,tooltipFontColor:N,tooltipFontSize:A,tooltipMaxWidth:T,tooltipMinWidth:j,tooltipOffset:I,tooltipPadding:L}={...s,...i.options},{height:R,width:P,x:D,y:z}=i,F=this,$=_u.drawGroup(D-p/2,z-d/2,i.id,i.parent),Y=f(i[h]),X=_u.drawTemplate(Y,{nodeHeight:R,nodeWidth:P}),G=lr({color:b,fontFamily:x,fontSize:v,fontWeight:_}),q=lr({backgroundColor:E,borderColor:g,borderRadius:o,borderStyle:y,borderWidth:`${w}px`,boxSizing:"border-box",height:"100%"})+(O?"; "+O:"");if(X.first().attr("style",q),X.attr("class",C),$.attr("style",G),$.add(X),c&&($.on("mouseover",(function(){const{self:t}=this.node.dataset,e=F.nodeMap[t];e&&bo(e,F.nodeMap,!0,s,F.chartContext)})),$.on("mouseout",(function(){const{self:t}=this.node.dataset,e=F.nodeMap[t];e&&bo(e,F.nodeMap,!1,s,F.chartContext)}))),l){const t=m?m(i[h]):Y;$.on("mousemove",(e=>{_o(F.chartContext,{bgColor:M,borderColor:k,fontColor:N,fontSize:A,fontFamily:x,maxWidth:T,minWidth:j,offset:I,padding:m?0:L,tooltipId:S},t,e.pageX,e.pageY,F.getContainerElement())})),$.on("mouseout",(t=>{var e;"svg"===(null==(e=t.relatedTarget)?void 0:e.tagName)&&Eo(F.chartContext,S)}))}if(u&&((null==(n=i.children)?void 0:n.length)||(null==(r=i.hiddenChildren)?void 0:r.length))){const t=7,e=((t,e,n,r)=>{switch(t){case"top":case"bottom":default:return{x:e/2-r,y:n-r};case"left":return{x:e-r,y:n/2-r};case"right":return{x:-r,y:n/2-r}}})(this.options.direction,p,d,t),n=!i.hiddenChildren,r=_u.drawGroup(e.x,e.y),s=_u.drawCircle({cx:t,cy:t,r:t});s.fill(this.options.expandCollapseButtonBGColor),s.stroke({color:this.options.expandCollapseButtonBorderColor,width:1}),r.add(s);const o=n?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14">\n <path d="m12,0C5.383,0,0,5.383,0,12s5.383,12,12,12,12-5.383,12-12S18.617,0,12,0Zm0,22c-5.514,0-10-4.486-10-10S6.486,2,12,2s10,4.486,10,10-4.486,10-10,10Zm5-10c0,.552-.448,1-1,1h-8c-.552,0-1-.448-1-1s.448-1,1-1h8c.552,0,1,.448,1,1Z"/>\n</svg>\n':'<svg height="14" viewBox="0 0 24 24" width="14" xmlns="http://www.w3.org/2000/svg">\n <path d="m12 0a12 12 0 1 0 12 12 12.013 12.013 0 0 0 -12-12zm0 22a10 10 0 1 1 10-10 10.011 10.011 0 0 1 -10 10zm5-10a1 1 0 0 1 -1 1h-3v3a1 1 0 0 1 -2 0v-3h-3a1 1 0 0 1 0-2h3v-3a1 1 0 0 1 2 0v3h3a1 1 0 0 1 1 1z"/>\n</svg>',h=_u.drawTemplate(o,{nodeHeight:14,nodeWidth:14});r.add(h),$.add(r),r.on("click",(t=>{t.stopPropagation(),n?this.collapse(i.id):this.expand(i.id)})),(t=>{const e=t.findOne("circle");if(!e)return;const n=e.attr("fill")||"#FFF",r=e.attr("stroke")||"#ddd",i=e.attr("stroke-width")||1,s=e.attr("r");t.on("mouseenter",(function(){e.attr({fill:"#f8f9fa",stroke:"#007bff","stroke-width":2,r:1.1*s}),t.attr("style","cursor: pointer; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));")})),t.on("mouseleave",(function(){e.attr({fill:n,stroke:r,"stroke-width":i,r:s}),t.attr("style","cursor: pointer;")}))})(r)}this.options.onNodeClick&&$.on("click",(()=>{this.options.onNodeClick(i)})),e.add($)}}class Ou extends i{constructor(t,e={}){super(t,"tree_"+Math.random().toString(36).substr(2,9)),this.options={...yo,...e};const{height:n,width:r}=this.options;this.graph=new Cu(this.element,this.options,this.chartContext),this.setupElementDimensions(r,n),this.handleWatermark()}static setLicense(t){a.setLicense(t)}setupElementDimensions(t,e){let n=!1,r=0;"string"==typeof t&&/^\d+(\.\d+)?%$/.test(t)?(r=Number(t.substring(0,t.length-1)),n=!0):r=Number(t);const i="auto"===e?r/1.6:Number(e);this.element.style.width=`${r}${n?"%":"px"}`,this.element.style.height=`${i}${n?"%":"px"}`,this.element.style.position="relative"}handleWatermark(){this.element&&(a.isLicenseValid()?ln.remove(this.element):ln.add(this.element))}render(t){if(!this.element)throw new Error("Element not found");if(this.graph.construct(t),this.graph.render(),this.options.enableToolbar){new an(this.element,this.chartContext).render({enableExport:!0,enableFitscreen:!0,enableZoom:!0,onExport:this.graph.exportToSvg.bind(this.graph),onFitscreen:this.graph.fitScreen.bind(this.graph),onZoom:this.graph.zoom.bind(this.graph)})}return this.graph}}"undefined"!=typeof window&&(window.ApexTree=Ou),t.ApexTree=Ou,t.default=Ou,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexTree={})}(this,(function(t){"use strict";var e=Object.defineProperty,n=(t,n,r)=>(((t,n,r)=>{n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r})(t,"symbol"!=typeof n?n+"":n,r),r);class r{constructor(t,e){this.injectedStyles=new Set,this.chartContainer=null,this.instanceId=e||Math.random().toString(36).substr(2,9),this.context=this.detectContext(t),this.chartContainer=t}getChartContainer(){return this.chartContainer}getChartScopedContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.chartContainer||this.context}detectContext(t){const e=t.getRootNode();return e instanceof ShadowRoot?e:document}getContext(){return this.context}getInstanceId(){return this.instanceId}isShadowDOM(){return this.context instanceof ShadowRoot}createElement(t){return document.createElement(t)}createElementNS(t,e){return document.createElementNS(t,e)}createTextNode(t){return document.createTextNode(t)}getElementById(t){return this.context===document?document.getElementById(t):this.context.querySelector(`#${t}`)}getElementsByClassName(t){if(this.context===document)return document.getElementsByClassName(t);const e=this.context.querySelectorAll(`.${t}`),n=Array.from(e);return{item:t=>n[t]||null,get length(){return n.length},[Symbol.iterator]:()=>n[Symbol.iterator](),...Object.fromEntries(n.map(((t,e)=>[e,t])))}}querySelector(t){return this.context.querySelector(t)}querySelectorAll(t){return this.context.querySelectorAll(t)}getAppendContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.context}getChartBounds(){var t;return(null==(t=this.chartContainer)?void 0:t.getBoundingClientRect())||new DOMRect}getBody(){if(this.context===document)return document.body||document.getElementsByTagName("body")[0];return this.context.host}dispatchEvent(t){this.context===document?document.dispatchEvent(t):this.context.dispatchEvent(t)}addEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.addEventListener(t,e,n):this.context.addEventListener(t,e,n)}removeEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.removeEventListener(t,e,n):this.context.removeEventListener(t,e,n)}injectStyles(t,e,n={}){const{force:r=!1,priority:i="normal"}=n;if(!r&&this.injectedStyles.has(e))return;if(r){const t=this.context.querySelector(`#${e}`);t&&(t.remove(),this.injectedStyles.delete(e))}if(this.context.querySelector(`#${e}`)&&!r)return void this.injectedStyles.add(e);const s=document.createElement("style");if(s.id=e,s.textContent=t,"normal"!==i&&s.setAttribute("data-priority",i),this.context===document)document.head.appendChild(s);else{const t=this.context;"high"===i?t.insertBefore(s,t.firstChild):t.appendChild(s)}this.injectedStyles.add(e)}injectStylesheets(t){t.forEach((({content:t,id:e,options:n})=>{this.injectStyles(t,e,n)}))}hasInjectedStyles(t){return this.injectedStyles.has(t)}removeStyles(t){const e=this.context.querySelector(`#${t}`);e&&(e.remove(),this.injectedStyles.delete(t))}removeAllStyles(){this.injectedStyles.forEach((t=>{const e=this.context.querySelector(`#${t}`);e&&e.remove()})),this.injectedStyles.clear()}getInjectedStyleIds(){return Array.from(this.injectedStyles)}getActiveElement(){if(this.context===document)return document.activeElement;return this.context.activeElement||document.activeElement}destroy(){this.removeAllStyles(),this.injectedStyles.clear()}}class i{constructor(t,e){if(!t)throw new Error("Container element is required");this.element=t,this.chartContext=new r(t,e)}getContext(){return this.chartContext}isShadowDOM(){return this.chartContext.isShadowDOM()}getTooltipContainer(){return this.chartContext.getAppendContainer()}injectStyles(t,e){this.chartContext.injectStyles(t,e)}createElement(t){return this.chartContext.createElement(t)}querySelector(t){return this.chartContext.querySelector(t)}addEventListener(t,e,n){this.chartContext.addEventListener(t,e,n)}removeEventListener(t,e,n){this.chartContext.removeEventListener(t,e,n)}dispatchEvent(t){this.chartContext.dispatchEvent(t)}destroy(){this.chartContext.destroy()}getInstanceId(){return this.chartContext.getInstanceId()}}function s(){}class o{constructor(t,e="apex"){this.canvas=t,this.prefix=e}getSvgString(){return this.canvas.svg().replace(/(<img [\w\W]+?)(>)/g,"$1 />").replace(/(<br)(>)/g,"$1 />").replace(/(<hr)(>)/g,"$1 />")}svgUrl(){const t=this.getSvgString(),e=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)}triggerDownload(t,e){const n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}exportToSVG(){this.triggerDownload(this.svgUrl(),`${this.prefix}-${(new Date).getTime()}.svg`)}}const h=class{static decodeLicenseData(t){try{const e=window.atob(t),n=JSON.parse(e);return n.issueDate&&n.expiryDate&&n.plan?{expiryDate:n.expiryDate,issueDate:n.issueDate,plan:n.plan,valid:!0}:null}catch{return null}}static generateLicenseKey(t,e,n="standard"){const r={expiryDate:e,issueDate:t,plan:n};return`APEX-${window.btoa(JSON.stringify(r))}`}static getLicenseStatus(){return this.licenseKey?(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult):{expired:!1,valid:!1}}static isLicenseValid(){return!!this.licenseKey&&(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult.valid)}static setLicense(t){this.licenseKey=t,this.validationResult=this.validateLicense(t),this.validationResult.valid||console.error(`[Apex] ${this.validationResult.message}`)}static validateLicense(t){try{if(!t.startsWith("APEX-"))return{expired:!1,message:'Invalid license key format. License key must start with "APEX-".',valid:!1};const e=t.split("-");if(2!==e.length)return{expired:!1,message:"Invalid license key format. Expected format: APEX-{encoded-data}.",valid:!1};const n=e[1],r=this.decodeLicenseData(n);if(!r)return{expired:!1,message:"Invalid license key. Unable to decode license data.",valid:!1};const i=new Date;return new Date(r.expiryDate)<i?{data:r,expired:!0,message:`License expired on ${r.expiryDate}. Please renew your license.`,valid:!1}:{data:r,expired:!1,valid:!0}}catch{return{expired:!1,message:"Invalid license key format or corrupted data.",valid:!1}}}};h.licenseKey=null,h.validationResult=null;let a=h;const u={},l=[];function c(t,e){if(Array.isArray(t))for(const n of t)c(n,e);else if("object"!=typeof t)f(Object.getOwnPropertyNames(e)),u[t]=Object.assign(u[t]||{},e);else for(const n in t)c(n,t[n])}function d(t){return u[t]||{}}function f(t){l.push(...t)}function p(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function m(t){return t%360*Math.PI/180}function g(t){return t.charAt(0).toUpperCase()+t.slice(1)}function y(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function w(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:h,y:a}=e.bbox();s&&(r=r.includes("left")?h:r.includes("right")?h+n:h+n/2),o&&(i=i.includes("top")?a:i.includes("bottom")?a+t:a+t/2)}return[r,i]}const b=new Set(["desc","metadata","title"]),x=t=>b.has(t.nodeName),v=(t,e,n={})=>{const r={...e};for(const i in r)r[i].valueOf()===n[i]&&delete r[i];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},_="http://www.w3.org/2000/svg",E="http://www.w3.org/2000/xmlns/",C="http://www.w3.org/1999/xlink",O={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};let M=class{};const k={},S="___SYMBOL___ROOT___";function N(t,e=_){return O.document.createElementNS(e,t)}function A(t,e=!1){if(t instanceof M)return t;if("object"==typeof t)return I(t);if(null==t)return new k[S];if("string"==typeof t&&"<"!==t.charAt(0))return I(O.document.querySelector(t));const n=e?O.document.createElement("div"):N("svg");return n.innerHTML=t,t=I(n.firstChild),n.removeChild(n.firstChild),t}function T(t,e){return e&&(e instanceof O.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:N(t)}function j(t){if(!t)return null;if(t.instance instanceof M)return t.instance;if("#document-fragment"===t.nodeName)return new k.Fragment(t);let e=g(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":k[e]||(e="Dom"),new k[e](t)}let I=j;function L(t,e=t.name,n=!1){return k[e]=t,n&&(k[S]=t),f(Object.getOwnPropertyNames(t.prototype)),t}let R=1e3;function P(t){return"Svgjs"+g(t)+R++}function D(t){for(let e=t.children.length-1;e>=0;e--)D(t.children[e]);return t.id?(t.id=P(t.nodeName),t):t}function z(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function F(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)}}c("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=A(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=A(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=A(t)).before(this),this},insertAfter:function(t){return(t=A(t)).after(this),this}});const $=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,Y=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,X=/rgb\((\d+),(\d+),(\d+)\)/,G=/(#[a-z_][a-z0-9\-_]*)/i,q=/\)\s*,?\s*/,B=/\s/g,V=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,W=/^rgb\(/,H=/^(\s+)?$/,Z=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,U=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Q=/[\s,]+/,K=/[MLHVCSQTAZ]/i;function J(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function tt(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function et(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}c("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Q)},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)}}),c("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=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||H.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||H.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),c("Dom",{data:function(t,e,n){if(null==t)return this.data(p(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(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(r){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}}),c("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);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||{}}});let nt=class t{constructor(...t){this.init(...t)}static isColor(e){return e&&(e instanceof t||this.isRgb(e)||this.test(e))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(e="vibrant",n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===e){const e=24*r()+57,n=38*r()+45,i=360*r();return new t(e,n,i,"lch")}if("sine"===e){const e=i(80*s(2*o*(n=null==n?r():n)/.5+.01)+150),h=i(50*s(2*o*n/.5+4.6)+200),a=i(100*s(2*o*n/.5+2.3)+150);return new t(e,h,a)}if("pastel"===e){const e=8*r()+86,n=17*r()+9,i=360*r();return new t(e,n,i,"lch")}if("dark"===e){const e=10+10*r(),n=50*r()+86,i=360*r();return new t(e,n,i,"lch")}if("rgb"===e){const e=255*r(),n=255*r(),i=255*r();return new t(e,n,i)}if("lab"===e){const e=100*r(),n=256*r()-128,i=256*r()-128;return new t(e,n,i,"lab")}if("grey"===e){const e=255*r();return new t(e,e,e)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(V.test(t)||W.test(t))}cmyk(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),h=Math.min(1-i,1-s,1-o);if(1===h)return new t(0,0,0,1,"cmyk");return new t((1-i-h)/(1-h),(1-s-h)/(1-h),(1-o-h)/(1-h),h,"cmyk")}hsl(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),h=Math.max(i,s,o),a=Math.min(i,s,o),u=(h+a)/2,l=h===a,c=h-a;return new t(360*(l?0:h===i?((s-o)/c+(s<o?6:0))/6:h===s?((o-i)/c+2)/6:h===o?((i-s)/c+4)/6:0),100*(l?0:u>.5?c/(2-h-a):c/(h+a)),100*u,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const c in this.space)delete this[this.space[c]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});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=tt(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:tt(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:tt(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:tt(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:tt(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:tt(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(W.test(t)){const e=t.replace(B,""),[n,r,i]=X.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!V.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=Y.exec((s=t,4===s.length?["#",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(""):s)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var s;const{_a:o,_b:h,_c:a,_d:u}=this,l="rgb"===this.space?{r:o,g:h,b:a}:"xyz"===this.space?{x:o,y:h,z:a}:"hsl"===this.space?{h:o,s:h,l:a}:"lab"===this.space?{l:o,a:h,b:a}:"lch"===this.space?{l:o,c:h,h:a}:"cmyk"===this.space?{c:o,m:h,y:a,k:u}:{};Object.assign(this,l)}lab(){const{x:e,y:n,z:r}=this.xyz();return new t(116*n-16,500*(e-n),200*(n-r),"lab")}lch(){const{l:e,a:n,b:r}=this.lab(),i=Math.sqrt(n**2+r**2);let s=180*Math.atan2(r,n)/Math.PI;s<0&&(s*=-1,s=360-s);return new t(e,i,s,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(e=this.space)||"xyz"===e||"lch"===e){let{x:e,y:n,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:t,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(t+16)/116,h=i/500+o,a=o-s/200,u=16/116,l=.008856,c=7.787;e=.95047*(h**3>l?h**3:(h-u)/c),n=1*(o**3>l?o**3:(o-u)/c),r=1.08883*(a**3>l?a**3:(a-u)/c)}const i=3.2406*e+-1.5372*n+-.4986*r,s=-.9689*e+1.8758*n+.0415*r,o=.0557*e+-.204*n+1.057*r,h=Math.pow,a=.0031308,u=i>a?1.055*h(i,1/2.4)-.055:12.92*i,l=s>a?1.055*h(s,1/2.4)-.055:12.92*s,c=o>a?1.055*h(o,1/2.4)-.055:12.92*o;return new t(255*u,255*l,255*c)}if("hsl"===this.space){let{h:e,s:n,l:r}=this;if(e/=360,n/=100,r/=100,0===n){r*=255;return new t(r,r,r)}const i=r<.5?r*(1+n):r+n-r*n,s=2*r-i,o=255*et(s,i,e+1/3),h=255*et(s,i,e),a=255*et(s,i,e-1/3);return new t(o,h,a)}if("cmyk"===this.space){const{c:e,m:n,y:r,k:i}=this,s=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,n*(1-i)+i)),h=255*(1-Math.min(1,r*(1-i)+i));return new t(s,o,h)}return this;var e}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(J);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),h=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,l=(.4124*h+.3576*a+.1805*u)/.95047,c=(.2126*h+.7152*a+.0722*u)/1,d=(.0193*h+.1192*a+.9505*u)/1.08883,f=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,m=d>.008856?Math.pow(d,1/3):7.787*d+16/116;return new t(f,p,m,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}},rt=class t{constructor(...t){this.init(...t)}clone(){return new t(this)}init(t,e){const n=0,r=0,i=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==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){st.isMatrixLike(t)||(t=new st(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 it(t,e,n){return Math.abs(e-t)<1e-6}let st=class t{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,r=t.flip&&(e||"y"===t.flip)?-1:1,i=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]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,a=t.shear||0,u=t.rotate||t.theta||0,l=new rt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,d=l.y,f=new rt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new rt(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,w=g.y,b=new rt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:h,skewX:i,skewY:s,shear:a,theta:u,rx:b.x,ry:b.y,tx:y,ty:w,ox:c,oy:d,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 r=t.a*e.a+t.c*e.b,i=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,a=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=h,n.f=a,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new t(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,h=this.f,a=n*s-r*i,u=a>0?1:-1,l=u*Math.sqrt(n*n+r*r),c=Math.atan2(u*r,u*n),d=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/a,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*l+e*(m*f*l-p*g),translateY:h-e+t*p*l+e*(m*p*l+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;const n=new t(e);return it(this.a,n.a)&&it(this.b,n.b)&&it(this.c,n.c)&&it(this.d,n.d)&&it(this.e,n.e)&&it(this.f,n.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(e){const n=t.fromArray([1,0,0,1,0,0]);return e=e instanceof At?e.matrixify():"string"==typeof e?t.fromArray(e.split(Q).map(parseFloat)):Array.isArray(e)?t.fromArray(e):"object"==typeof e&&t.isMatrixLike(e)?e:"object"==typeof e?(new t).transform(e):6===arguments.length?t.fromArray([].slice.call(arguments)):n,this.a=null!=e.a?e.a:n.a,this.b=null!=e.b?e.b:n.b,this.c=null!=e.c?e.c:n.c,this.d=null!=e.d?e.d:n.d,this.e=null!=e.e?e.e:n.e,this.f=null!=e.f?e.f:n.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const h=r/o,a=-e/o,u=-n/o,l=t/o,c=-(h*i+u*s),d=-(a*i+l*s);return this.a=h,this.b=a,this.c=u,this.d=l,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(e){const n=e instanceof t?e:new t(e);return t.matrixMultiply(n,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(e){const n=e instanceof t?e:new t(e);return t.matrixMultiply(this,n,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=m(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:h,d:a,e:u,f:l}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=h*r-a*i,this.d=a*r+h*i,this.e=u*r-l*i+n*i-e*r+e,this.f=l*r+u*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:h,e:a,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=h*e,this.e=a*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:h,f:a}=this;return this.a=r+i*t,this.c=s+o*t,this.e=h+a*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=m(t),e=m(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:h,c:a,d:u,e:l,f:c}=this;return this.a=o+h*i,this.b=h+o*s,this.c=a+u*i,this.d=u+a*s,this.e=l+c*i-r*i,this.f=c+l*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(e){if(t.isMatrixLike(e)){return new t(e).multiplyO(this)}const n=t.formatTransforms(e),{x:r,y:i}=new rt(n.ox,n.oy).transform(this),s=(new t).translateO(n.rx,n.ry).lmultiplyO(this).translateO(-r,-i).scaleO(n.scaleX,n.scaleY).skewO(n.skewX,n.skewY).shearO(n.shear).rotateO(n.theta).translateO(r,i);if(isFinite(n.px)||isFinite(n.py)){const t=new rt(r,i).transform(s),e=isFinite(n.px)?n.px-t.x:0,o=isFinite(n.py)?n.py-t.y:0;s.translateO(e,o)}return s.translateO(n.tx,n.ty),s}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}};function ot(){if(!ot.nodes){const t=A().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;ot.nodes={svg:t,path:e}}if(!ot.nodes.svg.node.parentNode){const t=O.document.body||O.document.documentElement;ot.nodes.svg.addTo(t)}return ot.nodes}function ht(t){return!(t.width||t.height||t.x||t.y)}L(st,"Matrix");let at=class t{constructor(...t){this.init(...t)}addOffset(){return this.x+=O.window.pageXOffset,this.y+=O.window.pageYOffset,new t(this)}init(t){return t="string"==typeof t?t.split(Q).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 ht(this)}merge(e){const n=Math.min(this.x,e.x),r=Math.min(this.y,e.y),i=Math.max(this.x+this.width,e.x+e.width)-n,s=Math.max(this.y+this.height,e.y+e.height)-r;return new t(n,r,i,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof st||(e=new st(e));let n=1/0,r=-1/0,i=1/0,s=-1/0;return[new rt(this.x,this.y),new rt(this.x2,this.y),new rt(this.x,this.y2),new rt(this.x2,this.y2)].forEach((function(t){t=t.transform(e),n=Math.min(n,t.x),r=Math.max(r,t.x),i=Math.min(i,t.y),s=Math.max(s,t.y)})),new t(n,i,r-n,s-i)}};function ut(t,e,n){let r;try{if(r=e(t.node),ht(r)&&((i=t.node)!==O.document&&!(O.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===O.document}).call(O.document.documentElement,i)))throw new Error("Element not in the dom")}catch(s){r=n(t)}var i;return r}c({viewbox:{viewbox(t,e,n,r){return null==t?new at(this.attr("viewBox")):this.attr("viewBox",new at(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,h=Math.min(s,o);if(null==t)return h;let a=h/t;a===1/0&&(a=Number.MAX_SAFE_INTEGER/100),e=e||new rt(n/2/s+i.x,r/2/o+i.y);const u=new at(i).transform(new st({scale:a,origin:e}));return this.viewbox(u)}}}),L(at,"Box");let lt=class extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}};z([lt],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const ct=["toArray","constructor","each"];function dt(t,e){return new lt(p((e||O.document).querySelectorAll(t),(function(t){return j(t)})))}lt.extend=function(t){t=t.reduce(((t,e)=>(ct.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),z([lt],t)};let ft=0;const pt={};function mt(t){let e=t.getEventHolder();return e===O.window&&(e=pt),e.events||(e.events={}),e.events}function gt(t){return t.getEventTarget()}function yt(t,e,n,r,i){const s=n.bind(r||t),o=A(t),h=mt(o),a=gt(o);e=Array.isArray(e)?e:e.split(Q),n._svgjsListenerId||(n._svgjsListenerId=++ft),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";h[e]=h[e]||{},h[e][r]=h[e][r]||{},h[e][r][n._svgjsListenerId]=s,a.addEventListener(e,s,i||!1)}))}function wt(t,e,n,r){const i=A(t),s=mt(i),o=gt(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Q)).forEach((function(t){const e=t&&t.split(".")[0],h=t&&t.split(".")[1];let a,u;if(n)s[e]&&s[e][h||"*"]&&(o.removeEventListener(e,s[e][h||"*"][n],r||!1),delete s[e][h||"*"][n]);else if(e&&h){if(s[e]&&s[e][h]){for(u in s[e][h])wt(o,[e,h].join("."),u);delete s[e][h]}}else if(h)for(t in s)for(a in s[t])h===a&&wt(o,[t,h].join("."));else if(e){if(s[e]){for(a in s[e])wt(o,[e,a].join("."));delete s[e]}}else{for(t in s)wt(o,t);!function(t){let e=t.getEventHolder();e===O.window&&(e=pt),e.events&&(e.events={})}(i)}}))}let bt=class extends M{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=gt(t);return e instanceof O.window.Event||(e=new O.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.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 r in n)for(const e in n[r])n[r][e](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 wt(this,t,e,n),this}on(t,e,n,r){return yt(this,t,e,n,r),this}removeEventListener(){}};function xt(){}L(bt,"EventTarget");const vt=400,_t=">",Et=0,Ct={"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"};let Ot=class 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(Q).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}},Mt=class t{constructor(...t){this.init(...t)}convert(e){return new t(this.value,e)}divide(e){return e=new t(e),new t(this/e,this.unit||e.unit)}init(e,n){return n=Array.isArray(e)?e[1]:n,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=n||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(n=e.match($))&&(this.value=parseFloat(n[1]),"%"===n[5]?this.value/=100:"s"===n[5]&&(this.value*=1e3),this.unit=n[5]):e instanceof t&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new t(e),new t(this-e,this.unit||e.unit)}plus(e){return e=new t(e),new t(this+e,this.unit||e.unit)}times(e){return e=new t(e),new t(this*e,this.unit||e.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 kt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),St=[];let Nt=class t extends bt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=A(t)).removeNamespace&&this.node instanceof O.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 A(t).put(this,e)}children(){return new lt(p(this.node.children,(function(t){return j(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=D(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(e,n){return this.put(new t(N(e),n))}first(){return j(this.node.firstChild)}get(t){return j(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=P(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return j(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=j(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=j(e.node.parentNode));return e}put(t,e){return t=A(t),this.add(t,e),t}putIn(t,e){return A(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=A(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const i in r)"number"==typeof r[i]&&(r[i]=Math.round(r[i]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,_)}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=j(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 r=N("wrapper",n),i=O.document.createDocumentFragment();r.innerHTML=t;for(let o=r.children.length;o--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}};z(Nt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=Z.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))?Ct[t]:Z.test(e)?parseFloat(e):e;"number"==typeof(e=St.reduce(((e,n)=>n(t,e,this)),e))?e=new Mt(e):kt.has(t)&&nt.isColor(e)?e=new nt(e):e.constructor===Array&&(e=new Ot(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 dt(t,this.node)},findOne:function(t){return j(this.node.querySelector(t))}}),L(Nt,"Dom");let At=class extends Nt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??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 Mt(t).plus(this.x()))}dy(t=0){return this.y(new Mt(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=A(t));const n=new lt;let r=this;for(;(r=r.parent())&&r.node!==O.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(G);return e?A(e[1]):null}root(){const t=this.parent(k[S]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=y(this,t,e);return this.width(new Mt(n.width)).height(new Mt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return v(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}};z(At,{bbox:function(){const t=ut(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(ot().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 at(t)},rbox:function(t){const e=ut(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new at(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 rt(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new st(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new st(e)}return new st(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new st}}}),L(At,"Element");const Tt={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 nt||nt.isRgb(e)||e instanceof At)this.attr(t,e);else for(n=Tt[t].length-1;n>=0;n--)null!=e[Tt[t][n]]&&this.attr(Tt.prefix(t,Tt[t][n]),e[Tt[t][n]]);return this},c(["Element","Runner"],e)})),c(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new st(this):this.attr("transform",new st(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!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)}}),c("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Mt(t)):this.rx(t).ry(e)}}),c("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new rt(this.node.getPointAtLength(t))}}),c(["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)}});c("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),c("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(q).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(Q).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(st.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new st)},toParent:function(t,e){if(this===t)return this;if(x(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.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 st(this).decompose();return null==t?e:e[t]}st.isMatrixLike(t)||(t={...t,origin:w(t,this)});const n=new st(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});let jt=class t extends At{flatten(){return this.each((function(){if(this instanceof t)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,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}};L(jt,"Container");let It=class extends jt{constructor(t,e=t){super(T("defs",t),e)}flatten(){return this}ungroup(){return this}};L(It,"Defs");let Lt=class extends At{};function Rt(t){return this.attr("rx",t)}function Pt(t){return this.attr("ry",t)}function Dt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function zt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Ft(t){return this.attr("cx",t)}function $t(t){return this.attr("cy",t)}function Yt(t){return null==t?2*this.rx():this.rx(new Mt(t).divide(2))}function Xt(t){return null==t?2*this.ry():this.ry(new Mt(t).divide(2))}L(Lt,"Shape");const Gt=Object.freeze(Object.defineProperty({__proto__:null,cx:Ft,cy:$t,height:Xt,rx:Rt,ry:Pt,width:Yt,x:Dt,y:zt},Symbol.toStringTag,{value:"Module"}));let qt=class extends Lt{constructor(t,e=t){super(T("ellipse",t),e)}size(t,e){const n=y(this,t,e);return this.rx(new Mt(n.width).divide(2)).ry(new Mt(n.height).divide(2))}};z(qt,Gt),c("Container",{ellipse:F((function(t=0,e=t){return this.put(new qt).size(t,e).move(0,0)}))}),L(qt,"Ellipse");let Bt=class extends Nt{constructor(t=O.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 Nt(N("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}};function Vt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Mt(t),fy:new Mt(e)}):this.attr({x1:new Mt(t),y1:new Mt(e)})}function Wt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Mt(t),cy:new Mt(e)}):this.attr({x2:new Mt(t),y2:new Mt(e)})}L(Bt,"Fragment");const Ht=Object.freeze(Object.defineProperty({__proto__:null,from:Vt,to:Wt},Symbol.toStringTag,{value:"Module"}));let Zt=class extends jt{constructor(t,e){super(T(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 at}targets(){return dt("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()+")"}};z(Zt,Ht),c({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:F((function(t,e){return this.put(new Zt(t)).update(e)}))}}),L(Zt,"Gradient");let Ut=class extends jt{constructor(t,e=t){super(T("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new at}targets(){return dt("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({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:F((function(t,e,n){return this.put(new Ut).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),L(Ut,"Pattern");let Qt=class extends Lt{constructor(t,e=t){super(T("image",t),e)}load(t,e){if(!t)return this;const n=new O.window.Image;return yt(n,"load",(function(t){const r=this.parent(Ut);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof Ut&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),yt(n,"load error",(function(){wt(n)})),this.attr("href",n.src=t,C)}};var Kt;Kt=function(t,e,n){return"fill"!==t&&"stroke"!==t||U.test(e)&&(e=n.root().defs().image(e)),e instanceof Qt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},St.push(Kt),c({Container:{image:F((function(t,e){return this.put(new Qt).size(0,0).load(t,e)}))}}),L(Qt,"Image");let Jt=class extends Ot{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new at(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(Q).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.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){st.isMatrixLike(t)||(t=new st(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}};const te=Jt;const ee=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:te,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},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)}},Symbol.toStringTag,{value:"Module"}));let ne=class extends Lt{constructor(t,e=t){super(T("line",t),e)}array(){return new Jt([[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,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Jt(t).toLine(),this.attr(t))}size(t,e){const n=y(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}};z(ne,ee),c({Container:{line:F((function(...t){return ne.prototype.plot.apply(this.put(new ne),null!=t[0]?t:[0,0,0,0])}))}}),L(ne,"Line");let re=class extends jt{constructor(t,e=t){super(T("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 ie(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}c({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:F((function(t,e,n){return this.put(new re).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof re?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),L(re,"Marker");const se={"-":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,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};let oe=class{done(){return!1}},he=class extends oe{constructor(t=_t){super(),this.ease=se[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}},ae=class extends oe{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}};function ue(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}z(class extends ae{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:ie("_duration",ue),overshoot:ie("_overshoot",ue)});z(class extends ae{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,h=this._windup;return!1!==h&&(s=Math.max(-h,Math.min(s,h))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:ie("_windup"),p:ie("P"),i:ie("I"),d:ie("D")});const le={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ce={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]]}},de="mlhvqtcsaz".split("");for(let Mu=0,ku=de.length;Mu<ku;++Mu)ce[de[Mu]]=function(t){return function(e,n,r){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 ce[t](e,n,r)}}(de[Mu].toUpperCase());function fe(t){return t.segment.length&&t.segment.length-1===le[t.segment[0].toUpperCase()]}function pe(t,e){t.inNumber&&me(t,!1);const n=K.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function me(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,fe(t)&&ge(t)}function ge(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return ce[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function ye(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 we(t){return"E"===t.lastToken.toUpperCase()}const be=new Set([" ",",","\t","\n","\r","\f"]);let xe=class extends Ot{bbox(){return ot().path.setAttribute("d",this.toString()),new at(ot.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=t,this[i][2]+=e):"H"===r?this[i][1]+=t:"V"===r?this[i][1]+=e:"C"===r||"S"===r||"Q"===r?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===r&&(this[i][5]+=t,this[i][6]+=e)):"A"===r&&(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,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new rt,p:new rt};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!pe(i,r))if("."!==r)if(isNaN(parseInt(r)))if(be.has(r))i.inNumber&&me(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(K.test(r)){if(i.inNumber)me(i,!1);else{if(!fe(i))throw new Error("parser Error");ge(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!we(i)){me(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||ye(i)){i.inNumber=!0,i.number=r,me(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){me(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&me(i,!1),i.inSegment&&fe(i)&&ge(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;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 ve=t=>{const e=typeof t;return"number"===e?Mt:"string"===e?nt.isColor(t)?nt:Q.test(t)?K.test(t)?xe:Ot:$.test(t)?Mt:Ee:ke.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Ot:"object"===e?Me:Ee};let _e=class{constructor(t){this._stepper=t||new he("-"),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(ve(t));let e=new this._type(t);return this._type===nt&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Me&&(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}},Ee=class{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}},Ce=class t{constructor(...t){this.init(...t)}init(e){return Array.isArray(e)&&(e={scaleX:e[0],scaleY:e[1],shear:e[2],rotate:e[3],translateX:e[4],translateY:e[5],originX:e[6],originY:e[7]}),Object.assign(this,t.defaults,e),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}};Ce.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Oe=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;let Me=class{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===nt&&t[n+7]!==e[n+7]){const e=t[n+7],r=new nt(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),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 r=ve(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(Oe),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(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}};const ke=[Ee,Ce,Me];let Se=class extends Lt{constructor(t,e=t){super(T("path",t),e)}array(){return this._array||(this._array=new xe(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 xe(t))}size(t,e){const n=y(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)}};Se.prototype.MorphArray=xe,c({Container:{path:F((function(t){return this.put(new Se).plot(t||new xe)}))}}),L(Se,"Path");const Ne=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new Jt(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 Jt(t))},size:function(t,e){const n=y(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));let Ae=class extends Lt{constructor(t,e=t){super(T("polygon",t),e)}};c({Container:{polygon:F((function(t){return this.put(new Ae).plot(t||new Jt)}))}}),z(Ae,ee),z(Ae,Ne),L(Ae,"Polygon");let Te=class extends Lt{constructor(t,e=t){super(T("polyline",t),e)}};c({Container:{polyline:F((function(t){return this.put(new Te).plot(t||new Jt)}))}}),z(Te,ee),z(Te,Ne),L(Te,"Polyline");let je=class extends Lt{constructor(t,e=t){super(T("rect",t),e)}};z(je,{rx:Rt,ry:Pt}),c({Container:{rect:F((function(t,e){return this.put(new je).size(t,e)}))}}),L(je,"Rect");let Ie=class{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 Le={nextDraw:null,frames:new Ie,timeouts:new Ie,immediates:new Ie,timer:()=>O.window.performance||O.window.Date,transforms:[],frame(t){const e=Le.frames.push({run:t});return null===Le.nextDraw&&(Le.nextDraw=O.window.requestAnimationFrame(Le._draw)),e},timeout(t,e){e=e||0;const n=Le.timer().now()+e,r=Le.timeouts.push({run:t,time:n});return null===Le.nextDraw&&(Le.nextDraw=O.window.requestAnimationFrame(Le._draw)),r},immediate(t){const e=Le.immediates.push(t);return null===Le.nextDraw&&(Le.nextDraw=O.window.requestAnimationFrame(Le._draw)),e},cancelFrame(t){null!=t&&Le.frames.remove(t)},clearTimeout(t){null!=t&&Le.timeouts.remove(t)},cancelImmediate(t){null!=t&&Le.immediates.remove(t)},_draw(t){let e=null;const n=Le.timeouts.last();for(;(e=Le.timeouts.shift())&&(t>=e.time?e.run():Le.timeouts.push(e),e!==n););let r=null;const i=Le.frames.last();for(;r!==i&&(r=Le.frames.shift());)r.run(t);let s=null;for(;s=Le.immediates.shift();)s();Le.nextDraw=Le.timeouts.first()||Le.frames.first()?O.window.requestAnimationFrame(Le._draw):null}},Re=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Pe=function(){const t=O.window;return(t.performance||t.Date).now()};let De=class extends bt{constructor(t=Pe){super(),this._timeSource=t,this.terminate()}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(Re);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+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 Le.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Le.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let s=this._runners.length;s--;){const t=this._runners[s],e=t.runner;this._time-t.start<=0&&e.reset()}let i=!1;for(let s=0,o=this._runners.length;s<o;s++){const t=this._runners[s],e=t.runner;let n=r;const h=this._time-t.start;if(h<=0){i=!0;continue}if(h<n&&(n=h),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--s,--o)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){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)}};c({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new De,this._timeline):(this._timeline=t,this)}}});let ze=class t extends bt{constructor(e){super(),this.id=t.id++,e="function"==typeof(e=null==e?vt:e)?new ae(e):e,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof e&&e,this._isDeclarative=e instanceof ae,this._stepper=this._isDeclarative?e:new he,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new st,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 r=1,i=!1,s=0;return e=e??Et,n=n||"last","object"!=typeof(t=t??vt)||t instanceof oe||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,s=t.wait??s,t=t.duration??vt),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(e,n,r){const i=t.sanitise(e,n,r),s=new t(i.duration);return this._timeline&&s.timeline(this._timeline),this._element&&s.element(this._element),s.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new st,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 he(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,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let h;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,h=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(h,1),0)},a=i*(r+n)-r;return h=e<=0?Math.round(t(1e-5)):e<a?t(e):Math.round(t(a-1e-5)),h}const a=Math.floor(this.loops()),u=s&&a%2==0;return h=a+(u&&!o||o&&u?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,r){this._queue.push({initialiser:t||xt,runner:e||xt,retarget:n,isTransform:r,initialised:!1,finished:!1});return 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 De||(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 r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let h=!1;return(n||o)&&(this._initialise(n),this.transforms=new st,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],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&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,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.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 r=this.timeline();return r&&r.play(),!0}return!1}};ze.id=0;let Fe=class{constructor(t=new st,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}};z([ze,Fe],{mergeWith(t){return new Fe(t.transforms.lmultiply(this.transforms),t.id)}});const $e=(t,e)=>t.lmultiplyO(e),Ye=t=>t.transforms;function Xe(){const t=this._transformationRunners.runners.map(Ye).reduce($e,new st);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}let Ge=class{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 Fe).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))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}};c({Element:{animate(t,e,n){const r=ze.sanitise(t,e,n),i=this.timeline();return new ze(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.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(Ye).reduce($e,new st)},_addRunner(t){this._transformationRunners.add(t),Le.cancelImmediate(this._frameId),this._frameId=Le.immediate(Xe.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ge).add(new Fe(new st(this))))}}});z(ze,{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 r=e;if(this._tryRetarget(t,r))return this;let i=new _e(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.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 Me(i.from()).valueOf();Object.assign(n,e),i.from(n)}const a=new Me(i.to()).valueOf();Object.assign(a,e),i.to(a),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new _e(this._stepper).to(new Mt(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,r){e=r,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 r=st.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new _e(this._stepper).type(n?Ce:st);let s,o,h,a,u;return this.queue((function(){o=o||this.element(),s=s||w(t,o),u=new st(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:d}=new rt(s).transform(o._currentTransform(this));let f=new st({...t,origin:[c,d]}),p=this._isDeclarative&&h?h:u;if(n){f=f.decompose(c,d),p=p.decompose(c,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);f.rotate=n[s]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&a&&(p.rotate=a)),i.from(p),i.to(f);const m=i.at(l);return a=m.rotate,h=new st(m),this.addTransform(h),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=w(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",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 Mt(e),this._tryRetarget(t,e))return this;const n=new _e(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new Mt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new _e(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 Mt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(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,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new _e(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new at(t,e,n,r))},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)}}),z(ze,{rx:Rt,ry:Pt,from:Vt,to:Wt}),L(ze,"Runner");let qe=class extends jt{constructor(t,e=t){super(T("svg",t),e),this.namespace()}defs(){return this.isRoot()?j(this.node.querySelector("defs"))||this.put(new It):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof O.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:_,version:"1.1"}).attr("xmlns:xlink",C,E):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,E).attr("xmlns:svgjs",null,E)}root(){return this.isRoot()?this:super.root()}};c({Container:{nested:F((function(){return this.put(new qe)}))}}),L(qe,"Svg",!0);let Be=class extends jt{constructor(t,e=t){super(T("symbol",t),e)}};c({Container:{symbol:F((function(){return this.put(new Be)}))}}),L(Be,"Symbol");const Ve=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(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)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(O.document.createTextNode(t)),this},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)}},Symbol.toStringTag,{value:"Module"}));let We=class extends Lt{constructor(t,e=t){super(T("text",t),e),this.dom.leading=this.dom.leading??new Mt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Mt(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(r){if(x(this.node))return;const i=O.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new Mt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Mt(t.leading||1.3),this}writeDataToDom(){return v(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||x(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===j(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);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()}};z(We,Ve),c({Container:{text:F((function(t=""){return this.put(new We).text(t)})),plain:F((function(t=""){return this.put(new We).plain(t)}))}}),L(We,"Text");let He=class extends Lt{constructor(t,e=t){super(T("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 We))return this;const e=t.index(this),n=O.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new Mt(n);return this.dy(e?r: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)}};z(He,Ve),c({Tspan:{tspan:F((function(t=""){const e=new He;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),L(He,"Tspan");let Ze=class extends Lt{constructor(t,e=t){super(T("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 Mt(t).divide(2))}};z(Ze,{x:Dt,y:zt,cx:Ft,cy:$t,width:Yt,height:Xt}),c({Container:{circle:F((function(t=0){return this.put(new Ze).size(t).move(0,0)}))}}),L(Ze,"Circle");let Ue=class extends jt{constructor(t,e=t){super(T("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return dt("svg [clip-path*="+this.id()+"]")}};c({Container:{clip:F((function(){return this.defs().put(new Ue)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Ue?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),L(Ue,"ClipPath");let Qe=class extends At{constructor(t,e=t){super(T("foreignObject",t),e)}};c({Container:{foreignObject:F((function(t,e){return this.put(new Qe).size(t,e)}))}}),L(Qe,"ForeignObject");const Ke=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof O.window.SVGSVGElement?new at(n.attr(["x","y","width","height"])):n.bbox()}catch(h){return}const i=new st(n),s=i.translate(t,e).transform(i.inverse()),o=new rt(r.x,r.y).transform(s);n.move(o.x,o.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 r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=y(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach((t=>{const e=new rt(n).transform(new st(t).inverse());t.scale(i,s,e.x,e.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)}},Symbol.toStringTag,{value:"Module"}));let Je=class extends jt{constructor(t,e=t){super(T("g",t),e)}};z(Je,Ke),c({Container:{group:F((function(){return this.put(new Je)}))}}),L(Je,"G");let tn=class extends jt{constructor(t,e=t){super(T("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,C)}};z(tn,Ke),c({Container:{link:F((function(t){return this.put(new tn).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 tn,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}}}),L(tn,"A");let en=class extends jt{constructor(t,e=t){super(T("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return dt("svg [mask*="+this.id()+"]")}};c({Container:{mask:F((function(){return this.defs().put(new en)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof en?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),L(en,"Mask");let nn=class extends At{constructor(t,e=t){super(T("stop",t),e)}update(t){return("number"==typeof t||t instanceof Mt)&&(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 Mt(t.offset)),this}};c({Gradient:{stop:function(t,e,n){return this.put(new nn).update(t,e,n)}}}),L(nn,"Stop");let rn=class extends At{constructor(t,e=t){super(T("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 r in e)n+=r.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[r]+";";return n+="}",n}(t,e))}};c("Dom",{style(t,e){return this.put(new rn).rule(t,e)},fontface(t,e,n){return this.put(new rn).font(t,e,n)}}),L(rn,"Style");let sn=class extends We{constructor(t,e=t){super(T("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")}};c({Container:{textPath:F((function(t,e){return t instanceof We||(t=this.text(t)),t.path(e)}))},Text:{path:F((function(t,e=!0){const n=new sn;let r;if(t instanceof Se||(t=this.defs().path(t)),n.attr("href","#"+t,C),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:F((function(t){return t instanceof We||(t=(new We).addTo(this.parent()).text(t)),t.path(this)})),targets(){return dt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),sn.prototype.MorphArray=xe,L(sn,"TextPath");let on=class extends Lt{constructor(t,e=t){super(T("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,C)}};c({Container:{use:F((function(t,e){return this.put(new on).use(t,e)}))}}),L(on,"Use"),z([qe,Be,Qt,Ut,re],d("viewbox")),z([ne,Te,Ae,Se],d("marker")),z(We,d("Text")),z(Se,d("Path")),z(It,d("Defs")),z([We,He],d("Tspan")),z([je,qt,Zt,ze],d("radius")),z(bt,d("EventTarget")),z(Nt,d("Dom")),z(At,d("Element")),z(Lt,d("Shape")),z([jt,Bt],d("Container")),z(Zt,d("Gradient")),z(ze,d("Runner")),lt.extend([...new Set(l)]),function(t=[]){ke.push(...[].concat(t))}([Mt,nt,at,st,Ot,Jt,xe,rt]),z(ke,{to(t){return(new _e).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});const hn={export:"data:image/svg+xml,%3csvg%20fill='%23000000'%20width='20px'%20height='20px'%20viewBox='0%200%2024%2024'%20id='export-2'%20xmlns='http://www.w3.org/2000/svg'%20class='icon%20line'%3e%3cpolyline%20id='primary'%20points='15%203%2021%203%2021%209'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/polyline%3e%3cpath%20id='primary-2'%20data-name='primary'%20d='M21,13v7a1,1,0,0,1-1,1H4a1,1,0,0,1-1-1V4A1,1,0,0,1,4,3h7'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/path%3e%3cline%20id='primary-3'%20data-name='primary'%20x1='11'%20y1='13'%20x2='21'%20y2='3'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/line%3e%3c/svg%3e","fit-screen":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='8%202%202%202%202%208%204%208%204%204%208%204%208%202'/%3e%3cpolygon%20points='24%202%2030%202%2030%208%2028%208%2028%204%2024%204%2024%202'/%3e%3cpolygon%20points='8%2030%202%2030%202%2024%204%2024%204%2028%208%2028%208%2030'/%3e%3cpolygon%20points='24%2030%2030%2030%2030%2024%2028%2024%2028%2028%2024%2028%2024%2030'/%3e%3cpath%20d='M24,24H8a2.0023,2.0023,0,0,1-2-2V10A2.0023,2.0023,0,0,1,8,8H24a2.0023,2.0023,0,0,1,2,2V22A2.0023,2.0023,0,0,1,24,24ZM8,10V22H24V10Z'/%3e%3crect%20fill='none'%20width='32'%20height='32'/%3e%3c/svg%3e","zoom-in":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:sketch='http://www.bohemiancoding.com/sketch/ns'%3e%3cg%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20transform='translate(-308.000000,%20-1139.000000)'%20fill='%23000000'%3e%3cpath%20d='M321.46,1163.45%20C315.17,1163.45%20310.07,1158.44%20310.07,1152.25%20C310.07,1146.06%20315.17,1141.04%20321.46,1141.04%20C327.75,1141.04%20332.85,1146.06%20332.85,1152.25%20C332.85,1158.44%20327.75,1163.45%20321.46,1163.45%20L321.46,1163.45%20Z%20M339.688,1169.25%20L331.429,1161.12%20C333.592,1158.77%20334.92,1155.67%20334.92,1152.25%20C334.92,1144.93%20328.894,1139%20321.46,1139%20C314.026,1139%20308,1144.93%20308,1152.25%20C308,1159.56%20314.026,1165.49%20321.46,1165.49%20C324.672,1165.49%20327.618,1164.38%20329.932,1162.53%20L338.225,1170.69%20C338.629,1171.09%20339.284,1171.09%20339.688,1170.69%20C340.093,1170.3%20340.093,1169.65%20339.688,1169.25%20L339.688,1169.25%20Z%20M326.519,1151.41%20L322.522,1151.41%20L322.522,1147.41%20C322.522,1146.85%20322.075,1146.41%20321.523,1146.41%20C320.972,1146.41%20320.524,1146.85%20320.524,1147.41%20L320.524,1151.41%20L316.529,1151.41%20C315.978,1151.41%20315.53,1151.59%20315.53,1152.14%20C315.53,1152.7%20315.978,1153.41%20316.529,1153.41%20L320.524,1153.41%20L320.524,1157.41%20C320.524,1157.97%20320.972,1158.41%20321.523,1158.41%20C322.075,1158.41%20322.522,1157.97%20322.522,1157.41%20L322.522,1153.41%20L326.519,1153.41%20C327.07,1153.41%20327.518,1152.96%20327.518,1152.41%20C327.518,1151.86%20327.07,1151.41%20326.519,1151.41%20L326.519,1151.41%20Z'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e","zoom-out":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20%3e%3cg%20transform='translate(-360.000000,%20-1139.000000)'%20fill='%23000000'%3e%3cpath%20d='M373.46,1163.45%20C367.17,1163.45%20362.071,1158.44%20362.071,1152.25%20C362.071,1146.06%20367.17,1141.04%20373.46,1141.04%20C379.75,1141.04%20384.85,1146.06%20384.85,1152.25%20C384.85,1158.44%20379.75,1163.45%20373.46,1163.45%20L373.46,1163.45%20Z%20M391.688,1169.25%20L383.429,1161.12%20C385.592,1158.77%20386.92,1155.67%20386.92,1152.25%20C386.92,1144.93%20380.894,1139%20373.46,1139%20C366.026,1139%20360,1144.93%20360,1152.25%20C360,1159.56%20366.026,1165.49%20373.46,1165.49%20C376.672,1165.49%20379.618,1164.38%20381.932,1162.53%20L390.225,1170.69%20C390.629,1171.09%20391.284,1171.09%20391.688,1170.69%20C392.093,1170.3%20392.093,1169.65%20391.688,1169.25%20L391.688,1169.25%20Z%20M378.689,1151.41%20L368.643,1151.41%20C368.102,1151.41%20367.663,1151.84%20367.663,1152.37%20C367.663,1152.9%20368.102,1153.33%20368.643,1153.33%20L378.689,1153.33%20C379.23,1153.33%20379.669,1152.9%20379.669,1152.37%20C379.669,1151.84%20379.23,1151.41%20378.689,1151.41%20L378.689,1151.41%20Z'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e"};class an{constructor(t,e){this.element=t,t&&(this.chartContext=e||new r(t),this.injectStyles())}injectStyles(){const t=`toolbar-styles-${this.chartContext.getInstanceId()}`;this.chartContext.injectStyles("\n #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n \n .toolbar-item {\n align-items: center;\n background-color: var(--toolbar-bg-color, #FFFFFF);\n border: 1px solid var(--toolbar-border-color, #BCBCBC);\n cursor: pointer;\n display: flex;\n height: 30px;\n justify-content: center;\n width: 30px;\n border-radius: 3px;\n transition: all 0.2s ease;\n position: relative;\n }\n \n .toolbar-item:hover {\n background-color: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #999);\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:active {\n transform: translateY(0);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);\n }\n \n .toolbar-item img {\n width: 16px;\n height: 16px;\n pointer-events: none;\n filter: var(--toolbar-icon-filter, none);\n }\n \n .toolbar-item[disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n \n /* Tooltip styles */\n .toolbar-item::after {\n content: attr(data-tooltip);\n position: absolute;\n bottom: -35px;\n left: 50%;\n transform: translateX(-50%);\n background: var(--tooltip-bg-color, #333);\n color: var(--tooltip-text-color, white);\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 12px;\n white-space: nowrap;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item::before {\n content: '';\n position: absolute;\n bottom: -25px;\n left: 50%;\n transform: translateX(-50%);\n border: 5px solid transparent;\n border-bottom-color: var(--tooltip-bg-color, #333);\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item:hover::after,\n .toolbar-item:hover::before {\n opacity: 1;\n }\n \n /* Shadow DOM specific adjustments */\n :host #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n",t)}createToolbarItem(t,e,n){const r=this.chartContext.createElement("div"),i=new Image;return i.src=e,i.alt=n||t,r.id=t,r.className="toolbar-item",r.setAttribute("role","button"),r.setAttribute("tabindex","0"),n&&(r.setAttribute("data-tooltip",n),r.setAttribute("aria-label",n)),r.append(i),r.addEventListener("keydown",(t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r.click())})),r}render({enableExport:t=!1,enableFitscreen:e=!1,enableZoom:n=!1,onExport:r=s,onFitscreen:i=s,onZoom:o=s}){if(!this.element)return;const h=this.chartContext.querySelector("#toolbar");null==h||h.remove();const a=this.chartContext.createElement("div");if(a.id="toolbar",a.setAttribute("role","toolbar"),a.setAttribute("aria-label","Chart controls"),t){const t=this.createToolbarItem("export",hn.export,"Export chart");t.addEventListener("click",(()=>{r()})),a.append(t)}if(n){const t=this.createToolbarItem("zoom-in",hn["zoom-in"],"Zoom in"),e=this.createToolbarItem("zoom-out",hn["zoom-out"],"Zoom out");t.addEventListener("click",(()=>{o(.1)})),e.addEventListener("click",(()=>{o(-.1)})),a.append(t,e)}if(e){const t=this.createToolbarItem("fit-screen",hn["fit-screen"],"Fit to screen");t.addEventListener("click",(()=>{i()})),a.append(t)}this.element.append(a)}destroy(){const t=this.chartContext.querySelector("#toolbar");null==t||t.remove()}}const un=class{static add(t){this.remove(t);const e=document.createElement("div");e.className=this.WATERMARK_CLASS,e.textContent=this.WATERMARK_TEXT,Object.assign(e.style,{bottom:"5px",color:"#666",fontFamily:"Arial, sans-serif",fontSize:"14px",msUserSelect:"none",pointerEvents:"none",position:"absolute",right:"5px",userSelect:"none",webkitUserSelect:"none",zIndex:"1000"}),"static"===getComputedStyle(t).position&&(t.style.position="relative"),t.appendChild(e)}static exists(t){return!!t.querySelector(`.${this.WATERMARK_CLASS}`)}static remove(t){const e=t.querySelector(`.${this.WATERMARK_CLASS}`);e&&e.remove()}};un.WATERMARK_CLASS="apexgantt-watermark",un.WATERMARK_TEXT="Powered by apexcharts.com";let ln=un;var cn,dn=(cn={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},function(t){return null==cn?void 0:cn[t]}),fn="object"==typeof global&&global&&global.Object===Object&&global,pn="object"==typeof self&&self&&self.Object===Object&&self,mn=(fn||pn||Function("return this")()).Symbol;var gn=Array.isArray,yn=Object.prototype,wn=yn.hasOwnProperty,bn=yn.toString,xn=mn?mn.toStringTag:void 0;var vn=Object.prototype.toString;var _n="[object Null]",En="[object Undefined]",Cn=mn?mn.toStringTag:void 0;function On(t){return null==t?void 0===t?En:_n:Cn&&Cn in Object(t)?function(t){var e=wn.call(t,xn),n=t[xn];try{t[xn]=void 0;var r=!0}catch(s){}var i=bn.call(t);return r&&(e?t[xn]=n:delete t[xn]),i}(t):function(t){return vn.call(t)}(t)}var Mn="[object Symbol]";var kn=1/0,Sn=mn?mn.prototype:void 0,Nn=Sn?Sn.toString:void 0;function An(t){if("string"==typeof t)return t;if(gn(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,An)+"";if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&On(t)==Mn}(t))return Nn?Nn.call(t):"";var e=t+"";return"0"==e&&1/t==-kn?"-0":e}function Tn(t){return null==t?"":An(t)}var jn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,In=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var Ln=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Rn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Pn="\\ud800-\\udfff",Dn="\\u2700-\\u27bf",zn="a-z\\xdf-\\xf6\\xf8-\\xff",Fn="A-Z\\xc0-\\xd6\\xd8-\\xde",$n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Yn="["+$n+"]",Xn="\\d+",Gn="["+Dn+"]",qn="["+zn+"]",Bn="[^"+Pn+$n+Xn+Dn+zn+Fn+"]",Vn="(?:\\ud83c[\\udde6-\\uddff]){2}",Wn="[\\ud800-\\udbff][\\udc00-\\udfff]",Hn="["+Fn+"]",Zn="(?:"+qn+"|"+Bn+")",Un="(?:"+Hn+"|"+Bn+")",Qn="(?:['’](?:d|ll|m|re|s|t|ve))?",Kn="(?:['’](?:D|LL|M|RE|S|T|VE))?",Jn="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",tr="[\\ufe0e\\ufe0f]?",er=tr+Jn+("(?:\\u200d(?:"+["[^"+Pn+"]",Vn,Wn].join("|")+")"+tr+Jn+")*"),nr="(?:"+[Gn,Vn,Wn].join("|")+")"+er,rr=RegExp([Hn+"?"+qn+"+"+Qn+"(?="+[Yn,Hn,"$"].join("|")+")",Un+"+"+Kn+"(?="+[Yn,Hn+Zn,"$"].join("|")+")",Hn+"?"+Zn+"+"+Qn,Hn+"+"+Kn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Xn,nr].join("|"),"g");function ir(t,e,n){return t=Tn(t),void 0===e?function(t){return Rn.test(t)}(t)?function(t){return t.match(rr)||[]}(t):function(t){return t.match(Ln)||[]}(t):t.match(e)||[]}var sr=RegExp("['’]","g");var or,hr=(or=function(t,e,n){return t+(n?"-":"")+e.toLowerCase()},function(t){return function(t,e,n,r){for(var i=-1,s=null==t?0:t.length;++i<s;)n=e(n,t[i],i,t);return n}(ir(function(t){return(t=Tn(t))&&t.replace(jn,dn).replace(In,"")}(t).replace(sr,"")),or,"")});const ar=(t,e="apex-tooltip-container")=>{let n=t.getElementById(e);if(!n){n=t.createElement("div"),n.id=e,n.setAttribute("role","tooltip"),n.setAttribute("aria-hidden","true");t.getAppendContainer().appendChild(n)}return n},ur=(t,e="",n,r="")=>{const i=t.getElementById(e);if(!i)return console.warn("Tooltip: Element not found, creating it"),ar(t,e),ur(t,e,n,r);if(n&&r){const t=r.includes("tooltip-content"),e=n.match(/background-color:\s*([^;]+);?/),s=n.match(/color:\s*([^;]+);?/),o=e?e[1]:"#333",h=s?s[1]:"white";i.innerHTML=t?r:`<div class="tooltip-content" style="background-color: ${o}; color: ${h};">${r}</div>`;const a=n+"; display: block !important; visibility: visible !important; opacity: 1 !important;";i.setAttribute("style",a),i.classList.add("visible"),i.setAttribute("aria-hidden","false")}else i.removeAttribute("style"),i.classList.remove("visible"),i.setAttribute("aria-hidden","true"),i.innerHTML=""},lr=(t={})=>{const e=[];for(const n in t){const r=`${hr(n)}: ${t[n]};`;e.push(r)}return e.join(" ")};var cr="\0",dr="\0",fr="";function pr(t,e){t[e]?t[e]++:t[e]=1}function mr(t,e){--t[e]||delete t[e]}function gr(t,e,n,r){var i=""+e,s=""+n;if(!t&&i>s){var o=i;i=s,s=o}return i+fr+s+fr+(void 0===r?cr:r)}function yr(t,e){return gr(t,e.v,e.w,e.name)}var wr=class{constructor(t){n(this,"_isDirected",!0),n(this,"_isMultigraph",!1),n(this,"_isCompound",!1),n(this,"_label"),n(this,"_defaultNodeLabelFn",(()=>{})),n(this,"_defaultEdgeLabelFn",(()=>{})),n(this,"_nodes",{}),n(this,"_in",{}),n(this,"_preds",{}),n(this,"_out",{}),n(this,"_sucs",{}),n(this,"_edgeObjs",{}),n(this,"_edgeLabels",{}),n(this,"_nodeCount",0),n(this,"_edgeCount",0),n(this,"_parent"),n(this,"_children"),t&&(this._isDirected=!Object.hasOwn(t,"directed")||t.directed,this._isMultigraph=!!Object.hasOwn(t,"multigraph")&&t.multigraph,this._isCompound=!!Object.hasOwn(t,"compound")&&t.compound),this._isCompound&&(this._parent={},this._children={},this._children[dr]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return this._defaultNodeLabelFn=t,"function"!=typeof t&&(this._defaultNodeLabelFn=()=>t),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var t=this;return this.nodes().filter((e=>0===Object.keys(t._in[e]).length))}sinks(){var t=this;return this.nodes().filter((e=>0===Object.keys(t._out[e]).length))}setNodes(t,e){var n=arguments,r=this;return t.forEach((function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this}setNode(t,e){return Object.hasOwn(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=dr,this._children[t]={},this._children[dr][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.hasOwn(this._nodes,t)}removeNode(t){var e=this;if(Object.hasOwn(this._nodes,t)){var n=t=>e.removeEdge(e._edgeObjs[t]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach((function(t){e.setParent(t)})),delete this._children[t]),Object.keys(this._in[t]).forEach(n),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(void 0===e)e=dr;else{for(var n=e+="";void 0!==n;n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==dr)return e}}children(t=dr){if(this._isCompound){var e=this._children[t];if(e)return Object.keys(e)}else{if(t===dr)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var e=this._preds[t];if(e)return Object.keys(e)}successors(t){var e=this._sucs[t];if(e)return Object.keys(e)}neighbors(t){var e=this.predecessors(t);if(e){const r=new Set(e);for(var n of this.successors(t))r.add(n);return Array.from(r.values())}}isLeaf(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach((function([n,r]){t(n)&&e.setNode(n,r)})),Object.values(this._edgeObjs).forEach((function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function i(t){var s=n.parent(t);return void 0===s||e.hasNode(s)?(r[t]=s,s):s in r?r[s]:i(s)}return this._isCompound&&e.nodes().forEach((t=>e.setParent(t,i(t)))),e}setDefaultEdgeLabel(t){return this._defaultEdgeLabelFn=t,"function"!=typeof t&&(this._defaultEdgeLabelFn=()=>t),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,e){var n=this,r=arguments;return t.reduce((function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this}setEdge(){var t,e,n,r,i=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(t=s.v,e=s.w,n=s.name,2===arguments.length&&(r=arguments[1],i=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),t=""+t,e=""+e,void 0!==n&&(n=""+n);var o=gr(this._isDirected,t,e,n);if(Object.hasOwn(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(void 0!==n&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(t,e,n);var h=function(t,e,n,r){var i=""+e,s=""+n;if(!t&&i>s){var o=i;i=s,s=o}var h={v:i,w:s};r&&(h.name=r);return h}(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[o]=h,pr(this._preds[e],t),pr(this._sucs[t],e),this._in[e][o]=h,this._out[t][o]=h,this._edgeCount++,this}edge(t,e,n){var r=1===arguments.length?yr(this._isDirected,arguments[0]):gr(this._isDirected,t,e,n);return this._edgeLabels[r]}edgeAsObj(){const t=this.edge(...arguments);return"object"!=typeof t?{label:t}:t}hasEdge(t,e,n){var r=1===arguments.length?yr(this._isDirected,arguments[0]):gr(this._isDirected,t,e,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(t,e,n){var r=1===arguments.length?yr(this._isDirected,arguments[0]):gr(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],mr(this._preds[e],t),mr(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this}inEdges(t,e){var n=this._in[t];if(n){var r=Object.values(n);return e?r.filter((t=>t.v===e)):r}}outEdges(t,e){var n=this._out[t];if(n){var r=Object.values(n);return e?r.filter((t=>t.w===e)):r}}nodeEdges(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},br={Graph:wr,version:"2.2.4"},xr=wr,vr={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:_r(t),edges:Er(t)};void 0!==t.graph()&&(e.value=structuredClone(t.graph()));return e},read:function(t){var e=new xr(t.options).setGraph(t.value);return t.nodes.forEach((function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),t.edges.forEach((function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function _r(t){return t.nodes().map((function(e){var n=t.node(e),r=t.parent(e),i={v:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.parent=r),i}))}function Er(t){return t.edges().map((function(e){var n=t.edge(e),r={v:e.v,w:e.w};return void 0!==e.name&&(r.name=e.name),void 0!==n&&(r.value=n),r}))}var Cr=function(t){var e,n={},r=[];function i(r){Object.hasOwn(n,r)||(n[r]=!0,e.push(r),t.successors(r).forEach(i),t.predecessors(r).forEach(i))}return t.nodes().forEach((function(t){e=[],i(t),e.length&&r.push(e)})),r};var Or=class{constructor(){n(this,"_arr",[]),n(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map((function(t){return t.key}))}has(t){return Object.hasOwn(this._keyIndices,t)}priority(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority}min(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key}add(t,e){var n=this._keyIndices;if(t=String(t),!Object.hasOwn(n,t)){var r=this._arr,i=r.length;return n[t]=i,r.push({key:t,priority:e}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)}_heapify(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))}_decrease(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e}_swap(t,e){var n=this._arr,r=this._keyIndices,i=n[t],s=n[e];n[t]=s,n[e]=i,r[s.key]=t,r[i.key]=e}},Mr=Or,kr=function(t,e,n,r){return function(t,e,n,r){var i,s,o={},h=new Mr,a=function(t){var e=t.v!==i?t.v:t.w,r=o[e],a=n(t),u=s.distance+a;if(a<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);u<r.distance&&(r.distance=u,r.predecessor=i,h.decrease(e,u))};t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;o[t]={distance:n},h.add(t,n)}));for(;h.size()>0&&(i=h.removeMin(),(s=o[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(a);return o}(t,String(e),n||Sr,r||function(e){return t.outEdges(e)})},Sr=()=>1;var Nr=kr,Ar=function(t,e,n){return t.nodes().reduce((function(r,i){return r[i]=Nr(t,i,e,n),r}),{})};var Tr=function(t){var e=0,n=[],r={},i=[];function s(o){var h=r[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),t.successors(o).forEach((function(t){Object.hasOwn(r,t)?r[t].onStack&&(h.lowlink=Math.min(h.lowlink,r[t].index)):(s(t),h.lowlink=Math.min(h.lowlink,r[t].lowlink))})),h.lowlink===h.index){var a,u=[];do{a=n.pop(),r[a].onStack=!1,u.push(a)}while(o!==a);i.push(u)}}return t.nodes().forEach((function(t){Object.hasOwn(r,t)||s(t)})),i};var jr=Tr,Ir=function(t){return jr(t).filter((function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))};var Lr=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,s=e(n);r[t][i]={distance:s,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var s=r[n];i.forEach((function(n){var r=s[t],i=e[n],o=s[n],h=r.distance+i.distance;h<o.distance&&(o.distance=h,o.predecessor=i.predecessor)}))}))})),r}(t,e||Rr,n||function(e){return t.outEdges(e)})},Rr=()=>1;function Pr(t){var e={},n={},r=[];if(t.sinks().forEach((function i(s){if(Object.hasOwn(n,s))throw new Dr;Object.hasOwn(e,s)||(n[s]=!0,e[s]=!0,t.predecessors(s).forEach(i),delete n[s],r.push(s))})),Object.keys(e).length!==t.nodeCount())throw new Dr;return r}class Dr extends Error{constructor(){super(...arguments)}}var zr=Pr;Pr.CycleException=Dr;var Fr=zr;var $r=function(t,e,n){Array.isArray(e)||(e=[e]);var r=t.isDirected()?e=>t.successors(e):e=>t.neighbors(e),i="post"===n?Yr:Xr,s=[],o={};return e.forEach((e=>{if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);i(e,r,o,s)})),s};function Yr(t,e,n,r){for(var i=[[t,!1]];i.length>0;){var s=i.pop();s[1]?r.push(s[0]):Object.hasOwn(n,s[0])||(n[s[0]]=!0,i.push([s[0],!0]),Gr(e(s[0]),(t=>i.push([t,!1]))))}}function Xr(t,e,n,r){for(var i=[t];i.length>0;){var s=i.pop();Object.hasOwn(n,s)||(n[s]=!0,r.push(s),Gr(e(s),(t=>i.push(t))))}}function Gr(t,e){for(var n=t.length;n--;)e(t[n],n,t);return t}var qr=$r;var Br=$r;var Vr=wr,Wr=Or;var Hr={Graph:br.Graph,json:vr,alg:{components:Cr,dijkstra:kr,dijkstraAll:Ar,findCycles:Ir,floydWarshall:Lr,isAcyclic:function(t){try{Fr(t)}catch(e){if(e instanceof Fr.CycleException)return!1;throw e}return!0},postorder:function(t,e){return qr(t,e,"post")},preorder:function(t,e){return Br(t,e,"pre")},prim:function(t,e){var n,r=new Vr,i={},s=new Wr;function o(t){var r=t.v===n?t.w:t.v,o=s.priority(r);if(void 0!==o){var h=e(t);h<o&&(i[r]=n,s.decrease(r,h))}}if(0===t.nodeCount())return r;t.nodes().forEach((function(t){s.add(t,Number.POSITIVE_INFINITY),r.setNode(t)})),s.decrease(t.nodes()[0],0);var h=!1;for(;s.size()>0;){if(n=s.removeMin(),Object.hasOwn(i,n))r.setEdge(n,i[n]);else{if(h)throw new Error("Input graph is not connected: "+t);h=!0}t.nodeEdges(n).forEach(o)}return r},tarjan:Tr,topsort:zr},version:br.version};function Zr(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Ur(t,e){if("_next"!==t&&"_prev"!==t)return e}let Qr=Hr.Graph,Kr=class{constructor(){let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return Zr(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&Zr(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){let t=[],e=this._sentinel,n=e._prev;for(;n!==e;)t.push(JSON.stringify(n,Ur)),n=n._prev;return"["+t.join(", ")+"]"}};var Jr=function(t,e){if(t.nodeCount()<=1)return[];let n=function(t,e){let n=new Qr,r=0,i=0;t.nodes().forEach((t=>{n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((t=>{let s=n.edge(t.v,t.w)||0,o=e(t),h=s+o;n.setEdge(t.v,t.w,h),i=Math.max(i,n.node(t.v).out+=o),r=Math.max(r,n.node(t.w).in+=o)}));let s=function(t){const e=[];for(let n=0;n<t;n++)e.push(n);return e}(i+r+3).map((()=>new Kr)),o=r+1;return n.nodes().forEach((t=>{ni(s,o,n.node(t))})),{graph:n,buckets:s,zeroIdx:o}}(t,e||ti);return function(t,e,n){let r,i=[],s=e[e.length-1],o=e[0];for(;t.nodeCount();){for(;r=o.dequeue();)ei(t,e,n,r);for(;r=s.dequeue();)ei(t,e,n,r);if(t.nodeCount())for(let s=e.length-2;s>0;--s)if(r=e[s].dequeue(),r){i=i.concat(ei(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx).flatMap((e=>t.outEdges(e.v,e.w)))};let ti=()=>1;function ei(t,e,n,r,i){let s=i?[]:void 0;return t.inEdges(r.v).forEach((r=>{let o=t.edge(r),h=t.node(r.v);i&&s.push({v:r.v,w:r.w}),h.out-=o,ni(e,n,h)})),t.outEdges(r.v).forEach((r=>{let i=t.edge(r),s=r.w,o=t.node(s);o.in-=i,ni(e,n,o)})),t.removeNode(r.v),s}function ni(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}let ri=Hr.Graph;var ii={addBorderNode:function(t,e,n,r){let i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return si(t,"border",i,e)},addDummyNode:si,applyWithChunking:hi,asNonCompoundGraph:function(t){let e=new ri({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((n=>{t.children(n).length||e.setNode(n,t.node(n))})),t.edges().forEach((n=>{e.setEdge(n,t.edge(n))})),e},buildLayerMatrix:function(t){let e=ci(ai(t)+1).map((()=>[]));return t.nodes().forEach((n=>{let r=t.node(n),i=r.rank;void 0!==i&&(e[i][r.order]=n)})),e},intersectRect:function(t,e){let n,r,i=t.x,s=t.y,o=e.x-i,h=e.y-s,a=t.width/2,u=t.height/2;if(!o&&!h)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(h)*a>Math.abs(o)*u?(h<0&&(u=-u),n=u*o/h,r=u):(o<0&&(a=-a),n=a,r=a*h/o);return{x:i+n,y:s+r}},mapValues:function(t,e){let n=e;"string"==typeof e&&(n=t=>t[e]);return Object.entries(t).reduce(((t,[e,r])=>(t[e]=n(r,e),t)),{})},maxRank:ai,normalizeRanks:function(t){let e=t.nodes().map((e=>{let n=t.node(e).rank;return void 0===n?Number.MAX_VALUE:n})),n=hi(Math.min,e);t.nodes().forEach((e=>{let r=t.node(e);Object.hasOwn(r,"rank")&&(r.rank-=n)}))},notime:function(t,e){return e()},partition:function(t,e){let n={lhs:[],rhs:[]};return t.forEach((t=>{e(t)?n.lhs.push(t):n.rhs.push(t)})),n},pick:function(t,e){const n={};for(const r of e)void 0!==t[r]&&(n[r]=t[r]);return n},predecessorWeights:function(t){let e=t.nodes().map((e=>{let n={};return t.inEdges(e).forEach((e=>{n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return di(t.nodes(),e)},range:ci,removeEmptyRanks:function(t){let e=t.nodes().map((e=>t.node(e).rank)),n=hi(Math.min,e),r=[];t.nodes().forEach((e=>{let i=t.node(e).rank-n;r[i]||(r[i]=[]),r[i].push(e)}));let i=0,s=t.graph().nodeRankFactor;Array.from(r).forEach(((e,n)=>{void 0===e&&n%s!=0?--i:void 0!==e&&i&&e.forEach((e=>t.node(e).rank+=i))}))},simplify:function(t){let e=(new ri).setGraph(t.graph());return t.nodes().forEach((n=>e.setNode(n,t.node(n)))),t.edges().forEach((n=>{let r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},successorWeights:function(t){let e=t.nodes().map((e=>{let n={};return t.outEdges(e).forEach((e=>{n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return di(t.nodes(),e)},time:function(t,e){let n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}},uniqueId:li,zipObject:di};function si(t,e,n,r){let i;do{i=li(r)}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}const oi=65535;function hi(t,e){if(e.length>oi){const n=function(t,e=oi){const n=[];for(let r=0;r<t.length;r+=e){const i=t.slice(r,r+e);n.push(i)}return n}(e);return t.apply(null,n.map((e=>t.apply(null,e))))}return t.apply(null,e)}function ai(t){const e=t.nodes().map((e=>{let n=t.node(e).rank;return void 0===n?Number.MIN_VALUE:n}));return hi(Math.max,e)}let ui=0;function li(t){var e=++ui;return toString(t)+e}function ci(t,e,n=1){null==e&&(e=t,t=0);let r=t=>t<e;n<0&&(r=t=>e<t);const i=[];for(let s=t;r(s);s+=n)i.push(s);return i}function di(t,e){return t.reduce(((t,n,r)=>(t[n]=e[r],t)),{})}let fi=Jr,pi=ii.uniqueId;var mi={run:function(t){("greedy"===t.graph().acyclicer?fi(t,(e=t,t=>e.edge(t).weight)):function(t){let e=[],n={},r={};function i(s){Object.hasOwn(r,s)||(r[s]=!0,n[s]=!0,t.outEdges(s).forEach((t=>{Object.hasOwn(n,t.w)?e.push(t):i(t.w)})),delete n[s])}return t.nodes().forEach(i),e}(t)).forEach((e=>{let n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,pi("rev"))}));var e},undo:function(t){t.edges().forEach((e=>{let n=t.edge(e);if(n.reversed){t.removeEdge(e);let r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}};let gi=ii;var yi={run:function(t){t.graph().dummyChains=[],t.edges().forEach((e=>function(t,e){let n,r,i,s=e.v,o=t.node(s).rank,h=e.w,a=t.node(h).rank,u=e.name,l=t.edge(e),c=l.labelRank;if(a===o+1)return;for(t.removeEdge(e),i=0,++o;o<a;++i,++o)l.points=[],r={width:0,height:0,edgeLabel:l,edgeObj:e,rank:o},n=gi.addDummyNode(t,"edge",r,"_d"),o===c&&(r.width=l.width,r.height=l.height,r.dummy="edge-label",r.labelpos=l.labelpos),t.setEdge(s,n,{weight:l.weight},u),0===i&&t.graph().dummyChains.push(n),s=n;t.setEdge(s,h,{weight:l.weight},u)}(t,e)))},undo:function(t){t.graph().dummyChains.forEach((e=>{let n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}};const{applyWithChunking:wi}=ii;var bi={longestPath:function(t){var e={};t.sources().forEach((function n(r){var i=t.node(r);if(Object.hasOwn(e,r))return i.rank;e[r]=!0;let s=t.outEdges(r).map((e=>null==e?Number.POSITIVE_INFINITY:n(e.w)-t.edge(e).minlen));var o=wi(Math.min,s);return o===Number.POSITIVE_INFINITY&&(o=0),i.rank=o}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}};var xi=Hr.Graph,vi=bi.slack,_i=function(t){var e,n,r=new xi({directed:!1}),i=t.nodes()[0],s=t.nodeCount();r.setNode(i,{});for(;Ei(r,t)<s;)e=Ci(r,t),n=r.hasNode(e.v)?vi(t,e):-vi(t,e),Oi(r,t,n);return r};function Ei(t,e){return t.nodes().forEach((function n(r){e.nodeEdges(r).forEach((i=>{var s=i.v,o=r===s?i.w:s;t.hasNode(o)||vi(e,i)||(t.setNode(o,{}),t.setEdge(r,o,{}),n(o))}))})),t.nodeCount()}function Ci(t,e){return e.edges().reduce(((n,r)=>{let i=Number.POSITIVE_INFINITY;return t.hasNode(r.v)!==t.hasNode(r.w)&&(i=vi(e,r)),i<n[0]?[i,r]:n}),[Number.POSITIVE_INFINITY,null])[1]}function Oi(t,e,n){t.nodes().forEach((t=>e.node(t).rank+=n))}var Mi=_i,ki=bi.slack,Si=bi.longestPath,Ni=Hr.alg.preorder,Ai=Hr.alg.postorder,Ti=ii.simplify,ji=Ii;function Ii(t){t=Ti(t),Si(t);var e,n=Mi(t);for(Pi(n),Li(n,t);e=zi(n);)$i(n,t,e,Fi(n,t,e))}function Li(t,e){var n=Ai(t,t.nodes());(n=n.slice(0,n.length-1)).forEach((n=>function(t,e,n){var r=t.node(n),i=r.parent;t.edge(n,i).cutvalue=Ri(t,e,n)}(t,e,n)))}function Ri(t,e,n){var r=t.node(n).parent,i=!0,s=e.edge(n,r),o=0;return s||(i=!1,s=e.edge(r,n)),o=s.weight,e.nodeEdges(n).forEach((s=>{var h,a,u=s.v===n,l=u?s.w:s.v;if(l!==r){var c=u===i,d=e.edge(s).weight;if(o+=c?d:-d,h=n,a=l,t.hasEdge(h,a)){var f=t.edge(n,l).cutvalue;o+=c?-f:f}}})),o}function Pi(t,e){arguments.length<2&&(e=t.nodes()[0]),Di(t,{},1,e)}function Di(t,e,n,r,i){var s=n,o=t.node(r);return e[r]=!0,t.neighbors(r).forEach((i=>{Object.hasOwn(e,i)||(n=Di(t,e,n,i,r))})),o.low=s,o.lim=n++,i?o.parent=i:delete o.parent,n}function zi(t){return t.edges().find((e=>t.edge(e).cutvalue<0))}function Fi(t,e,n){var r=n.v,i=n.w;e.hasEdge(r,i)||(r=n.w,i=n.v);var s=t.node(r),o=t.node(i),h=s,a=!1;return s.lim>o.lim&&(h=o,a=!0),e.edges().filter((e=>a===Yi(t,t.node(e.v),h)&&a!==Yi(t,t.node(e.w),h))).reduce(((t,n)=>ki(e,n)<ki(e,t)?n:t))}function $i(t,e,n,r){var i=n.v,s=n.w;t.removeEdge(i,s),t.setEdge(r.v,r.w,{}),Pi(t),Li(t,e),function(t,e){var n=t.nodes().find((t=>!e.node(t).parent)),r=Ni(t,n);(r=r.slice(1)).forEach((n=>{var r=t.node(n).parent,i=e.edge(n,r),s=!1;i||(i=e.edge(r,n),s=!0),e.node(n).rank=e.node(r).rank+(s?i.minlen:-i.minlen)}))}(t,e)}function Yi(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}Ii.initLowLimValues=Pi,Ii.initCutValues=Li,Ii.calcCutValue=Ri,Ii.leaveEdge=zi,Ii.enterEdge=Fi,Ii.exchangeEdges=$i;var Xi=bi.longestPath,Gi=_i,qi=ji,Bi=function(t){switch(t.graph().ranker){case"network-simplex":default:Wi(t);break;case"tight-tree":!function(t){Xi(t),Gi(t)}(t);break;case"longest-path":Vi(t)}};var Vi=Xi;function Wi(t){qi(t)}let Hi=ii;function Zi(t,e,n,r,i,s,o){let h=t.children(o);if(!h.length)return void(o!==e&&t.setEdge(e,o,{weight:0,minlen:n}));let a=Hi.addBorderNode(t,"_bt"),u=Hi.addBorderNode(t,"_bb"),l=t.node(o);t.setParent(a,o),l.borderTop=a,t.setParent(u,o),l.borderBottom=u,h.forEach((h=>{Zi(t,e,n,r,i,s,h);let l=t.node(h),c=l.borderTop?l.borderTop:h,d=l.borderBottom?l.borderBottom:h,f=l.borderTop?r:2*r,p=c!==d?1:i-s[o]+1;t.setEdge(a,c,{weight:f,minlen:p,nestingEdge:!0}),t.setEdge(d,u,{weight:f,minlen:p,nestingEdge:!0})})),t.parent(o)||t.setEdge(e,a,{weight:0,minlen:i+s[o]})}let Ui=ii;function Qi(t,e,n,r,i,s){let o={width:0,height:0,rank:s,borderType:e},h=i[e][s-1],a=Ui.addDummyNode(t,"border",o,n);i[e][s]=a,t.setParent(a,r),h&&t.setEdge(h,a,{weight:1})}function Ki(t){t.nodes().forEach((e=>Ji(t.node(e)))),t.edges().forEach((e=>Ji(t.edge(e))))}function Ji(t){let e=t.width;t.width=t.height,t.height=e}function ts(t){t.y=-t.y}function es(t){let e=t.x;t.x=t.y,t.y=e}let ns=ii;let rs=ii.zipObject;function is(t,e,n){let r=rs(n,n.map(((t,e)=>e))),i=e.flatMap((e=>t.outEdges(e).map((e=>({pos:r[e.w],weight:t.edge(e).weight}))).sort(((t,e)=>t.pos-e.pos)))),s=1;for(;s<n.length;)s<<=1;let o=2*s-1;s-=1;let h=new Array(o).fill(0),a=0;return i.forEach((t=>{let e=t.pos+s;h[e]+=t.weight;let n=0;for(;e>0;)e%2&&(n+=h[e+1]),e=e-1>>1,h[e]+=t.weight;a+=t.weight*n})),a}let ss=ii;let os=ii;function hs(t,e,n){let r;for(;e.length&&(r=e[e.length-1]).i<=n;)e.pop(),t.push(r.vs),n++;return n}let as=function(t,e=[]){return e.map((e=>{let n=t.inEdges(e);if(n.length){let r=n.reduce(((e,n)=>{let r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))},us=function(t,e){let n={};return t.forEach(((t,e)=>{let r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};void 0!==t.barycenter&&(r.barycenter=t.barycenter,r.weight=t.weight)})),e.edges().forEach((t=>{let e=n[t.v],r=n[t.w];void 0!==e&&void 0!==r&&(r.indegree++,e.out.push(n[t.w]))})),function(t){let e=[];function n(t){return e=>{e.merged||(void 0===e.barycenter||void 0===t.barycenter||e.barycenter>=t.barycenter)&&function(t,e){let n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return n=>{n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){let i=t.pop();e.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return e.filter((t=>!t.merged)).map((t=>ss.pick(t,["vs","i","barycenter","weight"])))}(Object.values(n).filter((t=>!t.indegree)))},ls=function(t,e){let n=os.partition(t,(t=>Object.hasOwn(t,"barycenter"))),r=n.lhs,i=n.rhs.sort(((t,e)=>e.i-t.i)),s=[],o=0,h=0,a=0;r.sort((u=!!e,(t,e)=>t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:u?e.i-t.i:t.i-e.i)),a=hs(s,i,a),r.forEach((t=>{a+=t.vs.length,s.push(t.vs),o+=t.barycenter*t.weight,h+=t.weight,a=hs(s,i,a)}));var u;let l={vs:s.flat(!0)};h&&(l.barycenter=o/h,l.weight=h);return l};var cs=function t(e,n,r,i){let s=e.children(n),o=e.node(n),h=o?o.borderLeft:void 0,a=o?o.borderRight:void 0,u={};h&&(s=s.filter((t=>t!==h&&t!==a)));let l=as(e,s);l.forEach((n=>{if(e.children(n.v).length){let h=t(e,n.v,r,i);u[n.v]=h,Object.hasOwn(h,"barycenter")&&(o=h,void 0!==(s=n).barycenter?(s.barycenter=(s.barycenter*s.weight+o.barycenter*o.weight)/(s.weight+o.weight),s.weight+=o.weight):(s.barycenter=o.barycenter,s.weight=o.weight))}var s,o}));let c=us(l,r);!function(t,e){t.forEach((t=>{t.vs=t.vs.flatMap((t=>e[t]?e[t].vs:t))}))}(c,u);let d=ls(c,i);if(h&&(d.vs=[h,d.vs,a].flat(!0),e.predecessors(h).length)){let t=e.node(e.predecessors(h)[0]),n=e.node(e.predecessors(a)[0]);Object.hasOwn(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+t.order+n.order)/(d.weight+2),d.weight+=2}return d};let ds=Hr.Graph,fs=ii;let ps=function(t){let e={},n=t.nodes().filter((e=>!t.children(e).length)),r=n.map((e=>t.node(e).rank)),i=ns.applyWithChunking(Math.max,r),s=ns.range(i+1).map((()=>[]));return n.sort(((e,n)=>t.node(e).rank-t.node(n).rank)).forEach((function n(r){if(e[r])return;e[r]=!0;let i=t.node(r);s[i.rank].push(r),t.successors(r).forEach(n)})),s},ms=function(t,e){let n=0;for(let r=1;r<e.length;++r)n+=is(t,e[r-1],e[r]);return n},gs=cs,ys=function(t,e,n){let r=function(t){var e;for(;t.hasNode(e=fs.uniqueId("_root")););return e}(t),i=new ds({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((e=>t.node(e)));return t.nodes().forEach((s=>{let o=t.node(s),h=t.parent(s);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(s),i.setParent(s,h||r),t[n](s).forEach((e=>{let n=e.v===s?e.w:e.v,r=i.edge(n,s),o=void 0!==r?r.weight:0;i.setEdge(n,s,{weight:t.edge(e).weight+o})})),Object.hasOwn(o,"minRank")&&i.setNode(s,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))})),i},ws=function(t,e,n){let r,i={};n.forEach((n=>{let s,o,h=t.parent(n);for(;h;){if(s=t.parent(h),s?(o=i[s],i[s]=h):(o=r,r=h),o&&o!==h)return void e.setEdge(o,h);h=s}}))},bs=Hr.Graph,xs=ii;var vs=function t(e,n){if(n&&"function"==typeof n.customOrder)return void n.customOrder(e,t);let r=xs.maxRank(e),i=_s(e,xs.range(1,r+1),"inEdges"),s=_s(e,xs.range(r-1,-1,-1),"outEdges"),o=ps(e);if(Cs(e,o),n&&n.disableOptimalOrderHeuristic)return;let h,a=Number.POSITIVE_INFINITY;for(let u=0,l=0;l<4;++u,++l){Es(u%2?i:s,u%4>=2),o=xs.buildLayerMatrix(e);let t=ms(e,o);t<a&&(l=0,h=Object.assign({},o),a=t)}Cs(e,h)};function _s(t,e,n){return e.map((function(e){return ys(t,e,n)}))}function Es(t,e){let n=new bs;t.forEach((function(t){let r=t.graph().root,i=gs(t,r,n,e);i.vs.forEach(((e,n)=>t.node(e).order=n)),ws(t,n,i.vs)}))}function Cs(t,e){Object.values(e).forEach((e=>e.forEach(((e,n)=>t.node(e).order=n))))}let Os=Hr.Graph,Ms=ii;var ks=function(t){let e,n=Ms.buildLayerMatrix(t),r=Object.assign(Ss(t,n),Ns(t,n)),i={};["u","d"].forEach((s=>{e="u"===s?n:Object.values(n).reverse(),["l","r"].forEach((n=>{"r"===n&&(e=e.map((t=>Object.values(t).reverse())));let o=("u"===s?t.predecessors:t.successors).bind(t),h=js(t,e,r,o),a=Is(t,e,h.root,h.align,"r"===n);"r"===n&&(a=Ms.mapValues(a,(t=>-t))),i[s+n]=a}))}));let s=Ls(t,i);return Rs(i,s),Ps(i,t.graph().align)};function Ss(t,e){let n={};return e.length&&e.reduce((function(e,r){let i=0,s=0,o=e.length,h=r[r.length-1];return r.forEach(((e,a)=>{let u=function(t,e){if(t.node(e).dummy)return t.predecessors(e).find((e=>t.node(e).dummy))}(t,e),l=u?t.node(u).order:o;(u||e===h)&&(r.slice(s,a+1).forEach((e=>{t.predecessors(e).forEach((r=>{let s=t.node(r),o=s.order;!(o<i||l<o)||s.dummy&&t.node(e).dummy||As(n,r,e)}))})),s=a+1,i=l)})),r})),n}function Ns(t,e){let n={};function r(e,r,i,s,o){let h;Ms.range(r,i).forEach((r=>{h=e[r],t.node(h).dummy&&t.predecessors(h).forEach((e=>{let r=t.node(e);r.dummy&&(r.order<s||r.order>o)&&As(n,e,h)}))}))}return e.length&&e.reduce((function(e,n){let i,s=-1,o=0;return n.forEach(((h,a)=>{if("border"===t.node(h).dummy){let e=t.predecessors(h);e.length&&(i=t.node(e[0]).order,r(n,o,a,s,i),o=a,s=i)}r(n,o,n.length,i,e.length)})),n})),n}function As(t,e,n){if(e>n){let t=e;e=n,n=t}let r=t[e];r||(t[e]=r={}),r[n]=!0}function Ts(t,e,n){if(e>n){let t=e;e=n,n=t}return!!t[e]&&Object.hasOwn(t[e],n)}function js(t,e,n,r){let i={},s={},o={};return e.forEach((t=>{t.forEach(((t,e)=>{i[t]=t,s[t]=t,o[t]=e}))})),e.forEach((t=>{let e=-1;t.forEach((t=>{let h=r(t);if(h.length){h=h.sort(((t,e)=>o[t]-o[e]));let r=(h.length-1)/2;for(let a=Math.floor(r),u=Math.ceil(r);a<=u;++a){let r=h[a];s[t]===t&&e<o[r]&&!Ts(n,t,r)&&(s[r]=t,s[t]=i[t]=i[r],e=o[r])}}}))})),{root:i,align:s}}function Is(t,e,n,r,i){let s={},o=function(t,e,n,r){let i=new Os,s=t.graph(),o=function(t,e,n){return(r,i,s)=>{let o,h=r.node(i),a=r.node(s),u=0;if(u+=h.width/2,Object.hasOwn(h,"labelpos"))switch(h.labelpos.toLowerCase()){case"l":o=-h.width/2;break;case"r":o=h.width/2}if(o&&(u+=n?o:-o),o=0,u+=(h.dummy?e:t)/2,u+=(a.dummy?e:t)/2,u+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":o=a.width/2;break;case"r":o=-a.width/2}return o&&(u+=n?o:-o),o=0,u}}(s.nodesep,s.edgesep,r);return e.forEach((e=>{let r;e.forEach((e=>{let s=n[e];if(i.setNode(s),r){var h=n[r],a=i.edge(h,s);i.setEdge(h,s,Math.max(o(t,e,r),a||0))}r=e}))})),i}(t,e,n,i),h=i?"borderLeft":"borderRight";function a(t,e){let n=o.nodes(),r=n.pop(),i={};for(;r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return a((function(t){s[t]=o.inEdges(t).reduce(((t,e)=>Math.max(t,s[e.v]+o.edge(e))),0)}),o.predecessors.bind(o)),a((function(e){let n=o.outEdges(e).reduce(((t,e)=>Math.min(t,s[e.w]-o.edge(e))),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==h&&(s[e]=Math.max(s[e],n))}),o.successors.bind(o)),Object.keys(r).forEach((t=>s[t]=s[n[t]])),s}function Ls(t,e){return Object.values(e).reduce(((e,n)=>{let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(n).forEach((([e,n])=>{let s=function(t,e){return t.node(e).width}(t,e)/2;r=Math.max(n+s,r),i=Math.min(n-s,i)}));const s=r-i;return s<e[0]&&(e=[s,n]),e}),[Number.POSITIVE_INFINITY,null])[1]}function Rs(t,e){let n=Object.values(e),r=Ms.applyWithChunking(Math.min,n),i=Ms.applyWithChunking(Math.max,n);["u","d"].forEach((n=>{["l","r"].forEach((s=>{let o=n+s,h=t[o];if(h===e)return;let a=Object.values(h),u=r-Ms.applyWithChunking(Math.min,a);"l"!==s&&(u=i-Ms.applyWithChunking(Math.max,a)),u&&(t[o]=Ms.mapValues(h,(t=>t+u)))}))}))}function Ps(t,e){return Ms.mapValues(t.ul,((n,r)=>{if(e)return t[e.toLowerCase()][r];{let e=Object.values(t).map((t=>t[r])).sort(((t,e)=>t-e));return(e[1]+e[2])/2}}))}let Ds=ii,zs=ks;let Fs=mi,$s=yi,Ys=Bi,Xs=ii.normalizeRanks,Gs=function(t){let e=function(t){let e={},n=0;function r(i){let s=n;t.children(i).forEach(r),e[i]={low:s,lim:n++}}return t.children().forEach(r),e}(t);t.graph().dummyChains.forEach((n=>{let r=t.node(n),i=r.edgeObj,s=function(t,e,n,r){let i,s,o=[],h=[],a=Math.min(e[n].low,e[r].low),u=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),o.push(i)}while(i&&(e[i].low>a||u>e[i].lim));s=i,i=r;for(;(i=t.parent(i))!==s;)h.push(i);return{path:o.concat(h.reverse()),lca:s}}(t,e,i.v,i.w),o=s.path,h=s.lca,a=0,u=o[a],l=!0;for(;n!==i.w;){if(r=t.node(n),l){for(;(u=o[a])!==h&&t.node(u).maxRank<r.rank;)a++;u===h&&(l=!1)}if(!l){for(;a<o.length-1&&t.node(u=o[a+1]).minRank<=r.rank;)a++;u=o[a]}t.setParent(n,u),n=t.successors(n)[0]}}))},qs=ii.removeEmptyRanks,Bs={run:function(t){let e=Hi.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,i){var s=t.children(r);s&&s.length&&s.forEach((t=>n(t,i+1))),e[r]=i}return t.children().forEach((t=>n(t,1))),e}(t),r=Object.values(n),i=Hi.applyWithChunking(Math.max,r)-1,s=2*i+1;t.graph().nestingRoot=e,t.edges().forEach((e=>t.edge(e).minlen*=s));let o=function(t){return t.edges().reduce(((e,n)=>e+t.edge(n).weight),0)}(t)+1;t.children().forEach((r=>Zi(t,e,s,o,i,n,r))),t.graph().nodeRankFactor=s},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((e=>{t.edge(e).nestingEdge&&t.removeEdge(e)}))}},Vs=function(t){t.children().forEach((function e(n){let r=t.children(n),i=t.node(n);if(r.length&&r.forEach(e),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let e=i.minRank,r=i.maxRank+1;e<r;++e)Qi(t,"borderLeft","_bl",n,i,e),Qi(t,"borderRight","_br",n,i,e)}}))},Ws={adjust:function(t){let e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||Ki(t)},undo:function(t){let e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){t.nodes().forEach((e=>ts(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);n.points.forEach(ts),Object.hasOwn(n,"y")&&ts(n)}))}(t);"lr"!==e&&"rl"!==e||(!function(t){t.nodes().forEach((e=>es(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);n.points.forEach(es),Object.hasOwn(n,"x")&&es(n)}))}(t),Ki(t))}},Hs=vs,Zs=function(t){(function(t){let e=Ds.buildLayerMatrix(t),n=t.graph().ranksep,r=0;e.forEach((e=>{const i=e.reduce(((e,n)=>{const r=t.node(n).height;return e>r?e:r}),0);e.forEach((e=>t.node(e).y=r+i/2)),r+=i+n}))})(t=Ds.asNonCompoundGraph(t)),Object.entries(zs(t)).forEach((([e,n])=>t.node(e).x=n))},Us=ii,Qs=Hr.Graph;var Ks=function(t,e){let n=e&&e.debugTiming?Us.time:Us.notime;n("layout",(()=>{let r=n(" buildLayoutGraph",(()=>function(t){let e=new Qs({multigraph:!0,compound:!0}),n=ao(t.graph());return e.setGraph(Object.assign({},to,ho(n,Js),Us.pick(n,eo))),t.nodes().forEach((n=>{const r=ho(ao(t.node(n)),no);Object.keys(ro).forEach((t=>{void 0===r[t]&&(r[t]=ro[t])})),e.setNode(n,r),e.setParent(n,t.parent(n))})),t.edges().forEach((n=>{let r=ao(t.edge(n));e.setEdge(n,Object.assign({},so,ho(r,io),Us.pick(r,oo)))})),e}(t)));n(" runLayout",(()=>function(t,e,n){e(" makeSpaceForEdgeLabels",(()=>function(t){let e=t.graph();e.ranksep/=2,t.edges().forEach((n=>{let r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t))),e(" removeSelfEdges",(()=>function(t){t.edges().forEach((e=>{if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t))),e(" acyclic",(()=>Fs.run(t))),e(" nestingGraph.run",(()=>Bs.run(t))),e(" rank",(()=>Ys(Us.asNonCompoundGraph(t)))),e(" injectEdgeLabelProxies",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);if(n.width&&n.height){let n=t.node(e.v),r={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};Us.addDummyNode(t,"edge-proxy",r,"_ep")}}))}(t))),e(" removeEmptyRanks",(()=>qs(t))),e(" nestingGraph.cleanup",(()=>Bs.cleanup(t))),e(" normalizeRanks",(()=>Xs(t))),e(" assignRankMinMax",(()=>function(t){let e=0;t.nodes().forEach((n=>{let r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank))})),t.graph().maxRank=e}(t))),e(" removeEdgeLabelProxies",(()=>function(t){t.nodes().forEach((e=>{let n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t))),e(" normalize.run",(()=>$s.run(t))),e(" parentDummyChains",(()=>Gs(t))),e(" addBorderSegments",(()=>Vs(t))),e(" order",(()=>Hs(t,n))),e(" insertSelfEdges",(()=>function(t){var e=Us.buildLayerMatrix(t);e.forEach((e=>{var n=0;e.forEach(((e,r)=>{var i=t.node(e);i.order=r+n,(i.selfEdges||[]).forEach((e=>{Us.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))}(t))),e(" adjustCoordinateSystem",(()=>Ws.adjust(t))),e(" position",(()=>Zs(t))),e(" positionSelfEdges",(()=>function(t){t.nodes().forEach((e=>{var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,s=r.y,o=n.x-i,h=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*o/3,y:s-h},{x:i+5*o/6,y:s-h},{x:i+o,y:s},{x:i+5*o/6,y:s+h},{x:i+2*o/3,y:s+h}],n.label.x=n.x,n.label.y=n.y}}))}(t))),e(" removeBorderNodes",(()=>function(t){t.nodes().forEach((e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),s=t.node(n.borderLeft[n.borderLeft.length-1]),o=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-s.x),n.height=Math.abs(i.y-r.y),n.x=s.x+n.width/2,n.y=r.y+n.height/2}})),t.nodes().forEach((e=>{"border"===t.node(e).dummy&&t.removeNode(e)}))}(t))),e(" normalize.undo",(()=>$s.undo(t))),e(" fixupEdgeLabelCoords",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t))),e(" undoCoordinateSystem",(()=>Ws.undo(t))),e(" translateGraph",(()=>function(t){let e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,s=t.graph(),o=s.marginx||0,h=s.marginy||0;function a(t){let s=t.x,o=t.y,h=t.width,a=t.height;e=Math.min(e,s-h/2),n=Math.max(n,s+h/2),r=Math.min(r,o-a/2),i=Math.max(i,o+a/2)}t.nodes().forEach((e=>a(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);Object.hasOwn(n,"x")&&a(n)})),e-=o,r-=h,t.nodes().forEach((n=>{let i=t.node(n);i.x-=e,i.y-=r})),t.edges().forEach((n=>{let i=t.edge(n);i.points.forEach((t=>{t.x-=e,t.y-=r})),Object.hasOwn(i,"x")&&(i.x-=e),Object.hasOwn(i,"y")&&(i.y-=r)})),s.width=n-e+o,s.height=i-r+h}(t))),e(" assignNodeIntersects",(()=>function(t){t.edges().forEach((e=>{let n,r,i=t.edge(e),s=t.node(e.v),o=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=o,r=s),i.points.unshift(Us.intersectRect(s,n)),i.points.push(Us.intersectRect(o,r))}))}(t))),e(" reversePoints",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);n.reversed&&n.points.reverse()}))}(t))),e(" acyclic.undo",(()=>Fs.undo(t)))}(r,n,e))),n(" updateInputGraph",(()=>function(t,e){t.nodes().forEach((n=>{let r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,r.rank=i.rank,e.children(n).length&&(r.width=i.width,r.height=i.height))})),t.edges().forEach((n=>{let r=t.edge(n),i=e.edge(n);r.points=i.points,Object.hasOwn(i,"x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,r)))}))};let Js=["nodesep","edgesep","ranksep","marginx","marginy"],to={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},eo=["acyclicer","ranker","rankdir","align"],no=["width","height"],ro={width:0,height:0},io=["minlen","weight","width","height","labeloffset"],so={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},oo=["labelpos"];function ho(t,e){return Us.mapValues(Us.pick(t,e),Number)}function ao(t){var e={};return t&&Object.entries(t).forEach((([t,n])=>{"string"==typeof t&&(t=t.toLowerCase()),e[t]=n})),e}let uo=ii,lo=Hr.Graph;var co={graphlib:Hr,layout:Ks,debug:{debugOrdering:function(t){let e=uo.buildLayerMatrix(t),n=new lo({compound:!0,multigraph:!0}).setGraph({});return t.nodes().forEach((e=>{n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),t.edges().forEach((t=>n.setEdge(t.v,t.w,{},t.name))),e.forEach(((t,e)=>{let r="layer"+e;n.setNode(r,{rank:"same"}),t.reduce(((t,e)=>(n.setEdge(t,e,{style:"invis"}),e)))})),n}},util:{time:ii.time,notime:ii.notime},version:"1.1.4"};const fo=(t,e,n)=>{const{x:r,y:i}=t,s=e.x,o=e.y,h=(null==n?void 0:n.x)??r,a=(null==n?void 0:n.y)??i,u=s-r<0?-1:1,l=o-i<0?-1:1;let c=Math.abs(s-r)/2<35?Math.abs(s-r)/2:35;c=Math.abs(o-i)/2<c?Math.abs(o-i)/2:c;const d=Math.abs(s-r)/2-c;return[`M ${h} ${a}`,`L ${h} ${i}`,`L ${r} ${i}`,`L ${r+d*u} ${i}`,`C ${r+d*u+c*u} ${i} ${r+d*u+c*u} ${i} ${r+d*u+c*u} ${i+c*l}`,`L ${r+d*u+c*u} ${o-c*l}`,`C ${r+d*u+c*u} ${o} ${r+d*u+c*u} ${o} ${s-d*u} ${o}`,`L ${s} ${o}`].join(" ")},po=(t,e,n,r={sy:0})=>{const{x:i}=t;let{y:s}=t;const o=e.x,h=e.y,a=(null==n?void 0:n.x)??i,u=(null==n?void 0:n.y)??s,l=o-i<0?-1:1,c=h-s<0?-1:1;s+=r.sy;let d=Math.abs(o-i)/2<35?Math.abs(o-i)/2:35;d=Math.abs(h-s)/2<d?Math.abs(h-s)/2:d;const f=Math.abs(h-s)/2-d;return[`M ${a} ${u}`,`L ${i} ${u}`,`L ${i} ${s}`,`L ${i} ${s+f*c}`,`C ${i} ${s+f*c+d*c} ${i} ${s+f*c+d*c} ${i+d*l} ${s+f*c+d*c}`,`L ${i+(Math.abs(o-i)-2*d)*l+d*l} ${s+f*c+d*c}`,`C ${o} ${s+f*c+d*c} ${o} ${s+f*c+d*c} ${o} ${h-f*c}`,`L ${o} ${h}`].join(" ")},mo={bottom:{calculateEdge:po,edgeMidX:({node:t})=>t.x,edgeMidY:({node:t})=>t.y+t.height/2,edgeParentX:({parent:t})=>t.x,edgeParentY:({parent:t})=>t.y-t.height/2,edgeX:({node:t})=>t.x,edgeY:({node:t})=>t.y+t.height/2,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y,leafHeight:({childLength:t,childrenSpacing:e,nodeHeight:n})=>(n+e)*t,leafWidth:({nodeWidth:t})=>t,leafX:()=>0,leafY:({childrenSpacing:t,index:e,nodeHeight:n})=>(n+t)*-e},left:{calculateEdge:fo,edgeMidX:({node:t})=>t.x-t.width/2,edgeMidY:({node:t})=>t.y,edgeParentX:({parent:t})=>t.x+t.width/2,edgeParentY:({parent:t})=>t.y,edgeX:({node:t})=>t.x-t.width/2,edgeY:({node:t})=>t.y,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({nodeHeight:t})=>t,leafWidth:({childLength:t,nodeWidth:e})=>e*t,leafX:({childrenSpacing:t,index:e,nodeWidth:n})=>(n+t)*e,leafY:()=>0},right:{calculateEdge:fo,edgeMidX:({node:t})=>t.x+t.width/2,edgeMidY:({node:t})=>t.y,edgeParentX:({parent:t})=>t.x-t.width/2,edgeParentY:({parent:t})=>t.y,edgeX:({node:t})=>t.x+t.width/2,edgeY:({node:t})=>t.y,leafGroupX:({node:t})=>t.x,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({nodeHeight:t})=>t,leafWidth:({childLength:t,nodeWidth:e})=>e*t,leafX:({childrenSpacing:t,index:e,nodeWidth:n})=>(n+t)*-e,leafY:()=>0},top:{calculateEdge:po,edgeMidX:({node:t})=>t.x,edgeMidY:({node:t})=>t.y-t.height/2,edgeParentX:({parent:t})=>t.x,edgeParentY:({parent:t})=>t.y+t.height/2,edgeX:({node:t})=>t.x,edgeY:({node:t})=>t.y-t.height/2,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({childLength:t,childrenSpacing:e,nodeHeight:n})=>(n+e)*t,leafWidth:({nodeWidth:t})=>t,leafX:()=>0,leafY:({childrenSpacing:t,index:e,nodeHeight:n})=>(n+t)*e}},go={bottom:"BT",left:"LR",right:"RL",top:"TB"},yo={borderColor:"#BCBCBC",borderColorHover:"#5C6BC0",borderRadius:"5px",borderStyle:"solid",borderWidth:1,canvasStyle:"",childrenSpacing:50,containerClassName:"root",contentKey:"name",direction:"top",edgeColor:"#BCBCBC",edgeColorHover:"#5C6BC0",edgeWidth:1,enableExpandCollapse:!1,enableToolbar:!1,enableTooltip:!1,expandCollapseButtonBGColor:"#FFFFFF",expandCollapseButtonBorderColor:"#BCBCBC",fontColor:"#000000",fontFamily:"",fontSize:"14px",fontWeight:"400",groupLeafNodes:!1,groupLeafNodesSpacing:10,height:"auto",highlightOnHover:!0,nodeBGColor:"#FFFFFF",nodeBGColorHover:"#FFFFFF",nodeClassName:"apextree-node",nodeHeight:30,nodeStyle:"",nodeTemplate:t=>`<div style='display: flex;justify-content: center;align-items: center; text-align: center; height: 100%;'>${t}</div>`,nodeWidth:50,onNodeClick:void 0,siblingSpacing:50,tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#BCBCBC",tooltipFontColor:"#000000",tooltipFontSize:"12px",tooltipId:"apextree-tooltip-container",tooltipMaxWidth:void 0,tooltipMinWidth:100,tooltipPadding:8,tooltipOffset:10,viewPortHeight:600,viewPortWidth:800,width:"100%"},wo=(t,e={})=>{for(const n in e)null==t||t.setAttribute(n,e[n])},bo=(t,e,n,r,i,s)=>{const o=null==t?void 0:t.options,h=(null==o?void 0:o.borderWidth)||r.borderWidth;let a=(null==o?void 0:o.borderColor)||r.borderColor,u=(null==o?void 0:o.nodeBGColor)||r.nodeBGColor;n&&(a=(null==o?void 0:o.borderColorHover)||r.borderColorHover,u=(null==o?void 0:o.nodeBGColorHover)||r.nodeBGColorHover);const l=i.querySelector(`#${s} [data-self='${t.id}'] foreignObject div`);if(l&&!t.id.endsWith("_leafs")&&(l.style.borderWidth=`${h}px`,l.style.borderColor=a,l.style.backgroundColor=u),t.parent){const o=i.querySelector(`#${s} #${t.parent}-${t.id}`);wo(o,n?{stroke:r.edgeColorHover,"stroke-width":r.edgeWidth+1}:{stroke:r.edgeColor,"stroke-width":r.edgeWidth}),t.parent&&bo(e[t.parent],e,n,r,i,s)}};function xo(t,e,n){const{children:r,...i}=t,s={...i,children:r?r.map((t=>t.id)):[],parent:e?e.id:void 0};if(n[s.id]=s,null==r?void 0:r.length)for(const o of r)xo(o,s,n)}function vo(t){const e={};return xo(t,void 0,e),e}function _o(t,e,n,r,i,s){const{bgColor:o,borderColor:h,fontColor:a,fontSize:u,fontFamily:l,maxWidth:c,minWidth:d,offset:f,padding:p,tooltipId:m}=e,g=document.createElement("div");g.style.position="absolute",g.style.visibility="hidden",g.style.width=`${c}px`,g.style.minWidth=`${d}px`,g.style.padding=`${p}px`,g.style.fontSize=u,g.style.fontFamily=l,g.style.wordWrap="break-word",g.style.whiteSpace="normal",g.innerHTML=n,document.body.appendChild(g);const y=g.offsetHeight,w=g.offsetWidth;document.body.removeChild(g);const b=function(t,e,n,r,i){const s=window.innerWidth,o=window.innerHeight,h=window.scrollX||document.documentElement.scrollLeft,a=window.scrollY||document.documentElement.scrollTop,u=10;let l="top",c=t,d=e-r-i;const f=e-a;f-r-i<u&&(l="bottom",d=e+i,f+i+r>o-u&&(l="top",d=a+u));const p=t-h;if(p+n>s-u&&(c=h+s-n-u),p<u&&(c=h+u),"top"===l||"bottom"===l){const e=t-n/2,r=e-h;r>=u&&r+n<=s-u&&(c=e)}return{placement:l,x:c,y:d}}(r,i,w,y,f),x=(({bgColor:t,borderColor:e,fontColor:n,fontFamily:r,fontSize:i,fontWeight:s,maxWidth:o,padding:h,placement:a="top",x:u,y:l})=>{const c=["position: absolute;","z-index: 1000;","pointer-events: none;"];return c.push("box-sizing: border-box;"),c.push("word-wrap: break-word;"),c.push("overflow-wrap: break-word;"),c.push(`left: ${u}px;`),c.push(`top: ${l}px;`),c.push(`data-placement: ${a};`),o&&(c.push(`width: ${o}px;`),c.push(`max-width: ${o}px;`)),e&&c.push(`border: 1px solid ${e};`),c.push("border-radius: 5px;"),n&&c.push(`color: ${n};`),r&&c.push(`font-family: ${r};`),s&&c.push(`font-weight: ${s};`),i&&c.push(`font-size: ${i};`),t&&c.push(`background-color: ${t};`),void 0!==h&&c.push(`padding: ${h}px;`),c.join(" ")})({bgColor:o,borderColor:h,fontColor:a,fontFamily:l,fontSize:u,fontWeight:"400",maxWidth:c,padding:p,placement:b.placement,x:b.x,y:b.y});ur(t,m,`${x} min-width: ${d}px; word-wrap: break-word; white-space: normal; overflow-wrap: break-word; line-height: 1.4;`,n)}function Eo(t,e){ur(t,e)}const Co={},Oo=[];function Mo(t,e){if(Array.isArray(t))for(const n of t)Mo(n,e);else if("object"!=typeof t)So(Object.getOwnPropertyNames(e)),Co[t]=Object.assign(Co[t]||{},e);else for(const n in t)Mo(n,t[n])}function ko(t){return Co[t]||{}}function So(t){Oo.push(...t)}function No(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function Ao(t){return t%360*Math.PI/180}function To(t){return t.charAt(0).toUpperCase()+t.slice(1)}function jo(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function Io(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:h,y:a}=e.bbox();s&&(r=r.includes("left")?h:r.includes("right")?h+n:h+n/2),o&&(i=i.includes("top")?a:i.includes("bottom")?a+t:a+t/2)}return[r,i]}const Lo=new Set(["desc","metadata","title"]),Ro=t=>Lo.has(t.nodeName),Po=(t,e,n={})=>{const r={...e};for(const i in r)r[i].valueOf()===n[i]&&delete r[i];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},Do="http://www.w3.org/2000/svg",zo="http://www.w3.org/2000/xmlns/",Fo="http://www.w3.org/1999/xlink",$o={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class Yo{}const Xo={},Go="___SYMBOL___ROOT___";function qo(t,e=Do){return $o.document.createElementNS(e,t)}function Bo(t,e=!1){if(t instanceof Yo)return t;if("object"==typeof t)return Ho(t);if(null==t)return new Xo[Go];if("string"==typeof t&&"<"!==t.charAt(0))return Ho($o.document.querySelector(t));const n=e?$o.document.createElement("div"):qo("svg");return n.innerHTML=t,t=Ho(n.firstChild),n.removeChild(n.firstChild),t}function Vo(t,e){return e&&(e instanceof $o.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:qo(t)}function Wo(t){if(!t)return null;if(t.instance instanceof Yo)return t.instance;if("#document-fragment"===t.nodeName)return new Xo.Fragment(t);let e=To(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":Xo[e]||(e="Dom"),new Xo[e](t)}let Ho=Wo;function Zo(t,e=t.name,n=!1){return Xo[e]=t,n&&(Xo[Go]=t),So(Object.getOwnPropertyNames(t.prototype)),t}let Uo=1e3;function Qo(t){return"Svgjs"+To(t)+Uo++}function Ko(t){for(let e=t.children.length-1;e>=0;e--)Ko(t.children[e]);return t.id?(t.id=Qo(t.nodeName),t):t}function Jo(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function th(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)}}Mo("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=Bo(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=Bo(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=Bo(t)).before(this),this},insertAfter:function(t){return(t=Bo(t)).after(this),this}});const eh=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,nh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rh=/rgb\((\d+),(\d+),(\d+)\)/,ih=/(#[a-z_][a-z0-9\-_]*)/i,sh=/\)\s*,?\s*/,oh=/\s/g,hh=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,ah=/^rgb\(/,uh=/^(\s+)?$/,lh=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ch=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,dh=/[\s,]+/,fh=/[MLHVCSQTAZ]/i;function ph(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function mh(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function gh(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}Mo("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(dh)},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)}}),Mo("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=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||uh.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||uh.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),Mo("Dom",{data:function(t,e,n){if(null==t)return this.data(No(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(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(r){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}}),Mo("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);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 yh{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof yh||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){const{random:n,round:r,sin:i,PI:s}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new yh(t,e,r,"lch")}if("sine"===t){const t=r(80*i(2*s*(e=null==e?n():e)/.5+.01)+150),o=r(50*i(2*s*e/.5+4.6)+200),h=r(100*i(2*s*e/.5+2.3)+150);return new yh(t,o,h)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new yh(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new yh(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new yh(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new yh(t,e,r,"lab")}if("grey"===t){const t=255*n();return new yh(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(hh.test(t)||ah.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);if(1===o)return new yh(0,0,0,1,"cmyk");return new yh((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),h=Math.min(r,i,s),a=(o+h)/2,u=o===h,l=o-h;return new yh(360*(u?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(u?0:a>.5?l/(2-o-h):l/(o+h)),100*a,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const c in this.space)delete this[this.space[c]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});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=mh(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:mh(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:mh(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:mh(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:mh(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:mh(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(ah.test(t)){const e=t.replace(oh,""),[n,r,i]=rh.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!hh.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=nh.exec((s=t,4===s.length?["#",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(""):s)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var s;const{_a:o,_b:h,_c:a,_d:u}=this,l="rgb"===this.space?{r:o,g:h,b:a}:"xyz"===this.space?{x:o,y:h,z:a}:"hsl"===this.space?{h:o,s:h,l:a}:"lab"===this.space?{l:o,a:h,b:a}:"lch"===this.space?{l:o,c:h,h:a}:"cmyk"===this.space?{c:o,m:h,y:a,k:u}:{};Object.assign(this,l)}lab(){const{x:t,y:e,z:n}=this.xyz();return new yh(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;i<0&&(i*=-1,i=360-i);return new yh(t,r,i,"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:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,h=i/500+o,a=o-s/200,u=16/116,l=.008856,c=7.787;t=.95047*(h**3>l?h**3:(h-u)/c),e=1*(o**3>l?o**3:(o-u)/c),n=1.08883*(a**3>l?a**3:(a-u)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,h=.0031308,a=r>h?1.055*o(r,1/2.4)-.055:12.92*r,u=i>h?1.055*o(i,1/2.4)-.055:12.92*i,l=s>h?1.055*o(s,1/2.4)-.055:12.92*s;return new yh(255*a,255*u,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e){n*=255;return new yh(n,n,n)}const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*gh(i,r,t+1/3),o=255*gh(i,r,t),h=255*gh(i,r,t-1/3);return new yh(s,o,h)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new yh(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(ph);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(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,h=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*h+.1805*a)/.95047,l=(.2126*o+.7152*h+.0722*a)/1,c=(.0193*o+.1192*h+.9505*a)/1.08883,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=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 yh(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class wh{constructor(...t){this.init(...t)}clone(){return new wh(this)}init(t,e){const n=0,r=0,i=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==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){xh.isMatrixLike(t)||(t=new xh(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 bh(t,e,n){return Math.abs(e-t)<1e-6}class xh{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,r=t.flip&&(e||"y"===t.flip)?-1:1,i=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]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,a=t.shear||0,u=t.rotate||t.theta||0,l=new wh(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,d=l.y,f=new wh(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new wh(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,w=g.y,b=new wh(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:h,skewX:i,skewY:s,shear:a,theta:u,rx:b.x,ry:b.y,tx:y,ty:w,ox:c,oy:d,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 r=t.a*e.a+t.c*e.b,i=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,a=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=h,n.f=a,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new xh(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,h=this.f,a=n*s-r*i,u=a>0?1:-1,l=u*Math.sqrt(n*n+r*r),c=Math.atan2(u*r,u*n),d=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/a,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*l+e*(m*f*l-p*g),translateY:h-e+t*p*l+e*(m*p*l+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new xh(t);return bh(this.a,e.a)&&bh(this.b,e.b)&&bh(this.c,e.c)&&bh(this.d,e.d)&&bh(this.e,e.e)&&bh(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=xh.fromArray([1,0,0,1,0,0]);return t=t instanceof Bh?t.matrixify():"string"==typeof t?xh.fromArray(t.split(dh).map(parseFloat)):Array.isArray(t)?xh.fromArray(t):"object"==typeof t&&xh.isMatrixLike(t)?t:"object"==typeof t?(new xh).transform(t):6===arguments.length?xh.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,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const h=r/o,a=-e/o,u=-n/o,l=t/o,c=-(h*i+u*s),d=-(a*i+l*s);return this.a=h,this.b=a,this.c=u,this.d=l,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof xh?t:new xh(t);return xh.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof xh?t:new xh(t);return xh.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=Ao(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:h,d:a,e:u,f:l}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=h*r-a*i,this.d=a*r+h*i,this.e=u*r-l*i+n*i-e*r+e,this.f=l*r+u*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:h,e:a,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=h*e,this.e=a*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:h,f:a}=this;return this.a=r+i*t,this.c=s+o*t,this.e=h+a*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=Ao(t),e=Ao(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:h,c:a,d:u,e:l,f:c}=this;return this.a=o+h*i,this.b=h+o*s,this.c=a+u*i,this.d=u+a*s,this.e=l+c*i-r*i,this.f=c+l*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(xh.isMatrixLike(t)){return new xh(t).multiplyO(this)}const e=xh.formatTransforms(t),{x:n,y:r}=new wh(e.ox,e.oy).transform(this),i=(new xh).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new wh(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}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 vh(){if(!vh.nodes){const t=Bo().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;vh.nodes={svg:t,path:e}}if(!vh.nodes.svg.node.parentNode){const t=$o.document.body||$o.document.documentElement;vh.nodes.svg.addTo(t)}return vh.nodes}function _h(t){return!(t.width||t.height||t.x||t.y)}Zo(xh,"Matrix");class Eh{constructor(...t){this.init(...t)}addOffset(){return this.x+=$o.window.pageXOffset,this.y+=$o.window.pageYOffset,new Eh(this)}init(t){return t="string"==typeof t?t.split(dh).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 _h(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new Eh(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof xh||(t=new xh(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new wh(this.x,this.y),new wh(this.x2,this.y),new wh(this.x,this.y2),new wh(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new Eh(e,r,n-e,i-r)}}function Ch(t,e,n){let r;try{if(r=e(t.node),_h(r)&&((i=t.node)!==$o.document&&!($o.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===$o.document}).call($o.document.documentElement,i)))throw new Error("Element not in the dom")}catch(s){r=n(t)}var i;return r}Mo({viewbox:{viewbox(t,e,n,r){return null==t?new Eh(this.attr("viewBox")):this.attr("viewBox",new Eh(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,h=Math.min(s,o);if(null==t)return h;let a=h/t;a===1/0&&(a=Number.MAX_SAFE_INTEGER/100),e=e||new wh(n/2/s+i.x,r/2/o+i.y);const u=new Eh(i).transform(new xh({scale:a,origin:e}));return this.viewbox(u)}}}),Zo(Eh,"Box");class Oh extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}Jo([Oh],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const Mh=["toArray","constructor","each"];function kh(t,e){return new Oh(No((e||$o.document).querySelectorAll(t),(function(t){return Wo(t)})))}Oh.extend=function(t){t=t.reduce(((t,e)=>(Mh.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),Jo([Oh],t)};let Sh=0;const Nh={};function Ah(t){let e=t.getEventHolder();return e===$o.window&&(e=Nh),e.events||(e.events={}),e.events}function Th(t){return t.getEventTarget()}function jh(t,e,n,r,i){const s=n.bind(r||t),o=Bo(t),h=Ah(o),a=Th(o);e=Array.isArray(e)?e:e.split(dh),n._svgjsListenerId||(n._svgjsListenerId=++Sh),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";h[e]=h[e]||{},h[e][r]=h[e][r]||{},h[e][r][n._svgjsListenerId]=s,a.addEventListener(e,s,i||!1)}))}function Ih(t,e,n,r){const i=Bo(t),s=Ah(i),o=Th(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(dh)).forEach((function(t){const e=t&&t.split(".")[0],h=t&&t.split(".")[1];let a,u;if(n)s[e]&&s[e][h||"*"]&&(o.removeEventListener(e,s[e][h||"*"][n],r||!1),delete s[e][h||"*"][n]);else if(e&&h){if(s[e]&&s[e][h]){for(u in s[e][h])Ih(o,[e,h].join("."),u);delete s[e][h]}}else if(h)for(t in s)for(a in s[t])h===a&&Ih(o,[t,h].join("."));else if(e){if(s[e]){for(a in s[e])Ih(o,[e,a].join("."));delete s[e]}}else{for(t in s)Ih(o,t);!function(t){let e=t.getEventHolder();e===$o.window&&(e=Nh),e.events&&(e.events={})}(i)}}))}class Lh extends Yo{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=Th(t);return e instanceof $o.window.Event||(e=new $o.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.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 r in n)for(const e in n[r])n[r][e](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 Ih(this,t,e,n),this}on(t,e,n,r){return jh(this,t,e,n,r),this}removeEventListener(){}}function Rh(){}Zo(Lh,"EventTarget");const Ph=400,Dh=">",zh=0,Fh={"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 $h 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(dh).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 Yh{constructor(...t){this.init(...t)}convert(t){return new Yh(this.value,t)}divide(t){return t=new Yh(t),new Yh(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(eh))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof Yh&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new Yh(t),new Yh(this-t,this.unit||t.unit)}plus(t){return t=new Yh(t),new Yh(this+t,this.unit||t.unit)}times(t){return t=new Yh(t),new Yh(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 Xh=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Gh=[];class qh extends Lh{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=Bo(t)).removeNamespace&&this.node instanceof $o.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 Bo(t).put(this,e)}children(){return new Oh(No(this.node.children,(function(t){return Wo(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=Ko(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new qh(qo(t),e))}first(){return Wo(this.node.firstChild)}get(t){return Wo(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=Qo(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return Wo(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=Wo(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=Wo(e.node.parentNode));return e}put(t,e){return t=Bo(t),this.add(t,e),t}putIn(t,e){return Bo(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=Bo(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const i in r)"number"==typeof r[i]&&(r[i]=Math.round(r[i]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,Do)}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=Wo(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 r=qo("wrapper",n),i=$o.document.createDocumentFragment();r.innerHTML=t;for(let o=r.children.length;o--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}Jo(qh,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=lh.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))?Fh[t]:lh.test(e)?parseFloat(e):e;"number"==typeof(e=Gh.reduce(((e,n)=>n(t,e,this)),e))?e=new Yh(e):Xh.has(t)&&yh.isColor(e)?e=new yh(e):e.constructor===Array&&(e=new $h(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 kh(t,this.node)},findOne:function(t){return Wo(this.node.querySelector(t))}}),Zo(qh,"Dom");class Bh extends qh{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??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 Yh(t).plus(this.x()))}dy(t=0){return this.y(new Yh(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=Bo(t));const n=new Oh;let r=this;for(;(r=r.parent())&&r.node!==$o.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(ih);return e?Bo(e[1]):null}root(){const t=this.parent(Xo[Go]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=jo(this,t,e);return this.width(new Yh(n.width)).height(new Yh(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return Po(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}Jo(Bh,{bbox:function(){const t=Ch(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(vh().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 Eh(t)},rbox:function(t){const e=Ch(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new Eh(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 wh(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new xh(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new xh(e)}return new xh(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new xh}}}),Zo(Bh,"Element");const Vh={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 yh||yh.isRgb(e)||e instanceof Bh)this.attr(t,e);else for(n=Vh[t].length-1;n>=0;n--)null!=e[Vh[t][n]]&&this.attr(Vh.prefix(t,Vh[t][n]),e[Vh[t][n]]);return this},Mo(["Element","Runner"],e)})),Mo(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new xh(this):this.attr("transform",new xh(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!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)}}),Mo("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Yh(t)):this.rx(t).ry(e)}}),Mo("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new wh(this.node.getPointAtLength(t))}}),Mo(["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)}});Mo("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),Mo("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(sh).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(dh).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(xh.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new xh)},toParent:function(t,e){if(this===t)return this;if(Ro(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.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 xh(this).decompose();return null==t?e:e[t]}xh.isMatrixLike(t)||(t={...t,origin:Io(t,this)});const n=new xh(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class Wh extends Bh{flatten(){return this.each((function(){if(this instanceof Wh)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,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}Zo(Wh,"Container");class Hh extends Wh{constructor(t,e=t){super(Vo("defs",t),e)}flatten(){return this}ungroup(){return this}}Zo(Hh,"Defs");class Zh extends Bh{}function Uh(t){return this.attr("rx",t)}function Qh(t){return this.attr("ry",t)}function Kh(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Jh(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function ta(t){return this.attr("cx",t)}function ea(t){return this.attr("cy",t)}function na(t){return null==t?2*this.rx():this.rx(new Yh(t).divide(2))}function ra(t){return null==t?2*this.ry():this.ry(new Yh(t).divide(2))}Zo(Zh,"Shape");const ia=Object.freeze(Object.defineProperty({__proto__:null,cx:ta,cy:ea,height:ra,rx:Uh,ry:Qh,width:na,x:Kh,y:Jh},Symbol.toStringTag,{value:"Module"}));class sa extends Zh{constructor(t,e=t){super(Vo("ellipse",t),e)}size(t,e){const n=jo(this,t,e);return this.rx(new Yh(n.width).divide(2)).ry(new Yh(n.height).divide(2))}}Jo(sa,ia),Mo("Container",{ellipse:th((function(t=0,e=t){return this.put(new sa).size(t,e).move(0,0)}))}),Zo(sa,"Ellipse");class oa extends qh{constructor(t=$o.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 qh(qo("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function ha(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Yh(t),fy:new Yh(e)}):this.attr({x1:new Yh(t),y1:new Yh(e)})}function aa(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Yh(t),cy:new Yh(e)}):this.attr({x2:new Yh(t),y2:new Yh(e)})}Zo(oa,"Fragment");const ua=Object.freeze(Object.defineProperty({__proto__:null,from:ha,to:aa},Symbol.toStringTag,{value:"Module"}));class la extends Wh{constructor(t,e){super(Vo(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 Eh}targets(){return kh("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()+")"}}Jo(la,ua),Mo({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:th((function(t,e){return this.put(new la(t)).update(e)}))}}),Zo(la,"Gradient");class ca extends Wh{constructor(t,e=t){super(Vo("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new Eh}targets(){return kh("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()+")"}}Mo({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:th((function(t,e,n){return this.put(new ca).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),Zo(ca,"Pattern");let da=class extends Zh{constructor(t,e=t){super(Vo("image",t),e)}load(t,e){if(!t)return this;const n=new $o.window.Image;return jh(n,"load",(function(t){const r=this.parent(ca);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof ca&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),jh(n,"load error",(function(){Ih(n)})),this.attr("href",n.src=t,Fo)}};!function(t){Gh.push(t)}((function(t,e,n){return"fill"!==t&&"stroke"!==t||ch.test(e)&&(e=n.root().defs().image(e)),e instanceof da&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e})),Mo({Container:{image:th((function(t,e){return this.put(new da).size(0,0).load(t,e)}))}}),Zo(da,"Image");class fa extends $h{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new Eh(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(dh).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.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){xh.isMatrixLike(t)||(t=new xh(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}const pa=fa;const ma=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:pa,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},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)}},Symbol.toStringTag,{value:"Module"}));class ga extends Zh{constructor(t,e=t){super(Vo("line",t),e)}array(){return new fa([[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,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new fa(t).toLine(),this.attr(t))}size(t,e){const n=jo(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}Jo(ga,ma),Mo({Container:{line:th((function(...t){return ga.prototype.plot.apply(this.put(new ga),null!=t[0]?t:[0,0,0,0])}))}}),Zo(ga,"Line");class ya extends Wh{constructor(t,e=t){super(Vo("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 wa(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}Mo({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:th((function(t,e,n){return this.put(new ya).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof ya?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),Zo(ya,"Marker");const ba={"-":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,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class xa{done(){return!1}}class va extends xa{constructor(t=Dh){super(),this.ease=ba[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class _a extends xa{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function Ea(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}Jo(class extends _a{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:wa("_duration",Ea),overshoot:wa("_overshoot",Ea)});Jo(class extends _a{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,h=this._windup;return!1!==h&&(s=Math.max(-h,Math.min(s,h))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:wa("_windup"),p:wa("P"),i:wa("I"),d:wa("D")});const Ca={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Oa={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]]}},Ma="mlhvqtcsaz".split("");for(let Mu=0,ku=Ma.length;Mu<ku;++Mu)Oa[Ma[Mu]]=function(t){return function(e,n,r){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 Oa[t](e,n,r)}}(Ma[Mu].toUpperCase());function ka(t){return t.segment.length&&t.segment.length-1===Ca[t.segment[0].toUpperCase()]}function Sa(t,e){t.inNumber&&Na(t,!1);const n=fh.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function Na(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,ka(t)&&Aa(t)}function Aa(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Oa[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function Ta(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 ja(t){return"E"===t.lastToken.toUpperCase()}const Ia=new Set([" ",",","\t","\n","\r","\f"]);class La extends $h{bbox(){return vh().path.setAttribute("d",this.toString()),new Eh(vh.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=t,this[i][2]+=e):"H"===r?this[i][1]+=t:"V"===r?this[i][1]+=e:"C"===r||"S"===r||"Q"===r?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===r&&(this[i][5]+=t,this[i][6]+=e)):"A"===r&&(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,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new wh,p:new wh};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!Sa(i,r))if("."!==r)if(isNaN(parseInt(r)))if(Ia.has(r))i.inNumber&&Na(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(fh.test(r)){if(i.inNumber)Na(i,!1);else{if(!ka(i))throw new Error("parser Error");Aa(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!ja(i)){Na(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||Ta(i)){i.inNumber=!0,i.number=r,Na(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){Na(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&Na(i,!1),i.inSegment&&ka(i)&&Aa(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;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 Ra=t=>{const e=typeof t;return"number"===e?Yh:"string"===e?yh.isColor(t)?yh:dh.test(t)?fh.test(t)?La:$h:eh.test(t)?Yh:Da:Ya.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?$h:"object"===e?$a:Da};class Pa{constructor(t){this._stepper=t||new va("-"),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(Ra(t));let e=new this._type(t);return this._type===yh&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===$a&&(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 Da{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 za{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,za.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}za.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Fa=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class $a{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===yh&&t[n+7]!==e[n+7]){const e=t[n+7],r=new yh(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),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 r=Ra(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(Fa),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(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const Ya=[Da,za,$a];class Xa extends Zh{constructor(t,e=t){super(Vo("path",t),e)}array(){return this._array||(this._array=new La(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 La(t))}size(t,e){const n=jo(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)}}Xa.prototype.MorphArray=La,Mo({Container:{path:th((function(t){return this.put(new Xa).plot(t||new La)}))}}),Zo(Xa,"Path");const Ga=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new fa(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 fa(t))},size:function(t,e){const n=jo(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));class qa extends Zh{constructor(t,e=t){super(Vo("polygon",t),e)}}Mo({Container:{polygon:th((function(t){return this.put(new qa).plot(t||new fa)}))}}),Jo(qa,ma),Jo(qa,Ga),Zo(qa,"Polygon");class Ba extends Zh{constructor(t,e=t){super(Vo("polyline",t),e)}}Mo({Container:{polyline:th((function(t){return this.put(new Ba).plot(t||new fa)}))}}),Jo(Ba,ma),Jo(Ba,Ga),Zo(Ba,"Polyline");class Va extends Zh{constructor(t,e=t){super(Vo("rect",t),e)}}Jo(Va,{rx:Uh,ry:Qh}),Mo({Container:{rect:th((function(t,e){return this.put(new Va).size(t,e)}))}}),Zo(Va,"Rect");class Wa{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 Ha={nextDraw:null,frames:new Wa,timeouts:new Wa,immediates:new Wa,timer:()=>$o.window.performance||$o.window.Date,transforms:[],frame(t){const e=Ha.frames.push({run:t});return null===Ha.nextDraw&&(Ha.nextDraw=$o.window.requestAnimationFrame(Ha._draw)),e},timeout(t,e){e=e||0;const n=Ha.timer().now()+e,r=Ha.timeouts.push({run:t,time:n});return null===Ha.nextDraw&&(Ha.nextDraw=$o.window.requestAnimationFrame(Ha._draw)),r},immediate(t){const e=Ha.immediates.push(t);return null===Ha.nextDraw&&(Ha.nextDraw=$o.window.requestAnimationFrame(Ha._draw)),e},cancelFrame(t){null!=t&&Ha.frames.remove(t)},clearTimeout(t){null!=t&&Ha.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ha.immediates.remove(t)},_draw(t){let e=null;const n=Ha.timeouts.last();for(;(e=Ha.timeouts.shift())&&(t>=e.time?e.run():Ha.timeouts.push(e),e!==n););let r=null;const i=Ha.frames.last();for(;r!==i&&(r=Ha.frames.shift());)r.run(t);let s=null;for(;s=Ha.immediates.shift();)s();Ha.nextDraw=Ha.timeouts.first()||Ha.frames.first()?$o.window.requestAnimationFrame(Ha._draw):null}},Za=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Ua=function(){const t=$o.window;return(t.performance||t.Date).now()};class Qa extends Lh{constructor(t=Ua){super(),this._timeSource=t,this.terminate()}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(Za);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+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 Ha.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ha.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let s=this._runners.length;s--;){const t=this._runners[s],e=t.runner;this._time-t.start<=0&&e.reset()}let i=!1;for(let s=0,o=this._runners.length;s<o;s++){const t=this._runners[s],e=t.runner;let n=r;const h=this._time-t.start;if(h<=0){i=!0;continue}if(h<n&&(n=h),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--s,--o)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){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)}}Mo({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Qa,this._timeline):(this._timeline=t,this)}}});class Ka extends Lh{constructor(t){super(),this.id=Ka.id++,t="function"==typeof(t=null==t?Ph:t)?new _a(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof _a,this._stepper=this._isDeclarative?t:new va,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new xh,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 r=1,i=!1,s=0;return e=e??zh,n=n||"last","object"!=typeof(t=t??Ph)||t instanceof xa||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,s=t.wait??s,t=t.duration??Ph),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Ka.sanitise(t,e,n),i=new Ka(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new xh,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 va(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,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let h;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,h=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(h,1),0)},a=i*(r+n)-r;return h=e<=0?Math.round(t(1e-5)):e<a?t(e):Math.round(t(a-1e-5)),h}const a=Math.floor(this.loops()),u=s&&a%2==0;return h=a+(u&&!o||o&&u?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,r){this._queue.push({initialiser:t||Rh,runner:e||Rh,retarget:n,isTransform:r,initialised:!1,finished:!1});return 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 Qa||(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 r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let h=!1;return(n||o)&&(this._initialise(n),this.transforms=new xh,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],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&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,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.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 r=this.timeline();return r&&r.play(),!0}return!1}}Ka.id=0;class Ja{constructor(t=new xh,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}Jo([Ka,Ja],{mergeWith(t){return new Ja(t.transforms.lmultiply(this.transforms),t.id)}});const tu=(t,e)=>t.lmultiplyO(e),eu=t=>t.transforms;function nu(){const t=this._transformationRunners.runners.map(eu).reduce(tu,new xh);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class ru{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 Ja).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))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}Mo({Element:{animate(t,e,n){const r=Ka.sanitise(t,e,n),i=this.timeline();return new Ka(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.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(eu).reduce(tu,new xh)},_addRunner(t){this._transformationRunners.add(t),Ha.cancelImmediate(this._frameId),this._frameId=Ha.immediate(nu.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new ru).add(new Ja(new xh(this))))}}});Jo(Ka,{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 r=e;if(this._tryRetarget(t,r))return this;let i=new Pa(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.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 $a(i.from()).valueOf();Object.assign(n,e),i.from(n)}const a=new $a(i.to()).valueOf();Object.assign(a,e),i.to(a),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new Pa(this._stepper).to(new Yh(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,r){e=r,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 r=xh.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new Pa(this._stepper).type(n?za:xh);let s,o,h,a,u;return this.queue((function(){o=o||this.element(),s=s||Io(t,o),u=new xh(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:d}=new wh(s).transform(o._currentTransform(this));let f=new xh({...t,origin:[c,d]}),p=this._isDeclarative&&h?h:u;if(n){f=f.decompose(c,d),p=p.decompose(c,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);f.rotate=n[s]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&a&&(p.rotate=a)),i.from(p),i.to(f);const m=i.at(l);return a=m.rotate,h=new xh(m),this.addTransform(h),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=Io(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",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 Yh(e),this._tryRetarget(t,e))return this;const n=new Pa(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new Yh(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new Pa(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 Yh(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(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,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new Pa(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new Eh(t,e,n,r))},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)}}),Jo(Ka,{rx:Uh,ry:Qh,from:ha,to:aa}),Zo(Ka,"Runner");class iu extends Wh{constructor(t,e=t){super(Vo("svg",t),e),this.namespace()}defs(){return this.isRoot()?Wo(this.node.querySelector("defs"))||this.put(new Hh):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof $o.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:Do,version:"1.1"}).attr("xmlns:xlink",Fo,zo):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,zo).attr("xmlns:svgjs",null,zo)}root(){return this.isRoot()?this:super.root()}}Mo({Container:{nested:th((function(){return this.put(new iu)}))}}),Zo(iu,"Svg",!0);let su=class extends Wh{constructor(t,e=t){super(Vo("symbol",t),e)}};Mo({Container:{symbol:th((function(){return this.put(new su)}))}}),Zo(su,"Symbol");const ou=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(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)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild($o.document.createTextNode(t)),this},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)}},Symbol.toStringTag,{value:"Module"}));class hu extends Zh{constructor(t,e=t){super(Vo("text",t),e),this.dom.leading=this.dom.leading??new Yh(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Yh(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(r){if(Ro(this.node))return;const i=$o.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new Yh(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Yh(t.leading||1.3),this}writeDataToDom(){return Po(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||Ro(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===Wo(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);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()}}Jo(hu,ou),Mo({Container:{text:th((function(t=""){return this.put(new hu).text(t)})),plain:th((function(t=""){return this.put(new hu).plain(t)}))}}),Zo(hu,"Text");class au extends Zh{constructor(t,e=t){super(Vo("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 hu))return this;const e=t.index(this),n=$o.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new Yh(n);return this.dy(e?r: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)}}Jo(au,ou),Mo({Tspan:{tspan:th((function(t=""){const e=new au;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),Zo(au,"Tspan");class uu extends Zh{constructor(t,e=t){super(Vo("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 Yh(t).divide(2))}}Jo(uu,{x:Kh,y:Jh,cx:ta,cy:ea,width:na,height:ra}),Mo({Container:{circle:th((function(t=0){return this.put(new uu).size(t).move(0,0)}))}}),Zo(uu,"Circle");class lu extends Wh{constructor(t,e=t){super(Vo("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return kh("svg [clip-path*="+this.id()+"]")}}Mo({Container:{clip:th((function(){return this.defs().put(new lu)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof lu?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),Zo(lu,"ClipPath");class cu extends Bh{constructor(t,e=t){super(Vo("foreignObject",t),e)}}Mo({Container:{foreignObject:th((function(t,e){return this.put(new cu).size(t,e)}))}}),Zo(cu,"ForeignObject");const du=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof $o.window.SVGSVGElement?new Eh(n.attr(["x","y","width","height"])):n.bbox()}catch(h){return}const i=new xh(n),s=i.translate(t,e).transform(i.inverse()),o=new wh(r.x,r.y).transform(s);n.move(o.x,o.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 r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=jo(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach((t=>{const e=new wh(n).transform(new xh(t).inverse());t.scale(i,s,e.x,e.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)}},Symbol.toStringTag,{value:"Module"}));class fu extends Wh{constructor(t,e=t){super(Vo("g",t),e)}}Jo(fu,du),Mo({Container:{group:th((function(){return this.put(new fu)}))}}),Zo(fu,"G");class pu extends Wh{constructor(t,e=t){super(Vo("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,Fo)}}Jo(pu,du),Mo({Container:{link:th((function(t){return this.put(new pu).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 pu,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}}}),Zo(pu,"A");class mu extends Wh{constructor(t,e=t){super(Vo("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return kh("svg [mask*="+this.id()+"]")}}Mo({Container:{mask:th((function(){return this.defs().put(new mu)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof mu?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),Zo(mu,"Mask");class gu extends Bh{constructor(t,e=t){super(Vo("stop",t),e)}update(t){return("number"==typeof t||t instanceof Yh)&&(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 Yh(t.offset)),this}}Mo({Gradient:{stop:function(t,e,n){return this.put(new gu).update(t,e,n)}}}),Zo(gu,"Stop");class yu extends Bh{constructor(t,e=t){super(Vo("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 r in e)n+=r.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[r]+";";return n+="}",n}(t,e))}}Mo("Dom",{style(t,e){return this.put(new yu).rule(t,e)},fontface(t,e,n){return this.put(new yu).font(t,e,n)}}),Zo(yu,"Style");class wu extends hu{constructor(t,e=t){super(Vo("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")}}Mo({Container:{textPath:th((function(t,e){return t instanceof hu||(t=this.text(t)),t.path(e)}))},Text:{path:th((function(t,e=!0){const n=new wu;let r;if(t instanceof Xa||(t=this.defs().path(t)),n.attr("href","#"+t,Fo),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:th((function(t){return t instanceof hu||(t=(new hu).addTo(this.parent()).text(t)),t.path(this)})),targets(){return kh("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),wu.prototype.MorphArray=La,Zo(wu,"TextPath");class bu extends Zh{constructor(t,e=t){super(Vo("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,Fo)}}Mo({Container:{use:th((function(t,e){return this.put(new bu).use(t,e)}))}}),Zo(bu,"Use");const xu=Bo;Jo([iu,su,da,ca,ya],ko("viewbox")),Jo([ga,Ba,qa,Xa],ko("marker")),Jo(hu,ko("Text")),Jo(Xa,ko("Path")),Jo(Hh,ko("Defs")),Jo([hu,au],ko("Tspan")),Jo([Va,sa,la,Ka],ko("radius")),Jo(Lh,ko("EventTarget")),Jo(qh,ko("Dom")),Jo(Bh,ko("Element")),Jo(Zh,ko("Shape")),Jo([Wh,oa],ko("Container")),Jo(la,ko("Gradient")),Jo(Ka,ko("Runner")),Oh.extend([...new Set(Oo)]),function(t=[]){Ya.push(...[].concat(t))}([Yh,yh,Eh,xh,$h,fa,La,wh]),Jo(Ya,{to(t){return(new Pa).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var vu=function(t){return t.touches||[{clientX:t.clientX,clientY:t.clientY}]};Jo(iu,{panZoom:function(t){var e,n,r,i,s,o,h,a,u,l,c,d,f=this;if(this.off(".panZoom"),!1===t)return this;var p,m,g=null!=(n=(t=null!=(e=t)?e:{}).zoomFactor)?n:2,y=null!=(r=t.zoomMin)?r:Number.MIN_VALUE,w=null!=(i=t.zoomMax)?i:Number.MAX_VALUE,b=null==(s=t.wheelZoom)||s,x=null==(o=t.pinchZoom)||o,v=null==(h=t.panning)||h,_=null!=(a=t.panButton)?a:0,E=null!=(u=t.oneFingerPan)&&u,C=null!=(l=t.margins)&&l,O=null!=(c=t.wheelZoomDeltaModeLinePixels)?c:17,M=null!=(d=t.wheelZoomDeltaModeScreenPixels)?d:53,k=!1,S=this.viewbox(),N=function(t){if(!C)return t;var e=C.top,n=C.left,r=C.bottom,i=C.right,s=f.attr(["width","height"]),o=s.width,h=s.height,a=f.node.preserveAspectRatio.baseVal,u=0,l=0,c=0,d=0;if(a.align!==a.SVG_PRESERVEASPECTRATIO_NONE){var p=o/h,m=S.width/S.height;if(m!==p){var g=a.meetOrSlice!==a.SVG_MEETORSLICE_SLICE,y=p>m?"width":"height",w="width"===y,b=g&&w||!g&&!w,x=b?p/m:m/p,v=t[y]-t[y]*x;b?a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMAX?(u=v/2,l=-v/2):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMAX?l=-v:a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMIN&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMID&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMAX||(u=v):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMAXYMID?(c=v/2,d=-v/2):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMAXYMIN?d=-v:a.align!==a.SVG_PRESERVEASPECTRATIO_XMINYMAX&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMIDYMAX&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMAX||(c=v)}}var _=S.width+S.x-n-u,E=S.x+i-t.width-l,O=S.height+S.y-e-c,M=S.y+r-t.height-d;return t.x=Math.min(_,Math.max(E,t.x)),t.y=Math.min(O,Math.max(M,t.y)),t},A=function t(e){(m=vu(e)).length<2?v&&E&&I.call(this,e):(v&&E&&L.call(this,e),e.preventDefault(),this.dispatch("pinchZoomStart",{event:e}).defaultPrevented||(this.off("touchstart.panZoom",t),k=!0,jh(document,"touchmove.panZoom",j,this,{passive:!1}),jh(document,"touchend.panZoom",T,this,{passive:!1})))},T=function t(e){e.preventDefault();var n=vu(e);n.length>1||(k=!1,this.dispatch("pinchZoomEnd",{event:e}),Ih(document,"touchmove.panZoom",j),Ih(document,"touchend.panZoom",t),this.on("touchstart.panZoom",A),n.length&&v&&E&&I.call(this,e))},j=function(t){t.preventDefault();var e=vu(t),n=this.zoom(),r=Math.sqrt(Math.pow(m[0].clientX-m[1].clientX,2)+Math.pow(m[0].clientY-m[1].clientY,2))/Math.sqrt(Math.pow(e[0].clientX-e[1].clientX,2)+Math.pow(e[0].clientY-e[1].clientY,2));(n<y&&r>1||n>w&&r<1)&&(r=1);var i={x:e[0].clientX+.5*(e[1].clientX-e[0].clientX),y:e[0].clientY+.5*(e[1].clientY-e[0].clientY)},s=m[0].clientX+.5*(m[1].clientX-m[0].clientX),o=m[0].clientY+.5*(m[1].clientY-m[0].clientY),h=this.point(i.x,i.y),a=this.point(2*i.x-s,2*i.y-o),u=new Eh(this.viewbox()).transform((new xh).translate(-a.x,-a.y).scale(r,0,0).translate(h.x,h.y));N(u),this.viewbox(u),m=e,this.dispatch("zoom",{box:u,focus:a})},I=function t(e){e.type.indexOf("mouse")>-1&&e.button!==_&&e.which!==_+1||(e.preventDefault(),this.off("mousedown.panZoom",t),m=vu(e),k||(this.dispatch("panStart",{event:e}),p={x:m[0].clientX,y:m[0].clientY},jh(document,"touchmove.panZoom mousemove.panZoom",R,this,{passive:!1}),jh(document,"touchend.panZoom mouseup.panZoom",L,this,{passive:!1})))},L=function t(e){e.preventDefault(),Ih(document,"touchmove.panZoom mousemove.panZoom",R),Ih(document,"touchend.panZoom mouseup.panZoom",t),this.on("mousedown.panZoom",I),this.dispatch("panEnd",{event:e})},R=function(t){t.preventDefault();var e=vu(t),n={x:e[0].clientX,y:e[0].clientY},r=this.point(n.x,n.y),i=this.point(p.x,p.y),s=[i.x-r.x,i.y-r.y];if(s[0]||s[1]){var o=new Eh(this.viewbox()).transform((new xh).translate(s[0],s[1]));p=n,N(o),this.dispatch("panning",{box:o,event:t}).defaultPrevented||this.viewbox(o)}};return b&&this.on("wheel.panZoom",(function(t){var e;switch(t.preventDefault(),t.deltaMode){case 1:e=t.deltaY*O;break;case 2:e=t.deltaY*M;break;default:e=t.deltaY}var n=Math.pow(1+g,-1*e/100)*this.zoom(),r=this.point(t.clientX,t.clientY);if(n>w&&(n=w),n<y&&(n=y),this.dispatch("zoom",{level:n,focus:r}).defaultPrevented)return this;if(this.zoom(n,r),C){var i=N(this.viewbox());this.viewbox(i)}}),this,{passive:!1}),x&&this.on("touchstart.panZoom",A,this,{passive:!1}),v&&this.on("mousedown.panZoom",I,this,{passive:!1}),this}});class _u{constructor(t,e,n,r,i){this.chartContext=i,this.width=e,this.height=n,this.containerElement=t,t.innerHTML="",this.canvas=xu().addTo(t).size("100%","100%").viewbox(`0 0 ${e} ${n}`).panZoom({zoomFactor:.2,zoomMin:.1}).attr({style:r})}static drawCircle(t={}){const e=new uu;return e.attr(t),e}static drawGroup(t=0,e=0,n,r){const i=new fu;return i.attr({"data-parent":r,"data-self":n,transform:`translate(${t}, ${e})`}),i}static drawPath(t,{borderColor:e=yo.borderColor,id:n=""}={}){const r=new Xa({d:t});return r.id(n),r.fill("none").stroke({color:e,width:1}),r}static drawRect({color:t="#fefefe",height:e=0,opacity:n=1,radius:r=0,width:i=0,x1:s,y1:o}={}){const h=new Va;return h.attr({height:e,opacity:n,rx:r,ry:r,width:i,x:s??void 0,y:o??void 0}),h.fill(t),h}static drawTemplate(t,{nodeHeight:e,nodeWidth:n}={}){const r=new cu({height:e,width:n}),i=document.createElement("div");return i.innerHTML=t,i.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),r.add(i),r}static drawText(t="",{dx:e,dy:n,x:r,y:i}){const s=new hu;return s.font({fill:"#f06"}),s.tspan(t),void 0!==r&&void 0!==i&&s.move(r,i),void 0!==e&&void 0!==n&&s.attr({dx:e,dy:n}),s}add(t){this.canvas.add(t)}clear(){this.canvas.clear().viewbox(`0 0 ${this.width} ${this.height}`)}exportToSvg(){new o(this.canvas,"apextree").exportToSVG()}resetViewBox(){this.canvas.viewbox(`0 0 ${this.width} ${this.height}`)}updateViewBox(t,e,n,r){this.canvas.viewbox(`${t} ${e} ${n} ${r}`)}zoom(t){const e=this.canvas.zoom()+t;e>=.1&&this.canvas.zoom(e)}getContainerElement(){return this.containerElement}}const Eu={marginx:100,marginy:100,rankdir:"TB"};class Cu extends _u{constructor(t,e,n){super(t,e.viewPortWidth,e.viewPortHeight,e.canvasStyle,n),this.options=e,this.preservedPositions=new Map}calculateLayout(){const{childrenSpacing:t,siblingSpacing:e}=this.options,n=go[this.options.direction];this.graph.setGraph({...Eu,nodesep:e,rankdir:n,ranksep:t}),co.layout(this.graph)}resetGraph(){this.graph=new co.graphlib.Graph,this.graph.setDefaultEdgeLabel((function(){return{}}))}setGraphNodesAndEdges(t){this.resetGraph(),this.setNodesRecursively(t)}setNodesRecursively(t,e){var n;const{direction:r,groupLeafNodesSpacing:i,nodeHeight:s,nodeWidth:o}=this.options,h=this.nodeMap[t],a={...h,parent:e||void 0};if(this.graph.setNode(t,{...a,height:s,width:o}),e&&this.graph.setEdge(e,t),h.onlyLeafNodes){const e=mo[r].leafWidth({childLength:h.children.length,childrenSpacing:i,nodeWidth:o}),n=mo[r].leafHeight({childLength:h.children.length,childrenSpacing:i,nodeHeight:s});this.graph.setNode(`${t}_leafs`,{...a,height:n,id:`${t}_leafs`,parent:t,width:e}),this.graph.setEdge(t,`${t}_leafs`)}else if(null==(n=h.children)?void 0:n.length)for(const u of h.children)this.setNodesRecursively(u,t)}changeLayout(t="top"){this.options={...this.options,direction:t},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!1})}collapse(t){const e=this.nodeMap[t];(null==e?void 0:e.children)&&(this.graph.nodes().forEach((t=>{const e=this.graph.node(t);void 0!==(null==e?void 0:e.x)&&void 0!==(null==e?void 0:e.y)&&this.preservedPositions.set(t,{x:e.x,y:e.y})})),this.nodeMap[t]={...e,children:void 0,hiddenChildren:e.children},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!0}))}construct(t){if(this.nodeMap=vo(t),this.data=t,this.options.groupLeafNodes){(function(t){const e=[];function n(t){return!t.children||0===t.children.length}return function t(r){if(r.children&&0!==r.children.length){r.children.every(n)&&e.push(r);for(const e of r.children)t(e)}}(t),e})(t).forEach((t=>{this.nodeMap[t.id]={...this.nodeMap[t.id],onlyLeafNodes:!0},this.nodeMap[`${t.id}_leafs`]={...this.nodeMap[t.id],id:`${t.id}_leafs`,onlyLeafNodes:!0,parent:t.id},this.nodeMap[t.id].children.forEach((e=>{this.nodeMap[e]={...this.nodeMap[e],parent:`${t.id}_leafs`}}))}))}this.setGraphNodesAndEdges(t.id)}expand(t){const e=this.nodeMap[t];(null==e?void 0:e.hiddenChildren)&&(this.graph.nodes().forEach((t=>{const e=this.graph.node(t);void 0!==(null==e?void 0:e.x)&&void 0!==(null==e?void 0:e.y)&&this.preservedPositions.set(t,{x:e.x,y:e.y})})),this.nodeMap[t]={...e,children:e.hiddenChildren,hiddenChildren:void 0},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!0}))}fitScreen(){const{height:t,width:e}=this.graph.graph();this.updateViewBox(0,0,e,t)}render({keepOldPosition:t=!1}={}){const e=this.canvas.viewbox();this.clear(),this.calculateLayout(),t&&this.preservedPositions.size>0&&this.graph.nodes().forEach((t=>{const e=this.preservedPositions.get(t);if(e){const n=this.graph.node(t);n&&(n.x=e.x,n.y=e.y,this.graph.setNode(t,n))}}));const{containerClassName:n,enableTooltip:r,fontColor:i,fontFamily:s,fontSize:o,fontWeight:h,tooltipId:a}=this.options,u=lr({color:i,fontFamily:s,fontSize:o,fontWeight:h}),l=_u.drawGroup(0,0,n);l.attr("style",u),l.id(n);const c=this.graph.nodes();if(this.graph.edges().forEach((t=>{this.renderEdge(t,l)})),c.forEach((t=>{t.endsWith("_leafs")?this.renderGroupedLeafNodes(t,l):this.renderNode(t,l)})),this.add(l),this.fitScreen(),t&&this.updateViewBox(e.x,e.y,e.width,e.height),r){const t=ar(this.chartContext,a);this.chartContext.getAppendContainer().appendChild(t)}}renderEdge(t,e){const n=this.graph.node(t.w),r=this.graph.node(t.v),{nodeHeight:i,nodeWidth:s}=this.options,o=((t,e,n,r,i)=>{if(!(null==t?void 0:t.parent))return null;const{calculateEdge:s,edgeMidX:o,edgeMidY:h,edgeParentX:a,edgeParentY:u,edgeX:l,edgeY:c}=mo[i];return s({x:l({node:t,nodeHeight:r,nodeWidth:n}),y:c({node:t,nodeHeight:r,nodeWidth:n})},{x:a({nodeHeight:r,nodeWidth:n,parent:e}),y:u({nodeHeight:r,nodeWidth:n,parent:e})},{x:o({node:t,nodeHeight:r,nodeWidth:n}),y:h({node:t,nodeHeight:r,nodeWidth:n})},{sy:0})})(n,r,s,i,this.options.direction);if(!o)return;const h=_u.drawPath(o,{id:`${t.v}-${t.w}`});e.add(h)}renderGroupedLeafNodes(t,e){const n=this.graph.node(t),{options:r}=this,{direction:i}=r,s=mo[i].leafGroupX({node:n}),o=mo[i].leafGroupY({node:n}),h=_u.drawGroup(s,o,n.id,n.parent);n.children.forEach(((t,e)=>{this.renderLeafNode(t,h,e)})),e.add(h)}renderLeafNode(t,e,n){const r=this.nodeMap[t],{options:i}=this,{containerClassName:s,contentKey:o,direction:h,enableTooltip:a,groupLeafNodesSpacing:u,highlightOnHover:l,nodeTemplate:c,tooltipTemplate:d}=i,{borderColor:f,borderStyle:p,borderRadius:m,borderWidth:g,fontColor:y,fontFamily:w,fontSize:b,fontWeight:x,nodeBGColor:v,nodeClassName:_,nodeHeight:E,nodeStyle:C,nodeWidth:O,tooltipBGColor:M,tooltipBorderColor:k,tooltipFontColor:S,tooltipFontSize:N,tooltipId:A,tooltipMaxWidth:T,tooltipMinWidth:j,tooltipOffset:I,tooltipPadding:L}={...i,...r.options},R=mo[h].leafX({childrenSpacing:u,index:n,nodeHeight:E,nodeWidth:O}),P=mo[h].leafY({childrenSpacing:u,index:n,nodeHeight:E,nodeWidth:O}),D=_u.drawGroup(R,P,r.id,r.parent),z=lr({background:v,borderColor:f,borderRadius:m,borderStyle:p,borderWidth:`${g}px`,color:y,fontFamily:w,fontSize:b,fontWeight:x}),F=c(r[o]),$=_u.drawTemplate(F,{nodeHeight:E,nodeWidth:O}),Y=z+(C?"; "+C:"");$.attr("style",Y),$.attr("class",_),D.add($);const X=this;if(l&&(D.on("mouseover",(function(){const{self:t}=this.node.dataset,e=X.nodeMap[t];e&&bo(e,X.nodeMap,!0,i,X.chartContext,s)})),D.on("mouseout",(function(){const{self:t}=this.node.dataset,e=X.nodeMap[t];e&&bo(e,X.nodeMap,!1,i,X.chartContext,s)}))),a){const t=d?d(r[o]):F;D.on("mousemove",(e=>{_o(X.chartContext,{bgColor:M,borderColor:k,fontColor:S,fontSize:N,fontFamily:w,maxWidth:T,minWidth:j,offset:I,padding:d?0:L,tooltipId:A},t,e.pageX,e.pageY,X.getContainerElement())})),D.on("mouseout",(t=>{var e;"svg"===(null==(e=t.relatedTarget)?void 0:e.tagName)&&Eo(X.chartContext,A)}))}this.options.onNodeClick&&D.on("click",(()=>{this.options.onNodeClick(r)})),e.add(D)}renderNode(t,e){var n,r;const i=this.graph.node(t),{options:s}=this,{borderRadius:o,containerClassName:h,contentKey:a,direction:u,enableExpandCollapse:l,enableTooltip:c,highlightOnHover:d,nodeHeight:f,nodeTemplate:p,nodeWidth:m,tooltipTemplate:g}=s,{borderColor:y,borderStyle:w,borderWidth:b,fontColor:x,fontFamily:v,fontSize:_,fontWeight:E,nodeBGColor:C,nodeClassName:O,nodeStyle:M,tooltipBGColor:k,tooltipBorderColor:S,tooltipId:N,tooltipFontColor:A,tooltipFontSize:T,tooltipMaxWidth:j,tooltipMinWidth:I,tooltipOffset:L,tooltipPadding:R}={...s,...i.options},{height:P,width:D,x:z,y:F}=i,$=this,Y=_u.drawGroup(z-m/2,F-f/2,i.id,i.parent),X=p(i[a]),G=_u.drawTemplate(X,{nodeHeight:P,nodeWidth:D}),q=lr({color:x,fontFamily:v,fontSize:_,fontWeight:E}),B=lr({backgroundColor:C,borderColor:y,borderRadius:o,borderStyle:w,borderWidth:`${b}px`,boxSizing:"border-box",height:"100%"})+(M?"; "+M:"");if(G.first().attr("style",B),G.attr("class",O),Y.attr("style",q),Y.add(G),d&&(Y.on("mouseover",(function(){const{self:t}=this.node.dataset,e=$.nodeMap[t];e&&bo(e,$.nodeMap,!0,s,$.chartContext,h)})),Y.on("mouseout",(function(){const{self:t}=this.node.dataset,e=$.nodeMap[t];e&&bo(e,$.nodeMap,!1,s,$.chartContext,h)}))),c){const t=g?g(i[a]):X;Y.on("mousemove",(e=>{_o($.chartContext,{bgColor:k,borderColor:S,fontColor:A,fontSize:T,fontFamily:v,maxWidth:j,minWidth:I,offset:L,padding:g?0:R,tooltipId:N},t,e.pageX,e.pageY,$.getContainerElement())})),Y.on("mouseout",(t=>{var e;"svg"===(null==(e=t.relatedTarget)?void 0:e.tagName)&&Eo($.chartContext,N)}))}if(l&&((null==(n=i.children)?void 0:n.length)||(null==(r=i.hiddenChildren)?void 0:r.length))){const t=7,e=((t,e,n,r)=>{switch(t){case"top":case"bottom":default:return{x:e/2-r,y:n-r};case"left":return{x:e-r,y:n/2-r};case"right":return{x:-r,y:n/2-r}}})(this.options.direction,m,f,t),n=!i.hiddenChildren,r=_u.drawGroup(e.x,e.y),s=_u.drawCircle({cx:t,cy:t,r:t});s.fill(this.options.expandCollapseButtonBGColor),s.stroke({color:this.options.expandCollapseButtonBorderColor,width:1}),r.add(s);const o=n?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14">\n <path d="m12,0C5.383,0,0,5.383,0,12s5.383,12,12,12,12-5.383,12-12S18.617,0,12,0Zm0,22c-5.514,0-10-4.486-10-10S6.486,2,12,2s10,4.486,10,10-4.486,10-10,10Zm5-10c0,.552-.448,1-1,1h-8c-.552,0-1-.448-1-1s.448-1,1-1h8c.552,0,1,.448,1,1Z"/>\n</svg>\n':'<svg height="14" viewBox="0 0 24 24" width="14" xmlns="http://www.w3.org/2000/svg">\n <path d="m12 0a12 12 0 1 0 12 12 12.013 12.013 0 0 0 -12-12zm0 22a10 10 0 1 1 10-10 10.011 10.011 0 0 1 -10 10zm5-10a1 1 0 0 1 -1 1h-3v3a1 1 0 0 1 -2 0v-3h-3a1 1 0 0 1 0-2h3v-3a1 1 0 0 1 2 0v3h3a1 1 0 0 1 1 1z"/>\n</svg>',h=_u.drawTemplate(o,{nodeHeight:14,nodeWidth:14});r.add(h),Y.add(r),r.on("click",(t=>{t.stopPropagation(),n?this.collapse(i.id):this.expand(i.id)})),(t=>{const e=t.findOne("circle");if(!e)return;const n=e.attr("fill")||"#FFF",r=e.attr("stroke")||"#ddd",i=e.attr("stroke-width")||1,s=e.attr("r");t.on("mouseenter",(function(){e.attr({fill:"#f8f9fa",stroke:"#007bff","stroke-width":2,r:1.1*s}),t.attr("style","cursor: pointer; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));")})),t.on("mouseleave",(function(){e.attr({fill:n,stroke:r,"stroke-width":i,r:s}),t.attr("style","cursor: pointer;")}))})(r)}this.options.onNodeClick&&Y.on("click",(()=>{this.options.onNodeClick(i)})),e.add(Y)}}class Ou extends i{constructor(t,e={}){const n="tree_"+Math.random().toString(36).substr(2,9);super(t,n);const r=e.containerClassName?`${e.containerClassName}-${n}`:`root-${n}`;this.options={...yo,...e,containerClassName:r};const{height:i,width:s}=this.options;this.graph=new Cu(this.element,this.options,this.chartContext),this.setupElementDimensions(s,i),this.handleWatermark()}static setLicense(t){a.setLicense(t)}setupElementDimensions(t,e){let n=!1,r=0;"string"==typeof t&&/^\d+(\.\d+)?%$/.test(t)?(r=Number(t.substring(0,t.length-1)),n=!0):r=Number(t);const i="auto"===e?r/1.6:Number(e);this.element.style.width=`${r}${n?"%":"px"}`,this.element.style.height=`${i}${n?"%":"px"}`,this.element.style.position="relative"}handleWatermark(){this.element&&(a.isLicenseValid()?ln.remove(this.element):ln.add(this.element))}render(t){if(!this.element)throw new Error("Element not found");if(this.graph.construct(t),this.graph.render(),this.options.enableToolbar){new an(this.element,this.chartContext).render({enableExport:!0,enableFitscreen:!0,enableZoom:!0,onExport:this.graph.exportToSvg.bind(this.graph),onFitscreen:this.graph.fitScreen.bind(this.graph),onZoom:this.graph.zoom.bind(this.graph)})}return this.graph}}"undefined"!=typeof window&&(window.ApexTree=Ou),t.ApexTree=Ou,t.default=Ou,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|