@turquoisehealth/pit-viper 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ ${n.join(`
11
11
  `,yl=class{constructor(){this.registeredListeners=new Map}addListener(t,i){const s={symbol:Symbol(t),handler:i};return this.registeredListeners.has(t)?this.registeredListeners.get(t).push(s):this.registeredListeners.set(t,[s]),()=>this.removeListener(s.symbol)}removeListener(t){for(const[i,s]of this.registeredListeners.entries()){const o=s.findIndex(n=>n.symbol===t);if(o>=0){s.splice(o,1),s.length===0&&this.registeredListeners.delete(i);break}}}dispatch(t,...i){for(const s of this.getListenersByType(t))try{s.handler(...i)}catch(o){ue.errorOnce(String(o))}}getListenersByType(t){return this.registeredListeners.get(t)??[]}destroy(){this.registeredListeners.clear()}},Bc=class{constructor(){this.listeners=new yl,this.destroyFns=[]}addListener(e,t){return this.listeners.addListener(e,t)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(e=>e())}},KY=class aC{constructor(t,i,s){this.element=t,this.topTabGuard=i,this.bottomTabGuard=s,this.destroyFns=[],this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,o=>this.onTab(o,!1)),this.initTabGuard(this.bottomTabGuard,o=>this.onTab(o,!0)),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",o=>this.onBlur(o),{capture:!0})}set tabIndex(t){this.guardTabIndex=t,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){for(const t of this.destroyFns)t();this.destroyFns.length=0}initTabGuard(t,i){const s=()=>i(t);t.addEventListener("focus",s),this.destroyFns.push(()=>t.removeEventListener("focus",s))}setGuardIndices(t){const i=t;pt(this.topTabGuard,"tabindex",i),pt(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:t}){const{topTabGuard:i,bottomTabGuard:s}=this;this.hasFocus=!1,this.guardTabIndex!==0&&t!==i&&t!==s&&this.setGuardIndices(this.guardTabIndex)}onTab(t,i){if(this.guardTabIndex!==0){let s;t.tabIndex===0?(s=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):s=this.findEnterTarget(i),s?.focus()}}static queryFocusable(t,i){const s=wt();return Array.from(t.querySelectorAll(i)).filter(o=>{if(o instanceof HTMLElement){const n=s.getComputedStyle(o);return n.display!=="none"&&n.visibility!=="none"}return!1})}findEnterTarget(t){const i=aC.queryFocusable(this.element,'[tabindex="0"]'),s=t?i.length-1:0;return i[s]}findExitTarget(t){const i=aC.queryFocusable(el(),"[tabindex]").filter(n=>n.tabIndex>0).sort((n,r)=>n.tabIndex-r.tabIndex),{before:s,after:o}=aC.findBeforeAndAfter(i,this.guardTabIndex);return t?s:o}static findBeforeAndAfter(t,i){let s=0,o=t.length-1,n,r;for(;s<=o;){const a=Math.floor((s+o)/2),l=t[a].tabIndex;if(l===i){n=t[a-1]||void 0,r=t[a+1]||void 0;break}else l<i?(n=t[a],s=a+1):(r=t[a],o=a-1)}return{before:n,after:r}}};function ir(e,t,i,s,o){t.addEventListener(i,s);const n=()=>t.removeEventListener(i,s,o);return e.push(n),n}function L2(e,t,i){ir(e,t,"keydown",s=>{s.key==="Escape"&&i(s)})}function $Y(e,t,i){const s=ir(e,window,"mousedown",o=>{[0,2].includes(o.button)&&!E2(t,o)&&(i(),s())});return s}function YY(e,t,i){const s=ir(e,window,"touchstart",o=>{Array.from(o.targetTouches).some(r=>!E2(t,r))&&(i(),s())});return s}function E2(e,t){if(t.target instanceof Element){const{x:i,y:s,width:o,height:n}=e.getBoundingClientRect(),{clientX:r,clientY:a}=t;return r>=i&&a>=s&&r<=i+o&&a<=s+n}return!1}function hS(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function VA(e,t,...i){return hS(e)&&(e.key===t||i.some(s=>e.key===s))}function fE(e,t,i,s){i&&ir(e,t,"keydown",o=>{VA(o,s)&&i.focus()})}function XY(e,t,i,s,o,n){fE(e,t,o,n),fE(e,t,i,s),ir(e,t,"keydown",r=>{VA(r,s,n)&&r.preventDefault()})}var Pu={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function P2(e){const{orientation:t,buttons:i,wrapAround:s=!1,onEscape:o,onFocus:n,onBlur:r}=e,{nextKey:a,prevKey:l}=Pu[t],c=p=>{p.target&&"tabIndex"in p.target&&(i.forEach(g=>g.tabIndex=-1),p.target.tabIndex=0)},[d,h]=s?[i.length,i.length]:[0,1/0],u=[];for(let p=0;p<i.length;p++){const g=i[(d+p-1)%h],f=i[p],y=i[(d+p+1)%h];ir(u,f,"focus",c),n&&ir(u,f,"focus",n),r&&ir(u,f,"blur",r),o&&L2(u,f,o),XY(u,f,y,a,g,l),f.tabIndex=p===0?0:-1}return u}var ZY=class{constructor(e,t,i){this.lastFocus=t,this.closeCallback=i,this.destroyFns=[],this.destroyFns.push($Y(this.destroyFns,e,()=>this.close(!0))),this.destroyFns.push(YY(this.destroyFns,e,()=>this.close(!0)))}close(e){this.destroyFns.forEach(t=>t()),this.destroyFns.length=0,this.closeCallback(),this.finishClosing(e)}finishClosing(e){this.destroyFns.forEach(t=>t()),this.destroyFns.length=0,pt(this.lastFocus,"aria-expanded",!1),e||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}};function N2(e){const{sourceEvent:t,orientation:i,menu:s,buttons:o,closeCallback:n,overrideFocusVisible:r,autoCloseOnBlur:a=!1}=e,{nextKey:l,prevKey:c}=Pu[i],d=WA(t);pt(d,"aria-expanded",!0);const h=new ZY(s,d,n),u=()=>h.close(),{destroyFns:p}=h;if(s.role="menu",s.ariaOrientation=i,p.push(...P2({orientation:i,buttons:o,onEscape:u,wrapAround:!0})),s.tabIndex=-1,L2(p,s,u),ir(p,s,"keydown",g=>{g.target===s&&(g.key===l||g.key===c)&&(g.preventDefault(),o[0]?.focus())}),a){const g=f=>{!o.includes(f.relatedTarget)&&u()};for(const f of o)ir(p,f,"blur",g)}return o[0]?.focus({preventScroll:!0}),r!==void 0&&(o.forEach(f=>f.setAttribute("data-focus-visible-override",r.toString())),ir(p,s,"keydown",()=>{o.forEach(f=>f.setAttribute("data-focus-visible-override","true"))},{once:!0})),h}function qY(e,t){return i=>{if(e.ariaDisabled==="true")return i.preventDefault();t(i)}}function HA(e){return"button"in e?e.button===0:hS(e)&&(e.code==="Space"||e.key==="Enter")}function WA(e){if(e?.target instanceof HTMLElement&&"tabindex"in e.target.attributes)return e.target}function O2(e){const t=i=>{if(i.defaultPrevented)return;cS(i.target,"data-preventdefault",!0)&&VA(i,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&i.preventDefault()};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}var QY=class{constructor(e){this.callback=e,this.devicePixelRatio=wt("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=t=>{t.matches||(this.devicePixelRatio=wt("devicePixelRatio")??1,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))}}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const e=wt("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);e?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=e}},JY=class{constructor(){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([t,i])=>this.observe(t,i)),this.queuedObserveRequests=[],this.observeWindow()},typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(t=>{for(const{target:i,contentRect:{width:s,height:o}}of t){const n=this.elements.get(i);this.checkSize(n,i,s,o)}}));let e;this.pixelRatioObserver=new QY(()=>{clearTimeout(e),e=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=el("readyState")==="complete",this.documentReady?this.observeWindow():wt()?.addEventListener("load",this.onLoad)}destroy(){wt()?.removeEventListener("load",this.onLoad),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const e=this.pixelRatioObserver?.pixelRatio??1;for(const[t,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==e){const{width:s,height:o}=i.size;i.size={width:s,height:o,pixelRatio:e},i.cb(i.size,t)}}checkSize(e,t,i,s){if(e&&(i!==e.size?.width||s!==e.size?.height)){const o=this.pixelRatioObserver?.pixelRatio??1;e.size={width:i,height:s,pixelRatio:o},e.cb(e.size,t)}}observe(e,t){if(!this.documentReady){this.queuedObserveRequests.push([e,t]);return}this.elements.has(e)?this.removeFromQueue(e):this.resizeObserver?.observe(e);const i={cb:t};this.elements.set(e,i)}unobserve(e){this.resizeObserver?.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter(([t])=>t!==e)}},ep=class extends Map{constructor(e,t){super(),this.defaultValue=e,this.defaultState=t}set(e,t){return this.delete(e),typeof t<"u"&&super.set(e,t),this}stateId(){return Array.from(this.keys()).pop()??this.defaultState}stateValue(){return Array.from(this.values()).pop()??this.defaultValue}},e6='<div role="presentation" class="ag-charts-wrapper ag-charts-styles" data-ag-charts><div role="presentation" class="ag-charts-canvas-center"><div role="presentation" class="ag-charts-canvas-container"><div role="presentation" class="ag-charts-canvas" aria-hidden="true"></div><div role="figure" class="ag-charts-canvas-proxy"><div role="presentation" class="ag-charts-series-area"></div></div><div role="presentation" class="ag-charts-canvas-overlay"></div></div></div></div>',t6=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area"],mE={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},i6=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}]]);function s6(e,t){if(typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(s=>{for(const o of s)o.target===e&&t(o.intersectionRatio)},{root:e});return i.observe(e),i}var F2={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return F2}};function yE(e,t){const i=He("div");return i.className="ag-charts-tab-guard",e.insertAdjacentElement(t,i),i}var B2=class extends Bc{constructor(e,t){super(),this.styles=new Map,this.container=void 0,this.containerSize=void 0,this.sizeMonitor=new JY,this.cursorState=new ep("default"),this.minWidth=0,this.minHeight=0;const i=He("div");i.innerHTML=e6,this.element=i.children.item(0),this.styleRootElement=t,this.rootElements=t6.reduce((a,l)=>{const c=`ag-charts-${l}`,d=this.element.classList.contains(c)?this.element:this.element.querySelector(`.${c}`);if(!d)throw new Error(`AG Charts - unable to find DOM element ${c}`);return a[l]={element:d,children:new Map,listeners:[]},a},{});let s=!1;this.observer=s6(this.element,a=>{a===0&&!s&&this.listeners.dispatch("hidden",{type:"hidden"}),s=a===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",UY),e&&this.setContainer(e),this.destroyFns.push(O2(this.element));const o=this.element.querySelector(".ag-charts-canvas-center");if(o==null)throw new Error("Error initializing tab guards");const n=yE(o,"beforebegin"),r=yE(o,"afterend");this.tabGuards=new KY(o,n,r)}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.container&&this.sizeMonitor.unobserve(this.container),Object.values(this.rootElements).forEach(e=>{e.children.forEach(t=>t.remove()),e.element.remove()}),this.element.remove()}setSizeOptions(e=300,t=300,i,s){const{style:o}=this.element;o.width=`${i??e}px`,o.height=`${s??t}px`,this.minWidth=i??e,this.minHeight=s??t,this.updateContainerClassName()}updateContainerSize(){const{style:e}=this.rootElements["canvas-center"].element;e.visibility=this.containerSize==null?"hidden":"",this.containerSize?(e.width=`${this.containerSize.width??0}px`,e.height=`${this.containerSize.height??0}px`):(e.width="",e.height=""),this.updateContainerClassName()}setTabGuardIndex(e){this.tabGuards.tabIndex=e}setContainer(e){if(e===this.container)return;if(this.container&&(this.container.removeChild(this.element),this.sizeMonitor.unobserve(this.container)),!(this.getShadowDocumentRoot(e)!=null))for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=e;for(const[i,s]of this.styles)this.addStyles(i,s);e.appendChild(this.element),this.sizeMonitor.observe(e,i=>{this.containerSize=i,this.updateContainerSize(),this.listeners.dispatch("resize",{type:"resize"})}),this.listeners.dispatch("container-changed",{type:"container-changed"})}setThemeClass(e){const t="ag-charts-theme-";this.element.classList.forEach(i=>{i.startsWith(t)&&i!==e&&this.element.classList.remove(i)}),this.element.classList.add(e)}setThemeParameters(e){const t={accentColor:"accent-color",axisColor:"axis-color",backgroundColor:"background-color",borderColor:"border-color",foregroundColor:"foreground-color",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",gridLineColor:"grid-line-color",padding:"padding",subtleTextColor:"subtle-text-color",textColor:"text-color",chromeBackgroundColor:"chrome-background-color",chromeFontFamily:"chrome-font-family",chromeFontSize:"chrome-font-size",chromeFontWeight:"chrome-font-weight",chromeSubtleTextColor:"chrome-subtle-text-color",chromeTextColor:"chrome-text-color",inputBackgroundColor:"input-background-color",inputTextColor:"input-text-color",crosshairLabelBackgroundColor:"crosshair-label-background-color",crosshairLabelTextColor:"crosshair-label-text-color"},i=["fontSize","chromeFontSize"];for(const[s,o]of Object.entries(e)){let n=`${o}`;i.includes(s)&&(n=`${o}px`),this.element.style.setProperty(`--ag-charts-${t[s]}`,n)}}updateCanvasLabel(e){pt(this.rootElements["canvas-proxy"].element,"aria-label",e)}getEventElement(e,t){return["focus","blur","keydown","keyup"].includes(t)?this.rootElements["series-area"].element:e}addEventListener(e,t,i){this.getEventElement(this.element,e).addEventListener(e,t,i)}removeEventListener(e,t,i){this.getEventElement(this.element,e).removeEventListener(e,t,i)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const e=wt(),t=new ve(0,0,e.innerWidth,e.innerHeight),i=this.getRawOverlayClientRect();return t.intersection(i)?.toDOMRect()??F2}getRawOverlayClientRect(){let e=this.element;for(;e!=null;){const n=e.computedStyleMap?.()?.get("overflow-y")?.toString();if(n==="auto"||n==="scroll")return ve.fromDOMRect(e.getBoundingClientRect());e=e.parentElement}const t=this.getShadowDocumentRoot();if(t!=null)return ve.fromDOMRect(t.getBoundingClientRect());const{innerWidth:i,innerHeight:s}=wt();return new ve(0,0,i,s)}getShadowDocumentRoot(e=this.container){const t=e?.ownerDocument?.body??el("body");for(;e!=null;){if(e===t)return;if(e.parentNode instanceof DocumentFragment)return e;e=e.parentNode}return this.container}getParent(e){return this.rootElements[e].element}getChildBoundingClientRect(e){const{children:t}=this.rootElements[e],i=[];for(const s of t.values())i.push(ve.fromDOMRect(s.getBoundingClientRect()));return ve.merge(i)}isManagedChildDOMElement(e,t,i){const{children:s}=this.rootElements[t],o=s?.get(i);return o!=null&&e.contains(o)}contains(e,t){return t==null?this.element.contains(e):this.rootElements[t].element.contains(e)}addStyles(e,t){const i="data-ag-charts";if(this.styles.set(e,t),this.container==null)return;const s=r=>r.getAttribute(i)===e,o=r=>{const a=new Set(["TITLE","META"]);let l=!0,c;for(const h of r.children){if(l&&a.has(h.tagName)){c=h;continue}if(l=!1,s(h))return;h.hasAttribute(i)&&(c=h)}const d=He("style");return c!=null?r.insertBefore(d,c.nextSibling):r.prepend(d),d};let n;this.styleRootElement?n=o(this.styleRootElement):this.getShadowDocumentRoot(this.container)!=null?n=this.addChild("styles",e):n=o(el("head")),!(n==null||s(n))&&(n.setAttribute(i,e),n.innerHTML=t)}removeStyles(e){this.removeChild("styles",e)}updateCursor(e,t){this.cursorState.set(e,t),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}addChild(e,t,i,s){const{element:o,children:n,listeners:r}=this.rootElements[e];if(!n)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(n.has(t))return n.get(t);const{childElementType:a="div"}=i6.get(e)??{};if(i&&i.tagName.toLowerCase()!==a.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const l=i??He(a);for(const[c,d,h]of r)l.addEventListener(c,d,h);if(n.set(t,l),s){const c=o.querySelector(s.query);if(c==null)throw new Error(`AG Charts - addChild query failed ${s.query}`);c.insertAdjacentElement(s.where,l)}else o?.appendChild(l);return l}removeChild(e,t){const{children:i}=this.rootElements[e];i&&(i.get(t)?.remove(),i.delete(t))}incrementDataCounter(e){const{dataset:t}=this.element;t[e]??(t[e]="0"),t[e]=String(Number(t[e])+1)}setDataBoolean(e,t){this.element.dataset[e]=String(t)}updateContainerClassName(){const{element:e,containerSize:t,minWidth:i,minHeight:s}=this;e.classList.toggle(mE.safeHorizontal,i>=(t?.width??1/0)),e.classList.toggle(mE.safeVertical,s>=(t?.height??1/0))}},o6=class extends aa{constructor(){super(He("div")),this.textElement=Sn("text"),this.textElement.role="presentation",this.svgElement=Sn("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(e){this.textElement.textContent=e;const i=this.textElement.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}},Rm=class extends aa{constructor(){super(He("button")),this.setEnabled(!0)}destructor(){}setEnabled(e){pt(this.elem,"aria-disabled",!e),er(this.elem,"pointer-events",e?void 0:"none")}addListener(e,t){return super.addListener(e,(i,s)=>{(e==="click"||e==="dblclick")&&this.isDisabled()||t(i,s)})}},n6=class extends aa{constructor(){super(He("div")),pt(this.elem,"role","group")}destructor(){}},G2=class extends aa{constructor(e,t){super(He("div")),this.focusedChildIndex=0,this.onChildFocus=(i,s)=>{const o=this.children[this.focusedChildIndex];this.focusedChildIndex=s.index,o?.setTabIndex(-1),s.setTabIndex(0)},this.onChildKeyDown=(i,s)=>{const o=this.orientation,[n,r]=o==="both"?[Pu.horizontal,Pu.vertical]:[Pu[o],void 0];let a=-1;if(hS(i.sourceEvent)){const l=i.sourceEvent.key;l===n.nextKey||l===r?.nextKey?a=s.index+1:(l===n.prevKey||l===r?.prevKey)&&(a=s.index-1)}this.children[a]?.focus()},this.orientation=e,pt(this.elem,"role",t)}get orientation(){return cS(this.elem,"aria-orientation")??"both"}set orientation(e){pt(this.elem,"aria-orientation",e!=="both"?e:void 0)}focus(){this.children[this.focusedChildIndex]?.focus()}onChildAdded(e){e.addListener("focus",this.onChildFocus),e.addListener("keydown",this.onChildKeyDown),e.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(e){e.removeListener("focus",this.onChildFocus),e.removeListener("keydown",this.onChildKeyDown)}},r6=class extends G2{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(e=>e.getElement().parentElement.remove())}addChildToDOM(e,t){const i=He("div");pt(i,"role","listitem"),er(i,"position","absolute"),aa.setElementContainer(e,i),this.appendOrInsert(i,t),this.setHidden(!1)}removeChildFromDOM(e){e.getElement().parentElement.remove(),this.setHidden(this.children.length===0)}setHidden(e){this.children.length===0&&(e=!0),super.setHidden(e)}},tp=class extends aa{constructor(t){super(t)}destructor(){}},jA=class Vg extends aa{constructor(){super(He("input")),this._step=Vg.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(t){this._step=t,this.getElement().step=t.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(t){if(t!==this._keyboardStep?.step&&(this._keyboardStep!==void 0&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),t!==void 0)){const i=()=>this.getElement().step=t.attributeValue,s=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:t,onKeyDown:i,onKeyUp:s,onBlur:s},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return cS(this.elem,"aria-orientation")??"both"}set orientation(t){pt(this.elem,"aria-orientation",t!=="both"?t:void 0),Vg.registerDefaultPreventers(this,t)}destructor(){}clampValueRatio(t,i){const s=this.getValueRatio(),o=Pe(t,s,i);return o!==s&&this.setValueRatio(o),o}setValueRatio(t,i){const{divider:s}=this.step,o=Math.round(t*1e4)/s,{ariaValueText:n=i2(o/s)}=i??{},r=this.getElement();r.value=`${o}`,r.ariaValueText=n}getValueRatio(){return parseFloat(this.getElement().value)/this.step.divider}static registerDefaultPreventers(t,i){i==="both"?t.removeListener("keydown",Vg.onKeyDown):t.addListener("keydown",Vg.onKeyDown)}static onKeyDown(t,i){let s=[];const{orientation:o}=i;o==="horizontal"?s=["ArrowUp","ArrowDown"]:o==="vertical"&&(s=["ArrowLeft","ArrowRight"]),s.includes(t.sourceEvent.code)&&t.sourceEvent.preventDefault()}};jA.STEP_ONE={attributeValue:"1",divider:1};jA.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var UA=jA,a6=class extends Rm{constructor(){super(),pt(this.elem,"role","switch"),this.setChecked(!1)}setChecked(e){pt(this.elem,"aria-checked",e)}},uS=class extends G2{constructor(e="horizontal"){super(e,"toolbar")}destructor(){}};function qh(e,t){return t.params?.type===e}function l6(e){if(e==="button")return new Rm;if(e==="slider")return new UA;if(e==="toolbar")return new uS;if(e==="group")return new n6;if(e==="list")return new r6;if(e==="region")return new tp(He("div"));if(e==="text")return new o6;if(e==="listswitch")return new a6;throw Error("AG Charts - error allocating meta")}function vE(e){const t={params:e,result:void 0};return t.result=l6(t.params.type),t}var _2=class{constructor(e,t){this.localeManager=e,this.domManager=t,this.destroyFns=[]}destroy(){this.destroyFns.forEach(e=>e())}addLocalisation(e){e(),this.destroyFns.push(this.localeManager.addListener("locale-changed",e))}createProxyContainer(e){const t=vE(e),{params:i,result:s}=t,o=s.getElement();return this.domManager.addChild("canvas-proxy",i.domManagerId,o),o.classList.add(...i.classList,"ag-charts-proxy-container"),o.role=i.type,"ariaOrientation"in i&&(o.ariaOrientation=i.ariaOrientation),qh("toolbar",t)&&(t.result.orientation=t.params.orientation),this.addLocalisation(()=>{o.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),s}createProxyElement(e){const t=vE(e);if(qh("button",t)){const{params:i,result:s}=t,o=s.getElement();if(this.initInteract(i,s),typeof i.textContent=="string")o.textContent=i.textContent;else{const{textContent:n}=i;this.addLocalisation(()=>{o.textContent=this.localeManager.t(n.id,n.params)})}this.setParent(t.params,t.result)}if(qh("slider",t)){const{params:i,result:s}=t,o=s.getElement();this.initInteract(i,s),o.type="range",o.role="presentation",o.style.margin="0px",this.addLocalisation(()=>{o.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(t.params,t.result)}if(qh("text",t)){const{params:i,result:s}=t;this.initElement(i,s),this.setParent(t.params,t.result)}if(qh("listswitch",t)){const{params:i,result:s}=t;this.initInteract(i,s),s.setTextContent(i.textContent),s.setChecked(i.ariaChecked),s.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(t.params,t.result)}if(qh("region",t)){const{params:i,result:s}=t,o=s.getElement();this.initInteract(i,s),o.role="region",this.setParent(t.params,t.result)}return t.result}initElement(e,t){const i=t.getElement();return pt(i,"id",e.id),er(i,"cursor",e.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),i}initInteract(e,t){const{tabIndex:i,domIndex:s}=e,o=this.initElement(e,t);i!==void 0&&(o.tabIndex=i),s!==void 0&&(t.domIndex=s)}setParent(e,t){if("parent"in e)e.parent?.addChild(t);else{const i={where:e.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",e.domManagerId,t.getElement(),i)}}},c6={ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColorPicker:"Color picker",ariaLabelFinancialCharts:"Financial Charts",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaValuePanRange:"${min}[percent] to ${max}[percent]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}"},d6=/\$\{(\w+)}(?:\[(\w+)])?/gi,bw={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})},h6=({defaultValue:e,variables:t})=>e?.replaceAll(d6,(i,s,o)=>{const n=t[s],r=o!=null?bw[o]:null;return o!=null&&r==null&&ue.warnOnce(`Format style [${o}] is not supported`),r!=null?r.format(n):typeof n=="number"?bw.number.format(n):n instanceof Date?bw.datetime.format(n):String(n)}),u6=class extends yl{constructor(){super(...arguments),this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(e){this.localeText!==e&&(this.localeText=e,this.dispatch("locale-changed"))}setLocaleTextFormatter(e){this.getLocaleText=e,this.getLocaleText!==e&&(this.getLocaleText=e,this.dispatch("locale-changed"))}t(e,t={}){const{localeText:i=c6,getLocaleText:s}=this,o=i[e];return s?.({key:e,defaultValue:o,variables:t})??h6({defaultValue:o,variables:t})??e}},KA=class{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:t,height:i,canvasElement:s,willReadFrequently:o=!1}=e;this.pixelRatio=e.pixelRatio??wt("devicePixelRatio")??1,this.element=s??He("canvas"),this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((t??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:o}),this.onEnabledChange(),this.resize(t??0,i??0,this.pixelRatio),EG(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t,i){if(!(e>0&&t>0))return;const{element:s,context:o}=this;s.width=Math.round(e*i),s.height=Math.round(t*i),o.setTransform(i,0,0,i,0,0),s.style.width=e+"px",s.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=i}clear(){LG(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};D([Nc(e=>e.onEnabledChange())],KA.prototype,"enabled",2);var p6=class{constructor(e){this.canvas=e,this.debug=yt.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(e,t,i){this.canvas.resize(e,t,i),this.layersMap.forEach(({canvas:s})=>s.resize(e,t,i))}addLayer(e){const{width:t,height:i,pixelRatio:s}=this.canvas,{name:o}=e,n=new PG({width:t,height:i,pixelRatio:s});return this.layersMap.set(n,{id:this.nextLayerId++,name:o,canvas:n}),this.debug("Scene.addLayer() - layers",this.layersMap),n}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.debug("Scene.removeLayer() - layers",this.layersMap))}clear(){for(const e of this.layersMap.values())e.canvas.destroy();this.layersMap.clear()}};function g6(e){for(const t of["B","KB","MB","GB"]){if(e<1536)return`${e.toFixed(1)}${t}`;e/=1024}return`${e.toFixed(1)}TB}`}function f6(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:i}=performance.memory,s=[];for(const o of[t,e,i])typeof o=="number"&&s.push(g6(o));return`Heap ${s.join(" / ")}`}function CE(e,t,i,s,o={},n=ve.zero){if(!yt.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:r=0,layersSkipped:a=0,nodesRendered:l=0,nodesSkipped:c=0,opsPerformed:d=0,opsSkipped:h=0}=s??{},u=performance.now(),{start:p,...g}=t,f=Object.entries(g).map(([T,E])=>bE(T,E)).filter(T=>T!=null).join(" + "),y=Object.entries(o).map(([T,E])=>`${T}: ${JSON.stringify(E)}`).join(" ; "),m=yt.check("scene:stats:verbose"),C=f6(),b=[`${bE("⏱️",p,u)} (${f})`,`${y}`,`Layers: ${m?Sw(r,a):e.size}`,m?`Nodes: ${Sw(l,c)}`:null,m?`Ops: ${Sw(d,h)}`:null,m&&C?C:null].filter(vo),S=new xA(T=>i.measureText(T)),A=new Map(b.map(T=>[T,S.measureLines(T)])),R=Math.max(...Array.from(A.values(),T=>T.width)),I=S6(A.values(),T=>T.height),w=2+n.x;i.save(),i.fillStyle="white",i.fillRect(w,0,R,I),i.fillStyle="black";let M=0;for(const[T,E]of A.entries())M+=E.height,i.fillText(T,w,M);i.restore()}function m6(e){const t=EC(wt("agChartsSceneDebug")),i=[];for(const s of t)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);e.debugNodeSearch=i}function y6(e,t){e.save();for(const[i,s]of Object.entries(t)){const o=$t.toCanvas(s);if(!o){ue.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(o.x,o.y,o.width,o.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,o.x,o.y,o.width),e.fillText(i,o.x,o.y,o.width)}e.restore()}var v6=new Set,C6=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function b6(e){const{...t}=e;for(const i of Object.keys(t))C6.has(i)||typeof t[i]!="number"&&typeof t[i]!="string"&&typeof t[i]!="boolean"&&(v6.add(i),delete t[i]);return t}function lC(e,t){if(!yt.check(!0,"scene"))return{};let i=0;return{node:t==="json"?b6(e):e,name:e.name??e.id,dirty:e.dirty,...Array.from(e.children(),s=>lC(s,t)).reduce((s,o)=>{let{name:n}=o;const{node:{visible:r,opacity:a,zIndex:l,translationX:c,translationY:d,rotation:h,scalingX:u,scalingY:p},node:g}=o;(!r||a<=0)&&(n=`(${n})`),Me.is(g)&&g.renderToOffscreenCanvas&&(n=`*${n}*`);const f=Array.isArray(l)?`(${l.join(", ")})`:l,y=[`${(i++).toString().padStart(3,"0")}|`,`${n??"<unknown>"}`,`z: ${f}`,c&&`x: ${c}`,d&&`y: ${d}`,h&&`r: ${h}`,u!=null&&u!==1&&`sx: ${u}`,p!=null&&p!==1&&`sy: ${p}`].filter(b=>!!b).join(" ");let m=y,C=1;for(;s[m]!=null&&C<100;)m=`${y} (${C++})`;return s[m]=o,s},{})}}function z2(e){if(!e.dirty)return{dirtyTree:{},paths:[]};const t=Array.from(e.children(),o=>z2(o)).filter(o=>o.paths.length>0),i=Me.is(e)?e.name??e.id:e.id,s=t.length?t.flatMap(o=>o.paths).map(o=>`${i}.${o}`):[i];return{dirtyTree:{name:i,node:e,dirty:e.dirty,...t.map(o=>o.dirtyTree).filter(o=>o.dirty!=null).reduce((o,n)=>(o[n.name??"<unknown>"]=n,o),{})},paths:s}}function Sw(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function bE(e,t,i){const s=i!=null?i-t:t;return`${e}: ${Math.round(s*100)/100}ms`}function S6(e,t){let i=0;for(const s of e)i+=t(s);return i}var pS=class{constructor(e){this.debug=yt.create(!0,"scene"),this.id=Rn(this),this.root=null,this.pendingSize=null,this.isDirty=!1,this.canvas=new KA(e),this.layersManager=new p6(this.canvas)}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(e){const{element:t}=this.canvas;return t.parentElement?.removeChild(t),e.appendChild(t),this}setRoot(e){return this.root===e?this:(this.isDirty=!0,this.root?._setLayerManager(),this.root=e,e&&(e.visible=!0,e._setLayerManager(this.layersManager)),this)}clear(){this.canvas.clear()}attachNode(e){return this.appendChild(e),()=>this.removeChild(e)}appendChild(e){return this.root?.appendChild(e),this}removeChild(e){return this.root?.removeChild(e),this}download(e,t){XB(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,i){return e=Math.round(e),t=Math.round(t),i??(i=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||i!==this.pixelRatio)?(this.pendingSize=[e,t,i],this.isDirty=!0,!0):!1}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:i,seriesRect:s}=e??{},{canvas:o,canvas:{context:n}={},root:r,pendingSize:a,width:l,height:c,pixelRatio:d}=this;if(!n)return;const h=performance.now();if(a&&(this.layersManager.resize(...a),this.pendingSize=null),r&&!r.visible){this.isDirty=!1;return}if(r?.dirty===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:lC(r,"console")}),CE(this.layersManager,t,n,void 0,i,s);return}const u={ctx:n,width:l,height:c,devicePixelRatio:d,debugNodes:{}};yt.check("scene:stats:verbose")&&(u.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),m6(u);let p=!1;if(r?.dirty!==!1&&(p=!0,o.clear()),r&&yt.check("scene:dirtyTree")){const{dirtyTree:g,paths:f}=z2(r);yt.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:g,paths:f})}if(r&&p){if(r.visible&&r.preRender(u),this.debug.check()){const g=lC(r,"console");this.debug("Scene.render() - before",{canvasCleared:p,tree:g})}r.visible&&(n.save(),r.render(u),n.restore())}t["✍️"]=performance.now()-h,n.verifyDepthZero?.(),this.isDirty=!1,CE(this.layersManager,t,n,u.stats,i,s),y6(n,u.debugNodes),r&&this.debug.check()&&this.debug("Scene.render() - after",{tree:lC(r,"console"),canvasCleared:p})}toSVG(){const{root:e,width:t,height:i}=this;if(e!=null)return Ic.toSVG(e,t,i)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1}destroy(){this.strip(),this.canvas.destroy(),Object.assign(this,{canvas:void 0})}};pS.className="Scene";var x6=class{constructor(){this.cache=new WeakMap}call(e,...t){let i,s=this.cache.get(e);try{i=JSON.stringify(t)}catch{return this.invoke(e,t,s)}return s==null&&(s=new Map,this.cache.set(e,s)),s.has(i)?s.get(i):this.invoke(e,t,s,i)}invoke(e,t,i,s){try{const o=e(...t);return i&&s!=null&&i.set(s,o),o}catch(o){ue.warnOnce("User callback errored, ignoring",o);return}}invalidateCache(){this.cache=new WeakMap}},w6=class extends Bc{constructor(e){super(),this.annotationRoot=e,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(e){return e==null||Mt(e)}restoreMemento(e,t,i){this.annotations=this.cleanData(i??[]).map(s=>{const o=this.getAnnotationTypeStyles(s.type);return _e(s,o)}),this.listeners.dispatch("restore-annotations",{type:"restore-annotations",annotations:this.annotations})}updateData(e){this.annotations=this.cleanData(e??[])}attachNode(e){return this.annotationRoot.append(e),()=>(this.annotationRoot?.removeChild(e),this)}setAnnotationStyles(e){this.styles=e}getAnnotationTypeStyles(e){return this.styles?.[e]}cleanData(e){for(const t of e)"textAlign"in t&&delete t.textAlign;return e}},M6=class{constructor(e){this.sceneRoot=e,this.axes=new Map,this.axisGridGroup=new Me({name:"Axes-Grids",zIndex:1}),this.axisGroup=new Me({name:"Axes",zIndex:2}),this.axisLabelGroup=new Me({name:"Axes-Labels",zIndex:13}),this.axisCrosslineRangeGroup=new Me({name:"Axes-Crosslines-Range",zIndex:4}),this.axisCrosslineLineGroup=new Me({name:"Axes-Crosslines-Line",zIndex:8}),this.axisCrosslineLabelGroup=new Me({name:"Axes-Crosslines-Label",zIndex:13}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(e,t){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of e)t.includes(s)||(s.detachAxis(i),s.destroy());for(const s of t)e?.includes(s)||s.attachAxis(i);this.axes.clear();for(const s of t){const o=s.createAxisContext();this.axes.has(o.direction)?this.axes.get(o.direction)?.push(o):this.axes.set(o.direction,[o])}}getAxisContext(e){return this.axes.get(e)??[]}destroy(){this.axes.clear(),this.sceneRoot.removeChild(this.axisGroup),this.sceneRoot.removeChild(this.axisGridGroup)}},gS=class extends yl{constructor(e){super(),this.animationManager=e,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.debug=yt.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(e){typeof e=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=e,this.isLoadingInitialData=!0,this.animationManager.skip(),this.dispatch("data-source-change"))}clearCallback(){this.dataSourceCallback=void 0}load(e){this.isLoadingData=!0,this.throttledFetch(e)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(e){return GL(t=>this.fetch(t).catch(i=>ue.error("callback failed",i)),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return GL((t,i)=>{this.debug(`DataService - dispatching 'data-load' | ${t}`),this.dispatch("data-load",{type:"data-load",data:i})},e,{leading:!0,trailing:!0})}async fetch(e){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const t=performance.now(),i=this.requestCounter++;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);let s;try{s=await this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-t}ms | ${i}`)}catch(n){this.debug(`DataService - request failed | ${i}`),ue.errorOnce(`DataService - request failed | [${n}]`)}this.isLoadingInitialData=!1;const o=this.freshRequests.findIndex(n=>n===i);if(o===-1||this.dispatchOnlyLatest&&o!==this.freshRequests.length-1){this.debug(`DataService - discarding stale request | ${i}`);return}this.freshRequests=this.freshRequests.slice(o+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(i,s):this.dispatch("data-error")}};D([wo({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],gS.prototype,"dispatchThrottle",2);D([wo({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],gS.prototype,"requestThrottle",2);var SE=class{constructor(e){this.maxAnimationTime=e,this.debug=yt.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(yu.map(t=>[t,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(yu[this.currentPhase])??[]}checkOverlappingId(e){e!=null&&this.controllers.has(e)&&(this.controllers.get(e).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${e}`),this.skip())}addAnimation(e){if(e.isComplete)return;if(yu.indexOf(e.phase)<this.currentPhase){this.debug("Skipping animation due to being for an earlier phase",e.id),e.stop();return}this.controllers.set(e.id,e),this.phases.get(e.phase)?.push(e)}removeAnimation(e){this.controllers.delete(e.id);const t=this.phases.get(e.phase),i=t?.indexOf(e);i!=null&&i>=0&&t?.splice(i,1)}progress(e){if(!this.isReady)return;let t=e===0?.01:e;const i=()=>{const c=yu[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:Df[c]}};let{phase:s,phaseControllers:o,phaseMeta:n}=i();const r=()=>yu[this.currentPhase]==null,a=()=>{for({phase:s,phaseControllers:o,phaseMeta:n}=i();!r()&&o.length===0;)this.currentPhase++,{phase:s,phaseControllers:o,phaseMeta:n}=i(),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:t},o)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${s} with ${o?.length} of ${l}`);do{const c=t,d=n.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let h=0;for(const u of o)d?u.stop():t=Math.min(u.update(c),t),u.isComplete&&(h++,this.removeAnimation(u));this.animationTimeConsumed+=c-t,this.debug(`AnimationBatch - updated ${o.length} controllers; ${h} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),a()}while(t>0&&!r());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let e=!0;for(const[,t]of this.controllers)if(t.duration>0&&Df[t.phase].skipIfNoEarlierAnimations!==!0){e=!1;break}if(!e)for(const[,t]of this.controllers)t.autoplay&&t.play(!0)}skip(e=!0){if(this.skipAnimations===!1&&e===!0){for(const t of this.controllers.values())t.stop();this.controllers.clear()}this.skipAnimations=e}play(){for(const e of this.controllers.values())e.play()}stop(){for(const e of this.controllers.values())try{e.stop(),this.removeAnimation(e)}catch(t){ue.error("Error during animation stop",t)}this.dispatchStopped()}stopByAnimationId(e){if(e!=null&&this.controllers.has(e)){const t=this.controllers.get(e);t&&(t.stop(),this.removeAnimation(t))}}stopByAnimationGroupId(e){for(const t of this.controllers.values())t.groupId===e&&this.stopByAnimationId(t.id)}dispatchStopped(){this.stoppedCbs.forEach(e=>e()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}destroy(){this.stop(),this.controllers.clear()}},V2=(e=>(e[e.Default=32]="Default",e[e.ZoomDrag=16]="ZoomDrag",e[e.Annotations=8]="Annotations",e[e.ContextMenu=4]="ContextMenu",e[e.Animation=2]="Animation",e[e.AnnotationsSelected=1]="AnnotationsSelected",e[e.Clickable=41]="Clickable",e[e.Focusable=34]="Focusable",e[e.Keyable=43]="Keyable",e[e.ContextMenuable=36]="ContextMenuable",e[e.AnnotationsMoveable=9]="AnnotationsMoveable",e[e.AnnotationsDraggable=57]="AnnotationsDraggable",e[e.ZoomDraggable=50]="ZoomDraggable",e[e.ZoomClickable=34]="ZoomClickable",e[e.ZoomWheelable=59]="ZoomWheelable",e[e.All=63]="All",e))(V2||{}),H2=class{constructor(){this.stateQueue=34}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}isState(e){return!!(this.stateQueue&-this.stateQueue&e)}};function xE(e){return e==null?!0:!isNaN(e)&&e>=0&&e<=2}var W2=class{constructor(e,t){this.interactionManager=e,this.chartUpdateMutex=t,this.defaultDuration=1e3,this.batch=new SE(this.defaultDuration*1.5),this.debug=yt.create(!0,"animation"),this.events=new iA,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0}addListener(e,t){return this.events.on(e,t)}animate(e){const t=this.batch;try{t.checkOverlappingId(e.id)}catch(a){this.failsafeOnError(a);return}let{id:i}=e;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()||e.phase==="none";s&&this.debug("AnimationManager - skipping animation");const{delay:o,duration:n}=e;if(!xE(o))throw new Error(`Animation delay of ${o} is unsupported (${i})`);if(!xE(n))throw new Error(`Animation duration of ${n} is unsupported (${i})`);const r=new lG({...e,id:i,skip:s,autoplay:this.isPlaying?e.autoplay:!1,phase:e.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(r,this.defaultDuration))return this.batch.addAnimation(r),r}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(e){this.failsafeOnError(e)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(e){try{this.batch.stopByAnimationId(e)}catch(t){this.failsafeOnError(t)}}stopByAnimationGroupId(e){try{this.batch.stopByAnimationGroupId(e)}catch(t){this.failsafeOnError(t)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(e=!0){this.skipAnimations=e}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error().stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(e){this.requestId=wt().requestAnimationFrame(t=>{e(t).catch(i=>ue.error(i))})}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let e;const t=async i=>{const s=()=>{const o=i-(e??i);e=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:o}),this.interactionManager.pushState(2);try{this.batch.progress(o)}catch(n){this.failsafeOnError(n)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:o})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(s):await this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(t):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(t)}cancelAnimation(){this.requestId!==null&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){ue.error("Error during animation, skipping animations",e),t&&this.cancelAnimation()}startBatch(e){this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`),this.reset(),this.batch.destroy(),this.batch=new SE(this.defaultDuration*1.5),e===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(2),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(e){this.batch.stoppedCbs.add(e)}destroy(){this.stop(),this.events.clear()}},j2=class extends Bc{seriesEvent(e){this.listeners.dispatch(e,{type:e})}seriesKeyNavZoom(e,t){const i={type:"series-keynav-zoom",delta:e,widgetEvent:t};this.listeners.dispatch("series-keynav-zoom",i)}legendItemClick(e,t,i,s,o){const n={type:"legend-item-click",legendType:e,series:t,itemId:i,enabled:s,legendItemName:o};this.listeners.dispatch("legend-item-click",n)}legendItemDoubleClick(e,t,i,s,o,n){const r={type:"legend-item-double-click",legendType:e,series:t,itemId:i,enabled:s,legendItemName:n,numVisibleItems:o};this.listeners.dispatch("legend-item-double-click",r)}},U2=class{constructor(){this.defaultActions=[],this.disabledActions=new Set,this.hiddenActions=new Set,this.listeners=new yl}static check(t,i){return i.type===t}static checkCallback(t,i,s){return t===i}dispatchContext(t,i,s,o){const{sourceEvent:n}=i,r=o?.x??i.canvasX,a=o?.y??i.canvasY;n.stopPropagation();const l={type:t,x:r,y:a,context:s,sourceEvent:n};this.listeners.dispatch("",l)}addListener(t){return this.listeners.addListener("",t)}filterActions(t){return this.defaultActions.filter(i=>i.id!=null&&!this.hiddenActions.has(i.id)&&["all",t].includes(i.type))}registerDefaultAction(t){const i=t.id!=null&&!this.defaultActions.some(({id:s})=>s===t.id);return i&&this.defaultActions.push(t),()=>{const s=i?this.defaultActions.findIndex(({id:o})=>o===t.id):-1;s!==-1&&this.defaultActions.splice(s,1)}}enableAction(t){this.disabledActions.delete(t)}disableAction(t){this.disabledActions.add(t)}showAction(t){this.hiddenActions.add(t)}hideAction(t){this.hiddenActions.delete(t)}isDisabled(t){return this.disabledActions.has(t)}},K2=class extends Bc{constructor(){super(...arguments),this.highlightStates=new ep}updateHighlight(e,t){const{activeHighlight:i}=this;this.highlightStates.set(e,t),this.activeHighlight=this.highlightStates.stateValue(),this.isEqual(this.activeHighlight,i)||this.listeners.dispatch("highlight-change",{type:"highlight-change",currentHighlight:this.activeHighlight,previousHighlight:i,callerId:e})}getActiveHighlight(){return this.activeHighlight}isEqual(e,t){return e===t||e!=null&&t!=null&&e?.series===t?.series&&e?.itemId===t?.itemId&&e?.datum===t?.datum}};function wE(e,t){if(e==null||t.length===0)return[!1,!1];const i=e.valueOf(),s=t[0],o=t[t.length-1];if(typeof s=="string")return[i===s,i===o];let n=s.valueOf(),r=o.valueOf();return n>r&&([n,r]=[r,n]),[i===n,i===r]}function bc(e,t,i,s,o){const{xValue:n,yValue:r}=e,[a,l]=wE(r,o),[c,d]=wE(n,s);return{datum:e,xKey:t,yKey:i,xValue:n,yValue:r,first:c,last:d,min:a,max:l}}function $2(e,[t,i],s){const o=jB(0,e-1,r=>{const a=s(r)?.[1]??NaN;return!Number.isFinite(a)||a>t})??0;let n=WB(0,e-1,r=>{const a=s(r)?.[0]??NaN;return!Number.isFinite(a)||a<i})??e-1;return n=Math.min(n+1,e),[o,n]}function $A(e,t){const i=t.yBar?.upperPoint??t.midPoint??e.datumMidPoint?.(t);if(i){const{x:s,y:o}=$t.toCanvasPoint(e.contentGroup,i.x,i.y);return{canvasX:Math.round(s),canvasY:Math.round(o)}}}function Y2(e,t,i,s,o){let n=-1,r=0,a=0,l=!1;for(;r<s&&n<=t-e;){n+=1;const c=i+a;if(l||(a*=-1),a>=0&&(a+=1),l&&a<0&&(a-=1),c<e||c>t){l=!0;continue}o(c)&&(r+=1)}return r}var UC=class{constructor(t,i){this.domManager=t,this.tooltip=i,this.stateTracker=new ep,this.suppressState=new ep(!1),this.appliedState=null,i.setup(t),t.addListener("hidden",()=>this.tooltip.hide())}updateTooltip(t,i,s){this.tooltip.enabled&&(s??(s=this.stateTracker.get(t)?.content),this.stateTracker.set(t,{content:s,meta:i}),this.applyStates())}removeTooltip(t){this.tooltip.enabled&&(this.stateTracker.delete(t),this.applyStates())}suppressTooltip(t){this.suppressState.set(t,!0)}unsuppressTooltip(t){this.suppressState.delete(t)}destroy(){this.domManager.removeStyles("tooltip")}applyStates(){const t=this.stateTracker.stateId(),i=t?this.stateTracker.get(t):null;if(this.suppressState.stateValue()||i?.meta==null||i?.content==null){this.appliedState=null,this.tooltip.hide();return}const s=this.domManager.getBoundingClientRect(),o=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():s;if(this.appliedState?.content===i?.content){const n=this.tooltip.isVisible();this.tooltip.show(o,s,i?.meta,null,n)}else this.tooltip.show(o,s,i?.meta,i?.content);this.appliedState=i}static makeTooltipMeta(t,i,s){const{canvasX:o,canvasY:n}=t,r=i.properties.tooltip,a={canvasX:o,canvasY:n,enableInteraction:r.interaction?.enabled??!1,lastPointerEvent:{type:t.type,canvasX:o,canvasY:n},showArrow:r.showArrow,position:{type:r.position.type,xOffset:r.position.xOffset,yOffset:r.position.yOffset}},l=$A(i,s);return(r.position.type==="node"||r.position.type==="sparkline")&&l?{...a,canvasX:l.canvasX,canvasY:l.canvasY}:a}isEnteringInteractiveTooltip(t){const{tooltip:i}=this,s=t.sourceEvent.relatedTarget;return i.interactive&&i.enabled&&i.isVisible()&&i.contains(s)}},ME=3,D6=505;function xw(e,t,i){const{offsetX:s,offsetY:o,clientX:n,clientY:r,currentX:a,currentY:l,sourceEvent:c}=i;return{type:t,device:e,offsetX:s,offsetY:o,clientX:n,clientY:r,currentX:a,currentY:l,sourceEvent:c}}function DE(e,t){const i=e*e+t*t,s=ME*ME;return i>=s}var X2=class{constructor(e){this.destroyFns=[],this.listeners=new yl,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.destroyFns.push(e.addListener("touchstart",this.onTouchStart.bind(this)),e.addListener("touchmove",this.onTouchMove.bind(this)),e.addListener("touchend",this.onTouchEnd.bind(this)),e.addListener("mousemove",this.onMouseMove.bind(this)),e.addListener("dblclick",this.onDblClick.bind(this)),e.addListener("drag-start",this.onDragStart.bind(this)),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.destroyFns.forEach(e=>e()),this.listeners.destroy()}addListener(e,t){return this.listeners.addListener(e,t)}dispatch(e){this.listeners.dispatch(e.type,e)}onTouchStart(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches.item(0)??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=t,this.touch.clientY=i}onTouchMove(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches.item(0)??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-t),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=t,this.touch.clientY=i}onTouchEnd(e){e.sourceEvent.preventDefault()}onMouseMove(e){this.dispatch(e)}onDblClick(e){this.dispatch({device:"mouse",...e})}onDragStart(e){this.dragStartEvent=e}onDragMove(e){this.dragStartEvent!=null&&DE(e.originDeltaX,e.originDeltaY)&&(this.dispatch(this.dragStartEvent),this.dispatch({...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.dispatch(e)}onDragEnd(e){if(this.isDragging){this.dispatch(e),this.isDragging=!1;return}if(e.device==="mouse"){const t=xw("mouse","click",e);this.dispatch(t)}else if(e.sourceEvent.type==="touchend"){if(DE(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const t=xw("touch","click",e);this.dispatch(t);const i=Date.now();if(this.lastClickTime!==void 0&&i-this.lastClickTime<=D6){const s=xw(e.device,"dblclick",e);this.dispatch(s),this.lastClickTime=void 0}else this.lastClickTime=i}}},ww=class extends tp{constructor(e){super(e)}addChildToDOM(){}removeChildFromDOM(){}},A6=class{constructor(e){this.seriesWidget=new ww(e.getParent("series-area")),this.chartWidget=new ww(e.getParent("canvas-proxy")),this.containerWidget=new ww(e.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),this.seriesDragInterpreter=new X2(this.seriesWidget)}destroy(){this.seriesDragInterpreter.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}},j0={bottomCenter:L6,center:T6,clone:O6,collides:F6,end:R6,from:B6,height:P6,round:N6,start:I6,topCenter:k6,origin:G6,width:E6};function I6(e){return{x:e.x1,y:e.y1}}function R6(e){return{x:e.x2,y:e.y2}}function k6(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}}function T6(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function L6(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}}function E6(e){return Math.abs(e.x2-e.x1)}function P6(e){return Math.abs(e.y2-e.y1)}function N6(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}}function O6(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}function F6(e,t){const i=AE(e),s=AE(t);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1}function AE(e){return{x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)}}function B6(e,t,i,s){if(typeof e=="number")return{x1:e,y1:t,x2:i,y2:s};if("width"in e)return{x1:e.x,y1:e.y,x2:e.x+e.width,y2:e.y+e.height};throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(e)}] [${t}] [${i}] [${s}]`)}function G6(){return{x1:0,y1:0,x2:0,y2:0}}function Gy(e,t,i,s,o){return t+(s-t)*((o-e)/(i-e))}function IE(e,t,i,s,o){return e+(o-t)*((i-e)/(s-t))}function RE(e,t,i){return[IE(e,i.min,t,i.max,0),IE(e,i.min,t,i.max,1)]}function _6(e,t,i){const[s,o]=RE(e.x1,e.x2,t),[n,r]=RE(e.y1,e.y2,i);return{x1:s,x2:o,y1:n,y2:r}}function kE(e,t,i,s,o,n){if(i<=o&&n<=s)return i;const r=o-i,a=n-s,l=Math.abs(r)<Math.abs(a)?r:a;return Pe(e,i+l,t)}function z6(e,t,i){const{x:s={min:0,max:1},y:o={min:0,max:1}}=t,n=j0.from(i),r=j0.from(e),a=_6(r,s,o),l=kE(a.x1,a.x2,r.x1,r.x2,n.x1,n.x2),c=kE(a.y1,a.y2,r.y1,r.y2,n.y1,n.y2);return{x:{min:Gy(r.x1,s.min,r.x2,s.max,l),max:Gy(r.x1,s.min,r.x2,s.max,l+e.width)},y:{min:Gy(r.y1,o.min,r.y2,o.max,c),max:Gy(r.y1,o.min,r.y2,o.max,c+e.height)}}}var V6=["rangeX","rangeY","ratioX","ratioY","autoScaledAxes"],H6=class{constructor(){this.enabled=!1,this.padding=0,this.manuallyAdjusted=!1}},TE=e=>Rs((t,i)=>!nt.is(e?.scale)&&!$r.is(e?.scale)||t==null||i.end==null?!0:t<=i.end,"to be less than end"),Z2=class extends Bc{constructor(e,t){super(),this.fireChartEvent=e,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new ep(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new H6,this.lastRestoredState=void 0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.destroyFns.push(t.addListener("layout:complete",()=>{const{pendingMemento:i}=this,s=!this.didLayoutAxes;this.didLayoutAxes=!0,i?this.restoreMemento(i.version,i.mementoVersion,i.memento):s&&this.autoScaleYZoom("zoom-manager")}))}createMemento(){return this.getMementoRanges()}guardMemento(e,t){if(e==null)return!0;if(!Ui(e))return!1;for(const r of Object.keys(e))if(!V6.includes(r))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),o={rangeX:{start:Ty(_d(Va,Ly),TE(i)),end:_d(Va,Ly)},rangeY:{start:Ty(_d(Va,Ly),TE(s)),end:_d(Va,Ly)},ratioX:{start:Ty(Ey,VL("end")),end:Ey},ratioY:{start:Ty(Ey,VL("end")),end:Ey},autoScaledAxes:I0(VK("y"))},n=_b(e,o);return n.errors.length>0?(t.push(...n.errors.map(r=>r.message)),!1):!0}restoreMemento(e,t,i){const{independentAxes:s}=this;if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:e,mementoVersion:t,memento:i};return}this.pendingMemento=void 0;const o=this.getDefinedZoom();if(i?.rangeX?o.x=this.rangeToRatio(i.rangeX,"x")??{min:0,max:1}:i?.ratioX?o.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:o.x={min:0,max:1},!this.navigatorModule||this.zoomModule){let a=i?.autoScaledAxes?.includes("y");i?.rangeY?(o.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1},a??(a=!1)):i?.ratioY?(o.y={min:i.ratioY.start??0,max:i.ratioY.end??1},a??(a=!1)):(o.y={min:0,max:1},a??(a=!0)),o.autoScaleYAxis=a}if(this.lastRestoredState=o,s!==!0){this.updateZoom("zoom-manager",o);return}const n=this.getPrimaryAxis("x"),r=this.getPrimaryAxis("y");for(const a of[n,r])a&&this.updateAxisZoom("zoom-manager",a.id,o[a.direction])}updateAxes(e){this.axes=e;const t=new Map(e.map(i=>[i.id,this.axisZoomManagers.get(i.id)]));this.axisZoomManagers.clear();for(const i of e)this.axisZoomManagers.set(i.id,t.get(i.id)??new W6(i));this.state.size>0&&e.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}setIndependentAxes(e=!0){this.independentAxes=e}setAutoScaleYAxis(e,t){this.autoScaleYAxis.enabled=e,this.autoScaleYAxis.padding=t}setNavigatorEnabled(e=!0){this.navigatorModule=e}setZoomModuleEnabled(e=!0){this.zoomModule=e}isZoomEnabled(){return this.zoomModule}updateZoom(e,t){if(t?.x&&(t.x.min<0||t.x.max>1)&&(ue.warnOnce(`Attempted to update x-axis zoom to an invalid ratio of [{ min: ${t.x.min}, max: ${t.x.max} }], expecting a ratio of 0 to 1, ignoring.`),t.x=void 0),t?.y&&(t.y.min<0||t.y.max>1)&&(ue.warnOnce(`Attempted to update y-axis zoom to an invalid ratio of [{ min: ${t.y.min}, max: ${t.y.max} }], expecting a ratio of 0 to 1, ignoring.`),t.y=void 0),this.axisZoomManagers.size===0){const s=this.state.stateId();(s==="initial"||s===e)&&this.state.set(e,t);return}this.state.set(e,t);const i=t?.autoScaleYAxis;i!=null&&(this.autoScaleYAxis.manuallyAdjusted=!i),this.axisZoomManagers.forEach(s=>{s.updateZoom(e,t?.[s.getDirection()])}),this.applyChanges(e)}updateAxisZoom(e,t,i){this.axisZoomManagers.get(t)?.updateZoom(e,i),this.applyChanges(e)}resetZoom(e){this.autoScaleYAxis.manuallyAdjusted=!1;const t=this.getRestoredZoom();this.updateZoom(e,{x:{min:t?.x?.min??0,max:t?.x?.max??1},y:{min:t?.y?.min??0,max:t?.y?.max??1},autoScaleYAxis:t?.autoScaleYAxis??!0})}resetAxisZoom(e,t){const s=this.axisZoomManagers.get(t)?.getDirection();if(s==null)return;const o=this.getRestoredZoom();if(s==="y"){const n=o?.autoScaleYAxis??!0;this.autoScaleYAxis.manuallyAdjusted=!n}this.updateAxisZoom(e,t,o?.[s]??{min:0,max:1})}setAxisManuallyAdjusted(e,t){this.axisZoomManagers.get(t)?.getDirection()==="y"&&(this.autoScaleYAxis.manuallyAdjusted=!0)}updatePrimaryAxisZoom(e,t,i){const s=this.getPrimaryAxis(t);s&&this.updateAxisZoom(e,s.id,i)}panToBBox(e,t,i){if(!this.isZoomEnabled())return!1;const s=this.getZoom();if(s===void 0||!s.x&&!s.y)return!1;if(!(t.width>0&&t.height>0&&Math.abs(i.width)<=Math.abs(t.width)&&Math.abs(i.height)<=Math.abs(t.height)))return ue.warnOnce("cannot pan to target BBox - chart too small?"),!1;const n=z6(t,s,i);return this.independentAxes?(this.updatePrimaryAxisZoom(e,"x",n.x),this.updatePrimaryAxisZoom(e,"y",n.y)):this.updateZoom(e,n),!0}fireZoomPanStartEvent(e){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:e})}extendToEnd(e,t,i){return this.extendWith(e,t,s=>Number(s)-i)}extendWith(e,t,i){const s=this.getPrimaryAxis(t);if(!s)return;const o=this.getDomainExtents(s);if(!o)return;const[,n]=o,r=i(n),a=this.rangeToRatio({start:r,end:n},t);a&&this.updateZoom(e,{[t]:a})}updateWith(e,t,i){const s=this.getPrimaryAxis(t);if(!s)return;const o=this.getDomainExtents(s);if(!o)return;let[n,r]=o;[n,r]=i(n,r);const a=this.rangeToRatio({start:n,end:r},t);a&&this.updateZoom(e,{[t]:a})}getZoom(){let e,t;if(this.axisZoomManagers.forEach(i=>{i.getDirection()==="x"?e??(e=i.getZoom()):i.getDirection()==="y"&&(t??(t=i.getZoom()))}),e||t)return{x:e,y:t}}getAxisZoom(e){return this.axisZoomManagers.get(e)?.getZoom()??{min:0,max:1}}getAxisZooms(){const e={};for(const[t,i]of this.axisZoomManagers.entries())e[t]={direction:i.getDirection(),zoom:i.getZoom()};return e}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(e){return this.getPrimaryAxis(e)?.id}isVisibleItemsCountAtLeast(e,t){const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),o=new Set;let n=0;const r=[e.x.min,e.x.max],a=[e.y.min,e.y.max];for(const l of i?.boundSeries??[]){o.add(l.id);const c=t-(n??0),d=l.getVisibleItems(r,a,c);if(n+=d,n>=t)return!0}for(const l of s?.boundSeries??[]){if(o.has(l.id))continue;const c=t-(n??0),d=l.getVisibleItems(r,a,c);if(n+=d,n>=t)return!0}return o.size===0}getMementoRanges(){const e=this.getDefinedZoom();let t;return this.autoScaleYAxis.enabled&&(t=this.autoScaleYAxis.manuallyAdjusted?[]:["y"]),{rangeX:this.getRangeDirection(e.x,"x"),rangeY:this.getRangeDirection(e.y,"y"),ratioX:{start:e.x.min,end:e.x.max},ratioY:{start:e.y.min,end:e.y.max},autoScaledAxes:t}}autoScaleYZoom(e,t=!0){if(!this.isZoomEnabled())return;const{independentAxes:i,autoScaleYAxis:s}=this,o=this.getZoom();if(o?.x==null||!s.enabled||s.manuallyAdjusted)return;const{padding:n}=s;let r;if(o.x?.min===0&&o.x?.max===1?r={min:0,max:1}:i?r=this.primaryAxisZoom("y",o.x,{padding:n}):r=this.combinedAxisZoom("y",o.x,{padding:n}),r!=null){if(i){const a=this.getPrimaryAxis("y");(a==null?void 0:this.axisZoomManagers.get(a.id))?.updateZoom("zoom-manager",r)}else for(const a of this.axisZoomManagers.values())a.getDirection()==="y"&&a.updateZoom("zoom-manager",r);t&&this.applyChanges(e)}}applyChanges(e){if(this.autoScaleYZoom(e,!1),!Array.from(this.axisZoomManagers.values(),s=>s.applyChanges()).includes(!0))return;const i={};for(const[s,o]of this.axisZoomManagers.entries())i[s]=o.getZoom();this.listeners.dispatch("zoom-change",{type:"zoom-change",...this.getZoom(),axes:i,callerId:e}),this.fireChartEvent({type:"zoom",...this.getMementoRanges()})}getRangeDirection(e,t){const i=this.getPrimaryAxis(t);if(!i||!nt.is(i.scale)&&!$r.is(i.scale))return;const s=this.getDomainPixelExtents(i);if(!s)return;const[o,n]=s;let r,a;return o<=n?(r=i.scale.invert(0),a=i.scale.invert(o+(n-o)*e.max)):(r=i.scale.invert(o-(o-n)*e.min),a=i.scale.invert(0)),{start:r,end:a}}rangeToRatio(e,t){const i=this.getPrimaryAxis(t);if(!i)return;const s=this.getDomainPixelExtents(i);if(!s)return;const[o,n]=s;let r=e.start==null?o:i.scale.convert?.(e.start),a=e.end==null?n:i.scale.convert?.(e.end);if(!Qe(r)||!Qe(a))return;const[l,c]=[Math.min(o,n),Math.max(o,n)];if(r<l||r>c){ue.warnOnce(`Invalid range start [${e.start}], expecting a value between [${i.scale.invert?.(o)}] and [${i.scale.invert?.(n)}], ignoring.`);return}if(a<l||a>c){ue.warnOnce(`Invalid range end [${e.end}], expecting a value between [${i.scale.invert?.(o)}] and [${i.scale.invert?.(n)}], ignoring.`);return}r=Math.min(c,Math.max(l,r)),a=Math.min(c,Math.max(l,a));const d=n-o,h=Math.abs((r-o)/d),u=Math.abs((a-o)/d);return{min:h,max:u}}getPrimaryAxis(e){return this.axes?.find(t=>t.direction===e)}getDomainExtents(e){const{domain:t}=e.scale,i=t.at(0),s=t.at(-1);if(!(i==null||s==null))return[i,s]}getDomainPixelExtents(e){const{domain:t}=e.scale,i=e.scale.convert?.(t.at(0)),s=e.scale.convert?.(t.at(-1));if(!(!Qe(i)||!Qe(s)))return[i,s]}getDefinedZoom(){const e=this.getZoom();return{x:{min:e?.x?.min??0,max:e?.x?.max??1},y:{min:e?.y?.min??0,max:e?.y?.max??1}}}zoomBounds(e,t,i,s){const o=e.scale,n=o.range;o.range=[0,1];const r=t.scale,a=r.range;r.range=[0,1];let l=1,c=!1,d=0,h=!1;for(const g of t.boundSeries){const{connectsToYAxis:f}=g,y=g.getRange("y",[i.min,i.max]);for(const m of y){const C=r.convert(m);Number.isFinite(C)&&(C<l&&(l=C,c=!f||m<0),C>d&&(d=C,h=!f||m>0))}}if(Qe(t.min)&&(l=0),Qe(t.max)&&(d=1),o.range=n,r.range=a,l>=d)return;const u=(c?s:0)+(h?s:0),p=Math.min((d-l)*(1+u),1);if(!(p<=0)){if(c&&h){const g=(d+l)/2;l=g-p/2,d=g+p/2}else!c&&h?d=l+p:c&&!h&&(l=d-p);return l<0?(d+=-l,l=0):d>1&&(l-=d-1,d=1),{min:l,max:d}}}primaryAxisZoom(e,t,{padding:i=0}={}){const s=e==="x"?"y":"x",o=this.getPrimaryAxis(s),n=this.getPrimaryAxis(e);if(!(o==null||n==null))return this.zoomBounds(o,n,t,i)}combinedAxisZoom(e,t,{padding:i=0}={}){const s=e==="x"?"y":"x",o=new Map;for(const l of this.axes)if(l.direction===s)for(const c of l.boundSeries)o.set(c,l);let n=1,r=0;for(const l of this.axes)if(l.direction===e)for(const c of l.boundSeries){const d=o.get(c);if(d==null)continue;const h=this.zoomBounds(d,l,t,i);if(h==null)return;n=Math.min(n,h.min),r=Math.max(r,h.max)}const a=1e-6;if(n<a&&(n=0),r>1-a&&(r=1),!(n>r))return{min:n,max:r}}},W6=class{constructor(e){this.axis=e;const[t=0,i=1]=e.visibleRange;this.state=new ep({min:t,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(e,t){this.state.set(e,t)}getZoom(){return Mi(this.state.stateValue())}hasChanges(){const e=this.currentZoom,t=this.state.stateValue();return e.min!==t.min||e.max!==t.max}applyChanges(){const e=this.hasChanges();return this.currentZoom=this.state.stateValue(),e}},j6=class{constructor(){this.labelData=new Map}updateLabels(e,t,i=ve.zero){const s={x:-t.left,y:-t.top,width:i.width+t.left+t.right,height:i.height+t.top+t.bottom},o=new Set(e.map(r=>r.id));for(const r of this.labelData.keys())o.has(r)||this.labelData.delete(r);for(const r of e){const a=r.getLabelData();a.every(aY)&&this.labelData.set(r.id,a)}const n=cY(this.labelData,s,5);for(const r of e)r.updatePlacedLabelData?.(n.get(r.id)??[])}},U6=class extends Bc{constructor(){super(...arguments),this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:e,isFixed:t})=>!e&&!t).map(({enabled:e,seriesId:t,itemId:i,legendItemName:s})=>({visible:e,seriesId:t,itemId:i,legendItemName:s}))}guardMemento(e){return e==null||Mt(e)}restoreMemento(e,t,i){i?.forEach(s=>{const{seriesId:o,data:n}=this.getRestoredData(s)??{};!o||!n||this.updateData(o,n)}),this.update()}getRestoredData(e){const{seriesId:t,itemId:i,legendItemName:s,visible:o}=e;if(t){const r=(this.legendDataMap.get(t)??[]).map(a=>{const l=a.seriesId===t&&(!i||a.itemId===i);return l&&a.isFixed&&this.warnFixed(a.seriesId,a.itemId),!a.isFixed&&l?{...a,enabled:o}:a});return{seriesId:t,data:r}}if(!(i==null&&s==null))for(const n of this.getData()){if(i!=null&&n.itemId!==i||s!=null&&n.legendItemName!==s)continue;if(n.isFixed){this.warnFixed(n.seriesId,i);return}const r=(this.legendDataMap.get(n.seriesId)??[]).map(a=>a.itemId===i||a.legendItemName===s?{...a,enabled:o}:a);return{seriesId:n.seriesId,data:r}}}warnFixed(e,t){ue.warnOnce(`The legend item with seriesId [${e}] and itemId [${t}] is not configurable, this series item cannot be toggled through the legend.`)}update(e){this.listeners.dispatch("legend-change",{type:"legend-change",legendData:e??this.getData()})}updateData(e,t=[]){this.legendDataMap.set(e,t)}clearData(){this.legendDataMap.clear()}toggleItem({enabled:e,seriesId:t,itemId:i,legendItemName:s}){if(s){this.getData().forEach(a=>{const l=(this.legendDataMap.get(a.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:e}:c);this.updateData(a.seriesId,l)});return}const o=this.getData(t),n=o.length===1,r=o.map(a=>i==null&&n||a.itemId===i?{...a,enabled:e}:a);this.updateData(t,r)}getData(e){return e?this.legendDataMap.get(e)??[]:[...this.legendDataMap].reduce((t,[i,s])=>t.concat(s),[])}getDatum({seriesId:e,itemId:t}={}){return this.getData(e).find(i=>i.itemId===t)}getSeriesEnabled(e){const t=this.getData(e);if(t.length>0)return t.some(i=>i.enabled)}getItemEnabled({seriesId:e,itemId:t}={}){return this.getDatum({seriesId:e,itemId:t})?.enabled??!0}},K6=class{constructor(){this.groups={}}registerSeries({internalId:e,seriesGrouping:t,visible:i,type:s}){var o;t&&((o=this.groups)[s]??(o[s]={}),this.groups[s][e]={grouping:t,visible:i})}updateSeries({internalId:e,seriesGrouping:t,visible:i,type:s}){if(!t)return;const o=this.groups[s]?.[e];o&&(o.grouping=t,o.visible=i)}deregisterSeries({internalId:e,type:t}){this.groups[t]&&delete this.groups[t][e],this.groups[t]&&Object.keys(this.groups[t]).length===0&&delete this.groups[t]}getVisiblePeerGroupIndex({type:e,seriesGrouping:t,visible:i}){if(!t)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,o=new Set;for(const r of Object.values(this.groups[e]??{}))r.visible&&(s.add(r.grouping.groupIndex),r.grouping.groupIndex===t.groupIndex&&o.add(r.grouping.stackIndex));const n=Array.from(s);return n.sort((r,a)=>r-a),{visibleGroupCount:n.length,visibleSameStackCount:o.size,index:n.indexOf(t.groupIndex)}}},rf=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PERFORM_LAYOUT=3]="PERFORM_LAYOUT",e[e.SERIES_UPDATE=4]="SERIES_UPDATE",e[e.PRE_SCENE_RENDER=5]="PRE_SCENE_RENDER",e[e.SCENE_RENDER=6]="SCENE_RENDER",e[e.NONE=7]="NONE",e))(rf||{}),q2=class{constructor(e){this.updateCallback=e,this.events=new iA}addListener(e,t){return this.events.on(e,t)}removeListener(e,t){return this.events.on(e,t)}destroy(){this.events.clear()}update(e=0,t){this.updateCallback(e,t)}dispatchUpdateComplete(){this.events.emit("update-complete",{type:"update-complete"})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:e}){this.events.emit("process-data",{type:"process-data",series:e})}},$6=class{constructor(e,t){this.callbackCache=new x6,this.chartEventManager=new j2,this.highlightManager=new K2,this.layoutManager=new R2,this.localeManager=new u6,this.seriesStateManager=new K6,this.stateManager=new jY,this.seriesLabelLayoutManager=new j6,this.contextModules=[];const{scene:i,root:s,syncManager:o,container:n,fireEvent:r,updateCallback:a,updateMutex:l,styleContainer:c,chartType:d}=t;this.chartService=e,this.syncManager=o,this.domManager=new B2(n,c),this.widgets=new A6(this.domManager);const h=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new pS({canvasElement:h}),this.scene.setRoot(s),this.axisManager=new M6(s),this.legendManager=new U6,this.annotationManager=new w6(e.annotationRoot),this.chartTypeOriginator=new HY(e),this.interactionManager=new H2,this.contextMenuRegistry=new U2,this.updateService=new q2(a),this.proxyInteractionService=new _2(this.localeManager,this.domManager),this.historyManager=new WY(this.chartEventManager),this.animationManager=new W2(this.interactionManager,l),this.dataService=new gS(this.animationManager),this.tooltipManager=new UC(this.domManager,e.tooltip),this.zoomManager=new Z2(r,this.layoutManager);for(const u of Yr.byType("context")){if(!u.chartTypes.includes(d))continue;const p=u.moduleFactory(this);this.contextModules.push(p),this[u.contextKey]=p}}destroy(){this.animationManager.destroy(),this.highlightManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.chartEventManager.destroy(),this.domManager.destroy(),this.highlightManager.destroy(),this.proxyInteractionService.destroy(),this.syncManager.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.contextModules.forEach(e=>e.destroy())}},Q2=class extends Ee{constructor(){super(...arguments),this.range="tooltip"}};D([k(Ct(["tooltip","node"],"a range"))],Q2.prototype,"range",2);function Y6(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function X6(e,t){if(e==null||t==null)return e===t;if(e.size!==t.size)return!1;for(const[i,s]of e){const o=t.get(i);if(o==null||!Y6(s,o))return!1}return!0}function Z6(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1){const{type:s,idsMap:o,scopes:n,data:r,...a}=e[i],{type:l,idsMap:c,scopes:d,data:h,...u}=t[i];if(s!==l||n&&d&&!Kr(n,d)||r&&h&&r!==h||!ih(a,u)||!X6(o,c))return!1}return!0}function q6(e,t){const{props:i,...s}=e,{props:o,...n}=t;return ih(s,n)&&Z6(i,o)}function Q6(e,t,i,s){return t===e.data&&Kr(i,e.ids)&&q6(s,e.opts)}var LE=class J2{constructor(){this.domain=new Set}static is(t){return t instanceof J2}extend(t){this.domain.add(t)}getDomain(){return Array.from(this.domain)}},Zl=class e_{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof e_}static extendDomain(t,i=[1/0,-1/0]){for(const s of t)typeof s=="number"&&(i[0]>s&&(i[0]=s),i[1]<s&&(i[1]=s));return i}extend(t){this.domain[0]>t&&(this.domain[0]=t),this.domain[1]<t&&(this.domain[1]=t)}getDomain(){return[...this.domain]}},Qh=0,Jh=1,kr=2,J6=class{constructor(e){const t=e.reduce((n,r)=>Math.max(n,r.length),0);let s=1<<32-Math.clz32(t);t===s/2&&(s=s>>>1),this.maxLevelSize=s;const o=new Float64Array((s*2-1)*2).fill(NaN);for(const n of e)for(let r=0;r<n.length;r+=1){const a=Number(n[r]),l=s+r-1,c=(l*kr|0)+Qh,d=(l*kr|0)+Jh,h=o[c],u=o[d];(!Number.isFinite(h)||a<h)&&(o[c]=a),(!Number.isFinite(u)||a>u)&&(o[d]=a)}for(let n=s/2|0;n>=1;n=n/2|0){const r=n-1|0,a=r+n|0;for(let l=0;l<n;l+=1){const c=r+l,d=a+l*2,h=d+1,u=o[(d*kr|0)+Qh],p=o[(h*kr|0)+Qh];o[(c*kr|0)+Qh]=!Number.isFinite(p)||u<p?u:p;const g=o[(d*kr|0)+Jh],f=o[(h*kr|0)+Jh];o[(c*kr|0)+Jh]=!Number.isFinite(f)||g>f?g:f}}this.buffer=o}computeRangeInto(e,t,i,s,o,n,r){const a=o+n-1;if(a<t||o>=i)return r;if(o>=t&&a<i){const l=e[(s*kr|0)+Qh],c=e[(s*kr|0)+Jh];Number.isFinite(l)&&(r[0]=Math.min(r[0],l)),Number.isFinite(c)&&(r[1]=Math.max(r[1],c))}else n>1&&(s=s*2|0,n=n/2|0,this.computeRangeInto(e,t,i,s+1|0,o,n,r),this.computeRangeInto(e,t,i,s+2|0,o+n,n,r));return r}rangeBetween(e,t){if(e>t)return[NaN,NaN];const{maxLevelSize:i,buffer:s}=this,o=[1/0,-1/0];return this.computeRangeInto(s,e,t,0,0,i,o),o}get range(){const{buffer:e}=this;return[e[Qh],e[Jh]]}},EE=Symbol("domain-ranges");function eX(e){return e.map(t=>Ui(t)?JSON.stringify(t):t).join("-")}function PE(e){return Number.isInteger(e)?e:Math.abs(e)>1e4?Math.trunc(e):Math.round(e*1e4)/1e4}function Co(e){const t=e?.map(Number);return t?.every(Number.isFinite)?t:[]}function YA(e,t){return t?.get(e.id)??0}function tX(e){return"scopes"in e&&Array.isArray(e.scopes)}var _y=Symbol("invalid");function Mw(e,t){const i=[];for(let s=0;s<e;s+=1)i[s]=t;return i}function KC(e,t,i){const s=[];for(const o of e){const n=o.get(t)?.[i];if(n==null)return;s.push(n)}return s}function t_(e){const t=[];let i=0,s;const o=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;s=o.exec(e);){if(s.index!==i)return;i=s.index+s[0].length;const n=s[1].trim();if(n.startsWith("."))t.push(n.slice(1).trim());else if(n.startsWith("[")){const r=n.slice(1,-1).trim();r.startsWith("'")?t.push(r.slice(1,-1).replace(/(?<!\\)\\'/g,"'")):r.startsWith('"')?t.push(r.slice(1,-1).replace(/(?<!\\)\\"/g,'"')):t.push(r)}else t.push(n)}if(i===e.length)return t}function iX(e){return t=>{let i=t;for(const s of e)i=i[s];return i}}var i_=class{constructor(e,t="standalone",i=!1){this.opts=e,this.mode=t,this.suppressFieldDotNotation=i,this.debug=yt.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[],this.markScopeDatumInvalid=function(a,l,c,d){for(const h of a)d.has(h)||d.set(h,Mw(l.length,!1)),d.get(h)[c]=!0};let s=!0;for(const a of e.props){if(a.type==="key"&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");a.type==="value"&&s&&(s=!1)}const o=({matchGroupIds:a=[]})=>{for(const l of a)if(this.values.every(c=>c.groupId!==l))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${l}).`)},n=new Set,r=new Set;for(const a of e.props){const l=a.type==="key"?n:r;switch(tX(a)&&a.scopes?.forEach(c=>l.add(c)),a.type){case"key":this.keys.push({...a,index:this.keys.length,missing:new Map});break;case"value":if(a.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(a)}`);this.values.push({...a,index:this.values.length,missing:new Map});break;case"aggregate":o(a),this.aggregates.push({...a,index:this.aggregates.length});break;case"group-value-processor":o(a),this.groupProcessors.push({...a,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...a,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...a,index:this.reducers.length});break;case"processor":this.processors.push({...a,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const a=new Set(r.values());if(n.forEach(l=>a.delete(l)),a.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...a.values()]}`)}}resolveProcessedDataDefById(e,t){const i=this.scopeCache.get(e.id)?.get(t);if(!i)throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(e,t){return this.resolveProcessedDataDefById(e,t).index}resolveKeysById(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),o=i.keys[s];if(o==null)throw new Error(`AG Charts - didn't find keys for [${t}, ${e.id}]`);return o.get(e.id)}hasColumnById(e,t){return this.scopeCache.get(e.id)?.get(t)!=null}resolveColumnById(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),o=i.columns?.[s];if(o==null)throw new Error(`AG Charts - didn't find column for [${t}, ${e.id}]`);return o}*forEachDatum(e,t,i){const s=t.columnScopes.findIndex(o=>o.has(e.id));for(const o of i.datumIndices[s]??[])yield t.columns[s][o]}*forEachGroupDatum(e,t){const i=t.columnScopes.findIndex(n=>n.has(e.id)),s={groupIndex:0,columnIndex:i},o=[];for(const n of t.groups){s.group=n;let r=0;for(const a of n.datumIndices[i]??o)s.datumIndex=a,s.valueIndex=r++,yield s;s.groupIndex++}}*forEachGroupDatumTuple(e,t){const s={columnIndex:t.columnScopes.findIndex(o=>o.has(e.id)),datumIndexes:[void 0,void 0,void 0]};for(const o of this.forEachGroupDatum(e,t))s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=o.group,s.nextGroupIndex=o.groupIndex,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=o.datumIndex,s.group!=null&&s.datumIndexes[1]!=null&&(yield s);s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=void 0,s.nextGroupIndex=void 0,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=void 0,s.group!=null&&s.datumIndexes[1]!=null&&(yield s)}getDomain(e,t,i,s){return this.getDomainsByType(i??"value",s)?.[this.resolveProcessedDataIndexById(e,t)]??[]}getDomainBetweenRange(e,t,[i,s],o){const n=t.map(c=>this.resolveProcessedDataIndexById(e,c)),r=n.join(":"),a=o[EE];let l=a.get(r);if(l==null){const c=n.map(d=>o.columns[d]);l=new J6(c),a.set(r,l)}return l.rangeBetween(i,s)}getDomainsByType(e,t){switch(e){case"key":return t.domain.keys;case"value":return t.domain.values;case"aggregate":return t.domain.aggValues;case"group-value-processor":return t.domain.groups;default:return null}}processData(e){const{opts:{groupByKeys:t,groupByFn:i},aggregates:s,groupProcessors:o,reducers:n,processors:r,propertyProcessors:a}=this,l=performance.now();if(t&&this.keys.length===0)return;let c=this.extractData(e);t?c=this.groupData(c):i&&(c=this.groupData(c,i(c))),o.length>0&&c.type==="grouped"&&this.postProcessGroups(c),s.length>0&&c.type==="ungrouped"?this.aggregateUngroupedData(c):s.length>0&&c.type==="grouped"&&this.aggregateGroupedData(c),a.length>0&&this.postProcessProperties(c),n.length>0&&this.reduceData(c),r.length>0&&this.postProcessData(c),this.warnDataMissingProperties(e);const d=performance.now();return c.time=d-l,this.debug.check()&&sX(c),this.processScopeCache(),c}warnDataMissingProperties(e){if(e.size!==0)for(const t of Gd(this.keys,this.values))for(const[i,s]of t.missing){if(s<(e.get(i)?.length??1/0))continue;const o=i==null?"":` for ${i}`;ue.warnOnce(`the key '${t.property}' was not found in any data element${o}.`)}}processScopeCache(){this.scopeCache.clear();for(const e of Gd(this.keys,this.values,this.aggregates))if(e.idsMap)for(const[t,i]of e.idsMap)for(const s of i)if(!this.scopeCache.has(t))this.scopeCache.set(t,new Map([[s,e]]));else{if(this.scopeCache.get(t)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(t).set(s,e)}}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,s]of this.values.entries())(!e||s.groupId&&e.includes(s.groupId))&&t.push(i);return t}valueIdxLookup(e,t){const i=e==null||e.length===0,s=typeof t=="string"?t:t.id,o=r=>{if(r.idsMap){for(const[a,l]of r.idsMap)if(e?.includes(a)&&l.has(s))return!0}return!1},n=this.values.reduce((r,a,l)=>((a.scopes==null||i&&!a.scopes.length||a.scopes.some(d=>e?.includes(d)))&&(a.property===s||a.id===s||o(a))&&r.push(l),r),[]);if(n.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return n}extractData(e){const{dataDomain:t,processValue:i,allScopesHaveSameDefs:s}=this.initDataDomainProcessor(),{keys:o,values:n}=this,{invalidData:r,invalidKeys:a,allKeyMappings:l}=this.extractKeys(o,e,i),{columns:c,columnScopes:d,partialValidDataCount:h,maxDataLength:u}=this.extractValues(r,n,e,a,i),p=g=>{const f=t.get(g),y=f.getDomain();return Zl.is(f)&&y[0]>y[1]?[]:y};return{type:"ungrouped",input:{count:u},scopes:new Set(e.keys()),dataSources:e,aggregation:void 0,keys:[...l.values()],columns:c,columnScopes:d,invalidKeys:a,invalidData:r,domain:{keys:o.map(p),values:n.map(p)},defs:{allScopesHaveSameDefs:s,keys:o,values:n},partialValidDataCount:h,time:0,[EE]:new Map}}extractKeys(e,t,i){const s=new Map,o=new Map,n=new Map;let r,a;const l=(c,d)=>{const h=a.get(c);r.set(d,r.get(h)),s.has(h)&&(s.set(d,s.get(h)),o.set(d,o.get(h)))};for(const c of e){const{invalidValue:d,scopes:h}=c;r=new Map,a=new Map,n.set(c,r);for(const u of h??[]){const p=t.get(u)??[];if(a.has(p)){l(p,u);continue}const g=[];r.set(u,g),a.set(p,u);let f,y;for(let m=0;m<p.length;m++){const C=i(c,p[m],m,u);if(C!==_y){g.push(C);continue}g.push(d),f??(f=Mw(p.length,!1)),y??(y=Mw(p.length,!1)),f[m]=!0,y[m]=!0}f&&y&&(s.set(u,f),o.set(u,y))}}return{invalidData:o,invalidKeys:s,allKeyMappings:n}}extractValues(e,t,i,s,o){let n=0;const r=[],a=[];let l=0;for(const c of t){const{invalidValue:d}=c;if(new Set(c.scopes.map(y=>i.get(y))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(c)}`);const u=new Set(c.scopes),p=pg(c.scopes),g=i.get(p),f=g.map((y,m)=>{const C=s.get(p)?.[m];let b=o(c,y,m,c.scopes);return(C||b===_y)&&this.markScopeDatumInvalid(c.scopes,g,m,e),C?b=d:b===_y&&(n+=1,b=d),b});r.push(f),a.push(u),l=Math.max(l,f.length)}return{columns:r,columnScopes:a,partialValidDataCount:n,maxDataLength:l}}groupData(e,t){var i;const s=new Map,{keys:o,columns:n,columnScopes:r,invalidKeys:a,invalidData:l}=e,c=e.scopes,d=new Set;for(const p of c){const g=n.map((S,A)=>A).filter(S=>!d.has(S)&&r[S].has(p));if(g.length===0)continue;for(const S of g)d.add(S);const f=new Set;for(const S of g)for(const A of r[S])f.add(A);const y=o.map(S=>S.get(p)).filter(S=>S!=null),m=n[pg(g)],C=l?.get(p),b=a?.get(p);for(let S=0;S<m.length;S++){if(b?.[S]===!0)continue;const A=y.map(M=>M[S]);if(A==null||A.length===0)throw new Error("AG Charts - no keys found for scope: "+p);const R=t?.(A)??A,I=eX(R),w=s.get(I)??{keys:R,datumIndices:[],validScopes:c};if(s.has(I)||s.set(I,w),C?.[S]===!0){w.validScopes===c&&(w.validScopes=new Set(c.values()));for(const M of f)w.validScopes.delete(M)}if(w.validScopes.size!==0)for(const M of g)(i=w.datumIndices)[M]??(i[M]=[]),w.datumIndices[M].push(S)}}const h=[],u=[];for(const{keys:p,datumIndices:g,validScopes:f}of s.values())f?.size!==0&&(h.push(p),u.push({datumIndices:g,keys:p,aggregation:[],validScopes:f}));return{...e,type:"grouped",domain:{...e.domain,groups:h},groups:u}}aggregateUngroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{keys:i,columns:s,dataSources:o}=e,n=pg(o.keys()),r=o.get(n);e.aggregation=r?.map((a,l)=>{const c=[];for(const[d,h]of this.aggregates.entries()){const u=this.valueGroupIdxLookup(h);let p=h.groupAggregateFunction?.()??[1/0,-1/0];const g=u.map(C=>s[C][l]),f=KC(i,n,l),y=f!=null?h.aggregateFunction(g,f):void 0;y&&(p=h.groupAggregateFunction?.(y,p)??Zl.extendDomain(y,p));const m=h.finalFunction?.(p)??p;if(h.round===!0)for(const C in m)m[C]=PE(m[C]);c[d]=m,Zl.extendDomain(m,t[d])}return c})}aggregateGroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{columns:i}=e;for(const[s,o]of this.aggregates.entries()){const n=this.valueGroupIdxLookup(o);for(const r of e.groups){if(r.aggregation??(r.aggregation=[]),r.validScopes?.size===0)continue;const a=r.keys;let l=o.groupAggregateFunction?.()??[1/0,-1/0];const c=Math.max(...n.map(h=>r.datumIndices[h]?.length??0));for(let h=0;h<c;h++){const u=n.map(g=>i[g][r.datumIndices[g]?.[h]]),p=o.aggregateFunction(u,a);p&&(l=o.groupAggregateFunction?.(p,l)??Zl.extendDomain(p,l))}const d=o.finalFunction?.(l)??l;if(o.round===!0)for(const h in d)d[h]=PE(d[h]);r.aggregation[s]=d,Zl.extendDomain(d,t[s])}}}postProcessGroups(e){const{groupProcessors:t}=this,{columnScopes:i,columns:s,invalidData:o,scopes:n}=e;for(const r of t){const a=this.valueGroupIdxLookup(r),l=r.adjust()();for(const c of e.groups)c.validScopes===n&&l(s,a,c);for(const c of a){const h=this.values[c].valueType==="category",u=s[c],p=pg(i[c]),g=o?.get(p),f=h?new LE:new Zl;for(let y=0;y<u.length;y+=1)g?.[y]!==!0&&f.extend(u[y]);e.domain.values[c]=f.getDomain()}}}postProcessProperties(e){for(const{adjust:t,property:i,scopes:s}of this.propertyProcessors)for(const o of this.valueIdxLookup(s,i))t()(e,o)}reduceData(e){e.reduced??(e.reduced={});const{dataSources:t,keys:i}=e;for(const s of this.reducers){const o=s.reducer();let n=s.initialValue;if(e.type==="grouped")for(const r of e.groups)n=o(n,r.keys);else{const r=pg(t.keys()),a=i.map(d=>d.get(r)).filter(d=>d!=null),l=a.map(()=>{}),c=t.get(r);for(let d=0;d<c.length;d+=1){for(let h=0;h<l.length;h++)l[h]=a[h]?.[d];n=o(n,l)}}e.reduced[s.property]=n}}postProcessData(e){e.reduced??(e.reduced={});for(const t of this.processors)e.reduced[t.property]=t.calculate(e,e.reduced[t.property])}initDataDomainProcessor(){const{keys:e,values:t}=this,i=new Set;for(const c of t)if(c.scopes)for(const d of c.scopes)i.add(d);const s=new Map,o=new Map;let n=!0;const r=()=>{for(const c of Gd(e,t))c.valueType==="category"?s.set(c,new LE):(s.set(c,new Zl),n&&(n=(c.scopes??[]).length===i.size))};r();const a=this.buildAccessors(Gd(e,t));return{dataDomain:s,processValue:(c,d,h,u)=>{let p,g;if(a.has(c.property)){try{g=a.get(c.property)(d)}catch{}p=g!=null}else p=c.property in d,g=p?d[c.property]:c.missingValue;c.forceValue!=null&&(g=p&&Wb(g)?-1*c.forceValue:c.forceValue,p=!0);const f="missingValue"in c;if(!p&&!f)if(typeof u=="string"){const y=c.missing.get(u)??0;c.missing.set(u,y+1)}else for(const y of u){const m=c.missing.get(y)??0;c.missing.set(y,m+1)}if(s.has(c)||r(),p&&c.validation?.(g,d,h)===!1)if("invalidValue"in c)g=c.invalidValue;else return this.mode!=="integrated"&&ue.warnOnce(`invalid value of type [${typeof g}] for [${c.scopes} / ${c.id}] ignored:`,`[${g}]`),_y;return c.processor&&(o.has(c)||o.set(c,c.processor()),g=o.get(c)?.(g)),s.get(c)?.extend(g),g},initDataDomain:r,scopes:i,allScopesHaveSameDefs:n}}buildAccessors(e){const t=new Map;if(this.suppressFieldDotNotation)return t;for(const i of e){if(!(i.property.includes(".")||i.property.includes("[")))continue;const o=t_(i.property);if(o==null){ue.warnOnce("Invalid property path [%s]",i.property);continue}const n=iX(o);t.set(i.property,n)}return t}};function sX(e){const t=(i,s)=>{s.length>0&&(ue.log(`DataModel.processData() - ${i}`),ue.table(s))};ue.log("DataModel.processData() - processedData",e),t("Key Domains",e.domain.keys),t("Group Domains",e.domain.groups??[]),t("Value Domains",e.domain.values),t("Aggregate Domains",e.domain.aggValues??[])}var s_=class La{constructor(t,i){this.mode=t,this.suppressFieldDotNotation=i,this.debug=yt.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(t,i,s){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((o,n)=>{this.requested.push({id:t,opts:s,data:i,resolve:o,reject:n})})}execute(t){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const i=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",i);const s=this.mergeRequested(i);this.debug("DataController.execute() - merged",s),this.debug.check()&&(wt().processedData=[]);const o=[];for(const{data:n,ids:r,opts:a,resolves:l,rejects:c}of s){const d=t?.find(p=>Q6(p,n,r,a));let h,u;if(d==null)try{h=new i_(a,this.mode,this.suppressFieldDotNotation);const p=new Map(i.map(g=>[g.id,g.data]));u=h.processData(p)}catch(p){c.forEach(g=>g(p));continue}else({dataModel:h,processedData:u}=d);o.push({opts:a,data:n,ids:r,dataModel:h,processedData:u}),this.debug.check()&&wt("processedData").push(u),u?.partialValidDataCount===0?l.forEach(p=>p({dataModel:h,processedData:u})):u?this.splitResult(h,u,r,l):c.forEach(p=>p(new Error("AG Charts - no processed data generated")))}return o}validateRequests(t){const i=[];for(const[s,o]of t.entries())s>0&&o.data.length!==t[0].data.length&&o.opts.groupByData===!1&&o.opts.groupByKeys===!1?o.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(o);return i}mergeRequested(t){const i=[];for(const s of t){const o=i.find(La.groupMatch(s));o?o.push(s):i.push([s])}return i.map(La.mergeRequests)}splitResult(t,i,s,o){for(let n=0;n<s.length;n++){const r=o[n];r({dataModel:t,processedData:i})}}static groupMatch({data:t,opts:i}){function s(c){return c.filter(d=>d.type==="key").map(d=>d.property).join(";")}const{groupByData:o,groupByKeys:n=!1,groupByFn:r,props:a}=i,l=s(a);return([c])=>(o===!1||c.data===t)&&(c.opts.groupByKeys??!1)===n&&c.opts.groupByFn===r&&s(c.opts.props)===l}static mergeRequests(t){const i=new Set(["key","group-value-processor"]);return t.reduce((s,{id:o,data:n,resolve:r,reject:a,opts:{props:l,...c}})=>{s.ids.push(o),s.rejects.push(a),s.resolves.push(r),s.data??(s.data=n),s.opts??(s.opts={...c,props:[]});for(const d of l){const h={...d,scopes:[o],data:n};La.createIdsMap(o,h);const u=s.opts.props.find(p=>p.type===h.type&&(i.has(p.type)||p.data===h.data)&&La.deepEqual(p,h));if(!u){s.opts.props.push(h);continue}u.scopes??(u.scopes=[]),u.scopes.push(...h.scopes??[]),(u.type==="key"||u.type==="value")&&h.idsMap?.size&&La.mergeIdsMap(h.idsMap,u.idsMap)}return s},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(t,i){for(const[s,o]of t){const n=i.get(s);if(n==null)i.set(s,new Set(o));else for(const r of o)n.add(r)}}static createIdsMap(t,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(t)?i.idsMap.get(t).add(i.id):i.idsMap.set(t,new Set([i.id])))}static deepEqual(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;let s,o;if(Array.isArray(t)){if(o=t.length,o!==i.length)return!1;for(s=o-1;s>=0;s--)if(!La.deepEqual(t[s],i[s]))return!1;return!0}const n=Object.keys(t);if(o=n.length,o!==Object.keys(i).length)return!1;for(s=o-1;s>=0;s--){const r=n[s];if(!La.skipKeys.has(r)&&(!Object.hasOwn(i,r)||!La.deepEqual(t[r],i[r])))return!1}return!0}return!1}};s_.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var o_=s_,oX=class{constructor(){this.axesMap=new Map,this.themeTemplates=new Map}register(e,t){this.axesMap.set(e,t.moduleFactory),t.themeTemplate&&this.setThemeTemplate(e,t.themeTemplate)}create(e,t){const i=this.axesMap.get(e);if(i)return i(t);throw new Error(`AG Charts - unknown axis type: ${e}`)}has(e){return this.axesMap.has(e)}keys(){return this.axesMap.keys()}setThemeTemplate(e,t){return this.themeTemplates.set(e,t),this}getThemeTemplate(e){return this.themeTemplates.get(e)}},Ka=new oX,vp=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"foreground",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"chartToolbar",chartTypes:["cartesian"]},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"statusBar",chartTypes:["cartesian"],identifier:"status-bar"},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"root",optionsKey:"ranges",chartTypes:["cartesian"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"]},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-number"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bar",community:!0},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"line",community:!0},{type:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"box-plot"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"candlestick"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"cone-funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"heatmap"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-area"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-bar"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"waterfall"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"nightingale"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-area"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-line"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-bar"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-column"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-marker"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape-background"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line-background"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"chord"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"sankey"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"pyramid"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"linear-gauge"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"radial-gauge"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"},{type:"context",contextKey:"sharedToolbar",chartTypes:["cartesian"]}];function nX(e){return vp.some(t=>t.type==="series"&&t.identifier===e)}function yh(e){return vp.find(t=>t.type==="series"&&t.identifier===e)?.chartTypes}function rX(e){return yh(e)?.find(i=>i==="cartesian")==="cartesian"}function aX(e){return yh(e)?.find(i=>i==="polar")==="polar"}function lX(e){return yh(e)?.find(i=>i==="hierarchy")==="hierarchy"}function cX(e){return yh(e)?.find(i=>i==="topology")==="topology"}function dX(e){return yh(e)?.find(i=>i==="flow-proportion")==="flow-proportion"}function hX(e){return yh(e)?.find(i=>i==="standalone")==="standalone"}function uX(e){return yh(e)?.find(i=>i==="gauge")==="gauge"}function pX(e){return e.packageType==="enterprise"}function gX(e){if(!pX(e))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const t=vp.find(i=>i.type===e.type&&("optionsKey"in i&&"optionsKey"in e?i.optionsKey===e.optionsKey:!0)&&("contextKey"in i&&"contextKey"in e?i.contextKey===e.contextKey:!0)&&i.identifier===e.identifier&&e.chartTypes.every(s=>i.chartTypes.includes(s)));return t&&(t.useCount??(t.useCount=0),t.useCount++),t!=null}function fX(){return vp.filter(({useCount:e})=>e==null||e===0)}var mX=class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(e,{optionsKey:t,moduleFactory:i,themeTemplate:s}){this.legendMap.set(e,{optionsKey:t,moduleFactory:i}),this.themeTemplates.set(t,s)}create(e,t){const i=this.legendMap.get(e)?.moduleFactory;if(i)return i(t);throw new Error(`AG Charts - unknown legend type: ${e}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((e,[t,i])=>(e[t]=i.optionsKey,e),{})}},XA=new mX,n_=class extends Map{get(e){return super.get(e)??"unknown"}isCartesian(e){return this.get(e)==="cartesian"}isPolar(e){return this.get(e)==="polar"}isHierarchy(e){return this.get(e)==="hierarchy"}isTopology(e){return this.get(e)==="topology"}isFlowProportion(e){return this.get(e)==="flow-proportion"}isStandalone(e){return this.get(e)==="standalone"}isGauge(e){return this.get(e)==="gauge"}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(e=>this.isCartesian(e))}get polarTypes(){return this.seriesTypes.filter(e=>this.isPolar(e))}get hierarchyTypes(){return this.seriesTypes.filter(e=>this.isHierarchy(e))}get topologyTypes(){return this.seriesTypes.filter(e=>this.isTopology(e))}get flowProportionTypes(){return this.seriesTypes.filter(e=>this.isFlowProportion(e))}get standaloneTypes(){return this.seriesTypes.filter(e=>this.isStandalone(e))}get gaugeTypes(){return this.seriesTypes.filter(e=>this.isGauge(e))}},yX=class extends Map{set(e,t){return super.set(e,_e(t,this.get(e)))}},Lt=new n_,r_=new n_,U0=new yX,vX=class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(e,{chartTypes:[t],moduleFactory:i,tooltipDefaults:s,defaultAxes:o,themeTemplate:n,paletteFactory:r,solo:a,stackable:l,groupable:c,stackedByDefault:d,hidden:h}){this.setThemeTemplate(e,n),this.seriesMap.set(e,{moduleFactory:i,tooltipDefaults:s,defaultAxes:o,paletteFactory:r,solo:a,stackable:l,groupable:c,stackedByDefault:d}),Lt.set(e,t),h||r_.set(e,t)}create(e,t){const i=this.seriesMap.get(e)?.moduleFactory;if(i)return i(t);throw new Error(`AG Charts - unknown series type: ${e}`)}cloneDefaultAxes(e,t){const i=this.seriesMap.get(e)?.defaultAxes;if(i==null)return null;const s=typeof i=="function"?i(t):i;return{axes:Mi(s)}}isDerivedDefaultAxes(e){return typeof this.seriesMap.get(e)?.defaultAxes=="function"}setThemeTemplate(e,t){const i=this.themeTemplates.get(e);this.themeTemplates.set(e,_e(t,i))}getThemeTemplate(e){return this.themeTemplates.get(e)}getPaletteFactory(e){return this.seriesMap.get(e)?.paletteFactory}getTooltipDefauls(e){return this.seriesMap.get(e)?.tooltipDefaults}isSolo(e){return this.seriesMap.get(e)?.solo??!1}isGroupable(e){return this.seriesMap.get(e)?.groupable??!1}isStackable(e){return this.seriesMap.get(e)?.stackable??!1}isStackedByDefault(e){return this.seriesMap.get(e)?.stackedByDefault??!1}},ho=new vX,ZA=class kd extends Bc{constructor(t){super(),this.chart=t}subscribe(t=kd.DEFAULT_GROUP){let i=this.get(t);return i||(i=new Set,kd.chartsGroups.set(t,i)),i.add(this.chart),this}unsubscribe(t=kd.DEFAULT_GROUP){return this.get(t)?.delete(this.chart),this}getChart(){return this.chart}getGroup(t=kd.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i):[]}getGroupSiblings(t=kd.DEFAULT_GROUP){return this.getGroup(t).filter(i=>i!==this.chart)}get(t){return kd.chartsGroups.get(t)}};ZA.chartsGroups=new Map;ZA.DEFAULT_GROUP=Symbol("sync-group-default");var CX=ZA,qA=class extends Ee{constructor(){super(...arguments),this.enabled=!1}};D([k(xe)],qA.prototype,"enabled",2);D([k(Ye)],qA.prototype,"tabIndex",2);var a_=["top","right","bottom","left"];function bX(e){return typeof e=="string"&&a_.includes(e)}function SX(e){const t=[],i=[],s=[...a_];for(const o of e)o instanceof Im&&(bX(o.position)?i.push(o.position):t.push(o));for(const o of t){let n;do n=s.pop();while(n&&i.includes(n));if(n==null)break;o.position=n}}var xX=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function wX(e,t,i){const s=(c,d,h)=>{const u=[c];for(const p of xX)p in d&&d[p]!=null&&u.push(`${p}=${d[p]}`);return h?.seriesGrouping&&u.push(`seriesGrouping.groupId=${h?.seriesGrouping.groupId}`),u.join(";")},o=new Map;let n=0;for(const c of e){const d=s(c.type,c.properties,i?.[n]);o.has(d)||o.set(d,[]),o.get(d)?.push([c,n++])}const r=new Map;n=0;for(const c of t){const d=s(c.type,c,c);r.has(d)||r.set(d,[]),r.get(d)?.push([c,n++])}if(![...o.keys()].some(c=>r.has(c)))return{status:"no-overlap",oldKeys:o.keys(),newKeys:r.keys()};const l=[];for(const[c,d]of r.entries())for(const[h,u]of d){const p=o.get(c);if(p==null||p.length<1){l.push({opts:h,targetIdx:u,idx:u,status:"add"}),o.delete(c);continue}const[g,f]=p.shift(),y=i?.[f]??{},m=sl(y,h??{}),{groupIndex:C,stackIndex:b}=m?.seriesGrouping??{};C!=null||b!=null?l.push({opts:h,series:g,diff:m,targetIdx:u,idx:f,status:"series-grouping"}):m?l.push({opts:h,series:g,diff:m,targetIdx:u,idx:f,status:"update"}):l.push({opts:h,series:g,targetIdx:u,idx:f,status:"no-op"}),p.length===0&&o.delete(c)}for(const c of o.values())for(const[d,h]of c)l.push({series:d,idx:h,targetIdx:-1,status:"remove"});return{status:"overlap",changes:l}}function vl(e){const{series:t}=e;if(t)return t[0]?.type??"line"}function QA(e){const t=vl(e);return t==null?!1:Lt.isCartesian(t)||rX(t)}function l_(e){const t=vl(e);return t==null?!1:Lt.isPolar(t)||aX(t)}function MX(e){const t=vl(e);return t==null?!1:Lt.isHierarchy(t)||lX(t)}function DX(e){const t=vl(e);return t==null?!1:Lt.isTopology(t)||cX(t)}function AX(e){const t=vl(e);return t==null?!1:Lt.isFlowProportion(t)||dX(t)}function c_(e){const t=vl(e);return t==null?!1:Lt.isStandalone(t)||hX(t)}function d_(e){const t=vl(e);return t==null?!1:Lt.isGauge(t)||uX(t)}function IX(e){const t=vl(e);return l_(e)&&t!=="pie"&&t!=="donut"}function RX(e){return e==null?!1:Lt.has(e)}function kX(e){return e==null?!1:Ka.has(e)}var TX=class extends AA{applyOptions(e){for(const t of this.moduleMap.values())t.module.optionsKey in e&&Jr(t.moduleInstance)&&t.moduleInstance.set(e[t.module.optionsKey])}*legends(){for(const{module:e,moduleInstance:t}of this.moduleMap.values())e.type==="legend"&&(yield{legendType:e.identifier,legend:t})}},K0="ag-charts-overlay",NE="ag-charts-dark-overlay",zd=class extends Ee{constructor(e,t){super(),this.className=e,this.defaultMessageId=t,this.enabled=!0}getText(e){return e.t(this.text??this.defaultMessageId)}getElement(e,t,i){if(this.content?.remove(),this.focusBox=i,this.renderer){const s=this.renderer();if(s instanceof HTMLElement)this.content=s;else{const o=He("div");o.innerHTML=s,this.content=o.firstElementChild}}else{const s=He("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)"});s.innerText=this.getText(t),this.content=s,e?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(o){s.style.opacity=String(o)},onStop(){s.style.opacity="1"}})}return this.content}removeElement(e=()=>this.content?.remove(),t){if(this.content){if(t){const{content:i}=this;t.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(s){i.style.opacity=String(s)},onStop(){e?.()}})}else e?.();this.content=void 0,this.focusBox=void 0}}};D([k(xe)],zd.prototype,"enabled",2);D([k(he,{optional:!0})],zd.prototype,"text",2);D([k(Qs,{optional:!0})],zd.prototype,"renderer",2);var Cp=class extends Ee{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new zd("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new zd("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new zd("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new zd("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(e){for(const t of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(t.focusBox!==void 0)return{text:t.getText(e),rect:t.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};D([k(xe)],Cp.prototype,"darkTheme",2);D([k(me)],Cp.prototype,"loading",2);D([k(me)],Cp.prototype,"noData",2);D([k(me)],Cp.prototype,"noVisibleSeries",2);D([k(me)],Cp.prototype,"unsupportedBrowser",2);function LX(e,t){const{animationDuration:i}=Df.add,s=i*t,o=He("div",`${K0}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${s}ms linear 50ms both`}),n=He("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),r=He("p",{marginTop:"1em"});r.innerText=e;const a=He("div",`${K0}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=He("style");return l.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),o.replaceChildren(l,n,r,a),o}var h_=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(h_||{}),u_=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(u_||{}),p_=(e=>(e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_NODE=1]="NEAREST_NODE",e[e.AXIS_ALIGNED=2]="AXIS_ALIGNED",e))(p_||{}),EX=.25,PX=.125,km=class{constructor(e,t,{datum:i},s){this.type=e,this.event=t,this.datum=i,this.seriesId=s.id}},JA=class{constructor(e,t,i){this.series=e,this.seriesGrouping=t,this.oldGrouping=i,this.type="groupingChanged"}},fS=class extends A2{constructor(t){super(),this.destroyFns=[],this.usesPlacedLabels=!1,this.seriesGrouping=void 0,this.NodeEvent=km,this.internalId=Rn(this),this.contentGroup=new Zs({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new Zs({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new Zs({name:`${this.internalId}-annotation`}),this.labelGroup=new Zs({name:`${this.internalId}-series-labels`}),this.axes={x:void 0,y:void 0},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new AA,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this._declarationOrder=-1,this.seriesListeners=new yl,this._pickNodeCache=new SA;const{moduleCtx:i,pickModes:s,directionKeys:o={},directionNames:n={},canHaveAxes:r=!1,usesPlacedLabels:a=!1}=t;this.ctx=i,this.directionKeys=o,this.directionNames=n,this.canHaveAxes=r,this.usesPlacedLabels=a,this.highlightGroup=new Zs({name:`${this.internalId}-highlight`}),this.highlightNode=this.highlightGroup.appendChild(new Me({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new Me({name:"highlightLabel",zIndex:10})),this.pickModes=s}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(t){this.properties.visible=t,this.ctx.legendManager.toggleItem({enabled:t,seriesId:this.id}),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){return this.data!=null&&this.data.length>0}get tooltipEnabled(){return this.properties.tooltip?.enabled??!1}onDataChange(){this.nodeDataRefresh=!0,this._pickNodeCache.clear()}setOptionsData(t){this._data=t,this.onDataChange()}setChartData(t){this._chartData=t,this.data===t&&this.onDataChange()}onSeriesGroupingChange(t,i){const{internalId:s,type:o,visible:n}=this;t&&this.ctx.seriesStateManager.deregisterSeries(this),i&&this.ctx.seriesStateManager.registerSeries({internalId:s,type:o,visible:n,seriesGrouping:i}),this.fireEvent(new JA(this,i,t))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(t,i,s){t.appendChild(this.contentGroup),i.appendChild(this.highlightGroup),i.appendChild(this.labelGroup),s?.appendChild(this.annotationGroup)}detachSeries(t,i,s){t?.removeChild(this.contentGroup),i.removeChild(this.highlightGroup),i.removeChild(this.labelGroup),s?.removeChild(this.annotationGroup)}setSeriesIndex(t){return t===this._declarationOrder?!1:(this._declarationOrder=t,this.contentGroup.zIndex=[1,t,0],this.highlightGroup.zIndex=[1,t,1],this.labelGroup.zIndex=[1,t,2],this.annotationGroup.zIndex=t,!0)}renderToOffscreenCanvas(){return!1}addEventListener(t,i){return super.addEventListener(t,i)}addListener(t,i){return this.seriesListeners.addListener(t,i)}dispatch(t,i){this.seriesListeners.dispatch(t,i)}addChartEventListeners(){}destroy(){this.destroyFns.forEach(t=>t()),this.destroyFns=[],this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(t,i){const s=this.resolveKeyDirection(t),o=i?.[s],n=[];if(!o)return n;const r=(...a)=>{for(const l of a)Array.isArray(l)?r(...l):typeof l=="object"?r(...Object.values(l)):n.push(l)};return r(...o.map(a=>this.properties[a])),n}getKeys(t){return this.getDirectionValues(t,this.directionKeys)}getKeyProperties(t){return this.directionKeys[this.resolveKeyDirection(t)]??[]}getNames(t){return this.getDirectionValues(t,this.directionNames)}resolveKeyDirection(t){return t}getDomain(t){const i=this.getSeriesDomain(t),s=this.moduleMap.mapModules(o=>o.getDomain(t)).flat();return s.length!==0?i.concat(s):i}getRange(t,i){return this.getSeriesRange(t,i)}getVisibleItems(t,i,s){return 1/0}getGradientFillOptions({bounds:t},i){const{axes:s}=this,o=s.x,n=s.y,r=o?.range??[0,1],a=n?.range??[0,1],[l,c]=Ki(r),[d,h]=Ki(a),u=c-l,p=h-d;let g=[0,1];return t==="series"?g=this.getSeriesDomain("y"):t==="axes"&&(g=n?.scale.domain??[0,1]),{bbox:new ve(l,d,u,p),domain:g,defaultColorRange:i}}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){this.ctx.seriesStateManager.updateSeries(this)}getOpacity(){const{dimOpacity:i=1,enabled:s=!0}=this.properties.highlightStyle.series;if(!s||i===1)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;case 2:default:return i}}getStrokeWidth(t){const{strokeWidth:i,enabled:s=!0}=this.properties.highlightStyle.series;if(!s||i===void 0)return t;switch(this.isItemIdHighlighted()){case 1:return i;case 0:case 2:return t}}isItemIdHighlighted(){const t=this.ctx.highlightManager?.getActiveHighlight()?.series;return t==null?0:t!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(t=>t.getTooltipParams()).reduce((t,i)=>Object.assign(t,i),{})}pickNode(t,i,s=!1){const{pickModes:o,pickModeAxis:n,visible:r,contentGroup:a}=this;if(!r||!a.visible||i==="highlight"&&!this.properties.highlight.enabled||i==="highlight-tooltip"&&!this.properties.highlight.enabled)return;let l=1/0;if(i==="tooltip"||i==="highlight-tooltip"){const{tooltip:p}=this.properties;l=typeof p.range=="number"?p.range:1/0,s||(s=p.range==="exact")}else if(i==="event"||i==="context-menu"){const{nodeClickRange:p}=this.properties;l=typeof p=="number"?p:1/0,s||(s=p==="exact")}const c=o.filter(p=>!s||p===0),{x:d,y:h}=t,u=JSON.stringify({x:d,y:h,maxDistance:l,selectedPickModes:c});if(this._pickNodeCache.has(u))return this._pickNodeCache.get(u);for(const p of c){let g;switch(p){case 0:g=this.pickNodeExactShape(t);break;case 1:g=this.pickNodeClosestDatum(t);break;case 2:g=n!=null?this.pickNodeMainAxisFirst(t,n==="main-category"):void 0;break}if(g&&g.distance<=l)return this._pickNodeCache.set(u,{pickMode:p,match:g.datum,distance:g.distance})}return this._pickNodeCache.set(u,void 0)}pickNodeExactShape(t){const i=this.contentGroup.pickNode(t.x,t.y);if(i&&i.datum.missing!==!0)return{datum:i.datum,distance:0}}pickNodeClosestDatum(t){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(t,i){const s=Hb(t.x,t.y,i);if(s.nearest!==void 0&&s.nearest.datum.missing!==!0)return{datum:s.nearest.datum,distance:Math.sqrt(s.distanceSquared)}}pickNodeMainAxisFirst(t,i){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(t){}fireNodeClickEvent(t,i){this.fireEvent(new this.NodeEvent("nodeClick",t,i,this))}fireNodeDoubleClickEvent(t,i){this.fireEvent(new this.NodeEvent("nodeDoubleClick",t,i,this))}createNodeContextMenuActionEvent(t,i){return new this.NodeEvent("nodeContextMenuAction",t,i,this)}onLegendInitialState(t,i){const{visible:s=!0,itemId:o,legendItemName:n}=i??{};this.toggleSeriesItem(s,t,o,n)}onLegendItemClick(t){const{enabled:i,itemId:s,series:o,legendType:n}=t,r="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=r!=null&&r===t.legendItemName;(o.id===this.id||l||a!=null)&&this.toggleSeriesItem(i,n,s,r,t)}onLegendItemDoubleClick(t){const{enabled:i,itemId:s,series:o,numVisibleItems:n,legendType:r}=t,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,l="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,c=a!=null&&a===t.legendItemName;o.id===this.id||c||l!=null?this.toggleSeriesItem(!0,r,s,a,t):i&&n===1?this.toggleSeriesItem(!0,r,void 0,a):this.toggleSeriesItem(!1,r,void 0,a)}toggleSeriesItem(t,i,s,o,n){const r=this.id;(t||i!=="category")&&(this.visible=t),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const a={type:"seriesVisibilityChange",seriesId:r,itemId:s,legendItemName:n?.legendItemName??o,visible:t};this.fireEvent(a),this.ctx.legendManager.toggleItem({enabled:t,seriesId:r,itemId:s,legendItemName:o})}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getLabelText(t,i,s=il){return t.formatter?this.ctx.callbackCache.call(t.formatter,{seriesId:this.id,...i})??s(i.value):s(i.value)}getMarkerStyle(t,i,s=t.getStyle()){const o={size:i.datum.point?.size??0},n=_e(o,s);if(t.itemStyler){const r=this.ctx.callbackCache.call(t.itemStyler,{seriesId:this.id,...n,...i,datum:i.datum.datum});return _e(r,n)}return n}updateMarkerStyle(t,i,s,o=i.getStyle(),{applyTranslation:n=!0,selected:r=!0}={}){const{point:a}=s.datum,l=this.getMarkerStyle(i,s,o),c=this.visible&&l.size>0&&a&&!isNaN(a.x)&&!isNaN(a.y);if(n?t.setProperties({visible:c,...l,translationX:a?.x,translationY:a?.y}):t.setProperties({visible:c,...l}),r||(t.fillOpacity*=EX,t.strokeOpacity*=PX),typeof i.shape=="function"&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const d=t.getBBox();if(a!==void 0&&d.isFinite()){const h=d.computeCenter(),[u,p]=["x","y"].map(g=>(l.strokeWidth??0)+Math.abs(h[g]-a[g]));a.focusSize=Math.max(d.width+u,d.height+p)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(t){const{width:i,height:s}=t??{width:NaN,height:NaN},o=t?{seriesRectWidth:i,seriesRectHeight:s}:void 0,n=sl(this.nodeDataDependencies,o)!=null;return n&&(this._nodeDataDependencies=o,this.markNodeDataDirty()),n}pickFocus(t){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(t,i){const{datumCallbackCache:s}=this,o=s.get(t);if(o!=null)return o;const n=i();return s.set(t,n),n}};D([wo({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],fS.prototype,"seriesGrouping",2);function NX(e,t){const i=-t/e;return e!==0&&i>=0&&i<=1?[i]:[]}function OX(e,t,i){if(e===0)return NX(t,i);const s=t*t-4*e*i,o=[];if(s===0){const n=-t/(2*e);n>=0&&n<=1&&o.push(n)}else if(s>0){const n=Math.sqrt(s),r=(-t-n)/(2*e),a=(-t+n)/(2*e);r>=0&&r<=1&&o.push(r),a>=0&&a<=1&&o.push(a)}return o}function FX(e,t,i,s){if(e===0)return OX(t,i,s);const o=t/e,n=i/e,r=s/e,a=(3*n-o*o)/9,l=(9*o*n-27*r-2*o*o*o)/54,c=a*a*a+l*l,d=1/3,h=[];if(c>=0){const u=Math.sqrt(c),p=Math.sign(l+u)*Math.pow(Math.abs(l+u),d),g=Math.sign(l-u)*Math.pow(Math.abs(l-u),d),f=Math.abs(Math.sqrt(3)*(p-g)/2),y=-.3333333333333333*o+(p+g);if(y>=0&&y<=1&&h.push(y),f===0){const m=-.3333333333333333*o-(p+g)/2;m>=0&&m<=1&&h.push(m)}}else{const u=Math.acos(l/Math.sqrt(-a*a*a)),p=d*o,g=2*Math.sqrt(-a),f=g*Math.cos(d*u)-p,y=g*Math.cos(d*(u+2*Math.PI))-p,m=g*Math.cos(d*(u+4*Math.PI))-p;f>=0&&f<=1&&h.push(f),y>=0&&y<=1&&h.push(y),m>=0&&m<=1&&h.push(m)}return h}function Au(e,t,i,s,o,n,r,a){const l=(i-e)*(a-n)-(s-t)*(r-o);if(l===0)return 0;const c=((r-o)*(t-n)-(e-o)*(a-n))/l,d=((i-e)*(t-n)-(s-t)*(e-o))/l;return c>=0&&c<=1&&d>=0&&d<=1?1:0}function BX(e,t,i,s,o,n,r,a,l,c,d,h){let u=0;const p=c-h,g=d-l,f=l*(h-c)-c*(d-l),y=OE(e,i,o,r),m=OE(t,s,n,a),C=p*y[0]+g*m[0],b=p*y[1]+g*m[1],S=p*y[2]+g*m[2],A=p*y[3]+g*m[3]+f,R=FX(C,b,S,A);for(const I of R){const w=I*I,M=I*w,T=y[0]*M+y[1]*w+y[2]*I+y[3],E=m[0]*M+m[1]*w+m[2]*I+m[3];let P;l===d?P=(E-c)/(h-c):P=(T-l)/(d-l),P>=0&&P<=1&&u++}return u}function OE(e,t,i,s){return[-e+3*t-3*i+s,3*e-6*t+3*i,-3*e+3*t,e]}function g_(e,t,i,s,o,n,r,a,l,c){if(isNaN(e)||isNaN(t))return 0;n&&([o,s]=[s,o]);const d=(c-a)/(l-r),h=a-d*r,u=Math.pow(d,2)+1,p=2*(d*(h-t)-e),g=Math.pow(e,2)+Math.pow(h-t,2)-Math.pow(i,2),f=Math.pow(p,2)-4*u*g;if(f<0)return 0;const y=(-p+Math.sqrt(f))/2/u,m=(-p-Math.sqrt(f))/2/u;let C=0;return[y,m].forEach(b=>{if(!(b>=Math.min(r,l)&&b<=Math.max(r,l)))return;const A=d*b+h,R=b-e,I=A-t,w=Math.atan2(I,R);dc(w,s,o)&&C++}),C}function $C(e,t,i,s,o){return(1-o)**3*e+3*(1-o)**2*o*t+3*(1-o)*o**2*i+o**3*s}function YC(e,t,i,s,o){if(o<=Math.min(e,s))return e<s?0:1;if(o>=Math.max(e,s))return e<s?1:0;let n=0,r=1,a=NaN;for(let l=0;l<12;l+=1)a=(n+r)/2,$C(e,t,i,s,a)<o?n=a:r=a;return a}function XC(e,t,i,s,o,n,r,a,l){const c=(1-l)*e+l*i,d=(1-l)*t+l*s,h=(1-l)*i+l*o,u=(1-l)*s+l*n,p=(1-l)*o+l*r,g=(1-l)*n+l*a,f=(1-l)*c+l*h,y=(1-l)*d+l*u,m=(1-l)*h+l*p,C=(1-l)*u+l*g,b=(1-l)*f+l*m,S=(1-l)*y+l*C;return[[{x:e,y:t},{x:c,y:d},{x:f,y},{x:b,y:S}],[{x:b,y:S},{x:m,y:C},{x:p,y:g},{x:r,y:a}]]}function $0(e,t,i,s){const o=-e+3*t-3*i+s,n=3*e-6*t+3*i,r=-3*e+3*t;if(o===0){if(n!==0){const l=-r/n;if(l>0&&l<1)return[l]}return[]}const a=n*n-4*o*r;if(a>=0){const l=Math.sqrt(a),c=(-n+l)/(2*o),d=(-n-l)/(2*o);return[c,d].filter(h=>h>0&&h<1)}return[]}function f_(e,t,i,s,o,n,r,a){const l=$0(e,i,o,r),c=$0(t,s,n,a);return[...l,...c]}var Tf=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.openedPath=!1,this.closedPath=!1}isEmpty(){return this.commands.length===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(t,i){this.openedPath=!0,this.path2d.moveTo(t,i),this.commands.push(0),this.params.push(t,i)}lineTo(t,i){this.openedPath?(this.path2d.lineTo(t,i),this.commands.push(1),this.params.push(t,i)):this.moveTo(t,i)}rect(t,i,s,o){this.moveTo(t,i),this.lineTo(t+s,i),this.lineTo(t+s,i+o),this.lineTo(t,i+o),this.closePath()}roundRect(t,i,s,o,n){n=Math.min(n,s/2,o/2),this.moveTo(t,i+n),this.arc(t+n,i+n,n,Math.PI,1.5*Math.PI),this.lineTo(t+n,i),this.lineTo(t+s-n,i),this.arc(t+s-n,i+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(t+s,i+n),this.lineTo(t+s,i+o-n),this.arc(t+s-n,i+o-n,n,0,Math.PI/2),this.lineTo(t+s-n,i+o),this.lineTo(t+n,i+o),this.arc(t+ +n,i+o-n,n,Math.PI/2,Math.PI),this.lineTo(t,i+o-n),this.closePath()}arc(t,i,s,o,n,r){this.openedPath=!0,this.path2d.arc(t,i,s,o,n,r),this.commands.push(2),this.params.push(t,i,s,o,n,r?1:0)}cubicCurveTo(t,i,s,o,n,r){this.openedPath||this.moveTo(t,i),this.path2d.bezierCurveTo(t,i,s,o,n,r),this.commands.push(3),this.params.push(t,i,s,o,n,r)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(t){t&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(t,i){const s=this.commands,o=this.params,n=s.length,r=-1e4,a=-1e4;let l=NaN,c=NaN,d=0,h=0,u=0;for(let p=0,g=0;p<n;p++)switch(s[p]){case 0:u+=Au(l,c,d,h,r,a,t,i),d=o[g++],l=d,h=o[g++],c=h;break;case 1:u+=Au(d,h,o[g++],o[g++],r,a,t,i),d=o[g-2],h=o[g-1];break;case 3:u+=BX(d,h,o[g++],o[g++],o[g++],o[g++],o[g++],o[g++],r,a,t,i),d=o[g-2],h=o[g-1];break;case 2:{const f=o[g++],y=o[g++],m=o[g++],C=o[g++],b=o[g++],S=!!o[g++];if(u+=g_(f,y,m,C,b,S,r,a,t,i),!isNaN(l)){const A=f+Math.cos(C)*m,R=y+Math.sin(C)*m;u+=Au(d,h,A,R,r,a,t,i)}d=f+Math.cos(b)*m,h=y+Math.sin(b)*m;break}case 4:u+=Au(l,c,d,h,r,a,t,i);break}return u%2===1}distanceSquared(t,i){let s=1/0;const o=this.commands,n=this.params,r=o.length;let a=NaN,l=NaN,c=0,d=0;for(let h=0,u=0;h<r;h++)switch(o[h]){case 0:c=a=n[u++],d=l=n[u++];break;case 1:{const p=n[u++],g=n[u++];s=of(t,i,c,d,p,g,s);break}case 3:ue.error("Command.Curve distanceSquare not implemented");break;case 2:{const p=n[u++],g=n[u++],f=n[u++],y=n[u++],m=n[u++],C=p+Math.cos(y)*f,b=g+Math.sin(y)*f,S=!!n[u++];s=of(t,i,c,d,C,b,s),s=W5(t,i,p,g,f,y,m,S,s),c=p+Math.cos(m)*f,d=g+Math.sin(m)*f;break}case 4:s=of(t,i,c,d,a,l,s);break}return s}toSVG(t=(i,s)=>({x:i,y:s})){const i=[],{commands:s,params:o}=this,n=(a,...l)=>{i.push(a);for(let c=0;c<l.length;c+=2){const{x:d,y:h}=t(l[c],l[c+1]);i.push(d,h)}};let r=0;for(const a of s)switch(a){case 0:n("M",o[r++],o[r++]);break;case 1:n("L",o[r++],o[r++]);break;case 3:n("C",o[r++],o[r++],o[r++],o[r++],o[r++],o[r++]);break;case 2:{const l=o[r++],c=o[r++],d=o[r++],h=o[r++],u=o[r++],p=o[r++];let g=p?h-u:u-h;g<0&&(g+=Math.ceil(-g/(2*Math.PI))*2*Math.PI),p&&(g=-g);const f=Math.max(Math.ceil(Math.abs(g)/(Math.PI/2)),1),y=g/f,m=4/3*Math.tan(y/4),C=i.length===0?"M":"L";n(C,l+Math.cos(h)*d,c+Math.sin(h)*d);for(let b=0;b<f;b+=1){const S=h+y*(b+0),A=h+y*(b+1),R=d*Math.sin(S),I=d*Math.cos(S),w=d*Math.sin(A),M=d*Math.cos(A);n("C",l+I-m*R,c+R+m*I,l+M+m*w,c+w-m*M,l+M,c+w)}break}case 4:i.push("Z");break}return i.join(" ")}computeBBox(){const{commands:t,params:i}=this;let[s,o,n,r]=[1/0,1/0,-1/0,-1/0],[a,l]=[NaN,NaN],[c,d]=[NaN,NaN];const h=(p,g,f)=>{s=Math.min(g,s),o=Math.min(p,o),n=Math.max(p,n),r=Math.max(g,r),f&&([a,l]=[p,g])};let u=0;for(const p of t)switch(p){case 0:h(i[u++],i[u++],!0),[c,d]=[a,l];break;case 1:h(i[u++],i[u++],!0);break;case 3:{const g=i[u++],f=i[u++],y=i[u++],m=i[u++],C=i[u++],b=i[u++];h(C,b,!0),f_(a,l,g,f,y,m,C,b).forEach(A=>{const R=$C(a,g,y,C,A),I=$C(l,f,m,b,A);h(R,I)});break}case 2:{const g=i[u++],f=i[u++],y=i[u++];let m=St(i[u++]),C=St(i[u++]);i[u++]&&([m,C]=[C,m]);const S=(R,I)=>{const w=g+y*Math.cos(R),M=f+y*Math.sin(R);h(w,M,I)};S(m),S(C,!0);const A=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const R of A)(m<C&&m<=R&&R<=C||m>C&&(m<=R||R<=C))&&S(R);break}case 4:[a,l]=[c,d];break}return new ve(o,s,n-o,r-s)}};function Ae(e){const{changeCb:t,convertor:i}=e??{};return ye({type:"path",convertor:i,changeCb:t})}var eo=class extends Mn{constructor(){super(...arguments),this.path=new Tf,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(t){this._clipX=t,this.dirtyPath=!0}set clipY(t){this._clipY=t,this.dirtyPath=!0}set dirtyPath(t){this._dirtyPath!==t&&(this._dirtyPath=t,t&&this.markDirty())}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}isPointInPath(t,i){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,i)}distanceSquared(t,i){return this.distanceSquaredTransformedPoint(t,i)}svgPathData(t){return this.updatePathIfDirty(),this.path.toSVG(t)}distanceSquaredTransformedPoint(t,i){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,i)?0:this.path.distanceSquared(t,i)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(t){return t.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=t.devicePixelRatio,this.updatePathIfDirty(),super.preRender(t,this.path.commands.length)}render(t){const{ctx:i}=t;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){i.save();const s=this.strokeWidth/2;this._clipPath??(this._clipPath=new Tf),this._clipPath.clear(),this._clipPath.rect(-s,-s,this._clipX+s,this._clipY+s+s),i.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(i),i.restore()}else this._clipPath=void 0,this.drawPath(i);this.fillShadow?.markClean(),super.render(t)}drawPath(t){this.fillStroke(t,this.path.getPath2D())}toSVG(){if(!this.visible)return;const t=Sn("path");return t.setAttribute("d",this.svgPathData()),this.applySvgFillAttributes(t),this.applySvgStrokeAttributes(t),{elements:[t]}}};eo.className="Path";D([Ae()],eo.prototype,"clip",2);D([Ae()],eo.prototype,"clipX",1);D([Ae()],eo.prototype,"clipY",1);var GX=class{constructor(e){this.swapChain=e,this.div=He("div"),this.svg=Sn("svg"),this.outerPath=Sn("path"),this.innerPath=Sn("path"),this.svg.append(this.outerPath),this.svg.append(this.innerPath),this.outerPath.classList.add("ag-charts-focus-svg-outer-path"),this.innerPath.classList.add("ag-charts-focus-svg-inner-path"),this.element=He("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",t=>this.onSwap(t))}clear(){}update(e,t,i){if(t!=null)if(e instanceof eo){const s=(n,r)=>{let{x:a,y:l}=$t.toCanvasPoint(e,n,r);return a-=t.x??0,l-=t.y??0,{x:a,y:l}},o=e.svgPathData(s);this.outerPath.setAttribute("d",o),this.innerPath.setAttribute("d",o),this.show(this.svg)}else{let s;if(i){const o=Math.max(e.x-t.x,0),n=Math.max(e.y-t.y,0),r=Math.min(e.x+e.width-t.x,t.width),a=Math.min(e.y+e.height-t.y,t.height);s=new ve(o,n,r-o,a-n)}else s=new ve(e.x-t.x,e.y-t.y,e.width,e.height);WC(this.div,s),this.show(this.div)}}onSwap(e){e!==this.element.parentElement&&(this.element.remove(),e.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(e){this.element.innerHTML="",this.element.append(e)}overrideFocusVisible(e){this.focusVisible=e;const t={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",t[`${e}`])}isFocusVisible(){const e=this.element.parentElement;return e!=null&&wt().getComputedStyle(e).opacity==="1"}},_X=class{constructor(e,t,i,s){this.label1=e,this.label2=t,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=o=>(er(o.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",o)),this.onFocus=o=>(er(o.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",o)),pt(this.label1,"id",`${i}-label1`),pt(this.label2,"id",`${i}-label2`),er(this.label1,"display","none"),er(this.label2,"display","none"),this.activeAnnouncer=this.createAnnouncer(s),this.inactiveAnnouncer=this.createAnnouncer(s),pt(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap("")}createAnnouncer(e){const t=He("div");return t.role=e,t.className="ag-charts-swapchain",t.addEventListener("blur",this.onBlur),t.addEventListener("focus",this.onFocus),t}destroy(){for(const e of[this.activeAnnouncer,this.inactiveAnnouncer])e.removeEventListener("blur",this.onBlur),e.removeEventListener("focus",this.onFocus),e.remove()}focus(e){this.focusOptions=e,this.activeAnnouncer.focus(e),this.focusOptions=void 0}update(e){this.skipDispatch=!0,this.swap(e),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(e,t){this.listeners[e].push(t),e==="swap"&&t(this.activeAnnouncer)}dispatch(e,t){e==="focus"?this.hasFocus=!0:e==="blur"&&(this.hasFocus=!1),this.listeners[e].forEach(i=>i(t))}swap(e){const t=this.activeAnnouncer.tabIndex;this.label2.textContent=e,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],sh(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),sh(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:t}),this.dispatch("swap",this.activeAnnouncer)}},zX={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1}};function VX(e,t){for(const i of t)if("code"in i){if(i.code===e.code)return!0}else if(i.key===e.key&&(i.shift===void 0||i.shift===e.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===e.ctrlKey||i.ctrlOrMeta===e.metaKey))return!0;return!1}function HX(e){for(const[t,{activatesFocusIndicator:i=!0,bindings:s}]of Object.entries(zX))if(VX(e,s))return{name:t,activatesFocusIndicator:i}}function WX(e,t,i){const s=$A(e,i.datum);if(s!=null)return{x:s.canvasX,y:s.canvasY};const o=i.bounds;if(o!=null){if(o instanceof ve){const{x:n,y:r}=o.computeCenter();return{x:t.x+n,y:t.y+r}}return $t.toCanvas(o).computeCenter()}}function jX({bounds:e}){return e instanceof ve?e:e!=null?$t.toCanvas(e):ve.NaN}function UX(e,t,i){const{x:s,y:o}=WX(e,t,i)??{};if(s!==void 0&&o!==void 0)return{type:"keyboard",canvasX:s,canvasY:o}}function Y0(e,t,i,s){let{top:o,right:n,bottom:r,left:a,width:l,height:c}=s;return a!=null?l!=null?n=i.width-a+l:n!=null&&(l=i.width-a-n):n!=null&&l!=null&&(a=i.width-n-l),o!=null?c!=null?r=i.height-o-c:r!=null&&(c=i.height-r-o):r!=null&&c!=null&&(o=i.height-r-c),l==null?c==null?(l=e,c=t):l=Math.ceil(e*c/t):c==null&&(c=Math.ceil(t*l/e)),a==null&&(n==null?a=Math.floor((i.width-l)/2):a=i.width-n-l),o==null&&(r==null?o=Math.floor((i.height-c)/2):o=i.height-c-r),{x:a,y:o,width:l,height:c}}var zy=null;function Nu(e){if(e!=null)return e===""?"":(zy??(zy=He("div")),zy.textContent=String(e),zy.innerHTML)}function Hg(e,t){const{path:i,size:s}=e,{x:o,y:n}=e;i.clear();let r=!1;for(const[a,l]of t){const c=o+(a-.5)*s,d=n+(l-.5)*s;r?i.lineTo(c,d):i.moveTo(c,d),r=!0}i.closePath()}var KX={circle({path:e,x:t,y:i,size:s}){const o=s/2;e.clear(),e.arc(t,i,o,0,Math.PI*2),e.closePath()},cross(e){Hg(e,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(e){Hg(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:i,size:s}){const o=s/4;i=i+o/2,e.clear(),e.arc(t-o,i-o,o,Ai(130),Ai(330)),e.arc(t+o,i-o,o,Ai(220),Ai(50)),e.lineTo(t,i+o),e.closePath()},pin({path:e,x:t,y:i,size:s}){e.moveTo(t+(.15625-.5)*s,i+(.34375-.5)*s),e.cubicCurveTo(t+(.15625-.5)*s,i+(.151491-.5)*s,t+(.307741-.5)*s,i+(0-.5)*s,t+(.5-.5)*s,i+(0-.5)*s),e.cubicCurveTo(t+(.692259-.5)*s,i+(0-.5)*s,t+(.84375-.5)*s,i+(.151491-.5)*s,t+(.84375-.5)*s,i+(.34375-.5)*s),e.cubicCurveTo(t+(.84375-.5)*s,i+(.493824-.5)*s,t+(.784625-.5)*s,i+(.600181-.5)*s,t+(.716461-.5)*s,i+(.695393-.5)*s),e.cubicCurveTo(t+(.699009-.5)*s,i+(.719769-.5)*s,t+(.681271-.5)*s,i+(.743104-.5)*s,t+(.663785-.5)*s,i+(.766105-.5)*s),e.cubicCurveTo(t+(.611893-.5)*s,i+(.834367-.5)*s,t+(.562228-.5)*s,i+(.899699-.5)*s,t+(.528896-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.524075-.5)*s,i+(.992358-.5)*s,t+(.512663-.5)*s,i+(1-.5)*s,t+(.5-.5)*s,i+(1-.5)*s),e.cubicCurveTo(t+(.487337-.5)*s,i+(1-.5)*s,t+(.475925-.5)*s,i+(.992358-.5)*s,t+(.471104-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.487337-.5)*s,i+(1-.5)*s,t+(.475925-.5)*s,i+(.992358-.5)*s,t+(.471104-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.437772-.5)*s,i+(.899699-.5)*s,t+(.388107-.5)*s,i+(.834367-.5)*s,t+(.336215-.5)*s,i+(.766105-.5)*s),e.cubicCurveTo(t+(.318729-.5)*s,i+(.743104-.5)*s,t+(.300991-.5)*s,i+(.719769-.5)*s,t+(.283539-.5)*s,i+(.695393-.5)*s),e.cubicCurveTo(t+(.215375-.5)*s,i+(.600181-.5)*s,t+(.15625-.5)*s,i+(.493824-.5)*s,t+(.15625-.5)*s,i+(.34375-.5)*s),e.closePath()},plus(e){Hg(e,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:e,x:t,y:i,size:s,pixelRatio:o}){const n=s/2;e.clear(),e.moveTo(Ta(o,t-n),Ta(o,i-n)),e.lineTo(Ta(o,t+n),Ta(o,i-n)),e.lineTo(Ta(o,t+n),Ta(o,i+n)),e.lineTo(Ta(o,t-n),Ta(o,i+n)),e.closePath()},star({path:e,x:t,y:i,size:s}){const n=s/2,r=n/2,a=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?n:r,d=l*Math.PI/5-a,h=t+Math.cos(d)*c,u=i+Math.sin(d)*c;e.lineTo(h,u)}e.closePath()},triangle(e){Hg(e,[[.5,0],[1,.87],[0,.87]])}},Tm=class extends eo{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}updatePath(){const{path:e,shape:t,x:i,y:s,size:o}=this,n=this.layerManager?.canvas?.pixelRatio??1,r=Fi.anchor(t),a={path:e,x:i-(r.x-.5)*o,y:s-(r.y-.5)*o,size:o,pixelRatio:n};e.clear(),typeof t=="string"?KX[t](a):typeof t=="function"&&t(a)}computeBBox(){const{x:e,y:t,size:i}=this,s=Fi.anchor(this.shape);return new ve(e-i*s.x,t-i*s.y,i,i)}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};D([Ae()],Tm.prototype,"shape",2);D([Ae()],Tm.prototype,"x",2);D([Ae()],Tm.prototype,"y",2);D([Ae({convertor:Math.abs})],Tm.prototype,"size",2);var Fi=class extends gp(CA(fh(Tm))){static anchor(t){return t==="pin"?{x:.5,y:1}:typeof t=="function"&&"anchor"in t?t.anchor:{x:.5,y:.5}}constructor(t){super(t),t?.shape!=null&&(this.shape=t.shape)}};function m_(e,t,i=t*(5/3)){const s=new Me,o=Math.min(e.marker.strokeWidth,2),n=Math.min(e.line?.strokeWidth??0,2),r=Math.max(e.marker.enabled===!1?0:t,e.line==null?0:i),a=Math.max(e.marker.enabled===!1?0:t,n);if(e.line!=null){const{stroke:l,strokeOpacity:c,lineDash:d}=e.line,h=new $o;h.x1=0,h.y1=a/2,h.x2=r,h.y2=a/2,h.stroke=l,h.strokeOpacity=c,h.strokeWidth=n,h.lineDash=d,s.append(h)}if(e.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:d,stroke:h,strokeOpacity:u,lineDash:p,lineDashOffset:g}=e.marker,f=new Fi;f.shape=l??"square",f.size=t,f.fill=c,f.fillOpacity=d,f.stroke=h,f.strokeOpacity=u,f.strokeWidth=o,f.lineDash=p,f.lineDashOffset=g;const y=Fi.anchor(l),m=r/2+(y.x-.5)*t,C=a/2+(y.y-.5)*t,b=t/(t+o);f.x=0,f.y=0,f.translationX=m,f.translationY=C,f.scalingX=b,f.scalingY=b,s.append(f)}return Me.toSVG(s,r,a)}var FE=.1,BE=200,GE=12,$X=.5,YX=class extends yl{constructor(){super(...arguments),this.x1=NaN,this.y1=NaN,this.x=NaN,this.y=NaN,this.vx=0,this.vy=0,this.t0=NaN,this.animationFrameHandle=void 0}reset(){this.x=NaN,this.y=NaN,this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(e,t){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=e,this.y=t,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=e,this.y1=t,this.t0=Date.now(),this.animationFrameHandle==null&&(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:e,y1:t,t0:i}=this,s=Date.now(),o=s-i;this.t0=s;const n=.001,r=Math.ceil(o/(n*1e3))|0;let{x:a,y:l,vx:c,vy:d}=this;for(let h=0;h<r;h+=1){const u=a-e,p=l-t,g=-(BE*u+GE*c)/FE,f=-(BE*p+GE*d)/FE;c+=g*n,d+=f*n,a+=c*n,l+=d*n}Math.hypot(a-e,l-t)<$X?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=a,this.y=l,this.vx=c,this.vy=d,this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.dispatch("update",{type:"update",x:this.x,y:this.y})}},Ss="ag-charts-tooltip",y_="ag-charts-tooltip--dark";function v_(e){const t=[];return e.type==="raw"?"":(e.heading!=null&&t.push(e.heading),e.title!=null&&t.push(e.title),e.data?.forEach(i=>{t.push(i.label??i.fallbackLabel,i.value)}),t.join("; "))}function _E(e,t,i){let s="";e==null?s+=`<span class="${Ss}-label">${Nu(t)}</span>`:(s+=`<span class="${Ss}-label">${Nu(e)}</span>`,s+=" ",s+=`<span class="${Ss}-value">${Nu(t)}</span>`);const o=[`${Ss}-row`];return i&&o.push(`${Ss}-row--inline`),s=`<div class="${o.join(" ")}">${s}</div>`,s}function XX(e){if(e.type==="raw")return e.rawHtmlString;let t="";if((e.heading==null||e.title==null)&&e.data?.length===1&&e.data[0].label==null&&e.data[0].value!=null){const i=e.data[0];t+=_E(e.heading??e.title,i.value,!1)}else{const i=e.title==null&&e.data?.length===1;e.heading!=null&&(t+=`<span class="${Ss}-heading">${Nu(e.heading)}</span>`,t+=" ");const s=e.symbol==null?void 0:m_(e.symbol,12);s!=null&&(e.title!=null||e.data?.length)&&(t+=`<span class="${Ss}-symbol">${s}</span>`),e.title!=null&&(t+=`<span class="${Ss}-title">${Nu(e.title)}</span>`,t+=" "),e.data?.forEach(o=>{t+=_E(o.label??o.fallbackLabel,o.value,i),t+=" "})}return t=`<div class="${Ss}-content">${t.trimEnd()}</div>`,t}var bp=class extends Ee{constructor(){super(...arguments),this.type="pointer",this.xOffset=0,this.yOffset=0}};D([k(Ct(["pointer","node","top","right","bottom","left","top-left","top-right","bottom-right","bottom-left",{value:"sparkline",undocumented:!0},{value:"sparkline-",undocumented:!0}],"a position type"))],bp.prototype,"type",2);D([k(Ye)],bp.prototype,"xOffset",2);D([k(Ye)],bp.prototype,"yOffset",2);var la=class extends Ee{constructor(){super(),this.enabled=!0,this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new bp,this.darkTheme=!1,this.bounds="extended",this.destroyFns=[],this.springAnimation=new YX,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.showTimeout=0,this._showArrow=!0,this._compact=!1,this._visible=!1,this.positionParams=void 0,this.destroyFns.push(this.springAnimation.addListener("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(e){"togglePopover"in wt().HTMLElement.prototype&&(this.element=e.addChild("canvas-overlay",Ss),this.element.setAttribute("popover","manual"),this.element.className=Ss)}destroy(e){e.removeChild("canvas-overlay",Ss),this.destroyFns.forEach(t=>t())}isVisible(){return this._visible}contains(e){return this.element?.contains(e)??!1}updateTooltipPosition(){const{element:e,positionParams:t}=this;if(e==null||t==null)return;const{canvasRect:i,relativeRect:s,meta:o}=t,{x:n,y:r}=this.springAnimation,a=o.position?.type??this.position.type,l=o.position?.xOffset??0,c=o.position?.yOffset??0,d=s.x,h=s.y,u=s.width-e.clientWidth-1+d,p=s.height-e.clientHeight+h;let g=this.getTooltipBounds({positionType:a,canvasX:n,canvasY:r,yOffset:c,xOffset:l,canvasRect:i}),f=Y0(e.clientWidth,e.clientHeight,s,g);a==="sparkline"&&(f.x<=d||f.x>=u)&&(g=this.getTooltipBounds({positionType:"sparkline-constrained",canvasX:n,canvasY:r,yOffset:c,xOffset:l,canvasRect:i}),f=Y0(e.clientWidth,e.clientHeight,s,g));const y=Pe(d,f.x,u),m=Pe(h,f.y,p),C=y!==f.x||m!==f.y,b=(a==="node"||a==="pointer")&&!C&&!l&&!c,S=o.showArrow??this.showArrow??b;this.updateShowArrow(S),this.updateCompact(a==="sparkline"||a==="sparkline-constrained"),e.style.transform=`translate(${y}px, ${m}px)`}show(e,t,i,s,o=!1){const{element:n}=this;if(n!=null&&s!=null)n.innerHTML=XX(s);else if(n==null||n.innerHTML===""){this.toggle(!1);return}const r={x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height};this.positionParams={canvasRect:t,relativeRect:r,meta:i},this.springAnimation.update(i.canvasX,i.canvasY),n.style.top=`${t.top}px`,n.style.left=`${t.left}px`,i.enableInteraction?(this.enableInteraction=!0,n.style.pointerEvents="auto",n.removeAttribute("aria-hidden")):(this.enableInteraction=!1,n.style.pointerEvents="none",n.setAttribute("aria-hidden","true")),this.delay>0&&!o?(this.toggle(!1),this.showTimeout=setTimeout(()=>{this.toggle(!0)},this.delay)):this.toggle(!0)}hide(){this.springAnimation.reset(),this.toggle(!1)}toggle(e){if(!this.element?.isConnected)return;this._visible=e;const{classList:t}=this.element,i=(s,o)=>t.toggle(`${Ss}--${s}`,o);e||clearTimeout(this.showTimeout),i("no-interaction",!this.enableInteraction),i("arrow",this._showArrow),i("compact",this._compact),t.toggle(y_,this.darkTheme),this.element.togglePopover(e),e&&this.updateTooltipPosition();for(const s of this.wrapTypes)t.toggle(`${Ss}--wrap-${s}`,s===this.wrapping)}updateShowArrow(e){this._showArrow=e}updateCompact(e){this._compact=e}getTooltipBounds(e){if(!this.element)return{};const{positionType:t,canvasX:i,canvasY:s,yOffset:o,xOffset:n,canvasRect:r}=e,{clientWidth:a,clientHeight:l}=this.element,c={width:a,height:l};switch(t){case"node":case"pointer":return c.top=s+o-l-8,c.left=i+n-a/2,c;case"top":return c.top=o,c.left=r.width/2-a/2+n,c;case"right":return c.top=r.height/2-l/2+o,c.left=r.width-a/2+n,c;case"left":return c.top=r.height/2-l/2+o,c.left=n,c;case"bottom":return c.top=r.height-l+o,c.left=r.width/2-a/2+n,c;case"top-left":return c.top=o,c.left=n,c;case"top-right":return c.top=o,c.left=r.width-a+n,c;case"bottom-right":return c.top=r.height-l+o,c.left=r.width-a+n,c;case"bottom-left":return c.top=r.height-l+o,c.left=n,c;case"sparkline":return c.top=s+o-l/2,c.left=i+n+8,c;case"sparkline-constrained":return c.top=s+o-l/2,c.left=i+n-8-a,c}}};D([k(xe)],la.prototype,"enabled",2);D([k(xe,{optional:!0})],la.prototype,"showArrow",2);D([k(pe)],la.prototype,"delay",2);D([k(tS,{optional:!0})],la.prototype,"range",2);D([k(eS)],la.prototype,"wrapping",2);D([k(me)],la.prototype,"position",2);D([k(xe)],la.prototype,"darkTheme",2);D([k(Ct(["extended","canvas"]))],la.prototype,"bounds",2);var ZX=class extends Bc{constructor(e){super(),this.chart=e,this.id=Rn(this),this.series=[],this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.hoverDevice="pointer",this.previousInputDevice="keyboard",this.focus={sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.hoverScheduler=MY(()=>{if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=4){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}});const t=e.ctx.domManager.addChild("series-area","series-area-aria-label1"),i=e.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new _X(t,i,this.id,"img"),this.swapChain.addListener("blur",()=>this.onBlur()),this.swapChain.addListener("focus",()=>this.onFocus()),this.focusIndicator=new GX(this.swapChain),this.focusIndicator.overrideFocusVisible(e.mode==="integrated"?!1:void 0);const{seriesDragInterpreter:s,seriesWidget:o,containerWidget:n}=e.ctx.widgets;o.setTabIndex(-1),this.destroyFns.push(()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label2"),o.addListener("focus",()=>this.swapChain.focus()),o.addListener("mousemove",r=>this.onHover(r)),o.addListener("wheel",r=>this.onWheel(r)),o.addListener("mouseleave",r=>this.onLeave(r)),o.addListener("keydown",r=>this.onKeyDown(r)),o.addListener("contextmenu",(r,a)=>this.onContextMenu(r,a)),s.addListener("drag-move",r=>this.onDragMove(r)),s.addListener("click",r=>this.onClick(r,o)),s.addListener("dblclick",r=>this.onClick(r,o)),n.addListener("contextmenu",(r,a)=>this.onContextMenu(r,a)),n.addListener("click",(r,a)=>this.onClick(r,a)),n.addListener("dblclick",(r,a)=>this.onClick(r,a)),e.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),e.ctx.domManager.addListener("resize",()=>this.clearAll()),e.ctx.highlightManager.addListener("highlight-change",r=>this.changeHighlightDatum(r)),e.ctx.layoutManager.addListener("layout:complete",r=>this.layoutComplete(r)),e.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),e.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),e.ctx.zoomManager.addListener("zoom-change",()=>this.clearAll()),e.ctx.zoomManager.addListener("zoom-pan-start",()=>this.clearAll()))}isState(e){return this.chart.ctx.interactionManager.isState(e)}isIgnoredTouch(e){return!(e.device!=="touch"||e.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(9))}dataChanged(){var e;(e=this.highlight).stashedHoverEvent??(e.stashedHoverEvent=this.highlight.appliedHoverEvent),this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator.clear(),this.clearHighlight()}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0)}updateComplete(){this.focusIndicator.isFocusVisible()&&this.isState(34)&&this.handleSeriesFocus(0,0,!0)}update(e,t){this.chart.ctx.updateService.update(e,t)}seriesChanged(e){this.focus.sortedSeries=[...e].sort((t,i)=>{let s=t.properties.focusPriority??1/0,o=i.properties.focusPriority??1/0;return s===o&&([s,o]=[t._declarationOrder,i._declarationOrder]),s<o?-1:s>o?1:0}),this.series=e}layoutComplete(e){this.seriesRect=e.series.rect,this.hoverRect=e.series.paddedRect,this.chart.ctx.widgets.seriesWidget.setBounds(e.series.paddedRect),this.chart.ctx.widgets.chartWidget.setBounds(e.chart)}onContextMenu(e,t){const{sourceEvent:i}=e;if(i.currentTarget!=t.getElement())return;if(i.target==this.chart.ctx.widgets.containerWidget.getElement()){if(this.isState(36)){const{currentX:l,currentY:c}=e;this.chart.ctx.contextMenuRegistry.dispatchContext("all",{sourceEvent:i,canvasX:l,canvasY:c},{})}return}let s,o;if(this.focusIndicator.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(o=$t.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(36)){const l=this.pickNode({x:e.currentX,y:e.currentY},"context-menu");l&&(this.chart.ctx.highlightManager.updateHighlight(this.id),s=l.datum)}const n=s?.series;this.clearAll();const r=e.currentX+t.cssLeft(),a=e.currentY+t.cssTop();this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{sourceEvent:i,canvasX:r,canvasY:a},{pickedSeries:n,pickedNode:s},o)}onLeave(e){!this.isState(41)||e.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(e)||(this.chart.ctx.domManager.updateCursor(this.id),this.focusIndicator.isFocusVisible()||this.clearAll())}onWheel(e){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.previousInputDevice="pointer")}onDragMove(e){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e))}onHover(e){this.isState(41)&&this.onHoverLikeEvent(e)}onHoverLikeEvent(e){if(!this.isIgnoredTouch(e)&&((e.device==="touch"||qX(e,"drag-move"))&&(this.tooltip.lastHover=e),e.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&e.sourceEvent.preventDefault(),this.hoverDevice="pointer",this.previousInputDevice="pointer",this.highlight.pendingHoverEvent=e,this.hoverScheduler.schedule(),this.isState(32))){const{currentX:t,currentY:i}=e,s=this.pickNode({x:t,y:i},"event");s?.series.hasEventListener("nodeClick")||s?.series.hasEventListener("nodeDoubleClick")?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}}onClick(e,t){if(e.device==="touch"&&t===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(41))return;if(t===this.chart.ctx.widgets.seriesWidget){if(!t.getElement().contains(e.sourceEvent.target))return}else if(e.sourceEvent.target!=t.getElement())return;if(this.focusIndicator.overrideFocusVisible(!1),this.onHoverLikeEvent(e),!this.isState(32))return;if(t==this.chart.ctx.widgets.seriesWidget&&this.checkSeriesNodeClick(e)){this.update(4),e.sourceEvent.preventDefault();return}const i={type:e.type==="click"?"click":"doubleClick",event:e.sourceEvent};this.chart.fireEvent(i)}onFocus(){this.isState(34)&&(this.hoverDevice=this.focusIndicator.isFocusVisible()?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(){this.isState(34)&&(this.hoverDevice="pointer",this.clearAll(),this.focusIndicator.overrideFocusVisible(void 0))}onKeyDown(e){if(!this.isState(43))return;const t=HX(e.sourceEvent);switch(t?.activatesFocusIndicator===!1&&this.focusIndicator.overrideFocusVisible(this.previousInputDevice==="keyboard"),t?.name){case"redo":return this.chart.ctx.chartEventManager.seriesEvent("series-redo");case"undo":return this.chart.ctx.chartEventManager.seriesEvent("series-undo");case"zoomin":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(1,e);case"zoomout":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(-1,e);case"arrowup":return this.onArrow(-1,0,e);case"arrowdown":return this.onArrow(1,0,e);case"arrowleft":return this.onArrow(0,-1,e);case"arrowright":return this.onArrow(0,1,e);case"submit":return this.onSubmit(e)}}onArrow(e,t,i){this.isState(34)&&(this.hoverDevice="keyboard",this.previousInputDevice="keyboard",this.focusIndicator.overrideFocusVisible(!0),this.focus.seriesIndex+=e,this.focus.datumIndex+=t,this.handleFocus(e,t),i.sourceEvent.preventDefault(),this.chart.ctx.chartEventManager.seriesEvent("series-focus-change"))}onSubmit(e){if(!this.isState(34))return;const{series:t,datum:i}=this.focus,s=e.sourceEvent;t!==void 0&&i!==void 0?t.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s}),s.preventDefault()}checkSeriesNodeClick(e){const t=this.pickNode({x:e.currentX,y:e.currentY},"event");return t==null?!1:e.type==="click"?(t.series.fireNodeClickEvent(e.sourceEvent,t.datum),!0):e.type==="dblclick"?(e.preventZoomDblClick=t.distance===0,t.series.fireNodeDoubleClickEvent(e.sourceEvent,t.datum),!0):!1}handleFocus(e,t){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);i==null?this.handleSeriesFocus(e,t):this.focusIndicator.update(i.rect,this.seriesRect,!1)}handleSeriesFocus(e,t,i=!1){if(this.chart.chartType==="hierarchy"||this.chart.chartType==="gauge"){this.handleSoloSeriesFocus(e,t,i);return}const{focus:s,seriesRect:o}=this,n=s.sortedSeries.filter(d=>d.visible&&d.focusable);if(n.length===0)return;const r={datumIndex:s.datumIndex-t,otherIndex:s.seriesIndex-e};s.seriesIndex=Pe(0,s.seriesIndex,n.length-1),s.series=n[s.seriesIndex];const{datumIndex:a,seriesIndex:l}=s,c=s.series.pickFocus({datumIndex:a,datumIndexDelta:t,otherIndex:l,otherIndexDelta:e,seriesRect:o});this.updatePickedFocus(e,t,r,c,i)}handleSoloSeriesFocus(e,t,i){this.focus.series=this.focus.sortedSeries[0];const{focus:{series:s,seriesIndex:o,datumIndex:n},seriesRect:r}=this;if(s==null)return;const a={datumIndex:this.focus.datumIndex-t,otherIndex:this.focus.seriesIndex-e},l=s.pickFocus({datumIndex:n,datumIndexDelta:t,otherIndex:o,otherIndexDelta:e,seriesRect:r});this.updatePickedFocus(e,t,a,l,i)}updatePickedFocus(e,t,i,s,o){const{focus:n,hoverRect:r}=this;if(s===void 0||n.series===void 0||r===void 0)return;const{datum:a,datumIndex:l,otherIndex:c}=s;if(c!==void 0&&(n.seriesIndex=c),n.datumIndex=l,n.datum=a,this.focusIndicator.isFocusVisible()&&this.chart.ctx.animationManager.reset(),this.focusIndicator.isFocusVisible()){const h=jX(s),{x:u,y:p}=h.computeCenter();if(!r.containsPoint(u,p)&&this.chart.ctx.zoomManager.panToBBox(this.id,r,h))return}this.focusIndicator.update(s.bounds,this.seriesRect,s.clipFocusBox);const d=UX(n.series,r,s);if(d!==void 0&&this.hoverDevice==="keyboard"){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0;const h=n.series.getTooltipContent(a),u=UC.makeTooltipMeta(d,n.series,a);this.chart.ctx.highlightManager.updateHighlight(this.id,a),this.chart.tooltip.enabled&&n.series.tooltipEnabled?this.chart.ctx.tooltipManager.updateTooltip(this.id,u,h):this.chart.ctx.tooltipManager.removeTooltip(this.id),o||(t===0&&e===0||i.datumIndex!==s.datumIndex||i.otherIndex!==(s.otherIndex??n.seriesIndex))&&this.swapChain.update(this.getDatumAriaText(a,h))}}getDatumAriaText(e,t){const i=t==null?"":v_(t);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:e.series.getDatumAriaText?.(e,i)??i})}clearHighlight(){this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id)}clearTooltip(){this.chart.ctx.tooltipManager.removeTooltip(this.id),this.tooltip.lastHover=void 0}clearAll(){this.clearHighlight(),this.clearTooltip(),this.focusIndicator.clear()}handleHoverHighlight(e){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const t=this.highlight.appliedHoverEvent;if(!t||!this.isState(41))return;const{currentX:i,currentY:s}=t,o=t.currentX+(this.hoverRect?.x??0),n=t.currentY+(this.hoverRect?.y??0);if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(o,n)){this.clearHighlight();return}const{range:r}=this.chart.highlight,a=r==="tooltip"?"highlight-tooltip":"highlight",l=this.pickNode({x:i,y:s},a);if(l){this.chart.ctx.highlightManager.updateHighlight(this.id,l.datum),this.hoverDevice="pointer";return}this.chart.ctx.highlightManager.updateHighlight(this.id)}handleHoverTooltip(e,t){if(!this.isState(41))return;const{currentX:i,currentY:s}=e,o=i+(this.hoverRect?.x??0),n=s+(this.hoverRect?.y??0),r=e.sourceEvent.target;if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(o,n)){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(r&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(r,"canvas-overlay",Ss))return;const a=this.pickNode({x:e.currentX,y:e.currentY},"tooltip");if(!a){this.hoverDevice=="pointer"&&this.clearTooltip();return}this.hoverDevice="pointer";const l=a.series.getTooltipContent(a.datum);if(this.chart.tooltip.enabled&&a.series.tooltipEnabled&&l!=null){const h=UC.makeTooltipMeta({type:"pointermove",canvasX:o,canvasY:n},a.series,a.datum);this.chart.ctx.tooltipManager.updateTooltip(this.id,h,l)}else this.chart.ctx.tooltipManager.removeTooltip(this.id)}changeHighlightDatum(e){const t=new Set,{series:i=void 0,datum:s}=e.currentHighlight??{},{series:o=void 0,datum:n}=e.previousHighlight??{};o&&t.add(o),i&&t.add(i),o?.properties.cursor&&n&&this.chart.ctx.domManager.updateCursor(o.id),i?.properties.cursor&&i?.properties.cursor!=="default"&&s&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),i==null||o==null?this.update(4):this.update(4,{seriesToUpdate:t})}pickNode(e,t,i){const s=[...this.series].reverse();let o;for(const n of s){if(!n.visible||!n.contentGroup.visible)continue;const{match:r,distance:a}=n.pickNode(e,t,i)??{};if(!(!r||a==null)&&((!o||o.distance>a)&&(o={series:n,distance:a,datum:r}),a===0))break}return o}};function qX(e,t){return e.type!==t}var zE=30,QX=class{constructor(e){this.seriesRoot=e,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(e){this.expectedSeriesCount=e}requestGroup(e){const{internalId:t,type:i,contentGroup:s,seriesGrouping:o}=e,{groupIndex:n=t}=o??{},r=this.series.get(t);if(r!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(r)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=zE?"aggressive-grouping":"normal");let a=this.groups.get(i);a==null&&(a=new Map,this.groups.set(i,a));const l=this.lookupIdx(n);let c=a.get(l);return c==null&&(c={type:i,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new Me({name:`${e.contentGroup.name??i}-managed-layer`,zIndex:e.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},a.set(l,c)),this.series.set(t,{layerState:c,seriesConfig:e}),c.seriesIds.push(t),c.group.appendChild(s),c.group}changeGroup(e){const{internalId:t,seriesGrouping:i,type:s,contentGroup:o,oldGrouping:n}=e,{groupIndex:r=t}=i??{};this.groups.get(s)?.get(r)?.seriesIds.includes(t)||(this.series.has(t)&&this.releaseGroup({internalId:t,seriesGrouping:n,type:s,contentGroup:o}),this.requestGroup(e))}releaseGroup(e){const{internalId:t,contentGroup:i,type:s}=e;if(!this.series.has(t))throw new Error(`AG Charts - series doesn't have an allocated layer: ${t}`);const o=this.series.get(t)?.layerState;o&&(o.seriesIds=o.seriesIds.filter(n=>n!==t),o.group.removeChild(i)),o?.seriesIds.length===0?(this.seriesRoot.removeChild(o.group),this.groups.get(o.type)?.delete(o.id),this.groups.get(s)?.delete(t)):o!=null&&o.seriesIds.length>0&&(o.group.zIndex=this.getLowestSeriesZIndex(o.seriesIds)),this.series.delete(t)}updateLayerCompositing(){this.groups.forEach(e=>{e.forEach(t=>{const{group:i,seriesIds:s}=t;let o;s.length===0?o=!1:s.length>1?o=!0:o=this.series.get(s[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=o,i.zIndex=this.getLowestSeriesZIndex(s)})})}lookupIdx(e){return this.mode==="normal"?e:typeof e=="string"&&(e=Number(e.split("-").at(-1)),!e)?0:Math.floor(Pe(0,e/this.expectedSeriesCount,1)*zE)}destroy(){this.groups.forEach(e=>{e.forEach(t=>{this.seriesRoot.removeChild(t.group)})}),this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(e){return e.reduce((i,s)=>{const n=this.series.get(s)?.seriesConfig.contentGroup.zIndex;return i==null||n==null?n:VG(i,n)<=0?i:n},void 0)??1}},C_=class extends Ee{constructor(){super(...arguments),this.dragAction="drag"}};D([k(Ct(["none","drag","hover"]))],C_.prototype,"dragAction",2);var JX=class{constructor(e,t,i,s,o){this.chart=e,this.dataService=t,this.updateService=i,this.zoomManager=s,this.animationManager=o,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.destroyFns=[],this.destroyFns.push(this.dataService.addListener("data-source-change",()=>this.onDataSourceChange()),this.dataService.addListener("data-load",()=>this.onDataLoad()),this.dataService.addListener("data-error",()=>this.onDataError()),this.updateService.addListener("update-complete",()=>this.onUpdateComplete()),this.zoomManager.addListener("zoom-change",()=>this.onZoomChange()))}destroy(){this.destroyFns.forEach(e=>e())}onDataLoad(){this.animationManager.skip(),this.updateService.update(1)}onDataError(){this.updateService.update(3)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(){!this.dirtyZoom&&!this.dirtyDataSource||this.updateWindow()}onZoomChange(){this.dirtyZoom=!0}updateWindow(){if(!this.dataService.isLazy())return;const e=this.getValidAxis();let t,i=!0;if(e){const s=this.zoomManager.getAxisZoom(e.id);t=this.getAxisWindow(e,s),i=this.shouldRefresh(e,s)}this.dirtyZoom=!1,this.dirtyDataSource=!1,i&&this.dataService.load({windowStart:t?.min,windowEnd:t?.max})}getValidAxis(){return this.chart.axes.find(e=>e.type==="time")}shouldRefresh(e,t){if(this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const i=this.lastAxisZooms.get(e.id);return i&&t.min===i.min&&t.max===i.max?!1:(this.lastAxisZooms.set(e.id,t),!0)}getAxisWindow(e,t){const{domain:i}=e.scale;if(!t||i.length===0||isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]),o=new Date(Number(i[0])+s*t.min),n=new Date(Number(i[0])+s*t.max);return{min:o,max:n}}},eZ=/^((?!chrome|android).)*safari/i,tZ=/Version\/(\d+(\.\d+)?)/,iZ=/Chrome/,sZ=/Chrome\/(\d+)/,oZ=/Edg/,nZ=/OPR/;function rZ(){const{userAgent:e}=wt("navigator");if(eZ.test(e)){const t=parseFloat(tZ.exec(e)?.[1]??"0"),i=Math.floor(t)>16;return i||ue.warnOnce(`Unsupported Safari version: ${t}; ${e}`),!i}else if(iZ.test(e)&&!oZ.test(e)&&!nZ.test(e)){const t=parseInt(sZ.exec(e)?.[1]??"0",10),i=t>126;return i||ue.warnOnce(`Unsupported Chrome version: ${t}; ${e}`),!i}return!1}var aZ=new Set(["map-shape-background","map-line-background"]),lZ=class{constructor(e,t,i,s,o,n,r){this.chartLike=e,this.overlays=t,this.dataService=i,this.layoutManager=s,this.localeManager=o,this.animationManager=n,this.domManager=r,this.destroyFns=[],this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(K0),this.destroyFns.push(this.layoutManager.addListener("layout:complete",a=>this.onLayoutComplete(a)))}destroy(){this.destroyFns.forEach(e=>e()),this.domManager.removeStyles("overlays"),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:e}}){const t=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),s=this.chartLike.series.some(c=>c.visible&&!aZ.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(NE):this.overlayElem.classList.remove(NE),this.overlayElem.style.left=`${e.x}px`,this.overlayElem.style.top=`${e.y}px`,this.overlayElem.style.width=`${e.width}px`,this.overlayElem.style.height=`${e.height}px`;const o=t,n=!t&&!i,r=i&&!s,a=this.overlays.unsupportedBrowser.enabled&&rZ();o?this.showOverlay(this.overlays.loading,e):this.hideOverlay(this.overlays.loading),n?this.showOverlay(this.overlays.noData,e):this.hideOverlay(this.overlays.noData),r?this.showOverlay(this.overlays.noVisibleSeries,e):this.hideOverlay(this.overlays.noVisibleSeries),a?this.showOverlay(this.overlays.unsupportedBrowser,e):this.hideOverlay(this.overlays.unsupportedBrowser);const l=o||n||r||a;pt(this.overlayElem,"aria-hidden",!l)}showOverlay(e,t){if(!e.enabled)return;const i=e.getElement(this.animationManager,this.localeManager,t);this.overlayElem.appendChild(i)}hideOverlay(e){e.removeElement(()=>{this.overlayElem.innerText=" "},this.animationManager)}},zn=yt.create(!0,"opts"),eI=class extends Ee{constructor(){super(...arguments),this.padding=new Fc(0)}};D([k(xe,{optional:!0})],eI.prototype,"clip",2);D([k(me)],eI.prototype,"padding",2);var li=class b_ extends A2{constructor(t,i){var s;super(),this.id=Rn(this),this.seriesRoot=new Zs({name:`${this.id}-series-root`,zIndex:5}),this.annotationRoot=new Zs({name:`${this.id}-annotation-root`,zIndex:9}),this.titleGroup=new Me({name:"titles",zIndex:13}),this.debug=yt.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new cE,this.padding=new Fc(20),this.seriesArea=new eI,this.keyboard=new qA,this.touch=new C_,this.mode="standalone",this.chartCaptions=new dS,this.suppressFieldDotNotation=!1,this.destroyed=!1,this._destroyFns=[],this.skipSync=!1,this.chartAnimationPhase="initial",this.modulesManager=new TX,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new cE,this.performUpdateType=7,this.runningUpdateType=7,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new wY,this.updateRequestors={},this.performUpdateTrigger=DY(({count:d})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(d)}catch(h){ue.error("update error",h)}}).catch(h=>ue.errorOnce(h))}),this._performUpdateSplits={},this.axes=[],this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=d=>{this.fireEvent({...d,type:"seriesNodeClick"})},this.onSeriesNodeDoubleClick=d=>{this.fireEvent({...d,type:"seriesNodeDoubleClick"})},this.onSeriesVisibilityChange=d=>{this.fireEvent(d)},this.seriesGroupingChanged=d=>{if(!(d instanceof JA))return;const{series:h,seriesGrouping:u,oldGrouping:p}=d;h.contentGroup.isRoot()||this.seriesLayerManager.changeGroup({internalId:h.internalId,type:h.type,contentGroup:h.contentGroup,renderToOffscreenCanvas:()=>h.renderToOffscreenCanvas(),seriesGrouping:u,oldGrouping:p})},this.chartOptions=t;const o=i?.scene,n=i?.container??t.processedOptions.container??void 0,r=i?.styleContainer??t.specialOverrides.styleContainer,a=new Me({name:"root"});a.visible=!1,a.append(this.seriesRoot),a.append(this.annotationRoot),a.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),this.tooltip=new la,this.seriesLayerManager=new QX(this.seriesRoot),this.mode=t.userOptions.mode??this.mode;const l=this.ctx=new $6(this,{chartType:this.getChartType(),scene:o,root:a,container:n,styleContainer:r,syncManager:new CX(this),fireEvent:d=>this.fireEvent(d),updateCallback:(d,h)=>this.update(d,h),updateMutex:this.updateMutex});this._destroyFns.push(l.domManager.addListener("resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new Cp,(s=this.overlays.loading).renderer??(s.renderer=()=>LX(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new JX(this,l.dataService,l.updateService,l.zoomManager,l.animationManager),new lZ(this,this.overlays,l.dataService,l.layoutManager,l.localeManager,l.animationManager,l.domManager)],this.highlight=new Q2,this.container=n;const c=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new ZX(this.initSeriesAreaDependencies()),this._destroyFns.push(l.layoutManager.registerElement(0,d=>{d.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(d)}),l.layoutManager.addListener("layout:complete",d=>this.chartCaptions.positionAbsoluteCaptions(d)),l.dataService.addListener("data-load",d=>{this.data=d.data}),this.title.registerInteraction(c,"beforebegin"),this.subtitle.registerInteraction(c,"beforebegin"),this.footnote.registerInteraction(c,"afterend"),aa.addWindowEvent("page-left",()=>this.destroy()),l.animationManager.addListener("animation-frame",()=>{this.update(6)}),l.animationManager.addListener("animation-start",()=>l.domManager.setDataBoolean("animating",!0)),l.animationManager.addListener("animation-stop",()=>l.domManager.setDataBoolean("animating",!1)),l.zoomManager.addListener("zoom-change",()=>{this.series.forEach(h=>h.animationState?.transition("updateData"));const d=this.chartAnimationPhase!=="initial";this.update(3,{forceNodeDataRefresh:!0,skipAnimations:d})})),this.parentResize(l.domManager.containerSize)}static getInstance(t){return b_.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}download(t,i){this.ctx.scene.download(t,i)}getCanvasDataURL(t){return this.ctx.scene.getDataURL(t)}toSVG(){return this.ctx.scene.toSVG()}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}overrideFocusVisible(t){this.seriesAreaManager.focusIndicator.overrideFocusVisible(t)}initSeriesAreaDependencies(){const{ctx:t,tooltip:i,highlight:s,overlays:o,seriesRoot:n,mode:r}=this,a=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,chartType:a,ctx:t,tooltip:i,highlight:s,overlays:o,seriesRoot:n,mode:r}}getModuleContext(){return this.ctx}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(t=>t.enabled&&t.text).map(t=>t.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}resetAnimations(){this.chartAnimationPhase="initial";for(const t of this.series)t.resetAnimation(this.chartAnimationPhase);for(const t of this.axes)t.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}detachAndClear(){this.container=void 0,this.ctx.scene.clear()}destroy(t){if(this.destroyed)return;const i=t?.keepTransferableResources;let s;return this.performUpdateType=7,this._destroyFns.forEach(o=>o()),this.processors.forEach(o=>o.destroy()),this.tooltip.destroy(this.ctx.domManager),this.overlays.destroy(),this.modulesManager.destroy(),i?(this.ctx.scene.strip(),s={container:this.container,scene:this.ctx.scene}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(o=>o.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.destroyed=!0,Object.freeze(this),s}requestFactoryUpdate(t){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await t(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>ue.errorOnce(i)))}update(t=0,i){if(this.destroyed)return;const{forceNodeDataRefresh:s=!1,skipAnimations:o,seriesToUpdate:n=this.series,newAnimationBatch:r}=i??{};this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),s&&this.series.forEach(a=>a.markNodeDataDirty());for(const a of n)this.seriesToUpdate.add(a);if(o&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),r&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this.skipSync=i?.skipSync??!1,this.debug.check()){let a=new Error().stack??"<unknown>";a=a.replace(/\([^)]*/g,""),this.updateRequestors[a]=t}t<this.performUpdateType&&(this.performUpdateType=t,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(i?.backOffMs))}async performUpdate(t){const{performUpdateType:i,extraDebugStats:s,_performUpdateSplits:o,ctx:n}=this,r=[...this.seriesToUpdate];this.performUpdateType=7,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.updateShortcutCount===0&&i<6&&(n.animationManager.startBatch(this._performUpdateSkipAnimations),n.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.debug("Chart.performUpdate() - start",rf[i]);let a=performance.now();o.start??(o.start=a);const l=d=>{o[d]??(o[d]=0),o[d]+=performance.now()-a,a=performance.now()};switch(i){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;await this.updateData(),l("⬇️");case 2:if(this.checkUpdateShortcut(2))break;await this.processData(),this.seriesAreaManager.dataChanged(),l("🏭");case 3:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(3))break;await this.processLayout(),l("⌖");case 4:{if(this.checkUpdateShortcut(4))break;await this.updateSeries(r),l("🤔"),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing()}case 5:if(this.checkUpdateShortcut(5))break;n.updateService.dispatchPreSceneRender(),l("↖");case 6:if(this.checkUpdateShortcut(6))break;n.animationManager.endBatch(),s.updateShortcutCount=this.updateShortcutCount,n.scene.render({debugSplitTimes:o,extraDebugStats:s,seriesRect:this.seriesRect}),this.extraDebugStats={};for(const d of Object.keys(o))delete o[d];this.ctx.domManager.incrementDataCounter("sceneRenders");case 7:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,n.animationManager.endBatch()}this.destroyed||(n.updateService.dispatchUpdateComplete(),this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=7),this._performUpdateNotify.notify();const c=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round((c-o.start)*100)/100,count:t,performUpdateType:rf[i]})}updateThemeClassName(){const t="ag-charts-theme-",i=[`${t}default`,`${t}default-dark`];let s=i[0],o=!1,{theme:n}=this.chartOptions.processedOptions;for(;typeof n!="string"&&n!=null;)n=n.baseTheme;typeof n=="string"&&(s=n.replace("ag-",t),o=n.includes("-dark")),i.includes(s)||(s=o?i[1]:i[0]),this.ctx.domManager.setThemeClass(s)}updateDOM(){this.updateThemeClassName();const{enabled:t,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(t?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(t){return this.destroyed?!0:this.updateShortcutCount>3?(ue.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=t?(this.updateShortcutCount++,!0):!1}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.await(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}onAxisChange(t,i){i==null&&t.length===0||this.ctx.axisManager.updateAxes(i??[],t)}onSeriesChange(t,i){const s=i?.filter(o=>!t.includes(o))??[];this.destroySeries(s),this.seriesLayerManager?.setSeriesCount(t.length);for(const o of t){if(i?.includes(o))continue;const n=this.seriesLayerManager.requestGroup(o);o.attachSeries(n,this.seriesRoot,this.annotationRoot);const r=this;o.chart={get mode(){return r.mode},get isMiniChart(){return!1},get seriesRect(){return r.seriesRect}},o.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(o),o.addChartEventListeners()}this.seriesAreaManager?.seriesChanged(t)}destroySeries(t){t?.forEach(i=>{i.removeEventListener("nodeClick",this.onSeriesNodeClick),i.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),i.removeEventListener("groupingChanged",this.seriesGroupingChanged),i.destroy(),this.seriesLayerManager.releaseGroup(i),i.detachSeries(void 0,this.seriesRoot,this.annotationRoot),i.chart=void 0})}addSeriesListeners(t){this.hasEventListener("seriesNodeClick")&&t.addEventListener("nodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&t.addEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&t.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),t.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const t of this.axes)t.boundSeries=this.series.filter(i=>i.axes[t.direction]===t)}assignAxesToSeries(){const t=sA(this.axes,i=>i.direction);for(const i of this.series)for(const s of i.directions){const o=t[s];if(!o){ue.warnOnce(`no available axis for direction [${s}]; check series and axes configuration.`);return}const n=i.getKeys(s),r=o.find(a=>!a.keys.length||n.some(l=>a.keys.includes(l)));if(!r){ue.warnOnce(`no matching axis for direction [${s}] and keys [${n}]; check series and axes configuration.`);return}i.axes[s]=r}}parentResize(t){if(t==null||this.width!=null&&this.height!=null)return;let{width:i,height:s}=t;const{pixelRatio:o}=t;if(i=Math.floor(i),s=Math.floor(s),i===0&&s===0)return;const[n=0,r=0,a=1]=this._lastAutoSize??[];n===i&&r===s&&a===o||(this._lastAutoSize=[i,s,o],this.resize("SizeMonitor",{}))}resize(t,i){const{scene:s,animationManager:o}=this.ctx,{inWidth:n,inHeight:r,inMinWidth:a,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(a??this.minWidth,l??this.minHeight,n??this.width,r??this.height);const d=n??this.width??this._lastAutoSize?.[0],h=r??this.height??this._lastAutoSize?.[1],u=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${t}`,{width:d,height:h,pixelRatio:u,stack:new Error().stack}),!(d==null||h==null||!Qe(d)||!Qe(h))&&s.resize(d,h,u)){o.reset();let p=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(p=!1,this._firstAutoSize=!1),this.update(3,{forceNodeDataRefresh:!0,skipAnimations:p}),this._autoSizeNotify.notify()}}async updateData(){this.series.forEach(i=>i.setChartData(this.data));const t=this.modulesManager.mapModules(i=>i.updateData?.(this.data));await Promise.all(t)}async processData(){this.series.some(o=>o.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const t=new o_(this.mode,this.suppressFieldDotNotation),i=this.series.map(o=>(o.resetDatumCallbackCache(),o.processData(t))),s=this.modulesManager.mapModules(o=>o.processData?.(t));this._cachedData=t.execute(this._cachedData),await Promise.all([...i,...s]);for(const o of this.axes)o.processData();this.updateLegends()}updateLegends(t){for(const{legend:i,legendType:s}of this.modulesManager.legends())s==="category"?this.setCategoryLegendData(t):this.setLegendData(s,i)}setCategoryLegendData(t){var i;const{ctx:{legendManager:s,stateManager:o}}=this;t&&this.series.forEach(r=>{const a=t.find(l=>l.seriesId===r.id);r.onLegendInitialState("category",a)});const n=this.series.flatMap(r=>{const a=r.getLegendData("category");return s.updateData(r.id,a),a});if(t){o.setStateAndRestore(s,t);return}if(this.mode!=="integrated"){const r={},a=new Map(this.series.map(l=>[l.id,l.type]));for(const{seriesId:l,symbol:{marker:c},label:d}of n.filter(h=>!h.hideInLegend)){if(c.fill==null)continue;const h=a.get(l),u=r[h]??(r[h]={});u[i=d.text]??(u[i]=c.fill),u[d.text]!==c.fill&&ue.warnOnce(`legend item '${d.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}s.update()}setLegendData(t,i){i.data=this.series.filter(s=>s.properties.showInLegend).flatMap(s=>s.getLegendData(t))}async processLayout(){const t=this.animationRect,{width:i,height:s}=this.ctx.scene,o=this.ctx.layoutManager.createContext(i,s);await this.performLayout(o),t&&!this.animationRect?.equals(t)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}async updateSeries(t){const{seriesRect:i}=this;await Promise.all(t.map(s=>s.update({seriesRect:i}))),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(s=>s.visible&&s.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(t=1e4,i=!1){const s=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==7||this.runningUpdateType!==7)&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==7||this.runningUpdateType!==7)&&await this._performUpdateNotify.await(),performance.now()-s>t){const o=`Chart.waitForUpdate() timeout of ${t} reached - first chart update taking too long.`;if(i)throw new Error(o);ue.warnOnce(o)}b2()&&await yY()}}filterMiniChartSeries(t){return t?.filter(i=>i.showInMiniChart!==!1)}applyOptions(t){const i=this.firstApply?t.processedOptions:t.diffOptions(this.chartOptions);if(i==null||Object.keys(i).length===0)return;const s=this.firstApply?{}:this.chartOptions.processedOptions,o=t.processedOptions;zn("Chart.applyOptions() - applying delta",i);const n=this.applyModules(o),r=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer"];i.listeners&&this.registerListeners(this,i.listeners),nf(this,i,{skip:r});let a=!1,l="no-op";i.series!=null&&(l=this.applySeries(this,i.series,s?.series),a=!0),l==="replaced"&&this.resetAnimations(),this.applyAxes(this,o,s,l,[])&&(a=!0),i.data&&(this.data=i.data),i.legend?.listeners&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,i.legend.listeners),i.locale?.localeText&&(this.modulesManager.getModule("locale").localeText=i.locale?.localeText),this.chartOptions=t;const c=this.modulesManager.getModule("navigator"),d=this.modulesManager.getModule("zoom");!c?.enabled&&!d?.enabled&&this.ctx.zoomManager.updateZoom("chart");const h=c?.miniChart,u=o.navigator?.miniChart?.series??o.series;h?.enabled===!0&&u!=null?this.applyMiniChartOptions(h,u,o,s):h?.enabled===!1&&(h.series=[],h.axes=[]),this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes),a||(a=this.shouldForceNodeDataRefresh(i,l));const g=a||n?0:3;this.maybeResetAnimations(l),this.shouldClearLegendData(o,s,l)&&this.ctx.legendManager.clearData(),this.applyInitialState(o),zn("Chart.applyOptions() - update type",rf[g],{seriesStatus:l,forceNodeDataRefresh:a}),this.update(g,{forceNodeDataRefresh:a,newAnimationBatch:!0}),this.firstApply=!1}applyInitialState(t){const{annotationManager:i,chartTypeOriginator:s,historyManager:o,stateManager:n,zoomManager:r}=this.ctx,{initialState:a}=t;if("annotations"in t&&t.annotations?.enabled&&a?.annotations!=null){const l=a.annotations.map(c=>{const d=i.getAnnotationTypeStyles(c.type);return _e(c,d)});n.setState(i,l)}a?.chartType!=null&&n.setState(s,a.chartType),(t.navigator?.enabled||t.zoom?.enabled)&&a?.zoom!=null&&n.setState(r,a.zoom),a?.legend!=null&&this.updateLegends(a.legend),a!=null&&o.clear()}maybeResetAnimations(t){if(this.mode==="standalone")switch(t){case"series-grouping-change":case"replaced":this.resetAnimations();break}}shouldForceNodeDataRefresh(t,i){const s=!!t.data||i==="data-change"||i==="replaced",o=XA.getKeys(),n=Object.values(o).some(a=>t[a]!=null),r=t.title!=null&&t.subtitle!=null;return s||n||r}shouldClearLegendData(t,i,s){const o=s==="replaced"||s==="series-grouping-change"||s==="updated",n=i.legend!=null&&t.legend==null;return o||n}applyMiniChartOptions(t,i,s,o){const n=o?.navigator?.miniChart?.series??o?.series,r=this.applySeries(t,this.filterMiniChartSeries(i),this.filterMiniChartSeries(n));this.applyAxes(t,s,o,r,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const a=t.series;for(const d of a)d.properties.id=void 0;const l=t.axes,c=l.find(d=>d.direction==="x");for(const d of l)d.nice=!1,d.gridLine.enabled=!1,d.label.enabled=d===c,d.tick.enabled=!1,d.interactionEnabled=!1;if(c!=null){const d=s.navigator?.miniChart,h=d?.label,u=d?.label?.interval;if(c.line.enabled=!1,c.label.set(T0(h,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),c.tick.set(T0(u,["enabled","width","size","color","interval","step"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:g}=c;if(g.length===0)g.set([{label:{enabled:!0}}]);else for(let f=1;f<g.length;f++)g[f].label.enabled=!1}const p=u?.step;p!=null&&(c.interval.step=p)}}applyModules(t){const{type:i}=this.constructor;let s=!1;for(const o of Yr.byType("root","legend")){const r=t[o.optionsKey]!=null&&o.chartTypes.includes(i);r!==this.modulesManager.isEnabled(o)&&(r?(this.modulesManager.addModule(o,a=>a.moduleFactory(this.getModuleContext())),o.type==="legend"&&this.modulesManager.getModule(o)?.attachLegend(this.ctx.scene),this[o.optionsKey]=this.modulesManager.getModule(o)):(this.modulesManager.removeModule(o),delete this[o.optionsKey]),s=!0)}return s}initSeriesDeclarationOrder(t){for(let i=0;i<t.length;i++)t[i].setSeriesIndex(i)}applySeries(t,i,s){if(!i)return"no-change";const o=wX(t.series,i,s);if(o.status==="no-overlap"){zn(`Chart.applySeries() - creating new series instances, status: ${o.status}`,o);const d=i.map(h=>this.createSeries(h));return this.initSeriesDeclarationOrder(d),t.series=d,"replaced"}zn("Chart.applySeries() - matchResult",o);const n=[];let r=!1,a=!1,l=!1;const c=o.changes.toSorted((d,h)=>d.targetIdx-h.targetIdx);for(const d of c)switch(a||(a=d.status==="series-grouping"),r||(r=d.diff?.data!=null),l||(l=d.status!=="no-op"),d.status){case"add":{const h=this.createSeries(d.opts);n.push(h),zn("Chart.applySeries() - created new series",h);break}case"remove":zn(`Chart.applySeries() - removing series at previous idx ${d.idx}`,d.series);break;case"no-op":n.push(d.series),zn(`Chart.applySeries() - no change to series at previous idx ${d.idx}`,d.series);break;case"series-grouping":case"update":default:{const{series:h,diff:u,idx:p}=d;zn(`Chart.applySeries() - applying series diff previous idx ${p}`,u,h),this.applySeriesValues(h,u),h.markNodeDataDirty(),n.push(h)}}return this.initSeriesDeclarationOrder(n),zn("Chart.applySeries() - final series instances",n),t.series=n,a?"series-grouping-change":r?"data-change":l?"updated":"no-op"}applyAxes(t,i,s,o,n=[]){if(!("axes"in i)||!i.axes)return!1;n=["axes[].type",...n];const{axes:r}=i;return!(o==="replaced")&&t.axes.length===r.length&&t.axes.every((c,d)=>c.type===r[d].type)&&QA(s)?(t.axes.forEach((c,d)=>{const h=s.axes?.[d]??{},u=sl(h,r[d]);zn(`Chart.applyAxes() - applying axis diff idx ${d}`,u);const p=`axes[${d}]`;nf(c,u,{path:p,skip:n})}),!0):(zn(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${o}`),t.axes=this.createAxis(r,n),!0)}createSeries(t){const i=ho.create(t.type,this.getModuleContext());return this.applySeriesOptionModules(i,t),this.applySeriesValues(i,t),i}applySeriesOptionModules(t,i){const s=t.createModuleContext(),o=t.getModuleMap();for(const n of Yr.byType("series-option"))n.optionsKey in i&&n.seriesTypes.includes(t.type)&&o.addModule(n,r=>r.moduleFactory(s))}applySeriesValues(t,i){const s=t.getModuleMap(),{type:o,data:n,listeners:r,seriesGrouping:a,showInMiniChart:l,...c}=i;for(const d of vp)if(d.type==="series-option"&&d.optionsKey in c){const h=s.getModule(d.optionsKey);if(h){const u=c[d.optionsKey];delete c[d.optionsKey],h.properties.set(u)}}t.properties.set(c),"data"in i&&t.setOptionsData(n),r&&this.registerListeners(t,r),"seriesGrouping"in i&&(a==null?t.seriesGrouping=void 0:t.seriesGrouping={...t.seriesGrouping,...a})}createAxis(t,i){const s=[],o=this.getModuleContext();for(let n=0;n<t.length;n++){const r=t[n],a=Ka.create(r.type,o);this.applyAxisModules(a,r),nf(a,r,{path:`axes[${n}]`,skip:i}),s.push(a)}return SX(s),s}applyAxisModules(t,i){const s=t.createModuleContext(),o=t.getModuleMap();for(const n of Yr.byType("axis-option")){const r=i[n.optionsKey]!=null;r!==o.isEnabled(n)&&(r?(o.addModule(n,a=>a.moduleFactory(s)),t[n.optionsKey]=o.getModule(n)):(o.removeModule(n),delete t[n.optionsKey]))}}registerListeners(t,i){t.clearEventListeners();for(const[s,o]of Object.entries(i))ph(o)&&t.addEventListener(s,o)}};li.chartsInstances=new WeakMap;D([wo({newValue(e){this.destroyed||(this.ctx.domManager.setContainer(e),li.chartsInstances.set(e,this))},oldValue(e){li.chartsInstances.delete(e)}})],li.prototype,"container",2);D([wo({newValue(e){this.resize("width option",{inWidth:e})}})],li.prototype,"width",2);D([wo({newValue(e){this.resize("height option",{inHeight:e})}})],li.prototype,"height",2);D([wo({newValue(e){this.resize("minWidth option",{inMinWidth:e})}})],li.prototype,"minWidth",2);D([wo({newValue(e){this.resize("minHeight option",{inMinHeight:e})}})],li.prototype,"minHeight",2);D([wo({newValue(e){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:e})}})],li.prototype,"overrideDevicePixelRatio",2);D([k(me)],li.prototype,"padding",2);D([k(me)],li.prototype,"seriesArea",2);D([k(me)],li.prototype,"keyboard",2);D([k(me)],li.prototype,"touch",2);D([k(Ct(["standalone","integrated"],"a chart mode"))],li.prototype,"mode",2);D([Rt("chartCaptions.title")],li.prototype,"title",2);D([Rt("chartCaptions.subtitle")],li.prototype,"subtitle",2);D([Rt("chartCaptions.footnote")],li.prototype,"footnote",2);D([k(xe)],li.prototype,"suppressFieldDotNotation",2);D([wo({changeValue(e,t){this.onAxisChange(e,t)}})],li.prototype,"axes",2);D([wo({changeValue(e,t){this.onSeriesChange(e,t)}})],li.prototype,"series",2);var mS=li,cZ={2:(e,t)=>Math.log2(t),[Math.E]:(e,t)=>Math.log(t),10:(e,t)=>Math.log10(t)},dZ=(e,t)=>Math.log(t)/Math.log(e);function Dw(e,t,i){const s=Math.min(...t),o=cZ[e]??dZ;return s>=0?o(e,i):-o(e,-i)}var hZ={[Math.E]:(e,t)=>Math.exp(t),10:(e,t)=>t>=0?10**t:1/10**-t},uZ=(e,t)=>e**t;function Aw(e,t,i){const s=Math.min(...t),o=hZ[e]??uZ;return s>=0?o(e,i):-o(e,-i)}var tI=class extends nt{constructor(e=[1,10],t=[0,1]){super(e,t),this.type="log",this.defaultClamp=!0,this.base=10,this.log=i=>Dw(this.base,this.domain,i),this.pow=i=>Aw(this.base,this.domain,i)}toDomain(e){return e}transform(e){const[t,i]=Ki(this.domain);return t>=0!=i>=0?NaN:t>=0?Math.log(e):-Math.log(-e)}transformInvert(e){const[t,i]=Ki(this.domain);return t>=0!=i>=0?NaN:t>=0?Math.exp(e):-Math.exp(-e)}niceDomain(e,t=this.domain){if(t.length<2)return[];const{base:i}=this,[s,o]=t,n=s>o?Math.ceil:Math.floor,r=s>o?Math.floor:Math.ceil,a=Aw(i,t,n(Dw(i,t,s))),l=Aw(i,t,r(Dw(i,t,o)));return[a,l]}ticks({interval:e,tickCount:t=nt.defaultTickCount},i=this.domain,s){if(!i||i.length<2||t<1)return[];const o=this.base,[n,r]=i,a=Math.min(n,r),l=Math.max(n,r);let c=this.log(a),d=this.log(l);if(e){const f=C=>C>=a&&C<=l,y=Math.min(Math.abs(e),Math.abs(d-c)),m=Rf(c,d,y).map(this.pow).filter(f);if(!kf(m.length,this.getPixelRange()))return m}if(!qB(o)||d-c>=t)return RA(c,d,Math.min(d-c,t)).map(this.pow);let h=[];const u=a>0;c=Math.floor(c)-1,d=Math.round(d)+1;const p=Zu(this.range)/t;let g=1/0;for(let f=c;f<=d;f++){const y=this.convert(this.pow(f+1));for(let m=1;m<o;m++){const C=u?m:o-m+1,b=this.pow(f)*C,S=this.convert(b),A=Math.abs(g-S),R=Math.abs(S-y),I=A>=p&&R>=p;b>=a&&b<=l&&(m===1||I||h.length===0)&&(h.push(b),g=S)}}return h=vG(h,u,s),h}tickFormatter({specifier:e}){return e!=null?$G(e):String}datumFormatter(e){return this.tickFormatter(e)}},pZ=class{constructor(e,t,i){this.root=new mZ(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(s,o)=>e.distanceSquared(s,o)};this.root.addElem(i)}find(e,t){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(e,t,i),i.best}},gZ=class{constructor(e,t,i,s){this.nw=e,this.ne=t,this.sw=i,this.se=s}addElem(e){this.nw.addElem(e),this.ne.addElem(e),this.sw.addElem(e),this.se.addElem(e)}find(e,t,i){this.nw.find(e,t,i),this.ne.find(e,t,i),this.sw.find(e,t,i),this.se.find(e,t,i)}},fZ=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=i??ve.NaN,this.elems=[],this.subdivisions=void 0}clear(e){this.elems.length=0,this.boundary=e,this.subdivisions=void 0}addElem(e){this.addCondition(e)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length<this.capacity?this.elems.push(e):this.subdivide(e):this.subdivisions.addElem(e))}find(e,t,i){this.findCondition(e,t,i)&&(this.subdivisions===void 0?this.findAction(e,t,i):this.subdivisions.find(e,t,i))}subdivide(e){this.subdivisions=this.makeSubdivisions();for(const t of this.elems)this.subdivisions.addElem(t);this.subdivisions.addElem(e),this.elems.length=0}makeSubdivisions(){const{x:e,y:t,width:i,height:s}=this.boundary,{capacity:o}=this,n=this.maxdepth-1,r=i/2,a=s/2,l=new ve(e,t,r,a),c=new ve(e+r,t,r,a),d=new ve(e,t+a,r,a),h=new ve(e+r,t+a,r,a);return new gZ(this.child(o,n,l),this.child(o,n,c),this.child(o,n,d),this.child(o,n,h))}},mZ=class S_ extends fZ{addCondition(t){const{x:i,y:s}=t.hitTester.midPoint;return this.boundary.containsPoint(i,s)}findCondition(t,i,s){const{best:o}=s;return o.distanceSquared!==0&&this.boundary.distanceSquared(t,i)<o.distanceSquared}findAction(t,i,s){const o=Hb(t,i,this.elems,s.best.distanceSquared);o.nearest!==void 0&&o.distanceSquared<s.best.distanceSquared&&(s.best=o)}child(t,i,s){return new S_(t,i,s)}},sr=class x_ extends nt{constructor(){super([0,1],[0,1]),this.type="number"}static getTickStep(t,i,s){const{interval:o,tickCount:n=nt.defaultTickCount,minTickCount:r,maxTickCount:a}=s;return o??If(t,i,n,r,a)}toDomain(t){return t}ticks({interval:t,tickCount:i=nt.defaultTickCount,minTickCount:s,maxTickCount:o},n=this.domain,r){if(!n||n.length<2||i<1||!n.every(isFinite))return[];const[a,l]=n;if(t){const c=Math.abs(t);if(!kf((l-a)/c,this.getPixelRange()))return Rf(a,l,c)}return RA(a,l,i,s,o,r)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{tickCount:s=nt.defaultTickCount}=t;let[o,n]=i;if(s===1)[o,n]=z5(o,n);else if(s>1){const r=o>n?Math.ceil:Math.floor,a=o>n?Math.floor:Math.ceil,l=4;for(let c=0;c<l;c++){const d=o,h=n,u=x_.getTickStep(o,n,t),[p,g]=i;if(o=r(p/u)*u,n=a(g/u)*u,o===d&&n===h)break}}return[o,n]}tickFormatter({ticks:t,fractionDigits:i,specifier:s}){return s!=null?QL(t,s):o=>il(o,i)}datumFormatter({ticks:t,fractionDigits:i,specifier:s}){return s!=null?QL(t,s):o=>il(o,i+1)}};function Cl(e){if(e.length===0)return null;let t=1/0,i=-1/0;for(const o of e){const n=o instanceof Date?o.getTime():o;typeof n=="number"&&(n<t&&(t=n),n>i&&(i=n))}const s=[t,i];return s.every(isFinite)?s:null}function iI(e,t,i){let s=!1;return e.length>2&&(e=Cl(e)??[NaN,NaN]),isNaN(t)||(s||(s=t>e[0]),e=[t,e[1]]),isNaN(i)||(s||(s=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{extent:e,clipped:s}}var Gc=class extends Im{constructor(t,i=new sr){super(t,i),this.min=NaN,this.max=NaN}normaliseDataDomain(t){const{min:i,max:s}=this,{extent:o,clipped:n}=iI(t,i,s);return{domain:o,clipped:n}}};Gc.className="NumberAxis";Gc.type="number";D([k(na(pp,wm("max"))),Oc(NaN)],Gc.prototype,"min",2);D([k(na(pp,Mm("min"))),Oc(NaN)],Gc.prototype,"max",2);var vh=class extends Im{constructor(e){super(e,new e2),this.min=void 0,this.max=void 0}normaliseDataDomain(e){let{min:t,max:i}=this,s=!1;return typeof t=="number"&&(t=new Date(t)),typeof i=="number"&&(i=new Date(i)),e.length>2&&(e=Cl(e)?.map(o=>new Date(o))??[]),t instanceof Date&&(s||(s=t>e[0]),e=[t,e[1]]),i instanceof Date&&(s||(s=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{domain:e,clipped:s}}};vh.className="TimeAxis";vh.type="time";D([k(na(uA,wm("max")),{optional:!0})],vh.prototype,"min",2);D([k(na(uA,Mm("min")),{optional:!0})],vh.prototype,"max",2);var sI=class extends fS{constructor(){super(...arguments),this.clipFocusBox=!0}getScaleInformation({xScale:e,yScale:t}){const i=nt.is(e),s=nt.is(t);return{isContinuousX:i,isContinuousY:s,xScaleType:e?.type,yScaleType:t?.type}}getModulePropertyDefinitions(){const e=this.axes.x?.scale,t=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:e,yScale:t}))).flat()}async requestDataModel(e,t,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:o}=await e.request(this.id,t??[],i);return this.dataModel=s,this.processedData=o,this.dispatch("data-processed",{dataModel:s,processedData:o}),{dataModel:s,processedData:o}}isProcessedDataAnimatable(){const e=this.processedData?.reduced?.animationValidation;if(!e)return!0;const{orderedKeys:t,uniqueKeys:i}=e;return t&&i}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(e){const t=this.getNodeData();if(t===void 0||t.length===0)return;const i=this.computeFocusDatumIndex(e,t);if(i===void 0)return;const{clipFocusBox:s}=this,o=t[i],n={...e,datumIndex:i},r=this.computeFocusBounds(n);if(r!==void 0)return{bounds:r,clipFocusBox:s,datum:o,datumIndex:i}}computeFocusDatumIndex(e,t){const i=a=>{const{missing:l=!1,enabled:c=!0,focusable:d=!0}=t[a];return!l&&c&&d},s=(a,l)=>{for(;a>=0&&!i(a);)a+=l;return a===-1?void 0:a},o=(a,l)=>{for(;a<t.length&&!i(a);)a+=l;return a===t.length?void 0:a};let n;const r=Pe(0,e.datumIndex,t.length-1);return e.datumIndexDelta<0?n=s(r,e.datumIndexDelta):e.datumIndexDelta>0?n=o(r,e.datumIndexDelta):n=o(r,1)??s(r,-1),n===void 0?e.datumIndexDelta===0?void 0:e.datumIndex-e.datumIndexDelta:n}},bl=class extends Ee{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};D([k(st,{optional:!0})],bl.prototype,"fill",2);D([k(rt,{optional:!0})],bl.prototype,"fillOpacity",2);D([k(st,{optional:!0})],bl.prototype,"stroke",2);D([k(pe,{optional:!0})],bl.prototype,"strokeWidth",2);D([k(rt,{optional:!0})],bl.prototype,"strokeOpacity",2);D([k(ra,{optional:!0})],bl.prototype,"lineDash",2);D([k(pe,{optional:!0})],bl.prototype,"lineDashOffset",2);var yS=class extends Ee{};D([k(pe,{optional:!0})],yS.prototype,"strokeWidth",2);D([k(rt,{optional:!0})],yS.prototype,"dimOpacity",2);D([k(xe,{optional:!0})],yS.prototype,"enabled",2);var w_=class extends Ee{constructor(){super(...arguments),this.color="black"}};D([k(st,{optional:!0})],w_.prototype,"color",2);var oI=class extends Ee{constructor(){super(...arguments),this.enabled=!0}};D([k(xe,{optional:!0})],oI.prototype,"enabled",2);var Lm=class extends Ee{constructor(){super(...arguments),this.item=new bl,this.series=new yS,this.text=new w_}};D([k(me)],Lm.prototype,"item",2);D([k(me)],Lm.prototype,"series",2);D([k(me)],Lm.prototype,"text",2);var Yo=class extends Ee{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new oI,this.highlightStyle=new Lm}};D([k(he,{optional:!0})],Yo.prototype,"id",2);D([k(xe)],Yo.prototype,"visible",2);D([k(xG,{optional:!0})],Yo.prototype,"focusPriority",2);D([k(xe)],Yo.prototype,"showInLegend",2);D([k(he)],Yo.prototype,"cursor",2);D([k(tS)],Yo.prototype,"nodeClickRange",2);D([k(me)],Yo.prototype,"highlight",2);D([k(me)],Yo.prototype,"highlightStyle",2);var Ch={x:["xKey"],y:["yKey"]},bh={x:["xName"],y:["yName"]},nI=class extends km{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},Sl=class extends Yo{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}};D([k(he,{optional:!0})],Sl.prototype,"legendItemName",2);D([k(xe,{optional:!0})],Sl.prototype,"pickOutsideVisibleMinorAxis",2);var ZC=100,_c=class extends sI{constructor({pathsPerSeries:e=["path"],hasMarkers:t=!1,hasHighlightedLabels:i=!1,pathsZIndexSubOrderOffset:s=[],datumSelectionGarbageCollection:o=!0,markerSelectionGarbageCollection:n=!0,animationAlwaysUpdateSelections:r=!1,animationResetFns:a,directionKeys:l,directionNames:c,...d}){if(super({directionKeys:l,directionNames:c,canHaveAxes:!0,...d}),this.NodeEvent=nI,this.dataNodeGroup=this.contentGroup.appendChild(new Me({name:`${this.id}-series-dataNodes`,zIndex:0})),this.markerGroup=this.contentGroup.appendChild(new Me({name:`${this.id}-series-markers`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new Zs({name:`${this.id}-series-labels`})),this.labelSelection=ai.select(this.labelGroup,Oi),this.highlightSelection=ai.select(this.highlightNode,()=>this.opts.hasMarkers?new Fi:this.nodeFactory()),this.highlightLabelSelection=ai.select(this.highlightLabel,Oi),this.annotationSelections=new Set,this.debug=yt.create(),!l||!c)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:e,hasMarkers:t,hasHighlightedLabels:i,pathsZIndexSubOrderOffset:s,directionKeys:l,directionNames:c,animationResetFns:a,animationAlwaysUpdateSelections:r,datumSelectionGarbageCollection:o,markerSelectionGarbageCollection:n},this.paths=e.map(h=>new eo({name:`${this.id}-${h}`})),this.datumSelection=ai.select(this.dataNodeGroup,()=>this.nodeFactory(),o),this.markerSelection=ai.select(this.markerGroup,Fi,n),this.animationState=new Am("empty",{empty:{update:{target:"ready",action:h=>this.animateEmptyUpdateReady(h)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:h=>this.animateReadyHighlight(h),highlightMarkers:h=>this.animateReadyHighlightMarkers(h),resize:h=>this.animateReadyResize(h),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:h=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(h):this.animateWaitingUpdateReady(h)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:h=>this.resetAllAnimation(h),reset:"empty"},clearing:{update:{target:"empty",action:h=>this.animateClearingUpdateEmpty(h)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),this.attachPaths(this.paths,t,i)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.detachPaths(this.paths,t,i)}attachPaths(e,t,i){for(const s of e)this.contentGroup.appendChild(s)}detachPaths(e,t,i){for(const s of e)this.contentGroup.removeChild(s)}renderToOffscreenCanvas(){const e=this.getNodeData();return e!=null&&e.length>ZC}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"?this.animationState.transition("skip"):e==="disabled"&&this.animationState.transition("disable")}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",e=>this.onLegendItemClick(e)),this.ctx.chartEventManager.addListener("legend-item-double-click",e=>this.onLegendItemDoubleClick(e)))}destroy(){super.destroy(),this._contextNodeData=void 0}update({seriesRect:e}){const{visible:t,_contextNodeData:i}=this,o=this.ctx.highlightManager?.getActiveHighlight()?.series===this,n=this.checkResize(e),r=this.updateHighlightSelection(o);this.updateSelections(t),this.updateNodes(r,o,t);const a=this.getAnimationData(e,i);a&&(n&&this.animationState.transition("resize",a),this.animationState.transition("update",a))}updateSelections(e){var t;const i=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!(!e&&i)&&!(!this.nodeDataRefresh&&!this.isPathOrSelectionDirty())){if(this.nodeDataRefresh){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const s=this.isProcessedDataAnimatable();this._contextNodeData&&((t=this._contextNodeData).animationValid??(t.animationValid=s));const{dataModel:o,processedData:n}=this;o!==void 0&&n!==void 0&&this.dispatch("data-update",{dataModel:o,processedData:n})}this.updateSeriesSelections()}}updateSeriesSelections(e){const{datumSelection:t,labelSelection:i,markerSelection:s,paths:o}=this,n=this._contextNodeData;if(!n)return;const{nodeData:r,labelData:a,itemId:l}=n;this.updatePaths({seriesHighlighted:e,itemId:l,contextData:n,paths:o}),this.datumSelection=this.updateDatumSelection({nodeData:r,datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:i})??i,this.opts.hasMarkers&&(this.markerSelection=this.updateMarkerSelection({nodeData:r,markerSelection:s}))}updateNodes(e,t,i){const{highlightSelection:s,highlightLabelSelection:o,opts:{hasMarkers:n,hasHighlightedLabels:r}}=this,a=!this.ctx.animationManager.isSkipped(),l=this.visible&&this._contextNodeData!=null&&i;this.contentGroup.visible=a||l,this.highlightGroup.visible=(a||l)&&t;const c=this.getOpacity();n?(this.updateMarkerNodes({markerSelection:s,isHighlight:!0}),this.animationState.transition("highlightMarkers",s)):(this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("highlight",s)),r&&this.updateLabelNodes({labelSelection:o});const{dataNodeGroup:d,markerGroup:h,datumSelection:u,labelSelection:p,markerSelection:g,paths:f,labelGroup:y}=this,{itemId:m}=this.contextNodeData??{};d.opacity=c,d.visible=a||l,y.visible=l,n&&(h.opacity=c,h.visible=l),y&&(y.opacity=c),this.updatePathNodes({seriesHighlighted:t,itemId:m,paths:f,opacity:c,visible:l,animationEnabled:a}),d.visible&&(this.updateDatumNodes({datumSelection:u,highlightedItems:e,isHighlight:!1}),this.usesPlacedLabels||this.updateLabelNodes({labelSelection:p}),n&&this.updateMarkerNodes({markerSelection:g,isHighlight:!1}))}getHighlightLabelData(e,t){const i=e.filter(s=>s.datum===t.datum&&s.itemId===t.itemId);return i.length===0?void 0:i}getHighlightData(e,t){return t?[t]:void 0}updateHighlightSelection(e){const{highlightSelection:t,highlightLabelSelection:i,_contextNodeData:s}=this;if(!s)return;const o=this.ctx.highlightManager?.getActiveHighlight(),n=e&&o?.datum?o:void 0;let r,a;if(n!=null){const l=this.isLabelEnabled(),{labelData:c,nodeData:d}=s;a=this.getHighlightData(d,n),r=l?this.getHighlightLabelData(c,n):void 0}return this.highlightSelection=this.updateHighlightSelectionItem({items:a,highlightSelection:t}),this.highlightLabelSelection=this.updateHighlightSelectionLabel({items:r,highlightLabelSelection:i}),a}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:e}of this.datumSelection)e.datum.missing!==!0&&(yield e)}getQuadTree(){if(this.quadtree===void 0){const{width:e,height:t}=this.ctx.scene.canvas,i=new ve(0,0,e,t);this.quadtree=new pZ(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickNodeExactShape(e){const t=super.pickNodeExactShape(e);if(t)return t;const{x:i,y:s}=e,{opts:{hasMarkers:o}}=this;let n;const{dataNodeGroup:r,markerGroup:a}=this;if(n=r.pickNode(i,s),!n&&o&&(n=a?.pickNode(i,s)),n&&n.datum.missing!==!0)return{datum:n.datum,distance:0};for(const l of this.moduleMap.modules()){const{datum:c}=l.pickNodeExact(e)??{};if(c!=null&&c?.missing!==!0)return{datum:c,distance:0}}}pickNodeClosestDatum(e){const{x:t,y:i}=e,{axes:s,_contextNodeData:o}=this;if(!o)return;const n=s.x,r=s.y,a={x:t,y:i};let l=1/0,c;for(const d of o.nodeData){const{point:{x:h=NaN,y:u=NaN}={}}=d;if(isNaN(h)||isNaN(u)||!(n?.inRange(h)&&r?.inRange(u)))continue;const g=Math.max((a.x-h)**2+(a.y-u)**2,0);g<l&&(l=g,c=d)}for(const d of this.moduleMap.modules()){const h=d.pickNodeNearest(e);if(h!==void 0&&h.distanceSquared<l){l=h.distanceSquared,c=h.datum;break}}if(c){const d=Math.max(Math.sqrt(l)-(c.point?.size??0),0);return{datum:c,distance:d}}}pickNodeMainAxisFirst(e,t){const{x:i,y:s}=e,{axes:o,_contextNodeData:n}=this,{pickOutsideVisibleMinorAxis:r}=this.properties;if(!n)return;const a=o.x,l=o.y,c=[a,l].filter(yp.is).map(g=>g.direction);if(t&&c.length===0)return;const[d="x"]=c,h=[i,s];d!=="x"&&h.reverse();const u=[1/0,1/0];let p;for(const g of n.nodeData){const{x:f=NaN,y=NaN}=g.point??g.midPoint??{};if(isNaN(f)||isNaN(y)||g.missing===!0)continue;const m=[a?.inRange(f),l?.inRange(y)];if(d!=="x"&&m.reverse(),!m[0]||!r&&!m[1])continue;const C=[f,y];d!=="x"&&C.reverse();let b=!0;for(let S=0;S<C.length;S++){const A=Math.abs(C[S]-h[S]);if(A>u[S]){b=!1;break}else A<u[S]&&(u[S]=A,u.fill(1/0,S+1,u.length))}b&&(p=g)}if(p){let g=Math.max(u[0]**2+u[1]**2-(p.point?.size??0),0);for(const f of this.moduleMap.modules()){const y=f.pickNodeMainAxisFirst(e);if(y!==void 0&&y.distanceSquared<g){p=y.datum,g=y.distanceSquared;break}}return{datum:p,distance:Math.sqrt(g)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}keysOrValues(e){const t=this.dataModel.resolveProcessedDataIndexById(this,e);return this.processedData?.keys[t]?.get(this.id)??this.processedData?.columns[t]??[]}visibleRange(e,t,i){const s=this.keysOrValues(e),o=0;return $2(i?.length??s.length,t,n=>{const r=i?.[n]??n;return this.xCoordinateRange(s[r],o,r)})}domainForVisibleRange(e,t,i,s,o,n){const{processedData:r,dataModel:a}=this,[l,c]=s,d=this.keysOrValues(i);if(o){const g=this.visibleRange(i,s,n);return a.getDomainBetweenRange(this,t,g,r)}const h=t.map(g=>this.keysOrValues(g));let u=1/0,p=-1/0;return d.forEach((g,f)=>{const[y,m]=this.xCoordinateRange(g,0,f);if(!(m<l||y>c))for(let C=0;C<t.length;C++){const b=h[C][f];u=Math.min(u,b),p=Math.max(p,b)}}),u>p?[NaN,NaN]:[u,p]}domainForClippedRange(e,t,i,s){const{processedData:o,dataModel:n,axes:r}=this,l=yZ(r[e==="x"?"y":"x"]);if(!l)return t.flatMap(g=>n.getDomain(this,g,"value",o));const c=this.keysOrValues(i);if(s){const g=vZ(c.length,l,f=>c[f]);return n.getDomainBetweenRange(this,t,g,o)}const d=t.map(g=>this.keysOrValues(g)),h=l[0].valueOf(),u=l[1].valueOf(),p=[];return c.forEach((g,f)=>{const y=g.valueOf();if(y<h||y>u)return;const m=d.map(C=>C[f]);y>=h&&p.push(...m),y<=u&&p.push(...m)}),p}countVisibleItems(e,t,i,s,o){const{dataModel:n,processedData:r}=this;if(!n||!r)return 1/0;const a=this.keysOrValues(e),l=t.map(A=>n.resolveColumnById(this,A,r)),c=this.axes.x,d=this.axes.y,h=this.shouldFlipXY(),u=c.range,p=d.range,g=(A,R,I)=>A[0]+(I-R[0])/(R[1]-R[0])*(A[1]-A[0]),f=g(u,c.visibleRange,i[0]),y=g(u,c.visibleRange,i[1]),m=g(p,d.visibleRange,h?s[0]:s[1]),C=g(p,d.visibleRange,h?s[1]:s[0]),b=Math.round((i[0]+(i[1]-i[0])/2)*a.length),S=0;return Y2(0,a.length-1,b,o,A=>{let[R,I]=this.xCoordinateRange(a[A],S,A),[w,M]=this.yCoordinateRange(l.map(T=>T[A]),S,A);return!Qe(R)||!Qe(I)||!Qe(w)||!Qe(M)?!1:(h&&([R,I,w,M]=[w,M,R,I]),R>=f&&I<=y&&w>=m&&M<=C)})}updateHighlightSelectionItem(e){const{opts:{hasMarkers:t}}=this,{items:i,highlightSelection:s}=e,o=i??[];if(t){const n=s;return this.updateMarkerSelection({nodeData:o,markerSelection:n})}else return this.updateDatumSelection({nodeData:o,datumSelection:s})}updateHighlightSelectionLabel(e){return this.updateLabelSelection({labelData:e.items??[],labelSelection:e.highlightLabelSelection})}updateDatumSelection(e){return e.datumSelection}updateDatumNodes(e){}updateMarkerSelection(e){return e.markerSelection}updateMarkerNodes(e){}updatePaths(e){e.paths.forEach(t=>t.visible=!1)}updatePathNodes(e){const{paths:t,opacity:i,visible:s}=e;for(const o of t)o.opacity=i,o.visible=s}resetPathAnimation(e){const{path:t}=this.opts?.animationResetFns??{};t&&e.paths.forEach(i=>{Wi([i],t)})}resetDatumAnimation(e){const{datum:t}=this.opts?.animationResetFns??{};t&&Wi([e.datumSelection],t)}resetLabelAnimation(e){const{label:t}=this.opts?.animationResetFns??{};t&&Wi([e.labelSelection],t)}resetMarkerAnimation(e){const{marker:t}=this.opts?.animationResetFns??{};t&&this.opts.hasMarkers&&Wi([e.markerSelection],t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(e),this.resetDatumAnimation(e),this.resetLabelAnimation(e),this.resetMarkerAnimation(e),e.contextData?.animationValid===!1&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){const{datum:t}=this.opts?.animationResetFns??{};t&&Wi([e],t)}animateReadyHighlightMarkers(e){const{marker:t}=this.opts?.animationResetFns??{};t&&Wi([e],t)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(e,t){const{_contextNodeData:i}=this;return i?{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:t,paths:this.paths,seriesRect:e}:void 0}updateLabelSelection(e){return e.labelSelection}getScaling(e){if(e instanceof tI){const{range:t,domain:i}=e;return{type:"log",convert:s=>e.convert(s),domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof nt){const{range:t,domain:i}=e;return{type:"continuous",domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof Cm){const{domain:t}=e;return{type:"category",domain:t,inset:e.inset,step:e.step}}}calculateScaling(){const e={};for(const t of Object.values(DA)){const i=this.axes[t];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(e[t]=s)}return e}};function yZ(e){let t,i;if(e instanceof Gc&&(Number.isFinite(e.min)||Number.isFinite(e.max))?(t=Number.isFinite(e.min)?e.min:void 0,i=Number.isFinite(e.max)?e.max:void 0):e instanceof vh&&(e.min!=null||e.max!=null)&&({min:t,max:i}=e),!(t==null&&i==null))return t??(t=-1/0),i??(i=1/0),[t,i]}function vZ(e,t,i){const s=t[0].valueOf(),o=t[1].valueOf(),n=jB(0,e-1,a=>{const l=i(a)?.valueOf();return!Number.isFinite(l)||l>=s});let r=WB(0,e-1,a=>{const l=i(a)?.valueOf();return!Number.isFinite(l)||l<=o});return n==null||r==null?[0,0]:(r=Math.min(r+1,e),[n,r])}var CZ=["top","right","bottom","left"],vS=class M_ extends mS{constructor(t,i){super(t,i),this.paired=!0,this.lastUpdateClipRect=void 0,this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}onAxisChange(t,i){super.onAxisChange(t,i),this.ctx!=null&&this.ctx.zoomManager.updateAxes(t)}destroySeries(t){super.destroySeries(t),this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}getChartType(){return"cartesian"}setRootClipRects(t){const{seriesRoot:i,annotationRoot:s}=this;i.setClipRect(t),s.setClipRect(t)}async processData(){await super.processData();for(const t of this.axes){const i=this.getSyncedDomain(t);i!=null&&t.setDomains(i)}this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}performLayout(t){const{seriesRoot:i,annotationRoot:s}=this,{clipSeries:o,seriesRect:n,visible:r}=this.updateAxes(t.layoutBox);this.seriesRoot.visible=r,this.seriesRect=n,this.animationRect=t.layoutBox;const{x:a,y:l}=n;if(t.width!==this.lastLayoutWidth||t.height!==this.lastLayoutHeight)for(const u of[i,s])u.translationX=Math.floor(a),u.translationY=Math.floor(l);else{const{translationX:u,translationY:p}=i;hl(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:u,translationY:p},{translationX:Math.floor(a),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=t.width,this.lastLayoutHeight=t.height;const c=n.clone().grow(this.seriesArea.padding),d=this.seriesArea.clip||o?c:void 0,{lastUpdateClipRect:h}=this;this.lastUpdateClipRect=d,this.ctx.animationManager.isActive()&&h!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:h,to:c,onUpdate:u=>this.setRootClipRects(u),onComplete:()=>this.setRootClipRects(d)}):this.setRootClipRects(d),this.ctx.layoutManager.emitLayoutComplete(t,{axes:this.axes.map(u=>u.getLayoutState()),series:{visible:r,rect:n,paddedRect:c},clipSeries:o})}updateAxes(t){const{clipSeries:i,seriesRect:s,overflows:o}=this.resolveAxesLayout(t);for(const n of this.axes)n.update(),n.setCrossLinesVisible(!o),this.clipAxis(n,s,t);return{clipSeries:i,seriesRect:s,visible:!o}}resolveAxesLayout(t){let i,s,o=0;const n=10;do if(s=i??this.getDefaultState(),i=this.updateAxesPass(new Map(s.axisAreaWidths),t.clone()),o++>n){ue.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(i,s));return this.lastAreaWidths=i.axisAreaWidths,i}updateAxesPass(t,i){const s=new Map,o={};let n=!1,r=!1;for(const m of CZ){const C=this.seriesArea.padding[m],b=this.axes.findLast(S=>S.position===m);b?b.seriesAreaPadding=C:i.shrink(C,m)}const a=(t.get("left")??0)+(t.get("right")??0),l=(t.get("top")??0)+(t.get("bottom")??0),c=this.buildCrossLinePadding(t);i.width<=a+c.hPadding||i.height<=l+c.vPadding?n=!0:i.shrink(c);const d=i.clone().shrink(Object.fromEntries(t));for(const m of this.axes){const{position:C="left",direction:b}=m;this.sizeAxis(m,d,C);const S=b==="y",{primaryTickCount:A,bbox:R}=m.calculateLayout(m.nice?o[b]:void 0);o[b]??(o[b]=A),r||(r=m.dataDomain.clipped||m.visibleRange[0]>0||m.visibleRange[1]<1),s.set(m.id,Math.ceil(m.thickness??(S?R?.width:R?.height)??0))}const h=Object.entries(sA(this.axes,m=>m.position??"left")),{width:u,height:p,pixelRatio:g}=this.ctx.scene,f=new Map,y=new Map;for(const[m,C]of h){let S=m==="left"||m==="right"?p%g:u%g,A=0;for(const R of C){y.set(R.id,S);const I=s.get(R.id)??0;A=Math.max(A,S+I),R.layoutConstraints.stacked&&(S+=I+M_.AxesPadding)}f.set(m,Math.ceil(A))}for(const[m,C]of h)this.positionAxes({axes:C,position:m,axisWidths:s,axisOffsets:y,axisAreaWidths:f,axisBound:i,seriesRect:d});return{clipSeries:r,seriesRect:d,axisAreaWidths:f,overflows:n}}buildCrossLinePadding(t){const i={top:0,right:0,bottom:0,left:0,hPadding:0,vPadding:0};this.axes.forEach(s=>{s.crossLines?.forEach(o=>{o.calculatePadding?.(i)})});for(const[s,o=0]of Object.entries(i))i[s]=Math.max(o-(t.get(s)??0),0);return i.hPadding=i.left+i.right,i.vPadding=i.top+i.bottom,i}clampToOutsideSeriesRect(t,i,s,o){const n=s==="x"?t.x:t.y,r=s==="x"?t.width:t.height;return o===1?Math.min(i,n+r):Math.max(i,n)}getSyncedDomain(t){const i=this.modulesManager.getModule("sync");if(!i?.enabled)return;const s=i.getSyncedDomain(t);if(s&&t.dataDomain.domain.length){let o;const{domain:n}=t.scale;if(nt.is(t.scale)){const[r,a]=Ki(s);o=r!==n[0]||a!==n[1]}else o=!Kr(s,n);o&&!this.skipSync&&i.updateSiblings()}return s}sizeAxis(t,i,s){const o=t instanceof yp,n=s==="left"||s==="right",{width:r,height:a}=i,l=n?a:r;let c=0,d=l,{min:h,max:u}=this.ctx.zoomManager.getAxisZoom(t.id);const{width:p,unit:g,align:f}=t.layoutConstraints;g==="px"?d=c+p:d=d*p/100,f==="end"&&(c=l-(d-c),d=l),n&&(o?[h,u]=[1-u,1-h]:[c,d]=[d,c]),t.range=[c,d],t.visibleRange=[h,u],t.gridLength=n?r:a}positionAxes(t){const{axes:i,axisBound:s,axisWidths:o,axisOffsets:n,axisAreaWidths:r,seriesRect:a,position:l}=t,c=r.get(l)??0;let d="x",h="y",u=1;(l==="top"||l==="bottom")&&(d="y",h="x");let p=s[d];(l==="right"||l==="bottom")&&(u=-1,p+=d==="x"?s.width:s.height);for(const g of i){const f=r.get(h==="x"?"left":"top")??0,y=o.get(g.id)??0,m=n.get(g.id)??0;g.gridPadding=c-m-y,g.translation[h]=s[h]+f,g.translation[d]=this.clampToOutsideSeriesRect(a,p+u*(m+y),d,u)}}shouldFlipXY(){return this.series.every(t=>t instanceof _c&&t.shouldFlipXY())}getDefaultState(){const t=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const s=this.lastAreaWidths.get(i);s!=null&&t.set(i,s)}return{axisAreaWidths:t,clipSeries:!1,overflows:!1}}isLayoutStable(t,i){if(i.overflows!==t.overflows||i.clipSeries!==t.clipSeries)return!1;for(const s of t.axisAreaWidths.keys())if(!i.axisAreaWidths.has(s))return!1;for(const[s,o]of i.axisAreaWidths.entries()){const n=t.axisAreaWidths.get(s);if((o!=null||n!=null)&&o!==n)return!1}return!0}clipAxis(t,i,s){const o=Math.ceil(t.gridLine?.width??0),n=Math.ceil(t.line?.width??0);let{width:r,height:a}=i;switch(r+=t.direction==="x"?o:n,a+=t.direction==="y"?o:n,t.clipGrid(i.x,i.y,r,a),t.position){case"left":case"right":t.clipTickLines(s.x,i.y-o,s.width+o,i.height+o*2);break;case"top":case"bottom":t.clipTickLines(i.x-o,s.y,i.width+o*2,s.height+o);const{label:l,labelNodes:c,scale:d}=t;if(nt.is(d)&&l.enabled&&l.avoidCollisions&&c.length>1){const h=c.toSorted((f,y)=>f.translationY-y.translationY),u=h.at(-1),p=u.getBBox(),g=i.x+p.y+p.height<=s.x+s.width+this.padding.right;if(u.visible=g,g||t.visibleRange[0]>0||t.visibleRange[1]<1)h[0].visible=!0;else{const f=h[0].getBBox();h[0].visible=f.y>=0}}break}}};vS.className="CartesianChart";vS.type="cartesian";vS.AxesPadding=15;var bZ=vS,SZ={type:"chart",name:"cartesian",detect:QA,create(e,t){return new bZ(e,t)}},VE=yt.create(!0,"opts"),af=class{constructor(t,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=t}async update(t){return VE.group("AgChartInstance.update()",async()=>{this.factoryApi.update(t,this),await this.chart.waitForUpdate()})}async updateDelta(t){return VE.group("AgChartInstance.updateDelta()",async()=>{this.factoryApi.updateUserDelta(this,t),await this.chart.waitForUpdate()})}getOptions(){const t=Mi(this.chart.getOptions());for(const i of Object.keys(t))i.startsWith("_")&&delete t[i];return t}waitForUpdate(){return this.chart.waitForUpdate()}async download(t){const i=await this.prepareResizedChart(this,t);try{i.chart.download(t?.fileName,t?.fileFormat)}finally{i.destroy()}}async __toSVG(t){const i=await this.prepareResizedChart(this,{width:600,height:300,...t});try{return i.chart.toSVG()}finally{i.destroy()}}async getImageDataURL(t){const i=await this.prepareResizedChart(this,t);try{return i.chart.getCanvasDataURL(t?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(t){const i=this.getEnabledOriginators();if(!i.includes(this.chart.ctx.legendManager)){await this.setStateOriginators(t,i);return}await this.setStateOriginators(t,i.filter(s=>s!==this.chart.ctx.zoomManager)),await this.setStateOriginators(t,[this.chart.ctx.zoomManager])}resetAnimations(){this.chart.resetAnimations()}skipAnimations(){this.chart.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=null}async prepareResizedChart(t,i={}){const{chart:s}=t,o=i.width??s.width??s.ctx.scene.canvas.width,n=i.height??s.height??s.ctx.scene.canvas.height,r=t.getState(),a=Yr.hasEnterpriseModules(),l={...s.chartOptions.processedOverrides,container:document.createElement("div"),width:o,height:n};i.width!=null&&i.height!=null&&(l.overrideDevicePixelRatio=1);const c=s.getOptions();a&&(l.animation={enabled:!1},this.licenseManager?.isDisplayWatermark()&&(l.foreground={text:this.licenseManager.getWatermarkMessage(),image:{url:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",width:170,height:25,right:25,bottom:50,opacity:.7}}));const d={...s.chartOptions.specialOverrides},h={...s.chartOptions.optionMetadata},u=this.factoryApi.create(c,l,d,h);await u.setState(r),u.chart.ctx.zoomManager.updateZoom("chartProxy",s.ctx.zoomManager.getZoom()),u.chart.ctx.legendManager.clearData(),u.chart.ctx.legendManager.update(s.ctx.legendManager.getData()),s.series.forEach((g,f)=>{g.visible||(u.chart.series[f].visible=!1)});const p=[];for(const g of s.modulesManager.legends())p.push(g.legend.pagination?.currentPage??0);for(const g of u.chart.modulesManager.legends()){const f=p.shift()??0;g.legend.pagination&&g.legend.pagination.setPage(f)}return u.chart.update(0,{forceNodeDataRefresh:!0}),await u.waitForUpdate(),u}getEnabledOriginators(){const{chartOptions:{processedOptions:t,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:o,zoomManager:n,legendManager:r}}=this.chart,a=[];return"annotations"in t&&t.annotations?.enabled&&a.push(s),i.presetType==="price-volume"&&a.push(o),(t.navigator?.enabled||t.zoom?.enabled)&&a.push(n),"legend"in this.chart&&a.push(r),a}async setStateOriginators(t,i){this.factoryApi.caretaker.restore(t,...i),this.chart.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await this.chart.waitForUpdate()}};af.chartInstances=new WeakMap;D([wo({oldValue(e){e.destroyed||(e.publicApi=void 0),af.chartInstances.delete(e)},newValue(e){e&&(e.publicApi=this,af.chartInstances.set(e,this))}})],af.prototype,"chart",2);var HE=af,rI=class extends aS{constructor(e){super(),this.ctx=e,this.localeText=void 0}};D([Nc(e=>{e.ctx.localeManager.setLocaleText(e.localeText)}),k(SG,{optional:!0})],rI.prototype,"localeText",2);D([Nc(e=>{e.ctx.localeManager.setLocaleTextFormatter(e.getLocaleText)}),k(Qs,{optional:!0})],rI.prototype,"getLocaleText",2);var xZ={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new rI(e)},WE=class extends bm{getIndex(e){return super.getIndex(e)??this.getMatchIndex(e)}getMatchIndex(e){const t=JSON.stringify(e),i=this._domain.find(s=>JSON.stringify(s)===t);if(i!=null)return super.getIndex(i)}},vg=new WeakMap;function qC(e,t){const i=JSON.stringify(e,null,0);return vg.has(t)||vg.set(t,new Map),vg.get(t)?.has(i)||vg.get(t)?.set(i,t(e)),vg.get(t)?.get(i)}function $s(e){const t=new Map,i=(...n)=>n.map(r=>typeof r=="object"||typeof r=="symbol"?r:(t.has(r)||t.set(r,{v:r}),t.get(r))),s={},o=new WeakMap;return(...n)=>{const r=n.length===0?[s]:i(...n);let a=o;for(const d of r.slice(0,-1))a.has(d)||a.set(d,new WeakMap),a=a.get(d);const l=r.at(-1);let c=a.get(l);return c||(c=e(...n),a.set(l,c)),c}}function CS(e,t=[0,0]){for(const i of e)typeof i=="number"&&(i<0&&(t[0]+=i),i>0&&(t[1]+=i));return t}function wZ(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:s=>CS(s)}}function D_(e,t){return{id:e,type:"aggregate",matchGroupIds:t?[t]:void 0,aggregateFunction:i=>CS(i),groupAggregateFunction:(i,s=[0,0])=>(s[0]+=i?.[0]??0,s[1]+=i?.[1]??0,s),round:!0}}function MZ(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:s=>Zl.extendDomain(s)}}function X0(e){return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(t,i=[0,0])=>(i[0]+=t?.[0]??0,i[1]+=t?.[1]??0,i)}}function A_(e,t){return{id:e,matchGroupIds:t?[t]:void 0,type:"aggregate",aggregateFunction:s=>CS(s),groupAggregateFunction:(s,o=[0,0,-1])=>(o[0]+=s?.[0]??0,o[1]+=s?.[1]??0,o[2]++,o),finalFunction:(s=[0,0,0])=>{const o=s[0]+s[1];return o>=0?[0,o/s[2]]:[o/s[2],0]},round:!0}}function Z0(e,t,i){const s={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(o,n=[])=>{const r=n[1]-n[0];return t.aggregateFunction(o).map(a=>a/r)},round:!0};return t.groupAggregateFunction&&(s.groupAggregateFunction=t.groupAggregateFunction),s}function I_(e){return()=>{let t=0;return i=>Qe(i)?(t+=e?Math.max(0,i):i,t):i}}function R_(){return()=>{let e=0;return t=>{if(!Qe(t))return t;const i=e;return e+=t,i}}}function k_(e){return e!=null&&oS(e)}function DZ(e){return e!=null}function T_(e){switch(e){case"number":case"log":case"ordinal-time":case"time":case"color":return k_;default:return DZ}}function L_(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function or(e,t,i={}){return{property:e,type:"key",valueType:L_(t),validation:T_(t),...i}}function ze(e,t,i={}){return{property:e,type:"value",valueType:L_(t),validation:T_(t),...i}}function E_(e,t={}){return{property:e,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...t}}function aI(e,t={}){const{min:i=-1/0,max:s=1/0,...o}=t;return{type:"value",property:e,valueType:"range",validation:k_,processor:()=>n=>Qe(n)?Pe(i,n,s):n,...o}}function Lf(e,t,i={}){const{onlyPositive:s,...o}=i;return{...ze(e,t,o),processor:I_(s)}}function AZ(e,t,i={}){return{...ze(e,t,i),processor:R_()}}function Sc(e,t,i,s,o){return[ze(e,o,s),B_(s.groupId,t,i,s.separateNegative),...s.rangeId!=null?[MZ(s.rangeId,s.groupId)]:[]]}function P_(e,t,i){return[ze(e,t,i),G_(i.groupId)]}var N_={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let e=NaN;return(t=1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),o=Math.abs(s-e);return e=s,!isNaN(o)&&o>0&&o<t?o:t}}},O_={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer:()=>{let e=NaN;return(t=-1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),o=Math.abs(s-e);return e=s,!isNaN(o)&&o>0&&o>t?o:t}}},F_={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:e}})=>e?.slice().sort((t,i)=>{for(let s=0;s<t.length;s++){const o=t[s]-i[s];if(o!==0)return o}return 0})};function IZ({normaliseTo:e}){const t=(i,s)=>{if(s===0)return null;const o=(i??0)*e/s;return o>=0?Math.min(e,o):Math.max(-e,o)};return()=>()=>(i,s,o)=>{const n=RZ(i,s,o);for(const r of s)for(const a of o.datumIndices[r]){const l=i[r],c=l[a];if(c==null){l[a]=void 0;continue}l[a]=typeof c=="number"?t(c,n):c.map(d=>t(d,n))}}}function RZ(e,t,i){const s=[0,0];for(const o of t){const n=e[o];for(const r of i.datumIndices[o]){const a=n[r];if(a==null)continue;const l=typeof a=="number"?a:Math.max(...a.map(d=>d??0)),c=l<0?0:1;c===0?s[c]=Math.min(s[c],l):s[c]=Math.max(s[c],l)}}return Math.max(Math.abs(s[0]),s[1])}function bS(e,t){return{type:"group-value-processor",matchGroupIds:e,adjust:qC({normaliseTo:t},IZ)}}function kZ({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:s}){const o=e[1]-e[0],n=(r,a,l)=>{const c=e[0]+(r-a)/l*o;return l===0?t:c>=e[1]?e[1]:c<e[0]?e[0]:c};return()=>(r,a)=>{let[l,c]=r.domain.values[a];i!=null&&(l=i),s!=null&&(c=s);const d=c-l;r.domain.values[a]=[e[0],e[1]];const h=r.columns[a];for(let u=0;u<h.length;u+=1)h[u]=n(h[u],l,d)}}function $d(e,t,i,s,o){return{type:"property-value-processor",property:e,adjust:qC({normaliseTo:t,rangeMin:s,rangeMax:o,zeroDomain:i},kZ)}}var q0=1,Q0=2,jE=(e,t,i,s)=>{let o=q0|Q0;if(t.valueType==="category")return i.length!==e&&(o&=-2),o;let n=s[0]?.valueOf();for(let r=1;o!==0&&r<s.length;r++){const a=s[r]?.valueOf();(!Number.isFinite(a)||n>a)&&(o&=-3),Number.isFinite(a)&&n===a&&(o&=-2),n=a}return o};function Sp(e){return{type:"processor",property:"animationValidation",calculate(t){const{keys:i,values:s}=t.defs,{input:{count:o},domain:{keys:n,values:r},keys:a,columns:l}=t;let c=q0|Q0;if(o!==0){for(let d=0;c!==0&&d<i.length;d++)for(const h of i[d].scopes)c&=jE(o,i[d],n[d],a[d].get(h));for(let d=0;c!==0&&d<s.length;d++){const h=s[d];e?.includes(h.id)&&(c&=jE(o,h,r[d],l[d]))}}return{uniqueKeys:(c&q0)!==0,orderedKeys:(c&Q0)!==0}}}}function TZ({mode:e,separateNegative:t}){return()=>()=>(i,s,o)=>{const n=[0,0];for(const r of s)for(const a of o.datumIndices[r]??[]){const l=i[r],c=l[a],d=Wb(c)&&t?0:1;Qe(c)&&(e==="normal"&&(n[d]+=c),l[a]=n[d],e==="trailing"&&(n[d]+=c))}}}function LZ({mode:e,sum:t}){return()=>{const i=[];let s=!0;return()=>(o,n,r)=>{let a=0;for(const l of n){const c=o[l];for(const d of r.datumIndices[l]??[]){const h=c[d],u=s&&t==="current"?0:i[l];i[l]=h;const p=t==="current"?h:u;if(!Qe(h)||!Qe(u)){c[d]=a;continue}e==="normal"&&(a+=p),c[d]=a,e==="trailing"&&(a+=p)}}s=!1}}}function B_(e,t,i,s=!1){let o;if(t.startsWith("window")){const n=t.endsWith("-trailing")?"trailing":"normal";o=qC({mode:n,sum:i},LZ)}else o=qC({mode:t,separateNegative:s},TZ);return{type:"group-value-processor",matchGroupIds:[e],adjust:o}}function EZ(){return()=>(e,t,i)=>{const s=new Float64Array(t.length);let o=0;for(const n of t){const r=e[n];for(const a of i.datumIndices[n]??[]){const l=r[a];s[o]=Number.isFinite(l)?l:NaN,o+=1,r[a]=s.subarray(0,o)}}}}function G_(e){return{type:"group-value-processor",matchGroupIds:[e],adjust:EZ}}function UE(e){return e.id??e.property}function PZ(e,t,i){const s=new Map,o=t.defs.values;for(let a=0;a<o.length;a+=1){const l=o[a];if(l.scopes?.includes(e)===!1)continue;const c=UE(l);if(s.has(c))return;s.set(c,a)}const n=[],r=i.defs.values;for(let a=0;a<r.length;a+=1){const l=r[a];if(l.scopes?.includes(e)===!1)continue;const c=UE(l),d=s.get(c);if(d==null)return;s.delete(c),n.push({previousIndex:d,nextIndex:a})}if(s.size===0)return n}function Iw(e,t,i,s,o){for(const{previousIndex:n,nextIndex:r}of i){const a=e[n],l=t[r],c=a[s],d=l[o];if(c!==d)return!1}return!0}function xp(e,t,i=!0){return{type:"processor",property:"diff",calculate(s,o){const n=new Map,r=new Map,a=new Map,l=new Map,c=t.keys,d=s.keys,h=t.columns,u=s.columns,p=PZ(e,t,s);if(p==null)return o;const g=Math.max(t.input.count,s.input.count);for(let m=0;m<g;m++){const C=m<t.input.count,b=m<s.input.count,S=C?KC(c,e,m):void 0,A=S!=null?ci(S):"",R=b?KC(d,e,m):void 0,I=R!=null?ci(R):"";if(b&&C&&A===I){Iw(h,u,p,m,m)||a.set(I,m);continue}const w=l.get(I);w!=null?((i||!Iw(h,u,p,w,m))&&(a.set(I,m),n.set(I,m)),l.delete(I)):b&&r.set(I,m);const M=r.get(A);M!=null?((i||!Iw(h,u,p,M,m))&&(a.set(A,m),n.set(A,m)),r.delete(A)):C&&(a.delete(A),l.set(A,m))}const y={changed:r.size>0||a.size>0||l.size>0,added:new Set(r.keys()),updated:new Set(a.keys()),removed:new Set(l.keys()),moved:new Set(n.keys())};return{...o,[e]:y}}}}function ci(e,...t){let i;return Mt(e)?i=e.map(o=>B0(o)).join("___"):i=B0(e),(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i instanceof Date)&&t.length>0&&(i+=`___${t.join("___")}`),i}var NZ=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(e,t){e>this.right&&(this.right=e),e<this.left&&(this.left=e),t>this.bottom&&(this.bottom=t),t<this.top&&(this.top=t)}},OZ=class __{constructor(t="",i,s){this.label=t,this.parent=i,this.refId=s,this.x=0,this.y=0,this.subtreeLeft=NaN,this.subtreeRight=NaN,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.index=0,this.screenX=0,this.depth=i?i.depth+1:0}insertTick(t,i){let s=this;for(let o=0;o<t.length;o++){const n=t[o],r=o!==t.length-1,{children:a}=s,l=a.find(c=>c.label===n);if(l&&r)s=l;else{const c=new __(n,s,i);c.index=a.length,a.push(c),r&&(s=c)}}}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((t,i)=>i!==this.index)??[]}};function FZ(e){const t=e.reduce((s,o)=>s<o.length?o.length:s,0),i=new OZ;for(let s=0;s<e.length;s++){const o=e[s];for(;o.length<t;)o.push("");i.insertTick(o,s)}return i}function BZ(e,t,i){const s=t.index-e.index,o=i/s;t.change-=o,t.shift+=i,e.change+=o,t.prelim+=i,t.mod+=i}function GZ(e,t,i){return t.getSiblings().indexOf(e.ancestor)>=0?e.ancestor:i}function _Z({children:e}){let t=0,i=0;for(let s=e.length-1;s>=0;s--){const o=e[s];o.prelim+=t,o.mod+=t,i+=o.change,t+=o.shift+i}}function zZ(e,t){const i=e.getLeftSibling();if(i){let s=e,o=e,n=i,r=o.getLeftmostSibling(),a=o.mod,l=s.mod,c=n.mod,d=r.mod;for(;n.nextRight()&&o.nextLeft();){n=n.nextRight(),o=o.nextLeft(),r=r.nextLeft(),s=s.nextRight(),s.ancestor=e;const h=n.prelim+c-(o.prelim+a)+1;h>0&&(BZ(GZ(n,e,t),e,h),a+=h,l+=h),c+=n.mod,a+=o.mod,d+=r.mod,l+=s.mod}n.nextRight()&&!s.nextRight()?s.mod+=c-l:(o.nextLeft()&&!r.nextLeft()&&(r.mod+=a-d),t=e)}return t}function z_(e){const{children:t}=e;if(t.length){let[i]=t;for(const n of t)z_(n),i=zZ(n,i);_Z(e);const s=(t[0].prelim+t.at(-1).prelim)/2,o=e.getLeftSibling();o?(e.prelim=o.prelim+1,e.mod=e.prelim-s):e.prelim=s}else{const i=e.getLeftSibling();e.prelim=i?i.prelim+1:0}}function V_(e,t,i){e.x=e.prelim+t,e.y=e.depth,i.insertNode(e);for(const s of e.children)V_(s,t+e.mod,i)}function H_(e){const{children:t}=e;let i=0;for(const s of t)H_(s),s.children.length?i+=s.leafCount:i++;e.leafCount=i,t.length?(e.subtreeLeft=t[0].subtreeLeft,e.subtreeRight=t[t.length-1].subtreeRight,e.x=(e.subtreeLeft+e.subtreeRight)/2):(e.subtreeLeft=e.x,e.subtreeRight=e.x)}function VZ(e){const t=new HZ,i=FZ(e);return z_(i),V_(i,-i.prelim,t),H_(i),t}var HZ=class{constructor(){this.dimensions=new NZ,this.nodes=[],this.depth=0}insertNode(e){this.depth<e.depth&&(this.depth=e.depth),this.dimensions.update(e.x,e.y),this.nodes.push(e)}scalingX(e,t){let i=1;if(e>0){const{left:s,right:o}=this.dimensions;i=e/(o-s)}return t&&(i*=-1),i}},xl=class extends Ee{constructor(){super(...arguments),this.enabled=!0}};D([k(xe)],xl.prototype,"enabled",2);D([k(xe,{optional:!0})],xl.prototype,"avoidCollisions",2);D([k(st,{optional:!0})],xl.prototype,"color",2);D([k(pe,{optional:!0})],xl.prototype,"spacing",2);D([k(pl,{optional:!0})],xl.prototype,"fontStyle",2);D([k(gl,{optional:!0})],xl.prototype,"fontWeight",2);D([k(Ye.restrict({min:1}),{optional:!0})],xl.prototype,"fontSize",2);D([k(he,{optional:!0})],xl.prototype,"fontFamily",2);var SS=class extends Ee{constructor(){super(...arguments),this.enabled=!0}};D([k(xe)],SS.prototype,"enabled",2);D([k(pe,{optional:!0})],SS.prototype,"width",2);D([k(st,{optional:!0})],SS.prototype,"stroke",2);var lI=class extends Ee{constructor(){super(...arguments),this.label=new xl,this.tick=new SS}};D([k(me)],lI.prototype,"label",2);D([k(me)],lI.prototype,"tick",2);var wp=class extends yp{constructor(e){super(e,new WE),this.tickScale=new WE,this.depthOptions=new Sm(lI),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:e}=this.tickTreeLayout,{range:t,step:i,inset:s,bandwidth:o}=this.scale,n=Math.abs(t[1]-t[0])-i,r=this.tickTreeLayout.scalingX(n,t[0]>t[1]),a=s+o/2;let l=0;for(const c of e){const d=c.x*r;l>d&&(l=d),c.screenX=d+a}for(const c of e)c.screenX-=l}getDepthOptionsMap(e){const t=[],{depthOptions:i,label:s}=this;for(let o=0;o<e;o++)t.push(i[o]?.label.enabled??s.enabled?{enabled:!0,spacing:i[o]?.label.spacing??s.spacing,lineHeight:Ft.getLineHeight(i[o]?.label.fontSize??s.fontSize??10),avoidCollisions:i[o]?.label.avoidCollisions??s.avoidCollisions}:{enabled:!1,spacing:0,lineHeight:0,avoidCollisions:!1});return t}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((e,t)=>e.setProperties(t))}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){if(this.updateDirection(),this.updateScale(),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:ve.zero,separatorLayout:[],tickLabelLayout:[]};const{step:e}=this.scale,{title:t,label:i,range:s,depthOptions:o}=this,{depth:n,nodes:r}=this.tickTreeLayout,a=Math.ceil(i.fontSize/e),l=Ai(this.rotation),c=this.position==="top"||this.position==="bottom",d=i.getSideFlag(),h=[],u=new Map,p=new Ju,{defaultRotation:g,configuredRotation:f}=_C({rotation:i.rotation,parallel:i.parallel,regularFlipRotation:St(l-Math.PI/2),parallelFlipRotation:St(l)}),y=g+f,m=this.getDepthOptionsMap(n),C=(_,W)=>{const z=n-_.depth;if(!m[z]?.enabled||W%a!==0||!ZB(_.screenX,s))return!1;const U=this.formatTick(_.label,W-1),G=this.getLabelStyles({value:U,depth:z},o[z]?.label);return p.setProperties({...G,text:U,textAlign:"center",textBaseline:i.parallel?"hanging":"bottom",rotation:0,translationX:0,translationY:_.screenX}),!0};let b=0;const S={};r.forEach((_,W)=>{const z=n-_.depth,U=PK(_.label);if(S[z]??(S[z]=1),S[z]<U&&(S[z]=U),!(!C(_,W)||!p.getBBox())&&(u.set(W,p.getBBox()),!_.leafCount)){p.rotation=y;const{width:V}=p.getBBox();b<V&&(b=V)}});const A=NA(),R=d*m[0].spacing,I=new Map,w=_=>{let W=b;for(let z=1;z<=_;z++)W+=m[z].spacing,(i.mirrored||z!==_)&&(W+=S[z]*m[z].lineHeight);return W};r.forEach((_,W)=>{if(W===0)return;const z=C(_,W),U=!_.children.length,G=n-_.depth;if(_.parent){const O=U?_.x:_.x-(_.leafCount-1)/2;if(!I.has(O)){const H=this.depthOptions[G]?.tick;let B=b;for(let Y=0;Y<=G;Y++)B+=m[Y].spacing,Y!==0&&(B+=S[Y]*m[Y].lineHeight);I.set(O,{tickSize:B,tickStroke:H?.stroke,tickWidth:H?.enabled!==!1?H?.width:0})}}if(!z)return;if(p.x=R,p.y=0,U){const{width:O}=u.get(W),H=NG(y);p.rotation=y,p.textAlign="end",p.textBaseline="middle",p.rotationCenterX=R-O/2,p.translationX=(m[G].spacing-O)/2*H*d,i.mirrored&&(p.translationX+=O)}else p.rotation=c?g:-Math.PI/2,p.rotationCenterX=R,p.translationX=d*w(G);if(m[G].avoidCollisions){const O=U?e:_.leafCount*e;if(p.getBBox().height>O){u.delete(W);return}}const{text:V=""}=p;h.push({text:V,visible:!0,range:this.scale.range,tickId:A(V),fill:p.fill,fontFamily:p.fontFamily,fontSize:p.fontSize,fontStyle:p.fontStyle,fontWeight:p.fontWeight,rotation:p.rotation,rotationCenterX:p.rotationCenterX,textAlign:p.textAlign,textBaseline:p.textBaseline,translationX:p.translationX,translationY:p.translationY,x:p.x,y:p.y}),u.set(W,$t.toCanvas(p))});const{enabled:M,stroke:T,width:E}=this.line;this.lineNode.datum={x:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:T,strokeWidth:M?E:0});const P=[...I.values()];P.push(P[0]);const N=[this.lineNode.getBBox(),new ve(0,0,P[0].tickSize*d,0)];t.enabled&&(this.updateTitle(!1,P[0].tickSize),N.push(t.caption.node.getBBox()));const F=ve.merge(Gd(u.values(),N));return{bbox:this.getTransformBox(F),separatorLayout:P,tickLabelLayout:h}}update(){if(!this.computedLayout)return;const{tickScale:e,gridLine:t,gridLength:i}=this,{separatorLayout:s}=this.computedLayout,o=e.ticks({nice:!1,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0}).map((n,r)=>({...s[r],tick:n,tickId:ci(n,r),tickLabel:n.filter(Boolean).join(" - "),translationY:Math.round(e.convert(n))}));this.gridLineGroupSelection.update(t.enabled&&i?o:[]),this.tickLineGroupSelection.update(this.tick.enabled?o:[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateTickLines(),this.updateTitle(),this.resetSelectionNodes()}calculateLayout(){const{separatorLayout:e,tickLabelLayout:t,bbox:i}=this.computeLayout();return this.computedLayout={separatorLayout:e,tickLabelLayout:t},{bbox:i,primaryTickCount:void 0,niceDomain:this.scale.domain}}onGridVisibilityChange(){this.gridLineGroupSelection.clear(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:e}=this,t=this.boundSeries.filter(o=>o.visible).flatMap(o=>o.getDomain(e));this.dataDomain={domain:Cl(t)??this.filterDuplicateArrays(t),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(o=>EC(Ui(o)&&"value"in o?o.value:o));this.tickTreeLayout=VZ(i);const s=[];for(const o of this.tickTreeLayout.nodes)o.leafCount||o.refId==null||s.push(this.dataDomain.domain[o.refId]);return this.scale.domain=RK(this.dataDomain.domain,s),this.tickScale.domain=i.concat([[""]]),{animatable:!0}}updateGridLines(){if(!this.gridLength)return;const{width:e,style:t}=this.gridLine,i=this.gridLength*-this.label.getSideFlag();this.gridLineGroupSelection.each((s,o,n)=>{const{stroke:r,lineDash:a}=t[n%t.length],l=o.translationY;s.visible=this.inRange(l),s.x1=0,s.x2=i,s.y=l,s.stroke=r,s.strokeWidth=e,s.lineDash=a})}filterDuplicateArrays(e){const t=new Set;return e.filter(i=>{const s=Mt(i)?JSON.stringify(i):i;return t.has(s)?!1:(t.add(s),!0)})}};wp.className="GroupedCategoryAxis";wp.type="grouped-category";D([k(pA)],wp.prototype,"depthOptions",2);var W_=ht(e=>yn(e)&&e!==0,"a non-zero number"),Sh=class extends Gc{constructor(e){super(e,new tI),this.min=NaN,this.max=NaN}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:o}=iI(e,t,i);return s[0]<0&&s[1]>0||e[0]<0&&e[1]>0?(ue.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:o}):s[0]===0||s[1]===0||e[0]===0||e[1]===0?(ue.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:o}):{domain:s,clipped:o}}set base(e){this.scale.base=e}get base(){return this.scale.base}defaultDatumFormatter(e,t){return String(e)}defaultLabelFormatter(e,t){return String(e)}};Sh.className="LogAxis";Sh.type="log";D([k(na(pp,W_,wm("max"))),Oc(NaN)],Sh.prototype,"min",2);D([k(na(pp,W_,Mm("min"))),Oc(NaN)],Sh.prototype,"max",2);var Wg=(e,{x0:t,y0:i,x1:s,y1:o,cx:n,cy:r},a,l)=>{if(l&&e.moveTo(t,i),t!==s||i!==o){const c=Math.atan2(i-r,t-n),d=Math.atan2(o-r,s-n);e.arc(n,r,a,c,d)}else e.lineTo(t,i)},KE=1e-6,Vy=(e,t,i,s,o)=>{let n=!1,r=!1,a=s-Math.sqrt(Math.max(o**2-i**2,0)),l=0,c=0,d=i-Math.sqrt(Math.max(o**2-s**2,0));return a>e?(n=!0,a=e,l=i-Math.sqrt(Math.max(o**2-(s-e)**2))):a<KE&&(a=0),d>t?(r=!0,c=s-Math.sqrt(Math.max(o**2-(i-t)**2)),d=t):d<KE&&(d=0),{leading0:a,leading1:l,trailing0:c,trailing1:d,leadingClipped:n,trailingClipped:r}},cC=(e,t,i,s,o,n,r)=>{let{topLeft:a,topRight:l,bottomRight:c,bottomLeft:d}=n;const h=Math.max(a+d,l+c),u=Math.max(a+l,d+c);if(h<=0&&u<=0){r==null?e.rect(t,i,s,o):e.rect(r.x,r.y,r.width,r.height);return}else if(r==null&&a===l&&a===c&&a===d){e.roundRect(t,i,s,o,a);return}if(s<0&&(t+=s,s=Math.abs(s)),o<0&&(i+=o,o=Math.abs(o)),s<=0||o<=0)return;if(r==null)r=new ve(t,i,s,o);else{const I=Math.max(t,r.x),w=Math.min(t+s,r.x+r.width),M=Math.max(i,r.y),T=Math.min(i+o,r.y+r.height);r=new ve(I,M,w-I,T-M)}const p=Math.max(h/o,u/s,1);p>1&&(a/=p,l/=p,c/=p,d/=p);let g=!0,f=!0,y=!0,m=!0,C,b,S,A;if(g){const I=Vy(r.height,r.width,Math.max(t+a-r.x,0),Math.max(i+a-r.y,0),a);I.leadingClipped&&(m=!1),I.trailingClipped&&(f=!1);const w=Math.max(r.x+I.leading1,r.x),M=Math.max(r.y+I.leading0,r.y),T=Math.max(r.x+I.trailing1,r.x),E=Math.max(r.y+I.trailing0,r.y),P=t+a,N=i+a;C={x0:w,y0:M,x1:T,y1:E,cx:P,cy:N}}if(f){const I=Vy(r.width,r.height,Math.max(i+l-r.y,0),Math.max(r.x+r.width-(t+s-l),0),l);I.leadingClipped&&(g=!1),I.trailingClipped&&(y=!1);const w=Math.min(r.x+r.width-I.leading0,r.x+r.width),M=Math.max(r.y+I.leading1,r.y),T=Math.min(r.x+r.width-I.trailing0,r.x+r.width),E=Math.max(r.y+I.trailing1,r.y),P=t+s-l,N=i+l;b={x0:w,y0:M,x1:T,y1:E,cx:P,cy:N}}if(y){const I=Vy(r.height,r.width,Math.max(r.x+r.width-(t+s-c),0),Math.max(r.y+r.height-(i+o-c),0),c);I.leadingClipped&&(f=!1),I.trailingClipped&&(m=!1);const w=Math.min(r.x+r.width-I.leading1,r.x+r.width),M=Math.min(r.y+r.height-I.leading0,r.y+r.height),T=Math.min(r.x+r.width-I.trailing1,r.x+r.width),E=Math.min(r.y+r.height-I.trailing0,r.y+r.height),P=t+s-c,N=i+o-c;S={x0:w,y0:M,x1:T,y1:E,cx:P,cy:N}}if(m){const I=Vy(r.width,r.height,Math.max(r.y+r.height-(i+o-d),0),Math.max(t+d-r.x,0),d);I.leadingClipped&&(y=!1),I.trailingClipped&&(g=!1);const w=Math.max(r.x+I.leading0,r.x),M=Math.min(r.y+r.height-I.leading1,r.y+r.height),T=Math.max(r.x+I.trailing0,r.x),E=Math.min(r.y+r.height-I.trailing1,r.y+r.height),P=t+d,N=i+o-d;A={x0:w,y0:M,x1:T,y1:E,cx:P,cy:N}}let R=!1;g&&C!=null&&(Wg(e,C,a,!R),R||(R=!0)),f&&b!=null&&(Wg(e,b,l,!R),R||(R=!0)),y&&S!=null&&(Wg(e,S,c,!R),R||(R=!0)),m&&A!=null&&Wg(e,A,d,!R),e.closePath()},ks=class extends eo{constructor(){super(...arguments),this.borderPath=new Tf,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=Mn.defaultStyles.strokeWidth,this.effectiveStrokeWidth=Mn.defaultStyles.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(t){this.topLeftCornerRadius=t,this.topRightCornerRadius=t,this.bottomRightCornerRadius=t,this.bottomLeftCornerRadius=t}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:t,borderPath:i,crisp:s,topLeftCornerRadius:o,topRightCornerRadius:n,bottomRightCornerRadius:r,bottomLeftCornerRadius:a}=this;let{x:l,y:c,width:d,height:h,strokeWidth:u,clipBBox:p}=this;const f=1/(this.layerManager?.canvas.pixelRatio??1);let y=1;if(t.clear(!0),i.clear(!0),s&&(d<=f&&(y*=d/f),h<=f&&(y*=h/f),d=this.align(l,d),h=this.align(c,h),l=this.align(l),c=this.align(c),p=p!=null?new ve(this.align(p.x),this.align(p.y),this.align(p.x,p.width),this.align(p.y,p.height)):void 0),u)if(d<f){const m=l+f/2;i.moveTo(m,c),i.lineTo(m,c+h),u=f,this.borderClipPath=void 0}else if(h<f){const m=c+f/2;i.moveTo(l,m),i.lineTo(l+d,m),u=f,this.borderClipPath=void 0}else if(u<d&&u<h){const m=u/2;l+=m,c+=m,d-=u,h-=u;const C=p?.clone().shrink(m),b={topLeft:o>0?o-u:0,topRight:n>0?n-u:0,bottomRight:r>0?r-u:0,bottomLeft:a>0?a-u:0};this.borderClipPath=void 0,d>0&&h>0&&(C==null||C?.width>0&&C?.height>0)&&(cC(t,l,c,d,h,b,C),cC(i,l,c,d,h,b,C))}else this.borderClipPath=this.borderClipPath??new Tf,this.borderClipPath.clear(!0),this.borderClipPath.rect(l,c,d,h),i.rect(l,c,d,h);else{const m={topLeft:o,topRight:n,bottomRight:r,bottomLeft:a};this.borderClipPath=void 0,cC(t,l,c,d,h,m,p)}if([o,n,r,a].every(m=>m===0)){const m=this.getBBox();this.hittester=m.containsPoint.bind(m),this.distanceSquared=(C,b)=>this.getBBox().distanceSquared(C,b)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=y}computeBBox(){const{x:t,y:i,width:s,height:o,clipBBox:n}=this;return n?.clone()??new ve(t,i,s,o)}isPointInPath(t,i){return this.hittester(t,i)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(t,i){return this.distanceCalculator(t,i)}applyFillAlpha(t){const{fillOpacity:i,microPixelEffectOpacity:s,opacity:o}=this;t.globalAlpha*=o*i*s}renderStroke(t){const{stroke:i,effectiveStrokeWidth:s}=this;if(i&&s){const{globalAlpha:o}=t,{strokeOpacity:n,lineDash:r,lineDashOffset:a,lineCap:l,lineJoin:c,borderPath:d,borderClipPath:h,opacity:u,microPixelEffectOpacity:p}=this;h&&t.clip(h.getPath2D()),this.applyStroke(t),t.globalAlpha*=u*n*p,t.lineWidth=s,r&&t.setLineDash(r),a&&(t.lineDashOffset=a),l&&(t.lineCap=l),c&&(t.lineJoin=c),t.stroke(d.getPath2D()),t.globalAlpha=o}}};ks.className="Rect";D([Ae()],ks.prototype,"x",2);D([Ae()],ks.prototype,"y",2);D([Ae()],ks.prototype,"width",2);D([Ae()],ks.prototype,"height",2);D([Ae()],ks.prototype,"topLeftCornerRadius",2);D([Ae()],ks.prototype,"topRightCornerRadius",2);D([Ae()],ks.prototype,"bottomRightCornerRadius",2);D([Ae()],ks.prototype,"bottomLeftCornerRadius",2);D([Ae()],ks.prototype,"clipBBox",2);D([Ae()],ks.prototype,"crisp",2);var Mp=class extends aS{constructor(t){super(),this.ctx=t,this.rectNode=new ks,this.textNode=new Oi,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.destroyFns.push(t.scene.attachNode(this.node),t.layoutManager.addListener("layout:complete",i=>this.onLayoutComplete(i)))}createNode(){return new Me({name:"background",zIndex:0})}onLayoutComplete(t){const{width:i,height:s}=t.chart;this.rectNode.width=i,this.rectNode.height=s}};D([k(xe),Yi("node","visible")],Mp.prototype,"visible",2);D([k(st,{optional:!0}),Yi("rectNode","fill")],Mp.prototype,"fill",2);D([k(me,{optional:!0})],Mp.prototype,"image",2);D([k(he,{optional:!0}),Yi("textNode")],Mp.prototype,"text",2);var j_={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Mp(e)};function WZ({orientation:e,bboxes:t,maxHeight:i,maxWidth:s,itemPaddingY:o=0,itemPaddingX:n=0,forceResult:r=!1}){const a=e==="horizontal",l={max:a?s:i,fn:a?u=>u.width:u=>u.height,padding:a?n:o},c={max:a?i:s,fn:a?u=>u.height:u=>u.width,padding:a?o:n};let d=0;const h=[];for(;d<t.length;){const u=t.slice(d),p=jZ(u,d,l,c,r);if(!p)return;d+=p.processedBBoxCount,h.push(p.pageIndices)}return KZ(h,e,t,o,n)}function jZ(e,t,i,s,o){let r=YZ(e,i);if(r<1){if(!o)return;r=1}let a=r;for(;a>=1;){const l=UZ(e,t,a,i,s,o);if(l==null&&a<=1)return;if(l==null){a--;continue}if(typeof l=="number"){if(l<=1)return;a=l<a&&l>1?l:a,a--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function UZ(e,t,i,s,o,n){const r=[];let a=0,l=0,c=[];const d=[];for(let h=0;h<e.length;h++){const u=(h+i)%i;u===0&&(a+=l,l=0,c.length>0&&r.push(c),c=[]);const p=s.fn(e[h])+s.padding;d[u]=Math.max(d[u]??0,p),l=Math.max(l,o.fn(e[h])+o.padding);const g=a+l,f=!n||r.length>0;if(g>o.max&&f){c=[];break}if(d.reduce((m,C)=>m+C,0)>s.max&&!n)return d.length<i?d.length:void 0;c.push(h+t)}return c.length>0&&r.push(c),r.length>0?r:void 0}function KZ(e,t,i,s,o){let n=0,r=0;return{pages:e.map(l=>{t==="horizontal"&&(l=$Z(l));let c=0;const d=l.map(p=>{const g=p.map(m=>(c=Math.max(m,c),i[m]));let f=0,y=0;return g.forEach(m=>{f+=m.height+s,y=Math.max(y,m.width+o)}),{indices:p,bboxes:g,columnHeight:Math.ceil(f),columnWidth:Math.ceil(y)}});let h=0,u=0;return d.forEach(p=>{h+=p.columnWidth,u=Math.max(u,p.columnHeight)}),n=Math.max(h,n),r=Math.max(u,r),{columns:d,startIndex:l[0][0],endIndex:c,pageWidth:h,pageHeight:u}}),maxPageWidth:n,maxPageHeight:r}}function $Z(e){const t=[];for(const i of e[0])t.push([]);return e.forEach((i,s)=>{i.forEach((o,n)=>{t[n][s]=o})}),t}function YZ(e,t){const i=e.length;let s=0;for(let o=0;o<i;o++)if(s+=t.fn(e[o])+t.padding,s>t.max)return i/o<2?Math.ceil(i/2):o;return i}var Dp=class extends Ee{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};D([k(st)],Dp.prototype,"color",2);D([k(pl,{optional:!0})],Dp.prototype,"fontStyle",2);D([k(gl,{optional:!0})],Dp.prototype,"fontWeight",2);D([k(pe)],Dp.prototype,"fontSize",2);D([k(he)],Dp.prototype,"fontFamily",2);var $a=class extends Ee{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};D([k(pe)],$a.prototype,"size",2);D([k(st,{optional:!0})],$a.prototype,"fill",2);D([k(rt,{optional:!0})],$a.prototype,"fillOpacity",2);D([k(st,{optional:!0})],$a.prototype,"stroke",2);D([k(pe)],$a.prototype,"strokeWidth",2);D([k(rt)],$a.prototype,"strokeOpacity",2);var xS=class extends Ee{constructor(e){super(),this.parent=e,this.shape="triangle",this.size=15,this.padding=8}};D([wo({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],xS.prototype,"shape",2);D([k(pe)],xS.prototype,"size",2);D([k(pe)],xS.prototype,"padding",2);var xh=class extends Ee{constructor(e,t){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.id=Rn(this),this.marker=new xS(this),this.activeStyle=new $a,this.inactiveStyle=new $a,this.highlightStyle=new $a,this.label=new Dp,this.group=new Zs({name:"pagination"}),this.labelNode=new Oi,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this.nextButton=new Fi,this.previousButton=new Fi,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(e){switch(this._orientation=e,e){case"horizontal":{this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}get orientation(){return this._orientation}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateNextButtonPosition(){const e=this.labelNode.getBBox();this.nextButton.translationX=e.width+(this.marker.size/2+this.marker.padding)*2}updateLabel(){const{currentPage:e,totalPages:t,labelNode:i,label:{color:s,fontStyle:o,fontWeight:n,fontSize:r,fontFamily:a}}=this;i.text=`${e+1} / ${t}`,i.fill=s,i.fontStyle=o,i.fontWeight=n,i.fontSize=r,i.fontFamily=a}updateMarkers(){const{nextButton:e,previousButton:t,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:o,inactiveStyle:n,highlightStyle:r,highlightActive:a}=this,l=(c,d)=>d?n:c===a?r:o;this.updateMarker(e,l("next",i)),this.updateMarker(t,l("previous",s))}updateMarker(e,t){const{shape:i,size:s}=this.marker;e.shape=i,e.size=s,e.fill=t.fill,e.fillOpacity=t.fillOpacity??1,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.strokeOpacity=t.strokeOpacity}enableOrDisableButtons(){const{currentPage:e,totalPages:t}=this,i=t===0,s=e===t-1,o=e===0;this.nextButtonDisabled=s||i,this.previousButtonDisabled=o||i}setPage(e){e=Pe(0,e,Math.max(0,this.totalPages-1)),this.currentPage!==e&&(this.currentPage=e,this.onPaginationChanged())}getCursor(e){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[e]?void 0:"pointer"}onClick(e,t){e.preventDefault(),t==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):t==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(e){this.highlightActive=e,this.updateMarkers(),this.chartUpdateCallback(6)}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(6)}attachPagination(e){e.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const e=$t.toCanvas(this.previousButton),t=$t.toCanvas(this.nextButton);return{prev:e,next:t}}};xh.className="Pagination";D([k(me)],xh.prototype,"marker",2);D([k(me)],xh.prototype,"activeStyle",2);D([k(me)],xh.prototype,"inactiveStyle",2);D([k(me)],xh.prototype,"highlightStyle",2);D([k(me)],xh.prototype,"label",2);var cI=class extends Ee{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}},XZ=new Set(["circle","cross","diamond","heart","pin","plus","square","star","triangle"]);function ZZ(e){return typeof e=="string"&&XZ.has(e)}var dI=ht(e=>ZZ(e)||typeof e=="function","a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class"),Ts=class extends cI{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:t,shape:i,fill:s,fillOpacity:o,stroke:n,strokeWidth:r,strokeOpacity:a,lineDash:l,lineDashOffset:c}=this;return{size:t,shape:i,fill:s,fillOpacity:o,stroke:n,strokeWidth:r,strokeOpacity:a,lineDash:l,lineDashOffset:c}}getDiameter(){return this.size+this.strokeWidth}};D([k(xe),ye()],Ts.prototype,"enabled",2);D([k(dI),ye()],Ts.prototype,"shape",2);D([k(pe),ye()],Ts.prototype,"size",2);D([k(st,{optional:!0}),ye()],Ts.prototype,"fill",2);D([k(rt),ye()],Ts.prototype,"fillOpacity",2);D([k(st,{optional:!0}),ye()],Ts.prototype,"stroke",2);D([k(pe),ye()],Ts.prototype,"strokeWidth",2);D([k(rt),ye()],Ts.prototype,"strokeOpacity",2);D([k(ra)],Ts.prototype,"lineDash",2);D([k(pe)],Ts.prototype,"lineDashOffset",2);D([k(Qs,{optional:!0}),ye()],Ts.prototype,"itemStyler",2);function Ef(e,t,i){e.fill=i?.fill??t.fill,e.fillOpacity=i?.fillOpacity??t.fillOpacity??1,e.stroke=i?.stroke??t.stroke,e.strokeOpacity=i?.strokeOpacity??t.strokeOpacity??1,e.strokeWidth=i?.strokeWidth??t.strokeWidth??0,e.lineDash=i?.lineDash??t.lineDash,e.lineDashOffset=i?.lineDashOffset??t.lineDashOffset??0}var qZ=class{constructor(e,t){this.idPrefix=t,this.dirty=!0,this.destroyFns=new k2,this.itemList=e.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${t}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${t}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"},ariaOrientation:"horizontal"}),this.itemDescription=He("p"),this.itemDescription.style.display="none",this.itemDescription.id=`${t}-ariaDescription`,this.itemDescription.textContent=this.getItemAriaDescription(e.localeManager),this.itemList.getElement().append(this.itemDescription)}destroy(){this.destroyFns.destroy()}initLegendList(e){if(!this.dirty)return;const{ctx:t,itemSelection:i,datumReader:s,itemListener:o}=e,n=t.localeManager,r=i.length;i.each((a,l,c)=>{a.proxyButton?.destroy(),a.proxyButton=t.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(n,s.getItemLabel(l),c,r),ariaChecked:!!a.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const d=a.proxyButton;d.addListener("click",h=>o.onClick(h.sourceEvent,a.datum,d)),d.addListener("dblclick",h=>o.onDoubleClick(h.sourceEvent,a.datum)),d.addListener("mouseenter",h=>o.onHover(h.sourceEvent,a)),d.addListener("mouseleave",()=>o.onLeave()),d.addListener("contextmenu",h=>o.onContextClick(h.sourceEvent,a)),d.addListener("blur",()=>o.onLeave()),d.addListener("focus",h=>o.onHover(h.sourceEvent,a)),d.addListener("drag-start",()=>{})}),this.dirty=!1}update(e){e.visible&&(this.initLegendList(e),this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!0)),this.updateVisibility(e.visible)}updateVisibility(e){this.itemList.setHidden(!e),this.paginationGroup.setHidden(!e)}updateItemProxyButtons({itemSelection:e,group:t,pagination:i,interactive:s}){const o=$t.toCanvas(t);this.itemList.setBounds(o);const n=Math.max(...e.nodes().map(r=>r.getBBox().height));e.each((r,a)=>{if(r.proxyButton){const l=r.pageIndex===i.currentPage,{x:c,y:d,height:h,width:u}=$t.toCanvas(r),p=(n-h)/2,g={x:c-o.x,y:d-p-o.y,height:n,width:u};r.proxyButton.setCursor("pointer"),r.proxyButton.setEnabled(s&&l),r.proxyButton.setBounds(g)}})}updatePaginationProxyButtons(e,t){const{pagination:i}=e;if(this.paginationGroup.setHidden(!i.visible),t&&"ctx"in e){const{ctx:n,oldPages:r,newPages:a}=e,l=(r?.length??a.length)>1,c=a.length>1;l!==c&&(c?(this.prevButton=n.proxyInteractionService.createProxyElement({type:"button",id:`${this.idPrefix}-prev-page`,textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",d=>this.onPageButton(e,d,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0)),this.nextButton??(this.nextButton=n.proxyInteractionService.createProxyElement({type:"button",id:`${this.idPrefix}-next-page`,textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup})),this.nextButton.addListener("click",d=>this.onPageButton(e,d,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0))):(this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0))}const{prev:s,next:o}=i.computeCSSBounds();this.prevButton?.setBounds(s),this.nextButton?.setBounds(o),this.prevButton?.setEnabled(i.currentPage!==0),this.nextButton?.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton?.setCursor(i.getCursor("next")),this.prevButton?.setCursor(i.getCursor("previous"))}onPageButton(e,t,i){e.pagination.onClick(t.sourceEvent,i),this.updatePaginationProxyButtons(e,!1)}onDataUpdate(e,t){this.dirty=e.length!==t.length||e.some((i,s,o)=>{const[n,r]=[t[s],e[s]];return n.id!==r.id})}onLocaleChanged(e,t,i){const s=t.length;t.each(({proxyButton:o},n,r)=>{const a=o?.getElement();if(a!=null){const l=i.getItemLabel(n);a.textContent=this.getItemAriaText(e,l,r,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(e)}onPageChange(e){this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!1)}getItemAriaText(e,t,i,s){return i>=0&&t?(i++,e.t("ariaLabelLegendItem",{label:t,index:i,count:s})):e.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(e){return e.t("ariaDescriptionLegendItem")}};function $E(e,t,i,s){const o={defaultPrevented:!1,apiEvent:{type:e,itemId:t,seriesId:i,event:s,preventDefault:()=>o.defaultPrevented=!0}};return o}var Tn=class extends fh(Me){constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new Me({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new Oi),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new Fi({zIndex:1})),this.line=this.symbolsGroup.appendChild(new $o({zIndex:0}));const{label:e,line:t,symbolsGroup:i}=this;t.visible=!1,i.renderToOffscreenCanvas=!0,i.optimizeForInfrequentRedraws=!0,e.textBaseline="middle",e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(e){this.enabled=e,this.refreshVisibilities()}refreshVisibilities(){const e=this.enabled?1:.5;this.label.opacity=e,this.opacity=e}layout(){const{marker:e,line:t,length:i,isCustomMarker:s}=this;let o=0,n=0;if(e.visible){const{size:r}=e,a=Fi.anchor(e.shape);o=(a.x-.5)*r+i/2,n=(a.y-.5)*r,s?(e.x=0,e.y=0,e.translationX=o,e.translationY=n):(e.x=o,e.y=n,e.translationX=0,e.translationY=0)}t.visible&&(t.x1=0,t.x2=i,t.y1=0,t.y2=0)}preRender(e){const t=super.preRender(e);return this.layout(),t}layoutLabel(){const{length:e,spacing:t}=this;this.label.x=e+t}computeBBox(){return this.layout(),super.computeBBox()}};Tn.className="MarkerLabel";D([Yi("label")],Tn.prototype,"text",2);D([Yi("label")],Tn.prototype,"fontStyle",2);D([Yi("label")],Tn.prototype,"fontWeight",2);D([Yi("label")],Tn.prototype,"fontSize",2);D([Yi("label")],Tn.prototype,"fontFamily",2);D([Yi("label","fill")],Tn.prototype,"color",2);D([Nc(e=>e.layoutLabel())],Tn.prototype,"spacing",2);D([Nc(e=>e.layoutLabel())],Tn.prototype,"length",2);D([ye()],Tn.prototype,"isCustomMarker",2);var zc=class extends Ee{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};D([k(pe,{optional:!0})],zc.prototype,"maxLength",2);D([k(st)],zc.prototype,"color",2);D([k(pl,{optional:!0})],zc.prototype,"fontStyle",2);D([k(gl,{optional:!0})],zc.prototype,"fontWeight",2);D([k(pe)],zc.prototype,"fontSize",2);D([k(he)],zc.prototype,"fontFamily",2);D([k(Qs,{optional:!0})],zc.prototype,"formatter",2);var Ap=class extends Ee{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};D([k(dI,{optional:!0})],Ap.prototype,"shape",2);D([k(pe)],Ap.prototype,"size",2);D([k(pe)],Ap.prototype,"padding",2);D([k(pe,{optional:!0})],Ap.prototype,"strokeWidth",2);D([k(xe)],Ap.prototype,"enabled",2);var hI=class extends Ee{};D([k(pe,{optional:!0})],hI.prototype,"strokeWidth",2);D([k(pe,{optional:!0})],hI.prototype,"length",2);var Vc=class extends Ee{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new Ap,this.label=new zc,this.line=new hI}};D([k(pe,{optional:!0})],Vc.prototype,"maxWidth",2);D([k(pe)],Vc.prototype,"paddingX",2);D([k(pe)],Vc.prototype,"paddingY",2);D([k(xe)],Vc.prototype,"showSeriesStroke",2);D([k(me)],Vc.prototype,"marker",2);D([k(me)],Vc.prototype,"label",2);D([k(me)],Vc.prototype,"line",2);var uI=class extends Ee{};D([k(Qs,{optional:!0})],uI.prototype,"legendItemClick",2);D([k(Qs,{optional:!0})],uI.prototype,"legendItemDoubleClick",2);var Cg="legend-visibility",Rw="legend-other-series",Do=class extends Ee{constructor(e){super(),this.ctx=e,this.id=Rn(this),this.group=new Zs({name:"legend",zIndex:14}),this.itemSelection=ai.select(this.group,Tn),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new Vc,this.listeners=new uI,this.enabled=!0,this.position="bottom",this.spacing=20,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.pagination=new xh(t=>e.updateService.update(t),t=>this.updatePageNumber(t)),this.pagination.attachPagination(this.group),this.destroyFns.push(e.contextMenuRegistry.registerDefaultAction({id:Cg,type:"legend",label:"contextMenuToggleSeriesVisibility",action:t=>this.contextToggleVisibility(t)}),e.contextMenuRegistry.registerDefaultAction({id:Rw,type:"legend",label:"contextMenuToggleOtherSeries",action:t=>this.contextToggleOtherSeries(t)}),e.legendManager.addListener("legend-change",this.onLegendDataChange.bind(this))),this.destroyFns.push(e.layoutManager.registerElement(1,t=>this.positionLegend(t)),e.localeManager.addListener("locale-changed",()=>this.onLocaleChanged()),()=>this.group.remove()),this.domProxy=new qZ(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(e.legendManager)}set data(e){ih(e,this._data)||(this.domProxy.onDataUpdate(this._data,e),this._data=e,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:e=[]}){this.enabled&&(this.data=e.filter(t=>!t.hideInLegend))}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.destroyFns.forEach(e=>e()),this.itemSelection.clear(),this.domProxy.destroy()}getOrientation(){if(this.orientation!==void 0)return this.orientation;switch(this.position){case"right":case"left":return"vertical";case"bottom":case"top":return"horizontal"}}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(e){e.appendChild(this.group)}getItemLabel(e){const{ctx:{callbackCache:t}}=this,{formatter:i}=this.item.label;if(i){const s=e.datum;return t.call(i,{itemId:e.itemId,value:e.label.text,seriesId:e.seriesId,...s&&{datum:s}})}return e.label.text}calcLayout(e,t){const{paddingX:i,paddingY:s,label:o,maxWidth:n,label:{maxLength:r=1/0,fontStyle:a,fontWeight:l,fontSize:c,fontFamily:d}}=this.item,h=[...this.data];this.reverseOrder&&h.reverse(),this.itemSelection.update(h);const u=[],p=Ft.toFontString(o),f=n??e*.8,y=this.calculateMarkerWidth();if(this.itemSelection.each((M,T)=>{M.fontStyle=a,M.fontWeight=l,M.fontSize=c,M.fontFamily=d;const E=this.updateMarkerLabel(M,T,y),P=T.itemId??T.id,F=(this.getItemLabel(T)??"<unknown>").replace(/\r?\n/g," ");M.text=this.truncate(F,r,f,E,p,P),u.push(M.getBBox())}),e=Math.max(1,e),t=Math.max(1,t),!isFinite(e))return{};const m=this.size,C=this.oldSize;m[0]=e,m[1]=t,(m[0]!==C[0]||m[1]!==C[1])&&(C[0]=m[0],C[1]=m[1]);const{pages:b,maxPageHeight:S,maxPageWidth:A}=this.updatePagination(u,e,t),R=this.pages;this.pages=b,this.maxPageSize=[A-i,S-s];const I=this.pagination.currentPage,w=this.pages[I];return this.pages.length<1||!w?(this.visible=!1,{oldPages:R}):(this.visible=!0,this.updatePositions(I),this.update(),{oldPages:R})}isCustomMarker(e,t){return e&&t!==void 0&&typeof t!="string"}calcSymbolsEnabled(e){const{showSeriesStroke:t,marker:i}=this.item,s=!!i.enabled||!t||(e.marker.enabled??!0),o=!!(e.line&&t),n=this.isCustomMarker(s,e.marker.shape);return{markerEnabled:s,lineEnabled:o,isCustomMarker:n}}calcSymbolsLengths(e){const{marker:t,line:i}=this.item,{markerEnabled:s,lineEnabled:o}=this.calcSymbolsEnabled(e),{strokeWidth:n}=this.getMarkerStyles(e),{strokeWidth:r}=o?this.getLineStyles(e):{strokeWidth:0};let a;const{shape:l}=e.marker;if(this.isCustomMarker(s,l)){const h=new Fi;h.shape=l,h.updatePath();const u=h.getBBox();a=Math.max(u.width,u.height)}const c=s?t.size:0,d=o?i.length??25:0;return{markerLength:c,markerStrokeWidth:n,lineLength:d,lineStrokeWidth:r,customMarkerSize:a}}calculateMarkerWidth(){let e=0;return this.itemSelection.each((t,i)=>{const{symbol:s}=i,{markerLength:o,lineLength:n,customMarkerSize:r=-1/0}=this.calcSymbolsLengths(s);e=Math.max(e,n,r,o)}),e}updateMarkerLabel(e,t,i){const{marker:s,paddingX:o}=this.item,{symbol:n}=t;let r=o;const{markerEnabled:a,lineEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(n),d=s.padding;(a||l)&&(r+=d+i);const{marker:h,line:u}=e;return h.visible=a,h.visible&&(h.shape=s.shape??n.marker.shape??"square",h.size=s.size,Ef(h,this.getMarkerStyles(n))),u.visible=l,u.visible&&Ef(u,this.getLineStyles(n)),e.length=i,e.spacing=d,e.isCustomMarker=c,r}truncate(e,t,i,s,o,n){let r=!1;e.length>t&&(e=e.substring(0,t),r=!0);const a=fl.getMeasurer({font:o}),l=MA.truncateLine(e,a,i-s,r);return l.endsWith(Ft.EllipsisChar)?this.truncatedItems.add(n):this.truncatedItems.delete(n),l}updatePagination(e,t,i){const s=this.getOrientation(),o=Math.min(this.paginationTrackingIndex,e.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:n,maxPageHeight:r,maxPageWidth:a,paginationBBox:l,paginationVertical:c}=this.calculatePagination(e,t,i),d=n.findIndex(b=>b.endIndex>=o);this.pagination.currentPage=Pe(0,d,n.length-1);const{paddingX:h,paddingY:u}=this.item,p=8,g=a-h,f=r-u;let y=0,m=-l.y-this.item.marker.size/2;c?m+=f+p:(y+=-l.x+g+p,m+=(f-l.height)/2),this.pagination.translationX=y,this.pagination.translationY=m,this.pagination.update(),this.pagination.updateMarkers();let C=0;return this.itemSelection.each((b,S,A)=>{A>(n[C]?.endIndex??1/0)&&C++,b.pageIndex=C}),{maxPageHeight:r,maxPageWidth:a,pages:n}}calculatePagination(e,t,i){const{paddingX:s,paddingY:o}=this.item,n=this.getOrientation(),r=["left","right"].includes(this.position);let a=this.pagination.getBBox(),l=new ve(0,0,0,0),c=[],d=0,h=0,u=0;const p=f=>f.width===a.width&&f.height===a.height,g=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(u++>10){ue.warn("unable to find stable legend layout.");break}a=l;const f=t-(r?0:a.width),y=i-(r?a.height:0),m=WZ({orientation:n,bboxes:e,maxHeight:y,maxWidth:f,itemPaddingY:o,itemPaddingX:s,forceResult:g});c=m?.pages??[],d=m?.maxPageWidth??0,h=m?.maxPageHeight??0;const C=c.length;if(this.pagination.visible=C>1,this.pagination.totalPages=C,this.pagination.update(),this.pagination.updateMarkers(),l=this.pagination.getBBox(),!this.pagination.visible)break}while(!p(l));return{maxPageWidth:d,maxPageHeight:h,pages:c,paginationBBox:l,paginationVertical:r}}updatePositions(e=0){const{item:{paddingY:t},itemSelection:i,pages:s}=this;if(s.length<1||!s[e])return;const{columns:o,startIndex:n,endIndex:r}=s[e];let a=0,l=0;const c=o.length,d=o[0].indices.length,h=this.getOrientation()==="horizontal",u=o[0].bboxes[0].height+t,p=[];i.each((g,f,y)=>{if(y<n||y>r){g.visible=!1;return}const m=y-n;let C,b;h?(C=m%c,b=Math.floor(m/c)):(C=Math.floor(m/d),b=m%d),g.visible=!0;const S=o[C];S&&(l=Math.floor(u*b),a=Math.floor(p[b]??0),p[b]=(p[b]??0)+S.columnWidth,g.translationX=a,g.translationY=l)})}updatePageNumber(e){const{itemSelection:t,group:i,pagination:s,pages:o,toggleSeries:n}=this,{startIndex:r,endIndex:a}=o[e];r===0?this.paginationTrackingIndex=0:e===o.length-1?this.paginationTrackingIndex=a:this.paginationTrackingIndex=Math.floor((r+a)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(e),this.domProxy.onPageChange({itemSelection:t,group:i,pagination:s,interactive:n}),this.ctx.updateService.update(6)}update(){const{label:{color:e}}=this.item;this.itemSelection.each((t,i)=>{t.setEnabled(i.enabled),t.color=e}),this.updateContextMenu()}updateContextMenu(){const{toggleSeries:e,ctx:{contextMenuRegistry:t}}=this;e?(t.hideAction(Cg),t.hideAction(Rw)):(t.showAction(Cg),t.showAction(Rw))}getLineStyles(e){const{stroke:t,strokeOpacity:i=1,strokeWidth:s,lineDash:o}=e.line??{},n=Math.min(2,s??1);return{stroke:t,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??n,lineDash:o}}getMarkerStyles(e){const{fill:t,stroke:i,strokeOpacity:s=1,fillOpacity:o=1,strokeWidth:n,lineDash:r,lineDashOffset:a}=e.marker,l=Math.min(2,n??1);return{fill:t,stroke:i,strokeOpacity:s,fillOpacity:o,strokeWidth:this.item.marker.strokeWidth??l,lineDash:r,lineDashOffset:a}}computePagedBBox(){const e=Me.computeChildrenBBox(this.group.children());if(this.pages.length>1){const[t,i]=this.maxPageSize;e.height=Math.max(i,e.height),e.width=Math.max(t,e.width)}return e}findNode(e){const{datum:t,proxyButton:i}=this.itemSelection.select(s=>s.datum?.itemId===e.itemId)[0]??{};if(t===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${t}, proxyButton: ${JSON.stringify(i)} }`);return{datum:t,proxyButton:i}}contextToggleVisibility(e){const{datum:t,proxyButton:i}=this.findNode(e);this.doClick(e.event,t,i)}contextToggleOtherSeries(e){this.doDoubleClick(e.event,this.findNode(e).datum)}onContextClick(e,t){const i=t.datum;this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.disableAction(Cg):this.ctx.contextMenuRegistry.enableAction(Cg);const{offsetX:s,offsetY:o}=e,{x:n,y:r}=$t.toCanvasPoint(t,s,o);this.ctx.contextMenuRegistry.dispatchContext("legend",{sourceEvent:e,canvasX:n,canvasY:r},{legendItem:i})}onClick(e,t,i){this.doClick(e,t,i)&&e.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(e=>e.getLegendData("category")).filter(e=>e.enabled).length}doClick(e,t,i){const{listeners:{legendItemClick:s},ctx:{chartService:o,highlightManager:n},preventHidingAll:r,toggleSeries:a}=this;if(!t)return!1;const{legendType:l,seriesId:c,itemId:d,enabled:h}=t,u=o.series.find(f=>f.id===c);if(!u)return!1;let p=h;const g=$E("click",d,u.id,e);return s?.(g.apiEvent),g.defaultPrevented||(a&&(p=!h,r&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.chartEventManager.legendItemClick(l,u,d,p,t.legendItemName)),p?n.updateHighlight(this.id,{series:u,itemId:d,datum:void 0,datumIndex:void 0}):n.updateHighlight(this.id),this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0,skipAnimations:t.skipAnimations??!1})),!0}onDoubleClick(e,t){this.doDoubleClick(e,t)&&e.preventDefault()}doDoubleClick(e,t){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:o}=this;if(s.mode==="integrated"||!t)return!1;const{legendType:n,id:r,itemId:a,seriesId:l}=t,c=s.series.find(h=>h.id===r);if(!c)return!1;const d=$E("dblclick",a,c.id,e);if(i?.(d.apiEvent),d.defaultPrevented)return!0;if(o){const h=s.series.flatMap(g=>g.getLegendData("category")),u=h.filter(g=>g.enabled).length,p=h.find(g=>g.itemId===a&&g.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(n,c,a,p?.enabled??!1,u,p?.legendItemName)}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(e,t){let i;if(e instanceof FocusEvent){const{x:n,y:r}=$t.toCanvas(t).computeCenter();i={type:"keyboard",canvasX:n,canvasY:r}}else{e.preventDefault();const{x:n,y:r}=$t.toCanvasPoint(t,e.offsetX,e.offsetY);i={type:"pointermove",canvasX:n,canvasY:r}}const{canvasX:s,canvasY:o}=i;return{canvasX:s,canvasY:o,lastPointerEvent:i,showArrow:!1}}onHover(e,t){if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(t.pageIndex);const i=t.datum,s=i?this.ctx.chartService.series.find(o=>o.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const o=this.toTooltipMeta(e,t);this.ctx.tooltipManager.updateTooltip(this.id,o,{type:"structured",title:this.getItemLabel(i)})}else this.ctx.tooltipManager.removeTooltip(this.id);i?.enabled&&s?this.updateHighlight({series:s,itemId:i?.itemId,datum:void 0,datumIndex:void 0}):this.updateHighlight()}onLeave(){this.ctx.tooltipManager.removeTooltip(this.id),this.updateHighlight()}updateHighlight(e){this.ctx.interactionManager.isState(32)?this.ctx.highlightManager.updateHighlight(this.id,e):this.ctx.interactionManager.isState(2)&&(this.pendingHighlightDatum=e,this.ctx.animationManager.onBatchStop(()=>{this.ctx.highlightManager.updateHighlight(this.id,this.pendingHighlightDatum)}))}onLocaleChanged(){this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(e){const t=this.positionLegendScene(e);this.positionLegendDOM(t)}positionLegendScene(e){if(!this.enabled||!this.data.length)return;const{layoutBox:t}=e,{x:i,y:s,width:o,height:n}=t,[r,a]=this.calculateLegendDimensions(t),{oldPages:l}=this.calcLayout(r,a),c=this.computePagedBBox(),d=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return n-c.height;case"right":default:return o-c.width}};if(this.visible){const h=this.spacing;let u,p;switch(this.position){case"top":case"bottom":u=(o-c.width)/2,p=d(),t.shrink(c.height+h,this.position);break;case"left":case"right":default:u=d(),p=(n-c.height)/2,t.shrink(c.width+h,this.position)}this.group.translationX=Math.floor(i+u-c.x),this.group.translationY=Math.floor(s+p-c.y)}return l}positionLegendDOM(e){const{ctx:t,itemSelection:i,pagination:s,pages:o,toggleSeries:n,group:r,listeners:{legendItemClick:a,legendItemDoubleClick:l}}=this,c=this.visible&&this.enabled,d=n||l!=null||a!=null;this.domProxy.update({visible:c,interactive:d,ctx:t,itemSelection:i,group:r,pagination:s,oldPages:e,newPages:o,datumReader:this,itemListener:this})}calculateLegendDimensions(e){const{width:t,height:i}=e,s=t/i,o=.5,n=.2,r=.25;let a,l;switch(this.position){case"top":case"bottom":{const c=s<1?Math.min(o,n*(1/s)):n;a=this.maxWidth?Math.min(this.maxWidth,t):t,l=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*c);break}case"left":case"right":default:{const c=s>1?Math.min(o,r*s):r;a=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*c),l=this.maxHeight?Math.min(this.maxHeight,i):i}}return[a,l]}};Do.className="Legend";D([k(xe)],Do.prototype,"toggleSeries",2);D([k(me)],Do.prototype,"pagination",2);D([k(me)],Do.prototype,"item",2);D([k(me)],Do.prototype,"listeners",2);D([Nc((e,t,i)=>{if(e.updateGroupVisibility(),t===i)return;const{ctx:{legendManager:s,stateManager:o}}=e;i===!1&&t===!0&&o.restoreState(s)}),k(xe)],Do.prototype,"enabled",2);D([k(gA)],Do.prototype,"position",2);D([k(pe,{optional:!0})],Do.prototype,"maxWidth",2);D([k(pe,{optional:!0})],Do.prototype,"maxHeight",2);D([k(xe,{optional:!0})],Do.prototype,"reverseOrder",2);D([k(Ct(["horizontal","vertical"],"an orientation"),{optional:!0})],Do.prototype,"orientation",2);D([k(xe,{optional:!0})],Do.prototype,"preventHidingAll",2);D([k(pe)],Do.prototype,"spacing",2);var QZ={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Do(e),packageType:"community",removable:"standalone-only"},U_={};In(U_,{CARTESIAN_AXIS_TYPE:()=>Y_,CARTESIAN_POSITION:()=>$_,FONT_SIZE:()=>K_,FONT_SIZE_RATIO:()=>pI,POLAR_AXIS_SHAPE:()=>Z_,POLAR_AXIS_TYPE:()=>X_});var K_=(e=>(e[e.SMALLEST=8]="SMALLEST",e[e.SMALLER=10]="SMALLER",e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=14]="LARGE",e[e.LARGEST=17]="LARGEST",e))(K_||{}),pI=(e=>(e[e.SMALLEST=.6666666666666666]="SMALLEST",e[e.SMALLER=.8333333333333334]="SMALLER",e[e.SMALL=1]="SMALL",e[e.MEDIUM=1.0833333333333333]="MEDIUM",e[e.LARGE=1.1666666666666667]="LARGE",e[e.LARGEST=1.4166666666666667]="LARGEST",e))(pI||{}),$_=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e))($_||{}),Y_=(e=>(e.CATEGORY="category",e.GROUPED_CATEGORY="grouped-category",e.ORDINAL_TIME="ordinal-time",e.NUMBER="number",e.TIME="time",e.LOG="log",e))(Y_||{}),X_=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(X_||{}),Z_=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(Z_||{}),gI={};In(gI,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>Fm,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>_m,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>zm,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>Nf,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Of,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Bm,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Gm,DEFAULT_BACKGROUND_COLOUR:()=>wS,DEFAULT_CAPTION_ALIGNMENT:()=>uc,DEFAULT_CAPTION_LAYOUT_STYLE:()=>hc,DEFAULT_COLOR_RANGE:()=>kS,DEFAULT_DIVERGING_SERIES_COLOR_RANGE:()=>Ao,DEFAULT_FIBONACCI_STROKES:()=>Pf,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Di,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>jt,DEFAULT_FUNNEL_SERIES_COLOR_RANGE:()=>ca,DEFAULT_GAUGE_SERIES_COLOR_RANGE:()=>Ln,DEFAULT_GRIDLINE_ENABLED:()=>Vr,DEFAULT_HIERARCHY_FILLS:()=>LS,DEFAULT_HIERARCHY_STROKES:()=>ES,DEFAULT_POLAR_SERIES_STROKE:()=>RS,DEFAULT_SEPARATION_LINES_COLOUR:()=>Em,DEFAULT_SHADOW_COLOUR:()=>Hc,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>TS,DEFAULT_TEXTBOX_COLOR:()=>Wm,DEFAULT_TEXTBOX_FILL:()=>Vm,DEFAULT_TEXTBOX_STROKE:()=>Hm,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Om,DEFAULT_TOOLBAR_POSITION:()=>jm,IS_COMMUNITY:()=>fI,IS_DARK_THEME:()=>Ou,IS_ENTERPRISE:()=>mI,PALETTE_ALT_DOWN_FILL:()=>bI,PALETTE_ALT_DOWN_STROKE:()=>vI,PALETTE_ALT_NEUTRAL_FILL:()=>SI,PALETTE_ALT_NEUTRAL_STROKE:()=>IS,PALETTE_ALT_UP_FILL:()=>CI,PALETTE_ALT_UP_STROKE:()=>yI,PALETTE_DOWN_FILL:()=>Nm,PALETTE_DOWN_STROKE:()=>DS,PALETTE_NEUTRAL_FILL:()=>AS,PALETTE_NEUTRAL_STROKE:()=>Ip,PALETTE_UP_FILL:()=>Pm,PALETTE_UP_STROKE:()=>MS});var Ou=Symbol("is-dark-theme"),fI=Symbol("is-community"),mI=Symbol("is-enterprise"),Em=Symbol("default-separation-lines-colour"),wS=Symbol("default-background-colour"),Hc=Symbol("default-shadow-colour"),hc=Symbol("default-caption-layout-style"),uc=Symbol("default-caption-alignment"),MS=Symbol("palette-up-stroke"),DS=Symbol("palette-down-stroke"),Pm=Symbol("palette-up-fill"),Nm=Symbol("palette-down-fill"),Ip=Symbol("palette-neutral-stroke"),AS=Symbol("palette-neutral-fill"),yI=Symbol("palette-alt-up-stroke"),vI=Symbol("palette-alt-down-stroke"),CI=Symbol("palette-alt-up-fill"),bI=Symbol("palette-alt-down-fill"),SI=Symbol("palette-gray-fill"),IS=Symbol("palette-gray-stroke"),RS=Symbol("default-polar-series-stroke"),Ao=Symbol("default-diverging-series-colour-range"),kS=Symbol("default-colour-range"),TS=Symbol("default-sparkline-crosshair-stroke"),Ln=Symbol("default-gauge-series-colour-range"),ca=Symbol("default-funnel-series-colour-range"),LS=Symbol("default-hierarchy-fills"),ES=Symbol("default-hierarchy-strokes"),jt=Symbol("default-financial-charts-annotation-stroke"),Pf=Symbol("default-hierarchy-strokes"),Om=Symbol("default-text-annotation-color"),Di=Symbol("default-financial-charts-annotation-background-fill"),Fm=Symbol("default-annotation-handle-fill"),Bm=Symbol("default-annotation-statistics-fill"),Gm=Symbol("default-annotation-statistics-stroke"),_m=Symbol("default-annotation-statistics-color"),zm=Symbol("default-annotation-statistics-divider-stroke"),Nf=Symbol("default-annotation-statistics-fill"),Of=Symbol("default-annotation-statistics-stroke"),Vm=Symbol("default-textbox-fill"),Hm=Symbol("default-textbox-stroke"),Wm=Symbol("default-textbox-color"),jm=Symbol("default-toolbar-position"),Vr=Symbol("default-gridline-enabled");function q_(e,t){return i=>t(i)?[{...e[0],position:e[1].position},{...e[1],position:e[0].position}]:e}function Um({takeColors:e}){const{fills:[t],strokes:[i]}=e(1);return{fill:t,stroke:i}}function xI(e){return{marker:Um(e)}}function QC(e,t,i,s,o){const{addPhaseFn:n,updatePhaseFn:r,removePhaseFn:a}=o,l=(c,d,h)=>{i.animate({id:`${e}_${t}_${d.id}_${c}`,groupId:e,from:0,to:1,ease:Mf,collapsable:!1,onUpdate(u,p){p&&c!=="removed"||(d.path.clear(!0),h(u,d),d.checkPathDirty())},onStop(){c==="added"&&(d.path.clear(!0),h(1,d),d.checkPathDirty())},phase:Jn[c]})};for(const c of s)i.isSkipped()||(l("removed",c,a),l("updated",c,r)),l("added",c,n)}function it({id:e},t,i,...s){hl(e,t,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function pc({id:e},t,i,...s){hl(e,t,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function wl(e){return{opacity:1}}var mr=class extends cI{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};D([k(xe),ye()],mr.prototype,"enabled",2);D([k(st),ye()],mr.prototype,"color",2);D([k(Ye),ye()],mr.prototype,"xOffset",2);D([k(Ye),ye()],mr.prototype,"yOffset",2);D([k(pe),ye()],mr.prototype,"blur",2);var Q_=class extends Ee{constructor(){super(...arguments),this.enabled=!1}};D([k(xe)],Q_.prototype,"enabled",2);var Ls=class extends Ee{constructor(){super(...arguments),this.enabled=!0,this.interaction=new Q_,this.position=new bp,this.range=void 0,this.class=void 0}formatTooltip(t,i){const s=this.renderer?.(i);return typeof s=="string"?{type:"raw",rawHtmlString:s}:s!=null?{type:"structured",...t,...s}:{type:"structured",...t}}};D([k(xe)],Ls.prototype,"enabled",2);D([k(xe,{optional:!0})],Ls.prototype,"showArrow",2);D([k(Qs,{optional:!0})],Ls.prototype,"renderer",2);D([k(me)],Ls.prototype,"interaction",2);D([k(me)],Ls.prototype,"position",2);D([k(tS,{optional:!0})],Ls.prototype,"range",2);D([k(he,{optional:!0})],Ls.prototype,"class",2);var J_=Ct(["linear","smooth","step"],"a line style"),ez=Ct(["start","middle","end"]),Rp=class extends Ee{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};D([k(J_)],Rp.prototype,"type",2);D([k(rt)],Rp.prototype,"tension",2);D([k(ez)],Rp.prototype,"position",2);var di=class extends Sl{constructor(){super(...arguments),this.xName=void 0,this.defaultColorRange=[],this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Rp,this.shadow=new mr,this.marker=new Ts,this.label=new Bi,this.tooltip=new Ls,this.connectMissingData=!1}};D([k(he)],di.prototype,"xKey",2);D([k(he,{optional:!0})],di.prototype,"xName",2);D([k(he)],di.prototype,"yKey",2);D([k(he,{optional:!0})],di.prototype,"yName",2);D([k(he,{optional:!0})],di.prototype,"yFilterKey",2);D([k(pe,{optional:!0})],di.prototype,"normalizedTo",2);D([k(Uo)],di.prototype,"defaultColorRange",2);D([k(Ec(MG,st))],di.prototype,"fill",2);D([k(rt)],di.prototype,"fillOpacity",2);D([k(st)],di.prototype,"stroke",2);D([k(pe)],di.prototype,"strokeWidth",2);D([k(rt)],di.prototype,"strokeOpacity",2);D([k(ra)],di.prototype,"lineDash",2);D([k(pe)],di.prototype,"lineDashOffset",2);D([k(me)],di.prototype,"interpolation",2);D([k(me)],di.prototype,"shadow",2);D([k(me)],di.prototype,"marker",2);D([k(me)],di.prototype,"label",2);D([k(me)],di.prototype,"tooltip",2);D([k(xe)],di.prototype,"connectMissingData",2);function ea(e){switch(e.type){case"linear":case"step":return[{x:e.x0,y:e.y0},{x:e.x1,y:e.y1}];case"cubic":return[{x:e.cp0x,y:e.cp0y},{x:e.cp3x,y:e.cp3y}]}}function JZ(e){const t=ea(e);return t[0].x>t[1].x&&t.reverse(),t}function e9(e,t){const{x:i,y:s}=t;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s};case"step":return{type:"step",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s,stepX:i};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:i,cp0y:s,cp1x:i,cp1y:s,cp2x:i,cp2y:s,cp3x:i,cp3y:s}}}function Ff(e,t,i){const[s,o]=ea(e),n=o.x!==s.x?(i.x-t.x)/(o.x-s.x):0,r=o.y!==s.y?(i.y-t.y)/(o.y-s.y):0;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:t.x,cp0y:t.y,cp1x:i.x-(e.cp2x-s.x)*n,cp1y:i.y-(e.cp2y-s.y)*r,cp2x:i.x-(e.cp1x-s.x)*n,cp2y:i.y-(e.cp1y-s.y)*r,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y,stepX:i.x-(e.stepX-s.x)*n}}}function tz(e,t,i){const{moveTo:s}=e,[o,n]=JZ(e),{x:r,y:a}=o,{x:l,y:c}=n;if(i<r)return Ff(e,o,o);if(t>l)return Ff(e,n,n);switch(e.type){case"linear":{const d=a===c?void 0:(c-a)/(l-r),h=d==null?a:d*(t-r)+a,u=d==null?a:d*(i-r)+a;return{type:"linear",moveTo:s,x0:t,y0:h,x1:i,y1:u}}case"step":if(i<=e.stepX){const d=e.y0;return{type:"step",moveTo:s,x0:t,y0:d,x1:i,y1:d,stepX:i}}else if(t>=e.stepX){const d=e.y1;return{type:"step",moveTo:s,x0:t,y0:d,x1:i,y1:d,stepX:t}}else{const{y0:d,y1:h,stepX:u}=e;return{type:"step",moveTo:s,x0:t,y0:d,x1:i,y1:h,stepX:u}}case"cubic":{const d=YC(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[h,u]=XC(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,d);const p=YC(u[0].x,u[1].x,u[2].x,u[3].x,i);return[u,h]=XC(u[0].x,u[0].y,u[1].x,u[1].y,u[2].x,u[2].y,u[3].x,u[3].y,p),{type:"cubic",moveTo:s,cp0x:u[0].x,cp0y:u[0].y,cp1x:u[1].x,cp1y:u[1].y,cp2x:u[2].x,cp2y:u[2].y,cp3x:u[3].x,cp3y:u[3].y}}}}function t9(e){const t=[];let i=0,s=NaN,o=NaN;for(const{x:n,y:r}of e){if(i>0){const a=i===1;t.push({type:"linear",moveTo:a,x0:s,y0:o,x1:n,y1:r})}i+=1,s=n,o=r}return t}var i9={start:0,middle:.5,end:1};function s9(e,t){const i=[];let s=0,o=NaN,n=NaN;const r=typeof t=="number"?t:i9[t];for(const{x:a,y:l}of e){if(s>0){const c=s===1,d=o+(a-o)*r;i.push({type:"step",moveTo:c,x0:o,y0:n,x1:a,y1:l,stepX:d})}s+=1,o=a,n=l}return i}var Hy=.05;function o9(e,t){const i=Array.isArray(e)?e:Array.from(e);if(i.length<=1)return[];const s=i.map((n,r)=>{const a=r===0?n:i[r-1],l=r===i.length-1?n:i[r+1],c=r===0||r===i.length-1;if(Math.sign(a.y-n.y)===Math.sign(l.y-n.y))return 0;if(!c){const d=Math.abs(a.y-l.y),h=Math.abs(n.y-a.y)/d,u=Math.abs(n.y-l.y)/d;if(h<=Hy||1-h<=Hy||u<=Hy||1-u<=Hy)return 0}return(l.y-a.y)/(l.x-a.x)});s[1]===0&&(s[0]*=2),s[s.length-2]===0&&(s[s.length-1]*=2);const o=[];for(let n=1;n<i.length;n+=1){const r=i[n-1],a=s[n-1],l=i[n],c=s[n],d=l.x-r.x,h=l.y-r.y;let u=d*t/3,p=d*a*t/3,g=d*t/3,f=d*c*t/3;c===0&&Math.abs(p)>Math.abs(h)&&(u*=Math.abs(h/p),p=Math.sign(p)*Math.abs(h)),a===0&&Math.abs(f)>Math.abs(h)&&(g*=Math.abs(h/f),f=Math.sign(f)*Math.abs(h)),o.push({type:"cubic",moveTo:n===1,cp0x:r.x,cp0y:r.y,cp1x:r.x+u,cp1y:r.y+p,cp2x:l.x-g,cp2y:l.y-f,cp3x:l.x,cp3y:l.y})}return o}function xi(e,t,i){return(t-e)*i+e}function n9(e,t){const{x0:i,y0:s,x1:o,y1:n}=e,a=(n-s)/(o-i)*(t-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:t,leftCp2y:a,stepX:t,stepY0:a,stepY1:a,rightCp1x:t,rightCp1y:a,rightCp2x:o,rightCp2y:n}}function r9(e,t){const{cp0x:i,cp0y:s,cp1x:o,cp1y:n,cp2x:r,cp2y:a,cp3x:l,cp3y:c}=e,d=YC(i,o,r,l,t),[h,u]=XC(i,s,o,n,r,a,l,c,d),p=h[3].y;return{leftCp1x:h[1].x,leftCp1y:h[1].y,leftCp2x:h[2].x,leftCp2y:h[2].y,stepX:t,stepY0:p,stepY1:p,rightCp1x:u[1].x,rightCp1y:u[1].y,rightCp2x:u[2].x,rightCp2y:u[2].y}}function a9(e){const{x0:t,y0:i,x1:s,y1:o,stepX:n}=e;return{leftCp1x:(t+n)/2,leftCp1y:i,leftCp2x:(t+n)/2,leftCp2y:i,stepX:n,stepY0:i,stepY1:o,rightCp1x:(n+s)/2,rightCp1y:o,rightCp2x:(n+s)/2,rightCp2y:o}}function YE(e,t){return e.type==="linear"?n9(e,t):e.type==="cubic"?r9(e,t):a9(e)}function iz(e,t,i,s,o,n,r){switch(t){case 0:r?e.moveTo(o,n):e.moveTo(i,s);break;case 1:r?e.lineTo(o,n):e.lineTo(i,s);break}}function sz(e,t,i,s,o,n){n?e.lineTo(t,i):e.lineTo(s,o)}function oz(e,t,i,s,o,n,r,a,l,c){c?e.cubicCurveTo(n,r,s,o,t,i):e.cubicCurveTo(s,o,n,r,a,l)}function nz(e,t,i,s,o,n,r){r?(e.lineTo(n,o),e.lineTo(n,i),e.lineTo(t,i)):(e.lineTo(n,i),e.lineTo(n,o),e.lineTo(s,o))}function J0(e,t,i,s){const[o,n]=ea(t);switch(iz(e,i,o.x,o.y,n.x,n.y,s),t.type){case"linear":sz(e,t.x0,t.y0,t.x1,t.y1,s);break;case"cubic":oz(e,t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,s);break;case"step":nz(e,t.x0,t.y0,t.x1,t.y1,t.stepX,s);break}}function rz(e,t,i){const[s,o]=ea(e),[n,r]=ea(t),a=xi(s.x,n.x,i),l=xi(s.y,n.y,i),c=xi(o.x,r.x,i),d=xi(o.y,r.y,i);return[{x:a,y:l},{x:c,y:d}]}function eD(e,t,i,s,o,n){const[{x:r,y:a},{x:l,y:c}]=rz(t,i,s);if(iz(e,o,r,a,l,c,n),t.type==="cubic"&&i.type==="cubic"){const d=xi(t.cp1x,i.cp1x,s),h=xi(t.cp1y,i.cp1y,s),u=xi(t.cp2x,i.cp2x,s),p=xi(t.cp2y,i.cp2y,s);oz(e,r,a,d,h,u,p,l,c,n)}else if(t.type==="step"&&i.type==="step"){const d=xi(t.stepX,i.stepX,s);nz(e,r,a,l,c,d,n)}else if(t.type==="linear"&&i.type==="linear")sz(e,r,a,l,c,n);else{let d;t.type==="step"?d=t.stepX:i.type==="step"?d=i.stepX:d=(r+l)/2;const h=YE(t,d),u=YE(i,d),p=xi(h.leftCp1x,u.leftCp1x,s),g=xi(h.leftCp1y,u.leftCp1y,s),f=xi(h.leftCp2x,u.leftCp2x,s),y=xi(h.leftCp2y,u.leftCp2y,s),m=xi(h.stepX,u.stepX,s),C=xi(h.stepY0,u.stepY0,s),b=xi(h.stepY1,u.stepY1,s),S=xi(h.rightCp1x,u.rightCp1x,s),A=xi(h.rightCp1y,u.rightCp1y,s),R=xi(h.rightCp2x,u.rightCp2x,s),I=xi(h.rightCp2y,u.rightCp2y,s);n?(e.cubicCurveTo(R,I,S,A,m,b),e.lineTo(m,C),e.cubicCurveTo(f,y,p,g,r,a)):(e.cubicCurveTo(p,g,f,y,m,C),e.lineTo(m,b),e.cubicCurveTo(S,A,R,I,l,c))}}var az=(e=>(e[e.Zero=0]="Zero",e[e.Split=1]="Split",e))(az||{});function l9(e,t){return e==null||t==null||typeof e!="object"||typeof t!="object"?!1:"id"in e&&"id"in t?e.id===t.id:e.toString()===t.toString()}function vs(e,t){if(!t)return NaN;if(e instanceof Date&&(e=e.getTime()),t.type==="continuous"&&typeof e=="number")return(e-t.domain[0])/(t.domain[1]-t.domain[0])*(t.range[1]-t.range[0])+t.range[0];if(t.type==="log"&&typeof e=="number")return t.convert(e);if(t.type!=="category")return NaN;const i=t.domain.findIndex(o=>o===e);return i>=0||t.domain.findIndex(o=>l9(e,o))>=0?t.inset+t.step*i:NaN}function Cn(e){return B0(e).valueOf()}function XE({data:e},t){return e.map((i,s)=>({xValue0Index:t.indexOf(Cn(i.xValue0)),xValue1Index:t.indexOf(Cn(i.xValue1)),datumIndex:s}))}function c9(e,t){const i=t.scales.x,s=e.scales.x;if(i?.type!=="category"||s?.type!=="category")return!0;let o=-1/0;for(const n of i.domain){const r=vs(n,s);if(Number.isFinite(r)){if(r<o)return!1;o=r}}return!0}function d9(e,t){let i=-1/0;for(const s of e){const o=vs(s.value,t.scales.x);if(Number.isFinite(o)){if(o<i)return!1;i=o}}return!0}function h9(e,t){const i=new Map;for(const{xValue0:d,xValue1:h}of e.data){const u=Cn(d),p=Cn(h);i.set(u,d).set(p,h)}const s=Array.from(i,([d,h])=>({axisValue:d,value:h}));s.sort((d,h)=>vs(d.value,e.scales.x)-vs(h.value,e.scales.x));const o=[];for(const{xValue0:d,xValue1:h}of t.data){const u=Cn(d),p=Cn(h);i.has(u)||(i.set(u,d),o.push({axisValue:u,value:d})),i.has(p)||(i.set(p,h),o.push({axisValue:p,value:h}))}o.sort((d,h)=>vs(d.value,t.scales.x)-vs(h.value,t.scales.x));const n=s;let r=0;for(const d of o){for(let h=n.length-1;h>r;h-=1){const u=vs(d.value,t.scales.x),p=vs(n[h].value,t.scales.x);if(u>p){r=h+1;break}}n.splice(r,0,d),r+=1}if(!d9(n,t))return;const a=n.map(d=>d.axisValue),l=XE(t,a),c=XE(e,a);return{axisValues:a,oldDataAxisIndices:l,newDataAxisIndices:c}}function ZE(e,t,i){if(i.xValue1Index===i.xValue0Index+1)return e;const s=ea(e),o=(s[1].x-s[0].x)/(i.xValue1Index-i.xValue0Index),n=s[0].x+(t-i.xValue0Index)*o,r=n+o;return tz(e,n,r)}function lz(e,t){const[i,s]=ea(e),o=vs(0,t.scales.y);return Ff(e,{x:i.x,y:o},{x:s.x,y:o})}function cz(e){const[t,i]=ea(e);return e9(e,{x:(t.x+i.x)/2,y:(t.y+i.y)/2})}function dz(e,t,i,s,o,n){let r,a;if(o.xValue0Index>=n.xValue1Index){const h=s.findLast(p=>p.xValue1Index<=n.xValue1Index)?.datumIndex,u=h!=null?i.data[h]:void 0;r=u?.xValue1,a=u?.yValue1}else if(o.xValue0Index<=n.xValue0Index){const h=s.find(p=>p.xValue0Index>=n.xValue0Index)?.datumIndex,u=h!=null?i.data[h]:void 0;r=u?.xValue0,a=u?.yValue0}if(r==null||a==null)switch(t){case 0:return lz(e,i);case 1:return cz(e)}const l=vs(r,i.scales.x),c=vs(a,i.scales.y),d={x:l,y:c};return Ff(e,d,d)}function wI(e,t){if(t==null)return;const i=Cn(e.xValue0),s=Cn(e.xValue1);return t.find(o=>Cn(o.xValue0)===i&&Cn(o.xValue1)===s)?.span}function qE(e,t,i,s,o,n,r){const a=e.data[s.datumIndex],l=a.span,c=wI(a,o);if(c!=null)r.removed.push({from:c,to:c}),r.moved.push({from:c,to:l}),r.added.push({from:l,to:l});else{const d=dz(l,t,e,i,s,n);r.added.push({from:d,to:l})}}function QE(e,t,i,s,o,n,r){const a=e.data[s.datumIndex],l=a.span,c=wI(a,o);if(c!=null)r.removed.push({from:l,to:l}),r.moved.push({from:l,to:c}),r.added.push({from:c,to:c});else{const d=dz(l,t,e,i,s,n);r.removed.push({from:l,to:d})}}function JE(e,t,i,s,o){const n=t[o.xValue0Index],r=i.data.find(y=>Cn(y.xValue0)===n),a=t[o.xValue1Index],l=i.data.find(y=>Cn(y.xValue1)===a);if(r==null||l==null)return;const[{x:c},{x:d}]=ea(e),h=vs(r.xValue0,i.scales.x),u=vs(r.yValue0,i.scales.y),p=vs(l.xValue1,i.scales.x),g=vs(l.yValue1,i.scales.y);let f=s.data[o.datumIndex].span;return f=Ff(f,{x:h,y:u},{x:p,y:g}),f=tz(f,c,d),f}function u9(e,t,i,s,o,n,r,a,l){const c=o+1,d=r.find(b=>b.xValue0Index<=o&&b.xValue1Index>=c),h=n.find(b=>b.xValue0Index<=o&&b.xValue1Index>=c),u=t.zeroData,p=e.zeroData;if(d==null&&h!=null){qE(e,i,n,h,u,a,l);return}else if(d!=null&&h==null){QE(t,i,r,d,p,a,l);return}else if(d==null||h==null)return;let g;d.xValue0Index===h.xValue0Index&&d.xValue1Index===h.xValue1Index?g=0:d.xValue0Index<=h.xValue0Index&&d.xValue1Index>=h.xValue1Index?g=-1:d.xValue0Index>=h.xValue0Index&&d.xValue1Index<=h.xValue1Index?g=1:g=0;const f=t.data[d.datumIndex],y=ZE(f.span,o,d),m=e.data[h.datumIndex],C=ZE(m.span,o,h);if(g===1){const b=JE(y,s,t,e,h);b!=null?(l.removed.push({from:y,to:b}),l.moved.push({from:b,to:C}),l.added.push({from:C,to:C})):QE(t,i,r,d,p,a,l)}else if(g===-1){const b=JE(C,s,e,t,d);b!=null?(l.removed.push({from:y,to:y}),l.moved.push({from:y,to:b}),l.added.push({from:b,to:C})):qE(e,i,n,h,u,a,l)}else l.removed.push({from:y,to:y}),l.moved.push({from:y,to:C}),l.added.push({from:C,to:C})}function p9(e,t,i,s){const o={removed:[],moved:[],added:[]},{axisValues:n,oldDataAxisIndices:r,newDataAxisIndices:a}=e,l={xValue0Index:Math.max(r.at(0)?.xValue0Index??-1/0,a.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(r.at(-1)?.xValue1Index??1/0,a.at(-1)?.xValue1Index??1/0)};for(let c=0;c<n.length-1;c+=1)u9(t,i,s,n,c,a,r,l,o);return o}function eP(e,t,i){const{span:s}=t;switch(i){case 0:return wI(t,e.zeroData)??lz(s,e);case 1:return cz(s)}}function g9(e,t,i){const s=[],o=[];for(const n of t.data){const r=n.span,a=eP(t,n,i);o.push({from:r,to:a})}for(const n of e.data){const r=n.span,a=eP(e,n,i);s.push({from:a,to:r})}return{removed:o,moved:[],added:s}}function lf(e,t,i){if(!c9(e,t))return;const s=h9(e,t);return s==null?g9(e,t,i):p9(s,e,t,i)}function tP(e){return e.type==="continuous"||e.type==="log"}function iP(e){return e.type==="category"}function Fu(e,t){return e===void 0||t===void 0?e!==void 0||t!==void 0:tP(e)&&tP(t)?e.type===t.type&&Kr(e.domain,t.domain)&&Kr(e.range,t.range):iP(e)&&iP(t)?e.inset===t.inset&&e.step===t.step&&Kr(e.domain,t.domain):!1}function Bf(e){return e==null?!1:e.type==="category"?e.domain.every(t=>t!=null):e.domain.every(t=>Number.isFinite(t)||t instanceof Date)&&e.range.every(t=>Number.isFinite(t))}function JC(e,t){let i;const s=e.map(o=>o.point);switch(t.type){case"linear":i=t9(s);break;case"smooth":i=o9(s,t.tension);break;case"step":i=s9(s,t.position);break}return i.map((o,n)=>({span:o,xValue0:e[n].xDatum,yValue0:e[n].yDatum,xValue1:e[n+1].xDatum,yValue1:e[n+1].yDatum}))}function hz(e,t,i=.001){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}function MI({path:e},t){let i;for(const{span:s}of t){const[o,n]=ea(s),r=i!=null&&hz(i,o)?1:0;J0(e,s,r,!1),i=n}}function dC(e,t,i){let s;for(const o of i){const[n,r]=rz(o.from,o.to,e),a=s!=null&&hz(s,n)?1:0;eD(t.path,o.from,o.to,e,a,!1),s=r}}function DI(e,t,i){const s=(a,l)=>dC(a,l,t.removed),o=(a,l)=>dC(a,l,t.moved),n=(a,l)=>dC(a,l,t.added),r=AI(e,i);return{status:e,path:{addPhaseFn:n,updatePhaseFn:o,removePhaseFn:s},pathProperties:r}}function AI(e,t){const i=t==="none"?"updated":e,s={fromFn:o=>{let n;return e==="removed"?n={finish:{visible:!1}}:e==="added"?n={start:{visible:!0}}:n={},{phase:Jn[i],...n}},toFn:o=>({phase:Jn[i]})};return t==="fade"?{fromFn:o=>({opacity:e==="added"?0:o.opacity,...s.fromFn(o)}),toFn:o=>({opacity:e==="removed"?0:1,...s.toFn(o)})}:s}function uz(e,t,i){const s=e.scales.x?.type==="category",o=t.scales.x?.type==="category";if(s!==o||!Bf(e.scales.x)||!Bf(t.scales.x)||e.strokeData==null||t.strokeData==null)return;let n="updated";t.visible&&!e.visible?n="removed":!t.visible&&e.visible&&(n="added");const r=lf({scales:e.scales,data:e.strokeData.spans},{scales:t.scales,data:t.strokeData.spans},1);if(r==null)return;const a=DI(n,r,"fade"),l=(i?.changed??!0)||!Fu(e.scales.x,t.scales.x)||!Fu(e.scales.y,t.scales.y)||n!=="updated";return{status:n,stroke:a,hasMotion:l}}function pz({path:e},{spans:t,phantomSpans:i}){for(let s=0;s<t.length;s+=1){const{span:o}=t[s],n=i[s].span;J0(e,o,0,!1),J0(e,n,1,!0),e.closePath()}}function hC(e,{path:t},i,s){for(let o=0;o<i.length;o+=1){const n=i[o],r=s[o];eD(t,n.from,n.to,e,0,!1),eD(t,r.from,r.to,e,1,!0),t.closePath()}}function gz(e,t,i,s){const o=(l,c)=>hC(l,c,t.removed,i.removed),n=(l,c)=>hC(l,c,t.moved,i.moved),r=(l,c)=>hC(l,c,t.added,i.added),a=AI(e,s);return{status:e,path:{addPhaseFn:r,updatePhaseFn:n,removePhaseFn:o},pathProperties:a}}function fz(e,t){const i=e.scales.x?.type==="category",s=t.scales.x?.type==="category";if(i!==s||!Bf(e.scales.x)||!Bf(t.scales.x))return;let o="updated";t.visible&&!e.visible?o="removed":!t.visible&&e.visible&&(o="added");const n=lf({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},0);if(n==null)return;const r=lf({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},0);if(r==null)return;const a=lf({scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},{scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},0);if(a==null)return;const l="none",c=gz(o,n,r,l),d=DI(o,a,l);return{status:o,fill:c,stroke:d}}function Gf({id:e},t,i,...s){const o={phase:i?Jn[i]:"trailing"};hl(e,"markers",t,s,{opacity:0},{opacity:1},o),s.forEach(n=>n.cleanup())}function II({id:e},t,...i){hl(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(s=>s.cleanup())}function RI({id:e,nodeDataDependencies:t},i,...s){const o=t.seriesRectWidth;Wt(e,"markers",i,s,{fromFn:(a,l)=>{const c=l.midPoint?.x??o;let d=Pe(0,rG(c/o),1);return isNaN(d)&&(d=0),{scalingX:0,scalingY:0,delay:d,duration:FC,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function Km(e){return{opacity:1,scalingX:1,scalingY:1}}function _f(e,t){return{translationX:t.point?.x??NaN,translationY:t.point?.y??NaN}}function $m(e,{datumIndex:t}){const i=e.getNodeData();if(i===void 0)return;const s=i[t],{point:o}=s;if(s==null||o==null)return;const n=4+(o.focusSize??e.getFormattedMarkerStyle(s).size),r=n/2,a=s.point.x-r,l=s.point.y-r;return $t.toCanvas(e.contentGroup,new ve(a,l,n,n))}function kI({id:e,visible:t,nodeDataDependencies:i},s,...o){const{seriesRectWidth:n,seriesRectHeight:r}=i;hl(e,"path_properties",s,o,{clipX:0},{clipX:n},{phase:"initial",start:{clip:!0,clipY:r,visible:t},finish:{clip:!1,visible:t}})}function eb({id:e},t,i,s="add",...o){hl(e,t,i,o,{opacity:0},{opacity:1},{phase:s})}function TI(e){return t=>({visible:e.getVisible(),opacity:e.getOpacity(),clipScalingX:1,clip:!1})}function tb({nodeDataDependencies:e},t){const i=s=>isFinite(s)?s:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}var f9=.125,m9=.25,LI=class extends _c{constructor(e){super({moduleCtx:e,directionKeys:Ch,directionNames:bh,pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:TI({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:wl,marker:(t,i)=>({...Km(),..._f(t,i)})}}),this.properties=new di,this.connectsToYAxis=!0,this.backgroundGroup=new Me({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){return super.renderToOffscreenCanvas()||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>ZC||this.contextNodeData.strokeData.spans.length>ZC)}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}attachPaths([e,t]){this.backgroundGroup.appendChild(e),this.contentGroup.appendChild(t),t.zIndex=-1}detachPaths([e,t]){this.backgroundGroup.removeChild(e),this.contentGroup.removeChild(t)}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}setSeriesIndex(e){const t=this.isStacked();return!super.setSeriesIndex(e)&&this._isStacked===t?!1:(this._isStacked=t,t?(this.backgroundGroup.zIndex=[0,e],this.contentGroup.zIndex=[1,e,0]):(this.backgroundGroup.zIndex=[1,e,0,0],this.contentGroup.zIndex=[1,e,0,1]),!0)}async processData(e){if(this.data==null||!this.properties.isValid())return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:o=1}={}}=this,{xKey:n,yKey:r,yFilterKey:a,connectMissingData:l,normalizedTo:c}=this.properties,d=!this.ctx.animationManager.isSkipped(),h=this.axes.x?.scale,u=this.axes.y?.scale,{xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:h,yScale:u}),f={value:`area-stack-${s}-yValue`,values:`area-stack-${s}-yValues`,stack:`area-stack-${s}-yValue-stack`,marker:`area-stack-${s}-yValues-marker`},y=[];oC(c)&&y.push(bS(Object.values(f),c)),d&&y.push(Sp());const m={invalidValue:null};(oC(c)||l)&&o>1&&(m.invalidValue=0),i||(m.forceValue=0),await this.requestDataModel(e,t,{props:[or(n,p,{id:"xValue"}),ze(r,g,{id:"yValueRaw",...m}),...a!=null?[ze(a,g,{id:"yFilterRaw"})]:[],...P_(r,g,{id:"yValueStack",...m,groupId:f.stack}),ze(r,g,{id:"yValue",...m,groupId:f.value}),...Sc(r,"window","current",{id:"yValueEnd",...m,groupId:f.values},g),...Sc(r,"normal","current",{id:"yValueCumulative",...m,groupId:f.marker},g),...y],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),o=i.enabled?.5*i.size*t:0;return[s-o,s+o]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),o=i.enabled?.5*i.size*t:0;return[s-o,s+o]}getSeriesDomain(e){const{processedData:t,dataModel:i,axes:s}=this;if(!t||!i)return[];const o=s.y;if(e==="x"){const r=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",t);return r?.def.type==="key"&&r.def.valueType==="category"?a:Co(Cl(a))}const n=this.domainForClippedRange("y",["yValueEnd"],"xValue",!0);if(o instanceof Sh||o instanceof vh)return Co(n);{const r=Number.isFinite(n[1]-n[0])?[n[0]>0?0:n[0],n[1]<0?0:n[1]]:[];return Co(r)}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange("y",["yValueEnd"],"xValue",t,!0);return[Math.min(i,0),Math.max(s,0)]}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValueEnd"],e,t,i)}createNodeData(){const{axes:e,data:t,processedData:i,dataModel:s}=this,o=e.x,n=e.y;if(!o||!n||!t||!s||i?.type!=="grouped"||!this.properties.isValid())return;const{yKey:r,xKey:a,yFilterKey:l,marker:c,label:d,fill:h,stroke:u,connectMissingData:p,interpolation:g}=this.properties,{scale:f}=o,{scale:y}=n,{isContinuousY:m}=this.getScaleInformation({xScale:f,yScale:y}),C=(f.bandwidth??0)/2,b=s.resolveKeysById(this,"xValue",i),S=s.resolveColumnById(this,"yValueEnd",i),A=s.resolveColumnById(this,"yValueRaw",i),R=s.resolveColumnById(this,"yValueCumulative",i),I=l!=null?s.resolveColumnById(this,"yFilterRaw",i):void 0,w=s.resolveColumnById(this,"yValueStack",i),M=(Z,ee,se)=>{let j;return(oC(this.properties.normalizedTo)?m&&oS(se):!isNaN(se))&&(j=ee),{x:f.convert(Z)+C,y:y.convert(j),size:c.size}},T=[],E=[],{visibleSameStackCount:P}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let N=!1;const{dataSources:F}=i,_=F.get(this.id)??[];for(const{datumIndex:Z}of s.forEachGroupDatum(this,i)){const ee=b[Z];if(ee==null)return;const se=_[Z],j=A[Z],X=R[Z],$=S[Z],J=Number.isFinite(j),ie=M(ee,+X,j),ne=I!=null?I[Z]===j:void 0;if(ne===!1&&(N=!0),J&&c&&E.push({series:this,itemId:r,datum:se,datumIndex:Z,midPoint:{x:ie.x,y:ie.y},cumulativeValue:$,yValue:j,xValue:ee,yKey:r,xKey:a,point:ie,fill:c.fill??h,stroke:c.stroke??u,strokeWidth:c.strokeWidth??this.getStrokeWidth(this.properties.strokeWidth),selected:ne}),J&&d){const K=this.getLabelText(d,{value:j,datum:se,xKey:a,yKey:r,xName:this.properties.xName,yName:this.properties.yName});T.push({series:this,itemId:r,datum:se,datumIndex:Z,x:ie.x,y:ie.y,labelText:K})}}const W=Z=>Z.flatMap(ee=>Array.isArray(ee)?JC(ee,g):new Array(ee.skip).fill(null)),z=(Z,ee)=>({point:{x:f.convert(Z)+C,y:y.convert(ee)},xDatum:Z,yDatum:ee}),U=Z=>{const ee=[];for(const{datumIndexes:[se,j,X]}of s.forEachGroupDatumTuple(this,i)){const $=b[j],J=w[j],ie=J[Z],ne=Number.isFinite(ie);if(p&&!ne)continue;const K=se!=null?w[se]:void 0,oe=X!=null?w[X]:void 0;let de=0,re=0;for(let be=0;be<=Z;be+=1){const Se=J[be];if(Number.isFinite(Se)){const Fe=K==null||Number.isFinite(K[be]),dt=oe==null||Number.isFinite(oe[be]);Fe&&(de+=Se),dt&&(re+=Se)}}const ce=ee[ee.length-1];if(!p&&(de!==re||!ne))if(!ne&&Array.isArray(ce)&&ce.length===1)ee[ee.length-1]={skip:1};else{const be=z($,de),Se=z($,re);Array.isArray(ce)?ce.push(be):ce!=null&&(ce.skip+=1),ee.push(ne?[Se]:{skip:0})}else{const be=Math.max(de,re),Se=z($,be);Array.isArray(ce)?ce.push(Se):ce!=null?(ce.skip+=1,ee.push([Se])):ee.push([Se])}}return W(ee)},G=this.seriesGrouping?.stackIndex??0,V=()=>{const Z=Array.from(s.forEachGroupDatum(this,i),({datumIndex:ee})=>{const se=b[ee],X=w[ee][G];if(!(p&&!Number.isFinite(X)))return z(se,0)}).filter(ee=>ee!=null);return JC(Z,g)},O=U(G),H=O.map(()=>null);for(let Z=G-1;Z>=-1;Z-=1){let ee;for(let se=0;se<H.length;se+=1)H[se]==null&&(ee??(ee=Z!==-1?U(Z):V()),H[se]=ee[se])}const B=O.map((Z,ee)=>Z??H[ee]),Y=O.filter(Z=>Z!=null);return{itemId:r,fillData:{itemId:r,spans:B,phantomSpans:H},strokeData:{itemId:r,spans:Y},labelData:T,nodeData:E,scales:this.calculateScaling(),visible:this.visible,stackVisible:P>0,crossFiltering:N}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{opacity:t,visible:i,animationEnabled:s}=e,[o,n]=e.paths,r=this.contextNodeData?.crossFiltering===!0,a=this.getStrokeWidth(this.properties.strokeWidth);n.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:a,strokeOpacity:this.properties.strokeOpacity*(r?m9:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:t,visible:i||s});const{fill:l}=this.properties;if(BG(l)){const c=this.getGradientFillOptions(l,this.properties.defaultColorRange);o.gradientFillOptions=c}o.setProperties({stroke:void 0,lineJoin:"round",pointerEvents:1,fill:this.properties.fill,fillOpacity:this.properties.fillOpacity*(r?f9:1),fillShadow:this.properties.shadow,opacity:t,visible:i||s}),tb(this,n),tb(this,o)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const i of e)i.path.clear(),i.markDirty()}updateFillPath(e,t){const[i]=e;i.path.clear(),pz(i,t.fillData),i.markDirty()}updateStrokePath(e,t){const{spans:i}=t.strokeData,[,s]=e;s.path.clear(),MI(s,i),s.markDirty()}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e,s=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(s?t:[])}getMarkerItemBaseStyle(e){const{marker:t}=this.properties,i=e?this.properties.highlightStyle.item:void 0;return{fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??t.strokeWidth,strokeOpacity:i?.strokeOpacity??t.strokeOpacity}}getMarkerItemStyleOverrides(e,t,i,s,o,n){const{marker:r}=this.properties,{itemStyler:a}=r;if(a==null)return;const{id:l,properties:c}=this,{xKey:d,yKey:h}=c,{xDomain:u,yDomain:p}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));return this.cachedDatumCallback(ci(e,n?"highlight":"node"),()=>a({seriesId:l,...bc(t,d,h,u,p),xValue:i,yValue:s,highlighted:n,...o}))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:o,marker:n,fill:r,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:d,highlightStyle:h}=this.properties,u=this.getSeriesDomain("x"),p=this.getSeriesDomain("y"),g=_e(i&&h.item,n.getStyle(),{fill:r,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:d});t.each((f,y)=>{this.updateMarkerStyle(f,n,{...bc(y,s,o,u,p),highlighted:i},g,{selected:y.selected})}),i||this.properties.marker.markClean()}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{enabled:i,fontStyle:s,fontWeight:o,fontSize:n,fontFamily:r,color:a}=this.properties.label;t.each((l,c)=>{const{x:d,y:h,labelText:u}=c;u&&i&&this.visible?(l.fontStyle=s,l.fontWeight=o,l.fontSize=n,l.fontFamily=r,l.textAlign="center",l.textBaseline="bottom",l.text=u,l.x=d,l.y=h-10,l.fill=a,l.visible=!0):l.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:n}=this,{xKey:r,xName:a,yKey:l,yName:c,tooltip:d}=n,h=o.x,u=o.y;if(!i||!s||!h||!u)return;const{datumIndex:p}=e,g=s.dataSources.get(this.id)?.[p],f=i.resolveKeysById(this,"xValue",s)[p],y=i.resolveColumnById(this,"yValueRaw",s)[p];if(f==null)return;const m=this.getMarkerItemBaseStyle(!1);return Object.assign(m,this.getMarkerItemStyleOverrides(String(p),g,f,y,m,!1)),d.formatTooltip({heading:h.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:u.formatDatum(y)}]},{seriesId:t,datum:g,title:c,xKey:r,xName:a,yKey:l,yName:c,...m,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:o,lineDash:n,marker:r}=this.properties,a=!r.enabled||r.fill===void 0;return{marker:{shape:r.shape,fill:a?e:r.fill,fillOpacity:a?i:r.fillOpacity,stroke:r.stroke??t,strokeOpacity:r.strokeOpacity,strokeWidth:r.strokeWidth,lineDash:r.lineDash,lineDashOffset:r.lineDashOffset,enabled:r.enabled||o<=0},line:{stroke:t,strokeOpacity:s,strokeWidth:o,lineDash:n}}}getLegendData(e){if(!this.properties.isValid()||e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:o,yName:n,legendItemName:r,showInLegend:a}=this.properties;return[{legendType:e,id:t,itemId:o,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:o}),label:{text:r??n??o},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!a}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,contextData:s,paths:o}=e,{animationManager:n}=this.ctx;this.updateAreaPaths(o,s),kI(this,n,...o),Wi([t],_f),RI(this,n,t),it(this,"labels",n,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{markerSelection:i,labelSelection:s,contextData:o,paths:n,previousContextData:r}=e,[a,l]=n;if(a==null&&l==null)return;this.resetMarkerAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(n,o)},d=()=>{t.skipCurrentBatch(),c()};if(o==null||r==null){c(),Gf(this,t,"added",i),eb(this,"fill_path_properties",t,"add",a),eb(this,"stroke_path_properties",t,"add",l),it(this,"labels",t,s);return}if(o.crossFiltering!==r.crossFiltering){d();return}const h=fz(o,r);if(h===void 0){d();return}else if(h.status==="no-op")return;Gf(this,t,void 0,i),Wt(this.id,"fill_path_properties",t,[a],h.fill.pathProperties),QC(this.id,"fill_path_update",t,[a],h.fill.path),Wt(this.id,"stroke_path_properties",t,[l],h.stroke.pathProperties),QC(this.id,"stroke_path_update",t,[l],h.stroke.path),it(this,"labels",t,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(n,o)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Me}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=e,s=this.getSeriesDomain("x"),o=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,{...bc(e,t,i,s,o),highlighted:!0})}computeFocusBounds(e){return $m(this,e)}};LI.className="AreaSeries";LI.type="area";var y9={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:e=>new LI(e),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{nodeClickRange:"nearest",tooltip:{position:{type:"node"}},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Hc,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear",tension:1,position:"end"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:0},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}},paletteFactory:e=>{const{marker:t}=xI(e),i=e.themeTemplateParameters.get(kS);return{fill:t.fill,stroke:t.stroke,marker:t,defaultColorRange:i}}};function EI(e,t){for(const i of t){const s=i.datum;s===void 0?ue.error("undefined datum"):e.addValue(i,s)}}function PI(e,t){const{x:i,y:s}=t,{nearest:o,distanceSquared:n}=e.getQuadTree().find(i,s);if(o!==void 0)return{datum:o.value,distance:Math.sqrt(n)}}var NI=class extends Sl{constructor(){super(...arguments),this.direction="vertical"}};D([k(IG)],NI.prototype,"direction",2);var mz=class extends _c{constructor(){super(...arguments),this.groupScale=new bm,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(e,t){const i=typeof t=="boolean"?1:.5,s=Qe(this.smallestDataInterval)?this.smallestDataInterval*i:0,o=Cl(e)??[NaN,NaN];return typeof t=="boolean"?o[t?0:1]-=(t?1:-1)*s:(o[0]-=s,o[1]+=s),Co(o)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return this.properties.direction==="vertical"}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const e=this.getBarDirection();return this.axes[e]}getCategoryAxis(){const e=this.getCategoryDirection();return this.axes[e]}getBandwidth(e){return nt.is(e.scale)?e.scale.calcBandwidth(this.smallestDataInterval):e.scale.bandwidth}xCoordinateRange(e){const t=this.axes[this.getCategoryDirection()],i=t.scale,s=this.getBandwidth(t)??0,o=nt.is(i)?s*-.5:0,n=i.convert(e)+o;return[n,n+s]}yCoordinateRange(e){const i=this.axes[this.getBarDirection()].scale,s=e.map(o=>i.convert(o));if(s.length===1){const o=i.convert(0);return[Math.min(s[0],o),Math.max(s[0],o)]}return[Math.min(...s),Math.max(...s)]}updateGroupScale(e){const t=[],{groupScale:i}=this,s=this.getBandwidth(e),{index:o,visibleGroupCount:n}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);for(let a=0;a<n;a++)t.push(String(a));return i.domain=t,i.range=[0,s??0],e instanceof wp?i.paddingInner=e.groupPaddingInner:e instanceof yp?(i.paddingInner=e.groupPaddingInner,i.round=i.padding!==0):i.padding=0,{barWidth:i.bandwidth>=1?i.bandwidth:i.rawBandwidth,groupIndex:o}}resolveKeyDirection(e){return this.getBarDirection()==="x"?e==="x"?"y":"x":e}initQuadTree(e){EI(e,this.datumNodesIter())}pickNodeClosestDatum(e){return PI(this,e)}},OI=class extends Bi{constructor(){super(...arguments),this.placement="inside-center",this.padding=0}};D([k(Ct(["inside-center","inside-start","inside-end","outside-start","outside-end"],"a placement"))],OI.prototype,"placement",2);D([k(Ye)],OI.prototype,"padding",2);var Yt=class extends NI{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.crisp=void 0,this.shadow=new mr,this.label=new OI,this.tooltip=new Ls,this.sparklineMode=!1,this.fastDataProcessing=!1}};D([k(he)],Yt.prototype,"xKey",2);D([k(he,{optional:!0})],Yt.prototype,"xName",2);D([k(he)],Yt.prototype,"yKey",2);D([k(he,{optional:!0})],Yt.prototype,"yName",2);D([k(he,{optional:!0})],Yt.prototype,"yFilterKey",2);D([k(he,{optional:!0})],Yt.prototype,"stackGroup",2);D([k(Ye,{optional:!0})],Yt.prototype,"normalizedTo",2);D([k(st)],Yt.prototype,"fill",2);D([k(rt)],Yt.prototype,"fillOpacity",2);D([k(st)],Yt.prototype,"stroke",2);D([k(pe)],Yt.prototype,"strokeWidth",2);D([k(rt)],Yt.prototype,"strokeOpacity",2);D([k(ra)],Yt.prototype,"lineDash",2);D([k(pe)],Yt.prototype,"lineDashOffset",2);D([k(pe)],Yt.prototype,"cornerRadius",2);D([k(xe,{optional:!0})],Yt.prototype,"crisp",2);D([k(Qs,{optional:!0})],Yt.prototype,"itemStyler",2);D([k(me,{optional:!0})],Yt.prototype,"shadow",2);D([k(me)],Yt.prototype,"label",2);D([k(me)],Yt.prototype,"tooltip",2);D([k(xe)],Yt.prototype,"sparklineMode",2);D([k(xe)],Yt.prototype,"fastDataProcessing",2);function yz(e,t,i,s){if(t!=null){const[o,n]=t;if(o!==0||n!==1)return!1}if(nt.is(e)){const o=e.calcBandwidth(s)-e.calcBandwidth(i);if(o>0&&o<1)return!1}return!0}var kw=e=>Wb(e.yValue??0);function zf(e,t,i){const{startingX:s,startingY:o}=C9(e,t);return{isVertical:e,calculate:(r,a)=>{let l=e?r.x:s,c=e?o:r.y,d=e?r.width:0,h=e?0:r.height;const{opacity:u=1}=r;a&&(isNaN(l)||isNaN(c))&&({x:l,y:c}=a,d=e?a.width:0,h=e?0:a.height,e&&!kw(a)?c+=a.height:!e&&kw(a)&&(l+=a.width));let p;return r.clipBBox==null?p=void 0:kw(r)?p=e?new ve(l,c-h,d,h):new ve(l-d,c,d,h):p=new ve(l,c,d,h),{x:l,y:c,width:d,height:h,clipBBox:p,opacity:u}},mode:i}}function v9(e,t){return{isVertical:e,calculate:i=>({x:e?i.x:i.x+i.width/2,y:e?i.y+i.height/2:i.y,width:e?i.width:0,height:e?0:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1}),mode:t}}function Vf(e){const t=n=>n==null||isNaN(n.x)||isNaN(n.y);return{toFn:(n,r,a)=>a==="removed"&&n.datum==null&&e.mode==="fade"?{...Hf(n,r),opacity:0}:a==="removed"||t(r)?e.calculate(r,n.previousDatum):{x:r.x,y:r.y,width:r.width,height:r.height,clipBBox:r.clipBBox,opacity:r.opacity??1},fromFn:(n,r,a)=>{a==="updated"&&t(r)?a="removed":a==="updated"&&t(n.previousDatum)&&(a="added");let l;a==="added"&&n.previousDatum==null&&e.mode==="fade"?l={...Hf(n,r),opacity:0}:a==="unknown"||a==="added"?l=e.calculate(r,n.previousDatum):l={x:n.x,y:n.y,width:n.width,height:n.height,clipBBox:n.clipBBox,opacity:n.opacity??1};const c=Jn[a];return{...l,phase:c}},applyFn:(n,r,a)=>{n.setProperties(r),n.crisp=a==="end"&&(n.datum?.crisp??!1)}}}function C9(e,t){const i=t[e?"y":"x"];let s=1/0,o=0;return i?(e?o=i.scale.convert(nt.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(nt.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:o}):{startingX:s,startingY:o}}function Hf(e,{x:t,y:i,width:s,height:o,clipBBox:n,opacity:r=1}){return{x:t,y:i,width:s,height:o,clipBBox:n,opacity:r,crisp:e.datum?.crisp??!1}}function FI(e,t){if(t===void 0)return;const{x:i,y:s,width:o,height:n}=t;return $t.toCanvas(e.contentGroup,new ve(i,s,o,n))}function vz(e,t,i){if(t.enabled&&i){const{x:s,y:o,text:n,textAlign:r,textBaseline:a}=i,{color:l,fontStyle:c,fontWeight:d,fontSize:h,fontFamily:u}=t;e.setProperties({visible:!0,x:s,y:o,text:n,fill:l,fontStyle:c,fontWeight:d,fontSize:h,fontFamily:u,textAlign:r,textBaseline:a})}else e.visible=!1}var b9={"inside-start":{inside:!0,direction:-1,textAlignment:1},"inside-end":{inside:!0,direction:1,textAlignment:-1},"outside-start":{inside:!1,direction:-1,textAlignment:-1},"outside-end":{inside:!1,direction:1,textAlignment:1}};function Cz({isUpward:e,isVertical:t,placement:i,padding:s=0,rect:o}){let n=o.x+o.width/2,r=o.y+o.height/2,a="center",l="middle";if(i!=="inside-center"){const c=(e?1:-1)*(t?-1:1),{direction:d,textAlignment:h}=b9[i],u=(d+1)*.5;if(t){const p=e?o.y+o.height:o.y,g=o.height*c;r=p+g*u+s*h*c,l=h===c?"top":"bottom"}else{const p=e?o.x:o.x+o.width,g=o.width*c;n=p+g*u+s*h*c,a=h===c?"left":"right"}}return{x:n,y:r,textAlign:a,textBaseline:l}}var S9=0,x9=1,w9=2,M9=3,D9=4,PS=class extends mz{constructor(t){super({moduleCtx:t,directionKeys:Ch,directionNames:bh,pickModes:[2,1,0],pathsPerSeries:[],hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Hf,label:wl}}),this.properties=new Yt,this.connectsToYAxis=!0,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}crossFilteringEnabled(){return this.properties.yFilterKey!=null&&(this.seriesGrouping==null||this.seriesGrouping.stackIndex===0)}async processData(t){if(!this.properties.isValid()||!this.data)return;const{xKey:i,yKey:s,yFilterKey:o,normalizedTo:n,fastDataProcessing:r}=this.properties,{seriesGrouping:{groupIndex:a=this.id}={},data:l}=this,c=this.seriesGrouping?.groupCount??0,h=(this.seriesGrouping?.stackCount??0)>=1||n!=null,u=!r||c>1||h,p=!this.ctx.animationManager.isSkipped(),g=this.getCategoryAxis()?.scale,f=this.getValueAxis()?.scale,{isContinuousX:y,xScaleType:m,yScaleType:C}=this.getScaleInformation({xScale:g,yScale:f}),b=`bar-stack-${a}-yValues`,S=`${b}-trailing`,A=this.visible?{}:{forceValue:0},R=[or(i,m,{id:"xValue"}),ze(s,C,{id:"yValue-raw",invalidValue:null,...A})];this.crossFilteringEnabled()&&R.push(ze(o,C,{id:"yFilterValue",invalidValue:null,...A})),h&&R.push(...Sc(s,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:b,separateNegative:!0,...A},C),...Sc(s,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:S,separateNegative:!0,...A},C)),y&&R.push(N_,O_),Qe(n)&&R.push(bS([b,S],Math.abs(n))),p&&this.processedData&&R.push(xp(this.id,this.processedData)),(p||!u)&&R.push(Sp());const{dataModel:I,processedData:w}=await this.requestDataModel(t,l,{props:R,groupByKeys:u,groupByData:!u});this.dataAggregationFilters=this.aggregateData(I,w),this.smallestDataInterval=w.reduced?.smallestKeyInterval,this.largestDataInterval=w.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:i,dataModel:s}=this;if(s==null||i==null)return[];if(t===this.getCategoryDirection()){const a=s.resolveProcessedDataDefById(this,"xValue"),l=s.getDomain(this,"xValue","key",i);return a?.def.type==="key"&&a.def.valueType==="category"?l:this.padBandExtent(l)}const o=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";let n=this.domainForClippedRange("y",[o],"xValue",!0);const r=this.crossFilteringEnabled()?s.getDomain(this,"yFilterValue","value",i):void 0;if(r!=null&&(n=[Math.min(n[0],r[0]),Math.max(n[1],r[1])]),this.getValueAxis()instanceof Sh)return Co(n);{const a=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return Co(a)}}getSeriesRange(t,i){const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw",[o,n]=this.domainForVisibleRange("y",[s],"xValue",i,!0);return[Math.min(o,0),Math.max(n,0)]}getVisibleItems(t,i,s){const o=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";return this.countVisibleItems("xValue",[o],t,i,s)}aggregateData(t,i){}createNodeData(){const{dataModel:t,processedData:i,groupScale:s,dataAggregationFilters:o}=this,n=this.getCategoryAxis(),r=this.getValueAxis();if(!t||!i||!n||!r||!this.properties.isValid())return;const a=i.dataSources?.get(this.id);if(a==null)return;const l=n.scale,c=r.scale,{xKey:d,yKey:h,xName:u,yName:p,legendItemName:g,label:f}=this.properties,y=r.isReversed(),{barWidth:m,groupIndex:C}=this.updateGroupScale(n),b=s.convert(String(C)),S=nt.is(l)?m*-.5:0,A=t.resolveKeysById(this,"xValue",i),R=t.resolveColumnById(this,"yValue-raw",i),I=this.crossFilteringEnabled()?t.resolveColumnById(this,"yFilterValue",i):void 0,w=!this.ctx.animationManager.isSkipped(),M=O=>l.convert(A[O])+b+S,T=this.properties.crisp??yz(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),E=c.convert(0),P=({datum:O,datumIndex:H,valueIndex:B,xValue:Y,yValue:q,cumulativeValue:Z,phantom:ee,currY:se,prevY:j,x:X,width:$,isPositive:J,yRange:ie,labelText:ne,opacity:K,crossScale:oe=1})=>{const de=J!==y,re=c.convert(se),ce=c.convert(j),be=c.convert(ie),Se=this.getBarDirection()==="x",Fe=$*.5*(1-oe),dt={x:Se?Math.min(re,ce):X+Fe,y:Se?X+Fe:Math.min(re,ce),width:Se?Math.abs(ce-re):$*oe,height:Se?$*oe:Math.abs(ce-re)},tt=new ve(dt.x,dt.y,dt.width,dt.height),At={x:Se?Math.min(E,be):X+Fe,y:Se?X+Fe:Math.min(E,be),width:Se?Math.abs(E-be):$*oe,height:Se?$*oe:Math.abs(E-be)},Ue=this.shouldFlipXY()?dt.height:dt.width;return{series:this,itemId:ee?ci(h,ee):h,datum:O,datumIndex:H,valueIndex:B,cumulativeValue:Z,phantom:ee,xValue:Y,yValue:q,yKey:h,xKey:d,capDefaults:{lengthRatioMultiplier:Ue,lengthMax:Ue},x:At.x,y:At.y,width:At.width,height:At.height,midPoint:{x:dt.x+dt.width/2,y:dt.y+dt.height/2},opacity:K,topLeftCornerRadius:Se!==de,topRightCornerRadius:de,bottomRightCornerRadius:Se===de,bottomLeftCornerRadius:!de,clipBBox:tt,crisp:T,label:ne!=null?{text:ne,...Cz({isUpward:de,isVertical:!Se,placement:f.placement,padding:f.padding,rect:dt})}:void 0,missing:q==null,focusable:!ee}},N=[],F=[],_=[],W=(O,H,B,Y,q,Z,ee,se)=>{const j=A[O];if(j==null)return;const X=R[O],$=I!=null?Number(I[O]):void 0,J=X>=0&&!Object.is(X,-0);if(!Number.isFinite(Z)||$!=null&&!Number.isFinite($))return;const ie=X!=null?this.getLabelText(this.properties.label,{datum:a[O],value:$??X,xKey:d,yKey:h,xName:u,yName:p,legendItemName:g}):void 0,ne=$!=null&&$>X,K=P({datum:a[O],datumIndex:O,valueIndex:H,xValue:j,yValue:$??X,cumulativeValue:$??Z,phantom:!1,currY:$!=null?q+$:Z,prevY:q,x:B,width:Y,isPositive:J,yRange:Math.max(q+($??-1/0),ee),labelText:ie,opacity:se,crossScale:ne?.6:void 0});if(F.push(K),_.push(K),$!=null){const oe=P({datum:a[O],datumIndex:O,valueIndex:H,xValue:j,yValue:$,cumulativeValue:$,phantom:!0,currY:Z,prevY:q,x:B,width:Y,isPositive:J,yRange:ee,labelText:void 0,opacity:se,crossScale:void 0});N.push(oe)}},[z,U]=l.range,G=U-z,V=o?.find(O=>O.maxRange>G);if(i.type==="grouped"){const O=m,H=t.hasColumnById(this,"yValue-start"),B=H?t.resolveColumnById(this,"yValue-start",i):void 0,Y=H?t.resolveColumnById(this,"yValue-end",i):void 0,q=H?t.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:Z,valueIndex:ee,group:{aggregation:se}}of t.forEachGroupDatum(this,i)){const j=M(Z),X=R[Z],$=X>=0&&!Object.is(X,-0),J=H?Number(B?.[Z]):0,ie=H?Number(Y?.[Z]):X;let ne=ie;H&&(ne=se[q][$?1:0]),W(Z,ee,j,O,J,ie,ne,1)}}else if(V==null){const O=m;let[H,B]=this.visibleRange("xValue",n.range);i.input.count<1e3&&(H=0,B=i.input.count);for(let Y=H;Y<B;Y+=1){const q=M(Y),Z=Number(R[Y]);W(Y,0,q,O,0,Z,Z,1)}}else{const{indexData:O,indices:H}=V,[B,Y]=this.visibleRange("xValue",n.range,H);for(let q=B;q<Y;q+=1){const Z=q*D9,ee=O[Z+S9],se=O[Z+x9],j=O[Z+w9],X=O[Z+M9];if(ee===-1)continue;const $=M((ee+se)/2|0),J=Math.abs(M(se)-M(ee))+m,ie=A[X]!=null?Number(R[X]):NaN,ne=A[j]!=null?Number(R[j]):NaN;if(ie>0){const K=ne>=0?ne/ie:1;W(X,0,$,J,0,ie,ie,K)}if(ne<0){const K=ie<=0?ie/ne:1;W(j,1,$,J,0,ne,ne,K)}}}return{itemId:h,nodeData:N.length>0?[...N,...F]:F,labelData:_,scales:this.calculateScaling(),visible:this.visible||w,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new ks}getHighlightData(t,i){const s=t.find(o=>o.datum===i.datum&&!o.phantom);return s!=null?[s]:void 0}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,i=>this.getDatumId(i))}getItemBaseStyle(t){const{properties:i}=this,{cornerRadius:s}=i,o=t?i.highlightStyle.item:void 0;return{fill:o?.fill??i.fill,fillOpacity:o?.fillOpacity??i.fillOpacity,stroke:o?.stroke??i.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(i.strokeWidth),strokeOpacity:o?.strokeOpacity??i.strokeOpacity,lineDash:o?.lineDash??i.lineDash??[],lineDashOffset:o?.lineDashOffset??i.lineDashOffset,cornerRadius:s}}getItemStyleOverrides(t,i,s,o,n,r){const{id:a,properties:l}=this,{xKey:c,yKey:d,itemStyler:h}=l;if(h==null)return;const{xDomain:u,yDomain:p}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));return this.cachedDatumCallback(ci(t,r?"highlight":"node"),()=>h({seriesId:a,...bc(i,c,d,u,p),xValue:s,yValue:o,highlighted:r,...n}))}updateDatumNodes(t){if(!this.properties.isValid())return;const{shadow:i}=this.properties,s=this.getCategoryDirection()==="x",o=this.getItemBaseStyle(t.isHighlight);t.datumSelection.each((n,r)=>{const a=this.getItemStyleOverrides(String(r.datumIndex),r.datum,r.xValue,r.yValue,o,t.isHighlight);n.opacity=r.opacity??0,Ef(n,o,a);const l=a?.cornerRadius??o.cornerRadius;n.topLeftCornerRadius=r.topLeftCornerRadius?l:0,n.topRightCornerRadius=r.topRightCornerRadius?l:0,n.bottomRightCornerRadius=r.bottomRightCornerRadius?l:0,n.bottomLeftCornerRadius=r.bottomLeftCornerRadius?l:0,n.visible=s?(r.clipBBox?.width??r.width)>0:(r.clipBBox?.height??r.height)>0,n.crisp=r.crisp,n.fillShadow=i})}updateLabelSelection(t){const i=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(i,s=>{s.pointerEvents=1})}updateLabelNodes(t){t.labelSelection.each((i,s)=>{vz(i,this.properties.label,s.label)})}getTooltipContent(t){const{id:i,dataModel:s,processedData:o,properties:n}=this,{xKey:r,xName:a,yKey:l,yName:c,legendItemName:d,stackGroup:h,tooltip:u}=n,p=this.getCategoryAxis(),g=this.getValueAxis();if(!s||!o||!p||!g)return;const{datumIndex:f}=t,y=o.dataSources.get(this.id)?.[f],m=s.resolveKeysById(this,"xValue",o)[f],C=s.resolveColumnById(this,"yValue-raw",o)[f];if(m==null)return;const b=this.getItemBaseStyle(!1);return Object.assign(b,this.getItemStyleOverrides(String(f),y,m,C,b,!1)),u.formatTooltip({heading:p.formatDatum(m),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:g.formatDatum(C)}]},{seriesId:i,datum:y,title:c,xKey:r,xName:a,yKey:l,yName:c,legendItemName:d,stackGroup:h,...b,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:i,strokeWidth:s,fillOpacity:o,strokeOpacity:n,lineDash:r,lineDashOffset:a}=this.properties;return{marker:{fill:t,fillOpacity:o,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:r,lineDashOffset:a}}}getLegendData(t){const{showInLegend:i}=this.properties;if(t!=="category"||!this.properties.isValid())return[];const{id:s,ctx:{legendManager:o},visible:n}=this,{yKey:r,yName:a,legendItemName:l}=this.properties;return[{legendType:"category",id:s,itemId:r,seriesId:s,enabled:n&&o.getItemEnabled({seriesId:s,itemId:r}),label:{text:l??a??r},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!i}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:i,annotationSelections:s}){const o=Vf(zf(this.isVertical(),this.axes,"normal"));Wt(this.id,"nodes",this.ctx.animationManager,[t],o),it(this,"labels",this.ctx.animationManager,i),it(this,"annotations",this.ctx.animationManager,...s)}animateWaitingUpdateReady(t){const{datumSelection:i,labelSelection:s,annotationSelections:o,previousContextData:n}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);let r=this.processedData?.reduced?.diff?.[this.id];r==null&&this.processedData?.reduced?.diff!=null&&(r={changed:!0,added:new Set(Array.from(i,({datum:h})=>this.getDatumId(h))),updated:new Set,removed:new Set,moved:new Set});const a=n==null?"fade":"normal",l=Vf(zf(this.isVertical(),this.axes,a));Wt(this.id,"nodes",this.ctx.animationManager,[i],l,(h,u)=>this.getDatumId(u),r);const c=n!=null&&(!Fu(t.contextData.scales.x,n.scales.x)||!Fu(t.contextData.scales.y,n.scales.y)||!Fu(t.contextData.groupScale,t.previousContextData.groupScale));((r?.changed??!1)||c)&&(it(this,"labels",this.ctx.animationManager,s),it(this,"annotations",this.ctx.animationManager,...o))}getDatumId(t){return ci(t.xValue,t.valueIndex,t.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){const i=this.contextNodeData?.nodeData[t].clipBBox;return FI(this,i)}};PS.className="BarSeries";PS.type="bar";var bz={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:e=>new PS(e),stackable:!0,groupable:!0,tooltipDefaults:{range:"exact"},defaultAxes:q_([{type:"number",position:"left"},{type:"category",position:"bottom"}],e=>e?.direction==="horizontal"),themeTemplate:{series:{direction:"vertical",fillOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"backgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:Hc,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}}}},paletteFactory:Um},BI=class extends Ts{constructor(){super(...arguments),this.maxSize=30}};D([k(pe),ye()],BI.prototype,"maxSize",2);D([k(Jb,{optional:!0}),ye()],BI.prototype,"domain",2);var Sz=class extends Bi{constructor(){super(...arguments),this.placement="top"}};D([k(fA)],Sz.prototype,"placement",2);var ut=class extends Sl{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.label=new Sz,this.tooltip=new Ls,this.marker=new BI}};D([k(he)],ut.prototype,"xKey",2);D([k(he)],ut.prototype,"yKey",2);D([k(he)],ut.prototype,"sizeKey",2);D([k(he,{optional:!0})],ut.prototype,"labelKey",2);D([k(he,{optional:!0})],ut.prototype,"colorKey",2);D([k(he,{optional:!0})],ut.prototype,"xFilterKey",2);D([k(he,{optional:!0})],ut.prototype,"yFilterKey",2);D([k(he,{optional:!0})],ut.prototype,"sizeFilterKey",2);D([k(he,{optional:!0})],ut.prototype,"xName",2);D([k(he,{optional:!0})],ut.prototype,"yName",2);D([k(he,{optional:!0})],ut.prototype,"sizeName",2);D([k(he,{optional:!0})],ut.prototype,"labelName",2);D([k(he,{optional:!0})],ut.prototype,"colorName",2);D([k(Jb,{optional:!0})],ut.prototype,"colorDomain",2);D([k(Uo)],ut.prototype,"colorRange",2);D([k(he,{optional:!0})],ut.prototype,"title",2);D([Rt("marker.shape")],ut.prototype,"shape",2);D([Rt("marker.size")],ut.prototype,"size",2);D([Rt("marker.maxSize")],ut.prototype,"maxSize",2);D([Rt("marker.domain",{optional:!0})],ut.prototype,"domain",2);D([Rt("marker.fill",{optional:!0})],ut.prototype,"fill",2);D([Rt("marker.fillOpacity")],ut.prototype,"fillOpacity",2);D([Rt("marker.stroke",{optional:!0})],ut.prototype,"stroke",2);D([Rt("marker.strokeWidth")],ut.prototype,"strokeWidth",2);D([Rt("marker.strokeOpacity")],ut.prototype,"strokeOpacity",2);D([Rt("marker.lineDash")],ut.prototype,"lineDash",2);D([Rt("marker.lineDashOffset")],ut.prototype,"lineDashOffset",2);D([Rt("marker.itemStyler",{optional:!0})],ut.prototype,"itemStyler",2);D([k(me)],ut.prototype,"label",2);D([k(me)],ut.prototype,"tooltip",2);var A9=class extends nI{constructor(e,t,i,s){super(e,t,i,s),this.sizeKey=s.properties.sizeKey}},GI=class extends _c{constructor(e){super({moduleCtx:e,directionKeys:Ch,directionNames:bh,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:wl,marker:Km},usesPlacedLabels:!0}),this.NodeEvent=A9,this.clipFocusBox=!1,this.properties=new ut,this.sizeScale=new sr,this.colorScale=new Pc}get pickModeAxis(){return"main-category"}async processData(e){if(!this.properties.isValid()||this.data==null||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:o}=this.getScaleInformation({xScale:t,yScale:i}),n=this.colorScale.type,r=this.sizeScale.type,{xKey:a,yKey:l,sizeKey:c,xFilterKey:d,yFilterKey:h,sizeFilterKey:u,labelKey:p,colorDomain:g,colorRange:f,colorKey:y,marker:m}=this.properties,{dataModel:C,processedData:b}=await this.requestDataModel(e,this.data,{props:[ze(a,s,{id:"xValue"}),ze(l,o,{id:"yValue"}),...d!=null?[ze(d,s,{id:"xFilterValue"})]:[],...h!=null?[ze(h,o,{id:"yFilterValue"})]:[],...u!=null?[ze(u,r,{id:"sizeFilterValue"})]:[],ze(c,r,{id:"sizeValue"}),...y?[ze(y,n,{id:"colorValue"})]:[],...p?[ze(p,"band",{id:"labelValue"})]:[]]}),S=C.resolveProcessedDataIndexById(this,"sizeValue"),A=b.domain.values[S]??[];if(this.sizeScale.domain=m.domain?m.domain:A,y){const R=C.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=g??b.domain.values[R]??[],this.colorScale.range=f,this.colorScale.update()}this.animationState.transition("updateData")}xCoordinateRange(e,t,i){const{properties:s,sizeScale:o}=this,{size:n,sizeKey:r}=s,a=this.axes.x.scale.convert(e),l=r!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,d=.5*(l!=null?o.convert(l[i]):n)*t;return[a-d,a+d]}yCoordinateRange(e,t,i){const{properties:s,sizeScale:o}=this,{size:n,sizeKey:r}=s,a=this.axes.y.scale.convert(e[0]),l=r!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,d=.5*(l!=null?o.convert(l[i]):n)*t;return[a-d,a+d]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s={x:"xValue",y:"yValue"},o=s[e],n=t.resolveProcessedDataDefById(this,o),r=t.getDomain(this,o,"value",i);if(n?.def.type==="value"&&n?.def.valueType==="category")return r;const l=s[e==="x"?"y":"x"],c=this.domainForClippedRange(e,[o],l,!1);return Co(Cl(c))}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t,!1)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValue"],e,t,i)}createNodeData(){const{axes:e,dataModel:t,processedData:i,colorScale:s,sizeScale:o,visible:n}=this,{xKey:r,yKey:a,sizeKey:l,xFilterKey:c,yFilterKey:d,sizeFilterKey:h,labelKey:u,xName:p,yName:g,sizeName:f,labelName:y,label:m,colorKey:C,marker:b}=this.properties,{placement:S}=m,A=Fi.anchor(b.shape),R=e.x,I=e.y;if(!(t&&i&&n&&R&&I))return;const w=t.resolveColumnById(this,"xValue",i),M=t.resolveColumnById(this,"yValue",i),T=l!=null?t.resolveColumnById(this,"sizeValue",i):void 0,E=C!=null?t.resolveColumnById(this,"colorValue",i):void 0,P=u!=null?t.resolveColumnById(this,"labelValue",i):void 0,N=c!=null?t.resolveColumnById(this,"xFilterValue",i):void 0,F=d!=null?t.resolveColumnById(this,"yFilterValue",i):void 0,_=h!=null?t.resolveColumnById(this,"sizeFilterValue",i):void 0,W=R.scale,z=I.scale,U=(W.bandwidth??0)/2,G=(z.bandwidth??0)/2,V=[];o.range=[b.size,b.maxSize];const O=m.getFont(),H=fl.getMeasurer({font:O});return i.dataSources.get(this.id)?.forEach((B,Y)=>{const q=w[Y],Z=M[Y],ee=T?.[Y],se=W.convert(q)+U,j=z.convert(Z)+G;let X;N!=null&&F!=null&&(X=N[Y]===q&&F[Y]===Z,_!=null&&X&&(X=_[Y]===ee));const $=this.getLabelText(m,{value:P!=null?P[Y]:Z,datum:B,xKey:r,yKey:a,sizeKey:l,labelKey:u,xName:p,yName:g,sizeName:f,labelName:y}),J=H.measureText(String($)),ie=ee!=null?o.convert(ee):b.size,ne=E!=null?s.convert(E[Y]):void 0;V.push({series:this,itemId:a,yKey:a,xKey:r,datum:B,datumIndex:Y,xValue:q,yValue:Z,sizeValue:ee,point:{x:se,y:j,size:ie},midPoint:{x:se,y:j},fill:ne,label:{text:$,...J},anchor:A,placement:S,selected:X})}),{itemId:a,nodeData:V,labelData:V,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const s=this.properties.marker.enabled?t:[];return i.update(s,void 0,o=>ci([o.xValue,o.yValue,o.label.text]))}getMarkerItemBaseStyle(e){const{properties:t}=this,{marker:i}=t,s=e?t.highlightStyle.item:void 0;return{fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(e,t,i,s){const{id:o,properties:n}=this,{xKey:r,yKey:a,sizeKey:l,labelKey:c,marker:d}=n,{itemStyler:h}=d;if(h!=null)return this.cachedDatumCallback(ci(e,s?"highlight":"node"),()=>h({seriesId:o,datum:t,xKey:r,yKey:a,sizeKey:l,labelKey:c,highlighted:s,...i}))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:o,sizeKey:n,labelKey:r,marker:a}=this.properties,{size:l,shape:c,fill:d,fillOpacity:h,stroke:u,strokeWidth:p,strokeOpacity:g,lineDash:f,lineDashOffset:y}=_e(i&&this.properties.highlightStyle.item,a.getStyle()),m={size:l,shape:c,fill:d,fillOpacity:h,stroke:u,strokeWidth:p,strokeOpacity:g,lineDash:f,lineDashOffset:y};this.sizeScale.range=[a.size,a.maxSize],t.each((C,b)=>{this.updateMarkerStyle(C,a,{datum:b,highlighted:i,xKey:s,yKey:o,sizeKey:n,labelKey:r},m,{selected:b.selected})}),i||this.properties.marker.markClean()}updatePlacedLabelData(e){this.labelSelection.update(e.map(t=>({...t.datum,point:{x:t.x,y:t.y,size:t.datum.point.size}})),t=>{t.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{label:t}=this.properties;e.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=t.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=t.fontStyle,i.fontWeight=t.fontWeight,i.fontSize=t.fontSize,i.fontFamily=t.fontFamily,i.textAlign="left",i.textBaseline="top"})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:n}=this,{xKey:r,xName:a,yKey:l,yName:c,sizeKey:d,sizeName:h,labelKey:u,labelName:p,title:g,tooltip:f}=n,y=o.x,m=o.y;if(!i||!s||!y||!m)return;const{datumIndex:C}=e,b=s.dataSources.get(this.id)?.[C],S=i.resolveColumnById(this,"xValue",s)[C],A=i.resolveColumnById(this,"yValue",s)[C];if(S==null)return;const R=[{label:a,fallbackLabel:r,value:y.formatDatum(S)},{label:c,fallbackLabel:l,value:m.formatDatum(A)}];if(d!=null){const w=i.resolveColumnById(this,"sizeValue",s)[C];R.push({label:h,fallbackLabel:d,value:String(w)})}const I=this.getMarkerItemBaseStyle(!1);return Object.assign(I,this.getMarkerItemStyleOverrides(String(C),b,I,!1)),f.formatTooltip({title:g,symbol:this.legendItemSymbol(),data:R},{seriesId:t,datum:b,title:l,xKey:r,xName:a,yKey:l,yName:c,sizeKey:d,sizeName:h,labelKey:u,labelName:p,...I,...this.getModuleTooltipParams()})}legendItemSymbol(){const{marker:e}=this.properties,{shape:t,fill:i,stroke:s,fillOpacity:o,strokeOpacity:n,strokeWidth:r,lineDash:a,lineDashOffset:l}=e;return{marker:{shape:t,fill:i??"rgba(0, 0, 0, 0)",stroke:s??"rgba(0, 0, 0, 0)",fillOpacity:o,strokeOpacity:n,strokeWidth:r,lineDash:a,lineDashOffset:l}}}getLegendData(){if(!this.properties.isValid())return[];const{id:e,ctx:{legendManager:t},visible:i}=this,{yKey:s,yName:o,title:n}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i&&t.getItemEnabled({seriesId:e,itemId:s}),label:{text:n??o??s},symbol:this.legendItemSymbol()}]}animateEmptyUpdateReady({markerSelection:e,labelSelection:t}){II(this,this.ctx.animationManager,e),it(this,"labels",this.ctx.animationManager,t)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Me}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,sizeKey:s,labelKey:o}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,sizeKey:s,labelKey:o,highlighted:!1})}computeFocusBounds(e){return $m(this,e)}};GI.className="BubbleSeries";GI.type="bubble";var I9={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:e=>new GI(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,maxSize:30,fillOpacity:.8,tooltip:{position:{type:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}},paletteFactory:Um},Ii=class extends Sl{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new mr,this.label=new Bi,this.tooltip=new Ls}};D([k(he)],Ii.prototype,"xKey",2);D([k(he,{optional:!0})],Ii.prototype,"yKey",2);D([k(he,{optional:!0})],Ii.prototype,"xName",2);D([k(he,{optional:!0})],Ii.prototype,"yName",2);D([k(st,{optional:!0})],Ii.prototype,"fill",2);D([k(rt)],Ii.prototype,"fillOpacity",2);D([k(st,{optional:!0})],Ii.prototype,"stroke",2);D([k(pe)],Ii.prototype,"strokeWidth",2);D([k(rt)],Ii.prototype,"strokeOpacity",2);D([k(ra)],Ii.prototype,"lineDash",2);D([k(pe)],Ii.prototype,"lineDashOffset",2);D([k(pe)],Ii.prototype,"cornerRadius",2);D([k(xe)],Ii.prototype,"areaPlot",2);D([k(xm,{optional:!0})],Ii.prototype,"bins",2);D([k(Ct(["count","sum","mean"],"a histogram aggregation"))],Ii.prototype,"aggregation",2);D([k(pe,{optional:!0})],Ii.prototype,"binCount",2);D([k(me)],Ii.prototype,"shadow",2);D([k(me)],Ii.prototype,"label",2);D([k(me)],Ii.prototype,"tooltip",2);var sP=10,_I=class extends _c{constructor(e){super({moduleCtx:e,directionKeys:Ch,directionNames:bh,pickModes:[1,0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:Hf,label:wl}}),this.properties=new Ii,this.calculatedBins=[]}deriveBins(e){const t=RA(e[0],e[1],sP),i=If(e[0],e[1],sP),[s]=t,o=n=>[n,n+i];return[[s-i,s],...t.map(o)]}calculateNiceBins(e,t){const i=Math.floor(e[0]),s=e[1],o=t||1,{start:n,binSize:r}=this.calculateNiceStart(i,s,o);return this.getBins(n,s,r,o)}getBins(e,t,i,s){const o=[],n=this.calculatePrecision(i);for(let r=0;r<s;r++){const a=Math.round((e+r*i)*n)/n;let l=Math.round((e+(r+1)*i)*n)/n;r===s-1&&(l=Math.max(l,t)),o[r]=[a,l]}return o}calculatePrecision(e){let t=10;if(isFinite(e)&&e>0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const s=Math.abs(t-e)/i,o=Math.floor(Math.log10(s)),n=Math.pow(10,o);return{start:Math.floor(e/n)*n,binSize:s}}async processData(e){this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:t,yKey:i,areaPlot:s,aggregation:o}=this.properties,n=this.axes.x?.scale,r=this.axes.y?.scale,{xScaleType:a,yScaleType:l}=this.getScaleInformation({yScale:r,xScale:n}),c=[or(t,a),F_];if(i){let h=X0("groupAgg");o==="count"||(o==="sum"?h=D_("groupAgg"):o==="mean"&&(h=A_("groupAgg"))),s&&(h=Z0("groupAgg",h)),c.push(ze(i,l,{invalidValue:void 0}),h)}else{c.push(E_("count"));let h=X0("groupAgg");s&&(h=Z0("groupAgg",h)),c.push(h)}const d=h=>{const u=Co(h.domain.keys[0]);if(u.length===0)return h.domain.groups=[],()=>[];const p=yn(this.properties.binCount)?this.calculateNiceBins(u,this.properties.binCount):this.properties.bins??this.deriveBins(u),g=p.length;return this.calculatedBins=[...p],f=>{let y=f[0];if(hp(y)&&(y=y.getTime()),!yn(y))return[];for(let m=0;m<g;m++){const C=p[m];if(y>=C[0]&&y<C[1]||m===g-1&&y<=C[1])return C}return[]}};!this.ctx.animationManager.isSkipped()&&this.processedData&&c.push(xp(this.id,this.processedData,!1)),await this.requestDataModel(e,this.data,{props:c,groupByFn:d}),this.animationState.transition("updateData")}xCoordinateRange(){return[NaN,NaN]}yCoordinateRange(){return[NaN,NaN]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i||!this.calculatedBins.length)return[];const s=i.getDomain(this,"groupAgg","aggregate",t),o=this.calculatedBins?.[0][0],n=this.calculatedBins?.[(this.calculatedBins?.length??0)-1][1];return Co(e==="x"?[o,n]:s)}getSeriesRange(e,[t,i]){const{dataModel:s,processedData:o}=this;if(!s||o?.type!=="grouped")return[NaN,NaN];const n=this.axes.x.scale,r=0;let a=-1/0;return o.groups.forEach(({keys:l,aggregation:c})=>{const[[d,h]=[0,0]]=c,[u,p]=l,[g,f]=Ki([n.convert(u),n.convert(p)]);if(f>=t&&g<=i){const y=d+h;a=Math.max(a,y)}}),r>a?[NaN,NaN]:[r,a]}createNodeData(){const{id:e,axes:t,processedData:i,dataModel:s}=this,o=t.x,n=t.y;if(!o||!n||!s)return;const{scale:r}=o,{scale:a}=n,{xKey:l,yKey:c,xName:d,yName:h}=this.properties,u=this.properties.label.formatter??(f=>String(f.value)),p=[],g={itemId:this.properties.yKey??this.id,nodeData:p,labelData:p,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return!this.visible||i==null||i.type!=="grouped"||(i.groups.forEach((f,y)=>{const{keys:m,datumIndices:C,aggregation:b}=f,[[S,A]=[0,0]]=b,R=C.length,I=m,[w,M]=I,T=[...s.forEachDatum(this,i,f)],E=r.convert(w),P=r.convert(M),N=S+A,F=a.convert(0),_=a.convert(N),W=Math.abs(P-E),z=Math.abs(_-F),U=Math.min(E,P),G=Math.min(F,_);let V;N!==0&&(V={x:U+W/2,y:G+z/2,text:this.cachedDatumCallback(ci(y,"label"),()=>u({value:N,datum:T,seriesId:e,xKey:l,yKey:c,xName:d,yName:h}))??String(N)});const O={x:U+W/2,y:G+z/2},H=n.isReversed();p.push({series:this,datumIndex:y,datum:T,aggregatedValue:N,frequency:R,domain:I,yKey:c,xKey:l,x:U,y:G,xValue:E,yValue:_,width:W,height:z,midPoint:O,topLeftCornerRadius:!H,topRightCornerRadius:!H,bottomRightCornerRadius:H,bottomLeftCornerRadius:H,label:V,crisp:!0})}),p.sort((f,y)=>f.x-y.x)),g}nodeFactory(){return new ks}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return i.update(t,void 0,s=>s.domain.join("_"))}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return{fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset,cornerRadius:t.cornerRadius}}updateDatumNodes(e){const{isHighlight:t}=e,{shadow:i}=this.properties,s=this.getItemBaseStyle(t);e.datumSelection.each((o,n)=>{const{cornerRadius:r}=s,{topLeftCornerRadius:a,topRightCornerRadius:l,bottomRightCornerRadius:c,bottomLeftCornerRadius:d}=n;Ef(o,s),o.topLeftCornerRadius=a?r:0,o.topRightCornerRadius=l?r:0,o.bottomRightCornerRadius=c?r:0,o.bottomLeftCornerRadius=d?r:0,o.crisp=n.crisp,o.fillShadow=i,o.visible=n.height>0})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=1,s.textAlign="center",s.textBaseline="middle"})}updateLabelNodes(e){const{fontStyle:t,fontWeight:i,fontFamily:s,fontSize:o,color:n}=this.properties.label,r=this.isLabelEnabled();e.labelSelection.each((a,l)=>{r&&l?.label?(a.text=l.label.text,a.x=l.label.x,a.y=l.label.y,a.fontStyle=t,a.fontWeight=i,a.fontFamily=s,a.fontSize=o,a.fill=n,a.visible=!0):a.visible=!1})}initQuadTree(e){const{value:t}=this.contentGroup.children().next();t&&EI(e,t.children())}pickNodeClosestDatum(e){return PI(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:n,ctx:{localeManager:r}}=this,{xKey:a,xName:l,yKey:c,yName:d,tooltip:h}=n,u=o.x,p=o.y;if(!i||s?.type!=="grouped"||!u||!p)return;const g=e.datumIndex,f=s.groups[g],{aggregation:y,datumIndices:m,keys:C}=f,[[b,S]=[0,0]]=y,A=m.length,R=C,[I,w]=R,M=b+S,T={data:[...i.forEachDatum(this,s,f)],aggregatedValue:M,frequency:A,domain:R},E=[{label:l,fallbackLabel:a,value:`${u.formatDatum(I)} - ${u.formatDatum(w)}`},{label:r.t("seriesHistogramTooltipFrequency"),value:p.formatDatum(A)}];if(c!=null){let P;switch(n.aggregation){case"sum":P=r.t("seriesHistogramTooltipSum",{yName:d});break;case"mean":P=r.t("seriesHistogramTooltipMean",{yName:d});break;case"count":P=r.t("seriesHistogramTooltipCount",{yName:d});break}E.push({label:P,value:p.formatDatum(M)})}return h.formatTooltip({symbol:this.legendItemSymbol(),data:E},{seriesId:t,datum:T,title:d,xKey:a,xName:l,yKey:c,yName:d,xRange:[I,w],frequency:A,...this.getItemBaseStyle(!1)})}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:n,lineDashOffset:r}=this.properties;return{marker:{fill:e??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:t,strokeOpacity:o,strokeWidth:s,lineDash:n,lineDashOffset:r}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:o,yName:n,showInLegend:r}=this.properties;return[{legendType:"category",id:t,itemId:o,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:o}),label:{text:n??o??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!r}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Vf(zf(!0,this.axes,"normal"));Wt(this.id,"datums",this.ctx.animationManager,[e],i),it(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const t=this.processedData?.reduced?.diff?.[this.id],i=Vf(zf(!0,this.axes,"normal"));Wt(this.id,"datums",this.ctx.animationManager,[e.datumSelection],i,(s,o)=>ci(o.domain),t),it(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return FI(this,this.contextNodeData?.nodeData[e])}};_I.className="HistogramSeries";_I.type="histogram";var R9={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:e=>new _I(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},shadow:{enabled:!1,color:Hc,xOffset:3,yOffset:3,blur:5}}},paletteFactory:({takeColors:e})=>{const{fills:[t],strokes:[i]}=e(1);return{fill:t,stroke:i}}},Ri=class extends Sl{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Rp,this.marker=new Ts,this.label=new Bi,this.tooltip=new Ls,this.connectMissingData=!1,this.sparklineMode=!1}};D([k(he)],Ri.prototype,"xKey",2);D([k(he)],Ri.prototype,"yKey",2);D([k(he,{optional:!0})],Ri.prototype,"xName",2);D([k(he,{optional:!0})],Ri.prototype,"yName",2);D([k(he,{optional:!0})],Ri.prototype,"yFilterKey",2);D([k(he,{optional:!0})],Ri.prototype,"stackGroup",2);D([k(pe,{optional:!0})],Ri.prototype,"normalizedTo",2);D([k(he,{optional:!0})],Ri.prototype,"title",2);D([k(st)],Ri.prototype,"stroke",2);D([k(pe)],Ri.prototype,"strokeWidth",2);D([k(rt)],Ri.prototype,"strokeOpacity",2);D([k(ra)],Ri.prototype,"lineDash",2);D([k(pe)],Ri.prototype,"lineDashOffset",2);D([k(me)],Ri.prototype,"interpolation",2);D([k(me)],Ri.prototype,"marker",2);D([k(me)],Ri.prototype,"label",2);D([k(me)],Ri.prototype,"tooltip",2);D([k(xe)],Ri.prototype,"connectMissingData",2);D([k(xe)],Ri.prototype,"sparklineMode",2);var k9=.25,NS=class extends _c{constructor(t){super({moduleCtx:t,directionKeys:Ch,directionNames:bh,hasMarkers:!0,pickModes:[2,1,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:TI({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:wl,marker:(i,s)=>({...Km(),..._f(i,s)})}}),this.clipFocusBox=!1,this.properties=new Ri,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:i,visible:s,seriesGrouping:{groupIndex:o=this.id,stackCount:n=0}={}}=this,{xKey:r,yKey:a,yFilterKey:l,connectMissingData:c,normalizedTo:d}=this.properties,h=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,p=this.axes.y?.scale,{isContinuousX:g,xScaleType:f,yScaleType:y}=this.getScaleInformation({xScale:u,yScale:p}),m=n>=1||d!=null,C={invalidValue:null};c&&m&&(C.invalidValue=0,s||(C.forceValue=0));const b=[];if((!g||m)&&b.push(or(r,f,{id:"xKey"})),b.push(ze(r,f,{id:"xValue"}),ze(a,y,{id:"yValueRaw",...C,invalidValue:void 0})),l!=null&&b.push(ze(l,y,{id:"yFilterRaw"})),m){const R=[`line-stack-${o}-yValues`,`line-stack-${o}-yValues-trailing`,`line-stack-${o}-yValues-marker`];b.push(...Sc(a,"window","current",{id:"yValueEnd",...C,groupId:R[0]},y),...Sc(a,"window-trailing","current",{id:"yValueStart",...C,groupId:R[1]},y),...Sc(a,"normal","current",{id:"yValueCumulative",...C,groupId:R[2]},y)),oC(d)&&b.push(bS([R[0],R[1],R[2]],d))}h&&(b.push(Sp(g?["xValue"]:void 0)),this.processedData&&b.push(xp(this.id,this.processedData)));const{dataModel:S,processedData:A}=await this.requestDataModel(t,i,{props:b,groupByKeys:m,groupByData:!m});this.dataAggregationFilters=this.aggregateData(S,A),this.animationState.transition("updateData")}xCoordinateRange(t,i){const{marker:s}=this.properties,o=this.axes.x.scale.convert(t),n=s.enabled?.5*s.size*i:0;return[o-n,o+n]}yCoordinateRange(t,i){const{marker:s}=this.properties,o=this.axes.y.scale.convert(t[0]),n=s.enabled?.5*s.size*i:0;return[o-n,o+n]}getSeriesDomain(t){const{dataModel:i,processedData:s}=this;if(!i||!s)return[];if(t==="x"){const r=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","value",s);return r?.def.type==="value"&&r.def.valueType==="category"?a:Co(Cl(a))}const o=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw",n=this.domainForClippedRange("y",[o],"xValue",!0);return Co(n)}getSeriesRange(t,i){const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.domainForVisibleRange("y",[s],"xValue",i,!0)}getVisibleItems(t,i,s){const o=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.countVisibleItems("xValue",[o],t,i,s)}aggregateData(t,i){}createNodeData(){const{dataModel:t,processedData:i,axes:s,dataAggregationFilters:o}=this,n=s.x,r=s.y;if(!t||!i||!n||!r)return;const{xKey:a,yKey:l,yFilterKey:c,xName:d,yName:h,marker:u,label:p,connectMissingData:g,interpolation:f,legendItemName:y}=this.properties,m=this.dataModel?.hasColumnById(this,"yValueEnd"),C=n.scale,b=r.scale,S=(C.bandwidth??0)/2,A=(b.bandwidth??0)/2,R=u.enabled?u.size:0,I=i.dataSources.get(this.id)??[],w=t.resolveColumnById(this,"xValue",i),M=t.resolveColumnById(this,"yValueRaw",i),T=m?t.resolveColumnById(this,"yValueEnd",i):void 0,E=m?t.resolveColumnById(this,"yValueCumulative",i):M,P=c!=null?t.resolveColumnById(this,"yFilterRaw",i):void 0,N=j=>C.convert(w[j])+S,F=j=>b.convert(E[j])+A,_={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},W=[];let z;const U=j=>{const X=I[j],$=w[j],J=M[j],ie=T?.[j],ne=P?.[j],K=N(j),oe=F(j);if(!Number.isFinite(K))return;if(J!=null){const re=p.enabled?this.getLabelText(p,{value:J,datum:X,xKey:a,yKey:l,xName:d,yName:h,legendItemName:y}):void 0;W.push({series:this,datum:X,datumIndex:j,yKey:l,xKey:a,point:{x:K,y:oe,size:R},midPoint:{x:K,y:oe},cumulativeValue:ie,yValue:J,xValue:$,capDefaults:_,labelText:re,selected:ne})}if(z==null)return;const de=z[z.length-1];if(J!=null){const re={point:{x:K,y:oe},xDatum:$,yDatum:J};Array.isArray(de)?de.push(re):de!=null?(de.skip+=1,z.push([re])):z.push([re])}else g||(Array.isArray(de)||de==null?z.push({skip:0}):de.skip+=1)},[G,V]=C.range,O=V-G,B=o?.find(j=>j.maxRange>O)?.indices;let[Y,q]=this.visibleRange("xValue",n.range,B);Y=Math.max(Y-1,0),q=Math.min(q+1,B?.length??w.length),i.input.count<1e3&&(Y=0,q=i.input.count),B==null&&(z=[]);for(let j=Y;j<q;j+=1)U(B?.[j]??j);const Z=z?.flatMap(j=>Array.isArray(j)?JC(j,f):[]),ee=Z!=null?{itemId:l,spans:Z}:void 0,se=P?.some((j,X)=>j===M[X])??!1;return{itemId:l,nodeData:W,labelData:W,strokeData:ee,scales:this.calculateScaling(),visible:this.visible,crossFiltering:se}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[i],opacity:s,visible:o,animationEnabled:n}=t,r=this.contextNodeData?.crossFiltering===!0;i.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:s,stroke:this.properties.stroke,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.properties.strokeOpacity*(r?k9:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),n||(i.visible=o),tb(this,i)}getMarkerItemBaseStyle(t){const{properties:i}=this,{marker:s}=i,o=t?i.highlightStyle.item:void 0;return{size:s.size,shape:s.shape,fill:o?.fill??s.fill,fillOpacity:o?.fillOpacity??s.fillOpacity,stroke:o?.stroke??s.stroke,strokeWidth:o?.strokeWidth??s.strokeWidth,strokeOpacity:o?.strokeOpacity??s.strokeOpacity,lineDash:o?.lineDash??s.lineDash,lineDashOffset:o?.lineDashOffset??s.lineDashOffset}}getMarkerItemStyleOverrides(t,i,s,o){const{id:n,properties:r}=this,{xKey:a,yKey:l,marker:c}=r,{itemStyler:d}=c;if(d!=null)return this.cachedDatumCallback(ci(t,o?"highlight":"node"),()=>{const h=this.getSeriesDomain("x"),u=this.getSeriesDomain("y");return d({seriesId:n,...bc(i,a,l,h,u),highlighted:o,...s})})}updateMarkerSelection(t){let{nodeData:i}=t;const{markerSelection:s}=t;return i=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0?i:[],this.properties.marker.isDirty()&&(s.clear(),s.cleanup()),s.update(i,void 0,n=>ci(n.xValue))}updateMarkerNodes(t){const{markerSelection:i,isHighlight:s}=t,{xKey:o,yKey:n,stroke:r,strokeWidth:a,strokeOpacity:l,marker:c,highlightStyle:d}=this.properties,h=this.getSeriesDomain("x"),u=this.getSeriesDomain("y"),p=_e(s&&d.item,c.getStyle(),{stroke:r,strokeWidth:a,strokeOpacity:l}),g=this.ctx.animationManager.isSkipped();i.each((f,y)=>{this.updateMarkerStyle(f,c,{...bc(y,o,n,h,u),highlighted:s},p,{applyTranslation:g,selected:y.selected})}),s||c.markClean()}updateLabelSelection(t){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])}updateLabelNodes(t){const{enabled:i,fontStyle:s,fontWeight:o,fontSize:n,fontFamily:r,color:a}=this.properties.label;t.labelSelection.each((l,c)=>{i&&c?.labelText?(l.fontStyle=s,l.fontWeight=o,l.fontSize=n,l.fontFamily=r,l.textAlign="center",l.textBaseline="bottom",l.text=c.labelText,l.x=c.point.x,l.y=c.point.y-10,l.fill=a,l.visible=!0):l.visible=!1})}getTooltipContent(t){const{id:i,dataModel:s,processedData:o,axes:n,properties:r}=this,{xKey:a,xName:l,yKey:c,yName:d,tooltip:h}=r,u=n.x,p=n.y;if(!s||!o||!u||!p)return;const{datumIndex:g}=t,f=o.dataSources.get(this.id)?.[g],y=s.resolveColumnById(this,"xValue",o)[g],m=s.resolveColumnById(this,"yValueRaw",o)[g];if(y==null)return;const C=this.getMarkerItemBaseStyle(!1);return Object.assign(C,this.getMarkerItemStyleOverrides(String(g),f,C,!1)),h.formatTooltip({heading:u.formatDatum(y),symbol:this.legendItemSymbol(),data:[{label:d,fallbackLabel:c,value:p.formatDatum(m)}]},{seriesId:i,datum:f,title:d,xKey:a,xName:l,yKey:c,yName:d,...C,...this.getModuleTooltipParams()})}legendItemSymbol(){const t="rgba(0, 0, 0, 0)",{stroke:i,strokeOpacity:s,strokeWidth:o,lineDash:n,marker:r}=this.properties;return{marker:{shape:r.shape,fill:r.fill??t,stroke:r.stroke??i??t,fillOpacity:r.fillOpacity,strokeOpacity:r.strokeOpacity,strokeWidth:r.strokeWidth,lineDash:r.lineDash,lineDashOffset:r.lineDashOffset,enabled:r.enabled},line:{stroke:i??t,strokeOpacity:s,strokeWidth:o,lineDash:n}}}getLegendData(t){if(!(this.properties.isValid()&&t==="category"))return[];const{id:i,ctx:{legendManager:s},visible:o}=this,{yKey:n,yName:r,title:a,legendItemName:l,showInLegend:c}=this.properties;return[{legendType:"category",id:i,itemId:n,legendItemName:l,seriesId:i,enabled:o&&s.getItemEnabled({seriesId:i,itemId:n}),label:{text:l??a??r??n},symbol:this.legendItemSymbol(),hideInLegend:!c}]}updatePaths(t){this.updateLinePaths(t.paths,t.contextData)}plotNodeDataPoints(t,i){if(i.length===0)return;const s=i[0].point;t.moveTo(s.x,s.y);for(let o=1;o<i.length;o+=1){const{x:n,y:r}=i[o].point;t.lineTo(n,r)}}updateLinePaths(t,i){const s=i.strokeData?.spans,[o]=t;o.path.clear(),s!=null?MI(o,s):this.plotNodeDataPoints(o.path,i.nodeData),o.markDirty()}animateEmptyUpdateReady(t){const{markerSelection:i,labelSelection:s,annotationSelections:o,contextData:n,paths:r}=t,{animationManager:a}=this.ctx;this.updateLinePaths(r,n),kI(this,a,...r),Wi([i],_f),RI(this,a,i),it(this,"labels",a,s),it(this,"annotations",a,...o)}animateReadyResize(t){const{contextData:i,paths:s}=t;this.updateLinePaths(s,i),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:i}=this.ctx,{markerSelection:s,labelSelection:o,annotationSelections:n,contextData:r,paths:a,previousContextData:l}=t,[c]=a;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const d=()=>{this.resetPathAnimation(t),this.updateLinePaths(a,r)},h=()=>{i.skipCurrentBatch(),d()};if(r==null||l==null){d(),Gf(this,i,"added",s),eb(this,"path_properties",i,"add",c),it(this,"labels",i,o),it(this,"annotations",i,...n);return}if(r.crossFiltering!==l.crossFiltering){h();return}const u=uz(r,l,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){h();return}else if(u.status==="no-op")return;Wt(this.id,"path_properties",i,[c],u.stroke.pathProperties),u.status==="added"?this.updateLinePaths(a,r):u.status==="removed"?this.updateLinePaths(a,l):QC(this.id,"path_update",i,[c],u.stroke.path),u.hasMotion&&(Gf(this,i,void 0,s),it(this,"labels",i,o),it(this,"annotations",i,...n))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Me}getFormattedMarkerStyle(t){const{xKey:i,yKey:s}=this.properties,o=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,{...bc(t,i,s,o,n),highlighted:!0})}computeFocusBounds(t){return $m(this,t)}};NS.className="LineSeries";NS.type="line";var xz={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:e=>new NS(e),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{tooltip:{position:{type:"node"}},strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear",tension:1,position:"end"},marker:{shape:"circle",size:7,strokeWidth:0},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}},paletteFactory:e=>{const{marker:t}=xI(e);return{stroke:t.fill,marker:t}}},wz=class extends Bi{constructor(){super(...arguments),this.placement="top"}};D([k(fA)],wz.prototype,"placement",2);var kt=class extends Sl{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.label=new wz,this.tooltip=new Ls,this.marker=new Ts}};D([k(he)],kt.prototype,"xKey",2);D([k(he)],kt.prototype,"yKey",2);D([k(he,{optional:!0})],kt.prototype,"labelKey",2);D([k(he,{optional:!0})],kt.prototype,"colorKey",2);D([k(he,{optional:!0})],kt.prototype,"xFilterKey",2);D([k(he,{optional:!0})],kt.prototype,"yFilterKey",2);D([k(he,{optional:!0})],kt.prototype,"xName",2);D([k(he,{optional:!0})],kt.prototype,"yName",2);D([k(he,{optional:!0})],kt.prototype,"labelName",2);D([k(he,{optional:!0})],kt.prototype,"colorName",2);D([k(Jb,{optional:!0})],kt.prototype,"colorDomain",2);D([k(Uo)],kt.prototype,"colorRange",2);D([k(he,{optional:!0})],kt.prototype,"title",2);D([Rt("marker.shape")],kt.prototype,"shape",2);D([Rt("marker.size")],kt.prototype,"size",2);D([Rt("marker.fill")],kt.prototype,"fill",2);D([Rt("marker.fillOpacity")],kt.prototype,"fillOpacity",2);D([Rt("marker.stroke")],kt.prototype,"stroke",2);D([Rt("marker.strokeWidth")],kt.prototype,"strokeWidth",2);D([Rt("marker.strokeOpacity")],kt.prototype,"strokeOpacity",2);D([Rt("marker.lineDash")],kt.prototype,"lineDash",2);D([Rt("marker.lineDashOffset")],kt.prototype,"lineDashOffset",2);D([Rt("marker.itemStyler",{optional:!0})],kt.prototype,"itemStyler",2);D([k(me)],kt.prototype,"label",2);D([k(me)],kt.prototype,"tooltip",2);var zI=class extends _c{constructor(e){super({moduleCtx:e,directionKeys:Ch,directionNames:bh,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:Km,label:wl},usesPlacedLabels:!0}),this.clipFocusBox=!1,this.properties=new kt,this.colorScale=new Pc}get pickModeAxis(){return"main-category"}async processData(e){if(!this.properties.isValid()||this.data==null||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:o}=this.getScaleInformation({xScale:t,yScale:i}),n=this.colorScale.type,{xKey:r,yKey:a,xFilterKey:l,yFilterKey:c,labelKey:d,colorKey:h,colorDomain:u,colorRange:p}=this.properties,{dataModel:g,processedData:f}=await this.requestDataModel(e,this.data,{props:[ze(r,s,{id:"xValue"}),ze(a,o,{id:"yValue"}),...l!=null?[ze(l,s,{id:"xFilterValue"})]:[],...c!=null?[ze(c,o,{id:"yFilterValue"})]:[],...h?[ze(h,n,{id:"colorValue"})]:[],...d?[ze(d,"band",{id:"labelValue"})]:[]]});if(h){const y=g.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=u??f.domain.values[y]??[],this.colorScale.range=p,this.colorScale.update()}this.animationState.transition("updateData")}xCoordinateRange(e,t){const i=this.axes.x.scale.convert(e),s=.5*this.properties.size*t;return[i-s,i+s]}yCoordinateRange(e,t){const i=this.axes.y.scale.convert(e[0]),s=.5*this.properties.size*t;return[i-s,i+s]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s={x:"xValue",y:"yValue"},o=s[e],n=t.resolveProcessedDataDefById(this,o),r=t.getDomain(this,o,"value",i);if(n?.def.type==="value"&&n?.def.valueType==="category")return r;const l=s[e==="x"?"y":"x"],c=this.domainForClippedRange(e,[o],l,!1);return Co(Cl(c))}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t,!1)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValue"],e,t,i)}createNodeData(){const{axes:e,dataModel:t,processedData:i,colorScale:s,visible:o}=this,{xKey:n,yKey:r,xFilterKey:a,yFilterKey:l,labelKey:c,colorKey:d,xName:h,yName:u,labelName:p,marker:g,label:f}=this.properties,{placement:y}=f,m=Fi.anchor(g.shape),C=e.x,b=e.y;if(!(t&&i&&o&&C&&b))return;const S=t.resolveColumnById(this,"xValue",i),A=t.resolveColumnById(this,"yValue",i),R=d!=null?t.resolveColumnById(this,"colorValue",i):void 0,I=c!=null?t.resolveColumnById(this,"labelValue",i):void 0,w=a!=null?t.resolveColumnById(this,"xFilterValue",i):void 0,M=l!=null?t.resolveColumnById(this,"yFilterValue",i):void 0,T=C.scale,E=b.scale,P=(T.bandwidth??0)/2,N=(E.bandwidth??0)/2,F=[],_=f.getFont(),W=fl.getMeasurer({font:_});return(i.dataSources.get(this.id)??[]).forEach((U,G)=>{const V=S[G],O=A[G],H=T.convert(V)+P,B=E.convert(O)+N,Y=w!=null&&M!=null?w[G]===V&&M[G]===O:void 0,q=this.getLabelText(f,{value:I!=null?I?.[G]:O,datum:U,xKey:n,yKey:r,labelKey:c,xName:h,yName:u,labelName:p}),Z=W.measureText(q),ee=R!=null?s.convert(R[G]):void 0;F.push({series:this,itemId:r,yKey:r,xKey:n,datum:U,datumIndex:G,xValue:V,yValue:O,capDefaults:{lengthRatioMultiplier:g.getDiameter(),lengthMax:1/0},point:{x:H,y:B,size:g.size},midPoint:{x:H,y:B},fill:ee,label:{text:q,...Z},anchor:m,placement:y,selected:Y})}),{itemId:r,nodeData:F,labelData:F,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])}getMarkerItemBaseStyle(e){const{properties:t}=this,{marker:i}=t,s=e?t.highlightStyle.item:void 0;return{fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(e,t,i,s){const{id:o,properties:n}=this,{xKey:r,yKey:a,labelKey:l,marker:c}=n,{itemStyler:d}=c;if(d!=null)return this.cachedDatumCallback(ci(e,s?"highlight":"node"),()=>d({seriesId:o,datum:t,xKey:r,yKey:a,labelKey:l,highlighted:s,...i}))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:o,labelKey:n,marker:r,highlightStyle:a}=this.properties,l=_e(i&&a.item,r.getStyle());t.each((c,d)=>{this.updateMarkerStyle(c,r,{datum:d,highlighted:i,xKey:s,yKey:o,labelKey:n},l,{selected:d.selected})}),i||r.markClean()}updatePlacedLabelData(e){this.labelSelection.update(e.map(t=>({...t.datum,point:{x:t.x,y:t.y,size:t.datum.point.size}})),t=>{t.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{label:t}=this.properties;e.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=t.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=t.fontStyle,i.fontWeight=t.fontWeight,i.fontSize=t.fontSize,i.fontFamily=t.fontFamily,i.textAlign="left",i.textBaseline="top"})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:n}=this,{xKey:r,xName:a,yKey:l,yName:c,labelKey:d,labelName:h,title:u,tooltip:p}=n,g=o.x,f=o.y;if(!i||!s||!g||!f)return;const{datumIndex:y}=e,m=s.dataSources.get(this.id)?.[y],C=i.resolveColumnById(this,"xValue",s)[y],b=i.resolveColumnById(this,"yValue",s)[y];if(C==null)return;const S=this.getMarkerItemBaseStyle(!1);return Object.assign(S,this.getMarkerItemStyleOverrides(String(y),m,S,!1)),p.formatTooltip({symbol:this.legendItemSymbol(),title:u,data:[{label:a,fallbackLabel:r,value:g.formatDatum(C)},{label:c,fallbackLabel:l,value:f.formatDatum(b)}]},{seriesId:t,datum:m,title:c,xKey:r,xName:a,yKey:l,yName:c,labelKey:d,labelName:h,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){const{shape:e,fill:t,stroke:i,fillOpacity:s,strokeOpacity:o,strokeWidth:n,lineDash:r,lineDashOffset:a}=this.properties.marker;return{marker:{shape:e,fill:t??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:o,strokeWidth:n,lineDash:r,lineDashOffset:a}}}getLegendData(e){if(!this.properties.isValid()||e!=="category")return[];const{yKey:t,yName:i,title:s,showInLegend:o}=this.properties,{id:n,ctx:{legendManager:r},visible:a}=this;return[{legendType:"category",id:n,itemId:t,seriesId:n,enabled:a&&r.getItemEnabled({seriesId:n,itemId:t}),label:{text:s??i??t},symbol:this.legendItemSymbol(),hideInLegend:!o}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:s}=e;II(this,this.ctx.animationManager,t),it(this,"labels",this.ctx.animationManager,i),it(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Me}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,labelKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,labelKey:s,highlighted:!0})}computeFocusBounds(e){return $m(this,e)}};zI.className="ScatterSeries";zI.type="scatter";var T9={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:e=>new zI(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,fillOpacity:.8,tooltip:{position:{type:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}},paletteFactory:Um},Mz=class tD{constructor(t,i,s,o){this.startAngle=t,this.endAngle=i,this.innerRadius=s,this.outerRadius=o}clone(){const{startAngle:t,endAngle:i,innerRadius:s,outerRadius:o}=this;return new tD(t,i,s,o)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[Vb](t,i){return new tD(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}};function Dz({startAngle:e,endAngle:t,innerRadius:i,outerRadius:s}){let o=1/0,n=1/0,r=-1/0,a=-1/0;const l=(c,d)=>{o=Math.min(c,o),n=Math.min(d,n),r=Math.max(c,r),a=Math.max(d,a)};return l(i*Math.cos(e),i*Math.sin(e)),l(i*Math.cos(t),i*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),dc(0,e,t)&&l(s,0),dc(Math.PI*.5,e,t)&&l(0,s),dc(Math.PI,e,t)&&l(-s,0),dc(Math.PI*1.5,e,t)&&l(0,-s),new ve(o,n,r-o,a-n)}function ib(e,t,i){const s=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:o,outerRadius:n}=i;if(i.startAngle===i.endAngle||s<Math.min(o,n)||s>Math.max(o,n))return!1;const r=Af(i.startAngle),a=Af(i.endAngle),l=Math.atan2(t,e);return r<a?l<=a&&l>=r:l<=a&&l>=-Math.PI||l>=r&&l<=Math.PI}function oP(e,t){const{startAngle:i,endAngle:s,innerRadius:o,outerRadius:n}=t,r={x:n*Math.cos(i),y:n*Math.sin(i)},a={x:n*Math.cos(s),y:n*Math.sin(s)},l=o===0?{x:0,y:0}:{x:o*Math.cos(i),y:o*Math.sin(i)},c=o===0?{x:0,y:0}:{x:o*Math.cos(s),y:o*Math.sin(s)};return Au(e.start.x,e.start.y,e.end.x,e.end.y,r.x,r.y,l.x,l.y)||Au(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,c.x,c.y)||g_(0,0,n,i,s,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function Az(e,t){const i={x:e.x,y:e.y},s={x:e.x+e.width,y:e.y},o={x:e.x,y:e.y+e.height},n={x:e.x+e.width,y:e.y+e.height};return oP({start:i,end:s},t)||oP({start:o,end:n},t)}function nP(e,t,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*s)/(e+1*s))-t<0)return 1;let n=0,r=1;for(let a=0;a<8;a+=1){const l=(n+r)/2;Math.asin(Math.abs(l*i)/(e+l*i))+Math.asin(Math.abs(l*s)/(e+l*s))-t<0?n=l:r=l}return n}var L9=1e-6;function xc(e,t){return sS(e,t)<L9?t:St(e-t)+t}function Wy(e,t,i=0){const o=Math.abs(t-e)>=2*Math.PI?2*Math.PI:St(t-e);return e=xc(e,i),t=e+o,{startAngle:e,endAngle:t}}function jy(e,t,i,s,o,n){const r=Math.sin(n),a=Math.cos(n),l=e**2+t**2-i**2;let c,d,h,u;if(a>.5){const b=r/a,S=1+b**2,A=-2*(e+t*b),R=A**2-4*S*l;if(R<0)return;const I=(-A+Math.sqrt(R))/(2*S),w=(-A-Math.sqrt(R))/(2*S);c=I,d=I*b,h=w,u=w*b}else{const b=a/r,S=1+b**2,A=-2*(t+e*b),R=A**2-4*S*l;if(R<0)return;const I=(-A+Math.sqrt(R))/(2*S),w=(-A-Math.sqrt(R))/(2*S);c=I*b,d=I,h=w*b,u=w}const p=a,g=r,f=c*p+d*g,y=h*p+u*g,m=f>0?xc(Math.atan2(d-t,c-e),s):NaN,C=y>0?xc(Math.atan2(u-t,h-e),s):NaN;if(m>=s&&m<=o)return m;if(C>=s&&C<=o)return C}function Uy(e,t,i,s,o,n){const r=Math.hypot(e,t),a=(r**2-i**2+n**2)/(2*r),l=r-a,c=Math.atan2(t,e),d=Math.acos(-l/i),h=xc(c+d,s),u=xc(c-d,s);if(h>=s&&h<=o)return h;if(u>=s&&u<=o)return u}var Tw=class{constructor(e,t,i,s,o){this.cx=e,this.cy=t,this.r=i,this.a0=s,this.a1=o,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){e==null||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(e){e==null||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},Xi=class extends eo{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=Math.PI*2,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(t){this.concentricEdgeInset=t,this.radialEdgeInset=t}set cornerRadius(t){this.startOuterCornerRadius=t,this.endOuterCornerRadius=t,this.startInnerCornerRadius=t,this.endInnerCornerRadius=t}computeBBox(){return Dz(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:t}=this;let{innerRadius:i,outerRadius:s}=this;return i=i>0?i+t:0,s=Math.max(s-t,0),{innerRadius:i,outerRadius:s}}normalizedClipSector(){const{clipSector:t}=this;if(t==null)return;const{startAngle:i,endAngle:s}=Wy(this.startAngle,this.endAngle),{innerRadius:o,outerRadius:n}=this.normalizedRadii(),r=Wy(t.startAngle,t.endAngle,i);return new Mz(Math.max(i,r.startAngle),Math.min(s,r.endAngle),Math.max(o,t.innerRadius),Math.min(n,t.outerRadius))}getAngleOffset(t){return t>0?this.radialEdgeInset/t:0}arc(t,i,s,o,n,r,a,l){if(t<=0)return;const{startAngle:c,endAngle:d}=Wy(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:u}=this.normalizedRadii(),p=this.normalizedClipSector();if(l&&h<=0)return;const g=l?this.getAngleOffset(h+t):this.getAngleOffset(u-t),f=a?c+g+i:d-g-i,y=l?h+t:u-t,m=y*Math.cos(f),C=y*Math.sin(f);if(p!=null&&(!a&&!(f>=c-1e-6&&f<=p.endAngle-1e-6)||a&&!(f>=p.startAngle+1e-6&&f<=d-1e-6)||l&&y<p.innerRadius-1e-6||!l&&y>p.outerRadius+1e-6))return;const b=new Tw(m,C,t,s,o);if(p!=null){l?(b.clipStart(jy(m,C,t,s,o,p.endAngle)),b.clipEnd(jy(m,C,t,s,o,p.startAngle))):(b.clipStart(jy(m,C,t,s,o,p.startAngle)),b.clipEnd(jy(m,C,t,s,o,p.endAngle)));let w,M;if(a?(w=Uy(m,C,t,s,o,p.innerRadius),M=Uy(m,C,t,s,o,p.outerRadius)):(w=Uy(m,C,t,s,o,p.outerRadius),M=Uy(m,C,t,s,o,p.innerRadius)),b.clipStart(w),b.clipEnd(M),w!=null){const{x:T,y:E}=b.pointAt(w),P=xc(Math.atan2(E,T),c);a?r?.clipStart(P):n.clipEnd(P)}if(M!=null){const{x:T,y:E}=b.pointAt(M),P=xc(Math.atan2(E,T),c);a?n.clipStart(P):r?.clipEnd(P)}}if(p!=null){const{x:w,y:M}=b.pointAt((b.a0+b.a1)/2);if(!ib(w,M,p))return}const{x:S,y:A}=b.pointAt(a===l?b.a0:b.a1),R=xc(Math.atan2(A,S),c),I=l?r:n;return a?I?.clipStart(R):I?.clipEnd(R),b}updatePath(){const{path:i,centerX:s,centerY:o,concentricEdgeInset:n,radialEdgeInset:r}=this;let{startOuterCornerRadius:a,endOuterCornerRadius:l,startInnerCornerRadius:c,endInnerCornerRadius:d}=this;const{startAngle:h,endAngle:u}=Wy(this.startAngle,this.endAngle),{innerRadius:p,outerRadius:g}=this.normalizedRadii(),f=this.normalizedClipSector(),y=u-h,m=y>=2*Math.PI-1e-6;if(i.clear(),p===0&&g===0||p>g)return;if((f?.startAngle??h)===(f?.endAngle??u))return;if(m&&this.clipSector==null&&a===0&&l===0&&c===0&&d===0){i.moveTo(s+g*Math.cos(h),o+g*Math.sin(h)),i.arc(s,o,g,h,u),p>n&&(i.moveTo(s+p*Math.cos(u),o+p*Math.sin(u)),i.arc(s,o,p,u,h,!0)),i.closePath();return}else if(this.clipSector==null&&Math.abs(p-g)<1e-6){i.arc(s,o,g,h,u,!1),i.arc(s,o,g,u,h,!0),i.closePath();return}const C=this.getAngleOffset(p),b=this.getAngleOffset(g);if(y<2*b)return;const A=(f?.innerRadius??p)>n,R=p<n||y<2*C,I=g-p,w=Math.max(a,c,l,d),M=w>0?Math.min(I/w,1):1;a*=M,l*=M,c*=M,d*=M;const T=nP(g,y-2*b,-a,-l);if(a*=T,l*=T,!R&&A){const j=nP(p,y-2*C,c,d);c*=j,d*=j}else c=0,d=0;const E=Math.max(a+c,l+d),P=E>0?Math.min(I/E,1):1;a*=P,l*=P,c*=P,d*=P;let N=0,F=0;const _=a/(g-a),W=l/(g-l);if(_>=0&&_<1-1e-6)N=Math.asin(_);else{N=y/2;const j=g/(1/Math.sin(N)+1);a=Math.min(j,a)}if(W>=0&&W<1-1e-6)F=Math.asin(W);else{F=y/2;const j=g/(1/Math.sin(F)+1);l=Math.min(j,l)}const z=Math.asin(c/(p+c)),U=Math.asin(d/(p+d)),G=f?.outerRadius??g,V=this.getAngleOffset(G),O=new Tw(0,0,G,h+V,u-V),H=f?.innerRadius??p,B=this.getAngleOffset(H),Y=A?new Tw(0,0,H,h+B,u-B):void 0;f!=null&&(O.clipStart(f.startAngle),O.clipEnd(f.endAngle),Y?.clipStart(f.startAngle),Y?.clipEnd(f.endAngle));const q=this.arc(a,N,h-Math.PI*.5,h+N,O,Y,!0,!1),Z=this.arc(l,F,u-F,u+Math.PI*.5,O,Y,!1,!1),ee=this.arc(d,U,u+Math.PI*.5,u+Math.PI-U,O,Y,!1,!0),se=this.arc(c,z,h+Math.PI+z,h+Math.PI*1.5,O,Y,!0,!0);if(R){const j=y<Math.PI*.5?r*(1+Math.cos(y))/Math.sin(y):NaN;let X;j>0&&j<g?X=Math.max(Math.hypot(r,j),p):X=r,X=Math.max(X,p);const $=h+y*.5;i.moveTo(s+X*Math.cos($),o+X*Math.sin($))}else if(!(se?.isValid()===!0||Y?.isValid()===!0)){const j=h+y/2,X=p*Math.cos(j),$=p*Math.sin(j);i.moveTo(s+X,o+$)}if(q?.isValid()===!0){const{cx:j,cy:X,r:$,a0:J,a1:ie}=q;i.arc(s+j,o+X,$,J,ie)}if(O.isValid()){const{r:j,a0:X,a1:$}=O;i.arc(s,o,j,X,$)}if(Z?.isValid()===!0){const{cx:j,cy:X,r:$,a0:J,a1:ie}=Z;i.arc(s+j,o+X,$,J,ie)}if(!R){if(ee?.isValid()===!0){const{cx:j,cy:X,r:$,a0:J,a1:ie}=ee;i.arc(s+j,o+X,$,J,ie)}if(Y?.isValid()===!0){const{r:j,a0:X,a1:$}=Y;i.arc(s,o,j,$,X,!0)}if(se?.isValid()===!0){const{cx:j,cy:X,r:$,a0:J,a1:ie}=se;i.arc(s+j,o+X,$,J,ie)}}i.closePath()}isPointInPath(t,i){const{startAngle:s,endAngle:o,innerRadius:n,outerRadius:r}=this.clipSector??this;return ib(t-this.centerX,i-this.centerY,{startAngle:s,endAngle:o,innerRadius:Math.min(n,r),outerRadius:Math.max(n,r)})}};Xi.className="Sector";D([Ae()],Xi.prototype,"centerX",2);D([Ae()],Xi.prototype,"centerY",2);D([Ae()],Xi.prototype,"innerRadius",2);D([Ae()],Xi.prototype,"outerRadius",2);D([Ae()],Xi.prototype,"startAngle",2);D([Ae()],Xi.prototype,"endAngle",2);D([Ae()],Xi.prototype,"clipSector",2);D([Ae()],Xi.prototype,"concentricEdgeInset",2);D([Ae()],Xi.prototype,"radialEdgeInset",2);D([Ae()],Xi.prototype,"startOuterCornerRadius",2);D([Ae()],Xi.prototype,"endOuterCornerRadius",2);D([Ae()],Xi.prototype,"startInnerCornerRadius",2);D([Ae()],Xi.prototype,"endInnerCornerRadius",2);var ni={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Fr={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},Iz=class extends mt{constructor(){super(...arguments),this.showInLegend=!1}};D([k(xe)],Iz.prototype,"showInLegend",2);var VI=class extends Bi{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};D([k(he)],VI.prototype,"text",2);D([k(Ye)],VI.prototype,"spacing",2);var HI=class extends Ee{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};D([k(st)],HI.prototype,"fill",2);D([k(rt)],HI.prototype,"fillOpacity",2);var kp=class extends Bi{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};D([k(pe)],kp.prototype,"offset",2);D([k(Ye.restrict({min:0,max:360}))],kp.prototype,"minAngle",2);D([k(pe)],kp.prototype,"minSpacing",2);D([k(pe)],kp.prototype,"maxCollisionOffset",2);D([k(xe)],kp.prototype,"avoidCollisions",2);var WI=class extends Bi{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};D([k(Ye)],WI.prototype,"positionOffset",2);D([k(rt)],WI.prototype,"positionRatio",2);var OS=class extends Ee{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};D([k(Uo,{optional:!0})],OS.prototype,"colors",2);D([k(pe)],OS.prototype,"length",2);D([k(pe)],OS.prototype,"strokeWidth",2);var je=class extends Yo{constructor(){super(...arguments),this.fills=Object.values(ni),this.strokes=Object.values(Fr),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.innerLabels=new Sm(VI),this.title=new Iz,this.innerCircle=new HI,this.shadow=new mr,this.calloutLabel=new kp,this.sectorLabel=new WI,this.calloutLine=new OS,this.tooltip=new Ls}isValid(){const e=super.isValid();return this.innerRadiusRatio==null&&this.innerRadiusOffset==null?(ue.warnOnce("Either an [innerRadiusRatio] or an [innerRadiusOffset] must be set to render a donut series."),!1):e}};D([k(he)],je.prototype,"angleKey",2);D([k(he,{optional:!0})],je.prototype,"angleName",2);D([k(he,{optional:!0})],je.prototype,"angleFilterKey",2);D([k(he,{optional:!0})],je.prototype,"radiusKey",2);D([k(he,{optional:!0})],je.prototype,"radiusName",2);D([k(pe,{optional:!0})],je.prototype,"radiusMin",2);D([k(pe,{optional:!0})],je.prototype,"radiusMax",2);D([k(he,{optional:!0})],je.prototype,"calloutLabelKey",2);D([k(he,{optional:!0})],je.prototype,"calloutLabelName",2);D([k(he,{optional:!0})],je.prototype,"sectorLabelKey",2);D([k(he,{optional:!0})],je.prototype,"sectorLabelName",2);D([k(he,{optional:!0})],je.prototype,"legendItemKey",2);D([k(Uo)],je.prototype,"fills",2);D([k(Uo)],je.prototype,"strokes",2);D([k(rt)],je.prototype,"fillOpacity",2);D([k(rt)],je.prototype,"strokeOpacity",2);D([k(ra)],je.prototype,"lineDash",2);D([k(pe)],je.prototype,"lineDashOffset",2);D([k(pe)],je.prototype,"cornerRadius",2);D([k(Qs,{optional:!0})],je.prototype,"itemStyler",2);D([k(Ye)],je.prototype,"rotation",2);D([k(Ye)],je.prototype,"outerRadiusOffset",2);D([k(rt)],je.prototype,"outerRadiusRatio",2);D([k(Ye,{optional:!0})],je.prototype,"innerRadiusOffset",2);D([k(rt,{optional:!0})],je.prototype,"innerRadiusRatio",2);D([k(pe)],je.prototype,"strokeWidth",2);D([k(Ye)],je.prototype,"sectorSpacing",2);D([k(xe)],je.prototype,"hideZeroValueSectorsInLegend",2);D([k(pA)],je.prototype,"innerLabels",2);D([k(me)],je.prototype,"title",2);D([k(me)],je.prototype,"innerCircle",2);D([k(me)],je.prototype,"shadow",2);D([k(me)],je.prototype,"calloutLabel",2);D([k(me)],je.prototype,"sectorLabel",2);D([k(me)],je.prototype,"calloutLine",2);D([k(me)],je.prototype,"tooltip",2);function Yd(e,t,i,s){const o=[i.convert(0),i.convert(1)],n=[s.convert(0),s.convert(1)],r=Math.PI/-2+Ai(t),a=e?"initial":"update",l=({radius:g})=>({innerRadius:o[0],outerRadius:o[0]+(o[1]-o[0])*g}),c=({radius:g})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*g});return{nodes:{toFn:(g,f,y,{prevLive:m})=>{let{startAngle:C,endAngle:b,innerRadius:S,outerRadius:A}=f;const{stroke:R,fill:I}=f.sectorFormat;if(y==="removed"&&m?(C=m.datum?.endAngle,b=m.datum?.endAngle):y==="removed"&&!m&&(C=r,b=r),y==="removed"){const w=l(f);S=w.innerRadius,A=w.outerRadius}return{startAngle:C,endAngle:b,outerRadius:A,innerRadius:S,stroke:R,fill:I}},fromFn:(g,f,y,{prevFromProps:m})=>{let{startAngle:C,endAngle:b,innerRadius:S,outerRadius:A}=g,{fill:R,stroke:I}=f.sectorFormat;if(y==="unknown"||y==="added"&&!m?(C=r,b=r,S=f.innerRadius,A=f.outerRadius):y==="added"&&m&&(C=m.endAngle??r,b=m.endAngle??r,S=m.innerRadius??f.innerRadius,A=m.outerRadius??f.outerRadius),y==="added"&&!e){const w=c(f);S=w.innerRadius,A=w.outerRadius}return y==="updated"&&(R=g.fill??R,I=(typeof g.stroke=="string"?g.stroke:void 0)??I),{startAngle:C,endAngle:b,innerRadius:S,outerRadius:A,fill:R,stroke:I,phase:a}}},innerCircle:{fromFn:(g,f)=>({size:g.previousDatum?.radius??g.size??0,phase:a}),toFn:(g,f)=>({size:f.radius??0})}}}function jI(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,fill:t.sectorFormat.fill,stroke:t.sectorFormat.stroke}}function UI(e,t){const i=t.y-e.centerY,s=t.x-e.centerX,o=Math.atan2(i,s),n=e.getItemNodes();for(const r of n)if(r.datum.missing!==!0&&dc(o,r.startAngle,r.endAngle)){const a=Math.sqrt(s*s+i*i);let l=0;return a<r.innerRadius?l=r.innerRadius-a:a>r.outerRadius&&(l=a-r.outerRadius),{datum:r.datum,distance:l}}}var Rz=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(Rz||{}),FS=class extends sI{constructor({useLabelLayer:e=!1,pickModes:t=[1,0],canHaveAxes:i=!1,animationResetFns:s,...o}){super({...o,useLabelLayer:e,pickModes:t,directionKeys:{x:["angleKey"],y:["radiusKey"]},directionNames:{x:["angleName"],y:["radiusName"]},canHaveAxes:i}),this.itemGroup=this.contentGroup.appendChild(new Me),this.nodeData=[],this.itemSelection=ai.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=ai.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=ai.select(this.highlightGroup,()=>this.nodeFactory()),this.highlightLabelSelection=ai.select(this.highlightLabel,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=s,this.animationState=new Am("empty",{empty:{update:{target:"ready",action:n=>this.animateEmptyUpdateReady(n)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:n=>this.animateReadyHighlight(n),highlightMarkers:n=>this.animateReadyHighlightMarkers(n),resize:n=>this.animateReadyResize(n),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:n=>this.animateWaitingUpdateReady(n)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:n=>this.animateClearingUpdateEmpty(n)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}setSeriesIndex(e){return super.setSeriesIndex(e)?(this.contentGroup.zIndex=[e,1],this.highlightGroup.zIndex=[e,2],this.labelGroup.zIndex=[e,3],!0):!1}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}labelFactory(){const e=new Oi;return e.pointerEvents=1,e}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",e=>this.onLegendItemClick(e)))}getInnerRadius(){return 0}computeLabelsBBox(e,t){return null}resetAllAnimation(){const{item:e,label:t}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),e&&Wi([this.itemSelection,this.highlightSelection],e),t&&Wi([this.labelSelection,this.highlightLabelSelection],t),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){const{item:t,label:i}=this.animationResetFns??{};t&&Wi([this.highlightSelection],t),i&&Wi([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(e){}animateReadyResize(e){this.resetAllAnimation()}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(t!==void 0)return this.itemSelection.select(i=>i instanceof eo&&i.datum===t)[0]}getSeriesRange(e,t){return[NaN,NaN]}},E9=class extends km{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},KI=class extends FS{constructor(e){super({moduleCtx:e,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:jI,label:wl}}),this.properties=new je,this.phantomNodeData=void 0,this.backgroundGroup=new Zs({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new sr,this.radiusScale=new sr,this.phantomGroup=this.backgroundGroup.appendChild(new Me({name:"phantom"})),this.phantomSelection=ai.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Me({name:"pieCalloutLabels"})),this.calloutLabelSelection=new ai(this.calloutLabelGroup,Me),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Me({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Fi({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new Fi({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new Me({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new Me({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=ai.select(this.innerLabelsGroup,Oi),this.innerCircleSelection=ai.select(this.innerCircleGroup,()=>new Fi({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=E9,this.angleScale=new sr,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e?.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}setSeriesIndex(e){return super.setSeriesIndex(e)?(this.backgroundGroup.zIndex=[0,e],!0):!1}nodeFactory(){return new Xi}getSeriesDomain(e){return e==="x"?this.angleScale.domain:this.radiusScale.domain}async processData(e){if(this.data==null||!this.properties.isValid())return;const{visible:t,id:i}=this,{angleKey:s,angleFilterKey:o,radiusKey:n,calloutLabelKey:r,sectorLabelKey:a,legendItemKey:l}=this.properties,c=(f,y,m)=>t&&this.ctx.legendManager.getItemEnabled({seriesId:i,itemId:m}),d=!this.ctx.animationManager.isSkipped(),h=[],u=[];l?h.push(or(l,"band",{id:"legendItemKey"})):r?h.push(or(r,"band",{id:"calloutLabelKey"})):a&&h.push(or(a,"band",{id:"sectorLabelKey"}));const p=this.radiusScale.type,g=this.angleScale.type;n&&u.push(aI(n,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax}),ze(n,p,{id:"radiusRaw"}),$d("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),r&&u.push(ze(r,"band",{id:"calloutLabelValue"})),a&&u.push(ze(a,"band",{id:"sectorLabelValue"})),l&&u.push(ze(l,"band",{id:"legendItemValue"})),o&&u.push(Lf(o,g,{id:"angleFilterValue",onlyPositive:!0,validation:c,invalidValue:0}),ze(o,g,{id:"angleFilterRaw"}),$d("angleFilterValue",[0,1],0,0)),d&&this.processedData&&h.length>0&&u.push(xp(this.id,this.processedData)),u.push(Sp()),await this.requestDataModel(e,this.data,{props:[...h,Lf(s,g,{id:"angleValue",onlyPositive:!0,validation:c,invalidValue:0}),ze(s,g,{id:"angleRaw"}),$d("angleValue",[0,1],0,0),...u]});for(const f of this.processedData?.defs?.values??[]){const{id:y,missing:m,property:C}=f,b=YA(this,m);y!=="angleRaw"&&b>0&&ue.warnOnce(`no value was found for the key '${String(C)}' on ${b} data element${b>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,this.nodeDataRefresh=!1}getProcessedDataValues(e,t){const i=e.resolveColumnById(this,"angleValue",t),s=e.resolveColumnById(this,"angleRaw",t),o=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterValue",t):void 0,n=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterRaw",t):void 0,r=this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,a=this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,l=this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,c=this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,d=this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:o,angleFilterRawValues:n,radiusValues:r,radiusRawValues:a,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:d}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:s,ctx:{legendManager:o},visible:n}=this,{rotation:r,innerRadiusRatio:a}=this.properties;if(!this.properties.isValid())return this.zerosumOuterRing.visible=!0,this.zerosumInnerRing.visible=!0,{itemId:e,nodeData:[],labelData:[]};if(!i||t?.type!=="ungrouped")return;const{angleValues:l,angleRawValues:c,angleFilterValues:d,angleFilterRawValues:h,radiusValues:u,radiusRawValues:p,calloutLabelValues:g,sectorLabelValues:f,legendItemValues:y}=this.getProcessedDataValues(i,t),m=h?.some((w,M)=>w>c[M])??!1;let C=0,b=0;const S=[],A=h!=null?[]:void 0,R=t.dataSources.get(this.id)??[],I=t.invalidData?.get(this.id);return R.forEach((w,M)=>{if(I?.[M]===!0)return;const T=m?d[M]:l[M],E=h!=null&&!m?Math.sqrt(h[M]/c[M]):1,P=s.convert(C)+Ai(r);C=T,b+=T;const N=s.convert(C)+Ai(r),F=Math.abs(N-P),_=P+F/2,W=c[M],U=(u?.[M]??1)*E,G=p?.[M],V=y?.[M],O=this.getLabels(w,_,F,!0,g?.[M],f?.[M],V),H=this.getSectorFormat(w,M,!1),B={itemId:M,series:this,datum:w,datumIndex:M,angleValue:W,midAngle:_,midCos:Math.cos(_),midSin:Math.sin(_),startAngle:P,endAngle:N,radius:U,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(U),0),sectorFormat:H,radiusValue:G,legendItemValue:V,enabled:n&&o.getItemEnabled({seriesId:e,itemId:M}),focusable:!0,...O};S.push(B),A?.push({...B,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}),this.zerosumOuterRing.visible=b===0,this.zerosumInnerRing.visible=b===0&&a!=null&&a!==1&&a>0,{itemId:e,nodeData:S,labelData:S,phantomNodeData:A}}getLabels(e,t,i,s,o,n,r){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,d=!s||a.enabled?this.properties.calloutLabelKey:void 0,h=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!d&&!h&&!c)return{};const u={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return d&&i>=Ai(a.minAngle)&&(p.calloutLabel={...this.getTextAlignment(t),text:this.getLabelText(a,{...u,value:o}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),h&&(p.sectorLabel={text:this.getLabelText(l,{...u,value:n})}),c!=null&&r!=null&&(p.legendItem={key:c,text:r}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Af(e),s=-.75*Math.PI,o=i-s,n=Math.floor(o/(Math.PI/2)),r=oA(n,t.length);return t[r]}getSectorFormat(e,t,i){const{angleKey:s,radiusKey:o,calloutLabelKey:n,sectorLabelKey:r,legendItemKey:a,fills:l,strokes:c,itemStyler:d}=this.properties,h=c[t%c.length],{fill:u,fillOpacity:p,stroke:g,strokeWidth:f,strokeOpacity:y,lineDash:m,lineDashOffset:C,cornerRadius:b}=_e(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[t%l.length]:void 0,stroke:h,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties);let S;return d&&(S=this.cachedDatumCallback(this.getDatumId(e,t)+(i?"-highlight":"-hide"),()=>d({datum:e,angleKey:s,radiusKey:o,calloutLabelKey:n,sectorLabelKey:r,legendItemKey:a,fill:u,fillOpacity:p,stroke:g,strokeWidth:f,strokeOpacity:y,lineDash:m,lineDashOffset:C,cornerRadius:b,highlighted:i,seriesId:this.id}))),{fill:S?.fill??u,fillOpacity:S?.fillOpacity??p,stroke:S?.stroke??g,strokeWidth:S?.strokeWidth??f,strokeOpacity:S?.strokeOpacity??y,lineDash:S?.lineDash??m,lineDashOffset:S?.lineDashOffset??C,cornerRadius:S?.cornerRadius??b}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,s=e*t+i;return s===e||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:e,outerRadiusOffset:t}=this.properties;return Math.max(this.radius*e+t,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);if(e===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-e);return-e-i-s}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},s=sl(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const o=this.getTitleTranslationY();t.node.y=isFinite(o)?o:0;const n=t.node.getBBox();t.node.visible=t.enabled&&isFinite(o)&&!this.bboxIntersectsSurroundingSeries(n)}for(const o of[this.zerosumInnerRing,this.zerosumOuterRing])o.fillOpacity=0,o.stroke=this.properties.calloutLabel.color,o.strokeWidth=1,o.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&this.labelGroup?.removeChild(e.node),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=t=>{const i=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,i),y:t.midSin*Math.max(0,i)}};this.nodeData.forEach(e),this.phantomNodeData?.forEach(e)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:o,labelSelection:n,innerLabelsSelection:r}=this,a=this.nodeData.map(c=>({...c,sectorFormat:{...c.sectorFormat}})),l=(c,d)=>{c.update(d,void 0,h=>this.getDatumId(h.datum,h.datumIndex)),this.ctx.animationManager.isSkipped()&&c.cleanup()};l(e,this.nodeData),l(t,a),l(i,this.phantomNodeData??[]),o.update(this.calloutNodeData,c=>{const d=new $o;d.tag=0,d.pointerEvents=1,c.appendChild(d);const h=new Oi;h.tag=1,h.pointerEvents=1,c.appendChild(h)}),n.update(this.nodeData),s.update(a),r.update(this.properties.innerLabels,c=>{c.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const o=Math.min(i,this.getOuterRadius());t=Math.ceil(o*2+1)}const s=e?[{radius:t}]:[];this.innerCircleSelection.update(s)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&t?.series===this,this.highlightLabel.visible=i&&t?.series===this,this.labelGroup.visible=i,this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((n,{radius:r})=>{n.setProperties({fill:this.properties.innerCircle?.fill,opacity:this.properties.innerCircle?.fillOpacity,size:r})});const s=this.ctx.animationManager.isSkipped(),o=(n,r,a,l)=>{const c=this.getSectorFormat(r.datum,r.itemId,l);r.sectorFormat.fill=c.fill,r.sectorFormat.stroke=c.stroke,s&&(n.startAngle=r.startAngle,n.endAngle=r.endAngle,n.innerRadius=r.innerRadius,n.outerRadius=r.outerRadius),(l||s)&&(n.fill=c.fill,n.stroke=c.stroke),n.strokeWidth=c.strokeWidth,n.fillOpacity=c.fillOpacity,n.strokeOpacity=c.strokeOpacity,n.lineDash=c.lineDash,n.lineDashOffset=c.lineDashOffset,n.cornerRadius=c.cornerRadius,n.fillShadow=this.properties.shadow;const d=Math.max((this.properties.sectorSpacing+(c.stroke!=null?c.strokeWidth:0))/2,0);n.inset=d,n.lineJoin=this.properties.sectorSpacing>=0||d>0?"miter":"round"};this.itemSelection.each((n,r,a)=>o(n,r,a,!1)),this.highlightSelection.each((n,r,a)=>{o(n,r,a,!0),n.visible=r.itemId===t?.itemId}),this.phantomSelection.each((n,r,a)=>o(n,r,a,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:e}=this.properties,t=e.length,i=e.strokeWidth,s=e.colors??this.properties.strokes,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((n,r)=>{const a=n.datum,{calloutLabel:l,outerRadius:c}=a;if(l?.text&&!l.hidden&&c!==0){n.visible=!0,n.strokeWidth=i,n.stroke=s[r%s.length],n.fill=void 0;const d=a.midCos*c,h=a.midSin*c;let u=a.midCos*(c+t),p=a.midSin*(c+t);if((l.collisionTextAlign??l.collisionOffsetY!==0)&&l.box!=null){const f=l.box;let y=u,m=p;u<f.x?y=f.x:u>f.x+f.width&&(y=f.x+f.width),p<f.y?m=f.y:p>f.y+f.height&&(m=f.y+f.height);const C=y-u,b=m-p,S=Math.sqrt(Math.pow(C,2)+Math.pow(b,2)),A=S-o;A>0&&(u=u+C*A/S,p=p+b*A/S)}n.x1=d,n.y1=h,n.x2=u,n.y2=p}else n.visible=!1})}getLabelOverflow(e,t,i){const s=-this.centerX,o=s+i.width,n=-this.centerY,r=n+i.height,a=1;let l=1;t.x+a<s?l=(t.x+t.width-s)/t.width:t.x+t.width-a>o&&(l=(o-t.x)/t.width);const c=t.y+a<n||t.y+t.height-a>r,d=l===1?e.length:Math.floor(e.length*l)-1,h=this.bboxIntersectsSurroundingSeries(t);return{textLength:d,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:h}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(t==null)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=t**2;return i.some(o=>o.x**2+o.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:o}=t,n=e.convert(0),r=m=>!m.calloutLabel||m.outerRadius===0,a=this.calloutNodeData,l=a.filter(m=>!r(m));if(l.forEach(m=>{const C=m.calloutLabel;C!=null&&(C.hidden=!1,C.collisionTextAlign=void 0,C.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(m=>m.midCos<0).sort((m,C)=>m.midSin-C.midSin),d=l.filter(m=>m.midCos>=0).sort((m,C)=>m.midSin-C.midSin),h=l.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,C)=>m.midCos-C.midCos),u=l.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,C)=>m.midCos-C.midCos),p=m=>{const C=m.calloutLabel;if(C==null)return ve.zero.clone();const b=m.outerRadius+i.length+s,S=m.midCos*b,A=m.midSin*b+C.collisionOffsetY,R=C.collisionTextAlign??C.textAlign,I=C.textBaseline;return Oi.computeBBox(C.text,S,A,{font:this.properties.calloutLabel,textAlign:R,textBaseline:I})},g=(m,C,b)=>{const S=p(m).grow(o/2),A=p(C).grow(o/2);S.x<A.x+A.width&&S.x+S.width>A.x&&(b==="to-top"?S.y<A.y+A.height:S.y+S.height>A.y)&&(C.calloutLabel.collisionOffsetY=b==="to-top"?S.y-A.y-A.height:S.y+S.height-A.y)},f=m=>{const C=m.slice().sort((S,A)=>Math.abs(S.midSin)-Math.abs(A.midSin))[0],b=m.indexOf(C);for(let S=b-1;S>=0;S--){const A=m[S+1],R=m[S];g(A,R,"to-top")}for(let S=b+1;S<m.length;S++){const A=m[S-1],R=m[S];g(A,R,"to-bottom")}},y=m=>{const C=l.some(w=>w.calloutLabel.collisionOffsetY!==0),b=m.map(w=>p(w)),S=b.map(w=>w.clone().grow(o/2));let A=!1;for(let w=0;w<S.length&&!A;w++){const M=S[w];for(let T=w+1;T<m.length;T++){const E=S[T];if(M.collidesBBox(E)){A=!0;break}}}const R=a.map(w=>{const{startAngle:M,endAngle:T,outerRadius:E}=w;return{startAngle:M,endAngle:T,innerRadius:n,outerRadius:E}}),I=b.some(w=>R.some(M=>Az(w,M)));!A&&!C&&!I||m.filter(w=>w.calloutLabel.textAlign==="center").forEach(w=>{const M=w.calloutLabel;w.midCos<0?M.collisionTextAlign="right":w.midCos>0?M.collisionTextAlign="left":M.collisionTextAlign="center"})};f(c),f(d),y(h),y(u)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,o=s.length,{offset:n,color:r}=i,a=new Oi;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const{datum:c}=l,d=c.calloutLabel,h=t.convert(c.radius),u=Math.max(0,h);if(!d?.text||u===0||d.hidden){l.visible=!1;return}const p=u+o+n,g=c.midCos*p,f=c.midSin*p+d.collisionOffsetY,y={textAlign:d.collisionTextAlign??d.textAlign,textBaseline:d.textBaseline};a.text=d.text,a.x=g,a.y=f,a.setFont(this.properties.calloutLabel),a.setAlign(y);const m=a.getBBox();let C=d.text,b=!0;if(i.avoidCollisions){const{textLength:S,hasVerticalOverflow:A}=this.getLabelOverflow(d.text,m,e);C=d.text.length===S?d.text:`${d.text.substring(0,S)}…`,b=!A}l.text=C,l.x=g,l.y=f,l.setFont(this.properties.calloutLabel),l.setAlign(y),l.fill=r,l.visible=b})}computeLabelsBBox(e,t){const{calloutLabel:i,calloutLine:s}=this.properties,o=s.length,{offset:n,maxCollisionOffset:r,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Oi;let d;const{title:h}=this.properties;if(h?.text&&h.enabled){const u=this.getTitleTranslationY();isFinite(u)&&(c.text=h.text,c.x=0,c.y=u,c.setFont(h),c.setAlign({textBaseline:"bottom",textAlign:"center"}),d=c.getBBox(),l.push(d))}return this.calloutNodeData.forEach(u=>{const p=u.calloutLabel;if(!p||u.outerRadius===0)return null;const g=u.outerRadius+o+n,f=u.midCos*g,y=u.midSin*g+p.collisionOffsetY;c.text=p.text,c.x=f,c.y=y,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const m=c.getBBox();if(p.box=m,Math.abs(p.collisionOffsetY)>r){p.hidden=!0;return}if(d){const C=-this.centerY,b=new ve(d.x-a,C,d.width+2*a,d.y+d.height+a-C);if(m.collidesBBox(b)){p.hidden=!0;return}}if(e.hideWhenNecessary){const{textLength:C,hasVerticalOverflow:b,hasSurroundingSeriesOverflow:S}=this.getLabelOverflow(p.text,m,t),A=p.text.length>2&&C<2;if(b||A||S){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:ve.merge(l)}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:s,fontWeight:o,fontFamily:n,positionOffset:r,positionRatio:a,color:l}=this.properties.sectorLabel,c=(d,h)=>{const{sectorLabel:u,outerRadius:p}=h;let g=!1;if(u&&p!==0){const f=t*(1-a)+p*a+r;d.fill=l,d.fontStyle=s,d.fontWeight=o,d.fontSize=i,d.fontFamily=n,d.text=u.text,d.x=h.midCos*f,d.y=h.midSin*f,d.textAlign="center",d.textBaseline="middle";const y=d.getBBox(),m=[[y.x,y.y],[y.x+y.width,y.y],[y.x+y.width,y.y+y.height],[y.x,y.y+y.height]],{startAngle:C,endAngle:b}=h,S={startAngle:C,endAngle:b,innerRadius:t,outerRadius:p};m.every(([A,R])=>ib(A,R,S))&&(g=!0)}d.visible=g};this.labelSelection.each(c),this.highlightLabelSelection.each(c)}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((d,h)=>{const{fontStyle:u,fontWeight:p,fontSize:g,fontFamily:f,color:y}=h;d.fontStyle=u,d.fontWeight=p,d.fontSize=g,d.fontFamily=f,d.text=h.text,d.x=0,d.y=0,d.fill=y,d.textAlign="center",d.textBaseline="alphabetic",e.push(d.getBBox()),t.push(h.spacing)});const i=d=>d===0?0:t[d],s=d=>d===t.length-1?0:t[d],o=e.reduce((d,h,u)=>d+h.height+i(u)+s(u),0),n=Math.max(...e.map(d=>d.width)),r=this.getInnerRadius(),l=Math.sqrt(Math.pow(n/2,2)+Math.pow(o/2,2))<=(r>0?r:this.getOuterRadius()),c=[];for(let d=0,h=-o/2;d<e.length;d++){const p=e[d].height+h+i(d);c.push(p),h=p+s(d)}this.innerLabelsSelection.each((d,h,u)=>{d.y=c[u],d.visible=l})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(e){return UI(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{legendItemKey:n,calloutLabelKey:r,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:d,angleName:h,radiusKey:u,radiusName:p,tooltip:g}=o,f=this.properties.title.text;if(!i||!s)return;const{datumIndex:y}=e,m=s.dataSources.get(this.id)?.[y],{angleRawValues:C,legendItemValues:b,calloutLabelValues:S,sectorLabelValues:A}=this.getProcessedDataValues(i,s),R=C[y],I=b?.[y]??(r===d?void 0:S?.[y])??(l===d?void 0:A?.[y])??h;return g.formatTooltip({title:f,symbol:this.legendItemSymbol(y),data:[{label:I,fallbackLabel:d,value:il(R,3)}]},{seriesId:t,datum:m,title:h,legendItemKey:n,calloutLabelKey:r,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:d,angleName:h,radiusKey:u,radiusName:p,...this.getSectorFormat(m,y,!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.[e],i=this.getSectorFormat(t,e,!1);return{marker:{fill:i.fill,stroke:i.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}}}getLegendData(e){const{visible:t,processedData:i,dataModel:s,id:o,ctx:{legendManager:n}}=this;if(!s||!i||!this.properties.isValid()||e!=="category")return[];const{angleKey:r,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:d}=this.properties;if(!c&&(!a||a===r)&&(!l||l===r))return[];const{angleRawValues:h,calloutLabelValues:u,sectorLabelValues:p,legendItemValues:g}=this.getProcessedDataValues(s,i),f=this.properties.title?.showInLegend&&this.properties.title.text,y=[],m=this.properties.hideZeroValueSectorsInLegend,C=i.dataSources.get(this.id),b=i.invalidData?.get(this.id);for(let S=0;S<i.input.count;S++){const A=C?.[S],R=h[S];if(b?.[S]===!0||m&&R===0)continue;const I=[];f&&I.push(f);const w=this.getLabels(A,2*Math.PI,2*Math.PI,!1,u?.[S],p?.[S],g?.[S]);c&&w.legendItem!==void 0?I.push(w.legendItem.text):a&&a!==r&&w.calloutLabel?.text!==void 0?I.push(w.calloutLabel?.text):l&&l!==r&&w.sectorLabel?.text!==void 0&&I.push(w.sectorLabel?.text),I.length!==0&&y.push({legendType:"category",id:o,datum:A,itemId:S,seriesId:o,enabled:t&&n.getItemEnabled({seriesId:o,itemId:S}),label:{text:I.join(" - ")},symbol:this.legendItemSymbol(S),legendItemName:c!=null?A[c]:void 0,hideInLegend:!d})}return y}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:s}}=this;e.forEach((o,n)=>i.toggleItem({enabled:o,seriesId:t,itemId:n})),i.update(),s.update(4)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=Yd(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Wt(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,o)=>this.getDatumId(o.datum,o.datumIndex)),Wt(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),it(this,"callout",t,this.calloutLabelSelection),it(this,"sector",t,this.labelSelection),it(this,"highlight",t,this.highlightLabelSelection),it(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,processedData:s,radiusScale:o,previousRadiusScale:n}=this,{animationManager:r}=this.ctx,a=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(a?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,d=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!d)&&this.ctx.animationManager.skipCurrentBatch();const h=!this.nodeData.some(p=>p.enabled),u=Yd(!1,this.properties.rotation,o,n);Wt(this.id,"nodes",r,[e,t,i],u.nodes,(p,g)=>this.getDatumId(g.datum,g.datumIndex),a),Wt(this.id,"innerCircle",r,[this.innerCircleSelection],u.innerCircle),it(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),it(this,"sector",this.ctx.animationManager,this.labelSelection),it(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.noVisibleData!==h&&(this.noVisibleData=h,it(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,radiusScale:s,previousRadiusScale:o}=this,{animationManager:n}=this.ctx,r=Yd(!1,this.properties.rotation,s,o);Wt(this.id,"nodes",n,[e,t,i],r.nodes,(a,l)=>this.getDatumId(l.datum,l.datumIndex)),Wt(this.id,"innerCircle",n,[this.innerCircleSelection],r.innerCircle),pc(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),pc(this,"sector",this.ctx.animationManager,this.labelSelection),pc(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),pc(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e,t){const{calloutLabelKey:i,sectorLabelKey:s,legendItemKey:o}=this.properties;return this.processedData?.reduced?.animationValidation?.uniqueKeys?o?ci(e[o]):i?ci(e[i]):s?ci(e[s]):`${t}`:`${t}`}};KI.className="DonutSeries";KI.type="donut";var P9={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2},fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Hc,xOffset:3,yOffset:3,blur:5},innerLabels:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},legend:{enabled:!0}},N9={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2},fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Hc,xOffset:3,yOffset:3,blur:5}},legend:{enabled:!0}},kz=({takeColors:e,colorsCount:t})=>{const{fills:i,strokes:s}=e(t);return{fills:i,strokes:s,calloutLine:{colors:s}}},O9={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:e=>new KI(e),tooltipDefaults:{range:"exact"},themeTemplate:P9,paletteFactory:kz},Tz=class extends mt{constructor(){super(...arguments),this.showInLegend=!1}};D([k(xe)],Tz.prototype,"showInLegend",2);var Tp=class extends Bi{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};D([k(pe)],Tp.prototype,"offset",2);D([k(Ye.restrict({min:0,max:360}))],Tp.prototype,"minAngle",2);D([k(pe)],Tp.prototype,"minSpacing",2);D([k(pe)],Tp.prototype,"maxCollisionOffset",2);D([k(xe)],Tp.prototype,"avoidCollisions",2);var $I=class extends Bi{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};D([k(Ye)],$I.prototype,"positionOffset",2);D([k(rt)],$I.prototype,"positionRatio",2);var BS=class extends Ee{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};D([k(Uo,{optional:!0})],BS.prototype,"colors",2);D([k(pe)],BS.prototype,"length",2);D([k(pe)],BS.prototype,"strokeWidth",2);var ot=class extends Yo{constructor(){super(...arguments),this.fills=Object.values(ni),this.strokes=Object.values(Fr),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.title=new Tz,this.shadow=new mr,this.calloutLabel=new Tp,this.sectorLabel=new $I,this.calloutLine=new BS,this.tooltip=new Ls}};D([k(he)],ot.prototype,"angleKey",2);D([k(he,{optional:!0})],ot.prototype,"angleName",2);D([k(he,{optional:!0})],ot.prototype,"angleFilterKey",2);D([k(he,{optional:!0})],ot.prototype,"radiusKey",2);D([k(he,{optional:!0})],ot.prototype,"radiusName",2);D([k(pe,{optional:!0})],ot.prototype,"radiusMin",2);D([k(pe,{optional:!0})],ot.prototype,"radiusMax",2);D([k(he,{optional:!0})],ot.prototype,"calloutLabelKey",2);D([k(he,{optional:!0})],ot.prototype,"calloutLabelName",2);D([k(he,{optional:!0})],ot.prototype,"sectorLabelKey",2);D([k(he,{optional:!0})],ot.prototype,"sectorLabelName",2);D([k(he,{optional:!0})],ot.prototype,"legendItemKey",2);D([k(Uo)],ot.prototype,"fills",2);D([k(Uo)],ot.prototype,"strokes",2);D([k(rt)],ot.prototype,"fillOpacity",2);D([k(rt)],ot.prototype,"strokeOpacity",2);D([k(ra)],ot.prototype,"lineDash",2);D([k(pe)],ot.prototype,"lineDashOffset",2);D([k(pe)],ot.prototype,"cornerRadius",2);D([k(Qs,{optional:!0})],ot.prototype,"itemStyler",2);D([k(Ye)],ot.prototype,"rotation",2);D([k(Ye)],ot.prototype,"outerRadiusOffset",2);D([k(rt)],ot.prototype,"outerRadiusRatio",2);D([k(pe)],ot.prototype,"strokeWidth",2);D([k(Ye)],ot.prototype,"sectorSpacing",2);D([k(xe)],ot.prototype,"hideZeroValueSectorsInLegend",2);D([k(me)],ot.prototype,"title",2);D([k(me)],ot.prototype,"shadow",2);D([k(me)],ot.prototype,"calloutLabel",2);D([k(me)],ot.prototype,"sectorLabel",2);D([k(me)],ot.prototype,"calloutLine",2);D([k(me)],ot.prototype,"tooltip",2);var F9=class extends km{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},YI=class extends FS{constructor(e){super({moduleCtx:e,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:jI,label:wl}}),this.properties=new ot,this.phantomNodeData=void 0,this.backgroundGroup=new Zs({name:`${this.id}-background`,zIndex:0}),this.previousRadiusScale=new sr,this.radiusScale=new sr,this.phantomGroup=this.backgroundGroup.appendChild(new Me({name:"phantom"})),this.phantomSelection=ai.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Me({name:"pieCalloutLabels"})),this.calloutLabelSelection=new ai(this.calloutLabelGroup,Me),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Me({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Fi({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=F9,this.angleScale=new sr,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}setSeriesIndex(e){return super.setSeriesIndex(e)?(this.backgroundGroup.zIndex=[0,e],!0):!1}nodeFactory(){const e=new Xi;return e.miterLimit=1e9,e}getSeriesDomain(e){return e==="x"?this.angleScale.domain:this.radiusScale.domain}async processData(e){if(this.data==null||!this.properties.isValid())return;const{visible:t,id:i,ctx:{legendManager:s}}=this,{angleKey:o,angleFilterKey:n,radiusKey:r,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c}=this.properties,d=(y,m,C)=>t&&s.getItemEnabled({seriesId:i,itemId:C}),h=!this.ctx.animationManager.isSkipped(),u=[],p=[];c?u.push(or(c,"band",{id:"legendItemKey"})):a?u.push(or(a,"band",{id:"calloutLabelKey"})):l&&u.push(or(l,"band",{id:"sectorLabelKey"}));const g=this.radiusScale.type,f=this.angleScale.type;r&&p.push(aI(r,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax}),ze(r,g,{id:"radiusRaw"}),$d("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),a&&p.push(ze(a,"band",{id:"calloutLabelValue"})),l&&p.push(ze(l,"band",{id:"sectorLabelValue"})),c&&p.push(ze(c,"band",{id:"legendItemValue"})),n&&p.push(Lf(n,f,{id:"angleFilterValue",onlyPositive:!0,validation:d,invalidValue:0}),ze(n,f,{id:"angleFilterRaw"}),$d("angleFilterValue",[0,1],0,0)),h&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&u.length>0&&p.push(xp(this.id,this.processedData)),p.push(Sp()),await this.requestDataModel(e,this.data,{props:[...u,Lf(o,f,{id:"angleValue",onlyPositive:!0,validation:d,invalidValue:0}),ze(o,f,{id:"angleRaw"}),$d("angleValue",[0,1],0,0),...p]});for(const y of this.processedData?.defs?.values??[]){const{id:m,missing:C,property:b}=y,S=YA(this,C);m!=="angleRaw"&&S>0&&ue.warnOnce(`no value was found for the key '${String(b)}' on ${S} data element${S>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,this.nodeDataRefresh=!1}getProcessedDataValues(e,t){const i=e.resolveColumnById(this,"angleValue",t),s=e.resolveColumnById(this,"angleRaw",t),o=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterValue",t):void 0,n=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterRaw",t):void 0,r=this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,a=this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,l=this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,c=this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,d=this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:o,angleFilterRawValues:n,radiusValues:r,radiusRawValues:a,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:d}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:s,ctx:{legendManager:o},visible:n}=this,{rotation:r}=this.properties;if(!i||t?.type!=="ungrouped")return;const{angleValues:a,angleRawValues:l,angleFilterValues:c,angleFilterRawValues:d,radiusValues:h,radiusRawValues:u,calloutLabelValues:p,sectorLabelValues:g,legendItemValues:f}=this.getProcessedDataValues(i,t),y=d?.some((I,w)=>I>l[w])??!1;let m=0,C=0;const b=[],S=d!=null?[]:void 0,A=t.dataSources.get(this.id)??[],R=t.invalidData?.get(this.id);return A.forEach((I,w)=>{if(R?.[w]===!0)return;const M=y?c[w]:a[w],T=d!=null&&!y?Math.sqrt(d[w]/l[w]):1,E=s.convert(m)+Ai(r);m=M,C+=M;const P=s.convert(m)+Ai(r),N=Math.abs(P-E),F=E+N/2,_=l[w],z=(h?.[w]??1)*T,U=u?.[w],G=f?.[w],V=this.getLabels(I,F,N,!0,p?.[w],g?.[w],G),O=this.getSectorFormat(I,w,!1),H={itemId:w,series:this,datum:I,datumIndex:w,angleValue:_,midAngle:F,midCos:Math.cos(F),midSin:Math.sin(F),startAngle:E,endAngle:P,radius:z,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(z),0),sectorFormat:O,radiusValue:U,legendItemValue:G,enabled:n&&o.getItemEnabled({seriesId:e,itemId:w}),...V};b.push(H),S?.push({...H,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0)})}),this.zerosumOuterRing.visible=C===0,{itemId:e,nodeData:b,labelData:b,phantomNodeData:S}}getLabels(e,t,i,s,o,n,r){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,d=!s||a.enabled?this.properties.calloutLabelKey:void 0,h=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!d&&!h&&!c)return{};const u={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return d&&i>=Ai(a.minAngle)&&(p.calloutLabel={...this.getTextAlignment(t),text:this.getLabelText(a,{...u,value:o}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),h&&(p.sectorLabel={text:this.getLabelText(l,{...u,value:n})}),c!=null&&r!=null&&(p.legendItem={key:c,text:r}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Af(e),s=-.75*Math.PI,o=i-s,n=Math.floor(o/(Math.PI/2)),r=oA(n,t.length);return t[r]}getSectorFormat(e,t,i){const{angleKey:s,radiusKey:o,calloutLabelKey:n,sectorLabelKey:r,legendItemKey:a,fills:l,strokes:c,itemStyler:d}=this.properties,h=c[t%c.length],{fill:u,fillOpacity:p,stroke:g,strokeWidth:f,strokeOpacity:y,lineDash:m,lineDashOffset:C,cornerRadius:b}=_e(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[t%l.length]:void 0,stroke:h,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties);let S;return d&&(S=this.cachedDatumCallback(this.getDatumId(e,t)+(i?"-highlight":"-hide"),()=>d({datum:e,angleKey:s,radiusKey:o,calloutLabelKey:n,sectorLabelKey:r,legendItemKey:a,fill:u,strokeOpacity:y,stroke:g,strokeWidth:f,fillOpacity:p,lineDash:m,lineDashOffset:C,cornerRadius:b,highlighted:i,seriesId:this.id}))),{fill:S?.fill??u,fillOpacity:S?.fillOpacity??p,stroke:S?.stroke??g,strokeWidth:S?.strokeWidth??f,strokeOpacity:S?.strokeOpacity??y,lineDash:S?.lineDash??m,lineDashOffset:S?.lineDashOffset??C,cornerRadius:S?.cornerRadius??b}}getOuterRadius(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(e){const t=[0,this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);if(e===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-e);return-e-i-s}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},s=sl(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const o=this.getTitleTranslationY();t.node.y=isFinite(o)?o:0;const n=t.node.getBBox();t.node.visible=t.enabled&&isFinite(o)&&!this.bboxIntersectsSurroundingSeries(n)}this.zerosumOuterRing.fillOpacity=0,this.zerosumOuterRing.stroke=this.properties.calloutLabel.color,this.zerosumOuterRing.strokeWidth=1,this.zerosumOuterRing.strokeOpacity=1,this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&this.labelGroup?.removeChild(e.node),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=t=>{const i=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,i),y:t.midSin*Math.max(0,i)}};this.nodeData.forEach(e),this.phantomNodeData?.forEach(e)}updateSelections(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:o,labelSelection:n}=this,r=this.nodeData.map(l=>({...l,sectorFormat:{...l.sectorFormat}})),a=(l,c)=>{l.update(c,void 0,d=>this.getDatumId(d.datum,d.datumIndex)),this.ctx.animationManager.isSkipped()&&l.cleanup()};a(e,this.nodeData),a(t,r),a(i,this.phantomNodeData??[]),o.update(this.calloutNodeData,l=>{const c=new $o;c.tag=0,c.pointerEvents=1,l.appendChild(c);const d=new Oi;d.tag=1,d.pointerEvents=1,l.appendChild(d)}),n.update(this.nodeData),s.update(r)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&t?.series===this,this.highlightLabel.visible=i&&t?.series===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity();const s=this.ctx.animationManager.isSkipped(),o=(n,r,a,l)=>{const c=this.getSectorFormat(r.datum,r.itemId,l);r.sectorFormat.fill=c.fill,r.sectorFormat.stroke=c.stroke,s&&(n.startAngle=r.startAngle,n.endAngle=r.endAngle,n.innerRadius=r.innerRadius,n.outerRadius=r.outerRadius),(l||s)&&(n.fill=c.fill,n.stroke=c.stroke),n.strokeWidth=c.strokeWidth,n.fillOpacity=c.fillOpacity,n.strokeOpacity=c.strokeOpacity,n.lineDash=c.lineDash,n.lineDashOffset=c.lineDashOffset,n.cornerRadius=c.cornerRadius,n.fillShadow=this.properties.shadow;const d=Math.max((this.properties.sectorSpacing+(c.stroke!=null?c.strokeWidth:0))/2,0);n.inset=d,n.lineJoin=this.properties.sectorSpacing>=0||d>0?"miter":"round"};this.itemSelection.each((n,r,a)=>o(n,r,a,!1)),this.highlightSelection.each((n,r,a)=>{o(n,r,a,!0),n.visible=r.itemId===t?.itemId}),this.phantomSelection.each((n,r,a)=>o(n,r,a,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:e}=this.properties,t=e.length,i=e.strokeWidth,s=e.colors??this.properties.strokes,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((n,r)=>{const a=n.datum,{calloutLabel:l,outerRadius:c}=a;if(l?.text&&!l.hidden&&c!==0){n.visible=!0,n.strokeWidth=i,n.stroke=s[r%s.length],n.fill=void 0;const d=a.midCos*c,h=a.midSin*c;let u=a.midCos*(c+t),p=a.midSin*(c+t);if((l.collisionTextAlign??l.collisionOffsetY!==0)&&l.box!=null){const f=l.box;let y=u,m=p;u<f.x?y=f.x:u>f.x+f.width&&(y=f.x+f.width),p<f.y?m=f.y:p>f.y+f.height&&(m=f.y+f.height);const C=y-u,b=m-p,S=Math.sqrt(Math.pow(C,2)+Math.pow(b,2)),A=S-o;A>0&&(u=u+C*A/S,p=p+b*A/S)}n.x1=d,n.y1=h,n.x2=u,n.y2=p}else n.visible=!1})}getLabelOverflow(e,t,i){const s=-this.centerX,o=s+i.width,n=-this.centerY,r=n+i.height,a=1;let l=1;t.x+a<s?l=(t.x+t.width-s)/t.width:t.x+t.width-a>o&&(l=(o-t.x)/t.width);const c=t.y+a<n||t.y+t.height-a>r,d=l===1?e.length:Math.floor(e.length*l)-1,h=this.bboxIntersectsSurroundingSeries(t);return{textLength:d,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:h}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(t==null)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=t**2;return i.some(o=>o.x**2+o.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:o}=t,n=e.convert(0),r=m=>!m.calloutLabel||m.outerRadius===0,a=this.calloutNodeData,l=a.filter(m=>!r(m));if(l.forEach(m=>{const C=m.calloutLabel;C!=null&&(C.hidden=!1,C.collisionTextAlign=void 0,C.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(m=>m.midCos<0).sort((m,C)=>m.midSin-C.midSin),d=l.filter(m=>m.midCos>=0).sort((m,C)=>m.midSin-C.midSin),h=l.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,C)=>m.midCos-C.midCos),u=l.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,C)=>m.midCos-C.midCos),p=m=>{const C=m.calloutLabel;if(C==null)return ve.zero.clone();const b=m.outerRadius+i.length+s,S=m.midCos*b,A=m.midSin*b+C.collisionOffsetY,R=C.collisionTextAlign??C.textAlign,I=C.textBaseline;return Oi.computeBBox(C.text,S,A,{font:this.properties.calloutLabel,textAlign:R,textBaseline:I})},g=(m,C,b)=>{const S=p(m).grow(o/2),A=p(C).grow(o/2);S.x<A.x+A.width&&S.x+S.width>A.x&&(b==="to-top"?S.y<A.y+A.height:S.y+S.height>A.y)&&(C.calloutLabel.collisionOffsetY=b==="to-top"?S.y-A.y-A.height:S.y+S.height-A.y)},f=m=>{const C=m.slice().sort((S,A)=>Math.abs(S.midSin)-Math.abs(A.midSin))[0],b=m.indexOf(C);for(let S=b-1;S>=0;S--){const A=m[S+1],R=m[S];g(A,R,"to-top")}for(let S=b+1;S<m.length;S++){const A=m[S-1],R=m[S];g(A,R,"to-bottom")}},y=m=>{const C=l.some(w=>w.calloutLabel.collisionOffsetY!==0),b=m.map(w=>p(w)),S=b.map(w=>w.clone().grow(o/2));let A=!1;for(let w=0;w<S.length&&!A;w++){const M=S[w];for(let T=w+1;T<m.length;T++){const E=S[T];if(M.collidesBBox(E)){A=!0;break}}}const R=a.map(w=>{const{startAngle:M,endAngle:T,outerRadius:E}=w;return{startAngle:M,endAngle:T,innerRadius:n,outerRadius:E}}),I=b.some(w=>R.some(M=>Az(w,M)));!A&&!C&&!I||m.filter(w=>w.calloutLabel.textAlign==="center").forEach(w=>{const M=w.calloutLabel;w.midCos<0?M.collisionTextAlign="right":w.midCos>0?M.collisionTextAlign="left":M.collisionTextAlign="center"})};f(c),f(d),y(h),y(u)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,o=s.length,{offset:n,color:r}=i,a=new Oi;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const{datum:c}=l,d=c.calloutLabel,h=t.convert(c.radius),u=Math.max(0,h);if(!d?.text||u===0||d.hidden){l.visible=!1;return}const p=u+o+n,g=c.midCos*p,f=c.midSin*p+d.collisionOffsetY,y={textAlign:d.collisionTextAlign??d.textAlign,textBaseline:d.textBaseline};a.text=d.text,a.x=g,a.y=f,a.setFont(this.properties.calloutLabel),a.setAlign(y);const m=a.getBBox();let C=d.text,b=!0;if(i.avoidCollisions){const{textLength:S,hasVerticalOverflow:A}=this.getLabelOverflow(d.text,m,e);C=d.text.length===S?d.text:`${d.text.substring(0,S)}…`,b=!A}l.text=C,l.x=g,l.y=f,l.setFont(this.properties.calloutLabel),l.setAlign(y),l.fill=r,l.visible=b})}computeLabelsBBox(e,t){const{calloutLabel:i,calloutLine:s}=this.properties,o=s.length,{offset:n,maxCollisionOffset:r,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Oi;let d;const{title:h}=this.properties;if(h?.text&&h.enabled){const u=this.getTitleTranslationY();isFinite(u)&&(c.text=h.text,c.x=0,c.y=u,c.setFont(h),c.setAlign({textBaseline:"bottom",textAlign:"center"}),d=c.getBBox(),l.push(d))}return this.calloutNodeData.forEach(u=>{const p=u.calloutLabel;if(!p||u.outerRadius===0)return null;const g=u.outerRadius+o+n,f=u.midCos*g,y=u.midSin*g+p.collisionOffsetY;c.text=p.text,c.x=f,c.y=y,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const m=c.getBBox();if(p.box=m,Math.abs(p.collisionOffsetY)>r){p.hidden=!0;return}if(d){const C=-this.centerY,b=new ve(d.x-a,C,d.width+2*a,d.y+d.height+a-C);if(m.collidesBBox(b)){p.hidden=!0;return}}if(e.hideWhenNecessary){const{textLength:C,hasVerticalOverflow:b,hasSurroundingSeriesOverflow:S}=this.getLabelOverflow(p.text,m,t),A=p.text.length>2&&C<2;if(b||A||S){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:ve.merge(l)}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:s,fontWeight:o,fontFamily:n,positionOffset:r,positionRatio:a,color:l}=this.properties.sectorLabel,c=t>0,d=this.ctx.legendManager.getData(this.id)?.filter(u=>u.enabled).length===1,h=(u,p)=>{const{sectorLabel:g,outerRadius:f,startAngle:y,endAngle:m}=p;let C=!1;if(g&&f!==0){const b=t*(1-a)+f*a+r;u.fill=l,u.fontStyle=s,u.fontWeight=o,u.fontSize=i,u.fontFamily=n,u.text=g.text,!c&&d?(u.x=0,u.y=0):(u.x=p.midCos*b,u.y=p.midSin*b),u.textAlign="center",u.textBaseline="middle";const A=u.getBBox(),R=[[A.x,A.y],[A.x+A.width,A.y],[A.x+A.width,A.y+A.height],[A.x,A.y+A.height]],I={startAngle:y,endAngle:m,innerRadius:t,outerRadius:f};R.every(([w,M])=>ib(w,M,I))&&(C=!0)}u.visible=C};this.labelSelection.each(h),this.highlightLabelSelection.each(h)}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2}pickNodeClosestDatum(e){return UI(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{legendItemKey:n,calloutLabelKey:r,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:d,angleName:h,radiusKey:u,radiusName:p,tooltip:g}=o,f=this.properties.title.text;if(!i||!s)return;const{datumIndex:y}=e,m=s.dataSources.get(this.id)?.[y],{angleRawValues:C,legendItemValues:b,calloutLabelValues:S,sectorLabelValues:A}=this.getProcessedDataValues(i,s),R=C[y],I=b?.[y]??(r===d?void 0:S?.[y])??(l===d?void 0:A?.[y])??h;return g.formatTooltip({title:f,symbol:this.legendItemSymbol(y),data:[{label:I,fallbackLabel:d,value:il(R,3)}]},{seriesId:t,datum:m,title:h,legendItemKey:n,calloutLabelKey:r,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:d,angleName:h,radiusKey:u,radiusName:p,...this.getSectorFormat(m,y,!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.[e],i=this.getSectorFormat(t,e,!1);return{marker:{fill:i.fill,stroke:i.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}}}getLegendData(e){const{id:t,visible:i,processedData:s,dataModel:o,ctx:{legendManager:n}}=this;if(!o||!s||e!=="category")return[];const{angleKey:r,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:d}=this.properties;if(!c&&(!a||a===r)&&(!l||l===r))return[];const{calloutLabelValues:h,sectorLabelValues:u,legendItemValues:p,angleRawValues:g}=this.getProcessedDataValues(o,s),f=this.properties.title?.showInLegend&&this.properties.title.text,y=[],m=this.properties.hideZeroValueSectorsInLegend,C=s.dataSources.get(this.id),b=s.invalidData?.get(this.id);for(let S=0;S<s.input.count;S++){const A=C?.[S],R=g[S];if(b?.[S]===!0||m&&R===0)continue;const I=[];f&&I.push(f);const w=this.getLabels(A,2*Math.PI,2*Math.PI,!1,h?.[S],u?.[S],p?.[S]);c&&w.legendItem!==void 0?I.push(w.legendItem.text):a&&a!==r&&w.calloutLabel?.text!==void 0?I.push(w.calloutLabel?.text):l&&l!==r&&w.sectorLabel?.text!==void 0&&I.push(w.sectorLabel?.text),I.length!==0&&y.push({legendType:"category",id:t,datum:A,itemId:S,seriesId:t,enabled:i&&n.getItemEnabled({seriesId:t,itemId:S}),label:{text:I.join(" - ")},symbol:this.legendItemSymbol(S),legendItemName:c!=null?A[c]:void 0,hideInLegend:!d})}return y}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:s}}=this;e.forEach((o,n)=>i.toggleItem({enabled:o,seriesId:t,itemId:n})),i.update(),s.update(4)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=Yd(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Wt(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,o)=>this.getDatumId(o.datum,o.datumIndex)),it(this,"callout",t,this.calloutLabelSelection),it(this,"sector",t,this.labelSelection),it(this,"highlight",t,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,processedData:s,radiusScale:o,previousRadiusScale:n}=this,{animationManager:r}=this.ctx,a=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(a?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,d=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!d)&&this.ctx.animationManager.skipCurrentBatch();const h=Yd(!1,this.properties.rotation,o,n);Wt(this.id,"nodes",r,[e,t,i],h.nodes,(u,p)=>this.getDatumId(p.datum,p.datumIndex),a),it(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),it(this,"sector",this.ctx.animationManager,this.labelSelection),it(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,radiusScale:s,previousRadiusScale:o}=this,{animationManager:n}=this.ctx,r=Yd(!1,this.properties.rotation,s,o);Wt(this.id,"nodes",n,[e,t,i],r.nodes,(a,l)=>this.getDatumId(l.datum,l.datumIndex)),pc(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),pc(this,"sector",this.ctx.animationManager,this.labelSelection),pc(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e,t){const{calloutLabelKey:i,sectorLabelKey:s,legendItemKey:o}=this.properties;return this.processedData?.reduced?.animationValidation?.uniqueKeys?o?ci(e[o]):i?ci(e[i]):s?ci(e[s]):`${t}`:`${t}`}};YI.className="PieSeries";YI.type="pie";var B9={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:e=>new YI(e),tooltipDefaults:{range:"exact"},themeTemplate:N9,paletteFactory:kz};function G9(){Yr.register(j_,QZ,xZ,y9,bz,I9,xz,T9,O9,B9,R9);for(const e of[Gc,yp,vh,wp,Sh])Ka.register(e.type,{moduleFactory:t=>new e(t)})}function _9(){for(const e of Yr.modules){if(e.packageType==="enterprise"&&!gX(e)&&ue.errorOnce("Unexpected enterprise module registered: "+e.identifier),e.type==="root"&&e.themeTemplate)for(const t of e.chartTypes)U0.set(t,e.themeTemplate);if(e.type==="series"){if(e.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${e.identifier}`);ho.register(e.identifier,e)}if(e.type==="series-option"&&e.themeTemplate)for(const t of e.seriesTypes)ho.setThemeTemplate(t,e.themeTemplate);if(e.type==="axis-option"&&e.themeTemplate)for(const t of e.axisTypes){const i=Ka.getThemeTemplate(t),s=_e(e.themeTemplate,i);Ka.setThemeTemplate(t,s)}e.type==="axis"&&Ka.register(e.identifier,e),e.type==="legend"&&XA.register(e.identifier,e)}if(Yr.hasEnterpriseModules()){const e=fX();e.length>0&&ue.errorOnce("Enterprise modules expected but not registered: ",e)}}var ip=class extends PA{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}updatePosition(){super.updatePosition();const t=VC(this),i=LA(t);this.axisGroup.setProperties(this.getAxisTransform()),this.gridLineGroupSelection.each(i),this.tickLineGroupSelection.each(i),this.tickLabelGroupSelection.each(EA())}computeLabelsBBox(t,i){return null}computeRange(){}getAxisLinePoints(){}};D([k(Ct(["polygon","circle"],"a polar axis shape"))],ip.prototype,"shape",2);D([k(rt)],ip.prototype,"innerRadiusRatio",2);var XI=class extends mS{constructor(e,t){super(e,t),this.padding=new Fc(40),this.ctx.axisManager.axisGroup.zIndex=6}getChartType(){return"polar"}async performLayout(e){const{layoutBox:t}=e;t.shrink(this.seriesArea.padding.toJson());const i=t.clone();this.seriesRect=i,this.animationRect=i,this.seriesRoot.translationX=i.x,this.seriesRoot.translationY=i.y,await this.computeCircle(i),this.axes.forEach(s=>s.update()),this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:i,paddedRect:i}})}updateAxes(e,t,i,s){const o=this.axes.find(l=>l.direction==="x"),n=this.axes.find(l=>l.direction==="y");if(!(o instanceof ip)||!(n instanceof ip))return;const r=o.scale,a=n.innerRadiusRatio;o.innerRadiusRatio=a,o.computeRange(),o.gridLength=s,n.gridAngles=r.ticks({nice:o.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.map(l=>r.convert(l)),n.gridRange=o.range,n.range=[s,s*a],[o,n].forEach(l=>{l.translation.x=e.x+t,l.translation.y=e.y+i,l.calculateLayout()})}async computeCircle(e){const t=this.series.filter(z9),i=this.axes.filter(V9),s=(c,d,h)=>{this.updateAxes(e,c,d,h),t.forEach(p=>{p.centerX=c,p.centerY=d,p.radius=h});const u=t.filter(p=>p.type==="donut"||p.type==="pie");if(u.length>1){const p=u.map(g=>{const f=g.getInnerRadius();return{series:g,innerRadius:f}}).sort((g,f)=>g.innerRadius-f.innerRadius);p.at(-1).series.surroundingRadius=void 0;for(let g=0;g<p.length-1;g++)p[g].series.surroundingRadius=p[g+1].innerRadius}},o=e.width/2,n=e.height/2,r=Math.max(0,Math.min(e.width,e.height)/2);let a=r;s(o,n,a);const l=async({hideWhenNecessary:c=!1}={})=>{const d=[];for(const p of Gd(i,t)){const g=await p.computeLabelsBBox({hideWhenNecessary:c},e);g&&d.push(g)}if(d.length===0){s(o,n,r);return}const h=ve.merge(d),u=this.refineCircle(h,a,e);s(u.centerX,u.centerY,u.radius),a=u.radius};await l(),await l(),await l(),await l({hideWhenNecessary:!0}),await l({hideWhenNecessary:!0});for(const c of Gd(i,t))await c.computeLabelsBBox({hideWhenNecessary:!0},e);return{radius:a,centerX:o,centerY:n}}refineCircle(e,t,i){const o=-t,n=-t,r=t,a=t;let l=Math.max(0,o-e.x),c=Math.max(0,n-e.y),d=Math.max(0,e.x+e.width-r),h=Math.max(0,e.y+e.height-a);l=d=Math.max(l,d),c=h=Math.max(c,h);const u=i.width-l-d,p=i.height-c-h;let g=Math.min(u,p)/2;const f=.5*i.width/2,y=.5*i.height/2,m=Math.min(f,y);if(g<m){g=m;const S=l+d,A=c+h;if(2*g+A>i.height){const R=i.height-2*g;Math.min(c,h)*2>R?(c=R/2,h=R/2):c>h?c=R-h:h=R-c}if(2*g+S>i.width){const R=i.width-2*g;Math.min(l,d)*2>R?(l=R/2,d=R/2):l>d?l=R-d:d=R-l}}const C=l+2*g+d,b=c+2*g+h;return{centerX:(i.width-C)/2+l+g,centerY:(i.height-b)/2+c+g,radius:g}}};XI.className="PolarChart";XI.type="polar";function z9(e){return e instanceof FS}function V9(e){return e instanceof ip}var H9={type:"chart",name:"polar",detect:l_,create(e,t){return new XI(e,t)}},Ya={isEnterprise:!1},iD=["bar","line","scatter"],Lz=(e=>(e.POINTER="pointer",e.NODE="node",e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_LEFT="top-left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e))(Lz||{}),dn=Symbol("IGNORED_PROP");function zo(e,t){const i={};for(const[s,o]of Object.entries(t))o!==dn&&Object.hasOwn(e,s)&&(i[s]=o);return i}function Ez(e){if(e===void 0)return;const{enabled:t,showArrow:i,range:s,position:o,delay:n,wrapping:r}=e;return Object.fromEntries(Object.entries({enabled:t,showArrow:i,range:s,position:o,delay:n,wrapping:r}).filter(([l,c])=>c!==void 0))}function W9(e){return e.type==="radial-gauge"}function j9(e){return e.type==="linear-gauge"}function U9(e){const{animation:t,background:i,container:s,contextMenu:o,footnote:n,height:r,listeners:a,locale:l,minHeight:c,minWidth:d,overrideDevicePixelRatio:h,padding:u,subtitle:p,theme:g,title:f,width:y,type:m,cursor:C,nodeClickRange:b,tooltip:S,value:A,scale:R={},startAngle:I,endAngle:w,highlightStyle:M,segmentation:T,bar:E,needle:P,targets:N,outerRadius:F,innerRadius:_,outerRadiusRatio:W,innerRadiusRatio:z,cornerRadius:U,cornerMode:G,label:V,secondaryLabel:O,spacing:H,...B}=e,{fills:Y,fillMode:q,fill:Z,fillOpacity:ee,stroke:se,strokeWidth:j,strokeOpacity:X,lineDash:$,lineDashOffset:J,min:ie=0,max:ne=1,interval:K={},label:oe={}}=R,de=zo(e,{animation:t,background:i,container:s,contextMenu:o,footnote:n,height:r,listeners:a,locale:l,minHeight:c,minWidth:d,overrideDevicePixelRatio:h,padding:u,subtitle:p,theme:g,title:f,tooltip:Ez(S),width:y}),re=zo(R,{fills:Y,fillMode:q,fill:Z,fillOpacity:ee,stroke:se,strokeWidth:j,strokeOpacity:X,lineDash:$,lineDashOffset:J}),ce=zo(e,{startAngle:dn,endAngle:dn,needle:P!=null?{enabled:!0,...P}:dn,scale:re,type:m,cursor:C,nodeClickRange:b,listeners:a,tooltip:S,value:A,highlightStyle:M,segmentation:T,bar:E,targets:N,outerRadius:F,innerRadius:_,outerRadiusRatio:W,innerRadiusRatio:z,cornerRadius:U,cornerMode:G,label:V,secondaryLabel:O,spacing:H,...B});return{...de,series:[ce],axes:[{type:"angle-number",min:ie,max:ne,startAngle:I,endAngle:w,interval:K??{},label:oe??{}},{type:"radius-number"}]}}function K9(e){const{animation:t,background:i,container:s,contextMenu:o,footnote:n,height:r,listeners:a,locale:l,minHeight:c,minWidth:d,overrideDevicePixelRatio:h,padding:u,subtitle:p,theme:g,title:f,width:y,type:m,cursor:C,nodeClickRange:b,tooltip:S,value:A,scale:R={},direction:I="vertical",thickness:w,highlightStyle:M,segmentation:T,bar:E,targets:P,cornerRadius:N,cornerMode:F,label:_,...W}=e,{fills:z,fillMode:U,fill:G,fillOpacity:V,stroke:O,strokeWidth:H,strokeOpacity:B,lineDash:Y,lineDashOffset:q,min:Z=0,max:ee=1,interval:se={},label:j={}}=R,X=zo(e,{animation:t,background:i,container:s,contextMenu:o,footnote:n,height:r,listeners:a,locale:l,minHeight:c,minWidth:d,overrideDevicePixelRatio:h,padding:u,subtitle:p,theme:g,title:f,tooltip:Ez(S),width:y}),$=zo(R,{fills:z,fillMode:U,fill:G,fillOpacity:V,stroke:O,strokeWidth:H,strokeOpacity:B,lineDash:Y,lineDashOffset:q}),J=zo(e,{scale:$,type:m,cursor:C,nodeClickRange:b,listeners:a,tooltip:S,value:A,direction:I,thickness:w,highlightStyle:M,segmentation:T,bar:E,targets:P,cornerRadius:N,cornerMode:F,label:_,...W}),{placement:ie,...ne}=j;let K,oe;const de=I==="horizontal";de?(K=ie==="before"?"top":"bottom",oe="left"):(K=ie==="after"?"right":"left",oe="bottom");const re={type:"number",position:K,min:Z,max:ee,reverse:!de,interval:se,label:ne,nice:!1},ce={type:"number",position:oe,min:0,max:1,label:{enabled:!1}};return{...X,series:[J],axes:de?[re,ce]:[ce,re]}}function rP(e,t){if(t==null)return e;const{targets:i,...s}=t;return e=_e(e,s),e.targets!=null&&i!=null&&(e.targets=OC(e.targets,i)),e}function $9(e,t){if(W9(e)){const C=rP(e,t);return U9(C)}else if(j9(e)){const C=rP(e,t);return K9(C)}const{animation:i,background:s,container:o,contextMenu:n,footnote:r,height:a,listeners:l,locale:c,minHeight:d,minWidth:h,padding:u,subtitle:p,theme:g,title:f,tooltip:y,width:m}=e;return zo(e,{animation:i,background:s,container:o,contextMenu:n,footnote:r,height:a,listeners:l,locale:c,minHeight:d,minWidth:h,padding:u,subtitle:p,theme:g,title:f,tooltip:y,width:m})}var nn={stroke:jt},es={fill:Fm},aP={color:"white",fill:jt},Ea={color:jt},sb={color:Om,fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"}},Ky={...sb,textAlign:"left"},sD={...sb,fontSize:{$ref:"fontSize"},color:_m,fill:Bm,stroke:Gm,strokeWidth:1,divider:{stroke:zm,strokeWidth:1,strokeOpacity:.5}},Lw={...nn,background:{fill:Di,fillOpacity:.2},handle:{...es},text:{...Ea},statistics:{...sD}},Y9={line:{...nn,handle:{...es},text:{...Ea}},"horizontal-line":{...nn,handle:{...es},axisLabel:{...aP},text:{...Ea}},"vertical-line":{...nn,handle:{...es},axisLabel:{...aP},text:{...Ea}},"disjoint-channel":{...nn,background:{fill:Di,fillOpacity:.2},handle:{...es},text:{...Ea}},"parallel-channel":{...nn,background:{fill:Di,fillOpacity:.2},handle:{...es},text:{...Ea}},"fibonacci-retracement":{...nn,strokes:Pf,rangeStroke:jt,handle:{...es},text:{...Ea,position:"center"},label:{...sb,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...nn,strokes:Pf,rangeStroke:jt,handle:{...es},text:{...Ea,position:"center"},label:{...sb,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...nn,...Ky,color:{$ref:"textColor"},handle:{...es},fill:Di,fillOpacity:.2},comment:{...Ky,color:"white",fontWeight:700,handle:{...es},fill:jt},note:{...Ky,color:Wm,fill:jt,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...es},background:{fill:Vm,stroke:Hm,strokeWidth:1}},text:{...Ky,handle:{...es}},arrow:{...nn,handle:{...es},text:{...Ea}},"arrow-up":{fill:Pm,handle:{...es,stroke:jt}},"arrow-down":{fill:Nm,handle:{...es,stroke:jt}},"date-range":{...Lw},"price-range":{...Lw},"date-price-range":{...Lw},"quick-date-price-range":{up:{...nn,fill:Di,fillOpacity:.2,handle:{...es},statistics:{...sD,color:"#fff",fill:Di,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...nn,stroke:Of,fill:Nf,fillOpacity:.2,handle:{...es,stroke:Of},statistics:{...sD,color:"#fff",fill:Nf,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}}};function Ni(e,t){if(Ui(e))return t(e)}var X9=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],Z9=[{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"fibonacci-retracement-drawing",tooltip:"toolbarAnnotationsFibonacciAnnotations",value:"fibonacci-menu"},{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"measurer-drawing",tooltip:"toolbarAnnotationsMeasurerAnnotations",value:"measurer-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}];function q9(e,t,i){const{dateKey:s="date",highKey:o="high",openKey:n="open",lowKey:r="low",closeKey:a="close",volumeKey:l="volume",chartType:c="candlestick",navigator:d=!1,volume:h=!0,rangeButtons:u=!0,statusBar:p=!0,toolbar:g=!0,zoom:f=!0,theme:y,data:m,...C}=e,b=J9(y,c,s,o,r,n,a),S=Q9(y,i,n,a,h,l),R={navigator:{enabled:d,...h?{miniChart:{enabled:d,series:[{type:"line",xKey:s,yKey:l,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},I=typeof y=="string"?!0:y?.overrides?.common?.annotations?.axesButtons?.enabled??!0,w={annotations:{enabled:g,optionsToolbar:{enabled:g},snap:!0,axesButtons:{enabled:I},toolbar:{enabled:g,buttons:Z9,padding:0},data:m,xKey:s,volumeKey:h?l:void 0}},M=p?{statusBar:{enabled:!0,data:m,highKey:o,openKey:n,lowKey:r,closeKey:a,volumeKey:h?l:void 0}}:null,T={zoom:{enabled:f,autoScaling:{enabled:!0},enableIndependentAxes:!0}},E={ranges:{enabled:u}},P=h?[{type:"number",position:"left",keys:[l],label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percentage",align:"end"}}]:[];return{theme:{baseTheme:typeof y=="string"?y:"ag-financial",..._e(typeof y=="object"?y:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:5},chartToolbar:{enabled:g},annotations:{...Y9}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...S,...b],axes:[{type:"number",position:"right",keys:[n,a,o,r],interval:{maxSpacing:Ni(y,N=>N.overrides?.common?.axes?.number?.interval?.maxSpacing)??45},label:{format:Ni(y,N=>N.overrides?.common?.axes?.number?.label?.format)??".2f"},crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percentage",align:"start"}},...P,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:m,...w,...R,...M,...T,...E,...C}}function Q9(e,t,i,s,o,n){if(!o)return[];const r=Ni(e,l=>l.overrides?.bar?.series?.fill),a=r?{fill:r}:{itemStyler({datum:l}){const{up:c,down:d}=t().palette;return{fill:l[i]<l[s]?c?.fill:d?.fill}}};return[{type:"bar",xKey:"date",yKey:n,tooltip:{enabled:!1},highlight:{enabled:!1},fillOpacity:Ni(e,l=>l.overrides?.bar?.series?.fillOpacity)??.5,...a,focusPriority:1,fastDataProcessing:!0}]}var Ew="range-area";function J9(e,t,i,s,o,n,r){const a={xKey:i,openKey:n,closeKey:r,highKey:s,lowKey:o},l={xKey:i,yKey:r},c={pickOutsideVisibleMinorAxis:!0};switch(t??"candlestick"){case"ohlc":return e8(c,a);case"line":return t8(c,e,l);case"step-line":return i8(c,e,l);case"hlc":return s8(c,e,l,a);case"high-low":return o8(c,e,a);case"candlestick":return lP(c,a);case"hollow-candlestick":return n8(c,e,a);default:return ue.warnOnce(`unknown chart type: ${t}; expected one of: ${X9.join(", ")}`),lP(c,a)}}function e8(e,t){return[{type:"ohlc",focusPriority:0,...e,...t}]}function t8(e,t,i){return[{type:"line",focusPriority:0,...e,...i,stroke:Ni(t,s=>s.overrides?.line?.series?.stroke)??Ip,marker:Ni(t,s=>s.overrides?.line?.series?.marker)??{enabled:!1}}]}function i8(e,t,i){return[{type:"line",focusPriority:0,...e,...i,stroke:Ni(t,s=>s.overrides?.line?.series?.stroke)??Ip,interpolation:Ni(t,s=>s.overrides?.line?.series?.interpolation)??{type:"step"},marker:Ni(t,s=>s.overrides?.line?.series?.marker)??{enabled:!1}}]}function s8(e,t,i,{xKey:s,highKey:o,closeKey:n,lowKey:r}){const a=Pz(Ew,t);return[{type:Ew,focusPriority:0,...e,xKey:s,yHighKey:o,yLowKey:n,fill:a.fill??Pm,stroke:a.stroke??MS,fillOpacity:Ni(t,l=>l.overrides?.["range-area"]?.series?.fillOpacity)??.3,strokeWidth:Ni(t,l=>l.overrides?.["range-area"]?.series?.strokeWidth)??2},{type:Ew,focusPriority:0,...e,xKey:s,yHighKey:n,yLowKey:r,fill:a.fill??Nm,stroke:a.stroke??DS,fillOpacity:Ni(t,l=>l.overrides?.["range-area"]?.series?.fillOpacity)??.3,strokeWidth:Ni(t,l=>l.overrides?.["range-area"]?.series?.strokeWidth)??2},{type:"line",...e,...i,stroke:Ni(t,l=>l.overrides?.line?.series?.stroke)??IS,strokeWidth:Ni(t,l=>l.overrides?.line?.series?.strokeWidth)??2,marker:Ni(t,l=>l.overrides?.line?.series?.marker)??{enabled:!1}}]}function o8(e,t,{xKey:i,highKey:s,lowKey:o}){const n=Pz("range-bar",t);return[{type:"range-bar",...e,xKey:i,yHighKey:s,yLowKey:o,fill:n.fill??AS,stroke:n.stroke??Ip,tooltip:{range:"nearest"},focusPriority:0,fastDataProcessing:!0}]}function lP(e,t){return[{type:"candlestick",focusPriority:0,...e,...t}]}function n8(e,t,i){const s=Ni(t,o=>o.overrides?.candlestick?.series?.item);return[{type:"candlestick",focusPriority:0,...e,...i,item:{up:{fill:s?.up?.fill??"transparent"}}}]}function Pz(e,t){const i=Ni(t,o=>o.overrides?.[e]?.series?.fill),s=Ni(t,o=>o.overrides?.[e]?.series?.stroke);return{fill:i,stroke:s}}var Nz={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:TS,lineDash:[0],label:{enabled:!1}}},Pw={...Nz,nice:!1},Nw={position:{type:"sparkline"}},Ow={style:[{stroke:{$ref:"gridLineColor"}}],width:2},r8={number:{gridLine:Ow},time:{gridLine:Ow},category:{gridLine:Ow}},a8={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...Pw,interval:{values:[0]}},log:{...Pw},time:{...Pw},category:{...Nz}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...Nw,range:"nearest"},axes:r8},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3},tooltip:Nw}},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4,tooltip:Nw}}}},Oz=$s(l8);function l8(e,t){return typeof e=="string"?{...t,baseTheme:e}:e!=null?{...e,baseTheme:Oz(e.baseTheme,t)}:t}function Fz(e){if(Array.isArray(e)&&e.length!==0){const t=e[0];if(typeof t=="number")return{data:e.map((s,o)=>({x:o,y:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(t))return{data:e.map(s=>({x:s[0],y:s[1],datum:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}return{data:e}}function c8(e,t){switch(e?.type){case"number":{const{type:i,min:s,max:o,reverse:n}=e;return zo(e,{type:i,reverse:n,min:s,max:o})}case"time":{const{type:i,min:s,max:o,reverse:n}=e;return zo(e,{type:i,reverse:n,min:s,max:o})}case"category":{const{type:i,paddingInner:s,paddingOuter:o,reverse:n}=e;return zo(e,{type:i,reverse:n,paddingInner:s,paddingOuter:o})}}return{type:t}}function d8(e,t,i){const s={};return e?.stroke!=null&&(s.style=[{stroke:e?.stroke}],s.enabled??(s.enabled=!0)),e?.strokeWidth!=null&&(s.width=e?.strokeWidth,s.enabled??(s.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(s.enabled??(s.enabled=!0)),e?.visible!=null&&(s.enabled=e.visible),s.enabled??(s.enabled=t),s}var h8=$s((e,t,i)=>s=>{const o=s.datum[s.xKey],n=s.datum[s.yKey],r=i!=null?s.datum[i]:s.datum,a=t?.renderer?.({context:e,datum:r,xValue:o,yValue:n});if(typeof a=="string")return a;const l=a?.title,c=a?.content;return l!=null&&c!=null?{heading:l,title:void 0,data:[{label:void 0,value:c}]}:{heading:l??c??n.toFixed(2),title:void 0,data:[]}});function u8(e){const{background:t,container:i,height:s,listeners:o,locale:n,minHeight:r,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:d,theme:h,data:u,crosshair:p,axis:g,min:f,max:y,tooltip:m,context:C,...b}=e,S=zo(e,{background:t,container:i,height:s,listeners:o,locale:n,minHeight:r,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:d,tooltip:dn,context:dn,data:dn,crosshair:dn,axis:dn,min:dn,max:dn,theme:dn}),{data:A,series:[R]=[],datumKey:I}=Fz(u),w=b;R!=null&&Object.assign(w,R),w.tooltip={...m,renderer:h8(C,m,I)},S.theme=Oz(h,a8),S.data=A,S.series=[w];const M=w.type!=="bar"||w.direction!=="horizontal",[T,E]=M?["bottom","left"]:["left","bottom"],P={...c8(g,"category"),position:T,...zo(e,{crosshair:p})},N={type:"number",gridLine:d8(g,!1,e),position:E,...zo(e,{min:f,max:y})};return S.axes=M?[N,P]:[P,N],S}var p8={"price-volume":q9,gauge:$9,sparkline:u8},g8={sparkline:Fz};function cP(e,t){let i=[];const s=d_(e),o=vl(e),n=o?Lt.get(o):"unknown";for(const r of vp)if(!(n!=="unknown"&&!r.chartTypes.includes(n))){if(r.type==="root"||r.type==="legend"){const a=e[r.optionsKey];if(a==null)continue;r.optionsInnerKey?a[r.optionsInnerKey]&&(i.push(`${r.optionsKey}.${r.optionsInnerKey}`),delete a[r.optionsInnerKey]):(i.push(r.optionsKey),delete e[r.optionsKey])}else if(r.type==="axis"){if(!("axes"in e)||!e.axes?.some(a=>a.type===r.identifier))continue;i.push(`axis[type=${r.identifier}]`),e.axes=e.axes.filter(a=>a.type!==r.identifier)}else if(r.type==="axis-option"){if(!("axes"in e)||!e.axes?.some(a=>a[r.optionsKey]))continue;i.push(`axis.${r.optionsKey}`),e.axes.forEach(a=>{a[r.optionsKey]&&delete a[r.optionsKey]})}else if(r.type==="series"){if(r.community||!e.series?.some(a=>a.type===r.identifier))continue;i.push(`series[type=${r.identifier}]`),e.series=e.series.filter(a=>a.type!==r.identifier)}else if(r.type==="series-option"){if(!e.series?.some(a=>a[r.optionsKey]))continue;i.push(`series.${r.optionsKey}`),e.series.forEach(a=>{a[r.optionsKey]&&delete a[r.optionsKey]})}}if(i.length&&!t){s&&(i=["AgCharts.createGauge"]);let r="ag-charts-enterprise",a="https://www.ag-grid.com/charts/javascript/installation/";e.mode==="integrated"&&(r="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",a="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),ue.warnOnce([`unable to use these enterprise features as '${r}' has not been loaded:`,"",...i,"",`See: ${a}`].join(`
12
12
  `))}}function f8(e){const t="mode"in e&&e.mode==="integrated";for(const i of Yr.byType("root","legend")){const s=e[i.optionsKey],o=s!=null&&s.enabled===!1,n=!("removable"in i)||i.removable===!0||i.removable==="standalone-only"&&!t;o&&n&&delete e[i.optionsKey]}}function oD(e){return e?.up||e?.down||e?.neutral?"user-full":e?.fills||e?.strokes?"user-indexed":"inbuilt"}var $y="white",nD={get cartesian(){return{seriesTypes:Lt.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:Lt.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:Lt.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:Lt.topologyTypes,commonOptions:[]}},get"flow-proportion"(){return{seriesTypes:Lt.flowProportionTypes,commonOptions:[]}},get standalone(){return{seriesTypes:Lt.standaloneTypes,commonOptions:[]}},get gauge(){return{seriesTypes:Lt.gaugeTypes,commonOptions:[]}}},m8={"radial-gauge":!0,"linear-gauge":!0};function dP(e){return m8[e]===!0}var y8=Object.values(nD).reduce((e,{commonOptions:t})=>e.concat(t),[]),rn=class rD{static getAxisDefaults(t){return _e(t,{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,style:[{stroke:{$ref:"gridLineColor"},lineDash:[]}]},crossLines:{enabled:!1,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.1,strokeWidth:1,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"}}},crosshair:{enabled:!0}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"backgroundColor"}},padding:{top:{$ref:"padding"},right:{$ref:"padding"},bottom:{$ref:"padding"},left:{$ref:"padding"}},seriesArea:{padding:{top:0,right:0,bottom:0,left:0}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.4166666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:hc,textAlign:uc},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:hc,textAlign:uc},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:hc,textAlign:uc},legend:{position:"bottom",spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:{$ref:"foregroundColor"}},inactiveStyle:{fill:{$ref:"subtleTextColor"}},highlightStyle:{fill:{$ref:"foregroundColor"}},label:{color:{$ref:"textColor"}}}},tooltip:{enabled:!0,darkTheme:Ou,delay:0},overlays:{darkTheme:Ou},listeners:{}}}constructor(t={}){const{overrides:i,palette:s}=Mi(t),o=this.createChartConfigPerChartType(this.getDefaults()),n={};i&&this.mergeOverrides(o,n,i);const{fills:r,strokes:a,...l}=this.getDefaultColors();this.palette=ef(_e(s,{fills:Object.values(r),strokes:Object.values(a),...l})),this.paletteType=oD(s),this.config=ef(this.templateTheme(o)),this.presets=ef(n)}mergeOverrides(t,i,s){for(const{seriesTypes:o,commonOptions:n}of Object.values(nD)){const r={...s.common};for(const a of y8)n.includes(a)||delete r[a];if(r)for(const a of o){const l=a;dP(l)||(t[l]=_e(r,t[l]))}}Lt.seriesTypes.forEach(o=>{const n=o,r=s[n];dP(n)?i[n]=r:t[n]=_e(r,t[n])})}createChartConfigPerChartType(t){for(const[i,{seriesTypes:s}]of Object.entries(nD)){const o=U0.get(i);for(const n of s)t[n]??(t[n]=Mi(o))}return t}getDefaults(){const t=(i,s)=>{const o={},n={axes:{},...XA.getThemeTemplates(),...this.getChartDefaults(),...U0.get(i)};for(const r of s){o[r]=_e(ho.getThemeTemplate(r),o[r]??Mi(n));const{axes:a}=o[r];for(const l of Ka.keys())a[l]=_e(a[l],Ka.getThemeTemplate(l),rD.cartesianAxisDefault[l])}return o};return _e(t("cartesian",Lt.cartesianTypes),t("polar",Lt.polarTypes),t("hierarchy",Lt.hierarchyTypes),t("topology",Lt.topologyTypes),t("flow-proportion",Lt.flowProportionTypes),t("standalone",Lt.standaloneTypes),t("gauge",Lt.gaugeTypes))}static applyTemplateTheme(t,i,s){if(Mt(t))for(let o=0;o<t.length;o++){const n=t[o];typeof n=="symbol"&&s?.has(n)&&(t[o]=s.get(n))}else for(const[o,n]of Object.entries(t))typeof n=="symbol"&&s?.has(n)&&(t[o]=s.get(n))}templateTheme(t,i=!0){const s=i?Mi(t):t,o=this.getTemplateParameters();return ja(s,rD.applyTemplateTheme,void 0,void 0,o),s}getDefaultColors(){return{fills:ni,strokes:Fr,up:{fill:ni.GREEN,stroke:Fr.GREEN},down:{fill:ni.RED,stroke:Fr.RED},neutral:{fill:ni.GRAY,stroke:Fr.GRAY},altUp:{fill:ni.BLUE,stroke:Fr.BLUE},altDown:{fill:ni.ORANGE,stroke:Fr.ORANGE},altNeutral:{fill:ni.GRAY,stroke:Fr.GRAY}}}getPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:[.675]},backgroundColor:$y,borderColor:{$foregroundBackgroundMix:[.818]},foregroundColor:"#464646",fontFamily:"Verdana, sans-serif",fontSize:12,fontWeight:400,gridLineColor:{$foregroundBackgroundAccentMix:[.93,.085]},padding:20,subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:[.975]},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:"#181d1f",chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},inputBackgroundColor:{$ref:"backgroundColor"},inputTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"backgroundColor"}}}getTemplateParameters(){const{isEnterprise:t}=Ya,i=new Map;i.set(Ou,!1),i.set(mI,t),i.set(fI,!t),i.set(Em,"#d9d9d9"),i.set(wS,$y),i.set(Hc,"#00000080"),i.set(Ao,[ni.ORANGE,ni.YELLOW,ni.GREEN]),i.set(kS,[ni.BLUE,ni.RED]),i.set(TS,"#aaa"),i.set(Ln,[ni.GREEN,ni.YELLOW,ni.RED]),i.set(ca,["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"]),i.set(hc,"block"),i.set(uc,"center"),i.set(LS,["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"]),i.set(ES,["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"]),i.set(Pf,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),i.set(RS,$y),i.set(jt,ni.BLUE),i.set(Di,ni.BLUE),i.set(Om,ni.BLUE),i.set(Fm,$y),i.set(Bm,"#fafafa"),i.set(Gm,"#ddd"),i.set(_m,"#000"),i.set(zm,"#181d1f"),i.set(Nf,"#e35c5c"),i.set(Of,"#e35c5c"),i.set(Vm,"#fafafa"),i.set(Hm,"#ddd"),i.set(Wm,"#000"),i.set(jm,"top"),i.set(Vr,!1);const s=this.getDefaultColors();return i.set(MS,this.palette.up?.stroke??s.up.stroke),i.set(Pm,this.palette.up?.fill??s.up.fill),i.set(DS,this.palette.down?.stroke??s.down.stroke),i.set(Nm,this.palette.down?.fill??s.down.fill),i.set(Ip,this.palette.neutral?.stroke??s.neutral.stroke),i.set(AS,this.palette.neutral?.fill??s.neutral.fill),i.set(yI,this.palette.altUp?.stroke??s.up.stroke),i.set(CI,this.palette.altUp?.fill??s.up.fill),i.set(vI,this.palette.altDown?.stroke??s.down.stroke),i.set(bI,this.palette.altDown?.fill??s.down.fill),i.set(SI,this.palette.altNeutral?.fill??s.altNeutral.fill),i.set(IS,this.palette.altNeutral?.stroke??s.altNeutral.stroke),i}};rn.cartesianAxisDefault={number:rn.getAxisDefaults({line:{enabled:!1}}),log:rn.getAxisDefaults({base:10,line:{enabled:!1},interval:{minSpacing:NaN}}),category:rn.getAxisDefaults({groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:Vr},crosshair:{enabled:!1}}),"grouped-category":rn.getAxisDefaults({tick:{enabled:!0,stroke:Em},label:{spacing:10,rotation:270},paddingInner:.4,groupPaddingInner:.2,crosshair:{enabled:!1}}),time:rn.getAxisDefaults({gridLine:{enabled:Vr}}),"ordinal-time":rn.getAxisDefaults({groupPaddingInner:0,label:{autoRotate:!1},gridLine:{enabled:Vr}}),"angle-category":rn.getAxisDefaults({label:{spacing:5},gridLine:{enabled:Vr}}),"angle-number":rn.getAxisDefaults({label:{spacing:5},gridLine:{enabled:Vr}}),"radius-category":rn.getAxisDefaults({line:{enabled:!1}}),"radius-number":rn.getAxisDefaults({line:{enabled:!1}})};var Ml=rn,Yy="#192232",_s={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},ad={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},Lp=class extends Ml{getDefaultColors(){return{fills:_s,strokes:ad,up:{fill:_s.GREEN,stroke:ad.GREEN},down:{fill:_s.RED,stroke:ad.RED},neutral:{fill:_s.GRAY,stroke:ad.GRAY},altUp:{fill:_s.BLUE,stroke:ad.BLUE},altDown:{fill:_s.ORANGE,stroke:ad.ORANGE},altNeutral:{fill:_s.GRAY,stroke:ad.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:[.263]},backgroundColor:Yy,borderColor:{$foregroundBackgroundMix:[.784]},chromeBackgroundColor:{$foregroundBackgroundMix:[.93]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundAccentMix:[.743,.01]},subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.57]},chromeTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$foregroundBackgroundAccentMix:[.35,.1]}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ou,!0),e.set(RS,Yy),e.set(Em,"#7f8389"),e.set(Ao,[_s.ORANGE,_s.YELLOW,_s.GREEN]),e.set(Ln,[_s.GREEN,_s.YELLOW,_s.RED]),e.set(ca,["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"]),e.set(LS,["#192834","#253746","#324859","#3f596c","#4d6a80"]),e.set(ES,["#192834","#3b5164","#496275","#577287","#668399"]),e.set(wS,Yy),e.set(jt,_s.BLUE),e.set(Om,"#fff"),e.set(Di,_s.BLUE),e.set(Fm,Yy),e.set(Bm,"#28313e"),e.set(Gm,"#4b525d"),e.set(_m,"#fff"),e.set(zm,"#fff"),e.set(Vm,"#28313e"),e.set(Hm,"#4b525d"),e.set(Wm,"#fff"),e}constructor(e){super(e)}},en={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},ld={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},v8=class extends Lp{getDefaultColors(){return{fills:{...en},strokes:{...ld},up:{fill:en.GREEN,stroke:ld.GREEN},down:{fill:en.RED,stroke:ld.RED},neutral:{fill:en.BLUE,stroke:ld.BLUE},altUp:{fill:en.GREEN,stroke:ld.GREEN},altDown:{fill:en.RED,stroke:ld.RED},altNeutral:{fill:en.GRAY,stroke:ld.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.88,.01]},padding:0}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ao,[en.GREEN,en.BLUE,en.RED]),e.set(jt,en.BLUE),e.set(Di,en.BLUE),e.set(hc,"overlay"),e.set(uc,"left"),e.set(jm,"bottom"),e.set(Vr,!0),e}},tn={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},cd={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},C8=class extends Ml{getDefaultColors(){return{fills:{...tn},strokes:{...cd},up:{fill:tn.GREEN,stroke:cd.GREEN},down:{fill:tn.RED,stroke:cd.RED},neutral:{fill:tn.BLUE,stroke:cd.BLUE},altUp:{fill:tn.GREEN,stroke:cd.GREEN},altDown:{fill:tn.RED,stroke:cd.RED},altNeutral:{fill:tn.GRAY,stroke:cd.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.94,.01]},padding:0}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ao,[tn.GREEN,tn.BLUE,tn.RED]),e.set(jt,tn.BLUE),e.set(Di,tn.BLUE),e.set(hc,"overlay"),e.set(uc,"left"),e.set(jm,"bottom"),e.set(Vr,!0),e}},zs={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},dd={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},b8=class extends Lp{getDefaultColors(){return{fills:zs,strokes:dd,up:{fill:zs.GREEN,stroke:dd.GREEN},down:{fill:zs.RED,stroke:dd.RED},neutral:{fill:zs.GRAY,stroke:dd.GRAY},altUp:{fill:zs.BLUE,stroke:dd.BLUE},altDown:{fill:zs.RED,stroke:dd.RED},altNeutral:{fill:zs.GRAY,stroke:dd.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ao,[zs.ORANGE,zs.YELLOW,zs.GREEN]),e.set(ca,["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"]),e.set(Ln,[zs.GREEN,zs.YELLOW,zs.RED]),e.set(jt,zs.BLUE),e.set(Di,zs.BLUE),e}},Vs={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},hd={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},S8=class extends Ml{getDefaultColors(){return{fills:Vs,strokes:hd,up:{fill:Vs.GREEN,stroke:hd.GREEN},down:{fill:Vs.RED,stroke:hd.RED},neutral:{fill:Vs.GRAY,stroke:hd.GRAY},altUp:{fill:Vs.BLUE,stroke:hd.BLUE},altDown:{fill:Vs.RED,stroke:hd.RED},altNeutral:{fill:Vs.GRAY,stroke:hd.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ao,[Vs.ORANGE,Vs.YELLOW,Vs.GREEN]),e.set(ca,["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"]),e.set(Ln,[Vs.GREEN,Vs.YELLOW,Vs.RED]),e.set(jt,Vs.BLUE),e.set(Di,Vs.BLUE),e}},si={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},ud={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},x8=class extends Lp{getDefaultColors(){return{fills:si,strokes:ud,up:{fill:si.GREEN,stroke:ud.GREEN},down:{fill:si.RED,stroke:ud.RED},neutral:{fill:si.GRAY,stroke:ud.GRAY},altUp:{fill:si.BLUE,stroke:ud.BLUE},altDown:{fill:si.RED,stroke:ud.RED},altNeutral:{fill:si.GRAY,stroke:ud.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ao,[si.BLUE,si.RED]),e.set(ca,[si.BLUE,si.PURPLE,si.MAGENTA,si.PINK,si.RED,si.ORANGE,si.YELLOW,si.GREEN]),e.set(Ln,[si.BLUE,si.RED]),e.set(jt,si.BLUE),e.set(Di,si.BLUE),e}},oi={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},pd={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},w8=class extends Ml{getDefaultColors(){return{fills:oi,strokes:pd,up:{fill:oi.GREEN,stroke:pd.GREEN},down:{fill:oi.RED,stroke:pd.RED},neutral:{fill:oi.GRAY,stroke:pd.GRAY},altUp:{fill:oi.BLUE,stroke:pd.BLUE},altDown:{fill:oi.RED,stroke:pd.RED},altNeutral:{fill:oi.GRAY,stroke:pd.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ao,[oi.BLUE,oi.RED]),e.set(ca,[oi.BLUE,oi.PURPLE,oi.MAGENTA,oi.PINK,oi.RED,oi.ORANGE,oi.YELLOW,oi.GREEN]),e.set(Ln,[oi.BLUE,oi.RED]),e.set(jt,oi.BLUE),e.set(Di,oi.BLUE),e}},gs={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},Vl={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},M8=class extends Lp{getDefaultColors(){return{fills:{...gs,RED:gs.ORANGE},strokes:{...Vl,RED:Vl.ORANGE},up:{fill:gs.GREEN,stroke:Vl.GREEN},down:{fill:gs.ORANGE,stroke:Vl.ORANGE},neutral:{fill:gs.GRAY,stroke:Vl.GRAY},altUp:{fill:gs.BLUE,stroke:Vl.BLUE},altDown:{fill:gs.ORANGE,stroke:Vl.ORANGE},altNeutral:{fill:gs.GRAY,stroke:Vl.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ao,[gs.ORANGE,gs.YELLOW,gs.GREEN]),e.set(Ln,[gs.GREEN,gs.YELLOW,gs.ORANGE]),e.set(jt,gs.BLUE),e.set(Di,gs.BLUE),e}},Hs={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},Aa={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},D8=class extends Ml{getDefaultColors(){return{fills:{...Hs,RED:Hs.ORANGE},strokes:{...Aa,RED:Aa.ORANGE},up:{fill:Hs.GREEN,stroke:Aa.GREEN},down:{fill:Hs.ORANGE,stroke:Aa.ORANGE},neutral:{fill:Aa.GRAY,stroke:Aa.GRAY},altUp:{fill:Hs.BLUE,stroke:Aa.BLUE},altDown:{fill:Hs.ORANGE,stroke:Aa.ORANGE},altNeutral:{fill:Hs.GRAY,stroke:Aa.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ao,[Hs.ORANGE,Hs.YELLOW,Hs.GREEN]),e.set(Ln,[Hs.GREEN,Hs.YELLOW,Hs.ORANGE]),e.set(jt,Hs.BLUE),e.set(Di,Hs.BLUE),e}},Ws={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},gd={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},A8=class extends Lp{getDefaultColors(){return{fills:Ws,strokes:gd,up:{fill:Ws.GREEN,stroke:gd.GREEN},down:{fill:Ws.RED,stroke:gd.RED},neutral:{fill:Ws.GRAY,stroke:gd.GRAY},altUp:{fill:Ws.BLUE,stroke:gd.BLUE},altDown:{fill:Ws.ORANGE,stroke:gd.ORANGE},altNeutral:{fill:Ws.GRAY,stroke:gd.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ao,[Ws.ORANGE,Ws.YELLOW,Ws.GREEN]),e.set(ca,["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"]),e.set(Ln,[Ws.GREEN,Ws.YELLOW,Ws.RED]),e.set(jt,Ws.BLUE),e.set(Di,Ws.BLUE),e}},js={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},fd={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},I8=class extends Ml{getDefaultColors(){return{fills:js,strokes:fd,up:{fill:js.GREEN,stroke:fd.GREEN},down:{fill:js.RED,stroke:fd.RED},neutral:{fill:js.GRAY,stroke:fd.GRAY},altUp:{fill:js.BLUE,stroke:fd.BLUE},altDown:{fill:js.ORANGE,stroke:fd.ORANGE},altNeutral:{fill:js.GRAY,stroke:fd.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ao,[js.ORANGE,js.YELLOW,js.GREEN]),e.set(ca,["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"]),e.set(Ln,[js.GREEN,js.YELLOW,js.RED]),e.set(jt,js.BLUE),e.set(Di,js.BLUE),e}},Bu=$s(()=>new Ml),R8=$s(()=>new Lp),ZI={"ag-default-dark":R8,"ag-sheets-dark":$s(()=>new M8),"ag-polychroma-dark":$s(()=>new x8),"ag-vivid-dark":$s(()=>new A8),"ag-material-dark":$s(()=>new b8),"ag-financial-dark":$s(()=>new v8),null:Bu,undefined:Bu,"ag-default":Bu,"ag-sheets":$s(()=>new D8),"ag-polychroma":$s(()=>new w8),"ag-vivid":$s(()=>new I8),"ag-material":$s(()=>new S8),"ag-financial":$s(()=>new C8)},ob=$s(k8);function k8(e){if(e instanceof Ml)return e;if(e==null||typeof e=="string"){const i=ZI[e];return i?i():(ue.warnOnce(`the theme [${e}] is invalid, using [ag-default] instead.`),Bu())}const{errors:t}=_b(e,L8,"theme");if(!t.length){const i=T8(e),s=i.baseTheme?ob(i.baseTheme):Bu();return new s.constructor(i)}for(const{message:i}of t)ue.warnOnce(i);return Bu()}function T8(e){let t=e,i,s;const o=[];for(;typeof t=="object";)i??(i=t.palette),s??(s=t.params),t.overrides&&o.push(t.overrides),t=t.baseTheme;return{baseTheme:t,overrides:_e(...o),params:s,palette:i}}var L8={baseTheme:_d(No,dw),overrides:dw,params:dw,palette:{fills:I0(No),strokes:I0(No),up:{fill:No,stroke:No},down:{fill:No,stroke:No},neutral:{fill:No,stroke:No}}},E8=new Set(["map-shape-background","map-line-background"]),qI=class Nr{constructor(t,i,s,o,n,r=!1){this.themeParameters={},this.debug=yt.create(!0,"opts"),this.optionMetadata=o??{},this.processedOverrides=i??{};let a=null;if(t instanceof Nr){if(a=t,this.specialOverrides=a.specialOverrides,!n)throw new Error("AG Charts - internal error: deltaOptions must be supplied.");this.userOptions=_e(n,Mi(a.userOptions,Nr.OPTIONS_CLONE_OPTS))}else this.userOptions=t,this.specialOverrides=this.specialOverridesDefaults({...s});r&&this.removeLeftoverSymbols(this.userOptions);let l,c,d,h,u;!r&&n!=null&&Nr.isFastPathDelta(n)&&a!=null?{activeTheme:l,processedOptions:c,defaultAxes:d,fastDelta:h}=this.fastSetup(n,a):{activeTheme:l,processedOptions:c,defaultAxes:d,themeParameters:u}=this.slowSetup(i,n,r),this.activeTheme=l,this.processedOptions=c,this.defaultAxes=d,this.fastDelta=h,this.themeParameters=u??{}}static isFastPathDelta(t){for(const i of Object.keys(t))if(!this.FAST_PATH_OPTIONS.has(i))return!1;return!0}fastSetup(t,i){const{activeTheme:s,defaultAxes:o,processedOptions:n}=i,{presetType:r}=this.optionMetadata,a=r?g8[r]:void 0;r!=null&&t.data!=null&&a!=null&&(t=_e(a(t.data),t)),this.fastSeriesSetup(t,n);const l=_e(t,n);return{activeTheme:s,defaultAxes:o,processedOptions:l,fastDelta:t}}fastSeriesSetup(t,i){t.series&&(t.series?.every((s,o)=>S2(s,i.series?.[o]??{}))?delete t.series:t.series=t.series.map((s,o)=>_e(s,i.series?.[o]??{})))}slowSetup(t,i,s=!1){let o=Mi(this.userOptions,Nr.OPTIONS_CLONE_OPTS);i&&(o=_e(i,o),s&&this.removeLeftoverSymbols(o));const{presetType:n}=this.optionMetadata;if(n!=null){const m=p8[n],C=this.userOptions,b=this.userOptions.type,S=b!=null?ob(this.userOptions.theme).presets[b]:void 0;this.debug(">>> AgCharts.createOrUpdate() - applying preset",C),o=m?.(C,S,()=>this.activeTheme)??o}Ya.isEnterprise||cP(o);const r=ob(o.theme);this.sanityCheck(o),this.removeDisabledOptions(o);const a=this.optionsType(o),{axes:l={},annotations:c={},series:d,...h}=this.getSeriesThemeConfig(a,r),[u,p]=this.splitAnnotationsOptions(c);this.annotationThemes=Mi(p);const g=this.getDefaultAxes(o,d);let f=_e(t,o,u,h,g);this.processAxesOptions(f,l),this.processSeriesOptions(f,r),this.processMiniChartSeriesOptions(f,r),f=Mi(f,Nr.OPTIONS_CLONE_OPTS);const y=this.getThemeParameters(r,f);return this.resolveThemeOperations(y,y),this.resolveThemeOperations(y,f),this.resolveThemeOperations(y,this.annotationThemes),(QA(f)||c_(f)||IX(f))&&f.legend?.enabled==null&&(f.legend??(f.legend={}),f.legend.enabled=f.series.length>1),this.enableConfiguredOptions(f,this.userOptions),r.templateTheme(f,!1),this.removeDisabledOptions(o),f8(f),Ya.isEnterprise||cP(f,!0),this.debug("AgCharts.createOrUpdate() - processed options",f),{activeTheme:r,processedOptions:f,defaultAxes:g,themeParameters:y}}diffOptions(t){return this===t?{}:t==null?this.processedOptions:this.fastDelta??sl(t.processedOptions,this.processedOptions)}getSeriesThemeConfig(t,i){return i?.config[t]??{}}getDefaultAxes(t,i){const s=this.optionsType(t);let o=t.series?.find(n=>(n.type??"line")===s)??{};return ho.isDerivedDefaultAxes(s)&&(o=_e(o,i)),ho.cloneDefaultAxes(s,o)}optionsType(t){return t.series?.[0]?.type??"line"}sanityCheck(t){this.axesTypeIntegrity(t),this.seriesTypeIntegrity(t),this.soloSeriesIntegrity(t)}splitAnnotationsOptions(t){const{axesButtons:i=null,enabled:s=null,optionsToolbar:o=null,toolbar:n=null,...r}=t;return i==null&&s==null&&o==null&&n==null?[{},r]:[{annotations:{axesButtons:i,enabled:s,optionsToolbar:o,toolbar:n}},r]}processAxesOptions(t,i){"axes"in t&&(t.axes=t.axes?.map(s=>{const{crossLines:o,...n}=_e(i[s.type]?.[s.position],i[s.type]);s.crossLines&&(s.crossLines=OC(s.crossLines,o));const r=n.gridLine?.style;s.gridLine?.style&&r?.length&&(s.gridLine.style=s.gridLine.style.map((u,p)=>u.stroke!=null||u.lineDash!=null?_e(u,r.at(p%r.length)):u));const{top:a,right:l,bottom:c,left:d,...h}=_e(s,n);return h}))}processSeriesOptions(t,i){const s=this.getTooltipPositionDefaults(t),o=Ui(t.theme)?oD(t.theme?.palette):"inbuilt",n={colourIndex:0,userPalette:o},r=t.series?.map(a=>{a.type??(a.type=this.getDefaultSeriesType(t));const{innerLabels:l,...c}=this.getSeriesThemeConfig(a.type,i).series??{},d=E8.has(a.type)?{colourIndex:0,userPalette:o}:n,h=this.getSeriesPalette(a.type,d,i),u=this.getTooltipRangeDefaults(t,a.type),p=_e(this.getSeriesGroupingOptions(a),a,s,u,c,h,{visible:!0});return p.innerLabels&&(p.innerLabels=OC(p.innerLabels,l)),p});t.series=this.setSeriesGroupingOptions(r??[])}processMiniChartSeriesOptions(t,i){let s=t.navigator?.miniChart?.series;if(s==null)return;const o={colourIndex:0,userPalette:Ui(t.theme)?oD(t.theme.palette):"inbuilt"};s=s.map(n=>{n.type??(n.type="line");const{innerLabels:r,...a}=this.getSeriesThemeConfig(n.type,i).series??{};return _e(this.getSeriesGroupingOptions(n),n,a,this.getSeriesPalette(n.type,o,i))}),t.navigator.miniChart.series=this.setSeriesGroupingOptions(s)}getThemeParameters(t,i){const s=t.getPublicParameters();if(!Is(i.theme)||!i.theme.params)return s;const o=Rs(l=>vo(l)&&Vt.validColorString(l),"a color"),n={accentColor:o,axisColor:o,backgroundColor:o,borderColor:o,foregroundColor:o,fontFamily:No,fontSize:Va,fontWeight:_d(No,Va),gridLineColor:o,padding:Va,subtleTextColor:o,textColor:o,chromeBackgroundColor:o,chromeFontFamily:No,chromeFontSize:Va,chromeFontWeight:_d(No,Va),chromeSubtleTextColor:o,chromeTextColor:o,inputBackgroundColor:o,inputTextColor:o,crosshairLabelBackgroundColor:o,crosshairLabelTextColor:o},{valid:r,errors:a}=_b(i.theme.params,n);for(const{message:l}of a)ue.warnOnce(l);return _e(r,s)}resolveThemeOperations(t,i){const s=x2(i,t,new Set(["palette","data"]));this.debug("resolveTheme()",s)}getSeriesPalette(t,i,s){const o=ho.getPaletteFactory(t),{colourIndex:n,userPalette:r}=i,{fills:a=[],strokes:l=[]}=s.palette;return o?.({userPalette:r,colorsCount:Math.max(a.length,l.length),themeTemplateParameters:s.getTemplateParameters(),palette:s.palette,takeColors(c){return i.colourIndex+=c,{fills:BL(a,c,n),strokes:BL(l,c,n)}}})}getSeriesGroupingOptions(t){const i=ho.isGroupable(t.type),s=ho.isStackable(t.type),o=ho.isStackedByDefault(t.type);t.grouped&&!i&&ue.warnOnce(`unsupported grouping of series type "${t.type}".`),(t.stacked||t.stackGroup)&&!s&&ue.warnOnce(`unsupported stacking of series type "${t.type}".`);let{grouped:n,stacked:r}=t;return r??(r=(o||t.stackGroup!=null)&&!(i&&n)),n??(n=!0),{stacked:s&&r,grouped:i&&n&&!(s&&r)}}setSeriesGroupingOptions(t){const i=this.getSeriesGrouping(t);this.debug("setSeriesGroupingOptions() - series grouping: ",i);const s={},o=i.reduce((n,r)=>{var a;return r.groupType==="default"||(n[a=r.seriesType]??(n[a]=0),n[r.seriesType]+=r.groupType==="stack"?1:r.series.length),n},{});return i.flatMap(n=>{var r;switch(s[r=n.seriesType]??(s[r]=0),n.groupType){case"stack":{const a=s[n.seriesType]++;return n.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:n.groupId,groupIndex:a,groupCount:o[n.seriesType],stackIndex:c,stackCount:n.series.length}}))}case"group":return n.series.map(a=>Object.assign(a,{seriesGrouping:{groupId:n.groupId,groupIndex:s[n.seriesType]++,groupCount:o[n.seriesType],stackIndex:0,stackCount:0}}))}return n.series}).map(({stacked:n,grouped:r,...a})=>a)}getSeriesGroupId(t){return[t.type,t.xKey,t.stacked?t.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(t){const i=new Map;return t.reduce((s,o)=>{const n=o.type;if(!o.stacked&&!o.grouped)s.push({groupType:"default",seriesType:n,series:[o],groupId:"__default__"});else{const r=this.getSeriesGroupId(o);if(!i.has(r)){const l={groupType:o.stacked?"stack":"group",seriesType:n,series:[],groupId:r};i.set(r,l),s.push(l)}i.get(r).series.push(o)}return s},[])}getDefaultSeriesType(t){switch(Ud.detectChartDefinition(t).name){case"cartesian":return"line";case"polar":return"pie";case"hierarchy":return"treemap";case"topology":return"map-shape";case"flow-proportion":return"sankey";case"standalone":return"pyramid";case"gauge":return"radial-gauge";default:throw new Error("Invalid chart options type detected.")}}getTooltipPositionDefaults(t){const i=t.tooltip?.position;if(!Is(i))return;const{type:s,xOffset:o,yOffset:n}=i,r={};return vo(s)&&FK(Lz,s)&&(r.type=s),Qe(o)&&(r.xOffset=o),Qe(n)&&(r.yOffset=n),{tooltip:{position:r}}}getTooltipRangeDefaults(t,i){return{tooltip:{range:t.tooltip?.range??ho.getTooltipDefauls(i)?.range}}}axesTypeIntegrity(t){if("axes"in t&&t.axes){const i=t.axes;for(const{type:s}of i)if(!kX(s)){delete t.axes;const o=[...Ka.keys()].join(", ");ue.warnOnce(`unknown axis type: ${s}; expected one of: ${o}`)}}}seriesTypeIntegrity(t){t.series=t.series?.filter(({type:i})=>{if(i==null||RX(i)||nX(i))return!0;ue.warnOnce(`unknown series type: ${JSON.stringify(i)}; expected one of: ${r_.seriesTypes.join(", ")}`)})}soloSeriesIntegrity(t){const i=t.series;if(i&&i.length>1&&i.some(s=>ho.isSolo(s.type))){const s=this.optionsType(t);if(ho.isSolo(s))ue.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),t.series=i.slice(0,1);else{const{solo:o,nonSolo:n}=sA(i,a=>ho.isSolo(a.type)?"solo":"nonSolo"),r=IK(o.map(a=>a.type)).join(", ");ue.warn(`Unable to mix these series types with the lead series type: ${r}`),t.series=n}}}static enableConfiguredJsonOptions(t,i){typeof i=="object"&&"enabled"in i&&!i._enabledFromTheme&&t.enabled==null&&(i.enabled=!0)}static cleanupEnabledFromThemeJsonOptions(t){t._enabledFromTheme!=null&&delete t._enabledFromTheme}enableConfiguredOptions(t,i){ja(i,Nr.enableConfiguredJsonOptions,new Set(["data","theme"]),t),ja(t,Nr.cleanupEnabledFromThemeJsonOptions,new Set(["data","theme"]))}static removeDisabledOptionJson(t){"enabled"in t&&t.enabled===!1&&Object.keys(t).forEach(i=>{i!=="enabled"&&delete t[i]})}removeDisabledOptions(t){ja(t,Nr.removeDisabledOptionJson,new Set(["data","theme"]))}static removeLeftoverSymbolsJson(t){if(!(!t||!Ui(t)))for(const[i,s]of Object.entries(t))BK(s)&&delete t[i]}removeLeftoverSymbols(t){ja(t,Nr.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(t){if(t.window!=null?YB(t.window):typeof window<"u"?t.window=window:typeof global<"u"&&(t.window=global.window),t.document!=null?$B(t.document):typeof document<"u"?t.document=document:typeof global<"u"&&(t.document=global.document),t.window==null)throw new Error("AG Charts - unable to resolve global window");if(t.document==null)throw new Error("AG Charts - unable to resolve global document");return t}};qI.OPTIONS_CLONE_OPTS=new Set(["data","container"]);qI.FAST_PATH_OPTIONS=new Set(["data","width","height"]);var Bz=qI,P8=100,QI=class Td{constructor(t,i,s,o,n,r=P8){this.name=t,this.buildItem=i,this.releaseItem=s,this.destroyItem=o,this.maxPoolSize=n,this.cleanupTimeMs=r,this.freePool=[],this.busyPool=new Set}static getPool(t,i,s,o,n){return this.pools.has(t)||this.pools.set(t,new Td(t,i,s,o,n)),this.pools.get(t)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}obtain(t){if(this.freePool.length===0&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(t),Td.debug(`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i)):Td.debug(`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}release(t){if(!this.busyPool.has(t))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");Td.debug(`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t),this.releaseItem(t),this.busyPool.delete(t),this.freePool.push(t),Td.debug(`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t),this.cleanPoolTimer&&clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=setTimeout(()=>{this.cleanPool()},this.cleanupTimeMs)}cleanPool(){const t=this.freePool.splice(0);for(const i of t)this.destroyItem(i);Td.debug(`Pool[name=${this.name}]: Cleaned pool of ${t.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`)}destroy(){this.cleanPool();for(const t of this.busyPool.values())this.destroyItem(t);this.busyPool.clear()}};QI.pools=new Map;QI.debug=yt.create(!0,"pool");var N8=QI;Ud.registerMany([SZ,H9]);var Ha=yt.create(!0,"opts"),bn=class{static licenseCheck(t){this.licenseChecked||(this.licenseManager=Ya.licenseManager?.(t),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(t){return Ya.licenseManager?.({}).getLicenseDetails(t)}static getInstance(t){return hP.getInstance(t)}static create(t,i){return Ha.group("AgCharts.create()",()=>{this.licenseCheck(t);const s=hP.createOrUpdate({userOptions:t,licenseManager:this.licenseManager,optionsMetadata:i});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&Ya.injectWatermark?.(s.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),s})}static createFinancialChart(t){return Ha.group("AgCharts.createFinancialChart()",()=>this.create(t,{presetType:"price-volume"}))}static createGauge(t){return Ha.group("AgCharts.createGauge()",()=>this.create(t,{presetType:"gauge"}))}static __createSparkline(t){return Ha.group("AgCharts.__createSparkline()",()=>{const{pool:i,...s}=t;return this.create(s,{presetType:"sparkline",pool:i??!0})})}};bn.licenseChecked=!1;var Hr=class ql{static getInstance(t){const i=mS.getInstance(t);return i?HE.chartInstances.get(i):void 0}static initialiseModules(){ql.initialised||(G9(),_9(),ql.initialised=!0)}static createOrUpdate(t){let{proxy:i}=t;const{userOptions:s,licenseManager:o,processedOverrides:n=i?.chart.chartOptions.processedOverrides??{},specialOverrides:r=i?.chart.chartOptions.specialOverrides??{},optionsMetadata:a=i?.chart.chartOptions.optionMetadata??{},deltaOptions:l,stripSymbols:c=!1}=t,d=Ya.styles!=null?[["ag-charts-enterprise",Ya.styles]]:[],{presetType:h}=a;ql.initialiseModules(),Ha(()=>[">>> AgCharts.createOrUpdate() user options",Mi(s)]);let u=s;bn.optionsMutationFn&&u&&(u=bn.optionsMutationFn(Mi(u),h),Ha(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Mi(u)]));const{document:p,window:g,styleContainer:f,...y}=u??{},m=(l?i?.chart.getChartOptions():y)??y,C=new Bz(m,n,{...r,document:p,window:g,styleContainer:f},a,l,c);let b=!1,S=i?.chart,A;return(S==null||Ud.detectChartDefinition(C.processedOptions)!==Ud.detectChartDefinition(S.chartOptions.processedOptions))&&(A=this.getPool(C)?.obtain(C),A?S=A.item:(b=!0,S=ql.createChartInstance(C,S)),d.forEach(([R,I])=>{S?.ctx.domManager.addStyles(R,I)})),i==null?(i=new HE(S,ql.callbackApi,o),i.releaseChart=A?.release):(A||b)&&(i.releaseChart?.(),i.chart=S,i.releaseChart=A?.release),Ha.check()&&typeof window<"u"&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[S.id]=S),S.queuedUserOptions.push(C.userOptions),S.queuedChartOptions.push(C),S.requestFactoryUpdate(R=>{Ha.group(">>>> Chart.applyOptions()",()=>{R.applyOptions(C);const I=R.queuedUserOptions.indexOf(C.userOptions)+1;R.queuedUserOptions.splice(0,I),R.queuedChartOptions.splice(0,I)})}),i}static markRemovedProperties(t,i,s=!1){if(typeof t!="object")return s;for(const[o,n]of Object.entries(t))typeof n>"u"&&(Object.assign(t,{[o]:Symbol("UNSET")}),s||(s=!0));return s}static updateUserDelta(t,i){i=Mi(i,new Set(["data"]));const s=ja(i,ql.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);Ha(()=>[">>> AgCharts.updateUserDelta() user delta",Mi(i)]),ql.createOrUpdate({proxy:t,deltaOptions:i,stripSymbols:s})}static createChartInstance(t,i){const s=i?.destroy({keepTransferableResources:!0});return Ud.detectChartDefinition(t.processedOptions).create(t,s)}static getPool(t){if(t.optionMetadata.pool===!0)return N8.getPool(t.optionMetadata.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};Hr.caretaker=new T2(jC);Hr.initialised=!1;Hr.callbackApi={caretaker:Hr.caretaker,create(e,t,i,s){return Hr.createOrUpdate({userOptions:e,processedOverrides:t,specialOverrides:i,optionsMetadata:s})},update(e,t){return Hr.createOrUpdate({userOptions:e,proxy:t})},updateUserDelta(e,t){return Hr.updateUserDelta(e,t)}};Hr.detachAndClear=e=>e.detachAndClear();Hr.destroy=e=>e.destroy();var hP=Hr,O8={};In(O8,{Arc:()=>da,BBox:()=>ve,Caption:()=>mt,CategoryScale:()=>bm,Group:()=>Me,Line:()=>$o,LinearScale:()=>sr,Marker:()=>Fi,Path:()=>eo,RadialColumnShape:()=>En,Rect:()=>ks,Scene:()=>pS,Sector:()=>Xi,Shape:()=>Mn,TranslatableGroup:()=>Zs,getRadialColumnWidth:()=>Gz,toRadians:()=>Ai});var da=class extends eo{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return Yn(St(this.startAngle),St(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?e.closePath():this.type===2&&!this.fullPie&&(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new ve(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(e,t){const i=this.getBBox();return this.type!==0&&i.containsPoint(e,t)&&this.path.isPointInPath(e,t)}};da.className="Arc";D([Ae()],da.prototype,"centerX",2);D([Ae()],da.prototype,"centerY",2);D([Ae()],da.prototype,"radius",2);D([Ae()],da.prototype,"startAngle",2);D([Ae()],da.prototype,"endAngle",2);D([Ae()],da.prototype,"counterClockwise",2);D([Ae()],da.prototype,"type",2);function Fw(e,t,i){const s=Math.sqrt(e**2+t**2),n=Math.atan2(t,e)+i;return{x:Math.cos(n)*s,y:Math.sin(n)*s}}var En=class extends eo{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0,this.isRadiusAxisReversed=!1}set cornerRadius(t){}computeBBox(){const{innerRadius:t,outerRadius:i,columnWidth:s}=this,o=this.getRotation(),n=-s/2,r=s/2,a=-i,l=-t;let c=1/0,d=1/0,h=-1/0,u=-1/0;for(let p=0;p<4;p+=1){const{x:g,y:f}=Fw(p%2===0?n:r,p<2?a:l,o);c=Math.min(g,c),d=Math.min(f,d),h=Math.max(g,h),u=Math.max(f,u)}return new ve(c,d,h-c,u-d)}getRotation(){const{startAngle:t,endAngle:i}=this,s=sS(t,i);return St(t+s/2+Math.PI/2)}updatePath(){const{isBeveled:t}=this;t?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:t,innerRadius:i,outerRadius:s,path:o}=this,n=-t/2,r=t/2,a=-s,l=-i,c=this.getRotation(),d=[[n,l],[n,a],[r,a],[r,l]].map(([h,u])=>Fw(h,u,c));o.clear(!0),o.moveTo(d[0].x,d[0].y),o.lineTo(d[1].x,d[1].y),o.lineTo(d[2].x,d[2].y),o.lineTo(d[3].x,d[3].y),o.closePath()}updateBeveledPath(){const{columnWidth:t,path:i,outerRadius:s,innerRadius:o,axisInnerRadius:n,axisOuterRadius:r,isRadiusAxisReversed:a}=this,l=Yn(o,n),c=Math.asin(t/2/o),d=this.getRotation(),h=(M,T)=>Fw(M,T,d),u=(M,T)=>Math.sqrt(M**2+T**2),p=(M,T)=>T>M?0:Math.sqrt(M**2-T**2),g=(M,T,E)=>E?M<T:M>T,f=l&&!isNaN(c)&&c<Math.PI/6;let y=-t/2,m=t/2;const C=-s,b=-o*(f?Math.cos(c):1),S=g(r,u(o,t/2),!a);if(S){const M=p(r,o);y=-M,m=M}i.clear(!0);const A=h(y,b);i.moveTo(A.x,A.y);const R=Yn(o,s),I=g(r,u(s,t/2),!a);if(R&&f)i.arc(0,0,o,St(-c-Math.PI/2)+d,St(c-Math.PI/2)+d,!1);else if(I){const M=-p(r,t/2),T=p(r,s);if(!S){const E=h(y,M);i.lineTo(E.x,E.y)}if(i.arc(0,0,r,Math.atan2(M,y)+d,Math.atan2(C,-T)+d,!1),!Yn(T,0)){const E=h(T,C);i.lineTo(E.x,E.y)}i.arc(0,0,r,Math.atan2(C,T)+d,Math.atan2(M,m)+d,!1)}else{const M=h(y,C),T=h(m,C);i.lineTo(M.x,M.y),i.lineTo(T.x,T.y)}const w=h(m,b);if(i.lineTo(w.x,w.y),f)i.arc(0,0,o,St(c-Math.PI/2)+d,St(-c-Math.PI/2)+d,!0);else{const M=h(y,b);i.lineTo(M.x,M.y)}i.closePath()}};En.className="RadialColumnShape";D([Ae()],En.prototype,"isBeveled",2);D([Ae()],En.prototype,"columnWidth",2);D([Ae()],En.prototype,"startAngle",2);D([Ae()],En.prototype,"endAngle",2);D([Ae()],En.prototype,"outerRadius",2);D([Ae()],En.prototype,"innerRadius",2);D([Ae()],En.prototype,"axisInnerRadius",2);D([Ae()],En.prototype,"axisOuterRadius",2);D([Ae()],En.prototype,"isRadiusAxisReversed",2);function Gz(e,t,i,s,o){const n=sS(e,t),r=n*(1-s)/2;if(e+=r,t-=r,n<.001)return 2*i*o;if(n>=2*Math.PI){const p=e+n/2;e=p-Math.PI,t=p+Math.PI}const a=i*Math.cos(e),l=i*Math.sin(e),c=i*Math.cos(t),d=i*Math.sin(t),h=Math.floor(Math.sqrt((a-c)**2+(l-d)**2)),u=2*i*o;return Math.max(1,Math.min(u,h))}var F8={};In(F8,{ChartTheme:()=>Ml,DEFAULT_ANNOTATION_HANDLE_FILL:()=>Fm,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>_m,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>zm,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>Nf,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Of,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Bm,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Gm,DEFAULT_BACKGROUND_COLOUR:()=>wS,DEFAULT_CAPTION_ALIGNMENT:()=>uc,DEFAULT_CAPTION_LAYOUT_STYLE:()=>hc,DEFAULT_COLOR_RANGE:()=>kS,DEFAULT_DIVERGING_SERIES_COLOR_RANGE:()=>Ao,DEFAULT_FIBONACCI_STROKES:()=>Pf,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Di,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>jt,DEFAULT_FUNNEL_SERIES_COLOR_RANGE:()=>ca,DEFAULT_GAUGE_SERIES_COLOR_RANGE:()=>Ln,DEFAULT_GRIDLINE_ENABLED:()=>Vr,DEFAULT_HIERARCHY_FILLS:()=>LS,DEFAULT_HIERARCHY_STROKES:()=>ES,DEFAULT_POLAR_SERIES_STROKE:()=>RS,DEFAULT_SEPARATION_LINES_COLOUR:()=>Em,DEFAULT_SHADOW_COLOUR:()=>Hc,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>TS,DEFAULT_TEXTBOX_COLOR:()=>Wm,DEFAULT_TEXTBOX_FILL:()=>Vm,DEFAULT_TEXTBOX_STROKE:()=>Hm,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Om,DEFAULT_TOOLBAR_POSITION:()=>jm,IS_COMMUNITY:()=>fI,IS_DARK_THEME:()=>Ou,IS_ENTERPRISE:()=>mI,PALETTE_ALT_DOWN_FILL:()=>bI,PALETTE_ALT_DOWN_STROKE:()=>vI,PALETTE_ALT_NEUTRAL_FILL:()=>SI,PALETTE_ALT_NEUTRAL_STROKE:()=>IS,PALETTE_ALT_UP_FILL:()=>CI,PALETTE_ALT_UP_STROKE:()=>yI,PALETTE_DOWN_FILL:()=>Nm,PALETTE_DOWN_STROKE:()=>DS,PALETTE_NEUTRAL_FILL:()=>AS,PALETTE_NEUTRAL_STROKE:()=>Ip,PALETTE_UP_FILL:()=>Pm,PALETTE_UP_STROKE:()=>MS,getChartTheme:()=>ob,themeNames:()=>B8,themeSymbols:()=>gI,themes:()=>ZI});var B8=Object.keys(ZI),G8={};In(G8,{Color:()=>Vt,interpolateColor:()=>tG});var L={};In(L,{AND:()=>na,ARRAY:()=>xm,ARRAY_OF:()=>ul,AbstractBarSeries:()=>mz,AbstractBarSeriesProperties:()=>NI,ActionOnSet:()=>wo,AnchoredPopover:()=>Hz,Animation:()=>lG,AnimationManager:()=>W2,Arc:()=>da,Axis:()=>PA,AxisGroupZIndexMap:()=>p2,AxisInterval:()=>mh,AxisLabel:()=>Gi,AxisTick:()=>fp,AxisTickGenerator:()=>m2,AxisTicks:()=>l7,BBox:()=>ve,BBoxValues:()=>zb,BOOLEAN:()=>xe,BOOLEAN_ARRAY:()=>o5,Background:()=>Mp,BackgroundModule:()=>j_,BandScale:()=>Cm,BarSeries:()=>PS,BarSeriesModule:()=>bz,BaseModuleInstance:()=>aS,BaseProperties:()=>Ee,BaseToolbar:()=>rR,ButtonWidget:()=>Rm,COLOR_GRADIENT:()=>MG,COLOR_STRING:()=>st,COLOR_STRING_ARRAY:()=>Uo,CachedTextMeasurer:()=>HG,CachedTextMeasurerPool:()=>fl,Caption:()=>mt,CartesianAxis:()=>Im,CartesianSeries:()=>_c,CartesianSeriesNodeEvent:()=>nI,CartesianSeriesProperties:()=>Sl,CategoryAxis:()=>yp,CategoryScale:()=>bm,ChangeDetectableProperties:()=>cI,Chart:()=>mS,ChartAxisDirection:()=>DA,ChartEventManager:()=>j2,ChartOptions:()=>Bz,ChartUpdateType:()=>rf,CollapseMode:()=>az,Color:()=>Vt,ColorScale:()=>Pc,ConicGradient:()=>p7,ContextMenuRegistry:()=>U2,ContinuousScale:()=>nt,DATE:()=>hA,DATE_ARRAY:()=>n5,DATE_OR_DATETIME_MS:()=>uA,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Ch,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>bh,DEFAULT_TOOLTIP_CLASS:()=>Ss,DEFAULT_TOOLTIP_DARK_CLASS:()=>y_,DIRECTION:()=>IG,DOMManager:()=>B2,DataController:()=>o_,DataModel:()=>i_,DataModelSeries:()=>sI,DataService:()=>gS,Debug:()=>yt,Default:()=>Oc,Deprecated:()=>_8,DeprecatedAndRenamedTo:()=>z8,DragInterpreter:()=>X2,DraggablePopover:()=>Wz,DropShadow:()=>mr,ExtendedPath2D:()=>Tf,FONT_SIZE_RATIO:()=>pI,FONT_STYLE:()=>pl,FONT_WEIGHT:()=>gl,FUNCTION:()=>Qs,FloatingToolbar:()=>y7,GREATER_THAN:()=>Mm,Gradient:()=>iS,Group:()=>Me,GroupedCategoryAxis:()=>wp,HdpiCanvas:()=>KA,HierarchyNode:()=>o7,HierarchySeries:()=>n7,HierarchySeriesProperties:()=>Wc,HighlightManager:()=>K2,HighlightProperties:()=>oI,HighlightStyle:()=>Lm,INTERACTION_RANGE:()=>tS,INTERPOLATION_STEP_POSITION:()=>ez,INTERPOLATION_TYPE:()=>J_,Image:()=>Ep,InteractionManager:()=>H2,InteractionState:()=>V2,InterpolationProperties:()=>Rp,Invalidating:()=>up,LABEL_PLACEMENT:()=>fA,LARGEST_KEY_INTERVAL:()=>O_,LESS_THAN:()=>wm,LINE_CAP:()=>r5,LINE_DASH:()=>ra,LINE_JOIN:()=>a5,LINE_STYLE:()=>l5,Label:()=>Bi,LayoutElement:()=>zA,LayoutManager:()=>R2,LegendMarkerLabel:()=>Tn,Line:()=>$o,LineSeries:()=>NS,LineSeriesModule:()=>xz,LinearGradient:()=>N0,LinearScale:()=>sr,Listeners:()=>yl,LogScale:()=>tI,LonLatBBox:()=>r7,MARKER_SHAPE:()=>dI,MATCHING_CROSSLINE_TYPE:()=>TA,MAX_SPACING:()=>kG,MIN_SPACING:()=>RG,Marker:()=>Fi,Menu:()=>g7,MercatorScale:()=>a7,ModuleRegistry:()=>Ud,Motion:()=>E0,NAN:()=>Qb,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Jn,NUMBER:()=>Ye,NUMBER_ARRAY:()=>Jb,NUMBER_OR_NAN:()=>pp,NativeWidget:()=>tp,NiceMode:()=>c2,Node:()=>Ic,NumberAxis:()=>Gc,OBJECT:()=>me,OBJECT_ARRAY:()=>pA,OR:()=>Ec,OVERFLOW_STRATEGY:()=>d5,ObserveChanges:()=>Nc,OrdinalTimeScale:()=>$r,PHASE_METADATA:()=>Df,PHASE_ORDER:()=>yu,PLACEMENT:()=>h5,PLAIN_OBJECT:()=>SG,POSITION:()=>gA,POSITION_TOP_COORDINATES:()=>zC,POSITIVE_NUMBER:()=>pe,PREV_NEXT_KEYS:()=>Pu,Padding:()=>Fc,ParallelStateMachine:()=>R5,Path:()=>eo,PointerEvents:()=>QB,PolarAxis:()=>ip,PolarSeries:()=>FS,PolarZIndexMap:()=>Rz,Popover:()=>nR,PropertiesArray:()=>Sm,ProxyInteractionService:()=>_2,ProxyOnWrite:()=>k5,ProxyProperty:()=>Rt,ProxyPropertyOnWrite:()=>Yi,QUICK_TRANSITION:()=>FC,RATIO:()=>rt,REAL_NUMBER:()=>xG,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>ZC,RadialColumnShape:()=>En,Range:()=>gr,Rect:()=>ks,RepeatType:()=>aG,Rotatable:()=>gp,RotatableGroup:()=>D5,RotatableText:()=>WG,SKIP_JS_BUILTINS:()=>aA,SMALLEST_KEY_INTERVAL:()=>N_,SORT_DOMAIN_GROUPS:()=>F_,STRING:()=>he,STRING_ARRAY:()=>DG,Scalable:()=>CA,ScalableGroup:()=>M5,Scene:()=>pS,SceneChangeDetection:()=>ye,ScenePathChangeDetection:()=>Ae,Sector:()=>Xi,SectorBox:()=>Mz,Selection:()=>ai,Series:()=>fS,SeriesContentZIndexMap:()=>u_,SeriesGroupingChangedEvent:()=>JA,SeriesItemHighlightStyle:()=>bl,SeriesMarker:()=>Ts,SeriesNodeEvent:()=>km,SeriesNodePickMode:()=>p_,SeriesProperties:()=>Yo,SeriesTooltip:()=>Ls,SeriesZIndexMap:()=>h_,Shape:()=>Mn,SimpleTextMeasurer:()=>xA,SliderWidget:()=>UA,StateMachine:()=>Am,StateMachineProperty:()=>I5,StopProperties:()=>yA,SvgPath:()=>oR,TEXT_ALIGN:()=>AG,TEXT_WRAP:()=>eS,TICK_INTERVAL:()=>l2,Text:()=>Oi,TextUtils:()=>Ft,TextWrapper:()=>MA,ThemeConstants:()=>U_,ThemeSymbols:()=>gI,TimeScale:()=>e2,Toolbar:()=>f7,ToolbarButtonProperties:()=>Ym,ToolbarButtonWidget:()=>jz,ToolbarWidget:()=>uS,Tooltip:()=>la,TooltipManager:()=>UC,TooltipPosition:()=>bp,Transformable:()=>$t,TransformableText:()=>Ju,Translatable:()=>fh,TranslatableGroup:()=>Zs,TranslatableLine:()=>HC,UNION:()=>Ct,UpdateService:()=>q2,VERTICAL_ALIGN:()=>c5,Validate:()=>k,Vec2:()=>vu,Vec4:()=>j0,WIDGET_HTML_EVENTS:()=>_A,Widget:()=>aa,WidgetEventUtil:()=>Ua,ZIndexMap:()=>a2,ZoomManager:()=>Z2,accumulateGroup:()=>B_,accumulateStack:()=>G_,accumulatedValue:()=>I_,accumulativeValueProperty:()=>Lf,addHitTestersToQuadtree:()=>EI,adjustLabelPlacement:()=>Cz,angleBetween:()=>sS,animationValidation:()=>Sp,applyShapeStyle:()=>Ef,areScalingEqual:()=>Fu,area:()=>Z0,buildFormatter:()=>vm,buildResetPathFn:()=>TI,calculateDefaultTimeTickFormat:()=>yG,calculateDerivativeExtrema:()=>$0,calculateDerivativeExtremaXY:()=>f_,calculateLabelChartPadding:()=>n2,calculateLabelTranslation:()=>G0,calculatePlacement:()=>Y0,checkCrisp:()=>yz,clamp:()=>Pe,clampArray:()=>k0,clippedRoundRect:()=>cC,collapsedStartingBarPosition:()=>zf,compareDates:()=>UG,computeBarFocusBounds:()=>FI,computeMarkerFocusBounds:()=>$m,countExpandingSearch:()=>Y2,countFractionDigits:()=>jb,createButton:()=>c7,createCheckbox:()=>d7,createDatumId:()=>ci,createDeprecationWarning:()=>JI,createElement:()=>He,createElementId:()=>bY,createIcon:()=>zz,createId:()=>Rn,createSelect:()=>h7,createSvgElement:()=>Sn,createTextArea:()=>u7,dateToNumber:()=>bs,datesSortOrder:()=>IA,datumKeys:()=>KC,datumStylerProperties:()=>bc,deconstructSelectionsOrNodes:()=>Yb,deepClone:()=>Mi,deepFreeze:()=>ef,defaultTimeTickFormat:()=>dA,diff:()=>xp,downloadUrl:()=>XB,drawCorner:()=>Wg,drawMarkerUnitPolygon:()=>Hg,easing:()=>E0,enterpriseModule:()=>Ya,evaluateBezier:()=>$C,extent:()=>Cl,extractDecoratedProperties:()=>oG,findMinMax:()=>Ki,findQuadtreeMatch:()=>PI,findRangeExtent:()=>Zu,fixNumericExtent:()=>Co,focusCursorAtEnd:()=>vY,formatNumber:()=>s2,formatPercent:()=>i2,formatValue:()=>il,fromToMotion:()=>Wt,generateUUID:()=>WK,getAngleRatioRadians:()=>NG,getColorStops:()=>FG,getDateTicksForInterval:()=>kA,getDatumRefPoint:()=>$A,getDocument:()=>el,getElementBBox:()=>C2,getIconClassNames:()=>lS,getLastFocus:()=>WA,getMissCount:()=>YA,getPath:()=>rA,getPathComponents:()=>t_,getRadialColumnWidth:()=>Gz,getWindow:()=>wt,groupAccumulativeValueProperty:()=>Sc,groupAverage:()=>A_,groupCount:()=>X0,groupStackValueProperty:()=>P_,groupSum:()=>D_,hasNoModifiers:()=>hS,inRange:()=>ZB,initMenuKeyNav:()=>N2,initRovingTabIndex:()=>P2,interpolatePoints:()=>JC,isAgFlowProportionChartOptions:()=>AX,isAgGaugeChartOptions:()=>d_,isAgHierarchyChartOptions:()=>MX,isAgStandaloneChartOptions:()=>c_,isAgTopologyChartOptions:()=>DX,isBetweenAngles:()=>dc,isButtonClickEvent:()=>HA,isContinuous:()=>oS,isDecoratedObject:()=>$b,isDenseInterval:()=>kf,isInputPending:()=>b2,isInteger:()=>qB,isNegative:()=>Wb,isNumberEqual:()=>Yn,isProperties:()=>Jr,isScaleValid:()=>Bf,jsonApply:()=>nf,jsonDiff:()=>sl,jsonPropertyCompare:()=>S2,jsonResolveOperations:()=>x2,jsonWalk:()=>ja,keyProperty:()=>or,labelDirectionHandling:()=>r2,legendSymbolSvg:()=>m_,lineDistanceSquared:()=>of,listDecoratedProperties:()=>Kd,makeAccessibleClickListener:()=>qY,mapValues:()=>n$,markerFadeInAnimation:()=>Gf,markerPaletteFactory:()=>xI,markerScaleInAnimation:()=>II,markerSwipeScaleInAnimation:()=>RI,mergeArrayDefaults:()=>OC,mergeDefaults:()=>_e,midpointStartingBarPosition:()=>v9,mod:()=>oA,moduleRegistry:()=>Yr,motion:()=>C7,nearestSquared:()=>Hb,nearestSquaredInContainer:()=>YK,normaliseGroupTo:()=>bS,normalisePropertyTo:()=>$d,normalisedExtentWithMetadata:()=>iI,normalizeAngle180:()=>Af,normalizeAngle360:()=>St,normalizeAngle360Inclusive:()=>C5,objectsEqual:()=>ih,objectsEqualWith:()=>nA,pairUpSpans:()=>lf,partialAssign:()=>L0,pathFadeInAnimation:()=>eb,pathMotion:()=>QC,pathSwipeInAnimation:()=>kI,pickByMatchingAngle:()=>UI,plotAreaPathFill:()=>pz,plotInterpolatedAreaSeriesFillSpans:()=>hC,plotInterpolatedLinePathStroke:()=>dC,plotLinePathStroke:()=>MI,predicateWithMessage:()=>ht,prepareAreaFillAnimationFns:()=>gz,prepareAreaPathAnimation:()=>fz,prepareAxisAnimationContext:()=>VC,prepareAxisAnimationFunctions:()=>d2,prepareBarAnimationFunctions:()=>Vf,prepareLinePathAnimation:()=>uz,prepareLinePathPropertyAnimation:()=>AI,prepareLinePathStrokeAnimationFns:()=>DI,preparePieSeriesAnimationFunctions:()=>Yd,range:()=>Rf,rangedValueProperty:()=>aI,resetAxisGroupFn:()=>h2,resetAxisLabelSelectionFn:()=>EA,resetAxisLineSelectionFn:()=>u2,resetAxisSelectionFn:()=>LA,resetBarSelectionsFn:()=>Hf,resetIds:()=>HK,resetLabelFn:()=>wl,resetMarkerFn:()=>Km,resetMarkerPositionFn:()=>_f,resetMotion:()=>Wi,resetPieSelectionsFn:()=>jI,round:()=>XK,rowCountProperty:()=>E_,sanitizeHtml:()=>Nu,scale:()=>vs,sectorBox:()=>Dz,seriesLabelFadeInAnimation:()=>it,seriesLabelFadeOutAnimation:()=>pc,setAttribute:()=>pt,setAttributes:()=>sh,setDocument:()=>$B,setElementBBox:()=>WC,setElementStyle:()=>er,setPath:()=>lA,setWindow:()=>YB,shallowClone:()=>BA,singleSeriesPaletteFactory:()=>Um,solveBezier:()=>YC,sortAndUniqueDates:()=>F0,splitBezier:()=>XC,staticFromToMotion:()=>hl,stopPageScrolling:()=>O2,sum:()=>wZ,sumValues:()=>CS,swapAxisCondition:()=>q_,toDegrees:()=>b5,toRadians:()=>Ai,tooltipContentAriaLabel:()=>v_,trailingAccumulatedValue:()=>R_,trailingAccumulatedValueProperty:()=>AZ,updateClipPath:()=>tb,updateLabelNode:()=>vz,validateCrossLineValues:()=>o2,valueProperty:()=>ze,visibleRangeIndices:()=>$2,without:()=>T0});function JI(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");ue.warnOnce(i)}}function _8(e,t){const i=JI(),s=t?.default;return tl((o,n,r)=>(r!==s&&i(n.toString(),e),r))}function z8(e,t){const i=JI();return tl((s,o,n)=>(n!==s[e]&&(i(o.toString(),`Use [${e}] instead.`),lA(s,e,t?t(n):n)),NC),(s,o)=>(i(o.toString(),`Use [${e}] instead.`),rA(s,e)))}var vu={add:V8,angle:$8,apply:i7,equal:e7,distance:j8,distanceSquared:U8,from:t7,gradient:X8,intercept:Z8,intersectAtX:Q8,intersectAtY:q8,length:tR,lengthSquared:W8,multiply:H8,normalized:K8,origin:iR,required:s7,rotate:Y8,round:J8,sub:eR};function V8(e,t){return typeof t=="number"?{x:e.x+t,y:e.y+t}:{x:e.x+t.x,y:e.y+t.y}}function eR(e,t){return typeof t=="number"?{x:e.x-t,y:e.y-t}:{x:e.x-t.x,y:e.y-t.y}}function H8(e,t){return typeof t=="number"?{x:e.x*t,y:e.y*t}:{x:e.x*t.x,y:e.y*t.y}}function tR(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function W8(e){return e.x*e.x+e.y*e.y}function j8(e,t){const i=eR(e,t);return Math.sqrt(i.x*i.x+i.y*i.y)}function U8(e,t){const i=eR(e,t);return i.x*i.x+i.y*i.y}function K8(e){const t=tR(e);return{x:e.x/t,y:e.y/t}}function $8(e,t=iR()){return Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)}function Y8(e,t,i=iR()){const s=tR(e);return{x:i.x+s*Math.cos(t),y:i.y+s*Math.sin(t)}}function X8(e,t,i){const s=t.x-e.x;return(i==null?t.y-e.y:i-t.y-(i-e.y))/s}function Z8(e,t,i){return(i==null?e.y:i-e.y)-t*e.x}function q8(e,t,i=0,s){return{x:e===1/0?1/0:(i-t)/e,y:s==null?i:s-i}}function Q8(e,t,i=0,s){const o=e===1/0?1/0:e*i+t;return{x:i,y:s==null?o:s-o}}function J8(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function e7(e,t){return e.x===t.x&&e.y===t.y}function t7(e,t){if(typeof e=="number")return{x:e,y:t};if("currentX"in e)return{x:e.currentX,y:e.currentY};if("offsetWidth"in e)return{x:e.offsetWidth,y:e.offsetHeight};if("width"in e)return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y+e.height}];if("x1"in e)return[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(e)}] [${t}]`)}function i7(e,t){return e.x=t.x,e.y=t.y,e}function s7(e){return{x:e?.x??0,y:e?.y??0}}function iR(){return{x:0,y:0}}var _z=class uC{constructor(t,i,s,o,n,r,a,l,c){this.series=t,this.datumIndex=i,this.datum=s,this.sizeValue=o,this.colorValue=n,this.sumSize=r,this.depth=a,this.parent=l,this.children=c,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(t,i=uC.Walk.PreOrder){i===uC.Walk.PreOrder&&t(this),this.children.forEach(s=>{s.walk(t,i)}),i===uC.Walk.PostOrder&&t(this)}*[Symbol.iterator](){yield this;for(const t of this.children)yield*t}};_z.Walk={PreOrder:0,PostOrder:1};var o7=_z,n7=class extends fS{constructor(e){super({moduleCtx:e,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new Pc,this.animationState=new Am("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}processData(){const{NodeClass:e}=this,{childrenKey:t,sizeKey:i,colorKey:s,colorRange:o}=this.properties;let n=0,r=1/0,a=-1/0;const l=(u,p,g)=>{const f=g.depth!=null?g.depth+1:0,y=t!=null?u[t]:void 0,m=y==null||y.length===0;let C=i!=null?u[i]:void 0;Number.isFinite(C)?C=Math.max(C,0):C=m?1:0;const b=C;n=Math.max(n,f);const S=s!=null?u[s]:void 0;return typeof S=="number"&&(r=Math.min(r,S),a=Math.max(a,S)),c(new e(this,p,u,C,S,b,f,g,[]),y)},c=(u,p)=>{const{datumIndex:g}=u;return p?.forEach((f,y)=>{const m=l(f,g.concat(y),u);u.children.push(m),u.sumSize+=m.sumSize}),u},d=c(new e(this,[],void 0,0,void 0,0,void 0,void 0,[]),this.data),h=[r,a];this.colorScale.domain=r<a?[r,a]:[0,1],this.colorScale.range=o??["black"],this.colorScale.update(),this.rootNode=d,this.maxDepth=n,this.colorDomain=h}update({seriesRect:e}){this.updateSelections(),this.updateNodes();const t=this.getAnimationData();this.checkResize(e)&&this.animationState.transition("resize",t),this.animationState.transition("update",t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(e){const{colorKey:t,colorName:i,colorRange:s}=this.properties,{id:o,ctx:{legendManager:n},visible:r}=this;return e==="gradient"&&t!=null&&s!=null?[{legendType:"gradient",enabled:r&&n.getItemEnabled({seriesId:o}),seriesId:o,colorName:i,colorRange:s,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(e){return e.datumIndex.join(":")}getDatumId(e){return this.getDatumIdFromData(e)}removeMeIndexPathForIndex(e){return this.datumSelection.at(e+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(e){for(const{index:t,datum:i}of this.datumSelection)if(Kr(i.datumIndex,e))return t-1;return 0}pickFocus(e){if(!this.rootNode?.children.length)return;const t=Pe(0,e.datumIndex-e.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=e;let o=this.removeMeIndexPathForIndex(t);const n=o.reduce((l,c)=>l.children[c],this.rootNode);if(s>0&&n.hasChildren)o=[...o,0];else if(s<0&&o.length>1)o=o.slice(0,-1);else if(s===0&&i!==0){const l=n.parent.children.length-1;o=o.slice(),o[o.length-1]=Pe(0,o[o.length-1]+i,l)}const r=o.reduce((l,c)=>l.children[c],this.rootNode),a=this.computeFocusBounds(this.datumSelection.at(t+1));if(a!=null)return{datum:r,datumIndex:this.removeMeIndexForIndexPath(o),otherIndex:r.depth,bounds:a,clipFocusBox:!0}}getDatumAriaText(e,t){if(!(e instanceof this.NodeClass)){ue.error(`datum is not HierarchyNode: ${JSON.stringify(e)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(e.depth??-1)+1,count:e.children.length,description:t})}},Wc=class extends Yo{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(ni),this.strokes=Object.values(Fr)}};D([k(he)],Wc.prototype,"childrenKey",2);D([k(he,{optional:!0})],Wc.prototype,"sizeKey",2);D([k(he,{optional:!0})],Wc.prototype,"colorKey",2);D([k(he,{optional:!0})],Wc.prototype,"colorName",2);D([k(Uo)],Wc.prototype,"fills",2);D([k(Uo)],Wc.prototype,"strokes",2);D([k(Uo,{optional:!0})],Wc.prototype,"colorRange",2);var r7=class{constructor(t,i,s,o){this.lon0=t,this.lat0=i,this.lon1=s,this.lat1=o}merge(t){this.lon0=Math.min(this.lon0,t.lon0),this.lat0=Math.min(this.lat0,t.lat0),this.lon1=Math.max(this.lon1,t.lon1),this.lat1=Math.max(this.lat1,t.lat1)}},GS=Math.PI/180,Bw=e=>e*GS,Gw=e=>-Math.log(Math.tan(Math.PI*.25+e*GS*.5)),_w=e=>e/GS,zw=e=>(Math.atan(Math.exp(-e))-Math.PI*.25)/(GS*.5),a7=class aD extends Xb{constructor(t,i){super(),this.domain=t,this.range=i,this.type="mercator",this.bounds=aD.bounds(t)}static bounds(t){const[[i,s],[o,n]]=t,r=Bw(i),a=Gw(s),l=Bw(o),c=Gw(n);return new ve(Math.min(r,l),Math.min(a,c),Math.abs(l-r),Math.abs(c-a))}static fixedScale(){return new aD([[_w(0),zw(0)],[_w(1),zw(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...t){let i=-1/0,s=1/0,o=-1/0,n=1/0;for(const r of t)for(const[a,l]of r)i=Math.min(a,i),s=Math.max(a,s),o=Math.min(l,o),n=Math.max(l,n);return{domain:[[i,o],[s,n]],animatable:!0}}convert([t,i]){const[[s,o],[n,r]]=this.range,a=(n-s)/this.bounds.width,l=(r-o)/this.bounds.height;return[(Bw(t)-this.bounds.x)*a+s,(Gw(i)-this.bounds.y)*l+o]}invert([t,i]){const[[s,o],[n,r]]=this.range,a=(n-s)/this.bounds.width,l=(r-o)/this.bounds.height;return[_w((t-s)/a+this.bounds.x),zw((i-o)/l+this.bounds.y)]}},sR=class lD{constructor(){this.id=Rn(this),this.axisGroup=new Zs({name:`${this.id}-AxisTicks`,zIndex:2}),this.labelSelection=ai.select(this.axisGroup,Oi),this.interval=new mh,this.label=new Gi,this.scale=new sr,this.position="bottom",this.translationX=0,this.translationY=0,this.padding=0}attachAxis(t){t.appendChild(this.axisGroup)}calculateLayout(){const t=[],i=this.generateTicks(),{translationX:s,translationY:o}=this;return this.labelSelection.update(i.ticks.map(n=>this.createLabelDatum(n)),void 0,n=>n.tickId),this.labelSelection.each((n,r)=>{n.setProperties(r),r.visible&&t.push(n.getBBox())}),this.axisGroup.setProperties({translationX:s,translationY:o}),ve.merge(t)}getLabelParams(t){const{padding:i}=this,{translate:s}=t;switch(this.position){case"top":case"bottom":return{x:s,y:i,textAlign:"center",textBaseline:"top"};case"left":case"right":return{x:i,y:s,textAlign:"start",textBaseline:"middle"}}}inRange(t,i=.001){const[s,o]=Ki(this.scale.range);return t>=s-i&&t<=o+i}createLabelDatum(t){const{x:i,y:s,textBaseline:o,textAlign:n}=this.getLabelParams(t);return{visible:!!t.tickLabel,tickId:t.tickId,fill:this.label.color,fontFamily:this.label.fontFamily,fontSize:this.label.fontSize,fontStyle:this.label.fontStyle,fontWeight:this.label.fontWeight,rotation:0,rotationCenterX:0,text:t.tickLabel,textAlign:n,textBaseline:o,x:i,y:s}}generateTicks(){const{minSpacing:t,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:o,tickCount:n}=JG(Zu(this.scale.range),1,t,i,lD.DefaultTickCount,lD.DefaultMinSpacing),r=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:n,minTickCount:o,maxTickCount:s});if(this.position==="bottom"||this.position==="top"){const a=fl.getMeasurer({font:this.label}),{domain:l}=this.scale,d=l[0]>l[1]?-1:1;let h=-1/0*d;r.ticks=r.ticks.filter(u=>Math.sign(u.translate-h)!==d?!1:(h=u.translate+a.textWidth(u.tickLabel,!0)*d,!0))}return r}getTicksData(t){const i=[],s=t.nice?this.scale.niceDomain(t):this.scale.domain,o=this.scale.ticks(t,s),n=o.reduce((l,c)=>Math.max(l,jb(c)),0),r=NA(),a=this.label.format?this.scale.tickFormatter({domain:s,ticks:o,fractionDigits:n,specifier:this.label.format}):l=>il(l,n);for(let l=0;l<o.length;l++){const c=o[l],d=this.scale.convert(c);if(!this.inRange(d))continue;const h=this.label.formatter?.({value:c,index:l,fractionDigits:n})??a(c),u=r(h);i.push({tick:c,tickId:u,tickLabel:h,translate:d})}return{rawTicks:o,fractionDigits:n,ticks:i}}};sR.DefaultTickCount=5;sR.DefaultMinSpacing=10;var l7=sR;function c7(e,t){const i=He("button",_S("ag-charts-input ag-charts-button",t));return e.label!==void 0?i.append(e.label):(i.append(zz(e.icon)),i.ariaLabel=e.altText),i.addEventListener("click",e.onPress),sh(i,t),i}function d7(e,t){const i=He("input",_S("ag-charts-input ag-charts-checkbox",t));return i.type="checkbox",i.checked=e.checked,i.addEventListener("change",s=>e.onChange(i.checked,s)),i.addEventListener("keydown",s=>{HA(s)&&(s.preventDefault(),i.click())}),sh(i,t),i}function h7(e,t){const i=He("select",_S("ag-charts-input ag-charts-select",t));return i.append(...e.options.map(s=>{const o=He("option");return o.value=s.value,o.textContent=s.label,o})),pt(i,"data-preventdefault",!1),i.value=e.value,i.addEventListener("change",s=>e.onChange(i.value,s)),sh(i,t),i}function u7(e,t){const i=He("textarea",_S("ag-charts-input ag-charts-textarea",t));return i.value=e.value,i.addEventListener("input",s=>e.onChange(i.value,s)),sh(i,t),pt(i,"data-preventdefault",!1),i}function zz(e){const t=He("span",`ag-charts-icon ag-charts-icon-${e}`);return pt(t,"aria-hidden",!0),t}function _S(e,t){return t==null?e:`${e} ${t.class}`}var p7=class extends iS{constructor(t,i,s=0,o){super(t,i,o),this.angle=s}createCanvasGradient(t,i){const{angle:o}=this,n=St(Ai(o+90)),r=i.x+i.width*.5,a=i.y+i.height*.5;return t.createConicGradient(n,r,a)}},oR=class extends eo{constructor(t=""){super(),this.x=0,this.y=0,this.commands=[],this._d="",this.d=t}get d(){return this._d}set d(t){if(t!==this._d){this._d=t,this.commands.length=0;for(const[i,s,o]of t.matchAll(/([A-Z])([0-9. ]*)/g)){const n=o.split(/\s+/g).map(Number);this.commands.push([s,n])}this.checkPathDirty()}}updatePath(){const{path:t,x:i,y:s}=this;t.clear();let o=i,n=s;for(const[r,a]of this.commands)switch(r){case"M":t.moveTo(i+a[0],s+a[1]),o=i+a[0];break;case"C":t.cubicCurveTo(i+a[0],s+a[1],i+a[2],s+a[3],i+a[4],s+a[5]),o=i+a[4],n=s+a[5];break;case"H":t.lineTo(i+a[0],n),o=s+a[0];break;case"L":t.lineTo(i+a[0],s+a[1]),o=i+a[0],n=s+a[1];break;case"V":t.lineTo(o,s+a[0]),n=s+a[0];break;case"Z":t.closePath();break;default:throw new Error(`Could not translate command '${r}' with '${a.join(" ")}'`)}t.closePath()}};D([Ae()],oR.prototype,"x",2);D([Ae()],oR.prototype,"y",2);var Ep=class extends Ic{constructor(t){super(),this.sourceImage=t,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(t){const{ctx:i}=t,s=this.sourceImage;s&&(i.globalAlpha=this.opacity,i.drawImage(s,0,0,s.width,s.height,this.x,this.y,this.width,this.height)),super.render(t)}};D([ye()],Ep.prototype,"x",2);D([ye()],Ep.prototype,"y",2);D([ye()],Ep.prototype,"width",2);D([ye()],Ep.prototype,"height",2);D([ye()],Ep.prototype,"opacity",2);var Vz={};In(Vz,{ButtonWidget:()=>Rm,NativeWidget:()=>tp,SliderWidget:()=>UA,ToolbarWidget:()=>uS,WIDGET_HTML_EVENTS:()=>_A,Widget:()=>aa,WidgetEventUtil:()=>Ua});var uP="canvas-overlay",nR=class extends aS{constructor(e,t,i){super(),this.ctx=e,this.hideFns=[],this.moduleId=`popover-${t}`,i?.detached?this.element=He("div"):this.element=e.domManager.addChild(uP,this.moduleId),this.element.setAttribute("role","presentation"),this.destroyFns.push(()=>e.domManager.removeChild(uP,this.moduleId))}attachTo(e){this.element.parentElement||e.element.append(this.element)}hide(e){const{lastFocus:t=this.lastFocus}=e??{};this.element.children.length!==0&&(this.hideFns.forEach(i=>i()),t?.focus(),this.lastFocus=void 0)}removeChildren(){this.element.replaceChildren()}showWithChildren(e,t){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");const i=He("div","ag-charts-popover");if(t.ariaLabel!=null&&i.setAttribute("aria-label",t.ariaLabel),t.class!=null&&i.classList.add(t.class),i.replaceChildren(...e),this.element.replaceChildren(i),this.hideFns.push(()=>this.removeChildren()),t.onHide&&this.hideFns.push(t.onHide),t.initialFocus&&t.sourceEvent){const s=WA(t.sourceEvent);s!==void 0&&(this.lastFocus=s,this.initialFocus=t.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(e){const t=this.getPopoverElement();t&&(t.style.setProperty("right","unset"),t.style.setProperty("bottom","unset"),e.x!=null&&t.style.setProperty("left",`${Math.floor(e.x)}px`),e.y!=null&&t.style.setProperty("top",`${Math.floor(e.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},Hz=class extends nR{setAnchor(e,t){this.anchor=e,this.fallbackAnchor=t,this.updatePosition(e),this.repositionWithinBounds()}showWithChildren(e,t){const i=t.anchor??this.anchor,s=t.fallbackAnchor??this.fallbackAnchor,o=super.showWithChildren(e,t);return i&&this.setAnchor(i,s),wt().requestAnimationFrame(()=>{this.repositionWithinBounds()}),o}repositionWithinBounds(){const{anchor:e,ctx:t,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!e||!s)return;const o=t.domManager.getBoundingClientRect(),{offsetWidth:n,offsetHeight:r}=s;let a=Pe(0,e.x,o.width-n),l=Pe(0,e.y,o.height-r);a!==e.x&&i?.x!=null&&(a=Pe(0,i.x-n,o.width-n)),l!==e.y&&i?.y!=null&&(l=Pe(0,i.y-r,o.height-r)),this.updatePosition({x:a,y:l})}},g7=class extends Hz{show(t){const i=t.items.map(o=>this.createRow(t,o)),s=this.showWithChildren(i,t);s.classList.add("ag-charts-menu"),s.setAttribute("role","menu"),this.menuCloser=N2({orientation:"vertical",menu:s,buttons:i,sourceEvent:t.sourceEvent,closeCallback:()=>this.hide()}),this.hideFns.push(()=>{this.menuCloser?.finishClosing(),this.menuCloser=void 0})}createRow(t,i){const{menuItemRole:s="menuitem"}=t,o=i.value===t.value,n=He("div","ag-charts-menu__row");if(n.setAttribute("role",s),s==="menuitemradio"&&n.setAttribute("aria-checked",(t.value===i.value).toString()),typeof i.value=="string"&&(n.dataset.popoverId=i.value),n.classList.toggle("ag-charts-menu__row--active",o),i.icon!=null){const c=He("span",`ag-charts-menu__icon ${lS(i.icon)}`);n.appendChild(c)}const r=i.strokeWidth!=null;if(r&&(n.classList.toggle("ag-charts-menu__row--stroke-width-visible",r),n.style.setProperty("--strokeWidth",r?`${i.strokeWidth}px`:null)),i.label!=null){const c=He("span","ag-charts-menu__label");c.textContent=this.ctx.localeManager.t(i.label),n.appendChild(c)}"altText"in i&&(n.ariaLabel=this.ctx.localeManager.t(i.altText));const a=()=>{t.onPress?.(i)},l=c=>{HA(c)&&(a(),c.preventDefault(),c.stopPropagation())};return n.addEventListener("keydown",l),n.addEventListener("click",l),n.addEventListener("mousemove",()=>{n.focus({preventScroll:!0})}),n}},Wz=class extends nR{constructor(){super(...arguments),this.dragged=!1}setDragHandle(t){t.addListener("drag-start",i=>{t.addClass(this.dragHandleDraggingClass),this.onDragStart(i)}),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",()=>{t.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(t){const i=this.getPopoverElement();i&&(t.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:vu.from(t.clientX,t.clientY),position:vu.from(Number(i.style.getPropertyValue("left").replace("px","")),Number(i.style.getPropertyValue("top").replace("px","")))})}onDragMove(t){const{dragStartState:i}=this,s=this.getPopoverElement();if(!i||!s)return;const o=vu.sub(vu.from(t.clientX,t.clientY),i.client),n=vu.add(i.position,o),r=this.ctx.domManager.getBoundingClientRect(),a={};n.x>=r.x&&n.x+s.offsetWidth<=r.width&&(a.x=n.x),n.y>=r.y&&n.y+s.offsetHeight<=r.height&&(a.y=n.y),this.updatePosition(a)}onDragEnd(){this.dragStartState=void 0}},Ym=class extends Ee{};D([k(he,{optional:!0})],Ym.prototype,"icon",2);D([k(he,{optional:!0})],Ym.prototype,"label",2);D([k(he,{optional:!0})],Ym.prototype,"ariaLabel",2);D([k(he,{optional:!0})],Ym.prototype,"tooltip",2);var jz=class extends Rm{constructor(t){super(),this.localeManager=t}update(t){const{localeManager:i}=this;t.tooltip&&(this.elem.title=i.t(t.tooltip));let s="";if(t.icon!=null&&(s=`<span class="${lS(t.icon)} ag-charts-toolbar__icon"></span>`),t.label!=null){const o=i.t(t.label);s=`${s}<span class="ag-charts-toolbar__label">${o}</span>`}this.elem.innerHTML=s}setChecked(t){pt(this.elem,"aria-checked",t)}},pP="ag-charts-toolbar__button--active",rR=class extends uS{constructor(e,t="horizontal"){super(t),this.localeManager=e,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new yl,this.hasPrefix=!1,this.buttonWidgets=[],this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",t==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",t==="vertical")}addToolbarListener(e,t){return this.events.addListener(e,t)}clearButtons(){for(const e of this.buttonWidgets)e.destroy();this.buttonWidgets.splice(0)}updateButtons(e){const{buttonWidgets:t}=this;for(const[i,s]of e.entries())(this.buttonWidgets.at(i)??this.createButton(i,s)).update(s);for(let i=e.length;i<t.length;i++)this.buttonWidgets.at(i)?.destroy();this.buttonWidgets.splice(e.length),this.refreshButtonClasses()}updateButtonByIndex(e,t){this.buttonWidgets.at(e)?.update(t)}clearActiveButton(){for(const e of this.buttonWidgets)e.toggleClass(pP,!1)}toggleActiveButtonByIndex(e){if(e!==-1)for(const[t,i]of this.buttonWidgets.entries())i.toggleClass(pP,e!=null&&e===t)}toggleButtonEnabledByIndex(e,t){e!==-1&&this.buttonWidgets.at(e)?.setEnabled(t)}toggleSwitchCheckedByIndex(e,t){e!==-1&&this.buttonWidgets.at(e)?.setChecked(t)}getButtonBounds(){return this.buttonWidgets.map(e=>this.getButtonWidgetBounds(e))}setButtonHiddenByIndex(e,t){this.buttonWidgets.at(e)?.setHidden(t)}getButtonWidgetBounds(e){const t=this.getBounds(),i=e.getBounds();return new ve(i.x+t.x,i.y+t.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:e,hasPrefix:t}=this;let i,s,o;for(const[n,r]of e.entries())i=!t&&n===0||o!=r.section,s=n===e.length-1||r.section!=e.at(n+1)?.section,r.toggleClass("ag-charts-toolbar__button--first",i),r.toggleClass("ag-charts-toolbar__button--last",s),r.toggleClass("ag-charts-toolbar__button--gap",n>0&&i),o=r.section}createButton(e,t){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const o={index:e,...t instanceof Ee?t.toJson():t},n=this.getButtonWidgetBounds(i);this.events.dispatch("button-pressed",{event:s,button:o,buttonBounds:n})}),i.addListener("focus",()=>{this.events.dispatch("button-focused",{button:{index:e}})}),t.section&&(i.section=t.section),this.buttonWidgets.push(i),this.addChild(i),i}},f7=class extends rR{createButtonWidget(){return new jz(this.localeManager)}},m7=class extends Wz{constructor(e,t,i){super(e,t),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(e,t){this.showWithChildren(e,{...t,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const e=this.getPopoverElement();return new ve(e?.offsetLeft??0,e?.offsetTop??0,e?.offsetWidth??0,e?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(e,t,i){const s=this.getPopoverElement();if(!s)return;const o=e.position??"above",{offsetWidth:n,offsetHeight:r}=s;let a=e.y-r-i,l=e.x-n/2;o==="below"?a=e.y+i:o==="right"?(a=e.y-r/2,l=e.x+t):o==="above-left"&&(l=e.x),this.updatePosition({x:l,y:a})}ignorePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="none")}capturePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="unset")}updatePosition(e){const t=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();e.x=Math.floor(Pe(0,e.x,i.width-t.width)),e.y=Math.floor(Pe(0,e.y,i.height-t.height)),super.updatePosition(e),this.onPopoverMoved()}},y7=class extends rR{constructor(t,i){super(t.localeManager),this.hasPrefix=!0,this.popover=new m7(t,i,this.onPopoverMoved.bind(this)),this.dragHandle=new v7(t.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}show(t){this.popover.show([this.dragHandle.getElement(),this.getElement()],t)}hide(){this.popover.hide()}setAnchor(t){this.popover.setAnchor(t,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const t=this.popover.getBounds();if(this.popoverBounds?.equals(t))return;this.popoverBounds=t.clone();const i=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:t,buttonBounds:i})}getButtonWidgetBounds(t){const i=this.popover.getBounds(),s=super.getButtonWidgetBounds(t),o=this.dragHandle.getBounds();return new ve(s.x+i.x-o.width,s.y+i.y,s.width,s.height)}},v7=class extends tp{constructor(t){super(He("div","ag-charts-floating-toolbar__drag-handle"));const i=new tp(He("span",`${lS("drag-handle")} ag-charts-toolbar__icon`));i.setAriaHidden(!0),this.addChild(i),this.elem.title=t}},C7={...KB,...TG};bn.create.bind(bn),bn.__createSparkline.bind(bn);var b7=x.defineComponent({props:{options:{type:Object,default:()=>({})}},setup(){return{chart:void 0}},render(){return x.h("div")},watch:{options(e){this.chart?.update({...e,container:this.$el})}},mounted(){const{options:e}=this;this.chart=bn.create({...e,container:this.$el})},unmounted(){this.chart?.destroy(),this.chart=void 0}});const S7=["#009999CC","#16696D","#FF7A4E","#C97AEB","#F2AD0D","#7C8AF4","#95C54C"],x7={common:{title:{enabled:!1},zoom:{enabled:!1},axes:{number:{crosshair:{enabled:!0},label:{enabled:!0}},category:{crosshair:{enabled:!1},label:{autoRotate:!0}}},legend:{toggleSeries:!1,preventHidingAll:!0}},bar:{series:{cornerRadius:6}}},w7={palette:{fills:S7},overrides:x7};var Uz=Object.defineProperty,M7=(e,t)=>{for(var i in t)Uz(e,i,{get:t[i],enumerable:!0})},v=(e,t,i,s)=>{for(var o=void 0,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=r(t,i,o)||o);return o&&Uz(t,i,o),o},D7=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(t,i){let s=t[0],o=t[1],n=t[2],r=t[3];s=this.ff(s,o,n,r,i[0],7,-680876936),r=this.ff(r,s,o,n,i[1],12,-389564586),n=this.ff(n,r,s,o,i[2],17,606105819),o=this.ff(o,n,r,s,i[3],22,-1044525330),s=this.ff(s,o,n,r,i[4],7,-176418897),r=this.ff(r,s,o,n,i[5],12,1200080426),n=this.ff(n,r,s,o,i[6],17,-1473231341),o=this.ff(o,n,r,s,i[7],22,-45705983),s=this.ff(s,o,n,r,i[8],7,1770035416),r=this.ff(r,s,o,n,i[9],12,-1958414417),n=this.ff(n,r,s,o,i[10],17,-42063),o=this.ff(o,n,r,s,i[11],22,-1990404162),s=this.ff(s,o,n,r,i[12],7,1804603682),r=this.ff(r,s,o,n,i[13],12,-40341101),n=this.ff(n,r,s,o,i[14],17,-1502002290),o=this.ff(o,n,r,s,i[15],22,1236535329),s=this.gg(s,o,n,r,i[1],5,-165796510),r=this.gg(r,s,o,n,i[6],9,-1069501632),n=this.gg(n,r,s,o,i[11],14,643717713),o=this.gg(o,n,r,s,i[0],20,-373897302),s=this.gg(s,o,n,r,i[5],5,-701558691),r=this.gg(r,s,o,n,i[10],9,38016083),n=this.gg(n,r,s,o,i[15],14,-660478335),o=this.gg(o,n,r,s,i[4],20,-405537848),s=this.gg(s,o,n,r,i[9],5,568446438),r=this.gg(r,s,o,n,i[14],9,-1019803690),n=this.gg(n,r,s,o,i[3],14,-187363961),o=this.gg(o,n,r,s,i[8],20,1163531501),s=this.gg(s,o,n,r,i[13],5,-1444681467),r=this.gg(r,s,o,n,i[2],9,-51403784),n=this.gg(n,r,s,o,i[7],14,1735328473),o=this.gg(o,n,r,s,i[12],20,-1926607734),s=this.hh(s,o,n,r,i[5],4,-378558),r=this.hh(r,s,o,n,i[8],11,-2022574463),n=this.hh(n,r,s,o,i[11],16,1839030562),o=this.hh(o,n,r,s,i[14],23,-35309556),s=this.hh(s,o,n,r,i[1],4,-1530992060),r=this.hh(r,s,o,n,i[4],11,1272893353),n=this.hh(n,r,s,o,i[7],16,-155497632),o=this.hh(o,n,r,s,i[10],23,-1094730640),s=this.hh(s,o,n,r,i[13],4,681279174),r=this.hh(r,s,o,n,i[0],11,-358537222),n=this.hh(n,r,s,o,i[3],16,-722521979),o=this.hh(o,n,r,s,i[6],23,76029189),s=this.hh(s,o,n,r,i[9],4,-640364487),r=this.hh(r,s,o,n,i[12],11,-421815835),n=this.hh(n,r,s,o,i[15],16,530742520),o=this.hh(o,n,r,s,i[2],23,-995338651),s=this.ii(s,o,n,r,i[0],6,-198630844),r=this.ii(r,s,o,n,i[7],10,1126891415),n=this.ii(n,r,s,o,i[14],15,-1416354905),o=this.ii(o,n,r,s,i[5],21,-57434055),s=this.ii(s,o,n,r,i[12],6,1700485571),r=this.ii(r,s,o,n,i[3],10,-1894986606),n=this.ii(n,r,s,o,i[10],15,-1051523),o=this.ii(o,n,r,s,i[1],21,-2054922799),s=this.ii(s,o,n,r,i[8],6,1873313359),r=this.ii(r,s,o,n,i[15],10,-30611744),n=this.ii(n,r,s,o,i[6],15,-1560198380),o=this.ii(o,n,r,s,i[13],21,1309151649),s=this.ii(s,o,n,r,i[4],6,-145523070),r=this.ii(r,s,o,n,i[11],10,-1120210379),n=this.ii(n,r,s,o,i[2],15,718787259),o=this.ii(o,n,r,s,i[9],21,-343485551),t[0]=this.add32(s,t[0]),t[1]=this.add32(o,t[1]),t[2]=this.add32(n,t[2]),t[3]=this.add32(r,t[3])}cmn(t,i,s,o,n,r){return i=this.add32(this.add32(i,t),this.add32(o,r)),this.add32(i<<n|i>>>32-n,s)}ff(t,i,s,o,n,r,a){return this.cmn(i&s|~i&o,t,i,n,r,a)}gg(t,i,s,o,n,r,a){return this.cmn(i&o|s&~o,t,i,n,r,a)}hh(t,i,s,o,n,r,a){return this.cmn(i^s^o,t,i,n,r,a)}ii(t,i,s,o,n,r,a){return this.cmn(s^(i|~o),t,i,n,r,a)}md51(t){const i=t.length,s=[1732584193,-271733879,-1732584194,271733878];let o;for(o=64;o<=t.length;o+=64)this.md5cycle(s,this.md5blk(t.substring(o-64,o)));t=t.substring(o-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(o=0;o<t.length;o++)n[o>>2]|=t.charCodeAt(o)<<(o%4<<3);if(n[o>>2]|=128<<(o%4<<3),o>55)for(this.md5cycle(s,n),o=0;o<16;o++)n[o]=0;return n[14]=i*8,this.md5cycle(s,n),s}md5blk(t){const i=[];for(let s=0;s<64;s+=4)i[s>>2]=t.charCodeAt(s)+(t.charCodeAt(s+1)<<8)+(t.charCodeAt(s+2)<<16)+(t.charCodeAt(s+3)<<24);return i}rhex(t){const i="0123456789abcdef".split("");let s="",o=0;for(;o<4;o++)s+=i[t>>o*8+4&15]+i[t>>o*8&15];return s}hex(t){for(let i=0;i<t.length;i++)t[i]=this.rhex(t[i]);return t.join("")}md5(t){return this.hex(this.md51(t))}add32(t,i){return this.ieCompatibility?this.add32Compat(t,i):this.add32Std(t,i)}add32Std(t,i){return t+i&4294967295}add32Compat(t,i){const s=(t&65535)+(i&65535);return(t>>16)+(i>>16)+(s>>16)<<16|s&65535}};function Vw(e){return e==null||e.length===0}var Xy={"01":"GRID","02":"CHARTS","0102":"BOTH"},gP="https://www.ag-grid.com/charts/licensing/",aR=class bi{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new D7,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(bi.licenseKey,bi.gridContext),i=`AG ${t.currentLicenseType==="BOTH"?"Grid and ":""}Charts Enterprise`;let s="";if(t.suppliedLicenseType==="BOTH"?s="AG Grid and AG Charts Enterprise":t.suppliedLicenseType==="GRID"?s="AG Grid Enterprise":t.suppliedLicenseType!==void 0&&(s="AG Charts Enterprise"),t.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(t.expired){const o=bi.getChartsReleaseDate(),n=bi.formatDate(o);this.outputExpiredKey(t.expiry,n,s)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,s):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,s)}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(bi.decode(i),10))}static extractLicenseComponents(t){let i=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const s=i.length-32,o=i.substring(s),n=i.substring(0,s),[r,a,l]=bi.extractBracketedInformation(i);return{md5:o,license:n,version:r,isTrial:a,type:l}}getLicenseDetails(t,i=!1){const s="CHARTS";if(Vw(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};const o=bi.getChartsReleaseDate(),{md5:n,license:r,version:a,isTrial:l,type:c}=bi.extractLicenseComponents(t);let d=n===this.md5.md5(r)&&t.indexOf("For_Trialing_ag-Grid_Only")===-1,h,u,p=null,g=!1,f;function y(){h=p<new Date,u=void 0}if(d&&(p=bi.extractExpiry(r),d=!isNaN(p.getTime()),d))switch(u=o>p,a){case"legacy":case"2":{d=!1;break}case"3":Vw(c)?d=!1:(f=c,c!==Xy["02"]&&c!==Xy["0102"]?(d=!1,g=!0):l&&y())}return d?{licenseKey:t,valid:d,expiry:bi.formatDate(p),expired:u,version:a,isTrial:l,trialExpired:h,invalidLicenseTypeForCombo:i?f!=="BOTH":void 0,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:f}:{licenseKey:t,valid:d,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:f}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!Vw(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getHostname(){if(!this.document)return"localhost";const t=this.document.defaultView??window;if(!t)return"localhost";const i=t.location,{hostname:s=""}=i;return s}isForceWatermark(){if(!this.document)return!1;const t=this.document?.defaultView??typeof window<"u"?window:void 0;if(!t)return!1;const{pathname:i}=t.location;return i?i.indexOf("forceWatermark")!==-1:!1}isWebsiteUrl(){const t=this.getHostname();return/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(t)!==null}isLocalhost(){const t=this.getHostname();return/^(?:127\.0\.0\.1|localhost)$/.exec(t)!==null}static formatDate(t){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=t.getDate(),o=t.getMonth(),n=t.getFullYear();return s+" "+i[o]+" "+n}static getChartsReleaseDate(){return new Date(parseInt(bi.decode(bi.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s="",o,n,r,a,l,c,d,h=0;const u=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;h<u.length;)a=i.indexOf(u.charAt(h++)),l=i.indexOf(u.charAt(h++)),c=i.indexOf(u.charAt(h++)),d=i.indexOf(u.charAt(h++)),o=a<<2|l>>4,n=(l&15)<<4|c>>2,r=(c&3)<<6|d,s=s+String.fromCharCode(o),c!=64&&(s=s+String.fromCharCode(n)),d!=64&&(s=s+String.fromCharCode(r));return s=bi.utf8_decode(s),s}static utf8_decode(t){t=t.replace(/rn/g,"n");let i="";for(let s=0;s<t.length;s++){const o=t.charCodeAt(s);o<128?i+=String.fromCharCode(o):o>127&&o<2048?(i+=String.fromCharCode(o>>6|192),i+=String.fromCharCode(o&63|128)):(i+=String.fromCharCode(o>>12|224),i+=String.fromCharCode(o>>6&63|128),i+=String.fromCharCode(o&63|128))}return i}static setGridContext(t=!1){bi.gridContext=t}static setLicenseKey(t){bi.licenseKey=t}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const i=t.match(/\[(.*?)\]/g).map(a=>a.replace("[","").replace("]",""));if(!i||i.length===0)return["legacy",!1,void 0];const s=i.filter(a=>a==="TRIAL").length===1,o=i.filter(a=>a.startsWith("v"))[0],n=o?o.replace("v",""):"legacy",r=Xy[i.filter(a=>Xy[a])[0]];return[n,s,r]}centerPadAndOutput(t){const i=this.totalMessageLength-t.length;console.error(t.padStart(i/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,i="*",s=""){console.error(t.padEnd(this.totalMessageLength-s.length,i)+s)}outputInvalidLicenseKey(t,i,s){bi.gridContext||(t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${s} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${gP}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${gP}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,i,s){bi.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${s} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){bi.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,i,s){bi.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${s} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};aR.RELEASE_INFORMATION="MTczOTI4MjAzOTc3OA==";aR.gridContext=!1;var Iu=aR;function Hw(e,t,i){const s=(n,r,a,l)=>{let c=e[0];for(let d=n;a>0?d<=r:d>r;d+=a){const h=e[d];if(l(c,h))return!0;c=h}return!1},o=Math.floor(e.length/2);return s(t,o,t,i)?!0:s(e.length-t,o,-t,i)}var{OR:A7,POSITIVE_NUMBER:I7,NAN:R7,AxisInterval:k7,Validate:T7}=L,lR=class extends k7{constructor(){super(...arguments),this.minSpacing=NaN}};v([T7(A7(I7,R7))],lR.prototype,"minSpacing");var{BaseProperties:Kz,ChartAxisDirection:L7,ARRAY:E7,BOOLEAN:cR,COLOR_STRING:dR,FONT_STYLE:P7,FONT_WEIGHT:N7,LINE_DASH:O7,NUMBER:$z,OBJECT:F7,POSITIVE_NUMBER:B7,RATIO:Yz,STRING:Xz,UNION:Zz,AND:G7,Validate:hi,MATCHING_CROSSLINE_TYPE:qz,createId:_7,Group:Ww}=L,yr=class extends Kz{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};v([hi(cR,{optional:!0})],yr.prototype,"enabled");v([hi(Xz,{optional:!0})],yr.prototype,"text");v([hi(P7,{optional:!0})],yr.prototype,"fontStyle");v([hi(N7,{optional:!0})],yr.prototype,"fontWeight");v([hi(B7)],yr.prototype,"fontSize");v([hi(Xz)],yr.prototype,"fontFamily");v([hi($z)],yr.prototype,"padding");v([hi(dR,{optional:!0})],yr.prototype,"color");v([hi(cR,{optional:!0})],yr.prototype,"parallel");var Io=class extends Kz{constructor(){super(...arguments),this.id=_7(this),this.shape="polygon",this.label=new yr,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=L7.X,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new Ww({name:this.id}),this.rangeGroup=new Ww({name:this.id}),this.labelGroup=new Ww({name:this.id}),this._isRange=void 0}assignCrossLineGroup(e,t){e!==this._isRange&&(e?this.rangeGroup.appendChild(t):this.lineGroup.appendChild(t)),this._isRange=e}setSectorNodeProps(e){e.fill=this.fill,e.fillOpacity=this.fillOpacity??1,e.stroke=this.stroke,e.strokeOpacity=this.strokeOpacity??1,e.strokeWidth=this.strokeWidth??1,e.lineDash=this.lineDash}setLabelNodeProps(e,t,i,s,o){const{label:n}=this;e.x=t,e.y=i,e.text=n.text,e.textAlign="center",e.textBaseline=s,e.rotation=o,e.rotationCenterX=t,e.rotationCenterY=i,e.fill=n.color,e.fontFamily=n.fontFamily,e.fontSize=n.fontSize,e.fontStyle=n.fontStyle,e.visible=!0}};v([hi(cR,{optional:!0})],Io.prototype,"enabled");v([hi(Zz(["range","line"],"a crossLine type"),{optional:!0})],Io.prototype,"type");v([hi(G7(qz("range"),E7.restrict({length:2})),{optional:!0})],Io.prototype,"range");v([hi(qz("value"),{optional:!0})],Io.prototype,"value");v([hi(dR,{optional:!0})],Io.prototype,"fill");v([hi(Yz,{optional:!0})],Io.prototype,"fillOpacity");v([hi(dR,{optional:!0})],Io.prototype,"stroke");v([hi($z,{optional:!0})],Io.prototype,"strokeWidth");v([hi(Yz,{optional:!0})],Io.prototype,"strokeOpacity");v([hi(O7,{optional:!0})],Io.prototype,"lineDash");v([hi(Zz(["polygon","circle"],"a shape"))],Io.prototype,"shape");v([hi(F7)],Io.prototype,"label");var{ChartAxisDirection:z7,validateCrossLineValues:V7,normalizeAngle360:jw,isNumberEqual:fP,Group:H7,Path:mP,Sector:W7,RotatableText:j7,ContinuousScale:U7,BandScale:K7}=L,hR=class extends Io{constructor(){super(),this.direction=z7.X,this.polygonNode=new mP,this.sectorNode=new W7,this.lineNode=new mP,this.crossLineRange=new H7,this.labelNode=new j7,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}update(e){const{scale:t,shape:i,type:s,value:o,range:n}=this;if(!t||!s||!V7(s,o,n,t,()=>{if(!U7.is(t))return!0;const[a,l]=n??[o,void 0],{domain:c}=t;return a>=c[0]&&a<=c[1]&&(s==="line"||l>=a&&l<=c[1])})){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,s==="line"&&i==="circle"&&K7.is(t)&&(this.type="range",this.range=[o,o]),this.updateLineNode(e),this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e)}updateLineNode(e){const{scale:t,type:i,value:s,lineNode:o}=this;if(!e||i!=="line"||!t){o.visible=!1;return}const n=t.convert(s);if(isNaN(n)){o.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:a}=this;o.visible=!0,o.stroke=this.stroke,o.strokeOpacity=this.strokeOpacity??1,o.strokeWidth=this.strokeWidth??1,o.fill=void 0,o.lineDash=this.lineDash;const l=a*Math.cos(n),c=a*Math.sin(n),d=r*Math.cos(n),h=r*Math.sin(n);o.path.clear(!0),o.path.moveTo(d,h),o.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(e){const{polygonNode:t,range:i,scale:s,shape:o,type:n,ticks:r}=this;if(!e||n!=="range"||o!=="polygon"||!s||!i){t.visible=!1;return}const{axisInnerRadius:a,axisOuterRadius:l}=this,c=r.indexOf(i[0]),d=r.indexOf(i[1]),u=(c<=d?r.slice(c,d+1):r.slice(c).concat(r.slice(0,d+1))).map(g=>s.convert(g));t.visible=!0,this.setSectorNodeProps(t);const{path:p}=t;p.clear(!0),u.forEach((g,f)=>{const y=l*Math.cos(g),m=l*Math.sin(g);f===0?p.moveTo(y,m):p.lineTo(y,m)}),a===0?p.lineTo(0,0):u.slice().reverse().forEach(g=>{const f=a*Math.cos(g),y=a*Math.sin(g);p.lineTo(f,y)}),t.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(e){const{sectorNode:t,range:i,scale:s,shape:o,type:n}=this;if(!e||n!=="range"||o!=="circle"||!s||!i){t.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:a}=this,l=i.map(h=>s.convert(h)),c=s.step??0,d=s instanceof L.BandScale?c/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=r,t.outerRadius=a,t.startAngle=l[0]-d,t.endAngle=l[1]+d,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(e){const{label:t,labelNode:i,range:s,scale:o,type:n,ticks:r}=this;if(!e||t.enabled===!1||!t.text||!o||n==="range"&&!s){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:a,axisOuterRadius:l}=this;let c,d,h,u;if(n==="line"){const p=jw(o.convert(this.value)),g=1.5*Math.PI,f=fP(p,g)||p>g||p<Math.PI/2,y=(a+l)/2*Math.cos(p),m=(a+l)/2*Math.sin(p);c=y+t.padding*Math.cos(p+Math.PI/2),d=m+t.padding*Math.sin(p+Math.PI/2),u=f?"top":"bottom",h=f?p:p-Math.PI}else{const[p,g]=s.map(C=>jw(o.convert(C)));let f=(p+g)/2;p>g&&(f-=Math.PI),f=jw(f);const y=(fP(f,0)||f>0)&&f<Math.PI;let m;this.shape==="circle"||r.length<3?m=l-t.padding:m=l*Math.cos(Math.PI/r.length)-t.padding,c=m*Math.cos(f),d=m*Math.sin(f),u=y?"bottom":"top",h=y?f-Math.PI/2:f+Math.PI/2}this.setLabelNodeProps(i,c,d,u,h)}};hR.className="AngleCrossLine";var{ChartAxisDirection:$7,NUMBER:Qz,UNION:Y7,ProxyOnWrite:X7,TextWrapper:Z7,TextUtils:q7,Validate:uR,isNumberEqual:eu,toRadians:Zy,normalizeAngle360:tu,normalizeAngle360Inclusive:Q7,Path:J7,RotatableText:eq,Transformable:tq,BBox:iq}=L,cD=class extends L.AxisLabel{constructor(){super(...arguments),this.orientation="fixed"}};v([uR(Y7(["fixed","parallel","perpendicular"],"a label orientation"))],cD.prototype,"orientation");var Xm=class extends L.PolarAxis{constructor(e,t){super(e,t),this.startAngle=0,this.endAngle=void 0,this.labelData=[],this.tickData=[],this.radiusLine=this.axisGroup.appendChild(new J7),this.includeInvisibleDomains=!0}get direction(){return $7.X}createLabel(){return new cD}calculateTickLayout(e){const{nice:t,scale:i}=this,s={nice:t,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},o=t?i.niceDomain(s,e):e,n=this.generateAngleTicks(o);this.tickData=n;const r=n.map(a=>a.value);return{niceDomain:o,primaryTickCount:void 0,tickDomain:o,ticks:r,fractionDigits:0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine()}normalizedAngles(){const e=tu(-Math.PI/2+Zy(this.startAngle)),t=this.endAngle!=null?Q7(Zy(this.endAngle)-Zy(this.startAngle)):2*Math.PI,i=e+t;return[e,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const e=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?e:[]),this.tickLineGroupSelection.update(this.tick.enabled?e:[]),this.tickLabelGroupSelection.update(this.label.enabled?e:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){const{translation:e,axisGroup:t,gridGroup:i,crossLineRangeGroup:s,crossLineLineGroup:o,crossLineLabelGroup:n}=this,r=Math.floor(e.x),a=Math.floor(e.y);t.translationX=r,t.translationY=a,i.translationX=r,i.translationY=a,s.translationX=r,s.translationY=a,o.translationX=r,o.translationY=a,n.translationX=r,n.translationY=a}updateRadiusLine(){const e=this.radiusLine,{path:t}=e;t.clear(!0);const{points:i,closePath:s}=this.getAxisLinePoints();i.forEach(({x:o,y:n,moveTo:r,arc:a,radius:l=0,startAngle:c=0,endAngle:d=0})=>{a?t.arc(o,n,l,c,d):r?t.moveTo(o,n):t.lineTo(o,n)}),s&&t.closePath(),e.visible=this.line.enabled,e.stroke=this.line.stroke,e.strokeWidth=this.line.width,e.fill=void 0}getAxisLinePoints(){const{scale:e,shape:t,gridLength:i}=this,[s,o]=this.range,n=eu(o-s,2*Math.PI),r=[];if(t==="circle")n?r.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):r.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:tu(s),endAngle:tu(o),arc:!0,moveTo:!1});else if(t==="polygon"){const a=e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.map(l=>e.convert(l));a&&a.length>2&&a.forEach((l,c)=>{const d=i*Math.cos(l),h=i*Math.sin(l),u=c===0;r.push({x:d,y:h,moveTo:u})})}return{points:r,closePath:n}}updateGridLines(){const{scale:e,gridLength:t,gridLine:{style:i,width:s},innerRadiusRatio:o}=this;if(!(i&&t>0))return;const n=t*o,r=i.length;this.gridLineGroupSelection.each((a,l,c)=>{const{value:d}=l,{stroke:h,lineDash:u}=i[c%r],p=e.convert(d);a.x1=n*Math.cos(p),a.y1=n*Math.sin(p),a.x2=t*Math.cos(p),a.y2=t*Math.sin(p),a.stroke=h,a.strokeWidth=s,a.lineDash=u,a.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:e,tickLabelGroupSelection:t}=this;t.each((i,s,o)=>{const n=this.labelData[o];if(!n||n.hidden){i.visible=!1;return}i.text=n.text,i.setFont(e),i.fill=e.color,i.x=n.x,i.y=n.y,i.textAlign=n.textAlign,i.textBaseline=n.textBaseline,i.visible=!0,n.rotation?(i.rotation=n.rotation,i.rotationCenterX=n.x,i.rotationCenterY=n.y):i.rotation=0})}updateTickLines(){const{scale:e,gridLength:t,tick:i,tickLineGroupSelection:s}=this;s.each((o,n)=>{const{value:r}=n,a=e.convert(r),l=Math.cos(a),c=Math.sin(a);o.x1=t*l,o.y1=t*c,o.x2=(t+i.size)*l,o.y2=(t+i.size)*c,o.stroke=i.stroke,o.strokeWidth=i.width})}createLabelNodeData(e,t,i){const{label:s,gridLength:o,scale:n,tick:r}=this;if(!s.enabled)return[];const a=new eq,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,d=e.map((h,u)=>{const{value:p}=h,g=o+s.spacing+r.size,f=n.convert(p),y=Math.cos(f),m=Math.sin(f),C=g*y,b=g*m,{textAlign:S,textBaseline:A}=this.getLabelAlign(f),R=u===e.length-1&&p!==e[0]&&eu(tu(f),tu(n.convert(e[0]))),I=this.getLabelRotation(f);let w=String(p);if(s.formatter){const{callbackCache:T}=this.moduleCtx;w=T.call(s.formatter,{value:p,index:u})??""}a.text=w,a.x=C,a.y=b,a.setFont(s),a.textAlign=S,a.textBaseline=A,a.rotation=I,I&&(a.rotationCenterX=C,a.rotationCenterY=b);let M=I?tq.toCanvas(a):a.getBBox();if(M&&t.hideWhenNecessary&&!I){const T=l-M.x,E=M.x+M.width-c,P=1;if(T>P||E>P){const N=M.width-Math.max(T,E);w=Z7.wrapText(w,{maxWidth:N,font:s,textWrap:"never"}),w===q7.EllipsisChar&&(w=""),a.text=w,M=a.getBBox()}}return{text:w,x:C,y:b,textAlign:S,textBaseline:A,hidden:w===""||h.hidden||R,rotation:I,box:M}});return s.avoidCollisions&&this.avoidLabelCollisions(d),d}computeLabelsBBox(e,t){this.labelData=this.createLabelNodeData(this.tickData,e,t);const i=this.labelData.map(({box:s})=>s).filter(s=>s!=null);return!this.label.enabled||i.length===0?null:iq.merge(i)}getLabelOrientation(){const{label:e}=this;return e instanceof cD?e.orientation:"fixed"}getLabelRotation(e){let t=Zy(this.label.rotation??0);e=tu(e);const i=this.getLabelOrientation();return i==="parallel"?(t+=e,e>=0&&e<Math.PI?t-=Math.PI/2:t+=Math.PI/2):i==="perpendicular"&&(t+=e,e>=Math.PI/2&&e<1.5*Math.PI&&(t+=Math.PI)),t}getLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,o;const n=this.getLabelOrientation(),r=eu(t,0),a=eu(i,0),l=eu(t,1),c=eu(i,-1),d=t>0&&!r,h=i>0&&!a;return n==="parallel"?(s="center",o=l&&a||h?"top":"bottom"):n==="perpendicular"?(s=c||d?"left":"right",o="middle"):(s="right",r?s="center":d&&(s="left"),o="bottom",a?o="middle":h&&(o="top")),{textAlign:s,textBaseline:o}}updateCrossLines(){const{shape:e,gridLength:t,innerRadiusRatio:i}=this;this.crossLines.forEach(s=>{s instanceof hR&&(s.ticks=this.tickData.map(o=>o.value),s.shape=e,s.axisOuterRadius=t,s.axisInnerRadius=t*i)}),super.updateCrossLines()}};Xm.CrossLineConstructor=hR;v([X7("rotation"),uR(Qz)],Xm.prototype,"startAngle");v([uR(Qz,{optional:!0})],Xm.prototype,"endAngle");var{RATIO:Jz,OBJECT:sq,Validate:pR,isNumberEqual:yP,CategoryScale:oq}=L,wh=class extends Xm{constructor(e){super(e,new oq),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new lR}generateAngleTicks(){const{scale:e,gridLength:t}=this,{values:i,minSpacing:s}=this.interval,o=i??e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})??[];if(o.length<2||isNaN(s))return o.map(c=>({value:c,visible:!0}));const n=o[0],r=e.convert(n),a=t*Math.cos(r),l=t*Math.sin(r);for(let c=1;c<o.length-1;c++){const d=o[c],h=e.convert(d);if(h-r>Math.PI)break;const u=t*Math.cos(h),p=t*Math.sin(h);if(Math.sqrt((u-a)**2+(p-l)**2)>s){const f=new Set([n]);return Hw(o,c,(y,m)=>{f.add(m)}),o.map(y=>{const m=f.has(y);return{value:y,visible:m}})}}return[{value:n,visible:!0}]}avoidLabelCollisions(e){let{minSpacing:t}=this.label;if(Number.isFinite(t)||(t=0),e.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;const d=l.box.clone().grow(t/2),h=c.box.clone().grow(t/2);return d.collidesBBox(h)},s=e[0],o=e.at(-1),n=new Set([s]),r=yP(s.x,o.x)&&yP(s.y,o.y),a=Math.floor(e.length/2);for(let l=1;l<=a;l++){const c=r?e.slice(0,-1):e;if(!Hw(c,l,i)){Hw(c,l,(h,u)=>{n.add(u)});break}}e.forEach(l=>{n.has(l)||(l.hidden=!0,l.box=void 0)})}};wh.className="AngleCategoryAxis";wh.type="angle-category";v([pR(Jz)],wh.prototype,"groupPaddingInner");v([pR(Jz)],wh.prototype,"paddingInner");v([pR(sq)],wh.prototype,"interval");var nq={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-category",moduleFactory:e=>new wh(e)},{range:vP,isDenseInterval:rq,isNumberEqual:aq,LinearScale:Uw}=L,lq=class dD extends Uw{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(t,i){const[s,o]=i;let n=Uw.getTickStep(s,o,t);const r=isNaN(t.maxTickCount)?1/0:t.maxTickCount,a=Math.abs(o-s)/n;let l=Math.pow(2,Math.ceil(Math.log(a)/Math.log(2)));return l>r&&(l/=2,n*=2),{count:l,step:n}}ticks(t,i=this.domain){const{arcLength:s}=this;if(!i||i.length<2||i.some(c=>!isFinite(c))||s<=0)return[];const{nice:o,interval:n}=t,[r,a]=i;if(n){const c=Math.abs(n),d=this.getPixelRange();if(!rq((a-r)/c,d))return vP(r,a,c)}let l;if(o&&this.hasNiceRange()){const c=super.niceDomain(t,i);l=dD.getNiceStepAndTickCount(t,c).step}else l=Uw.getTickStep(r,a,t);return vP(r,a,l)}hasNiceRange(){const t=this.range.slice().sort((s,o)=>s-o);return[Math.PI,2*Math.PI].some(s=>aq(s,t[1]-t[0]))}niceDomain(t,i=this.domain){const s=super.niceDomain(t,i);if(!this.hasNiceRange())return s;const o=s[0]>s[1],n=o?s[1]:s[0],{step:r,count:a}=dD.getNiceStepAndTickCount(t,s),l=1/r,c=r>=1?Math.ceil(n/r+a)*r:Math.ceil((n+a*r)*l)/l;return o?[c,n]:[n,c]}getPixelRange(){return this.arcLength}},{AND:eV,Default:tV,GREATER_THAN:cq,LESS_THAN:dq,NUMBER_OR_NAN:iV,OBJECT:hq,Validate:gR,angleBetween:uq,isNumberEqual:CP,normalisedExtentWithMetadata:pq,findMinMax:gq}=L,Pp=class extends Xm{constructor(e){super(e,new lq),this.shape="circle",this.min=NaN,this.max=NaN,this.interval=new lR}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:o}=pq(e,t,i);return{domain:s,clipped:o}}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:e}=this,t=Math.min(...e),i=Math.max(...e),s=uq(t,i)||2*Math.PI,o=this.gridLength;return s*o}generateAngleTicks(e){const{scale:t,range:i,nice:s}=this,{values:o,step:n,minSpacing:r,maxSpacing:a}=this.interval;let l;if(o==null){const{arcLength:c}=t,d=a?Math.floor(c/a):1,h=r?Math.floor(c/r):1/0,u=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),p=Math.max(d,Math.min(h,u)),g={nice:s,interval:n,tickCount:p,minTickCount:d,maxTickCount:h};l=t.ticks(g,e)}else{const[c,d]=gq(e.map(Number));l=o.filter(h=>h>=c&&h<=d).sort((h,u)=>h-u)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(e){let{minSpacing:t}=this.label;Number.isFinite(t)||(t=0);const i=(n,r)=>{if(n.hidden||r.hidden)return!1;const a=n.box.clone().grow(t/2),l=r.box.clone().grow(t/2);return a.collidesBBox(l)},s=e[0],o=e.at(-1);s!==o&&CP(s.x,o.x)&&CP(s.y,o.y)&&(o.hidden=!0);for(let n=1;n<e.length;n*=2){let r=!1;for(let a=n;a<e.length;a+=n){const l=e[a],c=e[a-n];if(i(c,l)){r=!0;break}}if(!r){e.forEach((a,l)=>{l%n>0&&(a.hidden=!0,a.box=void 0)});return}}e.forEach((n,r)=>{r>0&&(n.hidden=!0,n.box=void 0)})}};Pp.className="AngleNumberAxis";Pp.type="angle-number";v([gR(eV(iV,dq("max"))),tV(NaN)],Pp.prototype,"min");v([gR(eV(iV,cq("min"))),tV(NaN)],Pp.prototype,"max");v([gR(hq)],Pp.prototype,"interval");var fq={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-number",moduleFactory:e=>new Pp(e)},{OrdinalTimeScale:mq}=L,fR=class extends L.CategoryAxis{constructor(e){super(e,new mq)}};fR.className="OrdinalTimeAxis";fR.type="ordinal-time";var yq={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ordinal-time",moduleFactory:e=>new fR(e)},{ChartAxisDirection:vq,Validate:Cq,NUMBER:bq,validateCrossLineValues:Sq,clamp:bP,normalizeAngle360:xq,toRadians:wq,isNumberEqual:Mq,Group:Dq,Path:Aq,Sector:Iq,RotatableText:Rq}=L,sV=class extends yr{constructor(){super(...arguments),this.positionAngle=void 0}};v([Cq(bq,{optional:!0})],sV.prototype,"positionAngle");var mR=class extends Io{constructor(){super(),this.direction=vq.Y,this.label=new sV,this.polygonNode=new Aq,this.sectorNode=new Iq,this.crossLineRange=new Dq,this.labelNode=new Rq,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(e){const{scale:t,type:i,value:s,range:o}=this;if(!t||!i||!Sq(i,s,o,t)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}i==="line"&&t instanceof L.BandScale&&(this.type="range",this.range=[s,s]),this.updateRadii();const{innerRadius:n,outerRadius:r}=this;e&&(e=n>=this.axisInnerRadius&&r<=this.axisOuterRadius),this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:e,scale:t,type:i,axisInnerRadius:s,axisOuterRadius:o}=this;if(!t)return{innerRadius:0,outerRadius:0};const n=l=>o+s-l;let r,a;if(i==="line")r=n(t.convert(this.value)),a=r;else{const l=Math.abs(t?.bandwidth??0),c=e.map(d=>t.convert(d));r=n(Math.max(...c)),a=n(Math.min(...c))+l}this.outerRadius=r,this.innerRadius=a}drawPolygon(e,t,i){t.forEach((s,o)=>{const n=e*Math.cos(s),r=e*Math.sin(s);o===0?i.path.moveTo(n,r):i.path.lineTo(n,r)}),i.path.closePath()}updatePolygonNode(e){const{gridAngles:t,polygonNode:i,scale:s,shape:o,type:n,innerRadius:r,outerRadius:a}=this;if(!e||o!=="polygon"||!s||!t){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(a-l,t,i);const c=t.slice().reverse(),d=n==="line"?a-l:r+l;this.drawPolygon(d,c,i),this.setSectorNodeProps(i)}updateSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:s,sectorNode:o,shape:n,innerRadius:r,outerRadius:a}=this;if(!e||n!=="circle"||!s){o.visible=!1;return}o.visible=!0,o.startAngle=0,o.endAngle=2*Math.PI;const l=this.getPadding(),c=bP(t,r+l,i),d=bP(t,a-l,i);o.innerRadius=Math.min(c,d),o.outerRadius=Math.max(c,d),this.setSectorNodeProps(o)}updateLabelNode(e){const{innerRadius:t,label:i,labelNode:s,scale:o,shape:n,type:r}=this;if(!e||i.enabled===!1||!i.text||!o){s.visible=!1;return}const a=xq(wq((i.positionAngle??0)-90)),l=(Mq(a,0)||a>0)&&a<Math.PI,c=l?a-Math.PI/2:a+Math.PI/2;let d;const h=this.gridAngles??[];r==="line"?d=t+i.padding:n==="circle"||h.length<3?d=t-i.padding:d=t*Math.cos(Math.PI/h.length)-i.padding;const u=d*Math.cos(a),p=d*Math.sin(a);let g;r==="line"?g=l?"top":"bottom":g=l?"bottom":"top",this.setLabelNodeProps(s,u,p,g,c)}getPadding(){const{scale:e}=this;if(!e)return 0;const t=Math.abs(e.bandwidth??0),i=Math.abs(e.step??0);return e instanceof L.BandScale?(i-t)/2:0}};mR.className="RadiusCrossLine";var{ChartAxisDirection:kq,Default:Tq,ZIndexMap:Lq,NUMBER:oV,BOOLEAN:Eq,Validate:yR,isNumberEqual:Pq,normalizeAngle360:SP,toRadians:Nq,Caption:Oq,Group:Fq,Path:Bq,Line:Gq,Selection:_q,AxisTickGenerator:zq,AxisGroupZIndexMap:Vq}=L,vR=class extends L.AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};v([yR(Eq,{optional:!0})],vR.prototype,"autoRotate");v([yR(oV)],vR.prototype,"autoRotateAngle");var zS=class extends L.PolarAxis{constructor(e,t){super(e,t),this.positionAngle=0,this.tickGenerator=new zq(this),this.generatedTicks=void 0,this.lineNode=this.axisGroup.appendChild(new Gq({name:`${this.id}-Axis-line`,zIndex:Vq.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new Fq({name:`${this.id}-gridPaths`,zIndex:Lq.AXIS_GRID})),this.gridPathSelection=_q.select(this.gridPathGroup,Bq),this.axisGroup.appendChild(this.title.caption.node),this.destroyFns.push(this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}get direction(){return kq.Y}getAxisTransform(){const e=this.scale.range[0],{translation:t,positionAngle:i,innerRadiusRatio:s}=this,o=e*s,n=Nq(i);return{translationX:t.x,translationY:t.y-e-o,rotation:n,rotationCenterX:0,rotationCenterY:e+o}}update(){super.update(),this.updateTitle();const{enabled:e,stroke:t,width:i}=this.line;this.lineNode.setProperties({stroke:t,strokeWidth:e?i:0,x1:0,y1:this.range[0],x2:0,y2:this.range[1]})}calculateTickLayout(e,t,i,s){const{parallelFlipRotation:o,regularFlipRotation:n}=this.calculateRotations(),r=[0,1],a=this.label.getSideFlag(),l=a*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),c=this.tickGenerator.generateTicks({domain:e,niceMode:t,visibleRange:r,primaryTickCount:s,parallelFlipRotation:o,regularFlipRotation:n,labelX:l,sideFlag:a}),{tickData:d,primaryTickCount:h=s}=c,{ticks:u,rawTicks:p,tickDomain:g,fractionDigits:f,niceDomain:y=e}=d,m=u.map(C=>this.getTickLabelProps(C,c));return this.generatedTicks={ticks:u,labels:m},{ticks:p,tickDomain:g,niceDomain:y,primaryTickCount:h,fractionDigits:f,bbox:void 0}}updateSelections(){const{generatedTicks:e}=this;if(!e)return;const{ticks:t,labels:i}=e;this.gridLineGroupSelection.update(this.gridLength?t:[]),this.tickLineGroupSelection.update(t),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(t):[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const e=L.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.fill,t.fontFamily=i.fontFamily,t.fontSize=i.fontSize,t.fontStyle=i.fontStyle,t.fontWeight=i.fontWeight,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setProperties(e(t,i))})}updateGridLines(){super.updateGridLines();const{gridLine:{style:e,width:t},shape:i,generatedTicks:s}=this;if(!e||!s)return;const o=e.length,n=(u,p)=>{const{stroke:g,lineDash:f}=e[p%o];u.stroke=g,u.strokeWidth=t,u.lineDash=f,u.fill=void 0},[r,a]=this.gridRange??[0,2*Math.PI],l=Pq(a-r,2*Math.PI),h=i==="circle"?(u,p)=>{const{path:g}=u;g.clear(!0);const f=this.getTickRadius(p);l?(g.moveTo(f,0),g.arc(0,0,f,0,2*Math.PI)):(g.moveTo(f*Math.cos(r),f*Math.sin(r)),g.arc(0,0,f,SP(r),SP(a))),l&&g.closePath()}:(u,p)=>{const{path:g}=u,f=this.gridAngles;if(g.clear(!0),!f||f.length<3)return;const y=this.getTickRadius(p);f.forEach((m,C)=>{const b=y*Math.cos(m),S=y*Math.sin(m);C===0?g.moveTo(b,S):g.lineTo(b,S),f.forEach((A,R)=>{const I=y*Math.cos(A),w=y*Math.sin(A);R===0?g.moveTo(I,w):g.lineTo(I,w)}),g.closePath()}),g.closePath()};this.gridPathSelection.each((u,p,g)=>{n(u,g),h(u,p)})}updateTitle(){const e=a=>a.defaultValue,{title:t,range:i,moduleCtx:{callbackCache:s}}=this,{formatter:o=e}=this.title;t.caption.enabled=t.enabled,t.caption.fontFamily=t.fontFamily,t.caption.fontSize=t.fontSize,t.caption.fontStyle=t.fontStyle,t.caption.fontWeight=t.fontWeight,t.caption.color=t.color,t.caption.wrapping=t.wrapping;let n=!1;const r=t.caption.node;t.enabled&&(n=!0,r.rotation=Math.PI/2,r.x=Math.floor((i[0]+i[1])/2),r.y=-Oq.SMALL_PADDING,r.textAlign="center",r.textBaseline="bottom",r.text=s.call(o,this.getTitleFormatterParams())),r.visible=n}updateCrossLines(){this.crossLines.forEach(e=>{if(e instanceof mR){const{shape:t,gridAngles:i,range:s,innerRadiusRatio:o}=this,n=s[0];e.shape=t,e.gridAngles=i,e.axisOuterRadius=n,e.axisInnerRadius=n*o}}),super.updateCrossLines()}createLabel(){return new vR}getTickLabelProps(e,t){const{label:i}=this,{combinedRotation:s,textBaseline:o,textAlign:n}=t,r=this.scale.range,a=e.tickLabel,c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),d=a!==""&&a!=null;return{...this.getLabelStyles({value:e.tickLabel}),tickId:e.tickId,rotation:s,rotationCenterX:c,translationY:e.translationY,text:a,textAlign:n,textBaseline:o,visible:d,x:c,y:0,range:r}}};zS.CrossLineConstructor=mR;v([yR(oV),Tq(0)],zS.prototype,"positionAngle");var{RATIO:CR,ProxyPropertyOnWrite:nV,Validate:bR,CategoryScale:xP}=L,Mh=class extends zS{constructor(e){super(e,new xP),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}normaliseDataDomain(e){return{domain:e,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,s=t.range[0],o=s*i;if(xP.is(t)){const n=t.domain,r=n.length-1-n.indexOf(e.tick);return r===0?o:t.inset+t.step*(r-.5)+t.bandwidth/2}else{const n=(s-o)/t.domain.length;return s-e.translationY+o-n/2}}};Mh.className="RadiusCategoryAxis";Mh.type="radius-category";v([bR(CR)],Mh.prototype,"groupPaddingInner");v([nV("scale","paddingInner"),bR(CR)],Mh.prototype,"paddingInner");v([nV("scale","paddingOuter"),bR(CR)],Mh.prototype,"paddingOuter");var Hq={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-category",moduleFactory:e=>new Mh(e)},{AND:rV,Default:aV,GREATER_THAN:Wq,LESS_THAN:jq,NUMBER_OR_NAN:lV,Validate:cV,normalisedExtentWithMetadata:Uq,LinearScale:Kq}=L,Zm=class extends zS{constructor(e){super(e,new Kq),this.shape="polygon",this.min=NaN,this.max=NaN}prepareGridPathTickData(e){const{scale:t}=this,i=t.domain[1];return e.filter(({tick:s})=>s!==i).sort((s,o)=>o.tick-s.tick)}getTickRadius(e){const{scale:t}=this,i=t.range[0],s=i*this.innerRadiusRatio;return i-e.translationY+s}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:o}=Uq(e,t,i);return{domain:s,clipped:o}}};Zm.className="RadiusNumberAxis";Zm.type="radius-number";v([cV(rV(lV,jq("max"))),aV(NaN)],Zm.prototype,"min");v([cV(rV(lV,Wq("min"))),aV(NaN)],Zm.prototype,"max");var $q={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-number",moduleFactory:e=>new Zm(e)},{Chart:Yq}=L;function Xq(e){return e.type==="sankey"||e.type==="chord"}var SR=class extends Yq{getChartType(){return"flow-proportion"}async updateData(){await super.updateData();const{nodes:e}=this.getOptions();this.series.forEach(t=>{Xq(t)&&t.setChartNodes(e)})}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e;s.shrink(this.seriesArea.padding.toJson());const o=s.clone();this.seriesRect=o,this.animationRect=o,t.visible=this.series.some(n=>n.visible);for(const n of[t,i])n.translationX=Math.floor(o.x),n.translationY=Math.floor(o.y);this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:t.visible,rect:o,paddedRect:o}})}};SR.className="FlowProportionChart";SR.type="flow-proportion";var{isAgFlowProportionChartOptions:Zq}=L,qq={type:"chart",name:"flow-proportion",detect:Zq,create(e,t){return new SR(e,t)}},et={};M7(et,{error:()=>hV,errorOnce:()=>tQ,log:()=>Qq,logGroup:()=>sQ,reset:()=>iQ,table:()=>Jq,warn:()=>dV,warnOnce:()=>eQ});var Wf=new Set;function Qq(...e){console.log(...e)}function dV(e,...t){console.warn(`AG Charts - ${e}`,...t)}function hV(e,...t){typeof e=="object"?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function Jq(...e){console.table(...e)}function eQ(e,...t){const i=`Logger.warn: ${e}`;Wf.has(i)||(dV(e,...t),Wf.add(i))}function tQ(e,...t){const i=`Logger.error: ${e}`;Wf.has(i)||(hV(e,...t),Wf.add(i))}function iQ(){Wf.clear()}function sQ(e,t){console.groupCollapsed(e);try{return t()}finally{console.groupEnd()}}function oQ(e){return Array.from(new Set(e))}function uV(e,t,i){if(e>t)return;let s;for(;t>=e;){const o=Math.floor((t+e)/2),n=i(o);n==null?t=o-1:(s=n,e=o+1)}return s}function nQ(e,t=0,i){const{leading:s=!1,trailing:o=!0,maxWait:n=1/0}={};let r,a;if(n<t)throw new Error("Value of maxWait cannot be lower than waitMs.");function l(...c){if(s&&!a){a=Date.now(),r=setTimeout(()=>a=null,t),e(...c);return}let d=t;if(n!==1/0&&a){const h=Date.now()-a;t>n-h&&(d=n-h)}clearTimeout(r),a??(a=Date.now()),r=setTimeout(()=>{a=null,o&&e(...c)},d)}return Object.assign(l,{cancel(){clearTimeout(r),a=null}})}function*rQ(...e){for(const t of e)yield*t}function os(e){return e!=null}function aQ(e){return Array.isArray(e)}function jf(e){return e instanceof Date}function Kw(e){return jf(e)&&!isNaN(Number(e))}function ui(e){return typeof e=="object"&&e!==null&&!aQ(e)}function lQ(e){return typeof e=="string"}function ri(e){return typeof e=="number"}function gc(e){return Number.isFinite(e)}var{CartesianAxis:wP,Chart:cQ,ChartAxisDirection:bg,LinearScale:dQ,PolarAxis:hQ,isBetweenAngles:qy,normalizeAngle360Inclusive:uQ,sectorBox:pQ}=L;function gQ(e){return e.type==="radial-gauge"}function fQ(e){return e.type==="linear-gauge"}var xR=class extends cQ{getChartType(){return"gauge"}updateRadialGauge(e,t){const i=this.axes.find(M=>M.direction===bg.X);if(!(i instanceof hQ))return;i.computeRange();const s=e.x,o=s+e.width,n=e.y,r=n+e.height,[a,l]=i.range,d=uQ(l-a)>Math.PI,h=d||qy(1.5*Math.PI,a,l),u=d||qy(0*Math.PI,a,l),p=d||qy(.5*Math.PI,a,l),g=d||qy(1*Math.PI,a,l);let f;g&&!u?f="right":!g&&u?f="left":f="center";let y;h&&!p?y="bottom":!h&&p?y="top":y="middle";const m=pQ({startAngle:a,endAngle:l,innerRadius:0,outerRadius:.5}),C=-(m.x+m.width/2)*2,b=-(m.y+m.height/2)*2,{minimumRadius:S=0,maximumRadius:A}=t,R=Math.max(.5*Math.min(e.width/m.width,e.height/m.height),0);let I=Math.min(A??1/0,Math.max(R,S??0));const w=8;for(let M=0;M<w;M+=1){const T=I<=S||M===w-1,E=e.x+e.width/2+C*I,P=e.y+e.height/2+b*I;i.translation.x=E,i.translation.y=P,i.gridLength=I,i.calculateLayout();const N=i.computeLabelsBBox({hideWhenNecessary:T},e);if(T)break;let F=0;if(N!=null){const _=N.x+E,W=_+N.width,z=N.y+P,U=z+N.height;F=Math.max(n-z,s-_,U-r,W-o,0)}if(F>0)I=Math.max(I-F,S);else break}i.translation.x=e.x+e.width/2+C*I,i.translation.y=e.y+e.height/2+b*I,t.centerX=e.width/2+C*I,t.centerY=e.height/2+b*I,t.radius=I,t.textAlign=f,t.verticalAlign=y,(I===0||I>R)&&et.warnOnce("There was insufficient space to display the Radial Gauge.")}updateLinearGauge(e,t){const i=this.axes.find(m=>m.direction===bg.X),s=this.axes.find(m=>m.direction===bg.Y);if(!(i instanceof wP)||!(s instanceof wP))return e;const{horizontal:o,thickness:n}=t;let r=0,a=0;const l=new dQ,c=o?i:s;l.domain=[0,100],l.range=c.range;const d=l.ticks({nice:c.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0});o?r=t.computeInset(bg.X,d):a=t.computeInset(bg.Y,d);const h=e.width-Math.abs(r),u=e.height-Math.abs(a),{width:p,height:g}=o?{width:Math.max(h,0),height:Math.max(Math.min(u,n),0)}:{width:Math.max(Math.min(h,n),0),height:Math.max(u,0)},f=e.x+(h-p)/2+Math.max(r,0),y=e.y+(u-g)/2-Math.min(a,0);i.range=[0,p],i.gridLength=p,i.calculateLayout(),i.translation.x=f,i.translation.y=y+(i.position==="bottom"?n:0),s.range=[0,g],s.gridLength=g,s.calculateLayout(),s.translation.x=f+(s.position==="right"?n:0),s.translation.y=y,t.originX=f-e.x,t.originY=y-e.y,(p===0||g===0)&&et.warnOnce("There was insufficient space to display the Linear Gauge.")}performLayout(e){const{seriesRoot:t,annotationRoot:i,series:s,seriesArea:o}=this,{layoutBox:n}=e,r=n.clone();n.shrink(o.padding.toJson());const a=this.series[0];gQ(a)?this.updateRadialGauge(n,a):fQ(a)&&this.updateLinearGauge(n,a),this.axes.forEach(l=>l.update()),this.seriesRect=r.clone().translate(r.x-n.x,r.y-n.y),this.animationRect=n,t.visible=s.some(l=>l.visible);for(const l of[t,i])l.translationX=Math.floor(n.x),l.translationY=Math.floor(n.y);this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:t.visible,rect:r,paddedRect:n}})}getAriaLabel(){const e=[],t=this.getCaptionText();t.length!==0&&e.push(t);for(const s of this.series)e.push(s.getCaptionText());const i=e.join(". ");return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i})}};xR.className="GaugeChart";xR.type="gauge";var{isAgGaugeChartOptions:mQ}=L,yQ={type:"chart",name:"gauge",detect:mQ,create(e,t){return new xR(e,t)}},{Chart:vQ}=L,wR=class extends vQ{getChartType(){return"hierarchy"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e;s.shrink(this.seriesArea.padding.toJson());const o=s.clone();this.seriesRect=o,this.animationRect=o;for(const n of[t,i])n.translationX=Math.floor(o.x),n.translationY=Math.floor(o.y);t.visible=this.series[0].visible,t.setClipRect(o.clone()),this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:o,paddedRect:o}})}getAriaLabel(){const e=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:e})}};wR.className="HierarchyChart";wR.type="hierarchy";var{isAgHierarchyChartOptions:CQ}=L,bQ={type:"chart",name:"hierarchy",detect:CQ,create(e,t){return new wR(e,t)}},{Chart:SQ}=L,MR=class extends SQ{getChartType(){return"standalone"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e;s.shrink(this.seriesArea.padding.toJson());const o=s.clone();this.seriesRect=o,this.animationRect=o;for(const n of[t,i])n.translationX=Math.floor(s.x),n.translationY=Math.floor(s.y);t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:o,paddedRect:s}})}getAriaLabel(){const e=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:e})}};MR.className="StandaloneChart";MR.type="standalone";var{isAgStandaloneChartOptions:xQ}=L,wQ={type:"chart",name:"standalone",detect:xQ,create(e,t){return new MR(e,t)}},{Chart:MQ,MercatorScale:MP,NumberAxis:DP}=L;function AP(e){return e.type==="map-shape"||e.type==="map-line"||e.type==="map-marker"||e.type==="map-shape-background"||e.type==="map-line-background"}var DR=class extends MQ{constructor(e,t){super(e,t),this.xAxis=new DP(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new DP(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}async updateData(){await super.updateData();const{topology:e}=this.getOptions();this.series.forEach(t=>{AP(t)&&t.setChartTopology(e)})}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e;s.shrink(this.seriesArea.padding.toJson());const o=s.clone();this.seriesRect=o,this.animationRect=o;const n=this.series.filter(AP),r=n.reduce((c,d)=>{if(!d.visible)return c;const h=d.topologyBounds;return h==null?c:c==null?h:(c.merge(h),c)},void 0);let a;if(r!=null){const{lon0:c,lat0:d,lon1:h,lat1:u}=r,p=[[c,d],[h,u]],g=MP.bounds(p),{width:f,height:y}=o,m=Math.min(f/g.width,y/g.height),C=g.width*m,b=g.height*m,S=(f-C)/2,A=(y-b)/2,R=S,I=A,w=S+C,M=A+b,T=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),E=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),P=(w-R)/(T.max-T.min),N=R-P*T.min,F=(M-I)/(1-E.min-(1-E.max)),_=I-F*(1-E.max);a=new MP(p,[[N,_],[N+P,_+F]])}n.forEach(c=>{c.scale=a});const l=this.series.some(c=>c.visible);t.visible=l;for(const c of[t,i])c.translationX=Math.floor(o.x),c.translationY=Math.floor(o.y),c.setClipRect(o.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:l,rect:o,paddedRect:o}})}};DR.className="TopologyChart";DR.type="topology";var{isAgTopologyChartOptions:DQ}=L,AQ={type:"chart",name:"topology",detect:DQ,create(e,t){return new DR(e,t)}},{BOOLEAN:IQ,POSITIVE_NUMBER:RQ,ObserveChanges:pV,Validate:gV}=L,AR=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,e.animationManager.skip(!1)}};v([pV((e,t)=>{e.ctx.animationManager.skip(!t)}),gV(IQ)],AR.prototype,"enabled");v([pV((e,t)=>{e.ctx.animationManager.defaultDuration=t}),gV(RQ,{optional:!0})],AR.prototype,"duration");var kQ={type:"root",optionsKey:"animation",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new AR(e),themeTemplate:{animation:{enabled:!0}}},TQ='<div contenteditable="plaintext-only" class="ag-charts-text-input__textarea" tabindex="0"></div>',{focusCursorAtEnd:LQ}=L,IP="text-input",RP="canvas-overlay",EQ=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=e.domManager.addChild(RP,IP),this.element.classList.add("ag-charts-text-input"),this.destroyFns.push(()=>e.domManager.removeChild(RP,IP))}setKeyDownHandler(e){this.element.addEventListener("keydown",e),this.destroyFns.push(()=>this.element.removeEventListener("keydown",e))}show(e){this.element.innerHTML=TQ;const t=this.element.firstElementChild;L.setAttribute(t,"data-preventdefault",!1),t.isContentEditable||(t.contentEditable="true"),t.setAttribute("placeholder",this.ctx.localeManager.t(e.placeholderText??"inputTextareaPlaceholder")),e.styles?.placeholderColor&&t.style.setProperty("--placeholder-text-color",e.styles?.placeholderColor),t.innerText=e.text??"",t.style.color=e.styles?.color??"inherit",t.style.fontFamily=e.styles?.fontFamily??"inherit",t.style.fontSize=e.styles?.fontSize?`${e.styles.fontSize}px`:"inherit",t.style.fontStyle=e.styles?.fontStyle??"inherit",t.style.fontWeight=typeof e.styles?.fontWeight=="number"?`${e.styles.fontWeight}`:e.styles?.fontWeight??"inherit",LQ(t),t.addEventListener("input",()=>{this.updatePosition(),e.onChange?.(this.getValue(),this.getBBox())}),t.addEventListener("click",i=>{i.stopPropagation()}),e.layout&&(this.layout=e.layout,this.updatePosition()),e.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(e){this.element.firstElementChild&&(this.element.firstElementChild.style.color=e)}updateFontSize(e){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${e}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:e}=this,t=e.firstElementChild;if(!t)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:s,getTextInputCoords:o,getTextPosition:n,alignment:r,textAlign:a}=this.layout;e.style.setProperty("width",s?`${s}px`:"unset");const l=t.getBoundingClientRect(),c=o(l.height);let d=c.x;r==="center"?d-=(s??l.width)/2:r==="right"&&(d-=s??l.width);const h=n();let u=c.y;h==="center"?u-=l.height/2:h==="bottom"&&(u-=l.height),e.style.setProperty("top",`${u}px`),e.style.setProperty("left",`${d}px`),e.style.setProperty("max-width",`${i.width-d}px`),e.style.setProperty("text-align",r),t.style.setProperty("text-align",a)}getBBox(){const{left:e,top:t,width:i,height:s}=this.element.getBoundingClientRect();return new L.BBox(e,t,i,s)}},{BOOLEAN:PQ,BaseProperties:NQ,Validate:fV,UNION:OQ}=L,FQ=OQ(["x","y","xy"],"an axis type"),IR=class extends NQ{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};v([fV(PQ)],IR.prototype,"enabled");v([fV(FQ,{optional:!0})],IR.prototype,"axes");var RR=(e=>(e.Line="line",e.HorizontalLine="horizontal-line",e.VerticalLine="vertical-line",e.DisjointChannel="disjoint-channel",e.ParallelChannel="parallel-channel",e.FibonacciRetracement="fibonacci-retracement",e.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",e.Callout="callout",e.Comment="comment",e.Note="note",e.Text="text",e.Arrow="arrow",e.ArrowUp="arrow-up",e.ArrowDown="arrow-down",e.DateRange="date-range",e.PriceRange="price-range",e.DatePriceRange="date-price-range",e.QuickDatePriceRange="quick-date-price-range",e))(RR||{}),BQ=Object.values(RR);function GQ(e){for(const t of BQ)if(t===e)return t}var{BOOLEAN:Uf,COLOR_STRING:kR,DATE:Kf,FONT_STYLE:_Q,FONT_WEIGHT:zQ,FUNCTION:VQ,LINE_DASH:HQ,LINE_STYLE:WQ,NUMBER:oh,OBJECT:$f,OR:Yf,POSITIVE_NUMBER:TR,RATIO:mV,STRING:Rc,TEXT_ALIGN:jQ,UNION:VS,BaseProperties:jc,Validate:We,predicateWithMessage:UQ,generateUUID:KQ}=L,$Q=["value","groupPercentage"],Xf=UQ(e=>ui(e)&&Object.keys(e).every(t=>$Q.includes(t)),"objects with grouping value properties such as 'value' or 'groupPercentage'"),Zf=class extends jc{};v([We(Yf(Rc,oh,Kf,Xf))],Zf.prototype,"x");v([We(Yf(Rc,oh,Kf,Xf))],Zf.prototype,"y");var YQ=class extends Es(Dl(bV(jc))){},LR=class extends Es(Dl(ha(NR(Ih(jc))))){constructor(){super(...arguments),this.cornerRadius=2}};v([We(Uf)],LR.prototype,"enabled");v([We(TR)],LR.prototype,"cornerRadius");var XQ=class extends ha(jc){},ZQ=class extends Es(Dl(ha(jc))){},Dh=class extends Ih(jc){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};v([We(Rc)],Dh.prototype,"label");v([We(VS(["top","center","bottom"]),{optional:!0})],Dh.prototype,"position");v([We(VS(["left","center","right"]),{optional:!0})],Dh.prototype,"alignment");var qQ=class extends Ih(jc){},qm=class extends Ih(jc){constructor(){super(...arguments),this.label=""}};v([We(Rc)],qm.prototype,"label");v([We(VS(["top","inside","bottom"]),{optional:!0})],qm.prototype,"position");v([We(VS(["left","center","right"]),{optional:!0})],qm.prototype,"alignment");function Ah(e){class t extends JQ(bV(e)){constructor(){super(...arguments),this.id=KQ()}isValidWithContext(s,o){return super.isValid(o)}}return t}function ER(e){class t extends e{constructor(){super(...arguments),this.start=new Zf,this.end=new Zf}}return v([We($f)],t.prototype,"start"),v([We($f)],t.prototype,"end"),t}function yV(e){class t extends e{}return v([We(Yf(Rc,oh,Kf,Xf))],t.prototype,"x"),v([We(Yf(Rc,oh,Kf,Xf))],t.prototype,"y"),t}function vV(e){class t extends e{}return v([We(Yf(Rc,oh,Kf,Xf))],t.prototype,"value"),t}function PR(e){class t extends e{constructor(){super(...arguments),this.background=new XQ}}return v([We($f,{optional:!0})],t.prototype,"background"),t}function Uc(e){class t extends e{constructor(){super(...arguments),this.handle=new ZQ}}return v([We($f,{optional:!0})],t.prototype,"handle"),t}function CV(e){class t extends e{constructor(){super(...arguments),this.axisLabel=new LR}}return v([We($f,{optional:!0})],t.prototype,"axisLabel"),t}function NR(e){class t extends e{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return v([We(TR,{optional:!0})],t.prototype,"padding"),v([We(jQ,{optional:!0})],t.prototype,"textAlign"),v([We(VQ,{optional:!0})],t.prototype,"formatter"),t}function QQ(e){class t extends e{}return t}function OR(e){class t extends e{}return v([We(Uf,{optional:!0})],t.prototype,"extendStart"),v([We(Uf,{optional:!0})],t.prototype,"extendEnd"),t}function JQ(e){class t extends e{}return v([We(Uf,{optional:!0})],t.prototype,"locked"),t}function FR(e){class t extends e{setLocaleManager(s){this.localeManager??(this.localeManager=s)}}return t}function bV(e){class t extends e{}return v([We(Uf,{optional:!0})],t.prototype,"visible"),t}function ha(e){class t extends e{}return v([We(kR,{optional:!0})],t.prototype,"fill"),v([We(mV,{optional:!0})],t.prototype,"fillOpacity"),t}function Es(e){class t extends e{}return v([We(kR,{optional:!0})],t.prototype,"stroke"),v([We(mV,{optional:!0})],t.prototype,"strokeOpacity"),v([We(oh,{optional:!0})],t.prototype,"strokeWidth"),t}function Dl(e){class t extends e{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return v([We(HQ,{optional:!0})],t.prototype,"lineDash"),v([We(oh,{optional:!0})],t.prototype,"lineDashOffset"),v([We(WQ,{optional:!0})],t.prototype,"lineStyle"),t}function Ih(e){class t extends e{constructor(){super(...arguments),this.fontSize=12,this.fontFamily="Verdana, sans-serif"}}return v([We(_Q,{optional:!0})],t.prototype,"fontStyle"),v([We(zQ,{optional:!0})],t.prototype,"fontWeight"),v([We(TR)],t.prototype,"fontSize"),v([We(Rc)],t.prototype,"fontFamily"),v([We(kR,{optional:!0})],t.prototype,"color"),t}function Et(e){return ri(e)||lQ(e)||jf(e)?{value:e,groupPercentage:0}:e??{value:void 0,groupPercentage:0}}var{clampArray:eJ}=L;function cr(e,t){if(e.start==null||e.end==null)return;const i=Ut(e.start,t),s=Ut(e.end,t);if(!(i==null||s==null))return{x1:i.x,y1:i.y,x2:s.x,y2:s.y}}function Ut(e,t){const i=fc(e.x,t.xAxis),s=fc(e.y,t.yAxis);return{x:i,y:s}}function fc(e,t){if(e==null)return 0;const{value:i,groupPercentage:s}=Et(e),{scale:o,snapToGroup:n}=t,r=o.bandwidth===0?o.step??0:o.bandwidth??0,a=n?r/2:r*s;return o.convert(i)+a}function Pt(e,t){const i=qf(e.x,t.xAxis),s=qf(e.y,t.yAxis);return{x:i,y:s}}function qf(e,t){const{scale:i}=t;if(t.continuous&&i.step==null)return t.scaleInvert(e);const s=t.scaleInvertNearest(e),o=i.bandwidth===0?i.step:i.bandwidth??0,n=i.convert(s),r=n+o,a=eJ(e,i.range),l=n===r?0:(a-n)/(r-n);return{value:s,groupPercentage:l}}var{BaseProperties:tJ}=L,BR=class extends Ah(ER(Uc(tJ))){constructor(){super(...arguments),this.snapToAngle=45}isValidWithContext(e,t){return super.isValid(t)}getDefaultColor(e){}getDefaultOpacity(e){}},{STRING:iJ,Validate:sJ}=L,SV=class extends FR(NR(Ih(BR))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}isValidWithContext(e,t){return super.isValid(t)}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=this.text.length==0;let t=this.text;return e&&(t=this.placeholderText??"",this.localeManager&&(t=this.localeManager.t(t))),{text:t,isPlaceholder:e}}getTextInputCoords(e,t){return Ut(this.end,e)}getTextPosition(){return this.position}};v([sJ(iJ)],SV.prototype,"text");var{STRING:oJ,Validate:nJ,Color:kP}=L,rJ={top:6,right:12,bottom:9,left:12},Xn=class extends ha(Es(SV)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(e){return ui(e)&&e.type==="callout"}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=kP.fromString(this.color??"#888888");return new kP(e,t,i,.66).toString()}getPadding(){const{padding:e}=this;return e==null?{...rJ}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),s=this.getPadding(),o=s.left??0,n=s.bottom??0;return{x:i.x+o,y:i.y-n}}};v([nJ(oJ)],Xn.prototype,"type");var{STRING:aJ,BaseProperties:lJ,Validate:cJ}=L,HS=class extends Ah(yV(Uc(NR(Ih(lJ))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}isValidWithContext(e,t){return super.isValid(t)}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=this.text.length==0;return{text:e?this.placeholderText??"":this.text,isPlaceholder:e}}getTextInputCoords(e,t){return Ut(this,e)}getTextPosition(){return this.position}};v([cJ(aJ)],HS.prototype,"text");var{STRING:dJ,Validate:hJ,Color:TP}=L,Qy={top:8,right:14,bottom:8,left:14},Br=class extends ha(Es(HS)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(e){return ui(e)&&e.type==="comment"}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=TP.fromString(this.color??"#888888");return new TP(e,t,i,.66).toString()}getPadding(){const{padding:e,fontSize:t}=this;return e==null?{top:Math.max(t*.4,Qy.top),bottom:Math.max(t*.4,Qy.bottom),left:Math.max(t*.8,Qy.left),right:Math.max(t*.8,Qy.right)}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),s=this.getPadding();return{x:i.x+s.left,y:i.y-s.bottom}}};v([hJ(dJ)],Br.prototype,"type");var{Vec2:md}=L;function Qf(e,t){return e?"dashed":t??"solid"}function xV(e,t){switch(t){case"solid":return[];case"dashed":return[e*4,e*2];case"dotted":return[0,e*2]}}function Np(e,t,i,s){const o=Qf(e,i);return t??e??xV(s??1,o)}function Op(e,t,i){const s=Qf(t,i);return e??s==="dotted"?"round":void 0}function uJ(e,t){const[i,s]=md.from(e),o=t.height,n=md.gradient(s,i,o),r=md.intercept(s,n,o),a=[{x:i.x,y:o??0},{x:i.x,y:o==null?t.height:o-t.height}];if(n===1/0)return a;let l=[md.intersectAtY(n,r,0,o),md.intersectAtY(n,r,t.height,o),md.intersectAtX(n,r,0,o),md.intersectAtX(n,r,t.width,o)];return l=l.filter(c=>c.x>=t.x&&c.x<=t.width&&c.y>=t.y&&c.y<=t.height).sort((c,d)=>c.x===d.x?0:c.x<d.x?-1:1),l.length!==2?a:l}var{BOOLEAN:WS,OBJECT:Fp,STRING:jS,BaseProperties:GR,Validate:Ro}=L,pJ=class extends Es(GR){},_R=class extends Ih(ha(Es(GR))){constructor(){super(...arguments),this.divider=new pJ}};v([Ro(Fp,{optional:!0})],_R.prototype,"divider");var hD=class extends ha(Es(Uc(GR))){constructor(){super(...arguments),this.statistics=new _R}};v([Ro(Fp,{optional:!0})],hD.prototype,"statistics");var Bp=class extends FR(PR(Es(Dl(BR)))){constructor(){super(...arguments),this.direction="both",this.hasDateRange=!1,this.hasPriceRange=!1,this.statistics=new _R,this.getVolume=()=>{},this.text=new Dh}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Np(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Op(this.lineCap,this.lineDash,this.lineStyle)}};v([Ro(Fp,{optional:!0})],Bp.prototype,"statistics");v([Ro(Fp,{optional:!0})],Bp.prototype,"text");function zR(e){class t extends e{constructor(){super(...arguments),this.hasDateRange=!0}}return t}function VR(e){class t extends e{constructor(){super(...arguments),this.hasPriceRange=!0}}return t}var un=class extends zR(Bp){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(e){return ui(e)&&e.type==="date-range"}};v([Ro(jS)],un.prototype,"type");v([Ro(WS,{optional:!0})],un.prototype,"extendAbove");v([Ro(WS,{optional:!0})],un.prototype,"extendBelow");var pn=class extends VR(Bp){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(e){return ui(e)&&e.type==="price-range"}};v([Ro(jS)],pn.prototype,"type");v([Ro(WS,{optional:!0})],pn.prototype,"extendLeft");v([Ro(WS,{optional:!0})],pn.prototype,"extendRight");var Oa=class extends zR(VR(Bp)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(e){return ui(e)&&e.type==="date-price-range"}};v([Ro(jS)],Oa.prototype,"type");var Fo=class extends zR(VR(Bp)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new hD,this.down=new hD,this.direction="both"}static is(e){return ui(e)&&e.type==="quick-date-price-range"}};v([Ro(jS)],Fo.prototype,"type");v([Ro(Fp,{optional:!0})],Fo.prototype,"up");v([Ro(Fp,{optional:!0})],Fo.prototype,"down");var{TextWrapper:gJ,CachedTextMeasurerPool:fJ,BBox:mJ}=L,US=1.38;function wV(e){return{font:{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},textAlign:e.textAlign,textBaseline:e.position=="center"?"middle":e.position,lineHeight:US,avoidOrphans:!1,textWrap:"always"}}function KS(e,t,i){return i?gJ.wrapText(t,{...wV(e),maxWidth:i}):t}function yJ(e,t){const i=wV(e),{lineMetrics:s,width:o}=fJ.measureLines(t,i),n=s.length*(e.fontSize??14)*US;return{width:o,height:n}}function HR(e,t,i,s){let o=s?.width??0,n=s?.height??0;if(!s){const r=e.width!=null?KS(e,t,e.width):t;({width:o,height:n}=yJ(e,r))}return new mJ(i.x,i.y,o,n)}function MV(e,t,i,s,{x:o,y:n}){const{visible:r=!0,fontFamily:a,fontSize:l=14,fontStyle:c,fontWeight:d,textAlign:h}=s,u=l*US,p=s.position=="center"?"middle":s.position,g=i?s.getPlaceholderColor():s.color;e.setProperties({x:o,y:n,visible:r,text:t,fill:g,fontFamily:a,fontSize:l,fontStyle:c,fontWeight:d,textAlign:h,lineHeight:u,textBaseline:p})}var{OBJECT:vJ,STRING:CJ,BaseProperties:bJ,Validate:DV,clamp:SJ}=L,xJ=10,wJ=11,AV=20,MJ=22,DJ=10,IV=AV+DJ,RV=34,AJ=class extends ha(Es(bJ)){},uo=class extends ha(Es(HS)){constructor(){super(...arguments),this.type="note",this.background=new AJ,this.position="bottom",this.alignment="center",this.width=200}static is(e){return ui(e)&&e.type==="note"}getDefaultColor(e){switch(e){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(e){switch(e){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const e=this.padding??xJ;return{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const{width:i,text:s}=this,o=super.getTextInputCoords(e,t),n=this.getPadding().top,r=HR(this,s,o);r.x=SJ(i/2,r.x,e.seriesRect.width-i/2);const a=r.y-IV-n*2,l=r.y+wJ+n*2,c=Math.max(r.height,t);return a-c-RV<0?(r.y=l,this.position="top"):(r.y=a+n,this.position="bottom"),{x:r.x,y:r.y}}};v([DV(CJ)],uo.prototype,"type");v([DV(vJ,{optional:!0})],uo.prototype,"background");var{BaseProperties:IJ}=L,RJ=class extends Ah(yV(Uc(IJ))){isValidWithContext(e,t){return super.isValid(t)}getDefaultColor(e){}getDefaultOpacity(e){}},WR=class kV extends ha(RJ){constructor(){super(...arguments),this.size=32}static is(t){return t instanceof kV}getDefaultColor(t){return t==="fill-color"?this.fill:void 0}getDefaultOpacity(t){return t==="fill-color"?this.fillOpacity:void 0}};function Jf(e,t,i,s){let o=!0;return o&&(o=dr(e,t.start,i,s&&`${s}[start] `)),o&&(o=dr(e,t.end,i,s&&`${s}[end] `)),o}function TV(e,t,i){const s=t.direction==="horizontal"?e.yAxis:e.xAxis,o=uD(t.value,s);if(!o&&i){const{value:n}=Et(t.value);et.warnOnce(`${i}is outside the axis domain, ignoring. - value: [${n}]]`)}return o}function dr(e,t,i,s){if(t.x==null||t.y==null)return s&&et.warnOnce(`${s}requires both an [x] and [y] property, ignoring.`),!1;const o=i?.x===!1?!0:uD(t.x,e.xAxis),n=i?.y===!1?!0:uD(t.y,e.yAxis);if(!o||!n){let r="x & y domains";if(o&&(r="y domain"),n&&(r="x domain"),s){const{value:a}=Et(t.x),{value:l}=Et(t.y);et.warnOnce(`${s}is outside the ${r}, ignoring. - x: [${a}], y: ${l}]`)}return!1}return!0}function uD(e,t){const{domain:i}=t.scale,{value:s}=Et(e);return i&&s!=null&&t.continuous?s>=i[0]&&s<=i.at(-1):!0}function kJ(e){return e?.x!=null&&e?.y!=null}var{OBJECT:LV,STRING:EV,BaseProperties:PV,Validate:$S}=L,Cs=class extends Ah(vV(Uc(CV(Es(Dl(PV)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new Dh}static is(e){return ui(e)&&e.type==="horizontal-line"}isValidWithContext(e,t){return super.isValid(t)&&TV(e,this,t)}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Np(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Op(this.lineCap,this.lineDash,this.lineStyle)}};v([$S(EV)],Cs.prototype,"type");v([$S(LV,{optional:!0})],Cs.prototype,"text");var Gr=class extends Ah(vV(Uc(CV(Es(Dl(PV)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new Dh}static is(e){return ui(e)&&e.type==="vertical-line"}isValidWithContext(e,t){return super.isValid(t)&&TV(e,this,t)}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Np(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Op(this.lineCap,this.lineDash,this.lineStyle)}};v([$S(EV)],Gr.prototype,"type");v([$S(LV,{optional:!0})],Gr.prototype,"text");var{NUMBER:NV,OBJECT:TJ,STRING:LJ,BaseProperties:EJ,Validate:YS}=L,gn=class extends Ah(PR(ER(Uc(OR(Es(Dl(EJ))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new qm,this.snapToAngle=45}static is(e){return ui(e)&&e.type==="disjoint-channel"}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof e.start.y=="number"&&typeof e.end.y=="number"?(e.start.y-=this.startHeight,e.end.y-=this.endHeight):et.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}isValidWithContext(e,t){return super.isValid(t)&&Jf(e,this,{y:!1},t)&&Jf(e,this.bottom,{y:!1},t)}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Np(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Op(this.lineCap,this.lineDash,this.lineStyle)}};v([YS(LJ)],gn.prototype,"type");v([YS(NV)],gn.prototype,"startHeight");v([YS(NV)],gn.prototype,"endHeight");v([YS(TJ,{optional:!0})],gn.prototype,"text");var{OBJECT:PJ,STRING:OV,Validate:jR}=L,XS=class extends FR(QQ(OR(Es(Dl(BR))))){constructor(){super(...arguments),this.text=new Dh}isValidWithContext(e,t){return super.isValid(t)&&Jf(e,this,void 0,t)}getDefaultColor(e){switch(e){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Np(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Op(this.lineCap,this.lineDash,this.lineStyle)}};v([jR(PJ,{optional:!0})],XS.prototype,"text");var Fa=class extends XS{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(e){return ui(e)&&e.type==="arrow"}};v([jR(OV)],Fa.prototype,"type");var Ba=class extends XS{constructor(){super(...arguments),this.type="line"}static is(e){return ui(e)&&e.type==="line"}};v([jR(OV)],Ba.prototype,"type");var{OBJECT:NJ,BOOLEAN:UR,COLOR_STRING:OJ,COLOR_STRING_ARRAY:FJ,Validate:Rh,predicateWithMessage:BJ}=L,GJ=[10,6,4],_J=BJ(e=>gc(e)&&GJ.includes(e),"Number of fibonacci ranges, 10, 6 or 4"),Al=class extends XS{constructor(){super(...arguments),this.label=new qQ,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(e){switch(e){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};v([Rh(NJ,{optional:!0})],Al.prototype,"label");v([Rh(UR,{optional:!0})],Al.prototype,"reverse");v([Rh(UR,{optional:!0})],Al.prototype,"showFill");v([Rh(UR,{optional:!0})],Al.prototype,"isMultiColor");v([Rh(FJ,{optional:!0})],Al.prototype,"strokes");v([Rh(OJ,{optional:!0})],Al.prototype,"rangeStroke");v([Rh(_J,{optional:!0})],Al.prototype,"bands");var{STRING:zJ,OBJECT:VJ,Validate:FV}=L,_r=class extends Al{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new Zf}static is(e){return ui(e)&&e.type==="fibonacci-retracement-trend-based"}};v([FV(zJ)],_r.prototype,"type");v([FV(VJ)],_r.prototype,"endRetracement");var{STRING:HJ,Validate:WJ}=L,Ga=class extends Al{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(e){return ui(e)&&e.type==="fibonacci-retracement"}};v([WJ(HJ)],Ga.prototype,"type");var{NUMBER:jJ,STRING:UJ,OBJECT:BV,BaseProperties:KJ,Validate:ZS}=L,fn=class extends Ah(PR(ER(Uc(OR(Es(Dl(KJ))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new YQ,this.text=new qm,this.snapToAngle=45}static is(e){return ui(e)&&e.type==="parallel-channel"}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof e.start.y=="number"&&typeof e.end.y=="number"?(e.start.y-=this.height,e.end.y-=this.height):et.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}isValidWithContext(e,t){return super.isValid(t)&&Jf(e,this,{y:!1},t)&&Jf(e,this.bottom,{y:!1},t)}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Np(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Op(this.lineCap,this.lineDash,this.lineStyle)}};v([ZS(UJ)],fn.prototype,"type");v([ZS(jJ)],fn.prototype,"height");v([ZS(BV,{optional:!0})],fn.prototype,"middle");v([ZS(BV,{optional:!0})],fn.prototype,"text");var{STRING:$J,Validate:YJ}=L,_a=class extends HS{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(e){return ui(e)&&e.type==="text"}};v([YJ($J)],_a.prototype,"type");function mc(e){return Fo.is(e)}function qS(e){return Ba.is(e)||Cs.is(e)||Gr.is(e)||Fa.is(e)||GV(e)}function Xa(e){return gn.is(e)||fn.is(e)}function GV(e){return Ga.is(e)||_r.is(e)}function Xr(e){return Xn.is(e)||Br.is(e)||uo.is(e)||_a.is(e)}function Qm(e){return un.is(e)||pn.is(e)||Oa.is(e)||Fo.is(e)}function $w(e){return Xr(e)&&!uo.is(e)}function Ql(e){return qS(e)||Xa(e)||Qm(e)&&!Fo.is(e)}function XJ(e){return qS(e)||Xa(e)||Qm(e)||Xn.is(e)||uo.is(e)}function ZJ(e){return uo.is(e)}function qJ(e){return Xa(e)||Qm(e)||Xn.is(e)||Br.is(e)||WR.is(e)}function QJ(e){return Xr(e)&&!uo.is(e)}function Gu(e){return(qS(e)||Xa(e)||Qm(e))&&!mc(e)&&ui(e.text)}function JJ(e,t){"fontSize"in e&&(e.fontSize=t),Gu(e)&&(e.text.fontSize=t)}function _V(e,t){const i=t?.strokeWidth??e.strokeWidth??1,s=t?.type??e.lineStyle,o=s??Qf(e.lineDash,s),n=xV(i,o);e.strokeWidth=i,e.computedLineDash=n,e.lineStyle=o,e.lineCap=o==="dotted"?"round":void 0}function QS(e,t,i,s,o,n){switch(t){case"fill-color":{"fill"in e&&(e.fill=s),"fillOpacity"in e&&(e.fillOpacity=o),"background"in e&&(e.background.fill=s,e.background.fillOpacity=o);break}case"line-color":{"axisLabel"in e&&(e.axisLabel.fill=s,e.axisLabel.fillOpacity=o,e.axisLabel.stroke=s,e.axisLabel.strokeOpacity=o),"fill"in e&&"fillOpacity"in e&&ZJ(e)?(e.fill=s,e.fillOpacity=o):("strokeOpacity"in e&&(e.strokeOpacity=o),"isMultiColor"in e&&"rangeStroke"in e?(e.isMultiColor=n,e.rangeStroke=s):"stroke"in e&&(e.stroke=s));break}case"text-color":{"color"in e&&(e.color=i),Gu(e)&&(e.text.color=s);break}}}var{deepClone:sn}=L,eee=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(RR).map(e=>[e,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:sn(this.colors),fontSizes:sn(this.fontSizes),lineStyles:sn(this.lineStyles),lineTextAlignments:sn(this.lineTextAlignments),lineTextPositions:sn(this.lineTextPositions),fibonacciOptions:sn(this.fibonacciOptions)}}guardMemento(e){return!0}restoreMemento(e,t,i){this.colors=sn(i.colors),this.fontSizes=sn(i.fontSizes),this.lineStyles=sn(i.lineStyles),this.lineTextAlignments=sn(i.lineTextAlignments),this.lineTextPositions=sn(i.lineTextPositions),this.fibonacciOptions=sn(i.fibonacciOptions)}setDefaultColor(e,t,i,s,o,n){this.colors.get(e)?.set(t,[i,s,o,n])}setDefaultFontSize(e,t){this.fontSizes.set(e,t)}setDefaultLineStyleType(e,t){const i=this.lineStyles.get(e);i?i.type=t:this.lineStyles.set(e,{type:t})}setDefaultLineStyleWidth(e,t){const i=this.lineStyles.get(e);i?i.strokeWidth=t:this.lineStyles.set(e,{strokeWidth:t})}setDefaultLineTextAlignment(e,t){this.lineTextAlignments.set(e,t)}setDefaultLineTextPosition(e,t){this.lineTextPositions.set(e,t)}setDefaultFibonacciOptions(e,t,i){if(e!="fibonacci-retracement"&&e!="fibonacci-retracement-trend-based")return;const s=this.fibonacciOptions.get(e);s[t]=i,this.fibonacciOptions.set(e,s)}applyDefaults(e){for(const[t,i]of this.colors)if(e.type===t)for(const[s,[o,n,r,a]=[]]of i)o&&n&&r!=null&&a!=null&&QS(e,s,o,n,r,a);for(const[t,i]of this.fontSizes)e.type!==t||i==null||JJ(e,i);for(const[t,i]of this.lineStyles)e.type!==t||i==null||_V(e,i);for(const[t,i]of this.lineTextPositions)e.type!==t||i==null||(e.text.position=i);for(const[t,i]of this.lineTextAlignments)e.type!==t||i==null||(e.text.alignment=i);for(const[t,i]of this.fibonacciOptions)e.type!==t||i==null||Object.entries(i).forEach(([s,o])=>{o!=null&&e.set({[s]:o})})}},tee='<div class="ag-charts-color-picker__palette" tabindex="0"></div><div class="ag-charts-color-picker__color-row"><button class="ag-charts-color-picker__multi-color-button" tabindex="0" type="button"></button> <input class="ag-charts-color-picker__hue-input" tabindex="0" type="range" min="0" max="360" value="0"></div><input class="ag-charts-color-picker__alpha-input" tabindex="0" type="range" min="0" max="1" value="1" step="0.01"> <label class="ag-charts-color-picker__color-field"><span class="ag-charts-color-picker__color-label">Color</span> <input class="ag-charts-color-picker__color-input" tabindex="0" value="#000"></label>',{Color:pD,clamp:Jy,createElement:iee}=L,LP=e=>{try{const t=pD.fromString(e),[i,s,o]=t.toHSB();return[i,s,o,t.a]}catch{return}},zV=class extends L.AnchoredPopover{constructor(e,t){super(e,"color-picker",t),this.hasChanged=!1,this.hideFns.push(()=>{this.hasChanged&&this.onChangeHide?.()})}show(e){this.hasChanged=!1,this.onChangeHide=e.onChangeHide;const{element:t,initialFocus:i}=this.createColorPicker(e),s=this.showWithChildren([t],{initialFocus:i,...e});s.classList.add("ag-charts-color-picker"),s.setAttribute("role","dialog")}createColorPicker(e){let t=e.isMultiColor??!1,[i,s,o,n]=LP(e.color??"#f00")??[0,1,.5,1];n=e.opacity??n;const r=iee("div","ag-charts-color-picker__content");r.innerHTML=tee,r.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const a=r.querySelector(".ag-charts-color-picker__palette"),l=r.querySelector(".ag-charts-color-picker__hue-input"),c=r.querySelector(".ag-charts-color-picker__multi-color-button"),d=r.querySelector(".ag-charts-color-picker__alpha-input"),h=r.querySelector(".ag-charts-color-picker__color-input"),u=r.querySelector(".ag-charts-color-picker__color-label");c.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!e.hasMultiColorOption);const p=(m=!0)=>{const b=pD.fromHSB(i,s,o,n).toHexString();if(r.style.setProperty("--h",`${i}`),r.style.setProperty("--s",`${s}`),r.style.setProperty("--v",`${o}`),r.style.setProperty("--a",`${n}`),r.style.setProperty("--color",b.slice(0,7)),r.style.setProperty("--color-a",b),l.value=`${i}`,d.value=`${n}`,d.classList.toggle("ag-charts-color-picker__alpha-input--opaque",n===1),c.classList.toggle("ag-charts-color-picker__multi-color-button--active",t),u.classList.toggle("ag-charts-color-picker__color-label--multi-color",t),document.activeElement!==h&&(h.value=t?"Multi Colour":b.toUpperCase()),m||e.color==null){const S=pD.fromHSB(i,s,o,1).toHexString();e.onChange?.(b,S,n,t)}m&&(this.hasChanged=!0)};p(!1);const g=m=>m.preventDefault(),f=m=>m.stopPropagation(),y=m=>{m.preventDefault();const C=m.currentTarget;C.focus();const b=C.getBoundingClientRect(),S=({pageX:R,pageY:I})=>{t=!1,s=Math.min(Math.max((R-b.left)/b.width,0),1),o=1-Math.min(Math.max((I-b.top)/b.height,0),1),p()},A=()=>{window.removeEventListener("pointermove",S)};S(m),window.addEventListener("pointermove",S),window.addEventListener("pointerup",A,{once:!0})};return r.addEventListener("mousedown",f),r.addEventListener("touchstart",f),r.addEventListener("touchmove",f),r.addEventListener("keydown",m=>{switch(m.stopPropagation(),m.key){case"Enter":case"Escape":this.hide();break;default:return}m.preventDefault()}),a.addEventListener("pointerdown",y),a.addEventListener("touchstart",g,{passive:!1}),a.addEventListener("touchmove",g,{passive:!1}),a.addEventListener("keydown",m=>{if(m.key==="ArrowLeft")s=Jy(0,s-.01,1);else if(m.key==="ArrowRight")s=Jy(0,s+.01,1);else if(m.key==="ArrowUp")o=Jy(0,o+.01,1);else if(m.key==="ArrowDown")o=Jy(0,o-.01,1);else return;m.preventDefault(),p()}),c.addEventListener("click",()=>{t=!t,p()}),l.addEventListener("input",m=>{t=!1,i=m.currentTarget.valueAsNumber??0,p()}),d.addEventListener("input",m=>{t=!1,n=m.currentTarget.valueAsNumber??0,p()}),h.addEventListener("input",m=>{t=!1;const C=LP(m.currentTarget.value);C!=null&&([i,s,o,n]=C,p())}),h.addEventListener("blur",()=>p()),h.addEventListener("keydown",m=>{m.key==="Enter"&&(m.currentTarget.blur(),p())}),{element:r,initialFocus:a}}};function EP(e){return!(e instanceof L.LogScale)&&!(e instanceof L.BandScale)}var see=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:EP},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:EP}],oee=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],nee=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],ree=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],aee=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],lee=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],VV=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],cf=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],HV=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{ARRAY:cee,BOOLEAN:dee,NUMBER:hee,OBJECT:uee,STRING:pee,UNION:gee,Color:PP,FloatingToolbar:fee,Listeners:mee,Menu:Yw,PropertiesArray:yee,ToolbarButtonProperties:NP,ToolbarButtonWidget:vee,Validate:kh}=L,Gp=class extends NP{constructor(){super(...arguments),this.checkedOverrides=new NP}};v([kh(gee(["line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings","lock"]))],Gp.prototype,"value");v([kh(uee,{optional:!0})],Gp.prototype,"checkedOverrides");v([kh(pee,{optional:!0})],Gp.prototype,"color");v([kh(hee,{optional:!0})],Gp.prototype,"strokeWidth");v([kh(Boolean,{optional:!0})],Gp.prototype,"isMultiColor");var Cee=class extends vee{update(e){super.update(e),e.value==="line-stroke-width"&&this.updateLineStrokeWidth(e),(e.value==="fill-color"||e.value==="line-color"||e.value==="text-color")&&this.updateFillColor(e)}updateFillColor(e){const t=this.getElement();t.classList.add("ag-charts-annotations__color-picker-button"),t.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",e.isMultiColor),t.style.setProperty("--color",e.color??null)}updateLineStrokeWidth(e){const t=this.getElement();t.classList.add("ag-charts-annotations__stroke-width-button"),t.style.setProperty("--stroke-width",`${e.strokeWidth}px`)}},bee=class extends fee{createButtonWidget(){return new Cee(this.localeManager)}},KR=class extends L.BaseProperties{constructor(e,t){super(),this.ctx=e,this.getActiveDatum=t,this.enabled=!0,this.buttons=new yee(Gp),this.destroyFns=[],this.events=new mee,this.visibleButtons=[],this.toolbar=new bee(this.ctx,"annotation-options"),this.colorPicker=new zV(this.ctx),this.textSizeMenu=new Yw(this.ctx,"text-size"),this.lineStyleTypeMenu=new Yw(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new Yw(this.ctx,"annotations-line-stroke-width"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),e.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),e.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>this.colorPicker.destroy())}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){for(const e of this.destroyFns)e()}addListener(e,t){return this.events.addListener(e,t)}show(){this.toolbar.show({})}hide(){this.toolbar.hide()}updateButtons(e){const t={"line-style-type":Ql(e),"line-stroke-width":Ql(e),"line-color":XJ(e),"text-color":QJ(e),"fill-color":qJ(e),"text-size":$w(e),settings:Gu(e),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(i=>t[i.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(e)}setAnchorScene(e){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(e.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.dispatch("hid-overlays")}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(e){this.updateColorPickerColor("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("text-color",e.getDefaultColor("text-color"),e.getDefaultOpacity("text-color"),"isMultiColor"in e&&e?.isMultiColor)}updateColorPickerColor(e,t,i,s){if(t!=null&&i!=null){const{r:o,g:n,b:r}=PP.fromString(t);t=PP.fromArray([o,n,r,i]).toHexString()}this.updateButtonByValue(e,{color:t,isMultiColor:s})}updateFontSize(e){this.updateButtonByValue("text-size",{label:e!=null?String(e):void 0})}updateLineStyleType(e){this.updateButtonByValue("line-style-type",{icon:e.icon})}updateStrokeWidth(e){this.updateButtonByValue("line-stroke-width",{label:e.label,strokeWidth:e.value})}dispatch(e,t){this.events.dispatch(e,t)}onButtonPress({event:e,button:t}){const i=this.getActiveDatum();if(i)switch(this.hideOverlays(),t.value){case"line-style-type":{const s=Ql(i)?Qf(i.lineDash,i.lineStyle):void 0;this.lineStyleTypeMenu.show({items:cf,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:s,sourceEvent:e.sourceEvent,onPress:o=>this.onLineStyleTypeMenuPress(o,i),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const s=Ql(i)?i.strokeWidth:void 0;this.lineStrokeWidthMenu.show({items:VV,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:s,sourceEvent:e.sourceEvent,onPress:o=>this.onLineStrokeWidthMenuPress(o,i),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":{this.toolbar.toggleActiveButtonByIndex(t.index),this.colorPicker.show({color:i?.getDefaultColor(t.value),opacity:i?.getDefaultOpacity(t.value),sourceEvent:e.sourceEvent,hasMultiColorOption:"isMultiColor"in i,isMultiColor:"isMultiColor"in i&&i?.isMultiColor,onChange:i!=null?this.onColorPickerChange.bind(this,t.value,i):void 0,onChangeHide:(s=>{this.dispatch("saved-color",{type:i.type,colorPickerType:t.value,color:i.getDefaultColor(s)})}).bind(this,t.value)});break}case"text-size":{const s=Xr(i)?i.fontSize:void 0;this.textSizeMenu.show({items:HV,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:s,sourceEvent:e.sourceEvent,onPress:o=>this.onTextSizeMenuPress(o,i),class:"ag-charts-annotations__text-size-menu"});break}case"delete":{this.dispatch("pressed-delete");break}case"lock":{i.locked=!i.locked,this.refreshButtons(i),this.dispatch("pressed-lock");break}case"settings":{this.toolbar.toggleActiveButtonByIndex(t.index),this.dispatch("pressed-settings",e);break}}}onToolbarMoved(e){const{buttonBounds:t,popoverBounds:i}=e,s={x:i.x,y:i.y+i.height+4},o={y:i.y-4};this.colorPicker.setAnchor(s,o);for(const[n,r]of t.entries()){const a=this.visibleButtons.at(n);if(!a)continue;const l={x:r.x,y:r.y+r.height-1},c={y:r.y};switch(a.value){case"line-stroke-width":this.lineStrokeWidthMenu.setAnchor(l,c);break;case"line-style-type":this.lineStyleTypeMenu.setAnchor(l,c);break;case"text-size":this.textSizeMenu.setAnchor(l,c);break}}}onColorPickerChange(e,t,i,s,o,n){this.dispatch("updated-color",{type:t.type,colorPickerType:e,colorOpacity:i,color:s,opacity:o,isMultiColor:n}),this.updateColorPickerColor(e,i,o,n)}onTextSizeMenuPress(e,t){if(!$w(t))return;const i=e.value;this.dispatch("updated-font-size",{type:t.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(e,t){if(!Ql(t))return;const i=e.value;this.dispatch("updated-line-style",{type:t.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(e)}onLineStrokeWidthMenuPress(e,t){if(!Ql(t))return;const i=e.value;this.dispatch("updated-line-width",{type:t.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(e)}refreshButtons(e){const t=e.locked??!1;for(const[i,s]of this.visibleButtons.entries())s&&(s.value==="lock"?(this.toolbar.toggleSwitchCheckedByIndex(i,t),this.updateButtonByIndex(i,t?s.checkedOverrides.toJson():s.toJson())):this.toolbar.toggleButtonEnabledByIndex(i,!t));$w(e)&&this.updateFontSize(e.fontSize),this.updateColors(e),this.updateLineStyles(e)}updateLineStyles(e){if(!Ql(e))return;const t=e.strokeWidth??1,i=Qf(e.lineDash,e.lineStyle);this.updateStrokeWidth({strokeWidth:t,value:t,label:String(t)}),this.updateLineStyleType(cf.find(s=>s.value===i)??cf[0])}updateButtonByValue(e,t){const i=this.visibleButtons.findIndex(s=>s.value===e);i!==-1&&this.updateButtonByIndex(i,t)}updateButtonByIndex(e,t){const i=this.visibleButtons.at(e);i&&this.toolbar.updateButtonByIndex(e,{...i.toJson(),...t,value:t.value??i.value})}};v([kh(dee)],KR.prototype,"enabled");v([kh(cee)],KR.prototype,"buttons");var{StateMachine:OP,StateMachineProperty:$R,Vec2:FP,Debug:See}=L,pi=class extends OP{constructor(e){const t=({context:i})=>{this.node?.drag(this.datum,this.offset,i,this.snapping),e.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:i,context:s})=>{this.hasMoved=!1,this.dragStart=i,this.offset=i,this.node?.dragStart(this.datum,i,s)}}},dragging:{keyDown:t,keyUp:t,drag:({offset:i,context:s})=>{this.hasMoved=FP.lengthSquared(FP.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,s,this.snapping),e.update()},dragEnd:{target:OP.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&e.recordAction("Move annotation"),e.update()}}}}),this.debug=See.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};v([$R()],pi.prototype,"snapping");v([$R()],pi.prototype,"datum");v([$R()],pi.prototype,"node");var{STRING:xee,Validate:wee}=L,Jl=class extends WR{constructor(){super(...arguments),this.type="arrow-down"}static is(e){return ui(e)&&e.type==="arrow-down"}};v([wee(xee)],Jl.prototype,"type");var WV=class jV extends L.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(t){const{handle:i,locked:s}=this;return s?{point:{x:i.x,y:i.y},offset:{x:0,y:0}}:{point:t,offset:{x:t.x-i.x,y:t.y-i.y}}}toggleActive(t){this.active=t,t||(this.handle.strokeWidth=jV.INACTIVE_STROKE_WIDTH)}toggleHovered(t){this.glow.visible=!this.locked&&t,this.glow.dirtyPath=!0}toggleDragging(t){this.locked||(this.handle.visible=!t,this.glow.visible=this.glow.visible&&!t,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(t){this.locked=t}getCursor(){}containsPoint(t,i){return this.handle.containsPoint(t,i)}};WV.INACTIVE_STROKE_WIDTH=2;var wc=WV,YR=class UV extends wc{constructor(){super(),this.handle=new L.Marker({shape:"circle"}),this.glow=new L.Marker({shape:"circle"}),this.append([this.handle]),this.handle.size=UV.HANDLE_SIZE,this.handle.strokeWidth=wc.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(t){this.handle.setProperties({...t,strokeWidth:wc.INACTIVE_STROKE_WIDTH})}drag(t){return{point:t,offset:{x:0,y:0}}}};YR.HANDLE_SIZE=7;YR.GLOW_SIZE=9;var ec=YR,JS=class lo extends wc{constructor(){super(),this.handle=new L.Rect,this.glow=new L.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=lo.CORNER_RADIUS,this.handle.width=lo.HANDLE_SIZE,this.handle.height=lo.HANDLE_SIZE,this.handle.strokeWidth=wc.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=lo.CORNER_RADIUS,this.glow.width=lo.GLOW_SIZE,this.glow.height=lo.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){if(super.toggleLocked(t),t){const i=(lo.HANDLE_SIZE-ec.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=i,this.handle.y+=i,this.handle.width=ec.HANDLE_SIZE,this.handle.height=ec.HANDLE_SIZE,this.glow.width=ec.GLOW_SIZE,this.glow.height=ec.GLOW_SIZE}else this.handle.cornerRadius=lo.CORNER_RADIUS,this.handle.width=lo.HANDLE_SIZE,this.handle.height=lo.HANDLE_SIZE,this.glow.width=lo.GLOW_SIZE,this.glow.height=lo.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(t){if(this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked){delete t.fill,delete t.strokeWidth;const i=(lo.HANDLE_SIZE-ec.HANDLE_SIZE)/2;t.x-=i,t.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(t),this.glow.setProperties({...t,x:(t.x??this.glow.x)-2,y:(t.y??this.glow.y)-2,strokeWidth:0,fill:t.stroke})}drag(t){return this.locked?{point:t,offset:{x:0,y:0}}:this.gradient==="vertical"?{point:{x:t.x,y:this.handle.y},offset:{x:t.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:t.y},offset:{x:0,y:t.y-this.handle.y}}}getCursor(){if(!this.locked)return this.gradient==="vertical"?"col-resize":"row-resize"}};JS.HANDLE_SIZE=12;JS.GLOW_SIZE=16;JS.CORNER_RADIUS=4;var Ru=JS,XR=class jg extends wc{constructor(){super(),this.handle=new L.Marker({shape:"circle"}),this.glow=new L.Marker({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=jg.HANDLE_SIZE,this.handle.strokeWidth=wc.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=jg.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){super.toggleLocked(t),t?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=ec.HANDLE_SIZE,this.glow.size=ec.GLOW_SIZE):(this.handle.size=jg.HANDLE_SIZE,this.glow.size=jg.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(t){this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked&&(delete t.fill,delete t.strokeWidth),this.handle.setProperties(t),this.glow.setProperties({...t,strokeWidth:0,fill:t.stroke})}getCursor(){return"pointer"}};XR.HANDLE_SIZE=11;XR.GLOW_SIZE=17;var Kt=XR,{ZIndexMap:Mee}=L,$i=class extends L.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=Mee.CHART_ANNOTATION}static isCheck(e,t){return ui(e)&&Object.hasOwn(e,"type")&&e.type===t}toggleHovered(e){this.toggleHandles(e)}*nonHandleChildren(){for(const e of this.children())e instanceof wc||(yield e)}computeBBoxWithoutHandles(){return L.Transformable.toCanvas(this,L.Group.computeChildrenBBox(this.nonHandleChildren()))}updateNode(e,t,i){if(!i&&t){this.removeChild(t);return}return i&&t==null&&(t=new e,this.appendChild(t)),t}},{Vec2:KV,toRadians:Dee}=L;function em(e,t,i=!1,s,o=1){if(!i)return Pt(e,t);const n=s?Ut(s,t):KV.origin();return Pt(Jm(e,n,o),t)}function Jm({x:e,y:t},i,s,o=1){const{x:n,y:r}=i,a=Math.sqrt(Math.pow(e-n,2)+Math.pow(t-r,2)),l=Math.atan2(t-r,e-n),c=Dee(s),d=Math.round(l/c)*c;return{x:n+a*Math.cos(d),y:r+a*Math.sin(d)*o}}function ex(e,t){const i={};return Object.entries(e).forEach(([s,o])=>{i[s]=Ut(o,t)}),i}function ZR(e,t,i){const s=[],o={};Object.entries(e).forEach(([d,h])=>{const u=KV.add(h,t);s.push(u),o[d]=Pt(u,i)});const{xAxis:n,yAxis:r}=i,a=(d,h,u)=>h>=d&&h<=u,l=s.every(d=>a(n.bounds.x,d.x,n.bounds.x+n.bounds.width)),c=s.every(d=>a(r.bounds.y,d.y,r.bounds.y+r.bounds.height));return{vectors:o,translateX:l,translateY:c}}var{Vec2:Xw}=L,$V=class extends $i{constructor(){super(...arguments),this.handle=new Kt,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=Ut(e,t);this.updateHandle(e,i),this.anchor=this.updateAnchor(e,i,t)}dragStart(e,t,i){this.dragState={offset:t,...ex({handle:e},i)}}drag(e,t,i){const{dragState:s}=this;if(e.locked||!s)return;const o=Xw.add(s.handle,Xw.sub(t,s.offset)),n=Pt(o,i);dr(i,n)&&(e.x=n.x,e.y=n.y)}translate(e,t,i){const s=Xw.add(Ut(e,i),t),o=Pt(s,i);dr(i,o)&&(e.x=o.x,e.y=o.y)}toggleHandles(e){this.handle.visible=!!e,this.handle.toggleHovered(this.activeHandle==="handle")}toggleActive(e){this.toggleHandles(e),this.handle.toggleActive(e)}stopDragging(){this.handle.toggleDragging(!1)}copy(e,t,i){const s=Ut(e,i),o=Pt({x:s.x-30,y:s.y-30},i);return t.x=o.x,t.y=o.y,t}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{handle:i}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="handle",!0):!1}getNodeAtCoords(e,t){if(this.handle.containsPoint(e,t))return"handle"}updateHandle(e,t,i){const{x:s,y:o}=this.getHandleCoords(e,t,i),n=this.getHandleStyles(e);this.handle.update({...n,x:s,y:o}),this.handle.toggleLocked(e.locked??!1)}updateAnchor(e,t,i){const s=this.getHandleCoords(e,t);return{x:s.x+i.seriesRect.x,y:s.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i){return{x:t.x,y:t.y}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},YV=class extends $V{constructor(){super(),this.append([this.handle])}update(e,t){super.update(e,t);const i=Ut(e,t);this.updateShape(e,i)}updateShape(e,t){this.updateShapeStyles(e),this.updateShapePath(e,t)}updateShapeStyles(e){const{shape:t}=this;t.fill=e.fill,t.fillOpacity=e.fillOpacity??1}updateShapePath(e,t){const{shape:i}=this;i.x=t.x,i.y=t.y,i.size=e.size}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}getNodeAtCoords(e,t){return this.shape.containsPoint(e,t)?"shape":super.getNodeAtCoords(e,t)}},XV=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function ZV(e){L.drawMarkerUnitPolygon(e,XV)}ZV.anchor={x:.5,y:0};var ev=class extends YV{constructor(){super(),this.type="arrow-up",this.shape=new L.Marker({shape:ZV}),this.append([this.shape])}static is(e){return $i.isCheck(e,"arrow-up")}getHandleCoords(e,t){const i=Kt.HANDLE_SIZE/2,s=super.getHandleCoords(e,t);return s.y-=i,s}},Aee=XV.map(([e,t])=>[e,1-t]);function qV(e){L.drawMarkerUnitPolygon(e,Aee)}qV.anchor={x:.5,y:1};var tv=class extends YV{constructor(){super(),this.type="arrow-down",this.shape=new L.Marker({shape:qV}),this.append([this.shape])}static is(e){return $i.isCheck(e,"arrow-down")}updateAnchor(e,t,i){const s=super.updateAnchor(e,t,i);return s.y-=e.size,s}getHandleCoords(e,t){const i=Kt.HANDLE_SIZE/2,s=super.getHandleCoords(e,t);return s.y+=i,s}},{StateMachine:iv,StateMachineProperty:Iee,Debug:Ree}=L,qR=class extends iv{constructor(e){const t=({point:s})=>{const o=this.createDatum();o.set({x:s.x,y:s.y}),e.create(o)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},cancel:iv.parent,reset:iv.parent},"waiting-first-render":{render:{target:iv.parent,action:i}}}),this.debug=Ree.create(!0,"annotations")}};v([Iee()],qR.prototype,"node");var kee=class extends qR{createDatum(){return new Jl}},BP={type:"arrow-down",datum:Jl,scene:tv,isDatum:Jl.is,translate:(e,t,i,s)=>{Jl.is(t)&&tv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Jl.is(t)&&Jl.is(i)&&tv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Jl.is(t)&&tv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new kee({...e,create:t("arrow-down")}),dragState:e=>new pi(e)},{STRING:Tee,Validate:Lee}=L,tc=class extends WR{constructor(){super(...arguments),this.type="arrow-up"}static is(e){return ui(e)&&e.type==="arrow-up"}};v([Lee(Tee)],tc.prototype,"type");var Eee=class extends qR{createDatum(){return new tc}},GP={type:"arrow-up",datum:tc,scene:ev,isDatum:tc.is,translate:(e,t,i,s)=>{tc.is(t)&&ev.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(tc.is(t)&&tc.is(i)&&ev.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{tc.is(t)&&ev.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Eee({...e,create:t("arrow-up")}),dragState:e=>new pi(e)},{Vec2:Pee,Vec4:_P}=L,QV=class extends $i{extendLine({x1:e,y1:t,x2:i,y2:s},o,n){const r={x1:e,y1:t,x2:i,y2:s};if(!o.extendStart&&!o.extendEnd)return r;const[a,l]=uJ(r,n.yAxis.bounds),c=r.x2<r.x1,d=r.y1>=r.y2,h=r.x2===r.x1;return o.extendEnd&&(h?r.y2=d?l.y:a.y:(r.x2=c?a.x:l.x,r.y2=c?a.y:l.y)),o.extendStart&&(h?r.y1=d?a.y:l.y:(r.x1=c?l.x:a.x,r.y1=c?l.y:a.y)),r}dragStart(e,t,i){this.dragState={offset:t,...ex({start:e.start,end:e.end},i)}}drag(e,t,i,s){e.locked||(this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints(e,s.start,s.end,Pee.sub(t,s.offset),i)}translatePoints(e,t,i,s,o){const{vectors:n,translateX:r,translateY:a}=ZR({start:t,end:i},s,o);r&&(e.start.x=n.start?.x,e.end.x=n.end?.x),(this.ignoreYBounds||a)&&(e.start.y=n.start?.y,e.end.y=n.end?.y)}translate(e,t,i){this.translatePoints(e,Ut(e.start,i),Ut(e.end,i),t,i)}copy(e,t,i){const s=cr(e,i);if(!s)return;const o=this.computeBBoxWithoutHandles(),n={x:-o.width/2,y:-o.height/2};return this.translatePoints(t,_P.start(s),_P.end(s),n,i),t}},{Vec4:zP}=L,QR=class extends QV{constructor(){super(...arguments),this.start=new Kt,this.end=new Kt,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=cr(e,t);i!=null&&(this.updateHandles(e,i),this.updateAnchor(e,i,t))}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e;else for(const[t,i]of Object.entries(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}dragHandle(e,t,i,s){const{activeHandle:o,dragState:n}=this;if(!o||!n)return;this[o].toggleDragging(!0);const r=s?this.snapToAngle(e,t,i):Pt(this[o].drag(t).point,i);!r||!dr(i,r)||(e[o].x=r.x,e[o].y=r.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,n=["start","end"].find(a=>a!==s);if(!s||!n)return;this[s].toggleDragging(!0);const r=Ut(e[n],i);return Pt(Jm(t,r,e.snapToAngle),i)}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):!1}getNodeAtCoords(e,t){if(this.start.containsPoint(e,t)||this.end.containsPoint(e,t))return"handle"}updateHandles(e,t,i){this.start.update({...this.getHandleStyles(e,"start"),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e,"end"),...this.getHandleCoords(e,t,"end",i)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}updateAnchor(e,t,i,s){this.anchor={x:t.x1+i.seriesRect.x,y:t.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i,s){return i==="start"?zP.start(t):zP.end(t)}getHandleStyles(e,t){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},{Vec2:VP,Vec4:HP}=L,Nee=class extends QR{constructor(){super(...arguments),this.label=new L.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty()}update(e,t){const i=cr(e,t);if(i==null)return;const s=this.getTextBBox(e,i);this.updateLabel(e,s,i),this.updateHandles(e,i,s),this.updateShape(e,s,i),this.updateAnchor(e,i,t,s)}dragHandle(e,t,i,s){const{activeHandle:o,dragState:n}=this;if(!o||!n)return;this[o].toggleDragging(!0);const r=VP.add(n.end,VP.sub(t,n.offset)),a=s?this.snapToAngle(e,r,i):Pt(r,i);!a||!dr(i,a)||(e[o].x=a.x,e[o].y=a.y)}containsPoint(e,t){const{label:i}=this;return super.containsPoint(e,t)||i.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t){const{text:i}=e.getText();return HR(e,i,HP.end(t),this.textInputBBox)}updateLabel(e,t,i){const{text:s,isPlaceholder:o}=e.getText();MV(this.label,s,o,e,this.getLabelCoords(e,t,i))}updateShape(e,t,i){}getLabelCoords(e,t,i){return HP.end(i)}getHandleStyles(e,t){return{...super.getHandleStyles(e,t),stroke:e.handle.stroke??e.color}}},{drawCorner:Oee,Path:Fee}=L,sv=class extends Nee{constructor(){super(),this.type="callout",this.shape=new Fee,this.append([this.shape,this.label,this.start,this.end])}static is(e){return $i.isCheck(e,"callout")}drag(e,t,i,s){e.locked||(this.activeHandle==="end"?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}getLabelCoords(e,t,i){const s=e.getPadding(),{bodyBounds:o={x:0,y:0,width:0,height:0}}=this.getDimensions(e,t,i)??{};return{x:o.x+s.left,y:o.y-s.bottom}}getHandleStyles(e,t){return t==="start"?{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(e,t,i,s){const{bodyBounds:o}=this.getDimensions(e,s,t)??{},n=o??s;this.anchor={x:n.x+i.seriesRect.x,y:n.y+i.seriesRect.y-n.height,position:this.anchor.position}}updateShape(e,t,i){const{shape:s}=this;s.fill=e.fill,s.fillOpacity=e.fillOpacity??1,s.stroke=e.stroke,s.strokeWidth=e.strokeWidth??1,s.strokeOpacity=e.strokeOpacity??1;const{tailPoint:o,bodyBounds:n}=this.getDimensions(e,t,i)??{};!o||!n||this.updatePath(o,n)}updatePath(e,t){const{x:i,y:s}=e,{x:o,y:n,width:r,height:a}=t,l=n-a,c=o+r,d=this.calculateCalloutPlacement({x:i,y:s},t),h=8,u=[{coordinates:{x0:o,x1:o+h,y0:l+h,y1:l,cx:d==="topLeft"?i:o+h,cy:d==="topLeft"?s:l+h},type:d==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:o+h,x1:c-h,y0:l,y1:l,cx:i,cy:s},type:d==="top"?"calloutSide":"side"},{coordinates:{x0:c-h,x1:c,y0:l,y1:l+h,cx:d==="topRight"?i:c-h,cy:d==="topRight"?s:l+h},type:d==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+h,y1:n-h,cx:i,cy:s},type:d==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-h,y0:n-h,y1:n,cx:d==="bottomRight"?i:c-h,cy:d==="bottomRight"?s:n-h},type:d==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-h,x1:o+h,y0:n,y1:n,cx:i,cy:s},type:d==="bottom"?"calloutSide":"side"},{coordinates:{x0:o+h,x1:o,y0:n,y1:n-h,cx:d==="bottomLeft"?i:o+h,cy:d==="bottomLeft"?s:n-h},type:d==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:o,x1:o,y0:n-h,y1:l+h,cx:i,cy:s},type:d==="left"?"calloutSide":"side"}],{path:p}=this.shape;p.clear(),p.moveTo(o,l+h),u.forEach(({coordinates:g,type:f})=>{this.drawPath(p,g,h,f)}),p.closePath()}drawPath(e,{x0:t,y0:i,x1:s,y1:o,cx:n,cy:r},a,l){switch(l){case"calloutCorner":{e.lineTo(n,r),e.lineTo(s,o);break}case"corner":{Oee(e,{x0:t,x1:s,y0:i,y1:o,cx:n,cy:r},a,!1);break}case"calloutSide":{if(t!==s){const d=t>s?-1:1,h=Math.min(t,s)+Math.abs(s-t)/2;e.lineTo(h-6*d,i),e.lineTo(n,r),e.lineTo(h+6*d,i),e.lineTo(s,o)}else{const d=i>o?-1:1,h=Math.min(i,o)+Math.abs(i-o)/2;e.lineTo(t,h-6*d),e.lineTo(n,r),e.lineTo(t,h+6*d),e.lineTo(s,o)}break}case"side":default:{e.lineTo(s,o);break}}}calculateCalloutPlacement(e,t){const i=t.x+t.width,s=t.y-t.height;let o,n;return e.x>i?o="right":e.x<t.x&&(o="left"),e.y>t.y?n="bottom":e.y<s&&(n="top"),o&&n?`${n}${o[0].toUpperCase()}${o.substring(1)}`:n??o}getDimensions(e,t,i){const{fontSize:s}=e,o=e.getPadding(),n=o.left+o.right,r=o.top+o.bottom,a=t.width+n,l=Math.max(t.height+r,s+r);return{tailPoint:{x:i.x1,y:i.y1},bodyBounds:{x:t.x,y:t.y,width:a,height:l}}}containsPoint(e,t){const{start:i,end:s,shape:o}=this;if(this.activeHandle=void 0,i.containsPoint(e,t))return this.activeHandle="start",!0;const n=s.containsPoint(e,t)||o.containsPoint(e,t);return n&&(this.activeHandle="end"),n}};function JR({key:e}){return e==="Escape"}function ek({key:e,shiftKey:t}){return!t&&e==="Enter"}var{StateMachine:Vn,StateMachineProperty:JV,Debug:Bee}=L,tk=class extends Vn{constructor(e){const t=({point:u})=>{const p=this.createDatum();p.set({start:u,end:u,visible:!0}),e.create(p)},i=()=>{const{node:u}=this;u?.toggleActive(!0),u?.toggleHandles({start:!0})},s=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},o=()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},n=u=>{this.node?.setTextInputBBox(u),e.update()},r=({point:u})=>{const{datum:p,node:g}=this;p?.set({end:u}),g?.toggleActive(!0),g?.toggleHandles({end:!1}),e.update()},a=()=>{e.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:u,colorOpacity:p,color:g,opacity:f,isMultiColor:y})=>{const{datum:m}=this;m&&(u==="text-color"&&e.updateTextInputColor(g),QS(m,u,p,g,f,y),e.update())},c=u=>{const{datum:p,node:g}=this;!p||!g||!Xr(p)||(p.fontSize=u,e.updateTextInputFontSize(u),e.update())},d=()=>{e.delete()},h=({textInputValue:u,bbox:p})=>{const{datum:g}=this;if(p!=null&&u!=null&&u.length>0){if(!Xr(g))return;const f=KS(g,u,p.width);g?.set({text:f}),e.update(),e.recordAction(`Create ${g?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:Vn.parent,reset:Vn.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:r,drag:r,click:{target:"edit",action:a},dragEnd:{target:"edit",action:a},reset:{target:Vn.parent,action:d},cancel:{target:Vn.parent,action:d}},edit:{onEnter:s,updateTextInputBBox:n,color:l,fontSize:c,textInput:[{guard:JR,target:Vn.parent,action:d},{guard:ek,target:Vn.parent,action:h}],click:{target:Vn.parent,action:h},dragStart:{target:Vn.parent,action:h},resize:{target:Vn.parent,action:h},onExit:o,cancel:{target:Vn.parent,action:d}}}),this.debug=Bee.create(!0,"annotations")}};v([JV()],tk.prototype,"datum");v([JV()],tk.prototype,"node");var Gee=class extends tk{createDatum(){return new Xn}},WP={type:"callout",datum:Xn,scene:sv,isDatum:Xn.is,translate:(e,t,i,s)=>{if(Xn.is(t)&&sv.is(e))return e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Xn.is(t)&&Xn.is(i)&&sv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Xn.is(t)&&sv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Gee({...e,create:t("callout")}),dragState:e=>new pi(e)},ik=class extends $V{constructor(){super(...arguments),this.label=new L.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty()}update(e,t){const i=Ut(e,t),s=this.getTextBBox(e,i,t);this.updateLabel(e,s),this.updateHandle(e,i,s),this.updateShape(e,s),this.anchor=this.updateAnchor(e,s,t)}copy(e,t,i){const s=Ut(e,i),o=this.getTextBBox(e,s,i),n=e.getPadding(),r=n.left+n.right,a=n.top+n.bottom,l=(o.width+r)/2,c=o.height+a,d=Pt({x:s.x-l,y:s.y-c},i);return t.x=d.x,t.y=d.y,t}containsPoint(e,t){const{label:i}=this;return super.containsPoint(e,t)||i.visible&&i.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.visible&&this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t,i){const{text:s}=e.getText();return HR(e,s,{x:t.x,y:t.y},this.textInputBBox)}updateLabel(e,t){const{text:i,isPlaceholder:s}=e.getText();MV(this.label,i,s,e,this.getLabelCoords(e,t))}updateShape(e,t){}updateAnchor(e,t,i){return{x:t.x+i.seriesRect.x,y:t.y+i.seriesRect.y-t.height,position:this.anchor.position}}getLabelCoords(e,t){return t}getHandleCoords(e,t,i){return i}getHandleStyles(e){const t=super.getHandleStyles(e);return t.stroke=e.handle.stroke??e.color,t}},{drawCorner:Zw}=L,ov=class extends ik{constructor(){super(),this.type="comment",this.shape=new L.Path,this.append([this.shape,this.label,this.handle])}static is(e){return $i.isCheck(e,"comment")}updateShape(e,t){const{shape:i}=this;i.fill=e.fill,i.fillOpacity=e.fillOpacity??1,i.stroke=e.stroke??"transparent",i.strokeWidth=e.strokeWidth??1,i.strokeOpacity=e.strokeOpacity??1,this.updatePath(e,t)}getLabelCoords(e,t){const i=e.getPadding();return{x:t.x+i.left,y:t.y-i.bottom}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}updateAnchor(e,t,i){const s=super.updateAnchor(e,t,i),o=e.getPadding();return s.y-=o.bottom+o.top,s}updatePath(e,t){const i=e.getPadding(),{x:s,y:o}=t;let{width:n,height:r}=t;const{fontSize:a}=e,l=i.left+i.right,c=i.top+i.bottom;n=n+l,r=Math.max(r+c,a+c);const d=o-r,h=s+n,u=(a*US+c)/2,{path:p}=this.shape;p.clear(),p.moveTo(s,o),p.lineTo(s,d+u),Zw(p,{x0:s,x1:s+u,y0:d+u,y1:d,cx:s+u,cy:d+u},u,!1),p.lineTo(h-u,d),Zw(p,{x0:h-u,x1:h,y0:d,y1:d+u,cx:h-u,cy:d+u},u,!1),p.lineTo(h,o-u),Zw(p,{x0:h,x1:h-u,y0:o-u,y1:o,cx:h-u,cy:o-u},u,!1),p.closePath()}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}},{StateMachine:Ia,StateMachineProperty:eH,Debug:_ee}=L,ey=class extends Ia{constructor(e){const t=({point:d})=>{const h=this.createDatum();h.set({x:d.x,y:d.y}),e.create(h)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()},s=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},o=()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},n=d=>{this.node?.setTextInputBBox(d),e.update()},r=({colorPickerType:d,colorOpacity:h,color:u,opacity:p,isMultiColor:g})=>{this.datum&&(d==="text-color"&&e.updateTextInputColor(u),QS(this.datum,d,h,u,p,g),e.update())},a=d=>{const{datum:h,node:u}=this;!h||!u||!Xr(h)||(h.fontSize=d,e.updateTextInputFontSize(d),e.update())},l=()=>{e.delete()},c=({textInputValue:d,bbox:h})=>{if(h!=null&&d!=null&&d.length>0){const{datum:u}=this;if(!Xr(u))return;const p=KS(u,d,h.width);u?.set({text:p}),e.update(),e.recordAction(`Create ${u?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:Ia.parent,reset:Ia.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:s,updateTextInputBBox:n,color:r,fontSize:a,textInput:[{guard:JR,target:Ia.parent,action:l},{guard:ek,target:Ia.parent,action:c}],click:{target:Ia.parent,action:c},dragStart:{target:Ia.parent,action:c},resize:{target:Ia.parent,action:c},onExit:o,cancel:{target:Ia.parent,action:l}}}),this.debug=_ee.create(!0,"annotations")}};v([eH()],ey.prototype,"datum");v([eH()],ey.prototype,"node");var zee=class extends ey{createDatum(){return new Br}},jP={type:"comment",datum:Br,scene:ov,isDatum:Br.is,translate:(e,t,i,s)=>{Br.is(t)&&ov.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Br.is(t)&&Br.is(i)&&ov.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Br.is(t)&&ov.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new zee({...e,create:t("comment")}),dragState:e=>new pi(e)},{calculateLabelTranslation:Vee,ChartAxisDirection:Hee}=L,tH=class extends L.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new L.Text({zIndex:1}),this.rect=new L.Rect;const{label:e}=this;e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.textBaseline="middle",e.textAlign="center",this.append([this.rect,this.label])}update(e){this.updateLabel(e),this.updateRect(e),this.updatePosition(e)}updateLabel({value:e,styles:t,context:i}){const{fontWeight:s,fontSize:o,fontStyle:n,fontFamily:r,textAlign:a,color:l="white",formatter:c}=t,d=c?c({value:e}):i.scaleValueFormatter()(e);this.label.setProperties({fontWeight:s,fontSize:o,fontStyle:n,fontFamily:r,textAlign:a,fill:l,text:d})}updateRect({styles:e}){const{rect:t}=this,{cornerRadius:i,fill:s,fillOpacity:o,stroke:n,strokeOpacity:r}=e;t.setProperties({cornerRadius:i,fill:s,fillOpacity:o,stroke:n,strokeOpacity:r})}updatePosition({x:e,y:t,context:i,styles:{padding:s}}){const{label:o,rect:n}=this,r=o.getBBox()?.clone(),a=s??8,l=s??5;r.grow(a,"horizontal"),r.grow(l,"vertical");const c=i.direction===Hee.X?Math.round(l/2):a,{xTranslation:d,yTranslation:h}=Vee({yDirection:!0,padding:i.labelPadding-c,position:i.position??"left",bbox:r}),u=e+d,p=t+h;o.x=u,o.y=p,n.y=p-Math.round(r.height/2),n.x=u-Math.round(r.width/2),n.height=r.height,n.width=r.width}};tH.className="AxisLabel";var{Vec2:Tr}=L,po=class extends L.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(e,t){return super.setProperties(e,t),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:e,strokeWidth:t,x1:i,y1:s,x2:o,y2:n}=this;let r=t+e;r%2===0&&(r+=1);const a=Tr.from(i,s-Math.floor(r/2)),l=Tr.from(o,n),c=Tr.distance(a,l);this.collisionBBox=new L.BBox(a.x,a.y,c,r)}isPointInPath(e,t){const{collisionBBox:i,x1:s,y1:o,x2:n,y2:r}=this;if(!i)return!1;const a=Tr.from(s,o),l=Tr.from(n,r),c=Tr.sub(Tr.from(e,t),a),d=Tr.sub(l,a),h=Tr.rotate(c,Tr.angle(c,d),a);return i.containsPoint(h.x,h.y)??!1}render(e){this.applyClipMask(e.ctx),super.render(e),this.closeClipMask(e.ctx)}setClipMask(e,t){const i=this.clipMask.get(e);L.jsonDiff(i,t)!=null&&this.markDirty(),t?this.clipMask.set(e,t):this.clipMask.delete(e)}applyClipMask(e){const{clipMask:t}=this;t.size!==0&&this.clipMask.forEach(i=>{const{x:s,y:o,radius:n}=i;e.save(),e.beginPath(),e.rect(0,0,e.canvas.width,e.canvas.height),e.ellipse(s,o,n,n,0,Math.PI*2,0,!0),e.clip()})}closeClipMask(e){this.clipMask.size!==0&&e.restore()}},nh=class extends L.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(e,t){const i=this.fromParentPoint(e,t),s=this.computeBBoxWithoutTransforms();return s?s.grow(this.growCollisionBox).containsPoint(i.x,i.y):!1}},{Vec2:ys}=L;function _u(e,t,i,s,o,n,r){if(!n||!o||!s){t.setClipMask(e);return}const{alignment:a,position:l}=s,c=sH(i,s.fontSize,r),{point:d,textBaseline:h}=oH(c,l,a);nH(o,n,s,d,c.angle,h);const{x:u,y:p,width:g,height:f}=o.getBBox(),y=ys.length(ys.from(g,f)),m={x:u+g/2,y:p+f/2,radius:y/2+ys.length(c.offset)};return l==="center"?t.setClipMask(e,m):t.setClipMask(e),{clipMask:m,numbers:c}}function iH(e,t,i,s,o,n,r){if(!r||!n)return;const{alignment:a,position:l}=s,[c,d]=t.y1<=i.y1?[t,i]:[i,t];let h=c;l==="bottom"?h=d:l==="inside"&&(h={x1:(c.x1+d.x1)/2,y1:(c.y1+d.y1)/2,x2:(c.x2+d.x2)/2,y2:(c.y2+d.y2)/2});const u=sH(h,s.fontSize,o),{point:p,textBaseline:g}=oH(u,l==="inside"?"center":l,a,e);nH(n,r,s,p,u.angle,g)}function sH(e,t,i){let[s,o]=ys.from(e);s.x>o.x&&([s,o]=[o,s]);const n=ys.normalized(ys.sub(o,s)),r=ys.angle(n),a=ys.multiply(n,Kt.HANDLE_SIZE/2+(t??14)/2),l=ys.multiply(n,(i??2)/2+(t??14)/3);return{left:s,right:o,normal:n,angle:r,inset:a,offset:l}}function oH({left:e,right:t,normal:i,angle:s,inset:o,offset:n},r,a,l){let c;a==="right"?c=ys.sub(t,o):a==="center"?c=ys.add(e,ys.multiply(i,ys.distance(e,t)/2)):c=ys.add(e,o);let d="bottom";return r==="bottom"?(c=ys.rotate(n,s+Math.PI/2,c),d="top"):r==="center"&&!l?d="middle":c=ys.rotate(n,s-Math.PI/2,c),{point:c,textBaseline:d}}function nH(e,t,i,s,o,n){e.setProperties({text:t,x:s.x,y:s.y,rotation:o,rotationCenterX:s.x,rotationCenterY:s.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:n})}var{ChartAxisDirection:Wee,Vec2:iu,Vec4:qw}=L,yc=class extends $i{constructor(){super(),this.type="cross-line",this.line=new po,this.middle=new Ru,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(e){return $i.isCheck(e,"cross-line")}update(e,t){const{seriesRect:i}=t;this.seriesRect=i,this.isHorizontal=Cs.is(e);const s=this.isHorizontal?t.yAxis:t.xAxis,o=this.convertCrossLine(e,s);if(o==null){this.visible=!1;return}this.visible=e.visible??!0,this.visible&&(this.updateLine(e,o),this.updateHandle(e,o),this.updateText(e,o),this.updateAxisLabel(e,s,o))}updateLine(e,t){const{line:i}=this,{lineDashOffset:s,stroke:o,strokeWidth:n,strokeOpacity:r}=e,{x1:a,y1:l,x2:c,y2:d}=t;i.setProperties({x1:a,y1:l,x2:c,y2:d,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:s,stroke:o,strokeWidth:n,strokeOpacity:r,fillOpacity:0})}updateHandle(e,t){const{middle:i}=this,{locked:s,stroke:o,strokeWidth:n,strokeOpacity:r}=e,a={fill:e.handle.fill,stroke:e.handle.stroke??o,strokeOpacity:e.handle.strokeOpacity??r,strokeWidth:e.handle.strokeWidth??n},l=iu.sub(qw.center(t),iu.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...a,...l}),i.toggleLocked(s??!1)}updateText(e,t){this.text=this.updateNode(nh,this.text,!!e.text.label),_u(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}createAxisLabel(e){const t=new tH;return e.attachLabel(t),t}updateAxisLabel(e,t,i){this.axisLabel||(this.axisLabel=this.createAxisLabel(t));const{axisLabel:s,seriesRect:o}=this,{direction:n,position:r}=t;if(e.axisLabel.enabled){s.visible=this.visible;const a=r==="left"||r==="top"?qw.start(i):qw.end(i),l=n===Wee.X?a.x:a.y;if(!t.inRange(l)){s.visible=!1;return}const{value:c}=Et(e.value);s.update({...iu.add(a,iu.required(o)),value:c,styles:e.axisLabel,context:t})}else s.visible=!1}setAxisLabelOpacity(e){this.axisLabel&&(this.axisLabel.opacity=e)}setAxisLabelVisible(e){this.axisLabel&&(this.axisLabel.visible=e)}toggleHandles(e){this.middle.visible=e,this.middle.toggleHovered(this.activeHandle==="middle")}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(e){this.toggleHandles(e),this.middle.toggleActive(e)}dragStart(e,t,i){const s=Cs.is(e)?{x:t.x,y:fc(e.value,i.yAxis)}:{x:fc(e.value,i.xAxis),y:t.y};this.dragState={offset:t,middle:s}}drag(e,t,i){const{activeHandle:s,dragState:o}=this;if(e.locked)return;let n;if(s)this[s].toggleDragging(!0),n=this[s].drag(t).point;else if(o)n=iu.add(o.middle,iu.sub(t,o.offset));else return;const r=Pt(n,i),a=Cs.is(e);e.set({value:a?r.y:r.x})}translate(e,{x:t,y:i},s){if(e.locked)return;const{axisContext:o,translation:n}=Cs.is(e)?{axisContext:s.yAxis,translation:i}:{axisContext:s.xAxis,translation:t},r=fc(e.value,o)+n,a=qf(r,o);isNaN(a)||e.set({value:a})}stopDragging(){this.middle.toggleDragging(!1)}copy(e,t,i){const s=Cs.is(e),o=this.isHorizontal?i.yAxis:i.xAxis,n=this.convertCrossLine(e,o);if(!n)return;const r=s?-30:0,a=s?0:-30,l=Pt({x:n.x1+a,y:n.y1+r},i);return t.set({value:s?l.y:l.x}),t}getCursor(){return this.activeHandle==null?"pointer":this[this.activeHandle].getCursor()}containsPoint(e,t){const{middle:i,line:s,text:o}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="middle",!0):s.isPointInPath(e,t)||!!o?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.line.isPointInPath(e,t))return"line";if(this.middle.containsPoint(e,t))return"handle"}getAnchor(){const e=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:e.x+e.width/2,y:e.y}:{x:e.x+e.width,y:e.y+e.height/2,position:"right"}}convertCrossLine(e,t){if(e.value==null)return;let i=0,s=0,o,n;const{bounds:r}=t,a=fc(e.value,t);return Cs.is(e)?(o=r.width,s=a,n=a):(i=a,o=a,n=r.height),{x1:i,y1:s,x2:o,y2:n}}},{StateMachine:nv,StateMachineProperty:jee,Debug:Uee}=L,sk=class extends nv{constructor(e,t){const i=({point:o})=>{const n=e==="horizontal",r=n?new Cs:new Gr;r.set({value:n?o.y:o.x}),t.create(r),t.recordAction(`Create ${n?"horizontal-line":"vertical-line"} annotation`)},s=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:nv.parent,cancel:nv.parent},"waiting-first-render":{render:{target:nv.parent,action:s}}}),this.debug=Uee.create(!0,"annotations")}};v([jee()],sk.prototype,"node");var UP={type:"horizontal-line",datum:Cs,scene:yc,isDatum:Cs.is,translate:(e,t,i,s)=>{Cs.is(t)&&yc.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Cs.is(t)&&Cs.is(i)&&yc.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Cs.is(t)&&yc.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new sk("horizontal",{...e,create:t("horizontal-line")}),dragState:e=>new pi(e)},KP={type:"vertical-line",datum:Gr,scene:yc,isDatum:Gr.is,translate:(e,t,i,s)=>{Gr.is(t)&&yc.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Gr.is(t)&&Gr.is(i)&&yc.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Gr.is(t)&&yc.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new sk("vertical",{...e,create:t("vertical-line")}),dragState:e=>new pi(e)},{Vec4:Kee}=L,rH=class{static updateBackground(e,t,i,s){const{background:o}=this,{seriesRect:n}=s;o.path.clear(!0);const r=Kee.from(0,0,n.width,n.height),a=this.getBackgroundPoints(e,t,i,r);for(let c=0;c<a.length;c++){const d=a[c];c===0?o.path.moveTo(d.x,d.y):o.path.lineTo(d.x,d.y)}o.path.closePath(),o.checkPathDirty();const l=this.getBackgroundStyles?.(e)??e.background;o.setProperties({fill:l.fill,fillOpacity:l.fillOpacity})}},aH=class extends QV{constructor(){super(...arguments),this.handles={},this.topLine=new po,this.bottomLine=new po,this.background=new L.Path({zIndex:-1}),this.anchor={x:0,y:0},this.updateBackground=rH.updateBackground.bind(this)}update(e,t){const{locked:i,visible:s}=e,o=cr(e,t),n=cr(e.bottom,t);if(o==null||n==null){this.visible=!1;return}else this.visible=s??!0;const r=this.extendLine(o,e,t),a=this.extendLine(n,e,t);this.updateLines(e,r,a,t,o,n),this.updateHandles(e,o,n),this.updateText(e,o,n),this.updateBackground(e,r,a,t),this.updateAnchor(o,n);for(const l of Object.values(this.handles))l.toggleLocked(i??!1)}snapToAngle(e,t,i,s,o,n){const{handles:r}=this,a=r[s].handle,l=r[i].drag(e).point;return Pt(Jm(l,a,o,n),t)}toggleHandles(e){const{handles:t}=this;if(typeof e=="boolean"){for(const[i,s]of Object.entries(t))s.visible=e,s.toggleHovered(this.activeHandle===i);return}for(const[i,s]of Object.entries(e)){const o=t[i];o.visible=s??!0,o.toggleHovered(this.activeHandle===i)}}toggleActive(e){this.toggleHandles(e);for(const t of Object.values(this.handles))t.toggleActive(e)}stopDragging(){const{activeHandle:e,handles:t}=this;e!=null&&t[e].toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return this.activeHandle==null?"pointer":this.handles[this.activeHandle].getCursor()}containsPoint(e,t){const{handles:i,topLine:s,bottomLine:o,text:n}=this;this.activeHandle=void 0;for(const[r,a]of Object.entries(i))if(a.containsPoint(e,t))return this.activeHandle=r,!0;return s.containsPoint(e,t)||o.containsPoint(e,t)||!!n?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.topLine.containsPoint(e,t)||this.bottomLine.containsPoint(e,t))return"line";for(const[i,s]of Object.entries(this.handles))if(s.containsPoint(e,t))return"handle"}updateAnchor(e,t){const{x:i,y:s}=L.Transformable.toCanvasPoint(this.topLine,(e.x1+e.x2)/2,Math.min(e.y1,e.y2,t.y1,t.y2));this.anchor.x=i,this.anchor.y=s}},{Vec2:Hl,Vec4:rv}=L,av=class extends aH{constructor(){super(),this.type="disjoint-channel",this.ignoreYBounds=!0,this.handles={topLeft:new Kt,topRight:new Kt,bottomLeft:new Kt,bottomRight:new Ru},this.append([this.background,this.topLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return $i.isCheck(e,"disjoint-channel")}dragHandle(e,t,i,s){const{activeHandle:o,handles:n}=this;if(o==null)return;const{offset:r}=n[o].drag(t);n[o].toggleDragging(!0);const a=u=>Pt(u,i),l=e.toJson(),c=e.snapToAngle,{value:d}=Et(e.end.y),{value:h}=Et(e.start.y);switch(o){case"topLeft":case"bottomLeft":{const u=o==="topLeft"?1:-1,p=s?this.snapToAngle(t,i,"topLeft","topRight",c,u):a({x:n.topLeft.handle.x+r.x,y:n.topLeft.handle.y+r.y*u}),g=s?this.snapToAngle(t,i,"bottomLeft","bottomRight",c,-u):a({x:n.bottomLeft.handle.x+r.x,y:n.bottomLeft.handle.y+r.y*-u});if(p?.y==null||g?.y==null||h==null||!ri(h))return;const f=e.startHeight+(p.y-h)*2;e.start.x=p.x,e.start.y=p.y,e.startHeight=f;break}case"topRight":{const u=s?this.snapToAngle(t,i,"topRight","topLeft",c):a({x:n.topRight.handle.x+r.x,y:n.topRight.handle.y+r.y});if(u?.y==null||d==null||!ri(d))return;const p=e.endHeight+(u.y-d)*2;e.end.x=u.x,e.end.y=u.y,e.endHeight=p;break}case"bottomRight":{const u=a({x:n.bottomLeft.handle.x+r.x,y:n.bottomLeft.handle.y+r.y}),p=a({x:n.bottomRight.handle.x+r.x,y:n.bottomRight.handle.y+r.y});if(!u||!p||e.start.y==null||d==null||!ri(d))return;const g=d-p.y,f=e.startHeight-(e.endHeight-g);e.startHeight=f,e.endHeight=g}}e.isValidWithContext(i)||e.set(l)}updateLines(e,t,i){const{topLine:s,bottomLine:o}=this,{lineDashOffset:n,stroke:r,strokeOpacity:a,strokeWidth:l}=e,c={lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:n,stroke:r,strokeOpacity:a,strokeWidth:l};s.setProperties({...t,...c}),o.setProperties({...i,...c})}updateHandles(e,t,i){const{handles:{topLeft:s,topRight:o,bottomLeft:n,bottomRight:r}}=this,a={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...a,...rv.start(t)}),o.update({...a,...rv.end(t)}),n.update({...a,...rv.start(i)}),r.update({...a,...Hl.sub(rv.end(i),Hl.from(r.handle.width/2,r.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(nh,this.text,!!e.text.label),iH(!1,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,s){const o=t.x1>t.x2,n=t.y1>t.y2,r=n?s.y2:s.y1,a=n?s.y1:s.y2,l=Hl.from(t);return e.extendEnd&&t.y2===a&&l.push(Hl.from(o?s.x1:s.x2,n?s.y1:s.y2)),e.extendEnd&&i.y2===r&&l.push(Hl.from(o?s.x1:s.x2,n?s.y2:s.y1)),l.push(...Hl.from(i).reverse()),e.extendStart&&i.y1===a&&l.push(Hl.from(o?s.x2:s.x1,n?s.y1:s.y2)),e.extendStart&&t.y1===r&&l.push(Hl.from(o?s.x2:s.x1,n?s.y2:s.y1)),l}},{StateMachine:Wl,StateMachineProperty:ok,Debug:$ee}=L,tx=class extends Wl{constructor(e){const t=({point:l})=>{const c=new gn;c.set({start:l,end:l,startHeight:0,endHeight:0}),e.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})},s=({offset:l,context:c})=>{const{datum:d,snapping:h}=this;d&&(d.set({end:em(l,c,h,d.start,d.snapToAngle)}),e.update())},o=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},n=({point:l})=>{const{datum:c,node:d}=this,{value:h}=Et(c?.end.y),{value:u}=Et(c?.start.y),{y:p}=l;if(c==null||!ri(u)||!ri(h)||!ri(p))return;const g=h-(p??0),f=(u-h)*2+g,y={x:c?.start.x,y:u-f},m={x:c?.end.x,y:l.y};d?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint(y)||!e.validatePoint(m))&&(c.set({startHeight:f,endHeight:g}),e.update())},r=({point:l})=>{const{datum:c,node:d}=this,{value:h}=Et(c?.end.y),{value:u}=Et(c?.start.y),{y:p}=l;if(c==null||!ri(u)||!ri(h)||!ri(p))return;const g=h-(p??0),f=(u-h)*2+g,y={x:c.start.x,y:u-g},m={x:c.end.x,y:l.y};d?.toggleHandles(!0),!(!e.validatePoint(y)||!e.validatePoint(m))&&(c.set({startHeight:f,endHeight:g}),e.recordAction("Create disjoint-channel annotation"),e.showAnnotationOptions(),e.update())},a=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Wl.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:o},dragEnd:{target:"height",action:o},reset:{target:Wl.parent,action:a},cancel:{target:Wl.parent,action:a}},height:{hover:n,click:{target:Wl.parent,action:r},drag:{target:Wl.parent,action:r},reset:{target:Wl.parent,action:a},cancel:{target:Wl.parent,action:a}}}),this.debug=$ee.create(!0,"annotations"),this.snapping=!1}};v([ok()],tx.prototype,"datum");v([ok()],tx.prototype,"node");v([ok()],tx.prototype,"snapping");var $P={type:"disjoint-channel",datum:gn,scene:av,isDatum:gn.is,translate:(e,t,i,s)=>{gn.is(t)&&av.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(gn.is(t)&&gn.is(i)&&av.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{gn.is(t)&&av.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new tx({...e,create:t("disjoint-channel")}),dragState:e=>new pi(e)},gD=[0,23.6,38.2,50,61.8,78.6,100],Yee=[161.8,261.8,361.8,423.6],Xee=[...gD,...Yee],Zee={10:Xee,6:gD,4:gD.filter(e=>e!==78.6&&e!==23.6)},qee=10;function Qee(e,t){const{x2:i,y1:s,y2:o}=e,n=s-o;return t==null?{x1:i,x2:i,y1:o-n,y2:o}:{x1:t.x1,x2:t.x2,y1:t.y2-n,y2:t.y2}}function lH({x1:e,y1:t,x2:i,y2:s},o,n,r,a=10){const l=t-s,c=n?-1:1;let d=r;const h=[];return Zee[a].forEach((u,p)=>{const g=r+l*(u/100)*c,f=o.yAxis.scaleInvert(g);h.push({id:p,x1:e,x2:i,y1:d,y2:g,tag:u==100?0:1,label:{x1:Math.min(e,i)-qee,x2:i,y1:g,y2:g,text:`${(u/100).toFixed(3)} (${f.toFixed(2)})`}}),d=g}),h}var{Vec2:Jee,Vec4:YP}=L,cH=class extends $i{constructor(){super(),this.trendLine=new po,this.rangeFillsGroup=new L.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=L.Selection.select(this.rangeFillsGroup,L.Range),this.rangeStrokesGroup=new L.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=L.Selection.select(this.rangeStrokesGroup,po),this.labelsGroup=new L.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=L.Selection.select(this.labelsGroup,nh),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(e,t){let i=cr(e,t);if(i==null){this.visible=!1;return}if(i=YP.round(i),this.visible=e.visible??!0,!this.visible)return;this.updateLine(e,i,this.trendLine),this.updateHandles(e,i),this.updateAnchor(e,i,t);const{reverse:s}=e,o=this.extendLine(i,e,t),n=s?o.y1:o.y2,r=s?o.y2:o.y1,a=lH(o,t,e.reverse,n,e.bands);this.updateRanges(e,a,t);const l={...o,y1:r,y2:r};this.updateText(e,l)}extendLine({x1:e,y1:t,x2:i,y2:s},o,n){const r={x1:e,y1:t,x2:i,y2:s};if(!o.extendStart&&!o.extendEnd)return r;const{x:a,width:l}=n.xAxis.bounds;return o.extendEnd&&(r[e>i?"x1":"x2"]=a+l),o.extendStart&&(r[e>i?"x2":"x1"]=a),r}updateLine(e,t,i){if(!t||!i)return;const{lineDashOffset:s,strokeWidth:o,strokeOpacity:n,stroke:r}=e;i.setProperties({...t,lineCap:e.getLineCap(),lineDash:[3,4],lineDashOffset:s,strokeWidth:o,strokeOpacity:n,fillOpacity:0,stroke:r})}updateRangeStrokes(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:s,strokes:o,rangeStroke:n,isMultiColor:r}=e;this.rangeStrokesGroupSelection.each((a,{x1:l,x2:c,y2:d,tag:h},u)=>{const p=d,g=r?o[u%o.length]:n;a.setProperties({x1:l,x2:c,y1:p,y2:p,stroke:g,strokeOpacity:s,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,tag:h})})}updateRanges(e,t,i){const s=o=>o.id;this.rangeFillsGroupSelection.update(t,void 0,s),this.rangeStrokesGroupSelection.update(t,void 0,s),this.labelsGroupSelection.update(t,void 0,s),this.updateRangeFills(e),this.updateRangeStrokes(e),this.updateRangeLabels(e,i)}updateRangeFills(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:s,strokes:o,rangeStroke:n,showFill:r,isMultiColor:a}=e;this.rangeFillsGroupSelection.each((l,{x1:c,x2:d,y1:h,y2:u},p)=>{const g=a?o[p%o.length]:n;if(!r){l.visible=!1;return}l.setProperties({x1:c,x2:d,y1:h,y2:u,startLine:!1,endLine:!1,isRange:!0,stroke:g,strokeOpacity:s,fill:g,fillOpacity:(s??1)*.15,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,visible:!0})})}updateRangeLabels(e,{xAxis:t}){const{rangeStrokesGroupSelection:i}=this,{strokes:s,strokeWidth:o,rangeStroke:n,isMultiColor:r,label:{fontFamily:a,fontSize:l,fontStyle:c,fontWeight:d,color:h}}=e,u={fontFamily:a,fontSize:l,fontStyle:c,fontWeight:d},p=this.checkWithinBounds(t,u,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((g,f,y)=>{const m=h??(r?s[y%s.length]:n),C=i.at(y);if(!C)return;const{text:b,...S}=f.label;if(p)g.setProperties({...u,text:b,x:S.x1,y:S.y1,textBaseline:"middle",textAlign:"end",fill:m}),_u(g.id,C,S);else{const A={...u,position:"center",alignment:"left",color:m};_u(g.id,C,S,A,g,b,o)}})}checkWithinBounds(e,t,i){if(!i)return!1;const{text:s,...o}=i.datum.label;i.setProperties({...t,text:s,x:o.x1,y:o.y1,textBaseline:"middle",textAlign:"end"});const{x:n}=i.getBBox();return n>=e.bounds.x&&n<=e.bounds.x+e.bounds.width}updateText(e,t){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:s,strokeWidth:o}=e;this.text=this.updateNode(nh,this.text,!!s.label),_u(i.id,i,t,s,this.text,s.label,o)}updateAnchor(e,t,i,s){const o=YP.topCenter(t);Jee.apply(this.anchor,L.Transformable.toCanvasPoint(this.trendLine,o.x,o.y))}containsPoint(e,t){const{trendLine:i,rangeStrokesGroupSelection:s,text:o}=this;let n=!1;return s.each(r=>n||(n=r.isPointInPath(e,t))),n||i.isPointInPath(e,t)||!!o?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.trendLine.isPointInPath(e,t))return"line"}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}drag(e,t,i,s){e.locked||(this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{Vec2:ete,Vec4:yd}=L,lv=class extends cH{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new po,this.start=new Kt,this.end=new Kt,this.endRetracement=new Kt,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(e){return $i.isCheck(e,"fibonacci-retracement-trend-based")}update(e,t){let{coords1:i,coords2:s}=this.getCoords(e,t);if(i==null||s==null){this.visible=!1;return}if(i=yd.round(i),s=yd.round(s),this.visible=e.visible??!0,!this.visible)return;(e.endRetracement.x==null||e.endRetracement.y==null)&&(s=void 0),this.updateLine(e,i,this.trendLine),this.updateLine(e,s,this.endRetracementLine),this.updateHandles(e,i,s),this.updateAnchor(e,s??i,t);const{reverse:o,bands:n}=e,r=Qee(i,s),a=this.extendLine(r,e,t),l=a.y2,c=a.y1,d=s?lH(a,t,o,l,n):[];this.updateRanges(e,d,t);const h={...a,y1:c,y2:c};this.updateText(e,h)}containsPoint(e,t){const{start:i,end:s,endRetracement:o,endRetracementLine:n}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):o.containsPoint(e,t)?(this.activeHandle="endRetracement",!0):n.isPointInPath(e,t)||super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)||this.endRetracement.containsPoint(e,t)?"handle":this.endRetracementLine.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...ex({start:e.start,end:e.end,endRetracement:e.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,endRetracement:s.endRetracement,translation:ete.sub(t,s.offset),context:i})}dragHandle(e,t,i,s){const{activeHandle:o,dragState:n}=this;if(!o||!n)return;this[o].toggleDragging(!0);const r=s?this.snapToAngle(e,t,i):Pt(this[o].drag(t).point,i);!r||!dr(i,r)||(e[o].x=r.x,e[o].y=r.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,o=["start","end","endRetracement"];if(!s)return;const n=(o.indexOf(s)+1)%o.length,r=o[n];this[s].toggleDragging(!0);const a=Ut(e[r],i);return Pt(Jm(t,a,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,endRetracement:s,translation:o,context:n}){const{vectors:r,translateX:a,translateY:l}=ZR({start:t,end:i,endRetracement:s},o,n);a&&(e.start.x=r.start?.x,e.end.x=r.end?.x,e.endRetracement.x=r.endRetracement?.x),(this.ignoreYBounds||l)&&(e.start.y=r.start?.y,e.end.y=r.end?.y,e.endRetracement.y=r.endRetracement?.y)}translate(e,t,i){this.translatePoints({datum:e,start:Ut(e.start,i),end:Ut(e.end,i),endRetracement:Ut(e.endRetracement,i),translation:t,context:i})}copy(e,t,i){const{coords1:s,coords2:o}=this.getCoords(e,i);if(!s||!o)return;const n=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:yd.start(s),end:yd.end(s),endRetracement:yd.end(o),translation:{x:-n.width/2,y:-n.height/2},context:i}),t}getCoords(e,t){return{coords1:cr(e,t),coords2:cr({start:e.end,end:e.endRetracement},t)}}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e,this.endRetracement.visible=e;else for(const[t,i]of Object.entries(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end"),this.endRetracement.toggleHovered(this.activeHandle==="endRetracement")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e),this.endRetracement.toggleActive(e)}updateHandles(e,t,i,s){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",s)}),i&&this.endRetracement.update({...this.getHandleStyles(e),...this.getHandleCoords(e,i,"endRetracement",s)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1),this.endRetracement.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return i==="start"?yd.start(t):yd.end(t)}},{StateMachine:jl,StateMachineProperty:nk,Debug:tte}=L,ix=class extends jl{constructor(e){const t=({point:c})=>{const d=this.createDatum();d.set({start:c,end:c}),e.create(d)},i=()=>{const{node:c}=this;c?.toggleActive(!0),c?.toggleHandles({start:!0,end:!1,endRetracement:!1})},s=({offset:c,context:d})=>{const{datum:h,snapping:u}=this;h&&(h.set({end:em(c,d,u,h.start,h.snapToAngle)}),e.update())},o=()=>{const{datum:c}=this;c&&(c.endRetracement.x=c.end.x,c.endRetracement.y=c.end.y,this.node?.toggleHandles({end:!0}),e.update())},n=({offset:c,context:d})=>{const{datum:h,snapping:u}=this;h&&(h.set({endRetracement:em(c,d,u,h.end,h.snapToAngle)}),e.update())},r=()=>{this.node?.toggleHandles({endRetracement:!0}),e.update()},a=()=>e.delete(),l=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:jl.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:"endRetracement",action:o},drag:s,dragEnd:{target:"endRetracement",action:o},reset:{target:jl.parent,action:a},cancel:{target:jl.parent,action:a},onExit:l},endRetracement:{hover:n,click:{target:jl.parent,action:r},drag:{target:jl.parent,action:r},reset:{target:jl.parent,action:a},cancel:{target:jl.parent,action:a}}}),this.debug=tte.create(!0,"annotations"),this.snapping=!1}createDatum(){return new _r}};v([nk()],ix.prototype,"datum");v([nk()],ix.prototype,"node");v([nk()],ix.prototype,"snapping");var XP={type:"fibonacci-retracement-trend-based",datum:_r,scene:lv,isDatum:_r.is,translate:(e,t,i,s)=>{_r.is(t)&&lv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(_r.is(t)&&_r.is(i)&&lv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{_r.is(t)&&lv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new ix({...e,create:t("fibonacci-retracement-trend-based")}),dragState:e=>new pi(e)},{Vec2:ite,Vec4:ZP}=L,cv=class extends cH{constructor(){super(),this.type="fibonacci-retracement",this.start=new Kt,this.end=new Kt,this.append([this.start,this.end])}static is(e){return $i.isCheck(e,"fibonacci-retracement")}containsPoint(e,t){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...ex({start:e.start,end:e.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,translation:ite.sub(t,s.offset),context:i})}dragHandle(e,t,i,s){const{activeHandle:o,dragState:n}=this;if(!o||!n)return;this[o].toggleDragging(!0);const r=s?this.snapToAngle(e,t,i):Pt(this[o].drag(t).point,i);!r||!dr(i,r)||(e[o].x=r.x,e[o].y=r.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,n=["start","end"].find(a=>a!==s);if(!s||!n)return;this[s].toggleDragging(!0);const r=Ut(e[n],i);return Pt(Jm(t,r,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,translation:s,context:o}){const{vectors:n,translateX:r,translateY:a}=ZR({start:t,end:i},s,o);r&&(e.start.x=n.start?.x,e.end.x=n.end?.x),(this.ignoreYBounds||a)&&(e.start.y=n.start?.y,e.end.y=n.end?.y)}translate(e,t,i){this.translatePoints({datum:e,start:Ut(e.start,i),end:Ut(e.end,i),translation:t,context:i})}copy(e,t,i){const s=cr(e,i);if(!s)return;const o=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:{x:s.x1,y:s.y1},end:{x:s.x2,y:s.y2},translation:{x:-o.width/2,y:-o.height/2},context:i}),t}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e;else for(const[t,i]of Object.entries(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}updateHandles(e,t,i,s){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",s)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return i==="start"?ZP.start(t):ZP.end(t)}},{StateMachine:su,StateMachineProperty:rk,Debug:ste}=L,_p=class extends su{constructor(e){const t=({point:a})=>{const l=this.createDatum();l.set({start:a,end:a}),e.create(l)},i=()=>{const{node:a}=this;a?.toggleActive(!0),a?.toggleHandles({start:!0,end:!1})},s=({offset:a,context:l})=>{const{datum:c,snapping:d}=this;c&&(c.set({end:em(a,l,d,c.start,c.snapToAngle)}),e.update())},o=()=>{this.node?.toggleHandles({end:!0}),e.update()},n=()=>e.delete(),r=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:su.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:su.parent,action:o},drag:s,dragEnd:{target:su.parent,action:o},reset:{target:su.parent,action:n},cancel:{target:su.parent,action:n},onExit:r}}),this.debug=ste.create(!0,"annotations"),this.snapping=!1}};v([rk()],_p.prototype,"datum");v([rk()],_p.prototype,"node");v([rk()],_p.prototype,"snapping");var ote=class extends _p{createDatum(){return new Fa}},nte=class extends _p{createDatum(){return new Ba}},rte=class extends _p{createDatum(){return new Ga}},qP={type:"fibonacci-retracement",datum:Ga,scene:cv,isDatum:Ga.is,translate:(e,t,i,s)=>{Ga.is(t)&&cv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Ga.is(t)&&Ga.is(i)&&cv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Ga.is(t)&&cv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new rte({...e,create:t("fibonacci-retracement")}),dragState:e=>new pi(e)},{Vec2:Sg}=L,ate=class extends L.Group{},nb=class extends ate{constructor(){super(),this.type="arrow",this.path=new L.Path,this.armLength=6,this.append([this.path])}update(e){const{path:t}=this,{x:i,y:s,angle:o,...n}=e,r=Sg.from(i,s),a=3*Math.PI/4,l=this.armLength+(e.strokeWidth??0)*2,c=Sg.rotate(Sg.from(0,l),o+a,r),d=Sg.rotate(Sg.from(l,0),o-a,r);t.setProperties(n),t.fillOpacity=0,t.path.clear(),t.path.moveTo(c.x,c.y),t.path.lineTo(r.x,r.y),t.path.lineTo(d.x,d.y)}},{Vec2:Hn,Vec4:QP}=L,vc=class extends QR{constructor(){super(),this.type="line",this.line=new po,this.append([this.line,this.start,this.end])}static is(e){return $i.isCheck(e,"line")}update(e,t){let i=cr(e,t);if(i==null){this.visible=!1;return}i=QP.round(i),this.visible=e.visible??!0,this.visible&&(this.updateLine(e,i,t),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateAnchor(e,i,t))}updateLine(e,t,i){const{line:s}=this,{lineDashOffset:o,stroke:n,strokeWidth:r,strokeOpacity:a}=e,l=this.extendLine(t,e,i);s.setProperties({...l,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:o,stroke:n,strokeWidth:r,strokeOpacity:a,fillOpacity:0})}updateText(e,t){this.text=this.updateNode(nh,this.text,!!e.text.label),_u(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}updateCaps(e,t){if(!e.startCap&&this.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),!e.endCap&&this.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),!e.startCap&&!e.endCap)return;const{stroke:i,strokeWidth:s,strokeOpacity:o}=e,[n,r]=Hn.from(t),a=Hn.angle(Hn.sub(r,n));e.startCap&&(this.startCap&&this.startCap.type!==e.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),this.startCap==null&&(this.startCap=new nb,this.append([this.startCap])),this.startCap.update({x:n.x,y:n.y,angle:a-Math.PI,stroke:i,strokeWidth:s,strokeOpacity:o})),e.endCap&&(this.endCap&&this.endCap.type!==e.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),this.endCap==null&&(this.endCap=new nb,this.append([this.endCap])),this.endCap.update({x:r.x,y:r.y,angle:a,stroke:i,strokeWidth:s,strokeOpacity:o}))}updateAnchor(e,t,i,s){const o=QP.topCenter(t);Hn.apply(this.anchor,L.Transformable.toCanvasPoint(this.line,o.x,o.y))}containsPoint(e,t){const{line:i,text:s}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||!!s?.containsPoint(e,t)}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.line.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}getHandleCoords(e,t,i,s){const{startCap:o,endCap:n}=this;let[r,a]=Hn.from(t);const l=Hn.angle(Hn.sub(a,r));return o&&(r=Hn.rotate(Hn.from(0,-Kt.HANDLE_SIZE/2),l,r)),n&&(a=Hn.rotate(Hn.from(0,Kt.HANDLE_SIZE/2),l,a)),i==="start"?r:a}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},JP={type:"line",datum:Ba,scene:vc,isDatum:Ba.is,translate:(e,t,i,s)=>{Ba.is(t)&&vc.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Ba.is(t)&&Ba.is(i)&&vc.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Ba.is(t)&&vc.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new nte({...e,create:t("line")}),dragState:e=>new pi(e)},eN={type:"arrow",datum:Fa,scene:vc,isDatum:Fa.is,translate:(e,t,i,s)=>{Fa.is(t)&&vc.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Fa.is(t)&&Fa.is(i)&&vc.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Fa.is(t)&&vc.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new ote({...e,create:t("arrow")}),dragState:e=>new pi(e)};function tN(e,t=0,i=0){let s=t;for(const o of e)if(Array.isArray(o)){for(const n of o)iN(n,s);s+=L.Group.computeChildrenBBox(o).width+i}else iN(o,s),s+=o.getBBox().width+i}function lte(e,t=0,i=0){let s=t;for(const o of e)if(Array.isArray(o)){for(const n of o)sN(n,s);s+=L.Group.computeChildrenBBox(o).height+i}else sN(o,s),s+=o.getBBox().height+i}function iN(e,t){"x1"in e?(e.x2=t+(e.x2-e.x1),e.x1=t):e.x=t}function sN(e,t){"y1"in e?(e.y2=t+(e.y2-e.y1),e.y1=t):e.y=t}function oN(e,t){"x1"in e?(e.x1+=t,e.x2+=t):e.x+=t}function nN(e,t){"y1"in e?(e.y1+=t,e.y2+=t):e.y+=t}var{Vec4:Qw}=L,dH=class extends L.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new L.Rect,this.dateRangeBarsText=new L.Text,this.dateRangeDivider=new L.Line,this.dateRangeValueText=new L.Text,this.priceRangeValueText=new L.Text,this.priceRangeDivider=new L.Line,this.priceRangePercentageText=new L.Text,this.volumeText=new L.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(e,t,i,s,o,n,r){this.verticalDirection=n;const a=this.updateStatistics(e,t,i,r),l=L.Group.computeChildrenBBox(a.flat()),c=10;l.grow(c),this.updateBackground(e,l,c),this.reposition(a,c,o),this.checkVisibility(e,o,s)}checkVisibility(e,t,i){const s=Qw.from(new L.BBox(0,0,t.seriesRect.width,t.seriesRect.height));Qw.collides(i,s)?this.visible=e.visible??!0:this.visible=!1}updateStatistics(e,t,i,s){const{dateRangeBarsText:o,dateRangeDivider:n,dateRangeValueText:r,priceRangeValueText:a,priceRangeDivider:l,priceRangePercentageText:c,volumeText:d}=this,h=8,u=6,p=e.statistics.fontSize+3,g=-2,f=this.getTextStyles(e),y={...this.getDividerStyles(e),x1:0,y1:0,x2:0,y2:p},m=[o,n,r],C=[a,l,c],b=[];return t.priceRange&&(a.setProperties({...f,text:this.formatPriceRangeValue(t.priceRange.value,s)}),l.setProperties(y),c.setProperties({...f,text:this.formatPriceRangePercentage(t.priceRange.percentage,s)}),tN(C,i.x,h),b.push(C)),t.dateRange&&(o.setProperties({...f,text:this.formatDateRangeBars(t.dateRange.bars,s)}),n.setProperties(y),r.setProperties({...f,text:this.formatDateRangeValue(t.dateRange.value)}),tN(m,i.x,h),b.push(m)),t.volume!=null?(d.setProperties({...f,x:i.x,text:this.formatVolume(t.volume,s),visible:!0}),b.push(d)):d.visible=!1,lte(b,i.y,u),l.y1+=g,l.y2+=g,n.y1+=g,n.y2+=g,b}updateBackground(e,t,i){const s=this.getBackgroundStyles(e);this.background.setProperties({...s,...t,x:t.x-t.width/2+i,y:t.y})}reposition(e,t,i){const{width:s,height:o}=i.seriesRect,n=Qw.from(this.background.getBBox());let r=0;n.x1<0&&(r=-n.x1),n.x2>s&&(r=s-n.x2);const a=Math.min(t,o-n.y2);for(const l of e)if(Array.isArray(l)){const c=L.Group.computeChildrenBBox(l).width;for(const d of l)oN(d,r-c/2),nN(d,a)}else oN(l,r-l.getBBox().width/2),nN(l,a);this.background.x+=r,this.background.y+=a}getTextStyles(e){return{fill:e.statistics.color,fontFamily:e.statistics.fontFamily,fontSize:e.statistics.fontSize,fontStyle:e.statistics.fontStyle,fontWeight:e.statistics.fontWeight,textBaseline:"top"}}getDividerStyles(e){return{stroke:e.statistics.divider.stroke,strokeOpacity:e.statistics.divider.strokeOpacity,strokeWidth:e.statistics.divider.strokeWidth}}getBackgroundStyles(e){return{fill:e.statistics.fill,stroke:e.statistics.stroke,strokeOpacity:e.statistics.strokeOpacity,strokeWidth:e.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(e,t){return t?.t("measurerDateRangeBars",{value:e})??`${e}`}formatDateRangeValue(e){const t=[],i=e>=0?"":"-";e=Math.abs(e);const s=1e3*60,o=s*60,n=o*24,r=Math.floor(e/s),a=Math.floor(e/o),l=Math.floor(e/n),c=a%(n/o),d=r%(o/s);return l>=1&&t.push(`${l}d`),a>=1&&(e<n||c!==0)&&t.push(`${c}h`),(e<o||d!==0)&&t.push(`${d}m`),t[0]=`${i}${t[0]}`,t.join(" ")}formatPriceRangeValue(e,t){return t?.t("measurerPriceRangeValue",{value:Number(e.toFixed(2))})??`${e}`}formatPriceRangePercentage(e,t){return t?.t("measurerPriceRangePercent",{value:e})??`${e}`}formatVolume(e,t){const i=isNaN(e)?"":this.volumeFormatter.format(e);return t?.t("measurerVolume",{value:i})??i}},cte=class extends dH{getDirectionStyles(e){return this.verticalDirection==="down"?e.down.statistics:e.up.statistics}getTextStyles(e){const t=this.getDirectionStyles(e);return{...super.getTextStyles(e),fill:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight}}getDividerStyles(e){const t=this.getDirectionStyles(e);return{stroke:t.divider.stroke,strokeOpacity:t.divider.strokeOpacity,strokeWidth:t.divider.strokeWidth}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{...super.getBackgroundStyles(e),fill:t.fill,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth}}},{Vec2:Lr,Vec4:vd}=L,Go=class extends QR{constructor(){super(),this.type="measurer",this.horizontalLine=new po,this.verticalLine=new po,this.horizontalStartLine=new po,this.horizontalEndLine=new po,this.verticalStartLine=new po,this.verticalEndLine=new po,this.horizontalEndCap=new nb,this.verticalEndCap=new nb,this.background=new L.Path({zIndex:-1}),this.updateBackground=rH.updateBackground.bind(this),this.statistics=this.createStatisticsScene(),this.statistics.zIndex=1,this.append([this.background,this.verticalStartLine,this.verticalEndLine,this.horizontalStartLine,this.horizontalEndLine,this.horizontalLine,this.verticalLine,this.horizontalEndCap,this.verticalEndCap,this.start,this.end,this.statistics])}static is(e){return $i.isCheck(e,"measurer")}createStatisticsScene(){return new dH}update(e,t){const i=cr(e,t);if(i==null){this.visible=!1;return}if(this.visible=e.visible??!0,!this.visible)return;const s=this.extendPerpendicular(i,e,t),o={...s,y2:s.y1},n={...s,y1:s.y2};this.verticalDirection=i.y1<i.y2?"down":"up",this.updateVisibilities(e),this.updateLines(e,i),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateBoundingLines(e,s),this.updateBackground(e,o,n,t),this.updateStatistics(e,i,t),this.updateAnchor(e,i,t)}extendPerpendicular(e,t,i){const s={x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)},[o,n]=Lr.from(i.yAxis.bounds);return un.is(t)?(t.extendAbove&&(s.y1=o.y),t.extendBelow&&(s.y2=n.y)):pn.is(t)&&(t.extendLeft&&(s.x1=o.x),t.extendRight&&(s.x2=n.x)),s}updateVisibilities(e){const{horizontalStartLine:t,horizontalEndLine:i,horizontalEndCap:s,verticalStartLine:o,verticalEndLine:n,verticalEndCap:r}=this,{direction:a}=e;o.visible=a!=="vertical",n.visible=a!=="vertical",s.visible=a!=="vertical",t.visible=a!=="horizontal",i.visible=a!=="horizontal",r.visible=a!=="horizontal"}updateLines(e,t){const{horizontalLine:i,verticalLine:s}=this,{direction:o}=e,{x1:n,y1:r,x2:a,y2:l}=t,c=Lr.round(vd.center(t)),d=this.getLineStyles(e);o!=="vertical"&&i.setProperties({...d,x1:n,x2:a,y1:c.y,y2:c.y}),o!=="horizontal"&&s.setProperties({...d,x1:c.x,x2:c.x,y1:r,y2:l})}updateText(e,t){const{direction:i}=e,s=Lr.round(vd.center(t));let o;const n={...t};i==="vertical"?(o=this.verticalLine,n.x1=s.x,n.x2=s.x):(o=this.horizontalLine,n.y1=s.y,n.y2=s.y),this.text=this.updateNode(nh,this.text,!!e.text.label);const{id:r}=o,a=_u(r,o,n,e.text,this.text,e.text.label,e.strokeWidth);let l;if(i==="both"&&a&&this.text){const c=vd.from(this.text.getBBox()),{offset:d}=a.numbers;c.x1<=s.x+d.x&&c.x2>=s.x-d.x&&(l={x:s.x,y:a.clipMask.y,radius:this.text.getBBox().height/2+Lr.length(d)})}this.verticalLine.setClipMask(r,l)}updateCaps(e,t){const{horizontalEndCap:i,verticalEndCap:s}=this,{direction:o}=e,{x1:n,y1:r,x2:a,y2:l}=t,c=Lr.round(vd.center(t)),{stroke:d,strokeWidth:h,strokeOpacity:u}=this.getLineStyles(e),p={stroke:d,strokeWidth:h,strokeOpacity:u};if(o!=="vertical"){const g=n<=a?0:Math.PI;let f=a;o==="horizontal"&&(f+=n<=a?-2:2),i.update({...p,x:f,y:c.y,angle:g})}if(o!=="horizontal"){const g=r<=l?Math.PI/2:Math.PI/-2;let f=l;o==="vertical"&&(f+=r<=l?-2:2),s.update({...p,x:c.x,y:f,angle:g})}}updateBoundingLines(e,t){const{verticalStartLine:i,verticalEndLine:s,horizontalStartLine:o,horizontalEndLine:n}=this,{direction:r}=e,{x1:a,y1:l,x2:c,y2:d}=t,h=this.getLineStyles(e);r==="horizontal"&&(i.setProperties({...h,x1:a,y1:l,x2:a,y2:d}),s.setProperties({...h,x1:c,y1:l,x2:c,y2:d})),r==="vertical"&&(o.setProperties({...h,x1:a,y1:l,x2:c,y2:l}),n.setProperties({...h,x1:a,y1:d,x2:c,y2:d}))}updateStatistics(e,t,i){const s=Lr.add(vd.bottomCenter(t),Lr.from(0,10)),o={volume:this.getVolume(e)};e.hasPriceRange&&(o.priceRange={percentage:this.getPriceRangePercentage(e),value:this.getPriceRangeValue(e)}),e.hasDateRange&&(o.dateRange={bars:this.getDateRangeBars(t,i),value:this.getDateRangeValue(e)}),this.statistics.update(e,o,s,t,i,this.verticalDirection,e.localeManager)}updateAnchor(e,t,i,s){const o=vd.topCenter(t);Lr.apply(this.anchor,L.Transformable.toCanvasPoint(this.horizontalLine,o.x,o.y))}getBackgroundPoints(e,t,i,s){const[o,n]=Lr.from(t),[r,a]=Lr.from(i);return[o,n,a,r]}getLineStyles(e){const{lineDashOffset:t,stroke:i,strokeWidth:s,strokeOpacity:o}=e;return{lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,stroke:i,strokeWidth:s,strokeOpacity:o,fillOpacity:0}}getBackgroundStyles(e){const{background:t}=e;return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}containsPoint(e,t){const{horizontalLine:i,text:s,verticalLine:o,horizontalStartLine:n,horizontalEndLine:r,verticalStartLine:a,verticalEndLine:l}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||o.isPointInPath(e,t)||n.visible&&n.isPointInPath(e,t)||r.visible&&r.isPointInPath(e,t)||a.visible&&a.isPointInPath(e,t)||l.visible&&l.isPointInPath(e,t)||!!s?.containsPoint(e,t)}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":"line"}getDateRangeBars(e,t){const{step:i}=t.xAxis.scale,s=e.x1<=e.x2?1:-1;return i?Math.round(vd.width(e)/i)*s:0}getDateRangeValue(e){const{value:t}=Et(e.start.x),{value:i}=Et(e.end.x);if(!jf(t)||!jf(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-t.getTime()}getPriceRangePercentage(e){if(e.start.y==null||e.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const{value:t}=Et(e.end.y),{value:i}=Et(e.start.y);if(!ri(t)||!ri(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(t-i)/i}getPriceRangeValue(e){if(e.start.y==null||e.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const{value:t}=Et(e.end.y),{value:i}=Et(e.start.y);if(!ri(t)||!ri(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return t-i}getVolume(e){return e.getVolume(e.start.x,e.end.x)}},dv=class extends Go{constructor(){super(...arguments),this.type="quick-measurer"}static is(e){return $i.isCheck(e,"quick-measurer")}createStatisticsScene(){return new cte}getDirectionStyles(e){return this.verticalDirection==="down"?e.down:e.up}getLineStyles(e){const t=this.getDirectionStyles(e);return{...super.getLineStyles(e),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){const t=this.getDirectionStyles(e);return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},{StateMachine:ou,StateMachineProperty:hH,Debug:dte}=L,zp=class extends ou{constructor(e){const t=({point:r})=>{const a=this.createDatum();a.set({start:r,end:r}),e.create(a)},i=({point:r})=>{const{datum:a,node:l}=this;a?.set({end:r}),l?.toggleActive(!0),l?.toggleHandles({end:!1}),e.update()},s=()=>{this.node?.toggleHandles({end:!0})},o=()=>e.delete(),n=()=>{e.showAnnotationOptions(),!mc(this.datum)&&e.recordAction(`Create ${this.node?.type} annotation`)};super("start",{start:{reset:ou.parent,click:{target:"end",action:t},drag:{target:"end",action:t}},end:{hover:i,drag:i,click:{target:ou.parent,action:s},dragEnd:{target:ou.parent,action:s},reset:{target:ou.parent,action:o},cancel:{target:ou.parent,action:o},onExit:n}}),this.debug=dte.create(!0,"annotations")}};v([hH()],zp.prototype,"datum");v([hH()],zp.prototype,"node");var hte=class extends zp{createDatum(){return new un}},ute=class extends zp{createDatum(){return new pn}},pte=class extends zp{createDatum(){return new Oa}},gte=class extends zp{createDatum(){return new Fo}},rN={type:"date-range",datum:un,scene:Go,isDatum:un.is,translate:(e,t,i,s)=>{un.is(t)&&Go.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(un.is(t)&&un.is(i)&&Go.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{un.is(t)&&Go.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new hte({...e,create:t("date-range")}),dragState:e=>new pi(e)},aN={type:"price-range",datum:pn,scene:Go,isDatum:pn.is,translate:(e,t,i,s)=>{pn.is(t)&&Go.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(pn.is(t)&&pn.is(i)&&Go.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{pn.is(t)&&Go.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new ute({...e,create:t("date-range")}),dragState:e=>new pi(e)},lN={type:"date-price-range",datum:Oa,scene:Go,isDatum:Oa.is,translate:(e,t,i,s)=>{Oa.is(t)&&Go.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Oa.is(t)&&Oa.is(i)&&Go.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Oa.is(t)&&Go.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new pte({...e,create:t("date-range")}),dragState:e=>new pi(e)},cN={type:"quick-date-price-range",datum:Fo,scene:dv,isDatum:Fo.is,translate:(e,t,i,s)=>{Fo.is(t)&&dv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Fo.is(t)&&Fo.is(i)&&dv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Fo.is(t)&&dv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new gte({...e,create:t("quick-date-price-range")}),dragState:e=>new pi(e)},{ZIndexMap:dN,TextWrapper:fte,clamp:mte}=L,hv=class extends ik{constructor(){super(),this.type="note",this.shape=new L.Rect,this.iconBackground=new L.SvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new L.SvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new L.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(e){return $i.isCheck(e,"note")}update(e,t){this.updateIcon(e,t),super.update(e,t)}getTextBBox(e,t,i){const s=super.getTextBBox(e,t,i);s.x-=e.width/2,s.x=mte(0,s.x,i.seriesRect.width-e.width);const o=e.getPadding().top,n=s.y-IV-o*2,r=s.y+Kt.HANDLE_SIZE+o*2;return n-s.height-RV<0?(s.y=r,e.position="top"):(s.y=n+o,e.position="bottom"),s}updateLabel(e,t){const i=e.visible===!1?!1:this.label.visible;super.updateLabel(e,t),this.label.visible=i,this.label.text=fte.wrapText(e.text,{font:{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},avoidOrphans:!1,textAlign:e.textAlign,textBaseline:"hanging",textWrap:"always",maxWidth:200})}updateShape(e,t){const{shape:i}=this;i.fill=e.background.fill,i.fillOpacity=e.background.fillOpacity??1,i.stroke=e.background.stroke,i.strokeOpacity=e.background.strokeOpacity??1,i.strokeWidth=e.background.strokeWidth??1,i.cornerRadius=4;const s=e.getPadding().top,o=e.position==="top";i.x=t.x-s,i.width=e.width+s*2,i.height=t.height+s*2,i.y=t.y+(o?0:-t.height)-s}updateIcon(e,t){const{active:i,iconBackground:s,iconLines:o}=this,{x:n,y:r}=Ut(e,t);s.x=n-MJ/2,s.y=r-AV,o.x=s.x,o.y=s.y,s.fill=e.fill,s.fillOpacity=e.fillOpacity??1,s.stroke=e.stroke,s.strokeOpacity=e.strokeOpacity??1,s.strokeWidth=e.strokeWidth??1,o.fill=e.stroke,i?s.fillShadow.color=e.fill??"rgba(0, 0, 0, 0.22)":s.fillShadow.color="rgba(0, 0, 0, 0.22)"}updateAnchor(e,t,i){const s=e.getPadding().top,o=e.position==="top",n=o?1:-1;return{x:t.x+i.seriesRect.x+e.width/2,y:t.y+i.seriesRect.y+n*(t.height+s),position:o?"below":"above"}}getLabelCoords(e,t){const i=e.position==="top",s=e.getPadding().top;return{x:t.x,y:t.y+(i?s/2:0)}}getHandleCoords(e,t,i){return{x:t.x,y:t.y+Kt.HANDLE_SIZE/2+4}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}toggleHovered(e){super.toggleHovered(e),this.label.visible=e,this.shape.visible=e,this.zIndex=e?dN.CHART_ANNOTATION_FOCUSED:dN.CHART_ANNOTATION}toggleActive(e){super.toggleActive(e),this.label.visible=e,this.shape.visible=e,this.active=e}containsPoint(e,t){return this.shape.visible&&this.shape.containsPoint(e,t)||this.iconBackground.containsPoint(e,t)?!0:super.containsPoint(e,t)}},yte=class extends ey{createDatum(){return new uo}},hN={type:"note",datum:uo,scene:hv,isDatum:uo.is,translate:(e,t,i,s)=>{uo.is(t)&&hv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(uo.is(t)&&uo.is(i)&&hv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{uo.is(t)&&hv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new yte({...e,create:t("note")}),dragState:e=>new pi(e)},{Vec2:Er,Vec4:nu}=L,uv=class extends aH{constructor(){super(),this.type="parallel-channel",this.ignoreYBounds=!0,this.handles={topLeft:new Kt,topMiddle:new Ru,topRight:new Kt,bottomLeft:new Kt,bottomMiddle:new Ru,bottomRight:new Kt},this.middleLine=new po,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return $i.isCheck(e,"parallel-channel")}dragHandle(e,t,i,s){const{activeHandle:o,handles:n}=this;if(o==null)return;const{offset:r}=n[o].drag(t);n[o].toggleDragging(!0);const a=e.toJson();let l=[],c=[];switch(o){case"topLeft":case"bottomLeft":l=["topLeft","bottomLeft"],c=["topRight","bottomRight"];break;case"topMiddle":l=["topLeft","topRight"],r.y-=Ru.HANDLE_SIZE/2;break;case"topRight":case"bottomRight":l=["topRight","bottomRight"],c=["topLeft","bottomLeft"];break;case"bottomMiddle":l=["bottomLeft","bottomRight"],r.y-=Ru.HANDLE_SIZE/2;break}const d=e.snapToAngle,h=l.map((p,g)=>s&&c[g]?this.snapToAngle(t,i,p,c[g],d):Pt(Er.add(n[p].handle,r),i)).filter(kJ);if(h.some(p=>!dr(i,p,{y:!1})))return;const{value:u}=Et(e.start.y);if((o==="topMiddle"||o==="bottomMiddle")&&u!=null&&ri(u)){const p=Pt(Er.add(n.topLeft.handle,r),i);o==="topMiddle"?e.height+=p.y-u:e.height-=p.y-u}for(const[p,g]of h.entries())switch(l[p]){case"topLeft":e.start.x=g.x,e.start.y=g.y;break;case"topRight":e.end.x=g.x,e.end.y=g.y;break}e.isValidWithContext(i)||e.set(a)}containsPoint(e,t){return super.containsPoint(e,t)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)}getNodeAtCoords(e,t){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)?"line":super.getNodeAtCoords(e,t)}updateLines(e,t,i,s,o,n){const{topLine:r,middleLine:a,bottomLine:l}=this,{lineDashOffset:c,stroke:d,strokeOpacity:h,strokeWidth:u}=e,p=e.getLineDash(),g={lineCap:e.getLineCap(),lineDash:p,lineDashOffset:c,stroke:d,strokeOpacity:h,strokeWidth:u};r.setProperties({...t,...g}),l.setProperties({...i,...g});const f=this.extendLine({x1:o.x1,y1:n.y1+(o.y1-n.y1)/2,x2:o.x2,y2:n.y2+(o.y2-n.y2)/2},e,s);a.setProperties({...f,lineDash:e.middle.lineDash??p,lineDashOffset:e.middle.lineDashOffset??c,stroke:e.middle.stroke??d,strokeOpacity:e.middle.strokeOpacity??h,strokeWidth:e.middle.strokeWidth??u,visible:e.middle.visible??!0})}updateHandles(e,t,i){const{handles:{topLeft:s,topMiddle:o,topRight:n,bottomLeft:r,bottomMiddle:a,bottomRight:l}}=this,c={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...c,...nu.start(t)}),n.update({...c,...nu.end(t)}),r.update({...c,...nu.start(i)}),l.update({...c,...nu.end(i)}),o.update({...c,...Er.sub(nu.center(t),Er.from(o.handle.width/2,o.handle.height/2))}),a.update({...c,...Er.sub(nu.center(i),Er.from(a.handle.width/2,a.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(nh,this.text,!!e.text.label),iH(!0,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,s){const o=t.x1>t.x2,n=t.y1>t.y2,r=t.x1!==i.x1&&t.y1!==i.y1,a=t.x2!==i.x2&&t.y2!==i.y2,l=Er.from(t);return e.extendEnd&&a&&l.push(Er.from(o?s.x1:s.x2,n?s.y1:s.y2)),l.push(...Er.from(i).reverse()),e.extendStart&&r&&l.push(Er.from(o?s.x2:s.x1,n?s.y2:s.y1)),l}},{StateMachine:Ul,StateMachineProperty:ak,Debug:vte}=L,sx=class extends Ul{constructor(e){const t=({point:l})=>{const c=new fn;c.set({start:l,end:l,height:0}),e.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})},s=({offset:l,context:c})=>{const{datum:d,snapping:h}=this;d&&(d.set({end:em(l,c,h,d.start,d.snapToAngle)}),e.update())},o=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},n=({point:l})=>{const{datum:c,node:d}=this,{value:h}=Et(c?.end.y),{value:u}=Et(c?.start.y),{y:p}=l;if(c==null||!ri(u)||!ri(h)||!ri(p))return;const g=h-(p??0),f=u-g;d?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint({x:c.start.x,y:f})||!e.validatePoint({x:c.end.x,y:l.y}))&&(c.set({height:g}),e.update())},r=({point:l})=>{const{datum:c,node:d}=this,{value:h}=Et(c?.end.y),{value:u}=Et(c?.start.y),{y:p}=l;if(c==null||!ri(u)||!ri(h)||!ri(p))return;const g=h-(p??0),f=u-g;d?.toggleHandles(!0),!(!e.validatePoint({x:c.start.x,y:f})||!e.validatePoint({x:c.end.x,y:l.y}))&&(c.set({height:g}),e.recordAction("Create parallel-channel annotation"),e.showAnnotationOptions(),e.update())},a=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Ul.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:o},dragEnd:{target:"height",action:o},reset:{target:Ul.parent,action:a},cancel:{target:Ul.parent,action:a}},height:{hover:n,click:{target:Ul.parent,action:r},drag:{target:Ul.parent,action:r},reset:{target:Ul.parent,action:a},cancel:{target:Ul.parent,action:a}}}),this.debug=vte.create(!0,"annotations"),this.snapping=!1}};v([ak()],sx.prototype,"datum");v([ak()],sx.prototype,"node");v([ak()],sx.prototype,"snapping");var uN={type:"parallel-channel",datum:fn,scene:uv,isDatum:fn.is,translate:(e,t,i,s)=>{fn.is(t)&&uv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(fn.is(t)&&fn.is(i)&&uv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{fn.is(t)&&uv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new sx({...e,create:t("parallel-channel")}),dragState:e=>new pi(e)},pv=class extends ik{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(e){return $i.isCheck(e,"text")}getHandleCoords(e,t){const i=Kt.HANDLE_SIZE/2;return{x:t.x+i,y:t.y+2+i}}},Cte=class extends ey{createDatum(){return new _a}},pN={type:"text",datum:_a,scene:pv,isDatum:_a.is,translate:(e,t,i,s)=>{_a.is(t)&&pv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(_a.is(t)&&_a.is(i)&&pv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{_a.is(t)&&pv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Cte({...e,create:t("text")}),dragState:e=>new pi(e)},Oo={[JP.type]:JP,[UP.type]:UP,[KP.type]:KP,[uN.type]:uN,[$P.type]:$P,[qP.type]:qP,[XP.type]:XP,[WP.type]:WP,[jP.type]:jP,[hN.type]:hN,[pN.type]:pN,[eN.type]:eN,[GP.type]:GP,[BP.type]:BP,[rN.type]:rN,[aN.type]:aN,[lN.type]:lN,[cN.type]:cN};function Vd(e){for(const{isDatum:t}of Object.values(Oo))if(t(e))return e}var{ActionOnSet:bte,ParallelStateMachine:Ste,StateMachine:lk,StateMachineProperty:ua,Debug:xte}=L,ox=class extends Ste{constructor(e){super(new wte(t=>{this.snapping=t}),new Mte(()=>{this.node=this.active==null?void 0:e.node(this.active)}),new Kc(e,t=>{this.active=t,this.datum=this.active==null?void 0:e.datum(this.active),this.node=this.active==null?void 0:e.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(e){return e===this.active}};v([ua()],ox.prototype,"snapping");v([ua()],ox.prototype,"datum");v([ua()],ox.prototype,"node");var wte=class extends lk{constructor(e){super("idle",{idle:{hover:({shiftKey:t})=>e(t),keyDown:({shiftKey:t})=>e(t),keyUp:({shiftKey:t})=>e(t),click:({shiftKey:t})=>e(t),drag:({shiftKey:t})=>e(t)},dragging:{},"text-input":{}})}},Mte=class extends lk{constructor(e){super("idle",{idle:{onEnter:e,render:e},dragging:{onEnter:e,render:e},"text-input":{render:e}})}},Kc=class extends lk{constructor(e,t){const i=b=>S=>{e.create(b,S),this.active=e.selectLast()},s=()=>{this.active!=null&&e.delete(this.active),this.active=void 0,e.select()},o={createDatum:i},n={...e,delete:s,showTextInput:()=>{this.active!=null&&e.showTextInput(this.active)},deselect:()=>{const b=this.active;this.active=void 0,this.hovered=void 0,e.select(this.active,b)},showAnnotationOptions:()=>{this.active!=null&&e.showAnnotationOptions(this.active)}},r=Object.fromEntries(Object.entries(Oo).map(([b,S])=>[b,S.createState(n,o)])),a=Object.fromEntries(Object.entries(Oo).map(([b,S])=>[b,S.dragState(e,o)])),l=({colorPickerType:b,colorOpacity:S,color:A,opacity:R,isMultiColor:I})=>{this.datum&&(b==="text-color"&&e.updateTextInputColor(A),QS(this.datum,b,S,A,R,I),e.update())},c=b=>{const{datum:S,node:A}=this;!S||!A||(Xr(S)?(S.fontSize=b,e.updateTextInputFontSize(b)):Gu(S)&&(S.text.fontSize=b),e.update())},d=b=>{const{datum:S,node:A}=this;!S||!A||!Ql(S)||(_V(S,b),e.update())},h=b=>{const{node:S}=this;!S||!("setTextInputBBox"in S)||(S.setTextInputBBox(b),e.update())},u=({textInputValue:b,bbox:S})=>{const{datum:A}=this;if(S!=null&&b!=null&&b.length>0){if(!Xr(A))return;const R=KS(A,b,S.width);A.set({text:R}),e.update(),e.recordAction(`Change ${A.type} annotation text`)}else e.delete(this.active),e.recordAction(`Delete ${A?.type} annotation`)},p=()=>{e.updateTextInputBBox(void 0)},g=()=>this.active!=null,f=()=>this.copied!=null,y=()=>{const{active:b,datum:S}=this;return b==null||!S?!1:Gu(S)&&!S.locked},m=()=>this.active!=null&&!mc(this.datum),C=()=>this.hovered!=null;super("idle",{idle:{onEnter:()=>{e.select(this.active,this.active),this.hoverCoords&&(this.hovered=e.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:b})=>{this.hovered=e.hoverAtCoords(b,this.active,this.hovered),this.hoverCoords=b},translate:{guard:g,action:({translation:b})=>{e.startInteracting(),e.translate(this.active,b),e.update()}},translateEnd:{guard:g,action:()=>{e.stopInteracting()}},copy:{guard:m,action:()=>{this.copied=e.copy(this.active)}},cut:{guard:m,action:()=>{this.copied=e.copy(this.active),s()}},paste:{guard:f,action:()=>{e.paste(this.copied)}},selectLast:()=>{const b=this.active;this.active=e.selectLast(),e.select(this.active,b)},click:[{guard:()=>{const{active:b,hovered:S,datum:A}=this;return b==null||S!==b||!A?!1:Xr(A)&&!A.locked},target:"text-input"},{action:()=>{const b=this.active;this.active=this.hovered,e.select(this.active,b)}}],dblclick:{guard:y,action:({offset:b})=>{const S=e.getNodeAtCoords(b,this.active)==="text"?"text":"line";e.showAnnotationSettings(this.active,void 0,S)}},dragStart:[{guard:C,target:"dragging",action:()=>{const b=this.active;this.active=this.hovered,e.select(this.active,b),e.startInteracting()}},{action:()=>{const b=this.active;this.active=this.hovered,e.select(this.active,b)}}],color:{guard:g,action:l},fontSize:{guard:g,action:c},lineProps:{guard:g,action:b=>{const S=Vd(this.datum);S?.set(b),e.update(),e.recordAction(`Change ${S?.type} ${Object.entries(b).map(([A,R])=>`${A} to ${R}`).join(", ")}`)}},lineStyle:{guard:g,action:d},lineText:{guard:g,action:b=>{const S=Vd(this.datum);Gu(S)&&(Xa(S)&&b.position==="center"&&(b.position="inside"),S.text.set(b),e.update())}},updateTextInputBBox:{guard:g,action:h},toolbarPressSettings:{guard:y,action:b=>{e.showAnnotationSettings(this.active,b)}},reset:()=>{this.active!=null&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,e.select(this.active,this.active),e.resetToIdle()},delete:()=>{this.active!=null&&(e.delete(this.active),!mc(this.datum)&&e.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{e.deleteAll()},...r},dragging:{onEnter:(b,S)=>{if(this.active==null)return;const A=e.getAnnotationType(this.active);A&&(this.transitionRoot(A),this.transitionRoot("dragStart",S))},...a},"text-input":{onEnter:()=>{if(this.active==null)return;const b=Vd(this.datum);!b||!("getTextInputCoords"in b)||(e.startInteracting(),e.showTextInput(this.active),b.visible=!1,e.update())},updateTextInputBBox:{guard:g,action:h},resize:{target:"idle",action:u},click:{target:"idle",action:u},drag:{target:"idle",action:u},textInput:[{guard:JR,target:"idle",action:p},{guard:ek,target:"idle",action:u}],color:{guard:g,action:l},fontSize:{guard:g,action:c},cancel:{target:"idle",action:p},onExit:()=>{e.stopInteracting(),e.hideTextInput();const b=this.active;if(this.active=this.hovered=void 0,e.select(this.active,b),b==null)return;const S=e.datum(b),A=e.node(b);!S||!A||(S.visible=!0)}}}),this.setActive=t,this.debug=xte.create(!0,"annotations"),this.snapping=!1}};v([bte({changeValue(e){this.setActive(e)}}),ua()],Kc.prototype,"active");v([ua()],Kc.prototype,"hovered");v([ua()],Kc.prototype,"hoverCoords");v([ua()],Kc.prototype,"copied");v([ua()],Kc.prototype,"snapping");v([ua()],Kc.prototype,"datum");v([ua()],Kc.prototype,"node");var{ARRAY:Dte,BOOLEAN:Ate,UNION:Ite,POSITIVE_NUMBER:Rte,ActionOnSet:kte,LayoutElement:Tte,Menu:Lte,PropertiesArray:Ete,ToolbarButtonProperties:Pte,Validate:nx,ChartAxisDirection:Nte}=L,uH=class extends Pte{};v([nx(Ite(["line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","clear"]))],uH.prototype,"value");var rx=class extends L.BaseProperties{constructor(e){super(),this.ctx=e,this.enabled=!0,this.padding=20,this.buttons=new Ete(uH),this.events=new L.Listeners,this.annotationMenu=new Lte(this.ctx,"annotations"),this.destroyFns=[],this.toolbar=e.sharedToolbar.getSharedToolbar("annotations");const t=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",t),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),e.layoutManager.registerElement(Tte.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",t),this.toolbar.destroy()})}destroy(){for(const e of this.destroyFns)e()}addListener(e,t){return this.events.addListener(e,t)}toggleVisibility(e){this.toolbar.setHidden(!e)}toggleClearButtonEnabled(e){const t=this.buttons.findIndex(i=>i.value==="clear");this.toolbar.toggleButtonEnabledByIndex(t,e)}resetButtonIcons(){for(const[e,t]of this.buttons.entries())switch(t.value){case"line-menu":this.updateButtonByIndex(e,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(e,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(e,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(e,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(e,{icon:"measurer-drawing",value:"measurer-menu"});break}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}dispatch(e,t){this.events.dispatch(e,t)}onLayoutStart(e){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(e.layoutBox,this.padding))}refreshButtonsEnabled(e){for(const[t,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(t,e)}onToolbarButtonPress({event:e,button:t,buttonBounds:i}){const s=this.ctx.axisManager.getAxisContext(Nte.Y)[0].scale;switch(t.value){case"clear":this.dispatch("pressed-clear");break;case"line-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsLineAnnotations",see.filter(o=>o.visible?o.visible(s):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsFibonacciAnnotations",oee);break;case"text-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsTextAnnotations",ree);break;case"shape-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsShapeAnnotations",aee);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsMeasurerAnnotations",lee);break}}onToolbarButtonPressShowMenu(e,t,i,s,o){this.dispatch("pressed-show-menu");const n=this.buttons.findIndex(r=>r.value===i);this.toolbar.toggleActiveButtonByIndex(n),this.annotationMenu.setAnchor({x:t.x+t.width+6,y:t.y}),this.annotationMenu.show({items:o,ariaLabel:this.ctx.localeManager.t(s),class:"ag-charts-annotations__toolbar-menu",sourceEvent:e.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,i)})}onButtonPressMenuCreateAnnotation(e,t){const i=this.buttons.findIndex(s=>s.value===e);this.updateButtonByIndex(i,{icon:t.icon}),this.dispatch("pressed-create-annotation",{annotation:t.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:e}){e.key==="Escape"&&this.dispatch("cancel-create-annotation")}updateButtonByIndex(e,t){const i=this.buttons.at(e);i&&(i.set({...i.toJson(),...t,value:t.value??i.value}),this.toolbar.updateButtonByIndex(e,{...i.toJson()}))}};v([nx(Ate),kte({changeValue(e){this.toolbar?.setHidden(!e)}})],rx.prototype,"enabled");v([nx(Rte)],rx.prototype,"padding");v([nx(Dte)],rx.prototype,"buttons");var{BaseModuleInstance:Ote,InteractionState:xg,Validate:Fte,BOOLEAN:Bte,ChartAxisDirection:Gte,getIconClassNames:_te}=L,Ug="ag-charts-annotations__axis-button",pH=class extends Ote{constructor(e,t,i,s){super(),this.ctx=e,this.axisCtx=t,this.onButtonClick=i,this.seriesRect=s,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=!!t.scale.bandwidth,e.domManager.addEventListener("focusin",({target:o})=>{const n=o instanceof HTMLElement?o:void 0;!(n&&e.domManager.contains(n,"series-area"))&&n!==this.button.getElement()&&this.hide()}),this.destroyFns.push(e.widgets.seriesWidget.addListener("drag-move",o=>this.onMouseDrag(o)),e.widgets.seriesWidget.addListener("mousemove",o=>this.onMouseMove(o)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),e.widgets.seriesDragInterpreter.addListener("click",o=>this.onClick(o)),e.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),e.zoomManager.addListener("zoom-pan-start",()=>this.hide()),e.zoomManager.addListener("zoom-change",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(e,t){this.seriesRect=e,this.padding=t}setup(){const e=new Vz.ButtonWidget;return e.addClass(Ug),e.setTabIndex(-1),e.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(e.getElement()),e}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",Ug)}onMouseMove(e){this.ctx.interactionManager.isState(xg.Clickable)&&this.show(e)}onMouseDrag(e){this.ctx.interactionManager.isState(xg.AnnotationsMoveable)&&this.show(e)}onMouseLeave(){this.ctx.interactionManager.isState(xg.Clickable)&&this.hide()}onClick(e){this.ctx.interactionManager.isState(xg.Clickable)&&e.device==="touch"&&this.show(e)}show(e){const{sourceEvent:t,currentX:i,currentY:s}=e;if(!(this.enabled&&this.ctx.widgets.seriesWidget.getElement().contains(t.target))){this.hide();return}this.toggleVisibility(!0);const o=this.getButtonCoordinates({x:i,y:s});this.coords={x:o.x+this.button.clientWidth/2,y:o.y+this.button.clientHeight/2},this.updatePosition(o)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(xg.Default)||this.hide()}getButtonCoordinates({x:e,y:t}){const{axisCtx:{direction:i,position:s},seriesRect:o,snap:n,axisCtx:r,padding:a}=this,{clientWidth:l,clientHeight:c}=this.button,[d,h]=[0,o.height],[u,p]=[0,o.width];if(n&&(e=fc(qf(e-o.x,r),r)+o.x,t=fc(qf(t-o.y,r),r)+o.y),i===Gte.X){const f=c-Math.max(0,a-5);e=e-l/2,t=s==="top"?d-c+f:h-f}else{const f=l-Math.max(0,a-9);e=s==="left"?u-l+f:p-f,t=t-c/2}return{x:e,y:t}}toggleVisibility(e){const{button:t}=this;if(t==null)return;const i=this.enabled&&e;this.toggleClass("-hidden",!i)}toggleClass(e,t){this.button.toggleClass(`${Ug}-${e}`,t)}updatePosition({x:e,y:t}){this.button.getElement().style.transform=`translate(${Math.round(e)}px, ${Math.round(t)}px)`}updateButtonElement(){const{button:e}=this;e.addListener("click",()=>this.onButtonClick(this.coords)),e.addListener("touchend",()=>this.onButtonClick(this.coords)),e.addListener("drag-start",()=>{}),e.setInnerHTML(`<span class="${_te("zoom-in")} ${Ug}-icon"></span>`)}};v([Fte(Bte)],pH.prototype,"enabled");var{Color:gN,DraggablePopover:zte,NativeWidget:fD,Vec2:Ci,createButton:gv,createCheckbox:Vte,createElementId:fN,createSelect:Hte,createTextArea:Wte,initRovingTabIndex:mN,getIconClassNames:jte,mapValues:Jw,setAttribute:Ute,setAttributes:eM,createElement:Na,getWindow:Kte}=L,gH=class mD extends zte{constructor(t,i){super(t,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new zV(this.ctx,{detached:!0}),this.destroyFns.push(t.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(t,i){const s=super.showWithChildren(t,i);return s.classList.add("ag-charts-dialog"),s.setAttribute("role","dialog"),s.addEventListener("mousedown",o=>{o.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),s.addEventListener("keydown",this.onKeyDown.bind(this)),Kte().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),s}updatePosition(t){super.updatePosition(t);const{anchor:i,fallbackAnchor:s}=this.getColorPickerAnchors()??{};i&&this.colorPicker.setAnchor(i,s)}createTabs(t,i,s){const o=Na("div","ag-charts-dialog__tabs"),n=Jw(s,()=>fN("ag-charts-dialog__tab")),r=Jw(s,()=>fN("ag-charts-dialog__tab-panel"));for(const[p,g]of Object.entries(s))eM(g.panel,{id:r[p],role:"tabpanel","aria-labelledby":n[p]});const a=p=>{for(const[g,f]of Object.entries(s))f.panel.classList.toggle("ag-charts-dialog__tab-panel--active",g===p),d[g].classList.toggle("ag-charts-dialog__tab-button--active",g===p),Ute(d[g],"aria-selected",g===p),g===p&&f.onShow?.()},l=new fD(Na("div","ag-charts-dialog__header"));l.addListener("drag-start",p=>{const{sourceEvent:g}=p;g.target instanceof Element&&g.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(p)}),l.addListener("drag-move",p=>this.onDragMove(p)),l.addListener("drag-end",()=>this.onDragEnd());const c=new Yte;this.setDragHandle(c);const d=Jw(s,(p,g)=>gv({label:this.ctx.localeManager.t(p.label),onPress:()=>a(g)},{id:n[g],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":r[g]})),h=Na("div","ag-charts-dialog__tab-list");eM(h,{role:"tablist","aria-label":this.ctx.localeManager.t(t)}),h.append(...Object.values(d));const u=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),h,u),o.append(l.getElement(),...Object.values(s).map(p=>p.panel)),a(i),mN({orientation:"horizontal",buttons:Object.values(d)}),{tabs:o,initialFocus:d[i]}}createTabPanel(){return Na("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return Na("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:t,options:i,value:s,onChange:o}){const n=this.createInputGroup(t);eM(n,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(t)});const r="ag-charts-dialog__button--active",a=[];for(const l of i){const{icon:c,altText:d}=l,h=this.ctx.localeManager.t(d),u=gv({icon:c,altText:h,onPress:()=>{for(const p of Array.from(n.children))p.classList.remove(r),p.ariaChecked="false";u.classList.add(r),u.ariaChecked="true",o(l.value)}},{"aria-checked":l.value===s,class:"ag-charts-dialog__button",role:"radio",title:h});l.value===s&&u.classList.add(r),n.appendChild(u),a.push(u)}return mN({orientation:"horizontal",buttons:a}),n}createSelect({altText:t,label:i,options:s,value:o,onChange:n}){const r=this.createInputGroup(i),a=this.ctx.localeManager.t(t),l=Hte({value:o,options:s,onChange:n},{class:"ag-charts-dialog__select","aria-label":a,title:a});return r.append(l),r}createTextArea({placeholder:t,value:i,onChange:s}){const o=t?this.ctx.localeManager.t(t):void 0;return Wte({value:i,onChange:s},{placeholder:o})}createCheckbox({label:t,checked:i,onChange:s}){const o=`ag-charts__${t}`,n=this.createInputGroup(t,{for:o}),r=Vte({checked:i,onChange:s},{class:"ag-charts-dialog__checkbox",role:"switch",id:o});return n.append(r),n}createColorPicker({color:t,opacity:i,label:s,altText:o,onChange:n,onChangeHide:r,isMultiColor:a,hasMultiColorOption:l}){const c=this.createInputGroup(s),d=this.ctx.localeManager.t(o),h=gv({label:d,onPress:u=>{const{anchor:p,fallbackAnchor:g}=this.getColorPickerAnchors(h)??{};this.colorPicker.show({anchor:p,fallbackAnchor:g,color:t,opacity:i,isMultiColor:a,hasMultiColorOption:l,sourceEvent:u,onChange:(f,y,m,C)=>{h.style.setProperty("--color",f),h.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",C),n(f,y,m,C)},onChangeHide:r})}},{"aria-label":d,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:d});if(a)h.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(t){const u=gN.fromString(t),p=new gN(u.r,u.g,u.b,i);h.style.setProperty("--color",p.toHexString())}return c.append(h),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return gv({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(t,i){const s=Na("div","ag-charts-dialog__input-group"),o=Na("label","ag-charts-dialog__input-group-label");return o.innerText=this.ctx.localeManager.t(t),i?.for&&o.setAttribute("for",i.for),s.appendChild(o),s}onLayoutComplete(t){this.seriesRect=t.series.paddedRect,this.reposition()}onKeyDown(t){t.altKey||t.ctrlKey||t.metaKey||t.isComposing||t.key!=="Escape"||this.hide()}reposition(){const{seriesRect:t,ctx:i}=this,s=i.domManager.getBoundingClientRect(),o=this.getPopoverElement();if(!t||!o)return;const n=Ci.from(0,t.y),r=Ci.from(s.width,t.height),a=Ci.from(o),l=Ci.from(.5,1);let c;if(t.width>1e3){const d=Ci.sub(Ci.add(n,Ci.multiply(r,l)),Ci.multiply(a,l));c=Ci.sub(d,Ci.from(0,mD.offset))}else{const d=Ci.sub(Ci.add(n,r),a);c=Ci.sub(d,mD.offset)}this.updatePosition(c)}getColorPickerAnchors(t){if(t&&(this.colorPickerAnchorElement=t),!this.colorPickerAnchorElement)return;const i=this.colorPickerAnchorElement.getBoundingClientRect(),s=this.ctx.domManager.getBoundingClientRect(),o=Ci.sub(Ci.from(i.x,i.y),Ci.from(s.left,s.top)),n=Ci.add(o,Ci.from(0,i.height+5)),r=Ci.sub(o,Ci.from(0,5));return{anchor:n,fallbackAnchor:r}}};gH.offset=60;var $te=gH,Yte=class extends fD{constructor(){super(Na("div","ag-charts-dialog__drag-handle"));const e=new fD(Na("span",jte("drag-handle")));e.setAriaHidden(!0),this.addChild(e)}},{Listeners:Xte,focusCursorAtEnd:Zte}=L,qte=class extends $te{constructor(e){super(e,"settings"),this.events=new Xte,this.hideFns.push(()=>this.events.dispatch("hidden"))}addListener(e,t){return this.events.addListener(e,t)}show(e,t){const i=this.createLinearLineTab(e,t),s=this.createLinearTextTab(e,t);let o="dialogHeaderLine";Xa(e)?o="dialogHeaderChannel":GV(e)?o="dialogHeaderFibonacciRange":e.type==="date-range"?o="dialogHeaderDateRange":e.type==="price-range"?o="dialogHeaderPriceRange":e.type==="date-price-range"&&(o="dialogHeaderDatePriceRange");const{tabs:n,initialFocus:r}=this.createTabs("ariaLabelSettingsTabBar",t.initialSelectedTab,{line:{label:o,panel:i},text:{label:"dialogHeaderText",panel:s.panel,onShow:s.onShow}});t.initialFocus=r,this.showWithChildren([n],t).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(e,t){const i=this.createTabPanel(),s=this.createInputGroupLine(),o=this.createInputGroupLine(),n="isMultiColor"in e,r=this.createColorPickerInput("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),n?e.isMultiColor:!1,n,t.onChangeLineColor,t.onChangeHideLineColor),a=this.createStrokeWidthSelect(e.strokeWidth??2,t.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(e.lineStyle??"solid",t.onChangeLineStyleType);if(s.append(r),"background"in e){const c=this.createColorPickerInput("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),!1,!1,t.onChangeFillColor,t.onChangeHideFillColor);s.append(c),o.append(a)}else"showFill"in e?(s.append(this.createCheckbox({label:"dialogInputShowFill",checked:e.showFill??!0,onChange:c=>t.onChangeLine({showFill:c})})),o.append(a)):s.append(a);return o.append(l),i.append(s,o),"bands"in e&&i.append(this.createFibonacciRatioSelect(e.bands??10,c=>t.onChangeLine({bands:c}))),"extendStart"in e&&"extendEnd"in e&&i.append(this.createCheckbox({label:Xa(e)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:e.extendStart??!1,onChange:c=>t.onChangeLine({extendStart:c})}),this.createCheckbox({label:Xa(e)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:e.extendEnd??!1,onChange:c=>t.onChangeLine({extendEnd:c})})),"extendAbove"in e&&"extendBelow"in e&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:e.extendAbove??!1,onChange:c=>t.onChangeLine({extendAbove:c})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:e.extendBelow??!1,onChange:c=>t.onChangeLine({extendBelow:c})})),"extendLeft"in e&&"extendRight"in e&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:e.extendLeft??!1,onChange:c=>t.onChangeLine({extendLeft:c})}),this.createCheckbox({label:"dialogInputExtendRight",checked:e.extendRight??!1,onChange:c=>t.onChangeLine({extendRight:c})})),"reverse"in e&&"showFill"in e&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:e.reverse??!1,onChange:c=>t.onChangeLine({reverse:c})})),i}createLinearTextTab(e,t){const i=this.createTabPanel(),s=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:e.text.label,onChange:d=>t.onChangeText({label:d})}),o=this.createFontSizeSelect(e.text.fontSize,t.onChangeTextFontSize),n=this.createColorPickerInput("text-color",e.text.color,1,!1,!1,t.onChangeTextColor,t.onChangeHideTextColor),r=e.text.position==="inside"?"center":e.text.position,a=this.createPositionRadioGroup(r??"top",d=>t.onChangeText({position:d})),l=this.createAlignmentRadioGroup(e.text.alignment??"center",d=>t.onChangeText({alignment:d})),c=this.createInputGroupLine();return c.append(o,n,a,l),i.append(s,c),{panel:i,onShow:()=>Zte(s)}}createColorPickerInput(e,t,i,s,o,n,r){const a=e==="fill-color"?"dialogInputFillColorPicker":"dialogInputColorPicker",l=e==="fill-color"?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:a,altText:l,color:t,opacity:i,isMultiColor:s,hasMultiColorOption:o,onChange:n,onChangeHide:r})}createStrokeWidthSelect(e,t){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:VV.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(e),onChange:i=>t(Number(i))})}createFibonacciRatioSelect(e,t){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:nee.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(e),onChange:i=>t(Number(i))})}createLineStyleRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:e,onChange:t})}createFontSizeSelect(e,t){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:HV.map(({label:i,value:s})=>({label:i,value:String(s)})),value:String(e),onChange:i=>t(Number(i))})}createPositionRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:e,onChange:t})}createAlignmentRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:"iconAltTextAlignLeft",value:"left"},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:"iconAltTextAlignRight",value:"right"}],value:e,onChange:t})}};function tM(e){return e.gridPadding+e.seriesAreaPadding+e.tickSize+e.label.spacing}function Qte(e,t,i){for(const{update:s}of Object.values(Oo))s(e,t,i)}var{BOOLEAN:fH,OBJECT:ck,ChartUpdateType:Jte,InteractionState:oo,ObserveChanges:eie,PropertiesArray:tie,Validate:ty,ChartAxisDirection:iie,Vec2:Cd,keyProperty:sie,valueProperty:oie,Selection:nie,BBox:rie}=L,Vp=class mH extends L.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!0,this.toolbar=new rx(this.ctx),this.optionsToolbar=new KR(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return Vd(this.annotationData.at(i))}),this.axesButtons=new IR,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new tie(mH.createAnnotationDatum),this.defaults=new eee,this.container=new L.Group({name:"static-annotations"}),this.annotations=new nie(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new qte(this.ctx),this.textInput=new EQ(this.ctx),this.restoreAnnotations=!0,this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(t.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this))}setupStateMachine(){const{ctx:t}=this;return new ox({resetToIdle:()=>{t.domManager.updateCursor("annotations"),this.popAnnotationState(oo.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(i,s,o)=>{let n;return this.annotations.each((r,a,l)=>{const c=r.containsPoint(i.x,i.y);c&&(n??(n=l)),r.toggleHovered(c||s===l)}),n!=null?t.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||t.tooltipManager.unsuppressTooltip("annotations"),this.ctx.domManager.updateCursor("annotations",n==null?void 0:this.annotations.at(n)?.getCursor()),n!==o&&this.update(),n},getNodeAtCoords:(i,s)=>{const o=this.annotations.at(s);if(o)return o.getNodeAtCoords(i.x,i.y)},translate:(i,s)=>{const o=this.annotations.at(i),n=Vd(this.annotationData.at(i));if(!(!o||!n))return this.translateNode(o,n,s)},copy:i=>{const s=this.annotations.at(i),o=Vd(this.annotationData.at(i));if(!(!s||!o))return this.createAnnotationDatumCopy(s,o)},paste:i=>{this.createAnnotation(i.type,i,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(i,s)=>{const{annotations:o,optionsToolbar:n,toolbar:r}=this;this.hideOverlays(),r.clearActiveButton(),r.resetButtonIcons();const a=i!=null?o.at(i):null,l=s!=null?o.at(s):null;l===a&&a!=null||(l?.toggleActive(!1),n.hide(),a?(this.pushAnnotationState(oo.AnnotationsSelected),a.toggleActive(!0),n.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{n.show(),n.setAnchorScene(a)})):(this.popAnnotationState(oo.AnnotationsSelected),this.popAnnotationState(oo.Annotations)),this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(oo.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(oo.Annotations)},stopInteracting:()=>{this.popAnnotationState(oo.Annotations)},create:(i,s)=>{this.createAnnotation(i,s)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{this.annotationData.splice(0,this.annotationData.length)},validatePoint:i=>{const s=this.getAnnotationContext();return s?dr(s,i):!0},getAnnotationType:i=>GQ(this.annotationData[i].type),datum:i=>this.annotationData.at(i),node:i=>this.annotations.at(i),recordAction:i=>{this.recordActionAfterNextUpdate(i)},update:()=>{this.postUpdateFns.push(()=>{const i=this.state.getActive(),s=i!=null?this.annotations.at(i):null;s!=null&&this.optionsToolbar.setAnchorScene(s)}),this.update()},showTextInput:i=>{const s=Vd(this.annotationData.at(i));if(!this.annotations.at(i)||!s||!("getTextInputCoords"in s)||!("getTextPosition"in s))return;const n={color:s.color,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,placeholderColor:s.getPlaceholderColor()},r=this.getAnnotationContext(),a=c=>Cd.add(s.getTextInputCoords(r,c),Cd.required(this.seriesRect)),l=()=>s.getTextPosition();this.textInput.show({styles:n,layout:{getTextInputCoords:a,getTextPosition:l,alignment:s.alignment,textAlign:s.textAlign,width:s.width},text:s.text,placeholderText:s.placeholderText,onChange:(c,d)=>{this.state.transition("updateTextInputBBox",d)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:i=>{this.textInput.updateColor(i)},updateTextInputFontSize:i=>{const s=this.textInput.updateFontSize(i);this.state.transition("updateTextInputBBox",s)},updateTextInputBBox:i=>{this.state.transition("updateTextInputBBox",i)},showAnnotationOptions:i=>{const s=this.annotations.at(i);!s||mc(this.annotationData.at(i))||(this.optionsToolbar.updateButtons(this.annotationData.at(i)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(s))},showAnnotationSettings:(i,s,o="line")=>{const n=this.annotationData.at(i);if(!qS(n)&&!Xa(n)&&!Qm(n)||mc(n))return;const r=c=>(d,h,u,p)=>{this.setColorAndDefault(n.type,c,d,h,u,p),this.optionsToolbar.updateColorPickerColor(c,h,u,p)},a=c=>()=>{this.recordActionAfterNextUpdate(`Change ${n.type} ${c} to ${n.getDefaultColor(c)}`,["annotations","defaults"]),this.update()},l={initialSelectedTab:o,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:s,onChangeLine:c=>{this.state.transition("lineProps",c),c.bands!=null&&this.defaults.setDefaultFibonacciOptions(n.type,"bands",c.bands),c.reverse!=null&&this.defaults.setDefaultFibonacciOptions(n.type,"reverse",c.reverse),c.showFill!=null&&this.defaults.setDefaultFibonacciOptions(n.type,"showFill",c.showFill)},onChangeText:c=>{this.state.transition("lineText",c),c.alignment&&this.defaults.setDefaultLineTextAlignment(n.type,c.alignment),c.position&&this.defaults.setDefaultLineTextPosition(n.type,c.position),this.recordActionAfterNextUpdate(`Change ${n.type} text ${Object.entries(c).map(([d,h])=>`${d} to ${h}`).join(", ")}`)},onChangeFillColor:r("fill-color"),onChangeHideFillColor:a("fill-color"),onChangeLineColor:r("line-color"),onChangeHideLineColor:a("line-color"),onChangeLineStyleType:c=>{this.setLineStyleTypeAndDefault(n.type,c),this.optionsToolbar.updateLineStyleType(cf.find(d=>d.value===c)??cf[0])},onChangeLineStyleWidth:c=>{this.setLineStyleWidthAndDefault(n.type,c),this.optionsToolbar.updateStrokeWidth({strokeWidth:c,value:c,label:String(c)})},onChangeTextColor:r("text-color"),onChangeHideTextColor:a("text-color"),onChangeTextFontSize:c=>{this.setFontSizeAndDefault(n.type,c)}};this.settingsDialog.show(n,l)}})}setupListeners(){const{ctx:t,optionsToolbar:i,settingsDialog:s,toolbar:o}=this,{seriesWidget:n,seriesDragInterpreter:r,chartWidget:a}=t.widgets;this.destroyFns.push(r.addListener("click",this.hoverTouchPreHandler.bind(this)),r.addListener("drag-start",this.hoverTouchPreHandler.bind(this)),r.addListener("drag-move",this.dragMoveTouchPreHandler.bind(this)),r.addListener("mousemove",this.onHover.bind(this)),r.addListener("click",this.onClick.bind(this)),r.addListener("dblclick",this.onDoubleClick.bind(this)),r.addListener("drag-start",this.onDragStart.bind(this)),r.addListener("drag-move",this.onDrag.bind(this)),r.addListener("drag-end",this.onDragEnd.bind(this)),n.addListener("keydown",this.onKeyDown.bind(this)),n.addListener("keyup",this.onKeyUp.bind(this)),a.addListener("click",this.onCancel.bind(this)),t.annotationManager.addListener("restore-annotations",this.onRestoreAnnotations.bind(this)),t.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),t.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),t.zoomManager.addListener("zoom-change",()=>this.onResize()),t.domManager.addListener("resize",()=>this.onResize()),o.addListener("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),o.addListener("pressed-create-annotation",({annotation:l})=>{this.cancel(),this.pushAnnotationState(oo.Annotations),this.state.transition(l),this.update()}),o.addListener("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),o.addListener("pressed-show-menu",()=>{this.cancel(),this.reset()}),o.addListener("pressed-unrelated",()=>{this.reset()}),i.addListener("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),i.addListener("pressed-settings",({sourceEvent:l})=>{this.state.transition("toolbarPressSettings",l)}),i.addListener("pressed-lock",()=>{this.update()}),i.addListener("hid-overlays",()=>{this.settingsDialog.hide()}),i.addListener("saved-color",({type:l,colorPickerType:c,color:d})=>{this.recordActionAfterNextUpdate(`Change ${l} ${c} to ${d}`,["annotations","defaults"])}),i.addListener("updated-color",({type:l,colorPickerType:c,colorOpacity:d,color:h,opacity:u,isMultiColor:p})=>{this.setColorAndDefault(l,c,d,h,u,p)}),i.addListener("updated-font-size",({type:l,fontSize:c})=>{this.setFontSizeAndDefault(l,c)}),i.addListener("updated-line-style",({type:l,lineStyleType:c})=>{this.setLineStyleTypeAndDefault(l,c)}),i.addListener("updated-line-width",({type:l,strokeWidth:c})=>{this.setLineStyleWidthAndDefault(l,c)}),s.addListener("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:t,toolbar:i}=this;this.destroyFns.push(t.annotationManager.attachNode(this.container),()=>t.domManager.removeStyles(Ug),()=>i.destroy())}async processData(t){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[sie(this.xKey,void 0,{id:"date"}),oie(this.volumeKey,"number",{id:"volume"})],{dataModel:s,processedData:o}=await t.request("annotations",this.data,{props:i});this.dataModel=s,this.processedData=o}createAnnotationScene(t){if(t.type in Oo)return new Oo[t.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${t.type}], expected one of [${Object.keys(Oo)}], ignoring.`)}static createAnnotationDatum(t){if(t.type in Oo)return new Oo[t.type].datum().set(t);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${t.type}], expected one of [${Object.keys(Oo)}], ignoring.`)}createAnnotation(t,i,s=!0){if(this.annotationData.push(i),s){const o=this.ctx.annotationManager.getAnnotationTypeStyles(t);o&&i.set(o),this.defaults.applyDefaults(i)}this.injectDatumDependencies(i),this.update()}injectDatumDependencies(t){"setLocaleManager"in t&&t.setLocaleManager(this.ctx.localeManager),"getVolume"in t&&(t.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(t,i){const{dataModel:s,processedData:o}=this;let n=Et(t).value,r=Et(i).value;if(!Kw(n)||!Kw(r)||!s||!o||this.volumeKey==null)return;n>r&&([n,r]=[r,n]);const a=s.resolveKeysById({id:"annotations"},"date",o),l=s.resolveColumnById({id:"annotations"},"volume",o);let c=0;for(let d=0;d<o.input.count;d++){const h=a[d];Kw(h)&&h>=n&&h<=r&&(c+=l[d])}return c}translateNode(t,i,s){const o=this.getAnnotationConfig(i),n=this.getAnnotationContext();n&&o.translate(t,i,s,n)}createAnnotationDatumCopy(t,i){const s=this.getAnnotationConfig(i),o=new s.datum;o.set(i.toJson());const n=this.getAnnotationContext();if(n)return s.copy(t,i,o,n)}getAnnotationConfig(t){if(t.type in Oo)return Oo[t.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${t.type}], expected one of [${Object.keys(Oo)}], ignoring.`)}onRestoreAnnotations(t){this.enabled&&(this.clear(),this.annotationData.set(t.annotations),this.restoreAnnotations=!0,this.update())}onLayoutComplete(t){const i=t.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i);for(const s of t.axes??[])s.direction===L.ChartAxisDirection.X?this.xAxis=this.getAxis(s,i,this.xAxis?.button):this.yAxis=this.getAxis(s,i,this.yAxis?.button);this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const t=this.ctx.chartService.series.some(o=>o.hasData),s=this.yAxis.context.seriesIds().some(o=>this.ctx.chartService.series.find(r=>r.id===o)?.visible);return t&&s}animateAnnotations({from:t,to:i,phase:s}){const{annotations:o}=this;this.ctx.animationManager?.animate({from:t,to:i,id:"chart-annotations",phase:s,groupId:"opacity",onUpdate(n){o.each(r=>{r.opacity=n,"setAxisLabelOpacity"in r&&r.setAxisLabelOpacity(n)})},onStop(){o.each(n=>{n.opacity=i,"setAxisLabelOpacity"in n&&n.setAxisLabelOpacity(i)})}})}onPreRender(){this.updateAnnotations(),this.state.transition("render")}getAxis(t,i,s){const o=this.ctx.axisManager.getAxisContext(t.direction)[0],{position:n="bottom",direction:r}=o,a=t.gridPadding+t.seriesAreaPadding,l=new rie(0,0,i.width,i.height).grow(a,n),c=o.direction===iie.X?"vertical":"horizontal",{axesButtons:d,snap:h}=this;if(this.enabled&&d.enabled&&(d.axes==="xy"||d.axes===r)){s??(s=new pH(this.ctx,{...o,snapToGroup:h},g=>this.onAxisButtonClick(g,c),i));const p=tM(t);s.update(i,p)}else s?.destroy(),s=void 0;return{layout:t,context:o,bounds:l,button:s}}recordActionAfterNextUpdate(t,i=["annotations"]){const{defaults:s,ctx:{annotationManager:o,historyManager:n}}=this,r=i.map(a=>a==="defaults"?s:o);this.postUpdateFns.push(()=>{n.record(t,...r)})}setColorAndDefault(t,i,s,o,n,r){this.state.transition("color",{colorPickerType:i,colorOpacity:s,color:o,opacity:n,isMultiColor:r}),this.defaults.setDefaultColor(t,i,s,o,n,r)}setFontSizeAndDefault(t,i){this.state.transition("fontSize",i),this.defaults.setDefaultFontSize(t,i),this.recordActionAfterNextUpdate(`Change ${t} font size to ${i}`,["annotations","defaults"])}setLineStyleTypeAndDefault(t,i){this.state.transition("lineStyle",{type:i}),this.defaults.setDefaultLineStyleType(t,i),this.recordActionAfterNextUpdate(`Change ${t} line style to ${i}`,["annotations","defaults"])}setLineStyleWidthAndDefault(t,i){this.state.transition("lineStyle",{strokeWidth:i}),this.defaults.setDefaultLineStyleWidth(t,i),this.recordActionAfterNextUpdate(`Change ${t} stroke width to ${i}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:t,annotations:i,seriesRect:s,ctx:{annotationManager:o}}=this,n=this.getAnnotationContext();if(!s||!n)return;o.updateData(t.toJson().filter(l=>!mc(l)));const r=this.showAnnotations();this.toolbar.refreshButtonsEnabled(r),this.toolbar.toggleClearButtonEnabled(t.length>0&&r);const a=this.restoreAnnotations;i.update(t??[],void 0,l=>l.id).each((l,c)=>{if(!r||!this.validateDatum(c,a)){l.visible=!1,"setAxisLabelVisible"in l&&l.setAxisLabelVisible(!1);return}"setAxisLabelVisible"in l&&l.setAxisLabelVisible(!0),this.injectDatumDependencies(c),Qte(l,c,n)}),this.postUpdateFns.forEach(l=>l()),this.postUpdateFns=[],this.restoreAnnotations=!1}validateDatum(t,i){const s=this.getAnnotationContext(),o=i?`Annotation [${t.type}] `:void 0;return s?t.isValidWithContext(s,o):!0}getAnnotationContext(){const{seriesRect:t,xAxis:i,yAxis:s,snap:o}=this;if(t&&i&&s)return{seriesRect:t,xAxis:{...i.context,bounds:i.bounds,labelPadding:tM(i.layout),snapToGroup:o},yAxis:{...s.context,bounds:s.bounds,labelPadding:tM(i.layout),snapToGroup:o}}}onHover(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const o=t.sourceEvent.shiftKey,n=Cd.from(t),r=Pt(n,s);i.transition("hover",{offset:n,point:r,shiftKey:o,context:s})}onClick(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const o=t.sourceEvent.shiftKey,n=Pt(Cd.from(t),s),r=this.textInput.getValue(),a=this.textInput.getBBox();i.transition("click",{point:n,shiftKey:o,textInputValue:r,bbox:a})}onDoubleClick(t){const{state:i}=this;if(!this.getAnnotationContext())return;const o=Cd.from(t);i.transition("dblclick",{offset:o})}onAxisButtonClick(t,i){this.cancel(),this.reset();const s=this.getAnnotationContext();if(!this.annotationData||!s)return;const{state:o}=this;this.pushAnnotationState(oo.Annotations);const n=i==="horizontal";if(o.transition(n?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!t)return;const r=Pt(t,s);dr(s,r)&&(o.transition("click",{point:r,shiftKey:!1}),this.update())}onResize(){const t=this.textInput.getValue(),i=this.textInput.getBBox();this.state.transition("resize",{textInputValue:t,bbox:i})}hoverTouchPreHandler(t){t.device==="touch"&&this.onHover(t)}dragMoveTouchPreHandler(t){t.device==="touch"&&this.ctx.interactionManager.isState(oo.AnnotationsSelected)&&t.sourceEvent.preventDefault()}onDragStart(t){if(!this.ctx.interactionManager.isState(oo.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=Cd.from(t),o=Pt(s,i),n=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("dragStart",{context:i,offset:s,point:o,textInputValue:n,bbox:r})}onDrag(t){if(!this.ctx.interactionManager.isState(oo.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=Cd.from(t),o=Pt(s,i),n=t.sourceEvent.shiftKey,r=this.textInput.getValue(),a=this.textInput.getBBox();this.state.transition("drag",{context:i,offset:s,point:o,shiftKey:n,textInputValue:r,bbox:a})}onDragEnd(){this.state.transition("dragEnd")}onCancel(t){const{sourceEvent:i}=t??{};i?.currentTarget===i?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{key:o,shiftKey:n}=t,r=this.textInput.getValue(),a=this.textInput.getBBox();i.transition("textInput",{key:o,shiftKey:n,textInputValue:r,bbox:a,context:s})}onKeyDown(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{sourceEvent:o}=t,{shiftKey:n,ctrlKey:r,metaKey:a}=o,l=r||a,c=r||n;this.state.transition("keyDown",{shiftKey:n,context:s});const d={x:0,y:0},h=Math.max(s?.xAxis.scale.bandwidth??0,c?10:1),u=Math.max(s?.yAxis.scale.bandwidth??0,c?10:1);switch(o.key){case"ArrowDown":d.y=u;break;case"ArrowUp":d.y=-u;break;case"ArrowLeft":d.x=-h;break;case"ArrowRight":d.x=h;break;case"Escape":this.onCancel();return;case"Backspace":case"Delete":this.onDelete();return}if((d.x||d.y)&&(i.transition("translate",{translation:d}),o.stopPropagation(),o.preventDefault()),!!l)switch(o.key){case"c":i.transition("copy");return;case"x":i.transition("cut"),this.recordActionAfterNextUpdate("Cut annotation");return;case"v":i.transition("paste"),this.recordActionAfterNextUpdate("Paste annotation");return}}onKeyUp(t){const{shiftKey:i}=t.sourceEvent,s=this.getAnnotationContext();s&&(this.state.transition("keyUp",{shiftKey:i,context:s}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){for(const[t,i]of this.annotationData.entries())mc(i)&&this.annotationData.splice(t,1)}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(t){this.ctx.interactionManager.pushState(t),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(t){this.ctx.interactionManager.popState(t),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(oo.Annotations)||this.ctx.interactionManager.isState(oo.AnnotationsSelected)}update(t=Jte.PRE_SCENE_RENDER){this.ctx.updateService.update(t)}};v([eie((e,t,i)=>{const{ctx:{annotationManager:s,stateManager:o}}=e;t!==i&&(e.toolbar?.toggleVisibility(!!t),i===!1&&t===!0?o.restoreState(s):t===!1&&e.clear())}),ty(fH)],Vp.prototype,"enabled");v([ty(ck)],Vp.prototype,"toolbar");v([ty(ck)],Vp.prototype,"optionsToolbar");v([ty(ck)],Vp.prototype,"axesButtons");v([ty(fH)],Vp.prototype,"snap");var aie=Vp,{FONT_SIZE_RATIO:lie,ThemeSymbols:Ei}=L,an={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},ts={fill:Ei.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},rh={color:{$ref:"backgroundColor"},fontSize:{$rem:[lie.LARGE]},fontFamily:{$ref:"fontFamily"}},yN={...rh,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},fv={...rh,textAlign:"left"},Ld={...rh,position:"top",alignment:"center",color:{$ref:"textColor"}},vN={...rh,position:"top",alignment:"center",color:{$ref:"textColor"}},yD={...rh,fontSize:{$ref:"fontSize"},color:Ei.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:Ei.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:Ei.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:Ei.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},iM={...an,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ts},text:{...Ld},statistics:{...yD}},cie={buttons:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}],padding:{$ref:"padding"}},die={buttons:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]},hie={enabled:!1,line:{...an,handle:{...ts},text:{...Ld}},"horizontal-line":{...an,handle:{...ts},axisLabel:{...yN},text:{...Ld}},"vertical-line":{...an,handle:{...ts},axisLabel:{...yN},text:{...Ld}},"disjoint-channel":{...an,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ts},text:{...vN}},"parallel-channel":{...an,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ts},text:{...vN}},"fibonacci-retracement":{...an,strokes:Ei.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...ts},text:{...Ld,position:"center"},label:{...rh,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...an,strokes:Ei.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...ts},text:{...Ld,position:"center"},label:{...rh,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...an,...fv,color:{$ref:"textColor"},handle:{...ts},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...fv,fontWeight:700,handle:{...ts},fill:{$ref:"foregroundColor"}},note:{...fv,color:Ei.DEFAULT_TEXTBOX_COLOR,fill:Ei.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...ts},background:{fill:Ei.DEFAULT_TEXTBOX_FILL,stroke:Ei.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...fv,color:{$ref:"textColor"},handle:{...ts}},arrow:{...an,handle:{...ts},text:{...Ld}},"arrow-up":{fill:Ei.PALETTE_UP_FILL,handle:{...ts,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:Ei.PALETTE_DOWN_FILL,handle:{...ts,stroke:{$ref:"foregroundColor"}}},"date-range":{...iM},"price-range":{...iM},"date-price-range":{...iM},"quick-date-price-range":{up:{...an,fill:Ei.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...ts},statistics:{...yD,color:"#fff",fill:Ei.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...an,stroke:Ei.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:Ei.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...ts,stroke:Ei.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...yD,color:"#fff",fill:Ei.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:cie,optionsToolbar:die},uie={type:"root",optionsKey:"annotations",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new aie(e),themeTemplate:{annotations:hie}},{BaseProperties:pie,ObserveChanges:gie,ProxyProperty:fie,Validate:Th,NUMBER:ax,POSITIVE_NUMBER:yH,RATIO:mie,calculatePlacement:yie,createElement:vie}=L,pa=class extends pie{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=vie("img"),this.imageElement.onload=this.onImageLoad,this.node=new L.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(e,t){this.containerWidth=e,this.containerHeight=t;const i={width:e,height:t},s=yie(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...s}:{visible:!1}),s}};v([Th(ax,{optional:!0})],pa.prototype,"top");v([Th(ax,{optional:!0})],pa.prototype,"right");v([Th(ax,{optional:!0})],pa.prototype,"bottom");v([Th(ax,{optional:!0})],pa.prototype,"left");v([Th(yH,{optional:!0})],pa.prototype,"width");v([Th(yH,{optional:!0})],pa.prototype,"height");v([Th(mie)],pa.prototype,"opacity");v([fie("imageElement.src"),gie(e=>e.loadedSynchronously=e.complete)],pa.prototype,"url");var{ActionOnSet:Cie,OBJECT:bie,Validate:Sie}=L,vH=class extends L.Background{constructor(){super(...arguments),this.image=new pa}onLayoutComplete(e){if(super.onLayoutComplete(e),this.image){const{width:t,height:i}=e.chart;this.image.performLayout(t,i)}}onImageLoad(){this.ctx.updateService.update(L.ChartUpdateType.SCENE_RENDER)}};v([Sie(bie,{optional:!0}),Cie({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){this.node.removeChild(e.node),e.onLoad=void 0}})],vH.prototype,"image");var xie={type:"root",optionsKey:"background",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new vH(e)},{BOOLEAN:wie,ActionOnSet:Mie,LayoutElement:Die,Menu:Aie,Validate:Iie}=L,sM=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],CH=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.menu=new Aie(this.ctx,"chart-toolbar"),this.toolbar=e.sharedToolbar.getSharedToolbar("chartToolbar"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),e.layoutManager.registerElement(Die.ToolbarLeft,this.onLayoutStart.bind(this)),()=>this.toolbar.destroy())}onLayoutStart(e){this.enabled&&(this.updateButton(),this.toolbar.layout(e.layoutBox))}onButtonPressed({event:e,buttonBounds:t}){this.menu.setAnchor({x:t.x+t.width+6,y:t.y}),this.menu.show({items:sM,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:e.sourceEvent,onPress:i=>{this.setChartType(i.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton()}}),this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const e=this.getChartType(),t=sM.find(i=>i.value===e)?.icon;t!=null&&this.toolbar.updateButtons([{icon:t,tooltip:"toolbarSeriesTypeDropdown"}])}hidePopover(){this.toolbar.clearActiveButton(),this.menu.hide()}setChartType(e){const t={chartType:e};this.ctx.chartService.publicApi?.updateDelta(t).catch(i=>et.error(i))}getChartType(){const e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return e==null||!sM.some(t=>t.value===e)?"candlestick":e}};v([Iie(wie),Mie({changeValue(e){this.toolbar?.setHidden(!e)}})],CH.prototype,"enabled");var Rie={type:"root",optionsKey:"chartToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new CH(e)},mv="ag-charts-context-menu",yv="ag-charts-dark-context-menu",{BOOLEAN:bH,Validate:SH,initMenuKeyNav:kie,makeAccessibleClickListener:Tie,ContextMenuRegistry:wg,createElement:oM}=L,nM="context-menu";function Lie(e,t){const{children:i}=e??{};if(!i)return[];const s=[];for(const o of Array.from(i))o instanceof t&&s.push(o);return s}var dk=class extends L.BaseModuleInstance{constructor(e){if(super(),this.ctx=e,this.enabled=!0,this.darkTheme=!1,this.extraActions=[],this.extraNodeActions=[],this.extraSeriesAreaActions=[],this.extraLegendItemActions=[],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.interactionManager=e.interactionManager,this.registry=e.contextMenuRegistry,this.groups={default:[],extra:[],extraSeriesArea:[],extraNode:[],extraLegendItem:[]},this.element=e.domManager.addChild("canvas-overlay",nM),this.element.classList.add(mv),this.element.addEventListener("contextmenu",t=>t.preventDefault()),this.destroyFns.push(()=>this.element.parentNode?.removeChild(this.element)),this.doClose(),this.destroyFns.push(e.domManager.addListener("hidden",()=>this.hide())),typeof MutationObserver<"u"){const t=new MutationObserver(()=>{this.menuElement&&this.element.contains(this.menuElement)&&this.reposition()});t.observe(this.element,{childList:!0}),this.mutationObserver=t,this.destroyFns.push(()=>t.disconnect())}this.destroyFns.push(this.registry.registerDefaultAction({id:"download",type:"all",label:"contextMenuDownload",action:()=>{const t=e.chartService.title;let i="image";t?.enabled&&t?.text!==void 0&&(i=t.text.replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(s=>{et.error("Unable to download chart",s)})}})),this.destroyFns.push(this.registry.addListener(t=>this.onContext(t)))}onContext(e){if(!this.enabled)return;e.sourceEvent.preventDefault(),this.showEvent=e.sourceEvent,this.x=e.x,this.y=e.y,this.groups.default=this.registry.filterActions(e.type);for(const a of this.groups.default)a.id==null||a.toggleEnabledOnShow==null||(a.toggleEnabledOnShow(e)?this.registry.enableAction(a.id):this.registry.disableAction(a.id));this.pickedNode=void 0,this.pickedLegendItem=void 0,this.groups.extra=this.extraActions.map(({label:a,action:l})=>({type:"all",label:a,action:l})),this.groups.extraSeriesArea=[],this.groups.extraNode=[],wg.check("series-area",e)&&(this.pickedNode=e.context.pickedNode,this.groups.extraSeriesArea=this.extraSeriesAreaActions.map(({label:a,action:l})=>({type:"series-area",label:a,action:l})),this.pickedNode&&(this.groups.extraNode=this.extraNodeActions.map(({label:a,action:l})=>({type:"node",label:a,action:l})))),this.groups.extraLegendItem=[],wg.check("legend",e)&&(this.pickedLegendItem=e.context.legendItem,this.pickedLegendItem&&(this.groups.extraLegendItem=this.extraLegendItemActions.map(({label:a,action:l})=>({type:"legend",label:a,action:l}))));const{default:t,extra:i,extraSeriesArea:s,extraNode:o,extraLegendItem:n}=this.groups;[t,i,s,o,n].reduce((a,l)=>l.length+a,0)!==0&&this.show(e.sourceEvent)}show(e){this.interactionManager.pushState(L.InteractionState.ContextMenu),this.element.classList.toggle(yv,this.darkTheme);const t=this.renderMenu();this.menuCloser?.close(),this.menuElement?this.element.replaceChild(t,this.menuElement):this.element.appendChild(t),this.menuElement=t,this.element.style.display="block";const i=e.pointerType==="touch"?!1:void 0,s=Lie(t,HTMLButtonElement);this.menuCloser=kie({menu:t,buttons:s,orientation:"vertical",sourceEvent:e,overrideFocusVisible:i,autoCloseOnBlur:!0,closeCallback:()=>this.doClose()}),e.pointerType==="touch"&&this.ctx.chartService.overrideFocusVisible(!1)}hide(){this.menuCloser?.close()}doClose(){this.interactionManager.popState(L.InteractionState.ContextMenu),this.menuElement&&(this.element.removeChild(this.menuElement),this.menuElement=void 0,this.menuCloser=void 0),this.element.style.display="none"}renderMenu(){const e=oM("div");return e.classList.add(`${mv}__menu`),e.classList.toggle(yv,this.darkTheme),e.role="menu",this.appendMenuGroup(e,this.groups.default,!1),this.appendMenuGroup(e,this.groups.extra),this.appendMenuGroup(e,this.groups.extraSeriesArea),this.pickedNode&&this.appendMenuGroup(e,this.groups.extraNode),this.pickedLegendItem&&this.appendMenuGroup(e,this.groups.extraLegendItem),e}appendMenuGroup(e,t,i=!0){t.length!==0&&(i&&e.appendChild(this.createDividerElement()),t.forEach(s=>{const o=this.renderItem(s);o&&e.appendChild(o)}))}renderItem(e){if(e&&typeof e=="object"&&e.constructor===Object)return this.createActionElement(e)}createDividerElement(){const e=oM("div");return e.classList.add(`${mv}__divider`),e.classList.toggle(yv,this.darkTheme),e.role="separator",e}createActionElement({id:e,label:t,type:i,action:s}){const o=!!(e&&this.registry.isDisabled(e));return this.createButtonElement(i,t,s,o)}createButtonOnClick(e,t){return wg.checkCallback("legend",e,t)?i=>{if(this.pickedLegendItem){const{seriesId:s,itemId:o}=this.pickedLegendItem;t({type:"contextmenu",seriesId:s,itemId:o,event:i}),this.hide()}}:wg.checkCallback("series-area",e,t)?()=>{t({type:"seriesContextMenuAction",event:this.showEvent}),this.hide()}:wg.checkCallback("node",e,t)?()=>{const{pickedNode:i,showEvent:s}=this,o=i?.series.createNodeContextMenuActionEvent(s,i);o?t(o):et.error("series node not found"),this.hide()}:()=>{t({type:"contextMenuEvent",event:this.showEvent}),this.hide()}}createButtonElement(e,t,i,s){const o=oM("button");return o.classList.add(`${mv}__item`),o.classList.toggle(yv,this.darkTheme),o.ariaDisabled=s.toString(),o.textContent=this.ctx.localeManager.t(t),o.role="menuitem",o.onclick=Tie(o,this.createButtonOnClick(e,i)),o.addEventListener("mouseover",()=>o.focus({preventScroll:!0})),o}reposition(){let{x:e,y:t}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:s,offsetHeight:o}=this.element;e=L.clamp(0,e,i.width-s),t=L.clamp(0,t,i.height-o),this.element.style.left=`${e}px`,this.element.style.top=`calc(${t}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(nM),this.ctx.domManager.removeChild("canvas-overlay",nM)}};v([SH(bH)],dk.prototype,"enabled");v([SH(bH)],dk.prototype,"darkTheme");var Eie={type:"root",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsKey:"contextMenu",moduleFactory:e=>new dk(e),themeTemplate:{contextMenu:{enabled:!0,darkTheme:L.ThemeSymbols.IS_DARK_THEME}}},{BaseProperties:Pie,BOOLEAN:xH,FUNCTION:wH,NUMBER:lx,STRING:MH,Validate:ga,createId:Nie,setAttribute:Oie}=L,Fie="ag-charts-crosshair-label",Hp=class extends L.ChangeDetectableProperties{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0}};v([ga(xH)],Hp.prototype,"enabled");v([ga(lx)],Hp.prototype,"xOffset");v([ga(lx)],Hp.prototype,"yOffset");v([ga(MH,{optional:!0})],Hp.prototype,"format");v([ga(wH,{optional:!0})],Hp.prototype,"renderer");var Wp=class extends Pie{constructor(e,t,i){super(),this.domManager=e,this.id=Nie(this),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.renderer=void 0,this.element=e.addChild("canvas-overlay",`crosshair-label-${this.id}`),this.element.classList.add(Fie),Oie(this.element,"aria-hidden",!0),this.element.setAttribute("data-key",t),this.element.setAttribute("data-axis-id",i)}show(e){const{element:t}=this,i=e.x+this.xOffset,s=e.y+this.yOffset;t.style.top=`${Math.round(s)}px`,t.style.left=`${Math.round(i)}px`,this.toggle(!0)}setLabelHtml(e){e!==void 0&&(this.element.innerHTML=e)}getBBox(){const{element:e}=this;return new L.BBox(e.clientLeft,e.clientTop,e.clientWidth,e.clientHeight)}toggle(e){this.element.classList.toggle("ag-charts-crosshair-label--hidden",!e)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(e,t){if(typeof e=="string")return e;t=t??{};const{text:i=t.text??"",color:s=t.color,backgroundColor:o=t.backgroundColor,opacity:n=t.opacity??1}=e;return`<div class="ag-charts-crosshair-label-content" style="${`opacity: ${n}; background-color: ${o?.toLowerCase()}; color: ${s}`}">
13
13
  <span>${i}</span>
14
- </div>`}};v([ga(xH)],Wp.prototype,"enabled");v([ga(lx)],Wp.prototype,"xOffset");v([ga(lx)],Wp.prototype,"yOffset");v([ga(MH,{optional:!0})],Wp.prototype,"format");v([ga(wH,{optional:!0})],Wp.prototype,"renderer");var{Group:Bie,TranslatableGroup:Gie,Line:CN,BBox:bN,createId:_ie,POSITIVE_NUMBER:DH,RATIO:zie,BOOLEAN:AH,COLOR_STRING:Vie,LINE_DASH:Hie,OBJECT:Wie,InteractionState:vv,Validate:$c,ZIndexMap:SN,formatNumber:jie,isInteger:Uie,ChartAxisDirection:xN}=L,Il=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.id=_ie(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new Hp,this.seriesRect=new bN(0,0,0,0),this.bounds=new bN(0,0,0,0),this.crosshairGroup=new Gie({name:"crosshairs",zIndex:SN.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new Bie({name:`${this.id}-crosshair-lines`,zIndex:SN.SERIES_CROSSHAIR})),this.lineGroupSelection=L.Selection.select(this.lineGroup,CN,!1),this.activeHighlight=void 0,this.axisCtx=e.parent,this.labels={},this.hideCrosshairs(),e.domManager.addEventListener("focusin",({target:t})=>{const i=t instanceof HTMLElement&&e.domManager.contains(t,"series-area");this.crosshairGroup.visible&&!i&&(this.hideCrosshairs(),this.ctx.updateService.update(L.ChartUpdateType.PERFORM_LAYOUT))}),this.destroyFns.push(e.scene.attachNode(this.crosshairGroup),e.widgets.seriesWidget.addListener("mousemove",t=>this.onMouseHoverLike(t)),e.widgets.seriesWidget.addListener("drag-move",t=>this.onMouseHoverLike(t)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),e.widgets.seriesDragInterpreter.addListener("click",t=>this.onClick(t)),e.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),e.zoomManager.addListener("zoom-pan-start",()=>this.onMouseOut()),e.zoomManager.addListener("zoom-change",()=>this.onMouseOut()),e.highlightManager.addListener("highlight-change",t=>this.onHighlightChange(t)),e.layoutManager.addListener("layout:complete",t=>this.layout(t)),()=>Object.entries(this.labels).forEach(([t,i])=>i.destroy()))}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;this.seriesRect=e;const{position:s="left",axisId:o}=this.axisCtx,n=i.find(c=>c.id===o);if(!n)return;this.axisLayout=n,this.bounds=e.clone().grow(n.gridPadding+n.seriesAreaPadding,s);const{crosshairGroup:r,bounds:a}=this;r.translationX=Math.round(a.x),r.translationY=Math.round(a.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l)}updateSelections(e){this.lineGroupSelection.update(e,t=>t.append(new CN),t=>t)}updateLabels(e){const{labels:t,ctx:i}=this;for(const s of e)this.label.enabled&&(t[s]??(t[s]=new Wp(i.domManager,s,this.axisCtx.axisId))),t[s]&&this.updateLabel(t[s]);this.labelFormatter=this.axisCtx.scaleValueFormatter(this.label.format)}updateLabel(e){const{enabled:t,xOffset:i,yOffset:s,format:o,renderer:n}=this.label;e.enabled=t,e.xOffset=i,e.yOffset=s,e.format=o,e.renderer=n}updateLines(){const{lineGroupSelection:e,bounds:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:n,lineDashOffset:r,axisLayout:a}=this;if(!a)return;const l=this.isVertical();e.each(c=>{c.stroke=i,c.strokeWidth=s,c.strokeOpacity=o,c.lineDash=n,c.lineDashOffset=r,c.y1=0,c.y2=l?t.height:0,c.x1=0,c.x2=l?0:t.width})}isVertical(){return this.axisCtx.direction===xN.X}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(e){const{labelFormatter:t,axisLayout:i,ctx:{callbackCache:s}}=this;if(t){const o=s.call(t,e);if(o!=null)return o}if(typeof e=="number"){const o=(i?.label.fractionDigits??0)+(Uie(e)?0:1);return jie(e,o)}return String(e??"")}onClick(e){e.device==="touch"&&this.onMouseHoverLike(e)}onMouseHoverLike(e){if(!this.enabled||this.snap)return;const t=this.isHover(e)?vv.Clickable:vv.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&(this.updatePositions(this.getData(e)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(L.ChartUpdateType.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(vv.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(L.ChartUpdateType.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(vv.Default)&&this.hideCrosshairs()}onHighlightChange(e){if(!this.enabled)return;const{crosshairGroup:t,axisCtx:i}=this,{datum:s,series:o}=e.currentHighlight??{},n=s&&(o?.axes.x?.id===i.axisId||o?.axes.y?.id===i.axisId);if(this.activeHighlight=n?e.currentHighlight:void 0,!this.activeHighlight)this.hideCrosshairs();else if(this.snap){const r=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(r),t.visible=!0}}isInRange(e){return this.axisCtx.inRange(e)}updatePositions(e){const{seriesRect:t,lineGroupSelection:i}=this;i.each((s,o)=>{const n=e[o];if(!n){s.visible=!1,this.hideLabel(o);return}s.visible=!0;const{value:r,position:a}=n;let l=0,c=0;this.isVertical()?(l=a,s.x=Math.round(l)):(c=a,s.y=Math.round(c)),this.label.enabled?this.showLabel(l+t.x,c+t.y,r,o):this.hideLabel(o)})}getData(e){const{axisCtx:t}=this,i="pointer",{datum:s,xKey:o="",yKey:n=""}=this.activeHighlight??{},{currentX:r,currentY:a}=e,l=this.isVertical(),c=l?r:a;let d=s?.[l?o:n]??"";return t.continuous&&(d=t.scaleInvert(c)),{[i]:{position:c,value:d}}}getActiveHighlightData(e){const{axisCtx:t}=this,{datum:i,series:s,xKey:o="",aggregatedValue:n,cumulativeValue:r,midPoint:a}=e,l=s.getKeyProperties(t.direction),c=(t.scale.bandwidth??0)/2,d=s.axes[t.direction]?.id===t.axisId,h=l.indexOf("yKey")>-1&&d,u=l.indexOf("xKey")>-1&&d,p=n??r;if(h&&p!==void 0){const f=t.scale.convert(p)+c;return this.isInRange(f)?{yKey:{value:p,position:f}}:{}}if(u){const f=(this.isVertical()?a?.x:a?.y)??0,y=t.continuous?t.scaleInvert(f):i[o];return this.isInRange(f)?{xKey:{value:y,position:f}}:{}}const g={};return l.forEach(f=>{const y=s.properties[f],m=i[y],C=t.scale.convert(m)+c;this.isInRange(C)&&(g[f]={value:m,position:C})}),g}getLabelHtml(e,t){const i=this.axisLayout?.label?.fractionDigits??0,s={text:this.formatValue(e)};return this.label.renderer?t.toLabelHtml(this.label.renderer({value:e,fractionDigits:i}),s):t.toLabelHtml(s)}showLabel(e,t,i,s){if(!this.axisLayout)return;const{bounds:o}=this,n=this.labels[s],r=this.getLabelHtml(i,n);n.setLabelHtml(r);const{width:a,height:l}=n.getBBox(),c=this.axisCtx.position;let d=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===xN.X?(d-=4,n.show({x:e-a/2,y:c==="bottom"?o.y+o.height+d:o.y-l-d})):(d-=8,n.show({x:c==="right"?o.x+o.width+d:o.x-a-d,y:t-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const e of Object.keys(this.labels))this.hideLabel(e)}hideLabel(e){this.labels[e]?.toggle(!1)}};v([$c(AH)],Il.prototype,"enabled");v([$c(Vie,{optional:!0})],Il.prototype,"stroke");v([$c(Hie,{optional:!0})],Il.prototype,"lineDash");v([$c(DH)],Il.prototype,"lineDashOffset");v([$c(DH)],Il.prototype,"strokeWidth");v([$c(zie)],Il.prototype,"strokeOpacity");v([$c(AH)],Il.prototype,"snap");v([$c(Wie)],Il.prototype,"label");var Kie={type:"axis-option",optionsKey:"crosshair",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","ordinal-time","number","log","time"],moduleFactory:e=>new Il(e),themeTemplate:{crosshair:{snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}}}},{BOOLEAN:$ie,FUNCTION:Yie,ActionOnSet:iy,Validate:IH}=L,jp=class extends L.BaseModuleInstance{constructor(e){super(),this.enabled=!1,this.getData=()=>Promise.resolve(),this.dataService=e.dataService}updateCallback(e,t){this.dataService&&(e&&t!=null?this.dataService.updateCallback(t):this.dataService.clearCallback())}};v([iy({newValue(e){this.updateCallback(e,this.getData)}}),IH($ie)],jp.prototype,"enabled");v([iy({newValue(e){this.updateCallback(this.enabled,e)}}),IH(Yie)],jp.prototype,"getData");v([iy({newValue(e){this.dataService.requestThrottle=e}})],jp.prototype,"requestThrottle");v([iy({newValue(e){this.dataService.dispatchThrottle=e}})],jp.prototype,"updateThrottle");v([iy({newValue(e){this.dataService.dispatchOnlyLatest=!e}})],jp.prototype,"updateDuringInteraction");var Xie={type:"root",optionsKey:"dataSource",packageType:"enterprise",chartTypes:["cartesian","hierarchy","polar","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new jp(e),themeTemplate:{dataSource:{enabled:!1}}},{nearestSquaredInContainer:Zie,partialAssign:qie,mergeDefaults:wN,BBox:Pa}=L,Qie=class{constructor(e){this.components=e,this.union=Pa.merge(e)}containsPoint(e,t){if(!this.union.containsPoint(e,t))return!1;for(const i of this.components)if(i.containsPoint(e,t))return!0;return!1}},Jie=class extends L.Group{constructor(){super(),this.capLength=NaN,this._datum=void 0,this.whiskerPath=new L.Path,this.capsPath=new L.Path,this.bboxes=new Qie([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(e){this._datum=e}calculateCapLength(e,t){const{lengthRatio:i=1,length:s}=e,{lengthRatioMultiplier:o,lengthMax:n}=t,r=s??i*o;return Math.min(r,n)}getItemStylerParams(e,t,i){const{datum:s}=this;if(s==null||e.itemStyler==null)return;const{xLowerKey:o,xUpperKey:n,yLowerKey:r,yUpperKey:a}=e;return{...t,datum:s.datum,seriesId:s.datum.seriesId,xKey:s.xKey,yKey:s.yKey,xLowerKey:o,xUpperKey:n,yLowerKey:r,yUpperKey:a,highlighted:i}}formatStyles(e,t,i){let{cap:s,...o}=e;const n=this.getItemStylerParams(t,e,i);if(n!=null&&t.itemStyler!=null){const r=t.itemStyler(n);o=wN(r,o),s=wN(r?.cap,r,s)}return{whiskerStyle:o,capsStyle:s}}applyStyling(e,t){qie(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],e,t)}update(e,t,i){if(this.datum===void 0)return;const{whiskerStyle:s,capsStyle:o}=this.formatStyles(e,t,i),{xBar:n,yBar:r,capDefaults:a}=this.datum,l=this.whiskerPath;this.applyStyling(l,s),l.path.clear(!0),r!==void 0&&(l.path.moveTo(r.lowerPoint.x,r.lowerPoint.y),l.path.lineTo(r.upperPoint.x,r.upperPoint.y)),n!==void 0&&(l.path.moveTo(n.lowerPoint.x,n.lowerPoint.y),l.path.lineTo(n.upperPoint.x,n.upperPoint.y)),l.path.closePath(),this.capLength=this.calculateCapLength(o??{},a);const c=this.capLength/2,d=this.capsPath;this.applyStyling(d,o),d.path.clear(!0),r!==void 0&&(d.path.moveTo(r.lowerPoint.x-c,r.lowerPoint.y),d.path.lineTo(r.lowerPoint.x+c,r.lowerPoint.y),d.path.moveTo(r.upperPoint.x-c,r.upperPoint.y),d.path.lineTo(r.upperPoint.x+c,r.upperPoint.y)),n!==void 0&&(d.path.moveTo(n.lowerPoint.x,n.lowerPoint.y-c),d.path.lineTo(n.lowerPoint.x,n.lowerPoint.y+c),d.path.moveTo(n.upperPoint.x,n.upperPoint.y-c),d.path.lineTo(n.upperPoint.x,n.upperPoint.y+c)),d.path.closePath()}updateBBoxes(){const{capLength:e,whiskerPath:t,capsPath:i}=this,{yBar:s,xBar:o}=this.datum??{},n=e/2,r=[];if(s!==void 0){const a=s.lowerPoint.y-s.upperPoint.y;r.push(new Pa(s.lowerPoint.x,s.upperPoint.y,t.strokeWidth,a),new Pa(s.lowerPoint.x-n,s.lowerPoint.y,e,i.strokeWidth),new Pa(s.upperPoint.x-n,s.upperPoint.y,e,i.strokeWidth))}if(o!==void 0){const a=o.upperPoint.x-o.lowerPoint.x;r.push(new Pa(o.lowerPoint.x,o.upperPoint.y,a,t.strokeWidth),new Pa(o.lowerPoint.x,o.lowerPoint.y-n,i.strokeWidth,e),new Pa(o.upperPoint.x,o.upperPoint.y-n,i.strokeWidth,e))}this.bboxes.components=r,this.bboxes.union=Pa.merge(r)}containsPoint(e,t){return this.bboxes.containsPoint(e,t)}pickNode(e,t){return this.containsPoint(e,t)?this:void 0}nearestSquared(e,t,i){const{bboxes:s}=this;if(s.union.distanceSquared(e,t)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:o}=Pa.nearestBox(e,t,s.components);return{nearest:this,distanceSquared:o}}},ese=class extends L.Group{nearestSquared(e,t){const{nearest:i,distanceSquared:s}=Zie(e,t,{children:this.children()});if(i!==void 0&&!isNaN(s))return{datum:i.datum,distanceSquared:s}}},{BaseProperties:RH,Validate:Bt,BOOLEAN:kH,COLOR_STRING:TH,FUNCTION:tse,LINE_DASH:LH,NUMBER:ise,OBJECT:sse,POSITIVE_NUMBER:cx,RATIO:hk,STRING:Yc}=L,Rl=class extends RH{};v([Bt(kH,{optional:!0})],Rl.prototype,"visible");v([Bt(TH,{optional:!0})],Rl.prototype,"stroke");v([Bt(cx,{optional:!0})],Rl.prototype,"strokeWidth");v([Bt(hk,{optional:!0})],Rl.prototype,"strokeOpacity");v([Bt(LH,{optional:!0})],Rl.prototype,"lineDash");v([Bt(cx,{optional:!0})],Rl.prototype,"lineDashOffset");v([Bt(ise,{optional:!0})],Rl.prototype,"length");v([Bt(hk,{optional:!0})],Rl.prototype,"lengthRatio");var ds=class extends RH{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new Rl}};v([Bt(Yc,{optional:!0})],ds.prototype,"yLowerKey");v([Bt(Yc,{optional:!0})],ds.prototype,"yLowerName");v([Bt(Yc,{optional:!0})],ds.prototype,"yUpperKey");v([Bt(Yc,{optional:!0})],ds.prototype,"yUpperName");v([Bt(Yc,{optional:!0})],ds.prototype,"xLowerKey");v([Bt(Yc,{optional:!0})],ds.prototype,"xLowerName");v([Bt(Yc,{optional:!0})],ds.prototype,"xUpperKey");v([Bt(Yc,{optional:!0})],ds.prototype,"xUpperName");v([Bt(kH,{optional:!0})],ds.prototype,"visible");v([Bt(TH,{optional:!0})],ds.prototype,"stroke");v([Bt(cx,{optional:!0})],ds.prototype,"strokeWidth");v([Bt(hk,{optional:!0})],ds.prototype,"strokeOpacity");v([Bt(LH,{optional:!0})],ds.prototype,"lineDash");v([Bt(cx,{optional:!0})],ds.prototype,"lineDashOffset");v([Bt(tse,{optional:!0})],ds.prototype,"itemStyler");v([Bt(sse)],ds.prototype,"cap");var{fixNumericExtent:ose,groupAccumulativeValueProperty:nse,mergeDefaults:rse,valueProperty:Cv,ChartAxisDirection:rM}=L;function ase(e){for(const t of iD)if(t===e.series.type)return e.series;throw new Error(`AG Charts - unsupported series type '${e.series.type}', error bars supported series types: ${iD.join(", ")}`)}var lse=class Kg extends L.BaseModuleInstance{constructor(t){super(),this.properties=new ds;const i=ase(t),{annotationGroup:s,annotationSelections:o}=i;this.cartesianSeries=i,this.groupNode=new ese({name:`${s.id}-errorBars`}),s.appendChild(this.groupNode),this.selection=L.Selection.select(this.groupNode,()=>this.errorBarFactory()),o.add(this.selection),i.addEventListener("seriesVisibilityChange",n=>this.onToggleSeriesItem(n)),this.destroyFns.push(i.addListener("data-processed",n=>this.onDataProcessed(n)),i.addListener("data-update",n=>this.onDataUpdate(n)),t.highlightManager.addListener("highlight-change",n=>this.onHighlightChange(n)),()=>s.removeChild(this.groupNode),()=>o.delete(this.selection))}hasErrorBars(){const{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:o}=this.properties;return os(t)&&os(i)||os(s)&&os(o)}isStacked(){const t=this.cartesianSeries.seriesGrouping?.stackCount;return t==null?!1:t>0}getUnstackPropertyDefinition(t){const i=[],{xLowerKey:s,xUpperKey:o,yLowerKey:n,yUpperKey:r,xErrorsID:a,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:d}=t;return n!=null&&r!=null&&i.push(Cv(n,d,{id:`${l}-lower`}),Cv(r,d,{id:`${l}-upper`})),s!=null&&o!=null&&i.push(Cv(s,c,{id:`${a}-lower`}),Cv(o,c,{id:`${a}-upper`})),i}getStackPropertyDefinition(t){const i=[],{cartesianSeries:s}=this,{xLowerKey:o,xUpperKey:n,yLowerKey:r,yUpperKey:a,xErrorsID:l,yErrorsID:c}=this.getMaybeFlippedKeys(),{xScaleType:d,yScaleType:h}=t,u=s.seriesGrouping?.groupIndex??s.id,p={invalidValue:null,missingValue:0,separateNegative:!0,...s.visible?{}:{forceValue:0}},g=(y,m,C,b)=>nse(y,"normal","current",{id:`${m}-${C}`,groupId:`errorGroup-${u}-${C}`,...p},b),f=(y,m,C,b)=>{i.push(...g(y,C,"lower",b),...g(m,C,"upper",b))};return r!=null&&a!=null&&f(r,a,c,h),o!=null&&n!=null&&f(o,n,l,d),i}getPropertyDefinitions(t){return this.isStacked()?this.getStackPropertyDefinition(t):this.getUnstackPropertyDefinition(t)}onDataProcessed(t){this.dataModel=t.dataModel,this.processedData=t.processedData}getDomain(t){const{xLowerKey:i,xUpperKey:s,xErrorsID:o,yLowerKey:n,yUpperKey:r,yErrorsID:a}=this.getMaybeFlippedKeys();if(t===rM.X?os(i)&&os(s):os(n)&&os(r)){const{dataModel:c,processedData:d,cartesianSeries:h}=this;if(c!=null&&d!=null){const u={x:o,y:a}[t],p=c.getDomain(h,`${u}-lower`,"value",d),g=c.getDomain(h,`${u}-upper`,"value",d),f=[Math.min(...p,...g),Math.max(...p,...g)];return ose(f)}}return[]}onDataUpdate(t){this.dataModel=t.dataModel,this.processedData=t.processedData,os(t.dataModel)&&os(t.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const t=this.getNodeData(),i=this.cartesianSeries.axes[rM.X]?.scale,s=this.cartesianSeries.axes[rM.Y]?.scale;if(!(!i||!s||!t))for(let o=0;o<t.length;o++){const{midPoint:n,xLower:r,xUpper:a,yLower:l,yUpper:c}=this.getDatum(t,o);if(n!=null){let d,h;os(r)&&os(a)&&(d={lowerPoint:{x:this.convert(i,r),y:n.y},upperPoint:{x:this.convert(i,a),y:n.y}}),os(l)&&os(c)&&(h={lowerPoint:{x:n.x,y:this.convert(s,l)},upperPoint:{x:n.x,y:this.convert(s,c)}}),t[o].xBar=d,t[o].yBar=h}}}getMaybeFlippedKeys(){let{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:o}=this.properties,[n,r]=["xValue-errors","yValue-errors"];return this.cartesianSeries.shouldFlipXY()&&([t,s]=[s,t],[i,o]=[o,i],[n,r]=[r,n]),{xLowerKey:t,xUpperKey:i,xErrorsID:n,yLowerKey:s,yUpperKey:o,yErrorsID:r}}static getDatumKey(t,i,s){if(i==null)return;const o=t.datum[i];if(o!=null){if(typeof o!="number"){et.warnOnce(`Found [${i}] error value of type ${typeof o}. Expected number type`);return}return o+s}}getDatum(t,i){const{xLowerKey:s,xUpperKey:o,yLowerKey:n,yUpperKey:r}=this.getMaybeFlippedKeys(),a=t[i],l=a.cumulativeValue==null||!this.isStacked()?0:a.cumulativeValue-a.yValue,[c,d]=this.cartesianSeries.shouldFlipXY()?[l,0]:[0,l];return{midPoint:a.midPoint,xLower:Kg.getDatumKey(a,s,c),xUpper:Kg.getDatumKey(a,o,c),yLower:Kg.getDatumKey(a,n,d),yUpper:Kg.getDatumKey(a,r,d)}}convert(t,i){const s=(t.bandwidth??0)/2;return t.convert(i)+s}update(){const t=this.getNodeData();t!=null&&(this.selection.update(t),this.selection.each((i,s,o)=>this.updateNode(i,s,o)))}updateNode(t,i,s){t.datum=i,t.update(this.getDefaultStyle(),this.properties,!1),t.updateBBoxes()}pickNodeExact(t){const{x:i,y:s}=t,o=this.groupNode.pickNode(i,s);if(o!=null)return{datum:o.datum,distanceSquared:0}}pickNodeNearest(t){return this.groupNode.nearestSquared(t.x,t.y)}pickNodeMainAxisFirst(t){return this.groupNode.nearestSquared(t.x,t.y)}getTooltipParams(){const{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:o,xLowerName:n=t,xUpperName:r=i,yLowerName:a=s,yUpperName:l=o}=this.properties;return{xLowerKey:t,xLowerName:n,xUpperKey:i,xUpperName:r,yLowerKey:s,yLowerName:a,yUpperKey:o,yUpperName:l}}onToggleSeriesItem(t){this.groupNode.visible=t.visible}makeStyle(t){return{visible:t.visible,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity,cap:rse(this.properties.cap,t)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(t,i,s){const o=this.getNodeData();if(o!=null){for(let n=0;n<o.length;n++)if(t===o[n]){this.selection.at(n)?.update(i,this.properties,s);break}}}onHighlightChange(t){const{previousHighlight:i,currentHighlight:s}=t;s?.series===this.cartesianSeries&&this.restyleHighlightChange(s,this.getHighlightStyle(),!0),i?.series===this.cartesianSeries&&this.restyleHighlightChange(i,this.getDefaultStyle(),!1),this.groupNode.opacity=this.cartesianSeries.getOpacity()}errorBarFactory(){return new Jie}getWhiskerProperties(){const{stroke:t,strokeWidth:i,visible:s,strokeOpacity:o,lineDash:n,lineDashOffset:r}=this.properties;return{stroke:t,strokeWidth:i,visible:s,strokeOpacity:o,lineDash:n,lineDashOffset:r}}},cse={series:{errorBar:{visible:!0,stroke:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1,cap:{length:void 0,lengthRatio:void 0}}}},dse={type:"series-option",identifier:"error-bars",optionsKey:"errorBar",packageType:"enterprise",chartTypes:["cartesian"],seriesTypes:iD,moduleFactory:e=>new lse(e),themeTemplate:cse},{ZIndexMap:hse,ActionOnSet:use,Validate:uk,ProxyPropertyOnWrite:EH,OBJECT:pse,RATIO:gse,COLOR_STRING:fse}=L,dx=class extends L.Background{constructor(){super(...arguments),this.image=new pa,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new L.Group({name:"foreground",zIndex:hse.FOREGROUND})}onLayoutComplete(e){super.onLayoutComplete(e);const{width:t,height:i}=e.chart;let s={x:0,y:0,width:t,height:i};this.image&&(s=this.image.performLayout(t,i)),this.text&&this.updateTextNode(s)}onImageLoad(){this.ctx.updateService.update(L.ChartUpdateType.SCENE_RENDER)}updateTextNode(e){const{textNode:t}=this;t.fontWeight="bold",t.fontFamily="Impact, sans-serif",t.fontSize=19,t.opacity=.7,t.fill="#9b9b9b",t.textBaseline="top";const i=this.textNode.getBBox(),s=10;t.x=e.x+e.width/2-i.width/2,t.y=e.y+e.height+s}};v([uk(pse,{optional:!0}),use({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){this.node.removeChild(e.node),e.onLoad=void 0}})],dx.prototype,"image");v([uk(fse,{optional:!0}),EH("rectNode","fill")],dx.prototype,"fill");v([uk(gse,{optional:!0}),EH("rectNode","fillOpacity")],dx.prototype,"fillOpacity");var mse={type:"root",optionsKey:"foreground",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new dx(e)},{TranslatableGroup:yse,ScenePathChangeDetection:PH}=L,pk=class extends yse{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(e,t){const{cornerRadius:i,inset:s}=this,{x:o,y:n,width:r,height:a}=t;e.beginPath(),e.roundRect(o+s,n+s,r-2*s,a-2*s,i),e.clip()}};v([PH()],pk.prototype,"inset");v([PH()],pk.prototype,"cornerRadius");var{Validate:gk,BOOLEAN:vse,POSITIVE_NUMBER:NH,ZIndexMap:bd,ActionOnSet:OH,CategoryAxis:Cse,TextUtils:bse,Padding:Sse,Group:Sd,BBox:MN,ProxyProperty:FH}=L,fk=class{constructor(){this.top=0,this.bottom=0}};v([gk(NH)],fk.prototype,"top");v([gk(NH)],fk.prototype,"bottom");var Up=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.padding=new fk,this.root=new Sd({name:"root"}),this.seriesRoot=this.root.appendChild(new pk({name:"Series-root",zIndex:bd.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new Sd({name:"Axes-Grids",zIndex:bd.AXIS_GRID})),this.axisGroup=this.root.appendChild(new Sd({name:"Axes-Grids",zIndex:bd.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new Sd({name:"Axes-Labels",zIndex:bd.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new Sd({name:"Axes-Crosslines-Range",zIndex:bd.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new Sd({name:"Axes-Crosslines-Line",zIndex:bd.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new Sd({name:"Axes-Crosslines-Label",zIndex:bd.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.axes=[],this.series=[]}destroy(){this._destroyed||(this.destroySeries(this.series),this.axes.forEach(e=>e.destroy()),this.axes=[],this._destroyed=!0)}onSeriesChange(e,t){const i=t?.filter(s=>!e.includes(s))??[];this.destroySeries(i);for(const s of e){if(t?.includes(s))continue;s.attachSeries(this.seriesRoot,this.seriesRoot,void 0);const o=this;s.chart={get mode(){return"standalone"},get isMiniChart(){return!0},get seriesRect(){return o.seriesRect}},s.resetAnimation(this.miniChartAnimationPhase==="initial"?"initial":"disabled")}}destroySeries(e){e?.forEach(t=>{t.destroy(),t.detachSeries(this.seriesRoot,this.seriesRoot,void 0),t.chart=void 0})}assignSeriesToAxes(){this.axes.forEach(e=>{e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)})}assignAxesToSeries(){const e={};this.axes.forEach(t=>{const i=t.direction;(e[i]??(e[i]=[])).push(t)}),this.series.forEach(t=>{t.directions.forEach(i=>{const s=e[i];if(!s){et.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);return}const o=t.getKeys(i),n=this.findMatchingAxis(s,o);if(!n){et.warnOnce(`no matching axis for direction [${i}] and keys [${o}]; check series and axes configuration.`);return}t.axes[i]=n})})}findMatchingAxis(e,t){for(const i of e){if(!i.keys.length)return i;if(t){for(const s of t)if(i.keys.includes(s))return i}}}updateData(e){this.series.forEach(t=>t.setChartData(e)),this.miniChartAnimationPhase==="initial"&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready",this.series.forEach(t=>t.resetAnimation("disabled"))})}async processData(e){this.series.some(t=>t.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(t=>(t.resetDatumCallbackCache(),t.processData(e))));for(const t of this.axes)t.processData()}computeAxisPadding(){const e=new Sse;return this.enabled&&this.axes.forEach(({position:t,thickness:i,line:s,label:o})=>{if(t==null)return;let n;i?n=i:n=(s.enabled?s.width:0)+(o.enabled?bse.getLineHeight(o.fontSize??0)+o.spacing:0),e[t]=Math.ceil(n)}),e}async layout(e,t){const{padding:i}=this,s=this.seriesRect!=null,o=new MN(0,0,e,t-(i.top+i.bottom));this.seriesRect=o,this.seriesRoot.translationY=i.top,this.seriesRoot.setClipRectCanvasSpace(new MN(0,-i.top,e,t)),this.axes.forEach(n=>{const{position:r="left"}=n;switch(r){case"top":case"bottom":n.range=[0,o.width],n.gridLength=o.height;break;case"right":case"left":{const a=n instanceof Cse;n.range=a?[0,o.height]:[o.height,0],n.gridLength=o.width;break}}n.gridPadding=0,n.translation.x=0,n.translation.y=0,r==="right"?n.translation.x=e:r==="bottom"&&(n.translation.y=t),s||n.resetAnimation("initial"),n.calculateLayout(),n.update()}),await Promise.all(this.series.map(n=>n.update({seriesRect:o})))}};v([gk(vse)],Up.prototype,"enabled");v([FH(["seriesRoot","inset"])],Up.prototype,"inset");v([FH(["seriesRoot","cornerRadius"])],Up.prototype,"cornerRadius");v([OH({changeValue(e,t=[]){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(i),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i)}})],Up.prototype,"axes");v([OH({changeValue(e,t){this.onSeriesChange(e,t)}})],Up.prototype,"series");var{clamp:xse,SliderWidget:DN}=L,wse=class{constructor(e,t){this.ctx=e,this.sliderHandlers=t,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=e,this.toolbar=e.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[e.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[i,s]of["min","pan","max"].entries()){const o=this.sliders[i];o.step=DN.STEP_HUNDRETH,o.keyboardStep=DN.STEP_ONE,o.orientation="horizontal",o.setPreventsDefault(!1),o.addListener("drag-start",n=>this.onDragStart(i,n,s)),o.addListener("drag-move",n=>this.onDrag(o,n,s)),o.addListener("drag-end",()=>this.updateSliderRatios()),o.addListener("contextmenu",n=>this.onContextMenu(o,n))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(e){this.toolbar.setHidden(!e)}updateZoom(){const{_min:e,_max:t}=this;if(!(e==null||t==null))return this.ctx.zoomManager.updateZoom("navigator",{x:{min:e,max:t}})}updateBounds(e){this.toolbar.setBounds(e)}updateSliderBounds(e,t){this.sliders[e].setBounds(t)}updateMinMax(e,t){this._min=e,this._max=t,this.updateSliderRatios()}updateSliderRatios(){const{_min:e,_max:t}=this,i=this.ctx.localeManager.t("ariaValuePanRange",{min:e,max:t});this.sliders[0].setValueRatio(e),this.sliders[1].setValueRatio(e,{ariaValueText:i}),this.sliders[2].setValueRatio(t)}toCanvasOffsets(e){return{offsetX:this.dragStartX+e.originDeltaX}}moveToFront(e){if(e===1)return;const t=this.sliders[e],i=this.sliders[2-e];this.toolbar.moveChild(i,t.domIndex-1)}onDragStart(e,t,i){const s=this.sliders[e],o=this.toolbar.cssLeft(),n=s.cssLeft();this.dragStartX=o+n+t.offsetX,this.moveToFront(e),t.device==="touch"&&t.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(t))}onDrag(e,t,i){t.device==="touch"&&t.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(t))}onContextMenu(e,{sourceEvent:t,offsetX:i,offsetY:s}){const{x:o,y:n}=this.toolbar.getBounds(),{x:r,y:a}=e.getBounds(),l=i+o+r,c=s+n+a;this.ctx.contextMenuRegistry.dispatchContext("all",{sourceEvent:t,canvasX:l,canvasY:c},{})}onPanSliderChange(){const e=this.sliders[1].getValueRatio(),t=this._max-this._min;this._min=xse(0,e,1-t),this._max=this._min+t,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}},{Validate:hx,ScenePathChangeDetection:ux,POSITIVE_NUMBER:mk,BOOLEAN:Mse,BBox:Dse,ExtendedPath2D:Ase}=L,Mc=class extends L.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new Ase}setCenter(e,t){this.dirtyPath=!0,(this.centerX!==e||this.centerY!==t)&&(this.centerX=e,this.centerY=t,this.markDirty())}static align(e,t,i,s,o,n,r,a,l){const c=e.align(i+o*r)+l,d=c+e.align(i+o*r,o*(a-r))-2*l,h=e.align(s+n/2);e.setCenter(c,h),t.setCenter(d,h)}computeBBox(){const{centerX:e,centerY:t,width:i,height:s}=this,o=e-i/2,n=t-s/2;return new Dse(o,n,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}updatePath(){const{centerX:e,centerY:t,path:i,gripPath:s,strokeWidth:o,cornerRadius:n,grip:r}=this,a=o/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),s.clear();const c=Math.floor(this.width/2*l)/l,d=Math.floor(this.height/2*l)/l;i.roundRect(e-c+a,t-d+a,2*(c-a),2*(d-a),n);const h=3;if(r)for(let u=-.5;u<=.5;u+=1)for(let p=-1;p<=1;p+=1)s.arc(e+u*h,t+p*h,1,0,2*Math.PI),s.closePath()}renderFill(e,t){const{stroke:i}=this;super.renderFill(e,t),e.fillStyle=typeof i=="string"?i:"black",e.fill(this.gripPath.getPath2D())}};Mc.className="RangeHandle";v([hx(mk),ux()],Mc.prototype,"width");v([hx(mk),ux()],Mc.prototype,"height");v([hx(mk),ux()],Mc.prototype,"cornerRadius");v([hx(Mse),ux()],Mc.prototype,"grip");var{Path:Ise,BBox:Mg,ExtendedPath2D:Rse,clippedRoundRect:aM,POSITIVE_NUMBER:kse,Validate:Tse,ScenePathChangeDetection:Lse}=L,yk=class extends Ise{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new Rse}layout(e,t,i,s,o,n){o=isNaN(o)?this.min:o,n=isNaN(n)?this.max:n,(e!==this.x||t!==this.y||i!==this.width||this.height!==s||o!==this.min||n!==this.max)&&(this.x=e,this.y=t,this.width=i,this.height=s,this.min=o,this.max=n,this.dirtyPath=!0,this.markDirty())}computeBBox(){const{x:e,y:t,width:i,height:s}=this;return new Mg(e,t,i,s)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:s,min:o,max:n}=this,r=e+i*o,a=e+i*n;return new Mg(r,t,a-r,s)}updatePath(){const{path:e,visiblePath:t,x:i,y:s,width:o,height:n,min:r,max:a,strokeWidth:l,cornerRadius:c}=this,d=l/2;e.clear(),t.clear();const h=this.align(i)+d,u=this.align(s)+d,p=this.align(i,o)-2*d,g=this.align(s,n)-2*d,f=this.align(i+o*r)+d,y=f+this.align(i+o*r,o*(a-r))-2*d,m={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c};aM(e,h,u,p,g,m,new Mg(h,u,f-h,g)),aM(e,h,u,p,g,m,new Mg(y,u,p+h-y,g)),y-f>1&&aM(t,h,u,p,g,m,new Mg(f,u,y-f,g))}renderStroke(e,t){super.renderStroke(e,t),super.renderStroke(e,this.visiblePath.getPath2D())}};yk.className="RangeMask";v([Tse(kse),Lse()],yk.prototype,"cornerRadius");var Ese=class extends L.Group{constructor(e){super({name:"rangeSelectorGroup",zIndex:L.ZIndexMap.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new L.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(e)}layout(e,t,i,s,o,n){this.x=e,this.y=t,this.width=i,this.height=s,this.lOffset=o,this.rOffset=n,this.background.translationX=e,this.background.translationY=t,this.markDirty()}updateBackground(e,t){e!=null&&this.background.removeChild(e),t!=null&&this.background.appendChild(t),this.markDirty()}computeBBox(){const{x:e,y:t,width:i,height:s,lOffset:o,rOffset:n}=this;return new L.BBox(e-o,t,i+(o+n),s)}},{clamp:lM,BaseModuleInstance:Pse,ObserveChanges:vk,Validate:px,BOOLEAN:Nse,POSITIVE_NUMBER:Ck}=L,Kp=class extends Pse{constructor(e){super(),this.ctx=e,this.enabled=!1,this.mask=new yk,this.minHandle=new Mc,this.maxHandle=new Mc,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(t,i)=>({x:t,y:i})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new Ese([this.mask,this.minHandle,this.maxHandle]),this.destroyFns.push(e.scene.attachNode(this.rangeSelector),this.ctx.localeManager.addListener("locale-changed",()=>this.updateZoom()),this.ctx.layoutManager.registerElement(L.LayoutElement.Navigator,t=>this.onLayoutStart(t)),this.ctx.layoutManager.addListener("layout:complete",t=>this.onLayoutComplete(t)),e.zoomManager.addListener("zoom-change",t=>this.onZoomChange(t))),this.domProxy=new wse(e,this),this.updateGroupVisibility(),this.miniChart=new Up(e)}updateBackground(e,t){this.rangeSelector?.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;this.rangeSelector==null||e===this.rangeSelector.visible||(this.rangeSelector.visible=e,this.domProxy.updateVisibility(e),e?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}onLayoutStart(e){if(this.enabled){const{layoutBox:t}=e,i=this.height+this.spacing;t.shrink(i,"bottom"),this.y=t.y+t.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:t,bottom:i}=this.miniChart.computeAxisPadding();e.layoutBox.shrink(t+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(e){const{x:t,width:i}=e.series.rect,{y:s,height:o}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:n,_max:r}=this.domProxy;this.layoutNodes(t,s,i,o,n,r),this.domProxy.updateBounds({x:t,y:s,width:i,height:o})}this.x=t,this.width=i,this.miniChart?.layout(i,o).catch(n=>et.error(n))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(L.InteractionState.ZoomDraggable)}onDragStart(e,{offsetX:t}){this.canDrag()&&(e==="pan"&&(this.panStart=(t-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(e,{offsetX:t}){if(!this.canDrag())return;const{panStart:i,x:s,width:o}=this,{minRange:n}=this.domProxy;let{_min:r,_max:a}=this.domProxy;const l=(t-s)/o;if(e==="min")r=lM(0,l,a-n);else if(e==="max")a=lM(r+n,l,1);else if(e==="pan"&&i!=null){const c=a-r;r=lM(0,l-i,1-c),a=r+c}this.domProxy._min=r,this.domProxy._max=a,this.updateZoom()}onZoomChange(e){const{x:t}=e;if(!t)return;const{x:i,y:s,width:o,height:n}=this,{min:r,max:a}=t;this.domProxy.updateMinMax(r,a),this.layoutNodes(i,s,o,n,r,a)}layoutNodes(e,t,i,s,o,n){const{rangeSelector:r,mask:a,minHandle:l,maxHandle:c}=this;a.layout(e,t,i,s,o,n),r.layout(e,t,i,s,l.width/2,c.width/2),Mc.align(l,c,e,t,i,s,o,n,a.strokeWidth/2),o+(n-o)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3),[l,this.maskVisibleRange,c].forEach((d,h)=>{const u=d.getBBox(),p={x:u.x-e,y:u.y-t,height:u.height,width:u.width};this.domProxy.updateSliderBounds(h,p)})}updateZoom(){this.enabled&&this.domProxy.updateZoom()}updateData(e){return this.miniChart?.updateData(e)}async processData(e){if(this.miniChart)return this.miniChart?.processData(e)}};v([vk((e,t,i)=>{e.updateBackground(i?.root,t?.root)})],Kp.prototype,"miniChart");v([px(Nse),vk((e,t)=>{e.ctx.zoomManager.setNavigatorEnabled(!!t),e.updateGroupVisibility()})],Kp.prototype,"enabled");v([px(Ck)],Kp.prototype,"height");v([px(Ck),vk((e,t)=>{e.mask.cornerRadius=t})],Kp.prototype,"cornerRadius");v([px(Ck)],Kp.prototype,"spacing");var Ose={type:"root",optionsKey:"navigator",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Kp(e),removable:!1,themeTemplate:{navigator:{enabled:!1,height:18,cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:[L.FONT_SIZE_RATIO.SMALLER]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0}}}}},{AND:Fse,ARRAY:AN,FUNCTION:Bse,NUMBER:Gse,OR:_se,ToolbarButtonProperties:zse,Validate:Vse}=L,BH=class extends zse{};v([Vse(_se(Gse,Fse(AN,AN.restrict({length:2})),Bse))],BH.prototype,"value");var{BOOLEAN:Hse,OBJECT:Wse,ChartAxisDirection:cM,LayoutElement:jse,PropertiesArray:Use,Toolbar:Kse,Validate:GH}=L,bk=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.buttons=new Use(BH),this.verticalSpacing=10,this.container=e.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new Kse(this.ctx.localeManager),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),e.layoutManager.registerElement(jse.ToolbarBottom,this.onLayoutStart.bind(this)),e.zoomManager.addListener("zoom-change",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.container.removeChild(this.toolbar.getElement()),this.toolbar.destroy()}onLayoutStart(e){const{buttons:t,ctx:i,enabled:s,toolbar:o,verticalSpacing:n}=this,{layoutBox:r}=e;if(!s||!i.zoomManager.isZoomEnabled()){o.setHidden(!0);return}o.setHidden(!1),o.updateButtons(t);const a=o.getBounds().height;o.setBounds({x:r.x,y:r.y+r.height-a,width:r.width,height:a}),r.shrink({bottom:a+n})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:e}}){const{zoomManager:t}=this.ctx,i=this.buttons.at(e);if(!i)return;const{value:s}=i;typeof s=="number"?t.extendToEnd("zoom-buttons",cM.X,s):Array.isArray(s)?t.updateWith("zoom-buttons",cM.X,()=>s):typeof s=="function"&&t.updateWith("zoom-buttons",cM.X,s),this.toolbar.toggleActiveButtonByIndex(e)}};v([GH(Hse)],bk.prototype,"enabled");v([GH(Wse)],bk.prototype,"buttons");var _H=1e3*60*60*24,dM=_H*30,$se=_H*365,Yse={type:"root",optionsKey:"ranges",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new bk(e),themeTemplate:{ranges:{enabled:!1,buttons:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:dM},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*dM},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*dM},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),t]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:$se},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:(e,t)=>[e,t]}]}}},zH=class $g extends L.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(t){return this.sharedToolbar||this.createSharedToolbar(),this.toolbarWithSection(t)}createSharedToolbar(){this.sharedToolbar=new L.Toolbar(this.ctx.localeManager,"vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.destroyFns.push(()=>{this.sharedToolbar&&(this.container.removeChild(this.sharedToolbar.getElement()),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(t){const i=this.sharedToolbar,s={layout:(o,n)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==t&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=t;const r=i.getBounds().width;i.setBounds({x:o.x,y:o.y,width:r}),o.shrink({left:r+i.horizontalSpacing+(n??0)})},addToolbarListener:(o,n)=>i.addToolbarListener(o,r=>{const a=this.getSectionIndex(t,r.button.index);if(a<0)return;const l={...r,button:this.sectionButtons[t][a]};n(l)}),updateButtons:o=>{this.sectionButtons[t]=o;const n=$g.SECTION_ORDER.flatMap(r=>this.sectionButtons[r]);i.updateButtons(n)},updateButtonByIndex:(o,n)=>{i.updateButtonByIndex(this.getIndex(t,o),n)},toggleActiveButtonByIndex:o=>{i.toggleActiveButtonByIndex(this.getIndex(t,o))},toggleButtonEnabledByIndex:(o,n)=>{i.toggleButtonEnabledByIndex(this.getIndex(t,o),n)},setHidden:o=>{o?this.activeSections.delete(t):this.activeSections.add(t);let n=0;for(const r of $g.SECTION_ORDER){if(r!==t){n+=this.sectionButtons[r].length;continue}for(const a of this.sectionButtons[t].keys())i.setButtonHiddenByIndex(n+a,o)}},destroy:()=>{s.setHidden(!0),this.activeSections.size===0&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return s.setHidden(!1),s}getIndex(t,i){let s=0;for(const o of $g.SECTION_ORDER){if(o===t)return s+i;s+=this.sectionButtons[o].length}return-1}getSectionIndex(t,i){let s=0;for(const o of $g.SECTION_ORDER){if(o===t)return i>=s+this.sectionButtons[t].length?-1:i-s;s+=this.sectionButtons[o].length}return-1}};zH.SECTION_ORDER=["chartToolbar","annotations"];var Xse=zH,Zse={type:"context",contextKey:"sharedToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Xse(e)},{CachedTextMeasurerPool:Dg,ZIndexMap:qse,LayoutElement:Qse,Validate:to,BaseProperties:Jse,OBJECT:$p,BOOLEAN:eoe,STRING:Yp,COLOR_STRING:toe,RATIO:ioe,valueProperty:soe,TextUtils:ooe,Group:noe,Label:Ag,Rect:roe,Text:Hi}=L,IN={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},aoe={up:"positive",down:"negative"},loe={hlc:"altNeutral"},Sk=class extends Jse{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};v([to(toe)],Sk.prototype,"fill");v([to(ioe)],Sk.prototype,"fillOpacity");var ko=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new Ag,this.positive=new Ag,this.negative=new Ag,this.neutral=new Ag,this.altNeutral=new Ag,this.background=new Sk,this.layoutStyle="block",this.id="status-bar",this.data=void 0,this.layer=new noe({name:"StatusBar",zIndex:qse.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new L.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new roe),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=e.highlightManager,this.labelGroup.visible=!1,this.destroyFns.push(e.scene.attachNode(this.layer),e.layoutManager.registerElement(Qse.Overlay,t=>this.startPerformLayout(t)),e.layoutManager.addListener("layout:complete",t=>this.onLayoutComplete(t)),e.highlightManager.addListener("highlight-change",()=>this.updateHighlight()))}async processData(e){if(!this.enabled||this.data==null)return;const t=[];for(const o of this.labels){const{id:n,key:r}=o,a=this[r];a==null?o.domain=void 0:t.push(soe(a,"number",{id:n}))}if(t.length===0)return;const{processedData:i,dataModel:s}=await e.request(this.id,this.data,{props:t});for(const o of this.labels){const{id:n,key:r}=o;this[r]!=null&&(o.domain=s.getDomain(this,n,"value",i))}}startPerformLayout(e){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled)return;const{layoutBox:t}=e,i=4,s=12,o=0,n=8;this.labelGroup.translationY=t.y+o;const r=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),a=ooe.getLineHeight(r),l=IN[this.getChartType()]??0;let c=0,d,h="alphabetic";if(this.layoutStyle==="block")t.shrink(o+a+n,"top"),d=r+(a-r)/2;else{const{title:u}=this.ctx.chartService;if(h="top",d=o+u.padding,u.enabled){const p=u.node.getBBox();c=p.x+p.width+s}else c=u.padding}for(const{label:u,configuration:p,title:g,value:f,domain:y,formatter:m}of this.labels){if(y==null||(l&p)===0){g.visible=!1,f.visible=!1;continue}const C=Math.max(Dg.measureText(m.format(y[0]),{font:this.positive.getFont(),textBaseline:h,textAlign:"left"}).width,Dg.measureText(m.format(y[1]),{font:this.positive.getFont(),textBaseline:h,textAlign:"left"}).width,Dg.measureText(m.format(y[0]),{font:this.negative.getFont(),textBaseline:h,textAlign:"left"}).width,Dg.measureText(m.format(y[1]),{font:this.negative.getFont(),textBaseline:h,textAlign:"left"}).width);g.visible=!0,f.visible=!0;const b=Dg.measureText(u,{font:this.title.getFont(),textBaseline:h,textAlign:"left"});g.setFont(this.title),g.fill=this.title.color,g.text=u,g.textBaseline=h,g.y=d,g.x=c,c+=b.width+i,f.textBaseline=h,f.y=d,f.x=c,c+=C+s}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=c-s,this.backgroundNode.height=a+o+n,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(e){this.labelGroup.translationX=e.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const e=this.highlightManager.getActiveHighlight(),t=e?.datum??this.data?.at(-1);if(t==null){this.labelGroup.visible=!1;return}this.labelGroup.visible=!0;const i=e?.itemId;let s=i!=null?aoe[i]:void 0;s==null&&this.openKey!=null&&this.closeKey!=null&&(t[this.openKey]<t[this.closeKey]?s="positive":s="negative");for(const{domain:o,value:n,key:r,formatter:a,style:l}of this.labels){if(o==null)continue;let c=l??s??"neutral";c==="neutral"&&(c=loe[this.getChartType()]??c);const d=this[r],h=d!=null?t?.[d]:void 0;n.setFont(this[c]),n.fill=this[c].color,n.text=typeof h=="number"?a.format(h):""}}getChartType(){let e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return(e==null||IN[e]==null)&&(e="candlestick"),e}};v([to(eoe)],ko.prototype,"enabled");v([to(Yp,{optional:!0})],ko.prototype,"openKey");v([to(Yp,{optional:!0})],ko.prototype,"highKey");v([to(Yp,{optional:!0})],ko.prototype,"lowKey");v([to(Yp,{optional:!0})],ko.prototype,"closeKey");v([to(Yp,{optional:!0})],ko.prototype,"volumeKey");v([to($p)],ko.prototype,"title");v([to($p)],ko.prototype,"positive");v([to($p)],ko.prototype,"negative");v([to($p)],ko.prototype,"neutral");v([to($p)],ko.prototype,"altNeutral");v([to($p)],ko.prototype,"background");v([to(Yp)],ko.prototype,"layoutStyle");var coe={type:"root",identifier:"status-bar",optionsKey:"statusBar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new ko(e),themeTemplate:{statusBar:{enabled:!1,layoutStyle:L.ThemeSymbols.DEFAULT_CAPTION_LAYOUT_STYLE,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:L.ThemeSymbols.PALETTE_UP_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:L.ThemeSymbols.PALETTE_DOWN_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:L.ThemeSymbols.PALETTE_NEUTRAL_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"backgroundColor"},fillOpacity:.5},altNeutral:{color:"gray"}}}},{BOOLEAN:xk,STRING:doe,UNION:hoe,BaseProperties:uoe,CartesianAxis:RN,ChartUpdateType:kN,ObserveChanges:sy,TooltipManager:poe,Validate:oy}=L,Lh=class extends uoe{constructor(e){super(),this.moduleContext=e,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0}updateSiblings(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(e??this.groupId))this.updateChart(i)}updateChart(e,t=kN.UPDATE_DATA){e.ctx.updateService.update(t,{skipSync:!0})}enabledZoomSync(){const{syncManager:e,zoomManager:t}=this.moduleContext;this.disableZoomSync=t.addListener("zoom-change",()=>{for(const i of e.getGroupSiblings(this.groupId))i.modulesManager.getModule("sync")?.zoom&&i.ctx.zoomManager.updateZoom("sync",this.mergeZoom(i))})}enabledNodeInteractionSync(){const{highlightManager:e,syncManager:t}=this.moduleContext;this.disableNodeInteractionSync=e.addListener("highlight-change",i=>{for(const s of t.getGroupSiblings(this.groupId))if(s.modulesManager.getModule("sync")?.nodeInteraction){if(!i.currentHighlight?.datum){s.ctx.highlightManager.updateHighlight(s.id),s.ctx.tooltipManager.removeTooltip(s.id);continue}for(const o of s.axes){const n=this.axes==="xy"?"x":this.axes;if(!RN.is(o)||o.direction!==n)continue;const r=s.series.map(a=>{const l=a.getKeys(o.direction);if(o.keys.length&&!o.keys.some(g=>l.includes(g)))return;const{nodeData:c}=a.contextNodeData;if(!c?.length)return;const d=c[0][`${o.direction}Key`];let h=i.currentHighlight.datum[d];const u=jf(h);u&&(h=h.getTime());const p=c.find(g=>{const f=g.datum[d];return u?f.getTime()===h:f===h});return p?{series:a,nodeDatum:p}:null}).filter(os);if(r.length<2&&r[0]?.nodeDatum!==s.ctx.highlightManager.getActiveHighlight()){const{series:a,nodeDatum:l}=r[0]??{};if(s.ctx.highlightManager.updateHighlight(s.id,l),l){const c=l.midPoint?.x??l.point?.x??0,d=l.midPoint?.y??l.point?.y??0,h=poe.makeTooltipMeta({type:"pointermove",canvasX:c,canvasY:d},a,l);delete h.lastPointerEvent,s.ctx.tooltipManager.updateTooltip(s.id,h,a.getTooltipContent(l))}else s.ctx.tooltipManager.removeTooltip(s.id);this.updateChart(s,kN.SERIES_UPDATE)}}}})}getSyncedDomain(e){if(!RN.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{syncManager:t}=this.moduleContext,i=t.getGroup(this.groupId),[{axes:s}]=i,{direction:o,min:n,max:r,nice:a,reverse:l}=e;for(const c of s)if(o===c.direction&&(a!==c.nice||l!==c.reverse||n!==c.min&&(gc(n)||gc(c.min))||r!==c.max&&(gc(r)||gc(c.max)))){et.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),this.enabled=!1;return}return oQ(i.flatMap(c=>c.series).filter(c=>{if(c.visible){const d=c.getKeys(e.direction);return e.keys.length?e.keys.some(h=>d.includes(h)):!0}}).flatMap(c=>c.getDomain(e.direction)))}mergeZoom(e){const{zoomManager:t}=this.moduleContext;if(this.axes==="xy")return t.getZoom();const i=e.ctx.zoomManager.getZoom()??{};return i[this.axes]=t.getZoom()?.[this.axes],i}onEnabledChange(){const{syncManager:e}=this.moduleContext;this.enabled?e.subscribe(this.groupId):e.unsubscribe(this.groupId),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(e,t){if(!this.enabled||e===t)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(t),i.subscribe(e),this.updateSiblings(t),this.updateSiblings(e)}onAxesChange(){if(!this.enabled)return;const{syncManager:e}=this.moduleContext;this.updateChart(e.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:e}=this.moduleContext;e.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};Lh.className="Sync";v([oy(xk),sy(e=>e.onEnabledChange())],Lh.prototype,"enabled");v([oy(doe,{optional:!0}),sy((e,t,i)=>e.onGroupIdChange(t,i))],Lh.prototype,"groupId");v([oy(hoe(["x","y","xy"],"an axis")),sy(e=>e.onAxesChange())],Lh.prototype,"axes");v([oy(xk),sy(e=>e.onNodeInteractionChange())],Lh.prototype,"nodeInteraction");v([oy(xk),sy(e=>e.onZoomChange())],Lh.prototype,"zoom");var goe={type:"root",optionsKey:"sync",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Lh(e),themeTemplate:{sync:{enabled:!1}}},{COLOR_STRING:foe,RATIO:moe,Validate:VH}=L,TN="#2196f3",yoe="#8a8a8a",gx=class extends L.Rect{constructor(){super(...arguments),this.fill=TN,this.fillOpacity=.2,this.zIndex=L.ZIndexMap.ZOOM_SELECTION}updateValid(){this.fill=TN}updateInvalid(){this.fill=yoe}};gx.className="ZoomRect";v([VH(foe)],gx.prototype,"fill");v([VH(moe)],gx.prototype,"fillOpacity");var{UNION:voe,clamp:Coe,isNumberEqual:LN,round:SNe}=L,gt={min:0,max:1},HH="end",WH="middle",fx=voe(["pointer","start","middle","end"],"an anchor point"),bv=(e,t=gt.min,i=gt.max)=>Coe(t,e,i);function wk(){return{x:{...gt},y:{...gt}}}function as(e){return e.x.max-e.x.min}function wn(e){return e.y.max-e.y.min}function EN(e,t,i=1e-10){return LN(e.min,t.min,i)&&LN(e.max,t.max,i)}function df(e,t,i){return EN(e.x,t.x,i)&&EN(e.y,t.y,i)}function xs(e){return{x:{min:e?.x?.min??gt.min,max:e?.x?.max??gt.max},y:{min:e?.y?.min??gt.min,max:e?.y?.max??gt.max}}}function ol(e,t,i){if(!e)return{x:0,y:0};const s=bv(t-e.x,0,e.x+e.width),o=bv(i-e.y,0,e.y+e.height),n=1/e.width*s,r=1-1/e.height*o;return{x:bv(n),y:bv(r)}}function ah(e,t,i){return{x:{min:e.x.min+t,max:e.x.max+t},y:{min:e.y.min+i,max:e.y.max+i}}}function jH(e,t,i){return{x:{min:e.x.min,max:e.x.min+as(e)*t},y:{min:e.y.min,max:e.y.min+wn(e)*i}}}function PN(e,t,i){const s=as(e),o=wn(e),n=e.x.min+s/2,r=e.y.min+o/2;return{x:{min:n-s*t/2,max:n+s*t/2},y:{min:r-o*i/2,max:r+o*i/2}}}function Zn(e,t,i,s){const{min:o,max:n}=t,r=o+(n-o)/2,a=e.max-e.min;switch(i){case"start":return{min:o,max:t.min+a};case"end":return{min:t.max-a,max:n};case"middle":return{min:r-a/2,max:r+a/2};case"pointer":return boe(e,t,s??r);default:return{min:o,max:n}}}function boe(e,t,i){const s=e.max-e.min,o=t.max-t.min,n=i*(1-(o-s)),r=i-n,a=e.min+r,l=e.max+r;return{min:a,max:l}}function Soe(e,t,i){return{x:{min:e.x.min*t,max:e.x.max*t},y:{min:e.y.min*i,max:e.y.max*i}}}function Dn(e){return{x:rb(e.x),y:rb(e.y)}}function rb(e){const t=e.max-e.min;let i=e.max>gt.max?gt.max-t:e.min,s=e.min<gt.min?t:e.max;return i=Math.max(gt.min,i),s=Math.min(gt.max,s),{min:i,max:s}}var xoe=class{update(e,t,i,s,o,n){return this.oldZoom??(this.oldZoom=xs(t===L.ChartAxisDirection.X?{...o,x:n}:{...o,y:n})),this.updateCoords(e.currentX,e.currentY),this.updateZoom(t,i,s)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(e,t){this.coords?(this.coords.x2=e,this.coords.y2=t):this.coords={x1:e,y1:t,x2:e,y2:t}}updateZoom(e,t,i){const{coords:s,oldZoom:o}=this;let n=xs(o);if(!s||!o)return e===L.ChartAxisDirection.X?n.x:n.y;const r=ol(i,s.x1,s.y1),a=ol(i,s.x2,s.y2);if(e===L.ChartAxisDirection.X){const c=(a.x-r.x)*as(o);return n.x.max+=c,n.x=Zn(n.x,o.x,t,r.x),n=Dn(n),n.x}const l=(a.y-r.y)*wn(o);return n.y.max-=l,n.y=Zn(n.y,o.y,t,r.y),n=Dn(n),n.y}},woe="zoom-action",Moe="pan-action",Doe=class{constructor(e,t,i,s,o,n){this.contextMenuRegistry=e,this.zoomManager=t,this.getModuleProperties=i,this.getRect=s,this.updateZoom=o,this.isZoomValid=n}registerActions(e){if(!e)return;const{contextMenuRegistry:t}=this,i=t.registerDefaultAction({id:woe,type:"series-area",label:"contextMenuZoomToCursor",action:this.onZoomToHere.bind(this),toggleEnabledOnShow:o=>{const n=this.getRect();if(!n)return!0;const r=ol(n,o.x,o.y);return this.iterateFindNextZoomAtPoint(r)!=null}}),s=t.registerDefaultAction({id:Moe,type:"series-area",label:"contextMenuPanToCursor",action:this.onPanToHere.bind(this),toggleEnabledOnShow:()=>!df(xs(this.zoomManager.getZoom()),wk())});return()=>{i(),s()}}computeOrigin(e){const t=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!t||!e?.target||!(e instanceof MouseEvent))return;const s={x:0,y:0,width:t.width,height:t.height};return ol(s,e.offsetX,e.offsetY)}onZoomToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=this.iterateFindNextZoomAtPoint(t);i!=null&&this.updateZoom(i)}onPanToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=xs(this.zoomManager.getZoom()),s=as(i),o=wn(i),n=t.x*s,r=t.y*o,a=(gt.max-gt.min)/2;let l={x:{min:t.x-a,max:t.x+a},y:{min:t.y-a,max:t.y+a}};l=PN(l,s,o),l=ah(l,i.x.min-t.x+n,i.y.min-t.y+r),this.updateZoom(Dn(l))}iterateFindNextZoomAtPoint(e){const{scrollingStep:t}=this.getModuleProperties();for(let i=t;i<=1-t;i+=t){const s=this.getNextZoomAtPoint(e,i);if(this.isZoomValid(s))return s}}getNextZoomAtPoint(e,t){const{isScalingX:i,isScalingY:s}=this.getModuleProperties(),o=xs(this.zoomManager.getZoom()),n=e.x*as(o),r=e.y*wn(o),a=gt.max-gt.min,l=a/2;let c={x:{min:e.x-l,max:e.x+l},y:{min:e.y-l,max:e.y+l}};return c=PN(c,i?as(o)*t:a,s?wn(o)*t:a),c=ah(c,o.x.min-e.x+n,o.y.min-e.y+r),Dn(c)}},{BBoxValues:Aoe}=L,Ioe=class{constructor(e){this.axesHandlers=e,this.axes=[]}initAxis(e,t,i,s){const{X:o,Y:n}=L.ChartAxisDirection,r={[o]:"ew-resize",[n]:"ns-resize"}[s],l=e.proxyInteractionService.createProxyElement({type:"region",domManagerId:t,where:"afterend"});return l.setCursor(r),l.addListener("drag-start",c=>{c.device==="touch"&&c.sourceEvent.preventDefault(),i.onDragStart(t,s)}),l.addListener("drag-move",c=>i.onDrag(c)),l.addListener("drag-end",i.onDragEnd),l.addListener("dblclick",()=>i.onDoubleClick(t,s)),{axisId:t,div:l}}destroy(){this.axes.forEach(e=>e.div.destroy())}update(e,t){if(this.axes.forEach(a=>a.div.setHidden(!e)),!e)return;const{X:i,Y:s}=L.ChartAxisDirection,o=[...t.axisManager.getAxisContext(i),...t.axisManager.getAxisContext(s)],{removed:n,added:r}=this.diffAxisIds(o);n.length>0&&(this.axes=this.axes.filter(a=>n.includes(a.axisId)?(a.div.destroy(),!1):!0));for(const a of r){const{axisId:l,direction:c}=a;this.axes.push(this.initAxis(t,l,this.axesHandlers,c))}for(const a of this.axes){const c=o.filter(d=>d.axisId===a.axisId)[0].getCanvasBounds();a.div.setHidden(Aoe.isEmpty(c)),c!==void 0&&a.div.setBounds(c)}}diffAxisIds(e){const t=this.axes.map(n=>n.axisId),i=e.map(n=>n.axisId),s=t.filter(n=>!i.includes(n)),o=e.filter(n=>!t.includes(n.axisId));return{removed:s,added:o}}},NN=16,Roe={off:1,short:.01,long:.002},koe=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:e}=this;return Math.max(typeof e=="number"?e:Roe[e]??1,1e-4)}addListener(e,t){return this.onUpdate=t,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(e){this.updateCoords(e.currentX,e.currentY);const{x1:t=0,y1:i=0,x2:s=0,y2:o=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:t-s,deltaY:i-o})}start(){this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:e}=this;let t=0,i=0,s=0;if(e.length>0){const o=this.zoomCoordsHistoryIndex%NN;let n=o-1;n<0&&(n=e.length-1);let r=o;r>=e.length&&(r=0);const a=e[n],l=e[r];t=a.x-l.x,i=a.y-l.y,s=a.t-l.t}if(this.coords=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,s>0&&this.decelerationValue<1){const o=t/s,n=i/s,r=Math.hypot(o,n),a=Math.atan2(n,o),l=performance.now();this.inertiaHandle=L.getWindow().requestAnimationFrame(c=>{this.animateInertia(c,c,l,r,a)})}}recordCurrentZoomCoords(){const{coords:e,coordsHistory:t,zoomCoordsHistoryIndex:i}=this;if(!e)return;const{x2:s,y2:o}=e,n=Date.now();t[i%NN]={x:s,y:o,t:n},this.zoomCoordsHistoryIndex+=1}animateInertia(e,t,i,s,o){const n=1-this.decelerationValue,r=-s/Math.log(n),a=s*(n**(t-i)-1)/Math.log(n),l=s*(n**(e-i)-1)/Math.log(n);this.onUpdate?.({type:"update",deltaX:-Math.cos(o)*(l-a),deltaY:-Math.sin(o)*(l-a)}),!(l>=r-1)&&(this.inertiaHandle=requestAnimationFrame(c=>{this.animateInertia(c,e,i,s,o)}))}updateCoords(e,t){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:e,y2:t}:this.coords={x1:e,y1:t,x2:e,y2:t}}translateZooms(e,t,i,s){const o=ol(e,e.x+Math.abs(i),e.y+e.height-Math.abs(s)),n=Math.sign(i)*o.x,r=-Math.sign(s)*o.y,a={};for(const[l,{direction:c,zoom:d}]of Object.entries(t)){if(d&&d.min===gt.min&&d.max===gt.max)continue;let h=xs({[c]:d});h=Dn(ah(h,n*as(h),r*wn(h))),a[l]={direction:c,zoom:h[c]}}return a}},Toe=200,Loe=class{update(e,t,i,s){const o=e.deltaX*t*Toe;return this.translateZooms(i,s,o)}translateZooms(e,t,i){const s={},o=ol(e,e.x+Math.abs(i),0),n=i<0?-o.x:o.x;for(const[r,{direction:a,zoom:l}]of Object.entries(t)){if(a!==L.ChartAxisDirection.X)continue;let c=xs({x:l});c=Dn(ah(c,n*as(c),0)),s[r]={direction:a,zoom:c.x}}return s}},Eoe=class{updateAxes(e,t,i,s){const o=e.sourceEvent,n={},{anchorPointX:r,anchorPointY:a,isScalingX:l,isScalingY:c,scrollingStep:d}=t,h=ol(i,o.offsetX??o.clientX,o.offsetY??o.clientY);for(const[u,{direction:p,zoom:g}]of Object.entries(s)){if(g==null)continue;let f={...g};const y=d*e.deltaY*(g.max-g.min);if(p===L.ChartAxisDirection.X&&l)f.max+=y,f=Zn(f,g,r,h.x);else if(p===L.ChartAxisDirection.Y&&c)f.max+=y,f=Zn(f,g,a,h.y);else continue;n[u]={direction:p,zoom:rb(f)}}return n}update(e,t,i,s){const{anchorPointX:o,anchorPointY:n,isScalingX:r,isScalingY:a,scrollingStep:l}=t,c=e.offsetX+i.x,d=e.offsetY+i.y,h=ol(i,c,d),u=e.deltaY;let p=xs(s);return p.x.max+=r?l*u*as(s):0,p.y.max+=a?l*u*wn(s):0,r&&(p.x=Zn(p.x,s.x,o,h.x)),a&&(p.y=Zn(p.y,s.y,n,h.y)),p=Dn(p),p}updateDelta(e,t,i){const{anchorPointX:s,anchorPointY:o,isScalingX:n,isScalingY:r,scrollingStep:a}=t;let l=xs(i);return l.x.max+=n?a*-e*as(i):0,l.y.max+=r?a*-e*wn(i):0,n&&(l.x=Zn(l.x,i.x,s)),r&&(l.y=Zn(l.y,i.y,o)),l=Dn(l),l}},Poe=class{constructor(e,t,i){this.rect=e,this.getZoom=t,this.isZoomValid=i,this.rect.visible=!1}update(e,t,i){const s=e.currentX+(i?.x??0),o=e.currentY+(i?.y??0);this.rect.visible=!0,this.updateCoords(s,o,t,i),this.updateRect(i)}stop(e,t,i){let s=xs();if(!e||!t)return s;this.coords&&(s=this.createZoomFromCoords(t,i));const o=t.width/e.width,n=t.height/e.height;return s=Dn(Soe(s,o,n)),this.reset(),s}reset(){this.coords=void 0,this.rect.visible=!1}didUpdate(){return this.rect.visible&&this.rect.width>0&&this.rect.height>0}updateCoords(e,t,i,s){if(!this.coords){this.coords={x1:e,y1:t,x2:e,y2:t};return}const{coords:o}=this;if(o.x2=e,o.y2=t,!s)return;const{isScalingX:n,isScalingY:r,keepAspectRatio:a}=i,l=this.getNormalisedDimensions();if(a&&n&&r){const c=s.width/s.height;o.y2<o.y1?o.y2=Math.min(o.y1-l.width/c,o.y1):o.y2=Math.max(o.y1+l.width/c,o.y1)}n||(o.x1=s.x,o.x2=s.x+s.width),r||(o.y1=s.y,o.y2=s.y+s.height)}updateRect(e){if(!e)return;const{rect:t}=this,i=this.getNormalisedDimensions(),{width:s,height:o}=i;let{x:n,y:r}=i;n=Math.max(n,e.x),n-=Math.max(0,n+s-(e.x+e.width)),r=Math.max(r,e.y),r-=Math.max(0,r+o-(e.y+e.height)),t.x=n,t.y=r,t.width=s,t.height=o;const a=this.createZoomFromCoords(e,this.getZoom());this.isZoomValid(a)?t.updateValid():t.updateInvalid()}createZoomFromCoords(e,t){const i=xs(t),s=this.getNormalisedDimensions(),o=ol(e,s.x,s.y+s.height),n=s.width/e.width,r=s.height/e.height;let a=jH(i,n,r);const l=o.x*as(i),c=o.y*wn(i);return a=ah(a,l,c),a=Dn(a),a}getNormalisedDimensions(){const{x1:e=0,y1:t=0,x2:i=0,y2:s=0}=this.coords??{},o=e<=i?e:i,n=t<=s?t:s,r=e<=i?i-e:e-i,a=t<=s?s-t:t-s;return{x:o,y:n,width:r,height:a}}},{ARRAY:Noe,BOOLEAN:Ooe,STRING:Foe,UNION:UH,ActionOnSet:KH,BaseProperties:Boe,ChartAxisDirection:Goe,NativeWidget:_oe,PropertiesArray:zoe,Toolbar:Voe,ToolbarButtonProperties:Hoe,Validate:Eh,createElement:Woe}=L,Mk=class extends Hoe{};v([Eh(UH(["reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"]))],Mk.prototype,"value");v([Eh(Foe)],Mk.prototype,"section");var Xp=class extends Boe{constructor(e,t,i,s,o,n,r){super(),this.ctx=e,this.getModuleProperties=t,this.getResetZoom=i,this.updateZoom=s,this.updateAxisZoom=o,this.resetZoom=n,this.isZoomValid=r,this.enabled=!1,this.buttons=new zoe(Mk),this.visible="hover",this.verticalSpacing=10,this.detectionRange=38,this.destroyFns=[],this.container=new _oe(Woe("div")),this.container.addClass("ag-charts-zoom-buttons"),e.domManager.addChild("canvas-overlay","zoom-buttons",this.container.getElement()),this.toolbar=new Voe(e.localeManager),this.container.addChild(this.toolbar),this.toggleVisibility(this.visible==="always"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("button-focused",this.onButtonFocus.bind(this)),e.widgets.containerWidget.addListener("mousemove",this.onHover.bind(this)),e.widgets.containerWidget.addListener("mouseleave",this.onLeave.bind(this)),e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),this.teardown.bind(this))}destroy(){for(const e of this.destroyFns)e()}toggleVisibleZoomed(e){this.visible==="zoomed"&&this.toggleVisibility(!e)}teardown(){this.ctx.domManager.removeChild("canvas-overlay","zoom-buttons"),this.container.destroy()}onLayoutComplete(e){const{buttons:t,container:i}=this,{rect:s}=e.series;this.toolbar.updateButtons(t),this.toggleButtons();const o=i.getBounds().height;i.setBounds({y:s.y+s.height-o})}onHover(e){if(!this.enabled||this.visible!=="hover"||this.toolbar.isHidden())return;const{container:t,detectionRange:i,ctx:{scene:s}}=this,{currentY:o,sourceEvent:{target:n}}=e,r=t.getElement(),a=r.offsetTop-i,l=o>a&&o<s.canvas.element.offsetHeight||n===r;this.toggleVisibility(l)}onLeave(){this.visible==="hover"&&this.toggleVisibility(!1)}toggleVisibility(e,t=!1){const{container:i,toolbar:s,verticalSpacing:o}=this;s.toggleClass("ag-charts-zoom-buttons__toolbar--hidden",!e);const n=s.getElement();n.style.transitionDuration=t?"0s":"",n.style.transform=e?"translateY(0)":`translateY(${i.getBounds().height+o}px)`}toggleButtons(){const e=xs(this.ctx.zoomManager.getZoom());if(!(this.previousZoom&&df(this.previousZoom,e))){this.previousZoom=e;for(const[t,i]of this.buttons.entries()){let s=!0;switch(i?.value){case"pan-start":s=e.x.min>gt.min;break;case"pan-end":s=e.x.max<gt.max;break;case"pan-left":s=e.x.min>gt.min;break;case"pan-right":s=e.x.max<gt.max;break;case"zoom-out":s=!df(e,wk());break;case"zoom-in":s=this.isZoomValid(this.getNextZoomStateUnified("zoom-in",e,this.getModuleProperties()));break;case"reset":s=!df(e,this.getResetZoom());break}this.toolbar.toggleButtonEnabledByIndex(t,s)}}}onButtonPress({button:e}){if(!this.enabled||this.toolbar.isHidden())return;const t=this.getModuleProperties();if(t.independentAxes&&e.value!=="reset"){const i=this.ctx.zoomManager.getAxisZooms();for(const[s,{direction:o,zoom:n}]of Object.entries(i))n!=null&&this.onButtonPressAxis(e,t,s,o,n)}else this.onButtonPressUnified(e,t)}onButtonFocus(e){this.toggleVisibility(!0,!0)}onButtonPressAxis(e,t,i,s,o){const{isScalingX:n,isScalingY:r,scrollingStep:a}=t;let l={...o};const c=o.max-o.min;switch(e.value){case"pan-start":l.max=c,l.min=0;break;case"pan-end":l.min=l.max-c,l.max=gt.max;break;case"pan-left":l.min-=c*a,l.max-=c*a;break;case"pan-right":l.min+=c*a,l.max+=c*a;break;case"zoom-in":case"zoom-out":{const d=s===Goe.X,h=d&&n||!d&&r;let u=e.value==="zoom-in"?1-a:1+a;h||(u=1);const p=d?this.getAnchorPointX(t):this.getAnchorPointY(t);l.max=l.min+(l.max-l.min)*u,l=Zn(l,o,p);break}}this.updateAxisZoom(i,s,rb(l))}onButtonPressUnified(e,t){const{scrollingStep:i}=t,s=xs(this.ctx.zoomManager.getZoom());let o=xs(s);switch(e.value){case"reset":this.resetZoom();return;case"pan-start":o.x.max=as(o),o.x.min=0;break;case"pan-end":o.x.min=gt.max-as(o),o.x.max=gt.max;break;case"pan-left":o=ah(o,-as(o)*i,0);break;case"pan-right":o=ah(o,as(o)*i,0);break;case"zoom-in":case"zoom-out":{o=this.getNextZoomStateUnified(e.value,s,t);break}}this.updateZoom(Dn(o))}getNextZoomStateUnified(e,t,i){const{isScalingX:s,isScalingY:o,scrollingStep:n}=i,r=e==="zoom-in"?1-n:1+n,a=jH(t,s?r:1,o?r:1);return a.x=Zn(a.x,t.x,this.getAnchorPointX(i)),a.y=Zn(a.y,t.y,this.getAnchorPointY(i)),a}getAnchorPointX(e){const t=this.anchorPointX??e.anchorPointX;return t==="pointer"?HH:t}getAnchorPointY(e){const t=this.anchorPointY??e.anchorPointY;return t==="pointer"?WH:t}};v([Eh(Ooe),KH({changeValue(e){this.toolbar?.setHidden(!e)}})],Xp.prototype,"enabled");v([Eh(Noe)],Xp.prototype,"buttons");v([Eh(UH(["always","zoomed","hover"])),KH({changeValue(e,t){t!=null&&this.toggleVisibility(e==="always")}})],Xp.prototype,"visible");v([Eh(fx)],Xp.prototype,"anchorPointX");v([Eh(fx)],Xp.prototype,"anchorPointY");var Bd=1e6;function ab({min:e,max:t},i,s,o){return o===0?0:Bd*((i-s)/o*(t-e)+e)}function joe(e,t,i,s,o,n){[e,t]=[Math.min(e,t),Math.max(e,t)],[i,s]=[Math.min(i,s),Math.max(i,s)];const r=Bd*(i-o)/n,a=Bd*(s-o)/n,l=(i-o)/(s-o),c=(e-l*t)/(Bd-r+l*(a-Bd)),d=(t+(a-Bd)*c)/a;return{min:c,max:d}}function ON(e,t,i,s){t===0&&(t=30),s===0&&(s=30);const o=e-t,n=e+t,r=i-s,a=i+s;return!(n<r||a<o)}var Uoe=class{constructor(){this.touchStart={origins:[{identifier:0,normalX:NaN,normalY:NaN},{identifier:0,normalX:NaN,normalY:NaN}]},this.initialZoom={x:{min:0,max:1},y:{min:0,max:1}},this.previous={a1:NaN,a2:NaN,b1:NaN,b2:NaN}}start(e,t,i){if(e.sourceEvent.targetTouches.length!==2)return!1;e.sourceEvent.preventDefault();const s=Array.from(e.sourceEvent.targetTouches),{x:o,y:n,width:r,height:a}=t.getBoundingClientRect();this.initialZoom.x.min=i.x?.min??0,this.initialZoom.x.max=i.x?.max??1,this.initialZoom.y.min=i.y?.min??0,this.initialZoom.y.max=i.y?.max??1,this.touchStart.origins.forEach(g=>g.identifier=0),this.previous.a1=NaN,this.previous.a2=NaN,this.previous.b1=NaN,this.previous.b2=NaN;for(const g of[0,1]){const f=s[g].clientX,y=n+a-s[g].clientY;this.touchStart.origins[g].identifier=s[g].identifier,this.touchStart.origins[g].normalX=ab(this.initialZoom.x,f,o,r),this.touchStart.origins[g].normalY=ab(this.initialZoom.y,y,n,a)}const[l,c]=s,[d,h]=this.touchStart.origins,u=ON(l.clientX,l.radiusX,c.clientX,c.radiusX);return ON(l.clientY,l.radiusY,c.clientY,c.radiusY)&&(d.normalY=h.normalY=(d.normalY+h.normalY)/2),u&&(d.normalX=h.normalX=(d.normalX+h.normalX)/2),!0}update(e,t){e.sourceEvent.preventDefault();const i=Array.from(e.sourceEvent.targetTouches),{x:s,y:o,width:n,height:r}=t.getBoundingClientRect(),{origins:a}=this.touchStart,l=[0,1].map(m=>i.find(C=>C.identifier===a[m].identifier)),c=a[0].normalX,d=a[1].normalX,h=l[0].clientX,u=l[1].clientX,p=a[0].normalY,g=a[1].normalY,f=o+r-l[0].clientY,y=o+r-l[1].clientY;return this.twitchTolerantZoomPan4(c,d,h,u,p,g,f,y,s,o,n,r)}end(e){const t=Array.from(e.sourceEvent.targetTouches).map(i=>i.identifier);return!t.includes(this.touchStart.origins[0].identifier)||!t.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(e,t,i,s,o,n,r,a,l,c,d,h){const{initialZoom:u,previous:p}=this,g=FN(e,t,i,s,p,"a1","a2",l,d,u.x),f=FN(o,n,r,a,p,"b1","b2",c,h,u.y);return{x:g,y:f}}};function FN(e,t,i,s,o,n,r,a,l,c){if(e!=t){const d=o[n],h=o[r];return Math.abs(i-d)+Math.abs(s-h)<=1?(i=d,s=h):(o[n]=i,o[r]=s),joe(e,t,i,s,a,l)}else{const d=ab(c,i,a,l),h=ab(c,s,a,l),u=(d+h)/2,p=(e-u)/Bd;return{min:c.min+p,max:c.max+p}}}var{BOOLEAN:fa,NUMBER:$H,POSITIVE_NUMBER:Koe,RATIO:Dk,UNION:Ak,OBJECT:YH,OR:$oe,ActionOnSet:mx,ChartAxisDirection:Ig,ChartUpdateType:BN,Deprecated:XH,Validate:Jt,InteractionState:Sv,ProxyProperty:Yoe,round:Xoe}=L,xv=e=>Xoe(e,10),GN="zoom-cursor",hM="zoom-tooltip",Ik=class extends L.BaseProperties{constructor(e){super(),this.onChange=e,this.enabled=!1,this.padding=0}};v([Jt(fa),mx({changeValue(e){this.onChange({enabled:e,padding:this.padding})}})],Ik.prototype,"enabled");v([Jt(Dk),mx({changeValue(e){this.onChange({enabled:this.enabled,padding:e})}})],Ik.prototype,"padding");var gi=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.enableAxisDragging=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=(gt.max-gt.min)/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=HH,this.anchorPointY=WH,this.autoScaling=new Ik(i=>{this.ctx.zoomManager.setAutoScaleYAxis(i.enabled,i.padding)}),this.buttons=new Xp(this.ctx,this.getModuleProperties.bind(this),this.getResetZoom.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.axisDragger=new xoe,this.panner=new koe,this.scroller=new Eoe,this.scrollPanner=new Loe,this.twoFingers=new Uoe,this.deceleration="short",this.dragState=0,this.isState=i=>this.ctx.interactionManager.isState(i),this.destroyContextMenuActions=void 0,this.isFirstWheelEvent=!0,this.debouncedWheelReset=nQ(()=>{this.isFirstWheelEvent=!0},100);const t=new gx;this.selector=new Poe(t,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new Doe(e.contextMenuRegistry,e.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this)),this.domProxy=new Ioe({onDragStart:(i,s)=>this.onAxisDragStart(i,s),onDrag:i=>{this.onDragMove({...i,currentX:i.offsetX,currentY:i.offsetY})},onDragEnd:()=>this.onDragEnd(),onDoubleClick:(i,s)=>{this.hoveredAxis={id:i,direction:s},this.onDoubleClick(),this.hoveredAxis=void 0}}),this.destroyFns.push(e.scene.attachNode(t),e.chartEventManager.addListener("series-keynav-zoom",i=>this.onNavZoom(i)),e.widgets.seriesDragInterpreter.addListener("dblclick",i=>this.onDoubleClick(i)),e.widgets.seriesDragInterpreter.addListener("drag-move",i=>this.onDragMove(i)),e.widgets.seriesDragInterpreter.addListener("drag-start",i=>this.onDragStart(i)),e.widgets.seriesDragInterpreter.addListener("drag-end",()=>this.onDragEnd()),e.widgets.seriesWidget.addListener("wheel",i=>this.onWheel(i)),e.widgets.seriesWidget.addListener("touchstart",(i,s)=>this.onTouchStart(i,s)),e.widgets.seriesWidget.addListener("touchmove",(i,s)=>this.onTouchMove(i,s)),e.widgets.seriesWidget.addListener("touchend",i=>this.onTouchEnd(i)),e.widgets.seriesWidget.addListener("touchcancel",i=>this.onTouchEnd(i)),e.updateService.addListener("process-data",i=>this.onProcessData(i)),e.layoutManager.addListener("layout:complete",i=>this.onLayoutComplete(i)),e.zoomManager.addListener("zoom-change",i=>this.onZoomChange(i)),e.zoomManager.addListener("zoom-pan-start",i=>this.onZoomPanStart(i)),this.panner.addListener("update",i=>this.onPanUpdate(i)),()=>this.teardown())}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.()}onEnabledChange(e){this.ctx.zoomManager.setZoomModuleEnabled(e),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(e))}isIgnoredTouch(e){if(this.ctx.chartService.touch.dragAction!=="drag")return!0;if(e?.device!=="touch"||this.enableSelecting)return!1;if(!this.enablePanning)return!0;const{x:t,y:i}=this.getZoom();return t.min===0&&t.max===1&&i.min===0&&i.max===1}onDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i,hoveredAxis:s,ctx:{zoomManager:o}}=this;!t||!i||!this.isState(Sv.ZoomClickable)||(s?o.resetAxisZoom("zoom",s.id):e?.preventZoomDblClick||this.resetZoom())}onDragStart(e){const{enabled:t,enableAxisDragging:i,enablePanning:s,enableSelecting:o,hoveredAxis:n,ctx:{domManager:r,zoomManager:a}}=this;if(!t||!this.hoveredAxis&&(!this.isState(Sv.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(e)))return;this.panner.stopInteractions();let l=0;if(i&&n)l=1;else if(e!=null){const c=this.isPanningKeyPressed(e.sourceEvent);s&&(!o||c)?(r.updateCursor(GN,"grabbing"),l=2,this.panner.start()):o&&!c&&(l=3)}(this.dragState=l)!==0&&a.fireZoomPanStartEvent("zoom")}onDragMove(e){const{anchorPointX:t,anchorPointY:i,axisDragger:s,dragState:o,enabled:n,paddedRect:r,panner:a,selector:l,seriesRect:c,shouldFlipXY:d,hoveredAxis:h,ctx:{interactionManager:u,tooltipManager:p,updateService:g,zoomManager:f}}=this;if(!n||!r||!c||!h&&(!this.isState(Sv.ZoomDraggable)||this.isIgnoredTouch(e)))return;u.pushState(L.InteractionState.ZoomDrag),e.device==="touch"&&e.sourceEvent.preventDefault();const y=this.getZoom();switch(o){case 1:{if(!h)break;const{id:m,direction:C}=h;let b=C===Ig.X?t:i;d&&(b=C===Ig.X?i:t);const S=f.getAxisZoom(m),A=s.update(e,C,b,c,y,S);f.setAxisManuallyAdjusted("zoom",m),this.updateAxisZoom(m,C,A);break}case 2:a.update(e);break;case 3:l.update(e,this.getModuleProperties(),r);break;case 0:return}p.updateTooltip(hM),g.update(BN.PERFORM_LAYOUT,{skipAnimations:!0})}onDragEnd(){const{axisDragger:e,dragState:t,enabled:i,panner:s,selector:o,ctx:{domManager:n,interactionManager:r,tooltipManager:a}}=this;if(r.popState(L.InteractionState.ZoomDrag),!(!i||t===0)){switch(t){case 1:this.hoveredAxis=void 0,e.stop();break;case 2:s.stop();break;case 3:{if(!o.didUpdate())break;const l=this.getZoom(),c=o.stop(this.seriesRect,this.paddedRect,l);this.updateZoom(c);break}}this.dragState=0,n.updateCursor(GN),a.removeTooltip(hM)}}onNavZoom(e){const{enabled:t,enableScrolling:i,scroller:s}=this;!this.ctx.interactionManager.isState(L.InteractionState.Default)||!t||!i||(e.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(s.updateDelta(e.delta,this.getModuleProperties(),this.getZoom())))}onWheel(e){const{enabled:t,enablePanning:i,enableScrolling:s,paddedRect:o}=this;if(!t||!s||!o||!this.isState(Sv.ZoomWheelable))return;const{deltaX:n,deltaY:r}=e.sourceEvent,a=n!=null&&r!=null&&Math.abs(n)>Math.abs(r);i&&a?this.onWheelPanning(e):this.onWheelScrolling(e)}onWheelPanning(e){const{scrollingStep:t,scrollPanner:i,seriesRect:s,ctx:{zoomManager:o}}=this;if(!s)return;e.sourceEvent.preventDefault();const n=i.update(e,t,s,o.getAxisZooms());for(const[r,{direction:a,zoom:l}]of Object.entries(n))this.updateAxisZoom(r,a,l)}onWheelScrolling(e){const{enableAxisDragging:t,enableIndependentAxes:i,hoveredAxis:s,scroller:o,seriesRect:n,ctx:{zoomManager:r}}=this;if(!n)return;const a=this.getZoom();let l=e.deltaY>0&&this.isMaxZoom(a);const c=t&&s!=null;let d=this.isScalingX(),h=this.isScalingY();c&&(d=s.direction===L.ChartAxisDirection.X,h=!d);const u=this.getModuleProperties({isScalingX:d,isScalingY:h});let p=!0;if(i===!0){const g=o.updateAxes(e,u,n,r.getAxisZooms());for(const[f,{direction:y,zoom:m}]of Object.entries(g))c&&s.id!==f||p&&(p=this.updateAxisZoom(f,y,m))}else{const g=o.update(e,u,n,this.getZoom());p=this.updateUnifiedZoom(g)}l||(l=e.deltaY<0&&!p),(!this.isFirstWheelEvent||!l)&&e.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}onAxisDragStart(e,t){this.hoveredAxis={id:e,direction:t},this.onDragStart(void 0)}onTouchStart(e,t){!this.enableTwoFingerZoom||this.dragState!==0||this.twoFingers.start(e,t,this.getZoom())&&(this.dragState=4)}onTouchMove(e,t){if(!this.enableTwoFingerZoom||this.dragState!==4)return;const i=this.twoFingers.update(e,t);this.updateZoom(Dn(i))}onTouchEnd(e){!this.enableTwoFingerZoom||this.dragState!==4||(e.sourceEvent.preventDefault(),this.twoFingers.end(e)&&(this.dragState=0))}onProcessData(e){this.shouldFlipXY=e.series.shouldFlipXY}onLayoutComplete(e){this.domProxy.update(this.enableAxisDragging,this.ctx);const{enabled:t}=this;if(!t)return;const{series:{rect:i,paddedRect:s}}=e;this.seriesRect=i,this.paddedRect=s}onZoomChange(e){e.callerId!=="zoom"&&this.panner.stopInteractions();const t=this.getZoom();this.buttons.toggleVisibleZoomed(this.isMaxZoom(t))}onZoomPanStart(e){e.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(e){const{panner:t,seriesRect:i,ctx:{tooltipManager:s,zoomManager:o}}=this;if(!i)return;const n=t.translateZooms(i,o.getAxisZooms(),e.deltaX,e.deltaY);for(const[r,{direction:a,zoom:l}]of Object.entries(n))this.updateAxisZoom(r,a,l);s.updateTooltip(hM)}isPanningKeyPressed(e){switch(this.panKey){case"alt":return e.altKey;case"ctrl":return e.ctrlKey;case"shift":return e.shiftKey;case"meta":return e.metaKey}}isScalingX(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="y":this.axes==="x"}isScalingY(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="x":this.axes==="y"}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}isMaxZoom(e){return df(e,wk())}isZoomValid(e){const{minVisibleItems:t,minVisibleItemsX:i,minVisibleItemsY:s,ctx:{zoomManager:o}}=this;if(t===0)return!0;const n=this.getZoom(),r=xv(as(e))<xv(as(n)),a=xv(wn(e))<xv(wn(n));return!r&&!a?!0:i!=null&&r?o.isVisibleItemsCountAtLeast(e,i):s!=null&&a?o.isVisibleItemsCountAtLeast(e,s):o.isVisibleItemsCountAtLeast(e,t)}isAxisZoomValid(e,t){const{minVisibleItems:i,minVisibleItemsX:s,minVisibleItemsY:o,ctx:{zoomManager:n}}=this,r=this.getZoom(),a=t.max-t.min,l=r[e].max-r[e].min,c={...r,[e]:t},d=e===Ig.X?s:o;return a>=l||n.isVisibleItemsCountAtLeast(c,d??i)}resetZoom(){this.ctx.zoomManager.resetZoom("zoom")}updateZoom(e){this.enableIndependentAxes?this.updatePrimaryAxisZooms(e):this.updateUnifiedZoom(e)}updateUnifiedZoom(e){return this.isZoomValid(e)?(this.ctx.zoomManager.updateZoom("zoom",e),!0):(this.ctx.updateService.update(BN.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(e){this.updatePrimaryAxisZoom(e,Ig.X),this.updatePrimaryAxisZoom(e,Ig.Y)}updatePrimaryAxisZoom(e,t){const i=this.ctx.zoomManager.getPrimaryAxisId(t);i!=null&&this.updateAxisZoom(i,t,e[t])}updateAxisZoom(e,t,i){const{enableIndependentAxes:s,ctx:{zoomManager:o}}=this;if(!i)return!1;const n=this.getZoom();return s!==!0?(n[t]=i,this.updateUnifiedZoom(n)):this.isAxisZoomValid(t,i)?(o.updateAxisZoom("zoom",e,i),!0):!1}getZoom(){return xs(this.ctx.zoomManager.getZoom())}getResetZoom(){return xs(this.ctx.zoomManager.getRestoredZoom())}getModuleProperties(e){return{anchorPointX:e?.anchorPointX??this.getAnchorPointX(),anchorPointY:e?.anchorPointY??this.getAnchorPointY(),enabled:e?.enabled??this.enabled,independentAxes:e?.independentAxes??this.enableIndependentAxes===!0,isScalingX:e?.isScalingX??this.isScalingX(),isScalingY:e?.isScalingY??this.isScalingY(),keepAspectRatio:e?.keepAspectRatio??this.keepAspectRatio,scrollingStep:e?.scrollingStep??this.scrollingStep}}};v([mx({newValue(e){this.onEnabledChange(e)}}),Jt(fa)],gi.prototype,"enabled");v([Jt(fa)],gi.prototype,"enableAxisDragging");v([Jt(fa)],gi.prototype,"enableDoubleClickToReset");v([mx({changeValue(e){this.ctx.zoomManager.setIndependentAxes(!!e)}}),Jt(fa,{optional:!0})],gi.prototype,"enableIndependentAxes");v([Jt(fa)],gi.prototype,"enablePanning");v([Jt(fa)],gi.prototype,"enableScrolling");v([Jt(fa)],gi.prototype,"enableSelecting");v([Jt(fa)],gi.prototype,"enableTwoFingerZoom");v([Jt(Ak(["alt","ctrl","meta","shift"],"a pan key"))],gi.prototype,"panKey");v([Jt(Ak(["x","y","xy"],"an axis"))],gi.prototype,"axes");v([Jt(Dk)],gi.prototype,"scrollingStep");v([Jt(fa)],gi.prototype,"keepAspectRatio");v([Jt(Koe)],gi.prototype,"minVisibleItems");v([XH("Use [minVisibleItems] instead."),Jt($H.restrict({min:1}))],gi.prototype,"minVisibleItemsX");v([XH("Use [minVisibleItems] instead."),Jt($H.restrict({min:1}))],gi.prototype,"minVisibleItemsY");v([Jt(fx)],gi.prototype,"anchorPointX");v([Jt(fx)],gi.prototype,"anchorPointY");v([Jt(YH)],gi.prototype,"autoScaling");v([Jt(YH)],gi.prototype,"buttons");v([Yoe("panner.deceleration"),Jt($oe(Dk,Ak(["off","short","long"],"a deceleration")))],gi.prototype,"deceleration");var Zoe={enabled:!0,visible:"hover",buttons:[{icon:"zoom-out",tooltip:"toolbarZoomZoomOut",value:"zoom-out",section:"scale"},{icon:"zoom-in",tooltip:"toolbarZoomZoomIn",value:"zoom-in",section:"scale"},{icon:"pan-left",tooltip:"toolbarZoomPanLeft",value:"pan-left",section:"pan"},{icon:"pan-right",tooltip:"toolbarZoomPanRight",value:"pan-right",section:"pan"},{icon:"reset",tooltip:"toolbarZoomReset",value:"reset",section:"reset"}]},qoe={type:"root",optionsKey:"zoom",packageType:"enterprise",chartTypes:["cartesian","topology"],moduleFactory:e=>new gi(e),themeTemplate:{zoom:{anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:Zoe,enabled:!1,enableAxisDragging:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:!1,padding:.05}}}},{BOOLEAN:ZH,OBJECT:Qoe,POSITION:Joe,POSITIVE_NUMBER:Rk,BaseProperties:ene,AxisTicks:tne,ZIndexMap:ine,ProxyProperty:kk,Validate:Ph,LayoutElement:sne,createId:one,Group:nne,Rect:rne,Marker:ane,TranslatableGroup:lne,LinearGradient:cne}=L,Tk=class extends ene{constructor(){super(...arguments),this.thickness=16,this.preferredLength=100}};v([Ph(Rk)],Tk.prototype,"thickness");v([Ph(Rk)],Tk.prototype,"preferredLength");var yx=class{constructor(e){this.axisTicks=e}};v([kk("axisTicks.label")],yx.prototype,"label");v([kk("axisTicks.interval")],yx.prototype,"interval");v([kk("axisTicks.padding")],yx.prototype,"padding");var Nh=class{constructor(e){this.ctx=e,this.id=one(this),this.legendGroup=new lne({name:"legend",zIndex:ine.LEGEND}),this.gradientRect=new rne,this.arrow=new ane({shape:"triangle"}),this.ticksGroup=new nne({name:"legend-axis-group"}),this.destroyFns=[],this.enabled=!1,this.position="bottom",this.reverseOrder=!1,this.gradient=new Tk,this.spacing=20,this.data=[],this.highlightManager=e.highlightManager,this.axisTicks=new tne,this.axisTicks.attachAxis(this.ticksGroup),this.scale=new yx(this.axisTicks),this.legendGroup.append([this.gradientRect,this.arrow,this.ticksGroup]),this.destroyFns.push(e.highlightManager.addListener("highlight-change",()=>this.onChartHoverChange()),e.layoutManager.registerElement(sne.Legend,t=>this.onStartLayout(t)),()=>this.legendGroup.remove())}isVertical(){return this.position==="right"||this.position==="left"}destroy(){this.destroyFns.forEach(e=>e())}attachLegend(e){e.appendChild(this.legendGroup)}onStartLayout(e){const[t]=this.data;if(!this.enabled||!t?.enabled){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(t);this.updateGradientRect(e.layoutBox,i);const s=this.updateAxis(t),{left:o,top:n}=this.getMeasurements(e.layoutBox,s);this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=o,this.legendGroup.translationY=n}normalizeColorArrays(e){let t=e.colorDomain.slice();const i=e.colorRange.slice();if(t.length===i.length)return{colorDomain:t,colorRange:i};t.length>i.length&&i.splice(t.length);const[s,o]=t,n=i.length;return t=i.map((r,a)=>a===0?s:a===n-1?o:s+(o-s)*a/(n-1)),{colorDomain:t,colorRange:i}}updateGradientRect(e,t){const{gradientRect:i}=this,{preferredLength:s,thickness:o}=this.gradient;let n;this.isVertical()?(n=0,i.width=o,i.height=Math.min(e.height,s)):(n=90,i.width=Math.min(e.width,s),i.height=o),i.fill=new cne("oklch",t.map((r,a)=>({offset:a/(t.length-1),color:r})),n)}updateAxis(e){const{axisTicks:t}=this,i=this.isVertical(),s=this.reverseOrder!==i;return t.position=this.position,t.translationX=i?this.gradient.thickness:0,t.translationY=i?0:this.gradient.thickness,t.scale.domain=s?e.colorDomain.slice().reverse():e.colorDomain,t.scale.range=i?[0,this.gradientRect.height]:[0,this.gradientRect.width],t.calculateLayout()}updateArrow(){const e=this.highlightManager.getActiveHighlight(),{arrow:t}=this;if(e?.colorValue==null){t.visible=!1;return}const{scale:i,label:s}=this.axisTicks,o=s.fontSize??0,n=i.convert(e.colorValue);let{x:r,y:a}=this.gradientRect,l=Math.PI;this.isVertical()?(r-=o/2,a+=n,l/=2):(r+=n,a-=o/2),t.visible=!0,t.fill=s.color,t.rotation=l,t.size=o,t.translationX=r,t.translationY=a}getMeasurements(e,t){let{x:i,y:s}=e,{width:o,height:n}=this.gradientRect;switch(this.isVertical()?o+=t.width+5:n+=t.height+5,this.position){case"left":s+=e.height/2-n/2,e.shrink(o+this.spacing,"left");break;case"right":i+=e.width-o,s+=e.height/2-n/2,e.shrink(o+this.spacing,"right");break;case"top":i+=e.width/2-o/2,e.shrink(n+this.spacing,"top");break;case"bottom":i+=e.width/2-o/2,s+=e.height-n,e.shrink(n+this.spacing,"bottom")}return{top:s,left:i}}onChartHoverChange(){this.enabled&&this.updateArrow()}};Nh.className="GradientLegend";v([Ph(ZH)],Nh.prototype,"enabled");v([Ph(Joe)],Nh.prototype,"position");v([Ph(ZH)],Nh.prototype,"reverseOrder");v([Ph(Qoe)],Nh.prototype,"gradient");v([Ph(Rk)],Nh.prototype,"spacing");var dne={type:"legend",optionsKey:"gradientLegend",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient",moduleFactory:e=>new Nh(e),themeTemplate:{enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1},removable:"standalone-only"};function hne(e,t){const i=e.addChild("canvas-overlay","watermark"),s=L.createElement("span");s.innerText=t,i.addEventListener("animationend",()=>{e.removeChild("canvas-overlay","watermark"),e.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(s)}var{findMinMax:une}=L,ns=0,Ys=1,go=2,fo=3,_o=4;function ny(e,t=1){let i=Math.ceil(Math.log2(e.length/t))-1;return i=Math.min(Math.max(i,0),16),2**i|0}function ry(e){return une(e.map(t=>Number(t)))}function vx(e,t,i){return(e.valueOf()-t)/(i-t)}function Cx(e,t){return Math.min(Math.floor(e*t),t-1)*_o|0}function ay(e,t,i,s,o,n){const r=new Int32Array(n*_o).fill(-1),a=new Float64Array(n*_o).fill(NaN);for(let l=0;l<e.length;l+=1){const c=e[l],d=t[l],h=i[l];if(c==null||d==null||h==null)continue;const u=vx(c,s,o),p=d.valueOf(),g=h.valueOf(),f=Cx(u,n),y=r[f+ns]===-1;(y||u<a[f+ns])&&(r[f+ns]=l,a[f+ns]=u),(y||u>a[f+Ys])&&(r[f+Ys]=l,a[f+Ys]=u),(y||g<a[f+go])&&(r[f+go]=l,a[f+go]=g),(y||p>a[f+fo])&&(r[f+fo]=l,a[f+fo]=p)}return{indexData:r,valueData:a}}function ly(e,t,i,{inPlace:s=!1}={}){const o=i/2|0,n=s?e:new Int32Array(o*_o),r=s?t:new Float64Array(o*_o);for(let a=0;a<o;a+=1){const l=a*_o|0,c=l*2|0,d=c+_o|0,h=e[d+ns]===-1,u=h||t[c+ns]<t[d+ns]?c:d;n[l+ns]=e[u+ns],r[l+ns]=t[u+ns];const p=h||t[c+Ys]>t[d+Ys]?c:d;n[l+Ys]=e[p+Ys],r[l+Ys]=t[p+Ys];const g=h||t[c+go]<t[d+go]?c:d;n[l+go]=e[g+go],r[l+go]=t[g+go];const f=h||t[c+fo]>t[d+fo]?c:d;n[l+fo]=e[f+fo],r[l+fo]=t[f+fo]}return{maxRange:o,indexData:n,valueData:r}}var _N={xMin:ns,xMax:Ys,yMin:go,yMax:fo,span:_o},pne=1e3,gne=5;function zN(e,t){return Array.from({length:e},(i,s)=>{const o=s*_o,n=t[o+ns],r=t[o+Ys];return(n+r)/2|0})}function fne(e,t,i){if(e.length<pne)return;const[s,o]=ry(i);let n=ny(e,gne),{indexData:r,valueData:a}=ay(e,t,t,s,o,n),l=zN(n,r);const c=[{maxRange:n,indexData:r,indices:l,indexes:_N}];for(;n>64;)({indexData:r,valueData:a,maxRange:n}=ly(r,a,n)),l=zN(n,r),c.push({maxRange:n,indexData:r,indices:l,indexes:_N});return c.reverse(),c}var{ChartAxisDirection:mne,ContinuousScale:yne,OrdinalTimeScale:vne}=L,Cne=class extends L.BarSeries{aggregateData(e,t){if(t?.type!=="ungrouped")return;const i=this.axes[mne.X];if(i==null||!(yne.is(i.scale)||vne.is(i.scale)))return;const s=e.resolveKeysById(this,"xValue",t),o=e.resolveColumnById(this,"yValue-raw",t),{index:n}=e.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[n];return fne(s,o,r)}},{BarSeriesModule:bne}=L,Sne={...bne,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"bar",moduleFactory:e=>new Cne(e)};function xne(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function wne(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}var{ScalableGroup:Mne,Rect:ru,Line:Rg,BBox:Dne,Selection:VN}=L,Ane=class extends Mne{constructor(){super(),this.append([new ru({tag:0}),new ru({tag:0}),new ru({tag:2}),new ru({tag:1}),new Rg({tag:3}),new Rg({tag:3}),new Rg({tag:4}),new Rg({tag:4})])}updateDatumStyles(e,t,i,s){const{bandwidth:o,scaledValues:{xValue:n,medianValue:r}}=e;let{minValue:a,q1Value:l,q3Value:c,maxValue:d}=e.scaledValues;(i&&!s||!i&&s)&&([d,c,l,a]=[a,l,c,d]);const h=(V,O,H,B)=>i?{y:V,x:O,width:B,height:H}:{x:V,y:O,width:H,height:B},u=(V,O,H)=>i?{y1:V,y2:O,x:H}:{x1:V,x2:O,y:H},p=(V,O,H)=>i?{x1:O,x2:H,y:V}:{x:V,y1:O,y2:H},g=(V,O,H,B)=>({x:V,y:O,width:H,height:B}=h(V,O,H,B),new Dne(V,O,H,B)),{fill:f,fillOpacity:y,stroke:m,strokeWidth:C,strokeOpacity:b,lineDash:S,lineDashOffset:A,cornerRadius:R,cap:I,whisker:w}=t,M=VN.select(this,ru),T=M.selectByTag(0),[E]=M.selectByTag(2),[P]=M.selectByTag(1),N=M.selectByTag(3),F=M.selectByTag(4);w.strokeWidth>o&&(w.strokeWidth=o);const _=h(l,n,c-l,o);E.setProperties(_),T[0].setProperties(_),T[0].setProperties({cornerRadius:R,clipBBox:g(l,n,Math.round(r-l+C/2),o)}),T[1].setProperties(_),T[1].setProperties({cornerRadius:R,clipBBox:g(Math.round(r-C/2),n,Math.floor(c-r+C/2),o)});const W=Math.max(Math.round(r-C/2),l+C),z=Math.min(Math.round(r+C/2),c-C);P.setProperties(_),P.setProperties({visible:W<z,cornerRadius:R,clipBBox:g(W,n+C,z-W,Math.max(0,o-C*2))});const U=Math.floor(n+o*(1-I.lengthRatio)/2),G=Math.ceil(n+o*(1+I.lengthRatio)/2);F[0].setProperties(p(a,U,G)),F[1].setProperties(p(d,U,G)),N[0].setProperties(u(Math.round(a+w.strokeWidth/2),l,Math.floor(n+o/2))),N[1].setProperties(u(c,Math.round(d-w.strokeWidth/2),Math.floor(n+o/2)));for(const V of T)V.setProperties({fill:f,fillOpacity:y,strokeWidth:C*2,strokeOpacity:0});P.setProperties({fill:m,fillOpacity:b,strokeWidth:0});for(const V of[...N,...F])V.setProperties(w);E.setProperties({stroke:m,strokeWidth:C,strokeOpacity:b,lineDash:S,lineDashOffset:A,cornerRadius:R,fillOpacity:0})}distanceSquared(e,t){const i=VN.selectByClass(this,ru,Rg);return L.nearestSquared(e,t,i).distanceSquared}get midPoint(){const e=this.datum;return e.midPoint===void 0?(et.error("BoxPlotGroup.datum.midPoint is undefined"),{x:NaN,y:NaN}):e.midPoint}},{BaseProperties:qH,AbstractBarSeriesProperties:Ine,SeriesTooltip:Rne,Validate:at,COLOR_STRING:bx,FUNCTION:kne,LINE_DASH:QH,OBJECT:Lk,POSITIVE_NUMBER:cy,RATIO:Sx,STRING:Xo,mergeDefaults:Tne}=L,JH=class extends qH{constructor(){super(...arguments),this.lengthRatio=.5}};v([at(Sx)],JH.prototype,"lengthRatio");var Zp=class extends qH{};v([at(bx,{optional:!0})],Zp.prototype,"stroke");v([at(cy)],Zp.prototype,"strokeWidth");v([at(Sx)],Zp.prototype,"strokeOpacity");v([at(QH,{optional:!0})],Zp.prototype,"lineDash");v([at(cy)],Zp.prototype,"lineDashOffset");var Dt=class extends Ine{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new JH,this.whisker=new Zp,this.tooltip=new Rne,this.backgroundFill="white"}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:o}=this,n=super.toJson();return n.whisker=Tne(n.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:o}),n}};v([at(Xo)],Dt.prototype,"xKey");v([at(Xo)],Dt.prototype,"minKey");v([at(Xo)],Dt.prototype,"q1Key");v([at(Xo)],Dt.prototype,"medianKey");v([at(Xo)],Dt.prototype,"q3Key");v([at(Xo)],Dt.prototype,"maxKey");v([at(Xo,{optional:!0})],Dt.prototype,"xName");v([at(Xo,{optional:!0})],Dt.prototype,"yName");v([at(Xo,{optional:!0})],Dt.prototype,"minName");v([at(Xo,{optional:!0})],Dt.prototype,"q1Name");v([at(Xo,{optional:!0})],Dt.prototype,"medianName");v([at(Xo,{optional:!0})],Dt.prototype,"q3Name");v([at(Xo,{optional:!0})],Dt.prototype,"maxName");v([at(bx,{optional:!0})],Dt.prototype,"fill");v([at(Sx)],Dt.prototype,"fillOpacity");v([at(bx)],Dt.prototype,"stroke");v([at(cy)],Dt.prototype,"strokeWidth");v([at(Sx)],Dt.prototype,"strokeOpacity");v([at(QH)],Dt.prototype,"lineDash");v([at(cy)],Dt.prototype,"lineDashOffset");v([at(cy)],Dt.prototype,"cornerRadius");v([at(kne,{optional:!0})],Dt.prototype,"itemStyler");v([at(Lk)],Dt.prototype,"cap");v([at(Lk)],Dt.prototype,"whisker");v([at(Lk)],Dt.prototype,"tooltip");v([at(bx)],Dt.prototype,"backgroundFill");var{extractDecoratedProperties:HN,fixNumericExtent:Lne,keyProperty:Ene,mergeDefaults:uM,SeriesNodePickMode:WN,SMALLEST_KEY_INTERVAL:Pne,valueProperty:kg,diff:Nne,animationValidation:One,computeBarFocusBounds:Fne,createDatumId:jN,Color:xNe,ContinuousScale:Bne,ChartAxisDirection:UN,motion:KN}=L,Gne=class extends L.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.minKey=s.properties.minKey,this.q1Key=s.properties.q1Key,this.medianKey=s.properties.medianKey,this.q3Key=s.properties.q3Key,this.maxKey=s.properties.maxKey}},Ek=class extends L.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[WN.NEAREST_NODE,WN.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},directionNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},pathsPerSeries:[],hasHighlightedLabels:!0}),this.properties=new Dt,this.NodeEvent=Gne}async processData(e){if(!this.properties.isValid()||!this.visible)return;const{xKey:t,minKey:i,q1Key:s,medianKey:o,q3Key:n,maxKey:r}=this.properties,a=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:d,xScaleType:h,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),p=[];a&&this.processedData&&p.push(Nne(this.id,this.processedData)),a&&p.push(One());const{processedData:g}=await this.requestDataModel(e,this.data,{props:[Ene(t,h,{id:"xValue"}),kg(i,u,{id:"minValue"}),kg(s,u,{id:"q1Value"}),kg(o,u,{id:"medianValue"}),kg(n,u,{id:"q3Value"}),kg(r,u,{id:"maxValue"}),...d?[Pne]:[],...p]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];if(e!==this.getBarDirection()){const{index:o,def:n}=i.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[o];return n.type==="key"&&n.valueType==="category"?r:this.padBandExtent(r)}const s=this.domainForClippedRange(UN.Y,["minValue","maxValue"],"xValue",!0);return Lne(s)}getSeriesRange(e,t){return this.domainForVisibleRange(UN.Y,["maxValue","minValue"],"xValue",t,!0)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),o=this.getValueAxis();if(!(t&&i&&s&&o))return;const{xKey:n,fill:r,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:d,lineDash:h,lineDashOffset:u,cap:p,whisker:g}=this.properties,f=[],y=t.resolveKeysById(this,"xValue",i),m=t.resolveColumnById(this,"minValue",i),C=t.resolveColumnById(this,"q1Value",i),b=t.resolveColumnById(this,"medianValue",i),S=t.resolveColumnById(this,"q3Value",i),A=t.resolveColumnById(this,"maxValue",i),{barWidth:R,groupIndex:I}=this.updateGroupScale(s),w=Bne.is(s.scale)?R*-.5:0,{groupScale:M}=this,T=this.isVertical(),E={itemId:n,nodeData:f,labelData:[],scales:this.calculateScaling(),visible:this.visible};return e&&(i.dataSources.get(this.id)??[]).forEach((N,F)=>{const _=y[F];if(_==null)return;const W=m[F],z=C[F],U=b[F],G=S[F],V=A[F];if([W,z,U,G,V].some(se=>typeof se!="number")||W>z||z>U||U>G||G>V)return;const O={xValue:Math.round(s.scale.convert(_)),minValue:Math.round(o.scale.convert(W)),q1Value:Math.round(o.scale.convert(z)),medianValue:Math.round(o.scale.convert(U)),q3Value:Math.round(o.scale.convert(G)),maxValue:Math.round(o.scale.convert(V))};O.xValue+=Math.round(M.convert(String(I)))+w;const H=Math.round(R),B=Math.abs(O.q3Value-O.q1Value),Y=O.xValue+H/2,q=Math.min(O.q3Value,O.q1Value)+B/2,Z={x:T?Y:q,y:T?q:Y};let ee;T?ee={x:Z.x-H/2,y:O.minValue,width:H,height:O.maxValue-O.minValue}:ee={x:O.minValue,y:Z.y-H/2,width:O.maxValue-O.minValue,height:H},f.push({series:this,itemId:_,datum:N,datumIndex:F,xKey:n,bandwidth:H,scaledValues:O,cap:p,whisker:g,fill:r,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:d,lineDash:h,lineDashOffset:u,midPoint:Z,focusRect:ee})}),E}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:n,lineDashOffset:r}=this.properties;return{marker:{fill:e,fillOpacity:t,stroke:i,strokeOpacity:o,strokeWidth:s,lineDash:n,lineDashOffset:r}}}getLegendData(e){const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:o,yName:n,showInLegend:r,legendItemName:a}=this.properties;return!o||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:t}),label:{text:a??n??t},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!r}]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:n,xName:r,yName:a,medianKey:l,medianName:c,q1Key:d,q1Name:h,q3Key:u,q3Name:p,minKey:g,minName:f,maxKey:y,maxName:m,legendItemName:C,tooltip:b}=o,S=this.getCategoryAxis(),A=this.getValueAxis();if(!i||!s||!S||!A)return;const{datumIndex:R}=e,I=s.dataSources.get(this.id)?.[R],w=i.resolveKeysById(this,"xValue",s)[R],M=i.resolveColumnById(this,"minValue",s)[R],T=i.resolveColumnById(this,"q1Value",s)[R],E=i.resolveColumnById(this,"medianValue",s)[R],P=i.resolveColumnById(this,"q3Value",s)[R],N=i.resolveColumnById(this,"maxValue",s)[R];if(w==null)return;const F=this.getItemBaseStyle(!1);return Object.assign(F,this.getItemStyleOverrides(String(R),I,F,!1)),b.formatTooltip({heading:S.formatDatum(w),title:C??a,symbol:this.legendItemSymbol(),data:[{label:f,fallbackLabel:g,value:A.formatDatum(M)},{label:h,fallbackLabel:d,value:A.formatDatum(T)},{label:c,fallbackLabel:l,value:A.formatDatum(E)},{label:p,fallbackLabel:u,value:A.formatDatum(P)},{label:m,fallbackLabel:y,value:A.formatDatum(N)}]},{seriesId:t,datum:I,title:a,xKey:n,xName:r,yName:a,medianKey:l,medianName:c,q1Key:d,q1Name:h,q3Key:u,q3Name:p,minKey:g,minName:f,maxKey:y,maxName:m,...F})}animateEmptyUpdateReady({datumSelection:e}){const t=this.isVertical(),{from:i,to:s}=xne(t);KN.resetMotion([e],wne(t)),KN.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[e],i,s,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}getItemBaseStyle(e){const{properties:t}=this,{cornerRadius:i,cap:s,whisker:o}=t,n=e?t.highlightStyle.item:void 0,r=this.getStrokeWidth(t.strokeWidth);return{fill:n?.fill??t.fill,fillOpacity:n?.fillOpacity??t.fillOpacity,stroke:n?.stroke??t.stroke,strokeWidth:n?.strokeWidth??r,strokeOpacity:n?.strokeOpacity??t.strokeOpacity,lineDash:n?.lineDash??t.lineDash??[],lineDashOffset:n?.lineDashOffset??t.lineDashOffset,cornerRadius:i,cap:s,whisker:o}}getItemStyleOverrides(e,t,i,s){const{id:o,properties:n}=this,{xKey:r,minKey:a,q1Key:l,medianKey:c,q3Key:d,maxKey:h,itemStyler:u}=n;if(u!=null)return this.cachedDatumCallback(jN(e,s?"highlight":"node"),()=>u({seriesId:o,datum:t,xKey:r,minKey:a,q1Key:l,medianKey:c,q3Key:d,maxKey:h,highlighted:s,...i}))}updateDatumNodes({datumSelection:e,isHighlight:t}){const i=this.isVertical(),s=this.getValueAxis()?.isReversed();e.each((o,n)=>{let r=this.getFormattedStyles(n,t?"highlight":"node");t&&(r=uM(this.properties.highlightStyle.item,r));const{stroke:a,strokeWidth:l,strokeOpacity:c,lineDash:d,lineDashOffset:h}=r;r.whisker=uM(r.whisker,{stroke:a,strokeWidth:l,strokeOpacity:c,lineDash:d,lineDashOffset:h}),o.updateDatumStyles(n,r,i,s)})}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new Ane}getFormattedStyles(e,t){const{id:i,properties:s}=this,{xKey:o,minKey:n,q1Key:r,medianKey:a,q3Key:l,maxKey:c,itemStyler:d,backgroundFill:h,cornerRadius:u}=s,{datum:p,stroke:g,strokeWidth:f,strokeOpacity:y,lineDash:m,lineDashOffset:C,cap:b,whisker:S}=e;let A,R;A=e.fill,R=s.fillOpacity;const I={fill:A,fillOpacity:R,stroke:g,strokeWidth:f,strokeOpacity:y,lineDash:m,lineDashOffset:C,cornerRadius:u,cap:HN(b),whisker:HN(S)};if(d){const w=this.cachedDatumCallback(jN(p.index,t),()=>d({datum:p,seriesId:i,highlighted:t==="highlight",...I,xKey:o,minKey:n,q1Key:r,medianKey:a,q3Key:l,maxKey:c}));if(w)return uM(w,I)}return I}computeFocusBounds({datumIndex:e}){return Fne(this,this.contextNodeData?.nodeData[e].focusRect)}};Ek.className="BoxPlotSeries";Ek.type="box-plot";var{CARTESIAN_AXIS_TYPE:$N}=L.ThemeConstants,_ne={series:{direction:"vertical",strokeWidth:2},axes:{[$N.NUMBER]:{crosshair:{snap:!1}},[$N.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},{Color:pM,swapAxisCondition:zne,ThemeSymbols:{DEFAULT_BACKGROUND_COLOUR:Vne},ThemeConstants:{CARTESIAN_AXIS_TYPE:YN,CARTESIAN_POSITION:XN}}=L,Hne={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:e=>new Ek(e),tooltipDefaults:{range:"exact"},defaultAxes:zne([{type:YN.NUMBER,position:XN.LEFT},{type:YN.CATEGORY,position:XN.BOTTOM}],e=>e?.direction==="horizontal"),themeTemplate:_ne,groupable:!0,paletteFactory:({takeColors:e,themeTemplateParameters:t})=>{const i=t.get(Vne),s=(Array.isArray(i)?i[0]:i)??"white",{fills:[o],strokes:[n]}=e(1);let r;try{r=pM.mix(pM.fromString(s),pM.fromString(o),.3).toString()}catch{r=o}return{fill:r,stroke:n,backgroundFill:s}}},Wne=1e3,ZN=ns,jne=fo,Une=go,qN=Ys;function Kne(e,t,i,s){if(e.length<Wne)return;const[o,n]=ry(s);let r=ny(e),{indexData:a,valueData:l}=ay(e,t,i,o,n,r);const c=[{maxRange:r,indexData:a}];for(;r>64;)({indexData:a,valueData:l,maxRange:r}=ly(a,l,r)),c.push({maxRange:r,indexData:a});return c.reverse(),c}var{fixNumericExtent:$ne,keyProperty:Yne,createDatumId:QN,SeriesNodePickMode:JN,ChartAxisDirection:gM,SMALLEST_KEY_INTERVAL:Xne,valueProperty:wv,diff:Zne,animationValidation:qne,computeBarFocusBounds:Qne,visibleRangeIndices:eO,ContinuousScale:Jne,OrdinalTimeScale:ere,BandScale:tre}=L,ire=class extends L.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.openKey=s.properties.openKey,this.closeKey=s.properties.closeKey,this.highKey=s.properties.highKey,this.lowKey=s.properties.lowKey}},eW=class extends L.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[JN.AXIS_ALIGNED,JN.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},directionNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},pathsPerSeries:[]}),this.NodeEvent=ire,this.dataAggregationFilters=void 0}async processData(e){if(!this.properties.isValid()||!this.visible)return;const{xKey:t,openKey:i,closeKey:s,highKey:o,lowKey:n}=this.properties,r=!this.ctx.animationManager.isSkipped(),a=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:d,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:l}),u=[];r&&(this.processedData&&u.push(Zne(this.id,this.processedData)),u.push(qne())),i&&u.push(wv(i,h,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:p,processedData:g}=await this.requestDataModel(e,this.data,{props:[Yne(t,d,{id:"xValue"}),wv(s,h,{id:"closeValue"}),wv(o,h,{id:"highValue"}),wv(n,h,{id:"lowValue"}),...c?[Xne]:[],...u]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(e,t){const i=this.axes[gM.X];if(i==null||!(Jne.is(i.scale)||ere.is(i.scale)))return;const s=e.resolveKeysById(this,"xValue",t),o=e.resolveColumnById(this,"highValue",t),n=e.resolveColumnById(this,"lowValue",t),{index:r}=e.resolveProcessedDataDefById(this,"xValue"),a=t.domain.keys[r];return Kne(s,o,n,a)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];if(e!==this.getBarDirection()){const{index:o,def:n}=i.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[o];return n.type==="key"&&n.valueType==="category"?r:this.padBandExtent(r)}const s=this.domainForClippedRange(gM.Y,["highValue","lowValue"],"xValue",!0);return $ne(s)}getSeriesRange(e,t){return this.domainForVisibleRange(gM.Y,["highValue","lowValue"],"xValue",t,!0)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["highValue","lowValue"],e,t,i)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),o=this.getValueAxis();if(!(t&&i&&s&&o))return;const n=[],{xKey:r,highKey:a,lowKey:l}=this.properties,c=i.dataSources.get(this.id)??[],d=t.resolveKeysById(this,"xValue",i),h=t.resolveColumnById(this,"openValue",i),u=t.resolveColumnById(this,"closeValue",i),p=t.resolveColumnById(this,"highValue",i),g=t.resolveColumnById(this,"lowValue",i),{groupScale:f}=this,{barWidth:y,groupIndex:m}=this.updateGroupScale(s),C=f.convert(String(m)),b=y>=1?y:f.rawBandwidth,S=tre.is(s.scale),A={itemId:r,nodeData:n,labelData:[],scales:this.calculateScaling(),visible:this.visible};if(!e)return A;const R=(F,_,W,z,U,G,V,O)=>{const H=c[F],B=S?V/2:0,Y=s.scale.convert(_)+C+B,q=o.scale.convert(W),Z=o.scale.convert(z),ee=o.scale.convert(U),se=o.scale.convert(G),j=z>W,X=j?"up":"down",$=Math.min(ee,se),J=Math.max(ee,se)-$,ie={x:Y,y:$+J/2};n.push({series:this,itemId:X,datum:H,datumIndex:F,xKey:r,xValue:_,openValue:W,closeValue:z,highValue:U,lowValue:G,midPoint:ie,aggregatedValue:z,isRising:j,centerX:Y,width:V,y:$,height:J,yOpen:q,yClose:Z,crisp:O})},{dataAggregationFilters:I}=this,w=s.scale,[M,T]=w.range,E=T-M,P=F=>w.convert(d[F])+C,N=I?.find(F=>F.maxRange>E);if(N==null){let[F,_]=eO(c.length,s.range,W=>{const z=P(W);return[z,z+b]});i.input.count<1e3&&(F=0,_=i.input.count);for(let W=F;W<_;W+=1){const z=d[W];if(z==null)continue;const U=h[W],G=u[W],V=p[W],O=g[W],H=O!=null&&O<=U&&O<=G,B=V!=null&&V>=U&&V>=G;if(!H){et.warnOnce(`invalid low value for key [${l}] in data element, low value cannot be higher than datum open or close values`);continue}if(!B){et.warnOnce(`invalid high value for key [${a}] in data element, high value cannot be lower than datum open or close values.`);continue}R(W,z,U,G,V,O,b,!0)}}else{const{maxRange:F,indexData:_}=N,[W,z]=eO(F,s.range,U=>{const G=U*_o,V=_[G+ZN],O=_[G+qN];if(V!==-1)return[P(V),P(O)+b]});for(let U=W;U<z;U+=1){const G=U*_o,V=_[G+ZN],O=_[G+qN],H=_[G+jne],B=_[G+Une];if(V===-1)continue;const Y=(V+O)/2|0,q=d[Y];if(q==null)continue;const Z=h[V],ee=u[O],se=p[H],j=g[B],X=Math.abs(P(O)-P(V))+b;R(Y,q,Z,ee,se,j,X,!1)}}return A}isVertical(){return!0}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}updateLabelNodes(e){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}getItemBaseStyle(e,t){const{properties:i}=this,s=i.item[e],o=t?i.highlightStyle.item:void 0;return{fill:o?.fill??s.fill,fillOpacity:o?.fillOpacity??s.fillOpacity,stroke:o?.stroke??s.stroke,strokeWidth:o?.strokeWidth??s.strokeWidth,strokeOpacity:o?.strokeOpacity??s.strokeOpacity,lineDash:o?.lineDash??s.lineDash,lineDashOffset:o?.lineDashOffset??s.lineDashOffset}}getItemStyleOverrides(e,t,i,s,o){const{id:n,properties:r}=this,{itemStyler:a}=r;if(a==null)return;const{xKey:l,openKey:c,closeKey:d,highKey:h,lowKey:u}=r;return this.cachedDatumCallback(QN(e,o?"highlight":"node"),()=>a({seriesId:n,datum:t,itemId:i,xKey:l,openKey:c,closeKey:d,highKey:h,lowKey:u,highlighted:o,...s}))}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:n,xName:r,yName:a,openKey:l,openName:c,highKey:d,highName:h,lowKey:u,lowName:p,closeKey:g,closeName:f,legendItemName:y,tooltip:m}=o,C=this.getCategoryAxis(),b=this.getValueAxis();if(!i||!s||!C||!b)return;const{datumIndex:S}=e,A=s.dataSources.get(this.id)?.[S],R=i.resolveKeysById(this,"xValue",s)[S],I=i.resolveColumnById(this,"openValue",s)[S],w=i.resolveColumnById(this,"highValue",s)[S],M=i.resolveColumnById(this,"lowValue",s)[S],T=i.resolveColumnById(this,"closeValue",s)[S];if(R==null)return;const E=T>=I?"up":"down",P=this.properties.item[E],N=this.getItemBaseStyle(E,!1);return Object.assign(N,this.getItemStyleOverrides(String(S),A,E,N,!1)),m.formatTooltip({heading:C.formatDatum(R),title:y,symbol:{marker:{fill:P.fill??P.stroke,fillOpacity:P.fillOpacity??P.strokeOpacity??1,stroke:P.stroke,strokeWidth:P.strokeWidth??1,strokeOpacity:P.strokeOpacity??1,lineDash:P.lineDash??[0],lineDashOffset:P.lineDashOffset??0}},data:[{label:c,fallbackLabel:l,value:b.formatDatum(I)},{label:h,fallbackLabel:d,value:b.formatDatum(w)},{label:p,fallbackLabel:u,value:b.formatDatum(M)},{label:f,fallbackLabel:g,value:b.formatDatum(T)}]},{seriesId:t,datum:A,title:a,itemId:E,xKey:n,xName:r,yName:a,openKey:l,openName:c,highKey:d,highName:h,lowKey:u,lowName:p,closeKey:g,closeName:f,...N})}getDatumId(e){return QN(e.xValue)}computeFocusBounds(e){const t=this.getNodeData()?.at(e.datumIndex);if(t==null)return;const{centerX:i,y:s,width:o,height:n}=t,r={x:i-o/2,y:s,width:o,height:n};return Qne(this,r)}},{Path:sre,ScenePathChangeDetection:Xc,BBox:ore}=L,ma=class extends sre{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1,this.strokeAlignment=0}computeBBox(){const{centerX:e,y:t,width:i,height:s}=this;return new ore(e-i/2,t,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return{x:this.centerX,y:this.y+this.height/2}}alignedCoordinates(){const{y:e,width:t,height:i,crisp:s,strokeAlignment:o}=this;let{centerX:n,yOpen:r,yClose:a}=this,l=n-t/2,c=n+t/2,d=e,h=e+i;if(s&&t>1){n=this.align(n),r=this.align(r),a=this.align(a);const p=this.align(t/2);l=n-p,c=n+p,d=this.align(e),h=d+this.align(d,i)}const u=(d+h)/2;return n+=o,l+=o,c+=o,d-=o,h+=o,r+=r<u?o:-o,a+=a<u?o:-o,{centerX:n,x0:l,x1:c,y0:d,y1:h,yOpen:r,yClose:a}}executeStroke(e,t){const{width:i,strokeWidth:s}=this;i<s&&(e.lineWidth=i),super.executeStroke(e,t)}};v([Xc()],ma.prototype,"centerX");v([Xc()],ma.prototype,"y");v([Xc()],ma.prototype,"width");v([Xc()],ma.prototype,"height");v([Xc()],ma.prototype,"yOpen");v([Xc()],ma.prototype,"yClose");v([Xc()],ma.prototype,"crisp");v([Xc()],ma.prototype,"strokeAlignment");var nre=class extends ma{updatePath(){const{path:e}=this,{centerX:t,x0:i,x1:s,y0:o,y1:n,yOpen:r,yClose:a}=this.alignedCoordinates();e.clear(),e.moveTo(t,o),e.lineTo(t,n),Math.abs(s-i)>1&&(e.moveTo(i,r),e.lineTo(t,r),e.moveTo(t,a),e.lineTo(s,a))}},{ScenePathChangeDetection:dy,ExtendedPath2D:rre}=L,qp=class extends ma{constructor(){super(...arguments),this.wickPath=new rre,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:o,lineDashOffset:n,wickStroke:r,wickStrokeWidth:a,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:d,strokeAlignment:h}=this,{centerX:u,x0:p,x1:g,y0:f,y1:y,yOpen:m,yClose:C}=this.alignedCoordinates();this.path.clear(),this.wickPath.clear();const S=r!=null&&r!==t||a!=null&&a!==i||l!=null&&l!==s||c!=null&&c!==o||d!=null&&d!==n?this.wickPath:e;if(Math.abs(g-p)<=3){S.moveTo(u,f),S.lineTo(u,y);return}const A=Math.min(m,C),R=Math.max(m,C);S.moveTo(u,f),S.lineTo(u,A+i/2),S.moveTo(u,y),S.lineTo(u,R-i/2);const I=h+i/2,w=R-A-2*I;if(w>0)e.rect(p+I,A+I,g-p-2*I,w);else{const M=(A+R)/2;e.moveTo(p,M),e.lineTo(g,M)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:n,lineDashOffset:r,wickStroke:a=i,wickStrokeWidth:l=s,wickStrokeOpacity:c=o,wickLineDash:d=n,wickLineDashOffset:h=r}=this;l!==0&&(e.globalAlpha*=c,typeof a=="string"&&(e.strokeStyle=a),e.lineWidth=l,d!=null&&e.setLineDash(d),e.lineDashOffset=h,e.stroke(t.getPath2D()))}};v([dy()],qp.prototype,"wickStroke");v([dy()],qp.prototype,"wickStrokeWidth");v([dy()],qp.prototype,"wickStrokeOpacity");v([dy()],qp.prototype,"wickLineDash");v([dy()],qp.prototype,"wickLineDashOffset");var{BaseProperties:tW,Validate:fi,AbstractBarSeriesProperties:are,SeriesTooltip:lre,STRING:vr,COLOR_STRING:cre,FUNCTION:dre,LINE_DASH:hre,OBJECT:xx,POSITIVE_NUMBER:iW,RATIO:ure}=L,lh=class extends tW{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};v([fi(cre)],lh.prototype,"stroke");v([fi(iW)],lh.prototype,"strokeWidth");v([fi(ure)],lh.prototype,"strokeOpacity");v([fi(hre)],lh.prototype,"lineDash");v([fi(iW)],lh.prototype,"lineDashOffset");var Pk=class extends tW{constructor(){super(...arguments),this.up=new lh,this.down=new lh}};v([fi(xx)],Pk.prototype,"up");v([fi(xx)],Pk.prototype,"down");var Zo=class extends are{};v([fi(vr)],Zo.prototype,"xKey");v([fi(vr)],Zo.prototype,"openKey");v([fi(vr)],Zo.prototype,"closeKey");v([fi(vr)],Zo.prototype,"highKey");v([fi(vr)],Zo.prototype,"lowKey");v([fi(vr,{optional:!0})],Zo.prototype,"xName");v([fi(vr,{optional:!0})],Zo.prototype,"yName");v([fi(vr,{optional:!0})],Zo.prototype,"openName");v([fi(vr,{optional:!0})],Zo.prototype,"closeName");v([fi(vr,{optional:!0})],Zo.prototype,"highName");v([fi(vr,{optional:!0})],Zo.prototype,"lowName");var wx=class extends Zo{constructor(){super(...arguments),this.tooltip=new lre,this.item=new Pk}};v([fi(xx)],wx.prototype,"tooltip");v([fi(xx)],wx.prototype,"item");v([fi(dre,{optional:!0})],wx.prototype,"itemStyler");var{BaseProperties:Nk,SeriesTooltip:pre,Validate:_i,COLOR_STRING:Ok,FUNCTION:gre,LINE_DASH:sW,OBJECT:hy,POSITIVE_NUMBER:uy,RATIO:Fk}=L,Qp=class extends Nk{};v([_i(Ok,{optional:!0})],Qp.prototype,"stroke");v([_i(uy)],Qp.prototype,"strokeWidth");v([_i(Fk)],Qp.prototype,"strokeOpacity");v([_i(sW,{optional:!0})],Qp.prototype,"lineDash");v([_i(uy)],Qp.prototype,"lineDashOffset");var hr=class extends Nk{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Qp}};v([_i(Ok,{optional:!0})],hr.prototype,"fill");v([_i(Fk)],hr.prototype,"fillOpacity");v([_i(Ok)],hr.prototype,"stroke");v([_i(uy)],hr.prototype,"strokeWidth");v([_i(Fk)],hr.prototype,"strokeOpacity");v([_i(sW)],hr.prototype,"lineDash");v([_i(uy)],hr.prototype,"lineDashOffset");v([_i(uy)],hr.prototype,"cornerRadius");v([_i(hy)],hr.prototype,"wick");var Bk=class extends Nk{constructor(){super(...arguments),this.up=new hr,this.down=new hr}};v([_i(hy)],Bk.prototype,"up");v([_i(hy)],Bk.prototype,"down");var Mx=class extends Zo{constructor(){super(...arguments),this.item=new Bk,this.tooltip=new pre}};v([_i(hy)],Mx.prototype,"item");v([_i(hy)],Mx.prototype,"tooltip");v([_i(gre,{optional:!0})],Mx.prototype,"itemStyler");var{createDatumId:fre}=L,Gk=class extends eW{constructor(){super(...arguments),this.properties=new Mx}nodeFactory(){return new qp}updateDatumNodes({datumSelection:e,isHighlight:t}){const{id:i,properties:s}=this,{xKey:o,highKey:n,lowKey:r,openKey:a,closeKey:l,item:c,itemStyler:d}=s,{up:h,down:u}=c,{fill:p,fillOpacity:g,stroke:f,strokeWidth:y,strokeOpacity:m,lineDash:C,lineDashOffset:b}=h,{stroke:S,strokeWidth:A,strokeOpacity:R,lineDash:I,lineDashOffset:w}=h.wick,{fill:M,fillOpacity:T,stroke:E,strokeWidth:P,strokeOpacity:N,lineDash:F,lineDashOffset:_}=u,{stroke:W,strokeWidth:z,strokeOpacity:U,lineDash:G,lineDashOffset:V}=u.wick,O=t?s.highlightStyle.item:void 0;e.each((H,B)=>{const{isRising:Y,centerX:q,width:Z,y:ee,height:se,yOpen:j,yClose:X,crisp:$}=B;let J;if(d!=null){const{fill:ne,fillOpacity:K,stroke:oe,strokeWidth:de,strokeOpacity:re,lineDash:ce,lineDashOffset:be}=Y?h:u;J=this.cachedDatumCallback(fre(this.getDatumId(B),t?"highlight":"node"),()=>d({seriesId:i,itemId:B.itemId,xKey:o,highKey:n,lowKey:r,openKey:a,closeKey:l,datum:B.datum,fill:ne,fillOpacity:K,strokeOpacity:re,stroke:oe,strokeWidth:de,lineDash:ce,lineDashOffset:be,highlighted:t}))}H.centerX=q,H.width=Z,H.y=ee,H.height=se,H.yOpen=j,H.yClose=X,H.crisp=$,H.fill=O?.fill??J?.fill??(Y?p:M),H.fillOpacity=O?.fillOpacity??J?.fillOpacity??(Y?g:T),H.stroke=O?.stroke??J?.stroke??(Y?f:E),H.strokeWidth=O?.strokeWidth??J?.strokeWidth??(Y?y:P),H.strokeOpacity=O?.strokeOpacity??J?.strokeOpacity??(Y?m:N),H.lineDash=O?.lineDash??J?.lineDash??(Y?C:F),H.lineDashOffset=O?.lineDashOffset??J?.lineDashOffset??(Y?b:_);const ie=J?.wick;H.wickStroke=O?.stroke??ie?.stroke??(Y?S:W),H.wickStrokeWidth=O?.strokeWidth??ie?.strokeWidth??(Y?A:z),H.wickStrokeOpacity=O?.strokeOpacity??ie?.strokeOpacity??(Y?R:U),H.wickLineDash=O?.lineDash??ie?.lineDash??(Y?I:G),H.wickLineDashOffset=O?.lineDashOffset??ie?.lineDashOffset??(Y?w:V),H.strokeAlignment=(J?.strokeWidth??(Y?y:P))/2})}legendItemSymbol(){const{up:e,down:t}=this.properties.item,i=new L.LinearGradient("rgb",[{color:e.fill,offset:0},{color:e.fill,offset:.5},{color:t.fill,offset:.5}],90),s=new L.LinearGradient("rgb",[{color:e.stroke,offset:0},{color:e.stroke,offset:.5},{color:t.stroke,offset:.5}],90);return{marker:{fill:i,fillOpacity:e.fillOpacity,stroke:s,strokeWidth:e.strokeWidth??1,strokeOpacity:e.strokeOpacity??1,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset}}}getLegendData(e){const{id:t,data:i,visible:s,ctx:{legendManager:o}}=this,{xKey:n,yName:r,showInLegend:a,legendItemName:l}=this.properties;return!i?.length||!n||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&o.getItemEnabled({seriesId:t,itemId:t}),label:{text:l??r??t},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!a}]}};Gk.className="CandleStickSeries";Gk.type="candlestick";var{CARTESIAN_AXIS_TYPE:tO}=L.ThemeConstants,mre={series:{highlightStyle:{item:{strokeWidth:3}}},animation:{enabled:!1},axes:{[tO.NUMBER]:{crosshair:{snap:!1}},[tO.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:iO,CARTESIAN_POSITION:sO}=L.ThemeConstants,yre={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:e=>new Gk(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:iO.NUMBER,position:sO.LEFT},{type:iO.ORDINAL_TIME,position:sO.BOTTOM}],themeTemplate:mre,groupable:!1,paletteFactory:({takeColors:e,colorsCount:t,userPalette:i,palette:s})=>{if(i==="user-indexed"){const{fills:o,strokes:n}=e(t);return{item:{up:{fill:"transparent",stroke:n[0]},down:{fill:o[0],stroke:n[0]}}}}return{item:{up:s.up,down:s.down}}}};function oO(e,t,i){i||(t=vre(t));const s=new Map;for(const n of e)s.set(n.id,{datum:n,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let o=0;return s.forEach((n,r)=>{o=Math.max(o,vD(s,t,n,r,-1,[])+vD(s,t,n,r,1,[])+1)}),{links:t,nodeGraph:s,maxPathLength:o}}function oW(e,t,i,s){const o=s.indexOf(t);if(o!==-1){for(let r=o;r<s.length;r+=1)i.add(s[r]);return}s.push(t);const{toNode:n}=t;for(const r of e)r.fromNode===n&&oW(e,r,i,s);s.pop()}function vre(e){const t=new Set;for(const i of e)oW(e,i,t,[]);return t.size!==0&&et.warnOnce("Some links formed circular references. These will be removed from the output."),t.size===0?e:e.filter(i=>!t.has(i))}function vD(e,t,i,s,o,n){if(n.includes(s))return 1/0;let r=o===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(r===-1){r=0;const a=o===-1?i.linksBefore:i.linksAfter;for(const l of t){const{fromNode:c,toNode:d}=l,h=o===-1?d.id:c.id,u=o===-1?c.id:d.id,p=s===h?e.get(u):void 0;p!=null&&(a.push({node:p,link:l}),n?.push(s),r=Math.max(r,vD(e,t,p,u,o,n)+1),n?.pop())}o===-1?i.maxPathLengthBefore=r:i.maxPathLengthAfter=r}return r}var{Series:Cre,DataController:bre,Validate:Sre,ARRAY:xre,keyProperty:wre,valueProperty:Mv,Selection:xd,Group:au,TransformableText:Mre}=L,Dre=class extends L.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s);const{datumIndex:o}=i,n=s.contextNodeData?.nodeData.find(r=>r.datumIndex.type===o.type&&r.datumIndex.index===o.index);this.size=n?.size,this.label=n?.type===1?n?.label:void 0}},_k=class extends Cre{constructor(){super(...arguments),this.NodeEvent=Dre,this._chartNodes=void 0,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new au({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new au({name:"nodeGroup"})),this.focusLinkGroup=this.highlightNode.appendChild(new au({name:"linkGroup"})),this.focusNodeGroup=this.highlightNode.appendChild(new au({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightNode.appendChild(new au({name:"linkGroup"})),this.highlightNodeGroup=this.highlightNode.appendChild(new au({name:"nodeGroup"})),this.labelSelection=xd.select(this.labelGroup,Mre),this.linkSelection=xd.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=xd.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=xd.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=xd.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=xd.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=xd.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes??this._chartNodes}setChartNodes(e){this._chartNodes=e,this.nodes===e&&(this.nodeDataRefresh=!0)}async processData(e){const{data:t,nodes:i}=this;if(t==null||!this.properties.isValid())return;const{fromKey:s,toKey:o,sizeKey:n,idKey:r,labelKey:a}=this.properties,l=new bre("standalone",e.suppressFieldDotNotation),c=i!=null?l.request(this.id,i,{props:[wre(r,void 0,{id:"idValue",includeProperty:!1}),...a!=null?[Mv(a,void 0,{id:"labelValue",includeProperty:!1})]:[]],groupByKeys:!0}):null,d=e.request(this.id,t,{props:[Mv(s,void 0,{id:"fromValue",includeProperty:!1}),Mv(o,void 0,{id:"toValue",includeProperty:!1}),...n!=null?[Mv(n,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]:[]],groupByKeys:!1});i!=null&&l.execute();const[h,u]=await Promise.all([c,d]);this.nodesDataModel=h?.dataModel,this.nodesProcessedData=h?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const p=new Map;if(h==null){const g=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),f=u.dataModel.resolveColumnById(this,"toValue",u.processedData),y=m=>{const C=p.size;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:C},type:1,index:C,linksBefore:[],linksAfter:[],id:m,size:0,label:m}};u.processedData.dataSources.get(this.id)?.forEach((m,C)=>{const b=g[C],S=f[C];b==null||S==null||(p.has(b)||p.set(b,y(b)),p.has(S)||p.set(S,y(S)))})}else{const g=h.dataModel.resolveColumnById(this,"idValue",h.processedData),f=a!=null?h.dataModel.resolveColumnById(this,"labelValue",h.processedData):void 0;h.processedData.dataSources.get(this.id)?.forEach((y,m)=>{const C=g[m],b=f?.[m];p.set(C,{series:this,itemId:void 0,datum:y,datumIndex:{type:1,index:m},type:1,index:m,linksBefore:[],linksAfter:[],id:C,size:0,label:b})})}this.processedNodes=p}getNodeGraph(e,t,{includeCircularReferences:i}){const{linksDataModel:s,linksProcessedData:o}=this;if(s==null||o==null){const{links:g,nodeGraph:f,maxPathLength:y}=oO(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:f,links:g,maxPathLength:y}}const{sizeKey:n}=this.properties,r=s.resolveColumnById(this,"fromValue",o),a=s.resolveColumnById(this,"toValue",o),l=n!=null?s.resolveColumnById(this,"sizeValue",o):void 0,c=new Map;this.processedNodes.forEach(g=>{const f=e(g);c.set(g.id,f)});const d=[];o.dataSources.get(this.id)?.forEach((g,f)=>{const y=r[f],m=a[f],C=l!=null?l[f]:1,b=c.get(y),S=c.get(m);if(C<=0||b==null||S==null)return;const A=t({series:this,itemId:void 0,datum:g,datumIndex:{type:0,index:f},type:0,index:f,fromNode:b,toNode:S,size:C});d.push(A)});const{links:h,nodeGraph:u,maxPathLength:p}=oO(c.values(),d,i);return u.forEach(g=>{g.datum.linksBefore=g.linksBefore.map(f=>f.link),g.datum.linksAfter=g.linksAfter.map(f=>f.link)}),this.nodeCount=u.size,this.linkCount=h.length,{nodeGraph:u,links:h,maxPathLength:p}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(e){const{seriesRect:t}=e,i={seriesRectWidth:t?.width??0,seriesRectHeight:t?.height??0};(this._nodeDataDependencies==null||this._nodeDataDependencies.seriesRectWidth!==i.seriesRectWidth||this._nodeDataDependencies.seriesRectHeight!==i.seriesRectHeight)&&(this._nodeDataDependencies=i),this.updateSelections();const s=this.contextNodeData?.nodeData??[],o=this.contextNodeData?.labelData??[];let n=this.ctx.highlightManager?.getActiveHighlight();if(n?.series===this&&n.type==null){const{itemId:d}=n;n=d!=null?s.find(h=>h.type===1&&h.id===d):void 0}else n?.series!==this&&(n=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=n!=null?this.properties.highlightStyle.series.dimOpacity??1:1,this.labelSelection=this.updateLabelSelection({labelData:o,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:s.filter(d=>d.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:s.filter(d=>d.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let r,a,l,c;n?.type===1?(r=s.filter(d=>d.type===0&&(d.toNode===n||d.fromNode===n)),a=r.map(d=>d.fromNode===n?d.toNode:d.fromNode),a.push(n),l=[],c=[n]):n?.type===0?(r=[n],a=[n.fromNode,n.toNode],l=[n],c=[]):(r=[],a=[],l=[],c=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:r,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:a,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:l,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:c,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}resetAnimation(e){}getSeriesDomain(e){return[]}getSeriesRange(e,t){return[NaN,NaN]}legendItemSymbol(e,t,i={}){const{fills:s,strokes:o}=this.properties,{fill:n=s[t%s.length],fillOpacity:r=1,stroke:a=o[t%o.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:d=[0],lineDashOffset:h=0}=i;return{marker:{fill:n,fillOpacity:r,stroke:a,strokeWidth:l,strokeOpacity:c,lineDash:d,lineDashOffset:h}}}getLegendData(e){if(e!=="category")return[];const{showInLegend:t}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:s},o)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:s??i},symbol:this.legendItemSymbol(1,o),hideInLegend:!t,isFixed:!0}))}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.linkSelection.each((o,n)=>{const r=o.containsPoint(e,t)?0:1/0;r<i&&(i=r,s=n)}),this.nodeSelection.each((o,n)=>{const r=o.distanceSquared(e,t);r<i&&(i=r,s=n)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}getDatumAriaText(e,t){if(e.type===0)return this.ctx.localeManager.t("ariaAnnounceFlowProportionLink",{index:e.index+1,count:this.linkCount,from:e.fromNode.id,to:e.toNode.id,size:e.size,sizeName:this.properties.sizeName??this.properties.sizeKey});if(e.type===1)return this.ctx.localeManager.t("ariaAnnounceFlowProportionNode",{index:e.index+1,count:this.nodeCount,description:t})}pickFocus(e){const{datumIndexDelta:t,otherIndexDelta:i}=e,s=this.contextNodeData?.nodeData[e.datumIndex-e.datumIndexDelta];let o=s;if(i!==0||t===0)return;if(s?.type===0){const a=Array.from(this.linkSelection,d=>d.datum),c=a.indexOf(s)+t;if(c>=0&&c<a.length)o=a[c];else if(c>0)o=a[a.length-1];else{const d=Array.from(this.nodeSelection,h=>h.datum);o=d[d.length-1]}}else if(s?.type===1){const a=Array.from(this.nodeSelection,d=>d.datum),c=a.indexOf(s)+t;c>=0&&c<a.length?o=a[c]:c<0?o=a[0]:o=Array.from(this.linkSelection,h=>h.datum)[0]}if(o==null)return;const n=o.type===1?Array.from(this.nodeSelection).find(a=>a.datum===o):Array.from(this.linkSelection).find(a=>a.datum===o);if(n==null)return;const r=this.computeFocusBounds(n.node);if(r!=null)return{datum:n.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(n.datum)??0,otherIndex:0,bounds:r,clipFocusBox:!0}}};v([Sre(xre,{optional:!0,property:"nodes"})],_k.prototype,"_chartNodes");var{BBox:Are,Path:Ire,ScenePathChangeDetection:Zc}=L;function lb({radius:e,startAngle:t,endAngle:i,tension:s}){const o=e*Math.cos(t),n=e*Math.sin(t),r=e*Math.cos(i),a=e*Math.sin(i),l=o*s,c=n*s,d=r*s,h=a*s;return{x:[o,l,d,r],y:[n,c,h,a]}}var kl=class extends Ire{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}computeBBox(){const{centerX:e,centerY:t,radius:i,startAngle1:s,endAngle1:o,startAngle2:n,endAngle2:r,tension:a}=this,l=lb({radius:i,startAngle:s,endAngle:r,tension:a}),c=lb({radius:i,startAngle:n,endAngle:o,tension:a}),d=Math.min(...l.x,...c.x),h=Math.max(...l.x,...c.x)-d,u=Math.min(...l.y,...c.y),p=Math.max(...l.y,...c.y)-u;return new Are(e+d,t+u,h,p)}tensionedCurveTo(e,t,i,s,o,n,r,a){const{path:l,tension:c}=this,d=1-c;l.cubicCurveTo((i-e)*d+e,(s-t)*d+t,(o-r)*d+r,(n-a)*d+a,r,a)}updatePath(){const{path:e,centerX:t,centerY:i,radius:s}=this;let{startAngle1:o,endAngle1:n,startAngle2:r,endAngle2:a}=this;o>r&&([o,r]=[r,o],[n,a]=[a,n]),e.clear();const l=t+s*Math.cos(o),c=i+s*Math.sin(o);e.moveTo(l,c),this.tensionedCurveTo(l,c,t,i,t,i,t+s*Math.cos(a),i+s*Math.sin(a)),e.arc(t,i,s,a,r,!0),this.tensionedCurveTo(t+s*Math.cos(r),i+s*Math.sin(r),t,i,t,i,t+s*Math.cos(n),i+s*Math.sin(n)),e.arc(t,i,s,n,o,!0),e.closePath()}};v([Zc()],kl.prototype,"centerX");v([Zc()],kl.prototype,"centerY");v([Zc()],kl.prototype,"radius");v([Zc()],kl.prototype,"startAngle1");v([Zc()],kl.prototype,"endAngle1");v([Zc()],kl.prototype,"startAngle2");v([Zc()],kl.prototype,"endAngle2");v([Zc()],kl.prototype,"tension");var{BaseProperties:nW,SeriesTooltip:Rre,SeriesProperties:kre,ARRAY:Tre,COLOR_STRING:Dx,COLOR_STRING_ARRAY:rW,FUNCTION:aW,LINE_DASH:lW,OBJECT:Ax,POSITIVE_NUMBER:qc,RATIO:py,STRING:Qc,Validate:Xe,Label:Lre}=L,zk=class extends Lre{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};v([Xe(qc)],zk.prototype,"spacing");v([Xe(qc)],zk.prototype,"maxWidth");var ya=class extends nW{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}};v([Xe(Dx,{optional:!0})],ya.prototype,"fill");v([Xe(py)],ya.prototype,"fillOpacity");v([Xe(Dx,{optional:!0})],ya.prototype,"stroke");v([Xe(py)],ya.prototype,"strokeOpacity");v([Xe(qc)],ya.prototype,"strokeWidth");v([Xe(lW)],ya.prototype,"lineDash");v([Xe(qc)],ya.prototype,"lineDashOffset");v([Xe(py)],ya.prototype,"tension");v([Xe(aW,{optional:!0})],ya.prototype,"itemStyler");var Cr=class extends nW{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};v([Xe(qc)],Cr.prototype,"spacing");v([Xe(qc)],Cr.prototype,"width");v([Xe(Dx,{optional:!0})],Cr.prototype,"fill");v([Xe(py)],Cr.prototype,"fillOpacity");v([Xe(Dx,{optional:!0})],Cr.prototype,"stroke");v([Xe(py)],Cr.prototype,"strokeOpacity");v([Xe(qc)],Cr.prototype,"strokeWidth");v([Xe(lW)],Cr.prototype,"lineDash");v([Xe(qc)],Cr.prototype,"lineDashOffset");v([Xe(aW,{optional:!0})],Cr.prototype,"itemStyler");var Ps=class extends kre{constructor(){super(...arguments),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fills=[],this.strokes=[],this.label=new zk,this.link=new ya,this.node=new Cr,this.tooltip=new Rre}};v([Xe(Qc)],Ps.prototype,"fromKey");v([Xe(Qc)],Ps.prototype,"toKey");v([Xe(Qc)],Ps.prototype,"idKey");v([Xe(Qc,{optional:!0})],Ps.prototype,"idName");v([Xe(Qc,{optional:!0})],Ps.prototype,"labelKey");v([Xe(Qc,{optional:!0})],Ps.prototype,"labelName");v([Xe(Qc,{optional:!0})],Ps.prototype,"sizeKey");v([Xe(Qc,{optional:!0})],Ps.prototype,"sizeName");v([Xe(Tre,{optional:!0})],Ps.prototype,"nodes");v([Xe(rW)],Ps.prototype,"fills");v([Xe(rW)],Ps.prototype,"strokes");v([Xe(Ax)],Ps.prototype,"label");v([Xe(Ax)],Ps.prototype,"link");v([Xe(Ax)],Ps.prototype,"node");v([Xe(Ax)],Ps.prototype,"tooltip");var{SeriesNodePickMode:nO,CachedTextMeasurerPool:Ere,TextWrapper:Pre,TextUtils:Nre,createDatumId:Dv,angleBetween:pC,normalizeAngle360:Ore,isBetweenAngles:rO,Sector:Fre,evaluateBezier:Av,applyShapeStyle:Bre}=L,Iv=e=>e.startAngle+pC(e.startAngle,e.endAngle)/2,Vk=class extends _k{constructor(e){super({moduleCtx:e,pickModes:[nO.NEAREST_NODE,nO.EXACT_SHAPE_MATCH]}),this.properties=new Ps}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new kl}nodeFactory(){return new Fre}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:o,sizeKey:n,label:{spacing:r,maxWidth:a,fontSize:l},node:{width:c,spacing:d}}=this.properties,h=t/2,u=i/2;let p=[];const{nodeGraph:g,links:f}=this.getNodeGraph(N=>({...N,centerX:h,centerY:u,innerRadius:NaN,outerRadius:NaN,startAngle:NaN,endAngle:NaN}),N=>({...N,centerX:h,centerY:u,radius:NaN,startAngle1:NaN,endAngle1:NaN,startAngle2:NaN,endAngle2:NaN}),{includeCircularReferences:!0});let y=0;g.forEach(({datum:N,linksBefore:F,linksAfter:_},W)=>{const z=F.reduce((U,{link:G})=>U+G.size,0)+_.reduce((U,{link:G})=>U+G.size,0);if(z===0)g.delete(W);else{N.size=z,y+=N.size;const U=this.getLabelText(this.properties.label,{datum:N.datum,value:N.label,fromKey:s,toKey:o,sizeKey:n,size:N.size});N.label=String(U)}});let m=0;if(this.isLabelEnabled()){const N=this.properties.label.getFont();let F=0;g.forEach(({datum:_})=>{const{id:W,label:z}=_;if(z==null)return;const U=Pre.wrapText(z,{maxWidth:a,font:this.properties.label,textWrap:"never"}),{width:G}=Ere.measureText(U,{font:N,textAlign:"left",textBaseline:"middle"});F=Math.max(G,F),p.push({id:W,text:U,centerX:h,centerY:u,angle:NaN,radius:NaN})}),m=F+r}const C=g.size;let b=Math.min(t,i)/2-c-m,S=d/b;if(m!==0&&(C*S>=1.5*Math.PI||b<=0)&&(p=[],b=Math.min(t,i)/2-c,S=d/b),C*S>=2*Math.PI||b<=0){et.warnOnce("There was insufficient space to display the Chord Series.");return}const A=b,R=b+c,I=Math.max((2*Math.PI-C*S)/y,0);let w=0;g.forEach(({datum:N})=>{N.innerRadius=A,N.outerRadius=R,N.startAngle=w,N.endAngle=w+N.size*I,w=N.endAngle+S;const F=(N.innerRadius+N.outerRadius)/2,_=Iv(N);N.midPoint={x:N.centerX+F*Math.cos(_),y:N.centerY+F*Math.sin(_)}});const M=[];g.forEach(({datum:N,linksBefore:F,linksAfter:_})=>{const W=Iv(N),z=[...F.map(G=>({link:G.link,distance:pC(Iv(G.node.datum),W),after:!1})),..._.map(G=>({link:G.link,distance:pC(Iv(G.node.datum),W),after:!0}))];let U=N.startAngle;z.toSorted((G,V)=>G.distance-V.distance).forEach(({link:G,after:V})=>{const O=G.size*I;V?(G.startAngle1=U,G.endAngle1=U+O):(G.startAngle2=U,G.endAngle2=U+O),U+=G.size*I}),M.push(N)});const{tension:T}=this.properties.link;f.forEach(N=>{N.radius=b;const F=lb({radius:b,startAngle:N.startAngle1,endAngle:N.endAngle2,tension:T}),_=lb({radius:b,startAngle:N.startAngle2,endAngle:N.endAngle1,tension:T}),W=Av(...F.x,.5),z=Av(...F.y,.5),U=Av(..._.x,.5),G=Av(..._.y,.5);N.midPoint={x:N.centerX+(W+U)/2,y:N.centerY+(z+G)/2},M.push(N)}),p.forEach(N=>{const F=g.get(N.id)?.datum;F!=null&&(N.radius=R+r,N.angle=Ore(F.startAngle+pC(F.startAngle,F.endAngle)/2))}),p.sort((N,F)=>N.angle-F.angle);let E=1/0,P=-1/0;return p=p.filter(N=>{const F=Nre.getLineHeight(l),_=Math.atan2(F/2,N.radius),W=N.angle-_,z=N.angle+_;return rO(E,W,z)||rO(P,W,z)?!1:(E=Math.min(W,E),P=Math.max(z,P),!0)}),{itemId:e,nodeData:M,labelData:p}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{color:i,fontStyle:s,fontWeight:o,fontSize:n,fontFamily:r}=this.properties.label;t.each((a,{text:l,centerX:c,centerY:d,radius:h,angle:u})=>{a.visible=!0,a.translationX=c+h*Math.cos(u),a.translationY=d+h*Math.sin(u),a.text=l,a.fill=i,a.fontStyle=s,a.fontWeight=o,a.fontSize=n,a.fontFamily=r,a.textBaseline="middle",Math.cos(u)>=0?(a.textAlign="left",a.rotation=u):(a.textAlign="right",a.rotation=u-Math.PI)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Dv([t.type,t.id]))}getBaseNodeStyle(e){const{properties:t}=this,{fill:i,fillOpacity:s,stroke:o,strokeOpacity:n,lineDash:r,lineDashOffset:a}=t.node,l=e?t.highlightStyle.item:void 0;return{fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??o,strokeOpacity:l?.strokeOpacity??n,strokeWidth:l?.strokeWidth??this.getStrokeWidth(t.node.strokeWidth),lineDash:l?.lineDash??r,lineDashOffset:l?.lineDashOffset??a}}getNodeStyleOverrides(e,t,i,s,o,n,r){const{id:a,properties:l}=this,{fills:c,strokes:d}=l,{itemStyler:h}=l.node,u=n.fill??c[i%c.length],p=n.stroke??d[i%d.length],g={};if(r||(g.fill=u,g.stroke=p),h!=null){const f=this.cachedDatumCallback(Dv(e,r?"highlight":"node"),()=>{const{fillOpacity:y=1,strokeOpacity:m=1,strokeWidth:C=0,lineDash:b=[],lineDashOffset:S=0}=n;return h({seriesId:a,datum:t,highlighted:r,label:o,size:s,fill:u,fillOpacity:y,stroke:p,strokeOpacity:m,strokeWidth:C,lineDash:b,lineDashOffset:S})});Object.assign(g,f)}return g}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getBaseNodeStyle(i);t.each((o,n)=>{const{datumIndex:r,size:a,label:l}=n,c=this.getNodeStyleOverrides(String(r),n,r.index,a,l,s,i);o.centerX=n.centerX,o.centerY=n.centerY,o.innerRadius=n.innerRadius,o.outerRadius=n.outerRadius,o.startAngle=n.startAngle,o.endAngle=n.endAngle,o.fill=c.fill??s?.fill,o.fillOpacity=c.fillOpacity??s?.fillOpacity,o.stroke=c.stroke??s?.stroke,o.strokeOpacity=c.strokeOpacity??s?.strokeOpacity,o.strokeWidth=c.strokeWidth??s?.strokeWidth,o.lineDash=c.lineDash??s?.lineDash,o.lineDashOffset=c.lineDashOffset??s?.lineDashOffset,o.inset=o.strokeWidth/2})}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Dv([t.type,t.index,t.fromNode.id,t.toNode.id]))}getBaseLinkStyle(e){const{properties:t}=this,{fill:i,fillOpacity:s,stroke:o,strokeOpacity:n,lineDash:r,lineDashOffset:a,tension:l}=t.link,c=e?t.highlightStyle.item:void 0;return{fill:c?.fill??i,fillOpacity:c?.fillOpacity??s,stroke:c?.stroke??o,strokeOpacity:c?.strokeOpacity??n,strokeWidth:c?.strokeWidth??this.getStrokeWidth(t.link.strokeWidth),lineDash:c?.lineDash??r,lineDashOffset:c?.lineDashOffset??a,tension:l}}getLinkStyleOverrides(e,t,i,s,o){const{id:n,properties:r}=this,{fills:a,strokes:l}=r,{itemStyler:c}=r.link,d=s.fill??a[i%a.length],h=s.stroke??l[i%l.length],u={};if(o||(u.fill=d,u.stroke=h),c!=null){const p=this.cachedDatumCallback(Dv(e,o?"highlight":"node"),()=>{const{fillOpacity:g=1,strokeOpacity:f=1,strokeWidth:y=0,lineDash:m=[],lineDashOffset:C=0,tension:b}=s;return c({seriesId:n,datum:t,highlighted:o,tension:b,fill:d,fillOpacity:g,stroke:h,strokeOpacity:f,strokeWidth:y,lineDash:m,lineDashOffset:C})});Object.assign(u,p)}return u}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getBaseLinkStyle(i);t.each((o,n)=>{const{datumIndex:r}=n,a=n.fromNode.datumIndex,l=this.getLinkStyleOverrides(String(r),n,a.index,s,i);o.centerX=n.centerX,o.centerY=n.centerY,o.radius=n.radius,o.startAngle1=n.startAngle1,o.endAngle1=n.endAngle1,o.startAngle2=n.startAngle2,o.endAngle2=n.endAngle2,Bre(o,s,l),o.tension=l?.tension??s.tension})}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:o}=this,{fromKey:n,toKey:r,sizeKey:a,sizeName:l,tooltip:c}=o,{datumIndex:d}=e,h=e.type===0?e.fromNode.index:e.index,u=e.type===0?`${e.fromNode.label} - ${e.toNode.label}`:e.label,p=d.type===0?i?.dataSources.get(this.id)?.[d.index]:s?.dataSources.get(this.id)?.[d.index],g=e.size;let f;if(e.type===0){const y=e.fromNode.datumIndex,m=this.getBaseLinkStyle(!1);Object.assign(m,this.getLinkStyleOverrides(String(d),p,y.index,m,!1)),f=m}else{const y=e.label,m=this.getBaseNodeStyle(!1);Object.assign(m,this.getNodeStyleOverrides(String(d),p,d.index,g,y,m,!1)),f=m}return c.formatTooltip({title:u,symbol:this.legendItemSymbol(e.type,h,f),data:a!=null?[{label:l,fallbackLabel:a,value:String(g)}]:[]},{seriesId:t,datum:p,title:u,fromKey:n,toKey:r,sizeKey:a,sizeName:l,size:g,...f})}computeFocusBounds(e){return e}};Vk.className="ChordSeries";Vk.type="chord";var Gre={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"chord",tooltipDefaults:{range:"exact"},moduleFactory:e=>new Vk(e),themeTemplate:{series:{highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0,tension:.4}},legend:{enabled:!1,toggleSeries:!1}},paletteFactory({takeColors:e,colorsCount:t}){const{fills:i,strokes:s}=e(t);return{fills:i,strokes:s}}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:ku,CARTESIAN_POSITION:lu},ThemeSymbols:{DEFAULT_SHADOW_COLOUR:_re}}=L;function cW(e){const{placement:t,...i}=e?.stageLabel??{};return e?.direction!=="horizontal"?[{type:ku.CATEGORY,position:t==="after"?lu.RIGHT:lu.LEFT,label:i},{type:ku.NUMBER,position:lu.BOTTOM}]:[{type:ku.NUMBER,position:lu.LEFT},{type:ku.CATEGORY,position:t==="before"?lu.TOP:lu.BOTTOM,label:i}]}var zre={series:{direction:"vertical",strokeWidth:0,spacingRatio:.25,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:0},shadow:{enabled:!1,color:_re,xOffset:3,yOffset:3,blur:5}},axes:{[ku.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter(e){return Math.abs(e.value).toFixed(e.fractionDigits??0)}}},[ku.CATEGORY]:{line:{enabled:!1}}}},{lineDistanceSquared:Rv,BBox:Vre,Path:Hre,ScenePathChangeDetection:Jc}=L,aO=1e-6;function lO([e,t],[i,s]){return Math.abs(e-i)<=aO&&Math.abs(t-s)<=aO}var va=class extends Hre{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:e,y0:t,x1:i,y1:s,x2:o,y2:n,x3:r,y3:a}=this;return{x:(e+i+o+r)/4,y:(t+s+n+a)/4}}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const{x0:i,y0:s,x1:o,y1:n,x2:r,y2:a,x3:l,y3:c}=this;return Math.min(Rv(e,t,i,s,o,n,1/0),Rv(e,t,o,n,r,a,1/0),Rv(e,t,r,a,l,c,1/0),Rv(e,t,l,c,i,s,1/0))}computeBBox(){const{x0:e,y0:t,x1:i,y1:s,x2:o,y2:n,x3:r,y3:a}=this,l=Math.min(e,i,o,r),c=Math.max(e,i,o,r)-l,d=Math.min(t,s,n,a),h=Math.max(t,s,n,a)-d;return new Vre(l,d,c,h)}updatePath(){const{path:e,x0:t,y0:i,x1:s,y1:o,x2:n,y2:r,x3:a,y3:l}=this,c=[[t,i],[s,o],[n,r],[a,l]];e.clear();let d,h;c.forEach(u=>{if(d!=null&&lO(d,u)||h!=null&&lO(h,u))return;const[p,g]=u;d==null?e.moveTo(p,g):e.lineTo(p,g),d??(d=u),h=u}),e.closePath()}};v([Jc()],va.prototype,"x0");v([Jc()],va.prototype,"y0");v([Jc()],va.prototype,"x1");v([Jc()],va.prototype,"y1");v([Jc()],va.prototype,"x2");v([Jc()],va.prototype,"y2");v([Jc()],va.prototype,"x3");v([Jc()],va.prototype,"y3");var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:Wre}=L;function cO(e,t,i,s){const{x0:o,y0:n,x1:r,y1:a,x2:l,y2:c,x3:d,y3:h,opacity:u}=e;return i?{x0:(o+d)/2,y0:(n+h)/2,x1:(r+l)/2,y1:(a+c)/2,x2:(r+l)/2,y2:(a+c)/2,x3:(o+d)/2,y3:(n+h)/2,opacity:u}:{x0:(o+r)/2,y0:(n+a)/2,x1:(o+r)/2,y1:(n+a)/2,x2:(l+d)/2,y2:(c+h)/2,x3:(l+d)/2,y3:(c+h)/2,opacity:u}}function jre(e,t){const i=n=>n==null;return{fromFn:(n,r,a)=>{a==="updated"&&i(r)?a="removed":a==="updated"&&i(n.previousDatum)&&(a="added");let l;a==="added"&&n.previousDatum==null&&t==="fade"||(a==="unknown"||a==="added"?l=cO(r,n.previousDatum,e):l={x0:n.x0,y0:n.y0,x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,x3:n.x3,y3:n.y3,opacity:n.opacity});const c=Wre[a];return{...l,phase:c}},toFn:(n,r,a)=>{let l;return a==="removed"&&n.datum==null&&t==="fade"||(a==="removed"||i(r)?l=cO(r,n.previousDatum,e):l=CD(n,r)),l}}}function CD(e,t){const{x0:i,y0:s,x1:o,y1:n,x2:r,y2:a,x3:l,y3:c,opacity:d}=t;return{x0:i,y0:s,x1:o,y1:n,x2:r,y2:a,x3:l,y3:c,opacity:d}}var{SeriesNodePickMode:dO,SeriesZIndexMap:hO,valueProperty:Ure,keyProperty:Kre,ChartAxisDirection:uO,updateLabelNode:$re,SMALLEST_KEY_INTERVAL:Yre,LARGEST_KEY_INTERVAL:Xre,diff:Zre,fixNumericExtent:qre,seriesLabelFadeInAnimation:pO,resetMotion:Qre,resetLabelFn:Jre,animationValidation:eae,computeBarFocusBounds:tae,ContinuousScale:iae,Group:sae,Selection:oae,PointerEvents:gO,motion:nae,checkCrisp:rae,createDatumId:aae}=L,lae=class extends L.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.stageKey,this.yKey=s.properties.valueKey}},dW=class extends L.AbstractBarSeries{constructor({moduleCtx:e,animationResetFns:t}){super({moduleCtx:e,pickModes:[dO.AXIS_ALIGNED,dO.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["stageKey"],y:["valueKey"]},directionNames:{x:[],y:[]},datumSelectionGarbageCollection:!1,animationResetFns:{datum:t.datum,label:Jre}}),this.NodeEvent=lae,this.connectorNodeGroup=this.contentGroup.appendChild(new sae({name:`${this.id}-series-connectorNodes`,zIndex:hO.BACKGROUND})),this.connectorSelection=oae.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=gO.None}get pickModeAxis(){return"main-category"}setSeriesIndex(e){return super.setSeriesIndex(e)?(this.connectorNodeGroup.zIndex=[hO.BACKGROUND,e],!0):!1}isVertical(){return!super.isVertical()}connectionFactory(){return new va}async processData(e){if(!this.properties.isValid())return;const{stageKey:t,valueKey:i}=this.properties,{visible:s,id:o}=this,n=(g,f,y)=>s&&this.ctx.legendManager.getItemEnabled({seriesId:o,itemId:y}),r=this.getCategoryAxis()?.scale,a=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:d}=this.getScaleInformation({xScale:r,yScale:a}),h=[];this.ctx.animationManager.isSkipped()||(this.processedData&&h.push(Zre(this.id,this.processedData)),h.push(eae()));const u=this.visible?{}:{forceValue:0},{processedData:p}=await this.requestDataModel(e,this.data,{props:[Kre(t,c,{id:"xValue"}),Ure(i,d,{id:"yValue",...u,validation:n,invalidValue:0}),...l?[Yre,Xre]:[],...h],groupByKeys:!1});this.smallestDataInterval=p.reduced?.smallestKeyInterval,this.largestDataInterval=p.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:o}}=this;if(!t||!i)return[];const{keys:[n]}=t.domain;if(e===this.getCategoryDirection()){const r=i.resolveProcessedDataDefById(this,"xValue");return r?.def.type==="key"&&r?.def.valueType==="category"?this.hasData?n.filter((a,l)=>o.getItemEnabled({seriesId:s,itemId:l})):[]:this.padBandExtent(n)}else{const r=this.domainForClippedRange(uO.Y,["yValue"],"xValue",!0),a=Math.max(...r),l=[-a,a];return qre(l)}}getSeriesRange(e,t){return[NaN,NaN]}createNodeData(){const{hasData:e,data:t,dataModel:i,groupScale:s,processedData:o,id:n,ctx:{legendManager:r}}=this,a=this.getCategoryAxis(),l=this.getValueAxis();if(!(e&&t&&a&&l&&i&&o?.type==="ungrouped"))return;const c=a.scale,d=l.scale,h=this.getBarDirection()===uO.X,{stageKey:u,valueKey:p}=this.properties,{strokeWidth:g}=this.barStyle(),f=`${p}`,y={itemId:f,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),visible:this.visible},m=this.visible;if(!m)return y;const C=i.resolveKeysById(this,"xValue",o),b=i.resolveColumnById(this,"yValue",o),{barWidth:S,groupIndex:A}=this.updateGroupScale(a),R=iae.is(c)?S*-.5:0,I=rae(a?.scale,a?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let w;return(o.dataSources.get(this.id)??[]).forEach((T,E)=>{const P=m&&r.getItemEnabled({seriesId:n,itemId:E}),N=C[E];if(N==null)return;const F=Math.round(c.convert(N))+s.convert(String(A))+R,_=b[E],W=Math.round(d.convert(-_)),z=Math.round(d.convert(_)),U=Math.max(g,Math.abs(z-W)),G={x:h?Math.min(z,W):F,y:h?F:Math.min(z,W),width:h?U:S,height:h?S:U},V={x:G.x+G.width/2,y:G.y+G.height/2},O=this.createLabelData({datumIndex:E,rect:G,barAlongX:h,yDatum:_,datum:T,visible:P}),H={index:E,series:this,itemId:f,datum:T,datumIndex:E,xValue:N,yValue:_,xKey:u,yKey:p,x:G.x,y:G.y,width:G.width,height:G.height,midPoint:V,strokeWidth:g,crisp:I,label:O,visible:P};if(y.nodeData.push(H),O!=null&&y.labelData.push(O),w!=null){const B=w.rect,Y=w.nodeDatum,q=w.datumIndex;h?y.connectorData.push({datum:Y,datumIndex:q,x0:B.x,y0:B.y+B.height,x1:B.x+B.width,y1:B.y+B.height,x2:G.x+G.width,y2:G.y,x3:G.x,y3:G.y,opacity:1}):y.connectorData.push({datum:Y,datumIndex:q,x0:B.x+B.width,y0:B.y,x1:G.x,y1:G.y,x2:G.x,y2:G.y+G.height,x3:B.x+B.width,y3:B.y+B.height,opacity:1})}P&&(w={itemId:f,rect:G,nodeDatum:H,datumIndex:E})}),y}updateNodes(e,t,i){super.updateNodes(e,t,i);const{connectorSelection:s}=this,o=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:s,connectorData:o}),this.updateConnectorNodes({connectorSelection:s})}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s,void 0,o=>this.getDatumId(o))}updateConnectorSelection(e){const{connectorData:t,connectorSelection:i}=e;return i.update(this.connectorEnabled()?t:[],void 0,s=>this.getDatumId(s.datum))}updateConnectorNodes(e){const{fills:t,strokes:i}=this.properties,{fill:s,fillOpacity:o,stroke:n,strokeOpacity:r,strokeWidth:a,lineDash:l,lineDashOffset:c}=this.connectorStyle();e.connectorSelection.each((d,h)=>{const{datumIndex:u}=h;d.setProperties(CD(d,h)),d.fill=s??t[u%t.length],d.fillOpacity=o,d.stroke=n??i[u%i.length],d.strokeOpacity=r,d.strokeWidth=a,d.lineDash=l,d.lineDashOffset=c})}getHighlightLabelData(e,t){const i=e.filter(s=>s.datum===t.datum);return i.length>0?i:void 0}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=gO.None})}updateLabelNodes(e){e.labelSelection.each((t,i)=>{$re(t,this.properties.label,i)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{stageKey:n,valueKey:r,tooltip:a}=o,l=this.getCategoryAxis(),c=this.getValueAxis();if(!i||!s||!l||!c)return;const{datumIndex:d}=e,h=s.dataSources.get(this.id)?.[d],u=i.resolveKeysById(this,"xValue",s)[d],p=i.resolveColumnById(this,"yValue",s)[d];if(u!=null)return a.formatTooltip({symbol:this.legendItemSymbol(d),data:[{label:l.formatDatum(u),value:c.formatDatum(p)}]},{seriesId:t,datum:h,title:n,stageKey:n,valueKey:r,...this.tooltipStyle(h,d)})}resetAllAnimation(e){super.resetAllAnimation(e),Qre([this.connectorSelection],CD)}animateEmptyUpdateReady({labelSelection:e}){const{connectorSelection:t}=this,i=this.isVertical(),o=jre(i,"normal");nae.fromToMotion(this.id,"connectors",this.ctx.animationManager,[t],o),pO(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(e){const{labelSelection:t}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id),pO(this,"labels",this.ctx.animationManager,t)}getDatumId(e){return aae(e.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return tae(this,this.contextNodeData?.nodeData[e])}legendItemSymbol(e){const{strokeWidth:t,fillOpacity:i,strokeOpacity:s,lineDash:o,lineDashOffset:n}=this.barStyle(),{fills:r,strokes:a}=this.properties,l=r[e%r.length]??"black",c=a[e%a.length]??"black";return{marker:{fill:l,fillOpacity:i,stroke:c,strokeWidth:t,strokeOpacity:s,lineDash:o,lineDashOffset:n}}}getLegendData(e){const{id:t,processedData:i,dataModel:s,ctx:{legendManager:o},visible:n}=this;if(!s||!i||e!=="category"||!this.properties.isValid())return[];const{showInLegend:r}=this.properties,a=s.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)??[]).map((l,c)=>{const d=a[c];if(d!=null)return{legendType:"category",id:t,datum:l,itemId:c,seriesId:t,enabled:n&&o.getItemEnabled({seriesId:t,itemId:c}),label:{text:String(d)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!r}}).filter(l=>l!=null)}},{Label:cae,AbstractBarSeriesProperties:dae,SeriesTooltip:hae,AxisLabel:uae,Validate:io,UNION:hW,COLOR_STRING_ARRAY:uW,LINE_DASH:pae,OBJECT:Hk,POSITIVE_NUMBER:Wk,RATIO:pW,STRING:gW}=L,jk=class extends cae{constructor(){super(...arguments),this.spacing=0}};v([io(hW(["before","middle","after"],"a placement"))],jk.prototype,"placement");v([io(Wk)],jk.prototype,"spacing");var fW=class extends uae{};v([io(hW(["before","after"],"a placement"))],fW.prototype,"placement");var qo=class extends dae{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new jk,this.stageLabel=new fW,this.tooltip=new hae}};v([io(gW)],qo.prototype,"stageKey");v([io(gW)],qo.prototype,"valueKey");v([io(uW)],qo.prototype,"fills");v([io(pW)],qo.prototype,"fillOpacity");v([io(uW)],qo.prototype,"strokes");v([io(Wk)],qo.prototype,"strokeWidth");v([io(pW)],qo.prototype,"strokeOpacity");v([io(pae)],qo.prototype,"lineDash");v([io(Wk)],qo.prototype,"lineDashOffset");v([io(Hk)],qo.prototype,"label");v([io(Hk)],qo.prototype,"stageLabel");v([io(Hk)],qo.prototype,"tooltip");function fO(e,{x:t,y:i,width:s,height:o,opacity:n}){return{x1:t,y1:i,x2:t+s,y2:i+o,opacity:n}}var{formatValue:gae,Line:fae}=L,Uk=class extends dW{constructor(e){super({moduleCtx:e,animationResetFns:{datum:fO}}),this.properties=new qo}get hasData(){const{id:e,ctx:{legendManager:t}}=this,i=this.data?.reduce((s,o,n)=>s+(t.getItemEnabled({seriesId:e,itemId:n})?1:0),0);return i!=null&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}barStyle(){return{fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[],lineDashOffset:0}}connectorStyle(){const{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:o}=this.properties;return{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:o}}nodeFactory(){return new fae}createLabelData({datumIndex:e,rect:t,barAlongX:i,yDatum:s,datum:o,visible:n}){const{stageKey:r,valueKey:a,label:l}=this.properties,{spacing:c,placement:d}=l;let h,u,p,g;if(i)switch(h=t.x+t.width/2,p="center",d){case"before":u=t.y-c,g="bottom";break;case"after":u=t.y+t.height+c,g="top";break;default:u=t.y+t.height/2,g="middle"}else switch(u=t.y+t.height/2,g="middle",d){case"before":h=t.x-c,p="right";break;case"after":h=t.x+t.width+c,p="left";break;default:h=t.x+t.width/2,p="center"}return{x:h,y:u,textAlign:p,textBaseline:g,text:this.getLabelText(l,{itemId:a,value:s,datum:o,stageKey:r,valueKey:a},f=>gae(f,0)),itemId:a,datum:o,datumIndex:e,series:this,visible:n}}updateDatumNodes(e){const t=e.isHighlight?this.properties.highlightStyle.item:void 0;e.datumSelection.each((i,s)=>{i.setProperties(fO(i,s)),i.stroke=t?.stroke,i.strokeWidth=t?.strokeWidth??0,i.strokeOpacity=t?.strokeOpacity??1,i.lineDash=t?.lineDash,i.lineDashOffset=t?.lineDashOffset??0})}tooltipStyle(e,t){const{fills:i,strokes:s}=this.properties,o=i[t%i.length]??"black",n=s[t%s.length]??"black",{fillOpacity:r,strokeOpacity:a,strokeWidth:l,lineDash:c,lineDashOffset:d}=this.barStyle();return{fill:o,fillOpacity:r,stroke:n,strokeOpacity:a,strokeWidth:l,lineDash:c,lineDashOffset:d}}};Uk.className="ConeFunnelSeries";Uk.type="cone-funnel";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:mO}}=L,mae={series:{direction:"vertical",strokeWidth:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4}},seriesArea:{padding:{top:20,bottom:20}},axes:{[mO.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter(e){return Math.abs(e.value).toFixed(e.fractionDigits??0)}}},[mO.CATEGORY]:{line:{enabled:!1}}}},yae={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"cone-funnel",moduleFactory:e=>new Uk(e),solo:!0,tooltipDefaults:{range:"nearest"},defaultAxes:cW,themeTemplate:mae,paletteFactory:({userPalette:e,themeTemplateParameters:t,takeColors:i,colorsCount:s})=>{const{fills:o}=i(s),n=t.get(L.ThemeSymbols.DEFAULT_FUNNEL_SERIES_COLOR_RANGE),r=e==="inbuilt"?n:[o[0],o[1]];return{fills:r,strokes:r.slice(0)}}},{Label:vae,DropShadow:Cae,AbstractBarSeriesProperties:bae,BaseProperties:Sae,SeriesTooltip:xae,AxisLabel:wae,Validate:Nt,UNION:Mae,BOOLEAN:Dae,COLOR_STRING_ARRAY:mW,COLOR_STRING:yW,FUNCTION:Aae,LINE_DASH:vW,OBJECT:gy,POSITIVE_NUMBER:Ix,RATIO:fy,STRING:CW}=L,Iae=class extends vae{},bW=class extends wae{};v([Nt(Mae(["before","after"],"a placement"))],bW.prototype,"placement");var Tl=class extends Sae{constructor(){super(...arguments),this.enabled=!0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};v([Nt(Dae)],Tl.prototype,"enabled");v([Nt(yW,{optional:!0})],Tl.prototype,"fill");v([Nt(fy)],Tl.prototype,"fillOpacity");v([Nt(yW,{optional:!0})],Tl.prototype,"stroke");v([Nt(Ix)],Tl.prototype,"strokeWidth");v([Nt(fy)],Tl.prototype,"strokeOpacity");v([Nt(vW)],Tl.prototype,"lineDash");v([Nt(Ix)],Tl.prototype,"lineDashOffset");var hs=class extends bae{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new Tl,this.shadow=new Cae().set({enabled:!1}),this.label=new Iae,this.stageLabel=new bW,this.tooltip=new xae}};v([Nt(CW)],hs.prototype,"stageKey");v([Nt(CW)],hs.prototype,"valueKey");v([Nt(mW)],hs.prototype,"fills");v([Nt(fy)],hs.prototype,"fillOpacity");v([Nt(mW)],hs.prototype,"strokes");v([Nt(Ix)],hs.prototype,"strokeWidth");v([Nt(fy)],hs.prototype,"strokeOpacity");v([Nt(vW)],hs.prototype,"lineDash");v([Nt(Ix)],hs.prototype,"lineDashOffset");v([Nt(fy)],hs.prototype,"spacingRatio");v([Nt(Aae,{optional:!0})],hs.prototype,"itemStyler");v([Nt(gy)],hs.prototype,"dropOff");v([Nt(gy)],hs.prototype,"shadow");v([Nt(gy)],hs.prototype,"label");v([Nt(gy)],hs.prototype,"stageLabel");v([Nt(gy)],hs.prototype,"tooltip");var{ChartAxisDirection:Rae,resetBarSelectionsFn:kae,prepareBarAnimationFunctions:yO,midpointStartingBarPosition:vO,createDatumId:Tae,formatValue:Lae,Rect:Eae,motion:CO,applyShapeStyle:Pae}=L,Kk=class extends dW{constructor(e){super({moduleCtx:e,animationResetFns:{datum:kae}}),this.properties=new hs}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}barStyle(){const{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:o}=this.properties;return{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:o}}connectorStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeOpacity:s,strokeWidth:o,lineDash:n,lineDashOffset:r}=this.properties.dropOff;return{fill:e,fillOpacity:t,stroke:i,strokeOpacity:s,strokeWidth:o,lineDash:n,lineDashOffset:r}}nodeFactory(){return new Eae}createLabelData({datumIndex:e,rect:t,yDatum:i,datum:s,visible:o}){const{valueKey:n,stageKey:r,label:a}=this.properties;return{x:t.x+t.width/2,y:t.y+t.height/2,textAlign:"center",textBaseline:"middle",text:this.getLabelText(a,{itemId:r,value:i,datum:s,valueKey:n,stageKey:r},l=>Lae(l,0)),itemId:r,datum:s,datumIndex:e,series:this,visible:o}}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset}}getItemStyleOverrides(e,t,i,s,o){const{id:n,properties:r}=this,{stageKey:a,valueKey:l,fills:c,strokes:d,itemStyler:h}=r,u=s.fill??c[i%c.length]??"black",p=s.stroke??d[i%d.length]??"black",g={};if(o||(g.fill=u,g.stroke=p),h!=null){const f=this.cachedDatumCallback(Tae(e,o?"highlight":"node"),()=>{const{fillOpacity:y,strokeOpacity:m,strokeWidth:C,lineDash:b,lineDashOffset:S}=s;return h({seriesId:n,datum:t,highlighted:o,stageKey:a,valueKey:l,fill:u,fillOpacity:y,stroke:p,strokeOpacity:m,strokeWidth:C,lineDash:b,lineDashOffset:S})});Object.assign(g,f)}return g}updateDatumNodes(e){const{shadow:t}=this.properties,{datumSelection:i,isHighlight:s}=e,o=this.getCategoryDirection()===Rae.X,n=this.getItemBaseStyle(s);i.each((r,a)=>{const{datumIndex:l}=a,c=this.getItemStyleOverrides(String(a.datumIndex),a.datum,l,n,s);Pae(r,n,c),r.visible=o?a.width>0:a.height>0,r.crisp=a.crisp,r.fillShadow=t})}tooltipStyle(e,t){const i=this.getItemBaseStyle(!1);return Object.assign(i,this.getItemStyleOverrides(String(t),e,t,i,!1)),i}animateEmptyUpdateReady(e){super.animateEmptyUpdateReady(e);const{datumSelection:t}=e,i=this.isVertical(),o=yO(vO(i,"normal"));CO.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],o)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e);const{datumSelection:t}=e,{processedData:i}=this,s=i?.reduced?.diff?.[this.id],o=yO(vO(this.isVertical(),"fade"));CO.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],o,(n,r)=>r.xValue,s)}};Kk.className="FunnelSeries";Kk.type="funnel";var Nae={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"funnel",moduleFactory:e=>new Kk(e),solo:!0,tooltipDefaults:{range:"exact"},defaultAxes:cW,themeTemplate:zre,paletteFactory:({takeColors:e})=>{const{fills:t,strokes:i}=e(1);return{fills:t,strokes:i}}},{CachedTextMeasurerPool:SW,TextUtils:xW,TextWrapper:cb}=L;function Oae(e,t){const{fontSize:i,minimumFontSize:s=i}=e,{fontSize:o,minimumFontSize:n=o}=t,r=i-s,a=o-n;let l=e.fontSize,c=t.fontSize;const d=[{labelFontSize:i,secondaryLabelFontSize:o}];for(;l>s||c>n;){const h=r>0?(l-s)/r:-1,u=a>0?(c-n)/a:-1;h>u?l--:c--,d.push({labelFontSize:l,secondaryLabelFontSize:c})}return d.reverse(),d}function sp(e,t){return e.lineHeight!=null&&e.fontSize!=null?e.lineHeight*t/e.fontSize:xW.getLineHeight(t)}function wW(e,t,i,s,{padding:o},n){const{spacing:r=0}=t,a=2*o,l=2*o+r,c=(t.minimumFontSize??t.fontSize)+(s.minimumFontSize??s.fontSize);if(c>n(c+l,!1).height-l)return;const d=Oae(t,s),h={fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},u={fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let p,g;return uV(0,d.length-1,f=>{const{labelFontSize:y,secondaryLabelFontSize:m}=d[f],C=f===0,b=sp(t,y),S=sp(s,m),A=n(b+S+l,C),R=A.width-a,I=A.height-l;if(b+S>I||((p==null||p.fontSize!==y)&&(h.fontSize=y,p=SO(t,e,R,I,h,t.wrapping,C?t.overflowStrategy:"hide")),p==null||p.width>R||p.height>I)||((g==null||g.fontSize!==m)&&(u.fontSize=m,g=SO(s,i,R,I,u,s.wrapping,C?s.overflowStrategy:"hide")),g==null))return;const w=p.height+g.height;if(!(g.width>R||w>I))return{width:Math.max(p.width,g.width),height:w+r,meta:A.meta,label:p,secondaryLabel:g}})}function tm(e,t,{padding:i},s){const o=2*i,n=Math.min(t.minimumFontSize??t.fontSize,t.fontSize),r={fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight};return uV(n,t.fontSize,a=>{const l=sp(t,a),c=a===n,d=s(l+o,c),h=d.width-o,u=d.height-o;if(l>u)return;r.fontSize=a;const p=cb.wrapLines(e,{maxWidth:h,maxHeight:u,font:r,textWrap:t.wrapping,overflow:(c?t.overflowStrategy:void 0)??"hide"});if(!p.length)return;const g=Fae(p,{lineHeight:l,font:r,maxWidth:h,maxHeight:u});if(g)return[{fontSize:a,lineHeight:l,...g},d.meta]})}function bO(e){return e?.minimumFontSize!=null&&e?.fontSize!=null&&e?.minimumFontSize>e?.fontSize}function $k(e,t,i,s,o,n){const r=t.enabled?e:void 0,a=s.enabled?i:void 0;(bO(t)||bO(s))&&et.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;r!=null&&a!=null&&(l=wW(r,t,a,s,o,n));let c;if(l==null&&r!=null&&(c=tm(r,t,o,n)),c!=null){const[h,u]=c;l={width:h.width,height:h.height,meta:u,label:h,secondaryLabel:void 0}}let d;if(l==null&&r==null&&a!=null&&(d=tm(a,s,o,n)),d!=null){const[h,u]=d;l={width:h.width,height:h.height,meta:u,label:void 0,secondaryLabel:h}}return l}function SO(e,t,i,s,o,n,r){const a=cb.wrapLines(t,{maxWidth:i,maxHeight:s,font:o,textWrap:n,overflow:r});if(!a.length)return;const l=sp(e,o.fontSize),{width:c}=SW.measureLines(a,{font:o});return{width:c,lineHeight:l,text:a.join(`
14
+ </div>`}};v([ga(xH)],Wp.prototype,"enabled");v([ga(lx)],Wp.prototype,"xOffset");v([ga(lx)],Wp.prototype,"yOffset");v([ga(MH,{optional:!0})],Wp.prototype,"format");v([ga(wH,{optional:!0})],Wp.prototype,"renderer");var{Group:Bie,TranslatableGroup:Gie,Line:CN,BBox:bN,createId:_ie,POSITIVE_NUMBER:DH,RATIO:zie,BOOLEAN:AH,COLOR_STRING:Vie,LINE_DASH:Hie,OBJECT:Wie,InteractionState:vv,Validate:$c,ZIndexMap:SN,formatNumber:jie,isInteger:Uie,ChartAxisDirection:xN}=L,Il=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.id=_ie(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new Hp,this.seriesRect=new bN(0,0,0,0),this.bounds=new bN(0,0,0,0),this.crosshairGroup=new Gie({name:"crosshairs",zIndex:SN.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new Bie({name:`${this.id}-crosshair-lines`,zIndex:SN.SERIES_CROSSHAIR})),this.lineGroupSelection=L.Selection.select(this.lineGroup,CN,!1),this.activeHighlight=void 0,this.axisCtx=e.parent,this.labels={},this.hideCrosshairs(),e.domManager.addEventListener("focusin",({target:t})=>{const i=t instanceof HTMLElement&&e.domManager.contains(t,"series-area");this.crosshairGroup.visible&&!i&&(this.hideCrosshairs(),this.ctx.updateService.update(L.ChartUpdateType.PERFORM_LAYOUT))}),this.destroyFns.push(e.scene.attachNode(this.crosshairGroup),e.widgets.seriesWidget.addListener("mousemove",t=>this.onMouseHoverLike(t)),e.widgets.seriesWidget.addListener("drag-move",t=>this.onMouseHoverLike(t)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),e.widgets.seriesDragInterpreter.addListener("click",t=>this.onClick(t)),e.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),e.zoomManager.addListener("zoom-pan-start",()=>this.onMouseOut()),e.zoomManager.addListener("zoom-change",()=>this.onMouseOut()),e.highlightManager.addListener("highlight-change",t=>this.onHighlightChange(t)),e.layoutManager.addListener("layout:complete",t=>this.layout(t)),()=>Object.entries(this.labels).forEach(([t,i])=>i.destroy()))}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;this.seriesRect=e;const{position:s="left",axisId:o}=this.axisCtx,n=i.find(c=>c.id===o);if(!n)return;this.axisLayout=n,this.bounds=e.clone().grow(n.gridPadding+n.seriesAreaPadding,s);const{crosshairGroup:r,bounds:a}=this;r.translationX=Math.round(a.x),r.translationY=Math.round(a.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l)}updateSelections(e){this.lineGroupSelection.update(e,t=>t.append(new CN),t=>t)}updateLabels(e){const{labels:t,ctx:i}=this;for(const s of e)this.label.enabled&&(t[s]??(t[s]=new Wp(i.domManager,s,this.axisCtx.axisId))),t[s]&&this.updateLabel(t[s]);this.labelFormatter=this.axisCtx.scaleValueFormatter(this.label.format)}updateLabel(e){const{enabled:t,xOffset:i,yOffset:s,format:o,renderer:n}=this.label;e.enabled=t,e.xOffset=i,e.yOffset=s,e.format=o,e.renderer=n}updateLines(){const{lineGroupSelection:e,bounds:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:n,lineDashOffset:r,axisLayout:a}=this;if(!a)return;const l=this.isVertical();e.each(c=>{c.stroke=i,c.strokeWidth=s,c.strokeOpacity=o,c.lineDash=n,c.lineDashOffset=r,c.y1=0,c.y2=l?t.height:0,c.x1=0,c.x2=l?0:t.width})}isVertical(){return this.axisCtx.direction===xN.X}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(e){const{labelFormatter:t,axisLayout:i,ctx:{callbackCache:s}}=this;if(t){const o=s.call(t,e);if(o!=null)return o}if(typeof e=="number"){const o=(i?.label.fractionDigits??0)+(Uie(e)?0:1);return jie(e,o)}return String(e??"")}onClick(e){e.device==="touch"&&this.onMouseHoverLike(e)}onMouseHoverLike(e){if(!this.enabled||this.snap)return;const t=this.isHover(e)?vv.Clickable:vv.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&(this.updatePositions(this.getData(e)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(L.ChartUpdateType.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(vv.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(L.ChartUpdateType.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(vv.Default)&&this.hideCrosshairs()}onHighlightChange(e){if(!this.enabled)return;const{crosshairGroup:t,axisCtx:i}=this,{datum:s,series:o}=e.currentHighlight??{},n=s&&(o?.axes.x?.id===i.axisId||o?.axes.y?.id===i.axisId);if(this.activeHighlight=n?e.currentHighlight:void 0,!this.activeHighlight)this.hideCrosshairs();else if(this.snap){const r=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(r),t.visible=!0}}isInRange(e){return this.axisCtx.inRange(e)}updatePositions(e){const{seriesRect:t,lineGroupSelection:i}=this;i.each((s,o)=>{const n=e[o];if(!n){s.visible=!1,this.hideLabel(o);return}s.visible=!0;const{value:r,position:a}=n;let l=0,c=0;this.isVertical()?(l=a,s.x=Math.round(l)):(c=a,s.y=Math.round(c)),this.label.enabled?this.showLabel(l+t.x,c+t.y,r,o):this.hideLabel(o)})}getData(e){const{axisCtx:t}=this,i="pointer",{datum:s,xKey:o="",yKey:n=""}=this.activeHighlight??{},{currentX:r,currentY:a}=e,l=this.isVertical(),c=l?r:a;let d=s?.[l?o:n]??"";return t.continuous&&(d=t.scaleInvert(c)),{[i]:{position:c,value:d}}}getActiveHighlightData(e){const{axisCtx:t}=this,{datum:i,series:s,xKey:o="",aggregatedValue:n,cumulativeValue:r,midPoint:a}=e,l=s.getKeyProperties(t.direction),c=(t.scale.bandwidth??0)/2,d=s.axes[t.direction]?.id===t.axisId,h=l.indexOf("yKey")>-1&&d,u=l.indexOf("xKey")>-1&&d,p=n??r;if(h&&p!==void 0){const f=t.scale.convert(p)+c;return this.isInRange(f)?{yKey:{value:p,position:f}}:{}}if(u){const f=(this.isVertical()?a?.x:a?.y)??0,y=t.continuous?t.scaleInvert(f):i[o];return this.isInRange(f)?{xKey:{value:y,position:f}}:{}}const g={};return l.forEach(f=>{const y=s.properties[f],m=i[y],C=t.scale.convert(m)+c;this.isInRange(C)&&(g[f]={value:m,position:C})}),g}getLabelHtml(e,t){const i=this.axisLayout?.label?.fractionDigits??0,s={text:this.formatValue(e)};return this.label.renderer?t.toLabelHtml(this.label.renderer({value:e,fractionDigits:i}),s):t.toLabelHtml(s)}showLabel(e,t,i,s){if(!this.axisLayout)return;const{bounds:o}=this,n=this.labels[s],r=this.getLabelHtml(i,n);n.setLabelHtml(r);const{width:a,height:l}=n.getBBox(),c=this.axisCtx.position;let d=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===xN.X?(d-=4,n.show({x:e-a/2,y:c==="bottom"?o.y+o.height+d:o.y-l-d})):(d-=8,n.show({x:c==="right"?o.x+o.width+d:o.x-a-d,y:t-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const e of Object.keys(this.labels))this.hideLabel(e)}hideLabel(e){this.labels[e]?.toggle(!1)}};v([$c(AH)],Il.prototype,"enabled");v([$c(Vie,{optional:!0})],Il.prototype,"stroke");v([$c(Hie,{optional:!0})],Il.prototype,"lineDash");v([$c(DH)],Il.prototype,"lineDashOffset");v([$c(DH)],Il.prototype,"strokeWidth");v([$c(zie)],Il.prototype,"strokeOpacity");v([$c(AH)],Il.prototype,"snap");v([$c(Wie)],Il.prototype,"label");var Kie={type:"axis-option",optionsKey:"crosshair",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","ordinal-time","number","log","time"],moduleFactory:e=>new Il(e),themeTemplate:{crosshair:{snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}}}},{BOOLEAN:$ie,FUNCTION:Yie,ActionOnSet:iy,Validate:IH}=L,jp=class extends L.BaseModuleInstance{constructor(e){super(),this.enabled=!1,this.getData=()=>Promise.resolve(),this.dataService=e.dataService}updateCallback(e,t){this.dataService&&(e&&t!=null?this.dataService.updateCallback(t):this.dataService.clearCallback())}};v([iy({newValue(e){this.updateCallback(e,this.getData)}}),IH($ie)],jp.prototype,"enabled");v([iy({newValue(e){this.updateCallback(this.enabled,e)}}),IH(Yie)],jp.prototype,"getData");v([iy({newValue(e){this.dataService.requestThrottle=e}})],jp.prototype,"requestThrottle");v([iy({newValue(e){this.dataService.dispatchThrottle=e}})],jp.prototype,"updateThrottle");v([iy({newValue(e){this.dataService.dispatchOnlyLatest=!e}})],jp.prototype,"updateDuringInteraction");var Xie={type:"root",optionsKey:"dataSource",packageType:"enterprise",chartTypes:["cartesian","hierarchy","polar","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new jp(e),themeTemplate:{dataSource:{enabled:!1}}},{nearestSquaredInContainer:Zie,partialAssign:qie,mergeDefaults:wN,BBox:Pa}=L,Qie=class{constructor(e){this.components=e,this.union=Pa.merge(e)}containsPoint(e,t){if(!this.union.containsPoint(e,t))return!1;for(const i of this.components)if(i.containsPoint(e,t))return!0;return!1}},Jie=class extends L.Group{constructor(){super(),this.capLength=NaN,this._datum=void 0,this.whiskerPath=new L.Path,this.capsPath=new L.Path,this.bboxes=new Qie([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(e){this._datum=e}calculateCapLength(e,t){const{lengthRatio:i=1,length:s}=e,{lengthRatioMultiplier:o,lengthMax:n}=t,r=s??i*o;return Math.min(r,n)}getItemStylerParams(e,t,i){const{datum:s}=this;if(s==null||e.itemStyler==null)return;const{xLowerKey:o,xUpperKey:n,yLowerKey:r,yUpperKey:a}=e;return{...t,datum:s.datum,seriesId:s.datum.seriesId,xKey:s.xKey,yKey:s.yKey,xLowerKey:o,xUpperKey:n,yLowerKey:r,yUpperKey:a,highlighted:i}}formatStyles(e,t,i){let{cap:s,...o}=e;const n=this.getItemStylerParams(t,e,i);if(n!=null&&t.itemStyler!=null){const r=t.itemStyler(n);o=wN(r,o),s=wN(r?.cap,r,s)}return{whiskerStyle:o,capsStyle:s}}applyStyling(e,t){qie(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],e,t)}update(e,t,i){if(this.datum===void 0)return;const{whiskerStyle:s,capsStyle:o}=this.formatStyles(e,t,i),{xBar:n,yBar:r,capDefaults:a}=this.datum,l=this.whiskerPath;this.applyStyling(l,s),l.path.clear(!0),r!==void 0&&(l.path.moveTo(r.lowerPoint.x,r.lowerPoint.y),l.path.lineTo(r.upperPoint.x,r.upperPoint.y)),n!==void 0&&(l.path.moveTo(n.lowerPoint.x,n.lowerPoint.y),l.path.lineTo(n.upperPoint.x,n.upperPoint.y)),l.path.closePath(),this.capLength=this.calculateCapLength(o??{},a);const c=this.capLength/2,d=this.capsPath;this.applyStyling(d,o),d.path.clear(!0),r!==void 0&&(d.path.moveTo(r.lowerPoint.x-c,r.lowerPoint.y),d.path.lineTo(r.lowerPoint.x+c,r.lowerPoint.y),d.path.moveTo(r.upperPoint.x-c,r.upperPoint.y),d.path.lineTo(r.upperPoint.x+c,r.upperPoint.y)),n!==void 0&&(d.path.moveTo(n.lowerPoint.x,n.lowerPoint.y-c),d.path.lineTo(n.lowerPoint.x,n.lowerPoint.y+c),d.path.moveTo(n.upperPoint.x,n.upperPoint.y-c),d.path.lineTo(n.upperPoint.x,n.upperPoint.y+c)),d.path.closePath()}updateBBoxes(){const{capLength:e,whiskerPath:t,capsPath:i}=this,{yBar:s,xBar:o}=this.datum??{},n=e/2,r=[];if(s!==void 0){const a=s.lowerPoint.y-s.upperPoint.y;r.push(new Pa(s.lowerPoint.x,s.upperPoint.y,t.strokeWidth,a),new Pa(s.lowerPoint.x-n,s.lowerPoint.y,e,i.strokeWidth),new Pa(s.upperPoint.x-n,s.upperPoint.y,e,i.strokeWidth))}if(o!==void 0){const a=o.upperPoint.x-o.lowerPoint.x;r.push(new Pa(o.lowerPoint.x,o.upperPoint.y,a,t.strokeWidth),new Pa(o.lowerPoint.x,o.lowerPoint.y-n,i.strokeWidth,e),new Pa(o.upperPoint.x,o.upperPoint.y-n,i.strokeWidth,e))}this.bboxes.components=r,this.bboxes.union=Pa.merge(r)}containsPoint(e,t){return this.bboxes.containsPoint(e,t)}pickNode(e,t){return this.containsPoint(e,t)?this:void 0}nearestSquared(e,t,i){const{bboxes:s}=this;if(s.union.distanceSquared(e,t)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:o}=Pa.nearestBox(e,t,s.components);return{nearest:this,distanceSquared:o}}},ese=class extends L.Group{nearestSquared(e,t){const{nearest:i,distanceSquared:s}=Zie(e,t,{children:this.children()});if(i!==void 0&&!isNaN(s))return{datum:i.datum,distanceSquared:s}}},{BaseProperties:RH,Validate:Bt,BOOLEAN:kH,COLOR_STRING:TH,FUNCTION:tse,LINE_DASH:LH,NUMBER:ise,OBJECT:sse,POSITIVE_NUMBER:cx,RATIO:hk,STRING:Yc}=L,Rl=class extends RH{};v([Bt(kH,{optional:!0})],Rl.prototype,"visible");v([Bt(TH,{optional:!0})],Rl.prototype,"stroke");v([Bt(cx,{optional:!0})],Rl.prototype,"strokeWidth");v([Bt(hk,{optional:!0})],Rl.prototype,"strokeOpacity");v([Bt(LH,{optional:!0})],Rl.prototype,"lineDash");v([Bt(cx,{optional:!0})],Rl.prototype,"lineDashOffset");v([Bt(ise,{optional:!0})],Rl.prototype,"length");v([Bt(hk,{optional:!0})],Rl.prototype,"lengthRatio");var ds=class extends RH{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new Rl}};v([Bt(Yc,{optional:!0})],ds.prototype,"yLowerKey");v([Bt(Yc,{optional:!0})],ds.prototype,"yLowerName");v([Bt(Yc,{optional:!0})],ds.prototype,"yUpperKey");v([Bt(Yc,{optional:!0})],ds.prototype,"yUpperName");v([Bt(Yc,{optional:!0})],ds.prototype,"xLowerKey");v([Bt(Yc,{optional:!0})],ds.prototype,"xLowerName");v([Bt(Yc,{optional:!0})],ds.prototype,"xUpperKey");v([Bt(Yc,{optional:!0})],ds.prototype,"xUpperName");v([Bt(kH,{optional:!0})],ds.prototype,"visible");v([Bt(TH,{optional:!0})],ds.prototype,"stroke");v([Bt(cx,{optional:!0})],ds.prototype,"strokeWidth");v([Bt(hk,{optional:!0})],ds.prototype,"strokeOpacity");v([Bt(LH,{optional:!0})],ds.prototype,"lineDash");v([Bt(cx,{optional:!0})],ds.prototype,"lineDashOffset");v([Bt(tse,{optional:!0})],ds.prototype,"itemStyler");v([Bt(sse)],ds.prototype,"cap");var{fixNumericExtent:ose,groupAccumulativeValueProperty:nse,mergeDefaults:rse,valueProperty:Cv,ChartAxisDirection:rM}=L;function ase(e){for(const t of iD)if(t===e.series.type)return e.series;throw new Error(`AG Charts - unsupported series type '${e.series.type}', error bars supported series types: ${iD.join(", ")}`)}var lse=class Kg extends L.BaseModuleInstance{constructor(t){super(),this.properties=new ds;const i=ase(t),{annotationGroup:s,annotationSelections:o}=i;this.cartesianSeries=i,this.groupNode=new ese({name:`${s.id}-errorBars`}),s.appendChild(this.groupNode),this.selection=L.Selection.select(this.groupNode,()=>this.errorBarFactory()),o.add(this.selection),i.addEventListener("seriesVisibilityChange",n=>this.onToggleSeriesItem(n)),this.destroyFns.push(i.addListener("data-processed",n=>this.onDataProcessed(n)),i.addListener("data-update",n=>this.onDataUpdate(n)),t.highlightManager.addListener("highlight-change",n=>this.onHighlightChange(n)),()=>s.removeChild(this.groupNode),()=>o.delete(this.selection))}hasErrorBars(){const{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:o}=this.properties;return os(t)&&os(i)||os(s)&&os(o)}isStacked(){const t=this.cartesianSeries.seriesGrouping?.stackCount;return t==null?!1:t>0}getUnstackPropertyDefinition(t){const i=[],{xLowerKey:s,xUpperKey:o,yLowerKey:n,yUpperKey:r,xErrorsID:a,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:d}=t;return n!=null&&r!=null&&i.push(Cv(n,d,{id:`${l}-lower`}),Cv(r,d,{id:`${l}-upper`})),s!=null&&o!=null&&i.push(Cv(s,c,{id:`${a}-lower`}),Cv(o,c,{id:`${a}-upper`})),i}getStackPropertyDefinition(t){const i=[],{cartesianSeries:s}=this,{xLowerKey:o,xUpperKey:n,yLowerKey:r,yUpperKey:a,xErrorsID:l,yErrorsID:c}=this.getMaybeFlippedKeys(),{xScaleType:d,yScaleType:h}=t,u=s.seriesGrouping?.groupIndex??s.id,p={invalidValue:null,missingValue:0,separateNegative:!0,...s.visible?{}:{forceValue:0}},g=(y,m,C,b)=>nse(y,"normal","current",{id:`${m}-${C}`,groupId:`errorGroup-${u}-${C}`,...p},b),f=(y,m,C,b)=>{i.push(...g(y,C,"lower",b),...g(m,C,"upper",b))};return r!=null&&a!=null&&f(r,a,c,h),o!=null&&n!=null&&f(o,n,l,d),i}getPropertyDefinitions(t){return this.isStacked()?this.getStackPropertyDefinition(t):this.getUnstackPropertyDefinition(t)}onDataProcessed(t){this.dataModel=t.dataModel,this.processedData=t.processedData}getDomain(t){const{xLowerKey:i,xUpperKey:s,xErrorsID:o,yLowerKey:n,yUpperKey:r,yErrorsID:a}=this.getMaybeFlippedKeys();if(t===rM.X?os(i)&&os(s):os(n)&&os(r)){const{dataModel:c,processedData:d,cartesianSeries:h}=this;if(c!=null&&d!=null){const u={x:o,y:a}[t],p=c.getDomain(h,`${u}-lower`,"value",d),g=c.getDomain(h,`${u}-upper`,"value",d),f=[Math.min(...p,...g),Math.max(...p,...g)];return ose(f)}}return[]}onDataUpdate(t){this.dataModel=t.dataModel,this.processedData=t.processedData,os(t.dataModel)&&os(t.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const t=this.getNodeData(),i=this.cartesianSeries.axes[rM.X]?.scale,s=this.cartesianSeries.axes[rM.Y]?.scale;if(!(!i||!s||!t))for(let o=0;o<t.length;o++){const{midPoint:n,xLower:r,xUpper:a,yLower:l,yUpper:c}=this.getDatum(t,o);if(n!=null){let d,h;os(r)&&os(a)&&(d={lowerPoint:{x:this.convert(i,r),y:n.y},upperPoint:{x:this.convert(i,a),y:n.y}}),os(l)&&os(c)&&(h={lowerPoint:{x:n.x,y:this.convert(s,l)},upperPoint:{x:n.x,y:this.convert(s,c)}}),t[o].xBar=d,t[o].yBar=h}}}getMaybeFlippedKeys(){let{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:o}=this.properties,[n,r]=["xValue-errors","yValue-errors"];return this.cartesianSeries.shouldFlipXY()&&([t,s]=[s,t],[i,o]=[o,i],[n,r]=[r,n]),{xLowerKey:t,xUpperKey:i,xErrorsID:n,yLowerKey:s,yUpperKey:o,yErrorsID:r}}static getDatumKey(t,i,s){if(i==null)return;const o=t.datum[i];if(o!=null){if(typeof o!="number"){et.warnOnce(`Found [${i}] error value of type ${typeof o}. Expected number type`);return}return o+s}}getDatum(t,i){const{xLowerKey:s,xUpperKey:o,yLowerKey:n,yUpperKey:r}=this.getMaybeFlippedKeys(),a=t[i],l=a.cumulativeValue==null||!this.isStacked()?0:a.cumulativeValue-a.yValue,[c,d]=this.cartesianSeries.shouldFlipXY()?[l,0]:[0,l];return{midPoint:a.midPoint,xLower:Kg.getDatumKey(a,s,c),xUpper:Kg.getDatumKey(a,o,c),yLower:Kg.getDatumKey(a,n,d),yUpper:Kg.getDatumKey(a,r,d)}}convert(t,i){const s=(t.bandwidth??0)/2;return t.convert(i)+s}update(){const t=this.getNodeData();t!=null&&(this.selection.update(t),this.selection.each((i,s,o)=>this.updateNode(i,s,o)))}updateNode(t,i,s){t.datum=i,t.update(this.getDefaultStyle(),this.properties,!1),t.updateBBoxes()}pickNodeExact(t){const{x:i,y:s}=t,o=this.groupNode.pickNode(i,s);if(o!=null)return{datum:o.datum,distanceSquared:0}}pickNodeNearest(t){return this.groupNode.nearestSquared(t.x,t.y)}pickNodeMainAxisFirst(t){return this.groupNode.nearestSquared(t.x,t.y)}getTooltipParams(){const{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:o,xLowerName:n=t,xUpperName:r=i,yLowerName:a=s,yUpperName:l=o}=this.properties;return{xLowerKey:t,xLowerName:n,xUpperKey:i,xUpperName:r,yLowerKey:s,yLowerName:a,yUpperKey:o,yUpperName:l}}onToggleSeriesItem(t){this.groupNode.visible=t.visible}makeStyle(t){return{visible:t.visible,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity,cap:rse(this.properties.cap,t)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(t,i,s){const o=this.getNodeData();if(o!=null){for(let n=0;n<o.length;n++)if(t===o[n]){this.selection.at(n)?.update(i,this.properties,s);break}}}onHighlightChange(t){const{previousHighlight:i,currentHighlight:s}=t;s?.series===this.cartesianSeries&&this.restyleHighlightChange(s,this.getHighlightStyle(),!0),i?.series===this.cartesianSeries&&this.restyleHighlightChange(i,this.getDefaultStyle(),!1),this.groupNode.opacity=this.cartesianSeries.getOpacity()}errorBarFactory(){return new Jie}getWhiskerProperties(){const{stroke:t,strokeWidth:i,visible:s,strokeOpacity:o,lineDash:n,lineDashOffset:r}=this.properties;return{stroke:t,strokeWidth:i,visible:s,strokeOpacity:o,lineDash:n,lineDashOffset:r}}},cse={series:{errorBar:{visible:!0,stroke:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1,cap:{length:void 0,lengthRatio:void 0}}}},dse={type:"series-option",identifier:"error-bars",optionsKey:"errorBar",packageType:"enterprise",chartTypes:["cartesian"],seriesTypes:iD,moduleFactory:e=>new lse(e),themeTemplate:cse},{ZIndexMap:hse,ActionOnSet:use,Validate:uk,ProxyPropertyOnWrite:EH,OBJECT:pse,RATIO:gse,COLOR_STRING:fse}=L,dx=class extends L.Background{constructor(){super(...arguments),this.image=new pa,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new L.Group({name:"foreground",zIndex:hse.FOREGROUND})}onLayoutComplete(e){super.onLayoutComplete(e);const{width:t,height:i}=e.chart;let s={x:0,y:0,width:t,height:i};this.image&&(s=this.image.performLayout(t,i)),this.text&&this.updateTextNode(s)}onImageLoad(){this.ctx.updateService.update(L.ChartUpdateType.SCENE_RENDER)}updateTextNode(e){const{textNode:t}=this;t.fontWeight="bold",t.fontFamily="Impact, sans-serif",t.fontSize=19,t.opacity=.7,t.fill="#9b9b9b",t.textBaseline="top";const i=this.textNode.getBBox(),s=10;t.x=e.x+e.width/2-i.width/2,t.y=e.y+e.height+s}};v([uk(pse,{optional:!0}),use({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){this.node.removeChild(e.node),e.onLoad=void 0}})],dx.prototype,"image");v([uk(fse,{optional:!0}),EH("rectNode","fill")],dx.prototype,"fill");v([uk(gse,{optional:!0}),EH("rectNode","fillOpacity")],dx.prototype,"fillOpacity");var mse={type:"root",optionsKey:"foreground",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new dx(e)},{TranslatableGroup:yse,ScenePathChangeDetection:PH}=L,pk=class extends yse{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(e,t){const{cornerRadius:i,inset:s}=this,{x:o,y:n,width:r,height:a}=t;e.beginPath(),e.roundRect(o+s,n+s,r-2*s,a-2*s,i),e.clip()}};v([PH()],pk.prototype,"inset");v([PH()],pk.prototype,"cornerRadius");var{Validate:gk,BOOLEAN:vse,POSITIVE_NUMBER:NH,ZIndexMap:bd,ActionOnSet:OH,CategoryAxis:Cse,TextUtils:bse,Padding:Sse,Group:Sd,BBox:MN,ProxyProperty:FH}=L,fk=class{constructor(){this.top=0,this.bottom=0}};v([gk(NH)],fk.prototype,"top");v([gk(NH)],fk.prototype,"bottom");var Up=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.padding=new fk,this.root=new Sd({name:"root"}),this.seriesRoot=this.root.appendChild(new pk({name:"Series-root",zIndex:bd.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new Sd({name:"Axes-Grids",zIndex:bd.AXIS_GRID})),this.axisGroup=this.root.appendChild(new Sd({name:"Axes-Grids",zIndex:bd.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new Sd({name:"Axes-Labels",zIndex:bd.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new Sd({name:"Axes-Crosslines-Range",zIndex:bd.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new Sd({name:"Axes-Crosslines-Line",zIndex:bd.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new Sd({name:"Axes-Crosslines-Label",zIndex:bd.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.axes=[],this.series=[]}destroy(){this._destroyed||(this.destroySeries(this.series),this.axes.forEach(e=>e.destroy()),this.axes=[],this._destroyed=!0)}onSeriesChange(e,t){const i=t?.filter(s=>!e.includes(s))??[];this.destroySeries(i);for(const s of e){if(t?.includes(s))continue;s.attachSeries(this.seriesRoot,this.seriesRoot,void 0);const o=this;s.chart={get mode(){return"standalone"},get isMiniChart(){return!0},get seriesRect(){return o.seriesRect}},s.resetAnimation(this.miniChartAnimationPhase==="initial"?"initial":"disabled")}}destroySeries(e){e?.forEach(t=>{t.destroy(),t.detachSeries(this.seriesRoot,this.seriesRoot,void 0),t.chart=void 0})}assignSeriesToAxes(){this.axes.forEach(e=>{e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)})}assignAxesToSeries(){const e={};this.axes.forEach(t=>{const i=t.direction;(e[i]??(e[i]=[])).push(t)}),this.series.forEach(t=>{t.directions.forEach(i=>{const s=e[i];if(!s){et.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);return}const o=t.getKeys(i),n=this.findMatchingAxis(s,o);if(!n){et.warnOnce(`no matching axis for direction [${i}] and keys [${o}]; check series and axes configuration.`);return}t.axes[i]=n})})}findMatchingAxis(e,t){for(const i of e){if(!i.keys.length)return i;if(t){for(const s of t)if(i.keys.includes(s))return i}}}updateData(e){this.series.forEach(t=>t.setChartData(e)),this.miniChartAnimationPhase==="initial"&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready",this.series.forEach(t=>t.resetAnimation("disabled"))})}async processData(e){this.series.some(t=>t.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(t=>(t.resetDatumCallbackCache(),t.processData(e))));for(const t of this.axes)t.processData()}computeAxisPadding(){const e=new Sse;return this.enabled&&this.axes.forEach(({position:t,thickness:i,line:s,label:o})=>{if(t==null)return;let n;i?n=i:n=(s.enabled?s.width:0)+(o.enabled?bse.getLineHeight(o.fontSize??0)+o.spacing:0),e[t]=Math.ceil(n)}),e}async layout(e,t){const{padding:i}=this,s=this.seriesRect!=null,o=new MN(0,0,e,t-(i.top+i.bottom));this.seriesRect=o,this.seriesRoot.translationY=i.top,this.seriesRoot.setClipRectCanvasSpace(new MN(0,-i.top,e,t)),this.axes.forEach(n=>{const{position:r="left"}=n;switch(r){case"top":case"bottom":n.range=[0,o.width],n.gridLength=o.height;break;case"right":case"left":{const a=n instanceof Cse;n.range=a?[0,o.height]:[o.height,0],n.gridLength=o.width;break}}n.gridPadding=0,n.translation.x=0,n.translation.y=0,r==="right"?n.translation.x=e:r==="bottom"&&(n.translation.y=t),s||n.resetAnimation("initial"),n.calculateLayout(),n.update()}),await Promise.all(this.series.map(n=>n.update({seriesRect:o})))}};v([gk(vse)],Up.prototype,"enabled");v([FH(["seriesRoot","inset"])],Up.prototype,"inset");v([FH(["seriesRoot","cornerRadius"])],Up.prototype,"cornerRadius");v([OH({changeValue(e,t=[]){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(i),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i)}})],Up.prototype,"axes");v([OH({changeValue(e,t){this.onSeriesChange(e,t)}})],Up.prototype,"series");var{clamp:xse,SliderWidget:DN}=L,wse=class{constructor(e,t){this.ctx=e,this.sliderHandlers=t,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=e,this.toolbar=e.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[e.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[i,s]of["min","pan","max"].entries()){const o=this.sliders[i];o.step=DN.STEP_HUNDRETH,o.keyboardStep=DN.STEP_ONE,o.orientation="horizontal",o.setPreventsDefault(!1),o.addListener("drag-start",n=>this.onDragStart(i,n,s)),o.addListener("drag-move",n=>this.onDrag(o,n,s)),o.addListener("drag-end",()=>this.updateSliderRatios()),o.addListener("contextmenu",n=>this.onContextMenu(o,n))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(e){this.toolbar.setHidden(!e)}updateZoom(){const{_min:e,_max:t}=this;if(!(e==null||t==null))return this.ctx.zoomManager.updateZoom("navigator",{x:{min:e,max:t}})}updateBounds(e){this.toolbar.setBounds(e)}updateSliderBounds(e,t){this.sliders[e].setBounds(t)}updateMinMax(e,t){this._min=e,this._max=t,this.updateSliderRatios()}updateSliderRatios(){const{_min:e,_max:t}=this,i=this.ctx.localeManager.t("ariaValuePanRange",{min:e,max:t});this.sliders[0].setValueRatio(e),this.sliders[1].setValueRatio(e,{ariaValueText:i}),this.sliders[2].setValueRatio(t)}toCanvasOffsets(e){return{offsetX:this.dragStartX+e.originDeltaX}}moveToFront(e){if(e===1)return;const t=this.sliders[e],i=this.sliders[2-e];this.toolbar.moveChild(i,t.domIndex-1)}onDragStart(e,t,i){const s=this.sliders[e],o=this.toolbar.cssLeft(),n=s.cssLeft();this.dragStartX=o+n+t.offsetX,this.moveToFront(e),t.device==="touch"&&t.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(t))}onDrag(e,t,i){t.device==="touch"&&t.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(t))}onContextMenu(e,{sourceEvent:t,offsetX:i,offsetY:s}){const{x:o,y:n}=this.toolbar.getBounds(),{x:r,y:a}=e.getBounds(),l=i+o+r,c=s+n+a;this.ctx.contextMenuRegistry.dispatchContext("all",{sourceEvent:t,canvasX:l,canvasY:c},{})}onPanSliderChange(){const e=this.sliders[1].getValueRatio(),t=this._max-this._min;this._min=xse(0,e,1-t),this._max=this._min+t,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}},{Validate:hx,ScenePathChangeDetection:ux,POSITIVE_NUMBER:mk,BOOLEAN:Mse,BBox:Dse,ExtendedPath2D:Ase}=L,Mc=class extends L.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new Ase}setCenter(e,t){this.dirtyPath=!0,(this.centerX!==e||this.centerY!==t)&&(this.centerX=e,this.centerY=t,this.markDirty())}static align(e,t,i,s,o,n,r,a,l){const c=e.align(i+o*r)+l,d=c+e.align(i+o*r,o*(a-r))-2*l,h=e.align(s+n/2);e.setCenter(c,h),t.setCenter(d,h)}computeBBox(){const{centerX:e,centerY:t,width:i,height:s}=this,o=e-i/2,n=t-s/2;return new Dse(o,n,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}updatePath(){const{centerX:e,centerY:t,path:i,gripPath:s,strokeWidth:o,cornerRadius:n,grip:r}=this,a=o/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),s.clear();const c=Math.floor(this.width/2*l)/l,d=Math.floor(this.height/2*l)/l;i.roundRect(e-c+a,t-d+a,2*(c-a),2*(d-a),n);const h=3;if(r)for(let u=-.5;u<=.5;u+=1)for(let p=-1;p<=1;p+=1)s.arc(e+u*h,t+p*h,1,0,2*Math.PI),s.closePath()}renderFill(e,t){const{stroke:i}=this;super.renderFill(e,t),e.fillStyle=typeof i=="string"?i:"black",e.fill(this.gripPath.getPath2D())}};Mc.className="RangeHandle";v([hx(mk),ux()],Mc.prototype,"width");v([hx(mk),ux()],Mc.prototype,"height");v([hx(mk),ux()],Mc.prototype,"cornerRadius");v([hx(Mse),ux()],Mc.prototype,"grip");var{Path:Ise,BBox:Mg,ExtendedPath2D:Rse,clippedRoundRect:aM,POSITIVE_NUMBER:kse,Validate:Tse,ScenePathChangeDetection:Lse}=L,yk=class extends Ise{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new Rse}layout(e,t,i,s,o,n){o=isNaN(o)?this.min:o,n=isNaN(n)?this.max:n,(e!==this.x||t!==this.y||i!==this.width||this.height!==s||o!==this.min||n!==this.max)&&(this.x=e,this.y=t,this.width=i,this.height=s,this.min=o,this.max=n,this.dirtyPath=!0,this.markDirty())}computeBBox(){const{x:e,y:t,width:i,height:s}=this;return new Mg(e,t,i,s)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:s,min:o,max:n}=this,r=e+i*o,a=e+i*n;return new Mg(r,t,a-r,s)}updatePath(){const{path:e,visiblePath:t,x:i,y:s,width:o,height:n,min:r,max:a,strokeWidth:l,cornerRadius:c}=this,d=l/2;e.clear(),t.clear();const h=this.align(i)+d,u=this.align(s)+d,p=this.align(i,o)-2*d,g=this.align(s,n)-2*d,f=this.align(i+o*r)+d,y=f+this.align(i+o*r,o*(a-r))-2*d,m={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c};aM(e,h,u,p,g,m,new Mg(h,u,f-h,g)),aM(e,h,u,p,g,m,new Mg(y,u,p+h-y,g)),y-f>1&&aM(t,h,u,p,g,m,new Mg(f,u,y-f,g))}renderStroke(e,t){super.renderStroke(e,t),super.renderStroke(e,this.visiblePath.getPath2D())}};yk.className="RangeMask";v([Tse(kse),Lse()],yk.prototype,"cornerRadius");var Ese=class extends L.Group{constructor(e){super({name:"rangeSelectorGroup",zIndex:L.ZIndexMap.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new L.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(e)}layout(e,t,i,s,o,n){this.x=e,this.y=t,this.width=i,this.height=s,this.lOffset=o,this.rOffset=n,this.background.translationX=e,this.background.translationY=t,this.markDirty()}updateBackground(e,t){e!=null&&this.background.removeChild(e),t!=null&&this.background.appendChild(t),this.markDirty()}computeBBox(){const{x:e,y:t,width:i,height:s,lOffset:o,rOffset:n}=this;return new L.BBox(e-o,t,i+(o+n),s)}},{clamp:lM,BaseModuleInstance:Pse,ObserveChanges:vk,Validate:px,BOOLEAN:Nse,POSITIVE_NUMBER:Ck}=L,Kp=class extends Pse{constructor(e){super(),this.ctx=e,this.enabled=!1,this.mask=new yk,this.minHandle=new Mc,this.maxHandle=new Mc,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(t,i)=>({x:t,y:i})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new Ese([this.mask,this.minHandle,this.maxHandle]),this.destroyFns.push(e.scene.attachNode(this.rangeSelector),this.ctx.localeManager.addListener("locale-changed",()=>this.updateZoom()),this.ctx.layoutManager.registerElement(L.LayoutElement.Navigator,t=>this.onLayoutStart(t)),this.ctx.layoutManager.addListener("layout:complete",t=>this.onLayoutComplete(t)),e.zoomManager.addListener("zoom-change",t=>this.onZoomChange(t))),this.domProxy=new wse(e,this),this.updateGroupVisibility(),this.miniChart=new Up(e)}updateBackground(e,t){this.rangeSelector?.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;this.rangeSelector==null||e===this.rangeSelector.visible||(this.rangeSelector.visible=e,this.domProxy.updateVisibility(e),e?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}onLayoutStart(e){if(this.enabled){const{layoutBox:t}=e,i=this.height+this.spacing;t.shrink(i,"bottom"),this.y=t.y+t.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:t,bottom:i}=this.miniChart.computeAxisPadding();e.layoutBox.shrink(t+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(e){const{x:t,width:i}=e.series.rect,{y:s,height:o}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:n,_max:r}=this.domProxy;this.layoutNodes(t,s,i,o,n,r),this.domProxy.updateBounds({x:t,y:s,width:i,height:o})}this.x=t,this.width=i,this.miniChart?.layout(i,o).catch(n=>et.error(n))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(L.InteractionState.ZoomDraggable)}onDragStart(e,{offsetX:t}){this.canDrag()&&(e==="pan"&&(this.panStart=(t-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(e,{offsetX:t}){if(!this.canDrag())return;const{panStart:i,x:s,width:o}=this,{minRange:n}=this.domProxy;let{_min:r,_max:a}=this.domProxy;const l=(t-s)/o;if(e==="min")r=lM(0,l,a-n);else if(e==="max")a=lM(r+n,l,1);else if(e==="pan"&&i!=null){const c=a-r;r=lM(0,l-i,1-c),a=r+c}this.domProxy._min=r,this.domProxy._max=a,this.updateZoom()}onZoomChange(e){const{x:t}=e;if(!t)return;const{x:i,y:s,width:o,height:n}=this,{min:r,max:a}=t;this.domProxy.updateMinMax(r,a),this.layoutNodes(i,s,o,n,r,a)}layoutNodes(e,t,i,s,o,n){const{rangeSelector:r,mask:a,minHandle:l,maxHandle:c}=this;a.layout(e,t,i,s,o,n),r.layout(e,t,i,s,l.width/2,c.width/2),Mc.align(l,c,e,t,i,s,o,n,a.strokeWidth/2),o+(n-o)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3),[l,this.maskVisibleRange,c].forEach((d,h)=>{const u=d.getBBox(),p={x:u.x-e,y:u.y-t,height:u.height,width:u.width};this.domProxy.updateSliderBounds(h,p)})}updateZoom(){this.enabled&&this.domProxy.updateZoom()}updateData(e){return this.miniChart?.updateData(e)}async processData(e){if(this.miniChart)return this.miniChart?.processData(e)}};v([vk((e,t,i)=>{e.updateBackground(i?.root,t?.root)})],Kp.prototype,"miniChart");v([px(Nse),vk((e,t)=>{e.ctx.zoomManager.setNavigatorEnabled(!!t),e.updateGroupVisibility()})],Kp.prototype,"enabled");v([px(Ck)],Kp.prototype,"height");v([px(Ck),vk((e,t)=>{e.mask.cornerRadius=t})],Kp.prototype,"cornerRadius");v([px(Ck)],Kp.prototype,"spacing");var Ose={type:"root",optionsKey:"navigator",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Kp(e),removable:!1,themeTemplate:{navigator:{enabled:!1,height:18,cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:[L.FONT_SIZE_RATIO.SMALLER]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0}}}}},{AND:Fse,ARRAY:AN,FUNCTION:Bse,NUMBER:Gse,OR:_se,ToolbarButtonProperties:zse,Validate:Vse}=L,BH=class extends zse{};v([Vse(_se(Gse,Fse(AN,AN.restrict({length:2})),Bse))],BH.prototype,"value");var{BOOLEAN:Hse,OBJECT:Wse,ChartAxisDirection:cM,LayoutElement:jse,PropertiesArray:Use,Toolbar:Kse,Validate:GH}=L,bk=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.buttons=new Use(BH),this.verticalSpacing=10,this.container=e.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new Kse(this.ctx.localeManager),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),e.layoutManager.registerElement(jse.ToolbarBottom,this.onLayoutStart.bind(this)),e.zoomManager.addListener("zoom-change",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.container.removeChild(this.toolbar.getElement()),this.toolbar.destroy()}onLayoutStart(e){const{buttons:t,ctx:i,enabled:s,toolbar:o,verticalSpacing:n}=this,{layoutBox:r}=e;if(!s||!i.zoomManager.isZoomEnabled()){o.setHidden(!0);return}o.setHidden(!1),o.updateButtons(t);const a=o.getBounds().height;o.setBounds({x:r.x,y:r.y+r.height-a,width:r.width,height:a}),r.shrink({bottom:a+n})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:e}}){const{zoomManager:t}=this.ctx,i=this.buttons.at(e);if(!i)return;const{value:s}=i;typeof s=="number"?t.extendToEnd("zoom-buttons",cM.X,s):Array.isArray(s)?t.updateWith("zoom-buttons",cM.X,()=>s):typeof s=="function"&&t.updateWith("zoom-buttons",cM.X,s),this.toolbar.toggleActiveButtonByIndex(e)}};v([GH(Hse)],bk.prototype,"enabled");v([GH(Wse)],bk.prototype,"buttons");var _H=1e3*60*60*24,dM=_H*30,$se=_H*365,Yse={type:"root",optionsKey:"ranges",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new bk(e),themeTemplate:{ranges:{enabled:!1,buttons:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:dM},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*dM},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*dM},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),t]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:$se},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:(e,t)=>[e,t]}]}}},zH=class $g extends L.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(t){return this.sharedToolbar||this.createSharedToolbar(),this.toolbarWithSection(t)}createSharedToolbar(){this.sharedToolbar=new L.Toolbar(this.ctx.localeManager,"vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.destroyFns.push(()=>{this.sharedToolbar&&(this.container.removeChild(this.sharedToolbar.getElement()),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(t){const i=this.sharedToolbar,s={layout:(o,n)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==t&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=t;const r=i.getBounds().width;i.setBounds({x:o.x,y:o.y,width:r}),o.shrink({left:r+i.horizontalSpacing+(n??0)})},addToolbarListener:(o,n)=>i.addToolbarListener(o,r=>{const a=this.getSectionIndex(t,r.button.index);if(a<0)return;const l={...r,button:this.sectionButtons[t][a]};n(l)}),updateButtons:o=>{this.sectionButtons[t]=o;const n=$g.SECTION_ORDER.flatMap(r=>this.sectionButtons[r]);i.updateButtons(n)},updateButtonByIndex:(o,n)=>{i.updateButtonByIndex(this.getIndex(t,o),n)},toggleActiveButtonByIndex:o=>{i.toggleActiveButtonByIndex(this.getIndex(t,o))},toggleButtonEnabledByIndex:(o,n)=>{i.toggleButtonEnabledByIndex(this.getIndex(t,o),n)},setHidden:o=>{o?this.activeSections.delete(t):this.activeSections.add(t);let n=0;for(const r of $g.SECTION_ORDER){if(r!==t){n+=this.sectionButtons[r].length;continue}for(const a of this.sectionButtons[t].keys())i.setButtonHiddenByIndex(n+a,o)}},destroy:()=>{s.setHidden(!0),this.activeSections.size===0&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return s.setHidden(!1),s}getIndex(t,i){let s=0;for(const o of $g.SECTION_ORDER){if(o===t)return s+i;s+=this.sectionButtons[o].length}return-1}getSectionIndex(t,i){let s=0;for(const o of $g.SECTION_ORDER){if(o===t)return i>=s+this.sectionButtons[t].length?-1:i-s;s+=this.sectionButtons[o].length}return-1}};zH.SECTION_ORDER=["chartToolbar","annotations"];var Xse=zH,Zse={type:"context",contextKey:"sharedToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Xse(e)},{CachedTextMeasurerPool:Dg,ZIndexMap:qse,LayoutElement:Qse,Validate:to,BaseProperties:Jse,OBJECT:$p,BOOLEAN:eoe,STRING:Yp,COLOR_STRING:toe,RATIO:ioe,valueProperty:soe,TextUtils:ooe,Group:noe,Label:Ag,Rect:roe,Text:Hi}=L,IN={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},aoe={up:"positive",down:"negative"},loe={hlc:"altNeutral"},Sk=class extends Jse{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};v([to(toe)],Sk.prototype,"fill");v([to(ioe)],Sk.prototype,"fillOpacity");var ko=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new Ag,this.positive=new Ag,this.negative=new Ag,this.neutral=new Ag,this.altNeutral=new Ag,this.background=new Sk,this.layoutStyle="block",this.id="status-bar",this.data=void 0,this.layer=new noe({name:"StatusBar",zIndex:qse.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new L.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new roe),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=e.highlightManager,this.labelGroup.visible=!1,this.destroyFns.push(e.scene.attachNode(this.layer),e.layoutManager.registerElement(Qse.Overlay,t=>this.startPerformLayout(t)),e.layoutManager.addListener("layout:complete",t=>this.onLayoutComplete(t)),e.highlightManager.addListener("highlight-change",()=>this.updateHighlight()))}async processData(e){if(!this.enabled||this.data==null)return;const t=[];for(const o of this.labels){const{id:n,key:r}=o,a=this[r];a==null?o.domain=void 0:t.push(soe(a,"number",{id:n}))}if(t.length===0)return;const{processedData:i,dataModel:s}=await e.request(this.id,this.data,{props:t});for(const o of this.labels){const{id:n,key:r}=o;this[r]!=null&&(o.domain=s.getDomain(this,n,"value",i))}}startPerformLayout(e){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled)return;const{layoutBox:t}=e,i=4,s=12,o=0,n=8;this.labelGroup.translationY=t.y+o;const r=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),a=ooe.getLineHeight(r),l=IN[this.getChartType()]??0;let c=0,d,h="alphabetic";if(this.layoutStyle==="block")t.shrink(o+a+n,"top"),d=r+(a-r)/2;else{const{title:u}=this.ctx.chartService;if(h="top",d=o+u.padding,u.enabled){const p=u.node.getBBox();c=p.x+p.width+s}else c=u.padding}for(const{label:u,configuration:p,title:g,value:f,domain:y,formatter:m}of this.labels){if(y==null||(l&p)===0){g.visible=!1,f.visible=!1;continue}const C=Math.max(Dg.measureText(m.format(y[0]),{font:this.positive.getFont(),textBaseline:h,textAlign:"left"}).width,Dg.measureText(m.format(y[1]),{font:this.positive.getFont(),textBaseline:h,textAlign:"left"}).width,Dg.measureText(m.format(y[0]),{font:this.negative.getFont(),textBaseline:h,textAlign:"left"}).width,Dg.measureText(m.format(y[1]),{font:this.negative.getFont(),textBaseline:h,textAlign:"left"}).width);g.visible=!0,f.visible=!0;const b=Dg.measureText(u,{font:this.title.getFont(),textBaseline:h,textAlign:"left"});g.setFont(this.title),g.fill=this.title.color,g.text=u,g.textBaseline=h,g.y=d,g.x=c,c+=b.width+i,f.textBaseline=h,f.y=d,f.x=c,c+=C+s}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=c-s,this.backgroundNode.height=a+o+n,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(e){this.labelGroup.translationX=e.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const e=this.highlightManager.getActiveHighlight(),t=e?.datum??this.data?.at(-1);if(t==null){this.labelGroup.visible=!1;return}this.labelGroup.visible=!0;const i=e?.itemId;let s=i!=null?aoe[i]:void 0;s==null&&this.openKey!=null&&this.closeKey!=null&&(t[this.openKey]<t[this.closeKey]?s="positive":s="negative");for(const{domain:o,value:n,key:r,formatter:a,style:l}of this.labels){if(o==null)continue;let c=l??s??"neutral";c==="neutral"&&(c=loe[this.getChartType()]??c);const d=this[r],h=d!=null?t?.[d]:void 0;n.setFont(this[c]),n.fill=this[c].color,n.text=typeof h=="number"?a.format(h):""}}getChartType(){let e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return(e==null||IN[e]==null)&&(e="candlestick"),e}};v([to(eoe)],ko.prototype,"enabled");v([to(Yp,{optional:!0})],ko.prototype,"openKey");v([to(Yp,{optional:!0})],ko.prototype,"highKey");v([to(Yp,{optional:!0})],ko.prototype,"lowKey");v([to(Yp,{optional:!0})],ko.prototype,"closeKey");v([to(Yp,{optional:!0})],ko.prototype,"volumeKey");v([to($p)],ko.prototype,"title");v([to($p)],ko.prototype,"positive");v([to($p)],ko.prototype,"negative");v([to($p)],ko.prototype,"neutral");v([to($p)],ko.prototype,"altNeutral");v([to($p)],ko.prototype,"background");v([to(Yp)],ko.prototype,"layoutStyle");var coe={type:"root",identifier:"status-bar",optionsKey:"statusBar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new ko(e),themeTemplate:{statusBar:{enabled:!1,layoutStyle:L.ThemeSymbols.DEFAULT_CAPTION_LAYOUT_STYLE,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:L.ThemeSymbols.PALETTE_UP_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:L.ThemeSymbols.PALETTE_DOWN_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:L.ThemeSymbols.PALETTE_NEUTRAL_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"backgroundColor"},fillOpacity:.5},altNeutral:{color:"gray"}}}},{BOOLEAN:xk,STRING:doe,UNION:hoe,BaseProperties:uoe,CartesianAxis:RN,ChartUpdateType:kN,ObserveChanges:sy,TooltipManager:poe,Validate:oy}=L,Lh=class extends uoe{constructor(e){super(),this.moduleContext=e,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0}updateSiblings(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(e??this.groupId))this.updateChart(i)}updateChart(e,t=kN.UPDATE_DATA){e.ctx.updateService.update(t,{skipSync:!0})}enabledZoomSync(){const{syncManager:e,zoomManager:t}=this.moduleContext;this.disableZoomSync=t.addListener("zoom-change",()=>{for(const i of e.getGroupSiblings(this.groupId))i.modulesManager.getModule("sync")?.zoom&&i.ctx.zoomManager.updateZoom("sync",this.mergeZoom(i))})}enabledNodeInteractionSync(){const{highlightManager:e,syncManager:t}=this.moduleContext;this.disableNodeInteractionSync=e.addListener("highlight-change",i=>{for(const s of t.getGroupSiblings(this.groupId))if(s.modulesManager.getModule("sync")?.nodeInteraction){if(!i.currentHighlight?.datum){s.ctx.highlightManager.updateHighlight(s.id),s.ctx.tooltipManager.removeTooltip(s.id);continue}for(const o of s.axes){const n=this.axes==="xy"?"x":this.axes;if(!RN.is(o)||o.direction!==n)continue;const r=s.series.map(a=>{const l=a.getKeys(o.direction);if(o.keys.length&&!o.keys.some(g=>l.includes(g)))return;const{nodeData:c}=a.contextNodeData;if(!c?.length)return;const d=c[0][`${o.direction}Key`];let h=i.currentHighlight.datum[d];const u=jf(h);u&&(h=h.getTime());const p=c.find(g=>{const f=g.datum[d];return u?f.getTime()===h:f===h});return p?{series:a,nodeDatum:p}:null}).filter(os);if(r.length<2&&r[0]?.nodeDatum!==s.ctx.highlightManager.getActiveHighlight()){const{series:a,nodeDatum:l}=r[0]??{};if(s.ctx.highlightManager.updateHighlight(s.id,l),l){const c=l.midPoint?.x??l.point?.x??0,d=l.midPoint?.y??l.point?.y??0,h=poe.makeTooltipMeta({type:"pointermove",canvasX:c,canvasY:d},a,l);delete h.lastPointerEvent,s.ctx.tooltipManager.updateTooltip(s.id,h,a.getTooltipContent(l))}else s.ctx.tooltipManager.removeTooltip(s.id);this.updateChart(s,kN.SERIES_UPDATE)}}}})}getSyncedDomain(e){if(!RN.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{syncManager:t}=this.moduleContext,i=t.getGroup(this.groupId),[{axes:s}]=i,{direction:o,min:n,max:r,nice:a,reverse:l}=e;for(const c of s)if(o===c.direction&&(a!==c.nice||l!==c.reverse||n!==c.min&&(gc(n)||gc(c.min))||r!==c.max&&(gc(r)||gc(c.max)))){et.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),this.enabled=!1;return}return oQ(i.flatMap(c=>c.series).filter(c=>{if(c.visible){const d=c.getKeys(e.direction);return e.keys.length?e.keys.some(h=>d.includes(h)):!0}}).flatMap(c=>c.getDomain(e.direction)))}mergeZoom(e){const{zoomManager:t}=this.moduleContext;if(this.axes==="xy")return t.getZoom();const i=e.ctx.zoomManager.getZoom()??{};return i[this.axes]=t.getZoom()?.[this.axes],i}onEnabledChange(){const{syncManager:e}=this.moduleContext;this.enabled?e.subscribe(this.groupId):e.unsubscribe(this.groupId),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(e,t){if(!this.enabled||e===t)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(t),i.subscribe(e),this.updateSiblings(t),this.updateSiblings(e)}onAxesChange(){if(!this.enabled)return;const{syncManager:e}=this.moduleContext;this.updateChart(e.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:e}=this.moduleContext;e.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};Lh.className="Sync";v([oy(xk),sy(e=>e.onEnabledChange())],Lh.prototype,"enabled");v([oy(doe,{optional:!0}),sy((e,t,i)=>e.onGroupIdChange(t,i))],Lh.prototype,"groupId");v([oy(hoe(["x","y","xy"],"an axis")),sy(e=>e.onAxesChange())],Lh.prototype,"axes");v([oy(xk),sy(e=>e.onNodeInteractionChange())],Lh.prototype,"nodeInteraction");v([oy(xk),sy(e=>e.onZoomChange())],Lh.prototype,"zoom");var goe={type:"root",optionsKey:"sync",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Lh(e),themeTemplate:{sync:{enabled:!1}}},{COLOR_STRING:foe,RATIO:moe,Validate:VH}=L,TN="#2196f3",yoe="#8a8a8a",gx=class extends L.Rect{constructor(){super(...arguments),this.fill=TN,this.fillOpacity=.2,this.zIndex=L.ZIndexMap.ZOOM_SELECTION}updateValid(){this.fill=TN}updateInvalid(){this.fill=yoe}};gx.className="ZoomRect";v([VH(foe)],gx.prototype,"fill");v([VH(moe)],gx.prototype,"fillOpacity");var{UNION:voe,clamp:Coe,isNumberEqual:LN,round:bNe}=L,gt={min:0,max:1},HH="end",WH="middle",fx=voe(["pointer","start","middle","end"],"an anchor point"),bv=(e,t=gt.min,i=gt.max)=>Coe(t,e,i);function wk(){return{x:{...gt},y:{...gt}}}function as(e){return e.x.max-e.x.min}function wn(e){return e.y.max-e.y.min}function EN(e,t,i=1e-10){return LN(e.min,t.min,i)&&LN(e.max,t.max,i)}function df(e,t,i){return EN(e.x,t.x,i)&&EN(e.y,t.y,i)}function xs(e){return{x:{min:e?.x?.min??gt.min,max:e?.x?.max??gt.max},y:{min:e?.y?.min??gt.min,max:e?.y?.max??gt.max}}}function ol(e,t,i){if(!e)return{x:0,y:0};const s=bv(t-e.x,0,e.x+e.width),o=bv(i-e.y,0,e.y+e.height),n=1/e.width*s,r=1-1/e.height*o;return{x:bv(n),y:bv(r)}}function ah(e,t,i){return{x:{min:e.x.min+t,max:e.x.max+t},y:{min:e.y.min+i,max:e.y.max+i}}}function jH(e,t,i){return{x:{min:e.x.min,max:e.x.min+as(e)*t},y:{min:e.y.min,max:e.y.min+wn(e)*i}}}function PN(e,t,i){const s=as(e),o=wn(e),n=e.x.min+s/2,r=e.y.min+o/2;return{x:{min:n-s*t/2,max:n+s*t/2},y:{min:r-o*i/2,max:r+o*i/2}}}function Zn(e,t,i,s){const{min:o,max:n}=t,r=o+(n-o)/2,a=e.max-e.min;switch(i){case"start":return{min:o,max:t.min+a};case"end":return{min:t.max-a,max:n};case"middle":return{min:r-a/2,max:r+a/2};case"pointer":return boe(e,t,s??r);default:return{min:o,max:n}}}function boe(e,t,i){const s=e.max-e.min,o=t.max-t.min,n=i*(1-(o-s)),r=i-n,a=e.min+r,l=e.max+r;return{min:a,max:l}}function Soe(e,t,i){return{x:{min:e.x.min*t,max:e.x.max*t},y:{min:e.y.min*i,max:e.y.max*i}}}function Dn(e){return{x:rb(e.x),y:rb(e.y)}}function rb(e){const t=e.max-e.min;let i=e.max>gt.max?gt.max-t:e.min,s=e.min<gt.min?t:e.max;return i=Math.max(gt.min,i),s=Math.min(gt.max,s),{min:i,max:s}}var xoe=class{update(e,t,i,s,o,n){return this.oldZoom??(this.oldZoom=xs(t===L.ChartAxisDirection.X?{...o,x:n}:{...o,y:n})),this.updateCoords(e.currentX,e.currentY),this.updateZoom(t,i,s)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(e,t){this.coords?(this.coords.x2=e,this.coords.y2=t):this.coords={x1:e,y1:t,x2:e,y2:t}}updateZoom(e,t,i){const{coords:s,oldZoom:o}=this;let n=xs(o);if(!s||!o)return e===L.ChartAxisDirection.X?n.x:n.y;const r=ol(i,s.x1,s.y1),a=ol(i,s.x2,s.y2);if(e===L.ChartAxisDirection.X){const c=(a.x-r.x)*as(o);return n.x.max+=c,n.x=Zn(n.x,o.x,t,r.x),n=Dn(n),n.x}const l=(a.y-r.y)*wn(o);return n.y.max-=l,n.y=Zn(n.y,o.y,t,r.y),n=Dn(n),n.y}},woe="zoom-action",Moe="pan-action",Doe=class{constructor(e,t,i,s,o,n){this.contextMenuRegistry=e,this.zoomManager=t,this.getModuleProperties=i,this.getRect=s,this.updateZoom=o,this.isZoomValid=n}registerActions(e){if(!e)return;const{contextMenuRegistry:t}=this,i=t.registerDefaultAction({id:woe,type:"series-area",label:"contextMenuZoomToCursor",action:this.onZoomToHere.bind(this),toggleEnabledOnShow:o=>{const n=this.getRect();if(!n)return!0;const r=ol(n,o.x,o.y);return this.iterateFindNextZoomAtPoint(r)!=null}}),s=t.registerDefaultAction({id:Moe,type:"series-area",label:"contextMenuPanToCursor",action:this.onPanToHere.bind(this),toggleEnabledOnShow:()=>!df(xs(this.zoomManager.getZoom()),wk())});return()=>{i(),s()}}computeOrigin(e){const t=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!t||!e?.target||!(e instanceof MouseEvent))return;const s={x:0,y:0,width:t.width,height:t.height};return ol(s,e.offsetX,e.offsetY)}onZoomToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=this.iterateFindNextZoomAtPoint(t);i!=null&&this.updateZoom(i)}onPanToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=xs(this.zoomManager.getZoom()),s=as(i),o=wn(i),n=t.x*s,r=t.y*o,a=(gt.max-gt.min)/2;let l={x:{min:t.x-a,max:t.x+a},y:{min:t.y-a,max:t.y+a}};l=PN(l,s,o),l=ah(l,i.x.min-t.x+n,i.y.min-t.y+r),this.updateZoom(Dn(l))}iterateFindNextZoomAtPoint(e){const{scrollingStep:t}=this.getModuleProperties();for(let i=t;i<=1-t;i+=t){const s=this.getNextZoomAtPoint(e,i);if(this.isZoomValid(s))return s}}getNextZoomAtPoint(e,t){const{isScalingX:i,isScalingY:s}=this.getModuleProperties(),o=xs(this.zoomManager.getZoom()),n=e.x*as(o),r=e.y*wn(o),a=gt.max-gt.min,l=a/2;let c={x:{min:e.x-l,max:e.x+l},y:{min:e.y-l,max:e.y+l}};return c=PN(c,i?as(o)*t:a,s?wn(o)*t:a),c=ah(c,o.x.min-e.x+n,o.y.min-e.y+r),Dn(c)}},{BBoxValues:Aoe}=L,Ioe=class{constructor(e){this.axesHandlers=e,this.axes=[]}initAxis(e,t,i,s){const{X:o,Y:n}=L.ChartAxisDirection,r={[o]:"ew-resize",[n]:"ns-resize"}[s],l=e.proxyInteractionService.createProxyElement({type:"region",domManagerId:t,where:"afterend"});return l.setCursor(r),l.addListener("drag-start",c=>{c.device==="touch"&&c.sourceEvent.preventDefault(),i.onDragStart(t,s)}),l.addListener("drag-move",c=>i.onDrag(c)),l.addListener("drag-end",i.onDragEnd),l.addListener("dblclick",()=>i.onDoubleClick(t,s)),{axisId:t,div:l}}destroy(){this.axes.forEach(e=>e.div.destroy())}update(e,t){if(this.axes.forEach(a=>a.div.setHidden(!e)),!e)return;const{X:i,Y:s}=L.ChartAxisDirection,o=[...t.axisManager.getAxisContext(i),...t.axisManager.getAxisContext(s)],{removed:n,added:r}=this.diffAxisIds(o);n.length>0&&(this.axes=this.axes.filter(a=>n.includes(a.axisId)?(a.div.destroy(),!1):!0));for(const a of r){const{axisId:l,direction:c}=a;this.axes.push(this.initAxis(t,l,this.axesHandlers,c))}for(const a of this.axes){const c=o.filter(d=>d.axisId===a.axisId)[0].getCanvasBounds();a.div.setHidden(Aoe.isEmpty(c)),c!==void 0&&a.div.setBounds(c)}}diffAxisIds(e){const t=this.axes.map(n=>n.axisId),i=e.map(n=>n.axisId),s=t.filter(n=>!i.includes(n)),o=e.filter(n=>!t.includes(n.axisId));return{removed:s,added:o}}},NN=16,Roe={off:1,short:.01,long:.002},koe=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:e}=this;return Math.max(typeof e=="number"?e:Roe[e]??1,1e-4)}addListener(e,t){return this.onUpdate=t,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(e){this.updateCoords(e.currentX,e.currentY);const{x1:t=0,y1:i=0,x2:s=0,y2:o=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:t-s,deltaY:i-o})}start(){this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:e}=this;let t=0,i=0,s=0;if(e.length>0){const o=this.zoomCoordsHistoryIndex%NN;let n=o-1;n<0&&(n=e.length-1);let r=o;r>=e.length&&(r=0);const a=e[n],l=e[r];t=a.x-l.x,i=a.y-l.y,s=a.t-l.t}if(this.coords=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,s>0&&this.decelerationValue<1){const o=t/s,n=i/s,r=Math.hypot(o,n),a=Math.atan2(n,o),l=performance.now();this.inertiaHandle=L.getWindow().requestAnimationFrame(c=>{this.animateInertia(c,c,l,r,a)})}}recordCurrentZoomCoords(){const{coords:e,coordsHistory:t,zoomCoordsHistoryIndex:i}=this;if(!e)return;const{x2:s,y2:o}=e,n=Date.now();t[i%NN]={x:s,y:o,t:n},this.zoomCoordsHistoryIndex+=1}animateInertia(e,t,i,s,o){const n=1-this.decelerationValue,r=-s/Math.log(n),a=s*(n**(t-i)-1)/Math.log(n),l=s*(n**(e-i)-1)/Math.log(n);this.onUpdate?.({type:"update",deltaX:-Math.cos(o)*(l-a),deltaY:-Math.sin(o)*(l-a)}),!(l>=r-1)&&(this.inertiaHandle=requestAnimationFrame(c=>{this.animateInertia(c,e,i,s,o)}))}updateCoords(e,t){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:e,y2:t}:this.coords={x1:e,y1:t,x2:e,y2:t}}translateZooms(e,t,i,s){const o=ol(e,e.x+Math.abs(i),e.y+e.height-Math.abs(s)),n=Math.sign(i)*o.x,r=-Math.sign(s)*o.y,a={};for(const[l,{direction:c,zoom:d}]of Object.entries(t)){if(d&&d.min===gt.min&&d.max===gt.max)continue;let h=xs({[c]:d});h=Dn(ah(h,n*as(h),r*wn(h))),a[l]={direction:c,zoom:h[c]}}return a}},Toe=200,Loe=class{update(e,t,i,s){const o=e.deltaX*t*Toe;return this.translateZooms(i,s,o)}translateZooms(e,t,i){const s={},o=ol(e,e.x+Math.abs(i),0),n=i<0?-o.x:o.x;for(const[r,{direction:a,zoom:l}]of Object.entries(t)){if(a!==L.ChartAxisDirection.X)continue;let c=xs({x:l});c=Dn(ah(c,n*as(c),0)),s[r]={direction:a,zoom:c.x}}return s}},Eoe=class{updateAxes(e,t,i,s){const o=e.sourceEvent,n={},{anchorPointX:r,anchorPointY:a,isScalingX:l,isScalingY:c,scrollingStep:d}=t,h=ol(i,o.offsetX??o.clientX,o.offsetY??o.clientY);for(const[u,{direction:p,zoom:g}]of Object.entries(s)){if(g==null)continue;let f={...g};const y=d*e.deltaY*(g.max-g.min);if(p===L.ChartAxisDirection.X&&l)f.max+=y,f=Zn(f,g,r,h.x);else if(p===L.ChartAxisDirection.Y&&c)f.max+=y,f=Zn(f,g,a,h.y);else continue;n[u]={direction:p,zoom:rb(f)}}return n}update(e,t,i,s){const{anchorPointX:o,anchorPointY:n,isScalingX:r,isScalingY:a,scrollingStep:l}=t,c=e.offsetX+i.x,d=e.offsetY+i.y,h=ol(i,c,d),u=e.deltaY;let p=xs(s);return p.x.max+=r?l*u*as(s):0,p.y.max+=a?l*u*wn(s):0,r&&(p.x=Zn(p.x,s.x,o,h.x)),a&&(p.y=Zn(p.y,s.y,n,h.y)),p=Dn(p),p}updateDelta(e,t,i){const{anchorPointX:s,anchorPointY:o,isScalingX:n,isScalingY:r,scrollingStep:a}=t;let l=xs(i);return l.x.max+=n?a*-e*as(i):0,l.y.max+=r?a*-e*wn(i):0,n&&(l.x=Zn(l.x,i.x,s)),r&&(l.y=Zn(l.y,i.y,o)),l=Dn(l),l}},Poe=class{constructor(e,t,i){this.rect=e,this.getZoom=t,this.isZoomValid=i,this.rect.visible=!1}update(e,t,i){const s=e.currentX+(i?.x??0),o=e.currentY+(i?.y??0);this.rect.visible=!0,this.updateCoords(s,o,t,i),this.updateRect(i)}stop(e,t,i){let s=xs();if(!e||!t)return s;this.coords&&(s=this.createZoomFromCoords(t,i));const o=t.width/e.width,n=t.height/e.height;return s=Dn(Soe(s,o,n)),this.reset(),s}reset(){this.coords=void 0,this.rect.visible=!1}didUpdate(){return this.rect.visible&&this.rect.width>0&&this.rect.height>0}updateCoords(e,t,i,s){if(!this.coords){this.coords={x1:e,y1:t,x2:e,y2:t};return}const{coords:o}=this;if(o.x2=e,o.y2=t,!s)return;const{isScalingX:n,isScalingY:r,keepAspectRatio:a}=i,l=this.getNormalisedDimensions();if(a&&n&&r){const c=s.width/s.height;o.y2<o.y1?o.y2=Math.min(o.y1-l.width/c,o.y1):o.y2=Math.max(o.y1+l.width/c,o.y1)}n||(o.x1=s.x,o.x2=s.x+s.width),r||(o.y1=s.y,o.y2=s.y+s.height)}updateRect(e){if(!e)return;const{rect:t}=this,i=this.getNormalisedDimensions(),{width:s,height:o}=i;let{x:n,y:r}=i;n=Math.max(n,e.x),n-=Math.max(0,n+s-(e.x+e.width)),r=Math.max(r,e.y),r-=Math.max(0,r+o-(e.y+e.height)),t.x=n,t.y=r,t.width=s,t.height=o;const a=this.createZoomFromCoords(e,this.getZoom());this.isZoomValid(a)?t.updateValid():t.updateInvalid()}createZoomFromCoords(e,t){const i=xs(t),s=this.getNormalisedDimensions(),o=ol(e,s.x,s.y+s.height),n=s.width/e.width,r=s.height/e.height;let a=jH(i,n,r);const l=o.x*as(i),c=o.y*wn(i);return a=ah(a,l,c),a=Dn(a),a}getNormalisedDimensions(){const{x1:e=0,y1:t=0,x2:i=0,y2:s=0}=this.coords??{},o=e<=i?e:i,n=t<=s?t:s,r=e<=i?i-e:e-i,a=t<=s?s-t:t-s;return{x:o,y:n,width:r,height:a}}},{ARRAY:Noe,BOOLEAN:Ooe,STRING:Foe,UNION:UH,ActionOnSet:KH,BaseProperties:Boe,ChartAxisDirection:Goe,NativeWidget:_oe,PropertiesArray:zoe,Toolbar:Voe,ToolbarButtonProperties:Hoe,Validate:Eh,createElement:Woe}=L,Mk=class extends Hoe{};v([Eh(UH(["reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"]))],Mk.prototype,"value");v([Eh(Foe)],Mk.prototype,"section");var Xp=class extends Boe{constructor(e,t,i,s,o,n,r){super(),this.ctx=e,this.getModuleProperties=t,this.getResetZoom=i,this.updateZoom=s,this.updateAxisZoom=o,this.resetZoom=n,this.isZoomValid=r,this.enabled=!1,this.buttons=new zoe(Mk),this.visible="hover",this.verticalSpacing=10,this.detectionRange=38,this.destroyFns=[],this.container=new _oe(Woe("div")),this.container.addClass("ag-charts-zoom-buttons"),e.domManager.addChild("canvas-overlay","zoom-buttons",this.container.getElement()),this.toolbar=new Voe(e.localeManager),this.container.addChild(this.toolbar),this.toggleVisibility(this.visible==="always"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("button-focused",this.onButtonFocus.bind(this)),e.widgets.containerWidget.addListener("mousemove",this.onHover.bind(this)),e.widgets.containerWidget.addListener("mouseleave",this.onLeave.bind(this)),e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),this.teardown.bind(this))}destroy(){for(const e of this.destroyFns)e()}toggleVisibleZoomed(e){this.visible==="zoomed"&&this.toggleVisibility(!e)}teardown(){this.ctx.domManager.removeChild("canvas-overlay","zoom-buttons"),this.container.destroy()}onLayoutComplete(e){const{buttons:t,container:i}=this,{rect:s}=e.series;this.toolbar.updateButtons(t),this.toggleButtons();const o=i.getBounds().height;i.setBounds({y:s.y+s.height-o})}onHover(e){if(!this.enabled||this.visible!=="hover"||this.toolbar.isHidden())return;const{container:t,detectionRange:i,ctx:{scene:s}}=this,{currentY:o,sourceEvent:{target:n}}=e,r=t.getElement(),a=r.offsetTop-i,l=o>a&&o<s.canvas.element.offsetHeight||n===r;this.toggleVisibility(l)}onLeave(){this.visible==="hover"&&this.toggleVisibility(!1)}toggleVisibility(e,t=!1){const{container:i,toolbar:s,verticalSpacing:o}=this;s.toggleClass("ag-charts-zoom-buttons__toolbar--hidden",!e);const n=s.getElement();n.style.transitionDuration=t?"0s":"",n.style.transform=e?"translateY(0)":`translateY(${i.getBounds().height+o}px)`}toggleButtons(){const e=xs(this.ctx.zoomManager.getZoom());if(!(this.previousZoom&&df(this.previousZoom,e))){this.previousZoom=e;for(const[t,i]of this.buttons.entries()){let s=!0;switch(i?.value){case"pan-start":s=e.x.min>gt.min;break;case"pan-end":s=e.x.max<gt.max;break;case"pan-left":s=e.x.min>gt.min;break;case"pan-right":s=e.x.max<gt.max;break;case"zoom-out":s=!df(e,wk());break;case"zoom-in":s=this.isZoomValid(this.getNextZoomStateUnified("zoom-in",e,this.getModuleProperties()));break;case"reset":s=!df(e,this.getResetZoom());break}this.toolbar.toggleButtonEnabledByIndex(t,s)}}}onButtonPress({button:e}){if(!this.enabled||this.toolbar.isHidden())return;const t=this.getModuleProperties();if(t.independentAxes&&e.value!=="reset"){const i=this.ctx.zoomManager.getAxisZooms();for(const[s,{direction:o,zoom:n}]of Object.entries(i))n!=null&&this.onButtonPressAxis(e,t,s,o,n)}else this.onButtonPressUnified(e,t)}onButtonFocus(e){this.toggleVisibility(!0,!0)}onButtonPressAxis(e,t,i,s,o){const{isScalingX:n,isScalingY:r,scrollingStep:a}=t;let l={...o};const c=o.max-o.min;switch(e.value){case"pan-start":l.max=c,l.min=0;break;case"pan-end":l.min=l.max-c,l.max=gt.max;break;case"pan-left":l.min-=c*a,l.max-=c*a;break;case"pan-right":l.min+=c*a,l.max+=c*a;break;case"zoom-in":case"zoom-out":{const d=s===Goe.X,h=d&&n||!d&&r;let u=e.value==="zoom-in"?1-a:1+a;h||(u=1);const p=d?this.getAnchorPointX(t):this.getAnchorPointY(t);l.max=l.min+(l.max-l.min)*u,l=Zn(l,o,p);break}}this.updateAxisZoom(i,s,rb(l))}onButtonPressUnified(e,t){const{scrollingStep:i}=t,s=xs(this.ctx.zoomManager.getZoom());let o=xs(s);switch(e.value){case"reset":this.resetZoom();return;case"pan-start":o.x.max=as(o),o.x.min=0;break;case"pan-end":o.x.min=gt.max-as(o),o.x.max=gt.max;break;case"pan-left":o=ah(o,-as(o)*i,0);break;case"pan-right":o=ah(o,as(o)*i,0);break;case"zoom-in":case"zoom-out":{o=this.getNextZoomStateUnified(e.value,s,t);break}}this.updateZoom(Dn(o))}getNextZoomStateUnified(e,t,i){const{isScalingX:s,isScalingY:o,scrollingStep:n}=i,r=e==="zoom-in"?1-n:1+n,a=jH(t,s?r:1,o?r:1);return a.x=Zn(a.x,t.x,this.getAnchorPointX(i)),a.y=Zn(a.y,t.y,this.getAnchorPointY(i)),a}getAnchorPointX(e){const t=this.anchorPointX??e.anchorPointX;return t==="pointer"?HH:t}getAnchorPointY(e){const t=this.anchorPointY??e.anchorPointY;return t==="pointer"?WH:t}};v([Eh(Ooe),KH({changeValue(e){this.toolbar?.setHidden(!e)}})],Xp.prototype,"enabled");v([Eh(Noe)],Xp.prototype,"buttons");v([Eh(UH(["always","zoomed","hover"])),KH({changeValue(e,t){t!=null&&this.toggleVisibility(e==="always")}})],Xp.prototype,"visible");v([Eh(fx)],Xp.prototype,"anchorPointX");v([Eh(fx)],Xp.prototype,"anchorPointY");var Bd=1e6;function ab({min:e,max:t},i,s,o){return o===0?0:Bd*((i-s)/o*(t-e)+e)}function joe(e,t,i,s,o,n){[e,t]=[Math.min(e,t),Math.max(e,t)],[i,s]=[Math.min(i,s),Math.max(i,s)];const r=Bd*(i-o)/n,a=Bd*(s-o)/n,l=(i-o)/(s-o),c=(e-l*t)/(Bd-r+l*(a-Bd)),d=(t+(a-Bd)*c)/a;return{min:c,max:d}}function ON(e,t,i,s){t===0&&(t=30),s===0&&(s=30);const o=e-t,n=e+t,r=i-s,a=i+s;return!(n<r||a<o)}var Uoe=class{constructor(){this.touchStart={origins:[{identifier:0,normalX:NaN,normalY:NaN},{identifier:0,normalX:NaN,normalY:NaN}]},this.initialZoom={x:{min:0,max:1},y:{min:0,max:1}},this.previous={a1:NaN,a2:NaN,b1:NaN,b2:NaN}}start(e,t,i){if(e.sourceEvent.targetTouches.length!==2)return!1;e.sourceEvent.preventDefault();const s=Array.from(e.sourceEvent.targetTouches),{x:o,y:n,width:r,height:a}=t.getBoundingClientRect();this.initialZoom.x.min=i.x?.min??0,this.initialZoom.x.max=i.x?.max??1,this.initialZoom.y.min=i.y?.min??0,this.initialZoom.y.max=i.y?.max??1,this.touchStart.origins.forEach(g=>g.identifier=0),this.previous.a1=NaN,this.previous.a2=NaN,this.previous.b1=NaN,this.previous.b2=NaN;for(const g of[0,1]){const f=s[g].clientX,y=n+a-s[g].clientY;this.touchStart.origins[g].identifier=s[g].identifier,this.touchStart.origins[g].normalX=ab(this.initialZoom.x,f,o,r),this.touchStart.origins[g].normalY=ab(this.initialZoom.y,y,n,a)}const[l,c]=s,[d,h]=this.touchStart.origins,u=ON(l.clientX,l.radiusX,c.clientX,c.radiusX);return ON(l.clientY,l.radiusY,c.clientY,c.radiusY)&&(d.normalY=h.normalY=(d.normalY+h.normalY)/2),u&&(d.normalX=h.normalX=(d.normalX+h.normalX)/2),!0}update(e,t){e.sourceEvent.preventDefault();const i=Array.from(e.sourceEvent.targetTouches),{x:s,y:o,width:n,height:r}=t.getBoundingClientRect(),{origins:a}=this.touchStart,l=[0,1].map(m=>i.find(C=>C.identifier===a[m].identifier)),c=a[0].normalX,d=a[1].normalX,h=l[0].clientX,u=l[1].clientX,p=a[0].normalY,g=a[1].normalY,f=o+r-l[0].clientY,y=o+r-l[1].clientY;return this.twitchTolerantZoomPan4(c,d,h,u,p,g,f,y,s,o,n,r)}end(e){const t=Array.from(e.sourceEvent.targetTouches).map(i=>i.identifier);return!t.includes(this.touchStart.origins[0].identifier)||!t.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(e,t,i,s,o,n,r,a,l,c,d,h){const{initialZoom:u,previous:p}=this,g=FN(e,t,i,s,p,"a1","a2",l,d,u.x),f=FN(o,n,r,a,p,"b1","b2",c,h,u.y);return{x:g,y:f}}};function FN(e,t,i,s,o,n,r,a,l,c){if(e!=t){const d=o[n],h=o[r];return Math.abs(i-d)+Math.abs(s-h)<=1?(i=d,s=h):(o[n]=i,o[r]=s),joe(e,t,i,s,a,l)}else{const d=ab(c,i,a,l),h=ab(c,s,a,l),u=(d+h)/2,p=(e-u)/Bd;return{min:c.min+p,max:c.max+p}}}var{BOOLEAN:fa,NUMBER:$H,POSITIVE_NUMBER:Koe,RATIO:Dk,UNION:Ak,OBJECT:YH,OR:$oe,ActionOnSet:mx,ChartAxisDirection:Ig,ChartUpdateType:BN,Deprecated:XH,Validate:Jt,InteractionState:Sv,ProxyProperty:Yoe,round:Xoe}=L,xv=e=>Xoe(e,10),GN="zoom-cursor",hM="zoom-tooltip",Ik=class extends L.BaseProperties{constructor(e){super(),this.onChange=e,this.enabled=!1,this.padding=0}};v([Jt(fa),mx({changeValue(e){this.onChange({enabled:e,padding:this.padding})}})],Ik.prototype,"enabled");v([Jt(Dk),mx({changeValue(e){this.onChange({enabled:this.enabled,padding:e})}})],Ik.prototype,"padding");var gi=class extends L.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.enableAxisDragging=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=(gt.max-gt.min)/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=HH,this.anchorPointY=WH,this.autoScaling=new Ik(i=>{this.ctx.zoomManager.setAutoScaleYAxis(i.enabled,i.padding)}),this.buttons=new Xp(this.ctx,this.getModuleProperties.bind(this),this.getResetZoom.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.axisDragger=new xoe,this.panner=new koe,this.scroller=new Eoe,this.scrollPanner=new Loe,this.twoFingers=new Uoe,this.deceleration="short",this.dragState=0,this.isState=i=>this.ctx.interactionManager.isState(i),this.destroyContextMenuActions=void 0,this.isFirstWheelEvent=!0,this.debouncedWheelReset=nQ(()=>{this.isFirstWheelEvent=!0},100);const t=new gx;this.selector=new Poe(t,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new Doe(e.contextMenuRegistry,e.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this)),this.domProxy=new Ioe({onDragStart:(i,s)=>this.onAxisDragStart(i,s),onDrag:i=>{this.onDragMove({...i,currentX:i.offsetX,currentY:i.offsetY})},onDragEnd:()=>this.onDragEnd(),onDoubleClick:(i,s)=>{this.hoveredAxis={id:i,direction:s},this.onDoubleClick(),this.hoveredAxis=void 0}}),this.destroyFns.push(e.scene.attachNode(t),e.chartEventManager.addListener("series-keynav-zoom",i=>this.onNavZoom(i)),e.widgets.seriesDragInterpreter.addListener("dblclick",i=>this.onDoubleClick(i)),e.widgets.seriesDragInterpreter.addListener("drag-move",i=>this.onDragMove(i)),e.widgets.seriesDragInterpreter.addListener("drag-start",i=>this.onDragStart(i)),e.widgets.seriesDragInterpreter.addListener("drag-end",()=>this.onDragEnd()),e.widgets.seriesWidget.addListener("wheel",i=>this.onWheel(i)),e.widgets.seriesWidget.addListener("touchstart",(i,s)=>this.onTouchStart(i,s)),e.widgets.seriesWidget.addListener("touchmove",(i,s)=>this.onTouchMove(i,s)),e.widgets.seriesWidget.addListener("touchend",i=>this.onTouchEnd(i)),e.widgets.seriesWidget.addListener("touchcancel",i=>this.onTouchEnd(i)),e.updateService.addListener("process-data",i=>this.onProcessData(i)),e.layoutManager.addListener("layout:complete",i=>this.onLayoutComplete(i)),e.zoomManager.addListener("zoom-change",i=>this.onZoomChange(i)),e.zoomManager.addListener("zoom-pan-start",i=>this.onZoomPanStart(i)),this.panner.addListener("update",i=>this.onPanUpdate(i)),()=>this.teardown())}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.()}onEnabledChange(e){this.ctx.zoomManager.setZoomModuleEnabled(e),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(e))}isIgnoredTouch(e){if(this.ctx.chartService.touch.dragAction!=="drag")return!0;if(e?.device!=="touch"||this.enableSelecting)return!1;if(!this.enablePanning)return!0;const{x:t,y:i}=this.getZoom();return t.min===0&&t.max===1&&i.min===0&&i.max===1}onDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i,hoveredAxis:s,ctx:{zoomManager:o}}=this;!t||!i||!this.isState(Sv.ZoomClickable)||(s?o.resetAxisZoom("zoom",s.id):e?.preventZoomDblClick||this.resetZoom())}onDragStart(e){const{enabled:t,enableAxisDragging:i,enablePanning:s,enableSelecting:o,hoveredAxis:n,ctx:{domManager:r,zoomManager:a}}=this;if(!t||!this.hoveredAxis&&(!this.isState(Sv.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(e)))return;this.panner.stopInteractions();let l=0;if(i&&n)l=1;else if(e!=null){const c=this.isPanningKeyPressed(e.sourceEvent);s&&(!o||c)?(r.updateCursor(GN,"grabbing"),l=2,this.panner.start()):o&&!c&&(l=3)}(this.dragState=l)!==0&&a.fireZoomPanStartEvent("zoom")}onDragMove(e){const{anchorPointX:t,anchorPointY:i,axisDragger:s,dragState:o,enabled:n,paddedRect:r,panner:a,selector:l,seriesRect:c,shouldFlipXY:d,hoveredAxis:h,ctx:{interactionManager:u,tooltipManager:p,updateService:g,zoomManager:f}}=this;if(!n||!r||!c||!h&&(!this.isState(Sv.ZoomDraggable)||this.isIgnoredTouch(e)))return;u.pushState(L.InteractionState.ZoomDrag),e.device==="touch"&&e.sourceEvent.preventDefault();const y=this.getZoom();switch(o){case 1:{if(!h)break;const{id:m,direction:C}=h;let b=C===Ig.X?t:i;d&&(b=C===Ig.X?i:t);const S=f.getAxisZoom(m),A=s.update(e,C,b,c,y,S);f.setAxisManuallyAdjusted("zoom",m),this.updateAxisZoom(m,C,A);break}case 2:a.update(e);break;case 3:l.update(e,this.getModuleProperties(),r);break;case 0:return}p.updateTooltip(hM),g.update(BN.PERFORM_LAYOUT,{skipAnimations:!0})}onDragEnd(){const{axisDragger:e,dragState:t,enabled:i,panner:s,selector:o,ctx:{domManager:n,interactionManager:r,tooltipManager:a}}=this;if(r.popState(L.InteractionState.ZoomDrag),!(!i||t===0)){switch(t){case 1:this.hoveredAxis=void 0,e.stop();break;case 2:s.stop();break;case 3:{if(!o.didUpdate())break;const l=this.getZoom(),c=o.stop(this.seriesRect,this.paddedRect,l);this.updateZoom(c);break}}this.dragState=0,n.updateCursor(GN),a.removeTooltip(hM)}}onNavZoom(e){const{enabled:t,enableScrolling:i,scroller:s}=this;!this.ctx.interactionManager.isState(L.InteractionState.Default)||!t||!i||(e.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(s.updateDelta(e.delta,this.getModuleProperties(),this.getZoom())))}onWheel(e){const{enabled:t,enablePanning:i,enableScrolling:s,paddedRect:o}=this;if(!t||!s||!o||!this.isState(Sv.ZoomWheelable))return;const{deltaX:n,deltaY:r}=e.sourceEvent,a=n!=null&&r!=null&&Math.abs(n)>Math.abs(r);i&&a?this.onWheelPanning(e):this.onWheelScrolling(e)}onWheelPanning(e){const{scrollingStep:t,scrollPanner:i,seriesRect:s,ctx:{zoomManager:o}}=this;if(!s)return;e.sourceEvent.preventDefault();const n=i.update(e,t,s,o.getAxisZooms());for(const[r,{direction:a,zoom:l}]of Object.entries(n))this.updateAxisZoom(r,a,l)}onWheelScrolling(e){const{enableAxisDragging:t,enableIndependentAxes:i,hoveredAxis:s,scroller:o,seriesRect:n,ctx:{zoomManager:r}}=this;if(!n)return;const a=this.getZoom();let l=e.deltaY>0&&this.isMaxZoom(a);const c=t&&s!=null;let d=this.isScalingX(),h=this.isScalingY();c&&(d=s.direction===L.ChartAxisDirection.X,h=!d);const u=this.getModuleProperties({isScalingX:d,isScalingY:h});let p=!0;if(i===!0){const g=o.updateAxes(e,u,n,r.getAxisZooms());for(const[f,{direction:y,zoom:m}]of Object.entries(g))c&&s.id!==f||p&&(p=this.updateAxisZoom(f,y,m))}else{const g=o.update(e,u,n,this.getZoom());p=this.updateUnifiedZoom(g)}l||(l=e.deltaY<0&&!p),(!this.isFirstWheelEvent||!l)&&e.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}onAxisDragStart(e,t){this.hoveredAxis={id:e,direction:t},this.onDragStart(void 0)}onTouchStart(e,t){!this.enableTwoFingerZoom||this.dragState!==0||this.twoFingers.start(e,t,this.getZoom())&&(this.dragState=4)}onTouchMove(e,t){if(!this.enableTwoFingerZoom||this.dragState!==4)return;const i=this.twoFingers.update(e,t);this.updateZoom(Dn(i))}onTouchEnd(e){!this.enableTwoFingerZoom||this.dragState!==4||(e.sourceEvent.preventDefault(),this.twoFingers.end(e)&&(this.dragState=0))}onProcessData(e){this.shouldFlipXY=e.series.shouldFlipXY}onLayoutComplete(e){this.domProxy.update(this.enableAxisDragging,this.ctx);const{enabled:t}=this;if(!t)return;const{series:{rect:i,paddedRect:s}}=e;this.seriesRect=i,this.paddedRect=s}onZoomChange(e){e.callerId!=="zoom"&&this.panner.stopInteractions();const t=this.getZoom();this.buttons.toggleVisibleZoomed(this.isMaxZoom(t))}onZoomPanStart(e){e.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(e){const{panner:t,seriesRect:i,ctx:{tooltipManager:s,zoomManager:o}}=this;if(!i)return;const n=t.translateZooms(i,o.getAxisZooms(),e.deltaX,e.deltaY);for(const[r,{direction:a,zoom:l}]of Object.entries(n))this.updateAxisZoom(r,a,l);s.updateTooltip(hM)}isPanningKeyPressed(e){switch(this.panKey){case"alt":return e.altKey;case"ctrl":return e.ctrlKey;case"shift":return e.shiftKey;case"meta":return e.metaKey}}isScalingX(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="y":this.axes==="x"}isScalingY(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="x":this.axes==="y"}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}isMaxZoom(e){return df(e,wk())}isZoomValid(e){const{minVisibleItems:t,minVisibleItemsX:i,minVisibleItemsY:s,ctx:{zoomManager:o}}=this;if(t===0)return!0;const n=this.getZoom(),r=xv(as(e))<xv(as(n)),a=xv(wn(e))<xv(wn(n));return!r&&!a?!0:i!=null&&r?o.isVisibleItemsCountAtLeast(e,i):s!=null&&a?o.isVisibleItemsCountAtLeast(e,s):o.isVisibleItemsCountAtLeast(e,t)}isAxisZoomValid(e,t){const{minVisibleItems:i,minVisibleItemsX:s,minVisibleItemsY:o,ctx:{zoomManager:n}}=this,r=this.getZoom(),a=t.max-t.min,l=r[e].max-r[e].min,c={...r,[e]:t},d=e===Ig.X?s:o;return a>=l||n.isVisibleItemsCountAtLeast(c,d??i)}resetZoom(){this.ctx.zoomManager.resetZoom("zoom")}updateZoom(e){this.enableIndependentAxes?this.updatePrimaryAxisZooms(e):this.updateUnifiedZoom(e)}updateUnifiedZoom(e){return this.isZoomValid(e)?(this.ctx.zoomManager.updateZoom("zoom",e),!0):(this.ctx.updateService.update(BN.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(e){this.updatePrimaryAxisZoom(e,Ig.X),this.updatePrimaryAxisZoom(e,Ig.Y)}updatePrimaryAxisZoom(e,t){const i=this.ctx.zoomManager.getPrimaryAxisId(t);i!=null&&this.updateAxisZoom(i,t,e[t])}updateAxisZoom(e,t,i){const{enableIndependentAxes:s,ctx:{zoomManager:o}}=this;if(!i)return!1;const n=this.getZoom();return s!==!0?(n[t]=i,this.updateUnifiedZoom(n)):this.isAxisZoomValid(t,i)?(o.updateAxisZoom("zoom",e,i),!0):!1}getZoom(){return xs(this.ctx.zoomManager.getZoom())}getResetZoom(){return xs(this.ctx.zoomManager.getRestoredZoom())}getModuleProperties(e){return{anchorPointX:e?.anchorPointX??this.getAnchorPointX(),anchorPointY:e?.anchorPointY??this.getAnchorPointY(),enabled:e?.enabled??this.enabled,independentAxes:e?.independentAxes??this.enableIndependentAxes===!0,isScalingX:e?.isScalingX??this.isScalingX(),isScalingY:e?.isScalingY??this.isScalingY(),keepAspectRatio:e?.keepAspectRatio??this.keepAspectRatio,scrollingStep:e?.scrollingStep??this.scrollingStep}}};v([mx({newValue(e){this.onEnabledChange(e)}}),Jt(fa)],gi.prototype,"enabled");v([Jt(fa)],gi.prototype,"enableAxisDragging");v([Jt(fa)],gi.prototype,"enableDoubleClickToReset");v([mx({changeValue(e){this.ctx.zoomManager.setIndependentAxes(!!e)}}),Jt(fa,{optional:!0})],gi.prototype,"enableIndependentAxes");v([Jt(fa)],gi.prototype,"enablePanning");v([Jt(fa)],gi.prototype,"enableScrolling");v([Jt(fa)],gi.prototype,"enableSelecting");v([Jt(fa)],gi.prototype,"enableTwoFingerZoom");v([Jt(Ak(["alt","ctrl","meta","shift"],"a pan key"))],gi.prototype,"panKey");v([Jt(Ak(["x","y","xy"],"an axis"))],gi.prototype,"axes");v([Jt(Dk)],gi.prototype,"scrollingStep");v([Jt(fa)],gi.prototype,"keepAspectRatio");v([Jt(Koe)],gi.prototype,"minVisibleItems");v([XH("Use [minVisibleItems] instead."),Jt($H.restrict({min:1}))],gi.prototype,"minVisibleItemsX");v([XH("Use [minVisibleItems] instead."),Jt($H.restrict({min:1}))],gi.prototype,"minVisibleItemsY");v([Jt(fx)],gi.prototype,"anchorPointX");v([Jt(fx)],gi.prototype,"anchorPointY");v([Jt(YH)],gi.prototype,"autoScaling");v([Jt(YH)],gi.prototype,"buttons");v([Yoe("panner.deceleration"),Jt($oe(Dk,Ak(["off","short","long"],"a deceleration")))],gi.prototype,"deceleration");var Zoe={enabled:!0,visible:"hover",buttons:[{icon:"zoom-out",tooltip:"toolbarZoomZoomOut",value:"zoom-out",section:"scale"},{icon:"zoom-in",tooltip:"toolbarZoomZoomIn",value:"zoom-in",section:"scale"},{icon:"pan-left",tooltip:"toolbarZoomPanLeft",value:"pan-left",section:"pan"},{icon:"pan-right",tooltip:"toolbarZoomPanRight",value:"pan-right",section:"pan"},{icon:"reset",tooltip:"toolbarZoomReset",value:"reset",section:"reset"}]},qoe={type:"root",optionsKey:"zoom",packageType:"enterprise",chartTypes:["cartesian","topology"],moduleFactory:e=>new gi(e),themeTemplate:{zoom:{anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:Zoe,enabled:!1,enableAxisDragging:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:!1,padding:.05}}}},{BOOLEAN:ZH,OBJECT:Qoe,POSITION:Joe,POSITIVE_NUMBER:Rk,BaseProperties:ene,AxisTicks:tne,ZIndexMap:ine,ProxyProperty:kk,Validate:Ph,LayoutElement:sne,createId:one,Group:nne,Rect:rne,Marker:ane,TranslatableGroup:lne,LinearGradient:cne}=L,Tk=class extends ene{constructor(){super(...arguments),this.thickness=16,this.preferredLength=100}};v([Ph(Rk)],Tk.prototype,"thickness");v([Ph(Rk)],Tk.prototype,"preferredLength");var yx=class{constructor(e){this.axisTicks=e}};v([kk("axisTicks.label")],yx.prototype,"label");v([kk("axisTicks.interval")],yx.prototype,"interval");v([kk("axisTicks.padding")],yx.prototype,"padding");var Nh=class{constructor(e){this.ctx=e,this.id=one(this),this.legendGroup=new lne({name:"legend",zIndex:ine.LEGEND}),this.gradientRect=new rne,this.arrow=new ane({shape:"triangle"}),this.ticksGroup=new nne({name:"legend-axis-group"}),this.destroyFns=[],this.enabled=!1,this.position="bottom",this.reverseOrder=!1,this.gradient=new Tk,this.spacing=20,this.data=[],this.highlightManager=e.highlightManager,this.axisTicks=new tne,this.axisTicks.attachAxis(this.ticksGroup),this.scale=new yx(this.axisTicks),this.legendGroup.append([this.gradientRect,this.arrow,this.ticksGroup]),this.destroyFns.push(e.highlightManager.addListener("highlight-change",()=>this.onChartHoverChange()),e.layoutManager.registerElement(sne.Legend,t=>this.onStartLayout(t)),()=>this.legendGroup.remove())}isVertical(){return this.position==="right"||this.position==="left"}destroy(){this.destroyFns.forEach(e=>e())}attachLegend(e){e.appendChild(this.legendGroup)}onStartLayout(e){const[t]=this.data;if(!this.enabled||!t?.enabled){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(t);this.updateGradientRect(e.layoutBox,i);const s=this.updateAxis(t),{left:o,top:n}=this.getMeasurements(e.layoutBox,s);this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=o,this.legendGroup.translationY=n}normalizeColorArrays(e){let t=e.colorDomain.slice();const i=e.colorRange.slice();if(t.length===i.length)return{colorDomain:t,colorRange:i};t.length>i.length&&i.splice(t.length);const[s,o]=t,n=i.length;return t=i.map((r,a)=>a===0?s:a===n-1?o:s+(o-s)*a/(n-1)),{colorDomain:t,colorRange:i}}updateGradientRect(e,t){const{gradientRect:i}=this,{preferredLength:s,thickness:o}=this.gradient;let n;this.isVertical()?(n=0,i.width=o,i.height=Math.min(e.height,s)):(n=90,i.width=Math.min(e.width,s),i.height=o),i.fill=new cne("oklch",t.map((r,a)=>({offset:a/(t.length-1),color:r})),n)}updateAxis(e){const{axisTicks:t}=this,i=this.isVertical(),s=this.reverseOrder!==i;return t.position=this.position,t.translationX=i?this.gradient.thickness:0,t.translationY=i?0:this.gradient.thickness,t.scale.domain=s?e.colorDomain.slice().reverse():e.colorDomain,t.scale.range=i?[0,this.gradientRect.height]:[0,this.gradientRect.width],t.calculateLayout()}updateArrow(){const e=this.highlightManager.getActiveHighlight(),{arrow:t}=this;if(e?.colorValue==null){t.visible=!1;return}const{scale:i,label:s}=this.axisTicks,o=s.fontSize??0,n=i.convert(e.colorValue);let{x:r,y:a}=this.gradientRect,l=Math.PI;this.isVertical()?(r-=o/2,a+=n,l/=2):(r+=n,a-=o/2),t.visible=!0,t.fill=s.color,t.rotation=l,t.size=o,t.translationX=r,t.translationY=a}getMeasurements(e,t){let{x:i,y:s}=e,{width:o,height:n}=this.gradientRect;switch(this.isVertical()?o+=t.width+5:n+=t.height+5,this.position){case"left":s+=e.height/2-n/2,e.shrink(o+this.spacing,"left");break;case"right":i+=e.width-o,s+=e.height/2-n/2,e.shrink(o+this.spacing,"right");break;case"top":i+=e.width/2-o/2,e.shrink(n+this.spacing,"top");break;case"bottom":i+=e.width/2-o/2,s+=e.height-n,e.shrink(n+this.spacing,"bottom")}return{top:s,left:i}}onChartHoverChange(){this.enabled&&this.updateArrow()}};Nh.className="GradientLegend";v([Ph(ZH)],Nh.prototype,"enabled");v([Ph(Joe)],Nh.prototype,"position");v([Ph(ZH)],Nh.prototype,"reverseOrder");v([Ph(Qoe)],Nh.prototype,"gradient");v([Ph(Rk)],Nh.prototype,"spacing");var dne={type:"legend",optionsKey:"gradientLegend",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient",moduleFactory:e=>new Nh(e),themeTemplate:{enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1},removable:"standalone-only"};function hne(e,t){const i=e.addChild("canvas-overlay","watermark"),s=L.createElement("span");s.innerText=t,i.addEventListener("animationend",()=>{e.removeChild("canvas-overlay","watermark"),e.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(s)}var{findMinMax:une}=L,ns=0,Ys=1,go=2,fo=3,_o=4;function ny(e,t=1){let i=Math.ceil(Math.log2(e.length/t))-1;return i=Math.min(Math.max(i,0),16),2**i|0}function ry(e){return une(e.map(t=>Number(t)))}function vx(e,t,i){return(e.valueOf()-t)/(i-t)}function Cx(e,t){return Math.min(Math.floor(e*t),t-1)*_o|0}function ay(e,t,i,s,o,n){const r=new Int32Array(n*_o).fill(-1),a=new Float64Array(n*_o).fill(NaN);for(let l=0;l<e.length;l+=1){const c=e[l],d=t[l],h=i[l];if(c==null||d==null||h==null)continue;const u=vx(c,s,o),p=d.valueOf(),g=h.valueOf(),f=Cx(u,n),y=r[f+ns]===-1;(y||u<a[f+ns])&&(r[f+ns]=l,a[f+ns]=u),(y||u>a[f+Ys])&&(r[f+Ys]=l,a[f+Ys]=u),(y||g<a[f+go])&&(r[f+go]=l,a[f+go]=g),(y||p>a[f+fo])&&(r[f+fo]=l,a[f+fo]=p)}return{indexData:r,valueData:a}}function ly(e,t,i,{inPlace:s=!1}={}){const o=i/2|0,n=s?e:new Int32Array(o*_o),r=s?t:new Float64Array(o*_o);for(let a=0;a<o;a+=1){const l=a*_o|0,c=l*2|0,d=c+_o|0,h=e[d+ns]===-1,u=h||t[c+ns]<t[d+ns]?c:d;n[l+ns]=e[u+ns],r[l+ns]=t[u+ns];const p=h||t[c+Ys]>t[d+Ys]?c:d;n[l+Ys]=e[p+Ys],r[l+Ys]=t[p+Ys];const g=h||t[c+go]<t[d+go]?c:d;n[l+go]=e[g+go],r[l+go]=t[g+go];const f=h||t[c+fo]>t[d+fo]?c:d;n[l+fo]=e[f+fo],r[l+fo]=t[f+fo]}return{maxRange:o,indexData:n,valueData:r}}var _N={xMin:ns,xMax:Ys,yMin:go,yMax:fo,span:_o},pne=1e3,gne=5;function zN(e,t){return Array.from({length:e},(i,s)=>{const o=s*_o,n=t[o+ns],r=t[o+Ys];return(n+r)/2|0})}function fne(e,t,i){if(e.length<pne)return;const[s,o]=ry(i);let n=ny(e,gne),{indexData:r,valueData:a}=ay(e,t,t,s,o,n),l=zN(n,r);const c=[{maxRange:n,indexData:r,indices:l,indexes:_N}];for(;n>64;)({indexData:r,valueData:a,maxRange:n}=ly(r,a,n)),l=zN(n,r),c.push({maxRange:n,indexData:r,indices:l,indexes:_N});return c.reverse(),c}var{ChartAxisDirection:mne,ContinuousScale:yne,OrdinalTimeScale:vne}=L,Cne=class extends L.BarSeries{aggregateData(e,t){if(t?.type!=="ungrouped")return;const i=this.axes[mne.X];if(i==null||!(yne.is(i.scale)||vne.is(i.scale)))return;const s=e.resolveKeysById(this,"xValue",t),o=e.resolveColumnById(this,"yValue-raw",t),{index:n}=e.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[n];return fne(s,o,r)}},{BarSeriesModule:bne}=L,Sne={...bne,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"bar",moduleFactory:e=>new Cne(e)};function xne(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function wne(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}var{ScalableGroup:Mne,Rect:ru,Line:Rg,BBox:Dne,Selection:VN}=L,Ane=class extends Mne{constructor(){super(),this.append([new ru({tag:0}),new ru({tag:0}),new ru({tag:2}),new ru({tag:1}),new Rg({tag:3}),new Rg({tag:3}),new Rg({tag:4}),new Rg({tag:4})])}updateDatumStyles(e,t,i,s){const{bandwidth:o,scaledValues:{xValue:n,medianValue:r}}=e;let{minValue:a,q1Value:l,q3Value:c,maxValue:d}=e.scaledValues;(i&&!s||!i&&s)&&([d,c,l,a]=[a,l,c,d]);const h=(V,O,H,B)=>i?{y:V,x:O,width:B,height:H}:{x:V,y:O,width:H,height:B},u=(V,O,H)=>i?{y1:V,y2:O,x:H}:{x1:V,x2:O,y:H},p=(V,O,H)=>i?{x1:O,x2:H,y:V}:{x:V,y1:O,y2:H},g=(V,O,H,B)=>({x:V,y:O,width:H,height:B}=h(V,O,H,B),new Dne(V,O,H,B)),{fill:f,fillOpacity:y,stroke:m,strokeWidth:C,strokeOpacity:b,lineDash:S,lineDashOffset:A,cornerRadius:R,cap:I,whisker:w}=t,M=VN.select(this,ru),T=M.selectByTag(0),[E]=M.selectByTag(2),[P]=M.selectByTag(1),N=M.selectByTag(3),F=M.selectByTag(4);w.strokeWidth>o&&(w.strokeWidth=o);const _=h(l,n,c-l,o);E.setProperties(_),T[0].setProperties(_),T[0].setProperties({cornerRadius:R,clipBBox:g(l,n,Math.round(r-l+C/2),o)}),T[1].setProperties(_),T[1].setProperties({cornerRadius:R,clipBBox:g(Math.round(r-C/2),n,Math.floor(c-r+C/2),o)});const W=Math.max(Math.round(r-C/2),l+C),z=Math.min(Math.round(r+C/2),c-C);P.setProperties(_),P.setProperties({visible:W<z,cornerRadius:R,clipBBox:g(W,n+C,z-W,Math.max(0,o-C*2))});const U=Math.floor(n+o*(1-I.lengthRatio)/2),G=Math.ceil(n+o*(1+I.lengthRatio)/2);F[0].setProperties(p(a,U,G)),F[1].setProperties(p(d,U,G)),N[0].setProperties(u(Math.round(a+w.strokeWidth/2),l,Math.floor(n+o/2))),N[1].setProperties(u(c,Math.round(d-w.strokeWidth/2),Math.floor(n+o/2)));for(const V of T)V.setProperties({fill:f,fillOpacity:y,strokeWidth:C*2,strokeOpacity:0});P.setProperties({fill:m,fillOpacity:b,strokeWidth:0});for(const V of[...N,...F])V.setProperties(w);E.setProperties({stroke:m,strokeWidth:C,strokeOpacity:b,lineDash:S,lineDashOffset:A,cornerRadius:R,fillOpacity:0})}distanceSquared(e,t){const i=VN.selectByClass(this,ru,Rg);return L.nearestSquared(e,t,i).distanceSquared}get midPoint(){const e=this.datum;return e.midPoint===void 0?(et.error("BoxPlotGroup.datum.midPoint is undefined"),{x:NaN,y:NaN}):e.midPoint}},{BaseProperties:qH,AbstractBarSeriesProperties:Ine,SeriesTooltip:Rne,Validate:at,COLOR_STRING:bx,FUNCTION:kne,LINE_DASH:QH,OBJECT:Lk,POSITIVE_NUMBER:cy,RATIO:Sx,STRING:Xo,mergeDefaults:Tne}=L,JH=class extends qH{constructor(){super(...arguments),this.lengthRatio=.5}};v([at(Sx)],JH.prototype,"lengthRatio");var Zp=class extends qH{};v([at(bx,{optional:!0})],Zp.prototype,"stroke");v([at(cy)],Zp.prototype,"strokeWidth");v([at(Sx)],Zp.prototype,"strokeOpacity");v([at(QH,{optional:!0})],Zp.prototype,"lineDash");v([at(cy)],Zp.prototype,"lineDashOffset");var Dt=class extends Ine{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new JH,this.whisker=new Zp,this.tooltip=new Rne,this.backgroundFill="white"}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:o}=this,n=super.toJson();return n.whisker=Tne(n.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:o}),n}};v([at(Xo)],Dt.prototype,"xKey");v([at(Xo)],Dt.prototype,"minKey");v([at(Xo)],Dt.prototype,"q1Key");v([at(Xo)],Dt.prototype,"medianKey");v([at(Xo)],Dt.prototype,"q3Key");v([at(Xo)],Dt.prototype,"maxKey");v([at(Xo,{optional:!0})],Dt.prototype,"xName");v([at(Xo,{optional:!0})],Dt.prototype,"yName");v([at(Xo,{optional:!0})],Dt.prototype,"minName");v([at(Xo,{optional:!0})],Dt.prototype,"q1Name");v([at(Xo,{optional:!0})],Dt.prototype,"medianName");v([at(Xo,{optional:!0})],Dt.prototype,"q3Name");v([at(Xo,{optional:!0})],Dt.prototype,"maxName");v([at(bx,{optional:!0})],Dt.prototype,"fill");v([at(Sx)],Dt.prototype,"fillOpacity");v([at(bx)],Dt.prototype,"stroke");v([at(cy)],Dt.prototype,"strokeWidth");v([at(Sx)],Dt.prototype,"strokeOpacity");v([at(QH)],Dt.prototype,"lineDash");v([at(cy)],Dt.prototype,"lineDashOffset");v([at(cy)],Dt.prototype,"cornerRadius");v([at(kne,{optional:!0})],Dt.prototype,"itemStyler");v([at(Lk)],Dt.prototype,"cap");v([at(Lk)],Dt.prototype,"whisker");v([at(Lk)],Dt.prototype,"tooltip");v([at(bx)],Dt.prototype,"backgroundFill");var{extractDecoratedProperties:HN,fixNumericExtent:Lne,keyProperty:Ene,mergeDefaults:uM,SeriesNodePickMode:WN,SMALLEST_KEY_INTERVAL:Pne,valueProperty:kg,diff:Nne,animationValidation:One,computeBarFocusBounds:Fne,createDatumId:jN,Color:SNe,ContinuousScale:Bne,ChartAxisDirection:UN,motion:KN}=L,Gne=class extends L.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.minKey=s.properties.minKey,this.q1Key=s.properties.q1Key,this.medianKey=s.properties.medianKey,this.q3Key=s.properties.q3Key,this.maxKey=s.properties.maxKey}},Ek=class extends L.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[WN.NEAREST_NODE,WN.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},directionNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},pathsPerSeries:[],hasHighlightedLabels:!0}),this.properties=new Dt,this.NodeEvent=Gne}async processData(e){if(!this.properties.isValid()||!this.visible)return;const{xKey:t,minKey:i,q1Key:s,medianKey:o,q3Key:n,maxKey:r}=this.properties,a=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:d,xScaleType:h,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),p=[];a&&this.processedData&&p.push(Nne(this.id,this.processedData)),a&&p.push(One());const{processedData:g}=await this.requestDataModel(e,this.data,{props:[Ene(t,h,{id:"xValue"}),kg(i,u,{id:"minValue"}),kg(s,u,{id:"q1Value"}),kg(o,u,{id:"medianValue"}),kg(n,u,{id:"q3Value"}),kg(r,u,{id:"maxValue"}),...d?[Pne]:[],...p]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];if(e!==this.getBarDirection()){const{index:o,def:n}=i.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[o];return n.type==="key"&&n.valueType==="category"?r:this.padBandExtent(r)}const s=this.domainForClippedRange(UN.Y,["minValue","maxValue"],"xValue",!0);return Lne(s)}getSeriesRange(e,t){return this.domainForVisibleRange(UN.Y,["maxValue","minValue"],"xValue",t,!0)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),o=this.getValueAxis();if(!(t&&i&&s&&o))return;const{xKey:n,fill:r,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:d,lineDash:h,lineDashOffset:u,cap:p,whisker:g}=this.properties,f=[],y=t.resolveKeysById(this,"xValue",i),m=t.resolveColumnById(this,"minValue",i),C=t.resolveColumnById(this,"q1Value",i),b=t.resolveColumnById(this,"medianValue",i),S=t.resolveColumnById(this,"q3Value",i),A=t.resolveColumnById(this,"maxValue",i),{barWidth:R,groupIndex:I}=this.updateGroupScale(s),w=Bne.is(s.scale)?R*-.5:0,{groupScale:M}=this,T=this.isVertical(),E={itemId:n,nodeData:f,labelData:[],scales:this.calculateScaling(),visible:this.visible};return e&&(i.dataSources.get(this.id)??[]).forEach((N,F)=>{const _=y[F];if(_==null)return;const W=m[F],z=C[F],U=b[F],G=S[F],V=A[F];if([W,z,U,G,V].some(se=>typeof se!="number")||W>z||z>U||U>G||G>V)return;const O={xValue:Math.round(s.scale.convert(_)),minValue:Math.round(o.scale.convert(W)),q1Value:Math.round(o.scale.convert(z)),medianValue:Math.round(o.scale.convert(U)),q3Value:Math.round(o.scale.convert(G)),maxValue:Math.round(o.scale.convert(V))};O.xValue+=Math.round(M.convert(String(I)))+w;const H=Math.round(R),B=Math.abs(O.q3Value-O.q1Value),Y=O.xValue+H/2,q=Math.min(O.q3Value,O.q1Value)+B/2,Z={x:T?Y:q,y:T?q:Y};let ee;T?ee={x:Z.x-H/2,y:O.minValue,width:H,height:O.maxValue-O.minValue}:ee={x:O.minValue,y:Z.y-H/2,width:O.maxValue-O.minValue,height:H},f.push({series:this,itemId:_,datum:N,datumIndex:F,xKey:n,bandwidth:H,scaledValues:O,cap:p,whisker:g,fill:r,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:d,lineDash:h,lineDashOffset:u,midPoint:Z,focusRect:ee})}),E}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:n,lineDashOffset:r}=this.properties;return{marker:{fill:e,fillOpacity:t,stroke:i,strokeOpacity:o,strokeWidth:s,lineDash:n,lineDashOffset:r}}}getLegendData(e){const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:o,yName:n,showInLegend:r,legendItemName:a}=this.properties;return!o||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:t}),label:{text:a??n??t},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!r}]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:n,xName:r,yName:a,medianKey:l,medianName:c,q1Key:d,q1Name:h,q3Key:u,q3Name:p,minKey:g,minName:f,maxKey:y,maxName:m,legendItemName:C,tooltip:b}=o,S=this.getCategoryAxis(),A=this.getValueAxis();if(!i||!s||!S||!A)return;const{datumIndex:R}=e,I=s.dataSources.get(this.id)?.[R],w=i.resolveKeysById(this,"xValue",s)[R],M=i.resolveColumnById(this,"minValue",s)[R],T=i.resolveColumnById(this,"q1Value",s)[R],E=i.resolveColumnById(this,"medianValue",s)[R],P=i.resolveColumnById(this,"q3Value",s)[R],N=i.resolveColumnById(this,"maxValue",s)[R];if(w==null)return;const F=this.getItemBaseStyle(!1);return Object.assign(F,this.getItemStyleOverrides(String(R),I,F,!1)),b.formatTooltip({heading:S.formatDatum(w),title:C??a,symbol:this.legendItemSymbol(),data:[{label:f,fallbackLabel:g,value:A.formatDatum(M)},{label:h,fallbackLabel:d,value:A.formatDatum(T)},{label:c,fallbackLabel:l,value:A.formatDatum(E)},{label:p,fallbackLabel:u,value:A.formatDatum(P)},{label:m,fallbackLabel:y,value:A.formatDatum(N)}]},{seriesId:t,datum:I,title:a,xKey:n,xName:r,yName:a,medianKey:l,medianName:c,q1Key:d,q1Name:h,q3Key:u,q3Name:p,minKey:g,minName:f,maxKey:y,maxName:m,...F})}animateEmptyUpdateReady({datumSelection:e}){const t=this.isVertical(),{from:i,to:s}=xne(t);KN.resetMotion([e],wne(t)),KN.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[e],i,s,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}getItemBaseStyle(e){const{properties:t}=this,{cornerRadius:i,cap:s,whisker:o}=t,n=e?t.highlightStyle.item:void 0,r=this.getStrokeWidth(t.strokeWidth);return{fill:n?.fill??t.fill,fillOpacity:n?.fillOpacity??t.fillOpacity,stroke:n?.stroke??t.stroke,strokeWidth:n?.strokeWidth??r,strokeOpacity:n?.strokeOpacity??t.strokeOpacity,lineDash:n?.lineDash??t.lineDash??[],lineDashOffset:n?.lineDashOffset??t.lineDashOffset,cornerRadius:i,cap:s,whisker:o}}getItemStyleOverrides(e,t,i,s){const{id:o,properties:n}=this,{xKey:r,minKey:a,q1Key:l,medianKey:c,q3Key:d,maxKey:h,itemStyler:u}=n;if(u!=null)return this.cachedDatumCallback(jN(e,s?"highlight":"node"),()=>u({seriesId:o,datum:t,xKey:r,minKey:a,q1Key:l,medianKey:c,q3Key:d,maxKey:h,highlighted:s,...i}))}updateDatumNodes({datumSelection:e,isHighlight:t}){const i=this.isVertical(),s=this.getValueAxis()?.isReversed();e.each((o,n)=>{let r=this.getFormattedStyles(n,t?"highlight":"node");t&&(r=uM(this.properties.highlightStyle.item,r));const{stroke:a,strokeWidth:l,strokeOpacity:c,lineDash:d,lineDashOffset:h}=r;r.whisker=uM(r.whisker,{stroke:a,strokeWidth:l,strokeOpacity:c,lineDash:d,lineDashOffset:h}),o.updateDatumStyles(n,r,i,s)})}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new Ane}getFormattedStyles(e,t){const{id:i,properties:s}=this,{xKey:o,minKey:n,q1Key:r,medianKey:a,q3Key:l,maxKey:c,itemStyler:d,backgroundFill:h,cornerRadius:u}=s,{datum:p,stroke:g,strokeWidth:f,strokeOpacity:y,lineDash:m,lineDashOffset:C,cap:b,whisker:S}=e;let A,R;A=e.fill,R=s.fillOpacity;const I={fill:A,fillOpacity:R,stroke:g,strokeWidth:f,strokeOpacity:y,lineDash:m,lineDashOffset:C,cornerRadius:u,cap:HN(b),whisker:HN(S)};if(d){const w=this.cachedDatumCallback(jN(p.index,t),()=>d({datum:p,seriesId:i,highlighted:t==="highlight",...I,xKey:o,minKey:n,q1Key:r,medianKey:a,q3Key:l,maxKey:c}));if(w)return uM(w,I)}return I}computeFocusBounds({datumIndex:e}){return Fne(this,this.contextNodeData?.nodeData[e].focusRect)}};Ek.className="BoxPlotSeries";Ek.type="box-plot";var{CARTESIAN_AXIS_TYPE:$N}=L.ThemeConstants,_ne={series:{direction:"vertical",strokeWidth:2},axes:{[$N.NUMBER]:{crosshair:{snap:!1}},[$N.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},{Color:pM,swapAxisCondition:zne,ThemeSymbols:{DEFAULT_BACKGROUND_COLOUR:Vne},ThemeConstants:{CARTESIAN_AXIS_TYPE:YN,CARTESIAN_POSITION:XN}}=L,Hne={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:e=>new Ek(e),tooltipDefaults:{range:"exact"},defaultAxes:zne([{type:YN.NUMBER,position:XN.LEFT},{type:YN.CATEGORY,position:XN.BOTTOM}],e=>e?.direction==="horizontal"),themeTemplate:_ne,groupable:!0,paletteFactory:({takeColors:e,themeTemplateParameters:t})=>{const i=t.get(Vne),s=(Array.isArray(i)?i[0]:i)??"white",{fills:[o],strokes:[n]}=e(1);let r;try{r=pM.mix(pM.fromString(s),pM.fromString(o),.3).toString()}catch{r=o}return{fill:r,stroke:n,backgroundFill:s}}},Wne=1e3,ZN=ns,jne=fo,Une=go,qN=Ys;function Kne(e,t,i,s){if(e.length<Wne)return;const[o,n]=ry(s);let r=ny(e),{indexData:a,valueData:l}=ay(e,t,i,o,n,r);const c=[{maxRange:r,indexData:a}];for(;r>64;)({indexData:a,valueData:l,maxRange:r}=ly(a,l,r)),c.push({maxRange:r,indexData:a});return c.reverse(),c}var{fixNumericExtent:$ne,keyProperty:Yne,createDatumId:QN,SeriesNodePickMode:JN,ChartAxisDirection:gM,SMALLEST_KEY_INTERVAL:Xne,valueProperty:wv,diff:Zne,animationValidation:qne,computeBarFocusBounds:Qne,visibleRangeIndices:eO,ContinuousScale:Jne,OrdinalTimeScale:ere,BandScale:tre}=L,ire=class extends L.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.openKey=s.properties.openKey,this.closeKey=s.properties.closeKey,this.highKey=s.properties.highKey,this.lowKey=s.properties.lowKey}},eW=class extends L.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[JN.AXIS_ALIGNED,JN.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},directionNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},pathsPerSeries:[]}),this.NodeEvent=ire,this.dataAggregationFilters=void 0}async processData(e){if(!this.properties.isValid()||!this.visible)return;const{xKey:t,openKey:i,closeKey:s,highKey:o,lowKey:n}=this.properties,r=!this.ctx.animationManager.isSkipped(),a=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:d,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:l}),u=[];r&&(this.processedData&&u.push(Zne(this.id,this.processedData)),u.push(qne())),i&&u.push(wv(i,h,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:p,processedData:g}=await this.requestDataModel(e,this.data,{props:[Yne(t,d,{id:"xValue"}),wv(s,h,{id:"closeValue"}),wv(o,h,{id:"highValue"}),wv(n,h,{id:"lowValue"}),...c?[Xne]:[],...u]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(e,t){const i=this.axes[gM.X];if(i==null||!(Jne.is(i.scale)||ere.is(i.scale)))return;const s=e.resolveKeysById(this,"xValue",t),o=e.resolveColumnById(this,"highValue",t),n=e.resolveColumnById(this,"lowValue",t),{index:r}=e.resolveProcessedDataDefById(this,"xValue"),a=t.domain.keys[r];return Kne(s,o,n,a)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];if(e!==this.getBarDirection()){const{index:o,def:n}=i.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[o];return n.type==="key"&&n.valueType==="category"?r:this.padBandExtent(r)}const s=this.domainForClippedRange(gM.Y,["highValue","lowValue"],"xValue",!0);return $ne(s)}getSeriesRange(e,t){return this.domainForVisibleRange(gM.Y,["highValue","lowValue"],"xValue",t,!0)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["highValue","lowValue"],e,t,i)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),o=this.getValueAxis();if(!(t&&i&&s&&o))return;const n=[],{xKey:r,highKey:a,lowKey:l}=this.properties,c=i.dataSources.get(this.id)??[],d=t.resolveKeysById(this,"xValue",i),h=t.resolveColumnById(this,"openValue",i),u=t.resolveColumnById(this,"closeValue",i),p=t.resolveColumnById(this,"highValue",i),g=t.resolveColumnById(this,"lowValue",i),{groupScale:f}=this,{barWidth:y,groupIndex:m}=this.updateGroupScale(s),C=f.convert(String(m)),b=y>=1?y:f.rawBandwidth,S=tre.is(s.scale),A={itemId:r,nodeData:n,labelData:[],scales:this.calculateScaling(),visible:this.visible};if(!e)return A;const R=(F,_,W,z,U,G,V,O)=>{const H=c[F],B=S?V/2:0,Y=s.scale.convert(_)+C+B,q=o.scale.convert(W),Z=o.scale.convert(z),ee=o.scale.convert(U),se=o.scale.convert(G),j=z>W,X=j?"up":"down",$=Math.min(ee,se),J=Math.max(ee,se)-$,ie={x:Y,y:$+J/2};n.push({series:this,itemId:X,datum:H,datumIndex:F,xKey:r,xValue:_,openValue:W,closeValue:z,highValue:U,lowValue:G,midPoint:ie,aggregatedValue:z,isRising:j,centerX:Y,width:V,y:$,height:J,yOpen:q,yClose:Z,crisp:O})},{dataAggregationFilters:I}=this,w=s.scale,[M,T]=w.range,E=T-M,P=F=>w.convert(d[F])+C,N=I?.find(F=>F.maxRange>E);if(N==null){let[F,_]=eO(c.length,s.range,W=>{const z=P(W);return[z,z+b]});i.input.count<1e3&&(F=0,_=i.input.count);for(let W=F;W<_;W+=1){const z=d[W];if(z==null)continue;const U=h[W],G=u[W],V=p[W],O=g[W],H=O!=null&&O<=U&&O<=G,B=V!=null&&V>=U&&V>=G;if(!H){et.warnOnce(`invalid low value for key [${l}] in data element, low value cannot be higher than datum open or close values`);continue}if(!B){et.warnOnce(`invalid high value for key [${a}] in data element, high value cannot be lower than datum open or close values.`);continue}R(W,z,U,G,V,O,b,!0)}}else{const{maxRange:F,indexData:_}=N,[W,z]=eO(F,s.range,U=>{const G=U*_o,V=_[G+ZN],O=_[G+qN];if(V!==-1)return[P(V),P(O)+b]});for(let U=W;U<z;U+=1){const G=U*_o,V=_[G+ZN],O=_[G+qN],H=_[G+jne],B=_[G+Une];if(V===-1)continue;const Y=(V+O)/2|0,q=d[Y];if(q==null)continue;const Z=h[V],ee=u[O],se=p[H],j=g[B],X=Math.abs(P(O)-P(V))+b;R(Y,q,Z,ee,se,j,X,!1)}}return A}isVertical(){return!0}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}updateLabelNodes(e){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}getItemBaseStyle(e,t){const{properties:i}=this,s=i.item[e],o=t?i.highlightStyle.item:void 0;return{fill:o?.fill??s.fill,fillOpacity:o?.fillOpacity??s.fillOpacity,stroke:o?.stroke??s.stroke,strokeWidth:o?.strokeWidth??s.strokeWidth,strokeOpacity:o?.strokeOpacity??s.strokeOpacity,lineDash:o?.lineDash??s.lineDash,lineDashOffset:o?.lineDashOffset??s.lineDashOffset}}getItemStyleOverrides(e,t,i,s,o){const{id:n,properties:r}=this,{itemStyler:a}=r;if(a==null)return;const{xKey:l,openKey:c,closeKey:d,highKey:h,lowKey:u}=r;return this.cachedDatumCallback(QN(e,o?"highlight":"node"),()=>a({seriesId:n,datum:t,itemId:i,xKey:l,openKey:c,closeKey:d,highKey:h,lowKey:u,highlighted:o,...s}))}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:n,xName:r,yName:a,openKey:l,openName:c,highKey:d,highName:h,lowKey:u,lowName:p,closeKey:g,closeName:f,legendItemName:y,tooltip:m}=o,C=this.getCategoryAxis(),b=this.getValueAxis();if(!i||!s||!C||!b)return;const{datumIndex:S}=e,A=s.dataSources.get(this.id)?.[S],R=i.resolveKeysById(this,"xValue",s)[S],I=i.resolveColumnById(this,"openValue",s)[S],w=i.resolveColumnById(this,"highValue",s)[S],M=i.resolveColumnById(this,"lowValue",s)[S],T=i.resolveColumnById(this,"closeValue",s)[S];if(R==null)return;const E=T>=I?"up":"down",P=this.properties.item[E],N=this.getItemBaseStyle(E,!1);return Object.assign(N,this.getItemStyleOverrides(String(S),A,E,N,!1)),m.formatTooltip({heading:C.formatDatum(R),title:y,symbol:{marker:{fill:P.fill??P.stroke,fillOpacity:P.fillOpacity??P.strokeOpacity??1,stroke:P.stroke,strokeWidth:P.strokeWidth??1,strokeOpacity:P.strokeOpacity??1,lineDash:P.lineDash??[0],lineDashOffset:P.lineDashOffset??0}},data:[{label:c,fallbackLabel:l,value:b.formatDatum(I)},{label:h,fallbackLabel:d,value:b.formatDatum(w)},{label:p,fallbackLabel:u,value:b.formatDatum(M)},{label:f,fallbackLabel:g,value:b.formatDatum(T)}]},{seriesId:t,datum:A,title:a,itemId:E,xKey:n,xName:r,yName:a,openKey:l,openName:c,highKey:d,highName:h,lowKey:u,lowName:p,closeKey:g,closeName:f,...N})}getDatumId(e){return QN(e.xValue)}computeFocusBounds(e){const t=this.getNodeData()?.at(e.datumIndex);if(t==null)return;const{centerX:i,y:s,width:o,height:n}=t,r={x:i-o/2,y:s,width:o,height:n};return Qne(this,r)}},{Path:sre,ScenePathChangeDetection:Xc,BBox:ore}=L,ma=class extends sre{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1,this.strokeAlignment=0}computeBBox(){const{centerX:e,y:t,width:i,height:s}=this;return new ore(e-i/2,t,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return{x:this.centerX,y:this.y+this.height/2}}alignedCoordinates(){const{y:e,width:t,height:i,crisp:s,strokeAlignment:o}=this;let{centerX:n,yOpen:r,yClose:a}=this,l=n-t/2,c=n+t/2,d=e,h=e+i;if(s&&t>1){n=this.align(n),r=this.align(r),a=this.align(a);const p=this.align(t/2);l=n-p,c=n+p,d=this.align(e),h=d+this.align(d,i)}const u=(d+h)/2;return n+=o,l+=o,c+=o,d-=o,h+=o,r+=r<u?o:-o,a+=a<u?o:-o,{centerX:n,x0:l,x1:c,y0:d,y1:h,yOpen:r,yClose:a}}executeStroke(e,t){const{width:i,strokeWidth:s}=this;i<s&&(e.lineWidth=i),super.executeStroke(e,t)}};v([Xc()],ma.prototype,"centerX");v([Xc()],ma.prototype,"y");v([Xc()],ma.prototype,"width");v([Xc()],ma.prototype,"height");v([Xc()],ma.prototype,"yOpen");v([Xc()],ma.prototype,"yClose");v([Xc()],ma.prototype,"crisp");v([Xc()],ma.prototype,"strokeAlignment");var nre=class extends ma{updatePath(){const{path:e}=this,{centerX:t,x0:i,x1:s,y0:o,y1:n,yOpen:r,yClose:a}=this.alignedCoordinates();e.clear(),e.moveTo(t,o),e.lineTo(t,n),Math.abs(s-i)>1&&(e.moveTo(i,r),e.lineTo(t,r),e.moveTo(t,a),e.lineTo(s,a))}},{ScenePathChangeDetection:dy,ExtendedPath2D:rre}=L,qp=class extends ma{constructor(){super(...arguments),this.wickPath=new rre,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:o,lineDashOffset:n,wickStroke:r,wickStrokeWidth:a,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:d,strokeAlignment:h}=this,{centerX:u,x0:p,x1:g,y0:f,y1:y,yOpen:m,yClose:C}=this.alignedCoordinates();this.path.clear(),this.wickPath.clear();const S=r!=null&&r!==t||a!=null&&a!==i||l!=null&&l!==s||c!=null&&c!==o||d!=null&&d!==n?this.wickPath:e;if(Math.abs(g-p)<=3){S.moveTo(u,f),S.lineTo(u,y);return}const A=Math.min(m,C),R=Math.max(m,C);S.moveTo(u,f),S.lineTo(u,A+i/2),S.moveTo(u,y),S.lineTo(u,R-i/2);const I=h+i/2,w=R-A-2*I;if(w>0)e.rect(p+I,A+I,g-p-2*I,w);else{const M=(A+R)/2;e.moveTo(p,M),e.lineTo(g,M)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:n,lineDashOffset:r,wickStroke:a=i,wickStrokeWidth:l=s,wickStrokeOpacity:c=o,wickLineDash:d=n,wickLineDashOffset:h=r}=this;l!==0&&(e.globalAlpha*=c,typeof a=="string"&&(e.strokeStyle=a),e.lineWidth=l,d!=null&&e.setLineDash(d),e.lineDashOffset=h,e.stroke(t.getPath2D()))}};v([dy()],qp.prototype,"wickStroke");v([dy()],qp.prototype,"wickStrokeWidth");v([dy()],qp.prototype,"wickStrokeOpacity");v([dy()],qp.prototype,"wickLineDash");v([dy()],qp.prototype,"wickLineDashOffset");var{BaseProperties:tW,Validate:fi,AbstractBarSeriesProperties:are,SeriesTooltip:lre,STRING:vr,COLOR_STRING:cre,FUNCTION:dre,LINE_DASH:hre,OBJECT:xx,POSITIVE_NUMBER:iW,RATIO:ure}=L,lh=class extends tW{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};v([fi(cre)],lh.prototype,"stroke");v([fi(iW)],lh.prototype,"strokeWidth");v([fi(ure)],lh.prototype,"strokeOpacity");v([fi(hre)],lh.prototype,"lineDash");v([fi(iW)],lh.prototype,"lineDashOffset");var Pk=class extends tW{constructor(){super(...arguments),this.up=new lh,this.down=new lh}};v([fi(xx)],Pk.prototype,"up");v([fi(xx)],Pk.prototype,"down");var Zo=class extends are{};v([fi(vr)],Zo.prototype,"xKey");v([fi(vr)],Zo.prototype,"openKey");v([fi(vr)],Zo.prototype,"closeKey");v([fi(vr)],Zo.prototype,"highKey");v([fi(vr)],Zo.prototype,"lowKey");v([fi(vr,{optional:!0})],Zo.prototype,"xName");v([fi(vr,{optional:!0})],Zo.prototype,"yName");v([fi(vr,{optional:!0})],Zo.prototype,"openName");v([fi(vr,{optional:!0})],Zo.prototype,"closeName");v([fi(vr,{optional:!0})],Zo.prototype,"highName");v([fi(vr,{optional:!0})],Zo.prototype,"lowName");var wx=class extends Zo{constructor(){super(...arguments),this.tooltip=new lre,this.item=new Pk}};v([fi(xx)],wx.prototype,"tooltip");v([fi(xx)],wx.prototype,"item");v([fi(dre,{optional:!0})],wx.prototype,"itemStyler");var{BaseProperties:Nk,SeriesTooltip:pre,Validate:_i,COLOR_STRING:Ok,FUNCTION:gre,LINE_DASH:sW,OBJECT:hy,POSITIVE_NUMBER:uy,RATIO:Fk}=L,Qp=class extends Nk{};v([_i(Ok,{optional:!0})],Qp.prototype,"stroke");v([_i(uy)],Qp.prototype,"strokeWidth");v([_i(Fk)],Qp.prototype,"strokeOpacity");v([_i(sW,{optional:!0})],Qp.prototype,"lineDash");v([_i(uy)],Qp.prototype,"lineDashOffset");var hr=class extends Nk{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Qp}};v([_i(Ok,{optional:!0})],hr.prototype,"fill");v([_i(Fk)],hr.prototype,"fillOpacity");v([_i(Ok)],hr.prototype,"stroke");v([_i(uy)],hr.prototype,"strokeWidth");v([_i(Fk)],hr.prototype,"strokeOpacity");v([_i(sW)],hr.prototype,"lineDash");v([_i(uy)],hr.prototype,"lineDashOffset");v([_i(uy)],hr.prototype,"cornerRadius");v([_i(hy)],hr.prototype,"wick");var Bk=class extends Nk{constructor(){super(...arguments),this.up=new hr,this.down=new hr}};v([_i(hy)],Bk.prototype,"up");v([_i(hy)],Bk.prototype,"down");var Mx=class extends Zo{constructor(){super(...arguments),this.item=new Bk,this.tooltip=new pre}};v([_i(hy)],Mx.prototype,"item");v([_i(hy)],Mx.prototype,"tooltip");v([_i(gre,{optional:!0})],Mx.prototype,"itemStyler");var{createDatumId:fre}=L,Gk=class extends eW{constructor(){super(...arguments),this.properties=new Mx}nodeFactory(){return new qp}updateDatumNodes({datumSelection:e,isHighlight:t}){const{id:i,properties:s}=this,{xKey:o,highKey:n,lowKey:r,openKey:a,closeKey:l,item:c,itemStyler:d}=s,{up:h,down:u}=c,{fill:p,fillOpacity:g,stroke:f,strokeWidth:y,strokeOpacity:m,lineDash:C,lineDashOffset:b}=h,{stroke:S,strokeWidth:A,strokeOpacity:R,lineDash:I,lineDashOffset:w}=h.wick,{fill:M,fillOpacity:T,stroke:E,strokeWidth:P,strokeOpacity:N,lineDash:F,lineDashOffset:_}=u,{stroke:W,strokeWidth:z,strokeOpacity:U,lineDash:G,lineDashOffset:V}=u.wick,O=t?s.highlightStyle.item:void 0;e.each((H,B)=>{const{isRising:Y,centerX:q,width:Z,y:ee,height:se,yOpen:j,yClose:X,crisp:$}=B;let J;if(d!=null){const{fill:ne,fillOpacity:K,stroke:oe,strokeWidth:de,strokeOpacity:re,lineDash:ce,lineDashOffset:be}=Y?h:u;J=this.cachedDatumCallback(fre(this.getDatumId(B),t?"highlight":"node"),()=>d({seriesId:i,itemId:B.itemId,xKey:o,highKey:n,lowKey:r,openKey:a,closeKey:l,datum:B.datum,fill:ne,fillOpacity:K,strokeOpacity:re,stroke:oe,strokeWidth:de,lineDash:ce,lineDashOffset:be,highlighted:t}))}H.centerX=q,H.width=Z,H.y=ee,H.height=se,H.yOpen=j,H.yClose=X,H.crisp=$,H.fill=O?.fill??J?.fill??(Y?p:M),H.fillOpacity=O?.fillOpacity??J?.fillOpacity??(Y?g:T),H.stroke=O?.stroke??J?.stroke??(Y?f:E),H.strokeWidth=O?.strokeWidth??J?.strokeWidth??(Y?y:P),H.strokeOpacity=O?.strokeOpacity??J?.strokeOpacity??(Y?m:N),H.lineDash=O?.lineDash??J?.lineDash??(Y?C:F),H.lineDashOffset=O?.lineDashOffset??J?.lineDashOffset??(Y?b:_);const ie=J?.wick;H.wickStroke=O?.stroke??ie?.stroke??(Y?S:W),H.wickStrokeWidth=O?.strokeWidth??ie?.strokeWidth??(Y?A:z),H.wickStrokeOpacity=O?.strokeOpacity??ie?.strokeOpacity??(Y?R:U),H.wickLineDash=O?.lineDash??ie?.lineDash??(Y?I:G),H.wickLineDashOffset=O?.lineDashOffset??ie?.lineDashOffset??(Y?w:V),H.strokeAlignment=(J?.strokeWidth??(Y?y:P))/2})}legendItemSymbol(){const{up:e,down:t}=this.properties.item,i=new L.LinearGradient("rgb",[{color:e.fill,offset:0},{color:e.fill,offset:.5},{color:t.fill,offset:.5}],90),s=new L.LinearGradient("rgb",[{color:e.stroke,offset:0},{color:e.stroke,offset:.5},{color:t.stroke,offset:.5}],90);return{marker:{fill:i,fillOpacity:e.fillOpacity,stroke:s,strokeWidth:e.strokeWidth??1,strokeOpacity:e.strokeOpacity??1,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset}}}getLegendData(e){const{id:t,data:i,visible:s,ctx:{legendManager:o}}=this,{xKey:n,yName:r,showInLegend:a,legendItemName:l}=this.properties;return!i?.length||!n||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&o.getItemEnabled({seriesId:t,itemId:t}),label:{text:l??r??t},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!a}]}};Gk.className="CandleStickSeries";Gk.type="candlestick";var{CARTESIAN_AXIS_TYPE:tO}=L.ThemeConstants,mre={series:{highlightStyle:{item:{strokeWidth:3}}},animation:{enabled:!1},axes:{[tO.NUMBER]:{crosshair:{snap:!1}},[tO.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:iO,CARTESIAN_POSITION:sO}=L.ThemeConstants,yre={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:e=>new Gk(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:iO.NUMBER,position:sO.LEFT},{type:iO.ORDINAL_TIME,position:sO.BOTTOM}],themeTemplate:mre,groupable:!1,paletteFactory:({takeColors:e,colorsCount:t,userPalette:i,palette:s})=>{if(i==="user-indexed"){const{fills:o,strokes:n}=e(t);return{item:{up:{fill:"transparent",stroke:n[0]},down:{fill:o[0],stroke:n[0]}}}}return{item:{up:s.up,down:s.down}}}};function oO(e,t,i){i||(t=vre(t));const s=new Map;for(const n of e)s.set(n.id,{datum:n,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let o=0;return s.forEach((n,r)=>{o=Math.max(o,vD(s,t,n,r,-1,[])+vD(s,t,n,r,1,[])+1)}),{links:t,nodeGraph:s,maxPathLength:o}}function oW(e,t,i,s){const o=s.indexOf(t);if(o!==-1){for(let r=o;r<s.length;r+=1)i.add(s[r]);return}s.push(t);const{toNode:n}=t;for(const r of e)r.fromNode===n&&oW(e,r,i,s);s.pop()}function vre(e){const t=new Set;for(const i of e)oW(e,i,t,[]);return t.size!==0&&et.warnOnce("Some links formed circular references. These will be removed from the output."),t.size===0?e:e.filter(i=>!t.has(i))}function vD(e,t,i,s,o,n){if(n.includes(s))return 1/0;let r=o===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(r===-1){r=0;const a=o===-1?i.linksBefore:i.linksAfter;for(const l of t){const{fromNode:c,toNode:d}=l,h=o===-1?d.id:c.id,u=o===-1?c.id:d.id,p=s===h?e.get(u):void 0;p!=null&&(a.push({node:p,link:l}),n?.push(s),r=Math.max(r,vD(e,t,p,u,o,n)+1),n?.pop())}o===-1?i.maxPathLengthBefore=r:i.maxPathLengthAfter=r}return r}var{Series:Cre,DataController:bre,Validate:Sre,ARRAY:xre,keyProperty:wre,valueProperty:Mv,Selection:xd,Group:au,TransformableText:Mre}=L,Dre=class extends L.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s);const{datumIndex:o}=i,n=s.contextNodeData?.nodeData.find(r=>r.datumIndex.type===o.type&&r.datumIndex.index===o.index);this.size=n?.size,this.label=n?.type===1?n?.label:void 0}},_k=class extends Cre{constructor(){super(...arguments),this.NodeEvent=Dre,this._chartNodes=void 0,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new au({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new au({name:"nodeGroup"})),this.focusLinkGroup=this.highlightNode.appendChild(new au({name:"linkGroup"})),this.focusNodeGroup=this.highlightNode.appendChild(new au({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightNode.appendChild(new au({name:"linkGroup"})),this.highlightNodeGroup=this.highlightNode.appendChild(new au({name:"nodeGroup"})),this.labelSelection=xd.select(this.labelGroup,Mre),this.linkSelection=xd.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=xd.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=xd.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=xd.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=xd.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=xd.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes??this._chartNodes}setChartNodes(e){this._chartNodes=e,this.nodes===e&&(this.nodeDataRefresh=!0)}async processData(e){const{data:t,nodes:i}=this;if(t==null||!this.properties.isValid())return;const{fromKey:s,toKey:o,sizeKey:n,idKey:r,labelKey:a}=this.properties,l=new bre("standalone",e.suppressFieldDotNotation),c=i!=null?l.request(this.id,i,{props:[wre(r,void 0,{id:"idValue",includeProperty:!1}),...a!=null?[Mv(a,void 0,{id:"labelValue",includeProperty:!1})]:[]],groupByKeys:!0}):null,d=e.request(this.id,t,{props:[Mv(s,void 0,{id:"fromValue",includeProperty:!1}),Mv(o,void 0,{id:"toValue",includeProperty:!1}),...n!=null?[Mv(n,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]:[]],groupByKeys:!1});i!=null&&l.execute();const[h,u]=await Promise.all([c,d]);this.nodesDataModel=h?.dataModel,this.nodesProcessedData=h?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const p=new Map;if(h==null){const g=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),f=u.dataModel.resolveColumnById(this,"toValue",u.processedData),y=m=>{const C=p.size;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:C},type:1,index:C,linksBefore:[],linksAfter:[],id:m,size:0,label:m}};u.processedData.dataSources.get(this.id)?.forEach((m,C)=>{const b=g[C],S=f[C];b==null||S==null||(p.has(b)||p.set(b,y(b)),p.has(S)||p.set(S,y(S)))})}else{const g=h.dataModel.resolveColumnById(this,"idValue",h.processedData),f=a!=null?h.dataModel.resolveColumnById(this,"labelValue",h.processedData):void 0;h.processedData.dataSources.get(this.id)?.forEach((y,m)=>{const C=g[m],b=f?.[m];p.set(C,{series:this,itemId:void 0,datum:y,datumIndex:{type:1,index:m},type:1,index:m,linksBefore:[],linksAfter:[],id:C,size:0,label:b})})}this.processedNodes=p}getNodeGraph(e,t,{includeCircularReferences:i}){const{linksDataModel:s,linksProcessedData:o}=this;if(s==null||o==null){const{links:g,nodeGraph:f,maxPathLength:y}=oO(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:f,links:g,maxPathLength:y}}const{sizeKey:n}=this.properties,r=s.resolveColumnById(this,"fromValue",o),a=s.resolveColumnById(this,"toValue",o),l=n!=null?s.resolveColumnById(this,"sizeValue",o):void 0,c=new Map;this.processedNodes.forEach(g=>{const f=e(g);c.set(g.id,f)});const d=[];o.dataSources.get(this.id)?.forEach((g,f)=>{const y=r[f],m=a[f],C=l!=null?l[f]:1,b=c.get(y),S=c.get(m);if(C<=0||b==null||S==null)return;const A=t({series:this,itemId:void 0,datum:g,datumIndex:{type:0,index:f},type:0,index:f,fromNode:b,toNode:S,size:C});d.push(A)});const{links:h,nodeGraph:u,maxPathLength:p}=oO(c.values(),d,i);return u.forEach(g=>{g.datum.linksBefore=g.linksBefore.map(f=>f.link),g.datum.linksAfter=g.linksAfter.map(f=>f.link)}),this.nodeCount=u.size,this.linkCount=h.length,{nodeGraph:u,links:h,maxPathLength:p}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(e){const{seriesRect:t}=e,i={seriesRectWidth:t?.width??0,seriesRectHeight:t?.height??0};(this._nodeDataDependencies==null||this._nodeDataDependencies.seriesRectWidth!==i.seriesRectWidth||this._nodeDataDependencies.seriesRectHeight!==i.seriesRectHeight)&&(this._nodeDataDependencies=i),this.updateSelections();const s=this.contextNodeData?.nodeData??[],o=this.contextNodeData?.labelData??[];let n=this.ctx.highlightManager?.getActiveHighlight();if(n?.series===this&&n.type==null){const{itemId:d}=n;n=d!=null?s.find(h=>h.type===1&&h.id===d):void 0}else n?.series!==this&&(n=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=n!=null?this.properties.highlightStyle.series.dimOpacity??1:1,this.labelSelection=this.updateLabelSelection({labelData:o,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:s.filter(d=>d.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:s.filter(d=>d.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let r,a,l,c;n?.type===1?(r=s.filter(d=>d.type===0&&(d.toNode===n||d.fromNode===n)),a=r.map(d=>d.fromNode===n?d.toNode:d.fromNode),a.push(n),l=[],c=[n]):n?.type===0?(r=[n],a=[n.fromNode,n.toNode],l=[n],c=[]):(r=[],a=[],l=[],c=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:r,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:a,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:l,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:c,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}resetAnimation(e){}getSeriesDomain(e){return[]}getSeriesRange(e,t){return[NaN,NaN]}legendItemSymbol(e,t,i={}){const{fills:s,strokes:o}=this.properties,{fill:n=s[t%s.length],fillOpacity:r=1,stroke:a=o[t%o.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:d=[0],lineDashOffset:h=0}=i;return{marker:{fill:n,fillOpacity:r,stroke:a,strokeWidth:l,strokeOpacity:c,lineDash:d,lineDashOffset:h}}}getLegendData(e){if(e!=="category")return[];const{showInLegend:t}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:s},o)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:s??i},symbol:this.legendItemSymbol(1,o),hideInLegend:!t,isFixed:!0}))}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.linkSelection.each((o,n)=>{const r=o.containsPoint(e,t)?0:1/0;r<i&&(i=r,s=n)}),this.nodeSelection.each((o,n)=>{const r=o.distanceSquared(e,t);r<i&&(i=r,s=n)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}getDatumAriaText(e,t){if(e.type===0)return this.ctx.localeManager.t("ariaAnnounceFlowProportionLink",{index:e.index+1,count:this.linkCount,from:e.fromNode.id,to:e.toNode.id,size:e.size,sizeName:this.properties.sizeName??this.properties.sizeKey});if(e.type===1)return this.ctx.localeManager.t("ariaAnnounceFlowProportionNode",{index:e.index+1,count:this.nodeCount,description:t})}pickFocus(e){const{datumIndexDelta:t,otherIndexDelta:i}=e,s=this.contextNodeData?.nodeData[e.datumIndex-e.datumIndexDelta];let o=s;if(i!==0||t===0)return;if(s?.type===0){const a=Array.from(this.linkSelection,d=>d.datum),c=a.indexOf(s)+t;if(c>=0&&c<a.length)o=a[c];else if(c>0)o=a[a.length-1];else{const d=Array.from(this.nodeSelection,h=>h.datum);o=d[d.length-1]}}else if(s?.type===1){const a=Array.from(this.nodeSelection,d=>d.datum),c=a.indexOf(s)+t;c>=0&&c<a.length?o=a[c]:c<0?o=a[0]:o=Array.from(this.linkSelection,h=>h.datum)[0]}if(o==null)return;const n=o.type===1?Array.from(this.nodeSelection).find(a=>a.datum===o):Array.from(this.linkSelection).find(a=>a.datum===o);if(n==null)return;const r=this.computeFocusBounds(n.node);if(r!=null)return{datum:n.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(n.datum)??0,otherIndex:0,bounds:r,clipFocusBox:!0}}};v([Sre(xre,{optional:!0,property:"nodes"})],_k.prototype,"_chartNodes");var{BBox:Are,Path:Ire,ScenePathChangeDetection:Zc}=L;function lb({radius:e,startAngle:t,endAngle:i,tension:s}){const o=e*Math.cos(t),n=e*Math.sin(t),r=e*Math.cos(i),a=e*Math.sin(i),l=o*s,c=n*s,d=r*s,h=a*s;return{x:[o,l,d,r],y:[n,c,h,a]}}var kl=class extends Ire{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}computeBBox(){const{centerX:e,centerY:t,radius:i,startAngle1:s,endAngle1:o,startAngle2:n,endAngle2:r,tension:a}=this,l=lb({radius:i,startAngle:s,endAngle:r,tension:a}),c=lb({radius:i,startAngle:n,endAngle:o,tension:a}),d=Math.min(...l.x,...c.x),h=Math.max(...l.x,...c.x)-d,u=Math.min(...l.y,...c.y),p=Math.max(...l.y,...c.y)-u;return new Are(e+d,t+u,h,p)}tensionedCurveTo(e,t,i,s,o,n,r,a){const{path:l,tension:c}=this,d=1-c;l.cubicCurveTo((i-e)*d+e,(s-t)*d+t,(o-r)*d+r,(n-a)*d+a,r,a)}updatePath(){const{path:e,centerX:t,centerY:i,radius:s}=this;let{startAngle1:o,endAngle1:n,startAngle2:r,endAngle2:a}=this;o>r&&([o,r]=[r,o],[n,a]=[a,n]),e.clear();const l=t+s*Math.cos(o),c=i+s*Math.sin(o);e.moveTo(l,c),this.tensionedCurveTo(l,c,t,i,t,i,t+s*Math.cos(a),i+s*Math.sin(a)),e.arc(t,i,s,a,r,!0),this.tensionedCurveTo(t+s*Math.cos(r),i+s*Math.sin(r),t,i,t,i,t+s*Math.cos(n),i+s*Math.sin(n)),e.arc(t,i,s,n,o,!0),e.closePath()}};v([Zc()],kl.prototype,"centerX");v([Zc()],kl.prototype,"centerY");v([Zc()],kl.prototype,"radius");v([Zc()],kl.prototype,"startAngle1");v([Zc()],kl.prototype,"endAngle1");v([Zc()],kl.prototype,"startAngle2");v([Zc()],kl.prototype,"endAngle2");v([Zc()],kl.prototype,"tension");var{BaseProperties:nW,SeriesTooltip:Rre,SeriesProperties:kre,ARRAY:Tre,COLOR_STRING:Dx,COLOR_STRING_ARRAY:rW,FUNCTION:aW,LINE_DASH:lW,OBJECT:Ax,POSITIVE_NUMBER:qc,RATIO:py,STRING:Qc,Validate:Xe,Label:Lre}=L,zk=class extends Lre{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};v([Xe(qc)],zk.prototype,"spacing");v([Xe(qc)],zk.prototype,"maxWidth");var ya=class extends nW{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}};v([Xe(Dx,{optional:!0})],ya.prototype,"fill");v([Xe(py)],ya.prototype,"fillOpacity");v([Xe(Dx,{optional:!0})],ya.prototype,"stroke");v([Xe(py)],ya.prototype,"strokeOpacity");v([Xe(qc)],ya.prototype,"strokeWidth");v([Xe(lW)],ya.prototype,"lineDash");v([Xe(qc)],ya.prototype,"lineDashOffset");v([Xe(py)],ya.prototype,"tension");v([Xe(aW,{optional:!0})],ya.prototype,"itemStyler");var Cr=class extends nW{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};v([Xe(qc)],Cr.prototype,"spacing");v([Xe(qc)],Cr.prototype,"width");v([Xe(Dx,{optional:!0})],Cr.prototype,"fill");v([Xe(py)],Cr.prototype,"fillOpacity");v([Xe(Dx,{optional:!0})],Cr.prototype,"stroke");v([Xe(py)],Cr.prototype,"strokeOpacity");v([Xe(qc)],Cr.prototype,"strokeWidth");v([Xe(lW)],Cr.prototype,"lineDash");v([Xe(qc)],Cr.prototype,"lineDashOffset");v([Xe(aW,{optional:!0})],Cr.prototype,"itemStyler");var Ps=class extends kre{constructor(){super(...arguments),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fills=[],this.strokes=[],this.label=new zk,this.link=new ya,this.node=new Cr,this.tooltip=new Rre}};v([Xe(Qc)],Ps.prototype,"fromKey");v([Xe(Qc)],Ps.prototype,"toKey");v([Xe(Qc)],Ps.prototype,"idKey");v([Xe(Qc,{optional:!0})],Ps.prototype,"idName");v([Xe(Qc,{optional:!0})],Ps.prototype,"labelKey");v([Xe(Qc,{optional:!0})],Ps.prototype,"labelName");v([Xe(Qc,{optional:!0})],Ps.prototype,"sizeKey");v([Xe(Qc,{optional:!0})],Ps.prototype,"sizeName");v([Xe(Tre,{optional:!0})],Ps.prototype,"nodes");v([Xe(rW)],Ps.prototype,"fills");v([Xe(rW)],Ps.prototype,"strokes");v([Xe(Ax)],Ps.prototype,"label");v([Xe(Ax)],Ps.prototype,"link");v([Xe(Ax)],Ps.prototype,"node");v([Xe(Ax)],Ps.prototype,"tooltip");var{SeriesNodePickMode:nO,CachedTextMeasurerPool:Ere,TextWrapper:Pre,TextUtils:Nre,createDatumId:Dv,angleBetween:pC,normalizeAngle360:Ore,isBetweenAngles:rO,Sector:Fre,evaluateBezier:Av,applyShapeStyle:Bre}=L,Iv=e=>e.startAngle+pC(e.startAngle,e.endAngle)/2,Vk=class extends _k{constructor(e){super({moduleCtx:e,pickModes:[nO.NEAREST_NODE,nO.EXACT_SHAPE_MATCH]}),this.properties=new Ps}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new kl}nodeFactory(){return new Fre}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:o,sizeKey:n,label:{spacing:r,maxWidth:a,fontSize:l},node:{width:c,spacing:d}}=this.properties,h=t/2,u=i/2;let p=[];const{nodeGraph:g,links:f}=this.getNodeGraph(N=>({...N,centerX:h,centerY:u,innerRadius:NaN,outerRadius:NaN,startAngle:NaN,endAngle:NaN}),N=>({...N,centerX:h,centerY:u,radius:NaN,startAngle1:NaN,endAngle1:NaN,startAngle2:NaN,endAngle2:NaN}),{includeCircularReferences:!0});let y=0;g.forEach(({datum:N,linksBefore:F,linksAfter:_},W)=>{const z=F.reduce((U,{link:G})=>U+G.size,0)+_.reduce((U,{link:G})=>U+G.size,0);if(z===0)g.delete(W);else{N.size=z,y+=N.size;const U=this.getLabelText(this.properties.label,{datum:N.datum,value:N.label,fromKey:s,toKey:o,sizeKey:n,size:N.size});N.label=String(U)}});let m=0;if(this.isLabelEnabled()){const N=this.properties.label.getFont();let F=0;g.forEach(({datum:_})=>{const{id:W,label:z}=_;if(z==null)return;const U=Pre.wrapText(z,{maxWidth:a,font:this.properties.label,textWrap:"never"}),{width:G}=Ere.measureText(U,{font:N,textAlign:"left",textBaseline:"middle"});F=Math.max(G,F),p.push({id:W,text:U,centerX:h,centerY:u,angle:NaN,radius:NaN})}),m=F+r}const C=g.size;let b=Math.min(t,i)/2-c-m,S=d/b;if(m!==0&&(C*S>=1.5*Math.PI||b<=0)&&(p=[],b=Math.min(t,i)/2-c,S=d/b),C*S>=2*Math.PI||b<=0){et.warnOnce("There was insufficient space to display the Chord Series.");return}const A=b,R=b+c,I=Math.max((2*Math.PI-C*S)/y,0);let w=0;g.forEach(({datum:N})=>{N.innerRadius=A,N.outerRadius=R,N.startAngle=w,N.endAngle=w+N.size*I,w=N.endAngle+S;const F=(N.innerRadius+N.outerRadius)/2,_=Iv(N);N.midPoint={x:N.centerX+F*Math.cos(_),y:N.centerY+F*Math.sin(_)}});const M=[];g.forEach(({datum:N,linksBefore:F,linksAfter:_})=>{const W=Iv(N),z=[...F.map(G=>({link:G.link,distance:pC(Iv(G.node.datum),W),after:!1})),..._.map(G=>({link:G.link,distance:pC(Iv(G.node.datum),W),after:!0}))];let U=N.startAngle;z.toSorted((G,V)=>G.distance-V.distance).forEach(({link:G,after:V})=>{const O=G.size*I;V?(G.startAngle1=U,G.endAngle1=U+O):(G.startAngle2=U,G.endAngle2=U+O),U+=G.size*I}),M.push(N)});const{tension:T}=this.properties.link;f.forEach(N=>{N.radius=b;const F=lb({radius:b,startAngle:N.startAngle1,endAngle:N.endAngle2,tension:T}),_=lb({radius:b,startAngle:N.startAngle2,endAngle:N.endAngle1,tension:T}),W=Av(...F.x,.5),z=Av(...F.y,.5),U=Av(..._.x,.5),G=Av(..._.y,.5);N.midPoint={x:N.centerX+(W+U)/2,y:N.centerY+(z+G)/2},M.push(N)}),p.forEach(N=>{const F=g.get(N.id)?.datum;F!=null&&(N.radius=R+r,N.angle=Ore(F.startAngle+pC(F.startAngle,F.endAngle)/2))}),p.sort((N,F)=>N.angle-F.angle);let E=1/0,P=-1/0;return p=p.filter(N=>{const F=Nre.getLineHeight(l),_=Math.atan2(F/2,N.radius),W=N.angle-_,z=N.angle+_;return rO(E,W,z)||rO(P,W,z)?!1:(E=Math.min(W,E),P=Math.max(z,P),!0)}),{itemId:e,nodeData:M,labelData:p}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{color:i,fontStyle:s,fontWeight:o,fontSize:n,fontFamily:r}=this.properties.label;t.each((a,{text:l,centerX:c,centerY:d,radius:h,angle:u})=>{a.visible=!0,a.translationX=c+h*Math.cos(u),a.translationY=d+h*Math.sin(u),a.text=l,a.fill=i,a.fontStyle=s,a.fontWeight=o,a.fontSize=n,a.fontFamily=r,a.textBaseline="middle",Math.cos(u)>=0?(a.textAlign="left",a.rotation=u):(a.textAlign="right",a.rotation=u-Math.PI)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Dv([t.type,t.id]))}getBaseNodeStyle(e){const{properties:t}=this,{fill:i,fillOpacity:s,stroke:o,strokeOpacity:n,lineDash:r,lineDashOffset:a}=t.node,l=e?t.highlightStyle.item:void 0;return{fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??o,strokeOpacity:l?.strokeOpacity??n,strokeWidth:l?.strokeWidth??this.getStrokeWidth(t.node.strokeWidth),lineDash:l?.lineDash??r,lineDashOffset:l?.lineDashOffset??a}}getNodeStyleOverrides(e,t,i,s,o,n,r){const{id:a,properties:l}=this,{fills:c,strokes:d}=l,{itemStyler:h}=l.node,u=n.fill??c[i%c.length],p=n.stroke??d[i%d.length],g={};if(r||(g.fill=u,g.stroke=p),h!=null){const f=this.cachedDatumCallback(Dv(e,r?"highlight":"node"),()=>{const{fillOpacity:y=1,strokeOpacity:m=1,strokeWidth:C=0,lineDash:b=[],lineDashOffset:S=0}=n;return h({seriesId:a,datum:t,highlighted:r,label:o,size:s,fill:u,fillOpacity:y,stroke:p,strokeOpacity:m,strokeWidth:C,lineDash:b,lineDashOffset:S})});Object.assign(g,f)}return g}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getBaseNodeStyle(i);t.each((o,n)=>{const{datumIndex:r,size:a,label:l}=n,c=this.getNodeStyleOverrides(String(r),n,r.index,a,l,s,i);o.centerX=n.centerX,o.centerY=n.centerY,o.innerRadius=n.innerRadius,o.outerRadius=n.outerRadius,o.startAngle=n.startAngle,o.endAngle=n.endAngle,o.fill=c.fill??s?.fill,o.fillOpacity=c.fillOpacity??s?.fillOpacity,o.stroke=c.stroke??s?.stroke,o.strokeOpacity=c.strokeOpacity??s?.strokeOpacity,o.strokeWidth=c.strokeWidth??s?.strokeWidth,o.lineDash=c.lineDash??s?.lineDash,o.lineDashOffset=c.lineDashOffset??s?.lineDashOffset,o.inset=o.strokeWidth/2})}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Dv([t.type,t.index,t.fromNode.id,t.toNode.id]))}getBaseLinkStyle(e){const{properties:t}=this,{fill:i,fillOpacity:s,stroke:o,strokeOpacity:n,lineDash:r,lineDashOffset:a,tension:l}=t.link,c=e?t.highlightStyle.item:void 0;return{fill:c?.fill??i,fillOpacity:c?.fillOpacity??s,stroke:c?.stroke??o,strokeOpacity:c?.strokeOpacity??n,strokeWidth:c?.strokeWidth??this.getStrokeWidth(t.link.strokeWidth),lineDash:c?.lineDash??r,lineDashOffset:c?.lineDashOffset??a,tension:l}}getLinkStyleOverrides(e,t,i,s,o){const{id:n,properties:r}=this,{fills:a,strokes:l}=r,{itemStyler:c}=r.link,d=s.fill??a[i%a.length],h=s.stroke??l[i%l.length],u={};if(o||(u.fill=d,u.stroke=h),c!=null){const p=this.cachedDatumCallback(Dv(e,o?"highlight":"node"),()=>{const{fillOpacity:g=1,strokeOpacity:f=1,strokeWidth:y=0,lineDash:m=[],lineDashOffset:C=0,tension:b}=s;return c({seriesId:n,datum:t,highlighted:o,tension:b,fill:d,fillOpacity:g,stroke:h,strokeOpacity:f,strokeWidth:y,lineDash:m,lineDashOffset:C})});Object.assign(u,p)}return u}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getBaseLinkStyle(i);t.each((o,n)=>{const{datumIndex:r}=n,a=n.fromNode.datumIndex,l=this.getLinkStyleOverrides(String(r),n,a.index,s,i);o.centerX=n.centerX,o.centerY=n.centerY,o.radius=n.radius,o.startAngle1=n.startAngle1,o.endAngle1=n.endAngle1,o.startAngle2=n.startAngle2,o.endAngle2=n.endAngle2,Bre(o,s,l),o.tension=l?.tension??s.tension})}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:o}=this,{fromKey:n,toKey:r,sizeKey:a,sizeName:l,tooltip:c}=o,{datumIndex:d}=e,h=e.type===0?e.fromNode.index:e.index,u=e.type===0?`${e.fromNode.label} - ${e.toNode.label}`:e.label,p=d.type===0?i?.dataSources.get(this.id)?.[d.index]:s?.dataSources.get(this.id)?.[d.index],g=e.size;let f;if(e.type===0){const y=e.fromNode.datumIndex,m=this.getBaseLinkStyle(!1);Object.assign(m,this.getLinkStyleOverrides(String(d),p,y.index,m,!1)),f=m}else{const y=e.label,m=this.getBaseNodeStyle(!1);Object.assign(m,this.getNodeStyleOverrides(String(d),p,d.index,g,y,m,!1)),f=m}return c.formatTooltip({title:u,symbol:this.legendItemSymbol(e.type,h,f),data:a!=null?[{label:l,fallbackLabel:a,value:String(g)}]:[]},{seriesId:t,datum:p,title:u,fromKey:n,toKey:r,sizeKey:a,sizeName:l,size:g,...f})}computeFocusBounds(e){return e}};Vk.className="ChordSeries";Vk.type="chord";var Gre={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"chord",tooltipDefaults:{range:"exact"},moduleFactory:e=>new Vk(e),themeTemplate:{series:{highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0,tension:.4}},legend:{enabled:!1,toggleSeries:!1}},paletteFactory({takeColors:e,colorsCount:t}){const{fills:i,strokes:s}=e(t);return{fills:i,strokes:s}}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:ku,CARTESIAN_POSITION:lu},ThemeSymbols:{DEFAULT_SHADOW_COLOUR:_re}}=L;function cW(e){const{placement:t,...i}=e?.stageLabel??{};return e?.direction!=="horizontal"?[{type:ku.CATEGORY,position:t==="after"?lu.RIGHT:lu.LEFT,label:i},{type:ku.NUMBER,position:lu.BOTTOM}]:[{type:ku.NUMBER,position:lu.LEFT},{type:ku.CATEGORY,position:t==="before"?lu.TOP:lu.BOTTOM,label:i}]}var zre={series:{direction:"vertical",strokeWidth:0,spacingRatio:.25,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:0},shadow:{enabled:!1,color:_re,xOffset:3,yOffset:3,blur:5}},axes:{[ku.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter(e){return Math.abs(e.value).toFixed(e.fractionDigits??0)}}},[ku.CATEGORY]:{line:{enabled:!1}}}},{lineDistanceSquared:Rv,BBox:Vre,Path:Hre,ScenePathChangeDetection:Jc}=L,aO=1e-6;function lO([e,t],[i,s]){return Math.abs(e-i)<=aO&&Math.abs(t-s)<=aO}var va=class extends Hre{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:e,y0:t,x1:i,y1:s,x2:o,y2:n,x3:r,y3:a}=this;return{x:(e+i+o+r)/4,y:(t+s+n+a)/4}}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const{x0:i,y0:s,x1:o,y1:n,x2:r,y2:a,x3:l,y3:c}=this;return Math.min(Rv(e,t,i,s,o,n,1/0),Rv(e,t,o,n,r,a,1/0),Rv(e,t,r,a,l,c,1/0),Rv(e,t,l,c,i,s,1/0))}computeBBox(){const{x0:e,y0:t,x1:i,y1:s,x2:o,y2:n,x3:r,y3:a}=this,l=Math.min(e,i,o,r),c=Math.max(e,i,o,r)-l,d=Math.min(t,s,n,a),h=Math.max(t,s,n,a)-d;return new Vre(l,d,c,h)}updatePath(){const{path:e,x0:t,y0:i,x1:s,y1:o,x2:n,y2:r,x3:a,y3:l}=this,c=[[t,i],[s,o],[n,r],[a,l]];e.clear();let d,h;c.forEach(u=>{if(d!=null&&lO(d,u)||h!=null&&lO(h,u))return;const[p,g]=u;d==null?e.moveTo(p,g):e.lineTo(p,g),d??(d=u),h=u}),e.closePath()}};v([Jc()],va.prototype,"x0");v([Jc()],va.prototype,"y0");v([Jc()],va.prototype,"x1");v([Jc()],va.prototype,"y1");v([Jc()],va.prototype,"x2");v([Jc()],va.prototype,"y2");v([Jc()],va.prototype,"x3");v([Jc()],va.prototype,"y3");var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:Wre}=L;function cO(e,t,i,s){const{x0:o,y0:n,x1:r,y1:a,x2:l,y2:c,x3:d,y3:h,opacity:u}=e;return i?{x0:(o+d)/2,y0:(n+h)/2,x1:(r+l)/2,y1:(a+c)/2,x2:(r+l)/2,y2:(a+c)/2,x3:(o+d)/2,y3:(n+h)/2,opacity:u}:{x0:(o+r)/2,y0:(n+a)/2,x1:(o+r)/2,y1:(n+a)/2,x2:(l+d)/2,y2:(c+h)/2,x3:(l+d)/2,y3:(c+h)/2,opacity:u}}function jre(e,t){const i=n=>n==null;return{fromFn:(n,r,a)=>{a==="updated"&&i(r)?a="removed":a==="updated"&&i(n.previousDatum)&&(a="added");let l;a==="added"&&n.previousDatum==null&&t==="fade"||(a==="unknown"||a==="added"?l=cO(r,n.previousDatum,e):l={x0:n.x0,y0:n.y0,x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,x3:n.x3,y3:n.y3,opacity:n.opacity});const c=Wre[a];return{...l,phase:c}},toFn:(n,r,a)=>{let l;return a==="removed"&&n.datum==null&&t==="fade"||(a==="removed"||i(r)?l=cO(r,n.previousDatum,e):l=CD(n,r)),l}}}function CD(e,t){const{x0:i,y0:s,x1:o,y1:n,x2:r,y2:a,x3:l,y3:c,opacity:d}=t;return{x0:i,y0:s,x1:o,y1:n,x2:r,y2:a,x3:l,y3:c,opacity:d}}var{SeriesNodePickMode:dO,SeriesZIndexMap:hO,valueProperty:Ure,keyProperty:Kre,ChartAxisDirection:uO,updateLabelNode:$re,SMALLEST_KEY_INTERVAL:Yre,LARGEST_KEY_INTERVAL:Xre,diff:Zre,fixNumericExtent:qre,seriesLabelFadeInAnimation:pO,resetMotion:Qre,resetLabelFn:Jre,animationValidation:eae,computeBarFocusBounds:tae,ContinuousScale:iae,Group:sae,Selection:oae,PointerEvents:gO,motion:nae,checkCrisp:rae,createDatumId:aae}=L,lae=class extends L.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.stageKey,this.yKey=s.properties.valueKey}},dW=class extends L.AbstractBarSeries{constructor({moduleCtx:e,animationResetFns:t}){super({moduleCtx:e,pickModes:[dO.AXIS_ALIGNED,dO.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["stageKey"],y:["valueKey"]},directionNames:{x:[],y:[]},datumSelectionGarbageCollection:!1,animationResetFns:{datum:t.datum,label:Jre}}),this.NodeEvent=lae,this.connectorNodeGroup=this.contentGroup.appendChild(new sae({name:`${this.id}-series-connectorNodes`,zIndex:hO.BACKGROUND})),this.connectorSelection=oae.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=gO.None}get pickModeAxis(){return"main-category"}setSeriesIndex(e){return super.setSeriesIndex(e)?(this.connectorNodeGroup.zIndex=[hO.BACKGROUND,e],!0):!1}isVertical(){return!super.isVertical()}connectionFactory(){return new va}async processData(e){if(!this.properties.isValid())return;const{stageKey:t,valueKey:i}=this.properties,{visible:s,id:o}=this,n=(g,f,y)=>s&&this.ctx.legendManager.getItemEnabled({seriesId:o,itemId:y}),r=this.getCategoryAxis()?.scale,a=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:d}=this.getScaleInformation({xScale:r,yScale:a}),h=[];this.ctx.animationManager.isSkipped()||(this.processedData&&h.push(Zre(this.id,this.processedData)),h.push(eae()));const u=this.visible?{}:{forceValue:0},{processedData:p}=await this.requestDataModel(e,this.data,{props:[Kre(t,c,{id:"xValue"}),Ure(i,d,{id:"yValue",...u,validation:n,invalidValue:0}),...l?[Yre,Xre]:[],...h],groupByKeys:!1});this.smallestDataInterval=p.reduced?.smallestKeyInterval,this.largestDataInterval=p.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:o}}=this;if(!t||!i)return[];const{keys:[n]}=t.domain;if(e===this.getCategoryDirection()){const r=i.resolveProcessedDataDefById(this,"xValue");return r?.def.type==="key"&&r?.def.valueType==="category"?this.hasData?n.filter((a,l)=>o.getItemEnabled({seriesId:s,itemId:l})):[]:this.padBandExtent(n)}else{const r=this.domainForClippedRange(uO.Y,["yValue"],"xValue",!0),a=Math.max(...r),l=[-a,a];return qre(l)}}getSeriesRange(e,t){return[NaN,NaN]}createNodeData(){const{hasData:e,data:t,dataModel:i,groupScale:s,processedData:o,id:n,ctx:{legendManager:r}}=this,a=this.getCategoryAxis(),l=this.getValueAxis();if(!(e&&t&&a&&l&&i&&o?.type==="ungrouped"))return;const c=a.scale,d=l.scale,h=this.getBarDirection()===uO.X,{stageKey:u,valueKey:p}=this.properties,{strokeWidth:g}=this.barStyle(),f=`${p}`,y={itemId:f,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),visible:this.visible},m=this.visible;if(!m)return y;const C=i.resolveKeysById(this,"xValue",o),b=i.resolveColumnById(this,"yValue",o),{barWidth:S,groupIndex:A}=this.updateGroupScale(a),R=iae.is(c)?S*-.5:0,I=rae(a?.scale,a?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let w;return(o.dataSources.get(this.id)??[]).forEach((T,E)=>{const P=m&&r.getItemEnabled({seriesId:n,itemId:E}),N=C[E];if(N==null)return;const F=Math.round(c.convert(N))+s.convert(String(A))+R,_=b[E],W=Math.round(d.convert(-_)),z=Math.round(d.convert(_)),U=Math.max(g,Math.abs(z-W)),G={x:h?Math.min(z,W):F,y:h?F:Math.min(z,W),width:h?U:S,height:h?S:U},V={x:G.x+G.width/2,y:G.y+G.height/2},O=this.createLabelData({datumIndex:E,rect:G,barAlongX:h,yDatum:_,datum:T,visible:P}),H={index:E,series:this,itemId:f,datum:T,datumIndex:E,xValue:N,yValue:_,xKey:u,yKey:p,x:G.x,y:G.y,width:G.width,height:G.height,midPoint:V,strokeWidth:g,crisp:I,label:O,visible:P};if(y.nodeData.push(H),O!=null&&y.labelData.push(O),w!=null){const B=w.rect,Y=w.nodeDatum,q=w.datumIndex;h?y.connectorData.push({datum:Y,datumIndex:q,x0:B.x,y0:B.y+B.height,x1:B.x+B.width,y1:B.y+B.height,x2:G.x+G.width,y2:G.y,x3:G.x,y3:G.y,opacity:1}):y.connectorData.push({datum:Y,datumIndex:q,x0:B.x+B.width,y0:B.y,x1:G.x,y1:G.y,x2:G.x,y2:G.y+G.height,x3:B.x+B.width,y3:B.y+B.height,opacity:1})}P&&(w={itemId:f,rect:G,nodeDatum:H,datumIndex:E})}),y}updateNodes(e,t,i){super.updateNodes(e,t,i);const{connectorSelection:s}=this,o=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:s,connectorData:o}),this.updateConnectorNodes({connectorSelection:s})}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s,void 0,o=>this.getDatumId(o))}updateConnectorSelection(e){const{connectorData:t,connectorSelection:i}=e;return i.update(this.connectorEnabled()?t:[],void 0,s=>this.getDatumId(s.datum))}updateConnectorNodes(e){const{fills:t,strokes:i}=this.properties,{fill:s,fillOpacity:o,stroke:n,strokeOpacity:r,strokeWidth:a,lineDash:l,lineDashOffset:c}=this.connectorStyle();e.connectorSelection.each((d,h)=>{const{datumIndex:u}=h;d.setProperties(CD(d,h)),d.fill=s??t[u%t.length],d.fillOpacity=o,d.stroke=n??i[u%i.length],d.strokeOpacity=r,d.strokeWidth=a,d.lineDash=l,d.lineDashOffset=c})}getHighlightLabelData(e,t){const i=e.filter(s=>s.datum===t.datum);return i.length>0?i:void 0}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=gO.None})}updateLabelNodes(e){e.labelSelection.each((t,i)=>{$re(t,this.properties.label,i)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{stageKey:n,valueKey:r,tooltip:a}=o,l=this.getCategoryAxis(),c=this.getValueAxis();if(!i||!s||!l||!c)return;const{datumIndex:d}=e,h=s.dataSources.get(this.id)?.[d],u=i.resolveKeysById(this,"xValue",s)[d],p=i.resolveColumnById(this,"yValue",s)[d];if(u!=null)return a.formatTooltip({symbol:this.legendItemSymbol(d),data:[{label:l.formatDatum(u),value:c.formatDatum(p)}]},{seriesId:t,datum:h,title:n,stageKey:n,valueKey:r,...this.tooltipStyle(h,d)})}resetAllAnimation(e){super.resetAllAnimation(e),Qre([this.connectorSelection],CD)}animateEmptyUpdateReady({labelSelection:e}){const{connectorSelection:t}=this,i=this.isVertical(),o=jre(i,"normal");nae.fromToMotion(this.id,"connectors",this.ctx.animationManager,[t],o),pO(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(e){const{labelSelection:t}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id),pO(this,"labels",this.ctx.animationManager,t)}getDatumId(e){return aae(e.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return tae(this,this.contextNodeData?.nodeData[e])}legendItemSymbol(e){const{strokeWidth:t,fillOpacity:i,strokeOpacity:s,lineDash:o,lineDashOffset:n}=this.barStyle(),{fills:r,strokes:a}=this.properties,l=r[e%r.length]??"black",c=a[e%a.length]??"black";return{marker:{fill:l,fillOpacity:i,stroke:c,strokeWidth:t,strokeOpacity:s,lineDash:o,lineDashOffset:n}}}getLegendData(e){const{id:t,processedData:i,dataModel:s,ctx:{legendManager:o},visible:n}=this;if(!s||!i||e!=="category"||!this.properties.isValid())return[];const{showInLegend:r}=this.properties,a=s.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)??[]).map((l,c)=>{const d=a[c];if(d!=null)return{legendType:"category",id:t,datum:l,itemId:c,seriesId:t,enabled:n&&o.getItemEnabled({seriesId:t,itemId:c}),label:{text:String(d)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!r}}).filter(l=>l!=null)}},{Label:cae,AbstractBarSeriesProperties:dae,SeriesTooltip:hae,AxisLabel:uae,Validate:io,UNION:hW,COLOR_STRING_ARRAY:uW,LINE_DASH:pae,OBJECT:Hk,POSITIVE_NUMBER:Wk,RATIO:pW,STRING:gW}=L,jk=class extends cae{constructor(){super(...arguments),this.spacing=0}};v([io(hW(["before","middle","after"],"a placement"))],jk.prototype,"placement");v([io(Wk)],jk.prototype,"spacing");var fW=class extends uae{};v([io(hW(["before","after"],"a placement"))],fW.prototype,"placement");var qo=class extends dae{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new jk,this.stageLabel=new fW,this.tooltip=new hae}};v([io(gW)],qo.prototype,"stageKey");v([io(gW)],qo.prototype,"valueKey");v([io(uW)],qo.prototype,"fills");v([io(pW)],qo.prototype,"fillOpacity");v([io(uW)],qo.prototype,"strokes");v([io(Wk)],qo.prototype,"strokeWidth");v([io(pW)],qo.prototype,"strokeOpacity");v([io(pae)],qo.prototype,"lineDash");v([io(Wk)],qo.prototype,"lineDashOffset");v([io(Hk)],qo.prototype,"label");v([io(Hk)],qo.prototype,"stageLabel");v([io(Hk)],qo.prototype,"tooltip");function fO(e,{x:t,y:i,width:s,height:o,opacity:n}){return{x1:t,y1:i,x2:t+s,y2:i+o,opacity:n}}var{formatValue:gae,Line:fae}=L,Uk=class extends dW{constructor(e){super({moduleCtx:e,animationResetFns:{datum:fO}}),this.properties=new qo}get hasData(){const{id:e,ctx:{legendManager:t}}=this,i=this.data?.reduce((s,o,n)=>s+(t.getItemEnabled({seriesId:e,itemId:n})?1:0),0);return i!=null&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}barStyle(){return{fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[],lineDashOffset:0}}connectorStyle(){const{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:o}=this.properties;return{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:o}}nodeFactory(){return new fae}createLabelData({datumIndex:e,rect:t,barAlongX:i,yDatum:s,datum:o,visible:n}){const{stageKey:r,valueKey:a,label:l}=this.properties,{spacing:c,placement:d}=l;let h,u,p,g;if(i)switch(h=t.x+t.width/2,p="center",d){case"before":u=t.y-c,g="bottom";break;case"after":u=t.y+t.height+c,g="top";break;default:u=t.y+t.height/2,g="middle"}else switch(u=t.y+t.height/2,g="middle",d){case"before":h=t.x-c,p="right";break;case"after":h=t.x+t.width+c,p="left";break;default:h=t.x+t.width/2,p="center"}return{x:h,y:u,textAlign:p,textBaseline:g,text:this.getLabelText(l,{itemId:a,value:s,datum:o,stageKey:r,valueKey:a},f=>gae(f,0)),itemId:a,datum:o,datumIndex:e,series:this,visible:n}}updateDatumNodes(e){const t=e.isHighlight?this.properties.highlightStyle.item:void 0;e.datumSelection.each((i,s)=>{i.setProperties(fO(i,s)),i.stroke=t?.stroke,i.strokeWidth=t?.strokeWidth??0,i.strokeOpacity=t?.strokeOpacity??1,i.lineDash=t?.lineDash,i.lineDashOffset=t?.lineDashOffset??0})}tooltipStyle(e,t){const{fills:i,strokes:s}=this.properties,o=i[t%i.length]??"black",n=s[t%s.length]??"black",{fillOpacity:r,strokeOpacity:a,strokeWidth:l,lineDash:c,lineDashOffset:d}=this.barStyle();return{fill:o,fillOpacity:r,stroke:n,strokeOpacity:a,strokeWidth:l,lineDash:c,lineDashOffset:d}}};Uk.className="ConeFunnelSeries";Uk.type="cone-funnel";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:mO}}=L,mae={series:{direction:"vertical",strokeWidth:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4}},seriesArea:{padding:{top:20,bottom:20}},axes:{[mO.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter(e){return Math.abs(e.value).toFixed(e.fractionDigits??0)}}},[mO.CATEGORY]:{line:{enabled:!1}}}},yae={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"cone-funnel",moduleFactory:e=>new Uk(e),solo:!0,tooltipDefaults:{range:"nearest"},defaultAxes:cW,themeTemplate:mae,paletteFactory:({userPalette:e,themeTemplateParameters:t,takeColors:i,colorsCount:s})=>{const{fills:o}=i(s),n=t.get(L.ThemeSymbols.DEFAULT_FUNNEL_SERIES_COLOR_RANGE),r=e==="inbuilt"?n:[o[0],o[1]];return{fills:r,strokes:r.slice(0)}}},{Label:vae,DropShadow:Cae,AbstractBarSeriesProperties:bae,BaseProperties:Sae,SeriesTooltip:xae,AxisLabel:wae,Validate:Nt,UNION:Mae,BOOLEAN:Dae,COLOR_STRING_ARRAY:mW,COLOR_STRING:yW,FUNCTION:Aae,LINE_DASH:vW,OBJECT:gy,POSITIVE_NUMBER:Ix,RATIO:fy,STRING:CW}=L,Iae=class extends vae{},bW=class extends wae{};v([Nt(Mae(["before","after"],"a placement"))],bW.prototype,"placement");var Tl=class extends Sae{constructor(){super(...arguments),this.enabled=!0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};v([Nt(Dae)],Tl.prototype,"enabled");v([Nt(yW,{optional:!0})],Tl.prototype,"fill");v([Nt(fy)],Tl.prototype,"fillOpacity");v([Nt(yW,{optional:!0})],Tl.prototype,"stroke");v([Nt(Ix)],Tl.prototype,"strokeWidth");v([Nt(fy)],Tl.prototype,"strokeOpacity");v([Nt(vW)],Tl.prototype,"lineDash");v([Nt(Ix)],Tl.prototype,"lineDashOffset");var hs=class extends bae{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new Tl,this.shadow=new Cae().set({enabled:!1}),this.label=new Iae,this.stageLabel=new bW,this.tooltip=new xae}};v([Nt(CW)],hs.prototype,"stageKey");v([Nt(CW)],hs.prototype,"valueKey");v([Nt(mW)],hs.prototype,"fills");v([Nt(fy)],hs.prototype,"fillOpacity");v([Nt(mW)],hs.prototype,"strokes");v([Nt(Ix)],hs.prototype,"strokeWidth");v([Nt(fy)],hs.prototype,"strokeOpacity");v([Nt(vW)],hs.prototype,"lineDash");v([Nt(Ix)],hs.prototype,"lineDashOffset");v([Nt(fy)],hs.prototype,"spacingRatio");v([Nt(Aae,{optional:!0})],hs.prototype,"itemStyler");v([Nt(gy)],hs.prototype,"dropOff");v([Nt(gy)],hs.prototype,"shadow");v([Nt(gy)],hs.prototype,"label");v([Nt(gy)],hs.prototype,"stageLabel");v([Nt(gy)],hs.prototype,"tooltip");var{ChartAxisDirection:Rae,resetBarSelectionsFn:kae,prepareBarAnimationFunctions:yO,midpointStartingBarPosition:vO,createDatumId:Tae,formatValue:Lae,Rect:Eae,motion:CO,applyShapeStyle:Pae}=L,Kk=class extends dW{constructor(e){super({moduleCtx:e,animationResetFns:{datum:kae}}),this.properties=new hs}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}barStyle(){const{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:o}=this.properties;return{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:o}}connectorStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeOpacity:s,strokeWidth:o,lineDash:n,lineDashOffset:r}=this.properties.dropOff;return{fill:e,fillOpacity:t,stroke:i,strokeOpacity:s,strokeWidth:o,lineDash:n,lineDashOffset:r}}nodeFactory(){return new Eae}createLabelData({datumIndex:e,rect:t,yDatum:i,datum:s,visible:o}){const{valueKey:n,stageKey:r,label:a}=this.properties;return{x:t.x+t.width/2,y:t.y+t.height/2,textAlign:"center",textBaseline:"middle",text:this.getLabelText(a,{itemId:r,value:i,datum:s,valueKey:n,stageKey:r},l=>Lae(l,0)),itemId:r,datum:s,datumIndex:e,series:this,visible:o}}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset}}getItemStyleOverrides(e,t,i,s,o){const{id:n,properties:r}=this,{stageKey:a,valueKey:l,fills:c,strokes:d,itemStyler:h}=r,u=s.fill??c[i%c.length]??"black",p=s.stroke??d[i%d.length]??"black",g={};if(o||(g.fill=u,g.stroke=p),h!=null){const f=this.cachedDatumCallback(Tae(e,o?"highlight":"node"),()=>{const{fillOpacity:y,strokeOpacity:m,strokeWidth:C,lineDash:b,lineDashOffset:S}=s;return h({seriesId:n,datum:t,highlighted:o,stageKey:a,valueKey:l,fill:u,fillOpacity:y,stroke:p,strokeOpacity:m,strokeWidth:C,lineDash:b,lineDashOffset:S})});Object.assign(g,f)}return g}updateDatumNodes(e){const{shadow:t}=this.properties,{datumSelection:i,isHighlight:s}=e,o=this.getCategoryDirection()===Rae.X,n=this.getItemBaseStyle(s);i.each((r,a)=>{const{datumIndex:l}=a,c=this.getItemStyleOverrides(String(a.datumIndex),a.datum,l,n,s);Pae(r,n,c),r.visible=o?a.width>0:a.height>0,r.crisp=a.crisp,r.fillShadow=t})}tooltipStyle(e,t){const i=this.getItemBaseStyle(!1);return Object.assign(i,this.getItemStyleOverrides(String(t),e,t,i,!1)),i}animateEmptyUpdateReady(e){super.animateEmptyUpdateReady(e);const{datumSelection:t}=e,i=this.isVertical(),o=yO(vO(i,"normal"));CO.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],o)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e);const{datumSelection:t}=e,{processedData:i}=this,s=i?.reduced?.diff?.[this.id],o=yO(vO(this.isVertical(),"fade"));CO.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],o,(n,r)=>r.xValue,s)}};Kk.className="FunnelSeries";Kk.type="funnel";var Nae={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"funnel",moduleFactory:e=>new Kk(e),solo:!0,tooltipDefaults:{range:"exact"},defaultAxes:cW,themeTemplate:zre,paletteFactory:({takeColors:e})=>{const{fills:t,strokes:i}=e(1);return{fills:t,strokes:i}}},{CachedTextMeasurerPool:SW,TextUtils:xW,TextWrapper:cb}=L;function Oae(e,t){const{fontSize:i,minimumFontSize:s=i}=e,{fontSize:o,minimumFontSize:n=o}=t,r=i-s,a=o-n;let l=e.fontSize,c=t.fontSize;const d=[{labelFontSize:i,secondaryLabelFontSize:o}];for(;l>s||c>n;){const h=r>0?(l-s)/r:-1,u=a>0?(c-n)/a:-1;h>u?l--:c--,d.push({labelFontSize:l,secondaryLabelFontSize:c})}return d.reverse(),d}function sp(e,t){return e.lineHeight!=null&&e.fontSize!=null?e.lineHeight*t/e.fontSize:xW.getLineHeight(t)}function wW(e,t,i,s,{padding:o},n){const{spacing:r=0}=t,a=2*o,l=2*o+r,c=(t.minimumFontSize??t.fontSize)+(s.minimumFontSize??s.fontSize);if(c>n(c+l,!1).height-l)return;const d=Oae(t,s),h={fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},u={fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let p,g;return uV(0,d.length-1,f=>{const{labelFontSize:y,secondaryLabelFontSize:m}=d[f],C=f===0,b=sp(t,y),S=sp(s,m),A=n(b+S+l,C),R=A.width-a,I=A.height-l;if(b+S>I||((p==null||p.fontSize!==y)&&(h.fontSize=y,p=SO(t,e,R,I,h,t.wrapping,C?t.overflowStrategy:"hide")),p==null||p.width>R||p.height>I)||((g==null||g.fontSize!==m)&&(u.fontSize=m,g=SO(s,i,R,I,u,s.wrapping,C?s.overflowStrategy:"hide")),g==null))return;const w=p.height+g.height;if(!(g.width>R||w>I))return{width:Math.max(p.width,g.width),height:w+r,meta:A.meta,label:p,secondaryLabel:g}})}function tm(e,t,{padding:i},s){const o=2*i,n=Math.min(t.minimumFontSize??t.fontSize,t.fontSize),r={fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight};return uV(n,t.fontSize,a=>{const l=sp(t,a),c=a===n,d=s(l+o,c),h=d.width-o,u=d.height-o;if(l>u)return;r.fontSize=a;const p=cb.wrapLines(e,{maxWidth:h,maxHeight:u,font:r,textWrap:t.wrapping,overflow:(c?t.overflowStrategy:void 0)??"hide"});if(!p.length)return;const g=Fae(p,{lineHeight:l,font:r,maxWidth:h,maxHeight:u});if(g)return[{fontSize:a,lineHeight:l,...g},d.meta]})}function bO(e){return e?.minimumFontSize!=null&&e?.fontSize!=null&&e?.minimumFontSize>e?.fontSize}function $k(e,t,i,s,o,n){const r=t.enabled?e:void 0,a=s.enabled?i:void 0;(bO(t)||bO(s))&&et.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;r!=null&&a!=null&&(l=wW(r,t,a,s,o,n));let c;if(l==null&&r!=null&&(c=tm(r,t,o,n)),c!=null){const[h,u]=c;l={width:h.width,height:h.height,meta:u,label:h,secondaryLabel:void 0}}let d;if(l==null&&r==null&&a!=null&&(d=tm(a,s,o,n)),d!=null){const[h,u]=d;l={width:h.width,height:h.height,meta:u,label:void 0,secondaryLabel:h}}return l}function SO(e,t,i,s,o,n,r){const a=cb.wrapLines(t,{maxWidth:i,maxHeight:s,font:o,textWrap:n,overflow:r});if(!a.length)return;const l=sp(e,o.fontSize),{width:c}=SW.measureLines(a,{font:o});return{width:c,lineHeight:l,text:a.join(`
15
15
  `),height:a.length*l,fontSize:o.fontSize}}function Fae(e,{font:t,lineHeight:i=xW.defaultLineHeight,maxWidth:s,maxHeight:o=1/0}){let n=i*e.length;for(;n>o;){if(e.length===1)return;e.pop(),e[e.length-1]=cb.appendEllipsis(e.at(-1)),n=i*e.length}const r=SW.measureLines(e,{font:t});let a,l;if(r.width>s){const c=[];l=0;for(const d of r.lineMetrics){if(d.width>s){if(!c.length)return;break}c.push(d.text),l=Math.max(l,d.width)}a=cb.appendEllipsis(c.join(`
16
16
  `))}else a=e.join(`
17
17
  `),l=r.width;return{text:a,width:l,height:n}}var{Validate:my,NUMBER:Bae,POSITIVE_NUMBER:MW,TEXT_WRAP:Gae,OVERFLOW_STRATEGY:_ae}=L,Jp=class extends L.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};v([my(Gae)],Jp.prototype,"wrapping");v([my(_ae)],Jp.prototype,"overflowStrategy");v([my(MW,{optional:!0})],Jp.prototype,"lineHeight");v([my(MW,{optional:!0})],Jp.prototype,"minimumFontSize");var ta=class extends Jp{constructor(){super(...arguments),this.spacing=0}};v([my(Bae)],ta.prototype,"spacing");var yy=class extends Jp{},{CartesianSeriesProperties:zae,SeriesTooltip:Vae,Validate:us,AND:Hae,ARRAY:Wae,COLOR_STRING:jae,COLOR_STRING_ARRAY:Uae,FUNCTION:Kae,OBJECT:DW,POSITIVE_NUMBER:AW,RATIO:$ae,STRING:Oh,TEXT_ALIGN:Yae,VERTICAL_ALIGN:Xae}=L,Zi=class extends zae{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new ta,this.tooltip=new Vae}};v([us(Oh,{optional:!0})],Zi.prototype,"title");v([us(Oh)],Zi.prototype,"xKey");v([us(Oh)],Zi.prototype,"yKey");v([us(Oh,{optional:!0})],Zi.prototype,"colorKey");v([us(Oh,{optional:!0})],Zi.prototype,"xName");v([us(Oh,{optional:!0})],Zi.prototype,"yName");v([us(Oh,{optional:!0})],Zi.prototype,"colorName");v([us(Hae(Uae,Wae.restrict({minLength:1})))],Zi.prototype,"colorRange");v([us(jae,{optional:!0})],Zi.prototype,"stroke");v([us($ae)],Zi.prototype,"strokeOpacity");v([us(AW,{optional:!0})],Zi.prototype,"strokeWidth");v([us(Yae)],Zi.prototype,"textAlign");v([us(Xae)],Zi.prototype,"verticalAlign");v([us(AW)],Zi.prototype,"itemPadding");v([us(Kae,{optional:!0})],Zi.prototype,"itemStyler");v([us(DW)],Zi.prototype,"label");v([us(DW)],Zi.prototype,"tooltip");var{SeriesNodePickMode:xO,computeBarFocusBounds:Zae,getMissCount:qae,valueProperty:fM,ChartAxisDirection:on,DEFAULT_CARTESIAN_DIRECTION_KEYS:Qae,DEFAULT_CARTESIAN_DIRECTION_NAMES:Jae,createDatumId:ele,ColorScale:tle,Rect:ile,PointerEvents:sle,applyShapeStyle:ole}=L,nle=class extends L.CartesianSeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.colorKey=s.properties.colorKey}},rle={left:-.5,center:0,right:-.5},ale={top:-.5,middle:0,bottom:-.5},Yk=class extends L.CartesianSeries{constructor(e){super({moduleCtx:e,directionKeys:Qae,directionNames:Jae,pickModes:[xO.NEAREST_NODE,xO.EXACT_SHAPE_MATCH],pathsPerSeries:[],hasMarkers:!1,hasHighlightedLabels:!0}),this.properties=new Zi,this.NodeEvent=nle,this.colorScale=new tle}async processData(e){const t=this.axes[on.X],i=this.axes[on.Y];if(!t||!i||!this.properties.isValid()||!this.data?.length)return;const{xKey:s,yKey:o,colorRange:n,colorKey:r}=this.properties,a=this.axes[on.X]?.scale,l=this.axes[on.Y]?.scale,{xScaleType:c,yScaleType:d}=this.getScaleInformation({xScale:a,yScale:l}),h=this.colorScale.type,{dataModel:u,processedData:p}=await this.requestDataModel(e,this.data,{props:[fM(s,c,{id:"xValue"}),fM(o,d,{id:"yValue"}),...r?[fM(r,h,{id:"colorValue"})]:[]]});if(this.isColorScaleValid()){const g=u.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=p.domain.values[g],this.colorScale.range=n,this.colorScale.update()}}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),o=i.input.count,n=qae(this,i.defs.values[s].missing);return!(o===0||o===n)}xCoordinateRange(e,t){const i=this.axes[on.X].scale,s=t*(i.bandwidth??0)/2,o=i.convert(e)+s,n=t*(i.bandwidth??10);return[o,o+n]}yCoordinateRange(e,t){const i=this.axes[on.Y].scale,s=t*(i.bandwidth??0)/2,o=i.convert(e[0])+s,n=t*(i.bandwidth??10);return[o,o+n]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;return!t||!i?[]:e===on.X?t.getDomain(this,"xValue","value",i):t.getDomain(this,"yValue","value",i)}getSeriesRange(e,t){return[NaN,NaN]}createNodeData(){const{data:e,visible:t,axes:i,dataModel:s,processedData:o}=this,n=i[on.X],r=i[on.Y];if(!(e&&s&&o&&t&&n&&r))return;if(n.type!=="category"||r.type!=="category"){et.warnOnce(`Heatmap series expected axes to have "category" type, but received "${n.type}" and "${r.type}" instead.`);return}const{xKey:a,xName:l,yKey:c,yName:d,colorKey:h,colorName:u,textAlign:p,verticalAlign:g,itemPadding:f,label:y}=this.properties,m=s.resolveColumnById(this,"xValue",o),C=s.resolveColumnById(this,"yValue",o),b=h?s.resolveColumnById(this,"colorValue",o):void 0,S=n.scale,A=r.scale,R=(S.bandwidth??0)/2,I=(A.bandwidth??0)/2,w=[],M=[],T=S.bandwidth??10,E=A.bandwidth??10,P=(T-2*f)*rle[p],N=(E-2*f)*ale[g],F=()=>({width:T,height:E,meta:null});return(o.dataSources.get(this.id)??[]).forEach((W,z)=>{const U=m[z],G=C[z],V=S.convert(U)+R,O=A.convert(G)+I,H=b?.[z],B=H==null?void 0:this.getLabelText(y,{value:H,datum:W,colorKey:h,colorName:u,xKey:a,yKey:c,xName:l,yName:d}),Y=$k(B,this.properties.label,void 0,this.properties.label,{padding:f},F),q={x:V,y:O,size:0};if(w.push({series:this,itemId:c,datumIndex:z,yKey:c,xKey:a,xValue:U,yValue:G,colorValue:H,datum:W,point:q,width:T,height:E,midPoint:{x:V,y:O},missing:H==null}),Y?.label!=null){const{text:Z,fontSize:ee,lineHeight:se,height:j}=Y.label,{fontStyle:X,fontFamily:$,fontWeight:J,color:ie}=this.properties.label,ne=q.x+P*(T-2*f),K=q.y+N*(E-2*f)-(Y.height-j)*.5;M.push({series:this,itemId:c,datum:W,datumIndex:z,text:Z,fontSize:ee,lineHeight:se,fontStyle:X,fontFamily:$,fontWeight:J,color:ie,textAlign:p,verticalAlign:g,x:ne,y:K})}}),{itemId:this.properties.yKey??this.id,nodeData:w,labelData:M,scales:this.calculateScaling(),visible:this.visible}}nodeFactory(){return new ile}update(e){return this.ctx.animationManager.skipCurrentBatch(),super.update(e)}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s)}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??1,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity}}getItemStyleOverrides(e,t,i,s,o){const{id:n,properties:r}=this,{xKey:a,yKey:l,colorRange:c,itemStyler:d}=r,h=this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):c[0];let u=s.fill==null?{fill:h}:void 0;if(d!=null){u??(u={});const p=this.cachedDatumCallback(ele(e,o?"highlight":"node"),()=>d({seriesId:n,datum:t,xKey:a,yKey:l,highlighted:o,fill:h,...s}));Object.assign(u,p)}return u}updateDatumNodes(e){const{isHighlight:t}=e,i=this.axes[on.X],[s,o]=i?.visibleRange??[],r=!(s!==0||o!==1),a=this.getItemBaseStyle(t);e.datumSelection.each((l,c)=>{const{datumIndex:d,colorValue:h,datum:u,point:p,width:g,height:f}=c,y=this.getItemStyleOverrides(String(d),u,h,a,t);l.crisp=r,l.x=Math.floor(p.x-g/2),l.y=Math.floor(p.y-f/2),l.width=Math.ceil(g),l.height=Math.ceil(f),ole(l,a,y)})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e,{enabled:s}=this.properties.label,o=s?t:[];return i.update(o)}updateLabelNodes(e){e.labelSelection.each((t,i)=>{t.text=i.text,t.fontSize=i.fontSize,t.lineHeight=i.lineHeight,t.fontStyle=i.fontStyle,t.fontFamily=i.fontFamily,t.fontWeight=i.fontWeight,t.fill=i.color,t.textAlign=i.textAlign,t.textBaseline=i.verticalAlign,t.x=i.x,t.y=i.y,t.pointerEvents=sle.None})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:n,colorScale:r}=this,{xKey:a,xName:l,yKey:c,yName:d,colorKey:h,colorName:u,colorRange:p,title:g,legendItemName:f,tooltip:y}=n,m=o[on.X],C=o[on.Y];if(!i||!s||!m||!C)return;const{datumIndex:b}=e,S=s.dataSources.get(this.id)?.[b],A=i.resolveColumnById(this,"xValue",s)[b],R=i.resolveColumnById(this,"yValue",s)[b],I=h!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",s)[b]:void 0;if(A==null)return;const w=[];let M;I==null?M=p[0]:(M=r.convert(I),w.push({label:u,fallbackLabel:h,value:String(I)})),w.push({label:l,fallbackLabel:a,value:m.formatDatum(A)},{label:d,fallbackLabel:c,value:C.formatDatum(R)});const T=M!=null?{marker:{shape:"square",fill:M,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}}:void 0,E=this.getItemBaseStyle(!1);return Object.assign(E,this.getItemStyleOverrides(String(b),S,I,E,!1)),y.formatTooltip({title:g??f,symbol:T,data:w},{seriesId:t,datum:S,title:g,xKey:a,xName:l,yKey:c,yName:d,colorKey:h,colorName:u,...E})}getLegendData(e){return e!=="gradient"||!this.properties.isValid()||!this.isColorScaleValid()||!this.dataModel?[]:[{legendType:"gradient",enabled:this.visible,seriesId:this.id,colorName:this.properties.colorName,colorDomain:this.processedData.domain.values[this.dataModel.resolveProcessedDataIndexById(this,"colorValue")],colorRange:this.properties.colorRange}]}isLabelEnabled(){return this.properties.label.enabled&&!!this.properties.colorKey}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e];if(t===void 0)return;const{width:i,height:s,midPoint:o}=t,n={x:o.x-i/2,y:o.y-s/2,width:i,height:s};return Zae(this,n)}};Yk.className="HeatmapSeries";Yk.type="heatmap";var lle={series:{label:{enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3},gradientLegend:{enabled:!0}},{ThemeSymbols:{DEFAULT_DIVERGING_SERIES_COLOR_RANGE:cle,DEFAULT_BACKGROUND_COLOUR:dle},ThemeConstants:{CARTESIAN_AXIS_TYPE:wO,CARTESIAN_POSITION:MO}}=L,hle={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"heatmap",moduleFactory:e=>new Yk(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:wO.CATEGORY,position:MO.LEFT},{type:wO.CATEGORY,position:MO.BOTTOM}],themeTemplate:lle,paletteFactory:({takeColors:e,colorsCount:t,userPalette:i,themeTemplateParameters:s})=>{const o=s.get(cle),n=s.get(dle),r=(Array.isArray(n)?n[0]:n)??"white",{fills:a,strokes:l}=e(t);return{stroke:i==="inbuilt"?r:l[0],colorRange:i==="inbuilt"?o:[a[0],a[1]]}}},ule=1e3,DO=10;function AO(e,t,i,s,o,n){const r=e[n];if(r==null)return!1;const a=vx(r,t,i),l=Cx(a,o);return n===s[l+ns]||n===s[l+Ys]||n===s[l+go]||n===s[l+fo]}function ple(e,t,i){if(e.length<ule)return;const[s,o]=ry(i);let n=ny(e,DO);const{indexData:r,valueData:a}=ay(e,t,t,s,o,n);let l=[];for(let d=0;d<e.length;d+=1)AO(e,s,o,r,n,d)&&l.push(d);const c=[{maxRange:n,indices:l}];for(;l.length>DO&&n>64;)({maxRange:n}=ly(r,a,n,{inPlace:!0})),l=l.filter(AO.bind(null,e,s,o,r,n)),c.push({maxRange:n,indices:l});return c.reverse(),c}var{ChartAxisDirection:gle,ContinuousScale:fle,OrdinalTimeScale:mle}=L,yle=class extends L.LineSeries{aggregateData(e,t){const i=this.axes[gle.X];if(i==null||!(fle.is(i.scale)||mle.is(i.scale)))return;const s=e.resolveColumnById(this,"xValue",t),o=e.resolveColumnById(this,"yValueRaw",t),n=e.getDomain(this,"xValue","value",t);return ple(s,o,n)}},{LineSeriesModule:vle}=L,Cle={...vle,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"line",moduleFactory:e=>new yle(e)},{ColorScale:ble}=L;function IW(e){if(e==null)return[];const t=new ble;t.domain=[0,1],t.range=e;const i=5;return Array.from({length:5},(s,o)=>t.convert(o/(i-1)))}var RW=class{*[Symbol.iterator](){const{node:e,datum:t}=this;e&&t&&(yield{node:e,datum:t})}nodes(){return this.node?[this.node]:[]}update(e,t,i,s){const o=e.nodes();if(o.length===0)this.node?.remove(),this.node=void 0;else{this.node===void 0&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,t.appendChild(this.node));const n=o[0],r=o.toReversed().find(a=>a.datum.datum.value>a.datum.datum.segmentStart)??o[o.length-1];this.node.datum=this.datum=n.datum,s(this.node,n,r)}}},kW={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function TW(e,t){if(e==null)return"";if(t==null)return String(e);const[i,s]=t.scale.domain,o=i!==0?Math.ceil(Math.log10(Math.abs(i))):0,n=s!==0?Math.ceil(Math.log10(Math.abs(s))):0,r=Math.max(2-Math.max(o,n),0);return e.toFixed(r)}function im(e,t,i){if(t.text!=null)return t.text;const s=i??t.value,o=t?.formatter?.({seriesId:e.id,datum:void 0,value:s});if(o!=null)return String(o)}function LW({path:e,x:t,y:i,size:s}){e.moveTo(t,i-s/2),e.lineTo(t,i+s/2)}var{clamp:IO}=L;function EW(e,t){const i=rQ(e.datumUnion.nodes(),e.targetSelection.nodes());return e.pickNodeNearestDistantObject(t,i)}function PW(e,t){const i=[{data:e.contextNodeData?.nodeData,selection:e.datumUnion},{data:e.contextNodeData?.targetData,selection:e.targetSelection}].filter(l=>l.data&&l.data.length>0),s=IO(0,t.otherIndex+t.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:o,selection:n}=i[s];if(o==null||o.length===0)return;const r=IO(0,t.datumIndex,o.length-1),a=o[r];for(const l of n)if(l.datum===a)return{bounds:l.node,clipFocusBox:!0,datum:a,datumIndex:r,otherIndex:s}}var{MARKER_SHAPE:Sle,UNION:Xk,OR:xle}=L,Rx=Xk(["continuous","discrete"],"a fill mode"),NW=xle(Sle,Xk(["line"],"a marker shape")),OW=Xk(["container","item"],"a corner mode");function FW(e){let t,i;return typeof e.value=="number"&&(t=e.value),typeof e.text=="string"&&(i=e.text),{value:t,text:i}}var{BaseProperties:BW,Validate:eg,OBJECT:wle,BOOLEAN:Mle,NUMBER:Zk,NUMBER_ARRAY:Dle}=L,kx=class extends BW{getSegments(e,t){const{values:i,step:s,count:o}=this,n=Math.min(...e.domain),r=Math.max(...e.domain);let a;if(i!=null){const l=i.filter(c=>c>n&&c<r).sort((c,d)=>c-d);a=[n,...l,r]}else if(s!=null){const l=[];for(let c=n;c<r;c+=s)l.push(c);l.push(r),a=l}else if(o!=null){const l=o+1;a=Array.from({length:l+1},(c,d)=>d/l*(r-n)+n)}else{const l=e.ticks({nice:!0,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.filter(c=>c>n&&c<r);a=l!=null?[n,...l,r]:void 0}return a!=null&&a.length>t&&(et.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),a=void 0),a??(a=[n,r]),a}};v([eg(Dle,{optional:!0})],kx.prototype,"values");v([eg(Zk,{optional:!0})],kx.prototype,"step");v([eg(Zk,{optional:!0})],kx.prototype,"count");var vy=class extends BW{constructor(){super(...arguments),this.enabled=!1,this.interval=new kx,this.spacing=0}};v([eg(Mle)],vy.prototype,"enabled");v([eg(wle)],vy.prototype,"interval");v([eg(Zk)],vy.prototype,"spacing");var{BaseProperties:qk,SeriesTooltip:Ale,SeriesProperties:Ile,PropertiesArray:Qk,Validate:we,BOOLEAN:GW,COLOR_STRING:Fh,COLOR_STRING_ARRAY:Rle,FUNCTION:kle,LINE_DASH:Jk,NUMBER:tg,OBJECT_ARRAY:eT,OBJECT:Bh,POSITIVE_NUMBER:Ca,RATIO:Gh,STRING:_W,UNION:tT,Label:Tle}=L,Lle=tT(["before","after","middle"],"a placement"),Ele=tT(["inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end"],"an placement"),Ple=tT(["horizontal","vertical"],"an orientation"),zW=class extends Tle{};v([we(tg,{optional:!0})],zW.prototype,"spacing");var ls=class extends qk{constructor(){super(...arguments),this.value=0,this.label=new zW}};v([we(_W,{optional:!0})],ls.prototype,"text");v([we(tg)],ls.prototype,"value");v([we(NW,{optional:!0})],ls.prototype,"shape");v([we(Lle,{optional:!0})],ls.prototype,"placement");v([we(tg,{optional:!0})],ls.prototype,"spacing");v([we(Ca,{optional:!0})],ls.prototype,"size");v([we(tg,{optional:!0})],ls.prototype,"rotation");v([we(Fh,{optional:!0})],ls.prototype,"fill");v([we(Gh,{optional:!0})],ls.prototype,"fillOpacity");v([we(Fh,{optional:!0})],ls.prototype,"stroke");v([we(Ca,{optional:!0})],ls.prototype,"strokeWidth");v([we(Gh,{optional:!0})],ls.prototype,"strokeOpacity");v([we(Jk,{optional:!0})],ls.prototype,"lineDash");v([we(Ca,{optional:!0})],ls.prototype,"lineDashOffset");v([we(Bh)],ls.prototype,"label");var Qo=class extends qk{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new Qk(L.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};v([we(GW)],Qo.prototype,"enabled");v([we(Ca,{optional:!0})],Qo.prototype,"thickness");v([we(Gh)],Qo.prototype,"thicknessRatio");v([we(eT)],Qo.prototype,"fills");v([we(Rx)],Qo.prototype,"fillMode");v([we(Fh,{optional:!0})],Qo.prototype,"fill");v([we(Gh)],Qo.prototype,"fillOpacity");v([we(Fh)],Qo.prototype,"stroke");v([we(Ca)],Qo.prototype,"strokeWidth");v([we(Gh)],Qo.prototype,"strokeOpacity");v([we(Jk)],Qo.prototype,"lineDash");v([we(Ca)],Qo.prototype,"lineDashOffset");var br=class extends qk{constructor(){super(...arguments),this.fills=new Qk(L.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black"}};v([we(eT)],br.prototype,"fills");v([we(Rx)],br.prototype,"fillMode");v([we(Fh,{optional:!0})],br.prototype,"fill");v([we(Gh)],br.prototype,"fillOpacity");v([we(Fh)],br.prototype,"stroke");v([we(Ca)],br.prototype,"strokeWidth");v([we(Gh)],br.prototype,"strokeOpacity");v([we(Jk)],br.prototype,"lineDash");v([we(Ca)],br.prototype,"lineDashOffset");v([we(Fh)],br.prototype,"defaultFill");var Tx=class extends ta{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};v([we(_W,{optional:!0})],Tx.prototype,"text");v([we(Ele)],Tx.prototype,"placement");v([we(GW)],Tx.prototype,"avoidCollisions");var Ns=class extends Ile{constructor(){super(...arguments),this.value=0,this.segmentation=new vy,this.defaultColorRange=[],this.targets=new Qk(ls),this.defaultTarget=new ls,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new br,this.bar=new Qo,this.label=new Tx,this.tooltip=new Ale}};v([we(tg)],Ns.prototype,"value");v([we(Bh)],Ns.prototype,"segmentation");v([we(Rle)],Ns.prototype,"defaultColorRange");v([we(eT)],Ns.prototype,"targets");v([we(Bh)],Ns.prototype,"defaultTarget");v([we(Ple)],Ns.prototype,"direction");v([we(Ca)],Ns.prototype,"thickness");v([we(Ca)],Ns.prototype,"cornerRadius");v([we(OW)],Ns.prototype,"cornerMode");v([we(tg)],Ns.prototype,"margin");v([we(Bh)],Ns.prototype,"scale");v([we(Bh)],Ns.prototype,"bar");v([we(kle,{optional:!0})],Ns.prototype,"itemStyler");v([we(Bh)],Ns.prototype,"label");v([we(Bh)],Ns.prototype,"tooltip");var{CachedTextMeasurerPool:Nle,BBox:Ole}=L;function iT(e){const{x0:t,y0:i,x1:s,y1:o,horizontalInset:n,verticalInset:r}=e,a=Math.min(t,s)+n,l=Math.min(i,o)+r,c=Math.max(Math.abs(s-t)-2*n,0),d=Math.max(Math.abs(o-i)-2*r,0);return{x:a,y:l,width:c,height:d}}function Fle(e,t){if(t==null)return!0;const i=iT(e),s=1e-6,o=i.x+s,n=i.y+s,r=i.x+i.width-s,a=i.y+i.height-s,l=t.x,c=t.x+t.width,d=t.y,h=t.y+t.height;return Math.max(o,l)<=Math.min(r,c)&&Math.max(n,d)<=Math.min(a,h)}function bD(e){const{clipX0:t,clipX1:i,clipY0:s,clipY1:o}=e;return t!=null&&i!=null||s!=null&&o!=null}function Ble(e){if(!bD(e))return;const{x0:t,y0:i,x1:s,y1:o}=e,{x:n,y:r,width:a,height:l}=iT(e);let{clipX0:c,clipX1:d,clipY0:h,clipY1:u}=e;(c==null||d==null)&&(c=t,d=s),(h==null||u==null)&&(h=i,u=o);const p=Math.min(c,d),g=Math.min(h,u),f=Math.abs(d-c),y=Math.abs(u-h);return c=Math.max(n,p),h=Math.max(r,g),d=Math.min(n+a,p+f),u=Math.min(r+l,g+y),new Ole(Math.min(c,d),Math.min(h,u),Math.abs(d-c),Math.abs(u-h))}function RO(e,t){const i=e?"initial":"update";return{node:{fromFn(o,n){const r=o.previousDatum;let{x0:a,y0:l,x1:c,y1:d,clipX0:h,clipY0:u,clipX1:p,clipY1:g}=r??n;const{horizontalInset:f,verticalInset:y}=n,m=r!=null&&bD(r),C=bD(n);return m&&C||(!m&&C?({x0:a,y0:l,x1:c,y1:d,clipX0:h,clipY0:u,clipX1:p,clipY1:g}=n,e&&(t?p=n.clipX0:g=n.clipY0)):m&&!C?({x0:a,y0:l,x1:c,y1:d}=n,h=void 0,u=void 0,p=void 0,g=void 0):e&&(t?c=a:d=l)),{x0:a,y0:l,x1:c,y1:d,clipX0:h,clipY0:u,clipX1:p,clipY1:g,horizontalInset:f,verticalInset:y,phase:i}},toFn(o,n){const{x0:r,y0:a,x1:l,y1:c,clipX0:d,clipY0:h,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:f}=n;return{x0:r,y0:a,x1:l,y1:c,clipX0:d,clipY0:h,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:f}},applyFn(o,n){o.setProperties(gC(o,n))}}}}function gC(e,t){const{x:i,y:s,width:o,height:n}=iT(t),r=Ble(t),a=Fle(t,r);return{x:i,y:s,width:o,height:n,clipBBox:r,visible:a}}var Gle={Before:"right",Center:"center",After:"left"},_le={Before:"top",Center:"middle",After:"bottom"},zle={Before:-1,Center:-.5,After:0},Vle={Before:0,Center:-.5,After:-1};function Hle(e,t,i,s,o){const{scale:n,bar:r}=s,{padding:a,horizontal:l}=i;t.each((c,d)=>{const h=im(e,d,o?.label),u=()=>({width:n.width,height:n.height,meta:null});let p;const g=d.avoidCollisions&&d.placement!=="outside-start"&&d.placement!=="outside-end";if(h==null)return;if(g)p=tm(h,d,{padding:a},u)?.[0];else{const N={fontSize:d.fontSize,fontStyle:d.fontStyle,fontWeight:d.fontWeight,fontFamily:d.fontFamily,lineHeight:d.lineHeight},{width:F,height:_}=Nle.measureText(h,{font:N});p={text:h,fontSize:d.fontSize,lineHeight:sp(d,d.fontSize),width:F,height:_}}if(p==null){c.visible=!1;return}const f=l?n.x:n.y+n.height,y=l?n.x+n.width:n.y,m=l?r.x:r.y+r.height,C=l?r.x+r.width:r.y,b=d.spacing*(l?1:-1);let S,A,R,I;switch(d.placement){case"outside-start":S=-1/0,A=1/0,R=f-b,I="Before";break;case"outside-end":S=-1/0,A=1/0,R=y+b,I="After";break;case"inside-start":S=f,A=C,R=f+b,I="After";break;case"inside-end":S=C,A=y,R=y-b,I="Before";break;case"inside-center":S=f,A=y,R=(f+y)/2,I="Center";break;case"bar-inside":S=m,A=C,R=(m+C)/2,I="Center";break;case"bar-inside-end":S=m,A=C,R=C-b,I="Before";break;case"bar-outside-end":S=C,A=y,R=C+b,I="After";break;case"bar-end":S=-1/0,A=1/0,R=C,I="Center";break}const w=l?R:n.x+n.width/2,M=l?n.y+n.height/2:R;let T,E;l?(T=w+zle[I]*p.width,E=T+p.width):(T=M+Vle[I]*p.height,E=T+p.height);const P=Math.min(T,E)>=Math.min(S,A)&&Math.max(T,E)<=Math.max(S,A);if(d.avoidCollisions&&!P){c.visible=!1;return}c.visible=!0,c.text=p.text,c.fontSize=p.fontSize,c.lineHeight=p.lineHeight,c.textAlign=l?Gle[I]:"center",c.textBaseline=l?"middle":_le[I],c.x=w,c.y=M})}var{fromToMotion:mM,resetMotion:Wle,SeriesNodePickMode:kO,StateMachine:jle,createDatumId:TO,ChartAxisDirection:Wn,CachedTextMeasurerPool:Ule,toRadians:Kle,BBox:Tg,Group:cu,PointerEvents:$le,Selection:du,Rect:Yle,Text:LO,LinearGradient:Xle,Marker:Zle,easing:qle,getColorStops:Qle}=L,Jle={before:180,middle:0,after:0},ece={before:90,middle:0,after:-90},sT=class extends L.Series{constructor(e){super({moduleCtx:e,useLabelLayer:!0,pickModes:[kO.EXACT_SHAPE_MATCH,kO.NEAREST_NODE]}),this.canHaveAxes=!0,this.properties=new Ns,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new cu({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new cu({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new cu({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new cu({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new cu({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new cu({name:"itemTargetLabelGroup"})),this.scaleSelection=du.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=du.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=du.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=du.select(this.itemTargetLabelGroup,LO),this.labelSelection=du.select(this.itemLabelGroup,LO),this.highlightTargetSelection=du.select(this.highlightTargetGroup,()=>this.markerFactory()),this.datumUnion=new RW,this.animationState=new jle("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=$le.None}get horizontal(){return this.properties.direction==="horizontal"}get thickness(){return this.properties.thickness}computeInset(e,t){const{label:i}=this.properties;let s;switch(i.placement){case"outside-start":s=1;break;case"outside-end":s=-1;break;default:return 0}const o=i.text?.split(`
@@ -95,4 +95,4 @@ License: MIT
95
95
  * @author RubaXa <trash@rubaxa.org>
96
96
  * @author owenm <owen23355@gmail.com>
97
97
  * @license MIT
98
- */function wB(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),i.push.apply(i,s)}return i}function oa(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?wB(Object(i),!0).forEach(function(s){jTe(e,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):wB(Object(i)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))})}return e}function IC(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?IC=function(t){return typeof t}:IC=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},IC(e)}function jTe(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function dl(){return dl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},dl.apply(this,arguments)}function UTe(e,t){if(e==null)return{};var i={},s=Object.keys(e),o,n;for(n=0;n<s.length;n++)o=s[n],!(t.indexOf(o)>=0)&&(i[o]=e[o]);return i}function KTe(e,t){if(e==null)return{};var i=UTe(e,t),s,o;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o<n.length;o++)s=n[o],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(i[s]=e[s])}return i}var $Te="1.15.6";function Ja(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Gl=Ja(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ry=Ja(/Edge/i),MB=Ja(/firefox/i),yf=Ja(/safari/i)&&!Ja(/chrome/i)&&!Ja(/android/i),LL=Ja(/iP(ad|od|hone)/i),Q3=Ja(/chrome/i)&&Ja(/android/i),J3={capture:!1,passive:!1};function qe(e,t,i){e.addEventListener(t,i,!Gl&&J3)}function Ke(e,t,i){e.removeEventListener(t,i,!Gl&&J3)}function Nb(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function eK(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function $n(e,t,i,s){if(e){i=i||document;do{if(t!=null&&(t[0]===">"?e.parentNode===i&&Nb(e,t):Nb(e,t))||s&&e===i)return e;if(e===i)break}while(e=eK(e))}return null}var DB=/\s+/g;function Eo(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(DB," ").replace(" "+t+" "," ");e.className=(s+(i?" "+t:"")).replace(DB," ")}}function ke(e,t,i){var s=e&&e.style;if(s){if(i===void 0)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),t===void 0?i:i[t];!(t in s)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),s[t]=i+(typeof i=="string"?"":"px")}}function Xu(e,t){var i="";if(typeof e=="string")i=e;else do{var s=ke(e,"transform");s&&s!=="none"&&(i=s+" "+i)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(i)}function tK(e,t,i){if(e){var s=e.getElementsByTagName(t),o=0,n=s.length;if(i)for(;o<n;o++)i(s[o],o);return s}return[]}function qr(){var e=document.scrollingElement;return e||document.documentElement}function wi(e,t,i,s,o){if(!(!e.getBoundingClientRect&&e!==window)){var n,r,a,l,c,d,h;if(e!==window&&e.parentNode&&e!==qr()?(n=e.getBoundingClientRect(),r=n.top,a=n.left,l=n.bottom,c=n.right,d=n.height,h=n.width):(r=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,h=window.innerWidth),(t||i)&&e!==window&&(o=o||e.parentNode,!Gl))do if(o&&o.getBoundingClientRect&&(ke(o,"transform")!=="none"||i&&ke(o,"position")!=="static")){var u=o.getBoundingClientRect();r-=u.top+parseInt(ke(o,"border-top-width")),a-=u.left+parseInt(ke(o,"border-left-width")),l=r+n.height,c=a+n.width;break}while(o=o.parentNode);if(s&&e!==window){var p=Xu(o||e),g=p&&p.a,f=p&&p.d;p&&(r/=f,a/=g,h/=g,d/=f,l=r+d,c=a+h)}return{top:r,left:a,bottom:l,right:c,width:h,height:d}}}function AB(e,t,i){for(var s=Cc(e,!0),o=wi(e)[t];s;){var n=wi(s)[i],r=void 0;if(r=o>=n,!r)return s;if(s===qr())break;s=Cc(s,!1)}return!1}function dp(e,t,i,s){for(var o=0,n=0,r=e.children;n<r.length;){if(r[n].style.display!=="none"&&r[n]!==Te.ghost&&(s||r[n]!==Te.dragged)&&$n(r[n],i.draggable,e,!1)){if(o===t)return r[n];o++}n++}return null}function EL(e,t){for(var i=e.lastElementChild;i&&(i===Te.ghost||ke(i,"display")==="none"||t&&!Nb(i,t));)i=i.previousElementSibling;return i||null}function cn(e,t){var i=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==Te.clone&&(!t||Nb(e,t))&&i++;return i}function IB(e){var t=0,i=0,s=qr();if(e)do{var o=Xu(e),n=o.a,r=o.d;t+=e.scrollLeft*n,i+=e.scrollTop*r}while(e!==s&&(e=e.parentNode));return[t,i]}function YTe(e,t){for(var i in e)if(e.hasOwnProperty(i)){for(var s in t)if(t.hasOwnProperty(s)&&t[s]===e[i][s])return Number(i)}return-1}function Cc(e,t){if(!e||!e.getBoundingClientRect)return qr();var i=e,s=!1;do if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var o=ke(i);if(i.clientWidth<i.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||i.clientHeight<i.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!i.getBoundingClientRect||i===document.body)return qr();if(s||t)return i;s=!0}}while(i=i.parentNode);return qr()}function XTe(e,t){if(e&&t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function m0(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var vf;function iK(e,t){return function(){if(!vf){var i=arguments,s=this;i.length===1?e.call(s,i[0]):e.apply(s,i),vf=setTimeout(function(){vf=void 0},t)}}}function ZTe(){clearTimeout(vf),vf=void 0}function sK(e,t,i){e.scrollLeft+=t,e.scrollTop+=i}function oK(e){var t=window.Polymer,i=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):i?i(e).clone(!0)[0]:e.cloneNode(!0)}function nK(e,t,i){var s={};return Array.from(e.children).forEach(function(o){var n,r,a,l;if(!(!$n(o,t.draggable,e,!1)||o.animated||o===i)){var c=wi(o);s.left=Math.min((n=s.left)!==null&&n!==void 0?n:1/0,c.left),s.top=Math.min((r=s.top)!==null&&r!==void 0?r:1/0,c.top),s.right=Math.max((a=s.right)!==null&&a!==void 0?a:-1/0,c.right),s.bottom=Math.max((l=s.bottom)!==null&&l!==void 0?l:-1/0,c.bottom)}}),s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}var mo="Sortable"+new Date().getTime();function qTe(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(o){if(!(ke(o,"display")==="none"||o===Te.ghost)){e.push({target:o,rect:wi(o)});var n=oa({},e[e.length-1].rect);if(o.thisAnimationDuration){var r=Xu(o,!0);r&&(n.top-=r.f,n.left-=r.e)}o.fromRect=n}})}},addAnimationState:function(s){e.push(s)},removeAnimationState:function(s){e.splice(YTe(e,{target:s}),1)},animateAll:function(s){var o=this;if(!this.options.animation){clearTimeout(t),typeof s=="function"&&s();return}var n=!1,r=0;e.forEach(function(a){var l=0,c=a.target,d=c.fromRect,h=wi(c),u=c.prevFromRect,p=c.prevToRect,g=a.rect,f=Xu(c,!0);f&&(h.top-=f.f,h.left-=f.e),c.toRect=h,c.thisAnimationDuration&&m0(u,h)&&!m0(d,h)&&(g.top-h.top)/(g.left-h.left)===(d.top-h.top)/(d.left-h.left)&&(l=JTe(g,u,p,o.options)),m0(h,d)||(c.prevFromRect=d,c.prevToRect=h,l||(l=o.options.animation),o.animate(c,g,h,l)),l&&(n=!0,r=Math.max(r,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),n?t=setTimeout(function(){typeof s=="function"&&s()},r):typeof s=="function"&&s(),e=[]},animate:function(s,o,n,r){if(r){ke(s,"transition",""),ke(s,"transform","");var a=Xu(this.el),l=a&&a.a,c=a&&a.d,d=(o.left-n.left)/(l||1),h=(o.top-n.top)/(c||1);s.animatingX=!!d,s.animatingY=!!h,ke(s,"transform","translate3d("+d+"px,"+h+"px,0)"),this.forRepaintDummy=QTe(s),ke(s,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),ke(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){ke(s,"transition",""),ke(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},r)}}}}function QTe(e){return e.offsetWidth}function JTe(e,t,i,s){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))*s.animation}var gu=[],y0={initializeByDefault:!0},ky={mount:function(t){for(var i in y0)y0.hasOwnProperty(i)&&!(i in t)&&(t[i]=y0[i]);gu.forEach(function(s){if(s.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),gu.push(t)},pluginEvent:function(t,i,s){var o=this;this.eventCanceled=!1,s.cancel=function(){o.eventCanceled=!0};var n=t+"Global";gu.forEach(function(r){i[r.pluginName]&&(i[r.pluginName][n]&&i[r.pluginName][n](oa({sortable:i},s)),i.options[r.pluginName]&&i[r.pluginName][t]&&i[r.pluginName][t](oa({sortable:i},s)))})},initializePlugins:function(t,i,s,o){gu.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var c=new a(t,i,t.options);c.sortable=t,c.options=t.options,t[l]=c,dl(s,c.defaults)}});for(var n in t.options)if(t.options.hasOwnProperty(n)){var r=this.modifyOption(t,n,t.options[n]);typeof r<"u"&&(t.options[n]=r)}},getEventProperties:function(t,i){var s={};return gu.forEach(function(o){typeof o.eventProperties=="function"&&dl(s,o.eventProperties.call(i[o.pluginName],t))}),s},modifyOption:function(t,i,s){var o;return gu.forEach(function(n){t[n.pluginName]&&n.optionListeners&&typeof n.optionListeners[i]=="function"&&(o=n.optionListeners[i].call(t[n.pluginName],s))}),o}};function eLe(e){var t=e.sortable,i=e.rootEl,s=e.name,o=e.targetEl,n=e.cloneEl,r=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,d=e.oldDraggableIndex,h=e.newDraggableIndex,u=e.originalEvent,p=e.putSortable,g=e.extraEventProperties;if(t=t||i&&i[mo],!!t){var f,y=t.options,m="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!Gl&&!Ry?f=new CustomEvent(s,{bubbles:!0,cancelable:!0}):(f=document.createEvent("Event"),f.initEvent(s,!0,!0)),f.to=r||i,f.from=a||i,f.item=o||i,f.clone=n,f.oldIndex=l,f.newIndex=c,f.oldDraggableIndex=d,f.newDraggableIndex=h,f.originalEvent=u,f.pullMode=p?p.lastPutMode:void 0;var C=oa(oa({},g),ky.getEventProperties(s,t));for(var b in C)f[b]=C[b];i&&i.dispatchEvent(f),y[m]&&y[m].call(t,f)}}var tLe=["evt"],ro=function(t,i){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=s.evt,n=KTe(s,tLe);ky.pluginEvent.bind(Te)(t,i,oa({dragEl:ge,parentEl:qt,ghostEl:Ne,rootEl:Ot,nextEl:Od,lastDownEl:RC,cloneEl:zt,cloneHidden:lc,dragStarted:Xg,putSortable:ss,activeSortable:Te.active,originalEvent:o,oldIndex:Lu,oldDraggableIndex:Cf,newIndex:Po,newDraggableIndex:rc,hideGhostForTarget:cK,unhideGhostForTarget:dK,cloneNowHidden:function(){lc=!0},cloneNowShown:function(){lc=!1},dispatchSortableEvent:function(a){Ks({sortable:i,name:a,originalEvent:o})}},n))};function Ks(e){eLe(oa({putSortable:ss,cloneEl:zt,targetEl:ge,rootEl:Ot,oldIndex:Lu,oldDraggableIndex:Cf,newIndex:Po,newDraggableIndex:rc},e))}var ge,qt,Ne,Ot,Od,RC,zt,lc,Lu,Po,Cf,rc,eC,ss,bu=!1,Ob=!1,Fb=[],Ad,Un,v0,C0,RB,kB,Xg,fu,bf,Sf=!1,tC=!1,kC,ms,b0=[],XD=!1,Bb=[],cw=typeof document<"u",iC=LL,TB=Ry||Gl?"cssFloat":"float",iLe=cw&&!Q3&&!LL&&"draggable"in document.createElement("div"),rK=function(){if(cw){if(Gl)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),aK=function(t,i){var s=ke(t),o=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),n=dp(t,0,i),r=dp(t,1,i),a=n&&ke(n),l=r&&ke(r),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+wi(n).width,d=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+wi(r).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(n&&a.float&&a.float!=="none"){var h=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===h)?"vertical":"horizontal"}return n&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=o&&s[TB]==="none"||r&&s[TB]==="none"&&c+d>o)?"vertical":"horizontal"},sLe=function(t,i,s){var o=s?t.left:t.top,n=s?t.right:t.bottom,r=s?t.width:t.height,a=s?i.left:i.top,l=s?i.right:i.bottom,c=s?i.width:i.height;return o===a||n===l||o+r/2===a+c/2},oLe=function(t,i){var s;return Fb.some(function(o){var n=o[mo].options.emptyInsertThreshold;if(!(!n||EL(o))){var r=wi(o),a=t>=r.left-n&&t<=r.right+n,l=i>=r.top-n&&i<=r.bottom+n;if(a&&l)return s=o}}),s},lK=function(t){function i(n,r){return function(a,l,c,d){var h=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(n==null&&(r||h))return!0;if(n==null||n===!1)return!1;if(r&&n==="clone")return n;if(typeof n=="function")return i(n(a,l,c,d),r)(a,l,c,d);var u=(r?a:l).options.group.name;return n===!0||typeof n=="string"&&n===u||n.join&&n.indexOf(u)>-1}}var s={},o=t.group;(!o||IC(o)!="object")&&(o={name:o}),s.name=o.name,s.checkPull=i(o.pull,!0),s.checkPut=i(o.put),s.revertClone=o.revertClone,t.group=s},cK=function(){!rK&&Ne&&ke(Ne,"display","none")},dK=function(){!rK&&Ne&&ke(Ne,"display","")};cw&&!Q3&&document.addEventListener("click",function(e){if(Ob)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ob=!1,!1},!0);var Id=function(t){if(ge){t=t.touches?t.touches[0]:t;var i=oLe(t.clientX,t.clientY);if(i){var s={};for(var o in t)t.hasOwnProperty(o)&&(s[o]=t[o]);s.target=s.rootEl=i,s.preventDefault=void 0,s.stopPropagation=void 0,i[mo]._onDragOver(s)}}},nLe=function(t){ge&&ge.parentNode[mo]._isOutsideThisEl(t.target)};function Te(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=dl({},t),e[mo]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return aK(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,a){r.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Te.supportPointer!==!1&&"PointerEvent"in window&&(!yf||LL),emptyInsertThreshold:5};ky.initializePlugins(this,e,i);for(var s in i)!(s in t)&&(t[s]=i[s]);lK(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:iLe,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?qe(e,"pointerdown",this._onTapStart):(qe(e,"mousedown",this._onTapStart),qe(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(qe(e,"dragover",this),qe(e,"dragenter",this)),Fb.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),dl(this,qTe())}Te.prototype={constructor:Te,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(fu=null)},_getDirection:function(t,i){return typeof this.options.direction=="function"?this.options.direction.call(this,t,i,ge):this.options.direction},_onTapStart:function(t){if(t.cancelable){var i=this,s=this.el,o=this.options,n=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,d=o.filter;if(pLe(s),!ge&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&yf&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=$n(l,o.draggable,s,!1),!(l&&l.animated)&&RC!==l)){if(Lu=cn(l),Cf=cn(l,o.draggable),typeof d=="function"){if(d.call(this,t,l,this)){Ks({sortable:i,rootEl:c,name:"filter",targetEl:l,toEl:s,fromEl:s}),ro("filter",i,{evt:t}),n&&t.preventDefault();return}}else if(d&&(d=d.split(",").some(function(h){if(h=$n(c,h.trim(),s,!1),h)return Ks({sortable:i,rootEl:h,name:"filter",targetEl:l,fromEl:s,toEl:s}),ro("filter",i,{evt:t}),!0}),d)){n&&t.preventDefault();return}o.handle&&!$n(c,o.handle,s,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,i,s){var o=this,n=o.el,r=o.options,a=n.ownerDocument,l;if(s&&!ge&&s.parentNode===n){var c=wi(s);if(Ot=n,ge=s,qt=ge.parentNode,Od=ge.nextSibling,RC=s,eC=r.group,Te.dragged=ge,Ad={target:ge,clientX:(i||t).clientX,clientY:(i||t).clientY},RB=Ad.clientX-c.left,kB=Ad.clientY-c.top,this._lastX=(i||t).clientX,this._lastY=(i||t).clientY,ge.style["will-change"]="all",l=function(){if(ro("delayEnded",o,{evt:t}),Te.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!MB&&o.nativeDraggable&&(ge.draggable=!0),o._triggerDragStart(t,i),Ks({sortable:o,name:"choose",originalEvent:t}),Eo(ge,r.chosenClass,!0)},r.ignore.split(",").forEach(function(d){tK(ge,d.trim(),S0)}),qe(a,"dragover",Id),qe(a,"mousemove",Id),qe(a,"touchmove",Id),r.supportPointer?(qe(a,"pointerup",o._onDrop),!this.nativeDraggable&&qe(a,"pointercancel",o._onDrop)):(qe(a,"mouseup",o._onDrop),qe(a,"touchend",o._onDrop),qe(a,"touchcancel",o._onDrop)),MB&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ge.draggable=!0),ro("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||i)&&(!this.nativeDraggable||!(Ry||Gl))){if(Te.eventCanceled){this._onDrop();return}r.supportPointer?(qe(a,"pointerup",o._disableDelayedDrag),qe(a,"pointercancel",o._disableDelayedDrag)):(qe(a,"mouseup",o._disableDelayedDrag),qe(a,"touchend",o._disableDelayedDrag),qe(a,"touchcancel",o._disableDelayedDrag)),qe(a,"mousemove",o._delayedDragTouchMoveHandler),qe(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&qe(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,r.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var i=t.touches?t.touches[0]:t;Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ge&&S0(ge),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Ke(t,"mouseup",this._disableDelayedDrag),Ke(t,"touchend",this._disableDelayedDrag),Ke(t,"touchcancel",this._disableDelayedDrag),Ke(t,"pointerup",this._disableDelayedDrag),Ke(t,"pointercancel",this._disableDelayedDrag),Ke(t,"mousemove",this._delayedDragTouchMoveHandler),Ke(t,"touchmove",this._delayedDragTouchMoveHandler),Ke(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,i){i=i||t.pointerType=="touch"&&t,!this.nativeDraggable||i?this.options.supportPointer?qe(document,"pointermove",this._onTouchMove):i?qe(document,"touchmove",this._onTouchMove):qe(document,"mousemove",this._onTouchMove):(qe(ge,"dragend",this),qe(Ot,"dragstart",this._onDragStart));try{document.selection?TC(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,i){if(bu=!1,Ot&&ge){ro("dragStarted",this,{evt:i}),this.nativeDraggable&&qe(document,"dragover",nLe);var s=this.options;!t&&Eo(ge,s.dragClass,!1),Eo(ge,s.ghostClass,!0),Te.active=this,t&&this._appendGhost(),Ks({sortable:this,name:"start",originalEvent:i})}else this._nulling()},_emulateDragOver:function(){if(Un){this._lastX=Un.clientX,this._lastY=Un.clientY,cK();for(var t=document.elementFromPoint(Un.clientX,Un.clientY),i=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Un.clientX,Un.clientY),t!==i);)i=t;if(ge.parentNode[mo]._isOutsideThisEl(t),i)do{if(i[mo]){var s=void 0;if(s=i[mo]._onDragOver({clientX:Un.clientX,clientY:Un.clientY,target:t,rootEl:i}),s&&!this.options.dragoverBubble)break}t=i}while(i=eK(i));dK()}},_onTouchMove:function(t){if(Ad){var i=this.options,s=i.fallbackTolerance,o=i.fallbackOffset,n=t.touches?t.touches[0]:t,r=Ne&&Xu(Ne,!0),a=Ne&&r&&r.a,l=Ne&&r&&r.d,c=iC&&ms&&IB(ms),d=(n.clientX-Ad.clientX+o.x)/(a||1)+(c?c[0]-b0[0]:0)/(a||1),h=(n.clientY-Ad.clientY+o.y)/(l||1)+(c?c[1]-b0[1]:0)/(l||1);if(!Te.active&&!bu){if(s&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))<s)return;this._onDragStart(t,!0)}if(Ne){r?(r.e+=d-(v0||0),r.f+=h-(C0||0)):r={a:1,b:0,c:0,d:1,e:d,f:h};var u="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");ke(Ne,"webkitTransform",u),ke(Ne,"mozTransform",u),ke(Ne,"msTransform",u),ke(Ne,"transform",u),v0=d,C0=h,Un=n}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Ne){var t=this.options.fallbackOnBody?document.body:Ot,i=wi(ge,!0,iC,!0,t),s=this.options;if(iC){for(ms=t;ke(ms,"position")==="static"&&ke(ms,"transform")==="none"&&ms!==document;)ms=ms.parentNode;ms!==document.body&&ms!==document.documentElement?(ms===document&&(ms=qr()),i.top+=ms.scrollTop,i.left+=ms.scrollLeft):ms=qr(),b0=IB(ms)}Ne=ge.cloneNode(!0),Eo(Ne,s.ghostClass,!1),Eo(Ne,s.fallbackClass,!0),Eo(Ne,s.dragClass,!0),ke(Ne,"transition",""),ke(Ne,"transform",""),ke(Ne,"box-sizing","border-box"),ke(Ne,"margin",0),ke(Ne,"top",i.top),ke(Ne,"left",i.left),ke(Ne,"width",i.width),ke(Ne,"height",i.height),ke(Ne,"opacity","0.8"),ke(Ne,"position",iC?"absolute":"fixed"),ke(Ne,"zIndex","100000"),ke(Ne,"pointerEvents","none"),Te.ghost=Ne,t.appendChild(Ne),ke(Ne,"transform-origin",RB/parseInt(Ne.style.width)*100+"% "+kB/parseInt(Ne.style.height)*100+"%")}},_onDragStart:function(t,i){var s=this,o=t.dataTransfer,n=s.options;if(ro("dragStart",this,{evt:t}),Te.eventCanceled){this._onDrop();return}ro("setupClone",this),Te.eventCanceled||(zt=oK(ge),zt.removeAttribute("id"),zt.draggable=!1,zt.style["will-change"]="",this._hideClone(),Eo(zt,this.options.chosenClass,!1),Te.clone=zt),s.cloneId=TC(function(){ro("clone",s),!Te.eventCanceled&&(s.options.removeCloneOnHide||Ot.insertBefore(zt,ge),s._hideClone(),Ks({sortable:s,name:"clone"}))}),!i&&Eo(ge,n.dragClass,!0),i?(Ob=!0,s._loopId=setInterval(s._emulateDragOver,50)):(Ke(document,"mouseup",s._onDrop),Ke(document,"touchend",s._onDrop),Ke(document,"touchcancel",s._onDrop),o&&(o.effectAllowed="move",n.setData&&n.setData.call(s,o,ge)),qe(document,"drop",s),ke(ge,"transform","translateZ(0)")),bu=!0,s._dragStartId=TC(s._dragStarted.bind(s,i,t)),qe(document,"selectstart",s),Xg=!0,window.getSelection().removeAllRanges(),yf&&ke(document.body,"user-select","none")},_onDragOver:function(t){var i=this.el,s=t.target,o,n,r,a=this.options,l=a.group,c=Te.active,d=eC===l,h=a.sort,u=ss||c,p,g=this,f=!1;if(XD)return;function y(U,G){ro(U,g,oa({evt:t,isOwner:d,axis:p?"vertical":"horizontal",revert:r,dragRect:o,targetRect:n,canSort:h,fromSortable:u,target:s,completed:C,onMove:function(O,H){return sC(Ot,i,ge,o,O,wi(O),t,H)},changed:b},G))}function m(){y("dragOverAnimationCapture"),g.captureAnimationState(),g!==u&&u.captureAnimationState()}function C(U){return y("dragOverCompleted",{insertion:U}),U&&(d?c._hideClone():c._showClone(g),g!==u&&(Eo(ge,ss?ss.options.ghostClass:c.options.ghostClass,!1),Eo(ge,a.ghostClass,!0)),ss!==g&&g!==Te.active?ss=g:g===Te.active&&ss&&(ss=null),u===g&&(g._ignoreWhileAnimating=s),g.animateAll(function(){y("dragOverAnimationComplete"),g._ignoreWhileAnimating=null}),g!==u&&(u.animateAll(),u._ignoreWhileAnimating=null)),(s===ge&&!ge.animated||s===i&&!s.animated)&&(fu=null),!a.dragoverBubble&&!t.rootEl&&s!==document&&(ge.parentNode[mo]._isOutsideThisEl(t.target),!U&&Id(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function b(){Po=cn(ge),rc=cn(ge,a.draggable),Ks({sortable:g,name:"change",toEl:i,newIndex:Po,newDraggableIndex:rc,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),s=$n(s,a.draggable,i,!0),y("dragOver"),Te.eventCanceled)return f;if(ge.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||g._ignoreWhileAnimating===s)return C(!1);if(Ob=!1,c&&!a.disabled&&(d?h||(r=qt!==Ot):ss===this||(this.lastPutMode=eC.checkPull(this,c,ge,t))&&l.checkPut(this,c,ge,t))){if(p=this._getDirection(t,s)==="vertical",o=wi(ge),y("dragOverValid"),Te.eventCanceled)return f;if(r)return qt=Ot,m(),this._hideClone(),y("revert"),Te.eventCanceled||(Od?Ot.insertBefore(ge,Od):Ot.appendChild(ge)),C(!0);var S=EL(i,a.draggable);if(!S||cLe(t,p,this)&&!S.animated){if(S===ge)return C(!1);if(S&&i===t.target&&(s=S),s&&(n=wi(s)),sC(Ot,i,ge,o,s,n,t,!!s)!==!1)return m(),S&&S.nextSibling?i.insertBefore(ge,S.nextSibling):i.appendChild(ge),qt=i,b(),C(!0)}else if(S&&lLe(t,p,this)){var A=dp(i,0,a,!0);if(A===ge)return C(!1);if(s=A,n=wi(s),sC(Ot,i,ge,o,s,n,t,!1)!==!1)return m(),i.insertBefore(ge,A),qt=i,b(),C(!0)}else if(s.parentNode===i){n=wi(s);var R=0,I,w=ge.parentNode!==i,M=!sLe(ge.animated&&ge.toRect||o,s.animated&&s.toRect||n,p),T=p?"top":"left",E=AB(s,"top","top")||AB(ge,"top","top"),P=E?E.scrollTop:void 0;fu!==s&&(I=n[T],Sf=!1,tC=!M&&a.invertSwap||w),R=dLe(t,s,n,p,M?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,tC,fu===s);var N;if(R!==0){var F=cn(ge);do F-=R,N=qt.children[F];while(N&&(ke(N,"display")==="none"||N===Ne))}if(R===0||N===s)return C(!1);fu=s,bf=R;var _=s.nextElementSibling,W=!1;W=R===1;var z=sC(Ot,i,ge,o,s,n,t,W);if(z!==!1)return(z===1||z===-1)&&(W=z===1),XD=!0,setTimeout(aLe,30),m(),W&&!_?i.appendChild(ge):s.parentNode.insertBefore(ge,W?_:s),E&&sK(E,0,P-E.scrollTop),qt=ge.parentNode,I!==void 0&&!tC&&(kC=Math.abs(I-wi(s)[T])),b(),C(!0)}if(i.contains(ge))return C(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ke(document,"mousemove",this._onTouchMove),Ke(document,"touchmove",this._onTouchMove),Ke(document,"pointermove",this._onTouchMove),Ke(document,"dragover",Id),Ke(document,"mousemove",Id),Ke(document,"touchmove",Id)},_offUpEvents:function(){var t=this.el.ownerDocument;Ke(t,"mouseup",this._onDrop),Ke(t,"touchend",this._onDrop),Ke(t,"pointerup",this._onDrop),Ke(t,"pointercancel",this._onDrop),Ke(t,"touchcancel",this._onDrop),Ke(document,"selectstart",this)},_onDrop:function(t){var i=this.el,s=this.options;if(Po=cn(ge),rc=cn(ge,s.draggable),ro("drop",this,{evt:t}),qt=ge&&ge.parentNode,Po=cn(ge),rc=cn(ge,s.draggable),Te.eventCanceled){this._nulling();return}bu=!1,tC=!1,Sf=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ZD(this.cloneId),ZD(this._dragStartId),this.nativeDraggable&&(Ke(document,"drop",this),Ke(i,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),yf&&ke(document.body,"user-select",""),ke(ge,"transform",""),t&&(Xg&&(t.cancelable&&t.preventDefault(),!s.dropBubble&&t.stopPropagation()),Ne&&Ne.parentNode&&Ne.parentNode.removeChild(Ne),(Ot===qt||ss&&ss.lastPutMode!=="clone")&&zt&&zt.parentNode&&zt.parentNode.removeChild(zt),ge&&(this.nativeDraggable&&Ke(ge,"dragend",this),S0(ge),ge.style["will-change"]="",Xg&&!bu&&Eo(ge,ss?ss.options.ghostClass:this.options.ghostClass,!1),Eo(ge,this.options.chosenClass,!1),Ks({sortable:this,name:"unchoose",toEl:qt,newIndex:null,newDraggableIndex:null,originalEvent:t}),Ot!==qt?(Po>=0&&(Ks({rootEl:qt,name:"add",toEl:qt,fromEl:Ot,originalEvent:t}),Ks({sortable:this,name:"remove",toEl:qt,originalEvent:t}),Ks({rootEl:qt,name:"sort",toEl:qt,fromEl:Ot,originalEvent:t}),Ks({sortable:this,name:"sort",toEl:qt,originalEvent:t})),ss&&ss.save()):Po!==Lu&&Po>=0&&(Ks({sortable:this,name:"update",toEl:qt,originalEvent:t}),Ks({sortable:this,name:"sort",toEl:qt,originalEvent:t})),Te.active&&((Po==null||Po===-1)&&(Po=Lu,rc=Cf),Ks({sortable:this,name:"end",toEl:qt,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){ro("nulling",this),Ot=ge=qt=Ne=Od=zt=RC=lc=Ad=Un=Xg=Po=rc=Lu=Cf=fu=bf=ss=eC=Te.dragged=Te.ghost=Te.clone=Te.active=null,Bb.forEach(function(t){t.checked=!0}),Bb.length=v0=C0=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ge&&(this._onDragOver(t),rLe(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],i,s=this.el.children,o=0,n=s.length,r=this.options;o<n;o++)i=s[o],$n(i,r.draggable,this.el,!1)&&t.push(i.getAttribute(r.dataIdAttr)||uLe(i));return t},sort:function(t,i){var s={},o=this.el;this.toArray().forEach(function(n,r){var a=o.children[r];$n(a,this.options.draggable,o,!1)&&(s[n]=a)},this),i&&this.captureAnimationState(),t.forEach(function(n){s[n]&&(o.removeChild(s[n]),o.appendChild(s[n]))}),i&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,i){return $n(t,i||this.options.draggable,this.el,!1)},option:function(t,i){var s=this.options;if(i===void 0)return s[t];var o=ky.modifyOption(this,t,i);typeof o<"u"?s[t]=o:s[t]=i,t==="group"&&lK(s)},destroy:function(){ro("destroy",this);var t=this.el;t[mo]=null,Ke(t,"mousedown",this._onTapStart),Ke(t,"touchstart",this._onTapStart),Ke(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ke(t,"dragover",this),Ke(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(i){i.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Fb.splice(Fb.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!lc){if(ro("hideClone",this),Te.eventCanceled)return;ke(zt,"display","none"),this.options.removeCloneOnHide&&zt.parentNode&&zt.parentNode.removeChild(zt),lc=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(lc){if(ro("showClone",this),Te.eventCanceled)return;ge.parentNode==Ot&&!this.options.group.revertClone?Ot.insertBefore(zt,ge):Od?Ot.insertBefore(zt,Od):Ot.appendChild(zt),this.options.group.revertClone&&this.animate(ge,zt),ke(zt,"display",""),lc=!1}}};function rLe(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function sC(e,t,i,s,o,n,r,a){var l,c=e[mo],d=c.options.onMove,h;return window.CustomEvent&&!Gl&&!Ry?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=i,l.draggedRect=s,l.related=o||t,l.relatedRect=n||wi(t),l.willInsertAfter=a,l.originalEvent=r,e.dispatchEvent(l),d&&(h=d.call(c,l,r)),h}function S0(e){e.draggable=!1}function aLe(){XD=!1}function lLe(e,t,i){var s=wi(dp(i.el,0,i.options,!0)),o=nK(i.el,i.options,Ne),n=10;return t?e.clientX<o.left-n||e.clientY<s.top&&e.clientX<s.right:e.clientY<o.top-n||e.clientY<s.bottom&&e.clientX<s.left}function cLe(e,t,i){var s=wi(EL(i.el,i.options.draggable)),o=nK(i.el,i.options,Ne),n=10;return t?e.clientX>o.right+n||e.clientY>s.bottom&&e.clientX>s.left:e.clientY>o.bottom+n||e.clientX>s.right&&e.clientY>s.top}function dLe(e,t,i,s,o,n,r,a){var l=s?e.clientY:e.clientX,c=s?i.height:i.width,d=s?i.top:i.left,h=s?i.bottom:i.right,u=!1;if(!r){if(a&&kC<c*o){if(!Sf&&(bf===1?l>d+c*n/2:l<h-c*n/2)&&(Sf=!0),Sf)u=!0;else if(bf===1?l<d+kC:l>h-kC)return-bf}else if(l>d+c*(1-o)/2&&l<h-c*(1-o)/2)return hLe(t)}return u=u||r,u&&(l<d+c*n/2||l>h-c*n/2)?l>d+c/2?1:-1:0}function hLe(e){return cn(ge)<cn(e)?1:-1}function uLe(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,s=0;i--;)s+=t.charCodeAt(i);return s.toString(36)}function pLe(e){Bb.length=0;for(var t=e.getElementsByTagName("input"),i=t.length;i--;){var s=t[i];s.checked&&Bb.push(s)}}function TC(e){return setTimeout(e,0)}function ZD(e){return clearTimeout(e)}cw&&qe(document,"touchmove",function(e){(Te.active||bu)&&e.cancelable&&e.preventDefault()});Te.utils={on:qe,off:Ke,css:ke,find:tK,is:function(t,i){return!!$n(t,i,t,!1)},extend:XTe,throttle:iK,closest:$n,toggleClass:Eo,clone:oK,index:cn,nextTick:TC,cancelNextTick:ZD,detectDirection:aK,getChild:dp,expando:mo};Te.get=function(e){return e[mo]};Te.mount=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t[0].constructor===Array&&(t=t[0]),t.forEach(function(s){if(!s.prototype||!s.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(s));s.utils&&(Te.utils=oa(oa({},Te.utils),s.utils)),ky.mount(s)})};Te.create=function(e,t){return new Te(e,t)};Te.version=$Te;var Si=[],Zg,qD,QD=!1,x0,w0,Gb,qg;function gLe(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(i){var s=i.originalEvent;this.sortable.nativeDraggable?qe(document,"dragover",this._handleAutoScroll):this.options.supportPointer?qe(document,"pointermove",this._handleFallbackAutoScroll):s.touches?qe(document,"touchmove",this._handleFallbackAutoScroll):qe(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(i){var s=i.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?Ke(document,"dragover",this._handleAutoScroll):(Ke(document,"pointermove",this._handleFallbackAutoScroll),Ke(document,"touchmove",this._handleFallbackAutoScroll),Ke(document,"mousemove",this._handleFallbackAutoScroll)),LB(),LC(),ZTe()},nulling:function(){Gb=qD=Zg=QD=qg=x0=w0=null,Si.length=0},_handleFallbackAutoScroll:function(i){this._handleAutoScroll(i,!0)},_handleAutoScroll:function(i,s){var o=this,n=(i.touches?i.touches[0]:i).clientX,r=(i.touches?i.touches[0]:i).clientY,a=document.elementFromPoint(n,r);if(Gb=i,s||this.options.forceAutoScrollFallback||Ry||Gl||yf){M0(i,this.options,a,s);var l=Cc(a,!0);QD&&(!qg||n!==x0||r!==w0)&&(qg&&LB(),qg=setInterval(function(){var c=Cc(document.elementFromPoint(n,r),!0);c!==l&&(l=c,LC()),M0(i,o.options,c,s)},10),x0=n,w0=r)}else{if(!this.options.bubbleScroll||Cc(a,!0)===qr()){LC();return}M0(i,this.options,Cc(a,!1),!1)}}},dl(e,{pluginName:"scroll",initializeByDefault:!0})}function LC(){Si.forEach(function(e){clearInterval(e.pid)}),Si=[]}function LB(){clearInterval(qg)}var M0=iK(function(e,t,i,s){if(t.scroll){var o=(e.touches?e.touches[0]:e).clientX,n=(e.touches?e.touches[0]:e).clientY,r=t.scrollSensitivity,a=t.scrollSpeed,l=qr(),c=!1,d;qD!==i&&(qD=i,LC(),Zg=t.scroll,d=t.scrollFn,Zg===!0&&(Zg=Cc(i,!0)));var h=0,u=Zg;do{var p=u,g=wi(p),f=g.top,y=g.bottom,m=g.left,C=g.right,b=g.width,S=g.height,A=void 0,R=void 0,I=p.scrollWidth,w=p.scrollHeight,M=ke(p),T=p.scrollLeft,E=p.scrollTop;p===l?(A=b<I&&(M.overflowX==="auto"||M.overflowX==="scroll"||M.overflowX==="visible"),R=S<w&&(M.overflowY==="auto"||M.overflowY==="scroll"||M.overflowY==="visible")):(A=b<I&&(M.overflowX==="auto"||M.overflowX==="scroll"),R=S<w&&(M.overflowY==="auto"||M.overflowY==="scroll"));var P=A&&(Math.abs(C-o)<=r&&T+b<I)-(Math.abs(m-o)<=r&&!!T),N=R&&(Math.abs(y-n)<=r&&E+S<w)-(Math.abs(f-n)<=r&&!!E);if(!Si[h])for(var F=0;F<=h;F++)Si[F]||(Si[F]={});(Si[h].vx!=P||Si[h].vy!=N||Si[h].el!==p)&&(Si[h].el=p,Si[h].vx=P,Si[h].vy=N,clearInterval(Si[h].pid),(P!=0||N!=0)&&(c=!0,Si[h].pid=setInterval(function(){s&&this.layer===0&&Te.active._onTouchMove(Gb);var _=Si[this.layer].vy?Si[this.layer].vy*a:0,W=Si[this.layer].vx?Si[this.layer].vx*a:0;typeof d=="function"&&d.call(Te.dragged.parentNode[mo],W,_,e,Gb,Si[this.layer].el)!=="continue"||sK(Si[this.layer].el,W,_)}.bind({layer:h}),24))),h++}while(t.bubbleScroll&&u!==l&&(u=Cc(u,!1)));QD=c}},30),hK=function(t){var i=t.originalEvent,s=t.putSortable,o=t.dragEl,n=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(i){var c=s||n;a();var d=i.changedTouches&&i.changedTouches.length?i.changedTouches[0]:i,h=document.elementFromPoint(d.clientX,d.clientY);l(),c&&!c.el.contains(h)&&(r("spill"),this.onSpill({dragEl:o,putSortable:s}))}};function PL(){}PL.prototype={startIndex:null,dragStart:function(t){var i=t.oldDraggableIndex;this.startIndex=i},onSpill:function(t){var i=t.dragEl,s=t.putSortable;this.sortable.captureAnimationState(),s&&s.captureAnimationState();var o=dp(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(i,o):this.sortable.el.appendChild(i),this.sortable.animateAll(),s&&s.animateAll()},drop:hK};dl(PL,{pluginName:"revertOnSpill"});function NL(){}NL.prototype={onSpill:function(t){var i=t.dragEl,s=t.putSortable,o=s||this.sortable;o.captureAnimationState(),i.parentNode&&i.parentNode.removeChild(i),o.animateAll()},drop:hK};dl(NL,{pluginName:"removeOnSpill"});Te.mount(new gLe);Te.mount(NL,PL);function fLe(e,t,i={}){let s;const{document:o=HTe,...n}=i,r={onUpdate:d=>{vLe(t,d.oldIndex,d.newIndex,d)}},a=()=>{const d=typeof e=="string"?o?.querySelector(e):WTe(e);!d||s!==void 0||(s=new Te(d,{...r,...n}))},l=()=>{s?.destroy(),s=void 0},c=(d,h)=>{if(h!==void 0)s?.option(d,h);else return s?.option(d)};return _Te(a),kL(l),{stop:l,start:a,option:c}}function mLe(e,t,i){const s=e.children[i];e.insertBefore(t,s)}function yLe(e){e.parentNode&&e.parentNode.removeChild(e)}function vLe(e,t,i,s=null){s!=null&&(yLe(s.item),mLe(s.from,s.item,t));const o=x.isRef(e),n=o?[...x.toValue(e)]:x.toValue(e);if(i>=0&&i<n.length){const r=n.splice(t,1)[0];x.nextTick(()=>{n.splice(i,0,r),o&&(e.value=n)})}}const CLe=["data-align"],bLe={key:0,role:"list",class:"pv-popover-list",ref:"popoverList"},SLe=x.defineComponent({__name:"PvPopover",props:{alignment:{default:void 0},cssCustomProperties:{default:()=>({})},isList:{type:Boolean,default:!1},isSortable:{type:Boolean}},emits:["list-order-updated"],setup(e,{emit:t}){const i=x.useTemplateRef("popoverList"),s=e,o=t;s.isSortable&&s.isList&&fLe(i,[],{animation:150,onUpdate:()=>{const r=Array.from(i.value?.children||[]).map(a=>a.id);o("list-order-updated",r)}});const n=x.computed(()=>{const r=[];return Object.keys(s.cssCustomProperties).forEach(a=>{const l=s.cssCustomProperties[a];l&&r.push(`--${a}: ${l};`)}),r.length?r.join("; "):void 0});return(r,a)=>(x.openBlock(),x.createElementBlock("div",{class:"pv-popover","data-align":r.alignment,style:x.normalizeStyle(n.value)},[r.isList?(x.openBlock(),x.createElementBlock("ul",bLe,[x.renderSlot(r.$slots,"default",{},void 0,!0)],512)):x.renderSlot(r.$slots,"default",{key:1},void 0,!0)],12,CLe))}}),Xh=(e,t)=>{const i=e.__vccOpts||e;for(const[s,o]of t)i[s]=o;return i},xLe=Xh(SLe,[["__scopeId","data-v-fe55e23d"]]),uK=TL?window:void 0;function Qg(e){var t;const i=x.toValue(e);return(t=i?.$el)!=null?t:i}function Su(...e){const t=[],i=()=>{t.forEach(a=>a()),t.length=0},s=(a,l,c,d)=>(a.addEventListener(l,c,d),()=>a.removeEventListener(l,c,d)),o=x.computed(()=>{const a=f0(x.toValue(e[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),n=VTe(()=>{var a,l;return[(l=(a=o.value)==null?void 0:a.map(c=>Qg(c)))!=null?l:[uK].filter(c=>c!=null),f0(x.toValue(o.value?e[1]:e[0])),f0(x.unref(o.value?e[2]:e[1])),x.toValue(o.value?e[3]:e[2])]},([a,l,c,d])=>{if(i(),!a?.length||!l?.length||!c?.length)return;const h=ETe(d)?{...d}:d;t.push(...a.flatMap(u=>l.flatMap(p=>c.map(g=>s(u,p,g,h)))))},{flush:"post"}),r=()=>{n(),i()};return kL(i),r}let EB=!1;function PB(e,t,i={}){const{window:s=uK,ignore:o=[],capture:n=!0,detectIframe:r=!1,controls:a=!1}=i;if(!s)return a?{stop:za,cancel:za,trigger:za}:za;if(YD&&!EB){EB=!0;const y={passive:!0};Array.from(s.document.body.children).forEach(m=>Su(m,"click",za,y)),Su(s.document.documentElement,"click",za,y)}let l=!0;const c=y=>x.toValue(o).some(m=>{if(typeof m=="string")return Array.from(s.document.querySelectorAll(m)).some(C=>C===y.target||y.composedPath().includes(C));{const C=Qg(m);return C&&(y.target===C||y.composedPath().includes(C))}});function d(y){const m=x.toValue(y);return m&&m.$.subTree.shapeFlag===16}function h(y,m){const C=x.toValue(y),b=C.$.subTree&&C.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(S=>S.el===m.target||m.composedPath().includes(S.el))}const u=y=>{const m=Qg(e);if(y.target!=null&&!(!(m instanceof Element)&&d(e)&&h(e,y))&&!(!m||m===y.target||y.composedPath().includes(m))){if("detail"in y&&y.detail===0&&(l=!c(y)),!l){l=!0;return}t(y)}};let p=!1;const g=[Su(s,"click",y=>{p||(p=!0,setTimeout(()=>{p=!1},0),u(y))},{passive:!0,capture:n}),Su(s,"pointerdown",y=>{const m=Qg(e);l=!c(y)&&!!(m&&!y.composedPath().includes(m))},{passive:!0}),r&&Su(s,"blur",y=>{setTimeout(()=>{var m;const C=Qg(e);((m=s.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!C?.contains(s.document.activeElement)&&t(y)},0)},{passive:!0})].filter(Boolean),f=()=>g.forEach(y=>y());return a?{stop:f,cancel:()=>{l=!1},trigger:y=>{l=!0,u(y),l=!1}}:f}const wLe={mounted(e,t){const i=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=PB(e,t.value,{capture:i});else{const[s,o]=t.value;e.__onClickOutside_stop=PB(e,s,Object.assign({capture:i},o))}},unmounted(e){e.__onClickOutside_stop()}};function D0(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function pK(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const i=e.parentNode;return!i||i.tagName==="BODY"?!1:pK(i)}}function MLe(e){const t=e||window.event,i=t.target;return pK(i)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const A0=new WeakMap;function DLe(e,t=!1){const i=x.shallowRef(t);let s=null,o="";x.watch(q3(e),a=>{const l=D0(x.toValue(a));if(l){const c=l;if(A0.get(c)||A0.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(o=c.style.overflow),c.style.overflow==="hidden")return i.value=!0;if(i.value)return c.style.overflow="hidden"}},{immediate:!0});const n=()=>{const a=D0(x.toValue(e));!a||i.value||(YD&&(s=Su(a,"touchmove",l=>{MLe(l)},{passive:!1})),a.style.overflow="hidden",i.value=!0)},r=()=>{const a=D0(x.toValue(e));!a||!i.value||(YD&&s?.(),a.style.overflow=o,A0.delete(a),i.value=!1)};return kL(r),x.computed({get(){return i.value},set(a){a?n():r()}})}function ALe(){let e=!1;const t=x.shallowRef(!1);return(i,s)=>{if(t.value=s.value,e)return;e=!0;const o=DLe(i,s.value);x.watch(t,n=>o.value=n)}}ALe();const ILe={class:"pv-relative"},RLe=["disabled"],kLe={key:0,class:"pv-shimmer"},TLe=x.defineComponent({__name:"PvDropdown",props:{defaultOpen:{type:Boolean,default:!1},popoverCssProperties:{},alignment:{},isList:{type:Boolean,default:!1},isSortable:{type:Boolean},icon:{type:Boolean},disabled:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["dropdown-open","dropdown-closed","list-order-updated"],setup(e,{expose:t,emit:i}){const s=i,o=x.ref(e.defaultOpen),n=x.computed(()=>({"pv-hide":!o.value})),r=l=>{o.value=!o.value},a=()=>{o.value=!1};return t({closeDropdown:a}),x.watch(o,l=>{s(l?"dropdown-open":"dropdown-closed")}),(l,c)=>x.withDirectives((x.openBlock(),x.createElementBlock("div",ILe,[x.createElementVNode("button",{class:x.normalizeClass({"pv-select":!l.icon,"pv-icon-button":l.icon}),style:{width:"auto"},onClick:r,disabled:l.disabled},[x.renderSlot(l.$slots,"trigger",{},()=>[c[1]||(c[1]=x.createTextVNode("Open"))],!0)],10,RLe),x.createVNode(xLe,{class:x.normalizeClass(n.value),"css-custom-properties":l.popoverCssProperties,alignment:l.alignment,isList:l.isList,isSortable:l.isSortable,onListOrderUpdated:c[0]||(c[0]=d=>l.$emit("list-order-updated",d))},{default:x.withCtx(()=>[x.renderSlot(l.$slots,"default",{},()=>[l.isLoading?(x.openBlock(),x.createElementBlock("span",kLe,"Loading...")):x.createCommentVNode("",!0)],!0)]),_:3},8,["class","css-custom-properties","alignment","isList","isSortable"])])),[[x.unref(wLe),a]])}}),OL=Xh(TLe,[["__scopeId","data-v-5261fc4a"]]),LLe=["xlink:href"],ELe=[void 0,10,12,20,24,32,64],As=x.defineComponent({__name:"PvIcon",props:{name:{},size:{}},setup(e){const t=e,i=x.computed(()=>({"pv-icon":!0,[`pv-icon-${t.size}`]:ELe.includes(t.size)}));return(s,o)=>(x.openBlock(),x.createElementBlock("svg",{"aria-hidden":"true",class:x.normalizeClass(i.value)},[x.createElementVNode("use",{"xlink:href":`#${s.name}`},null,8,LLe)],2))}}),PLe=["disabled"],NLe={key:0,class:"pv-button-loading"},OLe=x.defineComponent({__name:"PvButton",props:{variant:{default:"primary"},disabled:{type:Boolean,default:!1},size:{default:void 0},inverse:{type:Boolean,default:!1},shadow:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},setup(e){const t=e,i=x.computed(()=>({[`pv-button-${t.variant}`]:!0,[`pv-button-${t.size}`]:!!t.size,"pv-button-inverse":t.inverse,"pv-button-shadow":t.shadow}));return(s,o)=>(x.openBlock(),x.createElementBlock("button",{type:"button",class:x.normalizeClass(i.value),disabled:s.disabled},[s.loading?(x.openBlock(),x.createElementBlock("span",NLe)):x.renderSlot(s.$slots,"default",{key:1},void 0,!0)],10,PLe))}}),Ac=Xh(OLe,[["__scopeId","data-v-f00f6419"]]),FLe=x.defineComponent({__name:"PvCounterBadge",props:{value:{},prefix:{default:""},variant:{default:"primary"},size:{default:"sm"},maxValue:{default:99}},setup(e){const t=e,i=x.computed(()=>t.size=="md"?"md":(t.size=="sm","sm")),s=x.computed(()=>t.maxValue&&t.value&&t.value>t.maxValue?`${t.maxValue}+`:t.value!=null?`${t.prefix}${t.value}`:"-"),o=x.computed(()=>({"pv-inline-block pv-inset-square pv-radius pv-text-center":!0,"pv-badge-md pv-text-body-xs":i.value=="md","pv-badge-sm pv-text-body-xxs":i.value=="sm","pv-surface-brand-inverse pv-text-inverse":t.variant=="primary","pv-surface pv-bordered":t.variant=="secondary","pv-surface-lighten-5":t.variant=="tertiary","pv-text-secondary":t.variant=="ghost"||t.variant=="tertiary","pv-surface":t.variant=="ghost"}));return(n,r)=>(x.openBlock(),x.createElementBlock("div",{class:x.normalizeClass(o.value)},x.toDisplayString(s.value),3))}}),gK=Xh(FLe,[["__scopeId","data-v-5afd0e59"]]),BLe={class:"pv-text-body-xxs"},NB=x.defineComponent({__name:"PvTag",props:{label:{},rounded:{type:Boolean,default:!1},iconRight:{},iconLeft:{},isButton:{type:Boolean,default:!0}},emits:["tag-clicked","tag-icon-right-clicked","tag-icon-left-clicked"],setup(e,{emit:t}){const i=t;return(s,o)=>(x.openBlock(),x.createBlock(x.resolveDynamicComponent(s.isButton?"button":"div"),{class:"pv-flex-inline pv-tag",onClick:o[2]||(o[2]=n=>i("tag-clicked"))},{default:x.withCtx(()=>[s.iconLeft?(x.openBlock(),x.createBlock(As,{key:0,name:s.iconLeft,size:12,onClick:o[0]||(o[0]=x.withModifiers(n=>i("tag-icon-left-clicked"),["prevent"]))},null,8,["name"])):x.createCommentVNode("",!0),x.createElementVNode("span",BLe,x.toDisplayString(s.label),1),s.iconRight?(x.openBlock(),x.createBlock(As,{key:1,name:s.iconRight,size:12,onClick:o[1]||(o[1]=x.withModifiers(n=>i("tag-icon-right-clicked"),["prevent"]))},null,8,["name"])):x.createCommentVNode("",!0)]),_:1}))}}),GLe=["onClick","data-active","aria-label"],_Le=x.defineComponent({__name:"PvSegmentedControl",props:{options:{},iconOnly:{type:Boolean,default:!1},modelValue:{},large:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const i=t,s=n=>{i("update:modelValue",n)},o=x.computed(()=>({"pv-segmented-control":!e.large,"pv-segmented-control-large":e.large,"pv-segmented-control-icon":e.iconOnly}));return(n,r)=>(x.openBlock(),x.createElementBlock("div",{class:x.normalizeClass(o.value)},[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(n.options,a=>(x.openBlock(),x.createElementBlock("button",{key:a.value,onClick:l=>s(a.value),"data-active":n.modelValue===a.value?!0:null,"aria-label":n.iconOnly?a.label:void 0},[a.iconPosition=="left"?(x.openBlock(),x.createBlock(x.unref(As),{key:0,name:a.iconName},null,8,["name"])):x.createCommentVNode("",!0),n.iconOnly?x.createCommentVNode("",!0):(x.openBlock(),x.createElementBlock(x.Fragment,{key:1},[x.createTextVNode(x.toDisplayString(a.label),1)],64)),a.iconPosition=="right"?(x.openBlock(),x.createBlock(x.unref(As),{key:2,name:a.iconName},null,8,["name"])):x.createCommentVNode("",!0)],8,GLe))),128))],2))}}),zLe={class:"pv-flex"},VLe=["onClick"],OB=x.defineComponent({__name:"PvSelect",props:x.mergeModels({options:{default:()=>[]},defaultText:{default:"Select an option"},disabled:{type:Boolean,default:!1}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,i=x.ref(null),s=x.useModel(e,"modelValue"),o=x.computed(()=>{const l=t.options.find(c=>c.value===s.value);return l?l.label:t.defaultText}),n=x.computed(()=>{const l=t.options.find(c=>c.value===s.value);return l&&l?l.iconName:null}),r=l=>l&&l?l.iconName:null,a=l=>{s.value=l.value,i.value&&i.value.closeDropdown()};return(l,c)=>(x.openBlock(),x.createBlock(OL,{ref_key:"dropdown",ref:i,isList:!0,disabled:l.disabled,popoverCssProperties:{width:"auto"}},{trigger:x.withCtx(()=>[x.createElementVNode("div",zLe,[n.value?(x.openBlock(),x.createBlock(As,{key:0,class:"pv-icon-button",name:n.value},null,8,["name"])):x.createCommentVNode("",!0),x.createTextVNode(" "+x.toDisplayString(o.value),1)])]),default:x.withCtx(()=>[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(l.options,d=>(x.openBlock(),x.createElementBlock("li",{key:d.value},[x.createElementVNode("a",{role:"button",onClick:h=>a(d),style:{cursor:"pointer"}},[r(d)?(x.openBlock(),x.createBlock(As,{key:0,class:"pv-icon-button",name:r(d)||""},null,8,["name"])):x.createCommentVNode("",!0),x.createTextVNode(" "+x.toDisplayString(d.label),1)],8,VLe)]))),128))]),_:1},8,["disabled"]))}}),HLe={class:"pv-flex",style:{"--flex-wrap":"nowrap"}},WLe=["id"],jLe={key:1,style:{"padding-left":"16px"}},ULe=["checked","disabled","onChange"],KLe={class:"pv-text-body-md"},$Le={key:2},FB=2,YLe=x.defineComponent({__name:"GroupBySelector",setup(e){const t=x.inject("gridApi"),i=x.inject("availableRowGroupColumns"),s=x.inject("rowGroupColumnFields");x.watch(s,()=>{},{deep:!0});const o=p=>s.value.includes(p||""),n=(p,g)=>{g?t.value.addRowGroupColumns([p]):t.value.removeRowGroupColumns([p])},r=x.computed(()=>({"pv-hide":i.value.length===0})),a=x.computed(()=>s.value.length>=FB),l=x.computed(()=>s.value.map(p=>i.value.find(g=>g.field===p)).filter(p=>p!==void 0)),c=x.computed(()=>i.value.filter(p=>!s.value.includes(p.field))),d=x.computed(()=>{const p={label:"",value:"divider"},g=l.value.map(y=>({label:y.headerName,value:y.field})),f=c.value.map(y=>({label:y.headerName,value:y.field}));return[...g,p,...f]}),h=p=>`group-by-list-item-${p}`,u=p=>{const g=p.findIndex(m=>m==="divider"),y=p.slice(0,g).slice(0,FB).map(m=>m.replace("group-by-list-item-",""));t.value.setRowGroupColumns(y)};return(p,g)=>(x.openBlock(),x.createBlock(OL,{isList:!0,isSortable:!0,popoverCssProperties:{width:"auto"},alignment:"right",class:x.normalizeClass(r.value),onListOrderUpdated:u},{trigger:x.withCtx(()=>[x.createElementVNode("div",HLe,[g[0]||(g[0]=x.createElementVNode("p",{class:"pv-truncate pv-text-body-md"},"Group by",-1)),x.unref(s).length>0?(x.openBlock(),x.createBlock(x.unref(gK),{key:0,value:x.unref(s).length,variant:"tertiary"},null,8,["value"])):x.createCommentVNode("",!0)])]),default:x.withCtx(()=>[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(d.value,(f,y)=>(x.openBlock(),x.createElementBlock(x.Fragment,{key:f.value},[f.value!=="divider"?(x.openBlock(),x.createElementBlock("li",{key:0,id:h(f.value)},[x.createElementVNode("label",{class:x.normalizeClass(["pv-flex",{"pv-border-bottom":y+1===x.unref(s).length}])},[o(f.value)?(x.openBlock(),x.createBlock(As,{key:0,name:"reorder",class:"pv-text-subdued"})):(x.openBlock(),x.createElementBlock("span",jLe)),x.createElementVNode("input",{type:"checkbox",class:"pv-checkbox",checked:o(f.value),disabled:!o(f.value)&&a.value,onChange:m=>n(f.value,m.target.checked)},null,40,ULe),x.createElementVNode("span",KLe,x.toDisplayString(f.label),1),o(f.value)?(x.openBlock(),x.createElementBlock("sup",$Le,x.toDisplayString(y+1),1)):x.createCommentVNode("",!0)],2)],8,WLe)):x.createCommentVNode("",!0)],64))),128))]),_:1},8,["class"]))}}),XLe={},ZLe={class:"ag-custom-loading-cell pv-shimmer"};function qLe(e,t){return x.openBlock(),x.createElementBlock("div",ZLe)}const QLe=Xh(XLe,[["render",qLe]]),JLe={key:0},eEe={class:"pv-text-body-xxs pv-text-subdued"},tEe={class:"pv-flex pv-space-between",style:{"line-height":"20px"}},iEe={class:"pv-text-title-md"},sEe={key:0,class:"pv-text-subdued pv-text-body-xxs",style:{"padding-right":"12px"}},oEe={key:0,class:"pv-table-row-number"},nEe=x.defineComponent({__name:"GroupedCellRenderer",props:{params:{}},setup(e){const t=e,i=x.inject("rowGroupColumnFields"),s=x.inject("groupColumnCellValueColumn"),o=x.inject("expandedRows"),n=x.computed(()=>!t.params.displayBaseAggregationsOnly||a.value.level===i.value.length-1),r=x.computed(()=>t.params.rowNode.group),a=q3(t.params,"rowNode"),l=x.computed(()=>{if(!s.value)return"";const u=s.value.getColId()||"",p=a.value;return u&&p&&p.data&&u in p.data&&p.data[u]||""}),c=x.computed(()=>a.value.allChildrenCount||0),d=x.computed(()=>{const u=a.value.rowIndex,p=a.value.parent?.rowIndex;return u!=null&&p!=null?u-p:null}),h=u=>{const p=u.node.expanded,g=u.node.rowIndex;g!=null&&(o.value[g]=p)};return x.onMounted(()=>{const u=a.value,p=u.rowIndex,g=u.expanded;p!=null&&(o.value[p]=g),a.value.addEventListener("expandedChanged",h)}),x.onBeforeUnmount(()=>{const u=a.value;a.value.removeEventListener("expandedChanged",h);const p=u.rowIndex;p!=null&&(o.value[p]=!1)}),(u,p)=>(x.openBlock(),x.createElementBlock(x.Fragment,null,[r.value?(x.openBlock(),x.createElementBlock("div",JLe,[x.createElementVNode("p",eEe,x.toDisplayString(x.unref(a).rowGroupColumn?.getColDef().headerName),1),x.createElementVNode("div",tEe,[x.createElementVNode("p",iEe,x.toDisplayString(u.params.formattedValue||u.params.rowNode.key),1),u.params.displayCount&&n.value&&c.value>0?(x.openBlock(),x.createElementBlock("p",sEe," Count "+x.toDisplayString(c.value),1)):x.createCommentVNode("",!0)])])):x.createCommentVNode("",!0),x.createElementVNode("div",null,[x.createElementVNode("p",null,[u.params.displayRowNumber&&d.value?(x.openBlock(),x.createElementBlock("span",oEe,x.toDisplayString(d.value),1)):x.createCommentVNode("",!0),x.createTextVNode(" "+x.toDisplayString(l.value),1)])])],64))}});function BB(e){const t=e.filter(s=>s!=null&&!isNaN(s)).sort((s,o)=>s-o),i=t.length;return i===0?null:t[Math.floor(i/2)]}const rEe={style:{"line-height":"20px"}},aEe={class:"pv-text-subdued pv-text-body-xxs pv-relative"},lEe=x.defineComponent({__name:"GroupAggCellRenderer",props:{params:{}},setup(e){const t=e,i=x.inject("expandedRows"),s=x.computed(()=>(t.params.column?.getAggFunc()||"agg").toLowerCase()),o=()=>{const l=t.params.api;if(l){const c=!r.value;l.setRowNodeExpanded(t.params.node,c),n.value&&(i.value[n.value]=c)}},n=x.computed(()=>t.params.node?.rowIndex),r=x.computed(()=>{let l=!1;return n.value!=null&&(l=n.value in i.value?i.value[n.value]:!1),l}),a=x.computed(()=>r.value?"chevron-down":"chevron-right");return x.onMounted(()=>{t.params.node.expanded&&n.value&&(i.value[n.value]=!0)}),(l,c)=>(x.openBlock(),x.createElementBlock("div",{class:"pv-flex",ondblclick:o},[x.createElementVNode("div",rEe,[x.createElementVNode("p",null,x.toDisplayString(l.params.valueFormatted),1),x.createElementVNode("p",aEe,x.toDisplayString(s.value),1)]),x.createVNode(Ac,{variant:"icon",onClick:o},{default:x.withCtx(()=>[x.createVNode(As,{name:a.value},null,8,["name"])]),_:1})]))}}),fK=x.ref({}),JD=x.ref({}),eA=x.ref(void 0),mK=x.ref({}),yK=x.ref({}),vK=x.ref({}),cEe=async(e,t,i,s)=>{const o=vK.value[t.field]||void 0,n=yK.value[t.field]||[];if(eA.value==null){const h=(await e.getColumnFilterInstance(t.field)).getFilterValues();return o?h.filter(u=>u?.toLowerCase().includes(o.toLowerCase())):h}const r={api:e,colDef:t,column:i,filterModel:s||fK.value,query:o,selectedValues:n};JD.value[t.field]=!0;const a=await eA.value?.(r);JD.value[t.field]=!1,t.field&&(mK.value[t.field]=a);const l=a.filter(d=>d!=null).map(d=>d.value)||[],c=[...n,...l];return c.filter((d,h)=>c.indexOf(d)===h)},dEe=(e,t)=>{const i=mK.value[e];return i?i.find(s=>s?.value===t):null},hEe=(e,t)=>{yK.value[e]=t},uEe=(e,t)=>{vK.value[e]=t},CK=()=>({filterModel:fK,filterValuesLoadingStatus:JD,filterStoreHandler:eA,fetchFilterValues:cEe,filterValueContext:dEe,setFilterSelectedValues:hEe,setFilterValueSearchText:uEe}),pEe={class:"pv-flex pv-stack-8"},gEe={class:"pv-flex",style:{"--flex-wrap":"nowrap"}},fEe={key:0,class:"pv-text-body-md pv-text-subdued",style:{"padding-top":"8px"}},mEe={key:0,class:"pv-text-subdued pv-text-body-xxs",style:{"padding-top":"8px"}},yEe={class:"pv-flex"},vEe=["type","value","checked","disabled","onChange"],CEe={class:"pv-text-body-md",style:{"padding-left":"4px"}},bEe={key:2,class:"pv-text-body-xxs pv-text-subdued"},SEe={key:0,class:"pv-full-width"},xEe={class:"pv-flex-inline"},wEe={role:"list",class:"pv-flex pv-stack-8",style:{"--flex-wrap":"wrap"}},MEe=4,DEe=x.defineComponent({__name:"SetFilter",props:{filterColDef:{},filterStyle:{default:"horizontal"}},emits:["filter-selection-changed","filter-closed"],setup(e,{emit:t}){const i=e,s=t,o=x.inject("gridApi"),{filterModel:n,filterValuesLoadingStatus:r,filterValueContext:a,setFilterValueSearchText:l,setFilterSelectedValues:c}=CK(),d=x.inject("firstDataRendered"),h=x.ref([]),u=x.ref([]),p=x.computed(()=>i.filterColDef.field||""),g=x.computed(()=>i.filterColDef.headerName||""),f=x.ref(!1),y=x.computed(()=>{const B=i.filterColDef.context;return B&&B.filterValueFormatter&&typeof B.filterValueFormatter=="function"?B.filterValueFormatter:typeof i.filterColDef.valueFormatter=="function"?i.filterColDef.valueFormatter:null}),m=x.ref(""),C=x.ref(0),b=x.ref(0),S=async()=>{A(),await R().then(()=>{f.value=!1})},A=()=>{const B=[];if(n.value&&n.value[p.value]?.values){const Y=n.value[p.value].values||[];B.push(...Y)}h.value=B},R=async(B=!1,Y=!1)=>{const q=await o.value.getColumnFilterInstance(p.value);(Y||B&&r.value[p.value]!==!0&&C.value>b.value)&&(q.refreshFilterValues(),b.value=C.value);const Z=new Set(q.getFilterValues());h.value.forEach(ee=>{Z.add(ee)}),u.value=I(Array.from(Z))},I=B=>B.sort((Y,q)=>{const Z=h.value.includes(Y),ee=h.value.includes(q);return Z&&!ee?-1:!Z&&ee?1:0}),w=B=>y.value?y.value({value:B}):B,M=x.computed(()=>{const B=i.filterColDef.context;return B&&B.filterSelectMax?B.filterSelectMax:null}),T=x.computed(()=>{const B=i.filterColDef.context;return B&&B.filterSelectMin?B.filterSelectMin===1&&M.value===1:!1}),E=x.computed(()=>M.value?h.value.length>=M.value:!1),P=x.computed(()=>u.value.filter(B=>!h.value.includes(B))),N=x.computed(()=>u.value.length===1&&u.value[0]===null&&h.value.length===0),F=x.computed(()=>u.value.filter(B=>a(p.value,B)?.isPreference)),_=B=>N.value||a(p.value,B)?.isSelectable===!1?!0:T.value?!1:E.value&&!h.value.includes(B),W=B=>!F.value||F.value.length<1?!1:B===F.value.length-1&&u.value.length>F.value.length,z=x.computed(()=>{const B=[...F.value,...u.value];return B.filter((Y,q)=>B.indexOf(Y)===q)});x.watch(()=>r.value[p.value],()=>{const B=r.value[p.value];f.value&&!B?(R(),f.value=!1):B&&(f.value=!0)},{deep:!0}),x.watch(()=>n.value,()=>{C.value+=1,A()}),x.watch(()=>d.value,()=>{A()}),x.watch(()=>h.value,B=>{c(p.value,B)}),zTe(()=>m.value,async B=>{l(p.value,B),await R(!0,!0)},{debounce:300});const U=B=>{B&&T.value?h.value=[B]:B&&!h.value.includes(B)&&(h.value=[...h.value,B]),O(),s("filter-selection-changed")},G=B=>{h.value=h.value.filter(Y=>Y!==B),O(),s("filter-selection-changed")},V=(B,Y)=>{B.target.checked?U(Y):G(Y)},O=()=>{const B=h.value.length>0?h.value:null;o.value.setColumnFilterModel(p.value,{values:B}).then(()=>{o.value.onFilterChanged()})},H=()=>{m.value="",s("filter-closed")};return x.onMounted(()=>{S()}),(B,Y)=>(x.openBlock(),x.createElementBlock(x.Fragment,null,[x.createElementVNode("div",pEe,[(x.openBlock(),x.createBlock(x.resolveDynamicComponent(B.filterStyle==="vertical"?"ul":"div"),{role:"list",class:"pv-flex",style:{"--flex-wrap":"wrap"}},{default:x.withCtx(()=>[B.filterStyle==="vertical"?(x.openBlock(!0),x.createElementBlock(x.Fragment,{key:0},x.renderList(h.value,q=>(x.openBlock(),x.createElementBlock("li",{key:`${g.value}-${q}`},[x.createVNode(NB,{label:q||"",isButton:!0,iconRight:"close",onTagIconRightClicked:Z=>G(q)},null,8,["label","onTagIconRightClicked"])]))),128)):x.createCommentVNode("",!0),(x.openBlock(),x.createBlock(x.resolveDynamicComponent(B.filterStyle==="vertical"?"li":"div"),null,{default:x.withCtx(()=>[x.createVNode(OL,x.mergeProps({isList:!0,icon:B.filterStyle==="vertical",alignment:B.filterStyle==="vertical"&&h.value.length>2?"right":void 0,class:"pv-flex",popoverCssProperties:{width:"auto"},isLoading:f.value,onDropdownOpen:Y[1]||(Y[1]=q=>R(!0)),onDropdownClosed:H},B.filterStyle==="horizontal"?{"data-horizontal-filter-field":p.value}:{}),x.createSlots({default:x.withCtx(()=>[x.withDirectives(x.createElementVNode("input",{"onUpdate:modelValue":Y[0]||(Y[0]=q=>m.value=q),type:"text",class:"pv-input-search pv-input-small pv-full-width",style:{"min-width":"200px"}},null,512),[[x.vModelText,m.value]]),z.value.length===0?(x.openBlock(),x.createElementBlock("li",fEe," No Results ")):(x.openBlock(),x.createElementBlock(x.Fragment,{key:1},[F.value.length>0?(x.openBlock(),x.createElementBlock("li",mEe," Your Preferences ")):x.createCommentVNode("",!0),(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(z.value,(q,Z)=>(x.openBlock(),x.createElementBlock("li",{key:q,class:x.normalizeClass({"pv-border-bottom":W(Z)})},[x.createElementVNode("label",yEe,[x.createElementVNode("input",{type:T.value?"radio":"checkbox",class:x.normalizeClass(T.value?"pv-radio":"pv-checkbox"),value:q,checked:h.value.includes(q)||N.value,disabled:_(q),onChange:ee=>V(ee,q)},null,42,vEe),x.createElementVNode("span",CEe,x.toDisplayString(w(q)),1)])],2))),128))],64)),E.value?(x.openBlock(),x.createElementBlock("p",bEe," Max of "+x.toDisplayString(M.value)+" allowed ",1)):x.createCommentVNode("",!0)]),_:2},[B.filterStyle==="horizontal"?{name:"trigger",fn:x.withCtx(()=>[x.createElementVNode("div",gEe,[h.value.length>0?(x.openBlock(),x.createBlock(x.unref(gK),{key:0,value:h.value.length,variant:"tertiary"},null,8,["value"])):x.createCommentVNode("",!0),x.createElementVNode("p",{class:x.normalizeClass(["pv-text-body-md pv-truncate",{"pv-shimmer":f.value}])},x.toDisplayString(g.value),3)])]),key:"0"}:{name:"trigger",fn:x.withCtx(()=>[x.createVNode(As,{class:"pv-text-subdued",name:"add-circle"})]),key:"1"}]),1040,["icon","alignment","isLoading"])]),_:1}))]),_:1}))]),B.filterStyle=="vertical"?(x.openBlock(),x.createElementBlock("div",SEe,[x.createElementVNode("div",xEe,[x.createElementVNode("ul",wEe,[Y[2]||(Y[2]=x.createElementVNode("li",null,[x.createElementVNode("p",{class:"pv-text-subdued pv-text-body-md"},"Suggested:")],-1)),(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(P.value.slice(0,MEe),q=>(x.openBlock(),x.createElementBlock("li",{key:`${g.value}-${q}-suggest`},[x.createVNode(NB,{class:"pv-outlined-tag",label:q||"",isButton:!0,iconLeft:"expand",onTagIconLeftClicked:Z=>U(q),onTagClicked:Z=>U(q)},null,8,["label","onTagIconLeftClicked","onTagClicked"])]))),128))])])])):x.createCommentVNode("",!0)],64))}}),GB=Xh(DEe,[["__scopeId","data-v-3ba9abae"]]),AEe={class:"pv-flex"},IEe={class:"pv-flex-vertical pv-space-between pv-full-width",style:{height:"100%","overflow-x":"hidden"}},REe={class:"pv-flex-vertical pv-full-width"},kEe={class:"pv-flex pv-inset-squish pv-full-width pv-space-between"},TEe={class:"pv-text-title-lg"},LEe={class:"pv-full-width pv-inset-inline-24"},EEe={class:"pv-details",open:""},PEe={class:"pv-flex pv-stack-8"},NEe={class:"pv-text-title-lg"},OEe={class:"pv-inset-block-8"},FEe={class:"pv-sticky pv-border-top pv-full-width pv-inset-squish pv-flex pv-space-between pv-surface",style:{"--top":"unset",bottom:"0"}},BEe={class:"pv-flex"},_B=5,GEe=x.defineComponent({__name:"FilterPanel",props:{enableVerticalPanel:{type:Boolean,default:!0}},setup(e){const t=x.inject("gridApi"),i=x.inject("availableFilterColumns"),s=x.inject("currentlyActiveFilter"),o=x.ref(null),n=x.ref(null),r=x.computed(()=>{const p=[...i.value].slice(0,_B);return s.value?[...p.slice(0,_B-1),s.value]:p}),a=x.ref(!1),l=()=>{a.value=!0},c=()=>{a.value=!1,n.value=t.value.getFilterModel(),o.value?.showModal()},d=()=>{n.value=null,t.value.setFilterModel(null),t.value.onFilterChanged()},h=()=>{n.value&&t.value.setFilterModel(n.value),n.value=null,o.value?.close()},u=()=>{t.value.onFilterChanged(),o.value?.close()};return(p,g)=>(x.openBlock(),x.createElementBlock("div",AEe,[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(r.value,f=>(x.openBlock(),x.createElementBlock(x.Fragment,{key:f.field},[x.unref(t)?(x.openBlock(),x.createBlock(GB,{key:0,filterColDef:f},null,8,["filterColDef"])):x.createCommentVNode("",!0)],64))),128)),p.enableVerticalPanel?(x.openBlock(),x.createElementBlock("button",{key:0,class:"pv-button-ghost pv-stack-8 pv-inset-block",onClick:c,style:{"--inset-size":"6px"}},[x.createVNode(x.unref(As),{name:"filter"}),g[5]||(g[5]=x.createTextVNode(" All Filters "))])):x.createCommentVNode("",!0),p.enableVerticalPanel?(x.openBlock(),x.createElementBlock("dialog",{key:1,ref_key:"filterDrawer",ref:o,id:"filter-vertical-drawer",class:"pv-drawer pv-surface",onClick:g[4]||(g[4]=x.withModifiers(f=>h(),["self"])),style:{"max-width":"450px"}},[x.createElementVNode("div",IEe,[x.createElementVNode("div",REe,[x.createElementVNode("div",kEe,[x.createElementVNode("p",TEe," All Filters ("+x.toDisplayString(x.unref(i).length)+") ",1),x.createElementVNode("button",{class:"pv-button-ghost",onClick:g[0]||(g[0]=f=>h())},[x.createVNode(x.unref(As),{name:"close"})])]),x.createElementVNode("div",LEe,[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(x.unref(i),(f,y)=>(x.openBlock(),x.createElementBlock("div",{key:f.field,class:x.normalizeClass([{"pv-border-bottom":y<x.unref(i).length-1},"pv-stack-12"])},[x.createElementVNode("details",EEe,[x.createElementVNode("summary",PEe,[x.createElementVNode("span",NEe,x.toDisplayString(f.headerName),1)]),x.createElementVNode("div",OEe,[x.unref(t)?(x.openBlock(),x.createBlock(GB,{key:0,"filter-style":"vertical",filterColDef:f,onFilterSelectionChanged:l},null,8,["filterColDef"])):x.createCommentVNode("",!0)])])],2))),128))])]),x.createElementVNode("div",FEe,[x.createElementVNode("button",{class:"pv-button-ghost",onClick:g[1]||(g[1]=f=>d())}," Clear All "),x.createElementVNode("div",BEe,[x.createVNode(Ac,{variant:"ghost",onClick:g[2]||(g[2]=f=>h())},{default:x.withCtx(()=>g[6]||(g[6]=[x.createTextVNode(" Cancel ")])),_:1}),a.value?(x.openBlock(),x.createBlock(Ac,{key:0,variant:"primary",onClick:g[3]||(g[3]=f=>u())},{default:x.withCtx(()=>g[7]||(g[7]=[x.createTextVNode(" Apply ")])),_:1})):(x.openBlock(),x.createBlock(Ac,{key:1,variant:"primary",disabled:""},{default:x.withCtx(()=>g[8]||(g[8]=[x.createTextVNode(" No Changes ")])),_:1}))])])])],512)):x.createCommentVNode("",!0)]))}});var tA=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Date="date",e.Currency="currency",e.Formula="formula",e.Select="select",e.Percent="percent",e.Entity="entity",e.Id="id",e.User="user",e.Link="link",e.Status="status",e.Tag="tag",e.None="none",e))(tA||{});const _Ee=e=>{switch(e){case"string":return"fonts";case"number":return"hash";case"boolean":return"list";case"date":return"calendar";case"currency":return"currency-dollar";case"formula":return"formula";case"select":return"list";case"percent":return"percent";case"entity":return"building";case"id":return"id-2";case"link":return"link";case"user":return"user";case"status":return"list";case"tag":return"list";case"none":return null;default:return null}},zEe=(e,t)=>{if(!e)return e;switch(t){case"percent":return e.replace(/^%+/,"").trim();default:return e}},VEe={class:"pv-flex"},HEe={class:"pv-flex ag-header-actions"},WEe=x.defineComponent({__name:"HeaderCellRenderer",props:{params:{}},setup(e,{expose:t}){const i=e,s=x.ref(!1),o=x.ref(!1),n=x.ref(null),r=x.ref(null),a=x.ref(null),l=x.ref(!1),c=x.ref(null),d=x.computed(()=>c.value==="asc"?"arrow-up":c.value==="desc"?"arrow-down":""),h=x.computed(()=>o.value?{cursor:"pointer"}:{}),u=x.computed(()=>l.value?{opacity:1}:{}),p=()=>{l.value=!1},g=()=>{l.value=!0,a.value&&i.params.showColumnMenu(a.value,p)},f=b=>{s.value=b.enableFilterButton,o.value=b.enableSorting||!1,n.value=b.displayName,b.column.getColId()!="ag-Grid-AutoColumn"&&(r.value=_Ee(b.column.getColDef().context?.dataType),n.value=zEe(n.value,b.column.getColDef().context?.dataType))},y=b=>{b.column.getSort()!==void 0&&(c.value=b.column.getSort())},m=()=>{o.value&&i.params.progressSort(!1)};x.onBeforeMount(()=>{f(i.params)}),x.onMounted(()=>{i.params.column.addEventListener("sortChanged",y)}),x.onUnmounted(()=>{i.params.column.removeEventListener("sortChanged",y)});function C(b){return f(b),!0}return t({refresh:C}),(b,S)=>(x.openBlock(),x.createElementBlock("div",{class:"ag-custom-header-cell pv-flex pv-full-width pv-space-between",style:x.normalizeStyle(h.value),onClick:m},[x.createElementVNode("div",VEe,[r.value?(x.openBlock(),x.createBlock(As,{key:0,name:r.value,class:"pv-text-subdued"},null,8,["name"])):x.createCommentVNode("",!0),x.createElementVNode("p",null,x.toDisplayString(n.value),1),o.value&&d.value!==""?(x.openBlock(),x.createBlock(As,{key:1,name:d.value},null,8,["name"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",HEe,[x.createElementVNode("div",{ref_key:"menuButton",ref:a,class:"ag-header-cell-menu-button",style:x.normalizeStyle(u.value)},[x.createVNode(Ac,{variant:"icon",onClick:x.withModifiers(g,["stop","prevent"])},{default:x.withCtx(()=>[x.createVNode(As,{name:"menu"})]),_:1})],4)])],4))}}),jEe=Xh(WEe,[["__scopeId","data-v-d256662b"]]),UEe=h3.withParams({headerHeight:"30px",headerBackgroundColor:"#F7F8F8",headerCellHoverBackgroundColor:"#F7F8F8",headerColumnResizeHandleHeight:"50%",headerColumnResizeHandleWidth:"3px",headerColumnBorder:"none",headerFontWeight:"bold",headerFontSize:"12px",fontFamily:"Inter, sans-serif",fontSize:12,headerRowBorder:!0,rowHoverColor:"#F7F8F8",rangeSelectionBorderColor:"#36C5BA",rangeSelectionBorderStyle:"solid",wrapperBorder:"none",wrapperBorderRadius:"0px",menuBackgroundColor:"white",accentColor:"#36C5BA"}),KEe={class:"pv-popover-menu"},$Ee={class:"pv-popover",style:{"--height":"auto"}},YEe=["disabled"],XEe=x.defineComponent({__name:"ExportMenu",props:{getCsvData:{type:Function}},setup(e){const t=e,i=x.ref(!1);async function s(){i.value=!0;const o=await t.getCsvData();if(!o){i.value=!1;return}const n=new Blob([o],{type:"text/csv;charset=utf-8;"}),r=document.createElement("a");r.href=URL.createObjectURL(n),r.setAttribute("download","datatable_export.csv"),r.click(),i.value=!1}return(o,n)=>(x.openBlock(),x.createElementBlock("nav",KEe,[n[0]||(n[0]=x.createElementVNode("button",{type:"button",class:"pv-button-icon"},[x.createElementVNode("svg",{"aria-hidden":"true",class:"pv-icon-24"},[x.createElementVNode("title",null,"ellipsis"),x.createElementVNode("use",{"xlink:href":"#ellipsis"})])],-1)),x.createElementVNode("div",$Ee,[x.createElementVNode("button",{class:"pv-button pv-text-body-sm pv-inset-square-8",onClick:x.withModifiers(s,["prevent"]),disabled:i.value},[i.value?(x.openBlock(),x.createElementBlock(x.Fragment,{key:0},[x.createTextVNode("Exporting...")],64)):(x.openBlock(),x.createElementBlock(x.Fragment,{key:1},[x.createTextVNode("Download CSV")],64))],8,YEe)])]))}}),ZEe={class:"pv-flex"},qEe={key:1,class:""},QEe=x.defineComponent({__name:"PaginationPanel",props:{panelSize:{default:"xl"}},setup(e){dU.registerModules([aIe]);const t=x.inject("gridApi"),i=e,s=x.ref(1),o=x.ref(1);x.watchEffect(()=>{const c=t.value;c&&(s.value=c.paginationGetCurrentPage()+1,o.value=c.paginationGetTotalPages(),c.addEventListener("paginationChanged",()=>{s.value=c.paginationGetCurrentPage()+1,o.value=c.paginationGetTotalPages()}))});const n=x.computed(()=>{const c=o.value,d=s.value;if(c<=7)return Array.from({length:c},(u,p)=>p+1);const h=[];return d<=4?h.push(1,2,3,4,5,"...",c):d>=c-3?h.push(1,"...",c-4,c-3,c-2,c-1,c):h.push(1,"...",d-1,d,d+1,"...",c),h}),r=()=>{s.value>0&&t?.value.paginationGoToPage(s.value-2)},a=()=>{s.value<o.value&&t?.value.paginationGoToPage(s.value)},l=c=>{c>=1&&c<=o.value&&t?.value.paginationGoToPage(c-1)};return(c,d)=>(x.openBlock(),x.createElementBlock("div",ZEe,[x.createVNode(Ac,{variant:"icon",onClick:r,disabled:s.value===1,class:x.normalizeClass([{"pv-button-tertiary":s.value===1},{"pv-button-small":i.panelSize==="l"}])},{default:x.withCtx(()=>[x.createVNode(As,{name:"chevron-left"})]),_:1},8,["disabled","class"]),(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(n.value,h=>(x.openBlock(),x.createElementBlock(x.Fragment,{key:h},[typeof h=="number"?(x.openBlock(),x.createBlock(Ac,{key:0,variant:h===s.value?"primary":"tertiary",class:x.normalizeClass([{"pv-button-small":i.panelSize==="l"}]),onClick:u=>l(h)},{default:x.withCtx(()=>[x.createTextVNode(x.toDisplayString(h),1)]),_:2},1032,["variant","class","onClick"])):(x.openBlock(),x.createElementBlock("span",qEe,"..."))],64))),128)),x.createVNode(Ac,{variant:"icon",onClick:a,disabled:s.value===o.value,class:x.normalizeClass([{"pv-button-tertiary":s.value===o.value},{"pv-button-small":i.panelSize==="l"}])},{default:x.withCtx(()=>[x.createVNode(As,{name:"chevron-right"})]),_:1},8,["disabled","class"])]))}}),JEe={class:"pv-stack-8"},ePe={class:"pv-flex pv-space-between",style:{"align-items":"start"}},tPe={class:"pv-flex"},iPe={class:"pv-relative pv-stack-8",style:{width:"100%",height:"90%"}},sPe={key:1,class:"pv-chart-overlay pv-text-body-xs"},oPe=x.defineComponent({__name:"PvDataTable",props:{colDefs:{},rowData:{},serverSideRowHandler:{},filterValuesSetHandler:{},initialGridState:{},theme:{default:()=>UEe},displayBaseAggregationsOnly:{type:Boolean,default:!1},displayRowNumber:{type:Boolean,default:!1},enableVerticalFilterPanel:{type:Boolean,default:!0},enableColumnVisibilitySelector:{type:Boolean,default:!1},enableGroupBySelector:{type:Boolean,default:!1},enableCsvExport:{type:Boolean,default:!1},csvRowLimit:{default:2e4},serverSideCsvHandler:{},uniqueRowIdField:{},requireFiltersToShowData:{type:Boolean,default:!1},isLoading:{type:Boolean},containerHeight:{default:500},containerMinHeight:{default:200},debugMode:{type:Boolean,default:!1},pagination:{type:Boolean,default:!1},paginationPageSize:{default:50}},emits:["column-moved","column-resized","column-row-group-changed","grid-ready","filter-changed","filter-opened","first-data-rendered"],setup(e,{expose:t,emit:i}){const s=[uAe,hAe,Uxe,ARe,CAe,DAe,STe,VRe,Eke,tIe,jAe];k3.setLicenseKey("Using_this_{AG_Grid}_Enterprise_key_{AG-065231}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Turquoise_Health}_is_granted_a_{Multiple_Applications}_Developer_License_for_{3}_Front-End_JavaScript_developers___All_Front-End_JavaScript_developers_need_to_be_licensed_in_addition_to_the_ones_working_with_{AG_Grid}_Enterprise___This_key_has_been_granted_a_Deployment_License_Add-on_for_{2}_Production_Environments___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{16_August_2025}____[v3]_[01]_MTc1NTI5ODgwMDAwMA==c042c2db0e82c322692ccb41e7b58f3e");const n=e;n.debugMode&&s.push(nDe);const r=x.computed(()=>({height:`${n.containerHeight}px`,minHeight:`${n.containerMinHeight}px`})),a=i,l="serverSideRowHandler"in n&&n.serverSideRowHandler?{getRows:K=>{if(!A.value){K.success({rowData:[]});return}n.serverSideRowHandler?.(K)}}:null,c="filterValuesSetHandler"in n&&n.filterValuesSetHandler?async K=>{let oe={...I.value};!C.value&&n.initialGridState&&(oe=n.initialGridState.filter?.filterModel||{});const de=await M(K.api,K.colDef,K.column,oe);K.success(de)}:null,d=K=>{const oe=K.node,de=K.column?.getColId();return!oe.group||!de?!1:F.value.some(re=>{if(re.field===de)return!0})},h=(()=>{const K={suppressHeaderFilterButton:!0,editable:!1,sortable:!0,suppressHeaderMenuButton:!0,suppressColumnsToolPanel:!0,minWidth:200,flex:1,headerComponent:jEe,cellRendererSelector:oe=>{if(d(oe))return{component:lEe,params:oe}}};return l&&c&&(K.filterParams={values:c}),K})(),u=x.ref(void 0),p={name:"Column Filter",icon:'<span class="ag-icon ag-icon-filter"></span>',action:function(K){let oe=K.column?.getColId();if(K.column&&G(K.column)&&(oe=_.value?.getColId()||""),console.log("customFilterMenuItem",oe),!Z(oe)){const re=K.api.getColumn(oe)?.getColDef();re&&(y.value=re,x.nextTick(()=>{Z(oe)}))}}},g=(K,oe)=>{const de={...K};return oe.dataType===tA.Percent&&!K.valueFormatter?de.valueFormatter=Eme:oe.dataType===tA.Currency&&!K.valueFormatter&&(de.valueFormatter=J4),de},f=x.computed(()=>!n.colDefs||n.colDefs.length===0?[]:n.colDefs.map(K=>{const oe=K.context;return oe?g(K,oe):K})),y=x.ref(null),m=x.ref([]),C=x.ref(!1),b=x.ref(!0),S=x.ref(void 0),A=x.computed(()=>!n.requireFiltersToShowData||!n.serverSideRowHandler||!!Object.keys(I.value||{}).length),R=x.shallowRef(null),{filterModel:I,filterValuesLoadingStatus:w,fetchFilterValues:M,filterStoreHandler:T}=CK();T.value=n.filterValuesSetHandler;const E=x.ref(null),P=x.computed(()=>f.value.filter(K=>K.filter)),N=x.computed(()=>f.value.filter(K=>K.enableRowGroup)),F=x.computed(()=>f.value.filter(K=>K.aggFunc)),_=x.ref(null),W=x.ref({});x.provide("filterModel",I),x.provide("gridApi",R),x.provide("columnDisplayOrder",E),x.provide("currentlyActiveFilter",y),x.provide("availableFilterColumns",P),x.provide("availableRowGroupColumns",N),x.provide("rowGroupColumnFields",m),x.provide("groupColumnCellValueColumn",_),x.provide("expandedRows",W),x.provide("firstDataRendered",C),x.provide("filterValuesLoadingStatus",w),x.provide("displayUnfilteredTableData",A);const z=K=>{R.value=K.api,K.api.setColumnsVisible(m.value,!1),E.value=K.api.getAllGridColumns(),a("grid-ready",K)},U=K=>{R.value&&(I.value=R.value.getFilterModel()),a("filter-changed",K)},G=K=>K.getColId()&&K.getColId().includes("ag-Grid-AutoColumn"),V=K=>!K.getColDef().aggFunc,O=x.ref(!1),H=async()=>{if(O.value=!0,!R.value)return console.error("Grid API not available"),O.value=!1,null;try{const K=n.serverSideCsvHandler,oe=R.value?.getState(),de={rowGroupCols:[],valueCols:R.value?.getValueColumns().map(ce=>({id:ce.getId(),field:ce.getColDef().field,aggFunc:typeof ce.getColDef().aggFunc=="string"?ce.getColDef().aggFunc:void 0,displayName:ce.getColDef().headerName||ce.getColDef().field||""}))||[],filterModel:oe?.filter?.filterModel||{},sortModel:oe?.sort?.sortModel||[],pivotCols:[],pivotMode:!1,groupKeys:[],startRow:0,endRow:n.csvRowLimit};if(K){const ce={request:de,parentNode:{},api:R.value,context:void 0,success:()=>{},fail:()=>{}};return await n.serverSideCsvHandler(ce),O.value=!1,null}const re=n.serverSideRowHandler;return re?await new Promise((ce,be)=>{const Se=R.value?.getState(),Fe={request:de,parentNode:{},api:R.value,context:void 0,success:dt=>{const tt=R.value?.getRowGroupColumns().map(ps=>ps.getColDef().field).filter(ps=>!!ps)||[],At=R.value?.getAllDisplayedColumns().map(ps=>ps.getColDef().field).filter(ps=>!!ps)||[],Ue=R.value?.getValueColumns().map(ps=>ps.getColDef().field).filter(ps=>!!ps)||[],Tt=Array.from(new Set([...tt,...At,...Ue])),Gs=dt.rowData.map(ps=>{const Da={};return Tt.forEach(Lo=>{const _l=ps[Lo];Da[Lo]=_l!=null?String(_l):null}),Da}),ug=TTe.unparse(Gs);O.value=!1,ce(ug)},fail:()=>{O.value=!1,be("CSV export failed.")}};re(Fe,!0)}):(console.warn("Client-side export does not return CSV string"),O.value=!1,R.value.exportDataAsCsv(),null)}catch(K){return console.error("CSV export failed",K),O.value=!1,null}},B=K=>{const oe=_.value;if(m.value=[...K.api.getRowGroupColumns()].map(de=>de.getColId()),m.value.length>0){const de=K.api.getAllGridColumns().filter(re=>re.isVisible()&&!G(re)&&V(re)&&!m.value.includes(re.getColId()))[0];_.value=de,K.api.setColumnsVisible([de.getColId()],!1),j.value.headerName=de.getColDef().headerName}else _.value&&(_.value=null,j.value.headerName="");oe&&!m.value.includes(oe.getColId())&&K.api.setColumnsVisible([oe.getColId()],!0),a("column-row-group-changed",K)},Y=K=>{K.finished&&(E.value=K.api.getAllGridColumns()),a("column-moved",K)},q=K=>"allChildrenRowCount"in K&&K.allChildrenRowCount||0,Z=K=>{const oe=document.querySelector(`[data-horizontal-filter-field="${K}"]`);if(oe){const de=oe.querySelector("button");if(de)return de.click(),!0}return!1},ee=x.ref(QLe),se=x.ref({loadingMessage:"One moment please..."}),j=x.ref({headerName:"",minWidth:200,suppressMovable:!0,sortable:!1,pinned:"left",cellRendererParams:{suppressCount:!0,innerRenderer:nEe,innerRendererParams:K=>({displayBaseAggregationsOnly:n.displayBaseAggregationsOnly,displayRowNumber:n.displayRowNumber,displayCount:!1,formattedValue:K.valueFormatted,rowNode:K.node,api:R.value})}}),X=K=>{if(K.node.group)return{backgroundColor:"#F7F8F8"}},$={Median:K=>{const oe=K.values;if(K.rowNode.leafGroup){const ce=BB(oe);return{values:oe,value:ce}}const de=K.values.flatMap(ce=>ce.values||[]),re=BB(de);return{values:de,value:re}}};x.onBeforeMount(()=>{const K=Array.isArray(n.rowData)&&n.rowData.length>0,oe=typeof n.serverSideRowHandler=="function",de=typeof n.filterValuesSetHandler=="function";(K&&oe||K&&de)&&console.warn("Only one of `rowData` or `serverSideRowHandler + hasFilterValuesSetHandler` params should be provided to PvDataTable, not both."),u.value=re=>{const ce=["sortAscending","sortDescending","sortUnSort","rowUnGroup","valueAggSubMenu"],be=re.column&&G(re.column)?_.value:re.column;return be&&be.getColDef().filter&&ce.splice(2,0,p),ce.filter(Se=>typeof Se=="string"?re.defaultItems.includes(Se):!0)}});const J=K=>{I.value=K.filter?.filterModel||null,m.value=K.rowGroup?.groupColIds||[],b.value=!1,setTimeout(()=>{S.value=K,b.value=!0})};x.watch(()=>n.initialGridState,()=>{n.initialGridState&&J(n.initialGridState)},{deep:!0}),x.onMounted(()=>{n.initialGridState&&J(n.initialGridState)});const ie=K=>{C.value=!0,a("first-data-rendered",K)};t({getCsvData:H});const ne=K=>l?K.rowNode.level===m.value.length-2:!1;return(K,oe)=>(x.openBlock(),x.createElementBlock("div",{class:"pv-full-width",style:x.normalizeStyle(r.value)},[x.createElementVNode("div",JEe,[x.createElementVNode("div",ePe,[x.createVNode(GEe,{"enable-vertical-panel":K.enableVerticalFilterPanel},null,8,["enable-vertical-panel"]),x.createElementVNode("div",tPe,[K.enableGroupBySelector?(x.openBlock(),x.createBlock(YLe,{key:0})):x.createCommentVNode("",!0),K.enableCsvExport?(x.openBlock(),x.createBlock(XEe,{key:1,getCsvData:H})):x.createCommentVNode("",!0)])])]),x.createElementVNode("div",iPe,[b.value?(x.openBlock(),x.createBlock(x.unref(yIe),x.mergeProps({key:0,ref:"gridRef",style:{width:"100%",height:"100%"}},x.unref(l)?{serverSideDatasource:x.unref(l)}:{},{onColumnMoved:Y,onColumnRowGroupChanged:B,onFilterChanged:U,onFilterOpened:oe[0]||(oe[0]=de=>a("filter-opened",de)),onFirstDataRendered:ie,onGridReady:z,aggFuncs:$,autoGroupColumnDef:j.value,columnDefs:f.value,debug:K.debugMode,defaultColDef:x.unref(h),getChildCount:q,getMainMenuItems:u.value,getRowStyle:X,groupDefaultExpanded:x.unref(l)?void 0:1,groupDisplayType:"singleColumn",initialState:S.value,isServerSideGroupOpenByDefault:ne,loading:x.unref(l)?!1:K.isLoading,loadingCellRenderer:ee.value,loadingCellRendererParams:se.value,maxConcurrentDatasourceRequests:x.unref(l)?10:void 0,modules:s,rowData:K.rowData,rowModelType:x.unref(l)?"serverSide":"clientSide",serverSideInitialRowCount:x.unref(l)?1:void 0,showOpenedGroup:!0,suppressAggFuncInHeader:!0,suppressDragLeaveHidesColumns:!0,serverSideSortAllLevels:!1,serverSideEnableClientSideSort:!1,theme:K.theme,pagination:K.pagination,suppressPaginationPanel:!0,paginationPageSize:K.paginationPageSize,suppressScrollOnNewData:!0}),null,16,["autoGroupColumnDef","columnDefs","debug","defaultColDef","getMainMenuItems","groupDefaultExpanded","initialState","loading","loadingCellRenderer","loadingCellRendererParams","maxConcurrentDatasourceRequests","rowData","rowModelType","serverSideInitialRowCount","theme","pagination","paginationPageSize"])):x.createCommentVNode("",!0),A.value?x.createCommentVNode("",!0):(x.openBlock(),x.createElementBlock("p",sPe," Select a filter to view data. "))]),x.createVNode(QEe,{panelSize:"xl"})],4))}}),nPe={class:"pv-stack-16 pv-chart-options-panel"},rPe={key:0},aPe={class:"pv-flex"},lPe=x.defineComponent({__name:"PvChartOptionsPanel",props:{showPanel:{type:Boolean},chartFilter:{}},setup(e){const t=e,i=x.inject("activeChartType"),s=x.inject("chartTypes"),o=x.inject("sortTypes"),n=x.inject("activeSort"),r=x.inject("activeChartFilterOption"),a=x.computed(()=>{const c=[];return t.chartFilter&&t.chartFilter.options?t.chartFilter.options.map(d=>({label:d.label,value:d.value})):c}),l=x.computed(()=>["bar","line","column","area"].includes(i.value));return(c,d)=>(x.openBlock(),x.createElementBlock("div",nPe,[c.showPanel?(x.openBlock(),x.createElementBlock("div",rPe,[x.createElementVNode("div",{class:"pv-flex pv-space-between",style:x.normalizeStyle(c.chartFilter?{"--flex-justify":"flex-end"}:{})},[(x.openBlock(),x.createBlock(_Le,{key:0,options:a.value,modelValue:x.unref(r),"onUpdate:modelValue":d[0]||(d[0]=h=>x.isRef(r)?r.value=h:null)},null,8,["options","modelValue"])),x.createElementVNode("div",aPe,[x.createVNode(OB,{options:x.unref(o),modelValue:x.unref(n),"onUpdate:modelValue":d[1]||(d[1]=h=>x.isRef(n)?n.value=h:null),defaultText:"Sort By",disabled:!l.value},null,8,["options","modelValue","disabled"]),x.createVNode(OB,{options:x.unref(s),modelValue:x.unref(i),"onUpdate:modelValue":d[2]||(d[2]=h=>x.isRef(i)?i.value=h:null)},null,8,["options","modelValue"])])],4)])):x.createCommentVNode("",!0)]))}}),cPe={style:{height:"100%",width:"100%"}},dPe={class:"pv-relative pv-margin-auto"},hPe={key:0,class:"pv-chart-overlay pv-text-body-xs"},uPe=x.defineComponent({__name:"PvDataTableWithChart",props:{enabledChartTypes:{default:()=>["column","bar","line","area","pie"]},overrideChartData:{type:Boolean,default:!1},showSeriesLabels:{type:Boolean,default:!0},showSeriesLabelsWhenStacked:{type:Boolean,default:!1},initialChartData:{},chartFilter:{},chartType:{default:"column"},yKey:{default:""},colDefs:{},rowData:{},serverSideRowHandler:{},filterValuesSetHandler:{},initialGridState:{default:()=>({})},theme:{},displayBaseAggregationsOnly:{type:Boolean,default:!1},displayRowNumber:{type:Boolean,default:!0},enableVerticalFilterPanel:{type:Boolean,default:!0},enableColumnVisibilitySelector:{type:Boolean,default:!0},enableGroupBySelector:{type:Boolean,default:!0},enableCsvExport:{type:Boolean,default:!1},csvRowLimit:{},serverSideCsvHandler:{},uniqueRowIdField:{},requireFiltersToShowData:{type:Boolean,default:!1},isLoading:{type:Boolean},containerHeight:{},containerMinHeight:{},debugMode:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{}},emits:["chart-data-updated","column-moved","column-resized","column-row-group-changed","grid-ready","filter-changed","filter-opened","first-data-rendered"],setup(e,{expose:t,emit:i}){const s=e,o=i,n=x.ref(null),r=x.ref(null),a=j=>{n.value=j.api},l=j=>{f.value=[...j.api.getRowGroupColumns()],z(j.api),V(j.api),o("column-row-group-changed",j)},c=async j=>{if(s.chartFilter){const $=(await j.api.getColumnFilterInstance(s.chartFilter.colId))?.getModel();R.value=$?.values?.[0]||""}V(j.api),o("filter-changed",j)},d=x.ref([]),h=j=>{if(!j||!n.value)return;const X=n.value?.getColumnDef(j);if(X&&X.valueFormatter)return X.valueFormatter},u=x.ref([{label:"Column",value:"column",iconName:"chart-column",iconPosition:"left"},{label:"Bar",value:"bar",iconName:"chart-bar",iconPosition:"left"},{label:"Line",value:"line",iconName:"chart-line",iconPosition:"left"},{label:"Area",value:"area",iconName:"chart-area",iconPosition:"left"},{label:"Pie",value:"pie",iconName:"chart-pie",iconPosition:"left"}]),p=x.ref(s.chartType),g=x.ref([{label:"Lowest to Highest",value:"asc",iconName:"arrow-up-wide-narrow",iconPosition:"left"},{label:"Highest to Lowest",value:"desc",iconName:"arrow-down-narrow-wide",iconPosition:"left"}]),f=x.ref([]),y=x.ref([]),m=x.ref([]),C=x.ref("provider_name"),b=x.computed(()=>s.yKey),S=x.ref(null),A=x.ref(""),R=x.ref("");x.provide("activeChartFilterOption",R),x.provide("chartTypes",u),x.provide("sortTypes",g),x.provide("activeChartType",p),x.provide("activeSeries",b),x.provide("activeSort",A),x.watch(R,j=>{if(s.chartFilter&&n.value){const X=s.chartFilter.colId;let $=s.chartFilter.options.find(J=>J.value===j)?.filterValues||null;$&&$.length===0&&($=null),n.value.setColumnFilterModel(X,{values:$}).then(()=>{n.value?.onFilterChanged()})}});const I=x.computed(()=>{const j=d.value.find(X=>X.value===b.value);return j?j.label:""}),w=x.computed(()=>{const j=d.value.find(X=>X.value===b.value);return j&&j.dataType==="currency"}),M=x.computed(()=>p.value==="bar"),T=x.computed(()=>S.value&&S.value.fieldName&&S.value.fieldValues&&S.value.fieldValues.length>0&&["column","bar","line","area"].includes(p.value)),E=(j,X)=>`${j}_${X}`,P=x.computed(()=>{if(d.value.length===0)return[];const j=p.value==="column"?"bar":p.value;return["bar","line","area"].includes(j)?_.value:j==="pie"?W.value:(console.error("Unsupported chart type",j),[])}),N=x.computed(()=>y.value&&y.value.length>15?!1:w.value&&T.value?s.showSeriesLabels&&s.showSeriesLabelsWhenStacked:s.showSeriesLabels),F=j=>{const X=j.datum[j.xKey],$=j.yKey;let J=j.datum[$];const ie=h($);return ie&&typeof ie=="function"&&(J=ie({value:J})),{heading:X,data:[{label:I.value,value:J}]}},_=x.computed(()=>{const j=p.value==="column"?"bar":p.value;let X=[];const $=h(b.value),J=h(S.value?.fieldName);if(T.value)S.value?.fieldValues.forEach(K=>{const oe={type:j,xKey:C.value,yKey:E(b.value,K),yName:typeof J=="function"?J({value:K}):K,stacked:w.value,label:{enabled:N.value,color:"black",fontWeight:"bold",fontFamily:"Inter",padding:5,placement:"outside-end",formatter:$}};X.push(oe)});else{const ne={type:j,xKey:C.value,yKey:b.value,tooltip:{renderer:F},label:{enabled:N.value,color:"black",fontWeight:"bold",fontFamily:"Inter",padding:5,placement:"outside-end",formatter:h(b.value)}};X.push(ne)}let ie={};if(j==="column"||j==="bar"){const ne=ie;ne.direction=M.value?"horizontal":"vertical",ie=ne}else if(j==="line"||j==="area"){const ne=ie;ne.connectMissingData=!0,ie=ne}return X=X.map(ne=>({...ne,...ie})),X}),W=x.computed(()=>d.value.length===0?[]:[{type:"pie",legendItemKey:C.value,angleKey:b.value}]),z=j=>{const X=j.getAllGridColumns().filter($=>$.getAggFunc()!==null&&$.getAggFunc()!==void 0);C.value=f.value[0]?.getColId()||"",d.value=X.map($=>{const J=$.getColId(),ie=$.getColDef();return{label:ie.headerName||J,value:J,formatter:ie.valueFormatter,dataType:ie.context?.dataType}})};x.watch([b,P],([j,X])=>{const $=d.value.filter(J=>J.value!==j).map(J=>J.value);n.value&&(n.value.setColumnsVisible($,!1),n.value.setColumnsVisible([b.value],!0),o("chart-data-updated",{state:null,visualData:null,chartSeries:X}))});const U=()=>{y.value=[],m.value=[],S.value=null},G=(j,X,$)=>{if(!X||X.length===0){U();return}if($){const J=C.value,ie=new Set;X.forEach(K=>{const oe=K[$];ie.add(oe)});const ne=X.reduce((K,oe)=>{const de=oe[J];K[de]||(K[de]={});const re=oe[$];for(const ce of d.value){const be=ce.value;let Se=K[`${be}_sort_total`]||0;const Fe=oe[be];ie.add(re),$&&Fe&&(K[de][E(be,re)]=Fe,Se=Se+Fe),K[de][`${be}_sort_total`]=Se}return K},{});m.value=Object.keys(ne).map(K=>({[J]:K,...ne[K]})),S.value={fieldName:$,fieldValues:Array.from(ie)}}else m.value=[],S.value=null;y.value=X,o("chart-data-updated",{state:j.getState(),visualData:X,chartSeries:P.value})},V=j=>{if(s.overrideChartData)return;const X=f.value.length;if(U(),X===0||d.value.length===0)return;const $=[],J=[];let ie=new Set;if(j.forEachNodeAfterFilterAndSort(ne=>{if(ne.group&&ne.level===0){if(f.value.length>1){const oe=ne.childrenAfterFilter?.filter(ce=>ce.level===1&&ce.aggData)||[],{rowData:de,fieldValues:re}=H(ne,oe);ie=ie.union(re),J?.push(de)}const K=O(ne);$?.push(K)}}),y.value=$,f.value.length>1&&J&&J.length>0){const ne=f.value[1].getColId();m.value=J,S.value={fieldName:ne,fieldValues:Array.from(ie)}}else m.value=[],S.value=null},O=j=>{const X={[j.field]:j.key};for(const $ of d.value)!j.aggData||!j.aggData[$.value]||(X[$.value]=j.aggData[$.value]?.value??j.aggData[$.value]);return X},H=(j,X)=>{const $=new Set,J={[j.field]:j.key};let ie=0;for(const ne of d.value)X.forEach(K=>{const oe=K.key;$.add(oe);const de=K.aggData;if(oe&&de){const re=K.aggData[ne.value]?.value??K.aggData[ne.value];J[E(ne.value,oe)]=re,ie=ie+re}}),J[`${ne.value}_sort_total`]=ie;return{rowData:J,fieldValues:$}},B=x.computed(()=>{let j=T.value?m.value:y.value,X=null;if(A.value&&(X=T.value?`${b.value}_sort_total`:b.value),X&&j){const $=A.value.includes("desc")?-1:1;j=[...j].sort((J,ie)=>{const ne=J[X]||0,K=ie[X]||0;return(ne-K)*$})}if(j&&j.length===1){const $="",J=" ";j=[{[C.value]:$},j[0],{[C.value]:J}]}return j}),Y=x.computed(()=>{const j=B.value?.length||0,X=.05,$=.75,ne=.25*Math.exp(-.12*j);return Math.min(Math.max(ne,X),$)}),q=x.computed(()=>1),Z=x.computed(()=>.1),ee=x.computed(()=>f.value.length===0?"No groups selected. Select at least one group to display data.":B.value&&B.value?.length===0?"No data available to chart.":""),se=x.computed(()=>{const j={};return j.overlays={noData:{text:""}},j.data=B.value,j.axes=[{type:"category",position:M.value?"left":"bottom",label:{formatter:h(C.value)},paddingInner:Y.value,paddingOuter:q.value,groupPaddingInner:Z.value},{type:"number",position:M.value?"bottom":"left",label:{formatter:h(b.value)},title:{enabled:!0,text:I.value}}],j.series=P.value,j});return t({provideChartData:G,getCsvData:()=>r.value?.getCsvData()}),(j,X)=>(x.openBlock(),x.createElementBlock("div",cPe,[x.createVNode(lPe,{showPanel:B.value!=null&&B.value.length>0,chartFilter:j.chartFilter},null,8,["showPanel","chartFilter"]),x.createElementVNode("div",dPe,[x.createVNode(ej,{isLoading:j.isLoading,options:se.value},null,8,["isLoading","options"]),!j.isLoading&&ee.value!==""?(x.openBlock(),x.createElementBlock("p",hPe,x.toDisplayString(ee.value),1)):x.createCommentVNode("",!0)]),x.createVNode(oPe,x.mergeProps({ref_key:"pvDataTableRef",ref:r},j.$props,{onColumnRowGroupChanged:l,onGridReady:a,onFilterChanged:c,onFilterOpened:X[0]||(X[0]=$=>o("filter-opened",$)),onFirstDataRendered:X[1]||(X[1]=$=>o("first-data-rendered",$)),onColumnMoved:X[2]||(X[2]=$=>o("column-moved",$)),onColumnResized:X[3]||(X[3]=$=>o("column-resized",$))}),null,16)]))}});exports.PvChart=ej;exports.PvDataTableWithChart=uPe;
98
+ */function wB(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),i.push.apply(i,s)}return i}function oa(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?wB(Object(i),!0).forEach(function(s){jTe(e,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):wB(Object(i)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))})}return e}function IC(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?IC=function(t){return typeof t}:IC=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},IC(e)}function jTe(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function dl(){return dl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},dl.apply(this,arguments)}function UTe(e,t){if(e==null)return{};var i={},s=Object.keys(e),o,n;for(n=0;n<s.length;n++)o=s[n],!(t.indexOf(o)>=0)&&(i[o]=e[o]);return i}function KTe(e,t){if(e==null)return{};var i=UTe(e,t),s,o;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o<n.length;o++)s=n[o],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(i[s]=e[s])}return i}var $Te="1.15.6";function Ja(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Gl=Ja(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ry=Ja(/Edge/i),MB=Ja(/firefox/i),yf=Ja(/safari/i)&&!Ja(/chrome/i)&&!Ja(/android/i),LL=Ja(/iP(ad|od|hone)/i),Q3=Ja(/chrome/i)&&Ja(/android/i),J3={capture:!1,passive:!1};function qe(e,t,i){e.addEventListener(t,i,!Gl&&J3)}function Ke(e,t,i){e.removeEventListener(t,i,!Gl&&J3)}function Nb(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function eK(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function $n(e,t,i,s){if(e){i=i||document;do{if(t!=null&&(t[0]===">"?e.parentNode===i&&Nb(e,t):Nb(e,t))||s&&e===i)return e;if(e===i)break}while(e=eK(e))}return null}var DB=/\s+/g;function Eo(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(DB," ").replace(" "+t+" "," ");e.className=(s+(i?" "+t:"")).replace(DB," ")}}function ke(e,t,i){var s=e&&e.style;if(s){if(i===void 0)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),t===void 0?i:i[t];!(t in s)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),s[t]=i+(typeof i=="string"?"":"px")}}function Xu(e,t){var i="";if(typeof e=="string")i=e;else do{var s=ke(e,"transform");s&&s!=="none"&&(i=s+" "+i)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(i)}function tK(e,t,i){if(e){var s=e.getElementsByTagName(t),o=0,n=s.length;if(i)for(;o<n;o++)i(s[o],o);return s}return[]}function qr(){var e=document.scrollingElement;return e||document.documentElement}function wi(e,t,i,s,o){if(!(!e.getBoundingClientRect&&e!==window)){var n,r,a,l,c,d,h;if(e!==window&&e.parentNode&&e!==qr()?(n=e.getBoundingClientRect(),r=n.top,a=n.left,l=n.bottom,c=n.right,d=n.height,h=n.width):(r=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,h=window.innerWidth),(t||i)&&e!==window&&(o=o||e.parentNode,!Gl))do if(o&&o.getBoundingClientRect&&(ke(o,"transform")!=="none"||i&&ke(o,"position")!=="static")){var u=o.getBoundingClientRect();r-=u.top+parseInt(ke(o,"border-top-width")),a-=u.left+parseInt(ke(o,"border-left-width")),l=r+n.height,c=a+n.width;break}while(o=o.parentNode);if(s&&e!==window){var p=Xu(o||e),g=p&&p.a,f=p&&p.d;p&&(r/=f,a/=g,h/=g,d/=f,l=r+d,c=a+h)}return{top:r,left:a,bottom:l,right:c,width:h,height:d}}}function AB(e,t,i){for(var s=Cc(e,!0),o=wi(e)[t];s;){var n=wi(s)[i],r=void 0;if(r=o>=n,!r)return s;if(s===qr())break;s=Cc(s,!1)}return!1}function dp(e,t,i,s){for(var o=0,n=0,r=e.children;n<r.length;){if(r[n].style.display!=="none"&&r[n]!==Te.ghost&&(s||r[n]!==Te.dragged)&&$n(r[n],i.draggable,e,!1)){if(o===t)return r[n];o++}n++}return null}function EL(e,t){for(var i=e.lastElementChild;i&&(i===Te.ghost||ke(i,"display")==="none"||t&&!Nb(i,t));)i=i.previousElementSibling;return i||null}function cn(e,t){var i=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==Te.clone&&(!t||Nb(e,t))&&i++;return i}function IB(e){var t=0,i=0,s=qr();if(e)do{var o=Xu(e),n=o.a,r=o.d;t+=e.scrollLeft*n,i+=e.scrollTop*r}while(e!==s&&(e=e.parentNode));return[t,i]}function YTe(e,t){for(var i in e)if(e.hasOwnProperty(i)){for(var s in t)if(t.hasOwnProperty(s)&&t[s]===e[i][s])return Number(i)}return-1}function Cc(e,t){if(!e||!e.getBoundingClientRect)return qr();var i=e,s=!1;do if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var o=ke(i);if(i.clientWidth<i.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||i.clientHeight<i.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!i.getBoundingClientRect||i===document.body)return qr();if(s||t)return i;s=!0}}while(i=i.parentNode);return qr()}function XTe(e,t){if(e&&t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function m0(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var vf;function iK(e,t){return function(){if(!vf){var i=arguments,s=this;i.length===1?e.call(s,i[0]):e.apply(s,i),vf=setTimeout(function(){vf=void 0},t)}}}function ZTe(){clearTimeout(vf),vf=void 0}function sK(e,t,i){e.scrollLeft+=t,e.scrollTop+=i}function oK(e){var t=window.Polymer,i=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):i?i(e).clone(!0)[0]:e.cloneNode(!0)}function nK(e,t,i){var s={};return Array.from(e.children).forEach(function(o){var n,r,a,l;if(!(!$n(o,t.draggable,e,!1)||o.animated||o===i)){var c=wi(o);s.left=Math.min((n=s.left)!==null&&n!==void 0?n:1/0,c.left),s.top=Math.min((r=s.top)!==null&&r!==void 0?r:1/0,c.top),s.right=Math.max((a=s.right)!==null&&a!==void 0?a:-1/0,c.right),s.bottom=Math.max((l=s.bottom)!==null&&l!==void 0?l:-1/0,c.bottom)}}),s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}var mo="Sortable"+new Date().getTime();function qTe(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(o){if(!(ke(o,"display")==="none"||o===Te.ghost)){e.push({target:o,rect:wi(o)});var n=oa({},e[e.length-1].rect);if(o.thisAnimationDuration){var r=Xu(o,!0);r&&(n.top-=r.f,n.left-=r.e)}o.fromRect=n}})}},addAnimationState:function(s){e.push(s)},removeAnimationState:function(s){e.splice(YTe(e,{target:s}),1)},animateAll:function(s){var o=this;if(!this.options.animation){clearTimeout(t),typeof s=="function"&&s();return}var n=!1,r=0;e.forEach(function(a){var l=0,c=a.target,d=c.fromRect,h=wi(c),u=c.prevFromRect,p=c.prevToRect,g=a.rect,f=Xu(c,!0);f&&(h.top-=f.f,h.left-=f.e),c.toRect=h,c.thisAnimationDuration&&m0(u,h)&&!m0(d,h)&&(g.top-h.top)/(g.left-h.left)===(d.top-h.top)/(d.left-h.left)&&(l=JTe(g,u,p,o.options)),m0(h,d)||(c.prevFromRect=d,c.prevToRect=h,l||(l=o.options.animation),o.animate(c,g,h,l)),l&&(n=!0,r=Math.max(r,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),n?t=setTimeout(function(){typeof s=="function"&&s()},r):typeof s=="function"&&s(),e=[]},animate:function(s,o,n,r){if(r){ke(s,"transition",""),ke(s,"transform","");var a=Xu(this.el),l=a&&a.a,c=a&&a.d,d=(o.left-n.left)/(l||1),h=(o.top-n.top)/(c||1);s.animatingX=!!d,s.animatingY=!!h,ke(s,"transform","translate3d("+d+"px,"+h+"px,0)"),this.forRepaintDummy=QTe(s),ke(s,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),ke(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){ke(s,"transition",""),ke(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},r)}}}}function QTe(e){return e.offsetWidth}function JTe(e,t,i,s){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))*s.animation}var gu=[],y0={initializeByDefault:!0},ky={mount:function(t){for(var i in y0)y0.hasOwnProperty(i)&&!(i in t)&&(t[i]=y0[i]);gu.forEach(function(s){if(s.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),gu.push(t)},pluginEvent:function(t,i,s){var o=this;this.eventCanceled=!1,s.cancel=function(){o.eventCanceled=!0};var n=t+"Global";gu.forEach(function(r){i[r.pluginName]&&(i[r.pluginName][n]&&i[r.pluginName][n](oa({sortable:i},s)),i.options[r.pluginName]&&i[r.pluginName][t]&&i[r.pluginName][t](oa({sortable:i},s)))})},initializePlugins:function(t,i,s,o){gu.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var c=new a(t,i,t.options);c.sortable=t,c.options=t.options,t[l]=c,dl(s,c.defaults)}});for(var n in t.options)if(t.options.hasOwnProperty(n)){var r=this.modifyOption(t,n,t.options[n]);typeof r<"u"&&(t.options[n]=r)}},getEventProperties:function(t,i){var s={};return gu.forEach(function(o){typeof o.eventProperties=="function"&&dl(s,o.eventProperties.call(i[o.pluginName],t))}),s},modifyOption:function(t,i,s){var o;return gu.forEach(function(n){t[n.pluginName]&&n.optionListeners&&typeof n.optionListeners[i]=="function"&&(o=n.optionListeners[i].call(t[n.pluginName],s))}),o}};function eLe(e){var t=e.sortable,i=e.rootEl,s=e.name,o=e.targetEl,n=e.cloneEl,r=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,d=e.oldDraggableIndex,h=e.newDraggableIndex,u=e.originalEvent,p=e.putSortable,g=e.extraEventProperties;if(t=t||i&&i[mo],!!t){var f,y=t.options,m="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!Gl&&!Ry?f=new CustomEvent(s,{bubbles:!0,cancelable:!0}):(f=document.createEvent("Event"),f.initEvent(s,!0,!0)),f.to=r||i,f.from=a||i,f.item=o||i,f.clone=n,f.oldIndex=l,f.newIndex=c,f.oldDraggableIndex=d,f.newDraggableIndex=h,f.originalEvent=u,f.pullMode=p?p.lastPutMode:void 0;var C=oa(oa({},g),ky.getEventProperties(s,t));for(var b in C)f[b]=C[b];i&&i.dispatchEvent(f),y[m]&&y[m].call(t,f)}}var tLe=["evt"],ro=function(t,i){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=s.evt,n=KTe(s,tLe);ky.pluginEvent.bind(Te)(t,i,oa({dragEl:ge,parentEl:qt,ghostEl:Ne,rootEl:Ot,nextEl:Od,lastDownEl:RC,cloneEl:zt,cloneHidden:lc,dragStarted:Xg,putSortable:ss,activeSortable:Te.active,originalEvent:o,oldIndex:Lu,oldDraggableIndex:Cf,newIndex:Po,newDraggableIndex:rc,hideGhostForTarget:cK,unhideGhostForTarget:dK,cloneNowHidden:function(){lc=!0},cloneNowShown:function(){lc=!1},dispatchSortableEvent:function(a){Ks({sortable:i,name:a,originalEvent:o})}},n))};function Ks(e){eLe(oa({putSortable:ss,cloneEl:zt,targetEl:ge,rootEl:Ot,oldIndex:Lu,oldDraggableIndex:Cf,newIndex:Po,newDraggableIndex:rc},e))}var ge,qt,Ne,Ot,Od,RC,zt,lc,Lu,Po,Cf,rc,eC,ss,bu=!1,Ob=!1,Fb=[],Ad,Un,v0,C0,RB,kB,Xg,fu,bf,Sf=!1,tC=!1,kC,ms,b0=[],XD=!1,Bb=[],cw=typeof document<"u",iC=LL,TB=Ry||Gl?"cssFloat":"float",iLe=cw&&!Q3&&!LL&&"draggable"in document.createElement("div"),rK=function(){if(cw){if(Gl)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),aK=function(t,i){var s=ke(t),o=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),n=dp(t,0,i),r=dp(t,1,i),a=n&&ke(n),l=r&&ke(r),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+wi(n).width,d=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+wi(r).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(n&&a.float&&a.float!=="none"){var h=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===h)?"vertical":"horizontal"}return n&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=o&&s[TB]==="none"||r&&s[TB]==="none"&&c+d>o)?"vertical":"horizontal"},sLe=function(t,i,s){var o=s?t.left:t.top,n=s?t.right:t.bottom,r=s?t.width:t.height,a=s?i.left:i.top,l=s?i.right:i.bottom,c=s?i.width:i.height;return o===a||n===l||o+r/2===a+c/2},oLe=function(t,i){var s;return Fb.some(function(o){var n=o[mo].options.emptyInsertThreshold;if(!(!n||EL(o))){var r=wi(o),a=t>=r.left-n&&t<=r.right+n,l=i>=r.top-n&&i<=r.bottom+n;if(a&&l)return s=o}}),s},lK=function(t){function i(n,r){return function(a,l,c,d){var h=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(n==null&&(r||h))return!0;if(n==null||n===!1)return!1;if(r&&n==="clone")return n;if(typeof n=="function")return i(n(a,l,c,d),r)(a,l,c,d);var u=(r?a:l).options.group.name;return n===!0||typeof n=="string"&&n===u||n.join&&n.indexOf(u)>-1}}var s={},o=t.group;(!o||IC(o)!="object")&&(o={name:o}),s.name=o.name,s.checkPull=i(o.pull,!0),s.checkPut=i(o.put),s.revertClone=o.revertClone,t.group=s},cK=function(){!rK&&Ne&&ke(Ne,"display","none")},dK=function(){!rK&&Ne&&ke(Ne,"display","")};cw&&!Q3&&document.addEventListener("click",function(e){if(Ob)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ob=!1,!1},!0);var Id=function(t){if(ge){t=t.touches?t.touches[0]:t;var i=oLe(t.clientX,t.clientY);if(i){var s={};for(var o in t)t.hasOwnProperty(o)&&(s[o]=t[o]);s.target=s.rootEl=i,s.preventDefault=void 0,s.stopPropagation=void 0,i[mo]._onDragOver(s)}}},nLe=function(t){ge&&ge.parentNode[mo]._isOutsideThisEl(t.target)};function Te(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=dl({},t),e[mo]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return aK(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,a){r.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Te.supportPointer!==!1&&"PointerEvent"in window&&(!yf||LL),emptyInsertThreshold:5};ky.initializePlugins(this,e,i);for(var s in i)!(s in t)&&(t[s]=i[s]);lK(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:iLe,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?qe(e,"pointerdown",this._onTapStart):(qe(e,"mousedown",this._onTapStart),qe(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(qe(e,"dragover",this),qe(e,"dragenter",this)),Fb.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),dl(this,qTe())}Te.prototype={constructor:Te,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(fu=null)},_getDirection:function(t,i){return typeof this.options.direction=="function"?this.options.direction.call(this,t,i,ge):this.options.direction},_onTapStart:function(t){if(t.cancelable){var i=this,s=this.el,o=this.options,n=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,d=o.filter;if(pLe(s),!ge&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&yf&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=$n(l,o.draggable,s,!1),!(l&&l.animated)&&RC!==l)){if(Lu=cn(l),Cf=cn(l,o.draggable),typeof d=="function"){if(d.call(this,t,l,this)){Ks({sortable:i,rootEl:c,name:"filter",targetEl:l,toEl:s,fromEl:s}),ro("filter",i,{evt:t}),n&&t.preventDefault();return}}else if(d&&(d=d.split(",").some(function(h){if(h=$n(c,h.trim(),s,!1),h)return Ks({sortable:i,rootEl:h,name:"filter",targetEl:l,fromEl:s,toEl:s}),ro("filter",i,{evt:t}),!0}),d)){n&&t.preventDefault();return}o.handle&&!$n(c,o.handle,s,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,i,s){var o=this,n=o.el,r=o.options,a=n.ownerDocument,l;if(s&&!ge&&s.parentNode===n){var c=wi(s);if(Ot=n,ge=s,qt=ge.parentNode,Od=ge.nextSibling,RC=s,eC=r.group,Te.dragged=ge,Ad={target:ge,clientX:(i||t).clientX,clientY:(i||t).clientY},RB=Ad.clientX-c.left,kB=Ad.clientY-c.top,this._lastX=(i||t).clientX,this._lastY=(i||t).clientY,ge.style["will-change"]="all",l=function(){if(ro("delayEnded",o,{evt:t}),Te.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!MB&&o.nativeDraggable&&(ge.draggable=!0),o._triggerDragStart(t,i),Ks({sortable:o,name:"choose",originalEvent:t}),Eo(ge,r.chosenClass,!0)},r.ignore.split(",").forEach(function(d){tK(ge,d.trim(),S0)}),qe(a,"dragover",Id),qe(a,"mousemove",Id),qe(a,"touchmove",Id),r.supportPointer?(qe(a,"pointerup",o._onDrop),!this.nativeDraggable&&qe(a,"pointercancel",o._onDrop)):(qe(a,"mouseup",o._onDrop),qe(a,"touchend",o._onDrop),qe(a,"touchcancel",o._onDrop)),MB&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ge.draggable=!0),ro("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||i)&&(!this.nativeDraggable||!(Ry||Gl))){if(Te.eventCanceled){this._onDrop();return}r.supportPointer?(qe(a,"pointerup",o._disableDelayedDrag),qe(a,"pointercancel",o._disableDelayedDrag)):(qe(a,"mouseup",o._disableDelayedDrag),qe(a,"touchend",o._disableDelayedDrag),qe(a,"touchcancel",o._disableDelayedDrag)),qe(a,"mousemove",o._delayedDragTouchMoveHandler),qe(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&qe(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,r.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var i=t.touches?t.touches[0]:t;Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ge&&S0(ge),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Ke(t,"mouseup",this._disableDelayedDrag),Ke(t,"touchend",this._disableDelayedDrag),Ke(t,"touchcancel",this._disableDelayedDrag),Ke(t,"pointerup",this._disableDelayedDrag),Ke(t,"pointercancel",this._disableDelayedDrag),Ke(t,"mousemove",this._delayedDragTouchMoveHandler),Ke(t,"touchmove",this._delayedDragTouchMoveHandler),Ke(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,i){i=i||t.pointerType=="touch"&&t,!this.nativeDraggable||i?this.options.supportPointer?qe(document,"pointermove",this._onTouchMove):i?qe(document,"touchmove",this._onTouchMove):qe(document,"mousemove",this._onTouchMove):(qe(ge,"dragend",this),qe(Ot,"dragstart",this._onDragStart));try{document.selection?TC(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,i){if(bu=!1,Ot&&ge){ro("dragStarted",this,{evt:i}),this.nativeDraggable&&qe(document,"dragover",nLe);var s=this.options;!t&&Eo(ge,s.dragClass,!1),Eo(ge,s.ghostClass,!0),Te.active=this,t&&this._appendGhost(),Ks({sortable:this,name:"start",originalEvent:i})}else this._nulling()},_emulateDragOver:function(){if(Un){this._lastX=Un.clientX,this._lastY=Un.clientY,cK();for(var t=document.elementFromPoint(Un.clientX,Un.clientY),i=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Un.clientX,Un.clientY),t!==i);)i=t;if(ge.parentNode[mo]._isOutsideThisEl(t),i)do{if(i[mo]){var s=void 0;if(s=i[mo]._onDragOver({clientX:Un.clientX,clientY:Un.clientY,target:t,rootEl:i}),s&&!this.options.dragoverBubble)break}t=i}while(i=eK(i));dK()}},_onTouchMove:function(t){if(Ad){var i=this.options,s=i.fallbackTolerance,o=i.fallbackOffset,n=t.touches?t.touches[0]:t,r=Ne&&Xu(Ne,!0),a=Ne&&r&&r.a,l=Ne&&r&&r.d,c=iC&&ms&&IB(ms),d=(n.clientX-Ad.clientX+o.x)/(a||1)+(c?c[0]-b0[0]:0)/(a||1),h=(n.clientY-Ad.clientY+o.y)/(l||1)+(c?c[1]-b0[1]:0)/(l||1);if(!Te.active&&!bu){if(s&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))<s)return;this._onDragStart(t,!0)}if(Ne){r?(r.e+=d-(v0||0),r.f+=h-(C0||0)):r={a:1,b:0,c:0,d:1,e:d,f:h};var u="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");ke(Ne,"webkitTransform",u),ke(Ne,"mozTransform",u),ke(Ne,"msTransform",u),ke(Ne,"transform",u),v0=d,C0=h,Un=n}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Ne){var t=this.options.fallbackOnBody?document.body:Ot,i=wi(ge,!0,iC,!0,t),s=this.options;if(iC){for(ms=t;ke(ms,"position")==="static"&&ke(ms,"transform")==="none"&&ms!==document;)ms=ms.parentNode;ms!==document.body&&ms!==document.documentElement?(ms===document&&(ms=qr()),i.top+=ms.scrollTop,i.left+=ms.scrollLeft):ms=qr(),b0=IB(ms)}Ne=ge.cloneNode(!0),Eo(Ne,s.ghostClass,!1),Eo(Ne,s.fallbackClass,!0),Eo(Ne,s.dragClass,!0),ke(Ne,"transition",""),ke(Ne,"transform",""),ke(Ne,"box-sizing","border-box"),ke(Ne,"margin",0),ke(Ne,"top",i.top),ke(Ne,"left",i.left),ke(Ne,"width",i.width),ke(Ne,"height",i.height),ke(Ne,"opacity","0.8"),ke(Ne,"position",iC?"absolute":"fixed"),ke(Ne,"zIndex","100000"),ke(Ne,"pointerEvents","none"),Te.ghost=Ne,t.appendChild(Ne),ke(Ne,"transform-origin",RB/parseInt(Ne.style.width)*100+"% "+kB/parseInt(Ne.style.height)*100+"%")}},_onDragStart:function(t,i){var s=this,o=t.dataTransfer,n=s.options;if(ro("dragStart",this,{evt:t}),Te.eventCanceled){this._onDrop();return}ro("setupClone",this),Te.eventCanceled||(zt=oK(ge),zt.removeAttribute("id"),zt.draggable=!1,zt.style["will-change"]="",this._hideClone(),Eo(zt,this.options.chosenClass,!1),Te.clone=zt),s.cloneId=TC(function(){ro("clone",s),!Te.eventCanceled&&(s.options.removeCloneOnHide||Ot.insertBefore(zt,ge),s._hideClone(),Ks({sortable:s,name:"clone"}))}),!i&&Eo(ge,n.dragClass,!0),i?(Ob=!0,s._loopId=setInterval(s._emulateDragOver,50)):(Ke(document,"mouseup",s._onDrop),Ke(document,"touchend",s._onDrop),Ke(document,"touchcancel",s._onDrop),o&&(o.effectAllowed="move",n.setData&&n.setData.call(s,o,ge)),qe(document,"drop",s),ke(ge,"transform","translateZ(0)")),bu=!0,s._dragStartId=TC(s._dragStarted.bind(s,i,t)),qe(document,"selectstart",s),Xg=!0,window.getSelection().removeAllRanges(),yf&&ke(document.body,"user-select","none")},_onDragOver:function(t){var i=this.el,s=t.target,o,n,r,a=this.options,l=a.group,c=Te.active,d=eC===l,h=a.sort,u=ss||c,p,g=this,f=!1;if(XD)return;function y(U,G){ro(U,g,oa({evt:t,isOwner:d,axis:p?"vertical":"horizontal",revert:r,dragRect:o,targetRect:n,canSort:h,fromSortable:u,target:s,completed:C,onMove:function(O,H){return sC(Ot,i,ge,o,O,wi(O),t,H)},changed:b},G))}function m(){y("dragOverAnimationCapture"),g.captureAnimationState(),g!==u&&u.captureAnimationState()}function C(U){return y("dragOverCompleted",{insertion:U}),U&&(d?c._hideClone():c._showClone(g),g!==u&&(Eo(ge,ss?ss.options.ghostClass:c.options.ghostClass,!1),Eo(ge,a.ghostClass,!0)),ss!==g&&g!==Te.active?ss=g:g===Te.active&&ss&&(ss=null),u===g&&(g._ignoreWhileAnimating=s),g.animateAll(function(){y("dragOverAnimationComplete"),g._ignoreWhileAnimating=null}),g!==u&&(u.animateAll(),u._ignoreWhileAnimating=null)),(s===ge&&!ge.animated||s===i&&!s.animated)&&(fu=null),!a.dragoverBubble&&!t.rootEl&&s!==document&&(ge.parentNode[mo]._isOutsideThisEl(t.target),!U&&Id(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function b(){Po=cn(ge),rc=cn(ge,a.draggable),Ks({sortable:g,name:"change",toEl:i,newIndex:Po,newDraggableIndex:rc,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),s=$n(s,a.draggable,i,!0),y("dragOver"),Te.eventCanceled)return f;if(ge.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||g._ignoreWhileAnimating===s)return C(!1);if(Ob=!1,c&&!a.disabled&&(d?h||(r=qt!==Ot):ss===this||(this.lastPutMode=eC.checkPull(this,c,ge,t))&&l.checkPut(this,c,ge,t))){if(p=this._getDirection(t,s)==="vertical",o=wi(ge),y("dragOverValid"),Te.eventCanceled)return f;if(r)return qt=Ot,m(),this._hideClone(),y("revert"),Te.eventCanceled||(Od?Ot.insertBefore(ge,Od):Ot.appendChild(ge)),C(!0);var S=EL(i,a.draggable);if(!S||cLe(t,p,this)&&!S.animated){if(S===ge)return C(!1);if(S&&i===t.target&&(s=S),s&&(n=wi(s)),sC(Ot,i,ge,o,s,n,t,!!s)!==!1)return m(),S&&S.nextSibling?i.insertBefore(ge,S.nextSibling):i.appendChild(ge),qt=i,b(),C(!0)}else if(S&&lLe(t,p,this)){var A=dp(i,0,a,!0);if(A===ge)return C(!1);if(s=A,n=wi(s),sC(Ot,i,ge,o,s,n,t,!1)!==!1)return m(),i.insertBefore(ge,A),qt=i,b(),C(!0)}else if(s.parentNode===i){n=wi(s);var R=0,I,w=ge.parentNode!==i,M=!sLe(ge.animated&&ge.toRect||o,s.animated&&s.toRect||n,p),T=p?"top":"left",E=AB(s,"top","top")||AB(ge,"top","top"),P=E?E.scrollTop:void 0;fu!==s&&(I=n[T],Sf=!1,tC=!M&&a.invertSwap||w),R=dLe(t,s,n,p,M?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,tC,fu===s);var N;if(R!==0){var F=cn(ge);do F-=R,N=qt.children[F];while(N&&(ke(N,"display")==="none"||N===Ne))}if(R===0||N===s)return C(!1);fu=s,bf=R;var _=s.nextElementSibling,W=!1;W=R===1;var z=sC(Ot,i,ge,o,s,n,t,W);if(z!==!1)return(z===1||z===-1)&&(W=z===1),XD=!0,setTimeout(aLe,30),m(),W&&!_?i.appendChild(ge):s.parentNode.insertBefore(ge,W?_:s),E&&sK(E,0,P-E.scrollTop),qt=ge.parentNode,I!==void 0&&!tC&&(kC=Math.abs(I-wi(s)[T])),b(),C(!0)}if(i.contains(ge))return C(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ke(document,"mousemove",this._onTouchMove),Ke(document,"touchmove",this._onTouchMove),Ke(document,"pointermove",this._onTouchMove),Ke(document,"dragover",Id),Ke(document,"mousemove",Id),Ke(document,"touchmove",Id)},_offUpEvents:function(){var t=this.el.ownerDocument;Ke(t,"mouseup",this._onDrop),Ke(t,"touchend",this._onDrop),Ke(t,"pointerup",this._onDrop),Ke(t,"pointercancel",this._onDrop),Ke(t,"touchcancel",this._onDrop),Ke(document,"selectstart",this)},_onDrop:function(t){var i=this.el,s=this.options;if(Po=cn(ge),rc=cn(ge,s.draggable),ro("drop",this,{evt:t}),qt=ge&&ge.parentNode,Po=cn(ge),rc=cn(ge,s.draggable),Te.eventCanceled){this._nulling();return}bu=!1,tC=!1,Sf=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ZD(this.cloneId),ZD(this._dragStartId),this.nativeDraggable&&(Ke(document,"drop",this),Ke(i,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),yf&&ke(document.body,"user-select",""),ke(ge,"transform",""),t&&(Xg&&(t.cancelable&&t.preventDefault(),!s.dropBubble&&t.stopPropagation()),Ne&&Ne.parentNode&&Ne.parentNode.removeChild(Ne),(Ot===qt||ss&&ss.lastPutMode!=="clone")&&zt&&zt.parentNode&&zt.parentNode.removeChild(zt),ge&&(this.nativeDraggable&&Ke(ge,"dragend",this),S0(ge),ge.style["will-change"]="",Xg&&!bu&&Eo(ge,ss?ss.options.ghostClass:this.options.ghostClass,!1),Eo(ge,this.options.chosenClass,!1),Ks({sortable:this,name:"unchoose",toEl:qt,newIndex:null,newDraggableIndex:null,originalEvent:t}),Ot!==qt?(Po>=0&&(Ks({rootEl:qt,name:"add",toEl:qt,fromEl:Ot,originalEvent:t}),Ks({sortable:this,name:"remove",toEl:qt,originalEvent:t}),Ks({rootEl:qt,name:"sort",toEl:qt,fromEl:Ot,originalEvent:t}),Ks({sortable:this,name:"sort",toEl:qt,originalEvent:t})),ss&&ss.save()):Po!==Lu&&Po>=0&&(Ks({sortable:this,name:"update",toEl:qt,originalEvent:t}),Ks({sortable:this,name:"sort",toEl:qt,originalEvent:t})),Te.active&&((Po==null||Po===-1)&&(Po=Lu,rc=Cf),Ks({sortable:this,name:"end",toEl:qt,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){ro("nulling",this),Ot=ge=qt=Ne=Od=zt=RC=lc=Ad=Un=Xg=Po=rc=Lu=Cf=fu=bf=ss=eC=Te.dragged=Te.ghost=Te.clone=Te.active=null,Bb.forEach(function(t){t.checked=!0}),Bb.length=v0=C0=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ge&&(this._onDragOver(t),rLe(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],i,s=this.el.children,o=0,n=s.length,r=this.options;o<n;o++)i=s[o],$n(i,r.draggable,this.el,!1)&&t.push(i.getAttribute(r.dataIdAttr)||uLe(i));return t},sort:function(t,i){var s={},o=this.el;this.toArray().forEach(function(n,r){var a=o.children[r];$n(a,this.options.draggable,o,!1)&&(s[n]=a)},this),i&&this.captureAnimationState(),t.forEach(function(n){s[n]&&(o.removeChild(s[n]),o.appendChild(s[n]))}),i&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,i){return $n(t,i||this.options.draggable,this.el,!1)},option:function(t,i){var s=this.options;if(i===void 0)return s[t];var o=ky.modifyOption(this,t,i);typeof o<"u"?s[t]=o:s[t]=i,t==="group"&&lK(s)},destroy:function(){ro("destroy",this);var t=this.el;t[mo]=null,Ke(t,"mousedown",this._onTapStart),Ke(t,"touchstart",this._onTapStart),Ke(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ke(t,"dragover",this),Ke(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(i){i.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Fb.splice(Fb.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!lc){if(ro("hideClone",this),Te.eventCanceled)return;ke(zt,"display","none"),this.options.removeCloneOnHide&&zt.parentNode&&zt.parentNode.removeChild(zt),lc=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(lc){if(ro("showClone",this),Te.eventCanceled)return;ge.parentNode==Ot&&!this.options.group.revertClone?Ot.insertBefore(zt,ge):Od?Ot.insertBefore(zt,Od):Ot.appendChild(zt),this.options.group.revertClone&&this.animate(ge,zt),ke(zt,"display",""),lc=!1}}};function rLe(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function sC(e,t,i,s,o,n,r,a){var l,c=e[mo],d=c.options.onMove,h;return window.CustomEvent&&!Gl&&!Ry?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=i,l.draggedRect=s,l.related=o||t,l.relatedRect=n||wi(t),l.willInsertAfter=a,l.originalEvent=r,e.dispatchEvent(l),d&&(h=d.call(c,l,r)),h}function S0(e){e.draggable=!1}function aLe(){XD=!1}function lLe(e,t,i){var s=wi(dp(i.el,0,i.options,!0)),o=nK(i.el,i.options,Ne),n=10;return t?e.clientX<o.left-n||e.clientY<s.top&&e.clientX<s.right:e.clientY<o.top-n||e.clientY<s.bottom&&e.clientX<s.left}function cLe(e,t,i){var s=wi(EL(i.el,i.options.draggable)),o=nK(i.el,i.options,Ne),n=10;return t?e.clientX>o.right+n||e.clientY>s.bottom&&e.clientX>s.left:e.clientY>o.bottom+n||e.clientX>s.right&&e.clientY>s.top}function dLe(e,t,i,s,o,n,r,a){var l=s?e.clientY:e.clientX,c=s?i.height:i.width,d=s?i.top:i.left,h=s?i.bottom:i.right,u=!1;if(!r){if(a&&kC<c*o){if(!Sf&&(bf===1?l>d+c*n/2:l<h-c*n/2)&&(Sf=!0),Sf)u=!0;else if(bf===1?l<d+kC:l>h-kC)return-bf}else if(l>d+c*(1-o)/2&&l<h-c*(1-o)/2)return hLe(t)}return u=u||r,u&&(l<d+c*n/2||l>h-c*n/2)?l>d+c/2?1:-1:0}function hLe(e){return cn(ge)<cn(e)?1:-1}function uLe(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,s=0;i--;)s+=t.charCodeAt(i);return s.toString(36)}function pLe(e){Bb.length=0;for(var t=e.getElementsByTagName("input"),i=t.length;i--;){var s=t[i];s.checked&&Bb.push(s)}}function TC(e){return setTimeout(e,0)}function ZD(e){return clearTimeout(e)}cw&&qe(document,"touchmove",function(e){(Te.active||bu)&&e.cancelable&&e.preventDefault()});Te.utils={on:qe,off:Ke,css:ke,find:tK,is:function(t,i){return!!$n(t,i,t,!1)},extend:XTe,throttle:iK,closest:$n,toggleClass:Eo,clone:oK,index:cn,nextTick:TC,cancelNextTick:ZD,detectDirection:aK,getChild:dp,expando:mo};Te.get=function(e){return e[mo]};Te.mount=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t[0].constructor===Array&&(t=t[0]),t.forEach(function(s){if(!s.prototype||!s.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(s));s.utils&&(Te.utils=oa(oa({},Te.utils),s.utils)),ky.mount(s)})};Te.create=function(e,t){return new Te(e,t)};Te.version=$Te;var Si=[],Zg,qD,QD=!1,x0,w0,Gb,qg;function gLe(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(i){var s=i.originalEvent;this.sortable.nativeDraggable?qe(document,"dragover",this._handleAutoScroll):this.options.supportPointer?qe(document,"pointermove",this._handleFallbackAutoScroll):s.touches?qe(document,"touchmove",this._handleFallbackAutoScroll):qe(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(i){var s=i.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?Ke(document,"dragover",this._handleAutoScroll):(Ke(document,"pointermove",this._handleFallbackAutoScroll),Ke(document,"touchmove",this._handleFallbackAutoScroll),Ke(document,"mousemove",this._handleFallbackAutoScroll)),LB(),LC(),ZTe()},nulling:function(){Gb=qD=Zg=QD=qg=x0=w0=null,Si.length=0},_handleFallbackAutoScroll:function(i){this._handleAutoScroll(i,!0)},_handleAutoScroll:function(i,s){var o=this,n=(i.touches?i.touches[0]:i).clientX,r=(i.touches?i.touches[0]:i).clientY,a=document.elementFromPoint(n,r);if(Gb=i,s||this.options.forceAutoScrollFallback||Ry||Gl||yf){M0(i,this.options,a,s);var l=Cc(a,!0);QD&&(!qg||n!==x0||r!==w0)&&(qg&&LB(),qg=setInterval(function(){var c=Cc(document.elementFromPoint(n,r),!0);c!==l&&(l=c,LC()),M0(i,o.options,c,s)},10),x0=n,w0=r)}else{if(!this.options.bubbleScroll||Cc(a,!0)===qr()){LC();return}M0(i,this.options,Cc(a,!1),!1)}}},dl(e,{pluginName:"scroll",initializeByDefault:!0})}function LC(){Si.forEach(function(e){clearInterval(e.pid)}),Si=[]}function LB(){clearInterval(qg)}var M0=iK(function(e,t,i,s){if(t.scroll){var o=(e.touches?e.touches[0]:e).clientX,n=(e.touches?e.touches[0]:e).clientY,r=t.scrollSensitivity,a=t.scrollSpeed,l=qr(),c=!1,d;qD!==i&&(qD=i,LC(),Zg=t.scroll,d=t.scrollFn,Zg===!0&&(Zg=Cc(i,!0)));var h=0,u=Zg;do{var p=u,g=wi(p),f=g.top,y=g.bottom,m=g.left,C=g.right,b=g.width,S=g.height,A=void 0,R=void 0,I=p.scrollWidth,w=p.scrollHeight,M=ke(p),T=p.scrollLeft,E=p.scrollTop;p===l?(A=b<I&&(M.overflowX==="auto"||M.overflowX==="scroll"||M.overflowX==="visible"),R=S<w&&(M.overflowY==="auto"||M.overflowY==="scroll"||M.overflowY==="visible")):(A=b<I&&(M.overflowX==="auto"||M.overflowX==="scroll"),R=S<w&&(M.overflowY==="auto"||M.overflowY==="scroll"));var P=A&&(Math.abs(C-o)<=r&&T+b<I)-(Math.abs(m-o)<=r&&!!T),N=R&&(Math.abs(y-n)<=r&&E+S<w)-(Math.abs(f-n)<=r&&!!E);if(!Si[h])for(var F=0;F<=h;F++)Si[F]||(Si[F]={});(Si[h].vx!=P||Si[h].vy!=N||Si[h].el!==p)&&(Si[h].el=p,Si[h].vx=P,Si[h].vy=N,clearInterval(Si[h].pid),(P!=0||N!=0)&&(c=!0,Si[h].pid=setInterval(function(){s&&this.layer===0&&Te.active._onTouchMove(Gb);var _=Si[this.layer].vy?Si[this.layer].vy*a:0,W=Si[this.layer].vx?Si[this.layer].vx*a:0;typeof d=="function"&&d.call(Te.dragged.parentNode[mo],W,_,e,Gb,Si[this.layer].el)!=="continue"||sK(Si[this.layer].el,W,_)}.bind({layer:h}),24))),h++}while(t.bubbleScroll&&u!==l&&(u=Cc(u,!1)));QD=c}},30),hK=function(t){var i=t.originalEvent,s=t.putSortable,o=t.dragEl,n=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(i){var c=s||n;a();var d=i.changedTouches&&i.changedTouches.length?i.changedTouches[0]:i,h=document.elementFromPoint(d.clientX,d.clientY);l(),c&&!c.el.contains(h)&&(r("spill"),this.onSpill({dragEl:o,putSortable:s}))}};function PL(){}PL.prototype={startIndex:null,dragStart:function(t){var i=t.oldDraggableIndex;this.startIndex=i},onSpill:function(t){var i=t.dragEl,s=t.putSortable;this.sortable.captureAnimationState(),s&&s.captureAnimationState();var o=dp(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(i,o):this.sortable.el.appendChild(i),this.sortable.animateAll(),s&&s.animateAll()},drop:hK};dl(PL,{pluginName:"revertOnSpill"});function NL(){}NL.prototype={onSpill:function(t){var i=t.dragEl,s=t.putSortable,o=s||this.sortable;o.captureAnimationState(),i.parentNode&&i.parentNode.removeChild(i),o.animateAll()},drop:hK};dl(NL,{pluginName:"removeOnSpill"});Te.mount(new gLe);Te.mount(NL,PL);function fLe(e,t,i={}){let s;const{document:o=HTe,...n}=i,r={onUpdate:d=>{vLe(t,d.oldIndex,d.newIndex,d)}},a=()=>{const d=typeof e=="string"?o?.querySelector(e):WTe(e);!d||s!==void 0||(s=new Te(d,{...r,...n}))},l=()=>{s?.destroy(),s=void 0},c=(d,h)=>{if(h!==void 0)s?.option(d,h);else return s?.option(d)};return _Te(a),kL(l),{stop:l,start:a,option:c}}function mLe(e,t,i){const s=e.children[i];e.insertBefore(t,s)}function yLe(e){e.parentNode&&e.parentNode.removeChild(e)}function vLe(e,t,i,s=null){s!=null&&(yLe(s.item),mLe(s.from,s.item,t));const o=x.isRef(e),n=o?[...x.toValue(e)]:x.toValue(e);if(i>=0&&i<n.length){const r=n.splice(t,1)[0];x.nextTick(()=>{n.splice(i,0,r),o&&(e.value=n)})}}const CLe=["data-align"],bLe={key:0,role:"list",class:"pv-popover-list",ref:"popoverList"},SLe=x.defineComponent({__name:"PvPopover",props:{alignment:{default:void 0},cssCustomProperties:{default:()=>({})},isList:{type:Boolean,default:!1},isSortable:{type:Boolean}},emits:["list-order-updated"],setup(e,{emit:t}){const i=x.useTemplateRef("popoverList"),s=e,o=t;s.isSortable&&s.isList&&fLe(i,[],{animation:150,onUpdate:()=>{const r=Array.from(i.value?.children||[]).map(a=>a.id);o("list-order-updated",r)}});const n=x.computed(()=>{const r=[];return Object.keys(s.cssCustomProperties).forEach(a=>{const l=s.cssCustomProperties[a];l&&r.push(`--${a}: ${l};`)}),r.length?r.join("; "):void 0});return(r,a)=>(x.openBlock(),x.createElementBlock("div",{class:"pv-popover","data-align":r.alignment,style:x.normalizeStyle(n.value)},[r.isList?(x.openBlock(),x.createElementBlock("ul",bLe,[x.renderSlot(r.$slots,"default",{},void 0,!0)],512)):x.renderSlot(r.$slots,"default",{key:1},void 0,!0)],12,CLe))}}),Xh=(e,t)=>{const i=e.__vccOpts||e;for(const[s,o]of t)i[s]=o;return i},xLe=Xh(SLe,[["__scopeId","data-v-fe55e23d"]]),uK=TL?window:void 0;function Qg(e){var t;const i=x.toValue(e);return(t=i?.$el)!=null?t:i}function Su(...e){const t=[],i=()=>{t.forEach(a=>a()),t.length=0},s=(a,l,c,d)=>(a.addEventListener(l,c,d),()=>a.removeEventListener(l,c,d)),o=x.computed(()=>{const a=f0(x.toValue(e[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),n=VTe(()=>{var a,l;return[(l=(a=o.value)==null?void 0:a.map(c=>Qg(c)))!=null?l:[uK].filter(c=>c!=null),f0(x.toValue(o.value?e[1]:e[0])),f0(x.unref(o.value?e[2]:e[1])),x.toValue(o.value?e[3]:e[2])]},([a,l,c,d])=>{if(i(),!a?.length||!l?.length||!c?.length)return;const h=ETe(d)?{...d}:d;t.push(...a.flatMap(u=>l.flatMap(p=>c.map(g=>s(u,p,g,h)))))},{flush:"post"}),r=()=>{n(),i()};return kL(i),r}let EB=!1;function PB(e,t,i={}){const{window:s=uK,ignore:o=[],capture:n=!0,detectIframe:r=!1,controls:a=!1}=i;if(!s)return a?{stop:za,cancel:za,trigger:za}:za;if(YD&&!EB){EB=!0;const y={passive:!0};Array.from(s.document.body.children).forEach(m=>Su(m,"click",za,y)),Su(s.document.documentElement,"click",za,y)}let l=!0;const c=y=>x.toValue(o).some(m=>{if(typeof m=="string")return Array.from(s.document.querySelectorAll(m)).some(C=>C===y.target||y.composedPath().includes(C));{const C=Qg(m);return C&&(y.target===C||y.composedPath().includes(C))}});function d(y){const m=x.toValue(y);return m&&m.$.subTree.shapeFlag===16}function h(y,m){const C=x.toValue(y),b=C.$.subTree&&C.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(S=>S.el===m.target||m.composedPath().includes(S.el))}const u=y=>{const m=Qg(e);if(y.target!=null&&!(!(m instanceof Element)&&d(e)&&h(e,y))&&!(!m||m===y.target||y.composedPath().includes(m))){if("detail"in y&&y.detail===0&&(l=!c(y)),!l){l=!0;return}t(y)}};let p=!1;const g=[Su(s,"click",y=>{p||(p=!0,setTimeout(()=>{p=!1},0),u(y))},{passive:!0,capture:n}),Su(s,"pointerdown",y=>{const m=Qg(e);l=!c(y)&&!!(m&&!y.composedPath().includes(m))},{passive:!0}),r&&Su(s,"blur",y=>{setTimeout(()=>{var m;const C=Qg(e);((m=s.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!C?.contains(s.document.activeElement)&&t(y)},0)},{passive:!0})].filter(Boolean),f=()=>g.forEach(y=>y());return a?{stop:f,cancel:()=>{l=!1},trigger:y=>{l=!0,u(y),l=!1}}:f}const wLe={mounted(e,t){const i=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=PB(e,t.value,{capture:i});else{const[s,o]=t.value;e.__onClickOutside_stop=PB(e,s,Object.assign({capture:i},o))}},unmounted(e){e.__onClickOutside_stop()}};function D0(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function pK(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const i=e.parentNode;return!i||i.tagName==="BODY"?!1:pK(i)}}function MLe(e){const t=e||window.event,i=t.target;return pK(i)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const A0=new WeakMap;function DLe(e,t=!1){const i=x.shallowRef(t);let s=null,o="";x.watch(q3(e),a=>{const l=D0(x.toValue(a));if(l){const c=l;if(A0.get(c)||A0.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(o=c.style.overflow),c.style.overflow==="hidden")return i.value=!0;if(i.value)return c.style.overflow="hidden"}},{immediate:!0});const n=()=>{const a=D0(x.toValue(e));!a||i.value||(YD&&(s=Su(a,"touchmove",l=>{MLe(l)},{passive:!1})),a.style.overflow="hidden",i.value=!0)},r=()=>{const a=D0(x.toValue(e));!a||!i.value||(YD&&s?.(),a.style.overflow=o,A0.delete(a),i.value=!1)};return kL(r),x.computed({get(){return i.value},set(a){a?n():r()}})}function ALe(){let e=!1;const t=x.shallowRef(!1);return(i,s)=>{if(t.value=s.value,e)return;e=!0;const o=DLe(i,s.value);x.watch(t,n=>o.value=n)}}ALe();const ILe={class:"pv-relative"},RLe=["disabled"],kLe={key:0,class:"pv-shimmer"},TLe=x.defineComponent({__name:"PvDropdown",props:{defaultOpen:{type:Boolean,default:!1},popoverCssProperties:{},alignment:{},isList:{type:Boolean,default:!1},isSortable:{type:Boolean},icon:{type:Boolean},disabled:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["dropdown-open","dropdown-closed","list-order-updated"],setup(e,{expose:t,emit:i}){const s=i,o=x.ref(e.defaultOpen),n=x.computed(()=>({"pv-hide":!o.value})),r=l=>{o.value=!o.value},a=()=>{o.value=!1};return t({closeDropdown:a}),x.watch(o,l=>{s(l?"dropdown-open":"dropdown-closed")}),(l,c)=>x.withDirectives((x.openBlock(),x.createElementBlock("div",ILe,[x.createElementVNode("button",{class:x.normalizeClass({"pv-select":!l.icon,"pv-icon-button":l.icon}),style:{width:"auto"},onClick:r,disabled:l.disabled},[x.renderSlot(l.$slots,"trigger",{},()=>[c[1]||(c[1]=x.createTextVNode("Open"))],!0)],10,RLe),x.createVNode(xLe,{class:x.normalizeClass(n.value),"css-custom-properties":l.popoverCssProperties,alignment:l.alignment,isList:l.isList,isSortable:l.isSortable,onListOrderUpdated:c[0]||(c[0]=d=>l.$emit("list-order-updated",d))},{default:x.withCtx(()=>[x.renderSlot(l.$slots,"default",{},()=>[l.isLoading?(x.openBlock(),x.createElementBlock("span",kLe,"Loading...")):x.createCommentVNode("",!0)],!0)]),_:3},8,["class","css-custom-properties","alignment","isList","isSortable"])])),[[x.unref(wLe),a]])}}),OL=Xh(TLe,[["__scopeId","data-v-5261fc4a"]]),LLe=["xlink:href"],ELe=[void 0,10,12,20,24,32,64],As=x.defineComponent({__name:"PvIcon",props:{name:{},size:{}},setup(e){const t=e,i=x.computed(()=>({"pv-icon":!0,[`pv-icon-${t.size}`]:ELe.includes(t.size)}));return(s,o)=>(x.openBlock(),x.createElementBlock("svg",{"aria-hidden":"true",class:x.normalizeClass(i.value)},[x.createElementVNode("use",{"xlink:href":`#${s.name}`},null,8,LLe)],2))}}),PLe=["disabled"],NLe={key:0,class:"pv-button-loading"},OLe=x.defineComponent({__name:"PvButton",props:{variant:{default:"primary"},disabled:{type:Boolean,default:!1},size:{default:void 0},inverse:{type:Boolean,default:!1},shadow:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},setup(e){const t=e,i=x.computed(()=>({[`pv-button-${t.variant}`]:!0,[`pv-button-${t.size}`]:!!t.size,"pv-button-inverse":t.inverse,"pv-button-shadow":t.shadow}));return(s,o)=>(x.openBlock(),x.createElementBlock("button",{type:"button",class:x.normalizeClass(i.value),disabled:s.disabled},[s.loading?(x.openBlock(),x.createElementBlock("span",NLe)):x.renderSlot(s.$slots,"default",{key:1},void 0,!0)],10,PLe))}}),Ac=Xh(OLe,[["__scopeId","data-v-f00f6419"]]),FLe=x.defineComponent({__name:"PvCounterBadge",props:{value:{},prefix:{default:""},variant:{default:"primary"},size:{default:"sm"},maxValue:{default:99}},setup(e){const t=e,i=x.computed(()=>t.size=="md"?"md":(t.size=="sm","sm")),s=x.computed(()=>t.maxValue&&t.value&&t.value>t.maxValue?`${t.maxValue}+`:t.value!=null?`${t.prefix}${t.value}`:"-"),o=x.computed(()=>({"pv-inline-block pv-inset-square pv-radius pv-text-center":!0,"pv-badge-md pv-text-body-xs":i.value=="md","pv-badge-sm pv-text-body-xxs":i.value=="sm","pv-surface-brand-inverse pv-text-inverse":t.variant=="primary","pv-surface pv-bordered":t.variant=="secondary","pv-surface-lighten-5":t.variant=="tertiary","pv-text-secondary":t.variant=="ghost"||t.variant=="tertiary","pv-surface":t.variant=="ghost"}));return(n,r)=>(x.openBlock(),x.createElementBlock("div",{class:x.normalizeClass(o.value)},x.toDisplayString(s.value),3))}}),gK=Xh(FLe,[["__scopeId","data-v-5afd0e59"]]),BLe={class:"pv-text-body-xxs"},NB=x.defineComponent({__name:"PvTag",props:{label:{},rounded:{type:Boolean,default:!1},iconRight:{},iconLeft:{},isButton:{type:Boolean,default:!0}},emits:["tag-clicked","tag-icon-right-clicked","tag-icon-left-clicked"],setup(e,{emit:t}){const i=t;return(s,o)=>(x.openBlock(),x.createBlock(x.resolveDynamicComponent(s.isButton?"button":"div"),{class:"pv-flex-inline pv-tag",onClick:o[2]||(o[2]=n=>i("tag-clicked"))},{default:x.withCtx(()=>[s.iconLeft?(x.openBlock(),x.createBlock(As,{key:0,name:s.iconLeft,size:12,onClick:o[0]||(o[0]=x.withModifiers(n=>i("tag-icon-left-clicked"),["prevent"]))},null,8,["name"])):x.createCommentVNode("",!0),x.createElementVNode("span",BLe,x.toDisplayString(s.label),1),s.iconRight?(x.openBlock(),x.createBlock(As,{key:1,name:s.iconRight,size:12,onClick:o[1]||(o[1]=x.withModifiers(n=>i("tag-icon-right-clicked"),["prevent"]))},null,8,["name"])):x.createCommentVNode("",!0)]),_:1}))}}),GLe=["onClick","data-active","aria-label"],_Le=x.defineComponent({__name:"PvSegmentedControl",props:{options:{},iconOnly:{type:Boolean,default:!1},modelValue:{},large:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const i=t,s=n=>{i("update:modelValue",n)},o=x.computed(()=>({"pv-segmented-control":!e.large,"pv-segmented-control-large":e.large,"pv-segmented-control-icon":e.iconOnly}));return(n,r)=>(x.openBlock(),x.createElementBlock("div",{class:x.normalizeClass(o.value)},[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(n.options,a=>(x.openBlock(),x.createElementBlock("button",{key:a.value,onClick:l=>s(a.value),"data-active":n.modelValue===a.value?!0:null,"aria-label":n.iconOnly?a.label:void 0},[a.iconPosition=="left"?(x.openBlock(),x.createBlock(x.unref(As),{key:0,name:a.iconName},null,8,["name"])):x.createCommentVNode("",!0),n.iconOnly?x.createCommentVNode("",!0):(x.openBlock(),x.createElementBlock(x.Fragment,{key:1},[x.createTextVNode(x.toDisplayString(a.label),1)],64)),a.iconPosition=="right"?(x.openBlock(),x.createBlock(x.unref(As),{key:2,name:a.iconName},null,8,["name"])):x.createCommentVNode("",!0)],8,GLe))),128))],2))}}),zLe={class:"pv-flex"},VLe=["onClick"],OB=x.defineComponent({__name:"PvSelect",props:x.mergeModels({options:{default:()=>[]},defaultText:{default:"Select an option"},disabled:{type:Boolean,default:!1}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,i=x.ref(null),s=x.useModel(e,"modelValue"),o=x.computed(()=>{const l=t.options.find(c=>c.value===s.value);return l?l.label:t.defaultText}),n=x.computed(()=>{const l=t.options.find(c=>c.value===s.value);return l&&l?l.iconName:null}),r=l=>l&&l?l.iconName:null,a=l=>{s.value=l.value,i.value&&i.value.closeDropdown()};return(l,c)=>(x.openBlock(),x.createBlock(OL,{ref_key:"dropdown",ref:i,isList:!0,disabled:l.disabled,popoverCssProperties:{width:"auto"}},{trigger:x.withCtx(()=>[x.createElementVNode("div",zLe,[n.value?(x.openBlock(),x.createBlock(As,{key:0,class:"pv-icon-button",name:n.value},null,8,["name"])):x.createCommentVNode("",!0),x.createTextVNode(" "+x.toDisplayString(o.value),1)])]),default:x.withCtx(()=>[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(l.options,d=>(x.openBlock(),x.createElementBlock("li",{key:d.value},[x.createElementVNode("a",{role:"button",onClick:h=>a(d),style:{cursor:"pointer"}},[r(d)?(x.openBlock(),x.createBlock(As,{key:0,class:"pv-icon-button",name:r(d)||""},null,8,["name"])):x.createCommentVNode("",!0),x.createTextVNode(" "+x.toDisplayString(d.label),1)],8,VLe)]))),128))]),_:1},8,["disabled"]))}}),HLe={class:"pv-flex",style:{"--flex-wrap":"nowrap"}},WLe=["id"],jLe={key:1,style:{"padding-left":"16px"}},ULe=["checked","disabled","onChange"],KLe={class:"pv-text-body-md"},$Le={key:2},FB=2,YLe=x.defineComponent({__name:"GroupBySelector",setup(e){const t=x.inject("gridApi"),i=x.inject("availableRowGroupColumns"),s=x.inject("rowGroupColumnFields");x.watch(s,()=>{},{deep:!0});const o=p=>s.value.includes(p||""),n=(p,g)=>{g?t.value.addRowGroupColumns([p]):t.value.removeRowGroupColumns([p])},r=x.computed(()=>({"pv-hide":i.value.length===0})),a=x.computed(()=>s.value.length>=FB),l=x.computed(()=>s.value.map(p=>i.value.find(g=>g.field===p)).filter(p=>p!==void 0)),c=x.computed(()=>i.value.filter(p=>!s.value.includes(p.field))),d=x.computed(()=>{const p={label:"",value:"divider"},g=l.value.map(y=>({label:y.headerName,value:y.field})),f=c.value.map(y=>({label:y.headerName,value:y.field}));return[...g,p,...f]}),h=p=>`group-by-list-item-${p}`,u=p=>{const g=p.findIndex(m=>m==="divider"),y=p.slice(0,g).slice(0,FB).map(m=>m.replace("group-by-list-item-",""));t.value.setRowGroupColumns(y)};return(p,g)=>(x.openBlock(),x.createBlock(OL,{isList:!0,isSortable:!0,popoverCssProperties:{width:"auto"},alignment:"right",class:x.normalizeClass(r.value),onListOrderUpdated:u},{trigger:x.withCtx(()=>[x.createElementVNode("div",HLe,[g[0]||(g[0]=x.createElementVNode("p",{class:"pv-truncate pv-text-body-md"},"Group by",-1)),x.unref(s).length>0?(x.openBlock(),x.createBlock(x.unref(gK),{key:0,value:x.unref(s).length,variant:"tertiary"},null,8,["value"])):x.createCommentVNode("",!0)])]),default:x.withCtx(()=>[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(d.value,(f,y)=>(x.openBlock(),x.createElementBlock(x.Fragment,{key:f.value},[f.value!=="divider"?(x.openBlock(),x.createElementBlock("li",{key:0,id:h(f.value)},[x.createElementVNode("label",{class:x.normalizeClass(["pv-flex",{"pv-border-bottom":y+1===x.unref(s).length}])},[o(f.value)?(x.openBlock(),x.createBlock(As,{key:0,name:"reorder",class:"pv-text-subdued"})):(x.openBlock(),x.createElementBlock("span",jLe)),x.createElementVNode("input",{type:"checkbox",class:"pv-checkbox",checked:o(f.value),disabled:!o(f.value)&&a.value,onChange:m=>n(f.value,m.target.checked)},null,40,ULe),x.createElementVNode("span",KLe,x.toDisplayString(f.label),1),o(f.value)?(x.openBlock(),x.createElementBlock("sup",$Le,x.toDisplayString(y+1),1)):x.createCommentVNode("",!0)],2)],8,WLe)):x.createCommentVNode("",!0)],64))),128))]),_:1},8,["class"]))}}),XLe={},ZLe={class:"ag-custom-loading-cell pv-shimmer"};function qLe(e,t){return x.openBlock(),x.createElementBlock("div",ZLe)}const QLe=Xh(XLe,[["render",qLe]]),JLe={key:0},eEe={class:"pv-text-body-xxs pv-text-subdued"},tEe={class:"pv-flex pv-space-between",style:{"line-height":"20px"}},iEe={class:"pv-text-title-md"},sEe={key:0,class:"pv-text-subdued pv-text-body-xxs",style:{"padding-right":"12px"}},oEe={key:0,class:"pv-table-row-number"},nEe=x.defineComponent({__name:"GroupedCellRenderer",props:{params:{}},setup(e){const t=e,i=x.inject("rowGroupColumnFields"),s=x.inject("groupColumnCellValueColumn"),o=x.inject("expandedRows"),n=x.computed(()=>!t.params.displayBaseAggregationsOnly||a.value.level===i.value.length-1),r=x.computed(()=>t.params.rowNode.group),a=q3(t.params,"rowNode"),l=x.computed(()=>{if(!s.value)return"";const u=s.value.getColId()||"",p=a.value;return u&&p&&p.data&&u in p.data&&p.data[u]||""}),c=x.computed(()=>a.value.allChildrenCount||0),d=x.computed(()=>{const u=a.value.rowIndex,p=a.value.parent?.rowIndex;return u!=null&&p!=null?u-p:null}),h=u=>{const p=u.node.expanded,g=u.node.rowIndex;g!=null&&(o.value[g]=p)};return x.onMounted(()=>{const u=a.value,p=u.rowIndex,g=u.expanded;p!=null&&(o.value[p]=g),a.value.addEventListener("expandedChanged",h)}),x.onBeforeUnmount(()=>{const u=a.value;a.value.removeEventListener("expandedChanged",h);const p=u.rowIndex;p!=null&&(o.value[p]=!1)}),(u,p)=>(x.openBlock(),x.createElementBlock(x.Fragment,null,[r.value?(x.openBlock(),x.createElementBlock("div",JLe,[x.createElementVNode("p",eEe,x.toDisplayString(x.unref(a).rowGroupColumn?.getColDef().headerName),1),x.createElementVNode("div",tEe,[x.createElementVNode("p",iEe,x.toDisplayString(u.params.formattedValue||u.params.rowNode.key),1),u.params.displayCount&&n.value&&c.value>0?(x.openBlock(),x.createElementBlock("p",sEe," Count "+x.toDisplayString(c.value),1)):x.createCommentVNode("",!0)])])):x.createCommentVNode("",!0),x.createElementVNode("div",null,[x.createElementVNode("p",null,[u.params.displayRowNumber&&d.value?(x.openBlock(),x.createElementBlock("span",oEe,x.toDisplayString(d.value),1)):x.createCommentVNode("",!0),x.createTextVNode(" "+x.toDisplayString(l.value),1)])])],64))}});function BB(e){const t=e.filter(s=>s!=null&&!isNaN(s)).sort((s,o)=>s-o),i=t.length;return i===0?null:t[Math.floor(i/2)]}const rEe={style:{"line-height":"20px"}},aEe={class:"pv-text-subdued pv-text-body-xxs pv-relative"},lEe=x.defineComponent({__name:"GroupAggCellRenderer",props:{params:{}},setup(e){const t=e,i=x.inject("expandedRows"),s=x.computed(()=>(t.params.column?.getAggFunc()||"agg").toLowerCase()),o=()=>{const l=t.params.api;if(l){const c=!r.value;l.setRowNodeExpanded(t.params.node,c),n.value&&(i.value[n.value]=c)}},n=x.computed(()=>t.params.node?.rowIndex),r=x.computed(()=>{let l=!1;return n.value!=null&&(l=n.value in i.value?i.value[n.value]:!1),l}),a=x.computed(()=>r.value?"chevron-down":"chevron-right");return x.onMounted(()=>{t.params.node.expanded&&n.value&&(i.value[n.value]=!0)}),(l,c)=>(x.openBlock(),x.createElementBlock("div",{class:"pv-flex",ondblclick:o},[x.createElementVNode("div",rEe,[x.createElementVNode("p",null,x.toDisplayString(l.params.valueFormatted),1),x.createElementVNode("p",aEe,x.toDisplayString(s.value),1)]),x.createVNode(Ac,{variant:"icon",onClick:o},{default:x.withCtx(()=>[x.createVNode(As,{name:a.value},null,8,["name"])]),_:1})]))}}),fK=x.ref({}),JD=x.ref({}),eA=x.ref(void 0),mK=x.ref({}),yK=x.ref({}),vK=x.ref({}),cEe=async(e,t,i,s)=>{const o=vK.value[t.field]||void 0,n=yK.value[t.field]||[];if(eA.value==null){const h=(await e.getColumnFilterInstance(t.field)).getFilterValues();return o?h.filter(u=>u?.toLowerCase().includes(o.toLowerCase())):h}const r={api:e,colDef:t,column:i,filterModel:s||fK.value,query:o,selectedValues:n};JD.value[t.field]=!0;const a=await eA.value?.(r);JD.value[t.field]=!1,t.field&&(mK.value[t.field]=a);const l=a.filter(d=>d!=null).map(d=>d.value)||[],c=[...n,...l];return c.filter((d,h)=>c.indexOf(d)===h)},dEe=(e,t)=>{const i=mK.value[e];return i?i.find(s=>s?.value===t):null},hEe=(e,t)=>{yK.value[e]=t},uEe=(e,t)=>{vK.value[e]=t},CK=()=>({filterModel:fK,filterValuesLoadingStatus:JD,filterStoreHandler:eA,fetchFilterValues:cEe,filterValueContext:dEe,setFilterSelectedValues:hEe,setFilterValueSearchText:uEe}),pEe={class:"pv-flex pv-stack-8"},gEe={class:"pv-flex",style:{"--flex-wrap":"nowrap"}},fEe={key:0,class:"pv-text-body-md pv-text-subdued",style:{"padding-top":"8px"}},mEe={key:0,class:"pv-text-subdued pv-text-body-xxs",style:{"padding-top":"8px"}},yEe={class:"pv-flex"},vEe=["type","value","checked","disabled","onChange"],CEe={class:"pv-text-body-md",style:{"padding-left":"4px"}},bEe={key:2,class:"pv-text-body-xxs pv-text-subdued"},SEe={key:0,class:"pv-full-width"},xEe={class:"pv-flex-inline"},wEe={role:"list",class:"pv-flex pv-stack-8",style:{"--flex-wrap":"wrap"}},MEe=4,DEe=x.defineComponent({__name:"SetFilter",props:{filterColDef:{},filterStyle:{default:"horizontal"}},emits:["filter-selection-changed","filter-closed"],setup(e,{emit:t}){const i=e,s=t,o=x.inject("gridApi"),{filterModel:n,filterValuesLoadingStatus:r,filterValueContext:a,setFilterValueSearchText:l,setFilterSelectedValues:c}=CK(),d=x.inject("firstDataRendered"),h=x.ref([]),u=x.ref([]),p=x.computed(()=>i.filterColDef.field||""),g=x.computed(()=>i.filterColDef.headerName||""),f=x.ref(!1),y=x.computed(()=>{const B=i.filterColDef.context;return B&&B.filterValueFormatter&&typeof B.filterValueFormatter=="function"?B.filterValueFormatter:typeof i.filterColDef.valueFormatter=="function"?i.filterColDef.valueFormatter:null}),m=x.ref(""),C=x.ref(0),b=x.ref(0),S=async()=>{A(),await R().then(()=>{f.value=!1})},A=()=>{const B=[];if(n.value&&n.value[p.value]?.values){const Y=n.value[p.value].values||[];B.push(...Y)}h.value=B},R=async(B=!1,Y=!1)=>{const q=await o.value.getColumnFilterInstance(p.value);(Y||B&&r.value[p.value]!==!0&&C.value>b.value)&&(q.refreshFilterValues(),b.value=C.value);const Z=new Set(q.getFilterValues());h.value.forEach(ee=>{Z.add(ee)}),u.value=I(Array.from(Z))},I=B=>B.sort((Y,q)=>{const Z=h.value.includes(Y),ee=h.value.includes(q);return Z&&!ee?-1:!Z&&ee?1:0}),w=B=>y.value?y.value({value:B}):B,M=x.computed(()=>{const B=i.filterColDef.context;return B&&B.filterSelectMax?B.filterSelectMax:null}),T=x.computed(()=>{const B=i.filterColDef.context;return B&&B.filterSelectMin?B.filterSelectMin===1&&M.value===1:!1}),E=x.computed(()=>M.value?h.value.length>=M.value:!1),P=x.computed(()=>u.value.filter(B=>!h.value.includes(B))),N=x.computed(()=>u.value.length===1&&u.value[0]===null&&h.value.length===0),F=x.computed(()=>u.value.filter(B=>a(p.value,B)?.isPreference)),_=B=>N.value||a(p.value,B)?.isSelectable===!1?!0:T.value?!1:E.value&&!h.value.includes(B),W=B=>!F.value||F.value.length<1?!1:B===F.value.length-1&&u.value.length>F.value.length,z=x.computed(()=>{const B=[...F.value,...u.value];return B.filter((Y,q)=>B.indexOf(Y)===q)});x.watch(()=>r.value[p.value],()=>{const B=r.value[p.value];f.value&&!B?(R(),f.value=!1):B&&(f.value=!0)},{deep:!0}),x.watch(()=>n.value,()=>{C.value+=1,A()}),x.watch(()=>d.value,()=>{A()}),x.watch(()=>h.value,B=>{c(p.value,B)}),zTe(()=>m.value,async B=>{l(p.value,B),await R(!0,!0)},{debounce:300});const U=B=>{B&&T.value?h.value=[B]:B&&!h.value.includes(B)&&(h.value=[...h.value,B]),O(),s("filter-selection-changed")},G=B=>{h.value=h.value.filter(Y=>Y!==B),O(),s("filter-selection-changed")},V=(B,Y)=>{B.target.checked?U(Y):G(Y)},O=()=>{const B=h.value.length>0?h.value:null;o.value.setColumnFilterModel(p.value,{values:B}).then(()=>{o.value.onFilterChanged()})},H=()=>{m.value="",s("filter-closed")};return x.onMounted(()=>{S()}),(B,Y)=>(x.openBlock(),x.createElementBlock(x.Fragment,null,[x.createElementVNode("div",pEe,[(x.openBlock(),x.createBlock(x.resolveDynamicComponent(B.filterStyle==="vertical"?"ul":"div"),{role:"list",class:"pv-flex",style:{"--flex-wrap":"wrap"}},{default:x.withCtx(()=>[B.filterStyle==="vertical"?(x.openBlock(!0),x.createElementBlock(x.Fragment,{key:0},x.renderList(h.value,q=>(x.openBlock(),x.createElementBlock("li",{key:`${g.value}-${q}`},[x.createVNode(NB,{label:q||"",isButton:!0,iconRight:"close",onTagIconRightClicked:Z=>G(q)},null,8,["label","onTagIconRightClicked"])]))),128)):x.createCommentVNode("",!0),(x.openBlock(),x.createBlock(x.resolveDynamicComponent(B.filterStyle==="vertical"?"li":"div"),null,{default:x.withCtx(()=>[x.createVNode(OL,x.mergeProps({isList:!0,icon:B.filterStyle==="vertical",alignment:B.filterStyle==="vertical"&&h.value.length>2?"right":void 0,class:"pv-flex",popoverCssProperties:{width:"auto"},isLoading:f.value,onDropdownOpen:Y[1]||(Y[1]=q=>R(!0)),onDropdownClosed:H},B.filterStyle==="horizontal"?{"data-horizontal-filter-field":p.value}:{}),x.createSlots({default:x.withCtx(()=>[x.withDirectives(x.createElementVNode("input",{"onUpdate:modelValue":Y[0]||(Y[0]=q=>m.value=q),type:"text",class:"pv-input-search pv-input-small pv-full-width",style:{"min-width":"200px"}},null,512),[[x.vModelText,m.value]]),z.value.length===0?(x.openBlock(),x.createElementBlock("li",fEe," No Results ")):(x.openBlock(),x.createElementBlock(x.Fragment,{key:1},[F.value.length>0?(x.openBlock(),x.createElementBlock("li",mEe," Your Preferences ")):x.createCommentVNode("",!0),(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(z.value,(q,Z)=>(x.openBlock(),x.createElementBlock("li",{key:q,class:x.normalizeClass({"pv-border-bottom":W(Z)})},[x.createElementVNode("label",yEe,[x.createElementVNode("input",{type:T.value?"radio":"checkbox",class:x.normalizeClass(T.value?"pv-radio":"pv-checkbox"),value:q,checked:h.value.includes(q)||N.value,disabled:_(q),onChange:ee=>V(ee,q)},null,42,vEe),x.createElementVNode("span",CEe,x.toDisplayString(w(q)),1)])],2))),128))],64)),E.value?(x.openBlock(),x.createElementBlock("p",bEe," Max of "+x.toDisplayString(M.value)+" allowed ",1)):x.createCommentVNode("",!0)]),_:2},[B.filterStyle==="horizontal"?{name:"trigger",fn:x.withCtx(()=>[x.createElementVNode("div",gEe,[h.value.length>0?(x.openBlock(),x.createBlock(x.unref(gK),{key:0,value:h.value.length,variant:"tertiary"},null,8,["value"])):x.createCommentVNode("",!0),x.createElementVNode("p",{class:x.normalizeClass(["pv-text-body-md pv-truncate",{"pv-shimmer":f.value}])},x.toDisplayString(g.value),3)])]),key:"0"}:{name:"trigger",fn:x.withCtx(()=>[x.createVNode(As,{class:"pv-text-subdued",name:"add-circle"})]),key:"1"}]),1040,["icon","alignment","isLoading"])]),_:1}))]),_:1}))]),B.filterStyle=="vertical"?(x.openBlock(),x.createElementBlock("div",SEe,[x.createElementVNode("div",xEe,[x.createElementVNode("ul",wEe,[Y[2]||(Y[2]=x.createElementVNode("li",null,[x.createElementVNode("p",{class:"pv-text-subdued pv-text-body-md"},"Suggested:")],-1)),(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(P.value.slice(0,MEe),q=>(x.openBlock(),x.createElementBlock("li",{key:`${g.value}-${q}-suggest`},[x.createVNode(NB,{class:"pv-outlined-tag",label:q||"",isButton:!0,iconLeft:"expand",onTagIconLeftClicked:Z=>U(q),onTagClicked:Z=>U(q)},null,8,["label","onTagIconLeftClicked","onTagClicked"])]))),128))])])])):x.createCommentVNode("",!0)],64))}}),GB=Xh(DEe,[["__scopeId","data-v-3ba9abae"]]),AEe={class:"pv-flex"},IEe={class:"pv-flex-vertical pv-space-between pv-full-width",style:{height:"100%","overflow-x":"hidden"}},REe={class:"pv-flex-vertical pv-full-width"},kEe={class:"pv-flex pv-inset-squish pv-full-width pv-space-between"},TEe={class:"pv-text-title-lg"},LEe={class:"pv-full-width pv-inset-inline-24"},EEe={class:"pv-details",open:""},PEe={class:"pv-flex pv-stack-8"},NEe={class:"pv-text-title-lg"},OEe={class:"pv-inset-block-8"},FEe={class:"pv-sticky pv-border-top pv-full-width pv-inset-squish pv-flex pv-space-between pv-surface",style:{"--top":"unset",bottom:"0"}},BEe={class:"pv-flex"},_B=5,GEe=x.defineComponent({__name:"FilterPanel",props:{enableVerticalPanel:{type:Boolean,default:!0}},setup(e){const t=x.inject("gridApi"),i=x.inject("availableFilterColumns"),s=x.inject("currentlyActiveFilter"),o=x.ref(null),n=x.ref(null),r=x.computed(()=>{const p=[...i.value].slice(0,_B);return s.value?[...p.slice(0,_B-1),s.value]:p}),a=x.ref(!1),l=()=>{a.value=!0},c=()=>{a.value=!1,n.value=t.value.getFilterModel(),o.value?.showModal()},d=()=>{n.value=null,t.value.setFilterModel(null),t.value.onFilterChanged()},h=()=>{n.value&&t.value.setFilterModel(n.value),n.value=null,o.value?.close()},u=()=>{t.value.onFilterChanged(),o.value?.close()};return(p,g)=>(x.openBlock(),x.createElementBlock("div",AEe,[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(r.value,f=>(x.openBlock(),x.createElementBlock(x.Fragment,{key:f.field},[x.unref(t)?(x.openBlock(),x.createBlock(GB,{key:0,filterColDef:f},null,8,["filterColDef"])):x.createCommentVNode("",!0)],64))),128)),p.enableVerticalPanel?(x.openBlock(),x.createElementBlock("button",{key:0,class:"pv-button-ghost pv-stack-8 pv-inset-block",onClick:c,style:{"--inset-size":"6px"}},[x.createVNode(x.unref(As),{name:"filter"}),g[5]||(g[5]=x.createTextVNode(" All Filters "))])):x.createCommentVNode("",!0),p.enableVerticalPanel?(x.openBlock(),x.createElementBlock("dialog",{key:1,ref_key:"filterDrawer",ref:o,id:"filter-vertical-drawer",class:"pv-drawer pv-surface",onClick:g[4]||(g[4]=x.withModifiers(f=>h(),["self"])),style:{"max-width":"450px"}},[x.createElementVNode("div",IEe,[x.createElementVNode("div",REe,[x.createElementVNode("div",kEe,[x.createElementVNode("p",TEe," All Filters ("+x.toDisplayString(x.unref(i).length)+") ",1),x.createElementVNode("button",{class:"pv-button-ghost",onClick:g[0]||(g[0]=f=>h())},[x.createVNode(x.unref(As),{name:"close"})])]),x.createElementVNode("div",LEe,[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(x.unref(i),(f,y)=>(x.openBlock(),x.createElementBlock("div",{key:f.field,class:x.normalizeClass([{"pv-border-bottom":y<x.unref(i).length-1},"pv-stack-12"])},[x.createElementVNode("details",EEe,[x.createElementVNode("summary",PEe,[x.createElementVNode("span",NEe,x.toDisplayString(f.headerName),1)]),x.createElementVNode("div",OEe,[x.unref(t)?(x.openBlock(),x.createBlock(GB,{key:0,"filter-style":"vertical",filterColDef:f,onFilterSelectionChanged:l},null,8,["filterColDef"])):x.createCommentVNode("",!0)])])],2))),128))])]),x.createElementVNode("div",FEe,[x.createElementVNode("button",{class:"pv-button-ghost",onClick:g[1]||(g[1]=f=>d())}," Clear All "),x.createElementVNode("div",BEe,[x.createVNode(Ac,{variant:"ghost",onClick:g[2]||(g[2]=f=>h())},{default:x.withCtx(()=>g[6]||(g[6]=[x.createTextVNode(" Cancel ")])),_:1}),a.value?(x.openBlock(),x.createBlock(Ac,{key:0,variant:"primary",onClick:g[3]||(g[3]=f=>u())},{default:x.withCtx(()=>g[7]||(g[7]=[x.createTextVNode(" Apply ")])),_:1})):(x.openBlock(),x.createBlock(Ac,{key:1,variant:"primary",disabled:""},{default:x.withCtx(()=>g[8]||(g[8]=[x.createTextVNode(" No Changes ")])),_:1}))])])])],512)):x.createCommentVNode("",!0)]))}});var tA=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Date="date",e.Currency="currency",e.Formula="formula",e.Select="select",e.Percent="percent",e.Entity="entity",e.Id="id",e.User="user",e.Link="link",e.Status="status",e.Tag="tag",e.None="none",e))(tA||{});const _Ee=e=>{switch(e){case"string":return"fonts";case"number":return"hash";case"boolean":return"list";case"date":return"calendar";case"currency":return"currency-dollar";case"formula":return"formula";case"select":return"list";case"percent":return"percent";case"entity":return"building";case"id":return"id-2";case"link":return"link";case"user":return"user";case"status":return"list";case"tag":return"list";case"none":return null;default:return null}},zEe=(e,t)=>{if(!e)return e;switch(t){case"percent":return e.replace(/^%+/,"").trim();default:return e}},VEe={class:"pv-flex"},HEe={class:"pv-flex ag-header-actions"},WEe=x.defineComponent({__name:"HeaderCellRenderer",props:{params:{}},setup(e,{expose:t}){const i=e,s=x.ref(!1),o=x.ref(!1),n=x.ref(null),r=x.ref(null),a=x.ref(null),l=x.ref(!1),c=x.ref(null),d=x.computed(()=>c.value==="asc"?"arrow-up":c.value==="desc"?"arrow-down":""),h=x.computed(()=>o.value?{cursor:"pointer"}:{}),u=x.computed(()=>l.value?{opacity:1}:{}),p=()=>{l.value=!1},g=()=>{l.value=!0,a.value&&i.params.showColumnMenu(a.value,p)},f=b=>{s.value=b.enableFilterButton,o.value=b.enableSorting||!1,n.value=b.displayName,b.column.getColId()!="ag-Grid-AutoColumn"&&(r.value=_Ee(b.column.getColDef().context?.dataType),n.value=zEe(n.value,b.column.getColDef().context?.dataType))},y=b=>{b.column.getSort()!==void 0&&(c.value=b.column.getSort())},m=()=>{o.value&&i.params.progressSort(!1)};x.onBeforeMount(()=>{f(i.params)}),x.onMounted(()=>{i.params.column.addEventListener("sortChanged",y)}),x.onUnmounted(()=>{i.params.column.removeEventListener("sortChanged",y)});function C(b){return f(b),!0}return t({refresh:C}),(b,S)=>(x.openBlock(),x.createElementBlock("div",{class:"ag-custom-header-cell pv-flex pv-full-width pv-space-between",style:x.normalizeStyle(h.value),onClick:m},[x.createElementVNode("div",VEe,[r.value?(x.openBlock(),x.createBlock(As,{key:0,name:r.value,class:"pv-text-subdued"},null,8,["name"])):x.createCommentVNode("",!0),x.createElementVNode("p",null,x.toDisplayString(n.value),1),o.value&&d.value!==""?(x.openBlock(),x.createBlock(As,{key:1,name:d.value},null,8,["name"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",HEe,[x.createElementVNode("div",{ref_key:"menuButton",ref:a,class:"ag-header-cell-menu-button",style:x.normalizeStyle(u.value)},[x.createVNode(Ac,{variant:"icon",onClick:x.withModifiers(g,["stop","prevent"])},{default:x.withCtx(()=>[x.createVNode(As,{name:"menu"})]),_:1})],4)])],4))}}),jEe=Xh(WEe,[["__scopeId","data-v-d256662b"]]),UEe=h3.withParams({headerHeight:"30px",headerBackgroundColor:"#F7F8F8",headerCellHoverBackgroundColor:"#F7F8F8",headerColumnResizeHandleHeight:"50%",headerColumnResizeHandleWidth:"3px",headerColumnBorder:"none",headerFontWeight:"bold",headerFontSize:"12px",fontFamily:"Inter, sans-serif",fontSize:12,headerRowBorder:!0,rowHoverColor:"#F7F8F8",rangeSelectionBorderColor:"#36C5BA",rangeSelectionBorderStyle:"solid",wrapperBorder:"none",wrapperBorderRadius:"0px",menuBackgroundColor:"white",accentColor:"#36C5BA"}),KEe={class:"pv-popover-menu"},$Ee={class:"pv-popover",style:{"--height":"auto"}},YEe=["disabled"],XEe=x.defineComponent({__name:"ExportMenu",props:{getCsvData:{type:Function}},setup(e){const t=e,i=x.ref(!1);async function s(){i.value=!0;const o=await t.getCsvData();if(!o){i.value=!1;return}const n=new Blob([o],{type:"text/csv;charset=utf-8;"}),r=document.createElement("a");r.href=URL.createObjectURL(n),r.setAttribute("download","datatable_export.csv"),r.click(),i.value=!1}return(o,n)=>(x.openBlock(),x.createElementBlock("nav",KEe,[n[0]||(n[0]=x.createElementVNode("button",{type:"button",class:"pv-button-icon"},[x.createElementVNode("svg",{"aria-hidden":"true",class:"pv-icon-24"},[x.createElementVNode("title",null,"ellipsis"),x.createElementVNode("use",{"xlink:href":"#ellipsis"})])],-1)),x.createElementVNode("div",$Ee,[x.createElementVNode("button",{class:"pv-button pv-text-body-sm pv-inset-square-8",onClick:x.withModifiers(s,["prevent"]),disabled:i.value},[i.value?(x.openBlock(),x.createElementBlock(x.Fragment,{key:0},[x.createTextVNode("Exporting...")],64)):(x.openBlock(),x.createElementBlock(x.Fragment,{key:1},[x.createTextVNode("Download CSV")],64))],8,YEe)])]))}}),ZEe={key:1,class:""},qEe=x.defineComponent({__name:"PaginationPanel",props:{panelSize:{default:"xl"}},setup(e){dU.registerModules([aIe]);const t=x.inject("gridApi"),i=e,s=x.ref(1),o=x.ref(1);x.watchEffect(()=>{const c=t.value;c&&(s.value=c.paginationGetCurrentPage()+1,o.value=c.paginationGetTotalPages(),c.addEventListener("paginationChanged",()=>{s.value=c.paginationGetCurrentPage()+1,o.value=c.paginationGetTotalPages()}))});const n=x.computed(()=>{const c=o.value,d=s.value;if(c<=7)return Array.from({length:c},(u,p)=>p+1);const h=[];return d<=4?h.push(1,2,3,4,5,"...",c):d>=c-3?h.push(1,"...",c-4,c-3,c-2,c-1,c):h.push(1,"...",d-1,d,d+1,"...",c),h}),r=()=>{s.value>0&&t?.value.paginationGoToPage(s.value-2)},a=()=>{s.value<o.value&&t?.value.paginationGoToPage(s.value)},l=c=>{c>=1&&c<=o.value&&t?.value.paginationGoToPage(c-1)};return(c,d)=>(x.openBlock(),x.createElementBlock("div",{class:x.normalizeClass(["pv-flex",{"pv-hide":o.value<=1}])},[x.createVNode(Ac,{variant:"icon",onClick:r,disabled:s.value===1,size:i.panelSize==="l"?"small":void 0},{default:x.withCtx(()=>[x.createVNode(As,{name:"chevron-left"})]),_:1},8,["disabled","size"]),(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(n.value,h=>(x.openBlock(),x.createElementBlock(x.Fragment,{key:h},[typeof h=="number"?(x.openBlock(),x.createBlock(Ac,{key:0,variant:h===s.value?"primary":"tertiary",size:i.panelSize==="l"?"small":void 0,onClick:u=>l(h)},{default:x.withCtx(()=>[x.createTextVNode(x.toDisplayString(h),1)]),_:2},1032,["variant","size","onClick"])):(x.openBlock(),x.createElementBlock("span",ZEe,"..."))],64))),128)),x.createVNode(Ac,{variant:"icon",onClick:a,disabled:s.value===o.value,size:i.panelSize==="l"?"small":void 0},{default:x.withCtx(()=>[x.createVNode(As,{name:"chevron-right"})]),_:1},8,["disabled","size"])],2))}}),QEe={class:"pv-stack-8"},JEe={class:"pv-flex pv-space-between",style:{"align-items":"start"}},ePe={class:"pv-flex"},tPe={class:"pv-relative pv-stack-8",style:{width:"100%",height:"90%"}},iPe={key:1,class:"pv-chart-overlay pv-text-body-xs"},sPe=x.defineComponent({__name:"PvDataTable",props:{colDefs:{},rowData:{},serverSideRowHandler:{},filterValuesSetHandler:{},initialGridState:{},theme:{default:()=>UEe},displayBaseAggregationsOnly:{type:Boolean,default:!1},displayRowNumber:{type:Boolean,default:!1},enableVerticalFilterPanel:{type:Boolean,default:!0},enableColumnVisibilitySelector:{type:Boolean,default:!1},enableGroupBySelector:{type:Boolean,default:!1},enableCsvExport:{type:Boolean,default:!1},csvRowLimit:{default:2e4},serverSideCsvHandler:{},uniqueRowIdField:{},requireFiltersToShowData:{type:Boolean,default:!1},isLoading:{type:Boolean},containerHeight:{default:500},containerMinHeight:{default:200},debugMode:{type:Boolean,default:!1},pagination:{type:Boolean,default:!1},paginationPageSize:{default:50}},emits:["column-moved","column-resized","column-row-group-changed","grid-ready","filter-changed","filter-opened","first-data-rendered"],setup(e,{expose:t,emit:i}){const s=[uAe,hAe,Uxe,ARe,CAe,DAe,STe,VRe,Eke,tIe,jAe];k3.setLicenseKey("Using_this_{AG_Grid}_Enterprise_key_{AG-065231}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Turquoise_Health}_is_granted_a_{Multiple_Applications}_Developer_License_for_{3}_Front-End_JavaScript_developers___All_Front-End_JavaScript_developers_need_to_be_licensed_in_addition_to_the_ones_working_with_{AG_Grid}_Enterprise___This_key_has_been_granted_a_Deployment_License_Add-on_for_{2}_Production_Environments___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{16_August_2025}____[v3]_[01]_MTc1NTI5ODgwMDAwMA==c042c2db0e82c322692ccb41e7b58f3e");const n=e;n.debugMode&&s.push(nDe);const r=x.computed(()=>({height:`${n.containerHeight}px`,minHeight:`${n.containerMinHeight}px`})),a=i,l="serverSideRowHandler"in n&&n.serverSideRowHandler?{getRows:K=>{if(!A.value){K.success({rowData:[]});return}n.serverSideRowHandler?.(K)}}:null,c="filterValuesSetHandler"in n&&n.filterValuesSetHandler?async K=>{let oe={...I.value};!C.value&&n.initialGridState&&(oe=n.initialGridState.filter?.filterModel||{});const de=await M(K.api,K.colDef,K.column,oe);K.success(de)}:null,d=K=>{const oe=K.node,de=K.column?.getColId();return!oe.group||!de?!1:F.value.some(re=>{if(re.field===de)return!0})},h=(()=>{const K={suppressHeaderFilterButton:!0,editable:!1,sortable:!0,suppressHeaderMenuButton:!0,suppressColumnsToolPanel:!0,minWidth:200,flex:1,headerComponent:jEe,cellRendererSelector:oe=>{if(d(oe))return{component:lEe,params:oe}}};return l&&c&&(K.filterParams={values:c}),K})(),u=x.ref(void 0),p={name:"Column Filter",icon:'<span class="ag-icon ag-icon-filter"></span>',action:function(K){let oe=K.column?.getColId();if(K.column&&G(K.column)&&(oe=_.value?.getColId()||""),console.log("customFilterMenuItem",oe),!Z(oe)){const re=K.api.getColumn(oe)?.getColDef();re&&(y.value=re,x.nextTick(()=>{Z(oe)}))}}},g=(K,oe)=>{const de={...K};return oe.dataType===tA.Percent&&!K.valueFormatter?de.valueFormatter=Eme:oe.dataType===tA.Currency&&!K.valueFormatter&&(de.valueFormatter=J4),de},f=x.computed(()=>!n.colDefs||n.colDefs.length===0?[]:n.colDefs.map(K=>{const oe=K.context;return oe?g(K,oe):K})),y=x.ref(null),m=x.ref([]),C=x.ref(!1),b=x.ref(!0),S=x.ref(void 0),A=x.computed(()=>!n.requireFiltersToShowData||!n.serverSideRowHandler||!!Object.keys(I.value||{}).length),R=x.shallowRef(null),{filterModel:I,filterValuesLoadingStatus:w,fetchFilterValues:M,filterStoreHandler:T}=CK();T.value=n.filterValuesSetHandler;const E=x.ref(null),P=x.computed(()=>f.value.filter(K=>K.filter)),N=x.computed(()=>f.value.filter(K=>K.enableRowGroup)),F=x.computed(()=>f.value.filter(K=>K.aggFunc)),_=x.ref(null),W=x.ref({});x.provide("filterModel",I),x.provide("gridApi",R),x.provide("columnDisplayOrder",E),x.provide("currentlyActiveFilter",y),x.provide("availableFilterColumns",P),x.provide("availableRowGroupColumns",N),x.provide("rowGroupColumnFields",m),x.provide("groupColumnCellValueColumn",_),x.provide("expandedRows",W),x.provide("firstDataRendered",C),x.provide("filterValuesLoadingStatus",w),x.provide("displayUnfilteredTableData",A);const z=K=>{R.value=K.api,K.api.setColumnsVisible(m.value,!1),E.value=K.api.getAllGridColumns(),a("grid-ready",K)},U=K=>{R.value&&(I.value=R.value.getFilterModel()),a("filter-changed",K)},G=K=>K.getColId()&&K.getColId().includes("ag-Grid-AutoColumn"),V=K=>!K.getColDef().aggFunc,O=x.ref(!1),H=async()=>{if(O.value=!0,!R.value)return console.error("Grid API not available"),O.value=!1,null;try{const K=n.serverSideCsvHandler,oe=R.value?.getState(),de={rowGroupCols:[],valueCols:R.value?.getValueColumns().map(ce=>({id:ce.getId(),field:ce.getColDef().field,aggFunc:typeof ce.getColDef().aggFunc=="string"?ce.getColDef().aggFunc:void 0,displayName:ce.getColDef().headerName||ce.getColDef().field||""}))||[],filterModel:oe?.filter?.filterModel||{},sortModel:oe?.sort?.sortModel||[],pivotCols:[],pivotMode:!1,groupKeys:[],startRow:0,endRow:n.csvRowLimit};if(K){const ce={request:de,parentNode:{},api:R.value,context:void 0,success:()=>{},fail:()=>{}};return await n.serverSideCsvHandler(ce),O.value=!1,null}const re=n.serverSideRowHandler;return re?await new Promise((ce,be)=>{const Se=R.value?.getState(),Fe={request:de,parentNode:{},api:R.value,context:void 0,success:dt=>{const tt=R.value?.getRowGroupColumns().map(ps=>ps.getColDef().field).filter(ps=>!!ps)||[],At=R.value?.getAllDisplayedColumns().map(ps=>ps.getColDef().field).filter(ps=>!!ps)||[],Ue=R.value?.getValueColumns().map(ps=>ps.getColDef().field).filter(ps=>!!ps)||[],Tt=Array.from(new Set([...tt,...At,...Ue])),Gs=dt.rowData.map(ps=>{const Da={};return Tt.forEach(Lo=>{const _l=ps[Lo];Da[Lo]=_l!=null?String(_l):null}),Da}),ug=TTe.unparse(Gs);O.value=!1,ce(ug)},fail:()=>{O.value=!1,be("CSV export failed.")}};re(Fe,!0)}):(console.warn("Client-side export does not return CSV string"),O.value=!1,R.value.exportDataAsCsv(),null)}catch(K){return console.error("CSV export failed",K),O.value=!1,null}},B=K=>{const oe=_.value;if(m.value=[...K.api.getRowGroupColumns()].map(de=>de.getColId()),m.value.length>0){const de=K.api.getAllGridColumns().filter(re=>re.isVisible()&&!G(re)&&V(re)&&!m.value.includes(re.getColId()))[0];_.value=de,K.api.setColumnsVisible([de.getColId()],!1),j.value.headerName=de.getColDef().headerName}else _.value&&(_.value=null,j.value.headerName="");oe&&!m.value.includes(oe.getColId())&&K.api.setColumnsVisible([oe.getColId()],!0),a("column-row-group-changed",K)},Y=K=>{K.finished&&(E.value=K.api.getAllGridColumns()),a("column-moved",K)},q=K=>"allChildrenRowCount"in K&&K.allChildrenRowCount||0,Z=K=>{const oe=document.querySelector(`[data-horizontal-filter-field="${K}"]`);if(oe){const de=oe.querySelector("button");if(de)return de.click(),!0}return!1},ee=x.ref(QLe),se=x.ref({loadingMessage:"One moment please..."}),j=x.ref({headerName:"",minWidth:200,suppressMovable:!0,sortable:!1,pinned:"left",cellRendererParams:{suppressCount:!0,innerRenderer:nEe,innerRendererParams:K=>({displayBaseAggregationsOnly:n.displayBaseAggregationsOnly,displayRowNumber:n.displayRowNumber,displayCount:!1,formattedValue:K.valueFormatted,rowNode:K.node,api:R.value})}}),X=K=>{if(K.node.group)return{backgroundColor:"#F7F8F8"}},$={Median:K=>{const oe=K.values;if(K.rowNode.leafGroup){const ce=BB(oe);return{values:oe,value:ce}}const de=K.values.flatMap(ce=>ce.values||[]),re=BB(de);return{values:de,value:re}}};x.onBeforeMount(()=>{const K=Array.isArray(n.rowData)&&n.rowData.length>0,oe=typeof n.serverSideRowHandler=="function",de=typeof n.filterValuesSetHandler=="function";(K&&oe||K&&de)&&console.warn("Only one of `rowData` or `serverSideRowHandler + hasFilterValuesSetHandler` params should be provided to PvDataTable, not both."),u.value=re=>{const ce=["sortAscending","sortDescending","sortUnSort","rowUnGroup","valueAggSubMenu"],be=re.column&&G(re.column)?_.value:re.column;return be&&be.getColDef().filter&&ce.splice(2,0,p),ce.filter(Se=>typeof Se=="string"?re.defaultItems.includes(Se):!0)}});const J=K=>{I.value=K.filter?.filterModel||null,m.value=K.rowGroup?.groupColIds||[],b.value=!1,setTimeout(()=>{S.value=K,b.value=!0})};x.watch(()=>n.initialGridState,()=>{n.initialGridState&&J(n.initialGridState)},{deep:!0}),x.onMounted(()=>{n.initialGridState&&J(n.initialGridState)});const ie=K=>{C.value=!0,a("first-data-rendered",K)};t({getCsvData:H});const ne=K=>l?K.rowNode.level===m.value.length-2:!1;return(K,oe)=>(x.openBlock(),x.createElementBlock("div",{class:"pv-full-width",style:x.normalizeStyle(r.value)},[x.createElementVNode("div",QEe,[x.createElementVNode("div",JEe,[x.createVNode(GEe,{"enable-vertical-panel":K.enableVerticalFilterPanel},null,8,["enable-vertical-panel"]),x.createElementVNode("div",ePe,[K.enableGroupBySelector?(x.openBlock(),x.createBlock(YLe,{key:0})):x.createCommentVNode("",!0),K.enableCsvExport?(x.openBlock(),x.createBlock(XEe,{key:1,getCsvData:H})):x.createCommentVNode("",!0)])])]),x.createElementVNode("div",tPe,[b.value?(x.openBlock(),x.createBlock(x.unref(yIe),x.mergeProps({key:0,ref:"gridRef",style:{width:"100%",height:"100%"}},x.unref(l)?{serverSideDatasource:x.unref(l)}:{},{onColumnMoved:Y,onColumnRowGroupChanged:B,onFilterChanged:U,onFilterOpened:oe[0]||(oe[0]=de=>a("filter-opened",de)),onFirstDataRendered:ie,onGridReady:z,aggFuncs:$,autoGroupColumnDef:j.value,columnDefs:f.value,debug:K.debugMode,defaultColDef:x.unref(h),getChildCount:q,getMainMenuItems:u.value,getRowStyle:X,groupDefaultExpanded:x.unref(l)?void 0:1,groupDisplayType:"singleColumn",initialState:S.value,isServerSideGroupOpenByDefault:ne,loading:x.unref(l)?!1:K.isLoading,loadingCellRenderer:ee.value,loadingCellRendererParams:se.value,maxConcurrentDatasourceRequests:x.unref(l)?10:void 0,modules:s,rowData:K.rowData,rowModelType:x.unref(l)?"serverSide":"clientSide",serverSideInitialRowCount:x.unref(l)?1:void 0,showOpenedGroup:!0,suppressAggFuncInHeader:!0,suppressDragLeaveHidesColumns:!0,serverSideSortAllLevels:!1,serverSideEnableClientSideSort:!1,theme:K.theme,pagination:K.pagination,suppressPaginationPanel:!0,paginationPageSize:K.paginationPageSize,suppressScrollOnNewData:!0}),null,16,["autoGroupColumnDef","columnDefs","debug","defaultColDef","getMainMenuItems","groupDefaultExpanded","initialState","loading","loadingCellRenderer","loadingCellRendererParams","maxConcurrentDatasourceRequests","rowData","rowModelType","serverSideInitialRowCount","theme","pagination","paginationPageSize"])):x.createCommentVNode("",!0),A.value?x.createCommentVNode("",!0):(x.openBlock(),x.createElementBlock("p",iPe," Select a filter to view data. "))]),K.pagination?(x.openBlock(),x.createBlock(qEe,{key:0})):x.createCommentVNode("",!0)],4))}}),oPe={class:"pv-stack-16 pv-chart-options-panel"},nPe={key:0},rPe={class:"pv-flex"},aPe=x.defineComponent({__name:"PvChartOptionsPanel",props:{showPanel:{type:Boolean},chartFilter:{}},setup(e){const t=e,i=x.inject("activeChartType"),s=x.inject("chartTypes"),o=x.inject("sortTypes"),n=x.inject("activeSort"),r=x.inject("activeChartFilterOption"),a=x.computed(()=>{const c=[];return t.chartFilter&&t.chartFilter.options?t.chartFilter.options.map(d=>({label:d.label,value:d.value})):c}),l=x.computed(()=>["bar","line","column","area"].includes(i.value));return(c,d)=>(x.openBlock(),x.createElementBlock("div",oPe,[c.showPanel?(x.openBlock(),x.createElementBlock("div",nPe,[x.createElementVNode("div",{class:"pv-flex pv-space-between",style:x.normalizeStyle(c.chartFilter?{"--flex-justify":"flex-end"}:{})},[(x.openBlock(),x.createBlock(_Le,{key:0,options:a.value,modelValue:x.unref(r),"onUpdate:modelValue":d[0]||(d[0]=h=>x.isRef(r)?r.value=h:null)},null,8,["options","modelValue"])),x.createElementVNode("div",rPe,[x.createVNode(OB,{options:x.unref(o),modelValue:x.unref(n),"onUpdate:modelValue":d[1]||(d[1]=h=>x.isRef(n)?n.value=h:null),defaultText:"Sort By",disabled:!l.value},null,8,["options","modelValue","disabled"]),x.createVNode(OB,{options:x.unref(s),modelValue:x.unref(i),"onUpdate:modelValue":d[2]||(d[2]=h=>x.isRef(i)?i.value=h:null)},null,8,["options","modelValue"])])],4)])):x.createCommentVNode("",!0)]))}}),lPe={style:{height:"100%",width:"100%"}},cPe={class:"pv-relative pv-margin-auto"},dPe={key:0,class:"pv-chart-overlay pv-text-body-xs"},hPe=x.defineComponent({__name:"PvDataTableWithChart",props:{enabledChartTypes:{default:()=>["column","bar","line","area","pie"]},overrideChartData:{type:Boolean,default:!1},showSeriesLabels:{type:Boolean,default:!0},showSeriesLabelsWhenStacked:{type:Boolean,default:!1},initialChartData:{},chartFilter:{},chartType:{default:"column"},yKey:{default:""},colDefs:{},rowData:{},serverSideRowHandler:{},filterValuesSetHandler:{},initialGridState:{default:()=>({})},theme:{},displayBaseAggregationsOnly:{type:Boolean,default:!1},displayRowNumber:{type:Boolean,default:!0},enableVerticalFilterPanel:{type:Boolean,default:!0},enableColumnVisibilitySelector:{type:Boolean,default:!0},enableGroupBySelector:{type:Boolean,default:!0},enableCsvExport:{type:Boolean,default:!1},csvRowLimit:{},serverSideCsvHandler:{},uniqueRowIdField:{},requireFiltersToShowData:{type:Boolean,default:!1},isLoading:{type:Boolean},containerHeight:{},containerMinHeight:{},debugMode:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{}},emits:["chart-data-updated","column-moved","column-resized","column-row-group-changed","grid-ready","filter-changed","filter-opened","first-data-rendered"],setup(e,{expose:t,emit:i}){const s=e,o=i,n=x.ref(null),r=x.ref(null),a=j=>{n.value=j.api},l=j=>{f.value=[...j.api.getRowGroupColumns()],z(j.api),V(j.api),o("column-row-group-changed",j)},c=async j=>{if(s.chartFilter){const $=(await j.api.getColumnFilterInstance(s.chartFilter.colId))?.getModel();R.value=$?.values?.[0]||""}V(j.api),o("filter-changed",j)},d=x.ref([]),h=j=>{if(!j||!n.value)return;const X=n.value?.getColumnDef(j);if(X&&X.valueFormatter)return X.valueFormatter},u=x.ref([{label:"Column",value:"column",iconName:"chart-column",iconPosition:"left"},{label:"Bar",value:"bar",iconName:"chart-bar",iconPosition:"left"},{label:"Line",value:"line",iconName:"chart-line",iconPosition:"left"},{label:"Area",value:"area",iconName:"chart-area",iconPosition:"left"},{label:"Pie",value:"pie",iconName:"chart-pie",iconPosition:"left"}]),p=x.ref(s.chartType),g=x.ref([{label:"Lowest to Highest",value:"asc",iconName:"arrow-up-wide-narrow",iconPosition:"left"},{label:"Highest to Lowest",value:"desc",iconName:"arrow-down-narrow-wide",iconPosition:"left"}]),f=x.ref([]),y=x.ref([]),m=x.ref([]),C=x.ref("provider_name"),b=x.computed(()=>s.yKey),S=x.ref(null),A=x.ref(""),R=x.ref("");x.provide("activeChartFilterOption",R),x.provide("chartTypes",u),x.provide("sortTypes",g),x.provide("activeChartType",p),x.provide("activeSeries",b),x.provide("activeSort",A),x.watch(R,j=>{if(s.chartFilter&&n.value){const X=s.chartFilter.colId;let $=s.chartFilter.options.find(J=>J.value===j)?.filterValues||null;$&&$.length===0&&($=null),n.value.setColumnFilterModel(X,{values:$}).then(()=>{n.value?.onFilterChanged()})}});const I=x.computed(()=>{const j=d.value.find(X=>X.value===b.value);return j?j.label:""}),w=x.computed(()=>{const j=d.value.find(X=>X.value===b.value);return j&&j.dataType==="currency"}),M=x.computed(()=>p.value==="bar"),T=x.computed(()=>S.value&&S.value.fieldName&&S.value.fieldValues&&S.value.fieldValues.length>0&&["column","bar","line","area"].includes(p.value)),E=(j,X)=>`${j}_${X}`,P=x.computed(()=>{if(d.value.length===0)return[];const j=p.value==="column"?"bar":p.value;return["bar","line","area"].includes(j)?_.value:j==="pie"?W.value:(console.error("Unsupported chart type",j),[])}),N=x.computed(()=>y.value&&y.value.length>15?!1:w.value&&T.value?s.showSeriesLabels&&s.showSeriesLabelsWhenStacked:s.showSeriesLabels),F=j=>{const X=j.datum[j.xKey],$=j.yKey;let J=j.datum[$];const ie=h($);return ie&&typeof ie=="function"&&(J=ie({value:J})),{heading:X,data:[{label:I.value,value:J}]}},_=x.computed(()=>{const j=p.value==="column"?"bar":p.value;let X=[];const $=h(b.value),J=h(S.value?.fieldName);if(T.value)S.value?.fieldValues.forEach(K=>{const oe={type:j,xKey:C.value,yKey:E(b.value,K),yName:typeof J=="function"?J({value:K}):K,stacked:w.value,label:{enabled:N.value,color:"black",fontWeight:"bold",fontFamily:"Inter",padding:5,placement:"outside-end",formatter:$}};X.push(oe)});else{const ne={type:j,xKey:C.value,yKey:b.value,tooltip:{renderer:F},label:{enabled:N.value,color:"black",fontWeight:"bold",fontFamily:"Inter",padding:5,placement:"outside-end",formatter:h(b.value)}};X.push(ne)}let ie={};if(j==="column"||j==="bar"){const ne=ie;ne.direction=M.value?"horizontal":"vertical",ie=ne}else if(j==="line"||j==="area"){const ne=ie;ne.connectMissingData=!0,ie=ne}return X=X.map(ne=>({...ne,...ie})),X}),W=x.computed(()=>d.value.length===0?[]:[{type:"pie",legendItemKey:C.value,angleKey:b.value}]),z=j=>{const X=j.getAllGridColumns().filter($=>$.getAggFunc()!==null&&$.getAggFunc()!==void 0);C.value=f.value[0]?.getColId()||"",d.value=X.map($=>{const J=$.getColId(),ie=$.getColDef();return{label:ie.headerName||J,value:J,formatter:ie.valueFormatter,dataType:ie.context?.dataType}})};x.watch([b,P],([j,X])=>{const $=d.value.filter(J=>J.value!==j).map(J=>J.value);n.value&&(n.value.setColumnsVisible($,!1),n.value.setColumnsVisible([b.value],!0),o("chart-data-updated",{state:null,visualData:null,chartSeries:X}))});const U=()=>{y.value=[],m.value=[],S.value=null},G=(j,X,$)=>{if(!X||X.length===0){U();return}if($){const J=C.value,ie=new Set;X.forEach(K=>{const oe=K[$];ie.add(oe)});const ne=X.reduce((K,oe)=>{const de=oe[J];K[de]||(K[de]={});const re=oe[$];for(const ce of d.value){const be=ce.value;let Se=K[`${be}_sort_total`]||0;const Fe=oe[be];ie.add(re),$&&Fe&&(K[de][E(be,re)]=Fe,Se=Se+Fe),K[de][`${be}_sort_total`]=Se}return K},{});m.value=Object.keys(ne).map(K=>({[J]:K,...ne[K]})),S.value={fieldName:$,fieldValues:Array.from(ie)}}else m.value=[],S.value=null;y.value=X,o("chart-data-updated",{state:j.getState(),visualData:X,chartSeries:P.value})},V=j=>{if(s.overrideChartData)return;const X=f.value.length;if(U(),X===0||d.value.length===0)return;const $=[],J=[];let ie=new Set;if(j.forEachNodeAfterFilterAndSort(ne=>{if(ne.group&&ne.level===0){if(f.value.length>1){const oe=ne.childrenAfterFilter?.filter(ce=>ce.level===1&&ce.aggData)||[],{rowData:de,fieldValues:re}=H(ne,oe);ie=ie.union(re),J?.push(de)}const K=O(ne);$?.push(K)}}),y.value=$,f.value.length>1&&J&&J.length>0){const ne=f.value[1].getColId();m.value=J,S.value={fieldName:ne,fieldValues:Array.from(ie)}}else m.value=[],S.value=null},O=j=>{const X={[j.field]:j.key};for(const $ of d.value)!j.aggData||!j.aggData[$.value]||(X[$.value]=j.aggData[$.value]?.value??j.aggData[$.value]);return X},H=(j,X)=>{const $=new Set,J={[j.field]:j.key};let ie=0;for(const ne of d.value)X.forEach(K=>{const oe=K.key;$.add(oe);const de=K.aggData;if(oe&&de){const re=K.aggData[ne.value]?.value??K.aggData[ne.value];J[E(ne.value,oe)]=re,ie=ie+re}}),J[`${ne.value}_sort_total`]=ie;return{rowData:J,fieldValues:$}},B=x.computed(()=>{let j=T.value?m.value:y.value,X=null;if(A.value&&(X=T.value?`${b.value}_sort_total`:b.value),X&&j){const $=A.value.includes("desc")?-1:1;j=[...j].sort((J,ie)=>{const ne=J[X]||0,K=ie[X]||0;return(ne-K)*$})}if(j&&j.length===1){const $="",J=" ";j=[{[C.value]:$},j[0],{[C.value]:J}]}return j}),Y=x.computed(()=>{const j=B.value?.length||0,X=.05,$=.75,ne=.25*Math.exp(-.12*j);return Math.min(Math.max(ne,X),$)}),q=x.computed(()=>1),Z=x.computed(()=>.1),ee=x.computed(()=>f.value.length===0?"No groups selected. Select at least one group to display data.":B.value&&B.value?.length===0?"No data available to chart.":""),se=x.computed(()=>{const j={};return j.overlays={noData:{text:""}},j.data=B.value,j.axes=[{type:"category",position:M.value?"left":"bottom",label:{formatter:h(C.value)},paddingInner:Y.value,paddingOuter:q.value,groupPaddingInner:Z.value},{type:"number",position:M.value?"bottom":"left",label:{formatter:h(b.value)},title:{enabled:!0,text:I.value}}],j.series=P.value,j});return t({provideChartData:G,getCsvData:()=>r.value?.getCsvData()}),(j,X)=>(x.openBlock(),x.createElementBlock("div",lPe,[x.createVNode(aPe,{showPanel:B.value!=null&&B.value.length>0,chartFilter:j.chartFilter},null,8,["showPanel","chartFilter"]),x.createElementVNode("div",cPe,[x.createVNode(ej,{isLoading:j.isLoading,options:se.value},null,8,["isLoading","options"]),!j.isLoading&&ee.value!==""?(x.openBlock(),x.createElementBlock("p",dPe,x.toDisplayString(ee.value),1)):x.createCommentVNode("",!0)]),x.createVNode(sPe,x.mergeProps({ref_key:"pvDataTableRef",ref:r},j.$props,{onColumnRowGroupChanged:l,onGridReady:a,onFilterChanged:c,onFilterOpened:X[0]||(X[0]=$=>o("filter-opened",$)),onFirstDataRendered:X[1]||(X[1]=$=>o("first-data-rendered",$)),onColumnMoved:X[2]||(X[2]=$=>o("column-moved",$)),onColumnResized:X[3]||(X[3]=$=>o("column-resized",$))}),null,16)]))}});exports.PvChart=ej;exports.PvDataTableWithChart=hPe;