PageSourceSearch

https://apexcharts.com/_next/static/chunks/5887-96ac55666d011e7e.js

js apexcharts.com collected 2026-09-24 17:51:11 UTC 271,730 bytes, 89 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5887],{1847:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(2115);let o=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim()};var r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let s=(0,i.forwardRef)((e,t)=>{let{color:n="currentColor",size:s=24,strokeWidth:a=2,absoluteStrokeWidth:l,className:d="",children:h,iconNode:c,...u}=e;return(0,i.createElement)("svg",{ref:t,...r,width:s,height:s,stroke:n,strokeWidth:l?24*Number(a)/Number(s):a,className:o("lucide",d),...u},[...c.map(e=>{let[t,n]=e;return(0,i.createElement)(t,n)}),...Array.isArray(h)?h:[h]])}),a=(e,t)=>{let n=(0,i.forwardRef)((n,r)=>{let{className:a,...l}=n;return(0,i.createElement)(s,{ref:r,iconNode:t,className:o("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),a),...l})});return n.displayName="".concat(e),n}},2758:(e,t,n)=>{e.exports=n(9298)()},3341:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},3697:(e,t,n)=>{"use strict";n.d(t,{Df:()=>e7});let i=()=>{};class o{constructor(e,t){this.injectedStyles=new Set,this.trackedTooltips=new Set,this.instanceId=t||Math.random().toString(36).substr(2,9),this.context=this.detectContext(e),this.chartContainer=e}getChartContainer(){return this.chartContainer}getChartScopedContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.chartContainer||this.context}detectContext(e){let t=e.getRootNode();return t instanceof ShadowRoot?t:document}getContext(){return this.context}getInstanceId(){return this.instanceId}isShadowDOM(){return this.context instanceof ShadowRoot}createElement(e){return document.createElement(e)}createElementNS(e,t){return document.createElementNS(e,t)}createTextNode(e){return document.createTextNode(e)}getElementById(e){return this.context===document?document.getElementById(e):this.context.querySelector(`#${e}`)}getElementsByClassName(e){if(this.context===document)return document.getElementsByClassName(e);let t=Array.from(this.context.querySelectorAll(`.${e}`));return{item:e=>t[e]||null,get length(){return t.length},[Symbol.iterator]:()=>t[Symbol.iterator](),...Object.fromEntries(t.map((e,t)=>[t,e]))}}querySelector(e){return this.context.querySelector(e)}querySelectorAll(e){return this.context.querySelectorAll(e)}getAppendContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.context}getChartBounds(){var e;return(null==(e=this.chartContainer)?void 0:e.getBoundingClientRect())||new DOMRect}getBody(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.context.host}dispatchEvent(e){this.context===document?document.dispatchEvent(e):this.context.dispatchEvent(e)}addEventListener(e,t,n){this.context===document||"mousemove"===e||"mouseup"===e||"keydown"===e?document.addEventListener(e,t,n):this.context.addEventListener(e,t,n)}removeEventListener(e,t,n){this.context===document||"mousemove"===e||"mouseup"===e||"keydown"===e?document.removeEventListener(e,t,n):this.context.removeEventListener(e,t,n)}injectStyles(e,t,n={}){let{force:i=!1,priority:o="normal"}=n;if(!i&&this.injectedStyles.has(t))return;if(i){let e=this.context.querySelector(`#${t}`);e&&(e.remove(),this.injectedStyles.delete(t))}if(this.context.querySelector(`#${t}`)&&!i)return void this.injectedStyles.add(t);let r=document.createElement("style");if(r.id=t,r.textContent=e,"normal"!==o&&r.setAttribute("data-priority",o),this.context===document)document.head.appendChild(r);else{let e=this.context;"high"===o?e.insertBefore(r,e.firstChild):e.appendChild(r)}this.injectedStyles.add(t)}injectStylesheets(e){e.forEach(({content:e,id:t,options:n})=>{this.injectStyles(e,t,n)})}hasInjectedStyles(e){return this.injectedStyles.has(e)}removeStyles(e){let t=this.context.querySelector(`#${e}`);t&&(t.remove(),this.injectedStyles.delete(e))}
1removeAllStyles(){this.injectedStyles.forEach(e=>{let t=this.context.querySelector(`#${e}`);t&&t.remove()}),this.injectedStyles.clear()}getInjectedStyleIds(){return Array.from(this.injectedStyles)}getActiveElement(){return this.context===document?document.activeElement:this.context.activeElement||document.activeElement}trackTooltip(e){this.trackedTooltips.add(e)}destroy(){this.removeAllStyles(),this.injectedStyles.clear(),this.trackedTooltips.forEach(e=>e.remove()),this.trackedTooltips.clear()}}class r{constructor(e,t){if(!e)throw Error("Container element is required");this.element=e,this.chartContext=new o(e,t)}getContext(){return this.chartContext}isShadowDOM(){return this.chartContext.isShadowDOM()}getTooltipContainer(){return this.chartContext.getAppendContainer()}injectStyles(e,t){this.chartContext.injectStyles(e,t)}createElement(e){return this.chartContext.createElement(e)}querySelector(e){return this.chartContext.querySelector(e)}addEventListener(e,t,n){this.chartContext.addEventListener(e,t,n)}removeEventListener(e,t,n){this.chartContext.removeEventListener(e,t,n)}dispatchEvent(e){this.chartContext.dispatchEvent(e)}destroy(){this.chartContext.destroy()}getInstanceId(){return this.chartContext.getInstanceId()}}class s{constructor(e,t="apex"){this.canvas=e,this.prefix=t}getSvgString(){let e=this.canvas.node.cloneNode(!0),t=this.canvas.node.viewBox.baseVal;return t.width&&t.height&&(e.setAttribute("width",String(t.width)),e.setAttribute("height",String(t.height))),(new XMLSerializer).serializeToString(e)}svgUrl(){let e=new Blob([this.getSvgString()],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)}triggerDownload(e,t){let n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}exportToSVG(){this.triggerDownload(this.svgUrl(),`${this.prefix}-${(new Date).getTime()}.svg`)}}let a="http://www.w3.org/2000/svg",l=0;class d{constructor(e){this.node=e}attr(e,t){if("string"==typeof e)return void 0!==t?(this.node.setAttribute(e,String(t)),this):this.node.getAttribute(e);for(let[t,n]of Object.entries(e))null!=n&&this.node.setAttribute(t,String(n));return this}id(e){return this.node.setAttribute("id",e),this}fill(e){if(!e)return this;if(e instanceof SVGElement){let t=e.id;this.node.setAttribute("fill",`url(#${t})`)}else this.node.setAttribute("fill",e);return this}stroke({color:e,width:t,dasharray:n}={}){return void 0!==e&&this.node.setAttribute("stroke",e),void 0!==t&&this.node.setAttribute("stroke-width",String(t)),void 0!==n&&this.node.setAttribute("stroke-dasharray",String(n)),this}opacity(e){return this.node.setAttribute("opacity",String(e)),this}add(e){let t=e instanceof d?e.node:e;return this.node.appendChild(t),this}on(e,t){return this.node.addEventListener(e,t),this}findOne(e){let t=this.node.querySelector(e);return t?new d(t):null}first(){let e=this.node.firstElementChild;return e?new d(e):null}}class h extends d{constructor(e){super(document.createElementNS(a,"g")),e&&this.attr(e)}}class c extends d{constructor(){super(document.createElementNS(a,"rect"))}}class u extends d{constructor(){super(document.createElementNS(a,"circle"))}}class p extends d{constructor(e){super(document.createElementNS(a,"path")),e&&this.attr(e)}}class g extends d{constructor(){super(document.createElementNS(a,"text"))}font({fill:e,size:t}){return void 0!==e&&this.node.setAttribute("fill",e),void 0!==t&&this.node.setAttribute("font-size",String(t)),this}tspan(e){let t=document.createElementNS(a,"tspan");return t.textContent=e,this.node.appendChild(t),this}move(e,t){return this.node.setAttribute("x",String(e)),this.node.setAttribute("y",String(t)),this}}class f extends d{constructor(e){super(document.createElementNS(a,"foreignObject")),e&&this.attr(e)}}class m{constructor(e){this.gradient=e}stop(e,t){let n=document.createElementNS(a,"stop");n.setAttribute("offset",String(e)),n.setAttribute("stop-color",t??"transparent"),this.gradient.appendChild(n)}}function v(e,t){e.setAttribute("viewBox",`${t.x} ${t.y} ${t.w} ${t.h}`)}class y{constructor(e){this._defs=null,this._panZoomState=null,this.node=e}addTo(e){return e.appendChild(this.node),this}size(e,t){return this.node.setAttribute("width",String(e)),this.node.setAttribute("height",String(t)),this}viewbox(e){if(void 0===e){let e=this.node.viewBox.baseVal;return{x:e.x,y:e.y,width:e.width,height:e.height}}if(this.node.setAttribute("viewBox",e),this._panZoomState){let e=this.node.viewBox.baseVal;this._panZoomState.vb={x:e.x,y:e.y,w:e.width,h:e.height}}return this}attr(e){for(let[t,n]of Object.entries(e))null!=n&&this.node.setAttribute(t,String(n));return this}add(e){return this.node.appendChild(e instanceof d?e.node:e),this}clear(){let e=this._defs;return this.node.innerHTML="",e&&(this.node.appendChild(e),this._defs=e),this}svg(){return this.node.innerHTML}gradient(e,t){this._defs||(this._defs=document.createElementNS(a,"defs"),this.node.insertBefore(this._defs,this.node.firstChild));let n=document.createElementNS(a,"linearGradient"),i="apx-grad-"+ ++l;return n.setAttribute("id",i),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2","100%"),n.setAttribute("y2","0%"),t(new m(n)),this._defs.appendChild(n),n}panZoom(e={}){return this._panZoomState=function(e,t){let n=function(e){let t=e.viewBox.baseVal;return{x:t.x,y:t.y,w:t.width,h:t.height}}(e),i={zoomMin:t.zoomMin??.1,currentZoom:1,baseVb:{...n},vb:{...n}};e.addEventListener("wheel",t=>{if(!t.ctrlKey&&!t.metaKey)return;t.preventDefault();let n=1+Math.max(-.12,Math.min(.12,.0025*t.deltaY)),o=i.currentZoom/n;if(o<i.zoomMin)return;let r=e.getBoundingClientRect(),s=(t.clientX-r.left)/r.width,a=(t.clientY-r.top)/r.height,{vb:l}=i,d=l.w*n,h=l.h*n;i.vb={x:l.x+s*(l.w-d),y:l.y+a*(l.h-h),w:d,h:h},i.currentZoom=o,v(e,i.vb)},{passive:!1});let o=!1,r=!1,s=-1,a=0,l=0;e.addEventListener("pointerdown",e=>{0===e.button&&(e.preventDefault(),o=!0,r=!1,s=e.pointerId,a=e.clientX,l=e.clientY)}),e.addEventListener("pointermove",t=>{if(!o||t.pointerId!==s)return;if(!r){let n=t.clientX-a,i=t.clientY-l;if(4>Math.abs(n)&&4>Math.abs(i))return;r=!0,e.setPointerCapture(t.pointerId),e.style.cursor="grabbing",e.style.userSelect="none"}let n=e.getBoundingClientRect(),d=i.vb.w/n.width,h=i.vb.h/n.height,c=(t.clientX-a)*d,u=(t.clientY-l)*h;i.vb={x:i.vb.x-c,y:i.vb.y-u,w:i.vb.w,h:i.vb.h},v(e,i.vb),a=t.clientX,l=t.clientY});let d=t=>{o&&t.pointerId===s&&(r&&(e.releasePointerCapture(t.pointerId),e.style.cursor="",e.style.userSelect=""),o=!1,r=!1,s=-1)};return e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),i}(this.node,e),this}resetPanZoomBase(){if(!this._panZoomState)return;let e=this.node.viewBox.baseVal;this._panZoomState.baseVb={x:e.x,y:e.y,w:e.width,h:e.height},this._panZoomState.vb={x:e.x,y:e.y,w:e.width,h:e.height},this._panZoomState.currentZoom=1}zoom(e){var t;if(void 0===e)return(null==(t=this._panZoomState)?void 0:t.currentZoom)??1;if(!this._panZoomState)return this;let n=this._panZoomState;if(e<n.zoomMin)return this;let i=n.currentZoom/e,{vb:o}=n,r=o.w*i,s=o.h*i;return n.vb={x:o.x+.5*(o.w-r),y:o.y+.5*(o.h-s),w:r,h:s},n.currentZoom=e,v(this.node,n.vb),this}}let b={export:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewB
1ox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">\n    <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>\n    <polyline points="7 10 12 15 17 10"/>\n    <line x1="12" y1="15" x2="12" y2="3"/>\n  </svg>',"zoom-in":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">\n    <circle cx="11" cy="11" r="8"/>\n    <path d="m21 21-4.35-4.35"/>\n    <line x1="11" y1="8" x2="11" y2="14"/>\n    <line x1="8" y1="11" x2="14" y2="11"/>\n  </svg>',"zoom-out":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">\n    <circle cx="11" cy="11" r="8"/>\n    <path d="m21 21-4.35-4.35"/>\n    <line x1="8" y1="11" x2="14" y2="11"/>\n  </svg>',"fit-screen":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">\n    <path d="M8 3H5a2 2 0 0 0-2 2v3"/>\n    <path d="M21 8V5a2 2 0 0 0-2-2h-3"/>\n    <path d="M3 16v3a2 2 0 0 0 2 2h3"/>\n    <path d="M16 21h3a2 2 0 0 0 2-2v-3"/>\n  </svg>'};class x{constructor(e,t){this.element=e,e&&(this.chartContext=t||new o(e),this.injectStyles())}injectStyles(){let e=`toolbar-styles-${this.chartContext.getInstanceId()}`;this.chartContext.injectStyles("\n  #toolbar {\n    display: flex;\n    gap: 2px;\n    position: absolute;\n    /* Logical inset: stays on the right in LTR, mirrors to the left in RTL\n       (so it never collides with RTL-flipped chrome such as the search box). */\n    inset-inline-end: 12px;\n    top: 12px;\n    z-index: 100;\n    user-select: none;\n    background: var(--toolbar-bg-color, rgba(255, 255, 255, 0.92));\n    border: 1px solid var(--toolbar-border-color, rgba(0, 0, 0, 0.08));\n    border-radius: 10px;\n    padding: 4px;\n    box-shadow:\n      0 1px 3px rgba(0, 0, 0, 0.08),\n      0 4px 12px rgba(0, 0, 0, 0.06);\n    backdrop-filter: blur(8px);\n    -webkit-backdrop-filter: blur(8px);\n  }\n\n  .toolbar-item {\n    align-items: center;\n    background-color: transparent;\n    border: none;\n    border-radius: 6px;\n    color: var(--toolbar-icon-color, #444);\n    cursor: pointer;\n    display: flex;\n    height: 30px;\n    justify-content: center;\n    width: 30px;\n    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;\n    position: relative;\n    flex-shrink: 0;\n  }\n\n  .toolbar-item:hover {\n    background-color: var(--toolbar-hover-bg-color, rgba(0, 0, 0, 0.06));\n    color: var(--toolbar-icon-hover-color, #111);\n    transform: translateY(-1px);\n    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);\n  }\n\n  .toolbar-item:active {\n    transform: translateY(0);\n    box-shadow: none;\n    background-color: var(--toolbar-active-bg-color, rgba(0, 0, 0, 0.1));\n  }\n\n  .toolbar-item:focus-visible {\n    outline: none;\n    box-shadow: 0 0 0 2px var(--button-bg-color, #0066cc);\n  }\n\n  .toolbar-item svg {\n    width: 15px;\n    height: 15px;\n    pointer-events: none;\n    flex-shrink: 0;\n  }\n\n  .toolbar-item[disabled] {\n    opacity: 0.4;\n    cursor: not-allowed;\n    pointer-events: none;\n  }\n\n  /* Tooltip */\n  .toolbar-item::after {\n    content: attr(data-tooltip);\n    position: absolute;\n    bottom: calc(100% + 8px);\n    left: 50%;\n    transform: translateX(-50%);\n    background: var(--tooltip-bg-color, rgba(30, 30, 30, 0.92));\n    color: var(--tooltip-text-color, #fff);\n    padding: 5px 9px;\n    border-radius: 6px;\n    font-size: 11.5px;\n    font-weight: 500;\n    white-space: nowrap;\n    opacity: 0;\n    pointer-events: none;\n    transition: opacity 0.15s ease;\n    z-index: 1000;\n    letter-spacing: 0.01em;\n  }\n\n  .toolbar-item::before {\n    content: '';\n    position: absolute;\n    bottom: calc(100% + 3px);\n    left: 50%;\n    transform: translateX(-50%);\n    border: 4px solid transparent;\n    border-top-color: var(--tooltip-bg-color, rgba(30, 30, 30, 0.92));\n    opacity: 0;\n    pointer-events: none;\n    transition: opacity 0.15s 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: 2px;\n    position: absolute;\n    inset-inline-end: 12px;\n    top: 12px;\n    z-index: 100;\n  }\n",e)}createToolbarItem(e,t,n){let i=this.chartContext.createElement("div");return i.id=e,i.className="toolbar-item",i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.innerHTML=t,n&&(i.setAttribute("data-tooltip",n),i.setAttribute("aria-label",n)),i.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i.click())}),i}render({enableExport:e=!1,enableFitscreen:t=!1,enableZoom:n=!1,onExport:o=i,onFitscreen:r=i,onZoom:s=i}){if(!this.element)return;let a=this.chartContext.querySelector("#toolbar");null==a||a.remove();let l=this.chartContext.createElement("div");if(l.id="toolbar",l.setAttribute("role","toolbar"),l.setAttribute("aria-label","Chart controls"),e){let e=this.createToolbarItem("export",b.export,"Export chart");e.addEventListener("click",()=>{o()}),l.append(e)}
1if(n){let e=this.createToolbarItem("zoom-in",b["zoom-in"],"Zoom in"),t=this.createToolbarItem("zoom-out",b["zoom-out"],"Zoom out");e.addEventListener("click",()=>{s(.1)}),t.addEventListener("click",()=>{s(-.1)}),l.append(e,t)}if(t){let e=this.createToolbarItem("fit-screen",b["fit-screen"],"Fit to screen");e.addEventListener("click",()=>{r()}),l.append(e)}this.element.append(l)}destroy(){let e=this.chartContext.querySelector("#toolbar");null==e||e.remove()}}let w="aria-hidden",C=(e,t="apex-tooltip-container")=>{let n=e.getElementById(t);return n||((n=e.createElement("div")).id=t,n.setAttribute("role","tooltip"),n.setAttribute(w,"true"),e.getAppendContainer().appendChild(n),e.trackTooltip(n)),n},E=(e,t="",n,i="",o=!1)=>{let r=e.getElementById(t);if(!r)return C(e,t),E(e,t,n,i,o);if(n&&i){let t=i.includes("tooltip-content"),s=n.match(/background-color:\s*([^;]+);?/),a=n.match(/color:\s*([^;]+);?/);if(t||!s)r.innerHTML=i;else{let e=s[1],t=a?a[1]:"white";r.innerHTML=`<div class="tooltip-content" style="background-color: ${e}; color: ${t};">${i}</div>`}let l=n+"; display: block !important; visibility: visible !important; opacity: 1 !important;";if(r.setAttribute("style",l),r.classList.add("visible"),r.setAttribute(w,"false"),o&&"undefined"!=typeof window){let t=r.offsetWidth,n=parseFloat(r.style.left),i=e.getChartBounds();if(t>0&&!Number.isNaN(n)&&i.width>0){let e=window.scrollX||document.documentElement.scrollLeft||0,o=i.left+e,s=((e,t,n,i,o=8)=>{if(e+t<=n-o)return e;let r=e-t;return r<i+o?Math.max(i+o,n-t-o):r})(n,t,i.right+e,o);s!==n&&(r.style.left=`${s}px`)}}}else r.removeAttribute("style"),r.classList.remove("visible"),r.setAttribute(w,"true"),r.innerHTML=""},S=(e={})=>{let t=[];for(let n in e){let i=`${n.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}: ${e[n]};`;t.push(i)}return t.join(" ")},A=globalThis.console;function k(e,...t){A.error(e,...t)}let M="APEX-",$=new Date("2027-07-31T00:00:00Z"),L="__apex_license_v1__";function N(){let e=globalThis,t=e[L];return t||(t={key:null,listeners:new Set,result:null},e[L]=t),t}let T=class{static get licenseKey(){return N().key}static set licenseKey(e){N().key=e}static get listeners(){return N().listeners}static get validationResult(){return N().result}static set validationResult(e){N().result=e}static getKey(){return this.licenseKey}static getLicenseStatus(){return this.licenseKey?(this.validationResult=this.validateKey(this.licenseKey),this.validationResult):{expired:!1,signatureVerified:!1,valid:!1}}static isKeyValid(e){return!!e&&this.validateKey(e).valid}static isLicenseValid(){return this.getLicenseStatus().valid}static onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}static setLicense(e){var t,n;if(!e)return this.licenseKey=null,void this.publish({expired:!1,signatureVerified:!1,valid:!1});let i=this.validateKey(e);!i.valid&&e!==this.licenseKey&&(null==(t=this.validationResult)?void 0:t.valid)?(n=`[Apex] Ignoring license key: ${i.message??"it is not valid"} A valid license is already active on this page.`,A.warn(n)):(this.licenseKey=e,this.publish(i),i.valid||k(`[Apex] ${i.message}`))}static validateKey(e){let t=this.parseKey(e),n=this.validateStructure(e,t);if(!n.valid||!(null==t?void 0:t.signature))return n;let i=this.verdicts.get(e);return!1===i?{data:t.data,expired:!1,message:"Invalid license key. The license signature does not verify.",signatureVerified:!0,valid:!1}:(void 0===i&&this.verifySignature(e,t,n),{...n,signatureVerified:!0===i})}static _resetSignatureState(){this.verdicts.clear(),this.verifying.clear(),this.warnedUnverifiable=!1,this.epoch++}static base64ToBytes(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(4*Math.ceil(t.length/4),"="),i=globalThis.atob;if("function"!=typeof i)throw Error("no base64 decoder available");let o=i(n),r=new Uint8Array(o.length);for(let e=0;e<o.length;e++)r[e]=o.charCodeAt(e);return r}static canonicalPayload(e){let t=e.domains&&e.domains.length>0?e.domains.join(","):"";return`v1|${e.issueDate}|${e.expiryDate}|${e.plan}|${t}`}static notify(e){for(let t of this.listeners)try{t(e)}catch{}}static parseKey(e){if("string"!=typeof e||!e.startsWith(M))return null;let t=e.slice(5);if(!t)return null;try{let e=(new TextDecoder).decode(this.base64ToBytes(t)),n=JSON.parse(e);return n.issueDate&&n.expiryDate&&n.plan?{data:{domains:Array.isArray(n.domains)?n.domains:void 0,expiryDate:n.expiryDate,issueDate:n.issueDate,plan:n.plan,valid:!0},signature:"string"==typeof n.sig&&n.sig?n.sig:null}:null}catch{return null}}static publish(e){this.validationResult=e,this.notify(e)}static validateStructure(e,t){let n=e=>({expired:!1,message:e,signatureVerified:!1,valid:!1});if("string"!=typeof e||!e.startsWith(M))return n('Invalid license key format. License key must start with "APEX-".');if(!t)return n("Invalid license key. Unable to decode license data.");let{data:i,signature:o}=t;if(!o&&new Date>=$)return n("This license key is in the old unsigned format, which is no longer accepted. Please request a replacement key.");if(new Date(i.expiryDate)<new Date)return{data:i,expired:!0,message:`License expired on ${i.expiryDate}. Please renew your license.`,signatureVerified:!1,valid:!1};if(i.domains&&i.domains.length>0){let e="undefined"==typeof location?"":location.hostname;if(!i.domains.some(t=>e===t||e.endsWith(`.${t}
1`)))return{data:i,expired:!1,message:`License is not valid for this domain (${e}). Allowed domains: ${i.domains.join(", ")}.`,signatureVerified:!1,valid:!1}}return{data:i,expired:!1,signatureVerified:!1,valid:!0}}static async verifySignature(e,t,n){var i,o;if(this.verifying.has(e)||this.verdicts.has(e))return;this.verifying.add(e);let r=this.epoch,s=null==(i=globalThis.crypto)?void 0:i.subtle;if(!s||0===this.publicKeysSpki.length)return this.verifying.delete(e),void(this.warnedUnverifiable||(this.warnedUnverifiable=!0,o=s?"[Apex] No license signing key is configured in this build, so license signatures cannot be verified.":"[Apex] Web Crypto is unavailable (a secure context is required), so the license signature cannot be verified.",A.warn(o)));let a=(new TextEncoder).encode(this.canonicalPayload(t.data)),l=!1;for(let e of this.publicKeysSpki){try{let n=await s.importKey("spki",this.base64ToBytes(e),{name:"ECDSA",namedCurve:"P-256"},!1,["verify"]);l=await s.verify({hash:"SHA-256",name:"ECDSA"},n,this.base64ToBytes(t.signature),a)}catch{l=!1}if(l)break}if(this.verifying.delete(e),this.epoch!==r)return;if(this.verdicts.set(e,l),l){let t={...n,signatureVerified:!0};return void(this.licenseKey===e?this.publish(t):this.notify(t))}let d="Invalid license key. The license signature does not verify.",h={data:t.data,expired:!1,message:d,signatureVerified:!0,valid:!1};this.licenseKey===e?this.publish(h):this.notify(h),k(`[Apex] ${d}`)}};T.publicKeysSpki=["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQIaK9UMD6n0oR/FIy8QdL0uSzKMQlf1BB+tOrji4/WuHsyRNxeDhVykoSsNURozMi1xhmqWvBH1L//xIfugTPA=="],T.verdicts=new Map,T.verifying=new Set,T.warnedUnverifiable=!1,T.epoch=0;let F=class{static applyStyles(e){Object.assign(e.style,this.CRITICAL_STYLES,{backgroundImage:this.createWatermarkPattern(),backgroundRepeat:"repeat"})}static node(e){return e?e.querySelector(`[${this.WATERMARK_ATTR}]`):null}static add(e,t){return e&&"undefined"!=typeof document?(this.setManaged(e,t),this.paint(e)):null}static exists(e){return!!this.node(e)}static remove(e,t){e&&(this.setManaged(e,t),this.erase(e))}static untrack(e){this.managed.delete(e)}static createWatermarkPattern(){let e=this.WATERMARK_TEXT;return`url("data:image/svg+xml,${encodeURIComponent(`
2      <svg xmlns="http://www.w3.org/2000/svg" width="300" height="200">
3        <text
4          x="50%"
5          y="50%"
6          dominant-baseline="middle"
7          text-anchor="middle"
8          font-family="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Arial, sans-serif"
9          font-size="18"
10          font-weight="600"
11          fill="rgba(134, 134, 134, 0.1)"
12          transform="rotate(-35, 100, 60)"
13        >${e}</text>
14      </svg>
15    `.trim())}")`}static erase(e){var t;null==(t=this.node(e))||t.remove()}static paint(e){let t=this.node(e);return t||((t=document.createElement("div")).setAttribute(this.WATERMARK_ATTR,""),e.appendChild(t)),this.applyStyles(t),"function"==typeof getComputedStyle&&"static"===getComputedStyle(e).position&&(e.style.position="relative"),t}static reconcile(){let e=T.isLicenseValid();for(let t of this.managed)t.isConnected?e?this.erase(t):this.paint(t):this.managed.delete(t)}static setManaged(e,t){!1!==(null==t?void 0:t.manage)?this.track(e):this.managed.delete(e)}static track(e){this.managed.add(e),this.subscribed||(this.subscribed=!0,T.onChange(()=>{this.reconcile()}))}};F.WATERMARK_ATTR="data-apexcharts-watermark",F.WATERMARK_TEXT="APEXCHARTS",F.ATTR="data-apexcharts-watermark",F.CRITICAL_STYLES={bottom:"0",display:"block",left:"0",msUserSelect:"none",opacity:"1",pointerEvents:"none",position:"absolute",right:"0",top:"0",userSelect:"none",visibility:"visible",webkitUserSelect:"none",zIndex:"10000"},F.managed=new Set,F.subscribed=!1;let B=1/45,I={velocity:.01,displacement:.001};function O(e,t){e.value=t,e.target=t,e.velocity=0}function R(e){let t=e.restVelocity??.05,n=e.restDisplacement??.05;return Math.abs(e.velocity)<t&&Math.abs(e.value-e.target)<n}let P={crisp:[210,26],gentle:[120,20],snappy:[320,30]},D=[150,24];function z(e){return P[e??"crisp"]??P.crisp}class W{constructor(e={}){this.mql=null,this.handler=null,this.ownsClass=!1,this.element=e.element??null,this.className=e.className??"",this.onChange=e.onChange,"undefined"!=typeof window&&"function"==typeof window.matchMedia&&(this.mql=window.matchMedia("(prefers-reduced-motion: reduce)"),this.applyClass(this.mql.matches),this.handler=e=>{var t;this.applyClass(e.matches),null==(t=this.onChange)||t.call(this,e.matches)},"function"==typeof this.mql.addEventListener?this.mql.addEventListener("change",this.handler):"function"==typeof this.mql.addListener&&this.mql.addListener(this.handler))}get matches(){var e;return!!(null==(e=this.mql)?void 0:e.matches)||!(!this.className||!this.element)&&this.element.classList.contains(this.className)}dispose(){this.mql&&this.handler&&("function"==typeof this.mql.removeEventListener?this.mql.removeEventListener("change",this.handler):"function"==typeof this.mql.removeListener&&this.mql.removeListener(this.handler),this.mql=null,this.handler=null)}applyClass(e){this.element&&this.className&&(e?this.element.classList.contains(this.className)||(this.element.classList.add(this.className),this.ownsClass=!0):this.ownsClass&&(this.element.classList.remove(this.className),this.ownsClass=!1))}}class j{constructor(e={}){this.objects=new Map,this.frameHandle=null,this.lastTime=null,this.disposed=!1,this.opts=e;let[t,n]=e.spring??z("crisp");this.stiffness=t,this.damping=n,this.rest=e.rest;let i=e.clock??{};this.now=i.now??(()=>"undefined"!=typeof performance?performance.now():Date.now()),this.raf=i.raf??(e=>requestAnimationFrame(e)),this.caf=i.caf??(e=>cancelAnimationFrame(e)),this.reducedMotionOverride=e.reducedMotion,this.reducedMotionWatcher=void 0===e.reducedMotion?new W({element:e.element,className:e.reducedMotionClass,onChange:e=>{e&&null!==this.frameHandle&&this.snapAll()}}):null}get reducedMotion(){var e;return this.reducedMotionOverride??(null==(e=this.reducedMotionWatcher)?void 0:e.matches)??!1}has(e){return this.objects.has(e)}get size(){return this.objects.size}ids(){return this.objects.keys()}dataOf(e){var t;return null==(t=this.objects.get(e))?void 0:t.data}valuesOf(e){let t=this.objects.get(e);return t?H(t):void 0}channelValue(e,t){var n,i;return null==(i=null==(n=this.objects.get(e))?void 0:n.channels.get(t))?void 0:i.value}targetOf(e,t){var n,i;return null==(i=null==(n=this.objects.get(e))?void 0:n.channels.get(t))?void 0:i.target}add(e,t,n,i={}){var o;let r=this.objects.get(e);if(r)return r.data=n,r.delayMs=i.delayMs??0,r.paused=!1,void(r.settled=!1);let[s,a]=i.spring??[this.stiffness,this.damping],l=i.rest??this.rest,d=new Map;for(let e of Object.keys(t))d.set(e,function(e,t,n,i){let o={value:e,velocity:0,target:e,stiffness:t,damping:n};return void 0!==(null==i?void 0:i.velocity)&&(o.restVelocity=i.velocity),void 0!==(null==i?void 0:i.displacement)&&(o.restDisplacement=i.displacement),o}(t[e],s,a,(null==(o=i.channelRest)?void 0:o[e])??l));this.objects.set(e,{id:e,data:n,channels:d,delayMs:i.delayMs??0,pauseOnSettle:i.pauseOnSettle??!1,paused:!1,settled:!1})}setData(e,t){let n=this.objects.get(e);n&&(n.data=t)}retarget(e,t,n={}){let i=this.objects.get(e);if(!i)return;i.paused=!1,i.settled=!1,void 0!==n.delayMs&&(i.delayMs=n.delayMs);let o=this.reducedMotion;for(let e of Object.keys(t)){let n=i.channels.get(e);n&&(o?(O(n,t[e]),i.delayMs=0):n.target=t[e])}}snap(e,t){let n=this.objects.get(e);if(n){for(let e of Object.keys(t)){let i=n.channels.get(e);i&&O(i,t[e])}n.delayMs=0}}pause(e){let t=this.objects.get(e);t&&(t.paused=!0)}remove(e){this.objects.delete(e)}clear(){this.stop(),this.objects.clear()}atRest(){for(let e of this.objects.values())if(!e.paused){if(e.delayMs>0)return!1;for(let t of e.channels.values())if(t.value!==t.target||0!==t.velocity)return!1}return!0}writeAll(e){var t,n;for(let t of this.objects.values())t.paused||e&&!e(t.id,t.data)||this.write(t);null==(n=(t=this.opts).onFrame)||n.call(t)}step(e){var t,n;let i=!0;
15for(let t of Array.from(this.objects.values())){if(t.paused||!this.objects.has(t.id))continue;if(t.delayMs>0){t.delayMs-=1e3*e,i=!1;continue}let n=!0;for(let i of t.channels.values())(function(e,t){if(t<=0)return R(e);let n=t;for(;n>0;){let t=Math.min(n,B),i=-e.stiffness*(e.value-e.target)-e.damping*e.velocity;e.velocity+=i*t,e.value+=e.velocity*t,n-=t}return!!R(e)&&(e.value=e.target,e.velocity=0,!0)})(i,e)||(n=!1);this.write(t),n?t.settled||(t.settled=!0,this.settle(t)||t.pauseOnSettle&&(t.paused=!0)):(t.settled=!1,i=!1)}return null==(n=(t=this.opts).onFrame)||n.call(t),i}start(){if(this.disposed||null!==this.frameHandle)return;this.lastTime=null;let e=t=>{if(this.frameHandle=null,this.disposed)return;if(this.reducedMotion)return void this.snapAll();let n=this.lastTime??t;this.lastTime=t;let i=Math.min(Math.max(0,(t-n)/1e3),.05);this.step(i)?this.lastTime=null:this.frameHandle=this.raf(e)};this.frameHandle=this.raf(e)}settleNow(){this.disposed||this.snapAll()}stop(){null!==this.frameHandle&&(this.caf(this.frameHandle),this.frameHandle=null),this.lastTime=null}get running(){return null!==this.frameHandle}dispose(){var e;this.disposed||(this.disposed=!0,this.stop(),this.objects.clear(),null==(e=this.reducedMotionWatcher)||e.dispose())}get isDisposed(){return this.disposed}snapAll(){var e,t;for(let e of(this.stop(),Array.from(this.objects.values())))if(!e.paused&&this.objects.has(e.id)){for(let t of e.channels.values())O(t,t.target);e.delayMs=0,this.write(e),e.settled||(e.settled=!0,this.settle(e)||e.pauseOnSettle&&(e.paused=!0))}null==(t=(e=this.opts).onFrame)||t.call(e)}settle(e){var t,n;return!0===(null==(n=(t=this.opts).onSettle)?void 0:n.call(t,e.id,e.data))&&(this.objects.delete(e.id),!0)}write(e){var t,n;null==(n=(t=this.opts).write)||n.call(t,e.id,H(e),e.data)}}function H(e){let t={};for(let[n,i]of e.channels)t[n]=i.value;return t}let _="__apexcharts_themes__",G={accent:"--apx-accent",fore:"--apx-fore",grid:"--apx-grid",surface:"--apx-surface"};class q{constructor({chartContext:e,container:t,graph:n}){this.wrapper=null,this.onSegmentClick=null,this.chartContext=e,this.container=t,this.graph=n,this.injectStyles()}injectStyles(){let e=`apextree-breadcrumb-styles-${this.chartContext.getInstanceId()}`;this.chartContext.injectStyles('\n  .apextree-breadcrumb {\n    position: absolute;\n    top: 10px;\n    left: 50%;\n    transform: translateX(-50%);\n    z-index: 90;\n    display: inline-flex;\n    align-items: center;\n    gap: 4px;\n    background: var(--apex-tree-breadcrumb-bg, rgba(255,255,255,0.92));\n    border: 1px solid var(--apex-tree-breadcrumb-border, #E4E7EC);\n    border-radius: 8px;\n    padding: 4px 10px;\n    font-size: 13px;\n    font-family: inherit;\n    color: var(--apex-tree-breadcrumb-color, #344054);\n    max-width: calc(100% - 40px);\n    overflow: hidden;\n    box-shadow: 0 1px 2px rgba(16,24,40,0.06);\n  }\n\n  .apextree-breadcrumb[hidden] {\n    display: none;\n  }\n\n  .apextree-breadcrumb-item {\n    background: none;\n    border: none;\n    padding: 2px 6px;\n    border-radius: 4px;\n    cursor: pointer;\n    color: inherit;\n    font: inherit;\n    white-space: nowrap;\n    max-width: 160px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    transition: background-color 150ms ease, color 150ms ease;\n  }\n\n  .apextree-breadcrumb-item:hover {\n    background: var(--apex-tree-breadcrumb-hover-bg, #F2F4F7);\n    color: var(--apex-tree-breadcrumb-hover-color, #101828);\n  }\n\n  .apextree-breadcrumb-item[aria-current="true"] {\n    color: var(--apex-tree-breadcrumb-current-color, #5C6BC0);\n    font-weight: 600;\n    cursor: default;\n  }\n\n  .apextree-breadcrumb-item[aria-current="true"]:hover {\n    background: transparent;\n  }\n\n  .apextree-breadcrumb-separator {\n    color: var(--apex-tree-breadcrumb-separator, #98A2B3);\n    user-select: none;\n  }\n',e)}render(e){this.destroy();let t=this.chartContext.createElement("nav");t.className="apextree-breadcrumb",t.setAttribute("aria-label",this.graph.getMessages().breadcrumbAriaLabel),t.hidden=!0,this.container.append(t),this.wrapper=t,this.onSegmentClick=e??null}setSelected(e){if(!this.wrapper)return;if(!e)return this.wrapper.hidden=!0,void this.wrapper.replaceChildren();let t=this.buildTrail(e);if(0===t.length)return this.wrapper.hidden=!0,void this.wrapper.replaceChildren();this.wrapper.replaceChildren(),this.wrapper.hidden=!1,t.forEach((e,n)=>{var i,o;let r=n===t.length-1,s=this.chartContext.createElement("button");if(s.type="button",s.className="apextree-breadcrumb-item",s.textContent=this.graph.getNodeLabel(e)||e,s.title=s.textContent,r?(s.setAttribute("aria-current","true"),s.tabIndex=-1):s.addEventListener("click",()=>{var t;this.graph.centerOnNode(e),null==(t=this.onSegmentClick)||t.call(this,e)}),null==(i=this.wrapper)||i.append(s),!r){let e=this.chartContext.createElement("span");e.className="apextree-breadcrumb-separator",e.setAttribute("aria-hidden","true"),e.textContent=this.graph.getIsRtl()?"‹":"›",null==(o=this.wrapper)||o.append(e)}})}buildTrail(e){let t=this.graph.getNodeMap(),n=[],i=e;for(;i&&t[i];)n.unshift(i),i=t[i].parent;return n}destroy(){var e;null==(e=this.wrapper)||e.remove(),this.wrapper=null,this.onSegmentClick=null}}class K{constructor({chartContext:e,container:t,graph:n}){this.overlay=null,this.input=null,this.list=null,this.items=[],this.activeIndex=0,this.isOpen=!1,this.lastFocused=null,this.onDocKeydown=e=>{var t;(null==(t=this.overlay)?void 0:t.isConnected)&&(e.metaKey||e.ctrlKey)&&!e.altKey&&"k"===e.key.toLowerCase()&&(e.preventDefault(),this.toggle())},this.chartContext=e,this.container=t,this.graph=n,this.injectStyles()}injectStyles(){let e=`apextree-command-palette-styles-${this.chartContext.getInstanceId()}`;
15this.chartContext.injectStyles("\n  .apextree-cmdk-overlay {\n    position: absolute;\n    inset: 0;\n    z-index: 200;\n    display: flex;\n    justify-content: center;\n    align-items: flex-start;\n    padding-top: 12vh;\n    background: var(--apex-tree-cmdk-backdrop, rgba(16,24,40,0.32));\n  }\n\n  .apextree-cmdk-overlay[hidden] {\n    display: none;\n  }\n\n  .apextree-cmdk-panel {\n    width: min(440px, calc(100% - 32px));\n    max-height: 60%;\n    display: flex;\n    flex-direction: column;\n    overflow: hidden;\n    background: var(--apex-tree-cmdk-bg, #FFFFFF);\n    border: 1px solid var(--apex-tree-cmdk-border, #E4E7EC);\n    border-radius: 12px;\n    box-shadow: 0 12px 32px rgba(16,24,40,0.24);\n    font-family: inherit;\n    animation: apextree-cmdk-in 120ms ease-out;\n  }\n\n  @keyframes apextree-cmdk-in {\n    from { opacity: 0; transform: translateY(-6px); }\n    to { opacity: 1; transform: translateY(0); }\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    .apextree-cmdk-panel { animation: none; }\n  }\n\n  .apextree-cmdk-input {\n    border: none;\n    border-bottom: 1px solid var(--apex-tree-cmdk-border, #E4E7EC);\n    outline: none;\n    background: transparent;\n    font-size: 15px;\n    color: var(--apex-tree-cmdk-color, #101828);\n    padding: 14px 16px;\n    font-family: inherit;\n  }\n\n  .apextree-cmdk-input::placeholder {\n    color: var(--apex-tree-cmdk-placeholder, #98A2B3);\n  }\n\n  .apextree-cmdk-list {\n    overflow-y: auto;\n    padding: 6px;\n  }\n\n  .apextree-cmdk-item {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n    width: 100%;\n    text-align: start;\n    border: none;\n    background: none;\n    border-radius: 8px;\n    padding: 9px 12px;\n    font: inherit;\n    font-size: 13px;\n    color: var(--apex-tree-cmdk-color, #101828);\n    cursor: pointer;\n  }\n\n  .apextree-cmdk-item.is-active {\n    background: var(--apex-tree-cmdk-active-bg, #EEF2FF);\n    color: var(--apex-tree-cmdk-active-color, #3730A3);\n  }\n\n  .apextree-cmdk-item-label {\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n\n  .apextree-cmdk-item-hint {\n    flex-shrink: 0;\n    font-size: 11px;\n    color: var(--apex-tree-cmdk-hint, #98A2B3);\n    text-transform: uppercase;\n    letter-spacing: 0.04em;\n  }\n\n  .apextree-cmdk-empty {\n    padding: 16px;\n    text-align: center;\n    font-size: 13px;\n    color: var(--apex-tree-cmdk-hint, #98A2B3);\n  }\n",e)}render(){this.destroy();let e=this.graph.getMessages(),t=this.chartContext.createElement("div");t.className="apextree-cmdk-overlay",t.hidden=!0;let n=this.chartContext.createElement("div");n.className="apextree-cmdk-panel",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.setAttribute("aria-label",e.commandPaletteAriaLabel);let i=this.chartContext.createElement("input");i.type="text",i.className="apextree-cmdk-input",i.placeholder=e.commandPalettePlaceholder,i.setAttribute("role","combobox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-controls","apextree-cmdk-list"),i.autocomplete="off";let o=this.chartContext.createElement("div");o.className="apextree-cmdk-list",o.id="apextree-cmdk-list",o.setAttribute("role","listbox"),n.append(i,o),t.append(n),this.container.append(t),this.overlay=t,this.input=i,this.list=o,t.addEventListener("mousedown",e=>{e.target===t&&this.close()}),i.addEventListener("input",()=>this.rebuild(i.value)),i.addEventListener("keydown",e=>this.onInputKeydown(e)),document.addEventListener("keydown",this.onDocKeydown)}toggle(){this.isOpen?this.close():this.open()}open(){this.overlay&&this.input&&(this.lastFocused=document.activeElement??null,this.isOpen=!0,this.overlay.hidden=!1,this.input.value="",this.rebuild(""),this.input.focus())}close(){var e,t;this.overlay&&(this.isOpen=!1,this.overlay.hidden=!0,null==(t=null==(e=this.lastFocused)?void 0:e.focus)||t.call(e))}onInputKeydown(e){"ArrowDown"===e.key?(e.preventDefault(),this.move(1)):"ArrowUp"===e.key?(e.preventDefault(),this.move(-1)):"Enter"===e.key?(e.preventDefault(),this.runActive()):"Escape"===e.key&&(e.preventDefault(),this.close())}move(e){0!==this.items.length&&(this.activeIndex=(this.activeIndex+e+this.items.length)%this.items.length,this.highlightActive())}runActive(){let e=this.items[this.activeIndex];e&&(this.close(),e.run())}rebuild(e){let t=this.graph.getMessages(),n=e.trim(),i=n.toLowerCase(),o=[{hint:"Action",label:t.commandExpandAll,run:()=>
15this.graph.expandAll()},{hint:"Action",label:t.commandCollapseAll,run:()=>this.graph.collapseAll()},{hint:"Action",label:t.commandFitScreen,run:()=>this.graph.fitScreen()}].filter(e=>!i||e.label.toLowerCase().includes(i)),r=n?this.graph.findNodesByQuery(n).slice(0,8).map(e=>({hint:"Node",label:this.graph.getNodeLabel(e)||e,run:()=>this.graph.centerOnNode(e)})):[];this.items=[...r,...o],this.activeIndex=0,this.renderList(t.commandNoResults)}renderList(e){if(this.list){if(this.list.replaceChildren(),0===this.items.length){let t=this.chartContext.createElement("div");return t.className="apextree-cmdk-empty",t.textContent=e,void this.list.append(t)}this.items.forEach((e,t)=>{var n;let i=this.chartContext.createElement("button");i.type="button",i.className="apextree-cmdk-item",i.setAttribute("role","option"),i.dataset.index=String(t);let o=this.chartContext.createElement("span");if(o.className="apextree-cmdk-item-label",o.textContent=e.label,i.append(o),e.hint){let t=this.chartContext.createElement("span");t.className="apextree-cmdk-item-hint",t.textContent=e.hint,i.append(t)}i.addEventListener("mousemove",()=>{this.activeIndex=t,this.highlightActive()}),i.addEventListener("click",()=>{this.activeIndex=t,this.runActive()}),null==(n=this.list)||n.append(i)}),this.highlightActive()}}highlightActive(){this.list&&Array.from(this.list.querySelectorAll(".apextree-cmdk-item")).forEach((e,t)=>{let n=t===this.activeIndex;e.setAttribute("aria-selected",String(n)),e.classList.toggle("is-active",n),n&&"function"==typeof e.scrollIntoView&&e.scrollIntoView({block:"nearest"})})}destroy(){var e;document.removeEventListener("keydown",this.onDocKeydown),null==(e=this.overlay)||e.remove(),this.overlay=null,this.input=null,this.list=null,this.items=[],this.isOpen=!1}}class Z{constructor({chartContext:e,container:t,graph:n}){this.wrapper=null,this.input=null,this.countEl=null,this.matchIds=[],this.chartContext=e,this.container=t,this.graph=n,this.injectStyles()}injectStyles(){let e=`apextree-search-styles-${this.chartContext.getInstanceId()}`;this.chartContext.injectStyles('\n  .apextree-search {\n    position: absolute;\n    top: 10px;\n    inset-inline-start: 10px;\n    z-index: 100;\n    display: inline-flex;\n    align-items: center;\n    gap: 8px;\n    background: var(--apex-tree-search-bg, #FFFFFF);\n    border: 1px solid var(--apex-tree-search-border, #E4E7EC);\n    border-radius: 8px;\n    padding: 4px 8px;\n    box-shadow: 0 1px 2px rgba(16,24,40,0.06), 0 1px 3px rgba(16,24,40,0.1);\n    font-family: inherit;\n  }\n\n  .apextree-search-input {\n    border: none;\n    outline: none;\n    background: transparent;\n    font-size: 13px;\n    color: var(--apex-tree-search-color, #101828);\n    width: 180px;\n    padding: 4px 2px;\n    font-family: inherit;\n  }\n\n  .apextree-search-input::placeholder {\n    color: var(--apex-tree-search-placeholder, #98A2B3);\n  }\n\n  .apextree-search-count {\n    font-size: 12px;\n    color: var(--apex-tree-search-count-color, #667085);\n    min-width: 22px;\n    text-align: end;\n    white-space: nowrap;\n  }\n\n  /* Matched nodes carry a subtle outer glow via the apextree-node element. */\n  [data-apextree-match="true"] foreignObject > div:first-child {\n    box-shadow: 0 0 0 2px var(--apex-tree-search-match, #5C6BC0), 0 4px 6px -1px rgba(16,24,40,0.12) !important;\n  }\n',e)}render(){this.destroy();let e=this.chartContext.createElement("div");e.className="apextree-search",e.setAttribute("role","search");let t=this.graph.getMessages(),n=this.chartContext.createElement("input");n.type="search",n.className="apextree-search-input",n.placeholder=t.searchPlaceholder,n.setAttribute("aria-label",t.searchAriaLabel),n.autocomplete="off";let i=this.chartContext.createElement("span");i.className="apextree-search-count",i.setAttribute("aria-live","polite"),n.addEventListener("input",()=>{this.applyQuery(n.value)}),n.addEventListener("keydown",e=>{"Enter"===e.key?(e.preventDefault(),this.matchIds.length>0&&this.graph.centerOnNode(this.matchIds[0])):"Escape"===e.key&&(e.preventDefault(),n.value="",this.applyQuery(""),n.blur())}),e.append(n,i),this.container.append(e),this.wrapper=e,this.input=n,this.countEl=i}applyQuery(e){let t=this.graph.findNodesByQuery(e);if(this.matchIds=t,this.graph.setSearchHighlight(t),this.countEl){let n=e.trim();this.countEl.textContent=n?this.graph.getMessages().searchMatchCount(t.length):""}}focus(){var e,t;null==(e=this.input)||e.focus(),null==(t=this.input)||t.select()}clear(){this.input&&(this.input.value="",this.applyQuery(""),this.input.blur())}destroy(){var e;null==(e=this.wrapper)||e.remove(),this.wrapper=null,this.input=null,this.countEl=null,this.matchIds=[]}}class V{constructor(){this._nodes=new Map,this._outEdges=new Map,this._inEdges=new Map,this._graphAttrs={}}setDefaultEdgeLabel(e){}setGraph(e){this._graphAttrs={...this._graphAttrs,...e}}graph(){return this._graphAttrs}setNode(e,t){this._nodes.set(e,t),this._outEdges.has(e)||this._outEdges.set(e,new Set),this._inEdges.has(e)||this._inEdges.set(e,new Set)}node(e){return this._nodes.get(e)}nodes(){return Array.from(this._nodes.keys())}setEdge(e,t){var n,i;null==(n=this._outEdges.get(e))||n.add(t),null==(i=this._inEdges.get(t))||i.add(e)}edges(){let e=[];
15return this._outEdges.forEach((t,n)=>{t.forEach(t=>e.push({v:n,w:t}))}),e}children(e){return Array.from(this._outEdges.get(e)??[])}root(){for(let[e,t]of this._inEdges)if(0===t.size)return e;throw Error("TreeGraph: no root node found")}}let Y=-Math.PI/2;class X{constructor(e){var t;this.shortcutHandlers={},this.focusedNodeId=null,this.pendingFocusAfterUpdate=!1,this.typeAheadBuffer="",this.typeAheadTimer=null,this.isKeyboardUser=!1,this.nodeMap=e.nodeMap,this.rootNodeId=e.rootNodeId,this.container=e.container,this.options=e.options,this.onCollapse=e.onCollapse,this.onExpand=e.onExpand,this.onFitScreen=e.onFitScreen,this.onZoom=e.onZoom,this.motionQuery=(null==(t=window.matchMedia)?void 0:t.call(window,"(prefers-reduced-motion: reduce)"))??{matches:!1,addEventListener:()=>{},removeEventListener:()=>{}},this.reducedMotion=this.motionQuery.matches,this.motionChangeHandler=e=>{this.reducedMotion=e.matches},this.motionQuery.addEventListener("change",this.motionChangeHandler),this.boundKeyDown=this.handleKeyDown.bind(this),this.boundPointerDown=()=>{this.isKeyboardUser=!1},this.boundDocKeyDown=e=>{"Tab"===e.key&&(this.isKeyboardUser=!0),this.handleGlobalShortcut(e)},this.boundFocusIn=e=>{if(!this.isKeyboardUser)return;let t=e.target;if(t)if(t!==this.getSvgElement()){if(this.focusedNodeId&&t.getAttribute("data-self")===this.focusedNodeId){let e=this.getGroupElement(this.focusedNodeId);e&&this.applyFocusRing(e)}}else{let e=this.focusedNodeId??this.rootNodeId;this.focusNode(e,!0)}};let n=this.getSvgElement();n&&(n.addEventListener("keydown",this.boundKeyDown),n.addEventListener("pointerdown",this.boundPointerDown),n.addEventListener("focusin",this.boundFocusIn)),document.addEventListener("keydown",this.boundDocKeyDown),this.focusedNodeId=this.rootNodeId}update(e,t){this.nodeMap=e,this.rootNodeId=t,this.focusedNodeId&&!this.nodeMap[this.focusedNodeId]&&(this.focusedNodeId=this.rootNodeId),this.updateTabIndices(),this.pendingFocusAfterUpdate&&(this.pendingFocusAfterUpdate=!1,this.focusedNodeId&&this.focusNode(this.focusedNodeId,this.isKeyboardUser))}getSvgElement(){return this.container.querySelector("svg")}getGroupElement(e){return this.container.querySelector(`[data-self="${e}"]`)}getVisibleNodesInOrder(){let e=[],t=n=>{var i;e.push(n);let o=this.nodeMap[n];if(null==(i=null==o?void 0:o.children)?void 0:i.length)for(let e of o.children)this.nodeMap[e]&&t(e)};return this.nodeMap[this.rootNodeId]&&t(this.rootNodeId),e}updateTabIndices(){this.getVisibleNodesInOrder().forEach(e=>{let t=this.getGroupElement(e);t&&t.setAttribute("tabindex",e===this.focusedNodeId?"0":"-1")})}focusNode(e,t=!1){let n=this.focusedNodeId;if(n&&n!==e){let e=this.getGroupElement(n);e&&(e.setAttribute("tabindex","-1"),this.removeFocusRing(e))}this.focusedNodeId=e;let i=this.getGroupElement(e);i&&(i.setAttribute("tabindex","0"),i.focus({preventScroll:!1}),t||this.isKeyboardUser?this.applyFocusRing(i):this.removeFocusRing(i))}applyFocusRing(e){let t=e.querySelector("foreignObject > div:first-child");t&&(t.style.outline="2px solid #005FCC",t.style.outlineOffset="-2px")}removeFocusRing(e){let t=e.querySelector("foreignObject > div:first-child");t&&(t.style.outline="",t.style.outlineOffset="")}handleKeyDown(e){var t,n,i,o,r,s;this.isKeyboardUser=!0;let a=this.getVisibleNodesInOrder();if(0===a.length)return;let l=this.focusedNodeId??this.rootNodeId,d=a.indexOf(l);if(-1===d)return;let h=this.nodeMap[l];switch(e.key){case"Tab":{e.preventDefault();let t=e.shiftKey?(d-1+a.length)%a.length:(d+1)%a.length;this.focusNode(a[t],!0);break}case"ArrowDown":e.preventDefault(),d<a.length-1&&this.focusNode(a[d+1],!0);break;case"ArrowUp":e.preventDefault(),d>0&&this.focusNode(a[d-1],!0);break;case"ArrowRight":e.preventDefault(),(null==(t=h.hiddenChildren)?void 0:t.length)?(this.pendingFocusAfterUpdate=!0,this.onExpand(l)):(null==(n=h.children)?void 0:n.length)&&this.focusNode(h.children[0],!0);break;case"ArrowLeft":e.preventDefault(),(null==(i=h.children)?void 0:i.length)&&!(null==(o=h.hiddenChildren)?void 0:o.length)?(this.pendingFocusAfterUpdate=!0,this.onCollapse(l)):h.parent&&this.focusNode(h.parent,!0);break;case"Home":e.preventDefault(),this.focusNode(this.rootNodeId,!0);break;case"End":e.preventDefault(),a.length>0&&this.focusNode(a[a.length-1],!0);break;case"Enter":e.preventDefault(),(null==(r=h.hiddenChildren)?void 0:r.length)?(this.pendingFocusAfterUpdate=!0,this.onExpand(l)):(null==(s=h.children)?void 0:s.length)&&(this.pendingFocusAfterUpdate=!0,this.onCollapse(l)),this.options.onNodeClick&&this.options.onNodeClick(h);break;case" ":{e.preventDefault();let t=this.getGroupElement(l);
15if(t){let e="true"===t.getAttribute("aria-selected");t.setAttribute("aria-selected",e?"false":"true")}break}default:1===e.key.length&&/[a-zA-Z]/.test(e.key)&&this.handleTypeAhead(e.key.toLowerCase(),a,d)}}handleTypeAhead(e,t,n){null!==this.typeAheadTimer&&clearTimeout(this.typeAheadTimer),this.typeAheadBuffer+=e,this.typeAheadTimer=setTimeout(()=>{this.typeAheadBuffer="",this.typeAheadTimer=null},500);let i=this.typeAheadBuffer,o=this.options.contentKey,r=(n+1)%t.length;for(let e=0;e<t.length;e++){let n=t[(r+e)%t.length],s=this.nodeMap[n],a=s[o];if(("string"==typeof a?a:String("object"==typeof a&&null!==a&&"name"in a?a.name:s.name??"")).toLowerCase().startsWith(i)){this.focusNode(n,!0);break}}}getFocusedNodeId(){return this.focusedNodeId}setShortcutHandlers(e){this.shortcutHandlers={...this.shortcutHandlers,...e}}isTypingInField(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t||e.isContentEditable}isInContainer(e){return e instanceof Node&&this.container.contains(e)}handleGlobalShortcut(e){if(!e.defaultPrevented){if("Escape"===e.key&&this.isInContainer(e.target)&&this.shortcutHandlers.onClearSearch)return e.preventDefault(),void this.shortcutHandlers.onClearSearch();if(!this.isTypingInField(e.target))return"/"===e.key&&this.shortcutHandlers.onFocusSearch?(e.preventDefault(),void this.shortcutHandlers.onFocusSearch()):void this.handleViewportShortcut(e)}}handleViewportShortcut(e){if(!this.isInContainer(e.target)&&!this.isSvgFocused())return;let t=e.key;("f"===t||"F"===t)&&this.onFitScreen?(e.preventDefault(),this.onFitScreen()):("+"===t||"="===t)&&this.onZoom?(e.preventDefault(),this.onZoom(.1)):("-"===t||"_"===t)&&this.onZoom&&(e.preventDefault(),this.onZoom(-.1))}isSvgFocused(){let e=document.activeElement,t=this.getSvgElement();return null!==t&&(e===t||e instanceof Node&&t.contains(e))}destroy(){let e=this.getSvgElement();e&&(e.removeEventListener("keydown",this.boundKeyDown),e.removeEventListener("pointerdown",this.boundPointerDown),e.removeEventListener("focusin",this.boundFocusIn)),document.removeEventListener("keydown",this.boundDocKeyDown),null!==this.typeAheadTimer&&(clearTimeout(this.typeAheadTimer),this.typeAheadTimer=null),this.motionQuery.removeEventListener("change",this.motionChangeHandler)}}let U=(e,t,n,i,o,r,s,a,l)=>{if(0===n.length)return"";let d=r/2,h=s/2,c=Math.min(35,d-1),u=e<=a,p=u?i-o/2-h:i+o/2+h,g=u?i-o/2:i+o/2,f="top"===l?1:-1,m=n[n.length-1],v=t+d*f,y=[];for(let i of(y.push(`M ${e} ${t}`),y.push(`L ${e} ${v-c*f}`),y.push(`Q ${e} ${v} ${u?e-c:e+c} ${v}`),y.push(`L ${u?p+c:p-c} ${v}`),y.push(`Q ${p} ${v} ${p} ${v+c*f}`),y.push(`L ${p} ${m}`),n))y.push(`M ${p} ${i}`),y.push(`L ${g} ${i}`);return y.join(" ")},Q=(e,t,n)=>{let{x:i,y:o}=e,r=t.x,s=t.y,a=(null==n?void 0:n.x)??i,l=(null==n?void 0:n.y)??o,d=r-i<0?-1:1,h=s-o<0?-1:1,c=Math.abs(r-i)/2<35?Math.abs(r-i)/2:35,u=Math.abs(r-i)/2-(c=Math.abs(s-o)/2<c?Math.abs(s-o)/2:c);return`M ${a} ${l} L ${a} ${o} L ${i} ${o} L ${i+u*d} ${o} C ${i+u*d+c*d} ${o} ${i+u*d+c*d} ${o} ${i+u*d+c*d} ${o+c*h} L ${i+u*d+c*d} ${s-c*h} C ${i+u*d+c*d} ${s} ${i+u*d+c*d} ${s} ${r-u*d} ${s} L ${r} ${s}`},J=(e,t)=>
15`M ${e.x} ${e.y} L ${t.x} ${t.y}`,ee=(e,t,n,i={sy:0})=>{let{x:o}=e,{y:r}=e,s=t.x,a=t.y,l=(null==n?void 0:n.x)??o,d=(null==n?void 0:n.y)??r,h=s-o<0?-1:1,c=a-r<0?-1:1;r+=i.sy;let u=Math.abs(s-o)/2<35?Math.abs(s-o)/2:35;u=Math.abs(a-r)/2<u?Math.abs(a-r)/2:u;let p=Math.abs(a-r)/2-u;return`M ${l} ${d} L ${o} ${d} L ${o} ${r} L ${o} ${r+p*c} C  ${o} ${r+p*c+u*c} ${o} ${r+p*c+u*c} ${o+u*h} ${r+p*c+u*c} L ${o+(Math.abs(s-o)-2*u)*h+u*h} ${r+p*c+u*c} C  ${s} ${r+p*c+u*c} ${s} ${r+p*c+u*c} ${s} ${a-p*c} L ${s} ${a}`},et={bottom:{calculateEdge:ee,edgeMidX:({node:e})=>e.x,edgeMidY:({node:e})=>e.y+e.height/2,edgeParentX:({parent:e})=>e.x,edgeParentY:({parent:e})=>e.y-e.height/2,edgeX:({node:e})=>e.x,edgeY:({node:e})=>e.y+e.height/2,leafGroupX:({node:e})=>e.x-e.width/2,leafGroupY:({node:e,nodeHeight:t})=>e.y-t/2,leafHeight:({childLength:e,childrenSpacing:t,nodeHeight:n})=>(n+t)*e,leafWidth:({nodeWidth:e})=>e,leafX:()=>0,leafY:({childrenSpacing:e,index:t,nodeHeight:n})=>-((n+e)*t)},left:{calculateEdge:Q,edgeMidX:({node:e})=>e.x-e.width/2,edgeMidY:({node:e})=>e.y,edgeParentX:({parent:e})=>e.x+e.width/2,edgeParentY:({parent:e})=>e.y,edgeX:({node:e})=>e.x-e.width/2,edgeY:({node:e})=>e.y,leafGroupX:({node:e})=>e.x-e.width/2,leafGroupY:({node:e})=>e.y-e.height/2,leafHeight:({nodeHeight:e})=>e,leafWidth:({childLength:e,childrenSpacing:t,nodeWidth:n})=>n*e+t*(e-1),leafX:({childrenSpacing:e,index:t,nodeWidth:n})=>(n+e)*t,leafY:()=>0},right:{calculateEdge:Q,edgeMidX:({node:e})=>e.x+e.width/2,edgeMidY:({node:e})=>e.y,edgeParentX:({parent:e})=>e.x-e.width/2,edgeParentY:({parent:e})=>e.y,edgeX:({node:e})=>e.x+e.width/2,edgeY:({node:e})=>e.y,leafGroupX:({node:e})=>e.x,leafGroupY:({node:e})=>e.y-e.height/2,leafHeight:({nodeHeight:e})=>e,leafWidth:({childLength:e,childrenSpacing:t,nodeWidth:n})=>n*e+t*(e-1),leafX:({childrenSpacing:e,index:t,nodeWidth:n})=>-((n+e)*t),leafY:()=>0},top:{calculateEdge:ee,edgeMidX:({node:e})=>e.x,edgeMidY:({node:e})=>e.y-e.height/2,edgeParentX:({parent:e})=>e.x,edgeParentY:({parent:e})=>e.y+e.height/2,edgeX:({node:e})=>e.x,edgeY:({node:e})=>e.y-e.height/2,leafGroupX:({node:e})=>e.x-e.width/2,leafGroupY:({node:e})=>e.y-e.height/2,leafHeight:({childLength:e,childrenSpacing:t,nodeHeight:n})=>(n+t)*e,leafWidth:({nodeWidth:e})=>e,leafX:()=>0,leafY:({childrenSpacing:e,index:t,nodeHeight:n})=>(n+e)*t},radial:{calculateEdge:(e,t)=>J(e,t),edgeMidX:({node:e})=>e.x,edgeMidY:({node:e})=>e.y,edgeParentX:({parent:e})=>e.x,edgeParentY:({parent:e})=>e.y,edgeX:({node:e})=>e.x,edgeY:({node:e})=>e.y,leafGroupX:({node:e})=>e.x-e.width/2,leafGroupY:({node:e})=>e.y-e.height/2,leafHeight:({childLength:e,childrenSpacing:t,nodeHeight:n})=>(n+t)*e,leafWidth:({nodeWidth:e})=>e,leafX:()=>0,leafY:({childrenSpacing:e,index:t,nodeHeight:n})=>(n+e)*t}},en={bottom:"BT",left:"LR",radial:"RADIAL",right:"RL",top:"TB"},ei=e=>String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),eo=e=>{var t,n;return!!((null==(t=e.stats)?void 0:t.length)||e.progress||(null==(n=e.actions)?void 0:n.length)||e.details)},er=(e,{size:t=40,borderColor:n}={})=>e?`<img src="${ei(e)}" alt="" style="width:${t}px;height:${t}px;border-radius:50%;object-fit:cover;flex-shrink:0;${n?`border:2px solid ${ei(n)};`:""}" />`:"",es=e=>e?`<span style="align-self:flex-start;flex-shrink:0;font-size:0.7em;padding:2px 6px;border-radius:999px;background:${ei(e.color??"#EEF2FF")};color:#1E3A8A;font-weight:500;">${ei(e.text)}</span>`:"",ea=(e,{center:t=!1}={})=>(null==e?void 0:e.length)?e.map(e=>`<div style="display:flex;align-items:center;justify-content:${t?"center":"flex-start"};gap:6px;font-size:0.78em;color:#475467;line-height:1.3;margin-top:2px;">${e.icon?`<i class="${ei(e.icon)}" aria-hidden="true" style="flex-shrink:0;"></i>`:""}<span style="min-width:0;overflow:hidden;text-overflow:ellipsis;">${ei(e.label)}</span></div>`).join(""):"",el=e=>e?`<div style="font-weight:600;line-height:1.25;">${ei(e)}</div>`:"",ed=e=>e?`<div style="font-size:0.85em;color:#475467;line-height:1.25;margin-top:2px;">${ei(e)}</div>`:"",eh=e=>e?`<div style="font-size:0.78em;color:#667085;line-height:1.25;margin-top:1px;">${ei(e)}</div>`:"",ec=(e,{center:t=!1}={})=>(null==e?void 0:e.length)?`<div style="display:flex;flex-wrap:wrap;gap:4px;margin-top:6px;justify-content:${t?"center":"flex-start"};">${e.map(e=>`<span style="font-size:0.72em;padding:1px 7px;border-radius:999px;background:#F1F5F9;color:#475467;line-height:1.5;">${ei(e)}</span>`).join("")}</div>`:"",eu=(e,{center:t=!1}={})=>{var n,i;return eo(e)?`<div style="border-top:1px solid #EAECF0;margin-top:8px;padding-top:8px;">${(null==(i=e.stats)?void 0:i.length)?`<div style="display:flex;flex-direction:column;gap:2px;margin-top:6px;">${i.map(e=>`<div style="display:flex;justify-content:space-between;gap:12px;font-size:0.78em;line-height:1.35;"><span style="color:#667085;">${ei(e.label)}</span><span style="color:#101828;font-weight:600;">${ei(e.value)}</span></div>`).join("")}</div>`:""}${(e=>{if(!e)return"";
15let t=Math.max(0,Math.min(100,Number(e.value)||0)),n=ei(e.color??"#5C6BC0");return`<div style="margin-top:8px;">${e.label?`<div style="display:flex;justify-content:space-between;font-size:0.72em;color:#667085;margin-bottom:2px;"><span>${ei(e.label)}</span><span>${t}%</span></div>`:""}<div style="height:6px;border-radius:999px;background:#EEF2F6;overflow:hidden;"><div style="width:${t}%;height:100%;background:${n};border-radius:999px;"></div></div></div>`})(e.progress)}${(n=e.details)?`<div style="font-size:0.78em;color:#475467;line-height:1.4;margin-top:8px;">${ei(n)}</div>`:""}${((e,{center:t=!1}={})=>(null==e?void 0:e.length)?`<div style="display:flex;flex-wrap:wrap;gap:10px;margin-top:8px;justify-content:${t?"center":"flex-start"};">${e.map(e=>e.href?`<a href="${ei(e.href)}" style="font-size:0.78em;color:#5C6BC0;text-decoration:none;font-weight:500;">${ei(e.label)} ›</a>`:`<span style="font-size:0.78em;color:#5C6BC0;font-weight:500;">${ei(e.label)} ›</span>`).join("")}</div>`:"")(e.actions,{center:t})}</div>`:""},ep=e=>`<span role="button" tabindex="-1" data-apextree-card-toggle="" aria-expanded="${e}" style="align-self:center;flex-shrink:0;cursor:pointer;font-size:0.9em;color:#98A2B3;line-height:1;user-select:none;">${e?"▾":"▸"}</span>`,eg=e=>e&&"object"==typeof e?e.name??"":String(e??""),ef={a11y:{enabled:!0,label:"Organizational chart"},autoNodeHeight:{enabled:!1},cardExpansion:{clickToExpand:!1},borderColor:"#E4E7EC",borderColorHover:"#5C6BC0",borderRadius:"10px",borderStyle:"solid",borderWidth:1,canvasStyle:"",cardImagePosition:"left",childrenSpacing:50,collapseBadgeBGColor:"#5C6BC0",collapseBadgeEnabled:!0,collapseBadgeFontColor:"#FFFFFF",collapseBadgeFontSize:"12px",collapseBadgeThreshold:1,countBadgeBGColor:"#EEF2FF",countBadgeDataKey:"count",countBadgeEnabled:!1,countBadgeFontColor:"#3730A3",countBadgeFontSize:"12px",countBadgeSource:"descendants",countBadgeThreshold:1,containerClassName:"root",contentKey:"name",direction:"top",layoutType:"tree",enableAnimation:!0,motion:{spring:"crisp",stagger:"wave"},focus:{clickToFocus:!1,dimOpacity:.7},edgeColor:"#D0D5DD",edgeColorHover:"#5C6BC0",edgeColorMode:"default",edgeFlow:{color:"#5C6BC0",dashLength:8,direction:"toChild",followFocus:!1,gapLength:6,speed:60,width:2},edgeStyle:"orthogonal",edgeWidth:1,enableBreadcrumb:!1,enableExpandCollapse:!0,enableExpandCollapseZoom:!0,maxZoomNodeSpan:8,enableSearch:!1,enableCommandPalette:!1,semanticZoom:{enabled:!1},enableSelection:!1,enableToolbar:!1,enableZoomPan:!0,enableTooltip:!1,expandCollapseButtonBGColor:"#FFFFFF",expandCollapseButtonBorderColor:"#E4E7EC",expandCollapseButtonHaloColor:"",expandCollapseButtonIconColor:"#475467",expandCollapseButtonSize:15,expandCollapseOnNodeClick:!1,externalLabel:{align:"center",collisionStrategy:"none",enabled:!1,offsetX:0,offsetY:0,rotation:0,verticalAlign:"middle"},fontColor:"#101828",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',fontSize:"14px",fontWeight:"400",groupLeafNodes:!1,groupLeafNodesSpacing:10,height:"auto",highlightOnHover:!0,locale:{direction:"ltr"},nodeBGColor:"#FFFFFF",nodeBGColorHover:"#FFFFFF",nodeClassName:"apextree-node",nodeHeight:30,nodeShadow:"0 1px 2px rgba(16,24,40,0.06), 0 1px 3px rgba(16,24,40,0.1)",nodeShadowHover:"0 4px 6px -1px rgba(16,24,40,0.1), 0 2px 4px -2px rgba(16,24,40,0.1)",nodeStyle:"",nodeTemplate:(e,t)=>
15{var n,i;let o=(null==t?void 0:t.lod)??"full",r=e&&"object"==typeof e?e:void 0;return"dot"===o?(n=eg(e),i=null==r?void 0:r.accentColor,`<div style="display:flex;align-items:center;justify-content:center;height:100%;padding:4% 6%;box-sizing:border-box;overflow:hidden;background:${ei(i??"#94A3B8")};"><span style="color:#fff;font-weight:700;font-size:1.7em;line-height:1.1;text-align:center;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">${ei(n)}</span></div>`):"compact"===o?((e,t,n)=>{let i=ei(n??"#94A3B8"),o=t?`<div style="font-size:1em;color:#667085;line-height:1.3;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">${ei(t)}</div>`:"";return`<div style="display:flex;height:100%;overflow:hidden;">
16    <span aria-hidden="true" style="flex:none;width:6%;max-width:8px;background:${i};"></span>
17    <div style="flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:2%;padding:2% 6%;box-sizing:border-box;">
18      <div style="font-weight:700;font-size:1.35em;line-height:1.2;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">${ei(e)}</div>
19      ${o}
20    </div>
21  </div>`})(eg(e),null==r?void 0:r.title,null==r?void 0:r.accentColor):e&&"object"==typeof e&&(e=>{var t,n;return!!(e.imageURL||e.title||e.subtitle||e.badge||e.accentColor||(null==(t=e.meta)?void 0:t.length)||(null==(n=e.tags)?void 0:n.length)||eo(e))})(e)?((e,t)=>{let n=(null==t?void 0:t.expanded)??!1;return"top"===((null==t?void 0:t.cardImagePosition)??"left")?((e,t,n)=>{let i=er(e.imageURL,{size:48,borderColor:e.accentColor}),o=e.badge?`<div style="display:flex;justify-content:center;margin-top:4px;">${es(e.badge)}</div>`:"",r=eo(e)?`<div style="display:flex;justify-content:center;margin-top:4px;">${ep(n)}</div>`:"",s=`<div style="min-width:0;overflow:hidden;width:100%;">${el(e.name)}${ed(e.title)}
21${eh(e.subtitle)}${ea(e.meta,{center:!0})}${ec(e.tags,{center:!0})}${n?eu(e,{center:!0}):""}${o}${r}</div>`;return`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;height:100%;box-sizing:border-box;padding:10px 12px;text-align:center;overflow:hidden;">${"bottom"===t?`${s}${i}`:`${i}${s}`}</div>`})(e,(null==t?void 0:t.direction)??"top",n):((e,t)=>{var n;return`<div style="display:flex;align-items:stretch;height:100%;box-sizing:border-box;text-align:left;overflow:hidden;">${(n=e.accentColor)?`<span aria-hidden="true" style="flex-shrink:0;align-self:stretch;width:4px;background:${ei(n)};"></span>`:""}<div style="display:flex;align-items:center;gap:10px;flex:1;min-width:0;padding:10px 12px;">${er(e.imageURL)}<div style="min-width:0;flex:1;overflow:hidden;">${el(e.name)}${ed(e.title)}${eh(e.subtitle)}${ea(e.meta)}${ec(e.tags)}${t?eu(e):""}</div>${es(e.badge)}${eo(e)?ep(t):""}</div></div>`})(e,n)})(e,t):`<div style='display: flex;justify-content: center;align-items: center; text-align: center; height: 100%;'>${ei(e)}</div>`},nodeWidth:50,onNodeClick:void 0,paddingX:100,paddingY:100,siblingSpacing:50,theme:"light",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%"},em={breadcrumbAriaLabel:"Tree path",commandCollapseAll:"Collapse all",commandExpandAll:"Expand all",commandFitScreen:"Fit to screen",commandNoResults:"No matches",commandPaletteAriaLabel:"Command palette",commandPalettePlaceholder:"Jump to a node or run a command…",collapseNodeLabel:"Collapse node",expandNodeLabel:"Expand node",collapseCardLabel:"Collapse card",expandCardLabel:"Expand card",loadingNodeLabel:"Loading…",nodeAriaLabel:({level:e,name:t,position:n,state:i,total:o})=>`${t}, level ${e}, ${n} of ${o}${i?`, ${i}`:""}`,rootAriaLabel:"Organizational chart",searchAriaLabel:"Search tree nodes",searchMatchCount:e=>`${e} match${1===e?"":"es"}`,searchPlaceholder:"Search nodes…"};function ev(e,t){let n=t=>getComputedStyle(e).getPropertyValue(t).trim(),i=function(e,t){var n;let i=function(e){let t;if(!e||"function"!=typeof getComputedStyle)return{};try{t=getComputedStyle(e)}catch{return{}}if(!t||"function"!=typeof t.getPropertyValue)return{};let n=e=>{let n=t.getPropertyValue(e);return n?String(n).trim():""},i={};for(let[e,t]of Object.entries(G)){let o=n(t);o&&(i[e]=o)}let o=[];for(let e=1;e<=24;e++){let t=n(`--apx-series-${e}`);if(!t)break;o.push(t)}return o.length&&(i.series=o),i}(e),o=t?null==(n=t?function(){let e=globalThis,t=e[_];if(t)return t;let n={};return e[_]=n,n}()[t]??null:null)?void 0:n.tokens:void 0;return o?{...o,...i}:i}(e,t.theme),o=(e,i,o)=>(function({cssVar:e,fallback:t,option:n,token:i}){return e||(n&&n!==t?n:i||(n??""))})({cssVar:n(e),fallback:ef[i],option:t[i],token:o});return{...t,borderColor:o("--apex-tree-node-border","borderColor",i.grid),borderColorHover:o("--apex-tree-node-border-hover","borderColorHover",i.accent),borderRadius:n("--apex-tree-node-border-radius")||t.borderRadius,collapseBadgeBGColor:o("--apex-tree-badge-bg","collapseBadgeBGColor",i.accent),collapseBadgeFontColor:n("--apex-tree-badge-color")||t.collapseBadgeFontColor,collapseBadgeFontSize:n("--apex-tree-badge-font-size")||t.collapseBadgeFontSize,edgeColor:o("--apex-tree-edge-stroke","edgeColor",i.grid),edgeColorHover:o("--apex-tree-edge-stroke-hover","edgeColorHover",i.accent),expandCollapseButtonBGColor:o("--apex-tree-expand-btn-bg","expandCollapseButtonBGColor",i.surface),expandCollapseButtonBorderColor:o("--apex-tree-expand-btn-border","expandCollapseButtonBorderColor",i.grid),expandCollapseButtonHaloColor:n("--apex-tree-expand-btn-halo")||t.expandCollapseButtonHaloColor,expandCollapseButtonIconColor:o("--apex-tree-expand-btn-icon","expandCollapseButtonIconColor",i.accent),fontColor:o("--apex-tree-font-color","fontColor",i.fore),fontFamily:n("--apex-tree-font-family")||t.fontFamily,fontSize:n("--apex-tree-font-size")||t.fontSize,nodeBGColor:o("--apex-tree-node-bg","nodeBGColor",i.surface),nodeBGColorHover:n("--apex-tree-node-bg-hover")||t.nodeBGColorHover}}let ey=(e,t,n,i,o,r="orthogonal",s)=>{if(!(null==e?void 0:e.parent))return null;if("radial"===o){let n={x:e.x,y:e.y},i={x:t.x,y:t.y};
21return s?((e,t,n)=>{let{x:i,y:o}=n,r=Math.hypot(e.x-i,e.y-o),s=Math.hypot(t.x-i,t.y-o),a=Math.atan2(e.y-o,e.x-i),l=s<1?a:Math.atan2(t.y-o,t.x-i);for(;l-a>Math.PI;)l-=2*Math.PI;for(;l-a<-Math.PI;)l+=2*Math.PI;let d=(r+s)/2,h=(e,t)=>`${(i+e*Math.cos(t)).toFixed(3)} ${(o+e*Math.sin(t)).toFixed(3)}`;return`M ${h(r,a)} C ${h(d,a)} ${h(d,l)} ${h(s,l)}`})(n,i,s):J(n,i)}let{calculateEdge:a,edgeMidX:l,edgeMidY:d,edgeParentX:h,edgeParentY:c,edgeX:u,edgeY:p}=et[o],g={x:u({node:e,nodeHeight:i,nodeWidth:n}),y:p({node:e,nodeHeight:i,nodeWidth:n})},f={x:h({nodeHeight:i,nodeWidth:n,parent:t}),y:c({nodeHeight:i,nodeWidth:n,parent:t})};return"straight"===r?J(g,f):"curved"===r?"left"===o||"right"===o?((e,t)=>{let n=(e.x+t.x)/2;return`M ${e.x} ${e.y} C ${n} ${e.y}, ${n} ${t.y}, ${t.x} ${t.y}`})(g,f):((e,t)=>{let n=(e.y+t.y)/2;return`M ${e.x} ${e.y} C ${e.x} ${n}, ${t.x} ${n}, ${t.x} ${t.y}`})(g,f):a(g,f,{x:l({node:e,nodeHeight:i,nodeWidth:n}),y:d({node:e,nodeHeight:i,nodeWidth:n})},{sy:0})},eb=(e,t)=>{let n={...e??{enabled:!1},...t??{}};return n.enabled?n:void 0},ex=(e,t,n,i,o,r)=>{let s,a={"font-family":t.fontFamily??o.fontFamily,"font-weight":t.fontWeight??o.fontWeight},l=t.fontColor??o.fontColor,d=t.fontSize??o.fontSize,h=new g;if(h.tspan(e),null!=r){let e=n/2,o=i/2,l=Math.max(n,i)/2+(t.offsetX??6),d=(r%360+360)%360,h=d>90&&d<270;s={"dominant-baseline":"central",...a,"pointer-events":"none","text-anchor":h?"end":"start",transform:`rotate(${h?r+180:r} ${e} ${o})`,x:h?e-l:e+l,y:o}}else{let e=t.align??"center",o=t.verticalAlign??"middle",r=t.offsetX??0,l=t.offsetY??0,d=t.rotation??0,h=("left"===e?0:"right"===e?n:n/2)+r,c=("top"===o?0:"bottom"===o?i:i/2)+l;s={"dominant-baseline":"top"===o?"auto":"bottom"===o?"hanging":"central",...a,"pointer-events":"none","text-anchor":"left"===e?"end":"right"===e?"start":"middle",x:h,y:c},d&&(s.transform=`rotate(${d} ${h} ${c})`)}return h.attr(s),h.font({fill:l,size:d}),h},ew=(e,t)=>{let n=e[t];if(null==n)return"";if("object"==typeof n){let e=n.name;return null==e?"":String(e)}return String(n)},eC="apextree-edge-flow";function eE(e){return e.classList.contains("apextree-reduced-motion")}function eS(e,t,n,i){if("function"!=typeof e.addEventListener)return;let o=e.getAttribute("stroke")??n,r=null;e.addEventListener("mouseover",()=>{if(e.classList.contains(eC))return;if(eE(i))return void(e.style.stroke=t);if(null==r||r.cancel(),"function"!=typeof e.getTotalLength)return;let n=e.getTotalLength();0!==n&&(e.style.stroke=t,e.style.strokeDasharray=`${n}`,e.style.strokeDashoffset=""+-n,(r=e.animate([{strokeDashoffset:-n},{strokeDashoffset:0}],{duration:400,easing:"ease-out",fill:"forwards"})).finished.then(()=>{e.style.strokeDasharray="",e.style.strokeDashoffset="",null==r||r.cancel(),r=null}).catch(()=>{}))}),e.addEventListener("mouseout",()=>{e.classList.contains(eC)||(null==r||r.cancel(),r=null,e.style.strokeDasharray="",e.style.strokeDashoffset="",e.style.stroke=o)})}let eA=(e,t,n,i,o,r)=>{if(i<=0)return e;let s=r&&r.width>0?r.width:1/0,a=r&&r.height>0?r.height:1/0,{height:l,width:d,x:h,y:c}=e,u=Math.min(t*i,(null==o?void 0:o.width)??1/0,s),p=Math.min(n*i,(null==o?void 0:o.height)??1/0,a);return d<u&&(h-=(u-d)/2,d=u),l<p&&(c-=(p-l)/2,l=p),{height:l,width:d,x:h,y:c}},ek=(e,t,n)=>`translate(${e*(1-n)}, ${t*(1-n)}) scale(${n})`,eM="apextree-expand-btn-bg",e$="apextree-expand-btn-icon",eL="apextree-expand-btn-chrome",eN=(e,t,n,i,o,r,s=!0)=>{if(((e,t,n,i,o,r)=>{if(e.id.endsWith("_leafs"))return;let s=o.querySelector(`#${r} [data-self='${e.id}']`);if(!s)return;let a=s.querySelector(":scope > foreignObject > div");if(!a)return;let l=null==e?void 0:e.options,d=(null==l?void 0:l.nodeShadow)??i.nodeShadow,h=(null==l?void 0:l.nodeShadowHover)??i.nodeShadowHover,c=t?(null==l?void 0:l.borderColorHover)||i.borderColorHover:(null==l?void 0:l.borderColor)||i.borderColor,u=t?(null==l?void 0:l.nodeBGColorHover)||i.nodeBGColorHover:(null==l?void 0:l.nodeBGColor)||i.nodeBGColor;if(a.style.borderWidth=`${(null==l?void 0:l.borderWidth)||i.borderWidth}px`,a.style.borderColor=c,a.style.backgroundColor=u,a.style.boxShadow=t&&n&&h||d||"none",n){let e=parseFloat(s.getAttribute("data-y")??"NaN");if(Number.isFinite(e)){let n=t&&h?-1:0,i=s.querySelector(":scope > foreignObject"),o=s.querySelector(":scope > g.apextree-node-svg");if(i&&i.setAttribute("y",String(e+n)),o){let t=parseFloat(s.getAttribute("data-x")??"0");o.setAttribute("transform",`translate(${t}, ${e+n})`)}}}})(e,n,s,i,o,r),!e.parent)return;let a=`${e.parent}-${e.id}`,l=o.querySelector(`#${r} [id="${a}"]`);if(l instanceof SVGElement&&!l.classList.contains(eC)){let e=l.getAttribute("stroke")??i.edgeColor,t=Number(l.getAttribute("stroke-width"))||1;l.style.stroke=n?i.edgeColorHover:e,l.style.strokeWidth=n?String(t+2):""}eN(t[e.parent],t,n,i,o,r,!1)};function eT(e,t){var n;let i=t[e];if(!(null==(n=null==i?void 0:i.hiddenChildren)?void 0:n.length))return 0;let o=0;return function e(n){var i,r;for(let s of n){o++;let n=t[s];(null==(i=null==n?void 0:n.children)?void 0:i.length)&&e(n.children),(null==(r=null==n?void 0:n.hiddenChildren)?void 0:r.length)&&e(n.hiddenChildren)}}(i.hiddenChildren),o}function eF(e,t){let n=1,i=t[e];for(;null==i?void 0:i.parent;)n++,i=t[i.parent];return n}function eB(e,t,n){var i;let o=t[e],r=null==o?void 0:o.parent,s=r?(null==(i=t[r])?void 0:i.children)??[]:[n],a=s.indexOf(e)+1;return{posinset:a>0?a:1,setsize:s.length}}function eI(e,t,n,i,o){var r,s,a;let l=t[e];if(!l)return e;let d=l[i],h="string"==typeof d?d:String("object"==typeof d&&null!==d&&"name"in d?d.name:l.name??e),c=eF(e,t),{posinset:u,setsize:p}=eB(e,t,n);return o({level:c,name:h,position:u,state:(null==(r=l.children)?void 0:r.length)||(null==(s=l.hiddenChildren)?void 0:s.length)?(null==(a=l.hiddenChildren)?void 0:a.length)?"collapsed":"expanded":void 0,total:p})}function eO(e){return{enabled:(null==e?void 0:e.enabled)??!1,extraHeight:Math.max(0,(null==e?void 0:e.extraHeight)??0),maxHeight:Math.max(0,(null==e?void 0:e.maxHeight)??0),minHeight:Math.max(0,(null==e?void 0:e.minHeight)??0)}}class eR{constructor(){this.box=null,this.cache=new Map}measure(e,t,n,i,o){let r;if("undefined"==typeof document)return null;let s=`${t}|${i.borderWidth}|${i.fontFamily}|${i.fontSize}|${i.fontWeight}|${e}`,a=this.cache.get(s);if(void 0!==a)return a;let l=this.ensureBox(o);l.style.width=`${t}px`,l.style.borderWidth=`${i.borderWidth}px`,l.style.fontFamily=i.fontFamily,l.style.fontSize=i.fontSize,l.style.fontWeight=i.fontWeight,l.innerHTML=e;let d=l.offsetHeight;if(!d||d<=0)return null;let h=(r=d+n.extraHeight,n.minHeight>0&&(r=Math.max(r,n.minHeight)),n.maxHeight>0&&(r=Math.min(r,n.maxHeight)),Math.ceil(r));return this.cache.set(s,h),h}dispose(){var e;null==(e=this.box)||e.remove(),this.box=null,this.cache.clear()}ensureBox(e){var t;if(this.box&&this.box.parentNode===e)return this.box;null==(t=this.box)||t.remove();let n=document.createElement("div");return n.setAttribute("aria-hidden","true"),n.style.cssText="position:absolute;
21left:-99999px;top:0;visibility:hidden;pointer-events:none;box-sizing:border-box;border-style:solid;border-color:transparent;overflow:visible",e.appendChild(n),this.box=n,n}}let eP=[{property:"position",isUnsafe:e=>"relative"===e||"absolute"===e||"fixed"===e||"sticky"===e},{property:"opacity",isUnsafe:e=>""!==e&&1>parseFloat(e)},{property:"transform",isUnsafe:e=>""!==e&&"none"!==e},{property:"filter",isUnsafe:e=>""!==e&&"none"!==e},{property:"z-index",isUnsafe:e=>""!==e&&"auto"!==e},{property:"will-change",isUnsafe:e=>""!==e&&"auto"!==e},{property:"mix-blend-mode",isUnsafe:e=>""!==e&&"normal"!==e},{property:"isolation",isUnsafe:e=>"isolate"===e}],eD=!1;function ez(e,t,n){if(e.setAttribute("data-apex-tree-theme",t),"dark"!==t)return;let i=`apextree-theme-dark-${n.getInstanceId()}`;n.injectStyles('[data-apex-tree-theme="dark"] { \n  --apex-tree-node-bg: #1F2937;\n  --apex-tree-node-bg-hover: #243244;\n  --apex-tree-node-border: #374151;\n  --apex-tree-node-border-hover: #818CF8;\n  --apex-tree-node-border-radius: 10px;\n  --apex-tree-edge-stroke: #4B5563;\n  --apex-tree-edge-stroke-hover: #818CF8;\n  --apex-tree-font-color: #F3F4F6;\n  --apex-tree-expand-btn-bg: #1F2937;\n  --apex-tree-expand-btn-border: #4B5563;\n  --apex-tree-expand-btn-icon: #D1D5DB;\n  --apex-tree-badge-bg: #818CF8;\n  --apex-tree-badge-color: #0F172A;\n  --apex-tree-selection-ring: #818CF8;\n  --apex-tree-search-bg: #1F2937;\n  --apex-tree-search-border: #374151;\n  --apex-tree-search-color: #F3F4F6;\n  --apex-tree-search-placeholder: #6B7280;\n  --apex-tree-search-count-color: #9CA3AF;\n  --apex-tree-search-match: #818CF8;\n  --apex-tree-breadcrumb-bg: rgba(31,41,55,0.94);\n  --apex-tree-breadcrumb-border: #374151;\n  --apex-tree-breadcrumb-color: #D1D5DB;\n  --apex-tree-breadcrumb-hover-bg: #374151;\n  --apex-tree-breadcrumb-hover-color: #F9FAFB;\n  --apex-tree-breadcrumb-current-color: #A5B4FC;\n  --apex-tree-breadcrumb-separator: #6B7280;\n  --apex-tree-cmdk-backdrop: rgba(2,6,23,0.55);\n  --apex-tree-cmdk-bg: #1F2937;\n  --apex-tree-cmdk-border: #374151;\n  --apex-tree-cmdk-color: #F3F4F6;\n  --apex-tree-cmdk-placeholder: #6B7280;\n  --apex-tree-cmdk-hint: #6B7280;\n  --apex-tree-cmdk-active-bg: #374151;\n  --apex-tree-cmdk-active-color: #C7D2FE;\n  --toolbar-bg-color: rgba(31, 41, 55, 0.95);\n  --toolbar-border-color: rgba(255, 255, 255, 0.08);\n  --toolbar-icon-color: #D1D5DB;\n  --toolbar-hover-bg-color: rgba(255, 255, 255, 0.08);\n  --toolbar-icon-hover-color: #F9FAFB;\n  --toolbar-active-bg-color: rgba(255, 255, 255, 0.12);\n  --tooltip-bg-color: rgba(17, 24, 39, 0.95);\n  --tooltip-text-color: #F3F4F6;\n }',i)}function eW(e,t,n,i,o,r){let{bgColor:s,borderColor:a,fontColor:l,fontSize:d,fontFamily:h,maxWidth:c,minWidth:u,offset:p,padding:g,tooltipId:f}=t,m=document.createElement("div");m.style.position="absolute",m.style.visibility="hidden",void 0!==c&&(m.style.width=`${c}px`),m.style.minWidth=`${u}px`,m.style.padding=`${g}px`,m.style.fontSize=d,m.style.fontFamily=h,m.style.wordWrap="break-word",m.style.whiteSpace="normal",m.innerHTML=n,document.body.appendChild(m);let v=m.offsetHeight,y=m.offsetWidth;document.body.removeChild(m);let b=function(e,t,n,i,o){let r=window.innerWidth,s=window.innerHeight,a=window.scrollX||document.documentElement.scrollLeft,l=window.scrollY||document.documentElement.scrollTop,d="top",h=e,c=t-i-o,u=t-l;u-i-o<10&&(d="bottom",c=t+o,u+o+i>s-10&&(d="top",c=l+10));let p=e-a;if(p+n>r-10&&(h=a+r-n-10),p<10&&(h=a+10),"top"===d||"bottom"===d){let t=e-n/2,i=t-a;i>=10&&i+n<=r-10&&(h=t)}return{placement:d,x:h,y:c}}(i,o,y,v,p),x=(({bgColor:e,borderColor:t,fontColor:n,fontFamily:i,fontSize:o,fontWeight:r,maxWidth:s,padding:a,placement:l="top",x:d,y:h})=>{let 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: ${d}px;`),c.push(`top: ${h}px;`),c.push(`data-placement: ${l};`),s&&(c.push(`width: ${s}px;`),c.push(`max-width: ${s}px;`)),t&&c.push(`border: 1px solid ${t};`),n&&c.push(`color: ${n};`),i&&c.push(`font-family: ${i};`),r&&c.push(`font-weight: ${r};`),o&&c.push(`font-size: ${o};`),e&&(c.push(`background-color: ${e};`),c.push("border-radius: 6px;"),c.push("box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);")),void 0!==a&&c.push(`padding: ${a}px;`),c.join(" ")})({bgColor:s,borderColor:a,fontColor:l,fontFamily:h,fontSize:d,fontWeight:"400",maxWidth:c,padding:g,placement:b.placement,x:b.x,y:b.y});E(e,f,`${x} min-width: ${u}px; word-wrap: break-word; white-space: normal; overflow-wrap: break-word; line-height: 1.4;`,n)}let ej="apextree-reduced-motion",eH="\0camera";function e_(e){return e<0?0:e>1?1:e}class eG{constructor(e,t,n,i,o){this.canvas=e,this.onCameraSettled=n,this.edges=new Map,this.cameraTracked=!1,this.scene=new j({spring:i,element:t,reducedMotionClass:ej,clock:o,write:(e,t,n
21)=>this.writeObject(e,t,n),onFrame:()=>this.applyEdges(),onSettle:(e,t)=>this.settle(e,t)})}has(e){let t=this.nodeData(e);return!!t&&!t.exiting}originOf(e){let t=this.scene.valuesOf(e);if(!t||!this.nodeData(e))return null;let{x:n,y:i}=t;return{x:n,y:i}}retargetNode(e,t,n,i,o={}){var r,s;let a=this.nodeData(e);if(a)a.wrapper!==i.wrapper&&a.wrapper.remove(),a.wrapper=i.wrapper,a.foreign=i.foreign,a.decor=i.decor,a.exiting=!1,(this.scene.targetOf(e,"reveal")??1)<1&&(a.revealActive=!0);else{let l=(null==(r=o.seed)?void 0:r.x)??t,d=(null==(s=o.seed)?void 0:s.y)??n;a={id:e,...i,revealActive:!!o.enter,exiting:!1},this.scene.add(e,{reveal:+!o.enter,x:l,y:d},a,{channelRest:{reveal:I},delayMs:o.delayMs??0})}this.scene.retarget(e,{reveal:1,x:t,y:n},{delayMs:o.delayMs??0}),this.scene.start()}exitNode(e,t,n){let i=this.nodeData(e);i&&(i.exiting=!0,i.revealActive=!0,this.scene.retarget(e,{reveal:0,x:t,y:n},{delayMs:0}),this.scene.start())}registerEdge(e){this.edges.set(e.id,e)}retargetCamera(e){if(!this.cameraTracked){let e=this.canvas.viewbox();this.scene.add(eH,{h:e.height,w:e.width,x:e.x,y:e.y},{isCamera:!0},{pauseOnSettle:!0,spring:D}),this.cameraTracked=!0}this.scene.retarget(eH,{h:e.height,w:e.width,x:e.x,y:e.y}),this.scene.start()}unregisterEdge(e){this.edges.delete(e)}syncCameraToCanvas(){if(!this.cameraTracked)return;let e=this.canvas.viewbox();this.scene.snap(eH,{h:e.height,w:e.width,x:e.x,y:e.y}),this.scene.pause(eH)}applyAllImmediate(){this.scene.writeAll((e,t)=>!t.isCamera)}reset(){this.scene.clear(),this.edges.clear(),this.cameraTracked=!1}dispose(){this.scene.dispose(),this.edges.clear(),this.cameraTracked=!1}get reducedMotion(){return this.scene.reducedMotion}get running(){return this.scene.running}nodeData(e){let t=this.scene.dataOf(e);return t&&!t.isCamera?t:null}writeObject(e,t,n){if(n.isCamera){let{h:e,w:n,x:i,y:o}=t;this.canvas.viewbox(`${i} ${o} ${n} ${e}`)}else this.applyNode(n,t)}settle(e,t){return t.isCamera?(this.onCameraSettled(),!1):!!t.exiting&&(this.removeNode(t),!0)}removeNode(e){for(let[t,n]of(e.wrapper.remove(),this.edges))n.childIds?n.parentId!==e.id&&n.childIds.some(t=>t!==e.id&&this.scene.has(t))||(n.pathEl.remove(),this.edges.delete(t)):n.childId!==e.id&&n.parentId!==e.id||(n.pathEl.remove(),this.edges.delete(t))}applyNode(e,t){let{reveal:n,x:i,y:o}=t;e.wrapper.setAttribute("data-x",String(i)),e.wrapper.setAttribute("data-y",String(o)),e.foreign&&(e.foreign.setAttribute("x",String(i)),e.foreign.setAttribute("y",String(o))),e.decor&&e.decor.setAttribute("transform",`translate(${i}, ${o})`),e.revealActive&&this.applyReveal(e,n)}applyReveal(e,t){let n=e_(t);if(n>=.999&&(this.scene.targetOf(e.id,"reveal")??1)>=1)return e.foreign&&(e.foreign.style.clipPath=""),e.decor&&(e.decor.style.opacity=""),void(e.revealActive=!1);let i=e_(2*(1-n)),o=e.exiting?50*i:16*(1-n),r=e.exiting?1-i:n;e.foreign&&(e.foreign.style.clipPath=`inset(${o.toFixed(2)}%)`),e.decor&&(e.decor.style.opacity=String(r))}applyEdges(){for(let e of this.edges.values())this.applyEdge(e)}applyEdge(e){if(e.computeMulti&&e.childIds)return void this.applyBracketEdge(e);let t=this.nodeState(e.childId),n=this.nodeState(e.parentId);if(!t||!n)return;let i=eq(t.values,e.childHalf),o=eq(n.values,e.parentHalf),r=e.compute(i,o);r&&e.pathEl.setAttribute("d",r);let s=t.data.exiting?t:n.data.exiting?n:null;if(s){let t=e_(2*(1-e_(eK(s.values))));e.pathEl.style.opacity=String(1-t)}else e.pathEl.style.opacity&&(e.pathEl.style.opacity="")}applyBracketEdge(e){let t=this.nodeState(e.parentId);if(!t||!e.childIds||!e.computeMulti)return;let n=eq(t.values,e.parentHalf),i=[],o=0,r=1;for(let t of e.childIds){let n=this.nodeState(t);n&&(i.push(eq(n.values,e.childHalf)),n.data.exiting&&(o++,r=Math.min(r,e_(eK(n.values)))))}if(0===i.length)return;let s=e.computeMulti(n,i);s&&e.pathEl.setAttribute("d",s);let a=0;t.data.exiting?a=e_(2*(1-e_(eK(t.values)))):o>0&&o===i.length&&(a=e_(2*(1-r))),a>0?e.pathEl.style.opacity=String(1-a):e.pathEl.style.opacity&&(e.pathEl.style.opacity="")}nodeState(e){let t=this.nodeData(e);if(!t)return null;let n=this.scene.valuesOf(e);return n?{data:t,values:n}:null}}function eq(e,t){let{x:n,y:i}=e;return{x:n+t.w,y:i+t.h}}function eK(e){let{reveal:t}=e;return t}let eZ=`
22@keyframes apextree-edge-flow-anim { to { stroke-dashoffset: var(--apextree-flow-shift, 0); } }
23.${eC} { animation: apextree-edge-flow-anim var(--apextree-flow-dur, 1s) linear infinite; }
24@media (prefers-reduced-motion: reduce) { .${eC} { animation: none !important; } }
25.apextree-reduced-motion .${eC} { animation: none !important; }
26`,eV=(e,t)=>{var n;let i=new Set;for(let o of e){let e=o;for(let o=0;e&&o<1024;o++){let o=null==(n=t[e])?void 0:n.parent;if(!o)break;i.add(`${o}-${e}`),e=o}}return i};function eY(e){let t=[];for(let n of Array.from(e.children))"path"===n.tagName.toLowerCase()&&n.id&&t.pu
26sh(n);return t}class eX{constructor(e,t,n,i){this.chartContext=e,this.getMainGroup=t,this.getNodeMap=n,this.getOptions=i,this.targets=[],this.edgeIds=new Set,this.injected=!1}getTargets(){return[...this.targets]}setPath(e){this.targets=e.filter(Boolean),0!==this.targets.length?(this.edgeIds=eV(this.targets,this.getNodeMap()),this.apply()):this.clear()}clear(){this.targets=[],this.edgeIds=new Set;let e=this.getMainGroup();if(e)for(let t of eY(e))this.unstyle(t)}reapply(){0!==this.targets.length&&(this.edgeIds=eV(this.targets,this.getNodeMap()),this.apply())}apply(){let e=this.getMainGroup();if(!e)return;this.ensureKeyframes();let t=this.resolve();for(let n of eY(e))this.edgeIds.has(n.id)?this.styleActive(n,t):this.unstyle(n)}resolve(){let e=this.getOptions().edgeFlow??{};return{color:e.color??"#5C6BC0",dashLength:e.dashLength??8,direction:e.direction??"toChild",gapLength:e.gapLength??6,speed:e.speed??60,width:e.width??2}}styleActive(e,t){e.classList.add(eC),e.style.stroke=t.color,e.style.strokeWidth=String(t.width),e.style.strokeDasharray=`${t.dashLength} ${t.gapLength}`;let n=t.dashLength+t.gapLength,i="toChild"===t.direction?n:-n;e.style.setProperty("--apextree-flow-shift",String(i)),e.style.setProperty("--apextree-flow-dur",(t.speed>0?n/t.speed:0)+"s")}unstyle(e){e.classList.contains(eC)&&(e.classList.remove(eC),e.style.stroke="",e.style.strokeWidth="",e.style.strokeDasharray="",e.style.removeProperty("--apextree-flow-shift"),e.style.removeProperty("--apextree-flow-dur"))}ensureKeyframes(){this.injected||(this.chartContext.injectStyles(eZ,"apextree-edge-flow-keyframes"),this.injected=!0)}}class eU{constructor(e,t,n){this.getContainer=e,this.getNodeMap=t,this.getMessages=n,this.expanded=new Set}isExpanded(e){return this.expanded.has(e)}getExpanded(){return[...this.expanded]}expand(e){return!(!this.getNodeMap()[e]||this.expanded.has(e))&&(this.expanded.add(e),!0)}collapse(e){return this.expanded.delete(e)}toggle(e){return!!this.getNodeMap()[e]&&(this.expanded.has(e)?this.expanded.delete(e):this.expanded.add(e),!0)}setExpanded(e){let t=this.getNodeMap();this.expanded=new Set(e.filter(e=>t[e]))}clear(){this.expanded.clear()}reapply(){let e=this.getContainer();if(!e)return;let t=this.getMessages();for(let n of Array.from(e.querySelectorAll("g[data-self]"))){let e=n.getAttribute("data-self");if(!e)continue;let i=this.expanded.has(e);n.setAttribute("data-card-expanded",String(i));let o=n.querySelector("[data-apextree-card-toggle]");o&&(o.setAttribute("aria-expanded",String(i)),o.setAttribute("aria-label",i?t.collapseCardLabel:t.expandCardLabel))}}}let eQ="data-apextree-dim-overlay",eJ="data-apextree-focused";function e0(e){let t=[],n=[],i=null;for(let o of Array.from(e.children)){let e=o.tagName.toLowerCase();"g"===e&&o.getAttribute("data-self")?t.push(o):"path"===e&&o.id?n.push(o):"rect"===e&&o.hasAttribute(eQ)&&(i=o)}return{groups:t,overlay:i,paths:n}}class e1{constructor(e,t,n,i,o){this.getContainer=e,this.getMainGroup=t,this.getNodeMap=n,this.getOptions=i,this.onDismiss=o,this.focusedId=null,this.onKeydown=e=>{"Escape"===e.key&&this.focusedId&&(e.stopPropagation(),this.onDismiss())}}getFocusedId(){return this.focusedId}brightSetOf(e){var t,n;let i=this.getNodeMap(),o=new Set,r=e;for(let e=0;r&&e<1024;e++)o.add(r),r=null==(t=i[r])?void 0:t.parent;let s=[e];for(;s.length;){let e=s.shift();for(let t of(o.add(e),i[`${e}_leafs`]&&o.add(`${e}_leafs`),(null==(n=i[e])?void 0:n.children)??[]))o.has(t)||s.push(t)}return o}focus(e){let t=this.getMainGroup();if(!t)return!1;let n=t.querySelector(`g[data-self="${e}"]`);if(!n||!this.getNodeMap()[e])return!1;this.focusedId=e,document.addEventListener("keydown",this.onKeydown);let i=this.brightSetOf(e);this.ensureOverlay(t);let{groups:o,paths:r}=e0(t);for(let e of r)t.insertBefore(e,t.firstChild);for(let e of r){let n=e.id.indexOf("-");n<=0||i.has(e.id.slice(0,n))&&i.has(e.id.slice(n+1))&&t.appendChild(e)}for(let e of o){e.removeAttribute(eJ);let n=e.getAttribute("data-self");n&&i.has(n)&&t.appendChild(e)}return n.setAttribute(eJ,"true"),!0}clear(){this.focusedId=null,document.removeEventListener("keydown",this.onKeydown);let e=this.getMainGroup();if(!e)return;let{groups:t,overlay:n,paths:i}=e0(e);for(let e of(null==n||n.remove(),t))e.removeAttribute(eJ);for(let t of i)e.insertBefore(t,e.firstChild)}reapply(){if(!this.focusedId)return!1;let e=this.focusedId;return!!this.focus(e)||(this.focusedId=null,this.clear(),!1)}ensureOverlay(e){var t;let n=e0(e).overlay;n||((n=document.createElementNS("http://www.w3.org/2000/svg","rect")).setAttribute(eQ,"true"),n.setAttribute("x",String(-1e5)),n.setAttribute("y",String(-1e5)),n.setAttribute("width",String(2e5)),n.setAttribute("height",String(2e5)),n.style.pointerEvents="none",this.getContainer().classList.contains("apextree-reduced-motion")||(n.style.transition="fill-opacity 0.22s ease-out",n.setAttribute("fill-opacity","0"),n.getBoundingClientRect())),e.appendChild(n);let i=this.getOptions();return n.setAttribute("fill",function(e,t){let n=e;for(let e=0;n&&e<32;e++){let e=getComputedStyle(n).backgroundColor;if(e&&"transparent"!==e&&"rgba(0, 0, 0, 0)"!==e)return e;n=n.parentElement}return"dark"===t?"#0F172A":"#FFFFFF"}(this.getContainer(),i.theme)),n.setAttribute("fill-opacity",String((null==(t=i.focus)?void 0:t.dimOpacity)??.7)),n}}class e2{constructor(e,t,n,i,o,r=!0){this.chartContext=o,this.width=t,this.height=n,this.containerElement=e,e.innerHTML="";let s=new y(document.createElementNS(a,"svg")).addTo(e).size("100%","100%").viewbox(`0 0 ${t} ${n}`).attr({style:i});r&&s.panZoom({zoomFactor:.2,zoomMin:.1}),this.canvas=s}static drawCircle(e={}){let t=new u;return t.attr(e),t}static drawGroup(e=0,t=0,n,i){let o=new h;
26return o.attr({"data-parent":i,"data-self":n,transform:`translate(${e}, ${t})`}),o}static drawNodeWrapper(e,t,n,i){let o=new h;return o.attr({"data-parent":i,"data-self":n,"data-x":e,"data-y":t}),o}static drawPath(e,{borderColor:t=ef.borderColor,id:n=""}={}){let i=new p({d:e});return i.id(n),i.fill("none").stroke({color:t,width:1}),i}static drawRect({color:e="#fefefe",height:t=0,opacity:n=1,radius:i=0,width:o=0,x1:r,y1:s}={}){let a=new c;return a.attr({height:t,opacity:n,rx:i,ry:i,width:o,x:r??void 0,y:s??void 0}),a.fill(e),a}static drawSvgIcon(e){let t=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;return t.setAttribute("pointer-events","none"),new d(t)}static drawTemplate(e,{nodeHeight:t,nodeWidth:n}={}){let i=new f({height:t,width:n,overflow:"visible"}),o=document.createElement("div");return o.innerHTML=e,o.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(e=>{var t;if(eD)return;let n=(e=>{let t=[],n=new Set;for(let i of[e,...Array.from(e.querySelectorAll("*"))]){let e=i.style;if(e)for(let{property:i,isUnsafe:o}of eP){if(n.has(i))continue;let r=e.getPropertyValue(i).trim();r&&o(r)&&(n.add(i),t.push({property:i,value:r}))}}return t})(e);if(0===n.length||(eD=!0,"undefined"==typeof console))return;let i=n.map(e=>`  • ${e.property}: ${e.value}`).join("\n");null==(t=console.warn)||t.call(console,"[ApexTree] Your nodeTemplate uses CSS that Safari mis-paints inside an SVG <foreignObject> when the tree is zoomed — cards can render blank or shift to the canvas origin (Chromium and Firefox are unaffected). Found:\n"+i+"\nPrefer flex/grid layout and DOM order for stacking; dim text with color/rgba instead of opacity, and overlap avatars with negative margins instead of position:absolute. See https://github.com/apexcharts/apextree#custom-template")})(o),i.add(o),i}static drawText(e="",{dx:t,dy:n,x:i,y:o}){let r=new g;return r.font({fill:"#f06"}),r.tspan(e),void 0!==i&&void 0!==o&&r.move(i,o),void 0!==t&&void 0!==n&&r.attr({dx:t,dy:n}),r}add(e){this.canvas.add(e)}clear(){this.canvas.clear().viewbox(`0 0 ${this.width} ${this.height}`)}exportToSvg(){new s(this.canvas,"apextree").exportToSVG()}resetViewBox(){this.canvas.viewbox(`0 0 ${this.width} ${this.height}`)}updateViewBox(e,t,n,i){this.canvas.viewbox(`${e} ${t} ${n} ${i}`)}resetPanZoomBase(){this.canvas.resetPanZoomBase()}zoom(e){let t=this.canvas.zoom()+e;t>=.1&&this.canvas.zoom(t)}getContainerElement(){return this.containerElement}setTreeA11yAttributes(e,t=!1){this.canvas.attr({"aria-label":e,"aria-multiselectable":"multi"===t?"true":"false",role:"tree"});let n=`apextree-a11y-focus-${this.chartContext.getInstanceId()}`;this.chartContext.injectStyles('svg[role="tree"] { user-select: none; }\n[data-self]:focus { outline: none; }\n[data-self][aria-selected="true"] > foreignObject > div:first-child {\n  box-shadow: 0 0 0 2px var(--apex-tree-selection-ring, #5C6BC0), 0 4px 6px -1px rgba(16,24,40,0.12) !important;\n}\n@media (forced-colors: active) {\n  [data-self]:focus-visible > foreignObject > div:first-child {\n    outline: 2px solid Highlight !important;\n    outline-offset: -2px !important;\n  }\n  [data-self][aria-selected="true"] > foreignObject > div:first-child {\n    outline: 2px solid SelectedItem !important;\n    outline-offset: -2px !important;\n  }\n}',n)}}let e5=new Set(["class","data-depth","data-parent","data-self","data-sig","data-x","data-y","transform"]);class e4{constructor(e,t,n,i,o,r,s=new Map,a=em,l=!1){this.chartContext=i,this.callbacks=r,this.hiddenLabelIds=new Set,this.graph=e,this.nodeMap=t,this.renderOptions=n,this.rootNodeId=o,this.depthMap=s,this.messages=a,this.isRtl=l}update(e,t,n,i,o,r,s){this.graph=e,this.nodeMap=t,this.renderOptions=n,this.rootNodeId=i,this.depthMap=o,this.messages=r,this.isRtl=s,this.hiddenLabelIds=this.computeHiddenLabels()}computeHiddenLabels(){var e,t,n;let i=null==(e=this.renderOptions.externalLabel)?void 0:e.collisionStrategy,o=this.radialCenter();if(!o||!i||"none"===i)return new Set;let r=1.15*(parseFloat((null==(t=this.renderOptions.externalLabel)?void 0:t.fontSize)??this.renderOptions.fontSize)||12),s=[];for(let e of this.graph.nodes()){if(e.endsWith("_leafs"))continue;let t=this.graph.node(e);null!=(null==t?void 0:t.x)&&null!=(null==t?void 0:t.y)&&eb(this.renderOptions.externalLabel,null==(n=t.options)?void 0:n.externalLabel)&&ew(t,this.renderOptions.contentKey)&&s.push({id:e,isLeaf:0===this.graph.children(e).length,x:t.x,y:t.y})}return((e,t,n,i)=>{let o=new Set,r=e.filter(e=>!("leaves"===i&&!e.isLeaf&&(o.add(e.id),1))),s=new Map;for(let e of r){let n=e.x-t.x,i=e.y-t.y,o=Math.hypot(n,i);if(o<1)continue;let r=Math.round(o),a=(Math.atan2(i,n)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),l=s.get(r);l?l.push({angle:a,id:e.id}):s.set(r,[{angle:a,id:e.id}])}for(let[e,t]of s){if(t.length<2)continue;t.sort((e,t)=>
26e.angle-t.angle);let i=[],r=-1/0;for(let{angle:s,id:a}of t)(s-r)*e>=n?(i.push(s),r=s):o.add(a);if(i.length>1&&(2*Math.PI-i[i.length-1]+i[0])*e<n){let e=i[i.length-1],n=t.find(t=>t.angle===e);n&&o.add(n.id)}}return o})(s,o,r,i)}static refsOf(e){let t=null,n=null;for(let i of Array.from(e.children)){let e=i.tagName.toLowerCase();t||"foreignobject"!==e?n||"g"!==e||"apextree-node-svg"!==i.getAttribute("class")||(n=i):t=i}return{wrapper:e,foreign:t,decor:n}}signatureOf(e){var t,n;let i=this.nodeMap[e];if(!i)return"";let o=function(e,t){let n;if("string"==typeof e)return e;if(null==e)return t;if("object"!=typeof e)return String(e);try{n=JSON.stringify(e)??""}catch{return t}let i=0x811c9dc5;for(let e=0;e<n.length;e++)i^=n.charCodeAt(e),i=Math.imul(i,0x1000193);return(i>>>0).toString(36)}(i[this.renderOptions.contentKey],i.name),r=(null==(t=i.children)?void 0:t.length)??0,s=(null==(n=i.hiddenChildren)?void 0:n.length)??0;return`${o}|${r}|${s}|${this.renderOptions.collapseBadgeEnabled&&s?eT(e,this.nodeMap):0}|${this.renderOptions.countBadgeEnabled?this.getCountBadgeValue(i):0}|${+!!this.callbacks.isCardExpanded(e)}|${+!!this.callbacks.isLazyUnloaded(e)}|${+!!this.callbacks.isNodeLoading(e)}|${this.callbacks.getLodTier()}`}renderEdge(e,t){var n,i,o;let r,s=this.graph.node(e.w),a=this.graph.node(e.v),{childrenSpacing:l,edgeColor:d,edgeColorMode:h,edgeStyle:c,groupLeafNodesSpacing:u,nodeHeight:p,nodeWidth:g,siblingSpacing:f}=this.renderOptions,m=this.renderOptions.direction;if(e.w.endsWith("_leafs")&&("top"===m||"bottom"===m)){let t=(null==(i=null==(n=this.nodeMap[e.v])?void 0:n.children)?void 0:i.length)??0;r=((e,t,n,i,o,r,s,a,l,d)=>{let h=et[d],c="top"===d?t.y+t.height/2:t.y-t.height/2,u=e.x,p=h.leafGroupY({node:e,nodeHeight:r}),g=Array.from({length:i},(e,t)=>p+h.leafY({childrenSpacing:s,index:t,nodeWidth:o,nodeHeight:r})+r/2);return U(t.x,c,g,u,o,a,l,n.x,d)})(s,a,this.graph.node(this.rootNodeId),t,g,p,u,l,f,m)}else r=ey(s,a,g,p,m,c,this.radialCenter());if(!r)return null;let v=e.w.endsWith("_leafs")?this.nodeMap[e.v]:s,y="node"===h?(null==(o=null==v?void 0:v.options)?void 0:o.borderColor)??this.renderOptions.borderColor:d,b=e2.drawPath(r,{borderColor:y,id:`${e.v}-${e.w}`}),x=b.node;return x.setAttribute("data-edge-parent",e.v),x.setAttribute("data-edge-child",e.w),t.add(b),x}renderGroupedLeafNodes(e,t){t.add(this.buildGroupedLeafNodes(e))}buildGroupedLeafNodes(e){let t=this.graph.node(e),n=this.renderOptions,{direction:i}=n,{nodeHeight:o,nodeWidth:r}=n,s=et[i].leafGroupX({node:t,nodeHeight:o,nodeWidth:r}),a=et[i].leafGroupY({node:t,nodeHeight:o,nodeWidth:r}),l=e2.drawNodeWrapper(s,a,t.id,t.parent),d=this.depthMap.get(e)??0;return l.attr("data-depth",d),t.children.forEach((e,t)=>{this.renderLeafNode(e,l,t,s,a)}),l}renderLeafNode(e,t,n,i=0,o=0){var r,s,a;let l=this.nodeMap[e],d=this.renderOptions,{containerClassName:c,contentKey:u,direction:p,enableTooltip:g,groupLeafNodesSpacing:f,highlightOnHover:m,nodeTemplate:v,tooltipTemplate:y}=d,{borderColor:b,borderStyle:x,borderRadius:w,borderWidth:C,fontColor:A,fontFamily:k,fontSize:M,fontWeight:$,nodeBGColor:L,nodeClassName:N,nodeHeight:T,nodeStyle:F,nodeWidth:B,tooltipBGColor:I,tooltipBorderColor:O,tooltipFontColor:R,tooltipFontSize:P,tooltipId:D,tooltipMaxWidth:z,tooltipMinWidth:W,tooltipOffset:j,tooltipPadding:H}={...d,...l.options},_=i+et[p].leafX({childrenSpacing:f,index:n,nodeHeight:T,nodeWidth:B}),G=o+et[p].leafY({childrenSpacing:f,index:n,nodeHeight:T,nodeWidth:B}),q=e2.drawNodeWrapper(_,G,l.id,l.parent),K=this.depthMap.get(e)??0;q.attr("data-depth",K);let Z=eb(d.externalLabel,null==(r=l.options)?void 0:r.externalLabel),V=l[u],Y=Z?"":v(V,{direction:d.direction,cardImagePosition:d.cardImagePosition,expanded:!1,lod:this.callbacks.getLodTier()}),X=e2.drawTemplate(Y,{nodeHeight:T,nodeWidth:B});X.attr({x:_,y:G});let U=S({color:A,fontFamily:k,fontSize:M,fontWeight:$}),{nodeShadow:Q}={...d,...l.options},J=S({backgroundColor:L,borderColor:b,borderRadius:w,borderStyle:x,borderWidth:`${C}px`,boxShadow:Q||"none",boxSizing:"border-box",height:"100%",overflow:"hidden",transition:"box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease, transform 180ms ease"})+(F?"; "+F:"");null==(s=X.first())||s.attr("style",J),X.attr("class",N),q.attr("style",U),q.add(X);let ee=new h;if(ee.attr({class:"apextree-node-svg",transform:`translate(${_}, ${G})`}),Z&&!this.hiddenLabelIds.has(e)){let e=ew(l,u);if(e){let t=ex(e,Z,B,T,{fontColor:A,fontFamily:k,fontSize:M,fontWeight:$});ee.add(t)}}if(!1!==(null==(a=d.a11y)?void 0:a.enabled)){let e=eF(l.id,this.nodeMap),{posinset:t,setsize:n}=eB(l.id,this.nodeMap,this.rootNodeId),i=eI(l.id,this.nodeMap,this.rootNodeId,u,this.messages.nodeAriaLabel);q.attr({"aria-label":i,"aria-level":e,"aria-posinset":t,"aria-selected":"false","aria-setsize":n,role:"treeitem",tabindex:-1}),q.on("click",()=>{this.callbacks.onFocusNode(l.id)})}if(m&&(q.on("mouseover",e=>{let{self:t}=e.currentTarget.dataset,n=t?this.nodeMap[t]:void 0;n&&eN(n,this.nodeMap,!0,d,this.chartContext,c)}),q.on("mouseout",e=>{let{self:t}=e.currentTarget.dataset,n=t?this.nodeMap[t]:void 0;n&&eN(n,this.nodeMap,!1,d,this.chartContext,c)})),g){let e=y?y(l[u]):Y;q.on("mousemove",t=>{let{pageX:n,pageY:i}=t;eW(this.chartContext,{bgColor:I,borderColor:O,fontColor:R,fontSize:P,fontFamily:k,maxWidth:z,minWidth:W,offset:j,padding:y?0:H,tooltipId:D},e,n,i,this.callbacks.getContainerElement())}),q.on("mouseout",e=>{var t;"svg"===(null==(t=e.relatedTarget)?void 0:t.tagName)&&E(this.chartContext,D)})}if(d.onNodeClick){let{onNodeClick:e}=d;q.on("click",()=>{e(this.nodeMap[l.id]??l)})}q.add(ee),this.applyNodeWrapper(q,l.id),q.node.setAttribute("data-sig",this.signatureOf(l.id)),t.add(q)}renderNode(e,t){let n=this.createWrapper(e);this.renderContentInto(n,e),n.node.setAttribute("data-sig",this.signatureOf(e)),t.add(n)}createWrapper(e){let t=this.graph.node(e),{fontColor:n,fontFamily:i,fontSize:o,fontWeight:r}={...this.renderOptions,...t.options},{height:s,width:a,x:l,y:d}=t,h=e2.drawNodeWrapper(l-a/2,d-s/2,t.id,t.parent),c=this.depthMap.get(e)??0;h.attr("data-depth",c);let u=S({color:n,fontFamily:i,fontSize:o,fontWeight:r});return h.attr("style",u),this.applyBaseAria(h,t.id),this.bindWrapperInteractions(h,t.id),this.applyNodeWrapper(h,t.id),h}applyNodeWrapper(e,t){var n,i,o,r;let s=this.nodeMap[t];if(!s)return;let a=(null==(n=s.options)?void 0:n.nodeWrapper)??this.renderOptions.nodeWrapper;if(!a)return;let l=a({collapsed:!!(null==(i=s.hiddenChildren)?void 0:i.length),data:s[this.renderOptions.contentKey],depth:this.depthMap.get(t)??0,expanded:this.callbacks.isCardExpanded(t),hasChildren:!!((null==(o=s.children)?void 0:o.length)||(null==(r=s.hiddenChildren)?void 0:r.length)),id:t,name:s.name});if(!l)return;let d=e.node;if(l.className)for(let e of l.className.split(/\s+/))e&&d.classList.add(e);if(l.attributes)for(let[e,t]of Object.entries(l.attributes))e5.has(e)||d.setAttribute(e,String(t))}renderContentInto(e,t){var n,i,o,r,s,a;let l=this.graph.node(t),d=this.renderOptions,c=e.node;for(let e of Array.from(c.children)){let t=e.tagName.toLowerCase();("foreignobject"===t||"g"===t&&"apextree-node-svg"===e.getAttribute("class"))&&e.remove()}let{borderRadius:u,contentKey:p,enableExpandCollapse:g,nodeTemplate:f}=d,{borderColor:m,borderStyle:v,borderWidth:y,fontColor:b,fontFamily:x,fontSize:w,fontWeight:C,nodeBGColor:E,nodeClassName:A,nodeStyle:k}={...d,...l.options},{height:M,width:$,x:L,y:N}=l,T=L-$/2,F=N-M/2,B=eb(d.externalLabel,null==(n=l.options)?void 0:n.externalLabel),I=l[p],O=B?"":f(I,{direction:d.direction,cardImagePosition:d.cardImagePosition,expanded:this.callbacks.isCardExpanded(t),lod:this.callbacks.getLodTier()}),R=e2.drawTemplate(O,{nodeHeight:M,nodeWidth:$});R.attr({x:T,y:F});let P=this.callbacks.isLazyUnloaded(t),D=this.callbacks.isNodeLoading(t),z=!!((null==(i=l.children)?void 0:i.length)||(null==(o=l.hiddenChildren)?void 0:o.length))||P,W=d.expandCollapseOnNodeClick&&z,{nodeShadow:j}={...d,...l.options},H=S({backgroundColor:E,borderColor:m,borderRadius:u,borderStyle:v,borderWidth:`${y}px`,boxShadow:j||"none",boxSizing:"border-box",cursor:W?"pointer":"",height:"100%",overflow:"hidden",transition:"box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease, transform 180ms ease"})+(k?"; "+k:"");null==(r=R.first())||r.attr("style",H),R.attr("class",A),e.add(R);let _=new h;if(_.attr({class:"apextree-node-svg",transform:`translate(${T}, ${F})`}),B&&!this.hiddenLabelIds.has(t)){let e=ew(l,p);if(e){let t=ex(e,B,$,M,{fontColor:b,fontFamily:x,fontSize:w,fontWeight:C},this.radialLabelAngle(l));_.add(t)}}if(!1!==(null==(s=d.a11y)?void 0:s.enabled)&&z){let e=!!(null==(a=l.hiddenChildren)?void 0:a.length)||P;c.setAttribute("aria-expanded",e?"false":"true")}D?c.setAttribute("aria-busy","true"):c.removeAttribute("aria-busy"),g&&z&&this.renderExpandCollapseButton(l,_,{height:M,width:$},{lazyUnloaded:P,nodeLoading:D},d),this.renderCountBadge(l,_,$),e.add(_)}renderExpandCollapseButton(e,t,{height:n,width:i},{lazyUnloaded:o,nodeLoading:r},s){var a,l,d;let c=s.expandCollapseButtonSize,u=!(null==(a=e.hiddenChildren)?void 0:a.length)&&!o,g=u||r||!s.collapseBadgeEnabled?"":this.hiddenCountLabel(e,s.collapseBadgeThreshold),f=((e,t)=>{let n=Number.parseFloat(t),i=.7*e;return Number.isFinite(n)&&n>0?Math.min(n,i):i})(c,s.collapseBadgeFontSize),{height:m,width:v}=g?{height:c,width:Math.max(c,g.length*f*.6+10)}:{height:c,width:c},y=v/2,b=m/2,x=((e,t,n,i)=>{let{dx:o,dy:r}=((e,t)=>{if("radial"===e&&void 0!==t){let e=t*Math.PI/180;return{dx:Math.cos(e),dy:Math.sin(e)}}switch(e){case"bottom":return{dx:0,dy:-1};case"left":return{dx:1,dy:0};case"right":return{dx:-1,dy:0};default:return{dx:0,dy:1}}})(e,i),s=t/2,a=n/2,l=Math.min(Math.abs(o)>1e-6?s/Math.abs(o):1/0,Math.abs(r)>1e-6?a/Math.abs(r):1/0);return{x:s+o*l,y:a+r*l}})(s.direction,i,n,this.radialLabelAngle(e)),w=e2.drawGroup(x.x-y,x.y-b),C={width:Math.max(v+4,24),height:Math.max(m+4,24)},E=e2.drawRect({height:C.height,radius:C.height/2,width:C.width,x1:y-C.width/2,y1:b-C.height/2});E.attr({class:"apextree-expand-btn-hit",fill:"transparent",stroke:"none"}),w.add(E);let S=new h;if(S.attr({class:eL,transform:ek(y,b,1),style:"transition: transform 180ms ease"}),s.expandCollapseButtonHaloColor){let e=e2.drawRect({color:s.exp
26andCollapseButtonHaloColor,height:m+4,radius:(m+4)/2,width:v+4,x1:-2,y1:-2});e.attr({class:"apextree-expand-btn-halo","pointer-events":"none"}),S.add(e)}let A=!!g,k=A?s.collapseBadgeBGColor:s.expandCollapseButtonBGColor,M=e2.drawRect({color:k,height:m,radius:m/2,width:v,x1:0,y1:0});if(M.stroke({color:A?k:s.expandCollapseButtonBorderColor,width:1}),M.attr({class:eM,style:"transition: stroke 180ms ease"}),S.add(M),r?S.add(e2.drawSvgIcon((d=s.borderColorHover,`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="${c}" height="${c}"><g fill="none" stroke="${d}" stroke-width="3" stroke-linecap="round"><circle cx="12" cy="12" r="9" stroke-opacity="0.25"/><path d="M21 12a9 9 0 0 0-9-9"><animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="0.7s" repeatCount="indefinite"/></path></g></svg>`))):A?S.add(this.buildCountLabel(g,y,b,f,s.collapseBadgeFontColor,s)):S.add(function(e,t,n,i,o){let r=.45*n,s=`M ${e-r} ${t} H ${e+r}`,a=new p({d:i?s:`${s} M ${e} ${t-r} V ${t+r}`});return a.attr({class:e$,fill:"none","pointer-events":"none",stroke:o,"stroke-linecap":"round","stroke-width":Math.max(1.5,.2*n),style:"transition: stroke 180ms ease"}),a}(y,b,m/2,u,s.expandCollapseButtonIconColor)),w.add(S),t.add(w),w.on("click",t=>{t.stopPropagation(),r||(u?this.callbacks.onCollapse(e.id):this.callbacks.onExpand(e.id))}),!1!==(null==(l=s.a11y)?void 0:l.enabled)){let e=w.node;e.setAttribute("role","button"),e.setAttribute("aria-label",r?this.messages.loadingNodeLabel:u?this.messages.collapseNodeLabel:this.messages.expandNodeLabel),e.setAttribute("tabindex","-1")}r?w.attr("style","cursor: progress;"):((e,{centreX:t,centreY:n,hoverColor:i,restingBorderColor:o,restingIconColor:r})=>{let s=e.findOne(`.${eL}`),a=e.findOne(`.${eM}`),l=e.findOne(`.${e$}`);a&&s&&(e.attr("style","cursor: pointer;"),e.on("mouseenter",function(){s.attr({transform:ek(t,n,1.15)}),i&&(a.attr({stroke:i}),null==l||l.attr({stroke:i}))}),e.on("mouseleave",function(){s.attr({transform:ek(t,n,1)}),i&&(a.attr({stroke:o}),null==l||l.attr({stroke:r}))}))})(w,{centreX:y,centreY:b,hoverColor:A?void 0:s.borderColorHover,restingBorderColor:s.expandCollapseButtonBorderColor,restingIconColor:s.expandCollapseButtonIconColor})}hiddenCountLabel(e,t){let n=eT(e.id,this.nodeMap);return n>=t?String(n):""}buildCountLabel(e,t,n,i,o,r){let s=new g;return s.tspan(e),s.move(t,n),s.attr({class:"apextree-expand-btn-count","dominant-baseline":"central","font-family":r.fontFamily||"sans-serif","font-weight":"600","pointer-events":"none","text-anchor":"middle"}),s.font({fill:o,size:i}),s}radialLabelAngle(e){let t=this.radialCenter();if(!t)return;let n=e.x-t.x,i=e.y-t.y;return 1e-6>Math.hypot(n,i)?void 0:180*Math.atan2(i,n)/Math.PI}radialCenter(){if("radial"!==this.renderOptions.direction)return;let e=this.graph.graph();return{x:(e.width??0)/2,y:(e.height??0)/2}}applyBaseAria(e,t){var n;let i=this.renderOptions;if(!1===(null==(n=i.a11y)?void 0:n.enabled))return;let o=this.nodeMap[t],{contentKey:r}=i,s=eF(t,this.nodeMap),{posinset:a,setsize:l}=eB(t,this.nodeMap,this.rootNodeId),d=eI(t,this.nodeMap,this.rootNodeId,r,this.messages.nodeAriaLabel),h=!(null==o?void 0:o.parent);e.attr({"aria-label":d,"aria-level":s,"aria-posinset":a,"aria-selected":"false","aria-setsize":l,role:"treeitem",tabindex:h?0:-1})}bindWrapperInteractions(e,t){var n;let{containerClassName:i,contentKey:o,enableTooltip:r,highlightOnHover:s}=this.renderOptions;!1!==(null==(n=this.renderOptions.a11y)?void 0:n.enabled)&&e.on("click",e=>{var n,i;(null==(i=null==(n=e.target)?void 0:n.closest)?void 0:i.call(n,"[data-apextree-card-toggle]"))||this.callbacks.onFocusNode(t)}),s&&(e.on("mouseover",e=>{let{self:t}=e.currentTarget.dataset,n=t?this.nodeMap[t]:void 0;n&&eN(n,this.nodeMap,!0,this.renderOptions,this.chartContext,i)}),e.on("mouseout",e=>{let{self:t}=e.currentTarget.dataset,n=t?this.nodeMap[t]:void 0;n&&eN(n,this.nodeMap,!1,this.renderOptions,this.chartContext,i)})),r&&(e.on("mousemove",e=>{var n;let i=this.nodeMap[t];if(!i)return;let r={...this.renderOptions,...i.options},{nodeTemplate:s,tooltipTemplate:a}=this.renderOptions,l=eb(this.renderOptions.externalLabel,null==(n=i.options)?void 0:n.externalLabel),d=i[o],h=l?"":s(d,{direction:r.direction,cardImagePosition:r.cardImagePosition,expanded:this.callbacks.isCardExpanded(t),lod:"full"}),c=a?a(d):h,{pageX:u,pageY:p}=e;eW(this.chartContext,{bgColor:r.tooltipBGColor,borderColor:r.tooltipBorderColor,fontColor:r.tooltipFontColor,fontSize:r.tooltipFontSize,fontFamily:r.fontFamily,maxWidth:r.tooltipMaxWidth,minWidth:r.tooltipMinWidth,offset:r.tooltipOffset,padding:r.tooltipTemplate?0:r.tooltipPadding,tooltipId:r.tooltipId},c,u,p,this.callbacks.getContainerElement())}),e.on("mouseout",e=>{var t;"svg"===(null==(t=e.relatedTarget)?void 0:t.tagName)&&E(this.chartContext,this.renderOptions.tooltipId)})),e.on("click",e=>{var n,i,o;let r=e.target;((null==(n=null==r?void 0:r.closest)?void 0:n.call(r,"[data-apextree-card-toggle]"))||(null==(i=this.renderOptions.cardExpansion)?void 0:i.clickToExpand)&&!(null==(o=null==r?void 0:r.closest)?void 0:o.call(r,'[role="button"]')))&&this.callbacks.onToggleCard(t)}),e.on("click",e=>{var n,i,o;(null==(n=this.renderOptions.focus)?void 0:n.clickToFocus)&&((null==(o=null==(i=e.target)?void 0:i.closest)?void 0:o.call(i,'[role="button"]'))||this.callbacks.onFocusToggle(t))}),e.on("click",e=>{var n,i,o,r,s,a,l,d;if(null==(i=null==(n=e.target)?void 0:n.closest)?void 0:i.call(n,"[data-apextree-card-toggle]"))return;let h=this.nodeMap[t];
26if(!h)return;let c=this.renderOptions,u=!!((null==(o=h.children)?void 0:o.length)||(null==(r=h.hiddenChildren)?void 0:r.length));c.expandCollapseOnNodeClick&&u?((null==(s=h.hiddenChildren)?void 0:s.length)?this.callbacks.onExpand(t):(null==(a=h.children)?void 0:a.length)&&this.callbacks.onCollapse(t),null==(l=c.onNodeClick)||l.call(c,this.nodeMap[t]??h)):null==(d=c.onNodeClick)||d.call(c,h)})}getCountBadgeValue(e){let{countBadgeDataKey:t,countBadgeSource:n}=this.renderOptions;if("children"===n)return function(e,t){var n,i;let o=t[e];return o?((null==(n=o.children)?void 0:n.length)??0)+((null==(i=o.hiddenChildren)?void 0:i.length)??0):0}(e.id,this.nodeMap);if("data"===n){let n=e[t],i="number"==typeof n?n:Number(n);return Number.isFinite(i)?i:0}return function(e,t){let n=t[e];if(!n)return 0;let i=0;function o(e){if(null==e?void 0:e.length)for(let n of e){i++;let e=t[n];o(null==e?void 0:e.children),o(null==e?void 0:e.hiddenChildren)}}return o(n.children),o(n.hiddenChildren),i}(e.id,this.nodeMap)}renderCountBadge(e,t,n){let i=this.renderOptions;if(!i.countBadgeEnabled)return;let o=this.getCountBadgeValue(e);if(o<i.countBadgeThreshold)return;let r=String(o),s=Math.max(7*r.length+14,20),a=((e,t,n,i=!1)=>({x:i?-8:e-t+8,y:8-n}))(n,s,18,this.isRtl),l=e2.drawGroup(a.x,a.y),d=e2.drawRect({color:i.countBadgeBGColor,height:18,radius:9,width:s});l.add(d);let h=new g;h.tspan(r),h.move(s/2,9),h.attr({"dominant-baseline":"central","text-anchor":"middle","font-weight":"600","font-family":i.fontFamily||"sans-serif","pointer-events":"none"}),h.font({fill:i.countBadgeFontColor,size:i.countBadgeFontSize}),l.add(h),t.add(l)}}let e6="aria-selected";class e3{constructor(e,t,n=null){this.getContainer=e,this.mode=t,this.onChange=n,this.selected=new Set}getMode(){return this.mode}setMode(e){if(this.mode!==e){if(this.mode=e,!1===e)this.selected.clear();else if("single"===e&&this.selected.size>1){let[e]=Array.from(this.selected).slice(-1);this.selected=new Set(e?[e]:[])}this.syncToDom(),this.emit()}}getSelection(){return Array.from(this.selected)}setSelection(e){if(!1===this.mode)return;let t="single"===this.mode?e.slice(0,1):e;this.selected=new Set(t),this.syncToDom(),this.emit()}clearSelection(){!1!==this.mode&&0!==this.selected.size&&(this.selected.clear(),this.syncToDom(),this.emit())}handleNodeClick(e){if(!1===this.mode)return this.getSelection();if("single"===this.mode){if(1===this.selected.size&&this.selected.has(e))return this.getSelection();this.selected=new Set([e])}else this.selected.has(e)?this.selected.delete(e):this.selected.add(e);return this.syncToDom(),this.emit(),this.getSelection()}syncToDom(){this.getContainer().querySelectorAll("g[data-self]").forEach(e=>{let t=e.getAttribute("data-self");if(!t||!e.hasAttribute(e6))return;let n=this.selected.has(t)?"true":"false";e.getAttribute(e6)!==n&&e.setAttribute(e6,n)})}setChangeListener(e){this.onChange=e}emit(){var e;null==(e=this.onChange)||e.call(this,this.getSelection())}}let e8={rankdir:"TB"};class e9 extends e2{constructor(e,t,n){super(e,t.viewPortWidth,t.viewPortHeight,t.canvasStyle,n,t.enableZoomPan),this.options=t,this.keyboardNavigator=null,this.breadcrumbHandler=null,this.selectionController=null,this.focusController=null,this.activePathController=null,this.cardExpansionController=null,this.prevNodeIds=new Set,this.initialSetupDone=!1,this.motion=null,this.renderer=null,this.mainGroup=null,this.lastPivotId=null,this.savedGraphPositions=new Map,this.nodeMeasurer=new eR,this.baseContentSize=null,this.lodTier="full",this.lodZoomBound=!1,this.lodZoomTeardown=null,this.reducedMotionWatcher=null,this.lodDebounce=null,this.loadingNodes=new Set,this.lazyResolvedNodes=new Set,this.pendingShortcutHandlers=null,this.renderOptions=t,this.messages=function(e){var t,n;let i=function(e,t){if(!t)return{...e};let n={...e};for(let e of Object.keys(t)){let i=t[e];void 0!==i&&(n[e]=i)}return n}(em,null==(t=e.locale)?void 0:t.messages);return(null==(n=e.a11y)?void 0:n.label)?{...i,rootAriaLabel:e.a11y.label}:i}(t)}getMessages(){return this.messages}getIsRtl(){var e;return function(e,t){var n;if("rtl"===e)return!0;
26if("ltr"===e||"undefined"==typeof window||"undefined"==typeof document)return!1;if(t){let e=t.closest('[dir="rtl"], [dir="ltr"]');return e?"rtl"===e.getAttribute("dir"):"rtl"===window.getComputedStyle(t).direction}return"rtl"===((null==(n=document.documentElement)?void 0:n.getAttribute("dir"))??document.dir)}((null==(e=this.options.locale)?void 0:e.direction)??"ltr",this.getContainerElement())}mergeGraphPositions(){for(let e of this.graph.nodes()){let t=this.graph.node(e);void 0!==(null==t?void 0:t.x)&&void 0!==(null==t?void 0:t.y)&&this.savedGraphPositions.set(e,{x:t.x,y:t.y})}}calculateLayout(){let{childrenSpacing:e,paddingX:t,paddingY:n,siblingSpacing:i}=this.options,o=en[this.options.direction];if(this.graph.setGraph({...e8,cluster:"cluster"===this.options.layoutType,marginx:t,marginy:n,nodesep:i,rankdir:o,ranksep:e}),function(e){let t=e.graph(),n=t.rankdir??"TB",i=t.ranksep??50,o=t.nodesep??50,r=t.marginx??0,s=t.marginy??0,a=!0===t.cluster,l="LR"===n||"RL"===n,d="BT"===n||"RL"===n,h=l?r:s,c=l?s:r,u=t=>{var n,i;return l?(null==(n=e.node(t))?void 0:n.width)??0:(null==(i=e.node(t))?void 0:i.height)??0},p=t=>{var n,i;return l?(null==(n=e.node(t))?void 0:n.height)??0:(null==(i=e.node(t))?void 0:i.width)??0},g=function t(n,o,r,s,a){let l=e.node(n),d=u(n),c=r+s/2+(s>0?i:0)+d/2+(0===s?h:0),p={id:n,parent:o,children:[],width:(null==l?void 0:l.width)??0,height:(null==l?void 0:l.height)??0,depth:a,prelim:0,modifier:0,rankCoord:c};for(let i of e.children(n))p.children.push(t(i,n,c,d,a+1));return p}(e.root(),null,0,0,0);if(a){let e=0,t=0,n=i=>{for(let o of(i.depth>e&&(e=i.depth),i.rankCoord>t&&(t=i.rankCoord),i.children))n(o)};n(g);let i=n=>{for(let o of(0===n.children.length&&(n.depth=e,n.rankCoord=t),n.children))i(o)};i(g)}let f=c;function m(e,t,n,i,o,r){let s=e.prelim+t+r*p(e.id)/2;for(let a of(n>=i.length?i.push(s):i[n]=o(i[n],s),e.children))m(a,t+e.modifier,n+1,i,o,r)}if(function e(t){for(let n of t.children)e(n);let n=p(t.id);if(0===t.children.length)t.prelim=f+n/2,f+=n+o;else{!function(e){for(let t=1;t<e.children.length;t++){let n=e.children[t-1],i=e.children[t],r=function(e){let t=[];return m(e,0,0,t,Math.max,1),t}(n),s=function(e){let t=[];return m(e,0,0,t,Math.min,-1),t}(i),a=0,l=Math.min(r.length,s.length);for(let e=0;e<l;e++){let t=r[e]+o-s[e];t>a&&(a=t)}a>0&&(i.prelim+=a,i.modifier+=a)}}(t);let e=t.children[0],n=t.children[t.children.length-1];t.prelim=(e.prelim+n.prelim)/2}}(g),function e(t,n){for(let i of(t.prelim+=n,t.children))e(i,n+t.modifier);t.modifier=0}(g,0),"RADIAL"===n)return function(e,t,n){let i=e.graph(),o=[],r=new Map,s=1/0,a=-1/0,l=0,d=0,h=e=>{for(let t of(o.push(e),r.set(e.depth,(r.get(e.depth)??0)+1),e.prelim<s&&(s=e.prelim),e.prelim>a&&(a=e.prelim),e.depth>l&&(l=e.depth),0===e.children.length&&d++,e.children))h(t)};h(t);let c=t.width,u=t.height,p=Math.hypot(c,u)/2,g=Math.max(n.marginx,n.marginy),f=d>1?2*Math.PI*((d-1)/d):0,m=a-s||1,v=u+n.ranksep;if(f>0)for(let[e,t]of r)0!==e&&(v=Math.max(v,t*(c+n.nodesep)/f/e));let y=l*v+p,b=g+y,x=g+y;for(let t of o){let n=e.node(t.id);if(!n)continue;if(0===t.depth){n.x=b,n.y=x;continue}let i=t.depth*v,o=Y+(t.prelim-s)/m*f;n.x=b+i*Math.cos(o),n.y=x+i*Math.sin(o)}let w=2*(g+y);i.width=w,i.height=w}(e,g,{marginx:r,marginy:s,nodesep:o,ranksep:i});let v=0,y=e=>{for(let t of(e.rankCoord>v&&(v=e.rankCoord),e.children))y(t)};y(g);let b=0,x=0,w=0,C=0;!function t(n){let i=e.node(n.id);if(!i)return;let o=u(n.id),r=p(n.id),s=d?v-n.rankCoord+o/2+h:n.rankCoord,a=n.prelim;for(let e of(l?(i.x=s,i.y=a):(i.x=a,i.y=s),s>b&&(b=s,w=o/2),a>x&&(x=a,C=r/2),n.children))t(e)}(g),l?(t.width=b+w+r,t.height=x+C+s):(t.width=x+C+r,t.height=b+w+s)}(this.graph),this.getIsRtl()&&this.mirrorLayoutForRtl(),!this.hasCollapsedNodes()){let e=this.rawContentBox();this.baseContentSize={width:e.width,height:e.height}}}mirrorLayoutForRtl(){let e=this.graph.nodes(),t=1/0,n=-1/0;for(let i of e){let e=this.graph.node(i);if(void 0===(null==e?void 0:e.x))continue;let o=(e.width??0)/2;t=Math.min(t,e.x-o),n=Math.max(n,e.x+o)}if(!Number.isFinite(t))return;let i=t+n;for(let t of e){let e=this.graph.node(t);void 0!==(null==e?void 0:e.x)&&(e.x=i-e.x)}}resetGraph(){this.graph=new V}setGraphNodesAndEdges(e){this.resetGraph(),this.setNodesRecursively(e),this.measureNodeHeights()}measureNodeHeights(){var e,t,n,i;if(!eO(this.options.autoNodeHeight).enabled||"undefined"==typeof document||"radial"===this.options.direction)return;let o=this.getContainerElement();if(!o)return;let{cardImagePosition:r,contentKey:s,direction:a,nodeTemplate:l}=this.options;for(let d of this.graph.nodes()){if(d.endsWith("_leafs"))continue;let h=this.nodeMap[d],c=this.graph.node(d);if(!h||!c||h.onlyLeafNodes)continue;let u=eO((null==(e=h.options)?void 0:e.autoNodeHeight)??this.options.autoNodeHeight);if(!u.enabled||null!=(null==(t=h.options)?void 0:t.nodeHeight)||eb(this.options.externalLabel,null==(n=h.options)?void 0:n.externalLabel))continue;let p={...this.options,...h.options},g=l(h[s],{cardImagePosition:p.cardImagePosition??r,direction:a,expanded:(null==(i=this.cardExpansionController)?void 0:i.isExpanded(d))??!1,lod:"full"}),f=this.nodeMeasurer.measure(g,c.width,u,{borderWidth:p.borderWidth,fontFamily:p.fontFamily,fontSize:p.fontSize,fontWeight:p.fontWeight},o);null!=f&&(c.height=f)}
26}setNodesRecursively(e,t){var n,i,o,r;let{direction:s,groupLeafNodesSpacing:a,nodeHeight:l,nodeWidth:d}=this.options,h=this.nodeMap[e],c={...h,parent:t||void 0},u=(null==(n=h.options)?void 0:n.nodeWidth)??d,p=(null==(i=h.options)?void 0:i.nodeHeight)??l;if(this.graph.setNode(e,{...c,height:p,width:u}),t&&this.graph.setEdge(t,e),h.onlyLeafNodes&&(null==(o=h.children)?void 0:o.length)){let t=et[s].leafWidth({childLength:h.children.length,childrenSpacing:a,nodeWidth:d}),n=et[s].leafHeight({childLength:h.children.length,childrenSpacing:a,nodeHeight:l});this.graph.setNode(`${e}_leafs`,{...c,height:n,id:`${e}_leafs`,parent:e,width:t}),this.graph.setEdge(e,`${e}_leafs`)}else if(null==(r=h.children)?void 0:r.length)for(let t of h.children)this.setNodesRecursively(t,e)}buildDepthMap(){let e=new Map,t=[{id:this.data.id,depth:0}];for(;t.length>0;){let{id:n,depth:i}=t.shift();e.set(n,i),!1===e.has(`${n}_leafs`)&&e.set(`${n}_leafs`,i+1);let o=this.nodeMap[n];for(let n of(null==o?void 0:o.children)??[])e.has(n)||t.push({id:n,depth:i+1})}return e}rawContentBox(){let e=1/0,t=1/0,n=-1/0,i=-1/0;for(let o of this.graph.nodes()){let r=this.graph.node(o);if(void 0===(null==r?void 0:r.x)||void 0===(null==r?void 0:r.y))continue;let s=(r.width??0)/2,a=(r.height??0)/2;e=Math.min(e,r.x-s),t=Math.min(t,r.y-a),n=Math.max(n,r.x+s),i=Math.max(i,r.y+a)}if(!isFinite(e))return{x:0,y:0,width:0,height:0};let o=this.renderOptions.paddingX,r=this.renderOptions.paddingY;return{x:e-o,y:t-r,width:n-e+2*o,height:i-t+2*r}}hasCollapsedNodes(){return Object.values(this.nodeMap).some(e=>{var t;return((null==(t=e.hiddenChildren)?void 0:t.length)??0)>0})}viewportSize(){let e=this.getContainerElement(),t=(null==e?void 0:e.clientWidth)??0,n=(null==e?void 0:e.clientHeight)??0;return t>0&&n>0?{height:n,width:t}:null}computeRenderedBoundingBox(){return eA(this.rawContentBox(),this.renderOptions.nodeWidth,this.renderOptions.nodeHeight,this.renderOptions.maxZoomNodeSpan,this.baseContentSize??void 0,this.viewportSize())}runNodeEntranceAnimations(e,t){if(!this.renderOptions.enableAnimation)return;let n=this.getContainerElement();n.querySelectorAll("g[data-self][data-depth]").forEach(i=>{let o=i.getAttribute("data-self")??"",r=parseInt(i.getAttribute("data-depth")??"0",10),s=!t.has(o);("initial"===e||"expand"===e&&s||"data-update"===e&&s)&&function(e,t,n,i){if(eE(i))return;let o=e.querySelector("foreignObject")??e;if("function"!=typeof o.animate)return;let r=Math.min(80*t,600);o.animate([{clipPath:function(e){switch(e){case"top":return"inset(0% 0% 100% 0%)";case"bottom":return"inset(100% 0% 0% 0%)";case"left":return"inset(0% 100% 0% 0%)";case"right":return"inset(0% 0% 0% 100%)";default:return"inset(50% 50% 50% 50%)"}}(n)},{clipPath:"inset(0% 0% 0% 0%)"}],{duration:200,easing:"ease-out",delay:r,fill:"backwards"}),e.querySelectorAll(":scope > g").forEach(e=>{e.animate([{opacity:0},{opacity:1}],{duration:200,easing:"ease-out",delay:r+200,fill:"backwards"})})}(i,r,this.renderOptions.direction,n)})}seedInitialEntrance(){var e;let t=null==(e=this.mainGroup)?void 0:e.node;if(!t)return!1;let n=this.ensureMotion(),{nodeHeight:i,nodeWidth:o}=this.renderOptions,r=new Map,s=[];if(t.querySelectorAll("g[data-self]").forEach(e=>{if(e===t)return;let n=e.getAttribute("data-self");n&&(r.set(n,{x:parseFloat(e.getAttribute("data-x")??"0"),y:parseFloat(e.getAttribute("data-y")??"0")}),n.endsWith("_leafs")||s.push({id:n,el:e}))}),0===s.length)return!1;let a=r.get(this.data.id)??{x:0,y:0},l=e=>{var t,n;let i=0,o=null==(t=this.nodeMap[e])?void 0:t.parent;for(;o&&i<128;i++)o=null==(n=this.nodeMap[o])?void 0:n.parent;return i},d=e=>Math.min(80*l(e),600);for(let{id:e,el:t}of s){let i=r.get(e);if(!i)continue;let o=e4.refsOf(t),s=d(e);n.retargetNode(e,i.x,i.y,o,{seed:a,delayMs:s,enter:!0}),o.foreign&&"function"==typeof o.foreign.animate&&o.foreign.animate([{opacity:0},{opacity:1}],{duration:200,delay:s,easing:"ease-out",fill:"backwards"})}this.reconcileEdges(t,o/2,i/2,n);let h=new Set(s.map(e=>e.id));return t.querySelectorAll("path[id]").forEach(e=>{let t=e.getAttribute("id")??"",n="";for(let e of h)t.endsWith(`-${e}`)&&e.length>n.length&&(n=e);"function"==typeof e.animate&&e.animate([{opacity:0}
26,{opacity:1}],{duration:220,delay:(n?d(n):0)+60,easing:"ease-out",fill:"backwards"})}),n.applyAllImmediate(),!0}fadeOutAndRemove(e){if(!this.renderOptions.enableAnimation||"function"!=typeof e.animate)return void e.remove();e.animate([{opacity:1},{opacity:0}],{duration:220,easing:"ease-out"}).finished.then(()=>e.remove()).catch(()=>e.remove())}wireEdgeHoverAnimations(){if(!this.renderOptions.enableAnimation)return;let{edgeColor:e,edgeColorHover:t}=this.renderOptions;if(!t)return;let n=this.getContainerElement();n.querySelectorAll("path[id]").forEach(i=>{eS(i,t,e,n)})}runEdgeAnimations(e,t){if(!this.renderOptions.enableAnimation)return;let n=this.getContainerElement(),{edgeColor:i,edgeColorHover:o}=this.renderOptions,r=n.querySelectorAll("path[id]"),s=new Map;for(let e of this.graph.edges())s.set(`${e.v}-${e.w}`,{parent:e.v,child:e.w});r.forEach(r=>{var a;let l=r.getAttribute("id")??"",d=s.get(l);if(!d)return;let{parent:h,child:c}=d;if(!("initial"!==e&&("expand"!==e&&"data-update"!==e||t.has(h)&&t.has(c)))){let e=Math.min(80*parseInt((null==(a=n.querySelector(`g[data-self="${c}"]`))?void 0:a.getAttribute("data-depth"))??"0",10),600);!function(e,t,n=0){if(eE(t)||"function"!=typeof e.animate||"function"!=typeof e.getTotalLength)return;let i=e.getTotalLength();if(0===i)return;e.style.strokeDasharray=`${i}`,e.style.strokeDashoffset=""+-i;let o=e.animate([{strokeDashoffset:-i},{strokeDashoffset:0}],{duration:300,easing:"ease-out",delay:n,fill:"forwards"});o.finished.then(()=>{e.style.strokeDasharray="",e.style.strokeDashoffset="",o.cancel()}).catch(()=>{})}(r,n,e)}o&&eS(r,o,i,n)})}changeLayout(e="top"){this.options={...this.options,direction:e},this.setGraphNodesAndEdges(this.data.id),this.render({mode:"initial"})}collapse(e){this.setNodeCollapsed(e,!0)&&this.reflowBatch(e,"collapse")}setNodeCollapsed(e,t){var n,i;let o=this.nodeMap[e];return!!o&&(t?!!(null==(n=o.children)?void 0:n.length)&&(this.nodeMap[e]={...o,children:[],hiddenChildren:o.children},!0):!!(null==(i=o.hiddenChildren)?void 0:i.length)&&(this.nodeMap[e]={...o,children:o.hiddenChildren,hiddenChildren:void 0},!0))}fullChildrenOf(e){let t=this.nodeMap[e];return t?[...t.children??[],...t.hiddenChildren??[]]:[]}reflowBatch(e,t){this.mergeGraphPositions(),this.lastPivotId=e,this.setGraphNodesAndEdges(this.data.id),this.render({mode:t})}expandAll(){let e=!1;for(let t of Object.keys(this.nodeMap))t.endsWith("_leafs")||this.setNodeCollapsed(t,!1)&&(e=!0);e&&this.reflowBatch(this.data.id,"expand")}collapseAll(){let e=!1;for(let t of Object.keys(this.nodeMap))t.endsWith("_leafs")||this.setNodeCollapsed(t,!0)&&(e=!0);e&&this.reflowBatch(this.data.id,"collapse")}expandToDepth(e){let t=!1,n=[{d:0,id:this.data.id}],i=new Set;for(;n.length;){let{d:o,id:r}=n.shift();if(i.has(r))continue;i.add(r);let s=this.fullChildrenOf(r);for(let i of(this.setNodeCollapsed(r,o>=e)&&(t=!0),s))n.push({d:o+1,id:i})}t&&this.reflowBatch(this.data.id,e>=1?"expand":"collapse")}expandSubtree(e){this.reflowSubtree(e,!1)}collapseSubtree(e){this.reflowSubtree(e,!0)}reflowSubtree(e,t){if(!this.nodeMap[e])return;let n=!1,i=[e],o=new Set;for(;i.length;){let e=i.pop();if(o.has(e))continue;o.add(e);let r=this.fullChildrenOf(e);for(let o of(this.setNodeCollapsed(e,t)&&(n=!0),r))i.push(o)}n&&this.reflowBatch(e,t?"collapse":"expand")}construct(e){this.nodeMap=function(e){let t={};return function e(t,n,i){let{children:o,...r}=t,s={...r,children:o?o.map(e=>e.id):[],parent:n?n.id:void 0};if(i[s.id]=s,null==o?void 0:o.length)for(let t of o)e(t,s,i)}(e,void 0,t),t}(e),this.data=e,this.baseContentSize=null,this.loadingNodes=new Set,this.lazyResolvedNodes=new Set,this.options.groupLeafNodes&&(function(e){let t=[];function n(e){return!e.children||0===e.children.length}return function e(i){if(i.children&&0!==i.children.length)for(let o of(i.children.every(n)&&t.push(i),i.children))e(o)}(e),t})(e).forEach(e=>{this.nodeMap[e.id]={...this.nodeMap[e.id],onlyLeafNodes:!0},this.nodeMap[`${e.id}_leafs`]={...this.nodeMap[e.id],id:`${e.id}_leafs`,onlyLeafNodes:!0,parent:e.id},this.nodeMap[e.id].children.forEach(t=>{this.nodeMap[t]={...this.nodeMap[t],parent:`${e.id}_leafs`}})}),this.setGraphNodesAndEdges(e.id)}updateData(e){this.mergeGraphPositions();let t=Object.keys(this.nodeMap).filter(e=>{var t,n;return null==(n=null==(t=this.nodeMap[e])?void 0:t.hiddenChildren)?void 0:n.length});this.lastPivotId=e.id,this.construct(e);let n=!1;for(let e of t)this.setNodeCollapsed(e,!0)&&(n=!0);n&&this.setGraphNodesAndEdges(this.data.id),this.render({mode:"data-update"})}expand(e){this.tryLoadLazyChildren(e)||this.setNodeCollapsed(e,!1)&&this.reflowBatch(e,"expand")}isLazyUnloaded(e){var t,n;let i=this.nodeMap[e];return!!(null==i?void 0:i.hasChildren)&&!(null==(t=i.children)?void 0:t.length)&&!(null==(n=i.hiddenChildren)?void 0:n.length)&&!this.lazyResolvedNodes.has(e)}isNodeLoading(e){return this.loadingNodes.has(e)}tryLoadLazyChildren(e){let t=this.options.loadChildren;if(!t||!this.isLazyUnloaded(e))return!1;if(this.loadingNodes.has(e))return!0;let n=this.nodeMap[e];return this.loadingNodes.add(e),this.refreshNodeContent(),Promise.resolve(t({data:n[this.options.contentKey],id:e,name:n.name})).then(t=>{this.loadingNodes.delete(e),this.lazyResolvedNodes.add(e),this.attachLazyChildren(e,t??[])},()=>{this.loadingNodes.delete(e),this.refreshNodeContent()}),!0}attachLazyChildren(e,t){let n=this.nodeMap[e];if(!n)return;if(0===t.length)return void this.refreshNodeContent();let i=this.insertLazySubtree(t,e);this.nodeMap[e]={...n,children:i,hiddenChildren:void 0},this.reflowBatch(e,"expand")}insertLazySubtree(e,t){let n=(e,t)=>{let{children:i,...o}=e;for(let r of(this.nodeMap[e.id]={...o,children:i?i.map(e=>e.id):[],hiddenChildren:void 0,parent:t},i??[]))n(r,e.id)},i=[];for(let o of e)i.push(o.id),n(o,t);return i}refreshNodeContent(){this.setGraphNodesAndEdges(this.data.id),this.render({mode:"card-toggle"})}fitScreen(){var e;let{height:t,width:n}=this.graph.graph();this.updateViewBox(0,0,n??0,t??0),this.resetPanZoomBase(),null==(e=this.motion)||e.syncCameraToCanvas(),this.scheduleLodRefresh()}getNodeMap(){return this.nodeMap}ensureSelectionController(){this.selectionController?this.selectionController.setMode(this.options.enableSelection):!1!==this.options.enableSelection&&(this.selectionController=new e3(()=>this.getContainerElement(),this.options.enableSelection))}setBreadcrumbHandler(e){this.breadcrumbHandler=e}getSelection(){var e;return(null==(e=this.selectionController)?void 0:e.getSelection())??[]}setSelection(e){var t;null==(t=this.selectionController)||t.setSelection(e)}clearSelection(){var e;null==(e=this.selectionController)||e.clearSelection()}onSelectionChange(e){var t;null==(t=this.selectionController)||t.setChangeListener(e)}setKeyboardShortcutHandlers(e){var t;this.pendingShortcutHandlers=e,null==(t=this.keyboardNavigator)||t.setShortcutHandlers(e)}getRootNodeId(){return this.data.id}getNodeLabel(e){let t=this.nodeMap[e];if(!t)return"";let n=t[this.options.contentKey];return"string"==typeof n?n:String(n&&"object"==typeof n&&"name"in n?n.name??"":t.name??"")}findNodesByQuery(e){let t=e.trim().toLowerCase();if(!t)return[];let n=[];for(let e of Object.keys(this.nodeMap))!e.endsWith("_leafs")&&this.getNodeLabel(e).toLowerCase().includes(t)&&n.push(e);return n}setSearchHighlight(e){let t=this.getContainerElement(),{containerClassName:n}=this.renderOptions;for(let i of(t.querySelectorAll('g[data-self][data-apextree-match="true"]').forEach(e
26=>{e.removeAttribute("data-apextree-match");let t=e.getAttribute("data-self"),i=t?this.nodeMap[t]:void 0;i&&eN(i,this.nodeMap,!1,this.renderOptions,this.chartContext,n,!1)}),e)){let e=this.nodeMap[i];if(!e)continue;let o=t.querySelector(`g[data-self="${i}"]`);o&&o.setAttribute("data-apextree-match","true"),eN(e,this.nodeMap,!0,this.renderOptions,this.chartContext,n,!1)}}centerOnNode(e){let t=this.graph.node(e);if(void 0===(null==t?void 0:t.x)||void 0===(null==t?void 0:t.y))return;let n=this.canvas.viewbox(),i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height};if(this.initialSetupDone&&this.renderOptions.enableAnimation){let e=this.ensureMotion();e.syncCameraToCanvas(),e.retargetCamera(i)}else this.updateViewBox(i.x,i.y,i.width,i.height),this.resetPanZoomBase()}focus(e){var t;if(!this.ensureFocusController().focus(e))return!1;let n=this.computeSubtreeBoundingBox(e)??this.computeRenderedBoundingBox();return this.animateCameraTo(n),(null==(t=this.renderOptions.edgeFlow)?void 0:t.followFocus)&&this.setActivePath(e),!0}clearFocus(){var e,t;(null==(e=this.focusController)?void 0:e.getFocusedId())&&(this.focusController.clear(),this.animateCameraTo(this.computeRenderedBoundingBox()),(null==(t=this.renderOptions.edgeFlow)?void 0:t.followFocus)&&this.clearActivePath())}setActivePath(e){let t=Array.isArray(e)?e:[e];this.ensureActivePathController().setPath(t)}clearActivePath(){var e;null==(e=this.activePathController)||e.clear()}getActivePath(){var e;return(null==(e=this.activePathController)?void 0:e.getTargets())??[]}ensureActivePathController(){return this.activePathController||(this.activePathController=new eX(this.chartContext,()=>this.mainGroup?this.mainGroup.node:null,()=>this.nodeMap,()=>this.renderOptions)),this.activePathController}expandCard(e){this.ensureCardExpansionController().expand(e)&&this.reflowForCardToggle(e)}collapseCard(e){this.ensureCardExpansionController().collapse(e)&&this.reflowForCardToggle(e)}toggleCard(e){this.ensureCardExpansionController().toggle(e)&&this.reflowForCardToggle(e)}setExpandedCards(e){this.ensureCardExpansionController().setExpanded(e),this.reflowForCardToggle(this.data.id)}getExpandedCards(){var e;return(null==(e=this.cardExpansionController)?void 0:e.getExpanded())??[]}reflowForCardToggle(e){this.mergeGraphPositions(),this.lastPivotId=e,this.setGraphNodesAndEdges(this.data.id),this.render({mode:"card-toggle"})}ensureCardExpansionController(){return this.cardExpansionController||(this.cardExpansionController=new eU(()=>this.getContainerElement(),()=>this.nodeMap,()=>this.messages)),this.cardExpansionController}getFocusedNodeId(){var e;return(null==(e=this.focusController)?void 0:e.getFocusedId())??null}toggleFocus(e){this.getFocusedNodeId()===e?this.clearFocus():this.focus(e)}ensureFocusController(){return this.focusController||(this.focusController=new e1(()=>this.getContainerElement(),()=>this.mainGroup?this.mainGroup.node:null,()=>this.nodeMap,()=>this.renderOptions,()=>this.clearFocus())),this.focusController}animateCameraTo(e){if(this.initialSetupDone&&this.renderOptions.enableAnimation){let t=this.ensureMotion();t.syncCameraToCanvas(),t.retargetCamera(e)}else this.updateViewBox(e.x,e.y,e.width,e.height),this.resetPanZoomBase()}computeSubtreeBoundingBox(e){var t;let n=1/0,i=1/0,o=-1/0,r=-1/0,s=new Set,a=[e];for(;a.length;){let e=a.shift();if(s.has(e))continue;for(let n of(s.add(e),this.nodeMap[`${e}_leafs`]&&a.push(`${e}_leafs`),(null==(t=this.nodeMap[e])?void 0:t.children)??[]))a.push(n);let l=this.graph.node(e);if(void 0===(null==l?void 0:l.x)||void 0===(null==l?void 0:l.y))continue;let d=(l.width??0)/2,h=(l.height??0)/2;n=Math.min(n,l.x-d),i=Math.min(i,l.y-h),o=Math.max(o,l.x+d),r=Math.max(r,l.y+h)}if(!isFinite(n))return null;let{nodeHeight:l,nodeWidth:d,paddingX:h,paddingY:c}=this.renderOptions;return eA({x:n-h,y:i-c,width:o-n+2*h,height:r-i+2*c},d,l,3,void 0,this.viewportSize())}ensureMotion(){var e;return this.motion||(this.motion=new eG(this.canvas,this.getContainerElement(),()=>this.resetPanZoomBase(),z(null==(e=this.options.motion)?void 0:e.spring))),this.motion}render({mode:e}={}){this.ensureLodZoomListener(),this.ensureReducedMotionWatcher(),("collapse"===e||"expand"===e||"card-toggle"===e||"data-update"===e||"lod"===e)&&this.options.enableAnimation&&this.initialSetupDone&&null!==this.mainGroup?this.reconcileRen
26der(e):this.fullRender(e)}resolveSemanticZoom(){var e;return{compactBelow:(null==(e=this.options.semanticZoom)?void 0:e.compactBelow)??90,dotBelow:(null==e?void 0:e.dotBelow)??42,enabled:(null==e?void 0:e.enabled)??!1}}computeLodTier(e){var t,n;let i=this.resolveSemanticZoom();if(!i.enabled)return"full";let o=(null==(t=this.getContainerElement())?void 0:t.clientWidth)??0,r=e||this.canvas.viewbox().width||0;return o&&r?(n=this.renderOptions.nodeWidth*(o/r),i.enabled?!Number.isFinite(n)||n<=0||n>=i.compactBelow?"full":n>=i.dotBelow?"compact":"dot":"full"):"full"}pendingViewBoxWidth(e,t){var n;return(null==(n=this.graph.graph())?void 0:n.width)||t}resolveLodTierForRender(e,t){return this.resolveSemanticZoom().enabled?"lod"===e?this.computeLodTier():"initial"===e||void 0===e?this.computeLodTier(this.pendingViewBoxWidth(e,t)):this.lodTier:"full"}ensureReducedMotionWatcher(){if(this.reducedMotionWatcher)return;let e=this.getContainerElement();e&&(this.reducedMotionWatcher=new W({className:ej,element:e}))}ensureLodZoomListener(){if(this.lodZoomBound||!this.resolveSemanticZoom().enabled)return;let e=this.getContainerElement();if(!e)return;let t=()=>{var e;return null==(e=this.motion)?void 0:e.syncCameraToCanvas()},n=()=>{t(),this.scheduleLodRefresh()};e.addEventListener("wheel",n,{passive:!0}),e.addEventListener("pointerdown",t,{passive:!0}),this.lodZoomTeardown=()=>{e.removeEventListener("wheel",n),e.removeEventListener("pointerdown",t)},this.lodZoomBound=!0}
26scheduleLodRefresh(){this.lodDebounce&&clearTimeout(this.lodDebounce),this.lodDebounce=setTimeout(()=>{this.lodDebounce=null,this.refreshLodNow()},130)}refreshLodNow(){this.resolveSemanticZoom().enabled&&this.computeLodTier()!==this.lodTier&&this.initialSetupDone&&this.mainGroup&&this.render({mode:"lod"})}zoom(e){var t;let n=this.canvas.viewbox(),i=this.baseContentSize;e<0&&null!==i&&n.width>=1.6*i.width&&n.height>=1.6*i.height||(this.resetPanZoomBase(),super.zoom(e)),null==(t=this.motion)||t.syncCameraToCanvas(),this.scheduleLodRefresh()}ensureRenderer(){return this.renderer||(this.renderer=new e4(this.graph,this.nodeMap,this.renderOptions,this.chartContext,this.data.id,{getContainerElement:()=>this.getContainerElement(),onCollapse:e=>this.collapse(e),onExpand:e=>this.expand(e),onFocusNode:e=>{var t,n,i;null==(t=this.keyboardNavigator)||t.focusNode(e),null==(n=this.breadcrumbHandler)||n.call(this,e),null==(i=this.selectionController)||i.handleNodeClick(e)},onFocusToggle:e=>this.toggleFocus(e),isCardExpanded:e=>{var t;return(null==(t=this.cardExpansionController)?void 0:t.isExpanded(e))??!1},onToggleCard:e=>this.toggleCard(e),isLazyUnloaded:e=>this.isLazyUnloaded(e),isNodeLoading:e=>this.isNodeLoading(e),getLodTier:()=>this.lodTier},new Map,this.messages,this.getIsRtl())),this.renderer}destroy(){var e,t,n,i;null==(e=this.motion)||e.dispose(),this.motion=null,null==(t=this.reducedMotionWatcher)||t.dispose(),this.reducedMotionWatcher=null,null==(n=this.keyboardNavigator)||n.destroy(),this.keyboardNavigator=null,null==(i=this.lodZoomTeardown)||i.call(this),this.lodZoomTeardown=null,this.lodZoomBound=!1,this.lodDebounce&&(clearTimeout(this.lodDebounce),this.lodDebounce=null)}fullRender(e){var t,n,i,o,r;let s=this.canvas.viewbox(),a="collapse"===e||"expand"===e||"card-toggle"===e;if(null==(t=this.motion)||t.reset(),this.clear(),this.calculateLayout(),a&&!this.options.enableExpandCollapseZoom&&this.savedGraphPositions.size>0)for(let e of this.graph.nodes()){let t=this.savedGraphPositions.get(e),n=this.graph.node(e);t&&n&&(n.x=t.x,n.y=t.y)}ez(this.getContainerElement(),this.options.theme,this.chartContext),this.renderOptions=ev(this.getContainerElement(),this.options),this.lodTier=this.resolveLodTierForRender(e,s.width),this.ensureSelectionController();let{containerClassName:l,enableTooltip:d,tooltipId:h}=this.renderOptions,{fontColor:c,fontFamily:u,fontSize:p,fontWeight:g}=this.renderOptions,f=S({color:c,fontFamily:u,fontSize:p,fontWeight:g}),m=e2.drawNodeWrapper(0,0,l);m.attr("style",f),m.id(l),this.mainGroup=m;let v=this.buildDepthMap(),y=this.graph.nodes(),b=this.graph.edges(),x=this.ensureRenderer();if(x.update(this.graph,this.nodeMap,this.renderOptions,this.data.id,v,this.messages,this.getIsRtl()),b.forEach(e=>{x.renderEdge(e,m)}),y.forEach(e=>{e.endsWith("_leafs")?x.renderGroupedLeafNodes(e,m):x.renderNode(e,m)}),this.add(m),null==(n=this.selectionController)||n.syncToDom(),null==(i=this.focusController)||i.reapply(),null==(o=this.activePathController)||o.reapply(),null==(r=this.cardExpansionController)||r.reapply(),"lod"===e)this.updateViewBox(s.x,s.y,s.width,s.height);else if(a&&this.renderOptions.enableExpandCollapseZoom){let e=this.computeRenderedBoundingBox();this.updateViewBox(e.x,e.y,e.width,e.height),this.resetPanZoomBase()}else a?this.updateViewBox(s.x,s.y,s.width,s.height):this.fitScreen();if(d){let e=C(this.chartContext,h);this.chartContext.getAppendContainer().appendChild(e)}let w=e??(0===this.prevNodeIds.size?"initial":"data-update"),E=this.prevNodeIds,A="initial"===w&&this.renderOptions.enableAnimation&&this.seedInitialEntrance();requestAnimationFrame(()=>{this.initialSetupDone=!0,this.refreshLodNow(),A?this.wireEdgeHoverAnimations():"initial"===w||"expand"===w||"data-update"===w?(this.runNodeEntranceAnimations(w,E),this.runEdgeAnimations(w,E)):this.wireEdgeHoverAnimations();let e=new Set;this.getContainerElement().querySelectorAll("g[data-self]").forEach(t=>{let n=t.getAttribute("data-self");n&&e.add(n)}),this.prevNodeIds=e}),this.applyA11y()}reconcileRender(e){var t,n,i,o,r,s,a,l,d,h,c;let u=this.canvas.viewbox();if(this.calculateLayout(),"data-update"!==e&&!this.options.enableExpandCollapseZoom&&this.savedGraphPositions.size>0)for(let e of this.graph.nodes()){let t=this.savedGraphPositions.get(e),n=this.graph.node(e);t&&n&&(n.x=t.x,n.y=t.y)}ez(this.getContainerElement(),this.options.theme,this.chartContext),this.renderOptions=ev(this.getContainerElement(),this.options),this.ensureSelectionController(),this.lodTier=this.resolveLodTierForRender(e,u.width);let p=this.buildDepthMap(),g=this.ensureRenderer();g.update(this.graph,this.nodeMap,this.renderOptions,this.data.id,p,this.messages,this.getIsRtl());let f=this.mainGroup.node,m=this.ensureMotion(),{nodeHeight:v,nodeWidth:y}=this.renderOptions,b=e=>({x:parseFloat(e.getAttribute("data-x")??"0"),y:parseFloat(e.getAttribute("data-y")??"0")}),x=e=>{let t=this.graph.node(e);return{x:((null==t?void 0:t.x)??0)-((null==t?void 0:t.width)??y)/2,y:((null==t?void 0:t.y)??0)-((null==t?void 0:t.height)??v)/2}},w=new Map,C=new Map,E=new Map;
26f.querySelectorAll("g[data-self]").forEach(e=>{if(e===f)return;let t=e.getAttribute("data-self");t&&(t.endsWith("_leafs")?C.set(t,e):(e.getAttribute("data-parent")??"").endsWith("_leafs")?E.set(t,e):w.set(t,e))});let S=this.graph.nodes(),A=S.filter(e=>!e.endsWith("_leafs")),k=S.filter(e=>e.endsWith("_leafs")),M=new Map;for(let e of k){let i=(null==(t=this.nodeMap[e])?void 0:t.parent)??e;for(let t of(null==(n=this.graph.node(e))?void 0:n.children)??[])M.set(t,i)}let $=new Set([...A,...k,...M.keys()]),L=[...w.keys(),...C.keys(),...E.keys()].filter(e=>!$.has(e)),N="wave"===((null==(i=this.renderOptions.motion)?void 0:i.stagger)??"wave"),T=N&&this.lastPivotId?function(e,t,n){let i=new Map;for(let e of n)i.set(e,0);let o=[{id:e,d:0}],r=new Set([e]);for(i.has(e)&&i.set(e,0);o.length;){let{id:e,d:n}=o.shift();for(let s of(i.has(e)&&i.set(e,n),t(e)))r.has(s)||(r.add(s),o.push({id:s,d:n+1}))}return i}(this.lastPivotId,e=>{var t;return(null==(t=this.nodeMap[e])?void 0:t.children)??[]},[...A,...M.keys(),...L]):new Map,F=e=>N?18*(T.get(e)??0):0,B=e=>{var t,n;let i=null==(t=this.nodeMap[e])?void 0:t.parent;for(let e=0;i&&e<128;e++){let e=m.originOf(i);if(e)return e;let t=w.get(i)??C.get(i);if(t)return b(t);if(this.graph.node(i))return x(i);i=null==(n=this.nodeMap[i])?void 0:n.parent}return this.lastPivotId?m.originOf(this.lastPivotId)??(this.graph.node(this.lastPivotId)?x(this.lastPivotId):{x:0,y:0}):{x:0,y:0}},{enter:I,update:O}=function(e,t){let n=e instanceof Set?e:new Set(e),i=t instanceof Set?t:new Set(t),o=[],r=[],s=[];for(let e of i)n.has(e)?r.push(e):o.push(e);for(let e of n)i.has(e)||s.push(e);return{enter:o,update:r,exit:s}}(w.keys(),A);for(let e of O){let t=w.get(e),n=g.signatureOf(e);if(t.getAttribute("data-sig")!==n){let i=b(t),o=g.createWrapper(e);g.renderContentInto(o,e);let r=o.node;r.setAttribute("data-sig",n),r.setAttribute("data-x",String(i.x)),r.setAttribute("data-y",String(i.y)),t.replaceWith(r),t=r}let i=x(e);m.retargetNode(e,i.x,i.y,e4.refsOf(t),{seed:b(t),delayMs:F(e)})}for(let e of I){let t=g.createWrapper(e);g.renderContentInto(t,e);let n=t.node;n.setAttribute("data-sig",g.signatureOf(e));let i=B(e);n.setAttribute("data-x",String(i.x)),n.setAttribute("data-y",String(i.y)),this.mainGroup.add(t);let o=x(e);m.retargetNode(e,o.x,o.y,e4.refsOf(n),{seed:i,delayMs:F(e),enter:!0})}for(let e of k){let t=g.buildGroupedLeafNodes(e),n=t.node,i=new Map,r=new Map,s=C.get(e);s?(s.querySelectorAll("g[data-self]").forEach(e=>{let t=e.getAttribute("data-self");t&&(i.set(t,b(e)),r.set(t,e))}),s.replaceWith(n)):this.mainGroup.add(t);let a=(null==(o=this.nodeMap[e])?void 0:o.parent)??e;for(let e of Array.from(n.children)){let t=e.getAttribute("data-self");if(!t)continue;let n=b(e),o=e,s=r.get(t);s&&s.getAttribute("data-sig")===g.signatureOf(t)&&(e.replaceWith(s),o=s);let l=e4.refsOf(o),d=m.originOf(t)??i.get(t)??null;if(d)o.setAttribute("data-x",String(d.x)),o.setAttribute("data-y",String(d.y)),m.retargetNode(t,n.x,n.y,l,{seed:d,delayMs:F(t)});else{let e=m.originOf(a)??B(t);o.setAttribute("data-x",String(e.x)),o.setAttribute("data-y",String(e.y)),m.retargetNode(t,n.x,n.y,l,{seed:e,delayMs:F(t),enter:!0})}}}for(let e of L){if(e.endsWith("_leafs")){let t=C.get(e);if(t){for(let e of Array.from(t.children))(null==(r=e.getAttribute)?void 0:r.call(e,"data-self"))&&f.appendChild(e);t.remove()}continue}let t=E.get(e)??w.get(e);if(!t)continue;let n=b(t),i=B(e);m.retargetNode(e,n.x,n.y,e4.refsOf(t),{seed:n}),m.exitNode(e,i.x,i.y)}this.reconcileEdges(f,y/2,v/2,m),m.applyAllImmediate(),null==(s=this.selectionController)||s.syncToDom();let R=(null==(a=this.focusController)?void 0:a.reapply())?(null==(l=this.focusController)?void 0:l.getFocusedId())??null:null;if(null==(d=this.activePathController)||d.reapply(),null==(h=this.cardExpansionController)||h.reapply(),"lod"===e)m.syncCameraToCanvas();else if(this.renderOptions.enableExpandCollapseZoom){m.syncCameraToCanvas();let e=(R?this.computeSubtreeBoundingBox(R):null)??this.computeRenderedBoundingBox();m.retargetCamera(e)}else this.updateViewBox(u.x,u.y,u.width,u.height);this.prevNodeIds=$,null==(c=this.keyboardNavigator)||c.update(this.nodeMap,this.data.id)}reconcileEdges(e,t,n,i){let o=this.renderer,{direction:r,edgeColor:s,edgeColorHover:a,edgeStyle:l,nodeHeight:d,nodeWidth:h}=this.renderOptions,c=this.graph.graph(),u="radial"===r?{x:(c.width??0)/2,y:(c.height??0)/2}:void 0,p="top"===r||"bottom"===r,g=new Map;
26e.querySelectorAll("path[id]").forEach(e=>{e.id&&(!e.id.endsWith("_leafs")||p?g.set(e.id,e):e.remove())});let f=(o,s,a,l)=>{var c;let u=Array.from(e.querySelectorAll(`g[data-self][data-parent="${a}"]`)).map(e=>e.getAttribute("data-self")??"").filter(Boolean);if(0===u.length)return;let{childrenSpacing:p,siblingSpacing:g}=this.renderOptions,f=(null==(c=this.graph.node(this.data.id))?void 0:c.x)??0;i.registerEdge({id:o,pathEl:l,childId:a,parentId:s,childHalf:{w:t,h:n},parentHalf:{w:t,h:n},compute:()=>null,childIds:u,computeMulti:(e,t)=>{let n=t.map(e=>e.y).sort((e,t)=>e-t),i="top"===r?e.y+d/2:e.y-d/2;return U(e.x,i,n,t[0].x,h,p,g,f,r)}})},m=(e,t,n,o)=>{let s=this.graph.node(n),a=this.graph.node(t),c={...s??{height:d,width:h},parent:t},p=a?{...a}:{height:d,width:h};i.registerEdge({id:e,pathEl:o,childId:n,parentId:t,childHalf:{w:(c.width??h)/2,h:(c.height??d)/2},parentHalf:{w:(p.width??h)/2,h:(p.height??d)/2},compute:(e,t)=>ey({...c,x:e.x,y:e.y},{...p,x:t.x,y:t.y},h,d,r,l,u)})},v=new Set;for(let t of this.graph.edges()){let n=`${t.v}-${t.w}`,i=t.w.endsWith("_leafs");v.add(n);let r=g.get(n)??null;r||(r=o.renderEdge(t,this.mainGroup))&&(e.insertBefore(r,e.firstChild),a&&eS(r,a,s,this.getContainerElement())),r&&(i&&p?f(n,t.v,t.w,r):i||m(n,t.v,t.w,r))}g.forEach((t,n)=>{if(v.has(n))return;let o=t.getAttribute("data-edge-parent"),r=t.getAttribute("data-edge-child");if(o&&r){if(!r.endsWith("_leafs"))return this.graph.node(r)?(i.unregisterEdge(n),void this.fadeOutAndRemove(t)):void m(n,o,r,t);e.querySelector(`g[data-self][data-parent="${r}"]`)?f(n,o,r,t):(i.unregisterEdge(n),this.fadeOutAndRemove(t))}else t.remove()})}applyA11y(){let e=this.renderOptions.a11y;!1!==(null==e?void 0:e.enabled)&&(this.setTreeA11yAttributes(this.messages.rootAriaLabel,this.options.enableSelection),this.keyboardNavigator?this.keyboardNavigator.update(this.nodeMap,this.data.id):(this.keyboardNavigator=new X({container:this.getContainerElement(),nodeMap:this.nodeMap,onCollapse:e=>this.collapse(e),onExpand:e=>this.expand(e),onFitScreen:()=>this.fitScreen(),onZoom:e=>this.zoom(e),options:this.renderOptions,rootNodeId:this.data.id}),this.pendingShortcutHandlers&&this.keyboardNavigator.setShortcutHandlers(this.pendingShortcutHandlers)))}}class e7 extends r{constructor(e,t={}){let n="tree_"+crypto.randomUUID().replace(/-/g,"").substring(0,9);super(e,n),this.searchControl=null,this.breadcrumbControl=null,this.commandPaletteControl=null;let i=t.containerClassName?`${t.containerClassName}-${n}`:`root-${n}`;this.options={...ef,...t,containerClassName:i};let{height:o,width:r}=this.options;this.graph=new e9(this.element,this.options,this.chartContext),this.setupElementDimensions(r,o),this.handleWatermark()}static setLicense(e){T.setLicense(e)}destroy(){var e,t,n;null==(e=this.searchControl)||e.destroy(),this.searchControl=null,null==(t=this.commandPaletteControl)||t.destroy(),this.commandPaletteControl=null,null==(n=this.breadcrumbControl)||n.destroy(),this.breadcrumbControl=null,this.graph.destroy(),super.destroy()}setupElementDimensions(e,t){let n=!1,i=0;"string"==typeof e&&/^\d+(\.\d+)?%$/.test(e)?(i=Number(e.substring(0,e.length-1)),n=!0):i=Number(e);let o="auto"===t?i/1.6:Number(t);this.element.style.width=`${i}${n?"%":"px"}`,this.element.style.height=`${o}${n?"%":"px"}`,this.element.style.position="relative"}handleWatermark(){this.element&&(T.isLicenseValid()?F.remove(this.element):F.add(this.element))}render(e){var t,n,i,o,r,s;if(!this.element)throw Error("Element not found");return r=this.element,s=(null==(t=this.options.locale)?void 0:t.direction)??"ltr",r&&("ltr"===s?r.removeAttribute("dir"):r.setAttribute("dir",s)),this.graph.construct(e),this.graph.render(),this.options.enableToolbar&&new x(this.element,this.chartContext).render({enableExport:!0,enableFitscreen:!1,enableZoom:this.options.enableZoomPan,onExport:this.graph.exportToSvg.bind(this.graph),onFitscreen:this.graph.fitScreen.bind(this.graph),onZoom:this.graph.zoom.bind(this.graph)}),this.options.enableSearch?(this.searchControl??(this.searchControl=new Z({chartContext:this.chartContext,container:this.element,graph:this.graph})),this.searchControl.render(),this.graph.setKeyboardShortcutHandlers({onFocusSearch:()=>{var e;return null==(e=this.searchControl)?void 0:e.focus()},onClearSearch:()=>{var e;return null==(e=this.searchControl)?void 0:e.clear()}})):(null==(n=this.searchControl)||n.destroy(),this.searchControl=null),this.options.enableCommandPalette?(this.commandPaletteControl??(this.commandPaletteControl=new K({chartContext:this.chartContext,container:this.element,graph:this.graph})),this.commandPaletteControl.render()):(null==(i=this.commandPaletteControl)||i.destroy(),this.commandPaletteControl=null),this.options.enableBreadcrumb?(this.breadcrumbControl??(this.breadcrumbControl=new q({chartContext:this.chartContext,container:this.element,graph:this.graph})),this.breadcrumbControl.render(),this.graph.setBreadcrumbHandler(e=>{var t;return null==(t=this.breadcrumbControl)?void 0:t.setSelected(e)})):(null==(o=this.breadcrumbControl)||o.destroy(),this.breadcrumbControl=null,this.graph.setBreadcrumbHandler(null)),this.graph}}"undefined"!=typeof window&&(window.ApexTree=e7)}
26,5539:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var i=n(2115),o=n(2591),r=n(2758),s=n.n(r);function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(null,arguments)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){!function(e,t,n){var i;(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var c=["type","width","height","series","options","chartRef"];function u(e){return e&&"object"===h(e)&&!Array.isArray(e)}function p(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new WeakSet;if(e===t)return!0;if("object"!==h(e)||null===e||"object"!==h(t)||null===t)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var r=0;r<i.length;r++){var s=i[r];if(!o.includes(s)||!p(e[s],t[s],n))return!1}return!0}var g=["type","series","options","width","height","chartRef"];function f(e){var t=e.type,n=void 0===t?"line":t,r=e.width,s=void 0===r?"100%":r,l=e.height,h=void 0===l?"auto":l,f=e.series,m=e.options,v=e.chartRef,y=function(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n={};for(var i in e)if(({}).hasOwnProperty.call(e,i)){if(t.includes(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.includes(n)||({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,c),b=(0,i.useRef)(null),x=(0,i.useRef)(null),w=(0,i.useRef)(null),C=v||w,E=function(){return function e(t,n){var i=d({},t);return u(t)&&u(n)&&Object.keys(n).forEach(function(o){u(n[o])?i[o]=o in t?e(t[o],n[o]):n[o]:i[o]=n[o]}),i}(m,{chart:{type:n,height:h,width:s},series:f})};(0,i.useEffect)(function(){return C.current=new o.A(b.current,E()),C.current.render(),x.current=m,function(){try{C.current&&"function"==typeof C.current.destroy&&C.current.destroy()}catch(e){}finally{C.current=null}}},[]),(0,i.useEffect)(function(){if(C.current&&C.current.w){var e=!p(C.current.w.config.series,f),t=!p(x.current,m)||h!==C.current.opts.chart.height||s!==C.current.opts.chart.width;(e||t)&&(e?t?C.current.updateOptions(E()):C.current.updateSeries(f):C.current.updateOptions(E())),x.current=m}},[m,f,h,s]);var S,A=(S=d({},y),g.forEach(function(e){delete S[e]}),S);return i.createElement("div",a({ref:b},A))}f.propTypes={type:s().string.isRequired,series:s().array.isRequired,options:s().object.isRequired,width:s().oneOfType([s().string,s().number]),height:s().oneOfType([s().string,s().number]),chartRef:s().shape({current:s().any})}},8203:(e,t,n)=>{"use strict";n.d(t,{Qn:()=>te});let i=()=>{};class o{constructor(e,t){this.injectedStyles=new Set,this.trackedTooltips=new Set,this.instanceId=t||Math.random().toString(36).substr(2,9),this.context=this.detectContext(e),this.chartContainer=e}getChartContainer(){return this.chartContainer}getChartScopedContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.chartContainer||this.context}detectContext(e){let t=e.getRootNode();return t instanceof ShadowRoot?t:document}getContext(){return this.context}getInstanceId(){return this.instanceId}isShadowDOM(){return this.context instanceof ShadowRoot}createElement(e){return document.createElement(e)}createElementNS(e,t){return document.createElementNS(e,t)}createTextNode(e){return document.createTextNode(e)}getElementById(e){return this.context===document?document.getElementById(e):this.context.querySelector(`#${e}`)}getElementsByClassName(e){if(this.context===document)return document.getElementsByClassName(e);let t=Array.from(this.context.querySelectorAll(`.${e}`));return{item:e=>t[e]||null,get length(){return t.length},[Symbol.iterator]:()=>t[Symbol.iterator](),...Object.fromEntries(t.map((e,t)=>[t,e]))}}querySelector(e){return this.context.querySelector(e)}querySelectorAll(e){return this.context.querySelectorAll(e)}getAppendContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.context}getChartBounds(){var e;return(null==(e=this.chartContainer)?void 0:e.getBoundingClientRect())||new DOMRect}getBody(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.context.host}dispatchEvent(e){this.context===document?document.dispatchEvent(e):this.context.dispatchEvent(e)}
26addEventListener(e,t,n){this.context===document||"mousemove"===e||"mouseup"===e||"keydown"===e?document.addEventListener(e,t,n):this.context.addEventListener(e,t,n)}removeEventListener(e,t,n){this.context===document||"mousemove"===e||"mouseup"===e||"keydown"===e?document.removeEventListener(e,t,n):this.context.removeEventListener(e,t,n)}injectStyles(e,t,n={}){let{force:i=!1,priority:o="normal"}=n;if(!i&&this.injectedStyles.has(t))return;if(i){let e=this.context.querySelector(`#${t}`);e&&(e.remove(),this.injectedStyles.delete(t))}if(this.context.querySelector(`#${t}`)&&!i)return void this.injectedStyles.add(t);let r=document.createElement("style");if(r.id=t,r.textContent=e,"normal"!==o&&r.setAttribute("data-priority",o),this.context===document)document.head.appendChild(r);else{let e=this.context;"high"===o?e.insertBefore(r,e.firstChild):e.appendChild(r)}this.injectedStyles.add(t)}injectStylesheets(e){e.forEach(({content:e,id:t,options:n})=>{this.injectStyles(e,t,n)})}hasInjectedStyles(e){return this.injectedStyles.has(e)}removeStyles(e){let t=this.context.querySelector(`#${e}`);t&&(t.remove(),this.injectedStyles.delete(e))}removeAllStyles(){this.injectedStyles.forEach(e=>{let t=this.context.querySelector(`#${e}`);t&&t.remove()}),this.injectedStyles.clear()}getInjectedStyleIds(){return Array.from(this.injectedStyles)}getActiveElement(){return this.context===document?document.activeElement:this.context.activeElement||document.activeElement}trackTooltip(e){this.trackedTooltips.add(e)}destroy(){this.removeAllStyles(),this.injectedStyles.clear(),this.trackedTooltips.forEach(e=>e.remove()),this.trackedTooltips.clear()}}
26class r{constructor(e,t){if(!e)throw Error("Container element is required");this.element=e,this.chartContext=new o(e,t)}getContext(){return this.chartContext}isShadowDOM(){return this.chartContext.isShadowDOM()}getTooltipContainer(){return this.chartContext.getAppendContainer()}injectStyles(e,t){this.chartContext.injectStyles(e,t)}createElement(e){return this.chartContext.createElement(e)}querySelector(e){return this.chartContext.querySelector(e)}addEventListener(e,t,n){this.chartContext.addEventListener(e,t,n)}removeEventListener(e,t,n){this.chartContext.removeEventListener(e,t,n)}dispatchEvent(e){this.chartContext.dispatchEvent(e)}destroy(){this.chartContext.destroy()}getInstanceId(){return this.chartContext.getInstanceId()}}class s{constructor(e,t="apex"){this.canvas=e,this.prefix=t}getSvgString(){let e=this.canvas.node.cloneNode(!0),t=this.canvas.node.viewBox.baseVal;return t.width&&t.height&&(e.setAttribute("width",String(t.width)),e.setAttribute("height",String(t.height))),(new XMLSerializer).serializeToString(e)}svgUrl(){let e=new Blob([this.getSvgString()],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)}triggerDownload(e,t){let n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}exportToSVG(){this.triggerDownload(this.svgUrl(),`${this.prefix}-${(new Date).getTime()}.svg`)}}let a="http://www.w3.org/2000/svg",l=0;class d{constructor(e){this.node=e}attr(e,t){if("string"==typeof e)return void 0!==t?(this.node.setAttribute(e,String(t)),this):this.node.getAttribute(e);for(let[t,n]of Object.entries(e))null!=n&&this.node.setAttribute(t,String(n));return this}id(e){return this.node.setAttribute("id",e),this}fill(e){if(!e)return this;if(e instanceof SVGElement){let t=e.id;this.node.setAttribute("fill",`url(#${t})`)}else this.node.setAttribute("fill",e);return this}stroke({color:e,width:t,dasharray:n}={}){return void 0!==e&&this.node.setAttribute("stroke",e),void 0!==t&&this.node.setAttribute("stroke-width",String(t)),void 0!==n&&this.node.setAttribute("stroke-dasharray",String(n)),this}opacity(e){return this.node.setAttribute("opacity",String(e)),this}add(e){let t=e instanceof d?e.node:e;return this.node.appendChild(t),this}on(e,t){return this.node.addEventListener(e,t),this}findOne(e){let t=this.node.querySelector(e);return t?new d(t):null}first(){let e=this.node.firstElementChild;return e?new d(e):null}}class h extends d{constructor(e){super(document.createElementNS(a,"g")),e&&this.attr(e)}}class c extends d{constructor(){super(document.createElementNS(a,"rect"))}}class u extends d{constructor(e){super(document.createElementNS(a,"path")),e&&this.attr(e)}}class p extends d{constructor(){super(document.createElementNS(a,"text"))}font({fill:e,size:t}){return void 0!==e&&this.node.setAttribute("fill",e),void 0!==t&&this.node.setAttribute("font-size",String(t)),this}tspan(e){let t=document.createElementNS(a,"tspan");return t.textContent=e,this.node.appendChild(t),this}move(e,t){return this.node.setAttribute("x",String(e)),this.node.setAttribute("y",String(t)),this}}class g{constructor(e){this.gradient=e}stop(e,t){let n=document.createElementNS(a,"stop");n.setAttribute("offset",String(e)),n.setAttribute("stop-color",t??"transparent"),this.gradient.appendChild(n)}}function f(e,t){e.setAttribute("viewBox",`${t.x} ${t.y} ${t.w} ${t.h}`)}class m{constructor(e){this._defs=null,this._panZoomState=null,this.node=e}addTo(e){return e.appendChild(this.node),this}size(e,t){return this.node.setAttribute("width",String(e)),this.node.setAttribute("height",String(t)),this}viewbox(e){if(void 0===e){let e=this.node.viewBox.baseVal;return{x:e.x,y:e.y,width:e.width,height:e.height}}if(this.node.setAttribute("viewBox",e),this._panZoomState){let e=this.node.viewBox.baseVal;this._panZoomState.vb={x:e.x,y:e.y,w:e.width,h:e.height}}return this}attr(e){for(let[t,n]of Object.entries(e))null!=n&&this.node.setAttribute(t,String(n));return this}add(e){return this.node.appendChild(e instanceof d?e.node:e),this}clear(){let e=this._defs;return this.node.innerHTML="",e&&(this.node.appendChild(e),this._defs=e),this}svg(){return this.node.innerHTML}gradient(e,t){this._defs||(this._defs=document.createElementNS(a,"defs"),this.node.insertBefore(this._defs,this.node.firstChild));let n=document.createElementNS(a,"linearGradient"),i="apx-grad-"+ ++l;return n.setAttribute("id",i),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2","100%"),n.setAttribute("y2","0%"),t(new g(n)),this._defs.appendChild(n),n}panZoom(e={}){return this._panZoomState=function(e,t){let n=function(e){let t=e.viewBox.baseVal;return{x:t.x,y:t.y,w:t.width,h:t.height}}(e),i={zoomMin:t.zoomMin??.1,currentZoom:1,baseVb:{...n},vb:{...n}};e.addEventListener("wheel",t=>{if(!t.ctrlKey&&!t.metaKey)return;t.preventDefault();let n=1+Math.max(-.12,Math.min(.12,.0025*t.deltaY)),o=i.currentZoom/n;if(o<i.zoomMin)return;let r=e.getBoundingClientRect(),s=(t.clientX-r.left)/r.width,a=(t.clientY-r.top)/r.height,{vb:l}=i,d=l.w*n,h=l.h*n;i.vb={x:l.x+s*(l.w-d),y:l.y+a*(l.h-h),w:d,h:h},i.currentZoom=o,f(e,i.vb)},{passive:!1});let o=!1,r=!1,s=-1,a=0,l=0;e.addEventListener("pointerdown",e=>{0===e.button&&(e.preventDefault(),o=!0,r=!1,s=e.pointerId,a=e.clientX,l=e.clientY)}),e.addEventListener("pointermove",t=>{if(!o||t.pointerId!==s)return;if(!r){let n=t.clientX-a,i=t.clientY-l;if(4>Math.abs(n)&&4>Math.abs(i))return;r=!0,e.setPointerCapture(t.pointerId),e.style.cursor="grabbing",e.style.userSelect="none"}let n=e.getBoundingClientRect(),d=i.vb.w/n.width,h=i.vb.h/n.height,c=(t.clientX-a)*d,u=(t.clientY-l)*h;i.vb={x:i.vb.x-c,y:i.vb.y-u,w:i.vb.w,h:i.vb.h},f(e,i.vb),a=t.clientX,l=t.clientY});let d=t=>{o&&t.pointerId===s&&(r&&(e.releasePointerCapture(t.pointerId),e.style.cursor="",e.style.userSelect=""),o=!1,r=!1,s=-1)};return e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),i}(this.node,e),this}resetPanZoomBase(){if(!this._panZoomState)return;let e=this.node.viewBox.baseVal;this._panZoomState.baseVb={x:e.x,y:e.y,w:e.width,h:e.height},this._panZoomState.vb={x:e.x,y:e.y,w:e.width,h:e.height},this._panZoomState.currentZoom=1}zoom(e){var t;if(void 0===e)return(null==(t=this._panZoomState)?void 0:t.currentZoom)??1;if(!this._panZoomState)return this;let n=this._panZoomState;if(e<n.zoomMin)return this;let i=n.currentZoom/e,{vb:o}=n,r=o.w*i,s=o.h*i;return n.vb={x:o.x+.5*(o.w-r),y:o.y+.5*(o.h-s),w:r,h:s},n.currentZoom=e,f(this.node,n.vb),this}}function v(e="",{fontColor:t="#666767",pointerEvents:n="all",textAnchor:i="start",x:o,y:r}={}){let s=new p;return s.font({fill:t}),s.tspan(e),void 0!==o&&void 0!==r&&s.move(o,r),s.attr({"pointer-events":n,"text-anchor":i}),s}function y(e,t,n,i){let o=new h;
26return o.attr({"data-parent":i,"data-self":n,transform:void 0!==e&&void 0!==t?`translate(${e}, ${t})`:void 0}),o}function b(e,{edgeColor:t,id:n="",opacity:i=1}={}){let o=new u({d:e});return o.id(n),o.fill(t).opacity(i),o}let x={export:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">\n    <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>\n    <polyline points="7 10 12 15 17 10"/>\n    <line x1="12" y1="15" x2="12" y2="3"/>\n  </svg>',"zoom-in":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">\n    <circle cx="11" cy="11" r="8"/>\n    <path d="m21 21-4.35-4.35"/>\n    <line x1="11" y1="8" x2="11" y2="14"/>\n    <line x1="8" y1="11" x2="14" y2="11"/>\n  </svg>',"zoom-out":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">\n    <circle cx="11" cy="11" r="8"/>\n    <path d="m21 21-4.35-4.35"/>\n    <line x1="8" y1="11" x2="14" y2="11"/>\n  </svg>',"fit-screen":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">\n    <path d="M8 3H5a2 2 0 0 0-2 2v3"/>\n    <path d="M21 8V5a2 2 0 0 0-2-2h-3"/>\n    <path d="M3 16v3a2 2 0 0 0 2 2h3"/>\n    <path d="M16 21h3a2 2 0 0 0 2-2v-3"/>\n  </svg>'};class w{constructor(e,t){this.element=e,e&&(this.chartContext=t||new o(e),this.injectStyles())}injectStyles(){let e=`toolbar-styles-${this.chartContext.getInstanceId()}`;this.chartContext.injectStyles("\n  #toolbar {\n    display: flex;\n    gap: 2px;\n    position: absolute;\n    /* Logical inset: stays on the right in LTR, mirrors to the left in RTL\n       (so it never collides with RTL-flipped chrome such as the search box). */\n    inset-inline-end: 12px;\n    top: 12px;\n    z-index: 100;\n    user-select: none;\n    background: var(--toolbar-bg-color, rgba(255, 255, 255, 0.92));\n    border: 1px solid var(--toolbar-border-color, rgba(0, 0, 0, 0.08));\n    border-radius: 10px;\n    padding: 4px;\n    box-shadow:\n      0 1px 3px rgba(0, 0, 0, 0.08),\n      0 4px 12px rgba(0, 0, 0, 0.06);\n    backdrop-filter: blur(8px);\n    -webkit-backdrop-filter: blur(8px);\n  }\n\n  .toolbar-item {\n    align-items: center;\n    background-color: transparent;\n    border: none;\n    border-radius: 6px;\n    color: var(--toolbar-icon-color, #444);\n    cursor: pointer;\n    display: flex;\n    height: 30px;\n    justify-content: center;\n    width: 30px;\n    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;\n    position: relative;\n    flex-shrink: 0;\n  }\n\n  .toolbar-item:hover {\n    background-color: var(--toolbar-hover-bg-color, rgba(0, 0, 0, 0.06));\n    color: var(--toolbar-icon-hover-color, #111);\n    transform: translateY(-1px);\n    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);\n  }\n\n  .toolbar-item:active {\n    transform: translateY(0);\n    box-shadow: none;\n    background-color: var(--toolbar-active-bg-color, rgba(0, 0, 0, 0.1));\n  }\n\n  .toolbar-item:focus-visible {\n    outline: none;\n    box-shadow: 0 0 0 2px var(--button-bg-color, #0066cc);\n  }\n\n  .toolbar-item svg {\n    width: 15px;\n    height: 15px;\n    pointer-events: none;\n    flex-shrink: 0;\n  }\n\n  .toolbar-item[disabled] {\n    opacity: 0.4;\n    cursor: not-allowed;\n    pointer-events: none;\n  }\n\n  /* Tooltip */\n  .toolbar-item::after {\n    content: attr(data-tooltip);\n    position: absolute;\n    bottom: calc(100% + 8px);\n    left: 50%;\n    transform: translateX(-50%);\n    background: var(--tooltip-bg-color, rgba(30, 30, 30, 0.92));\n    color: var(--tooltip-text-color, #fff);\n    padding: 5px 9px;\n    border-radius: 6px;\n    font-size: 11.5px;\n    font-weight: 500;\n    white-space: nowrap;\n    opacity: 0;\n    pointer-events: none;\n    transition: opacity 0.15s ease;\n    z-index: 1000;\n    letter-spacing: 0.01em;\n  }\n\n  .toolbar-item::before {\n    content: '';\n    position: absolute;\n    bottom: calc(100% + 3px);\n    left: 50%;\n    transform: translateX(-50%);\n    border: 4px solid transparent;\n    border-top-color: var(--tooltip-bg-color, rgba(30, 30, 30, 0.92));\n    opacity: 0;\n    pointer-events: none;\n    transition: opacity 0.15s 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: 2px;\n    position: absolute;\n    inset-inline-end: 12px;\n    top: 12px;\n    z-index: 100;\n  }\n",e)}createToolbarItem(e,t,n){let i=this.chartContext.createElement("div");return i.id=e,i.className="toolbar-item",i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.innerHTML=t,n&&(i.setAttribute("data-tooltip",n),i.setAttribute("aria-label",n)),i.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i.click())}),i}render({enableExport:e=!1,enableFitscreen:t=!1,enableZoom:n=!1,onExport:o=i,onFitscreen:r=i,onZoom:s=i}){if(!this.element)return;let a=this.chartContext.querySelector("#toolbar");null==a||a.remove();let l=this.chartContext.createElement("div");if(l.id="toolbar",l.setAttribute("role","toolbar"),l.setAttribute("aria-label","Chart controls"),e){let e=this.createToolbarItem("export",x.export,"Export chart");e.addEventListener("click",()=>{o()}),l.append(e)}
26if(n){let e=this.createToolbarItem("zoom-in",x["zoom-in"],"Zoom in"),t=this.createToolbarItem("zoom-out",x["zoom-out"],"Zoom out");e.addEventListener("click",()=>{s(.1)}),t.addEventListener("click",()=>{s(-.1)}),l.append(e,t)}if(t){let e=this.createToolbarItem("fit-screen",x["fit-screen"],"Fit to screen");e.addEventListener("click",()=>{r()}),l.append(e)}this.element.append(l)}destroy(){let e=this.chartContext.querySelector("#toolbar");null==e||e.remove()}}let C="aria-hidden",E=(e,t="apex-tooltip-container")=>{let n=e.getElementById(t);return n||((n=e.createElement("div")).id=t,n.setAttribute("role","tooltip"),n.setAttribute(C,"true"),e.getAppendContainer().appendChild(n),e.trackTooltip(n)),n},S=(e,t="",n,i="",o=!1)=>{let r=e.getElementById(t);if(!r)return E(e,t),S(e,t,n,i,o);if(n&&i){let t=i.includes("tooltip-content"),s=n.match(/background-color:\s*([^;]+);?/),a=n.match(/color:\s*([^;]+);?/);if(t||!s)r.innerHTML=i;else{let e=s[1],t=a?a[1]:"white";r.innerHTML=`<div class="tooltip-content" style="background-color: ${e}; color: ${t};">${i}</div>`}let l=n+"; display: block !important; visibility: visible !important; opacity: 1 !important;";if(r.setAttribute("style",l),r.classList.add("visible"),r.setAttribute(C,"false"),o&&"undefined"!=typeof window){let t=r.offsetWidth,n=parseFloat(r.style.left),i=e.getChartBounds();if(t>0&&!Number.isNaN(n)&&i.width>0){let e=window.scrollX||document.documentElement.scrollLeft||0,o=i.left+e,s=((e,t,n,i,o=8)=>{if(e+t<=n-o)return e;let r=e-t;return r<i+o?Math.max(i+o,n-t-o):r})(n,t,i.right+e,o);s!==n&&(r.style.left=`${s}px`)}}}else r.removeAttribute("style"),r.classList.remove("visible"),r.setAttribute(C,"true"),r.innerHTML=""},A=(e={})=>{let t=[];for(let n in e){let i=`${n.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}: ${e[n]};`;t.push(i)}return t.join(" ")},k=({bgColor:e,borderColor:t,fontColor:n,fontFamily:i,fontSize:o,fontWeight:r,maxWidth:s,padding:a,placement:l="top",x:d,y:h})=>{let 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: ${d}px;`),c.push(`top: ${h}px;`),c.push(`data-placement: ${l};`),s&&(c.push(`width: ${s}px;`),c.push(`max-width: ${s}px;`)),t&&c.push(`border: 1px solid ${t};`),n&&c.push(`color: ${n};`),i&&c.push(`font-family: ${i};`),r&&c.push(`font-weight: ${r};`),o&&c.push(`font-size: ${o};`),e&&(c.push(`background-color: ${e};`),c.push("border-radius: 6px;"),c.push("box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);")),void 0!==a&&c.push(`padding: ${a}px;`),c.join(" ")},M=globalThis.console;function $(e,...t){M.error(e,...t)}let L="APEX-",N=new Date("2027-07-31T00:00:00Z"),T="__apex_license_v1__";function F(){let e=globalThis,t=e[T];return t||(t={key:null,listeners:new Set,result:null},e[T]=t),t}let B=class{static get licenseKey(){return F().key}static set licenseKey(e){F().key=e}static get listeners(){return F().listeners}static get validationResult(){return F().result}static set validationResult(e){F().result=e}static getKey(){return this.licenseKey}static getLicenseStatus(){return this.licenseKey?(this.validationResult=this.validateKey(this.licenseKey),this.validationResult):{expired:!1,signatureVerified:!1,valid:!1}}static isKeyValid(e){return!!e&&this.validateKey(e).valid}static isLicenseValid(){return this.getLicenseStatus().valid}static onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}static setLicense(e){var t,n;if(!e)return this.licenseKey=null,void this.publish({expired:!1,signatureVerified:!1,valid:!1});let i=this.validateKey(e);!i.valid&&e!==this.licenseKey&&(null==(t=this.validationResult)?void 0:t.valid)?(n=`[Apex] Ignoring license key: ${i.message??"it is not valid"} A valid license is already active on this page.`,M.warn(n)):(this.licenseKey=e,this.publish(i),i.valid||$(`[Apex] ${i.message}`))}static validateKey(e){let t=this.parseKey(e),n=this.validateStructure(e,t);if(!n.valid||!(null==t?void 0:t.signature))return n;let i=this.verdicts.get(e);return!1===i?{data:t.data,expired:!1,message:"Invalid license key. The license signature does not verify.",signatureVerified:!0,valid:!1}:(void 0===i&&this.verifySignature(e,t,n),{...n,signatureVerified:!0===i})}static _resetSignatureState(){this.verdicts.clear(),this.verifying.clear(),this.warnedUnver
26ifiable=!1,this.epoch++}static base64ToBytes(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(4*Math.ceil(t.length/4),"="),i=globalThis.atob;if("function"!=typeof i)throw Error("no base64 decoder available");let o=i(n),r=new Uint8Array(o.length);for(let e=0;e<o.length;e++)r[e]=o.charCodeAt(e);return r}static canonicalPayload(e){let t=e.domains&&e.domains.length>0?e.domains.join(","):"";return`v1|${e.issueDate}|${e.expiryDate}|${e.plan}|${t}`}static notify(e){for(let t of this.listeners)try{t(e)}catch{}}static parseKey(e){if("string"!=typeof e||!e.startsWith(L))return null;let t=e.slice(5);if(!t)return null;try{let e=(new TextDecoder).decode(this.base64ToBytes(t)),n=JSON.parse(e);return n.issueDate&&n.expiryDate&&n.plan?{data:{domains:Array.isArray(n.domains)?n.domains:void 0,expiryDate:n.expiryDate,issueDate:n.issueDate,plan:n.plan,valid:!0},signature:"string"==typeof n.sig&&n.sig?n.sig:null}:null}catch{return null}}static publish(e){this.validationResult=e,this.notify(e)}static validateStructure(e,t){let n=e=>({expired:!1,message:e,signatureVerified:!1,valid:!1});if("string"!=typeof e||!e.startsWith(L))return n('Invalid license key format. License key must start with "APEX-".');if(!t)return n("Invalid license key. Unable to decode license data.");let{data:i,signature:o}=t;if(!o&&new Date>=N)return n("This license key is in the old unsigned format, which is no longer accepted. Please request a replacement key.");if(new Date(i.expiryDate)<new Date)return{data:i,expired:!0,message:`License expired on ${i.expiryDate}. Please renew your license.`,signatureVerified:!1,valid:!1};if(i.domains&&i.domains.length>0){let e="undefined"==typeof location?"":location.hostname;if(!i.domains.some(t=>e===t||e.endsWith(`.${t}`)))return{data:i,expired:!1,message:`License is not valid for this domain (${e}). Allowed domains: ${i.domains.join(", ")}.`,signatureVerified:!1,valid:!1}}return{data:i,expired:!1,signatureVerified:!1,valid:!0}}static async verifySignature(e,t,n){var i,o;if(this.verifying.has(e)||this.verdicts.has(e))return;this.verifying.add(e);let r=this.epoch,s=null==(i=globalThis.crypto)?void 0:i.subtle;if(!s||0===this.publicKeysSpki.length)return this.verifying.delete(e),void(this.warnedUnverifiable||(this.warnedUnverifiable=!0,o=s?"[Apex] No license signing key is configured in this build, so license signatures cannot be verified.":"[Apex] Web Crypto is unavailable (a secure context is required), so the license signature cannot be verified.",M.warn(o)));let a=(new TextEncoder).encode(this.canonicalPayload(t.data)),l=!1;for(let e of this.publicKeysSpki){try{let n=await s.importKey("spki",this.base64ToBytes(e),{name:"ECDSA",namedCurve:"P-256"},!1,["verify"]);l=await s.verify({hash:"SHA-256",name:"ECDSA"},n,this.base64ToBytes(t.signature),a)}catch{l=!1}if(l)break}if(this.verifying.delete(e),this.epoch!==r)return;if(this.verdicts.set(e,l),l){let t={...n,signatureVerified:!0};return void(this.licenseKey===e?this.publish(t):this.notify(t))}let d="Invalid license key. The license signature does not verify.",h={data:t.data,expired:!1,message:d,signatureVerified:!0,valid:!1};this.licenseKey===e?this.publish(h):this.notify(h),$(`[Apex] ${d}`)}};B.publicKeysSpki=["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQIaK9UMD6n0oR/FIy8QdL0uSzKMQlf1BB+tOrji4/WuHsyRNxeDhVykoSsNURozMi1xhmqWvBH1L//xIfugTPA=="],B.verdicts=new Map,B.verifying=new Set,B.warnedUnverifiable=!1,B.epoch=0;let I=class{static applyStyles(e){Object.assign(e.style,this.CRITICAL_STYLES,{backgroundImage:this.createWatermarkPattern(),backgroundRepeat:"repeat"})}static node(e){return e?e.querySelector(`[${this.WATERMARK_ATTR}]`):null}static add(e,t){return e&&"undefined"!=typeof document?(this.setManaged(e,t),this.paint(e)):null}static exists(e){return!!this.node(e)}static remove(e,t){e&&(this.setManaged(e,t),this.erase(e))}static untrack(e){this.managed.delete(e)}static createWatermarkPattern(){let e=this.WATERMARK_TEXT;return`url("data:image/svg+xml,${encodeURIComponent(`
27      <svg xmlns="http://www.w3.org/2000/svg" width="300" height="200">
28        <text
29          x="50%"
30          y="50%"
31          dominant-baseline="middle"
32          text-anchor="middle"
33          font-family="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Arial, sans-serif"
34          font-size="18"
35          font-weight="600"
36          fill="rgba(134, 134, 134, 0.1)"
37          transform="rotate(-35, 100, 60)"
38        >${e}</text>
39      </svg>
40    `.trim())}")`}static erase(e){var t;null==(t=this.node(e))||t.remove()}static paint(e){let t=this.node(e);return t||((t=document.createElement("div")).setAttribute(this.WATERMARK_ATTR,""),e.appendChild(t)),this.applyStyles(t),"function"==typeof getComputedStyle&&"static"===getComputedStyle(e).position&&(e.style.position="relative"),t}static reconcile(){let e=B.isLicenseValid();for(let t of this.managed)t.isConnected?e?this.erase(t):this.paint(t):this.managed.delete(t)}static setManaged(e,t){!1!==(null==t?void 0:t.manage)?this.track(e):this.managed.delete(e)}static track(e){this.managed.add(e),this.subscribed||(this.subscribed=!0,B.onChange(()=>{this.reconcile()}))}};function O(e,t){e&&("ltr"===t?e.removeAttribute("dir"):e.setAttribute("dir",t))}I.WATERMARK_ATTR="data-apexcharts-watermark",I.WATERMARK_TEXT="APEXCHARTS",I.ATTR="data-apexcharts-watermark",I.CRITICAL_STYLES={bottom:"0",display:"block",left:"0",msUserSelect:"none",opacity:"1",pointerEvents:"none",position:"absolute",right:"0",top:"0",userSelect:"none",visibility:"visible",webkitUserSelect:"none",zIndex:"10000"},I.managed=new Set,I.subscribed=!1;let R=1/45,P={velocity:.01,displacement:.001};function D(e,t){e.value=t,e.target=t,e.velocity=0}function z(e){let t=e.restVelocity??.05,n=e.restDisplacement??.05;return Math.abs(e.velocity)<t&&Math.abs(e.value-e.target)<n}let W={crisp:[210,26]};
40class j{constructor(e={}){this.mql=null,this.handler=null,this.ownsClass=!1,this.element=e.element??null,this.className=e.className??"",this.onChange=e.onChange,"undefined"!=typeof window&&"function"==typeof window.matchMedia&&(this.mql=window.matchMedia("(prefers-reduced-motion: reduce)"),this.applyClass(this.mql.matches),this.handler=e=>{var t;this.applyClass(e.matches),null==(t=this.onChange)||t.call(this,e.matches)},"function"==typeof this.mql.addEventListener?this.mql.addEventListener("change",this.handler):"function"==typeof this.mql.addListener&&this.mql.addListener(this.handler))}get matches(){var e;return!!(null==(e=this.mql)?void 0:e.matches)||!(!this.className||!this.element)&&this.element.classList.contains(this.className)}dispose(){this.mql&&this.handler&&("function"==typeof this.mql.removeEventListener?this.mql.removeEventListener("change",this.handler):"function"==typeof this.mql.removeListener&&this.mql.removeListener(this.handler),this.mql=null,this.handler=null)}applyClass(e){this.element&&this.className&&(e?this.element.classList.contains(this.className)||(this.element.classList.add(this.className),this.ownsClass=!0):this.ownsClass&&(this.element.classList.remove(this.className),this.ownsClass=!1))}}class H{constructor(e={}){this.objects=new Map,this.frameHandle=null,this.lastTime=null,this.disposed=!1,this.opts=e;let[t,n]=e.spring??W.crisp??W.crisp;this.stiffness=t,this.damping=n,this.rest=e.rest;let i=e.clock??{};this.now=i.now??(()=>"undefined"!=typeof performance?performance.now():Date.now()),this.raf=i.raf??(e=>requestAnimationFrame(e)),this.caf=i.caf??(e=>cancelAnimationFrame(e)),this.reducedMotionOverride=e.reducedMotion,this.reducedMotionWatcher=void 0===e.reducedMotion?new j({element:e.element,className:e.reducedMotionClass,onChange:e=>{e&&null!==this.frameHandle&&this.snapAll()}}):null}get reducedMotion(){var e;return this.reducedMotionOverride??(null==(e=this.reducedMotionWatcher)?void 0:e.matches)??!1}has(e){return this.objects.has(e)}get size(){return this.objects.size}ids(){return this.objects.keys()}dataOf(e){var t;return null==(t=this.objects.get(e))?void 0:t.data}valuesOf(e){let t=this.objects.get(e);return t?_(t):void 0}channelValue(e,t){var n,i;return null==(i=null==(n=this.objects.get(e))?void 0:n.channels.get(t))?void 0:i.value}targetOf(e,t){var n,i;return null==(i=null==(n=this.objects.get(e))?void 0:n.channels.get(t))?void 0:i.target}add(e,t,n,i={}){var o;let r=this.objects.get(e);if(r)return r.data=n,r.delayMs=i.delayMs??0,r.paused=!1,void(r.settled=!1);let[s,a]=i.spring??[this.stiffness,this.damping],l=i.rest??this.rest,d=new Map;for(let e of Object.keys(t))d.set(e,function(e,t,n,i){let o={value:e,velocity:0,target:e,stiffness:t,damping:n};return void 0!==(null==i?void 0:i.velocity)&&(o.restVelocity=i.velocity),void 0!==(null==i?void 0:i.displacement)&&(o.restDisplacement=i.displacement),o}(t[e],s,a,(null==(o=i.channelRest)?void 0:o[e])??l));this.objects.set(e,{id:e,data:n,channels:d,delayMs:i.delayMs??0,pauseOnSettle:i.pauseOnSettle??!1,paused:!1,settled:!1})}setData(e,t){let n=this.objects.get(e);n&&(n.data=t)}retarget(e,t,n={}){let i=this.objects.get(e);if(!i)return;i.paused=!1,i.settled=!1,void 0!==n.delayMs&&(i.delayMs=n.delayMs);let o=this.reducedMotion;for(let e of Object.keys(t)){let n=i.channels.get(e);n&&(o?(D(n,t[e]),i.delayMs=0):n.target=t[e])}}snap(e,t){let n=this.objects.get(e);if(n){for(let e of Object.keys(t)){let i=n.channels.get(e);i&&D(i,t[e])}n.delayMs=0}}pause(e){let t=this.objects.get(e);t&&(t.paused=!0)}remove(e){this.objects.delete(e)}clear(){this.stop(),this.objects.clear()}atRest(){for(let e of this.objects.values())if(!e.paused){if(e.delayMs>0)return!1;for(let t of e.channels.values())if(t.value!==t.target||0!==t.velocity)return!1}return!0}writeAll(e){var t,n;for(let t of this.objects.values())t.paused||e&&!e(t.id,t.data)||this.write(t);null==(n=(t=this.opts).onFrame)||n.call(t)}step(e){var t,n;let i=!0;for(let t of Array.from(this.objects.values())){if(t.paused||!this.objects.has(t.id))continue;if(t.delayMs>0){t.delayMs-=1e3*e,i=!1;continue}let n=!0;for(let i of t.channels.values())(function(e,t){if(t<=0)return z(e);let n=t;for(;n>0;){let t=Math.min(n,R),i=-e.stiffness*(e.value-e.target)-e.damping*e.velocity;
40e.velocity+=i*t,e.value+=e.velocity*t,n-=t}return!!z(e)&&(e.value=e.target,e.velocity=0,!0)})(i,e)||(n=!1);this.write(t),n?t.settled||(t.settled=!0,this.settle(t)||t.pauseOnSettle&&(t.paused=!0)):(t.settled=!1,i=!1)}return null==(n=(t=this.opts).onFrame)||n.call(t),i}start(){if(this.disposed||null!==this.frameHandle)return;this.lastTime=null;let e=t=>{if(this.frameHandle=null,this.disposed)return;if(this.reducedMotion)return void this.snapAll();let n=this.lastTime??t;this.lastTime=t;let i=Math.min(Math.max(0,(t-n)/1e3),.05);this.step(i)?this.lastTime=null:this.frameHandle=this.raf(e)};this.frameHandle=this.raf(e)}settleNow(){this.disposed||this.snapAll()}stop(){null!==this.frameHandle&&(this.caf(this.frameHandle),this.frameHandle=null),this.lastTime=null}get running(){return null!==this.frameHandle}dispose(){var e;this.disposed||(this.disposed=!0,this.stop(),this.objects.clear(),null==(e=this.reducedMotionWatcher)||e.dispose())}get isDisposed(){return this.disposed}snapAll(){var e,t;for(let e of(this.stop(),Array.from(this.objects.values())))if(!e.paused&&this.objects.has(e.id)){for(let t of e.channels.values())D(t,t.target);e.delayMs=0,this.write(e),e.settled||(e.settled=!0,this.settle(e)||e.pauseOnSettle&&(e.paused=!0))}null==(t=(e=this.opts).onFrame)||t.call(e)}settle(e){var t,n;return!0===(null==(n=(t=this.opts).onSettle)?void 0:n.call(t,e.id,e.data))&&(this.objects.delete(e.id),!0)}write(e){var t,n;null==(n=(t=this.opts).write)||n.call(t,e.id,_(e),e.data)}}function _(e){let t={};for(let[n,i]of e.channels)t[n]=i.value;return t}let G="__apexcharts_themes__",q={accent:"--apx-accent",fore:"--apx-fore",grid:"--apx-grid",surface:"--apx-surface"};function K(e,t){if(0===e.length)return;let n,i=0;for(let o=e.length-1;o>=0;--o)n=(e[o].dy??0)/2,(e[o][t]??0)-n<i&&(e[o][t]=Math.min(e[o].Rmax??0,i+n)),i=(e[o][t]??0)+n;let o=(e[0].Rmax??0)+(e[0].dy??0)/2;for(let i=0;i<e.length;++i)n=(e[i].dy??0)/2,(e[i][t]??0)+n>o&&(e[i][t]=Math.max(n,o-n)),o=(e[i][t]??0)-n}function Z(e,t,n){return t.slice().sort((t,i)=>{let o,r;if("outgoing"===n){let n=e.node(t.w),s=e.node(i.w);o=(null==n?void 0:n.y)??0,r=(null==s?void 0:s.y)??0}else{let n=e.node(t.v),s=e.node(i.v);o=(null==n?void 0:n.y)??0,r=(null==s?void 0:s.y)??0}if(Math.abs(o-r)>.001)return o-r;if(t.name!==i.name){if("number"==typeof t.name&&"number"==typeof i.name)return t.name-i.name;if("string"==typeof t.name&&"string"==typeof i.name)return t.name.localeCompare(i.name)}return 0})}function V(e,t){e.forEach(e=>{e.Rmax=function(e){let t=(e.x1??0)-(e.x0??0),n=(e.y1??0)-(e.y0??0);return e.d0!==e.d1?Math.abs(n)/2.1:0!==n?(t*t+n*n)/Math.abs(4*n):1/0}(e),e[t]=Math.max((e.dy??0)/2,e.d0===e.d1?.6*(e.Rmax??0):5+(e.dy??0)/2)});let n=function(e,t){let n=null;for(let i=0;i<e.length;++i)if(t(e[i])){n=i;break}return n}(e,"r0"===t?e=>(e.y1??0)>(e.y0??0):e=>(e.y0??0)>(e.y1??0));if(null===n&&(n=e.length),K(e.slice(n),t),n>0){let i=[];for(let t=n-1;t>=0;t--)i.push(e[t]);K(i,t)}}function Y(e,t,n,i,o){if(0===i.length)return;let r=i.map(n=>{let i=`__${t.v}_${t.w}_${n}`;return e.setNode(i,{data:null,direction:o,dummy:!0,rank:n}),i}),s=[t.v,...r,t.w];s.forEach((i,o)=>{o+1<s.length&&e.setEdge(s[o],s[o+1],{data:e.edge(t).data,origEdge:t,origLabel:n,source:e.node(t.v),target:e.node(t.w),value:e.edge(t).value},t.name)}),e.removeEdge(t)}function X(e,t,n){return function(e,t,n){let i,o;t.length>n.length?(i=t,o=n):(i=n,o=t);let r=o.length,s=[];i.forEach(t=>{o.forEach((n,i)=>{(e.hasEdge(t,n)||e.hasEdge(n,t))&&s.push(i)})});let a=1;for(;a<r;)a*=2;let l=2*a-1;a-=1;let d=Array(l).fill(0),h=0;return s.forEach(e=>{let t=e+a;for(d[t]++;t>0;)t%2&&(h+=d[t+1]),t=Math.floor((t-1)/2),d[t]++}),h}(e,t,n)}function U(e,t,n){let i=0;return n>0&&(i+=X(e,t[n-1],t[n])),n+1<t.length&&(i+=X(e,t[n],t[n+1])),i}function Q(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function J(e){let t=Math.floor(e.length/2);if(0===e.length)return -1;if(e.length%2==1)return e[t];if(2===e.length)return(e[0]+e[1])/2;let n=e[t-1]-e[0],i=e[e.length-1]-e[t];return(e[t-1]*i+e[t]*n)/(n+i)}function ee(e,t,n,i,o,r=!1){let s=t[n],a=t[i],l=[];return a.forEach((t,n)=>{e.nodeEdges(t,o).length>0&&l.push(n)}
40),0===l.length&&r&&s.forEach((t,n)=>{e.nodeEdges(t,o).length>0&&l.push(n+.5)}),l.sort((e,t)=>e-t),l}function et(e,t){let n=new Map(e.map((e,t)=>[e,t]));for(let i=1;i<e.length;++i)for(let o=i;o>0;--o){let i=o-1,r=t.get(e[i]),s=t.get(e[o]);for(;-1===(r=t.get(e[i]))&&i>0;)i--;if(void 0===s||void 0===r||-1===s||-1===r||(r===s&&(r=n.get(e[i])??r,s=n.get(e[o])??s),s>=r))break;[e[o],e[i]]=[e[i],e[o]]}}function en(e,t){let n=0;for(let i=0;i<t.length-1;++i)n+=X(e,t[i],t[i+1]);return n}let ei=(e,t)=>(e||[]).reduce((e,n)=>e+(t?t(n):n),0);function eo(e,t,n){e.nodes().forEach(i=>{let o=ei(e.inEdges(i),n=>t(e.edge(n))),r=ei(e.outEdges(i),n=>t(e.edge(n))),s=e.node(i);s||e.setNode(i,s={}),s.value=Math.max(o,r),void 0===s.direction&&(s.direction=n(s)||"r")})}function er(e,t,n=0,i=1){if(0===t.length||0===t[0].length)return[];let o=Array(t[0].length).fill(0);return t.forEach(t=>{t.forEach((t,r)=>{let s=ei(t,t=>{let o=e.node(t),r=e.inEdges(t)||[],s=e.outEdges(t)||[],a=Math.max(Math.max(0,r.length-1),Math.max(0,s.length-1));return o.value+a*n/i});o[r]=Math.max(o[r],s)})}),o}
40function es(e,t,n){return void 0!==n?`${e}�${t}�${n}`:`${e}�${t}`}class ea{constructor(e={}){this._nodes=new Map,this._edges=new Map,this._graphLabel={},this._out=new Map,this._in=new Map,this._isMultigraph=e.multigraph??!1}graph(){return this._graphLabel}setGraph(e){return this._graphLabel=e,this}setNode(e,t){return this._nodes.has(e)?void 0!==t&&this._nodes.set(e,t):(this._nodes.set(e,void 0!==t?t:{}),this._out.set(e,new Set),this._in.set(e,new Set)),this}node(e){return this._nodes.get(e)}hasNode(e){return this._nodes.has(e)}nodes(){return Array.from(this._nodes.keys())}removeNode(e){var t,n;if(!this._nodes.has(e))return this;this._nodes.delete(e);let i=Array.from(this._out.get(e)??[]),o=Array.from(this._in.get(e)??[]);for(let e of i){let n=this._edges.get(e);n&&(null==(t=this._in.get(n.w))||t.delete(e)),this._edges.delete(e)}for(let e of o){let t=this._edges.get(e);t&&(null==(n=this._out.get(t.v))||n.delete(e)),this._edges.delete(e)}return this._out.delete(e),this._in.delete(e),this}sources(){return this.nodes().filter(e=>{var t;return 0===((null==(t=this._in.get(e))?void 0:t.size)??0)})}successors(e){return this.outEdges(e).map(e=>e.w)}setEdge(e,t,n,i){var o,r;let s,a;"object"==typeof e?(s=e.v,a=e.w,i=e.name,n=t):(s=e,a=t),this.setNode(s),this.setNode(a);let l=this._isMultigraph?es(s,a,i):es(s,a),d=this._edges.get(l);if(d)void 0!==n&&(d.label=n);else{let e={v:s,w:a,name:i,label:void 0!==n?n:{}};this._edges.set(l,e),null==(o=this._out.get(s))||o.add(l),null==(r=this._in.get(a))||r.add(l)}return this}edge(e,t,n){var i;let o;return o="string"==typeof e?this._isMultigraph?es(e,t,n):es(e,t):this._isMultigraph?es(e.v,e.w,e.name):es(e.v,e.w),null==(i=this._edges.get(o))?void 0:i.label}hasEdge(e,t,n){let i=this._isMultigraph?es(e,t,n):es(e,t);return this._edges.has(i)}edges(){return Array.from(this._edges.values()).map(({v:e,w:t,name:n})=>({v:e,w:t,name:n}))}removeEdge(e){var t,n;let i=this._isMultigraph?es(e.v,e.w,e.name):es(e.v,e.w),o=this._edges.get(i);return o&&(null==(t=this._out.get(o.v))||t.delete(i),null==(n=this._in.get(o.w))||n.delete(i),this._edges.delete(i)),this}outEdges(e){let t=this._out.get(e);return t?Array.from(t).flatMap(e=>{let t=this._edges.get(e);return t?[{v:t.v,w:t.w,name:t.name}]:[]}):[]}inEdges(e){let t=this._in.get(e);return t?Array.from(t).flatMap(e=>{let t=this._edges.get(e);return t?[{v:t.v,w:t.w,name:t.name}]:[]}):[]}nodeEdges(e,t){let n=[],i=new Set;for(let o of[...this.inEdges(e),...this.outEdges(e)])if(o.v===t||o.w===t){let e=es(o.v,o.w,o.name);i.has(e)||(i.add(e),n.push(o))}return n}}function el(e){return void 0!==e.name?`${e.v}�${e.w}�${e.name}`:`${e.v}�${e.w}`}function ed(e,t,n,i,o,r=0){n.has(t)||(n.add(t),o.push(t),i.setNode(t,{depth:r}),e.outEdges(t).map(e=>e.w).forEach(s=>{n.has(s)||i.setEdge(t,s,{delta:1}),ed(e,s,n,i,o,r+1)}))}function eh(e,t){if(0===e.nodes().length)return;let n=function(e,t){let n=new ea({directed:!0}),i=!1;for(let e of t)if("min"===e.type){i=!0;break}if(!i){let n=e.sources();t=n.length>0?[{nodes:[n[0]],type:"min"},...t]:[{nodes:[e.nodes()[0]],type:"min"},...t]}let o=new Map,r=0;return t.forEach(e=>{if(!e.nodes||0===e.nodes.length)return;let t=""+r++;e.nodes.forEach(e=>{o.set(e,t)}),n.setNode(t,{nodes:e.nodes,type:e.type})}),e.nodes().forEach(e=>{if(!o.has(e)){let t=""+r++;o.set(e,t),n.setNode(t,{nodes:[e],type:"same"})}}
40),e.edges().forEach(t=>{let i=o.get(t.v)??t.v,r=o.get(t.w)??t.w,s=e.node(t.v)||{},a=e.node(t.w)||{},l=n.edge(i,r)||{delta:0};i===r?(l.delta=0,n.setEdge(i,r,l)):"l"===s.direction?(l.delta=Math.max(l.delta??0,+("l"===a.direction)),n.setEdge(r,i,l)):(l.delta=Math.max(l.delta??0,+("l"!==a.direction)),n.setEdge(i,r,l))}),n}(e,t);n.sources().forEach(e=>{"0"!==e&&n.setEdge("0",e,{delta:0,temp:!0})}),function(e,t){let n=function(e,t){let n=new Set,i=new ea({directed:!0}),o=[];if(!e.hasNode("0"))throw Error("node not in graph");return ed(e,t,n,i,o),e.nodes().forEach(t=>{n.has(t)||ed(e,t,n,i,o)}),o.forEach((e,t)=>{i.node(e).thread=t+1<o.length?o[t+1]:o[0]}),i}(e,"0");e.edges().forEach(t=>{if(0>function(e,t,n){let i=e.node(t),o=e.node(n);if((i.depth??0)<(o.depth??0)){let t=i.thread;for(;void 0!==t&&(e.node(t).depth??0)>(i.depth??0);){if(t===n)return 1;t=e.node(t).thread}}else if((o.depth??0)<(i.depth??0)){let n=o.thread;for(;void 0!==n&&(e.node(n).depth??0)>(o.depth??0);){if(n===t)return -1;n=e.node(n).thread}}return 0}(n,t.v,t.w)){let n=e.edge(t)||{};n.reversed=!0,e.removeEdge(t),e.setEdge(t.w,t.v,n)}})}(n,0),function(e){var t;let n=e.sources(),i=new Set,o=new Set;
40for(e.edges().forEach(e=>{e.v===e.w&&o.add(el(e))});n.length>0;){let r=n.shift();if(void 0===r)break;i.add(r);let s=e.node(r);for(let n of(s||e.setNode(r,s={}),s.rank=0,e.inEdges(r))){let i=(null==(t=e.edge(n)||{})?void 0:t.delta)??1;s.rank=Math.max(s.rank,(e.node(n.v).rank??0)+i)}for(let t of e.outEdges(r))o.add(el(t));for(let t of e.nodes())!(0>n.indexOf(t))||i.has(t)||e.inEdges(t).some(e=>!o.has(el(e)))||n.push(t)}}(n),n.edges().forEach(e=>{n.edge(e).temp&&function(e){let t=n.node(e),i=Math.min(...n.outEdges(e).map(e=>(n.node(e.w).rank??0)-(n.edge(e).delta??0)));void 0!==i&&(t.rank=i)}(e.w)}),e.nodes().forEach(t=>{e.node(t)||e.setNode(t,{})}),n.nodes().forEach(t=>{var i;let o=n.node(t);null==(i=o.nodes)||i.forEach(t=>{e.node(t).rank=o.rank})})}let ec=["#6b9ece","#e07b7b","#7dba8f","#b09ed1","#e0b678","#6dbaba","#d17da8","#b5b56d","#c49a6d","#8fa4b8","#c98aa0","#94bf7d","#e0a08a","#7b9eb5","#a988a8"],eu={canvasStyle:"border: 1px solid #caced0; box-sizing: border-box",edgeGap:0,edgeGradientFill:!0,edgeOpacity:.4,particleFlow:!1,enableToolbar:!0,type:"sankey",arcCornerRadius:6,enableTooltip:!0,fontColor:"#212121",fontFamily:"",fontSize:"14px",fontWeight:"400",height:"auto",locale:{direction:"ltr"},nodeBorderColor:null,nodeBorderWidth:1,nodeWidth:20,nodePalette:void 0,theme:void 0,draggableNodes:!1,onNodeClick:void 0,spacing:20,tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#E2E8F0",tooltipFontColor:"#1a1a1a",tooltipId:"apexsankey-tooltip-container",tooltipTemplate:({source:e,target:t,value:n})=>`
41      <div style='display:flex;align-items:center;gap:6px;padding:7px 10px;'>
42        <div style='width:10px;height:10px;border-radius:2px;background-color:${null==e?void 0:e.color};flex-shrink:0;'></div>
43        <span style='font-weight:500;'>${null==e?void 0:e.title}</span>
44        <svg width='14' height='14' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' style='opacity:0.5;flex-shrink:0;'><path d='M5 12h14M13 6l6 6-6 6' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>
45        <div style='width:10px;height:10px;border-radius:2px;background-color:${null==t?void 0:t.color};flex-shrink:0;'></div>
46        <span style='font-weight:500;'>${null==t?void 0:t.title}</span>
47        <span style='opacity:0.6;margin-left:2px;'>\xb7</span>
48        <span style='font-weight:600;'>${n}</span>
49      </div>
50    `,nodeTooltipTemplate:({node:e,value:t})=>`
51      <div style='display:flex;align-items:center;gap:6px;padding:7px 10px;'>
52        <div style='width:10px;height:10px;border-radius:2px;background-color:${null==e?void 0:e.color};flex-shrink:0;'></div>
53        <span style='font-weight:500;'>${null==e?void 0:e.title}</span>
54        <span style='opacity:0.6;'>\xb7</span>
55        <span style='font-weight:600;'>${t}</span>
56      </div>
57    `,viewPortHeight:500,viewPortWidth:800,whitespace:.18,orientation:"horizontal",axisTitles:void 0,width:"100%",highlightConnectedPath:!0,dimOpacity:.2,animation:{enabled:!0,duration:800},a11y:{enabled:!0}},ep={diagramLabel:({flowCount:e,largestFlow:t,nodeCount:n})=>{let i=`Sankey flow diagram: ${n} nodes, ${e} flows.`;return t&&(i+=` Largest flow: ${t.source} (${t.value} units) to ${t.target}.`),i},edgeAriaLabel:({source:e,target:t,value:n})=>`Flow from ${e} to ${t}: ${n} units`,nodeAriaLabel:({incoming:e,name:t,outgoing:n})=>{let i=t;return e&&(i+=`: receives ${e.total} units from ${e.sources.join(", ")}`),n&&(i+=`${e?"; ":": "}flows ${n.total} units to ${n.targets.join(", ")}`),i},nodesGroupLabel:"Sankey nodes"};class eg{constructor(e,t,n){this.element=e,this.options=t,this.chartContext=n,e.innerHTML="",this.canvas=new m(document.createElementNS(a,"svg")).addTo(e).size("100%","100%").viewbox(`-${this.spacing} -${this.spacing+this.getYShift()} ${this.width+2*this.spacing} ${this.height+this.spacing+this.getYShift()}`).attr({style:this.options.canvasStyle})}getYShift(){return 30*!!this.options.enableToolbar}add(e){this.canvas.add(e)}clear(){this.canvas.clear().viewbox(`-${this.spacing} -${this.spacing+this.getYShift()} ${this.width+2*this.spacing} ${this.height+this.spacing+this.getYShift()}`)}exportToSvg(){new s(this.canvas,"apexsankey").exportToSVG()}
57resetViewBox(){this.canvas.viewbox(`-${this.spacing} -${this.spacing+this.getYShift()} ${this.width+2*this.spacing} ${this.height+this.spacing+this.getYShift()}`)}updateViewBox(e,t,n,i){this.canvas.viewbox(`${e} ${t} ${n} ${i}`)}get height(){return this.options.viewPortHeight}get spacing(){return this.options.spacing}get width(){return this.options.viewPortWidth}}class ef{constructor(e,t,n){this.svgRoot=e,this.graph=t,this.dimOpacity=n,this.pinnedNode=null,this.pinnedEdge=null}highlightNode(e){let t=this.prefersReducedMotion(),n=[...this.graph.inEdges(e)??[],...this.graph.outEdges(e)??[]],i=new Set([e]);n.forEach(e=>{var t,n,o,r;let s=this.graph.edge(e.v,e.w,e.name),a=null==(n=null==(t=null==s?void 0:s.source)?void 0:t.data)?void 0:n.id,l=null==(r=null==(o=null==s?void 0:s.target)?void 0:o.data)?void 0:r.id;a&&i.add(a),l&&i.add(l)}),this.dimAll(t),n.forEach(e=>{let n=this.svgRoot.querySelector(`[data-edge-source="${e.v}"][data-edge-target="${e.w}"]`);n&&this.setOpacity(n,1,t)}),i.forEach(e=>{let n=this.svgRoot.querySelector(`[data-node-id="${e}"]`);n&&this.setOpacity(n,1,t)})}highlightEdge(e,t){var n,i,o,r;let s=this.prefersReducedMotion(),a=this.graph.edge(e,t),l=(null==(i=null==(n=null==a?void 0:a.source)?void 0:n.data)?void 0:i.id)??e,d=(null==(r=null==(o=null==a?void 0:a.target)?void 0:o.data)?void 0:r.id)??t;this.dimAll(s),this.svgRoot.querySelectorAll(`[data-edge-source="${e}"][data-edge-target="${t}"]`).forEach(e=>this.setOpacity(e,1,s));let h=this.svgRoot.querySelector(`[data-node-id="${l}"]`),c=this.svgRoot.querySelector(`[data-node-id="${d}"]`);h&&this.setOpacity(h,1,s),c&&this.setOpacity(c,1,s)}focusNode(e){let t=new Set([e]),n=[];this.walk(e,"down",t,n),this.walk(e,"up",t,n),this.applySets(t,n)}focusEdge(e,t){var n,i,o,r;let s=this.graph.edge(e,t),a=(null==(i=null==(n=null==s?void 0:s.source)?void 0:n.data)?void 0:i.id)??e,l=(null==(r=null==(o=null==s?void 0:s.target)?void 0:o.data)?void 0:r.id)??t,d=new Set([a,l]),h=[{v:e,w:t}];this.walk(a,"up",d,h),this.walk(l,"down",d,h),this.applySets(d,h)}togglePinFocusNode(e){this.pinnedNode!==e?(this.pinnedNode=e,this.pinnedEdge=null,this.focusNode(e)):this.clearPin()}togglePinFocusEdge(e,t){this.pinnedEdge&&this.pinnedEdge.source===e&&this.pinnedEdge.target===t?this.clearPin():(this.pinnedEdge={source:e,target:t},this.pinnedNode=null,this.focusEdge(e,t))}isPinned(){return null!==this.pinnedNode||null!==this.pinnedEdge}clearPin(){this.pinnedNode=null,this.pinnedEdge=null,this.clear()}reset(){this.pinnedNode?this.focusNode(this.pinnedNode):this.pinnedEdge?this.focusEdge(this.pinnedEdge.source,this.pinnedEdge.target):this.clear()}walk(e,t,n,i){let o=new Set([e]),r=[e];for(;r.length;){let e=[];for(let s of r)for(let r of"down"===t?this.graph.outEdges(s)??[]:this.graph.inEdges(s)??[]){i.push({v:r.v,w:r.w});let s="down"===t?r.w:r.v;n.add(s),o.has(s)||(o.add(s),e.push(s))}r=e}}applySets(e,t){let n=this.prefersReducedMotion();this.dimAll(n),t.forEach(({v:e,w:t})=>{this.svgRoot.querySelectorAll(`[data-edge-source="${e}"][data-edge-target="${t}"]`).forEach(e=>this.setOpacity(e,1,n))}),e.forEach(e=>{let t=this.svgRoot.querySelector(`[data-node-id="${e}"]`);t&&this.setOpacity(t,1,n)})}clear(){let e=this.prefersReducedMotion()?"none":"";this.svgRoot.querySelectorAll("[data-edge-source]").forEach(t=>{t.style.transition=e,t.style.opacity=""}),this.svgRoot.querySelectorAll("[data-node-id]").forEach(t=>{t.style.transition=e,t.style.opacity=""})}dimAll(e){this.svgRoot.querySelectorAll("[data-edge-source]").forEach(t=>{this.setOpacity(t,this.dimOpacity,e)}),this.svgRoot.querySelectorAll("[data-node-id]").forEach(t=>{this.setOpacity(t,this.dimOpacity,e)})}setOpacity(e,t,n){e.style.transition=n?"none":"opacity 0.2s ease",e.style.opacity=String(t)}prefersReducedMotion(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}}function em(e,t){var n,i;let o=t=>getComputedStyle(e).getPropertyValue(t).trim(),r=o("--apex-sankey-edge-opacity"),s=""!==r?Number(r):t.edgeOpacity,a=o("--apex-sankey-node-width"),l=""!==a?Number(a):t.nodeWidth,d=o("--apex-sankey-node-border-width"),h=""!==d?Number(d):t.nodeBorderWidth,c=o("--apex-sankey-edge-gradient"),u=""!==c?"true"===c:t.edgeGradientFill,p=function(e,t){var n;let i=function(e){let t;if(!e||"function"!=typeof getComputedStyle)return{};try{t=getComputedStyle(e)}catch{return{}}if(!t||"function"!=typeof t.getPropertyValue)return{};let n=e=>{let n=t.getPropertyValue(e);return n?String(n).trim():""},i={};for(let[e,t]of Object.entries(q)){let o=n(t);o&&(i[e]=o)}let o=[];for(let e=1;e<=24;e++){let t=n(`--apx-series-${e}`);if(!t)break;o.push(t)}return o.length&&(i.series=o),i}(e),o=t?null==(n=t?function(){let e=globalThis,t=e[G];if(t)return t;let n={};return e[G]=n,n}()[t]??null:null)?void 0:n.tokens:void 0;return o?{...o,...i}:i}(e,"string"==typeof t.theme?t.theme:void 0),g=(e,n,i)=>(function({cssVar:e,fallback:t,option:n,token:i}){return e||(n&&n!==t?n:i||(n??""))})({cssVar:o(e),fallback:eu[n],option:t[n],token:i}),f=o("--apex-sankey-node-border-color")||(t.nodeBorderColor!==eu.no
57deBorderColor?t.nodeBorderColor:p.grid??t.nodeBorderColor),m=g("--apex-sankey-tooltip-bg","tooltipBGColor",p.surface),v=g("--apex-sankey-tooltip-border-color","tooltipBorderColor",p.grid),y=g("--apex-sankey-tooltip-font-color","tooltipFontColor",p.fore),b=p.series&&((n=t.nodePalette)===(i=eu.nodePalette)||n&&i&&n.length===i.length&&n.every((e,t)=>e===i[t]))?[...p.series]:t.nodePalette,x=o("--apex-sankey-tooltip-theme"),w="dark"===x||"light"===x?x:t.tooltipTheme;return{...t,edgeGradientFill:u,edgeOpacity:Number.isFinite(s)?s:t.edgeOpacity,fontColor:g("--apex-sankey-label-color","fontColor",p.fore),fontSize:o("--apex-sankey-label-font-size")||t.fontSize,fontFamily:o("--apex-sankey-font-family")||t.fontFamily,nodeBorderColor:f,nodePalette:b,nodeBorderWidth:Number.isFinite(h)?h:t.nodeBorderWidth,nodeWidth:Number.isFinite(l)?l:t.nodeWidth,tooltipBGColor:m,tooltipBorderColor:v,tooltipFontColor:y,tooltipTheme:w}}let ev="#005FCC",ey="role",eb="aria-label",ex="data-node-id",ew="data-orig-stroke",eC="data-orig-stroke-width",eE="stroke",eS="stroke-width",eA="forced-colors",ek="apexsankey-desc",eM="data-edge-target",e$="apexsankey-a11y-styles";class eL{constructor(e,t,n={},i,o,r=ep){this.svgEl=e,this.graph=t,this.options=n,this.tooltipId=i,this.pathHighlighter=o,this.messages=r,this.nodeGroups=[],this.edgePaths=[],this.nodeOutEdges=new Map,this.edgeSourceNode=new Map,this.mediaQuery=null,this.forcedColorsHandler=null,this.isKeyboardUser=!1}apply(){!1!==this.options.enabled&&(this.injectAriaAttributes(),this.setupKeyboardNavigation(),function(){if(document.getElementById(e$))return;let e=document.createElement("style");e.id=e$,e.textContent=`
58    /* ApexSankey: keyboard focus ring */
59    .node:focus,
60    svg path[data-edge-source]:focus { outline: none; }
61    .node:focus-visible rect {
62      stroke: ${ev};
63      stroke-width: 2;
64    }
65
66    /* High-contrast (Windows Forced Colors) */
67    @media (forced-colors: active) {
68      .node rect {
69        fill: ButtonFace;
70        stroke: ButtonText;
71      }
72      .node text {
73        fill: ButtonText;
74      }
75      .node:focus-visible rect {
76        stroke: Highlight;
77        stroke-width: 2;
78      }
79    }
80
81    /* Reduced motion */
82    @media (prefers-reduced-motion: reduce) {
83      .node rect,
84      svg path {
85        transition: none !important;
86        animation: none !important;
87      }
88    }
89  `,document.head.appendChild(e)}(),this.setupHighContrastMode())}destroy(){this.mediaQuery&&this.forcedColorsHandler&&(this.mediaQuery.removeEventListener("change",this.forcedColorsHandler),this.mediaQuery=null,this.forcedColorsHandler=null)}injectAriaAttributes(){let{svgEl:e,graph:t,messages:n,options:i}=this,o=t.nodes().filter(e=>!t.node(e).dummy),r=t.edges(),s=function(e,t,n,i,o){var r,s,a,l;if(o)return o;let d=0,h="",c="";for(let t of n)try{let n=e.edge(t.v,t.w,t.name).value??0;if(n>d){let i=e.node(t.v),o=e.node(t.w);i.dummy||o.dummy||(d=n,h=(null==(r=i.data)?void 0:r.title)??(null==(s=i.data)?void 0:s.id)??t.v,c=(null==(a=o.data)?void 0:a.title)??(null==(l=o.data)?void 0:l.id)??t.w)}}catch{}let u=h&&c?{source:h,target:c,value:d}:void 0;return i.diagramLabel({flowCount:n.length,largestFlow:u,nodeCount:t.length})}(t,o,r,n,i.diagramLabel);e.setAttribute(ey,"img"),e.setAttribute(eb,s),e.removeAttribute("aria-labelledby");let a=e.querySelector("title");if(a&&a.remove(),i.description){let t=e.querySelector("desc");if(!t){let n=document.createElementNS("http://www.w3.org/2000/svg","desc");n.id=ek,e.insertBefore(n,e.firstChild),t=n}t.textContent=i.description,e.setAttribute("aria-describedby",ek)}let l=Array.from(e.querySelectorAll(`[${ex}]`));l.forEach(e=>{let i=e.getAttribute(ex);i&&(e.setAttribute(ey,"listitem"),e.setAttribute(eb,function(e,t,n){var i,o,r,s,a,l;let d=t.node(e),h=(null==(i=d.data)?void 0:i.title)??(null==(o=d.data)?void 0:o.id)??e,c=[],u=0;for(let n of t.inEdges(e))try{let e=t.edge(n.v,n.w,n.name),i=t.node(n.v);i.dummy||(c.push((null==(r=i.data)?void 0:r.title)??(null==(s=i.data)?void 0:s.id)??n.v),u+=e.value??0)}catch{}let p=[],g=0;for(let n of t.outEdges(e))try{let e=t.edge(n.v,n.w,n.name),i=t.node(n.w);i.dummy||(p.push((null==(a=i.data)?void 0:a.title)??(null==(l=i.data)?void 0:l.id)??n.w),g+=e.value??0)}catch{}return n.nodeAriaLabel({incoming:c.length>0?{sources:c,total:u}:void 0,name:h,outgoing:p.length>0?{targets:p,total:g}:void 0})}(i,t,n)),e.setAttribute("tabindex","0"))}),this.nodeGroups=l;let d=[],h=new Map,c=new Map;
89e.querySelectorAll("[data-edge-source]").forEach(e=>{var i,o,r,s;let a=e.getAttribute("data-edge-source"),l=e.getAttribute("data-edge-target"),u=e.getAttribute("data-edge-name")??void 0;if(a&&l)try{let p=t.edge(a,l,u),g=p.source,f=p.target;if(!g||!f)return;let m=(null==(i=g.data)?void 0:i.title)??(null==(o=g.data)?void 0:o.id)??a,v=(null==(r=f.data)?void 0:r.title)??(null==(s=f.data)?void 0:s.id)??l,y=p.value??0;e.setAttribute("role","img"),e.setAttribute("aria-label",n.edgeAriaLabel({source:m,target:v,value:y})),e.setAttribute("focusable","true"),e.setAttribute("tabindex","-1"),d.push(e),c.set(e,a),h.has(a)||h.set(a,[]);let b=h.get(a);b&&b.push(e)}catch{}}),this.edgePaths=d,this.nodeOutEdges=h,this.edgeSourceNode=c}setupKeyboardNavigation(){for(let e of(this.svgEl.addEventListener("pointerdown",()=>{this.isKeyboardUser=!1}),this.svgEl.addEventListener("keydown",()=>{this.isKeyboardUser=!0}),this.nodeGroups.forEach((e,t)=>{e.addEventListener("keydown",n=>{let i=n.key;if("Enter"===i||" "===i){n.preventDefault();let t=e.querySelector("rect");t&&t.dispatchEvent(new MouseEvent("click",{bubbles:!0}))}else if("Escape"===i)n.preventDefault(),this.restoreFocusRing(e),e.blur(),this.hideTooltip();else if("ArrowRight"===i||"ArrowDown"===i){n.preventDefault();let i=e.getAttribute(ex),o=i?this.nodeOutEdges.get(i)??[]:[];o.length>0?o[0].focus():this.nodeGroups[(t+1)%this.nodeGroups.length].focus()}else("ArrowLeft"===i||"ArrowUp"===i)&&(n.preventDefault(),this.nodeGroups[(t-1+this.nodeGroups.length)%this.nodeGroups.length].focus())}),e.addEventListener("focus",()=>{var t;if(this.isKeyboardUser){this.applyFocusRing(e);let n=e.getAttribute(ex);n&&(null==(t=this.pathHighlighter)||t.highlightNode(n))}if(this.tooltipId){let t=e.querySelector("rect");if(t){let e=t.getBoundingClientRect();t.dispatchEvent(new MouseEvent("mouseover",{clientX:e.left+e.width/2,clientY:e.top,bubbles:!0}))}}}),e.addEventListener("blur",()=>{var t;this.restoreFocusRing(e),null==(t=this.pathHighlighter)||t.reset(),this.hideTooltip()})}),this.edgePaths)){let t=()=>{let t=this.edgeSourceNode.get(e);return t?this.nodeOutEdges.get(t)??[]:[]},n=()=>{let t=this.edgeSourceNode.get(e),n=t?this.nodeGroups.find(e=>e.getAttribute(ex)===t):void 0;n&&n.focus()};e.addEventListener("keydown",i=>{let o=i.key;if("Enter"===o||" "===o)i.preventDefault(),e.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if("Escape"===o||"ArrowLeft"===o)i.preventDefault(),n();else if("ArrowDown"===o){i.preventDefault();let n=t(),o=n.indexOf(e);n[(o+1)%n.length].focus()}else if("ArrowUp"===o){i.preventDefault();let n=t(),o=n.indexOf(e);n[(o-1+n.length)%n.length].focus()}else if("ArrowRight"===o){i.preventDefault();let t=e.getAttribute(eM),n=t?this.nodeGroups.find(e=>e.getAttribute(ex)===t):void 0;n&&n.focus()}else if("Tab"===o){let t=this.edgeSourceNode.get(e),n=this.nodeGroups.findIndex(e=>e.getAttribute(ex)===t);if(-1!==n){let e=i.shiftKey?(n-1+this.nodeGroups.length)%this.nodeGroups.length:(n+1)%this.nodeGroups.length;i.preventDefault(),this.nodeGroups[e].focus()}}}),e.addEventListener("focus",()=>{var t;if(this.isKeyboardUser){let n=e.getAttribute("data-edge-source"),i=e.getAttribute(eM);n&&i&&(null==(t=this.pathHighlighter)||t.highlightEdge(n,i))}if(this.tooltipId){let t=e.getBoundingClientRect();e.dispatchEvent(new MouseEvent("mouseover",{clientX:t.left+t.width/2,clientY:t.top+t.height/2,bubbles:!0}))}}),e.addEventListener("blur",e=>{var t;let n=e.relatedTarget;n&&this.edgePaths.includes(n)||(null==(t=this.pathHighlighter)||t.reset(),this.hideTooltip())})}}hideTooltip(){if(this.tooltipId){let e=document.getElementById(this.tooltipId);e&&(e.style.display="none")}}applyFocusRing(e){let t=e.querySelector("rect");t&&(t.setAttribute(ew,t.getAttribute(eE)??""),t.setAttribute(eC,t.getAttribute(eS)??""),t.setAttribute(eE,ev),t.setAttribute(eS,"2"))}restoreFocusRing(e){let t=e.querySelector("rect");if(!t)return;let n=t.getAttribute(ew),i=t.getAttribute(eC);null!==n&&(t.setAttribute(eE,n),t.removeAttribute(ew)),null!==i&&(t.setAttribute(eS,i),t.removeAttribute(eC))}setupHighContrastMode(){if("undefined"!=typeof window&&"function"==typeof window.matchMedia)try{let e=window.matchMedia("(forced-colors: active)");this.mediaQuery=e,e.matches&&this.svgEl.classList.add(eA),this.forcedColorsHandler=e=>{e.matches?this.svgEl.classList.add(eA):this.svgEl.classList.remove(eA)},e.addEventListener("change",this.forcedColorsHandler)}catch{}}}let eN="http://www.w3.org/2000/svg",eT=e=>2*(0!==e.dy);function eF(e,t,n=.5){return e+(t-e)*n}function eB(e,t=!1){if(!e.points||e.points.length<2)return null;let n="";for(let i=0;i<e.points.length-1;++i){let o=e.points[i],r=e.points[i+1];n+=`${function(e,t=!1){let n=(e,n)=>t?`${n},${e}`:`${e},${n}`,{x0:i}=e,{x1:o}=e,{y0:r}=e,{y1:s}=e;o<i&&([i,o]=[o,i],[r,s]=[s,r]);let a=eF(i,o);return`M${n(i,r)} C${n(a,r)} ${n(a,s)} ${n(o,s)}`}({dy:e.dy??0,r0:o.ro,r1:r.ri,x0:o.x??0,x1:r.x??0,y0:o.y??0,y1:r.y??0},t)} `}return n.trim()}function eI(e,t=!1){var n;if(1===(null==(n=e.points)?void 0:n.length))return function(e,t=!1){if(!e.points)return null;let n=e.points[0],i=Math.max(eT(e),e.dy??0)/2,o=(e,n)=>t?`${n},${e}`:`${e},${n}`;return"down-right"===n.style?`M${o((n.x??0)-20,(n.y??0)-i)} L${o(n.x??0,(n.y??0)-i)} L${o(n.x??0,(n.y??0)+i)} L${o((n.x??0)-20,(n.y??0)+i)} Z`:"right-down"===n.style?`M${o(n.x??0,(n.y??0)-i)} L${o((n.x??0)+20,(n.y??0)-i)} L${o((n.x??0)+20,(n.y??0)+i)} L${o(n.x??0,(n.y??0)+i)} Z`:null}(e,t);if(!e.points)return null;let i="";for(let n=0;n<e.points.length-1;++n){let o=e.points[n],r=e.points[n+1];i+=function(e,t=!1){let n=(e,n)=>t?`${n},${e}`:`${e},${n}`,i=Math.max(eT(e),e.dy)/2,{x0:o}=e,{x1:r}=e,{y0:s}=e,{y1:a}=e;r<o&&([o,r]=[r,o],[s,a]=[a,s]);let l=eF(o,r);return`M${n(o,s-i)} C${n(l,s-i)} ${n(l,a-i)} ${n(r,a-i)} L${n(r,a+i)} C${n(l,a+i)} ${n(l,s+i)} ${n(o,s+i)} Z`}({d0:o.d,d1:r.d,dy:e.dy??0,r0:o.ro,r1:r.ri,x0:o.x??0,x1:r.x??0,y0:o.y??0,y1:r.y??0},t)}return i}let eO=(e,t)=>{let n=(null==e?void 0:e.title)??(null==e?void 0:e.id)??"";return t&&n.length>t?`${n.substr(0,15)}...`:n};class eR{build(e){let{chartContext:t,events:n,graph:i,isRtl:o,maxRank:r,messages:s,options:a,pathHighlighter:l}=e,{enableTooltip:d,fontColor:u,fontFamily:p,fontSize:g,fontWeight:f,nodeBorderColor:m,nodeBorderWidth:b,nodeWidth:x,nodeTooltipTemplate:w,onNodeClick:C,tooltipBGColor:M,tooltipBorderColor:$,tooltipFontColor:L,tooltipId:N}=a,T=A({color:u,fontFamily:p,fontSize:g,fontWeight:f}),F="vertical"===a.orientation,B=F?y(0,x/2):y(x/2,0);B.attr("style",T);let I=(null==i?void 0:i.nodes())||[],O=(null==i?void 0:i.edges())||[],R=y();O.forEach(t=>{this.buildEdge(e,t,R)}),B.add(R);let P=y();P.node.setAttribute("role","list"),P.node.setAttribute("aria-label",s.nodesGroupLabel),I.forEach(e
89=>{let s,a=i.node(e);if(a.dummy)return;if(d&&w){let n=i.inEdges(e)??[],o=i.outEdges(e)??[],r=Math.max(n.reduce((e,t)=>{var n;return e+((null==(n=i.edge(t.v,t.w,t.name))?void 0:n.value)??0)},0),o.reduce((e,t)=>{var n;return e+((null==(n=i.edge(t.v,t.w,t.name))?void 0:n.value)??0)},0));s={chartContext:t,isCustomTooltip:w!==eu.nodeTooltipTemplate,nodeTooltipTemplate:w,nodeValue:r,tooltipBGColor:M,tooltipBorderColor:$,tooltipFontColor:L,tooltipId:N}}let y=function(e,t,n){var i,o;let{dy:r,x:s,y:a}=e,{fontColor:l="#212121",fontSize:d="14px",fontFamily:u,fontWeight:p,isRtl:g=!1,vertical:f=!1,nodeBorderColor:m,nodeBorderWidth:y,nodeWidth:b=0,onNodeClick:x,nodeTooltip:w}=n,C=new h({class:"node"}),A=function({borderColor:e="#caced0",color:t="#97cbe6",height:n=0,opacity:i=1,radius:o=0,width:r=0,x:s=0,y:a=0}={}){let l=new c;return l.attr({height:n,opacity:i,rx:o,ry:o,width:r,x:s,y:a}),l.fill(t),l.stroke({color:e,width:1}),l}(f?{height:b,width:r,x:a??0,y:(s??0)-b/2}:{height:r,width:b,x:(s??0)-b/2,y:a});if(A.fill(null==(i=e.data)?void 0:i.color),A.stroke({color:m??(null==(o=e.data)?void 0:o.color),width:y}),A.on("click",()=>{"function"==typeof x&&x(e)}),w){let{chartContext:t,isCustomTooltip:n,nodeValue:i,tooltipBGColor:o,tooltipBorderColor:r,tooltipFontColor:s,tooltipId:a,nodeTooltipTemplate:h}=w,c=h({node:e.data,value:i});A.on("mouseover",e=>{let{pageX:i,pageY:h}=e;S(t,a,k({bgColor:n?void 0:o,borderColor:n?void 0:r,fontColor:n?void 0:s||l,fontFamily:n?void 0:u??"",fontSize:n?void 0:d??"14px",fontWeight:n?void 0:p??"400",x:i,y:h}),c,!0)}),A.on("mousemove",e=>{let{pageX:i,pageY:h}=e;S(t,a,k({bgColor:n?void 0:o,borderColor:n?void 0:r,fontColor:n?void 0:s||l,fontFamily:n?void 0:u??"",fontSize:n?void 0:d??"14px",fontWeight:n?void 0:p??"400",x:i,y:h}),c,!0)}),A.on("mouseout",()=>{E(t,a).style.display="none"})}if(C.add(A),e.data&&(r??0)>Number.parseInt(d,10)){let n=function(e,{fontColor:t,isRtl:n,maxRank:i,nodeWidth:o,vertical:r}){let s,a,{data:l}=e;if(!l)return null;if(r){let n=(e.y??0)+(e.dy??0)/2,r=e.x??0,s=(e.rank??0)<i/2?r+o/2+14:r-o/2-8;return v(eO(l,18),{fontColor:t,pointerEvents:"none",textAnchor:"middle",x:n,y:s})}let d=(s=!1,a=!1,(e.rank??0)<i/2&&(a=!0,s=!1),n&&(a=!a),{right:a,top:s}),{x:h,y:c}=function(e,t,n){let i,o=t.top?-25:(e.dy??0)/2-10;return i=t.top?t.right?4:-4:t.right?10+n/2:-n/2-10,{x:(e.x??0)+i,y:(e.y??0)+o}}(e,d,o);return v(eO(l,d.top?25:15),{fontColor:t,pointerEvents:"none",textAnchor:d.top?"middle":d.right?"start":"end",x:h,y:c})}
89(e,{fontColor:l,isRtl:g,maxRank:t,nodeWidth:b,vertical:f});n&&C.add(n)}return C}(a,r,{fontColor:u,fontFamily:p,fontSize:g,fontWeight:f,isRtl:o,vertical:F,nodeBorderColor:m,nodeBorderWidth:b,nodeWidth:x,nodeTooltip:s,onNodeClick:C});if(y.node.setAttribute("data-node-id",e),y.node.setAttribute("data-node-rank",String(a.rank??0)),l&&(y.node.addEventListener("mouseenter",()=>{l.isPinned()||l.highlightNode(e)}),y.node.addEventListener("mouseleave",()=>l.reset()),y.node.addEventListener("click",()=>l.togglePinFocusNode(e))),n){let t=t=>i=>n.emit(t,{id:e,node:a,originalEvent:i});y.node.addEventListener("click",t("node:click")),y.node.addEventListener("mouseenter",t("node:mouseenter")),y.node.addEventListener("mouseleave",t("node:mouseleave"))}P.add(y)}),B.add(P);let D=this.buildAxisTitles(e);return D&&B.add(D),{mainGroup:B,edgesGroup:R,nodesGroup:P}}buildAxisTitles(e){let{graph:t,options:n}=e,i=n.axisTitles;if(!i||0===i.length)return null;let o="vertical"===n.orientation,r=((null==t?void 0:t.nodes())??[]).map(e=>t.node(e)).filter(e=>!e.dummy&&null!=e.x&&null!=e.y);if(0===r.length)return null;let s=Math.min(...r.map(e=>e.y??0)),a=new Map;for(let e of r){let t=e.rank??0;a.has(t)||a.set(t,{x:e.x??0,y:e.y??0})}let l=y();for(let[e,t]of(l.node.setAttribute("class","axis-titles"),l.node.setAttribute("aria-hidden","true"),a)){let r=i[e];if(null==r||""===r)continue;let a=o?s-18:t.x,d=o?t.x:s-18,h=v(r,{fontColor:n.fontColor,pointerEvents:"none",textAnchor:o?"end":"middle",x:a,y:d});h.node.setAttribute("font-weight","600"),l.add(h)}return l}buildEdge(e,t,n){let{canvas:i,chartContext:o,events:r,graph:s,isRtl:a,options:l,pathHighlighter:d}=e,{edgeGradientFill:h,edgeOpacity:c,enableTooltip:u,fontFamily:p,fontSize:g,fontWeight:f,nodeWidth:m,tooltipBGColor:v,tooltipBorderColor:y,tooltipFontColor:x,tooltipId:w,tooltipTemplate:C}=l,A=s.edge(t.v,t.w,t.name),M=s.node(t.v),$=s.node(t.w),L=A.source,N=A.target;if(!L||!N)return;let T=a?-1:1;M.dummy&&(A.x0=(A.x0??0)-m/2*T),$.dummy&&(A.x1=(A.x1??0)+m/2*T);let F=eI(A,"vertical"===l.orientation);if(!F)return;let B=b(F,{edgeColor:i.gradient("linear",e=>{var t,n,i;e.stop(0,(null==(t=L.data)?void 0:t.color)??""),e.stop(1,h?(null==(n=N.data)?void 0:n.color)??"":(null==(i=L.data)?void 0:i.color)??"")}),id:`${t.v}-${t.w}`,opacity:c});if(B.node.setAttribute("data-edge-source",t.v),B.node.setAttribute("data-edge-target",t.w),void 0!==t.name&&B.node.setAttribute("data-edge-name",t.name),($.rank??0)<(M.rank??0)&&(B.node.setAttribute("data-edge-reversed","true"),B.node.style.opacity="1",B.node.setAttribute("fill-opacity",String(c)),B.node.setAttribute("stroke","#475569"),B.node.setAttribute("stroke-width","1.5"),B.node.setAttribute("stroke-opacity","0.85"),B.node.setAttribute("stroke-dasharray","7 5")),d){let e=t.v,n=t.w;B.on("mouseenter",()=>{d.isPinned()||d.highlightEdge(e,n)}),B.on("mouseleave",()=>d.reset()),B.on("click",()=>d.togglePinFocusEdge(e,n))}if(r){let e=e=>n=>r.emit(e,{source:t.v,target:t.w,value:A.value??0,originalEvent:n});B.on("click",e("edge:click")),B.on("mouseenter",e("edge:mouseenter")),B.on("mouseleave",e("edge:mouseleave"))}if(u&&L.data&&N.data){let e=C?C({source:L.data,target:N.data,value:A.value}):`${L.data.title} → ${N.data.title}: ${A.value}`,t=C!==eu.tooltipTemplate;B.on("mouseover",n=>{let{pageX:i,pageY:r}=n;S(o,w,k({bgColor:t?void 0:v,borderColor:t?void 0:y,fontColor:t?void 0:x,fontFamily:t?void 0:p,fontSize:t?void 0:g,fontWeight:t?void 0:f,x:i,y:r}),e,!0)}),B.on("mousemove",n=>{let{pageX:i,pageY:r}=n;S(o,w,k({bgColor:t?void 0:v,borderColor:t?void 0:y,fontColor:t?void 0:x,fontFamily:t?void 0:p,fontSize:t?void 0:g,fontWeight:t?void 0:f,x:i,y:r}),e,!0)}),B.on("mouseout",()=>{E(o,w).style.display="none"})}n.add(B)}}class eP{constructor(e,t,n){this.svg=e,this.graph=t,this.options=n,this.baseline=new Map,this.downHandlers=new Map,this.active=null}attach(){for(let e of this.graph.nodes()){let t=this.graph.node(e);t.dummy||this.baseline.set(e,{x:t.x??0,y:t.y??0})}this.svg.querySelectorAll("[data-node-id]").forEach(e=>{let t=e.getAttribute("data-node-id");if(!t)return;e.style.cursor="grab",e.style.touchAction="none";let n=n=>this.onDown(n,t,e);this.downHandlers.set(e,n),e.addEventListener("pointerdown",n)})}destroy(){this.active&&this.endDrag(this.active,!1),this.downHandlers.forEac
89h((e,t)=>t.removeEventListener("pointerdown",e)),this.downHandlers.clear(),this.baseline.clear()}onDown(e,t,n){if(this.active||0!==e.button)return;e.stopPropagation(),e.preventDefault();let i="function"==typeof this.svg.getScreenCTM?this.svg.getScreenCTM():null,o=(null==i?void 0:i.a)||1,r=(null==i?void 0:i.d)||1;"function"==typeof n.getAnimations&&n.getAnimations().forEach(e=>e.cancel()),n.style.opacity="",n.style.transform="";let s=this.collectConnections(t),a=this.graph.node(t),l={id:t,el:n,pointerId:e.pointerId,scaleX:o,scaleY:r,clientX:e.clientX,clientY:e.clientY,nodeStartX:a.x??0,nodeStartY:a.y??0,conns:s,moved:!1,onMove:e=>this.onMove(e),onUp:e=>this.onUp(e)};this.active=l;try{n.setPointerCapture(e.pointerId)}catch{}n.style.cursor="grabbing",n.addEventListener("pointermove",l.onMove),n.addEventListener("pointerup",l.onUp),n.addEventListener("pointercancel",l.onUp)}collectConnections(e){let t=[],n=(e,n,i,o)=>{let r=this.graph.edge(e,n,i),s=null==r?void 0:r.points;if(!s||0===s.length)return;let a="first"===o?s[0]:s[s.length-1],l=this.findEdgeEl(e,n,i);l&&t.push({el:l,label:r,point:a,startX:a.x??0,startY:a.y??0})};for(let t of this.graph.outEdges(e)??[])n(t.v,t.w,t.name,"first");for(let t of this.graph.inEdges(e)??[])n(t.v,t.w,t.name,"last");return t}findEdgeEl(e,t,n){let i=`[data-edge-source="${e}"][data-edge-target="${t}"]`,o=void 0===n?i:`${i}[data-edge-name="${n}"]`;return this.svg.querySelector(o)}onMove(e){var t,n,i;let o=this.active;if(!o||e.pointerId!==o.pointerId)return;let r=(e.clientX-o.clientX)/o.scaleX,s=(e.clientY-o.clientY)/o.scaleY;!o.moved&&Math.abs(e.clientX-o.clientX)+Math.abs(e.clientY-o.clientY)>3&&(o.moved=!0);let{gx:a,gy:l}=(i=this.options.vertical,i?{gx:s,gy:r}:{gx:r,gy:s}),d=this.graph.node(o.id);for(let e of(d.x=o.nodeStartX+a,d.y=o.nodeStartY+l,o.conns))e.point.x=e.startX+a,e.point.y=e.startY+l,e.el.setAttribute("d",eI(e.label,this.options.vertical)??"");let h=this.baseline.get(o.id)??{x:0,y:0},c=this.options.vertical?(d.y??0)-h.y:(d.x??0)-h.x,u=this.options.vertical?(d.x??0)-h.x:(d.y??0)-h.y;o.el.setAttribute("transform",`translate(${c} ${u})`),null==(n=(t=this.options).onNodeDrag)||n.call(t,o.id,d,"move")}onUp(e){var t,n;let i=this.active;i&&e.pointerId===i.pointerId&&(this.endDrag(i,i.moved),i.moved&&(null==(n=(t=this.options).onNodeDrag)||n.call(t,i.id,this.graph.node(i.id),"end")))}endDrag(e,t){e.el.removeEventListener("pointermove",e.onMove),e.el.removeEventListener("pointerup",e.onUp),e.el.removeEventListener("pointercancel",e.onUp);try{e.el.releasePointerCapture(e.pointerId)}catch{}e.el.style.cursor="grab",t&&e.el.addEventListener("click",e=>{e.stopImmediatePropagation(),e.preventDefault()},{capture:!0,once:!0}),this.active=null}}let eD="http://www.w3.org/2000/svg";function ez(e,t){let n=e.length-1;if(n<=0)return e[0]??{x:0,y:0};let i=t*n,o=Math.floor(i);o>=n&&(o=n-1),o<0&&(o=0);let r=i-o,s=e[o],a=e[o+1];return{x:s.x+(a.x-s.x)*r,y:s.y+(a.y-s.y)*r}}class eW{constructor(e,t,n){this.mainGroup=e,this.graph=t,this.options=n,this.group=null,this.edges=[],this.raf=0,this.lastTs=null}start(){if(this.prefersReducedMotion())return;let e=this.mainGroup.ownerSVGElement;if(!e)return;let t=document.createElementNS(eD,"path");if(t.setAttribute("fill","none"),t.setAttribute("stroke","none"),"function"!=typeof t.getTotalLength||"function"!=typeof t.getPointAtLength)return;e.appendChild(t);let n=document.createElementNS(eD,"g");n.setAttribute("class","apexsankey-particles"),n.setAttribute("aria-hidden","true"),n.style.pointerEvents="none",this.group=n;let i=0;for(let e of this.graph.edges()){if(i>=600)break;let o=this.graph.edge(e.v,e.w,e.name),r=(null==o?void 0:o.dy)??0;if(r<=0)continue;let s=eB(o,this.options.vertical);if(!s)continue;t.setAttribute("d",s);let a=t.getTotalLength();if(!a||!Number.isFinite(a))continue;let l=Math.max(10,Math.min(80,Math.round(a/10))),d=[];for(let e=0;e<=l;e++){let n=t.getPointAtLength(a*e/l);d.push({x:n.x,y:n.y})}let h=Math.max(1,Math.min(16,Math.round(r/9))),c=[],u=[];for(let e=0;e<h&&i<600;e++,i++){let t=document.createElementNS(eD,"circle");t.setAttribute("r",String(1.9)),t.setAttribute("fill","rgba(255,255,255,0.9)"),n.appendChild(t),c.push(t),u.push((e+.6*Math.random())/h)}this.edges.push({pts:d,length:a,circles:c,t:u})}e.removeChild(t),this.edges.length?(this.paint(),this.mainGroup.appendChild(n),this.raf=requestAnimationFrame(e=>this.tick(e))):this.group=null}destroy(){var e;this.raf&&cancelAnimationFrame(this.raf),this.raf=0,null==(e=this.group)||e.remove(),this.group=null,this.edges=[],this.lastTs=null}tick(e){if(!this.group)return;let t=null===this.lastTs?0:Math.min(.05,(e-this.lastTs)/1e3);for(let n of(this.lastTs=e,this.edges)){let e=n.length>0?63*t/n.length:0;for(let t=0;t<n.t.length;t++){let i=n.t[t]+e;i>=1&&(i-=Math.floor(i)),n.t[t]=i}}this.paint(),this.raf=requestAnimationFrame(e=>this.tick(e))}paint(){for(let e of this.edges)for(let t=0;t<e.circles.length;t++){let n=ez(e.pts,e.t[t]);e.circles[t].setAttribute("cx",String(n.x)),e.circles[t].setAttribute("cy",String(n.y))}}prefersReducedMotion(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}}function ej(e,t,n,i){return[e+n*Math.cos(i),t+n*Math.sin(i)]}let eH=e=>(Math.round(100*e)/100).toString();class e_{build(e){let{chartContext:t,events:n,layout:i,options:o}=e,{center:r,innerRadius:s,outerRadius:a,arcs:l,ribbons:d}=i,{fontColor:h,fontFamily:c,fontSize:u,fontWeight:p,edgeOpacity:g,dimOpacity:f,enableTooltip:m,arcCornerRadius:x}=o,w=y();w.attr("style",A({color:h,fontFamily:c,fontSize:u,fontWeight:p}));let C=new Map(l.map(e=>[e.id,{title:e.title,color:e.color}])),E=new Map(l.map(e=>[e.id,0]));for(let e of d)E.set(e.source,(E.get(e.source)??0)+e.value),E.set(e.target,(E.get(e.target)??0)+e.value);let S=[],k=y();for(let t of d){let i=b(function(e,t,n,i,o,r,s){let a=+(o-i>Math.PI),l=+(s-r>Math.PI),[d,h]=ej(e,t,n,i),[c,u]=ej(e,t,n,o),[p,g]=ej(e,t,n,r),[f,m]=ej(e,t,n,s);return`M${eH(d)},${eH(h)} A${eH(n)},${eH(n)} 0 ${a} 1 ${eH(c)},${eH(u)} Q${eH(e)},${eH(t)} ${eH(p)},${eH(g)} A${eH(n)},${eH(n)} 0 ${l} 1 ${eH(f)},${eH(m)} Q${eH(e)},${eH(t)} ${eH(d)},${eH(h)} Z`}(r.x,r.y,s,t.s0,t.s1,t.t0,t.t1),{opacity:g,id:`${t.source}-${t.target}`});i.node.setAttribute("fill",t.sourceColor),i.node.setAttribute("data-edge-source",t.source),i.node.setAttribute("data-edge-target",t.target),k.add(i),S.push({source:t.source,target:t.target,el:i.node}),m&&this.wireTooltip(e,i.node,()=>this.edgeTooltip(e,t.source,t.target,t.value,C)),n&&i.node.addEventListener("click",e=>n.emit("edge:click",{source:t.source,target:t.target,value:t.value,originalEvent:e}))}w.add(k);let M=[],$=y();for(let t of l){let i=b(function(e,t,n,i,o,r,s=0){let a=+(r-o>Math.PI),l=Math.max(0,Math.min(s,i-n,i*(r-o)/2));if(l<=0){let[s,l]=ej(e,t,i,o),[d,h]=ej(e,t,i,r),[c,u]=ej(e,t,n,r),[p,g]=ej(e,t,n,o);return`M${eH(s)},${eH(l)} A${eH(i)},${eH(i)} 0 ${a} 1 ${eH(d)},${eH(h)} L${eH(c)},${eH(u)} A${eH(n)},${eH(n)} 0 ${a} 0 ${eH(p)},${eH(g)} Z`}let d=l/i,h=+(r-d-(o+d)>Math.PI),[c,u]=ej(e,t,i,o+d),[p,g]=ej(e,t,i,r-d),[f,m]=ej(e,t,i-l,r),[v,y]=ej(e,t,n,r),[b,x]=ej(e,t,n,o),[w,C]=ej(e,t,i-l,o),E=eH(l);return`M${eH(c)},${eH(u)} A${eH(i)},${eH(i)} 0 ${h} 1 ${eH(p)},${eH(g)} A${E},${E} 0 0 1 ${eH(f)},${eH(m)} L${eH(v)},${eH(y)} A${eH(n)},${eH(n)} 0 ${a} 0 ${eH(b)},${eH(x)} L${eH(w)},${eH(C)} A${E},${E} 0 0 1 ${eH(c)},${eH(u)} Z`}(r.x,r.y,s,a,t.startAngle,t.endAngle,x??0),{opacity:1});i.node.setAttribute("fill",t.color),i.node.setAttribute("data-node-id",t.id),$.add(i),M.push({id:t.id,el:i.node}),m&&this.wireTooltip(e,i.node,()=>this.nodeTooltip(e,t.id,C,E.get(t.id)??0)),n&&i.node.addEventListener("click",e=>n.emit("node:click",{id:t.id,node:{data:{id:t.id,title:t.title,color:t.color}},originalEvent:e}));let o=(t.startAngle+t.endAngle)/2;if(t.endAngle-t.startAngle>=.06){let[e,n]=ej(r.x,r.y,a+10,o),i=Math.cos(o)>=0,s=v(t.title,{fontColor:h,pointerEvents:"none",textAnchor:i?"start":"end",x:e,y:n});s.node.setAttribute("dominant-baseline","central"),$.add(s)}}return w.add($),this.wireHoverFocus(S,M,g,f),{mainGroup:w}}wireHoverFocus(e,t,n,i){let o=(e,t)=>{e.style.transition="opacity 0.15s ease",e.style.opacity=String(t)},r=()=>
89{e.forEach(e=>o(e.el,n)),t.forEach(e=>o(e.el,1))};t.forEach(s=>{s.el.addEventListener("mouseenter",()=>(r=>{let s=new Set([r]);e.forEach(e=>{let t=e.source===r||e.target===r;o(e.el,t?Math.min(1,n+.35):i*n),t&&s.add(e.source).add(e.target)}),t.forEach(e=>o(e.el,s.has(e.id)?1:i))})(s.id)),s.el.addEventListener("mouseleave",r)}),e.forEach(s=>{s.el.addEventListener("mouseenter",()=>{e.forEach(e=>o(e.el,e===s?Math.min(1,n+.35):i*n)),t.forEach(e=>o(e.el,e.id===s.source||e.id===s.target?1:i))}),s.el.addEventListener("mouseleave",r)})}edgeTooltip(e,t,n,i,o){let{tooltipTemplate:r}=e.options,s=o.get(t),a=o.get(n);return r?r({source:{id:t,...s},target:{id:n,...a},value:i}):`${(null==s?void 0:s.title)??t} → ${(null==a?void 0:a.title)??n}: ${i}`}nodeTooltip(e,t,n,i){let{nodeTooltipTemplate:o}=e.options,r=n.get(t);return o?o({node:{id:t,...r},value:i}):`${(null==r?void 0:r.title)??t}: ${i}`}wireTooltip(e,t,n){let{chartContext:i,options:o}=e,{fontFamily:r,fontSize:s,fontWeight:a,tooltipBGColor:l,tooltipBorderColor:d,tooltipFontColor:h,tooltipId:c,tooltipTemplate:u,nodeTooltipTemplate:p}=o,g=u!==eu.tooltipTemplate||p!==eu.nodeTooltipTemplate,f=e=>{let{pageX:t,pageY:o}=e;S(i,c,k({bgColor:g?void 0:l,borderColor:g?void 0:d,fontColor:g?void 0:h,fontFamily:g?void 0:r,fontSize:g?void 0:s,fontWeight:g?void 0:a,x:t,y:o}),n(),!0)};t.addEventListener("mouseover",f),t.addEventListener("mousemove",f),t.addEventListener("mouseout",()=>{E(i,c).style.display="none"})}}let eG=-Math.PI/2;class eq{constructor(e={}){this.onFrame=null,this.reducedMotion=e.reducedMotion??!1,this.scene=new H({spring:e.spring,rest:e.rest,reducedMotion:this.reducedMotion,clock:{now:e.now,raf:e.raf,caf:e.caf},onFrame:()=>
89this.emit()})}has(e){return this.scene.has(e)}positionOf(e){let t=this.scene.valuesOf(e);return t?eK(t):void 0}retarget(e,t,n){if(this.scene.has(e))n&&this.scene.snap(e,{x:n.x,y:n.y});else{let i=n??t;this.scene.add(e,{x:i.x,y:i.y},void 0)}this.scene.retarget(e,{x:t.x,y:t.y})}snap(e,t){this.scene.has(e)?this.scene.snap(e,{x:t.x,y:t.y}):this.scene.add(e,{x:t.x,y:t.y},void 0)}remove(e){this.scene.remove(e)}reset(){this.scene.clear()}dispose(){this.scene.dispose()}atRest(){return this.scene.atRest()}step(e){return this.scene.step(e)}start(e){e&&(this.onFrame=e),this.reducedMotion?this.scene.writeAll():this.scene.start()}stop(){this.scene.stop()}emit(){if(!this.onFrame)return;let e=new Map;for(let t of this.scene.ids()){let n=this.scene.valuesOf(t);n&&e.set(t,eK(n))}this.onFrame(e)}}function eK(e){let{x:t,y:n}=e;return{x:t,y:n}}function eZ(e,t,n){return void 0===n?`${e}\0${t}`:`${e}\0${t}\0${n}`}function eV(e){let t=new Map;for(let n of e.nodes()){let i=e.node(n);t.set(n,{x:i.x??0,y:i.y??0,dy:i.dy??0})}let n=new Map;for(let t of e.edges()){let i=e.edge(t.v,t.w,t.name);n.set(eZ(t.v,t.w,t.name),{v:t.v,w:t.w,x0:i.x0??0,y0:i.y0??0,x1:i.x1??0,y1:i.y1??0,dy:i.dy??0,points:(i.points??[]).map(e=>({x:e.x??0,y:e.y??0}))})}return{nodes:t,edges:n}}function eY(e,t,n){let i=new Map;for(let[o,r]of e.nodes)i.set(o,t.has(o)?{x:n.x,y:n.y,dy:r.dy}:{x:r.x,y:r.y,dy:r.dy});let o=new Map;for(let[i,r]of e.edges){let e=t.has(r.v),s=t.has(r.w),a=r.points.map(e=>({x:e.x,y:e.y}));(e||s)&&a.length&&(e&&(a[0]={x:n.x,y:n.y}),s&&(a[a.length-1]={x:n.x,y:n.y})),o.set(i,{v:r.v,w:r.w,x0:e?n.x:r.x0,y0:e?n.y:r.y0,x1:s?n.x:r.x1,y1:s?n.y:r.y1,dy:r.dy,points:a})}return{nodes:i,edges:o}}let eX=(e,t,n)=>e+(t-e)*n;function eU(e,t,n,i){for(let o of e.nodes()){let r=t.nodes.get(o),s=n.nodes.get(o);if(!r||!s)continue;let a=e.node(o);a.x=eX(r.x,s.x,i),a.y=eX(r.y,s.y,i),a.dy=eX(r.dy,s.dy,i)}for(let o of e.edges()){let r=eZ(o.v,o.w,o.name),s=t.edges.get(r),a=n.edges.get(r);if(!s||!a)continue;let l=e.edge(o.v,o.w,o.name);if(l.x0=eX(s.x0,a.x0,i),l.y0=eX(s.y0,a.y0,i),l.x1=eX(s.x1,a.x1,i),l.y1=eX(s.y1,a.y1,i),l.dy=eX(s.dy,a.dy,i),l.points)for(let e=0;e<l.points.length;e++){let t=s.points[e],n=a.points[e];t&&n&&(l.points[e].x=eX(t.x,n.x,i),l.points[e].y=eX(t.y,n.y,i))}}}let eQ=[120,20];class eJ extends eg{constructor(e,t,n,i){super(e,t,n),this.events=i,this.a11yHelper=null,this.pathHighlighter=null,this.nodeDrag=null,this.particleFlow=null,this._hasAnimated=!1,this.renderer=new eR,this.lastGeometry=null,this.relayoutMotion=null,this.currentMainGroup=null,this.chordRenderer=new e_,this.chordData=null,this.renderOptions=t,this.messages=function(e){var t,n=null==(t=e.locale)?void 0:t.messages;if(!n)return{...ep};let i={...ep};for(let e of Object.keys(n)){let t=n[e];void 0!==t&&(i[e]=t)}return i}(t)}getMessages(){return this.messages}get isRtl(){var e;return function(e,t){var n;if("rtl"===e)return!0;if("ltr"===e||"undefined"==typeof window||"undefined"==typeof document)return!1;if(t){let e=t.closest('[dir="rtl"], [dir="ltr"]');return e?"rtl"===e.getAttribute("dir"):"rtl"===window.getComputedStyle(t).direction}return"rtl"===((null==(n=document.documentElement)?void 0:n.getAttribute("dir"))??document.dir)}((null==(e=this.options.locale)?void 0:e.direction)??"ltr",this.element)}construct(e){var t;if("chord"===this.options.type)return void this.constructChord(e);let{edgeGap:n,nodeWidth:i,spacing:o,viewPortHeight:r,viewPortWidth:s,whitespace:a}=this.options,l=function(e){let t=function(){let e=[100,100],t=null,n=.18,i=function(e,t,n){return 1},o=function(e){return e.data.value},r=function(e){return e.data?e.data.direction??"r":"r"};function s(a,l,d=0){null===t&&s.scaleToFit(a,l,d),eo(a,o,r),function(e,t,n,i=0){e.nodes().forEach(t=>{let o=e.node(t),r=e.inEdges(t)||[],s=e.outEdges(t)||[],a=Math.max(Math.max(0,r.length-1),Math.max(0,s.length-1));o.dy=o.value*n+a*i}
89),e.edges().forEach(i=>{let o=e.edge(i);o.value=t(o),o.dy=o.value*n})}(a,o,t,d);let h=er(a,l,d,t),c=[];for(let t=0;t<l.length;t++){let o=l[t],r=o.length,s=0;c[t]=[];for(let l=0;l<o.length;l++){let d=o[l],u=h[l]/ei(h)*e[1],p=0===s?0:n*u/5,g=u-2*p,f=d.map((e,t)=>a.node(e).value&&d[t+1]?i(d[t],d[t+1],a):0),m=Math.max(0,g-ei(d,e=>a.node(e).dy)),v=ei(f)?m/ei(f):0,y=s+p;1===d.length&&(y+=(g-a.node(d[0]).dy)/2),c[t][l]={margin:p,height:g,gaps:f,kg:v,isFirst:0===l,isLast:l===r-1,startYY:y},s+=u}}let u,p,g=-1,f=-1,m=0,v=0;(function(e){let t=[];for(let n=0;n<e.length;n++){let i=e[n];for(let e=0;e<i.length;e++){let o=i[e];for(let i=0;i<o.length;i++)t.push({rankIndex:n,bandIndex:e,nodeIndex:i,nodeId:o[i]})}}return t})(l).forEach(({rankIndex:e,bandIndex:t,nodeIndex:n,nodeId:i})=>{var o;e===g&&t===f||(g=e,f=t,u=c[e][t],p=l[e][t],m=u.startYY,v=u.isFirst?Number.MAX_VALUE:0);let r=a.node(i);r.y=m,r.spaceAbove=v,r.spaceBelow=u.gaps[n]*u.kg,m+=r.dy+r.spaceBelow,v=r.spaceBelow,void 0!==(null==(o=r.data)?void 0:o.forceY)&&(r.y=u.margin+r.data.forceY*(u.height-r.dy)),n===p.length-1&&(r.spaceBelow=u.isLast?Number.MAX_VALUE:0)});let y=function(e,t){let n=[];return t.forEach((i,o)=>{if(o===t.length-1)return;let r=0;i.forEach(t=>{t.forEach(t=>{e.outEdges(t).forEach(t=>{let n=e.edge(t).dy,i=Math.abs(e.node(t.w).y-e.node(t.v).y)-n,o=n*n-i*i,s=o>=0?Math.sqrt(o):n;s>r&&(r=s)})})}),n.push(r)}),n}(a,l);!function(e,t,n,i){let o,r=i.reduce((e,t)=>e+t,0);if(r>n)o=i.map(e=>n*e/r);else{let e=n-r;o=i.map(n=>n+e/(t.length-1))}let s=0;t.forEach((t,n)=>{t.forEach(t=>{t.forEach(t=>{e.node(t).x=s})}),s+=o[n]})}(a,l,e[0],y);let b=[];return a.nodes().forEach(e=>{let t=a.node(e);t.id=e,b.push(t)}),b}return s.scaleToFit=function(i,s,a=0){eo(i,o,r);let l=0;a>0&&i.nodes().forEach(e=>{l=Math.max(l,function(e,t,n){if(n<=0)return 0;let i=e.inEdges(t)||[],o=e.outEdges(t)||[];return Math.max(Math.max(0,i.length-1),Math.max(0,o.length-1))*n}(i,e,a))});let d=ei(er(i,s,0,1));if(d<=0)return void(t=1);t=(e[1]-l)/d,1!==n&&(t*=1-n)},s.size=function(t){return arguments.length?(e=t,s):e},s.separation=function(e){return arguments.length?(i="function"==typeof e?e:()=>e,s):i},s.whitespace=function(e){return arguments.length?(n=e,s):n},s.scale=function(e){return arguments.length?(t=e,s):t},s}(),n=function(e){let t=e.edgeGap||0;return function(n){n.nodes().forEach(i=>{let o=n.node(i),r=Z(n,o.outgoing||[],"outgoing"),s=Z(n,o.incoming||[],"incoming"),a=r.length,l=s.length,d=r.reduce((e,t)=>e+(n.edge(t).dy??0),0),h=s.reduce((e,t)=>e+(n.edge(t).dy??0),0),c=d+Math.max(0,a-1)*t,u=h+Math.max(0,l-1)*t,p=((o.dy??0)-c)/2,g=((o.dy??0)-u)/2;p=Math.max(0,p),g=Math.max(0,g),r.forEach((i,r)=>{let s=n.edge(i);s.x0=(o.x??0)+(e.nodeWidth??0)/2,s.y0=(o.y??0)+p+(s.dy??0)/2,s.d0=o.direction||"r",p+=s.dy??0,r<a-1&&(p+=t)}),s.forEach((i,r)=>{let s=n.edge(i);s.x1=(o.x??0)-(e.nodeWidth??0)/2,s.y1=(o.y??0)+g+(s.dy??0)/2,s.d1=o.direction||"r",g+=s.dy??0,r<l-1&&(g+=t)})}),n.nodes().forEach(e=>{let t=n.node(e),i=(t.outgoing||[]).map(e=>n.edge(e)),o=(t.incoming||[]).map(e=>n.edge(e));i.sort((e,t)=>(e.y0??0)-(t.y0??0)),o.sort((e,t)=>(e.y1??0)-(t.y1??0)),V(i,"r0"),V(o,"r1")});let i=[];
89return n.edges().forEach(e=>{let t=n.edge(e);t.id=`${e.v}-${e.w}-${e.name}`,i.push(t)}),i}}(e),i=[],o=[],r=null;function s(a=[],l=[],d={}){let h=function(e=[],t=[]){let n=new ea({directed:!0,multigraph:!0});return t.forEach(e=>{n.setEdge(e.source,e.target,{data:e,points:[]},e.type)}),n.nodes().forEach(e=>n.setNode(e,{data:{}})),e.forEach(e=>{n.hasNode(e.id)&&(n.node(e.id).data=e,void 0!==e.direction&&(n.node(e.id).direction=e.direction))}),n.edges().forEach(e=>{n.edge(e).source=n.node(e.v),n.edge(e).target=n.node(e.w)}),n}(l,a);return d.order?(eh(h,d.rankSets||[]),(r=d.order).length>0&&r[0].length>0&&!Array.isArray(r[0][0])&&(r=r.map(e=>[e])),r=r.map(e=>e.map(e=>e.filter(e=>void 0!==h.node(e))))):(eh(h,d.rankSets||[]),h.edges().forEach(e=>{let t=h.node(e.v),n=h.node(e.w),i=h.edge(e),o=t.rank,r=[];if(void 0!==o&&void 0!==n.rank&&o+1<=n.rank){for("l"===t.direction&&r.push(o);++o<n.rank;)r.push(o);"l"===n.direction&&r.push(o),Y(h,e,i,r,"r")}else if(void 0!==o&&void 0!==n.rank&&o>n.rank){for("l"!==t.direction&&r.push(o);o-- >n.rank+1;)r.push(o);"l"!==n.direction&&r.push(o),Y(h,e,i,r,"l")}}),r=function(e,t=25){let n=function(e){let t=[],n=e.nodes().filter(t=>0===e.node(t).rank).concat(e.sources());return 0===n.length&&(n=e.nodes().slice(0,1)),(function(e,t){let n=new Set,i=[];for(let o of t)!function t(o){if(!n.has(o))for(let r of(n.add(o),i.push(o),e.successors(o)))t(r)}(o);return i})(e,n).forEach(n=>{let i=e.node(n).rank;if(void 0!==i){for(;i>=t.length;)t.push([]);t[i].push(n)}}),t}(e),i=n,o=en(e,n),r=0;for(;r++<t;){(function(e,t,n=1,i=!1){if(n>0)for(let n=1;n<t.length;++n){let o=new Map;t[n].forEach(r=>{let s=J(ee(e,t,n,n-1,r,i));o.set(r,s)}),et(t[n],o)}else for(let n=t.length-2;n>=0;--n){let o=new Map;t[n].forEach(r=>{let s=J(ee(e,t,n,n+1,r,i));o.set(r,s)}),et(t[n],o)}})(e,n,+(r%2==0)),function(e,t){let n=!0;for(;n;){n=!1;for(let i=0;i<t.length;++i)for(let o=0;o<t[i].length-1;++o){let r=U(e,t,i);Q(t[i],o,o+1),U(e,t,i)<r?n=!0:Q(t[i],o,o+1)}}}(e,n);let t=en(e,n);if(t<o&&(i=function(e){let t=[];for(let n of e){let e=[];for(let i of(t.push(e),n))e.push(i)}return t}(n),o=t),0===o)break}return i.map(e=>[e])}(h)),i=t(h,r,e.edgeGap||0),h.nodes().forEach(e=>{let t=h.node(e);t.incoming=h.inEdges(e),t.outgoing=h.outEdges(e)}),o=n(h),h.nodes().filter(e=>e.startsWith("__")).forEach(e=>{var t;let n=h.node(e);if(!n)return;let i=(null==(t=h.inEdges(e))?void 0:t.map(e=>h.edge(e)))||[];i.forEach(e=>{e.origLabel&&e.origEdge&&(e.origLabel.dy=e.dy,e.origLabel.x0=e.x0,e.origLabel.y0=e.y0,e.origLabel.r0=e.r0,e.origLabel.d0=e.d0,e.origLabel.value=e.value,h.setEdge(e.origEdge,e.origLabel))});let o,r=i.map(e=>e.r1);for(;n.dummy;)(i=h.outEdges(e).map(e=>h.edge(e))).forEach((e,t)=>{e.origLabel&&(e.origLabel.points||(e.origLabel.points=[]),e.origLabel.points.push({d:e.d0,r0:e.r0,r1:r[t],x:n.x,y:e.y0}))}),r=i.map(e=>e.r1),o=h.successors(e)[0],h.removeNode(e),n=h.node(e=o);i.forEach(e=>{e.origLabel&&(e.origLabel.x1=e.x1,e.origLabel.y1=e.y1,e.origLabel.r1=e.r1,e.origLabel.d1=e.d1)})}
89),h.edges().forEach(e=>{let t=h.edge(e);t.points||(t.points=[]),t.points.unshift({d:t.d0,ro:t.r0,x:t.x0,y:t.y0}),t.points.push({d:t.d1,ri:t.r1,x:t.x1,y:t.y1})}),h}return void 0!==e.whitespace&&t.whitespace(e.whitespace),s.nodes=function(){return i},s.links=function(){return o},s.order=function(){return r},s.size=function(e){return arguments.length?(t.size(e),s):t.size()},s.separation=function(e){return arguments.length?(t.separation(e),s):t.separation()},s.whitespace=function(e){return arguments.length?(t.whitespace(e),s):t.whitespace()},s.edgeValue=function(e){return s},s.scale=function(e){return arguments.length?(t.scale(e),s):t.scale()},s}({edgeGap:n,nodeWidth:i,whitespace:a}),d="vertical"===this.options.orientation;l.size(d?[r-i,s-o]:[s-i,r-o]);let h=(null==(t=this.options.nodePalette)?void 0:t.length)?this.options.nodePalette:ec,c=e.nodes.map((e,t)=>{let n=t%h.length;return{...e,color:e.color??h[n],colorIndex:n}}),u=l(e.edges,c);this.maxRank=(l.order()??[]).length-1,this.graph=u,this.isRtl&&!d&&this.mirrorLayoutForRtl()}constructChord(e){var t;let n=(null==(t=this.options.nodePalette)?void 0:t.length)?this.options.nodePalette:ec,i=e.nodes.map((e,t)=>({id:e.id,title:e.title??e.id,color:e.color??n[t%n.length]})),o=e.edges.map(e=>({source:e.source,target:e.target,value:e.value}));this.chordData={nodes:i,edges:o}}mirrorLayoutForRtl(){let e=this.graph.nodes(),t=1/0,n=-1/0;for(let i of e){let e=this.graph.node(i).x;void 0!==e&&(t=Math.min(t,e),n=Math.max(n,e))}if(!Number.isFinite(t))return;let i=t+n;for(let t of e){let e=this.graph.node(t);void 0!==e.x&&(e.x=i-e.x)}for(let e of this.graph.edges()){let t=this.graph.edge(e.v,e.w,e.name);if(void 0!==t.x0&&(t.x0=i-t.x0),void 0!==t.x1&&(t.x1=i-t.x1),t.points)for(let e of t.points)void 0!==e.x&&(e.x=i-e.x)}}render({keepOldPosition:e=!1}={}){var t,n,i;if("chord"===this.options.type)return void this.renderChord();this.renderOptions=em(this.element,this.options);let{tooltipTheme:o,tooltipBGColor:r,tooltipBorderColor:s,tooltipFontColor:a}=this.renderOptions;"dark"===o?this.renderOptions={...this.renderOptions,tooltipBGColor:"#1e2433",tooltipBorderColor:"#374151",tooltipFontColor:"#e5e7eb"}:"light"===o&&(this.renderOptions={...this.renderOptions,tooltipBGColor:r,tooltipBorderColor:s,tooltipFontColor:a});let{dimOpacity:l,enableTooltip:d,highlightConnectedPath:h,tooltipId:c}=this.renderOptions,u=this.canvas.viewbox();this.clear(),this.pathHighlighter=h?new ef(this.canvas.node,this.graph,l):null;let{mainGroup:p,edgesGroup:g,nodesGroup:f}=this.renderer.build({canvas:this.canvas,chartContext:this.chartContext,events:this.events,graph:this.graph,isRtl:this.isRtl,maxRank:this.maxRank,messages:this.messages,options:this.renderOptions,pathHighlighter:this.pathHighlighter});this.add(p),this.currentMainGroup=p;let{animation:m}=this.renderOptions;if((null==m?void 0:m.enabled)&&!this._hasAnimated&&(this._hasAnimated=!0,function(e,t,n,i,o){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let r=e.viewBox.baseVal,s=r.width,a=r.x,l=e.querySelector("defs")??(()=>{let t=document.createElementNS(eN,"defs");return e.insertBefore(t,e.firstChild),t})(),d=`sankey-flow-clip-${Math.random().toString(36).slice(2,9)}`,h=document.createElementNS(eN,"clipPath");h.setAttribute("id",d);let c=document.createElementNS(eN,"rect");c.setAttribute("x",String(a)),c.setAttribute("y","-9999"),c.setAttribute("height","99999"),c.setAttribute("width","0"),h.appendChild(c),l.appendChild(h),t.setAttribute("clip-path",`url(#${d})`);let u=null;requestAnimationFrame(function e(n){null===u&&(u=n);let i=Math.min((n-u)/o,1),r=(i<.5?2*i*i:(4-2*i)*i-1)*s;c.setAttribute("width",String(r)),i<1?requestAnimationFrame(e):(t.removeAttribute("clip-path"),h.remove())});let p=n.querySelectorAll("[data-node-rank]"),g=.1*o,f=.7*o-g,m=.45*o;p.forEach(e=>{let t=parseInt(e.getAttribute("data-node-rank")??"0",10);e.style.opacity="0";let n=e.animate([{opacity:"0",transform:"translateY(6px)"},{opacity:"1",transform:"translateY(0px)"}],{duration:m,delay:g+(i>0?t/i:0)*f,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards"});n.onfinish=()=>{e.style.opacity="",e.style.transform="",n.cancel()}})}(this.canvas.node,g.node,f.node,this.maxRank,m.duration)),e&&this.updateViewBox(u.x,u.y,u.width,u.height),d){let e=E(this.chartContext,c);this.chartContext.getAppendContainer().appendChild(e)}this.a11yHelper&&this.a11yHelper.destroy();let v=this.renderOptions.a11y;!1!==(null==v?void 0:v.enabled)&&(this.a11yHelper=new eL(this.canvas.node,this.graph,v,c,this.pathHighlighter,this.messages),this.a11yHelper.apply()),null==(t=this.nodeDrag)||t.destroy(),this.nodeDrag=null,this.renderOptions.draggableNodes&&(this.nodeDrag=new eP(this.canvas.node,this.graph,{vertical:"vertical"===this.renderOptions.orientation}),this.nodeDrag.attach()),null==(n=this.particleFlow)||n.destroy(),this.particleFlow=null,this.renderOptions.particleFlow&&(this.particleFlow=new eW(p.node,this.graph,{vertical:"vertical"===this.renderOptions.orientation}),this.particleFlow.start()),this.lastGeometry=eV(this.graph),null==(i=this.events)||i.emit("rendered")}renderChord(){var e;if(this.renderOptions=em(this.element,this.options),"dark"===this.renderOptions.tooltipTheme&&(this.renderOptions={...this.renderOptions,tooltipBGColor:"#1e2433",tooltipBorderColor:"#374151",tooltipFontColor:"#e5e7eb"}),this.clear(),!this.chordData)return;
89let{enableTooltip:t,nodeWidth:n,tooltipId:i,viewPortHeight:o,viewPortWidth:r}=this.renderOptions,s=function(e,t,n){let{width:i,height:o,nodeWidth:r}=n,s=n.padAngle??.04,a=Math.max(10,Math.min(i,o)/2-56),l=Math.max(5,a-Math.max(12,r)),d=t.filter(e=>e.source!==e.target&&e.value>0),h=new Map(e.map((e,t)=>[e.id,t])),c=new Map(e.map(e=>[e.id,e.color])),u=new Map(e.map(e=>[e.id,0]));for(let e of d)u.set(e.source,(u.get(e.source)??0)+e.value),u.set(e.target,(u.get(e.target)??0)+e.value);let p=e.filter(e=>(u.get(e.id)??0)>0),g=p.reduce((e,t)=>e+(u.get(t.id)??0),0)||1,f=Math.max(0,2*Math.PI-p.length*s)/g,m=[],v=new Map,y=eG;for(let e of p){let t=(u.get(e.id)??0)*f;m.push({id:e.id,title:e.title,color:e.color,startAngle:y,endAngle:y+t}),v.set(e.id,y),y+=t+s}let b=new Map;for(let e of p)b.set(e.id,[]);d.forEach((e,t)=>{var n,i;null==(n=b.get(e.source))||n.push({edge:t,role:"s",other:h.get(e.target)??0}),null==(i=b.get(e.target))||i.push({edge:t,role:"t",other:h.get(e.source)??0})});let x=[],w=[];for(let e of p){let t=(b.get(e.id)??[]).sort((e,t)=>e.other-t.other||e.edge-t.edge),n=v.get(e.id)??eG;for(let e of t){let t=d[e.edge].value*f,i=[n,n+t];"s"===e.role?x[e.edge]=i:w[e.edge]=i,n+=t}}return{center:{x:i/2,y:o/2},outerRadius:a,innerRadius:l,arcs:m,ribbons:d.map((e,t)=>{var n,i,o,r;return{index:t,source:e.source,target:e.target,value:e.value,sourceColor:c.get(e.source)??"#888888",targetColor:c.get(e.target)??"#888888",s0:(null==(n=x[t])?void 0:n[0])??0,s1:(null==(i=x[t])?void 0:i[1])??0,t0:(null==(o=w[t])?void 0:o[0])??0,t1:(null==(r=w[t])?void 0:r[1])??0}})}}(this.chordData.nodes,this.chordData.edges,{width:r,height:o,nodeWidth:n}),{mainGroup:a}=this.chordRenderer.build({chartContext:this.chartContext,layout:s,options:this.renderOptions,events:this.events});if(this.add(a),this.currentMainGroup=a,t){let e=E(this.chartContext,i);this.chartContext.getAppendContainer().appendChild(e)}null==(e=this.events)||e.emit("rendered")}destroy(){var e,t,n,i;null==(e=this.relayoutMotion)||e.dispose(),this.relayoutMotion=null,null==(t=this.particleFlow)||t.destroy(),this.particleFlow=null,null==(n=this.nodeDrag)||n.destroy(),this.nodeDrag=null,null==(i=this.a11yHelper)||i.destroy(),this.a11yHelper=null}update(e,t){var n,i;if("chord"===this.options.type)return this.construct(e),void this.render();null==(n=this.particleFlow)||n.destroy(),this.particleFlow=null;let o=!1===(null==(i=this.renderOptions.animation)?void 0:i.enabled),r=null!==this.lastGeometry&&!o&&!this.prefersReducedMotion();if((null==t?void 0:t.shrinkInto)&&r){let n=eV(this.graph),i=eY(n,new Set(t.shrinkInto.nodes),t.shrinkInto.anchor);return void this.animateGeometry(n,i,()=>{this.construct(e),this.render()},eQ)}let s=null!==this.lastGeometry?eV(this.graph):null;this.construct(e);let a=eV(this.graph),l=this.currentMainGroup;if(null===s||null===l||o||this.prefersReducedMotion())this.render();else if(null==t?void 0:t.growFrom){let e=eY(a,new Set(t.growFrom.nodes),t.growFrom.anchor);this.animateGeometry(e,a,()=>{eU(this.graph,e,a,1),this.render()},eQ)}else!function(e,t){if(e.nodes.size!==t.nodes.size||e.edges.size!==t.edges.size)return!1;for(let n of e.nodes.keys())if(!t.nodes.has(n))return!1;for(let[n,i]of e.edges){let e=t.edges.get(n);if(!e||e.points.length!==i.points.length)return!1}return!0}(s,a)?this.morphGrow(s,a,l):this.animateRelayout(s,a)}animateRelayout(e,t){this.animateGeometry(e,t,()=>{eU(this.graph,e,t,1),this.render()})}animateGeometry(e,t,n,i){var o;null==(o=this.relayoutMotion)||o.dispose();let r=new eq(i?{rest:P,spring:i}:{rest:P});this.relayoutMotion=r;let s=!1;r.retarget("t",{x:1,y:0},{x:0,y:0}),r.start(i=>{var o;if(r.atRest()){if(s)return;return s=!0,void n()}let a=(null==(o=i.get("t"))?void 0:o.x)??0;eU(this.graph,e,t,a),this.drawGeometry()})}buildLayer(){let{mainGroup:e}=this.renderer.build({canvas:this.canvas,chartContext:this.chartContext,graph:this.graph,isRtl:this.isRtl,maxRank:this.maxRank,messages:this.messages,options:this.renderOptions,pathHighlighter:null});return this.currentMainGroup=e,this.add(e),e}drawGeometry(){this.clear(),this.buildLayer()}morphGrow(e,t,n){var i;null==(i=this.relayoutMotion)||i.dispose(),this.hideSurvivorsOnOldLayer(n,t);let o=function(e,t){let n=new Map;for(let[i,o]of t.nodes){let t=e.nodes.get(i);n.set(i,t?{x:t.x,y:t.y,dy:t.dy}:{x:o.x,y:o.y,dy:0})}let i=new Map;for(let[o,r]of t.edges){let t=e.edges.get(o);if(t&&t.points.length===r.points.length)i.set(o,{v:r.v,w:r.w,x0:t.x0,y0:t.y0,x1:t.x1,y1:t.y1,dy:t.dy,points:t.points.map(e=>({x:e.x,y:e.y}))});else{let e=n.get(r.v),t=(null==e?void 0:e.x)??r.x0,s=(null==e?void 0:e.y)??r.y0;i.set(o,{v:r.v,w:r.w,x0:t,y0:s,x1:t,y1:s,dy:0,points:r.points.map(()=>({x:t,y:s}))})}}return{nodes:n,edges:i}}(e,t);eU(this.graph,o,t,0);let r=this.buildLayer(),s=new eq({rest:P});this.relayoutMotion=s;let a=!1;s.retarget("t",{x:1,y:0},{x:0,y:0}),s.start(e=>{var i;if(s.atRest()){if(a)return;return a=!0,eU(this.graph,o,t,1),void this.render()}let l=(null==(i=e.get("t"))?void 0:i.x)??0,d=l<0?0:l>1?1:l;
89n.node.setAttribute("opacity",String(1-d)),eU(this.graph,o,t,d),r.node.remove(),r=this.buildLayer()})}hideSurvivorsOnOldLayer(e,t){let n=e.node;n.querySelectorAll("[data-node-id]").forEach(e=>{t.nodes.has(e.getAttribute("data-node-id")??"")&&(e.style.opacity="0")}),n.querySelectorAll("[data-edge-source]").forEach(e=>{let n=e.getAttribute("data-edge-source")??"",i=e.getAttribute("data-edge-target")??"",o=e.getAttribute("data-edge-name"),r=null===o?eZ(n,i):eZ(n,i,o);t.edges.has(r)&&(e.style.opacity="0")})}prefersReducedMotion(){return"undefined"==typeof window||"function"!=typeof window.matchMedia||window.matchMedia("(prefers-reduced-motion: reduce)").matches}}let e0={light:{nodePalette:["#6b9ece","#e07b7b","#7dba8f","#b09ed1","#e0b678","#6dbaba","#d17da8","#b5b56d","#c49a6d","#8fa4b8","#c98aa0","#94bf7d","#e0a08a","#7b9eb5","#a988a8"],fontColor:"#212121",edgeOpacity:.4,edgeGradientFill:!0,nodeBorderColor:null,canvasStyle:"border: 1px solid #caced0; box-sizing: border-box",tooltipTheme:"light"},dark:{nodePalette:["#2dd4bf","#7c83f0","#fb6f92","#38bdf8","#fbbf24","#a78bfa","#34d399","#f472b6","#5eead4","#93a6ff","#fca5a5","#fcd34d"],fontColor:"#e7eff4",edgeOpacity:.5,edgeGradientFill:!0,nodeBorderColor:null,canvasStyle:"background: #0e1a23; border: 1px solid #1f2f3a; box-sizing: border-box;",tooltipTheme:"dark"},midnight:{nodePalette:["#818cf8","#a78bfa","#c084fc","#f0abfc","#60a5fa","#38bdf8","#34d399","#fbbf24"],fontColor:"#c7d2fe",edgeOpacity:.55,edgeGradientFill:!0,nodeBorderColor:null,canvasStyle:"background: #0b1020; border: 1px solid #1e2749; box-sizing: border-box;",tooltipTheme:"dark"},mint:{nodePalette:["#10b981","#14b8a6","#0ea5e9","#34d399","#5eead4","#6ee7b7","#22d3ee","#84cc16"],fontColor:"#0f3d33",edgeOpacity:.4,edgeGradientFill:!0,nodeBorderColor:null,canvasStyle:"background: #f2fbf7; border: 1px solid #cbeee0; box-sizing: border-box;",tooltipTheme:"light"},sunset:{nodePalette:["#fb7185","#f97316","#f59e0b","#ef4444","#ec4899","#fbbf24","#fb923c","#e11d48"],fontColor:"#7c2d12",edgeOpacity:.42,edgeGradientFill:!0,nodeBorderColor:null,canvasStyle:"background: #fff7f0; border: 1px solid #f6d9c4; box-sizing: border-box;",tooltipTheme:"light"}},e1=["nodePalette","fontColor","edgeOpacity","edgeGradientFill","nodeBorderColor","canvasStyle","tooltipTheme"];class e2{constructor(){this.handlers=new Map}on(e,t){let n=this.handlers.get(e);return n||(n=new Set,this.handlers.set(e,n)),n.add(t),()=>this.off(e,t)}off(e,t){let n=this.handlers.get(e);n&&(n.delete(t),0===n.size&&this.handlers.delete(e))}emit(e,t){let n=this.handlers.get(e);if(n)for(let i of[...n])try{i(t)}catch(t){console.error(`ApexSankey: an event handler for "${e}" threw`,t)}}clear(){this.handlers.clear()}}let e5="http://www.w3.org/2000/svg",e4=[[3.6,1,0],[2.8,.55,.05],[2,.3,.1]];function e6(e,t,n){let i=new Set(n),o=new Map(t.map(e=>[e.id,e])),r=new Map;for(let e of t)if(i.has(e.id))for(let t of e.children)r.set(t,e.id);let s=[],a=new Set;for(let t of e.nodes){let e=r.get(t.id);if(void 0===e){s.push(t);continue}if(a.has(e))continue;a.add(e);let n=o.get(e);n&&s.push(void 0!==n.color?{id:n.id,title:n.title,color:n.color}:{id:n.id,title:n.title})}let l=new Map;for(let t of e.edges){let e=r.get(t.source)??t.source,n=r.get(t.target)??t.target;if(e===n)continue;let i=`${e}\0${n}\0${t.type??""}`,o=l.get(i);o?l.set(i,{...o,value:o.value+t.value}):l.set(i,{...t,source:e,target:n})}return{nodes:s,edges:[...l.values()]}}let e3=(e,t,n)=>`${e}\0${t}\0${n}`,e8={added:"#16a34a",removed:"#dc2626",changed:"#d97706"};class e9{constructor(e,t){this.element=e,this.config=t,this.root=null,this.teardowns=[],this.syncing=!1,this.entered=new Map,this.diff=function(e,t){let n=new Map(e.edges.map(e=>[e3(e.source,e.target,e.type??""),e])),i=new Map(t.edges.map(e=>[e3(e.source,e.target,e.type??""),e])),o=[];for(let e of t.edges){let t=e3(e.source,e.target,e.type??""),i=n.get(t);o.push({source:e.source,target:e.target,type:e.type??"",status:void 0===i?"added":i.value===e.value?"unchanged":"changed",beforeValue:null==i?void 0:i.value,afterValue:e.value})}for(let t of e.edges){let e=e3(t.source,t.target,t.type??"");i.has(e)||o.push({source:t.source,target:t.target,type:t.type??"",status:"removed",beforeValue:t.value})}let r=new Set(e.nodes.map(e=>e.id)),s=new Set(t.nodes.map(e=>e.id));return{edges:o,addedNodes:t.nodes.filter(e=>!r.has(e.id)).map(e=>e.id),removedNodes:e.nodes.filter(e=>!s.has(e.id)).map(e=>e.id)}}(t.before,t.after)}render(){let{after:e,before:t,options:n}=this.config,i={...e8,...this.config.diffColors};this.element.innerHTML="";let o=document.createElement("div");o.className="apexsankey-comparison",o.style.cssText="display:flex;flex-direction:column;gap:12px;";let r=document.createElement("div");r.className="apexsankey-comparison-panels",r.style.cssText="display:flex;gap:16px;align-items:flex-start;",o.appendChild(r);let s=this.buildPanel(r,t.title),a=this.buildPanel(r,e.title);!1!==this.config.showLegend&&o.appendChild(this.buildLegend(i)),this.element.appendChild(o),this.root=o;let l={...n,width:"100%",height:(null==n?void 0:n.height)??420};if(this.before=new te(s,{...l,tooltipId:"apexsankey-cmp-before"}),this.after=new te(a,{...l,tooltipId:"apexsankey-cmp-after"}),this.before.render({nodes:t.nodes,edges:t.edges,options:this.before.options}),this.after.render({nodes:e.nodes,edges:e.edges,options:this.after.options}),!1!==this.config.showDiff){let e=(null==n?void 0:n.edgeOpacity)??.4;this.applyDiff(this.before,"before",i,e),this.applyDiff(this.after,"after",i,e)}return!1!==this.config.syncHighlight&&(this.link(this.before,this.after),this.link(this.after,this.before)),this}destroy(){var e,t,n;for(let e of this.teardowns.splice(0))e();null==(e=this.before)||e.destroy(),null==(t=this.after)||t.destroy(),this.before=void 0,this.after=void 0,this.entered.clear(),null==(n=this.root)||n.remove(),this.root=null}buildPanel(e,t){let n=document.createElement("div");if(n.style.cssText="flex:1;min-width:0;",t){let e=document.createElement("div");e.className="apexsankey-comparison-title",e.textContent=t,e.style.cssText="font-weight:600;font-size:13px;margin-bottom:6px;color:#334155;",n.appendChild(e)}let i=document.createElement("div");return n.appendChild(i),e.appendChild(n),i}buildLegend(e){let t=document.createElement("div");for(let[n,i,o]of(t.className="apexsankey-comparison-legend",t.style.cssText="display:flex;gap:16px;font-size:12px;color:#475569;align-items:center;flex-wrap:wrap;",[["Added",e.added,!0],["Removed",e.removed,!0],["Changed",e.changed,!1]])){let e=document.createElement("span");e.style.cssText="display:inline-flex;align-items:center;gap:6px;";let r=document.createElement("span");r.style.cssText=`display:inline-block;width:20px;height:0;border-top:2px ${o?"dashed":"solid"} ${i};`,e.append(r,document.createTextNode(n)),t.appendChild(e)}return t}applyDiff(e,t,n,i){var o,r;
89let s=null==(r=null==(o=e.graph)?void 0:o.canvas)?void 0:r.node;if(s)for(let e of this.diff.edges){if(!("changed"===e.status||("before"===t?"removed"===e.status:"added"===e.status)))continue;let o=this.findEdge(s,e.source,e.target);if(!o)continue;let r=n[e.status];o.style.opacity="1",o.setAttribute("fill-opacity",String(i)),o.setAttribute("stroke",r),o.setAttribute("stroke-width","2"),o.setAttribute("stroke-opacity","0.9"),"changed"!==e.status&&o.setAttribute("stroke-dasharray","6 4"),o.setAttribute("data-diff",e.status)}}link(e,t){this.teardowns.push(e.on("node:mouseenter",({id:e})=>this.syncEnter(t,t=>this.findNode(t,e)))),this.teardowns.push(e.on("node:mouseleave",()=>this.syncLeave(t))),this.teardowns.push(e.on("edge:mouseenter",({source:e,target:n})=>this.syncEnter(t,t=>this.findEdge(t,e,n)))),this.teardowns.push(e.on("edge:mouseleave",()=>this.syncLeave(t)))}syncEnter(e,t){var n,i;if(this.syncing)return;let o=null==(i=null==(n=e.graph)?void 0:n.canvas)?void 0:i.node,r=o&&t(o);if(r){this.syncLeave(e),this.syncing=!0;try{r.dispatchEvent(new MouseEvent("mouseenter"))}finally{this.syncing=!1}this.entered.set(e,r)}}syncLeave(e){let t=this.entered.get(e);if(t){this.entered.delete(e),this.syncing=!0;try{t.dispatchEvent(new MouseEvent("mouseleave"))}finally{this.syncing=!1}}}findNode(e,t){for(let n of Array.from(e.querySelectorAll("[data-node-id]")))if(n.getAttribute("data-node-id")===t)return n;return null}findEdge(e,t,n){for(let i of Array.from(e.querySelectorAll("[data-edge-source]")))if(i.getAttribute("data-edge-source")===t&&i.getAttribute("data-edge-target")===n)return i;return null}}let e7=class extends r{constructor(e,t={}){super(e,"sankey_"+crypto.randomUUID().replace(/-/g,"").substring(0,9)),this.events=new e2,this.pluginTeardowns=[],this.isDestroyed=!1,this.options={...eu,...function(e){if(!e)return{};let t="string"==typeof e?e0[e]:e;if(!t)return{};let n={};for(let e of e1){let i=t[e];void 0!==i&&(n[e]=i)}return n}(t.theme),...t};let{height:n,width:i}=this.options;this.graph=new eJ(this.element,this.options,this.chartContext,this.events),this.setupElementDimensions(i,n),this.handleWatermark()}static setLicense(e){B.setLicense(e)}static registerTheme(e,t){e0[e]=t}static buildAlluvialData(e){return function(e){var t;let{dimensions:n,records:i}=e,o=(null==(t=e.palette)?void 0:t.length)?e.palette:ec,r=[],s=new Map,a=new Map,l=0,d=0,h=(e,t)=>{let n,i=`${e}\0${t}`,h=s.get(i);return h||(h="alluvial-"+d++,s.set(i,h),r.push({id:h,title:t,color:((n=a.get(t))||(n=o[l%o.length],l++,a.set(t,n)),n)})),h},c=new Map;for(let e of i){let t=e.value??1;for(let i=0;i<n.length-1;i++){let o=e.values[n[i]],r=e.values[n[i+1]];if(null==o||null==r)continue;let s=h(i,o),a=h(i+1,r),l=`${s}�${a}`,d=c.get(l);d?d.value+=t:c.set(l,{source:s,target:a,value:t,type:o})}}return{nodes:r,edges:[...c.values()]}}(e)}static collapseGroups(e,t,n){return e6(e,t,n)}static compare(e,t){return new e9(e,t).render()}setupElementDimensions(e,t){let n=!1,i=0;"string"==typeof e&&/^\d+(\.\d+)?%$/.test(e)?(i=Number(e.substring(0,e.length-1)),n=!0):i=Number(e);let o="auto"===t?i/1.6:t;this.element.style.width=`${i}${n?"%":"px"}`,this.element.style.height=`${o}${n?"%":"px"}`,this.element.style.position="relative"}handleWatermark(){this.element&&(B.isLicenseValid()?I.remove(this.element):I.add(this.element))}render(e){var t;if(!this.element)throw Error("Element not found");return O(this.element,(null==(t=this.options.locale)?void 0:t.direction)??"ltr"),this.graph.construct(e),this.graph.render(),this.options.enableToolbar&&new w(this.element,this.chartContext).render({enableExport:!0,onExport:this.graph.exportToSvg.bind(this.graph)}),this.graph}update(e,t){var n;if(!this.element)throw Error("Element not found");return O(this.element,(null==(n=this.options.locale)?void 0:n.direction)??"ltr"),this.graph.update(e,t),this.graph}on(e,t){return this.events.on(e,t)}off(e,t){this.events.off(e,t)}use(e){let t=e.install({chart:this,on:(e,t)=>this.on(e,t)});return"function"==typeof t&&this.pluginTeardowns.push(t),this}destroy(){if(!this.isDestroyed){for(let e of(this.isDestroyed=!0,this.pluginTeardowns.splice(0)))try{e()}catch(e){console.error("ApexSankey: a plugin teardown threw",e)}this.events.emit("destroyed"),this.events.clear(),this.graph.destroy(),super.destroy()}}};e7.plugins={pathTrace:function(e={}){let t=e.trigger??"click",n=e.direction??"downstream",i=e.color??"#ffffff",o=e.duration??700,r=e.stagger??220;return{name:"path-trace",install(e){let s=e.chart,a=null,l=0,d=0,h=()=>{l&&cancelAnimationFrame(l),l=0,null==a||a.remove(),a=null};return e.on("hover"===t?"node:mouseenter":"node:click",({id:e})=>(e=>{var t;if(h(),"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let c=s.graph,u=null==c?void 0:c.graph,p=null==(t=null==c?void 0:c.canvas)?void 0:t.node;if(!u||!p)return;let g=p.querySelector("[data-edge-source]"),f=null==g?void 0:g.parentNode;if(!f)return;let m=document.createElementNS(e5,"path");
89if("function"!=typeof m.getTotalLength)return;p.appendChild(m);let v="vertical"===s.options.orientation,y=function(e,t,n){let i=[],o=n=>{let o=new Set([t]),r=[t],s=0;for(;r.length&&i.length<250;){let t=[];for(let a of r)for(let r of n?e.outEdges(a)??[]:e.inEdges(a)??[]){i.push({v:r.v,w:r.w,name:r.name,depth:s,dir:n?1:-1});let e=n?r.w:r.v;o.has(e)||(o.add(e),t.push(e))}r=t,s++}};return"upstream"!==n&&o(!0),"upstream"!==n&&"both"!==n||o(!1),i}(u,e,n),b=document.createElementNS(e5,"g");b.setAttribute("class","apexsankey-path-trace"),b.setAttribute("aria-hidden","true"),b.style.pointerEvents="none";let x=[];for(let e of y){let t=u.edge(e.v,e.w,e.name),n=t&&eB(t,v);if(!n)continue;m.setAttribute("d",n);let o=m.getTotalLength();if(!o||!Number.isFinite(o))continue;let s=Math.max(8,Math.min(60,Math.round(o/12))),a=[];for(let e=0;e<=s;e++){let t=m.getPointAtLength(o*e/s);a.push({x:t.x,y:t.y})}let l=e4.map(([e,t])=>{let n=document.createElementNS(e5,"circle");return n.setAttribute("r",String(e)),n.setAttribute("fill",i),n.setAttribute("opacity","0"),n.dataset.opacity=String(t),e>3&&n.setAttribute("stroke","rgba(0,0,0,0.2)"),b.appendChild(n),n});x.push({pts:a,startAt:e.depth*r,dir:e.dir,circles:l})}if(p.removeChild(m),!x.length)return;f.appendChild(b),a=b;let w=x.reduce((e,t)=>Math.max(e,t.startAt+o),0)+250,C=e=>{d||(d=e);let t=e-d;for(let e of x){let n=(t-e.startAt)/o;e.circles.forEach((t,i)=>{let o=n-e4[i][2];if(o<0||o>1)return void t.setAttribute("opacity","0");let r=ez(e.pts,e.dir>0?o:1-o);t.setAttribute("cx",String(r.x)),t.setAttribute("cy",String(r.y)),t.setAttribute("opacity",t.dataset.opacity??"1")})}if(t>=w)return h(),void(d=0);l=requestAnimationFrame(C)};d=0,l=requestAnimationFrame(C)})(e)),e.on("rendered",h),h}}},timePlayback:function(e){let{frames:t}=e,n=e.interval??1600,i=!1!==e.controls;return{name:"time-playback",install(o){var r,s;let a=o.chart,l=t.length-1,d=0,h=!1,c=0,u=null,p=()=>{let e=t[d];e&&a.update({nodes:e.nodes,edges:e.edges,options:a.options})},g=()=>{var e;u&&(u.slider.value=String(d),u.label.textContent=(null==(e=t[d])?void 0:e.label)??`Frame ${d+1} / ${t.length}`,u.button.textContent=h?"⏸":"▶",u.button.setAttribute("aria-label",h?"Pause":"Play"))},f=e=>{d=Math.max(0,Math.min(l,e)),p(),g()},m=()=>{c="undefined"!=typeof window?window.setTimeout(y,n):0};function v(){h=!1,c&&clearTimeout(c),c=0,g()}function y(){if(h){if(d>=l){if(!e.loop)return void v();d=0}else d++;p(),g(),m()}}let b=()=>{h||t.length<2||(d>=l&&!e.loop&&f(0),h=!0,g(),m())};if(i){(u=function(e){let t=document.createElement("div");t.className="apexsankey-playback",t.style.cssText="display:flex;align-items:center;gap:10px;padding:8px 4px;font:inherit;font-size:13px;color:#334155;";let n=document.createElement("button");n.type="button",n.style.cssText="cursor:pointer;width:34px;height:28px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;font-size:13px;line-height:1;";let i=document.createElement("input");i.type="range",i.min="0",i.max=String(Math.max(0,e-1)),i.step="1",i.value="0",i.setAttribute("aria-label","Time frame"),i.style.cssText="flex:1;cursor:pointer;";let o=document.createElement("span");return o.style.cssText="min-width:110px;text-align:right;font-variant-numeric:tabular-nums;",t.append(n,i,o),{bar:t,button:n,slider:i,label:o}}(t.length)).button.addEventListener("click",()=>h?v():b()),u.slider.addEventListener("input",()=>{let e=Number((null==u?void 0:u.slider.value)??0);v(),f(e)});let n=null==(s=null==(r=a.graph)?void 0:r.canvas)?void 0:s.node,i=(null==n?void 0:n.parentElement)??null;e.mount?e.mount.appendChild(u.bar):(null==i?void 0:i.parentElement)?i.parentElement.insertBefore(u.bar,i.nextSibling):null==i||i.appendChild(u.bar)}return g(),e.autoplay&&b(),()=>{v(),null==u||u.bar.remove()}}}},drillDown:function(e){let{edges:t,groups:n,nodes:i}=e,o={nodes:i,edges:t};return{name:"drill-down",install(t){let i=t.chart,r=new Set(n.map(e=>e.id)),s=new Map;for(let e of n)for(let t of e.children)s.set(t,e.id);let a=new Set(e.expanded??[]),l=e=>{i.update({...(()=>{let e=n.filter(e=>!a.has(e.id)).map(e=>e.id);return e6(o,n,e)})(),options:i.options},e)},d=e=>{var t;return(null==(t=n.find(t=>
89t.id===e))?void 0:t.children)??[]},h=e=>{var t;let n=null==(t=i.graph)?void 0:t.graph,o=null==n?void 0:n.node(e);return void 0===(null==o?void 0:o.x)||void 0===o.y?null:{x:o.x,y:o.y}},c=()=>{var e,t;let n=null==(t=null==(e=i.graph)?void 0:e.canvas)?void 0:t.node;n&&n.querySelectorAll("[data-node-id]").forEach(e=>{e.style.cursor=(e=>{if(r.has(e))return!a.has(e);let t=s.get(e);return void 0!==t&&a.has(t)})(e.getAttribute("data-node-id")??"")?"pointer":""})};t.on("rendered",c),t.on("node:click",({id:e})=>{let t;if(r.has(e)&&!a.has(e)){let n=h(e),i=d(e);a.add(e),n&&i.length&&(t={growFrom:{anchor:n,nodes:i}})}else{let n=s.get(e);if(void 0===n||!a.has(n))return;let i=d(n),o=(e=>{let t=e.map(h).filter(e=>null!==e);if(!t.length)return null;let n=t.reduce((e,t)=>({x:e.x+t.x,y:e.y+t.y}),{x:0,y:0});return{x:n.x/t.length,y:n.y/t.length}})(i);a.delete(n),o&&i.length&&(t={shrinkInto:{anchor:o,nodes:i}})}l(t)}),l(),c()}}}};let te=e7;"undefined"!=typeof window&&(window.ApexSankey=te)},9298:(e,t,n)=>{"use strict";var i=n(3341);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,r,s){if(s!==i){var a=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:o};return n.PropTypes=n,n}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.