@nebula.js/sn-pivot-table 4.4.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-pivot-table v4.4.
|
|
2
|
+
* @nebula.js/sn-pivot-table v4.4.1
|
|
3
3
|
* Copyright (c) 2025 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -173,4 +173,4 @@ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,p=e.le
|
|
|
173
173
|
}
|
|
174
174
|
`),Zk.rippleVisible,oR,550,(({theme:e})=>e.transitions.easing.easeInOut),Zk.ripplePulsate,(({theme:e})=>e.transitions.duration.shorter),Zk.child,Zk.childLeaving,aR,550,(({theme:e})=>e.transitions.easing.easeInOut),Zk.childPulsate,sR,(({theme:e})=>e.transitions.easing.easeInOut)),uR=e.forwardRef((function(t,n){const r=Vk({props:t,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:a}=r,s=bn(r,Qk),[l,c]=e.useState([]),u=e.useRef(0),d=e.useRef(null);e.useEffect((()=>{d.current&&(d.current(),d.current=null)}),[l]);const p=e.useRef(!1),h=Db(),f=e.useRef(null),m=e.useRef(null),g=e.useCallback((e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:i,cb:a}=e;c((e=>[...e,Hn.jsx(cR,{classes:{ripple:ls(o.ripple,Zk.ripple),rippleVisible:ls(o.rippleVisible,Zk.rippleVisible),ripplePulsate:ls(o.ripplePulsate,Zk.ripplePulsate),child:ls(o.child,Zk.child),childLeaving:ls(o.childLeaving,Zk.childLeaving),childPulsate:ls(o.childPulsate,Zk.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:i},u.current)])),u.current+=1,d.current=a}),[o]),y=e.useCallback(((e={},t={},n=()=>{})=>{const{pulsate:r=!1,center:o=i||t.pulsate,fakeElement:a=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&p.current)return void(p.current=!1);"touchstart"===(null==e?void 0:e.type)&&(p.current=!0);const s=a?null:m.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,u,d;if(o||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),u=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),u=Math.round(n-l.top)}if(o)d=Math.sqrt((2*l.width**2+l.height**2)/3),d%2==0&&(d+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-u),u)+2;d=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===f.current&&(f.current=()=>{g({pulsate:r,rippleX:c,rippleY:u,rippleSize:d,cb:n})},h.start(80,(()=>{f.current&&(f.current(),f.current=null)}))):g({pulsate:r,rippleX:c,rippleY:u,rippleSize:d,cb:n})}),[i,g,h]),b=e.useCallback((()=>{y({},{pulsate:!0})}),[y]),v=e.useCallback(((e,t)=>{if(h.clear(),"touchend"===(null==e?void 0:e.type)&&f.current)return f.current(),f.current=null,void h.start(0,(()=>{v(e,t)}));f.current=null,c((e=>e.length>0?e.slice(1):e)),d.current=t}),[h]);return e.useImperativeHandle(n,(()=>({pulsate:b,start:y,stop:v})),[b,y,v]),Hn.jsx(lR,dn({className:ls(Zk.root,o.root,a),ref:m},s,{children:Hn.jsx(gu,{component:null,exit:!0,children:l})}))}));function dR(e){return ub("MuiButtonBase",e)}const pR=db("MuiButtonBase",["root","disabled","focusVisible"]),hR=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],fR=pw("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${pR.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),mR=e.forwardRef((function(t,n){const r=Vk({props:t,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:a,className:s,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:p=!1,LinkComponent:h="a",onBlur:f,onClick:m,onContextMenu:g,onDragLeave:y,onFocus:b,onFocusVisible:v,onKeyDown:x,onKeyUp:w,onMouseDown:S,onMouseLeave:E,onMouseUp:C,onTouchEnd:M,onTouchMove:_,onTouchStart:k,tabIndex:R=0,TouchRippleProps:A,touchRippleRef:I,type:L}=r,D=bn(r,hR),P=e.useRef(null),O=e.useRef(null),T=Rb(O,I),{isFocusVisibleRef:N,onFocus:q,onBlur:F,ref:j}=Bb(),[z,B]=e.useState(!1);c&&z&&B(!1),e.useImperativeHandle(i,(()=>({focusVisible:()=>{B(!0),P.current.focus()}})),[]);const[W,$]=e.useState(!1);e.useEffect((()=>{$(!0)}),[]);const H=W&&!u&&!c;function V(e,t,n=d){return kb((r=>{t&&t(r);return!n&&O.current&&O.current[e](r),!0}))}e.useEffect((()=>{z&&p&&!u&&W&&O.current.pulsate()}),[u,p,z,W]);const G=V("start",S),U=V("stop",g),Y=V("stop",y),K=V("stop",C),X=V("stop",(e=>{z&&e.preventDefault(),E&&E(e)})),J=V("start",k),Z=V("stop",M),Q=V("stop",_),ee=V("stop",(e=>{F(e),!1===N.current&&B(!1),f&&f(e)}),!1),te=kb((e=>{P.current||(P.current=e.currentTarget),q(e),!0===N.current&&(B(!0),v&&v(e)),b&&b(e)})),ne=()=>{const e=P.current;return l&&"button"!==l&&!("A"===e.tagName&&e.href)},re=e.useRef(!1),ie=kb((e=>{p&&!re.current&&z&&O.current&&" "===e.key&&(re.current=!0,O.current.stop(e,(()=>{O.current.start(e)}))),e.target===e.currentTarget&&ne()&&" "===e.key&&e.preventDefault(),x&&x(e),e.target===e.currentTarget&&ne()&&"Enter"===e.key&&!c&&(e.preventDefault(),m&&m(e))})),oe=kb((e=>{p&&" "===e.key&&O.current&&z&&!e.defaultPrevented&&(re.current=!1,O.current.stop(e,(()=>{O.current.pulsate(e)}))),w&&w(e),m&&e.target===e.currentTarget&&ne()&&" "===e.key&&!e.defaultPrevented&&m(e)}));let ae=l;"button"===ae&&(D.href||D.to)&&(ae=h);const se={};"button"===ae?(se.type=void 0===L?"button":L,se.disabled=c):(D.href||D.to||(se.role="button"),c&&(se["aria-disabled"]=c));const le=Rb(n,j,P),ce=dn({},r,{centerRipple:o,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:p,tabIndex:R,focusVisible:z}),ue=(e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,o=$b({root:["root",t&&"disabled",n&&"focusVisible"]},dR,i);return n&&r&&(o.root+=` ${r}`),o})(ce);return Hn.jsxs(fR,dn({as:ae,className:ls(ue.root,s),ownerState:ce,onBlur:ee,onClick:m,onContextMenu:U,onFocus:te,onKeyDown:ie,onKeyUp:oe,onMouseDown:G,onMouseLeave:X,onMouseUp:K,onDragLeave:Y,onTouchEnd:Z,onTouchMove:Q,onTouchStart:J,ref:le,tabIndex:c?-1:R,type:L},se,D,{children:[a,H?Hn.jsx(uR,dn({ref:T,center:o},A)):null]}))}));function gR(e){return ub("MuiTypography",e)}db("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const yR=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],bR=pw("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${ny(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})((({theme:e,ownerState:t})=>dn({margin:0},"inherit"===t.variant&&{font:"inherit"},"inherit"!==t.variant&&e.typography[t.variant],"inherit"!==t.align&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16}))),vR={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},xR={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},wR=e.forwardRef((function(e,t){const n=Vk({props:e,name:"MuiTypography"}),r=(e=>xR[e]||e)(n.color),i=ib(dn({},n,{color:r})),{align:o="inherit",className:a,component:s,gutterBottom:l=!1,noWrap:c=!1,paragraph:u=!1,variant:d="body1",variantMapping:p=vR}=i,h=bn(i,yR),f=dn({},i,{align:o,color:r,className:a,component:s,gutterBottom:l,noWrap:c,paragraph:u,variant:d,variantMapping:p}),m=s||(u?"p":p[d]||vR[d])||"span",g=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:a}=e;return $b({root:["root",o,"inherit"!==e.align&&`align${ny(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]},gR,a)})(f);return Hn.jsx(bR,dn({as:m,ref:t,ownerState:f,className:ls(g.root,a)},h))}));const SR=e.forwardRef((function(t,n){const{children:r,container:i,disablePortal:o=!1}=t,[a,s]=e.useState(null),l=Rb(e.isValidElement(r)?Kb(r):null,n);if(bb((()=>{o||s(function(e){return"function"==typeof e?e():e}(i)||document.body)}),[i,o]),bb((()=>{if(a&&!o)return _b(n,a),()=>{_b(n,null)}}),[n,a,o]),o){if(e.isValidElement(r)){const t={ref:l};return e.cloneElement(r,t)}return Hn.jsx(e.Fragment,{children:r})}return Hn.jsx(e.Fragment,{children:a?q.createPortal(r,a):a})})),ER=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],CR={entering:{opacity:1},entered:{opacity:1}},MR=e.forwardRef((function(t,n){const r=Tx(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:s,easing:l,in:c,onEnter:u,onEntered:d,onEntering:p,onExit:h,onExited:f,onExiting:m,style:g,timeout:y=i,TransitionComponent:b=uu}=t,v=bn(t,ER),x=e.useRef(null),w=Rb(x,Kb(s),n),S=e=>t=>{if(e){const n=x.current;void 0===t?e(n):e(n,t)}},E=S(p),C=S(((e,t)=>{Gk(e);const n=Uk({style:g,timeout:y,easing:l},{mode:"enter"});e.style.webkitTransition=r.transitions.create("opacity",n),e.style.transition=r.transitions.create("opacity",n),u&&u(e,t)})),M=S(d),_=S(m),k=S((e=>{const t=Uk({style:g,timeout:y,easing:l},{mode:"exit"});e.style.webkitTransition=r.transitions.create("opacity",t),e.style.transition=r.transitions.create("opacity",t),h&&h(e)})),R=S(f);return Hn.jsx(b,dn({appear:a,in:c,nodeRef:x,onEnter:C,onEntered:M,onEntering:E,onExit:k,onExited:R,onExiting:_,addEndListener:e=>{o&&o(x.current,e)},timeout:y},v,{children:(t,n)=>e.cloneElement(s,dn({style:dn({opacity:0,visibility:"exited"!==t||c?void 0:"hidden"},CR[t],g,s.props.style),ref:w},n))}))}));function _R(e){return ub("MuiBackdrop",e)}db("MuiBackdrop",["root","invisible"]);const kR=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],RR=pw("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})((({ownerState:e})=>dn({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"}))),AR=e.forwardRef((function(e,t){var n,r,i;const o=Vk({props:e,name:"MuiBackdrop"}),{children:a,className:s,component:l="div",components:c={},componentsProps:u={},invisible:d=!1,open:p,slotProps:h={},slots:f={},TransitionComponent:m=MR,transitionDuration:g}=o,y=bn(o,kR),b=dn({},o,{component:l,invisible:d}),v=(e=>{const{classes:t,invisible:n}=e;return $b({root:["root",n&&"invisible"]},_R,t)})(b),x=null!=(n=h.root)?n:u.root;return Hn.jsx(m,dn({in:p,timeout:g},y,{children:Hn.jsx(RR,dn({"aria-hidden":!0},x,{as:null!=(r=null!=(i=f.root)?i:c.Root)?r:l,className:ls(v.root,s,null==x?void 0:x.className),ownerState:dn({},b,null==x?void 0:x.ownerState),classes:v,ref:t,children:a}))}))})),IR=db("MuiBox",["root"]),LR=Px(),DR=function(t={}){const{themeId:n,defaultTheme:r,defaultClassName:i="MuiBox-root",generateClassName:o}=t,a=_a("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(Ky),s=e.forwardRef((function(e,t){const s=nb(r),l=ib(e),{className:c,component:u="div"}=l,d=bn(l,lb);return Hn.jsx(a,dn({as:u,ref:t,className:ls(c,o?o(i):i),theme:n&&s[n]||s},d))}));return s}({themeId:Hg,defaultTheme:LR,defaultClassName:IR.root,generateClassName:sb.generate});function PR(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function OR(e){return parseInt(Mb(e).getComputedStyle(e).paddingRight,10)||0}function TR(e,t,n,r,i){const o=[t,n,...r];[].forEach.call(e.children,(e=>{const t=-1===o.indexOf(e),n=!function(e){const t=-1!==["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||n}(e);t&&n&&PR(e,i)}))}function NR(e,t){let n=-1;return e.some(((e,r)=>!!t(e)&&(n=r,!0))),n}function qR(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(function(e){const t=Cb(e);return t.body===e?Mb(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(r)){const e=Wb(Cb(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${OR(r)+e}px`;const t=Cb(r).querySelectorAll(".mui-fixed");[].forEach.call(t,(t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${OR(t)+e}px`}))}let e;if(r.parentNode instanceof DocumentFragment)e=Cb(r).body;else{const t=r.parentElement,n=Mb(r);e="HTML"===(null==t?void 0:t.nodeName)&&"scroll"===n.getComputedStyle(t).overflowY?t:r}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach((({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)}))}}const FR=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function jR(e){const t=[],n=[];return Array.from(e.querySelectorAll(FR)).forEach(((e,r)=>{const i=function(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1!==i&&function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type)return!1;if(!e.name)return!1;const t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}(e))}(e)&&(0===i?t.push(e):n.push({documentOrder:r,tabIndex:i,node:e}))})),n.sort(((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex)).map((e=>e.node)).concat(t)}function zR(){return!0}function BR(t){const{children:n,disableAutoFocus:r=!1,disableEnforceFocus:i=!1,disableRestoreFocus:o=!1,getTabbable:a=jR,isEnabled:s=zR,open:l}=t,c=e.useRef(!1),u=e.useRef(null),d=e.useRef(null),p=e.useRef(null),h=e.useRef(null),f=e.useRef(!1),m=e.useRef(null),g=Rb(Kb(n),m),y=e.useRef(null);e.useEffect((()=>{l&&m.current&&(f.current=!r)}),[r,l]),e.useEffect((()=>{if(!l||!m.current)return;const e=Cb(m.current);return m.current.contains(e.activeElement)||(m.current.hasAttribute("tabIndex")||m.current.setAttribute("tabIndex","-1"),f.current&&m.current.focus()),()=>{o||(p.current&&p.current.focus&&(c.current=!0,p.current.focus()),p.current=null)}}),[l]),e.useEffect((()=>{if(!l||!m.current)return;const e=Cb(m.current),t=t=>{y.current=t,!i&&s()&&"Tab"===t.key&&e.activeElement===m.current&&t.shiftKey&&(c.current=!0,d.current&&d.current.focus())},n=()=>{const t=m.current;if(null===t)return;if(!e.hasFocus()||!s()||c.current)return void(c.current=!1);if(t.contains(e.activeElement))return;if(i&&e.activeElement!==u.current&&e.activeElement!==d.current)return;if(e.activeElement!==h.current)h.current=null;else if(null!==h.current)return;if(!f.current)return;let n=[];if(e.activeElement!==u.current&&e.activeElement!==d.current||(n=a(m.current)),n.length>0){var r,o;const e=Boolean((null==(r=y.current)?void 0:r.shiftKey)&&"Tab"===(null==(o=y.current)?void 0:o.key)),t=n[0],i=n[n.length-1];"string"!=typeof t&&"string"!=typeof i&&(e?i.focus():t.focus())}else t.focus()};e.addEventListener("focusin",n),e.addEventListener("keydown",t,!0);const r=setInterval((()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&n()}),50);return()=>{clearInterval(r),e.removeEventListener("focusin",n),e.removeEventListener("keydown",t,!0)}}),[r,i,o,s,l,a]);const b=e=>{null===p.current&&(p.current=e.relatedTarget),f.current=!0};return Hn.jsxs(e.Fragment,{children:[Hn.jsx("div",{tabIndex:l?0:-1,onFocus:b,ref:u,"data-testid":"sentinelStart"}),e.cloneElement(n,{ref:g,onFocus:e=>{null===p.current&&(p.current=e.relatedTarget),f.current=!0,h.current=e.target;const t=n.props.onFocus;t&&t(e)}}),Hn.jsx("div",{tabIndex:l?0:-1,onFocus:b,ref:d,"data-testid":"sentinelEnd"})]})}const WR=new class{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&PR(e.modalRef,!1);const r=function(e){const t=[];return[].forEach.call(e.children,(e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);TR(t,e.mount,e.modalRef,r,!0);const i=NR(this.containers,(e=>e.container===t));return-1!==i?(this.containers[i].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n)}mount(e,t){const n=NR(this.containers,(t=>-1!==t.modals.indexOf(e))),r=this.containers[n];r.restore||(r.restore=qR(r,t))}remove(e,t=!0){const n=this.modals.indexOf(e);if(-1===n)return n;const r=NR(this.containers,(t=>-1!==t.modals.indexOf(e))),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),0===i.modals.length)i.restore&&i.restore(),e.modalRef&&PR(e.modalRef,t),TR(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{const e=i.modals[i.modals.length-1];e.modalRef&&PR(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};function $R(t){const{container:n,disableEscapeKeyDown:r=!1,disableScrollLock:i=!1,manager:o=WR,closeAfterTransition:a=!1,onTransitionEnter:s,onTransitionExited:l,children:c,onClose:u,open:d,rootRef:p}=t,h=e.useRef({}),f=e.useRef(null),m=e.useRef(null),g=Rb(m,p),[y,b]=e.useState(!d),v=function(e){return!!e&&e.props.hasOwnProperty("in")}(c);let x=!0;"false"!==t["aria-hidden"]&&!1!==t["aria-hidden"]||(x=!1);const w=()=>(h.current.modalRef=m.current,h.current.mount=f.current,h.current),S=()=>{o.mount(w(),{disableScrollLock:i}),m.current&&(m.current.scrollTop=0)},E=kb((()=>{const e=function(e){return"function"==typeof e?e():e}(n)||Cb(f.current).body;o.add(w(),e),m.current&&S()})),C=e.useCallback((()=>o.isTopModal(w())),[o]),M=kb((e=>{f.current=e,e&&(d&&C()?S():m.current&&PR(m.current,x))})),_=e.useCallback((()=>{o.remove(w(),x)}),[x,o]);e.useEffect((()=>()=>{_()}),[_]),e.useEffect((()=>{d?E():v&&a||_()}),[d,_,v,a,E]);const k=e=>t=>{var n;null==(n=e.onKeyDown)||n.call(e,t),"Escape"===t.key&&229!==t.which&&C()&&(r||(t.stopPropagation(),u&&u(t,"escapeKeyDown")))},R=e=>t=>{var n;null==(n=e.onClick)||n.call(e,t),t.target===t.currentTarget&&u&&u(t,"backdropClick")};return{getRootProps:(e={})=>{const n=Vb(t);delete n.onTransitionEnter,delete n.onTransitionExited;const r=dn({},n,e);return dn({role:"presentation"},r,{onKeyDown:k(r),ref:g})},getBackdropProps:(e={})=>dn({"aria-hidden":!0},e,{onClick:R(e),open:d}),getTransitionProps:()=>({onEnter:Eb((()=>{b(!1),s&&s()}),null==c?void 0:c.props.onEnter),onExited:Eb((()=>{b(!0),l&&l(),a&&_()}),null==c?void 0:c.props.onExited)}),rootRef:g,portalRef:M,isTopModal:C,exited:y,hasTransition:v}}function HR(e){return ub("MuiModal",e)}db("MuiModal",["root","hidden","backdrop"]);const VR=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],GR=pw("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})((({theme:e,ownerState:t})=>dn({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"}))),UR=pw(AR,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),YR=e.forwardRef((function(t,n){var r,i,o,a,s,l;const c=Vk({name:"MuiModal",props:t}),{BackdropComponent:u=UR,BackdropProps:d,className:p,closeAfterTransition:h=!1,children:f,container:m,component:g,components:y={},componentsProps:b={},disableAutoFocus:v=!1,disableEnforceFocus:x=!1,disableEscapeKeyDown:w=!1,disablePortal:S=!1,disableRestoreFocus:E=!1,disableScrollLock:C=!1,hideBackdrop:M=!1,keepMounted:_=!1,onBackdropClick:k,open:R,slotProps:A,slots:I}=c,L=bn(c,VR),D=dn({},c,{closeAfterTransition:h,disableAutoFocus:v,disableEnforceFocus:x,disableEscapeKeyDown:w,disablePortal:S,disableRestoreFocus:E,disableScrollLock:C,hideBackdrop:M,keepMounted:_}),{getRootProps:P,getBackdropProps:O,getTransitionProps:T,portalRef:N,isTopModal:q,exited:F,hasTransition:j}=$R(dn({},D,{rootRef:n})),z=dn({},D,{exited:F}),B=(e=>{const{open:t,exited:n,classes:r}=e;return $b({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},HR,r)})(z),W={};if(void 0===f.props.tabIndex&&(W.tabIndex="-1"),j){const{onEnter:e,onExited:t}=T();W.onEnter=e,W.onExited=t}const $=null!=(r=null!=(i=null==I?void 0:I.root)?i:y.Root)?r:GR,H=null!=(o=null!=(a=null==I?void 0:I.backdrop)?a:y.Backdrop)?o:u,V=null!=(s=null==A?void 0:A.root)?s:b.root,G=null!=(l=null==A?void 0:A.backdrop)?l:b.backdrop,U=Yb({elementType:$,externalSlotProps:V,externalForwardedProps:L,getSlotProps:P,additionalProps:{ref:n,as:g},ownerState:z,className:ls(p,null==V?void 0:V.className,null==B?void 0:B.root,!z.open&&z.exited&&(null==B?void 0:B.hidden))}),Y=Yb({elementType:H,externalSlotProps:G,additionalProps:d,getSlotProps:e=>O(dn({},e,{onClick:t=>{k&&k(t),null!=e&&e.onClick&&e.onClick(t)}})),className:ls(null==G?void 0:G.className,null==d?void 0:d.className,null==B?void 0:B.backdrop),ownerState:z});return _||R||j&&!F?Hn.jsx(SR,{ref:N,container:m,disablePortal:S,children:Hn.jsxs($,dn({},U,{children:[!M&&u?Hn.jsx(H,dn({},Y)):null,Hn.jsx(BR,{disableEnforceFocus:x,disableAutoFocus:v,disableRestoreFocus:E,isEnabled:q,open:R,children:e.cloneElement(f,W)})]}))}):null})),KR=db("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),XR=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function JR(e){return`scale(${e}, ${e**2})`}const ZR={entering:{opacity:1,transform:JR(1)},entered:{opacity:1,transform:"none"}},QR="undefined"!=typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),eA=e.forwardRef((function(t,n){const{addEndListener:r,appear:i=!0,children:o,easing:a,in:s,onEnter:l,onEntered:c,onEntering:u,onExit:d,onExited:p,onExiting:h,style:f,timeout:m="auto",TransitionComponent:g=uu}=t,y=bn(t,XR),b=Db(),v=e.useRef(),x=Tx(),w=e.useRef(null),S=Rb(w,Kb(o),n),E=e=>t=>{if(e){const n=w.current;void 0===t?e(n):e(n,t)}},C=E(u),M=E(((e,t)=>{Gk(e);const{duration:n,delay:r,easing:i}=Uk({style:f,timeout:m,easing:a},{mode:"enter"});let o;"auto"===m?(o=x.transitions.getAutoHeightDuration(e.clientHeight),v.current=o):o=n,e.style.transition=[x.transitions.create("opacity",{duration:o,delay:r}),x.transitions.create("transform",{duration:QR?o:.666*o,delay:r,easing:i})].join(","),l&&l(e,t)})),_=E(c),k=E(h),R=E((e=>{const{duration:t,delay:n,easing:r}=Uk({style:f,timeout:m,easing:a},{mode:"exit"});let i;"auto"===m?(i=x.transitions.getAutoHeightDuration(e.clientHeight),v.current=i):i=t,e.style.transition=[x.transitions.create("opacity",{duration:i,delay:n}),x.transitions.create("transform",{duration:QR?i:.666*i,delay:QR?n:n||.333*i,easing:r})].join(","),e.style.opacity=0,e.style.transform=JR(.75),d&&d(e)})),A=E(p);return Hn.jsx(g,dn({appear:i,in:s,nodeRef:w,onEnter:M,onEntered:_,onEntering:C,onExit:R,onExited:A,onExiting:k,addEndListener:e=>{"auto"===m&&b.start(v.current||0,e),r&&r(w.current,e)},timeout:"auto"===m?null:m},y,{children:(t,n)=>e.cloneElement(o,dn({style:dn({opacity:0,transform:JR(.75),visibility:"exited"!==t||s?void 0:"hidden"},ZR[t],f,o.props.style),ref:S},n))}))}));function tA(e){return ub("MuiLink",e)}eA.muiSupportAuto=!0;const nA=db("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),rA={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},iA=({theme:e,ownerState:t})=>{const n=(e=>rA[e]||e)(t.color),r=iy(e,`palette.${n}`,!1)||t.color,i=iy(e,`palette.${n}Channel`);return"vars"in e&&i?`rgba(${i} / 0.4)`:gv(r,.4)},oA=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],aA=pw(wR,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`underline${ny(n.underline)}`],"button"===n.component&&t.button]}})((({theme:e,ownerState:t})=>dn({},"none"===t.underline&&{textDecoration:"none"},"hover"===t.underline&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},"always"===t.underline&&dn({textDecoration:"underline"},"inherit"!==t.color&&{textDecorationColor:iA({theme:e,ownerState:t})},{"&:hover":{textDecorationColor:"inherit"}}),"button"===t.component&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${nA.focusVisible}`]:{outline:"auto"}}))),sA=e.forwardRef((function(t,n){const r=Vk({props:t,name:"MuiLink"}),{className:i,color:o="primary",component:a="a",onBlur:s,onFocus:l,TypographyClasses:c,underline:u="always",variant:d="inherit",sx:p}=r,h=bn(r,oA),{isFocusVisibleRef:f,onBlur:m,onFocus:g,ref:y}=Bb(),[b,v]=e.useState(!1),x=Rb(n,y),w=dn({},r,{color:o,component:a,focusVisible:b,underline:u,variant:d}),S=(e=>{const{classes:t,component:n,focusVisible:r,underline:i}=e;return $b({root:["root",`underline${ny(i)}`,"button"===n&&"button",r&&"focusVisible"]},tA,t)})(w);return Hn.jsx(aA,dn({color:o,className:ls(S.root,i),classes:c,component:a,onBlur:e=>{m(e),!1===f.current&&v(!1),s&&s(e)},onFocus:e=>{g(e),!0===f.current&&v(!0),l&&l(e)},ref:x,ownerState:w,variant:d,sx:[...Object.keys(rA).includes(o)?[]:[{color:o}],...Array.isArray(p)?p:[p]]},h))})),lA=e.createContext({});function cA(e){return ub("MuiList",e)}db("MuiList",["root","padding","dense","subheader"]);const uA=["children","className","component","dense","disablePadding","subheader"],dA=pw("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})((({ownerState:e})=>dn({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0}))),pA=e.forwardRef((function(t,n){const r=Vk({props:t,name:"MuiList"}),{children:i,className:o,component:a="ul",dense:s=!1,disablePadding:l=!1,subheader:c}=r,u=bn(r,uA),d=e.useMemo((()=>({dense:s})),[s]),p=dn({},r,{component:a,dense:s,disablePadding:l}),h=(e=>{const{classes:t,disablePadding:n,dense:r,subheader:i}=e;return $b({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},cA,t)})(p);return Hn.jsx(lA.Provider,{value:d,children:Hn.jsxs(dA,dn({as:a,className:ls(h.root,o),ref:n,ownerState:p},u,{children:[c,i]}))})})),hA=db("MuiListItemIcon",["root","alignItemsFlexStart"]),fA=db("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),mA=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function gA(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function yA(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function bA(e,t){if(void 0===t)return!0;let n=e.innerText;return void 0===n&&(n=e.textContent),n=n.trim().toLowerCase(),0!==n.length&&(t.repeating?n[0]===t.keys[0]:0===n.indexOf(t.keys.join("")))}function vA(e,t,n,r,i,o){let a=!1,s=i(e,t,!!t&&n);for(;s;){if(s===e.firstChild){if(a)return!1;a=!0}const t=!r&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&bA(s,o)&&!t)return s.focus(),!0;s=i(e,s,n)}return!1}const xA=e.forwardRef((function(t,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:a,className:s,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:d="selectedMenu"}=t,p=bn(t,mA),h=e.useRef(null),f=e.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});bb((()=>{i&&h.current.focus()}),[i]),e.useImperativeHandle(r,(()=>({adjustStyleForScrollbar:(e,{direction:t})=>{const n=!h.current.style.width;if(e.clientHeight<h.current.clientHeight&&n){const n=`${Wb(Cb(e))}px`;h.current.style["rtl"===t?"paddingLeft":"paddingRight"]=n,h.current.style.width=`calc(100% + ${n})`}return h.current}})),[]);const m=Rb(h,n);let g=-1;e.Children.forEach(a,((t,n)=>{e.isValidElement(t)?(t.props.disabled||("selectedMenu"===d&&t.props.selected||-1===g)&&(g=n),g===n&&(t.props.disabled||t.props.muiSkipListHighlight||t.type.muiSkipListHighlight)&&(g+=1,g>=a.length&&(g=-1))):g===n&&(g+=1,g>=a.length&&(g=-1))}));const y=e.Children.map(a,((t,n)=>{if(n===g){const n={};return o&&(n.autoFocus=!0),void 0===t.props.tabIndex&&"selectedMenu"===d&&(n.tabIndex=0),e.cloneElement(t,n)}return t}));return Hn.jsx(pA,dn({role:"menu",ref:m,className:s,onKeyDown:e=>{const t=h.current,n=e.key,r=Cb(t).activeElement;if("ArrowDown"===n)e.preventDefault(),vA(t,r,c,l,gA);else if("ArrowUp"===n)e.preventDefault(),vA(t,r,c,l,yA);else if("Home"===n)e.preventDefault(),vA(t,null,c,l,gA);else if("End"===n)e.preventDefault(),vA(t,null,c,l,yA);else if(1===n.length){const i=f.current,o=n.toLowerCase(),a=performance.now();i.keys.length>0&&(a-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&o!==i.keys[0]&&(i.repeating=!1)),i.lastTime=a,i.keys.push(o);const s=r&&!i.repeating&&bA(r,i);i.previousKeyMatched&&(s||vA(t,r,!1,l,gA,i))?e.preventDefault():i.previousKeyMatched=!1}u&&u(e)},tabIndex:i?0:-1},p,{children:y}))}));function wA(e){return ub("MuiPopover",e)}db("MuiPopover",["root","paper"]);const SA=["onEntering"],EA=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],CA=["slotProps"];function MA(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function _A(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function kA(e){return[e.horizontal,e.vertical].map((e=>"number"==typeof e?`${e}px`:e)).join(" ")}function RA(e){return"function"==typeof e?e():e}const AA=pw(YR,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),IA=pw(Jk,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),LA=e.forwardRef((function(t,n){var r,i,o;const a=Vk({props:t,name:"MuiPopover"}),{action:s,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:d="anchorEl",children:p,className:h,container:f,elevation:m=8,marginThreshold:g=16,open:y,PaperProps:b={},slots:v,slotProps:x,transformOrigin:w={vertical:"top",horizontal:"left"},TransitionComponent:S=eA,transitionDuration:E="auto",TransitionProps:{onEntering:C}={},disableScrollLock:M=!1}=a,_=bn(a.TransitionProps,SA),k=bn(a,EA),R=null!=(r=null==x?void 0:x.paper)?r:b,A=e.useRef(),I=Rb(A,R.ref),L=dn({},a,{anchorOrigin:c,anchorReference:d,elevation:m,marginThreshold:g,externalPaperSlotProps:R,transformOrigin:w,TransitionComponent:S,transitionDuration:E,TransitionProps:_}),D=(e=>{const{classes:t}=e;return $b({root:["root"],paper:["paper"]},wA,t)})(L),P=e.useCallback((()=>{if("anchorPosition"===d)return u;const e=RA(l),t=(e&&1===e.nodeType?e:Cb(A.current).body).getBoundingClientRect();return{top:t.top+MA(t,c.vertical),left:t.left+_A(t,c.horizontal)}}),[l,c.horizontal,c.vertical,u,d]),O=e.useCallback((e=>({vertical:MA(e,w.vertical),horizontal:_A(e,w.horizontal)})),[w.horizontal,w.vertical]),T=e.useCallback((e=>{const t={width:e.offsetWidth,height:e.offsetHeight},n=O(t);if("none"===d)return{top:null,left:null,transformOrigin:kA(n)};const r=P();let i=r.top-n.vertical,o=r.left-n.horizontal;const a=i+t.height,s=o+t.width,c=Mb(RA(l)),u=c.innerHeight-g,p=c.innerWidth-g;if(null!==g&&i<g){const e=i-g;i-=e,n.vertical+=e}else if(null!==g&&a>u){const e=a-u;i-=e,n.vertical+=e}if(null!==g&&o<g){const e=o-g;o-=e,n.horizontal+=e}else if(s>p){const e=s-p;o-=e,n.horizontal+=e}return{top:`${Math.round(i)}px`,left:`${Math.round(o)}px`,transformOrigin:kA(n)}}),[l,d,P,O,g]),[N,q]=e.useState(y),F=e.useCallback((()=>{const e=A.current;if(!e)return;const t=T(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,q(!0)}),[T]);e.useEffect((()=>(M&&window.addEventListener("scroll",F),()=>window.removeEventListener("scroll",F))),[l,M,F]);e.useEffect((()=>{y&&F()})),e.useImperativeHandle(s,(()=>y?{updatePosition:()=>{F()}}:null),[y,F]),e.useEffect((()=>{if(!y)return;const e=function(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout((()=>{e.apply(this,r)}),t)}return r.clear=()=>{clearTimeout(n)},r}((()=>{F()})),t=Mb(l);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[l,y,F]);let j=E;"auto"!==E||S.muiSupportAuto||(j=void 0);const z=f||(l?Cb(RA(l)).body:void 0),B=null!=(i=null==v?void 0:v.root)?i:AA,W=null!=(o=null==v?void 0:v.paper)?o:IA,$=Yb({elementType:W,externalSlotProps:dn({},R,{style:N?R.style:dn({},R.style,{opacity:0})}),additionalProps:{elevation:m,ref:I},ownerState:L,className:ls(D.paper,null==R?void 0:R.className)}),H=Yb({elementType:B,externalSlotProps:(null==x?void 0:x.root)||{},externalForwardedProps:k,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:z,open:y},ownerState:L,className:ls(D.root,h)}),{slotProps:V}=H,G=bn(H,CA);return Hn.jsx(B,dn({},G,!Hb(B)&&{slotProps:V,disableScrollLock:M},{children:Hn.jsx(S,dn({appear:!0,in:y,onEntering:(e,t)=>{C&&C(e,t),F()},onExited:()=>{q(!1)},timeout:j},_,{children:Hn.jsx(W,dn({},$,{children:p}))}))}))}));function DA(e){return ub("MuiMenu",e)}db("MuiMenu",["root","paper","list"]);const PA=["onEntering"],OA=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],TA={vertical:"top",horizontal:"right"},NA={vertical:"top",horizontal:"left"},qA=pw(LA,{shouldForwardProp:e=>dw(e)||"classes"===e,name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),FA=pw(IA,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),jA=pw(xA,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),zA=e.forwardRef((function(t,n){var r,i;const o=Vk({props:t,name:"MuiMenu"}),{autoFocus:a=!0,children:s,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:d,open:p,PaperProps:h={},PopoverClasses:f,transitionDuration:m="auto",TransitionProps:{onEntering:g}={},variant:y="selectedMenu",slots:b={},slotProps:v={}}=o,x=bn(o.TransitionProps,PA),w=bn(o,OA),S=(()=>{const t=e.useContext(tv);return null!=t&&t})(),E=dn({},o,{autoFocus:a,disableAutoFocusItem:c,MenuListProps:u,onEntering:g,PaperProps:h,transitionDuration:m,TransitionProps:x,variant:y}),C=(e=>{const{classes:t}=e;return $b({root:["root"],paper:["paper"],list:["list"]},DA,t)})(E),M=a&&!c&&p,_=e.useRef(null);let k=-1;e.Children.map(s,((t,n)=>{e.isValidElement(t)&&(t.props.disabled||("selectedMenu"===y&&t.props.selected||-1===k)&&(k=n))}));const R=null!=(r=b.paper)?r:FA,A=null!=(i=v.paper)?i:h,I=Yb({elementType:b.root,externalSlotProps:v.root,ownerState:E,className:[C.root,l]}),L=Yb({elementType:R,externalSlotProps:A,ownerState:E,className:C.paper});return Hn.jsx(qA,dn({onClose:d,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?TA:NA,slots:{paper:R,root:b.root},slotProps:{root:I,paper:L},open:p,ref:n,transitionDuration:m,TransitionProps:dn({onEntering:(e,t)=>{_.current&&_.current.adjustStyleForScrollbar(e,{direction:S?"rtl":"ltr"}),g&&g(e,t)}},x),ownerState:E},w,{classes:f,children:Hn.jsx(jA,dn({onKeyDown:e=>{"Tab"===e.key&&(e.preventDefault(),d&&d(e,"tabKeyDown"))},actions:_,autoFocus:a&&(-1===k||c),autoFocusItem:M,variant:y},u,{className:ls(C.list,u.className),children:s}))}))}));function BA(e){return ub("MuiMenuItem",e)}const WA=db("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),$A=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],HA=pw(mR,{shouldForwardProp:e=>dw(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})((({theme:e,ownerState:t})=>dn({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${WA.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:gv(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${WA.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:gv(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${WA.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:gv(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:gv(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${WA.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${WA.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${KR.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${KR.inset}`]:{marginLeft:52},[`& .${fA.root}`]:{marginTop:0,marginBottom:0},[`& .${fA.inset}`]:{paddingLeft:36},[`& .${hA.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&dn({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${hA.root} svg`]:{fontSize:"1.25rem"}})))),VA=e.forwardRef((function(t,n){const r=Vk({props:t,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:a=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:d,className:p}=r,h=bn(r,$A),f=e.useContext(lA),m=e.useMemo((()=>({dense:a||f.dense||!1,disableGutters:l})),[f.dense,a,l]),g=e.useRef(null);bb((()=>{i&&g.current&&g.current.focus()}),[i]);const y=dn({},r,{dense:m.dense,divider:s,disableGutters:l}),b=(e=>{const{disabled:t,dense:n,divider:r,disableGutters:i,selected:o,classes:a}=e;return dn({},a,$b({root:["root",n&&"dense",t&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},BA,a))})(r),v=Rb(g,n);let x;return r.disabled||(x=void 0!==d?d:-1),Hn.jsx(lA.Provider,{value:m,children:Hn.jsx(HA,dn({ref:v,role:u,tabIndex:x,component:o,focusVisibleClassName:ls(b.focusVisible,c),className:ls(b.root,p)},h,{ownerState:y,classes:b}))})})),GA=pw(DR,{shouldForwardProp:e=>!["interactions","hoverBackground","background","shouldShowMenuIcon","isDimension"].includes(e)})((({interactions:e,background:t,hoverBackground:n,shouldShowMenuIcon:r,isDimension:i})=>({pointerEvents:i?"all":"none",position:"relative",display:"grid",gridTemplateColumns:r?"1fr 12px":"1fr",gap:8,alignItems:"center",cursor:e.active?"pointer":"default",background:t,"&&:hover":{background:e.active&&i?n:t}}))),UA=pw("div")({position:"absolute",left:0,bottom:0}),YA=pw("div",{shouldForwardProp:e=>"justifyContent"!==e})((({justifyContent:e})=>({...og,justifyContent:null!=e?e:og.justifyContent,flexDirection:"row",overflow:"hidden",position:"relative",gap:8}))),KA=pw("div")((()=>({...og}))),XA=pw("div",{shouldForwardProp:e=>!["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","justifyContent"].includes(e)})((({fontSize:e,fontFamily:t,fontWeight:n,fontStyle:r,textDecoration:i,justifyContent:o})=>({display:"flex",justifyContent:o,alignSelf:"center",flexGrow:1,maxWidth:"100%",fontWeight:n,fontSize:e,fontFamily:t,fontStyle:r,textDecoration:i}))),JA=pw(zA)((({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}}))),ZA=pw(VA,{shouldForwardProp:e=>!["isActive"].includes(e)})((({theme:e,isActive:t})=>({width:220,maxHeight:32,borderRadius:e.spacing(.5),margin:e.spacing(.25,.5),padding:e.spacing(1,1.5),display:"flex",justifyContent:"space-between",position:"relative",overflow:"hidden ",boxSizing:"border-box",background:t?"rgba(0, 0, 0, 0.05)":"transparent","&:hover":{".indent-mode-dropdown-more":{opacity:1}}}))),QA=pw("span")({textOverflow:"ellipsis",overflow:"hidden"}),eI=pw("div",{shouldForwardProp:e=>"visible"!==e})((({visible:e})=>({opacity:e?1:0,width:20,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"})));var tI;!function(e){e.Expand="Expand",e.Collapse="Collapse"}(tI||(tI={}));const nI=(e,t)=>({qExcludeList:t===tI.Expand,qPos:{qDimName:e,qElemNo:[]}}),rI=`${AE}/qExpansionState`,iI=({model:e,qExpansionState:t,qEffectiveDimensionName:n,action:r})=>async()=>{const i=(({qEffectiveDimensionName:e,oldExpansionState:t,action:n})=>{const r=null==t?void 0:t.findIndex((t=>{var n;return(null===(n=t.qPos)||void 0===n?void 0:n.qDimName)===e}));return{expansionData:nI(e,n),index:r}})({qEffectiveDimensionName:n,oldExpansionState:t,action:r});await(async({model:e,newExpansionState:t,errorMsg:n})=>{const{index:r,expansionData:i}=t;try{let t,n=rI,o="Add";void 0===r?t=JSON.stringify([i]):-1===r?(n=`${rI}/-`,t=JSON.stringify(i)):(n=`${rI}/${r}`,o="Replace",t=JSON.stringify(i)),await e.applyPatches([{qPath:n,qOp:o,qValue:t}],!0)}catch(e){console.error(n,e)}})({model:e,newExpansionState:i,errorMsg:`Failed to ${r} dimension`})},oI=({model:e,effectivePropertiesService:t,cell:n,env:r})=>{if(!r.flags.isEnabled("CLIENT_IM_6273_EXPAND_OR_COLLAPSE_DIM")||void 0===n.qEffectiveDimensionName)return;const i={model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n.qEffectiveDimensionName};return{expandCallback:iI({...i,action:tI.Expand}),collapseCallback:iI({...i,action:tI.Collapse})}},aI={[PS.Sorting]:!0,[PS.Selections]:!0,[PS.Searching]:!0},sI=({cell:e,style:t,isFirstColumn:n,isLastColumn:r,isLastRow:i,changeSortOrder:o,iconsVisibilityStatus:a,columnWidth:s,overrideLeftGridWidth:l,shouldApplyIndentModeColumnWidth:u,tableWidth:d})=>{var p;const h=c(null),{styleService:f,layoutService:m,effectivePropertiesService:g}=_E(),{app:y,interactions:b,embed:v,translator:x,env:w,model:S}=EE(),{fontSize:E,fontFamily:C,fontStyle:M,fontWeight:_,textDecoration:k,color:R,background:A,hoverBackground:I,activeBackground:L}=f.header,D=c(null),{shouldShowLockIcon:P,shouldShowMenuIcon:O}=a,{open:T,setOpen:N,handleOpenMenu:q,setIsAdjustingWidth:F}=Wk(),j={sortFromMenu:async(t,n)=>{t.stopPropagation(),await o(e,n)}},z={embed:v,listboxRef:h,sortCriteria:m.searchSortFromDimension&&e.isDim?g.getSortCriteriaForDimension(e.dimensionInfoIndex):void 0},B={app:y,qStateName:m.layout.qStateName},{labelTextAlign:W}=null!==(p=m.getDimensionInfo(e.dimensionInfoIndex))&&void 0!==p?p:{},$=wk(W,"flex-start");return Hn.jsxs(GA,{className:Ot,title:e.label,interactions:b,background:T?L:A,hoverBackground:I,shouldShowMenuIcon:O,isDimension:e.isDim,style:{...t,...sg,...pg(e,i,n,r,f.grid.border),color:R},"data-testid":"title-cell",onClick:q,children:[Hn.jsxs(YA,{children:[P?Hn.jsx(KA,{children:Hn.jsx(zk,{height:12})}):null,Hn.jsx(XA,{fontFamily:C,fontSize:E,fontStyle:M,fontWeight:_,textDecoration:k,justifyContent:$,children:Hn.jsx("span",{style:lg,children:e.label})})]}),e.isDim?Hn.jsxs(Hn.Fragment,{children:[Hn.jsx(NS,{headerData:e,translator:x,anchorRef:D,open:T,setOpen:N,interactions:b,menuAvailabilityFlags:aI,sortRelatedArgs:j,searchRelatedArgs:z,selectionRelatedArgs:B,expandOrCollapseArgs:oI({model:S,effectivePropertiesService:g,cell:e,env:w}),shouldShowMenuIcon:O,env:w,model:S&&"setActiveField"in S?S:void 0}),Hn.jsx(UA,{ref:h}),Hn.jsx(UA,{ref:D})]}):null,Hn.jsx(Hk,{cellInfo:{...e,isLeftColumn:!0},columnWidth:s,isLastColumn:r,overrideLeftGridWidth:l,setIsAdjustingWidth:F,shouldApplyIndentModeColumnWidth:u,tableWidth:d})]})},lI=({rowSpan:e,columnSpan:t})=>{const{styleService:n}=_E();return e>0&&t>0?Hn.jsx("div",{style:{...ag,gridRowStart:1,gridRowEnd:`span ${e}`,gridColumnStart:1,gridColumnEnd:`span ${t}`,borderWidth:"0px 1px 0px 0px",borderColor:n.grid.border,background:n.grid.background},"data-testid":"empty-header-cell"}):null};function cI(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const uI=(e,n)=>t.createElement("svg",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){cI(e,t,n[t])}))}return e}({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:n},e),t.createElement("path",{d:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5z"})),dI=u(uI);function pI(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const hI=(e,n)=>t.createElement("svg",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){pI(e,t,n[t])}))}return e}({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:n},e),t.createElement("path",{d:"m8 7-4.5 4.5L2 10l6-6 6 6-1.5 1.5z"}),t.createElement("use",{fillRule:"evenodd"})),fI=u(hI),mI=({tableWidth:e,leftGridWidth:t,overrideLeftGridWidth:n})=>{const{styleService:r}=_E(),{interactions:i,translator:o}=EE(),{isActive:a}=J_(),{dataModel:s}=hM(),{setIsAdjustingWidth:l}=Bk([s]);if(!(!!i.active&&!a))return null;const c=$k(r,{isLeftColumn:!0});return Hn.jsx(vw,{isPivot:!0,isLastColumn:!0,isLeftColumn:!0,keyValue:"adjuster-indent-row",hoverColor:c,columnWidth:t,updateWidthCallback:t=>{n(Math.min(t,e*gM))},confirmWidthCallback:r=>{var i;if(r.type===Ft.FitToContent)return void s.applyIndentModeColumnWidth({type:Ft.Auto});const o=Math.min(null!==(i=r.pixels)&&void 0!==i?i:t,e*gM);n(o),s.applyIndentModeColumnWidth({type:Ft.Pixels,pixels:o})},setIsAdjustingWidth:l,accessibilityRelatedArgs:{translator:o,columnLabel:o.get("SNPivotTable.IndentMode.Rows")},direction:"ltr"})};function gI(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const yI=(e,n)=>t.createElement("svg",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){gI(e,t,n[t])}))}return e}({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:n},e),t.createElement("path",{d:"M3 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m6 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2"})),bI=u(yI),vI=({cell:e,changeSortOrder:t})=>{const n=c(null),r=c(null),{app:i,interactions:o,embed:a,translator:s,env:l,model:u}=EE(),{layoutService:d,effectivePropertiesService:p}=_E(),{open:h,setOpen:f,handleOpenMenu:m}=Wk();return Hn.jsxs(ZA,{onClick:m,isActive:h,children:[Hn.jsx(QA,{children:e.label}),Hn.jsxs(eI,{className:"indent-mode-dropdown-more",visible:h,children:[Hn.jsx(bI,{}),e.isDim?Hn.jsxs(Hn.Fragment,{children:[Hn.jsx(NS,{headerData:e,translator:s,anchorRef:n,open:h,setOpen:f,interactions:o,menuAvailabilityFlags:aI,sortRelatedArgs:{sortFromMenu:async(n,r)=>{n.stopPropagation(),await t(e,r)}},searchRelatedArgs:{embed:a,listboxRef:r},selectionRelatedArgs:{app:i,qStateName:d.layout.qStateName},expandOrCollapseArgs:oI({model:u,effectivePropertiesService:p,cell:e,env:l}),shouldShowMenuIcon:!1,env:l,model:u&&"setActiveField"in u?u:void 0}),Hn.jsx(UA,{ref:r}),Hn.jsx(UA,{ref:n})]}):null]})]})},xI=({idx:e,menu:t,menuItems:n,isOnlyOneRow:r})=>{var i,o;const a=(null===(i=n.at(-1))||void 0===i?void 0:i.id)===LE,s=e+1<n.length&&(null===(o=n[e+1])||void 0===o?void 0:o.id)===LE;return!(r&&a&&s)&&((null==t?void 0:t.id)!==LE&&e<n.length-1)},wI=({menuItems:e,changeSortOrder:t,overrideLeftGridWidth:n,leftGridWidth:r,tableWidth:i})=>{const{styleService:o}=_E(),{interactions:a,translator:s}=EE(),{dataModel:u,gridSectionsData:{headersData:d}}=hM(),[p,h]=l(!1),f=c(null),{headerCellHeight:m}=o,{color:g,background:y,hoverBackground:b,activeBackground:v,fontFamily:x,fontSize:w,fontStyle:S,fontWeight:E,textDecoration:C}=o.header,{isAdjustingWidth:M}=Bk([u]),_=e=>{e.stopPropagation()},k={height:m,gridColumn:`1 / span ${d.size.x}`,gridRow:d.size.y,zIndex:d.size.x-0};return Hn.jsxs(GA,{isDimension:!0,background:p?v:y,interactions:a,hoverBackground:b,style:{...k,...sg,color:g},onClick:e=>{!a.active||Y_(e)||M||h(!p)},"data-testid":"indentModeHeaderCellWrapper",children:[Hn.jsxs(YA,{justifyContent:"flex-start",children:[Hn.jsx(XA,{fontFamily:x,fontSize:w,fontStyle:S,fontWeight:E,textDecoration:C,justifyContent:"flex-start",children:Hn.jsx("span",{style:lg,children:s.get("SNPivotTable.IndentMode.Rows")})}),p?Hn.jsx(fI,{}):Hn.jsx(dI,{}),Hn.jsx(UA,{ref:f})]}),Hn.jsx(JA,{open:p,anchorEl:f.current,children:e.map(((n,r)=>[n&&n.id!==LE&&Hn.jsx("li",{role:"presentation",onClick:_,onKeyDown:_,children:Hn.jsx(vI,{cell:n,changeSortOrder:t})}),xI({idx:r,menu:n,menuItems:e,isOnlyOneRow:1===d.size.y})&&Hn.jsx(kw,{"data-testid":"group-divider",variant:"middle"})]))}),Hn.jsx(mI,{tableWidth:i,leftGridWidth:r,overrideLeftGridWidth:n})]})},SI=({layoutService:e,headersData:t,topRowIndex:n})=>e.isIndentModeEnabled&&t.size.x>1&&n+1===t.size.y,EI={display:"grid",width:"fit-content"},CI=({tableWidth:e,leftGridWidth:t,columnWidths:n,rowHight:r,changeSortOrder:i,getHeaderCellsIconsVisibilityStatus:o,height:a,overrideLeftGridWidth:s})=>{const{layoutService:l}=_E(),{gridSectionsData:{headersData:c}}=hM();return Hn.jsxs("div",{"data-testid":"HEADER_GRID",style:{...EI,gridTemplateColumns:n.map((e=>`${e}px`)).join(" "),gridTemplateRows:c.data.map((()=>`${r}px`)).join(" "),height:a},children:[c.size.y>1&&Hn.jsx(lI,{columnSpan:c.size.x-1,rowSpan:c.size.y-1}),c.data.map(((a,u)=>{let d=[];if(SI({layoutService:l,headersData:c,topRowIndex:u})){const n=a.at(0);var p;if(Array.isArray(n))d.push(Hn.jsx(wI,{menuItems:n,changeSortOrder:i,overrideLeftGridWidth:s,leftGridWidth:t,tableWidth:e},null===(p=n.at(0))||void 0===p?void 0:p.id));return d}return d=a.reduce(((t,a,d)=>{if(a&&!Array.isArray(a)){const p=o(d,a.isLocked,a.label),h=l.isIndentModeEnabled&&1===c.size.x;t.push(Hn.jsx(sI,{style:{width:n[d],height:r,gridColumn:l.isIndentModeEnabled&&c.size.x>1?2:d+1,gridRow:u+1,zIndex:c.size.x-d},isLastRow:u===c.size.y-1,isFirstColumn:0===d,isLastColumn:d===c.size.x-1,changeSortOrder:i,cell:a,iconsVisibilityStatus:p,columnWidth:n[d],overrideLeftGridWidth:s,shouldApplyIndentModeColumnWidth:h,tableWidth:e},a.id))}return t}),[]),d}))]})};var MI=f(CI);const _I=(e,t,n,r)=>{const{layoutService:i}=_E();m((()=>{var t;null===(t=e.current)||void 0===t||t.forEach((e=>null==e?void 0:e.resetAfterIndex(0,!0)))}),[e,t,n,r,i])},kI=(e,t)=>{jg((()=>{var t;null===(t=e.current)||void 0===t||t.forEach((e=>null==e?void 0:e.resetAfterIndex(0,!1)))}),[e,t])},RI=(e,t)=>{const{isLast:n,list:r,listValues:i}=t;return n?r[e]:i[e]},AI=(e,t,n,r)=>{var i;if(r)return;const o=n?"flex-start":"center";var a,s;if(e.representation.type===Wt.Image)return null!==(a=null===(s=e.representation.resolvedImagePosition)||void 0===s?void 0:s.horizontal)&&void 0!==a?a:o;if(e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex){var l;const{labelTextAlign:n}=null!==(l=t.visibleMeasureInfo[e.visibleMeasureInfoIndex])&&void 0!==l?l:{};return wk(n,o)}const{textAlign:c}=null!==(i=t.getDimensionInfo(e.dimensionInfoIndex))&&void 0!==i?i:{};return wk(c,o)},II=()=>{},LI=({children:e,reactWindowStyle:t,cell:n,data:r,showTotalCellDivider:i,isLastRow:o,isLastColumn:a,isLeftColumn:s,isCellSelected:l,isAdjustingWidth:c,index:u})=>{var d;const{styleService:p,layoutService:h}=_E(),{interactions:f}=EE(),{isLocked:m,createMouseDownHandler:g,createMouseOverHandler:y}=J_(),{showLastBorder:b}=r,v=m(n)||n.isLockedByDimension,x=!(v||!f.active||!f.select||n.isEmpty||n.isNull||n.isPseudoDimension||n.isTotal||c),w=x?g(u,(e=>RI(e,r))):void 0,S=x?y(u):void 0,E=bM({isLeftColumn:s,layoutService:h,representation:n.representation});return Hn.jsx("div",{className:Ot,title:f.passive?n.representation.text:void 0,style:{...t,...dg(o,a,p.grid.border,b),...hg({bottomDivider:i&&s,rightDivider:i&&!s,borderColor:p.grid.divider}),...sg,padding:"0px 4px",cursor:lk(x),background:rk({styleService:p,isCellSelected:l,cell:n,isCellLocked:v}),zIndex:s?void 0:h.size.x-n.x,justifyContent:AI(n,h,s,E),display:"flex",...h.isIndentModeEnabled&&s&&{paddingLeft:Math.max(4,24*(null!==(d=n.indentLevel)&&void 0!==d?d:0))}},"aria-hidden":"true",onMouseDown:w,onMouseOver:S,onKeyUp:II,role:"button",tabIndex:-1,"data-testid":"dimension-cell","data-x":n.x,"data-page-x":n.pageX,"data-y":n.y,"data-page-y":n.pageY,"data-cell-type":n.ref.qType,"data-dimension-info-index":n.dimensionInfoIndex,children:e})},DI=e=>{e.stopPropagation()},PI=({href:e,text:t,interactions:n,color:r})=>({href:e,title:t,rel:"noreferrer",target:"_blank",underline:"hover",onClick:DI,style:{pointerEvents:n.active?"auto":"none",color:null!=r?r:void 0,opacity:n.active&&n.passive||r?void 0:.4}}),OI=({href:e,text:n,interactions:r,color:i})=>t.createElement(Pp,PI({href:e,text:n,interactions:r,color:i}),n);function TI(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?NI(Object(n),!0).forEach((function(t){TI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NI(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var FI=Object.prototype.hasOwnProperty,jI=Object.prototype.toString,zI=Object.defineProperty,BI=Object.getOwnPropertyDescriptor,WI=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===jI.call(e)},$I=function(e){if(!e||"[object Object]"!==jI.call(e))return!1;var t,n=FI.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&FI.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||FI.call(e,t)},HI=function(e,t){zI&&"__proto__"===t.name?zI(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},VI=function(e,t){if("__proto__"===t){if(!FI.call(e,t))return;if(BI)return BI(e,t).value}return e[t]},GI=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=VI(s,n),s!==(i=VI(t,n))&&(u&&i&&($I(i)||(o=WI(i)))?(o?(o=!1,a=r&&WI(r)?r:[]):a=r&&$I(r)?r:{},HI(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&HI(s,{name:n,newValue:i}));return s};function UI(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function YI(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function KI(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:a,row:s,sourceKey:l,target:c,targetProp:u,columnOrder:d}=e,p=r;if(i.field&&i.field!==n){const e=UI(i.field,o,{cache:t},d);if(-1===e)return;p=GI({qRow:a},e(s))}c[u]=YI(i,p,{key:l})}function XI(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),d=Object.keys(c),p=!!i[e].trackBy,h=typeof i[e].trackBy,f={},m=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=UI(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const b=a.qDataPages[t].qArea.qTop+y,v=GI({qRow:b},o(a.qDataPages[t].qMatrix[y])),x=YI(u,v,{key:s});if(!(u.filter&&!u.filter(v))){for(let e=0;e<d.length;e++){const r=c[d[e]];let i=r.fields||[r];r.fields&&(x[d[e]]=[]);for(let o=0;o<i.length;o++)KI({cache:n,f:l,mainCell:v,p:i[o],prop:d[e],page:a.qDataPages[t],rowIdx:b,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:r.fields?x[d[e]]:x,targetProp:r.fields?o:d[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[d[e]].map((e=>e.value)),n=x[d[e]].map((e=>e.label));x[d[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[d[e]].value)}}}p&&r.track({cfg:i[e],itemData:v,obj:x,target:m,tracker:f,trackType:h}),g.push(x)}}}const y=p?r.collect(m,{main:u,propsArr:d,props:c}):g;o=[...o,...y]}return o}function JI(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function ZI(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=eL)):void 0===t&&(t=QI);for(var n,r,i,o,a,s=new rL(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new rL(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(nL)}function QI(e){return e.children}function eL(e){return Array.isArray(e)?e[1]:null}function tL(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function nL(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function rL(e){this.data=e,this.depth=this.height=0,this.parent=null}function iL(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}rL.prototype=ZI.prototype={constructor:rL,count:function(){return this.eachAfter(JI)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;e=n.pop(),t=r.pop();for(;e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return ZI(this).eachBefore(tL)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var oL={depth:-1},aL={},sL={};function lL(e){return e.id}function cL(e){return e.parentId}function uL(){var e,t=lL,n=cL;function r(r){var i,o,a,s,l,c,u,d,p=Array.from(r),h=t,f=n,m=new Map;if(null!=e){const t=p.map(((t,n)=>function(e){e=`${e}`;let t=e.length;pL(e,t-1)&&!pL(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(dL),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(dL(e)),p.push(sL));h=(e,n)=>t[n],f=(e,t)=>n[t]}for(a=0,i=p.length;a<i;++a)o=p[a],c=p[a]=new rL(o),null!=(u=h(o,a,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?aL:c)),null!=(u=f(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=p[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===aL)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===sL&&1===s.children.length;)s=s.children[0],--i;for(let e=p.length-1;e>=0&&(c=p[e]).data===sL;--e)c.data=null}if(s.parent=oL,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(nL),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=iL(e),r):t},r.parentId=function(e){return arguments.length?(n=iL(e),r):n},r.path=function(t){return arguments.length?(e=iL(t),r):e},r}function dL(e){let t=e.length;if(t<2)return"";for(;--t>1&&!pL(e,t););return e.slice(0,t)}function pL(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function hL(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=hL(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=hL(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function fL(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...fL(e[i].children,t-1,n)]);return r}function mL(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>fL(e.children,r-1,n)}return!1}const gL=/^qDimensionInfo(?:\/(\d+))?/,yL=/^\/?qMeasureInfo\/(\d+)/,bL=/\/qAttrExprInfo\/(\d+)/,vL=/\/qAttrDimInfo\/(\d+)/;function xL(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function wL(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,d=r;const p=n.qEffectiveInterColumnSortOrder,h=xL(n);return gL.test(d)&&(i=!0,o=+gL.exec(d)[1],d=r.replace(gL,"")),yL.test(d)&&("K"===n.qMode?c=+yL.exec(d)[1]:p&&-1!==p.indexOf(-1)?(c=+yL.exec(d)[1],u=0):u=+yL.exec(d)[1],d=d.replace(yL,"")),d&&(vL.exec(d)?s=+vL.exec(d)[1]:bL.exec(d)&&(a=+bL.exec(d)[1])),l=i?"S"===n.qMode?h[o]:p?p.indexOf(o):o:p&&-1!==p.indexOf(-1)?p.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function SL(e,t){let n,r,i=mL(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function EL(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function CL(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let p,h,f,m,g,y;if("primitive"===d.type?(f=d.value,y=String(d.value)):("function"==typeof d.value&&(p=e=>d.value(e,r)),"function"==typeof d.label&&(h=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),p&&(f=g.map(p),p=null),h&&(y=g.map(h),h=null),f=d.reduce?d.reduce(f):f,y=d.reduceLabel?d.reduceLabel(y,f):String(f)):(f=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=f)):(f=i,y=i)),s.fields){const e=p?p(f):f;c.push(e),u.push(h&&null!=y?h(y):null!=y?y:String(e))}else{const n=p?p(f):f;o[t[e]]={value:n,label:h?h(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,r):c,label:"function"==typeof s.label?s.label(u,r):u})}}const ML=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=hL(r,e);return o&&o[0]?(t.tree=ZI(o[0],n.children||(e=>e[i])),t.tree):null};const _L=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],s=i.fields?i.fields:[i];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=SL(o,wL(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function kL(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),r=e.fields(),i=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=qI({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e])),c=uL().id((e=>e.__id)).parentId((e=>e.__parent))(l);return c}(t):ML(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=xL(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:c}=r.normalizeConfig(qI(qI({},e),{},{field:a?a.key():void 0}),t),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const d=a?wL(a,{cube:i}):{fieldDepth:0};_L({propsArr:u,props:s,cube:i,cache:n,itemDepthObject:d,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,r=l[u[e].depth].main,i=c[e],a=i.data,s=EL(r,a,{key:o});CL({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function RL(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!ML(s,n,e))continue;const c="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:u,main:d}=r.normalizeConfig(i[a],t),p=Object.keys(u),h=wL(c,{cube:s}),{nodeFn:f,attrFn:m,valueFn:g}=SL({fieldDepth:0},h);_L({propsArr:p,props:u,cube:s,cache:n,itemDepthObject:h,f:c});const y=!!i[a].trackBy,b=typeof i[a].trackBy,v={},x=[],w=f(n.tree),S=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(d.filter&&!d.filter(n))continue;const o=EL(d,n,{key:l});CL({propsArr:p,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:v,trackType:b}),S.push(o)}const E=y?r.collect(x,{main:d,propsArr:p,props:u}):S;o=[...o,...E]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var AL=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
|
|
175
175
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
176
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,p=e.length,h=e.search(/[0-9\-\+#]/),f=h>0?e.substring(0,h):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=p-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=g>0?e.substring(v,p):"";if(n=(t="-"===(e=e.substring(h,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,p=d.length,v=0;v<p;v++)m+=d.charAt(v),!((v-y+1)%l)&&v<p-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),f+(n?"-":"")+r+x}}));function IL(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const LL={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},DL=/%\)?$/,PL=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,OL=/^\(oct\)/i,TL=/^\(dec\)/i,NL=/^\(hex\)/i,qL=/^\(bin\)/i,FL=/^\(rom\)/i,jL=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,zL=/#|0/g;function BL(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function WL(e,t,n){let r;return PL.test(t)?e=BL(e,Number(/\d{2}/.exec(t)[0]),t,n):OL.test(t)?e=BL(e,8,t,n):TL.test(t)?e=BL(e,10,t,n):NL.test(t)?e=BL(e,16,t,n):qL.test(t)?e=BL(e,2,t,n):FL.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function $L(e,t,n){const r=IL(e);return n?r:new RegExp(r||"",t)}function HL(e,t,n,r){let i,o,a,s,l,c,u,d,p,h=e.pattern;var f,m;r&&(e.abbreviate=!0),f=t,(m=n)&&(m=IL(m)),f&&(f=IL(f)),p=new RegExp("(?:[#0]+".concat(f,")?[#0]+(?:").concat(m,"[#0]+)?")),a=h.match(p),a=a?a[0]:"",s=a?h.substr(0,h.indexOf(a)):h,l=a?h.substring(h.indexOf(a)+a.length):"",a||(a=h?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace($L(c,"g"),t)),u=n,n=".",u&&(a=a.replace($L(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=h.split(u);let y;g[1]&&(y=g[1].match(zL)),e.prefix=s||"",e.postfix=l||"",e.pattern=h,e.maxPrecision=y?y.length:2,e.percentage=DL.test(h),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat($L(t,null,!0),"|").concat($L(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class VL{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return LL;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new VL(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],jL.test(e[0])&&(r.positive.isFunctional=!0),e[1]?jL.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?jL.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||HL(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&HL(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&HL(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",p="",h=e;if(isNaN(e))return"".concat(h);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=WL(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=AL(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),p=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=AL(l,e)}e=e.replace(u.numericRegex,(e=>e===a?u.groupTemp:e===o?u.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+p+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function GL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function UL(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new VL(...t)}(i,e,t,n,r),a=GL(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const YL="D",KL="T",XL="TS",JL="IV",ZL=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],QL=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],eD=["January","February","March","April","May","June","July","August","September","October","November","December"],tD=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function nD(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function rD(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function iD(e,t){let n,r=function(e){const t=e,n=24*rD(t),r=60*rD(n),i=60*rD(r),o=1e3*rD(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:a,s:s,f:l,t:u}}class oD{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:ZL,qDayNames:QL,qLongMonthNames:eD,qMonthNames:tD}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[KL]:r.qTimeFmt||"hh:mm:ss",[YL]:r.qDateFmt||"YYYY-MM-DD",[XL]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new oD(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=iD(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:nD("".concat(t.year).slice(-2),2),YYY:nD("".concat(t.year).slice(-3),3),def:e=>nD("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:nD("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:nD("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>nD("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>nD("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>nD("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>nD("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return s}}function aD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new oD(...t)}function sD(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=aD(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=GL(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==JL?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=aD(i,e,t),r=GL(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function lD(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return sD(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),UL(n,r,i,o,t)}(t,i),p="dimension"===s?"first":(e,t)=>d(t),h={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(h)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:p,formatter:()=>d,tags:()=>t.qTags};return h}function cD(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:lD(GI({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=cD("qAttrDimInfo",t,n,a,GI({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=cD("qAttrExprInfo",t,n,a,GI({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=cD("qMeasureInfo",t,n,a,GI({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function uD(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=uD.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=RL,a.hierarchy=kL,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=XI,a.pages=i.qDataPages,a.hierarchy=kL):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,c="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...cD("qDimensionInfo",i,e,"",GI({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...cD("qMeasureInfo",i,e,"",GI({},a,{value:c,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{r.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),i=lD(qI({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),s}const dD=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],pD=/\/qDimensionInfo(?:\/(\d+))?/,hD=/\/qMeasureInfo\/(\d+)/,fD=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,mD=/\/qAttrExprInfo\/(\d+)/,gD=/\/?qHyperCube/,yD=/\/?qTreeData/,bD=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),vD=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function xD(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;gD.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=bD):yD.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=vD);let s=!0;if(pD.test(e)&&(r=+pD.exec(e)[1]),hD.test(e)&&(i=+hD.exec(e)[1]),fD.test(e)){i=-1,r=0;const e=+fD.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(mD.test(e)){const e=i;if(t){i=0;const a=hL(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+mD.exec(n)[1]}else r>-1?(r=-1,i=+mD.exec(n)[1]):i+=+mD.exec(n)[1]+1}return dD.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function wD(e){uD.util=e.data("matrix").util,e.data("q",uD),e.formatter("q-number",UL),e.formatter("q-time",sD)}wD.qBrushHelper=xD,wD.selections=xD;var SD=Object.prototype.hasOwnProperty,ED=Object.prototype.toString,CD=Object.defineProperty,MD=Object.getOwnPropertyDescriptor,_D=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===ED.call(e)},kD=function(e){if(!e||"[object Object]"!==ED.call(e))return!1;var t,n=SD.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&SD.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||SD.call(e,t)},RD=function(e,t){CD&&"__proto__"===t.name?CD(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},AD=function(e,t){if("__proto__"===t){if(!SD.call(e,t))return;if(MD)return MD(e,t).value}return e[t]},ID=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=AD(s,n),s!==(i=AD(t,n))&&(u&&i&&(kD(i)||(o=_D(i)))?(o?(o=!1,a=r&&_D(r)?r:[]):a=r&&kD(r)?r:{},RD(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&RD(s,{name:n,newValue:i}));return s},LD="2.3.0";function DD(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function OD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PD(Object(n),!0).forEach((function(t){DD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PD(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function TD(e){return!!e.changedTouches}function ND(e){return"number"==typeof e&&!isNaN(e)}function qD(e){return"number"!=typeof e||isNaN(e)}function FD(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function jD(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function zD(e){return[{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}]}function BD(e){const[t,n,r,i]=FD(e);return{x:t,y:n,width:r-t,height:i-n}}function WD(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function $D(e){const{x:t,y:n,width:r,height:i,x1:o,x2:a,y1:s,y2:l,cx:c,cy:u,r:d,vertices:p}=e||{};return ND(c)&&ND(u)&&ND(d)?"circle":ND(o)&&ND(a)&&ND(s)&&ND(l)?"line":ND(t)&&ND(n)&&ND(r)&&ND(i)?"rect":ND(t)&&ND(n)?"point":Array.isArray(p)?p.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function HD(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var VD=Math.PI,GD=2*VD,UD=1e-6,YD=GD-UD;function KD(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function XD(){return new KD}function JD(e){return function(){return e}}KD.prototype=XD.prototype={constructor:KD,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-e,l=r-t,c=o-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>UD)if(Math.abs(u*s-l*c)>UD&&i){var p=n-o,h=r-a,f=s*s+l*l,m=p*p+h*h,g=Math.sqrt(f),y=Math.sqrt(d),b=i*Math.tan((VD-Math.acos((f+d-m)/(2*g*y)))/2),v=b/y,x=b/g;Math.abs(v-1)>UD&&(this._+="L"+(e+v*c)+","+(t+v*u)),this._+="A"+i+","+i+",0,0,"+ +(u*p>c*h)+","+(this._x1=e+x*s)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=e+a,c=t+s,u=1^o,d=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>UD||Math.abs(this._y1-c)>UD)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%GD+GD),d>YD?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>UD&&(this._+="A"+n+","+n+",0,"+ +(d>=VD)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var ZD=Math.abs,QD=Math.atan2,eP=Math.cos,tP=Math.max,nP=Math.min,rP=Math.sin,iP=Math.sqrt,oP=1e-12,aP=Math.PI,sP=aP/2,lP=2*aP;function cP(e){return e>=1?sP:e<=-1?-sP:Math.asin(e)}function uP(e){return e.innerRadius}function dP(e){return e.outerRadius}function pP(e){return e.startAngle}function hP(e){return e.endAngle}function fP(e){return e&&e.padAngle}function mP(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/iP(s*s+l*l),u=c*l,d=-c*s,p=e+u,h=t+d,f=n+u,m=r+d,g=(p+f)/2,y=(h+m)/2,b=f-p,v=m-h,x=b*b+v*v,w=i-o,S=p*m-f*h,E=(v<0?-1:1)*iP(tP(0,w*w*x-S*S)),C=(S*v-b*E)/x,M=(-S*b-v*E)/x,_=(S*v+b*E)/x,k=(-S*b+v*E)/x,R=C-g,A=M-y,I=_-g,L=k-y;return R*R+A*A>I*I+L*L&&(C=_,M=k),{cx:C,cy:M,x01:-u,y01:-d,x11:C*(i/w-1),y11:M*(i/w-1)}}function gP(){var e=uP,t=dP,n=JD(0),r=null,i=pP,o=hP,a=fP,s=null;function l(){var l,c,u=+e.apply(this,arguments),d=+t.apply(this,arguments),p=i.apply(this,arguments)-sP,h=o.apply(this,arguments)-sP,f=ZD(h-p),m=h>p;if(s||(s=l=XD()),d<u&&(c=d,d=u,u=c),d>oP)if(f>lP-oP)s.moveTo(d*eP(p),d*rP(p)),s.arc(0,0,d,p,h,!m),u>oP&&(s.moveTo(u*eP(h),u*rP(h)),s.arc(0,0,u,h,p,m));else{var g,y,b=p,v=h,x=p,w=h,S=f,E=f,C=a.apply(this,arguments)/2,M=C>oP&&(r?+r.apply(this,arguments):iP(u*u+d*d)),_=nP(ZD(d-u)/2,+n.apply(this,arguments)),k=_,R=_;if(M>oP){var A=cP(M/u*rP(C)),I=cP(M/d*rP(C));(S-=2*A)>oP?(x+=A*=m?1:-1,w-=A):(S=0,x=w=(p+h)/2),(E-=2*I)>oP?(b+=I*=m?1:-1,v-=I):(E=0,b=v=(p+h)/2)}var L=d*eP(b),D=d*rP(b),P=u*eP(w),O=u*rP(w);if(_>oP){var T,N=d*eP(v),q=d*rP(v),F=u*eP(x),j=u*rP(x);if(f<aP&&(T=function(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,d=s-o,p=d*l-u*c;if(!(p*p<oP))return[e+(p=(u*(t-o)-d*(e-i))/p)*l,t+p*c]}(L,D,F,j,N,q,P,O))){var z=L-T[0],B=D-T[1],W=N-T[0],$=q-T[1],H=1/rP(function(e){return e>1?0:e<-1?aP:Math.acos(e)}((z*W+B*$)/(iP(z*z+B*B)*iP(W*W+$*$)))/2),V=iP(T[0]*T[0]+T[1]*T[1]);k=nP(_,(u-V)/(H-1)),R=nP(_,(d-V)/(H+1))}}E>oP?R>oP?(g=mP(F,j,L,D,d,R,m),y=mP(N,q,P,O,d,R,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),R<_?s.arc(g.cx,g.cy,R,QD(g.y01,g.x01),QD(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,R,QD(g.y01,g.x01),QD(g.y11,g.x11),!m),s.arc(0,0,d,QD(g.cy+g.y11,g.cx+g.x11),QD(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,R,QD(y.y11,y.x11),QD(y.y01,y.x01),!m))):(s.moveTo(L,D),s.arc(0,0,d,b,v,!m)):s.moveTo(L,D),u>oP&&S>oP?k>oP?(g=mP(P,O,N,q,u,-k,m),y=mP(L,D,F,j,u,-k,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),k<_?s.arc(g.cx,g.cy,k,QD(g.y01,g.x01),QD(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,k,QD(g.y01,g.x01),QD(g.y11,g.x11),!m),s.arc(0,0,u,QD(g.cy+g.y11,g.cx+g.x11),QD(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,k,QD(y.y11,y.x11),QD(y.y01,y.x01),!m))):s.arc(0,0,u,w,x,m):s.lineTo(P,O)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-aP/2;return[eP(r)*n,rP(r)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:JD(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:JD(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:JD(+e),l):n},l.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:JD(+e),l):r},l.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:JD(+e),l):i},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:JD(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:JD(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function yP(e){this._context=e}function bP(e){return new yP(e)}function vP(e){return e[0]}function xP(e){return e[1]}function wP(){var e=vP,t=null,n=JD(0),r=xP,i=JD(!0),o=null,a=bP,s=null;function l(l){var c,u,d,p,h,f=l.length,m=!1,g=new Array(f),y=new Array(f);for(null==o&&(s=a(h=XD())),c=0;c<=f;++c){if(!(c<f&&i(p=l[c],c,l))===m)if(m=!m)u=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=c-1;d>=u;--d)s.point(g[d],y[d]);s.lineEnd(),s.areaEnd()}m&&(g[c]=+e(p,c,l),y[c]=+n(p,c,l),s.point(t?+t(p,c,l):g[c],r?+r(p,c,l):y[c]))}if(h)return s=null,h+""||null}function c(){return function(){var e=vP,t=xP,n=JD(!0),r=null,i=bP,o=null;function a(a){var s,l,c,u=a.length,d=!1;for(null==r&&(o=i(c=XD())),s=0;s<=u;++s)!(s<u&&n(l=a[s],s,a))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(l,s,a),+t(l,s,a));if(c)return o=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:JD(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:JD(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:JD(!!e),a):n},a.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),a):i},a.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),a):r},a}().defined(i).curve(a).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:JD(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:JD(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:JD(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:JD(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:JD(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:JD(+e),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:JD(!!e),l):i},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}function SP(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function EP(e){return e}yP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var CP=Array.prototype.slice;function MP(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function _P(e){this._context=e}function kP(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function RP(e,t){this._context=e,this._k=(1-t)/6}_P.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:MP(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:MP(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},RP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:kP(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:kP(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var AP=function e(t){function n(e){return new RP(e,t)}return n.tension=function(t){return e(+t)},n}(0);function IP(e,t){this._context=e,this._alpha=t}IP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>oP){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>oP){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var LP=function e(t){function n(e){return t?new IP(e,t):new RP(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function DP(e){return e<0?-1:1}function PP(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(DP(o)+DP(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function OP(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function TP(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function NP(e){this._context=e}function qP(e){this._context=new FP(e)}function FP(e){this._context=e}function jP(e){this._context=e}function zP(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function BP(e,t){this._context=e,this._t=t}function WP(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function $P(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function HP(e,t){return e[t]}function VP(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function GP(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function UP(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return a(e,i);const o=s(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),l.add=a,l.get=s,l.has=function(e){return!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map((e=>i[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function YP(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function KP(e){return(e=YP(Math.abs(e)))?e[1]:NaN}NP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:TP(this,this._t0,OP(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,TP(this,OP(this,n=PP(this,e,t)),n);break;default:TP(this,this._t0,n=PP(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(qP.prototype=Object.create(NP.prototype)).point=function(e,t){NP.prototype.point.call(this,t,e)},FP.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},jP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=zP(e),i=zP(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},BP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var XP,JP=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ZP(e){if(!(t=JP.exec(e)))throw new Error("invalid format: "+e);var t;return new QP({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function QP(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function eO(e,t){var n=YP(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}ZP.prototype=QP.prototype,QP.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var tO={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>eO(100*e,t),r:eO,s:function(e,t){var n=YP(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(XP=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+YP(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function nO(e){return e}var rO,iO,oO,aO=Array.prototype.map,sO=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function lO(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?nO:(t=aO.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?nO:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(aO.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=ZP(e)).fill,n=e.align,d=e.sign,p=e.symbol,h=e.zero,f=e.width,m=e.comma,g=e.precision,y=e.trim,b=e.type;"n"===b?(m=!0,b="g"):tO[b]||(void 0===g&&(g=12),y=!0,b="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var v="$"===p?i:"#"===p&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",x="$"===p?o:/[%p]/.test(b)?l:"",w=tO[b],S=/[defgprs%]/.test(b);function E(e){var i,o,l,p=v,E=x;if("c"===b)E=w(e)+E,e="";else{var C=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),C&&0==+e&&"+"!==d&&(C=!1),p=(C?"("===d?d:c:"-"===d||"("===d?"":d)+p,E=("s"===b?sO[8+XP/3]:"")+E+(C&&"("===d?")":""),S)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){E=(46===l?a+e.slice(i+1):e.slice(i))+E,e=e.slice(0,i);break}}m&&!h&&(e=r(e,1/0));var M=p.length+e.length+E.length,_=M<f?new Array(f-M+1).join(t):"";switch(m&&h&&(e=r(_+e,_.length?f-E.length:1/0),_=""),n){case"<":e=p+e+E+_;break;case"=":e=p+_+e+E;break;case"^":e=_.slice(0,M=_.length>>1)+p+e+E+_.slice(M);break;default:e=_+p+e+E}return s(e)}return g=void 0===g?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),E.toString=function(){return e+""},E}return{format:d,formatPrefix:function(e,t){var n=d(((e=ZP(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(KP(t)/3))),i=Math.pow(10,-r),o=sO[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){rO=lO(e),iO=rO.format,oO=rO.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const cO=new Date,uO=new Date;function dO(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>dO((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(i.count=(t,r)=>(cO.setTime(+t),uO.setTime(+r),e(cO),e(uO),Math.floor(n(cO,uO))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const pO=6e4,hO=864e5,fO=6048e5,mO=dO((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pO)/hO),(e=>e.getDate()-1));mO.range;const gO=dO((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/hO),(e=>e.getUTCDate()-1));gO.range;const yO=dO((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/hO),(e=>Math.floor(e/hO)));function bO(e){return dO((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pO)/fO))}yO.range;const vO=bO(0),xO=bO(1),wO=bO(2),SO=bO(3),EO=bO(4),CO=bO(5),MO=bO(6);function _O(e){return dO((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/fO))}vO.range,xO.range,wO.range,SO.range,EO.range,CO.range,MO.range;const kO=_O(0),RO=_O(1),AO=_O(2),IO=_O(3),LO=_O(4),DO=_O(5),PO=_O(6);kO.range,RO.range,AO.range,IO.range,LO.range,DO.range,PO.range;const OO=dO((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));OO.every=e=>isFinite(e=Math.floor(e))&&e>0?dO((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,OO.range;const TO=dO((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function NO(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function qO(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function FO(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=NO,n=(t,n)=>NO(e(t),n),r=(t,n)=>e(t)-n):(t=e===NO||e===qO?e:jO,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function jO(){return 0}TO.every=e=>isFinite(e=Math.floor(e))&&e>0?dO((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,TO.range;const zO=FO(NO).right;FO((function(e){return null===e?NaN:+e})).center;var BO=zO;class WO extends Map{constructor(e,t=HO){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get($O(this,e))}has(e){return super.has($O(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function $O({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function HO(e){return null!==e&&"object"==typeof e?e.valueOf():e}const VO=Math.sqrt(50),GO=Math.sqrt(10),UO=Math.sqrt(2);function YO(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=VO?10:o>=GO?5:o>=UO?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?YO(e,t,2*n):[s,l,c]}function KO(e,t,n){return YO(e=+e,t=+t,n=+n)[2]}function XO(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function JO(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ZO(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function QO(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=aT(i),u=sT(i),d=aT(o),p=sT(o),h=aT(a),f=sT(a),m=aT(s),g=sT(s),y=aT(l),b=sT(l),v={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:RT,e:RT,f:PT,g:HT,G:GT,H:AT,I:IT,j:LT,L:DT,m:OT,M:TT,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:mN,s:gN,S:NT,u:qT,U:FT,V:zT,w:BT,W:WT,x:null,X:null,y:$T,Y:VT,Z:UT,"%":fN},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:YT,e:YT,f:QT,g:uN,G:pN,H:KT,I:XT,j:JT,L:ZT,m:eN,M:tN,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:mN,s:gN,S:nN,u:rN,U:iN,V:aN,w:sN,W:lN,x:null,X:null,y:cN,Y:dN,Z:hN,"%":fN},w={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return C(e,t,n,r)},d:bT,e:bT,f:CT,g:fT,G:hT,H:xT,I:xT,j:vT,L:ET,m:yT,M:wT,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:gT,Q:_T,s:kT,S:ST,u:cT,U:uT,V:dT,w:lT,W:pT,x:function(e,t,r){return C(e,n,t,r)},X:function(e,t,n){return C(e,r,t,n)},y:fT,Y:hT,Z:mT,"%":MT};function S(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=eT[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function E(e,t){return function(n){var r,i,o=ZO(1900,void 0,1);if(C(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=JO(ZO(o.y,0,1))).getUTCDay(),r=i>4||0===i?RO.ceil(r):RO(r),r=gO.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=XO(ZO(o.y,0,1))).getDay(),r=i>4||0===i?xO.ceil(r):xO(r),r=mO.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?JO(ZO(o.y,0,1)).getUTCDay():XO(ZO(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,JO(o)):XO(o)}}function C(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in eT?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return v.x=S(n,v),v.X=S(r,v),v.c=S(t,v),x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),{format:function(e){var t=S(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=E(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=E(e+="",!0);return t.toString=function(){return e},t}}}var eT={"-":"",_:" ",0:"0"},tT=/^\s*\d+/,nT=/^%/,rT=/[\\^$*+?|[\]().{}]/g;function iT(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function oT(e){return e.replace(rT,"\\$&")}function aT(e){return new RegExp("^(?:"+e.map(oT).join("|")+")","i")}function sT(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function lT(e,t,n){var r=tT.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function cT(e,t,n){var r=tT.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function uT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function dT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function pT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function hT(e,t,n){var r=tT.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function fT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function mT(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function gT(e,t,n){var r=tT.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function yT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function bT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function vT(e,t,n){var r=tT.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function xT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function wT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ST(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ET(e,t,n){var r=tT.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function CT(e,t,n){var r=tT.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function MT(e,t,n){var r=nT.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function _T(e,t,n){var r=tT.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function kT(e,t,n){var r=tT.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function RT(e,t){return iT(e.getDate(),t,2)}function AT(e,t){return iT(e.getHours(),t,2)}function IT(e,t){return iT(e.getHours()%12||12,t,2)}function LT(e,t){return iT(1+mO.count(OO(e),e),t,3)}function DT(e,t){return iT(e.getMilliseconds(),t,3)}function PT(e,t){return DT(e,t)+"000"}function OT(e,t){return iT(e.getMonth()+1,t,2)}function TT(e,t){return iT(e.getMinutes(),t,2)}function NT(e,t){return iT(e.getSeconds(),t,2)}function qT(e){var t=e.getDay();return 0===t?7:t}function FT(e,t){return iT(vO.count(OO(e)-1,e),t,2)}function jT(e){var t=e.getDay();return t>=4||0===t?EO(e):EO.ceil(e)}function zT(e,t){return e=jT(e),iT(EO.count(OO(e),e)+(4===OO(e).getDay()),t,2)}function BT(e){return e.getDay()}function WT(e,t){return iT(xO.count(OO(e)-1,e),t,2)}function $T(e,t){return iT(e.getFullYear()%100,t,2)}function HT(e,t){return iT((e=jT(e)).getFullYear()%100,t,2)}function VT(e,t){return iT(e.getFullYear()%1e4,t,4)}function GT(e,t){var n=e.getDay();return iT((e=n>=4||0===n?EO(e):EO.ceil(e)).getFullYear()%1e4,t,4)}function UT(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+iT(t/60|0,"0",2)+iT(t%60,"0",2)}function YT(e,t){return iT(e.getUTCDate(),t,2)}function KT(e,t){return iT(e.getUTCHours(),t,2)}function XT(e,t){return iT(e.getUTCHours()%12||12,t,2)}function JT(e,t){return iT(1+gO.count(TO(e),e),t,3)}function ZT(e,t){return iT(e.getUTCMilliseconds(),t,3)}function QT(e,t){return ZT(e,t)+"000"}function eN(e,t){return iT(e.getUTCMonth()+1,t,2)}function tN(e,t){return iT(e.getUTCMinutes(),t,2)}function nN(e,t){return iT(e.getUTCSeconds(),t,2)}function rN(e){var t=e.getUTCDay();return 0===t?7:t}function iN(e,t){return iT(kO.count(TO(e)-1,e),t,2)}function oN(e){var t=e.getUTCDay();return t>=4||0===t?LO(e):LO.ceil(e)}function aN(e,t){return e=oN(e),iT(LO.count(TO(e),e)+(4===TO(e).getUTCDay()),t,2)}function sN(e){return e.getUTCDay()}function lN(e,t){return iT(RO.count(TO(e)-1,e),t,2)}function cN(e,t){return iT(e.getUTCFullYear()%100,t,2)}function uN(e,t){return iT((e=oN(e)).getUTCFullYear()%100,t,2)}function dN(e,t){return iT(e.getUTCFullYear()%1e4,t,4)}function pN(e,t){var n=e.getUTCDay();return iT((e=n>=4||0===n?LO(e):LO.ceil(e)).getUTCFullYear()%1e4,t,4)}function hN(){return"+0000"}function fN(){return"%"}function mN(e){return+e}function gN(e){return Math.floor(+e/1e3)}const yN=UP();yN("d3-number",(function(e,t,n){let r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=lO(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o})),yN("d3-time",(function(e){let t=QO({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=QO(...arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r}));const bN={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return yN(t.type||"d3-number")(t.format||"")})(e)};function vN(e){let{id:t=bN.id,key:n=bN.key,min:r=bN.min,max:i=bN.max,type:o=bN.type,tags:a=bN.tags,title:s=bN.title,values:l=bN.values,value:c=bN.value,label:u=bN.label,formatter:d=bN.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>a(e),type:()=>o(e),min:()=>r(e),max:()=>i(e),title:()=>s(e),items:()=>l(e),formatter:()=>d(e),value:c,label:u}}const xN=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),wN=e=>e.reduce(((e,t)=>e+t),0),SN={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=xN(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=xN(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=xN(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=xN(e),n=t.length;return n?wN(t)/n:NaN}};function EN(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((a=>{const s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map((n=>EN(e,t,{main:n},r).main)):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=SN[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?SN[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=SN[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?SN[l.field.reduceLabel]:l.field.reduceLabel))})),i}function CN(e,t){const{main:n}=EN(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:EN(e,t,e.props||{},n),main:n}}function MN(e,t,n,r){const i=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=r?e[t][r]:e[t],i[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function _N(e,t){let{main:n,propsArr:r,props:i}=t,o=[];const a=n.field.formatter(),s={};return r.forEach((e=>{s[e]=i[e].field?i[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=MN(e.items,n,a);return r.forEach((n=>{t[n]=MN(e.items,i[n],s[n],n)})),t}))),o}function kN(e){let{cfg:t,itemData:n,obj:r,target:i,tracker:o,trackType:a}=e;const s="function"===a?t.trackBy(n):n[t.trackBy];let l=o[s];l||(l=o[s]={items:[],id:s},i.push(l)),l.items.push(r)}function RN(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function AN(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const IN={diverging:function(e,t){if((s=e.length)>0)for(var n,r,i,o,a,s,l=0,c=e[t[0]].length;l<c;++l)for(o=a=0,n=0;n<s;++n)(i=(r=e[t[n]][l])[1]-r[0])>=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o},none:WP,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}WP(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}WP(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,c=0;s<i;++s){for(var u=e[t[s]],d=u[a][1]||0,p=(d-(u[a-1][1]||0))/2,h=0;h<s;++h){var f=e[t[h]];p+=(f[a][1]||0)-(f[a-1][1]||0)}l+=d,c+=p*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,WP(e,t)}}},LN={ascending:function(e){var t=e.map(GP);return $P(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,r=e.length,i=e.map(GP),o=function(e){var t=e.map(VP);return $P(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],c.push(n));return c.reverse().concat(l)},none:$P,reverse:function(e){return $P(e).reverse()}};function DN(e,t,n){const r={},i=t.stackKey,o=t.value,a=t.startProp||"start",s=t.endProp||"end",l=t.offset||"none",c=t.order||"none",u=t.valueRef||"";let d=0,p={};for(let t=0;t<e.items.length;t++){let n=e.items[t],o=u?n[u]:null;if(o&&o.source){let e="".concat(o.source.key||"","/").concat(o.source.field);p[e]||(p[e]=o.source)}let a=i(n);r[a]=r[a]||{items:[]},r[a].items.push(n),d=Math.max(d,r[a].items.length)}const h=Array.apply(null,{length:d}).map(Number.call,Number),f=Object.keys(r).map((e=>r[e].items)),m=function(){var e=JD([]),t=$P,n=WP,r=HP;function i(i){var o,a,s=e.apply(this,arguments),l=i.length,c=s.length,u=new Array(c);for(o=0;o<c;++o){for(var d,p=s[o],h=u[o]=new Array(l),f=0;f<l;++f)h[f]=d=[0,+r(i[f],p,f,i)],d.data=i[f];h.key=p}for(o=0,a=t(u);o<c;++o)u[a[o]].index=o;return n(u,a),u}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:JD(CP.call(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:JD(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?$P:"function"==typeof e?e:JD(CP.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?WP:e,i):n},i}().keys(h).value(((e,t)=>e[t]?o(e[t]):0)).order(LN[c]).offset(IN[l]);let g=m(f),y=[];for(let e=0;e<g.length;e++){let t=g[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[a]={value:n[0]},r[s]={value:n[1]},y.push(n[0],n[1]))}}let b=Object.keys(p).map((e=>{let t=n(p[e].key);return t?t.field(p[e].field):null})).filter((e=>!!e));const v=vN({title:b.map((e=>e.title())).join(", "),min:AN(y),max:RN(y),type:"measure",formatter:b[0]?b[0].formatter:void 0});e.fields.push(v)}function PN(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=OD({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.fields();else if(e.items)n.items=e.items.map((e=>({value:o(e),label:String(a(e))})));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach((e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&i){const t=i.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(a(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&DN(n,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function ON(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:PN;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function TN(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const NN=Symbol("implicit");function qN(){var e=new WO,t=[],n=[],r=NN;function i(i){let o=e.get(i);if(void 0===o){if(r!==NN)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new WO;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return qN(t,n).unknown(r)},TN.apply(i,arguments),i}function FN(){var e,t,n=qN().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=a<o,p=d?a:o,h=d?o:a;e=(h-p)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),p+=(h-p-e*(n-l))*u,t=e*(1-l),s&&(p=Math.round(p),t=Math.round(t));var f=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map((function(t){return p+e*t}));return i(d?f.reverse():f)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,d()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,d()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return FN(r(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},TN.apply(d(),arguments)}function jN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zN(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function BN(){}var WN=.7,$N=1/WN,HN="\\s*([+-]?\\d+)\\s*",VN="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",GN="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",UN=/^#([0-9a-f]{3,8})$/,YN=new RegExp(`^rgb\\(${HN},${HN},${HN}\\)$`),KN=new RegExp(`^rgb\\(${GN},${GN},${GN}\\)$`),XN=new RegExp(`^rgba\\(${HN},${HN},${HN},${VN}\\)$`),JN=new RegExp(`^rgba\\(${GN},${GN},${GN},${VN}\\)$`),ZN=new RegExp(`^hsl\\(${VN},${GN},${GN}\\)$`),QN=new RegExp(`^hsla\\(${VN},${GN},${GN},${VN}\\)$`),eq={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function tq(){return this.rgb().formatHex()}function nq(){return this.rgb().formatRgb()}function rq(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=UN.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?iq(t):3===n?new sq(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?oq(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?oq(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=YN.exec(e))?new sq(t[1],t[2],t[3],1):(t=KN.exec(e))?new sq(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=XN.exec(e))?oq(t[1],t[2],t[3],t[4]):(t=JN.exec(e))?oq(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ZN.exec(e))?hq(t[1],t[2]/100,t[3]/100,1):(t=QN.exec(e))?hq(t[1],t[2]/100,t[3]/100,t[4]):eq.hasOwnProperty(e)?iq(eq[e]):"transparent"===e?new sq(NaN,NaN,NaN,0):null}function iq(e){return new sq(e>>16&255,e>>8&255,255&e,1)}function oq(e,t,n,r){return r<=0&&(e=t=n=NaN),new sq(e,t,n,r)}function aq(e,t,n,r){return 1===arguments.length?function(e){return e instanceof BN||(e=rq(e)),e?new sq((e=e.rgb()).r,e.g,e.b,e.opacity):new sq}(e):new sq(e,t,n,null==r?1:r)}function sq(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function lq(){return`#${pq(this.r)}${pq(this.g)}${pq(this.b)}`}function cq(){const e=uq(this.opacity);return`${1===e?"rgb(":"rgba("}${dq(this.r)}, ${dq(this.g)}, ${dq(this.b)}${1===e?")":`, ${e})`}`}function uq(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function dq(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function pq(e){return((e=dq(e))<16?"0":"")+e.toString(16)}function hq(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new mq(e,t,n,r)}function fq(e){if(e instanceof mq)return new mq(e.h,e.s,e.l,e.opacity);if(e instanceof BN||(e=rq(e)),!e)return new mq;if(e instanceof mq)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new mq(a,s,l,e.opacity)}function mq(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function gq(e){return(e=(e||0)%360)<0?e+360:e}function yq(e){return Math.max(0,Math.min(1,e||0))}function bq(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}jN(BN,rq,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tq,formatHex:tq,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return fq(this).formatHsl()},formatRgb:nq,toString:nq}),jN(sq,aq,zN(BN,{brighter(e){return e=null==e?$N:Math.pow($N,e),new sq(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?WN:Math.pow(WN,e),new sq(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new sq(dq(this.r),dq(this.g),dq(this.b),uq(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:lq,formatHex:lq,formatHex8:function(){return`#${pq(this.r)}${pq(this.g)}${pq(this.b)}${pq(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:cq,toString:cq})),jN(mq,(function(e,t,n,r){return 1===arguments.length?fq(e):new mq(e,t,n,null==r?1:r)}),zN(BN,{brighter(e){return e=null==e?$N:Math.pow($N,e),new mq(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?WN:Math.pow(WN,e),new mq(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new sq(bq(e>=240?e-240:e+120,i,r),bq(e,i,r),bq(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new mq(gq(this.h),yq(this.s),yq(this.l),uq(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=uq(this.opacity);return`${1===e?"hsl(":"hsla("}${gq(this.h)}, ${100*yq(this.s)}%, ${100*yq(this.l)}%${1===e?")":`, ${e})`}`}}));var vq=e=>()=>e;function xq(e){return 1==(e=+e)?wq:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):vq(isNaN(t)?n:t)}}function wq(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):vq(isNaN(e)?t:e)}var Sq=function e(t){var n=xq(t);function r(e,t){var r=n((e=aq(e)).r,(t=aq(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=wq(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Eq(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function Cq(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Lq(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function Mq(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function _q(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function kq(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Lq(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Rq=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Aq=new RegExp(Rq.source,"g");function Iq(e,t){var n,r,i,o=Rq.lastIndex=Aq.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Rq.exec(e))&&(r=Aq.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:_q(n,r)})),o=Aq.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Lq(e,t){var n,r=typeof t;return null==t||"boolean"===r?vq(t):("number"===r?_q:"string"===r?(n=rq(t))?(t=n,Sq):Iq:t instanceof rq?Sq:t instanceof Date?Mq:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Eq:Array.isArray(t)?Cq:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?kq:_q)(e,t)}function Dq(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Pq(e){return+e}var Oq=[0,1];function Tq(e){return e}function Nq(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function qq(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Nq(i,r),o=n(a,o)):(r=Nq(r,i),o=n(o,a)),function(e){return o(r(e))}}function Fq(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Nq(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=BO(e,t,1,r)-1;return o[n](i[n](t))}}function jq(){var e,t,n,r,i,o,a=Oq,s=Oq,l=Lq,c=Tq;function u(){var e=Math.min(a.length,s.length);return c!==Tq&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?Fq:qq,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),_q)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,Pq),u()):a.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=Dq,u()},d.clamp=function(e){return arguments.length?(c=!!e||Tq,u()):c!==Tq},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function zq(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?KO(t,e,n):KO(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=ZP(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(KP(t)/3)))-KP(Math.abs(e)))}(o,a))||(r.precision=i),oO(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,KP(t)-KP(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-KP(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return iO(r)}function Bq(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const r=t<e,[i,o,a]=r?YO(t,e,n):YO(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(i+e)/-a;else for(let e=0;e<s;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return zq(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(i=l,l=c,c=i,i=a,a=s,s=i);u-- >0;){if((i=KO(l,c,n))===r)return o[a]=l,o[s]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function Wq(){var e=jq()(Tq,Tq);return e.copy=function(){return t=e,Wq().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},TN.apply(e,arguments),Bq(e)}function $q(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[BO(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return $q().domain(t).range(n).unknown(e)},TN.apply(i,arguments)}function Hq(e){return void 0===e?e=>e:t=>e(t)}function Vq(e){return Math.max(0,Math.min(1,e))}function Gq(e){return"object"==typeof e}function Uq(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function Yq(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push(...Uq(t,o,a)),o-=a-o,a=e[i],r.push(...Uq(t,o,a))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push(...Uq(t,o,a))):r.push(...Uq(t,o,a))}return r.filter((e=>e>=n.min()&&e<=n.max()))}function Kq(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const a=qD(i)||qD(t)?2:Math.max(t/i,2),s=Math.min(1e3,Math.round(a));let l=n.ticks(s);l.length<=1&&(l=n.ticks(s+1));const c=r>0?Yq(l,r,n):l;c.sort(((e,t)=>e-t));const u=c.map(Hq(o));return c.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function Xq(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const a=qD(i)||qD(t)?2:Math.max(t/i,2),s=Math.min(1e3,Math.round(a)),l=s>10?10:s;n.nice(l);const c=n.ticks(s),u=r>0?Yq(c,r,n):c;u.sort(((e,t)=>e-t));const d=u.map(Hq(o));return u.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:d[t],value:e,isMinor:-1===c.indexOf(e)}}))}function Jq(e){let t,{settings:n,scale:r,distance:i,formatter:o=e=>e}=e;const a=n.minorTicks&&!qD(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!qD(e.value):!qD(e)));t=function(e){let{values:t,scale:n,formatter:r=e=>e}=e;return t.sort(((e,t)=>(Gq(e)?e.value:e)-(Gq(t)?t.value:t))).filter(((e,t,r)=>{const i=Gq(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t})).map((e=>{const t=Gq(e),i=t?e.value:e,o=n(i);return{position:o,value:i,label:t&&void 0!==e.label?e.label:r(i),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?Vq(n(e.start)):o,end:t&&!isNaN(e.end)?Vq(n(e.end)):o}}))}({values:e,scale:r.copy(),formatter:o})}else if(qD(n.ticks.count)){t=(n.ticks.tight?Xq:Kq)({distance:i,minorCount:a,unitDivider:n.ticks.distance,scale:r,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const r=e.map((e=>e.position)),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,o)}else{t=function(e){let{count:t,minorCount:n,scale:r,formatter:i}=e;return r.ticks((t-1)*n+t).map(((e,t)=>{const o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:a,scale:r.copy(),formatter:o})}return t}function Zq(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={};return Object.keys(t).forEach((i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]})),r}const Qq={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},eF={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},tF={count:NaN};function nF(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function rF(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Wq(),i={instance:null,invert:!1},o={data:t,resources:n},a=Zq(e,Qq,o);let s;function l(e){return qD(e)?NaN:r(e)}a.ticks=Zq(e.ticks,eF,o),a.minorTicks=Zq(e.minorTicks,tF,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=ID(!0,{},a,e.settings),e.scale=l,s=Jq(e),s):(s=r.ticks(e),s)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+i);n.push(o,o),r.push(a,a)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=rF(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return nF(i,l),i.instance(e)},l.normInvert=function(e){return nF(i,l),i.instance.invert(e)};const{mini:c,maxi:u}=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),r=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(a,t?t.fields:[]);return l.domain([c,u]),l.range(a.invert?[1,0]:[0,1]),i.invert=a.invert,l}const iF={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function oF(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},r=Zq(e,iF,n),i=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>i[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}}))}(t,n.trackBy)}}const c=FN();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(r.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<i.length;e++){const t=ID({datum:i[e]},n),r=u(t,e);-1===a.indexOf(r)&&(a.push(r),s.push(d(t,e)),o[r]=e)}return c.domain(a),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const aF={depth:0};function sF(e,t,n){return e.ancestors().map((e=>t(ID({datum:e.data},n)))).reverse().slice(1).toString()}const lF=e=>e.min(),cF=e=>e.max();function uF(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map(lF).filter(ND);i=e.length?Math.min(...e):i}if(!r){const e=t.map(cF).filter(ND);o=e.length?Math.max(...e):o}}return[i,o]}const dF={domain:[],range:[],invert:!1,min:NaN,max:NaN};function pF(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=rF(e,t,n).clamp(!0).interpolate(Sq),i=Zq(e,dF,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;ID(!0,s,r);const[l,c]=uF(i,t?t.fields:[]),u=o?i.domain.length:-1,d=n.theme?n.theme.palette("sequential",u>0?u:2):[],p=a?i.range:d;return s.range(i.invert?p.slice().reverse():p.slice()),s.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(s.range(),l,c)),s}const hF={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function fF(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const mF={domain:[],range:[]};const gF={domain:[],range:[],unknown:void 0},yF={domain:[],range:[],override:!1};const bF=UP();function vF(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{r.extract.push({field:e})})));const i=PN(r,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(i);return"color"===a&&(a=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=a),o}bF("linear",rF),bF("band",oF),bF("h-band",(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={data:n,resources:r},o=Zq(t,iF,i);o.ticks=Zq(t.ticks,aF,i),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=oF(o);const{values:s,labels:l,items:c,ticks:u}=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=sF(e,i,n),d=e.leaves()||[e],p=i(ID({datum:e.data},n)),h=o(ID({datum:e.data},n)),f=Array.isArray(e.children),m={key:t,count:d.length,value:p,label:h,leftEdge:sF(d[0],i,n),rightEdge:sF(d[Math.max(d.length-1,0)],i,n),node:e};f?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(h)),(r<=0&&!f||e.depth===r)&&c.push(m),l[t]=m}}));const d=e.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:c}}(n.root,o,i),d=function(e){const t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};ID(!0,d,a),d.bandwidth=function(e){const t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=d(t.leftEdge),r=d(t.rightEdge);return Math.abs(e-r)+n}return n},d.step=function(e){const t=c[String(e)],n=t?t.count:1;let r=a.step();return r*=n,r},d.data=()=>n,d.datum=e=>{const t=c[String(e)];return t?t.node.data:null},d.copy=()=>e(t,n,r),d.labels=()=>l,d.ticks=()=>u.map((e=>{const t=d(e.key),n=d.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const p=a.pxScale;return d.pxScale=function(e){return a=p(e),d},d.domain(s),d})),bF("sequential-color",pF),bF("threshold-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=$q(),i=Zq(e,hF,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return qD(e)?NaN:r(e)}Object.keys(r).forEach((e=>s[e]=r[e]));const l=t.fields,[c,u]=uF(i,l),d=o?i.domain.length:-1,p=n.theme?n.theme.palette("sequential",d>0?d:2):[];let h=a?i.range:p,f=[];return f=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=Wq().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(h,c,u):[c+(u-c)/2],h.length>f.length+1?f=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(h,c,u):h.length<f.length+1&&(h=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=pF().domain([n,r]).range(t);return[n,...fF(e),r].map((e=>i(e)))}(f,h,c,u)),s.data=()=>t,s.range(i.invert?h.slice().reverse():h),s.domain(f),s})),bF("categorical-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=qN(),i={data:t,resources:n},o=Zq(e,mF,i),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],d=[];for(let e=0;e<l.length;e++){const t=ID({datum:l[e]},i),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(s(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>d,r.label=e=>d[u.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(u),r}(e,t,n),i=n.theme,o=Zq(e,gF,{data:t,resources:n});let a;if(o.explicit=Zq(e.explicit,yF,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/a.length);for(let e=1;e<i+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(a[i]=n[r])}else{const r=t.map(((t,r)=>[e.indexOf(t),t,n[r]])).sort(((e,t)=>e[0]-t[0]));r.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])}))}a.length=e.length}return r.range(a),r}));var xF={};function wF(){wF.init.call(this)}xF.isObject=function(e){return"object"==typeof e&&null!==e},xF.isNumber=function(e){return"number"==typeof e},xF.isUndefined=function(e){return void 0===e},xF.isFunction=function(e){return"function"==typeof e};var SF=wF;wF.EventEmitter=wF,wF.prototype._events=void 0,wF.prototype._maxListeners=void 0,wF.defaultMaxListeners=10,wF.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},wF.prototype.setMaxListeners=function(e){if(!xF.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},wF.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],xF.isUndefined(n))return!1;if(xF.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(xF.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},wF.prototype.addListener=function(e,t){var n;if(!xF.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,xF.isFunction(t.listener)?t.listener:t),this._events[e]?xF.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,xF.isObject(this._events[e])&&!this._events[e].warned)&&((n=xF.isUndefined(this._maxListeners)?wF.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,xF.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),xF.isFunction(console.trace)&&console.trace()));return this},wF.prototype.on=wF.prototype.addListener,wF.prototype.once=function(e,t){if(!xF.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},wF.prototype.removeListener=function(e,t){var n,r,i,o;if(!xF.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||xF.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(xF.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},wF.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],xF.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},wF.prototype.listeners=function(e){return this._events&&this._events[e]?xF.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},wF.listenerCount=function(e,t){return e._events&&e._events[t]?xF.isFunction(e._events[t])?1:e._events[t].length:0};var EF={mixin:e=>(Object.keys(SF.prototype).forEach((t=>{e[t]=SF.prototype[t]})),SF.init(e),e)};function CF(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update(o){let a=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);const s=Math.max(e,Math.min(t-r,n));n!==s&&(n=s,a=!0),a&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return EF.mixin(i),i}function MF(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||CF();return o.update({min:n,max:r,viewSize:i}),o}function _F(e,t){return e<=t}function kF(e,t){return e<t}function RF(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function AF(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:r=!0,includeMin:i=!0}=n;e=r?_F:kF,t=i?_F:kF},i.add=e=>{let{min:t,max:n}=e;const i=RF(r,t),o=RF(r,n,!0),a=[i,o-i];i%2==0&&a.push(t),o%2==0&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.remove=e=>{let{min:t,max:n}=e;const i=RF(r,t),o=RF(r,n,!0),a=[i,o-i];i%2==1&&a.push(t),o%2==1&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let{min:t,max:n}=e;const i=RF(r,t,!0),o=RF(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function IF(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const LF={key:void 0,includeMin:!0,includeMax:!0};function DF(e){let{items:t,collection:n,vc:r}=e;const i={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=r()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(i[a]=i[a]||[],i[a].push(s[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:i[a]});return o}function PF(e){let{items:t,collection:n}=e;const r={},i=[];let o,a;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(r[o]=r[o]||[],r[o].push(a[e]))}const s=Object.keys(r);for(let e=0,t=s.length;e<t;e++)o=s[e],i.push({id:o,values:r[o]});return i}function OF(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function TF(e){let{key:t,collection:n,obj:r,fn:i,value:o}=e;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function NF(e,t){const n=[],r=Object.keys(e);let i,o;const a=e=>-1===t[i].indexOf(e);for(let s=0,l=r.length;s<l;s++)i=r[s],t[i]?(o=e[i].filter(a),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function qF(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?ID({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),r):r}function FF(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function jF(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function zF(e,t,n){let{ranges:r,interceptors:i,rc:o,aliases:a,rangeConfig:s}=n;const l=qF(i["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach((e=>{const n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}})),c}function BF(){let{vc:e=IF,rc:t=AF}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,r={},i={},o={},a={sources:{},default:ID({},LF)};const s={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(i).forEach((t=>{e.values[t]=i[t].values()})),Object.keys(r).forEach((t=>{e.ranges[t]=r[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(a={sources:{},default:ID({},LF)},e.ranges.forEach((e=>{const t={};Object.keys(LF).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:LF[n]})),void 0!==e.key?a.sources[e.key]=t:a.default=t})),Object.keys(r).forEach((e=>r[e].configure(a.sources[e]||a.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{i[n]&&e.values[n].join(";")===i[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(i).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{r[n]&&e.ranges[n].join(";")===r[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(r).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,r={},i={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(r).length>0||e.length;r={},i={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(r).map((e=>({type:"range",id:e,brush:r[e]})))),e=e.concat(Object.keys(i).map((e=>({type:"value",id:e,brush:i[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const r=qF(s.addValues,t,o),a=DF({vc:e,collection:i,items:r});u.emit("add-values",r),a.length&&(n||(n=!0,u.emit("start")),u.emit("update",a,[]),c.updateValues())}};return u.setValues=t=>{const r=qF(s.setValues,t,o),a=function(e){let{items:t,vCollection:n,vc:r}=e;const i={},o=OF(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const d=e=>{n[a]&&n[a].contains(e)||TF({key:a,value:e,collection:n,obj:i,fn:r})},p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)a=p[e],o[a].forEach(d);return l=NF(c,i),s=NF(i,c),[s,l]}({items:r,vCollection:i,vc:e});u.emit("set-values",r),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.removeValue=(e,t)=>{u.removeValues([{key:e,value:t}])},u.removeValues=e=>{const t=qF(s.removeValues,e,o),n=PF({collection:i,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(t,r)=>{const a=qF(s.addValues,t,o),l=qF(s.removeValues,r,o),d=DF({vc:e,collection:i,items:a}),p=PF({collection:i,items:l});u.emit("add-values",a),u.emit("remove-values",l),(d.length||p.length)&&(n||(n=!0,u.emit("start")),u.emit("update",d,p),c.updateValues())},u.toggleValue=(e,t)=>{u.toggleValues([{key:e,value:t}])},u.toggleValues=t=>{const r=qF(s.toggleValues,t,o),a=function(e){let{items:t,values:n,vc:r}=e;const i={},o={},a=[],s=[],l=OF(t);let c,u,d;const p=Object.keys(l);for(let e=0,t=p.length;e<t;e++){c=p[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):TF({key:c,value:u,collection:n,obj:i,fn:r})}const h=Object.keys(i);for(let e=0,t=h.length;e<t;e++)c=h[e],a.push({id:c,values:i[c]});const f=Object.keys(o);for(let e=0,t=f.length;e<t;e++)c=f[e],s.push({id:c,values:o[c]});return[a,s]}({items:r,values:i,vc:e});u.emit("toggle-values",r),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.containsValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].contains(t)},u.addRange=(e,t)=>{u.addRanges([{key:e,range:t}])},u.addRanges=e=>{zF(e,"add",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(e,t)=>{u.removeRanges([{key:e,range:t}])},u.removeRanges=e=>{zF(e,"remove",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(e,t)=>{u.setRanges([{key:e,range:t}])},u.setRanges=e=>{zF(e,"set",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(e,t)=>{u.toggleRanges([{key:e,range:t}])},u.toggleRanges=e=>{zF(e,"toggle",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsValue(t)},u.containsRange=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsRange(t)},u.containsMappedData=(e,t,n)=>{let a=[];const s=Object.keys(e);let l,c,u,d;for(let t=0,n=s.length;t<n;t++){if(l=s[t],"value"===l)c=e,a[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],a[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),d=c.value,r[u]?a[t].bool=Array.isArray(d)?r[u].containsRange({min:d[0],max:d[1]}):r[u].containsValue(d):i[u]&&i[u].contains(d)&&(a[t].bool=!0))}return t?(a=a.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!a.length&&!a.some((e=>!1===e.bool)):"xor"===n?!!a.length&&a.some((e=>e.bool))&&a.some((e=>!1===e.bool)):a.some((e=>e.bool))):a.some((e=>e.bool))},u.intercept=(e,t)=>{const n=FF(e);s[n]&&s[n].push(t)},u.removeInterceptor=(e,t)=>{const n=FF(e);if(!s[n])return;const r=s[n].indexOf(t);-1!==r&&s[n].splice(r,1)},u.removeAllInterceptors=e=>{const t=[];if(e){const n=FF(e);s[n]&&s[n].length&&t.push({name:e,handlers:s[n]})}else Object.keys(s).forEach((e=>{s[e].length&&t.push({name:jF(e),handlers:s[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},u.addKeyAlias=(e,t)=>{o[e]=t},u.removeKeyAlias=e=>{delete o[e]},EF.mixin(u),u}function WF(e){return e*e*e}function $F(e){return--e*e*e+1}function HF(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}UP();const VF=["stroke","fill","color","backgroundColor","thumbColor"];function GF(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let a;for(a=0;a<r;++a)i[a]=UF(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<r;++a)o[a]=i[a](e);return o}}function UF(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?_q:"string"===r?(i=rq(t))&&VF.includes(n)?(t=i,Sq):Iq:t instanceof rq?Sq:t instanceof Date?Mq:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Eq:Array.isArray(t)?GF:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?YF:_q)(e,t)}function YF(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=UF(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function KF(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const XF={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},JF=/^\$/;function ZF(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function QF(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function ej(e,t){return e.pxScale?e.pxScale(t):e}const tj={normalizeSettings:function(e,t,n){const r=ID({},e),i=ID({},t);return Object.keys(r).forEach((e=>{i[e]={};const o=r[e],a=typeof o;if("function"==typeof o)i[e].fn=o;else if(ZF(o)){let n=t[e];"string"==typeof n&&JF.test(n)&&(n=XF[n]);const r=typeof n;i[e]="undefined"===r||r===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in r)return;const n=t[e];"string"===typeof n&&JF.test(n)?i[e]=XF[n]:i[e]=n})),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof s&&void 0!==c,d=u&&"string"==typeof c.ref,p=u&&o in s,h=d?s[c.ref]:p?s[o]:a;ZF(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&h?(r[o]=c.scale(h.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&h?r[o]=h.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:QF};function nj(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...nj(t.children)),e):(e.push(t),e)),[])}function rj(e,t){let{context:n,data:r,style:i,filter:o,mode:a}=t;const s=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach((e=>{d.push(e)})),Object.keys(u).forEach((e=>{-1===d.indexOf(e)&&d.push(e)}));const p=[];let h=!1;const f=()=>{let t=nj(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=f(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:s}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},d.forEach((t=>{e[r].__style[t]=e[r][t]})));const t=s.containsMappedData(n,i,a),o=p.indexOf(e[r]);let l=!1;t&&-1===o?(p.push(e[r]),l=!0):t||-1===o||(p.splice(o,1),l=!0),e[r].needToUpdate=l||h,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=ID({},e[i],e[i].__style),n=e[i].isActive;d.forEach((r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,p):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,p):u[r]:e[i].__style[r]})),r=!0}delete e[i].needToUpdate}return h=!1,r},g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=f(),i=r.length;for(let e=0;e<i;e++)r[e].data&&(r[e].__style=r[e].__style||{},d.forEach((t=>{r[e].__style[t]=r[e][t],t in u&&(r[e][t]="function"==typeof u[t]?u[t].call(null,r[e]):u[t])})));h=!0,p.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=f(),i=r.length;for(let e=0;e<i;e++)r[e].__style&&(Object.keys(r[e].__style).forEach((t=>{r[e][t]=r[e].__style[t]})),r[e].__style=void 0);p.length=0,n||e.renderer.render(e.nodes)},b=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",y),s.on("update",b),{isActive:()=>s.isActive(),update:()=>{p.length=0,h=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",b)}}}function ij(e){let{nodes:t,action:n,chart:r,trigger:i}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:r,trigger:i}=e;if(!i)return;const o=i.data||[""];let a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}}))}i.contexts.forEach((e=>{a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)}))}({dataPoints:o,action:n,chart:r,trigger:i})}function oj(e){let{collisions:t,t:n,config:r,action:i}=e,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map((e=>e.node));return ij({nodes:s,action:i,chart:r.chart,data:r.data,trigger:n}),a}function aj(e,t,n){const r=n.element().getBoundingClientRect();let i=TD(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&TD(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!TD(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function sj(e,t,n){return e?"function"==typeof e?e(t):e:n}const lj={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function cj(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function uj(e,t,n,r){const i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function dj(e){return-e/180*Math.PI}function pj(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(dj(e))}function hj(e,t){return{x:e.x+t.x,y:e.y+t.y}}function fj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function mj(e,t){return{x:e.x*t,y:e.y*t}}function gj(e,t){return e.x-t.x}function yj(e,t){return e.y-t.y}function bj(e,t){return gj(e,t)**2+yj(e,t)**2}function vj(e,t){return Math.sqrt(bj(e,t))}function xj(e,t){return e.x*t.x+e.y*t.y}function wj(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=fj(e,n);return hj({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const Sj={up:0,down:180,left:90,right:-90};function Ej(e){let{x:t,y:n,size:r}=e;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const Cj=UP();Cj.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),Cj.add("diamond",(function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:cj([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}})),Cj.add("saltire",(function(e){const t=dj(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=uj(e.x,e.y,o,i).map((e=>wj(e,t,s)));return{type:"path",fill:"black",d:cj(l)}})),Cj.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),Cj.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},r=Sj[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i;let s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=dj(r);return s=s.map((e=>wj(e,l,n))),{type:"path",fill:"black",d:cj(s)}})),Cj.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:Ej(e)}})),Cj.add("star",(function(e){const t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i;for(let t=1;t<=i;t++){const i=s*t+a,l=dj(i),c=dj(i+s/2),u=Math.sin(l),d=Math.cos(l),p=Math.sin(c),h=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+h*o,y:e.y+p*o})}return{type:"path",fill:"black",d:cj(n)}})),Cj.add("n-polygon",(function(e){const t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=r;a++){const r=dj(i*a+o),s=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:cj(t)}})),Cj.add("cross",(function(e){const t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:cj(uj(t,n,e.size,o))}})),Cj.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){const e=dj(90);o=o.map((n=>wj(n,e,t)))}const a=BD(o);return a.type="rect",a.fill="black",a})),Cj.add("rect",(function(e){const{x:t,y:n,size:r}=e,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}));const Mj=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Cj;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==lj[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function _j(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:r=0,prioOrder:i=0,preferredSize:o=0,minimumLayoutMode:a,show:s=!0}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:r,children:i}=e;return"function"==typeof o?o({inner:n,outer:r,children:i,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},prioOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},minimumLayoutMode(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a},show(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s}}}function kj(e,t,n){const{require:r=[]}=t,i=t.mediator||{},{settings:o,formatter:a,scale:s,data:l,renderer:c,chart:u,dockConfig:d,mediator:p,instance:h,rect:f,style:m,registries:g,resolver:y,update:b,_DO_NOT_USE_getInfo:v,symbol:x,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:s}),Object.defineProperty(e,"mediator",{get:p}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:g}),f&&Object.defineProperty(e,"rect",{get:f}),v&&(e._DO_NOT_USE_getInfo=v),Object.keys(t).forEach((n=>{var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((e=>e===r))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),r.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:d}):"instance"===t?Object.defineProperty(e,"instance",{get:h}):"update"===t&&b?Object.defineProperty(e,"update",{get:b}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:x})})),Object.keys(i).forEach((t=>{e.mediator.on(t,i[t].bind(e))}))}function Rj(e,t,n){const r=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function Aj(e,t,n){Object.keys(n.on||{}).forEach((r=>{e.eventListeners=e.eventListeners||[];const i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)})),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit(e,...r)}}function Ij(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:r=()=>({})}=e,{chart:i,container:o,mediator:a,registries:s,theme:l,renderer:c}=t,u=EF.mixin({});let d,p,h,f,m,g=t.settings||{},y=ID(!0,{},n,g),b=[],v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tj,n={};return{resolve:function(r){let{data:i,settings:o,defaults:a={},scaled:s}=r;const l=n.norm=t.normalizeSettings(o,a,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};s&&Object.keys(s).forEach((e=>{l[e]&&t.updateScaleSize(l,e,s[e])}));const u=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:c};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:c};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:i}),x=!1;const w={nodes:[],chart:i,config:y.brush||{},renderer:null},S={tap:[],over:[]},E=[],C={},M=ID({},g);function _(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=void 0!==e[t],o=void 0!==g[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?a=e[t].call(C,...l):r&&(a=e[t])),o&&("function"==typeof g[t]?a=g[t].call(M,...l):r&&(a=g[t])),i||o||(a=n.call(C,...l)),a}}const k=_("preferredSize",(()=>0),!0),R=_("resize",(e=>{let{inner:t}=e;return t})),A=_("created"),I=_("beforeMount"),L=_("mounted"),D=_("beforeUnmount"),P=_("beforeUpdate"),O=_("updated"),T=_("beforeRender"),N=_("beforeDestroy"),q=_("destroyed"),F=e.render,j=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&E.push(rj(w,e))}))},z=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?S.over.push(e):S.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>b});const B=y.renderer||e.renderer,W=B?c||s.renderer(B)():c||s.renderer()();"function"==typeof W.settings&&W.settings(y.rendererSettings),w.renderer=W;const $={resources:i.logger?{logger:i.logger()}:{}};let H=_j(Rj(y,k,i.logger()),$);const V=e=>{e.key=y.key,e.element=W.element()},G=()=>{};G.dockConfig=()=>H,G.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(g=e.settings,y=ID(!0,{},n,e.settings),H=_j(Rj(y,k,i.logger()),$),w.config=y.brush||{}),y.scale&&(d=i.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=PN(y.data,{dataset:i.dataset,collection:i.dataCollection},{logger:i.logger()},i.dataCollection);t?t.isFirst?(b=n,b.items&&(b.items=[...n.items])):b.items&&(b.items=[...b.items,...n.items||[]]):b=n}else b=d?d.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?p=i.formatter(y.formatter):d&&d.data().fields&&(p=d.data().fields[0].formatter()),m=l.style(y.style||{})},G.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=R({inner:e,outer:t});f=n?W.size(n):W.size(e),M.rect=ID(!0,{computedPhysical:f.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),f=ID(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},f)},G.getRect=()=>M.rect;const U=()=>{const e=W.renderArgs?W.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=b;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return b.items&&r&&(n=OD(OD({},b),{},{items:b.items.slice(r.start,r.end)})),e.push({data:n}),e};let Y,K,X;function J(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}G.beforeMount=I,G.beforeRender=()=>{T({size:f})},G.render=()=>{const e=F.call(C,...U());J(e),W.render(e),Y=e,K=M.rect.computed},G.hide=()=>{G.unmount(),W.size({x:0,y:0,width:0,height:0}),W.clear()},G.beforeUpdate=()=>{P({settings:y,data:b})},G.update=()=>{X&&X.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return W.render(),void(Y=null);const r=F.call(C,...U());J(r),E.forEach((e=>e.cleanUp())),E.length=0,S.tap=[],S.over=[],t&&(j(),z()),E.forEach((e=>{e.isActive()&&e.update()})),Y&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:Y,currentRect:M.rect.computed,previousRect:K}),X=function(e,t,n,r){let i,{old:o,current:a}=e,{renderer:s}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},p=[],h=null;const f=n.trackBy||KF,m={start(){let e={};if(o.forEach(((t,n)=>{let r=f(t,n);e[r]=t})),a.forEach(((t,n)=>{let r=f(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),r=t.points.filter((e=>!e.dummy)),i=r.map((e=>e.data.major.value)),o=n.filter((e=>i.includes(e.data.major.value))).map((e=>e.data.major.value)),a=n.filter((e=>o.includes(e.data.major.value))),s=r.filter((e=>o.includes(e.data.major.value)));return{old:a,current:s}}(e[r],t);d.ips.push(YF(ID({},e[r],{points:n.old}),ID({},t,{points:n.current}))),l.push(ID({},e[r],{commonPoints:n.old}))}else d.ips.push(YF(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(YF(ID({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(YF(e[t],ID({},e[t],{r:1e-4,opacity:0}))))})),p.push({name:"exiting",easing:WF,duration:200,tweens:u.ips,nodes:[...l]}),p.push({name:"updating",easing:HF,duration:400,tweens:d.ips,nodes:[]}),p.push({name:"entering",easing:$F,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,i=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:a}=r.getValue("animations.updatingStageMeta");!1===o?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===i)}p.length&&(h=s.getScene(a),p[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(m.tick)))},tick(){let e=p[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,n=[],o=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));if(n.push(...o),n.push(...e.nodes),s.render(n),t>=1){p.shift();const{isInit:e,shouldBeRemoved:t}=r.getValue("animations.updatingStageMeta");p.length?"updating"===p[0].name&&t&&p.shift():(!0===e&&r.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}i&&(i=window.requestAnimationFrame(m.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return h}};return m}({old:Y,current:r},{renderer:W},n,i.storage),X.start()):W.render(r),Y=r,K=M.rect.computed,W.setKey&&"string"==typeof g.key&&W.setKey(g.key)},G.updated=O,G.destroy=()=>{G.unmount(),N(h),W.destroy(),q(),h=null};const Z=e=>{w.nodes=e,E.forEach((e=>{e.isActive()&&e.update()})),W.render(e)};return kj(C,e,{settings:()=>y,data:()=>b,scale:()=>d,formatter:()=>p,renderer:()=>W,chart:()=>i,dockConfig:()=>H,mediator:()=>a,instance:()=>M,rect:()=>M.rect,style:()=>m,update:()=>Z,registries:()=>s,resolver:()=>v,symbol:()=>Mj(s.symbol)}),kj(M,g,{settings:()=>y,data:()=>b,scale:()=>d,formatter:()=>p,renderer:()=>W,chart:()=>i,dockConfig:()=>H,mediator:()=>a,style:()=>m,_DO_NOT_USE_getInfo:r.bind(C),isVisible:()=>x}),G.getBrushedShapes=function(e,t,n){const r=[];if(y.brush&&y.brush.consume){const o=i.brush(e),a=W.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let i=0;i<a.length;i++){const s=a[i];s.data&&o.containsMappedData(s.data,n||e.data,t)&&(V(s),r.push(s),a.splice(i,1),i--)}}))}return r},G.findShapes=e=>{var t;const n=(null!==(t=X)&&void 0!==t&&t.inProgress()?X.targetScene:W).findShapes(e);for(let e=0,t=n.length;e<t;e++)V(n[e]);return n},G.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=W.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=r.length;e<t;e++)V(r[e]);return r},G.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];ij({nodes:e,action:t.action||"toggle",trigger:t,chart:i,data:w.data})},G.mount=()=>{h=W.element&&W.element()?h:W.appendTo(o),W.setKey&&"string"==typeof g.key&&W.setKey(g.key),y.brush&&(j(),z()),Aj(M,u,g),Aj(C,u,e),x=!0},G.mounted=()=>L(h),G.unmount=()=>{[M,C].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:r}=e;t.removeListener(n,r)})),e.eventListeners.length=0),e.emit=()=>{}}(e,u)})),S.tap=[],S.over=[],E.forEach((e=>{e.cleanUp()})),E.length=0,D(),x=!1},G.onBrushTap=e=>{S.tap.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return oj({collisions:aj(t,n,r.renderer),t:n,config:r,action:sj(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},G.onBrushOver=e=>{S.over.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return oj({collisions:aj(t,n,r.renderer),t:n,config:r,action:sj(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},G.def=C,G.ctx=M,G.renderer=()=>W,G.set({settings:g}),A(),G}function Lj(e){const t=ID(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function Dj(e,t,n){const r=hj(function(e,t){const n=xj(e,t)/xj(t,t)||1;return{x:t.x*n,y:t.y*n}}(fj(n,e),fj(t,e)),e);return r}function Pj(e,t,n){return vj(e,n)+vj(t,n)-vj(e,t)<1e-12}function Oj(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function Tj(e){return e.x1===e.x2&&e.y1===e.y2}function Nj(e){return e.width<=0||e.height<=0}function qj(e){return e.r<=0}function Fj(e){return e.edges.length<=2}function jj(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=Gj(e,WD(t.edges[r])),!0===n)return!0;return!1}function zj(e,t){let n=!1;const{numPolygons:r,polygons:i}=t;for(let t=0;t<r;t++){if(n=tz(e,i[t]),!0===n)return!0}return!1}function Bj(e,t){if(qj(e))return!1;return bj({x:e.cx,y:e.cy},t)<=e.r**2}function Wj(e,t){if(Nj(t)||qj(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,c=Math.abs(s-i),u=Math.abs(l-o);if(c>n+a||u>r+a)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=a**2}function $j(e,t){if(qj(e)||Tj(t))return!1;const[n,r]=jD(t);if(Bj(e,n)||Bj(e,r))return!0;const i={x:e.cx,y:e.cy},o=Dj(n,r,i);return bj(o,i)<=e.r**2&&Pj(n,r,o)}function Hj(e,t){if(Fj(t)||qj(e))return!1;if(Vj(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if($j(e,WD(t.edges[r])))return!0}return!1}function Vj(e,t){if(Fj(e)||!Xj(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=i.length,s=a-1;++l<a;s=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[s].y&&i[l].y===r&&(n-i[l].x)*(n-i[s].x)<=0)return!0;if(i[l].y<r&&r<=i[s].y||i[s].y<r&&r<=i[l].y){if(c=(i[s].x-i[l].x)*(r-i[l].y)/(i[s].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function Gj(e,t){if(Fj(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(Zj(t,WD(e.edges[n])))return!0}const[n,r]=jD(t);return Vj(e,n)||Vj(e,r)}function Uj(e,t){if(Fj(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(Jj(t,WD(e.edges[n])))return!0}const[n,r,i,o]=zD(t);return Vj(e,n)||Vj(e,r)||Vj(e,i)||Vj(e,o)}function Yj(e,t){return!Nj(e)&&!Nj(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function Kj(e,t){if(Nj(e)||Nj(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((t=>Xj(e,t)))}function Xj(e,t){return!Nj(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function Jj(e,t){if(Tj(t)||Nj(e))return!1;const[n,r]=jD(t);if(Xj(e,n)||Xj(e,r))return!0;const i=zD(e);let o=i.length;for(let e=0;e<o;e++){if(Zj(WD([i[e],i[3!==e?e+1:0]]),t))return!0}return!1}function Zj(e,t){const[n,r]=jD(e),[i,o]=jD(t),a=gj(r,n),s=yj(r,n),l=gj(o,i),c=yj(o,i),u=gj(n,i),d=yj(n,i);let p=c*a-l*s;const h=l*d-c*u,f=a*d-s*u;let m,g;if(0===a&&0===s)return!1;if(0===l&&0===c)return!1;if(0===p){if(0===h&&0===f){if(0===a){if(0===s)return n.x===r.x&&n.y===r.y;m=yj(i,n)/s,g=yj(o,n)/s}else m=(i.x-n.x)/a,g=(o.x-n.x)/a;return!(m<0&&g<0||m>1&&g>1)}return!1}const y=h/p;return p=f/p,y>=0&&y<=1&&p>=0&&p<=1}function Qj(e,t){if(Tj(e))return!1;const[n,r]=jD(e);return Pj(n,r,t)}function ez(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Yj(n,r)&&(Kj(n,r)?jj(e,t):jj(t,e))}function tz(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Yj(n,r)&&(Kj(r,n)?function(e,t){let n=!1;const{numPolygons:r,polygons:i}=e;for(let e=0;e<r;e++)if(n=ez(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=iz(e,WD(t.edges[r])),!0===n)return!0;return!1}(e,t))}function nz(e,t){if(qj(e))return!1;if(rz(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:r}=t;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if($j(e,WD(n.edges[t])))return!0}}return!1}function rz(e,t){if(!Xj(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.numPolygons;let o,a,s,l,c,u,d=!1;for(a=0;a<i;a++)for(o=e.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(d=!d)}}return d}function iz(e,t){const[n,r]=jD(t);if(rz(e,n)||rz(e,r))return!0;const{numPolygons:i,polygons:o}=e;for(let e=0;e<i;e++){const n=o[e];for(let e=0,r=n.edges.length;e<r;e++){if(Zj(t,WD(n.edges[e])))return!0}}return!1}function oz(e,t){const[n,r,i,o]=zD(t);if(rz(e,n)||rz(e,r)||rz(e,i)||rz(e,o))return!0;const{numPolygons:a,polygons:s}=e;for(let e=0;e<a;e++){const n=s[e];for(let e=0,r=n.edges.length;e<r;e++){if(Jj(t,WD(n.edges[e])))return!0}}return!1}const az=/^\$/,sz="@extend";function lz(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function cz(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&lz(e),az.test(r)?(n.push(e),cz(r,t,n)):r}let r=e;const i=ID(!0,{},t,e),o={};if(e[sz]){const o=e[sz];-1!==n.indexOf(o)&&lz(o);let a=n.slice();a.push(o),r=ID(!0,{},cz(i[o],t,a),e)}return Object.keys(r).forEach((e=>{let t=n.slice();if(e===sz||az.test(e))return;o[e]=r[e];let a=o[e];az.test(a)&&a in i?(-1!==n.indexOf(a)&&lz(a),t.push(a),a=i[a],"object"==typeof a||az.test(a)&&a in i?o[e]=cz(a,i,t):o[e]=a):"object"==typeof a&&(o[e]=cz(a,i,t))})),o}function uz(e,t){return cz(e,t,[])}function dz(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>uz(e,n),setStyle:t=>{n=ID({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function pz(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function hz(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return ID(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function fz(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function mz(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function gz(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function yz(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function bz(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function vz(e,t,n,r,i){const o=ID({},t),a=ID({},n);gz(o,r),yz(a,r),bz(e,o,a);const s=function(e,t,n){const r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i);return!!s&&(gz(t,r),yz(n,r),!0)}function xz(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function wz(e){return BD([].concat(...e.map(zD)))}function Sz(e){let{visible:t,layoutRect:n,reducedRect:r,containerRect:i,translation:o}=e;const a=fz(r.x,r.y,r.width,r.height),s=fz(r.x,r.y,r.width,r.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=wz(n.map((e=>e.outerRect))),c=wz(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const a=e?"height":"width",s=(r[a]-n[a]*i.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=xz(c),t.edgeBleed=e.edgeBleed,t.computed=xz(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function Ez(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof i?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function Cz(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function Mz(e){let t=hz(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:r,containerRect:i}=function(e,t){const n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),pz(r),pz(n),{logicalContainerRect:r,containerRect:n}}(e,t),[o,a]=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o];Cz(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];Ez(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:u}):i.push({comp:a,key:l,config:s,referencedDocks:u})}return[r,i]}(n,t,r),s=function(e){let{layoutRect:t,visible:n,hidden:r,settings:i}=e;const o=fz(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<s.length;++e){const n=s[e];mz(n,o,t),vz(t,o,a,n,i)||(r.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every((e=>t.some((t=>t.key===e))));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter((e=>-1!==s.indexOf(e)));return n.length=0,n.push(...l),bz(t,o,a),o}({layoutRect:r,visible:o,hidden:a,settings:t}),l=Sz({visible:o,layoutRect:r,reducedRect:s,containerRect:i,translation:{x:e.x,y:e.y}});return a.forEach((e=>{e.comp.visible=!1;const t=fz();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:a.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=hz(e)},n}const _z=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},kz=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(OD(OD({},n),{},{children:kz(e.children)}))}})),Rz=(e,t)=>({visible:[],hidden:t,ordered:[]}),Az=e=>(t,n)=>{var r;const i=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(OD(OD({},t),{},{children:kz(e.children)}))}})),o=e=>n[e.index],{visible:a=i,hidden:s=[],ordered:l=a}=null!==(r=e(t,i))&&void 0!==r?r:{};return{visible:a.map(o),hidden:s.map(o),ordered:l.map(o)}},Iz=e=>"function"==typeof e?Az(e):(e=>{const t=Mz(e);return Az(((e,n)=>t.layout(e,n)))})(e);function Lz(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=$D(e),a=ID(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=r,n.y+=i}}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function Dz(e,t){const n=[];let r=0;t.forEach((e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)})),t.forEach(((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach((t=>{e.insertBefore(t,r)}))):(o&&o.forEach((t=>{e.appendChild(t,r)})),e.appendChild(r))})(e,t,n[r])))}function Pz(e,t){let{element:n,data:r=[],settings:i={},on:o={}}=e;const a=t.registries,s=t.logger,l=dz(t.style,t.palettes),c=[],u=ID({},e),d=function(){const e={};return EF.mixin(e),e}();let p=[],h=null,f=null,m=null,g=[],y=()=>{},b=()=>{};const v={};let x=!1;const w=function(e){let{createComponent:t}=e;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},a=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find((e=>r.hasKey&&r.key===e.key));i?r.children&&i.components&&s(r.children,i.components):(e.splice(n,1),a(r),r.children&&s(r.children,[]),r.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:s}=e;return s.map((e=>{const s=_z(t,e.key);return r.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:i,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:e.components})),s)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:r,ordered:i,rect:o,visible:a}=e;const{visible:s,hidden:l,ordered:u}=r(o,t);a.push(...s),n.push(...l),i.push(...u),s.forEach((e=>{if(e.children){var t,r;const o=Iz(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:a})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:Rz,ordered:i,rect:null,visible:a})}))};return n.destroy=()=>{r.forEach((e=>e.instance.destroy())),r=[],i=[]},n.findComponentByKey=e=>_z(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const r=[],o=[],a=[],s=Iz(t);return c({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=e=>{let{components:t}=e;i=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:r,formatters:o,scales:a}=e;s(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!a.component.has(e.type))return s.warn("Unknown component: ".concat(e.type)),!1;return{instance:Ij(a.component(e.type),{settings:e,chart:u,mediator:d,registries:a,theme:l,container:n}),settings:ID(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function S(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=r?e[t].call(u,...a):n.call(u,...a),i}}const E=()=>{let e;i.dockLayout?(s.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=i.dockLayout):e=i.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},C=S("created"),M=S("beforeMount"),_=S("mounted"),k=S("beforeUpdate"),R=S("updated"),A=S("beforeRender"),I=S("beforeDestroy"),L=S("destroyed"),D=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:r={},scales:i={},scroll:o={}}=t;y=function(e,t){let{types:n,logger:r}=t;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});i[n]=a}})),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:s,types:a.data}),n||Object.keys(v).forEach((e=>v[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),b=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:PN;const i={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=()=>r(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=ID(r,{fields:e}))}return r}}(t.collections,{dataset:y},{logger:s});const c={theme:l,logger:s};h=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vF;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:y,collection:b},OD(OD({},c),{},{scale:a.scale})),f=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ON;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(a=o.type),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(r,{dataset:y,collection:b},OD(OD({},c),{},{formatter:a.formatter})),m=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=MF(e[r],t?t[r]:null));return n}(o,m)};function P(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter((e=>!!e.key)).map((e=>e.key));g.forEach((e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()})),g=e.map((e=>{const r=e.key&&t[e.key]?t[e.key]:a.interaction(e.type)(u,d,n);return r.set(e),r}))}const O=e=>{const t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return p.forEach((e=>{const t=e.instance.getRect();Xj(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)})),a},T=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=O(e)},r=t=>{const n=e.comps||O(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=TD(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),x){x=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=O(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),x){x=!1;break}}}}),i.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},N=()=>{c.forEach((e=>{let{key:t,listener:r}=e;return n.removeEventListener(t,r)})),c.length=0},q=()=>{n.innerHTML="",(()=>{const{components:e=[]}=i;A(),D(r,i),w.set({components:e});const{visible:t,hidden:o,ordered:a}=E();p=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),Dz(n,a)})(),T(),P(i.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(r=e.data),e.settings&&(i=e.settings,P(e.settings.interactions)),k(),D(r,i);const{formatters:n,scales:o,components:a=[]}=i;w.update({components:a,data:r,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),E()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let a;e.data&&(r=e.data),e.settings&&(i=e.settings,P(e.settings.interactions)),k(),D(r,i,{partialData:t});const{formatters:s,scales:l,components:c=[]}=i;w.update({components:c,data:r,excludeFromUpdate:o,formatters:s,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],d=[];let h;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),h=u;else{const{visible:e,hidden:t,ordered:n}=E();p=e,h=e,a=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):d.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}d.forEach((e=>e.instance.beforeMount())),d.forEach((e=>e.instance.mount())),h.forEach((e=>e.instance.beforeRender())),h.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||Dz(n,a),d.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),p.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),R()},u.destroy=()=>{I(),w.destroy(),N(),P(),delete u.update,delete u.destroy,L()},u.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return p.filter((e=>null==r||e.key===r)).forEach((r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]})),i},u.findShapes=e=>{let t=[];return p.forEach((n=>{const r=n.instance.findShapes(e);t=[...t,...r]})),t},u.componentsFromPoint=e=>O(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=p;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=p.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=Lz(e,i,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const r=t.components[n].key;p.filter((e=>r===e.key)).forEach((r=>{let i=e.filter((e=>e.key===r.key));r.instance.brushFromShapes(i,t.components[n])}))}},u.scroll=function(){return function(e,t){return t[e]||(t[e]=CF()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",m)},u.dataset=e=>y(e),u.dataCollection=e=>b(e),u.scales=function(){return h.all()},u.formatters=function(){return f.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return v[e]||(v[e]=BF()),v[e]},u.scale=function(e){return h.get(e)},u.formatter=function(e){return f.get(e)},u.toggleBrushing=function(e){x=void 0!==e?e:!x},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>s,u.theme=()=>l,u.storage=Lj({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:g,on(){T(),g.forEach((e=>e.on()))},off(){N(),g.forEach((e=>e.off()))}})}),C(),n&&(M(),q(),_(n),u.element=n),u}const Oz=e=>{let t=UP(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var Tz=UP();function Nz(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}const qz=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const Fz=e=>{let{key:t,data:n,cache:r,config:i}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const r=t.split("\n"),i=r[0],o=r[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){a=n;break}}else n.test(i)&&(a=n)}}return r.map((e=>e.split(a)))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,{source:n,data:r,cache:i,config:o}=e,a=r;const s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map(((e,t)=>t)):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(r[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=d(e),r=qz(t),o=r.length>0,a=o?"measure":"dimension",s=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(vN(ID({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function jz(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[]},i={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:r}),fields:()=>r.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let r=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:a}=CN(e,t),s=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},d=[],p=n.items(),h=[];for(let t=0;t<p.length;t++){const n=p[t];if(a.filter&&!a.filter(n))continue;const r=Nz(a,n,{key:i});s.forEach((e=>{const a=o[e];let s=a.field?a.field.items()[t]:n;r[e]=Nz(a,s,{key:i})})),l&&kN({cfg:e,itemData:n,obj:r,target:d,tracker:u,trackType:c}),h.push(r)}r=l?[...r,..._N(d,{main:a,propsArr:s,props:o})]:[...r,...h]}})),r}(e,i),hierarchy:()=>null};return Fz({key:e,data:t,config:n,cache:r}),i}jz.util={normalizeConfig:CN,collect:_N,track:kN};const zz=UP();zz.default("matrix"),zz("matrix",jz),zz("default",jz);const Bz=UP();function Wz(e,t,n){return Math.max(e,Math.min(t,n))}function $z(e){let{item:t,value:n,boxCenter:r,rendWidth:i,rendHeight:o,flipXY:a,symbol:s}=e,l="x",c="y",u=i,d=o,p=n<.5?90:-90;return a&&(l="y",c="x",u=o,d=i,p=n<.5?180:0),s(ID({},t.oob,{[l]:r*u,[c]:Math.max(t.oob.size/2,Math.min(n*d,d-t.oob.size/2)),startAngle:p}))}function Hz(e){let{item:t,boxWidth:n,boxPadding:r,rendWidth:i,rendHeight:o,flipXY:a}=e,s="x",l="y",c="width",u="height",d=i,p=o;a&&(s="y",l="x",c="height",u="width",d=o,p=i);const{actualDiff:h,actualLow:f}=function(e){let{start:t,end:n,minPx:r=.1,maxPx:i=1}=e;const o=Math.max(t,n),a=Math.min(t,n),s=Wz(-.1,1.2,o),l=Wz(-.1,1.2,a),c=s*i-l*i,u=Math.max(r,c),d=(u-c)/2;return{actualDiff:u,startModifier:d,actualLow:l*i-d}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:p});return ID({},t.box,{type:"rect",[s]:(r+t.major)*d,[l]:f,[u]:h,[c]:n*d,data:t.data||{},collider:{type:null}})}function Vz(e){let{item:t,from:n,to:r,boxCenter:i,rendWidth:o,rendHeight:a,flipXY:s}=e,l="x1",c="y1",u="x2",d="y2",p=o,h=a;return s&&(l="y1",c="x1",u="y2",d="x2",p=a,h=o),ID({},t.line,{type:"line",[d]:Math.floor(n*h),[l]:i*p,[c]:Math.floor(r*h),[u]:i*p,data:t.data||{},collider:{type:null}})}function Gz(e){let{item:t,key:n,position:r,width:i,boxCenter:o,rendWidth:a,rendHeight:s,flipXY:l}=e,c="x1",u="y1",d="x2",p="y2",h=a,f=s;l&&(c="y1",u="x1",d="y2",p="x2",h=s,f=a);const m=i/2;return ID({type:"line"},t[n],{[u]:Math.floor(r*f),[c]:(o-m)*h,[p]:Math.floor(r*f),[d]:(o+m)*h,r:m*h,cx:o*h,cy:r*f,width:i*h,data:t.data||{},collider:{type:null}})}function Uz(e,t,n){const{width:r,maxWidthPx:i,minWidthPx:o}=t.box,a=e>=0?1:-1;let s=Math.min(a*e*r,isNaN(i)?n:i/n);return s=isNaN(o)?s:Math.max(o/n,s),s*a}Bz("native",(function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach((e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function c(){a.forEach((e=>{let{key:t,listener:r}=e;n.removeEventListener(t,r)})),a=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,r=null}}}));const Yz={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},Kz=Object.keys(Yz),Xz={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:r}=this.rect,i="horizontal"===this.settings.settings.orientation,{style:o,resolver:a,symbol:s}=this,l=Kz.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=Yz[e]));const u=function(e){let{keys:t,data:n,defaultSettings:r,style:i,settings:o,width:a,height:s,resolver:l}=e;const c=ID(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},d=o.major;let p;p="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:ID(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:ID(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const h=o.minor||{},f={};["start","end","min","max","med"].forEach((e=>{(h[e]||n.items&&n.items.length&&n.items[0][e])&&(f[e]={scale:h.scale,ref:e})}));let m,g={major:p,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:ID(!0,{},f,h)})};for(let e=0,r=t.length;e<r;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:r,resolver:a}),{settings:d,items:p}=u,h=function(e){let{width:t,height:n,flipXY:r,resolved:i,keys:o,symbol:a}=e;const s=[],l=i.major.items;if(!l.length)return s;const c=t,u=n,d=r?n:t,p=i.major.settings,h=["start","end","min","max","med"].filter((e=>void 0!==i.minor.settings[e])),f=h.length,m=o.filter((e=>"oob"!==e));let g,y,b,v,x,w,S,E,C;const M=o?o.length:0,_=m?m.length:0,k={box:function(){b.box&&ND(b.start)&&ND(b.end)&&g.push(Hz({item:b,boxWidth:v,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){ND(b.min)&&ND(b.start)&&g.push(Vz({item:b,from:b.min,to:b.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),ND(b.max)&&ND(b.end)&&g.push(Vz({item:b,from:b.max,to:b.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){b.median&&ND(b.med)&&g.push(Gz({item:b,key:"median",position:b.med,width:v,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(b.whisker){const e=v*b.whisker.width;ND(b.min)&&g.push(Gz({item:b,key:"whisker",position:b.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),ND(b.max)&&g.push(Gz({item:b,key:"whisker",position:b.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))}}};function R(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<f;r++)e=b[h[r]],ND(e)&&(t<e&&(t=e),n>e&&(n=e));S=t<0&&t!==-Number.MAX_VALUE,E=n>1&&n!==Number.MAX_VALUE,C=S||E}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let h=null,f=null;void 0!==p.binStart?(h=t.binStart,f=t.binEnd,y=p.binStart.scale):(y=p.major.scale,h=y?t.major:0);let A=0;y?y.bandwidth?(A=y.bandwidth(),h-=A/2):A=f-h:A=1,b=ID({},{major:h,majorEnd:f},i.minor.items[e]);for(let t=0;t<M;t++)b[o[t]]=i[o[t]].items[e];if(v=Uz(A,b,d),x=(A-v)/2,w=x+b.major+v/2,R(),C)b.oob&&(S?g.push($z({item:b,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})):E&&g.push($z({item:b,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})));else for(let e=0;e<_;e++)b[m[e]]&&!1===b[m[e]].show||k[m[e]]();const I={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(I)}return s}({width:n,height:r,flipXY:i,resolved:u,keys:l,symbol:s});return h}};const Jz={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},Zz=/px$/,Qz={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},eB={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function tB(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function nB(e,t,n,r){let{width:i,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,a=Zz.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);qD(a)&&(t=Jz,a=n.min+t.size*(n.max-n.min));const[s,l]=function(e){let t=Qz.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=OD(OD({},l),{},{type:s,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(c.width=t.width);const u=r(c);return u.data=e.data,u}))}const rB={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:ID({},Qz,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:r,height:i}=this.rect,o=ID({},eB,this.settings.settings.sizeLimits),a=n.items,s=function(e,t,n,r,i){const o=tB(e?e.scale:void 0,n),a=tB(t?t.scale:void 0,r);let s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,r,i,o);return nB(a,this.rect,s,this.settings.shapeFn||this.symbol)}};const iB={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function oB(e,t,n,r){let{x:i,y:o,width:a,height:s}=t;const l=gP(),c={x:i+a/2,y:o+s/2},u=Math.min(a,s)/2,d=Math.min(a,s)/2,p=d/100;return e.map(((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,a=u*i.innerRadius,s=p*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;const h=l.centroid(e),f=i.offset?function(e,t,n,r){let[i,o]=e;const a=Math.sqrt(i*i+o*o);i/=a,o/=a;const s=n-r;return{x:i*t*s,y:o*t*s}}(h,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(f.x,", ").concat(f.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+f.x,y:c.y+f.y}}},i}))}function aB(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const sB={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],r=[],i=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:ID({},iB,this.style.slice),settings:i.slice});let a=0;for(let e=0,t=o.length;e<t;e++){const t=aB(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),a+=t)}const s=function(){var e=EP,t=SP,n=null,r=JD(0),i=JD(lP),o=JD(0);function a(a){var s,l,c,u,d,p=a.length,h=0,f=new Array(p),m=new Array(p),g=+r.apply(this,arguments),y=Math.min(lP,Math.max(-lP,i.apply(this,arguments)-g)),b=Math.min(Math.abs(y)/p,o.apply(this,arguments)),v=b*(y<0?-1:1);for(s=0;s<p;++s)(d=m[f[s]=s]=+e(a[s],s,a))>0&&(h+=d);for(null!=t?f.sort((function(e,n){return t(m[e],m[n])})):null!=n&&f.sort((function(e,t){return n(a[e],a[t])})),s=0,c=h?(y-p*v)/h:0;s<p;++s,g=u)l=f[s],u=g+((d=m[l])>0?d*c:0)+v,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:u,padAngle:b};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:JD(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:JD(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:JD(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:JD(+e),a):o},a}().sortValues(null);s.startAngle(i.startAngle),s.endAngle(i.endAngle),s.padAngle(i.padAngle);return oB(s(n),ID({},this.rect,{x:0,y:0}),r,a)}};const lB=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class cB{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[cB.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const a=cB.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return r&&lB(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function uB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cB(...t)}function dB(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const pB={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=uB(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,QF(this,"x",this.rect.width),QF(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=ID({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=ID({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=dB(this.x,this.rect.width),this.lines.y=dB(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>ID(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,r=this.lines[t].filter((e=>!!e.isMinor===n)),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach((e=>{let n=e.data;var r,i;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function hB(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function fB(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return t+=i?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function mB(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function gB(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function yB(e){let{chart:t,blueprint:n,renderer:r,p:i,settings:o,items:a,slopeLine:s}=e,l=!0,c=!1,u=!1,d=!1,p=!1,h=ID(!0,{},o.style.line,i.line||{}),f=ID(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:h.stroke});if(c=s?n.processItem({type:"line",x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,stroke:h.stroke||"black",strokeWidth:h.strokeWidth||1,strokeDasharray:h.strokeDasharray,flipXY:!1,value:i.valueInfo?i.valueInfo.id:i.value}):n.processItem({type:"line",x1:i.position,y1:0,x2:i.position,y2:1,stroke:h.stroke||"black",strokeWidth:h.strokeWidth||1,strokeDasharray:h.strokeDasharray,flipXY:i.flipXY||!1,value:i.valueInfo?i.valueInfo.id:i.value}),i.label){const e=ID(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:h.stroke},i.label);let s,c={width:0,height:0},f="";s=mB(i,t),!1!==i.label.showValue&&(s?f=" (".concat(s(i.value),")"):i.scale&&(f=" (".concat(i.value,")"))),f&&(c=r.measureText({text:f,fontFamily:e.fontFamily,fontSize:e.fontSize}));let m=r.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:m.width+c.width,height:Math.max(m.height,c.height)},y=e.padding,b=gB(i.flipXY?e.vAlign:e.align),v=gB(i.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*n.width,e.maxWidthPx),w=g.height+2*y,S=i.flipXY?w:x,E=i.flipXY?x:w;if(u=n.processItem({fn:t=>{let{width:r,height:o}=t,a=i.position*r-(i.flipXY?w:x)*(1-b);a=i.flipXY?a:Math.max(a,0);return{type:"rect",x:a,y:Math.max(Math.abs(v*o-E*v),0),width:i.flipXY?S:Math.min(S,n.width-a),height:E,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:i.flipXY||!1}),u.x<-1||u.x+u.width>n.width+1||u.y<-1||u.y+u.height>n.height+1)u=void 0;else{d={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:u.x+y,y:u.y+u.height/2+g.height/3,maxWidth:u.width-2*y-c.width,anchor:"start"},f&&(p={type:"text",text:f||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:d.x+3+(u.width-(c.width+2*y)),y:d.y});for(let e=0,t=a.length;e<t;e++){let t=a[e];"rect"===t.type?Yj(u,t)&&(l=!1):"line"===t.type&&i.flipXY===t.flipXY&&Jj(u,t)&&(l=!1)}}}if(a.push(c),0!==(null==s?void 0:s.slope)&&(null!=s&&s.showLabel||null!=s&&s.showValue)){let e,o;const l=120;let u=s.showLabel?s.refLineLabel:"";if(s.showValue){const n=mB(i,t),r=n?n(s.value):s.value;e="(".concat(s.slope,"x + ").concat(r,")"),u+=s.refLineLabel?" ".concat(e):e}if(u.length>1){var m;const e=r.measureText({text:u,fontFamily:f.fontFamily,fontSize:f.fontSize});e.width=e.width>l?l:e.width;const i=s.slope>0&&!s.isRtl?4*f.padding:f.padding/2,d=s.slope>0?3*f.padding:f.padding,p=function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});if(t>0){if(r.max()*t+n>=i.max())return!0}else if(t<0&&r.max()*t+n<=i.min())return!0;return!1}(t,s.slope,s.value)?function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});return r(t<0?(i.min()-n)/t:(i.max()-n)/t)}(t,s.slope,s.value):void 0,g=void 0===p?Math.abs(c.y2):1,y=function(e,t,n,r,i,o){return e.slope>0?n<.8?e.isRtl?n*i.width-(r.width+o.padding):n*i.width:n>.8?e.isRtl?n*i.width+(r.width+2*o.padding):n*i.width-(r.width+6*o.padding):1===n?e.isRtl?n*i.width+(r.width+3*o.padding):n*i.width-(r.width+6*o.padding):t.x2-(r.width+2*o.padding):e.isRtl?t.x1-(r.width+2*o.padding):t.x1}(s,c,p,e,n,f),b=s.slope>0?g:c.y1;s.labelStroke&&(o={type:"rect",x:s.isRtl?Math.max(y,i)-2:Math.max(y,i)+2,y:Math.abs(Math.max(b,d)-e.height),rx:3,ry:3,width:e.width+f.padding,height:e.height-2,stroke:h.stroke,fill:h.stroke});const v={type:"text",text:u,fill:null!==(m=s.labelStroke)&&void 0!==m?m:h.stroke,opacity:f.opacity,fontFamily:f.fontFamily,fontSize:f.fontSize,x:o?o.x+2:Math.max(y,i)+2,y:o?o.y+e.height-f.padding:Math.abs(Math.max(b,d)-f.padding/2),anchor:"start",title:u,maxWidth:l,width:e.width};(function(e,t,n,r,i,o,a){for(let s=0,l=e.length;s<l;s++){const l=e[s];if("text"===(null==l?void 0:l.type))if(n>0&&void 0!==i){if(Math.abs(l.x-t.x)<l.width+o&&Math.abs(l.y-t.y)<r.height+a)return!0}else if(Math.abs(l.y-t.y)<r.height+a)return!0}return!1})(a,v,s.slope,e,p,i,d)||(o&&a.push(o),a.push(v))}}l&&u&&d&&(a.push(u,d),p&&a.push(p))}function bB(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function vB(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function xB(e,t){const n=e.min();if(n===e.max()){const r=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}const wB={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=uB(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(vB).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=xB(t,e.value);return ID(e,{scale:t,position:n})}return ID(e,{position:e.value})})),this.lines.y=this.lines.y.filter(vB).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=xB(t,e.value);return ID(e,{scale:t,position:n,flipXY:!0})}return ID(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(bB(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(bB(e)),!1))));let n=[];return[...this.lines.x,...this.lines.y].forEach((r=>{if(!0===r.show||void 0===r.show){let i;if(r.slope&&0!==r.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max();i=OD({},r),i.x1=xB(e,o),i.x2=xB(e,a);const s=o*r.slope+r.value,l=a*r.slope+r.value;if(i.y1=xB(n,s),i.y2=xB(n,l),i.y1>1&&i.y2>1)return r.slope,void t["y".concat(i.y1>1?1:0)].push(bB(r));if(i.y1<0)return void t["y".concat(i.y1>1?1:0)].push(bB(r))}else i=void 0;yB({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:r,settings:e,items:n,slopeLine:i})}})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:r,items:i}=e;const o=Object.keys(n);let a=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],s=n[r];if(s.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:r,height:i}=t,u=e*r+("1"===e?-o:o),d=n?l:i-l;return"arc"===a.type?{type:"path",d:hB(n?d:u,n?u:d,a.width,c),x:u,y:d,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),d=u.cx||u.x,p=u.cy||u.y,h={type:"text",text:s.length||"",x:d-.4*a.width,y:p+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},f={type:"path",d:fB(d,p,a.width,c),x:d,y:p,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(u,h,f)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function SB(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){ID(e,t.style)}(t,e),t}function EB(e){return"string"==typeof e||"number"==typeof e?e:"-"}function CB(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map((e=>wj(e,r,{x:t.x,y:t.y}))),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},p=r>=0?[u,d]:[d,u];c.push(...p),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function MB(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function _B(e,t){var n,r;const i={type:"text",text:EB(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+MB(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+MB(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,a=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,a=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>r&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){const n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),CB(e,i,t),i}function kB(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){ID(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function RB(e){return!e.isMinor&&e.position>=0&&e.position<=1}function AB(e){let{rect:t,state:n,majorTicks:r,measure:i,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:r,state:i}=e;const o="layered"===i.labels.activeMode?2:1,a=r.width,s=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*a*Math.abs(n.start-n.end)<s[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:r}=e;const i=r.height,o=n("M").height;return!(t.length<2)&&i*Math.abs(t[0].position-t[1].position)<o}({majorTicks:r,measureText:i,rect:t})}function IB(e){let{value:t,maxValue:n,minValue:r,range:i,modifier:o}=e;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function LB(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:d}=a.labels;if(a.labels.show){const e=a.align,p="top"===e||"bottom"===e,h=p?n.inner.width:n.inner.height,f=o.ticks({settings:a,distance:h,formatter:r}).filter(RB),m=e=>{const t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=IB({value:t.width,maxValue:u,minValue:d}),t};if(t&&p&&"auto"===a.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:r,state:i,settings:o}=e;const a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,p=0;if(isNaN(a))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(p=s*u*Math.abs(r.start-r.end),o+c>p)return!0}else{const e=t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0);if(p=s*u*e,d=n("M").width*l*a,d+c>p)return!0}return!1}({majorTicks:f,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&AB({rect:n.inner,state:s,majorTicks:f,measure:m,horizontal:p})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>IB({value:t.width,maxValue:u,minValue:d})*Math.sin(e)+t.height*Math.cos(e)}else g=p?e=>e.height:e=>IB({value:e.width,maxValue:u,minValue:d});if(p&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=f.map((e=>e.label));else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const b=y.map(m),v=b.map(g),x=Math.max(...v,0);if(l+=x,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=f[r]?f[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...b.map(i).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:r,bleedSize:i,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:f,measureText:m,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const DB=(e,t,n)=>e.width*Math.abs(t.position-n.position);function PB(e){let{layered:t,major:n,innerRect:r,outerRect:i,tick:o,index:a}=e;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?DB(r,o,l)/2-2:1/0,d=c?DB(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,d):(e=>{let{innerRect:t,outerRect:n,tick:r,prevWidth:i}=e;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:r,nextWidth:i}=e;const o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function OB(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function TB(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=OB(e)+e.labels.margin,t}function NB(e,t){return e.map((e=>kB(e,t)))}function qB(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function FB(e){let{textMetrics:t,settings:n,innerRect:r,scale:i,tilted:o,layered:a,tick:s}=e;const l=t.height,c=qB(i,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-TB(n)-n.paddingEnd;else if(a)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-TB(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=IB({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function jB(e){let{textMetrics:t,settings:n,innerRect:r,outerRect:i,tilted:o,layered:a,tick:s,index:l,major:c}=e;const u=t.height,d={width:0,height:u};if("left"===n.align||"right"===n.align)d.width=r.width-TB(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-TB(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=PB({layered:a,major:c,innerRect:r,outerRect:i,tick:s,index:l});return d.width=IB({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function zB(e){let t;function n(){return t=jB,n}function r(){return t=FB,r}function i(e){let{settings:n,scale:r,innerRect:i,outerRect:o,measureText:a,ticks:s,state:l,textBounds:c}=e;const u=[],d=function(e){return e.filter((e=>!e.isMinor))}(s),p=function(e){return e.filter((e=>e.isMinor))}(s),h={innerRect:i,align:n.align,outerRect:o},f="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.line.show&&(h.style=n.line,h.padding=n.paddingStart,u.push(SB(h))),n.ticks.show&&(h.style=n.ticks,h.tickSize=n.ticks.tickSize,h.padding=OB(n),g=NB(d,h)),n.labels.show){const e=TB(n);h.style=n.labels,h.padding=e,h.tilted=f,h.layered=m,h.angle=n.labels.tiltAngle,h.paddingEnd=n.paddingEnd,h.textBounds=c;const s=(e,s)=>{h.textRect=function(e){let{style:t,measureText:n,tick:r}=e;return n({text:r.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:h.style});const l=t({textMetrics:h.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:f,layered:m,tick:e,major:d,index:s});h.maxWidth=l.width,h.maxHeight=l.height,h.stepSize=function(e){let{innerRect:t,scale:n,settings:r,tick:i}=e;return("top"===r.align||"bottom"===r.align?t.width:t.height)*qB(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=_B(e,t);return i.data=e.data,i}))}(d,h,s):function(e,t,n,r){const i=t.padding,o=TB(n);return e.map(((e,a)=>{r(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;const l=_B(e,t);return l.data=e.data,l}))}(d,h,n,s),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>Yj(HD(1,e[t].boundingRect),HD(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,h),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&p.length>0&&(h.style=n.minorTicks,h.tickSize=n.minorTicks.tickSize,h.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...NB(p,h))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const BB={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},WB={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const $B={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:r}=e;const i=ID(!0,{},t.isDiscrete?BB:WB,n),o=ID(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:s,paddingEnd:l}=o;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=zB(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:r}=this,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=ej(r,i);const o=function(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s}=e,l=0;const{size:c,edgeBleed:u,isToLarge:d}=LB({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s});if(l+=c,d)return{size:l};if(a.ticks.show&&(l+=a.ticks.margin,l+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>l&&(l=e)}if(a.line.show){const e=a.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(e)}return l+=a.paddingStart,l+=a.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,r=ID({},t,function(e){let{align:t,inner:n}=e;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return ID(this.state.innerRect,r),ID(this.state.outerRect,i),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=ej(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),lB.multiple(t),t}};const HB={render:()=>[]};function VB(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));r=e.join(t)}return r}function GB(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const UB={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=VB(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const{title:e,definitionSettings:t,rect:n}=this,r=[];return r.push(function(e){let{title:t,definitionSettings:n,dock:r,rect:i,measureText:o,style:a}=e;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:GB(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};ID(s,a.text);const l=o(s);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),s.x=e,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),s.y=e,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;s.transform="rotate(".concat(t,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate(e){e.settings&&(ID(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=VB(t,n,this.scale)}};function YB(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[i?"x":"y"];if(r&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),r=l.startScroll+e;s.moveTo(r)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function KB(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const XB={require:["chart","renderer"],on:{panStart(e){const t=KB(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=YB(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=KB(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=KB(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=KB(e,this.renderer);YB(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[r?"left":"top"]:"".concat(s,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function JB(e){let{h:t,isVertical:n,value:r,pos:i,align:o,borderHit:a,state:s,idx:l}=e;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,p="100%",h="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(p="".concat(s.targetRect.x+s.targetRect.width,"px"),h="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(d=n?s.targetRect.x:s.targetRect.y,p="".concat(s.rect.width-d,"px"),h="".concat(s.rect.height-d,"px")),c||(i-=a),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:i,"px"),top:"".concat(n?i:d,"px"),height:n?"".concat(a,"px"):h,width:n?p:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:ID({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function ZB(e){let{h:t,isVertical:n,label:r,otherValue:i,rangeIdx:o,idx:a,pos:s,align:l,state:c,value:u}=e;const d="end"!==l,p="outside"===c.settings.bubbles.placement;let h,f="none";n?(h=d?"left":"right",p&&(f=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(h=d?"top":"bottom",p&&(f=d?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const b=m?t("input",{type:"text",value:u,style:OD(OD({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":a,style:g},[r]);return t("div",{style:{position:"absolute",[h]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:f}},[b])}function QB(e){let{h:t,isVertical:n,top:r,height:i,color:o,on:a,opacity:s}=e;return t("div",ID({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function eW(e){let{borderHit:t,els:n,isVertical:r,state:i,vStart:o,vEnd:a,idx:s}=e,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,d=c?i.scale.norm(a)*i.size:a,p=Math.abs(u-d),h=Math.min(u,d)+l,f=h+p;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,s=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(a)*t:a,u=Math.abs(s-l),d=Math.min(s,l),p={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(p.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[QB(p)]))}const m=u<d?o:a,g=u<d?a:o,[y,b]=c?i.scale.domain():[Math.min(o,a),Math.max(o,a)],v=m+1e-5>=y&&m-1e-5<=b,x=g-1e-5<=b&&g+1e-5>=y;v&&n.push(JB({h:i.h,isVertical:r,borderHit:t,value:m,pos:h,align:"start",state:i,idx:s})),x&&n.push(JB({h:i.h,isVertical:r,borderHit:t,value:g,pos:f,align:"end",state:i,idx:s}));const w=i.settings.bubbles;if(w&&w.show){w.fontSize,w.fontFamily,w.fill;const e=[o,a];v&&n.push(ZB({h:i.h,isVertical:r,align:w.align,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:h,state:i})),x&&n.push(ZB({h:i.h,isVertical:r,align:w.align,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:f,state:i}))}}function tW(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function nW(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((r,i)=>{e.active&&i===e.active.idx||eW({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})})),e.active){let r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{const t=tW(e);r=e.active.start+t,i=e.active.end+t}eW({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function rW(e){return{min:e.scale.min(),max:e.scale.max()}}function iW(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function oW(e,t,n){let r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function aW(e){e.renderer.render(nW(e))}function sW(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}function lW(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let a=0;a<i.length;++a){const s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function cW(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function uW(e){const t=e.reduce(((e,t)=>(e.push(...zD(t.bounds)),e)),[]);return BD(t)}const dW={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=sW(this.state,this.state.brushInstance),this.state.active=null,aW(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=ej(this.chart.scale(t.scale),r);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){const r=uW(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=ej(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=uW(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)})),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,r){let i=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=OD({},i[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)}))}(this.state,e,t,n),this.emit("bubbleEnd"),aW(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,aW(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=i;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=rF(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>cW(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(lW(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=BF(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach((e=>{if(!cW(r,[e.min,e.max]))return;const o=n.indexOf(lW(e.min,t)),a=n.indexOf(lW(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))})),i}(e,i);return this.state.ranges=sW(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[nW(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;t.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=ID({},r.element().getBoundingClientRect());const u=a-t.offset.left,d=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);const p=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(h/t.size),c.start=t.scale.normInvert(p/t.size);let f=t.ranges;const m=rW(t);let g,y,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),m.min=b>0?f[b-1].max:m.min,m.max=b+1<f.length?f[b+1].min:m.max;else{for(g=0;g<f.length;g++){if(f[g].min<=c.start&&c.start<=f[g].max){b=g,m.min=g?f[g-1].max:m.min,m.max=g+1<f.length?f[g+1].min:m.max;break}if(c.start<f[g].min){m.max=f[g].min,m.min=g?f[g-1].max:m.min;break}}-1===b&&f.length&&g>=f.length&&(m.min=f[f.length-1].max)}if(-1!==b||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==b)if(y={idx:b,start:f[b].min,end:f[b].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(p-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(p-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!Xj(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:sW,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=rW(e);oW(e,e.current,n)}(this.state,sW),aW(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=tW(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let r=sW(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter((e=>-1===i.indexOf(e))),s=i.filter((e=>-1===o.indexOf(e))),l=a.map((e=>({key:n.id(),value:e}))),c=s.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),aW(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(r.rangeIdx)||JSON.stringify(r)===JSON.stringify(this.state.edit))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;aW(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function pW(e){e.renderer.render(nW(e))}function hW(e){return e.rc.ranges()}function fW(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const mW={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,r=this.state.rect[0===n?"height":"width"],i=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),a=o[0]?o.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)})),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=AF(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const r=Math.min(...n),i=Math.max(...n),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce(((n,i)=>{const o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i})),l=e.settings.brush.components.reduce(((e,t)=>e.key===s.key?e:t));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=a-t.offset.left,d=s-t.offset.top,p=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let f=h,m=p;c.start=p,c.current=h;let g=t.ranges;const y=iW(t);let b,v,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(b=0;b<g.length;b++){if(g[b].min<=m&&m<=g[b].max){x=b,y.min=b?g[b-1].max:y.min,y.max=b+1<g.length?g[b+1].min:y.max;break}if(m<g[b].min){y.max=g[b].min,y.min=b?g[b-1].max:y.min;break}}-1===x&&g.length&&b>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(v={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let e=v.start,t=v.end;Math.abs(p-e)<=o?(c.start=v.end,v.mode="modify"):Math.abs(p-t)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:m,end:f,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=v,"modify"!==v.mode&&t.targetRect&&!Xj(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:hW,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=iW(e);oW(e,e.current,n)}(this.state,hW),pW(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=tW(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach((t=>{n=[...n,...fW(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),pW(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function gW(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}(e).map((i=>{const o=e.scale(i.min)*n,a=e.scale(i.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?r:l,y:t?s:0,height:t?l:r}}))}function yW(e,t,n,r){function i(){!function(e){e.renderer.render(gW(e))}(e)}function o(){!function(e){e.renderer.render(gW(e))}(e)}function a(){!function(e){e.renderer.render(gW(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function bW(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const vW={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=ej(this.chart.scale(e.scale),r);return bW(this.state),yW(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,gW(this.state)},beforeDestroy(){bW(this.state)}};function xW(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function wW(e,t,n){return bj(e,t.points[0])<n.settings.snapIndicator.threshold**2}function SW(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function EW(e){let{state:t,start:n=null,end:r=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==r&&(t.snapIndicator.x2=r.x,t.snapIndicator.y2=r.y)}function CW(e,t){e.snapIndicator.visible=t}const MW={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})))}(this.settings);const n=xW(this.state.rendererBounds,e);SW(this.state,n),EW({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=xW(this.state.rendererBounds,e);wW(t,this.state,this.settings)?CW(this.state,!0):CW(this.state,!1),SW(this.state,t),EW({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;CW(this.state,!1);wW(xW(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map((e=>({x:e.x+n,y:e.y+r}))),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function _W(e,t,n,r,i){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=i(t[l]),o[n]+o[r]<e[n]?a=l+1:s=l}return a}function kW(e){let{orientation:t,targetNodes:n,labels:r,container:i}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_W;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:d,node:p}=r[t];if(d[s]<i[s]||d[s]+d[l]>i[s]+i[l])return!1;for(let e=o(d,a,s,l,c);e<a.length;e++)if(Yj(d,a[e].textBounds))return!1;const h=o(d,n,s,l,u),f=d[s]+d[l];for(let e=h;e<n.length;e++){const t=n[e].node;if(f<t.localBounds[s])break;if(Yj(d,t.localBounds)&&p!==t)return!1}return a.push(r[t]),!0}}const RW=4;function AW(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function IW(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function LW(e){return OD(OD({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function DW(e,t,n){return n?e.width>=t.height:e.width>=t.width}function PW(e,t,n){return n?e.height>=t.width:e.height>=t.height}function OW(e,t,n,r,i){let o,a;return"v"===e?(o=r||i||DW(t,n,!0),a=PW(t,n,!r)):(o=DW(t,n),a=i||PW(t,n,!1)),o&&a}function TW(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function NW(e,t,n){const r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return DW(e,t,n.rotate)&&PW(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=TW(e.x,e.width,i.height,n.align)+o,r.y=TW(e.y,e.height,i.width,n.justify),r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=TW(e.x,e.width,i.width,n.align),r.y=TW(e.y,e.height,i.height,n.justify)+o),r}function qW(e){let{bar:t,view:n,direction:r,position:i,padding:o=RW}=e;const a={};if(ID(a,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(a.y=0,a.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(a.y=o,a.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(a.x=0,a.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(a.x=o,a.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(a,n),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{top:n=RW,bottom:r=RW,left:i=RW,right:o=RW}=t;e.x+=i,e.width-=i+o,e.y+=n,e.height-=n+r}(a,o),a}function FW(e){let t,n,r,i,o,{direction:a,fitsHorizontally:s,measured:l,node:c,orientation:u,placementSettings:d,rect:p}=e,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qW;const f=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=h({bar:c.localBounds,view:p,direction:a,position:r.position,padding:r.padding}),f.push(i),t=!o||i[m]>t[m]?i:t,OW(u,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=f.indexOf(n)),r=d[o],{bounds:n,placement:r}}function jW(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=RW,bottom:a=RW,left:s=RW,right:l=RW}=i,c=e.x+e.dx,u=e.y+e.dy,d=n?Math.min(t.width,r.height):Math.min(t.height,r.width),p=n?Math.min(t.height,r.height):Math.min(t.width,r.width),h=.5*t.height,f=1e-9;return{x:(n?c-h:c)-s-f,y:(n?u:u-h)-o-f,width:p+(s+l)-f,height:d+(o+a)-f}}function zW(e){let{chart:t,targetNodes:n,rect:r,fitsHorizontally:i,collectiveOrientation:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:FW,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NW,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:kW;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,p,h,f,m,g,y,b,v,x,w,S,E,C;for(let e=0,l=n.length;e<l;e++){g=null,p=n[e],h=p.node,E=AW(h,t),v=p.direction,C="left"===v||"right"===v?"h":"v";for(let t=0;t<p.texts.length;t++){if(f=p.texts[t],!IW(f))continue;x=p.labelSettings[t],b=p.measurements[t],S=x.placements;const n=a({direction:v,fitsHorizontally:i,lblStngs:x,measured:b,node:h,orientation:C,placements:S,placementSettings:p.placementSettings[t],rect:r});if(g=n.bounds,w=n.placement,g&&w){m=w.justify;const t="function"==typeof x.linkData?x.linkData(E,e):void 0,n="function"==typeof w.overflow?w.overflow(E,e):w.overflow;"up"===v&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===v&&(m=1-m);const r=!("h"===o||i);if(d=s(g,f,{justify:"h"===C?w.align:m,align:"h"===C?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:b,rotate:r,overflow:!!n}),d){const n=jW(d,b,r,g,w.padding);y="function"==typeof w.fill?w.fill(OD(OD({},E),{},{textBounds:n}),e):w.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof w.background&&(d.backgroundColor="function"==typeof w.background.fill?w.background.fill(OD(OD({},E),{},{textBounds:n}),e):w.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=jW(d,b,r,g,w.background.padding))),c.push(d),u.labels.push({node:h,textBounds:n})}}}}const M=c.filter(l(u));return[...M.filter((e=>void 0!==e.backgroundBounds)).map(LW),...M]}function BW(e){const t=2*Math.PI;return(e%t+t)%t}function WW(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function $W(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function HW(e,t,n){let{x:r,y:i}=t;if(r*r+i*i>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function VW(e){let t,n,{radius:r,size:i,angle:o}=e,{width:a,height:s}=i,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=HW(r,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=HW(r,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=HW(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=HW(r,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function GW(e){let{slice:t,measured:n,padding:r}=e,{start:i,end:o,innerRadius:a,outerRadius:s}=t,l=s-a-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>a&&(l=s-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=BW((i+o)/2);let d=s-r,p={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(p.angle=u-Math.PI/2,p.anchor="end"):(p.angle=u+Math.PI/2,p.anchor="start"),p}function UW(e){let{context:t,node:n,bounds:r}=e;let{start:i,end:o}=n.desc.slice;const a=BW((i+o)/2);switch(Math.floor(a/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function YW(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function KW(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function XW(e){let t,n,{slice:r,direction:i,position:o,padding:a,measured:s,view:l,context:c,store:u}=e,{start:d,end:p,innerRadius:h,offset:f}=r;switch(o){case"into":t="rotate"===i?GW({slice:r,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:r}=e,{start:i,end:o,innerRadius:a,outerRadius:s}=t;const l=BW((i+o)/2);let c=VW({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",Jj(c,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||Jj(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||Wj({cx:0,cy:0,r:a},c)?null:(WW(c,n),c)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:p,innerRadius:0,outerRadius:h},t="rotate"===i?GW({slice:n,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:r,store:i}=e;const{start:o,end:a,outerRadius:s}=t,l=BW((o+a)/2);let c=VW({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",WW(c,n),i.insideLabelBounds.some((e=>Yj(e,c)))?null:(i.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":t="rotate"===i?function(e){let{slice:t,measured:n,padding:r,view:i}=e,{start:o,end:a,outerRadius:s,offset:l}=t,c=s+r,u=a-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=BW((o+a)/2);let p=Math.sin(d)*c,h=-Math.cos(d)*c,f=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=h<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;t<f&&(f=t)}if(Math.sin(m)>.001){let e=p<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;t<f&&(f=t)}if(f<=0||f<n.minReqWidth)return null;let g={x:p,y:h,width:f,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:s,padding:a,view:l}):function(e){let{slice:t,measured:n,padding:r,view:i,context:o}=e,{start:a,end:s,outerRadius:l,offset:c}=t;const u=BW((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),i))return null;let d=l+r+n.height/2,p=Math.sin(u)*d,h=-Math.cos(u)*d,f=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(p+c.x));e<f&&(f=e)}else{let e=Math.abs(i.x-(p+c.x));e<f&&(f=e)}if(f<n.minReqWidth)return null;let m={x:p,y:h,width:f,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=f.x,t.y+=f.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const{start:r,end:i,offset:o,outerRadius:a}=n,s=BW((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,r)),t}function JW(e){let{context:t,direction:n,measured:r,node:i,placementSettings:o,rect:a,store:s}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:XW;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function ZW(e,t,n){const r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}const QW=/\n+|\r+|\r\n/,e$=/\s/,t$=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function n$(e){return"string"==typeof e?-1!==e.search(QW):-1!==String(e).search(QW)}function r$(e){return-1!==e.search(e$)}function i$(e){return-1!==e.search(t$)}function o$(e,t,n){return Math.max(t,Math.min(n,e))}function a$(){let{string:e,separator:t="",reverse:n=!1,measureText:r=e=>({width:e.length,height:1}),mandatoryBreakIdentifiers:i=[n$],noBreakAllowedIdentifiers:o=[],suppressIdentifier:a=[r$,n$,e=>""===e],hyphenationIdentifiers:s=[i$]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let d=n?c:-1;function p(e){const t=o$(e,0,c-1),n=l[t],u=r(n),d=function(e,t,n,r,i){return r.some((r=>r(e,t,n)))?1:i.some((r=>r(e,t,n)))?0:2}(n,t,l,i,o);return{index:t,value:n,breakOpportunity:d,suppress:a.some((e=>e(n,t,l))),hyphenation:s.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?d--:d++:d=o$(e,0,c-1),u(d)?p(d):{done:!0}},peek:p,length:c}}const s$="…",l$=/^\s*\d+(\.\d+)?px\s*$/i;function c$(e){return"string"===typeof e&&l$.test(e)}function u$(e){const t=e["font-size"]||e.fontSize;return c$(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function d$(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=u$(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function p$(e,t){return{lines:[],line:"",width:0,maxLines:d$(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function h$(e){e.lines.push(e.line),e.line="",e.width=0}function f$(e,t){e.line+=t.value,e.width+=t.width}function m$(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function g$(e,t,n){const r=a$({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?m$(e,t,r):t,h$(e),f$(e,t)):f$(e,t)}}function y$(e,t){const n=a$({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=p$(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){h$(r),i=!1;break}1===e.breakOpportunity?h$(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?m$(r,e,n):e,h$(r),f$(r,e)):f$(r,e)}return{lines:r.lines,reduced:i}}function b$(e,t){const n=a$({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=p$(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){h$(r),i=!1;break}1===e.breakOpportunity?h$(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?h$(r):e.width>r.maxWidth?g$(r,e,t):(h$(r),f$(r,e)):f$(r,e)}return{lines:r.lines,reduced:i}}function v$(e){return{"break-all":y$,"break-word":b$}[e.wordBreak]}function x$(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=v$(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||n$(n.text)){const o=(u$(n)-i.height)/2,a=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach(((a,s)=>{const l=ID({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=s$:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)})),i}(a,n,o,i.height)}}}}function w$(e,t){let{text:n,"font-size":r,"font-family":i,maxWidth:o}=e;if(n="string"==typeof n?n:"".concat(n),void 0===o)return n;let a=t({text:n,fontSize:r,fontFamily:i}).width;if(a<=o)return n;let s=0,l=n.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:n.substr(0,e)+s$,fontSize:r,fontFamily:i}).width,a<=o?s=e+1:l=e-1}return n.substr(0,l)+s$}function S$(e){const t=e.baseline||e["dominant-baseline"];let n=0;const r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}const E$={},C$={},M$={fontSize:void 0,fontFamily:void 0};let _$;function k$(e,t,n){const r=e+t+n;return"number"!=typeof C$[r]&&(_$=_$||document.createElement("canvas").getContext("2d"),function(e,t){M$.fontSize===e&&M$.fontFamily===t||(_$.font=e+" "+t,M$.fontSize=e,M$.fontFamily=t)}(t,n),C$[r]=_$.measureText(e).width),C$[r]}function R$(e){return"number"!=typeof E$[e]&&(E$[e]=function(e){if(c$(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),E$[e]}function A$(e){let{text:t,fontSize:n,fontFamily:r}=e;return{width:k$(t,n,r),height:R$(n)}}function I$(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A$;const n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+S$(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function L$(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A$;const n=v$(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||n$(e.text))){const o=n(e,(e=>t({text:e,fontFamily:i,fontSize:r}))),a=ID({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?s$:"";const c=t({text:a,fontSize:r,fontFamily:i}).width;c>=s&&(s=c,l=a)}a.text=l;const c=I$(a,t);return c.height=u$(e)*o.lines.length,c}return I$(e,t)}function D$(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function P$(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function O$(e){let{cx:t,cy:n,r:r}=e;return{type:"circle",bounds:{cx:t,cy:n,r:r}}}function T$(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:r,outerRadius:i,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==r?r:i;return O$({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?O$(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var N$={bar:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zW;const l=ID({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>ID({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>ID({},l,t,e,n))))),{fitsHorizontally:d,hasHorizontalDirection:p,targetNodes:h}=function(e){let{nodes:t,rect:n,chart:r,labelSettings:i,placementSettings:o,settings:a,renderer:s}=e;const l={},c=[];let u,d,p,h,f,m,g,y=!0,b=!1;for(let e=0;e<t.length;e++){if(d=t[e],h=d.localBounds,!Yj(h,n))continue;let v=AW(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],p="function"==typeof m.label?m.label(v,e):void 0,IW(p)&&(g="function"==typeof a.direction?a.direction(v,e):a.direction||"up",b=b||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=p,f=s.measureText(l),u.measurements.push(f),u.texts.push(p),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&f.width<=h.width-2*RW);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:b}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),f=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:p?"h":"v"}),m="h"===f?"y":"x",g="h"===f?"height":"width";return h.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[g]-(t.node.localBounds[m]+t.node.localBounds[g]))),s({chart:n,targetNodes:h,stngs:t,rect:i,fitsHorizontally:d,collectiveOrientation:f})},slice:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JW,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:KW;const c=ID({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>ID({},c,t,e))),d=t.labels.map((e=>e.placements.map((n=>ID({},c,t,e,n))))),p=[],h={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const{start:a,end:s}=e[o].desc.slice,l=BW((a+s)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}const o=(e,t)=>BW((e.desc.slice.start+e.desc.slice.end)/2)-BW((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),r.sort(a),i.sort(o),t.concat(n,i,r)}(r);const f={};for(let e=0,t=r.length;e<t;e++){const t=r[e],a=YW(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(a,e):"";if(!c)continue;const m="function"==typeof r.direction?r.direction(a,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(a,e):void 0,y=ZW(c,r,o),b=s({context:f,direction:m,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:h}),v=b.bounds,x=b.placement;if(v&&x){if("outside"===x.position&&"rotate"!==m){UW({context:f,node:t,bounds:v});if(!Oj($W(v),i))continue}const n="function"==typeof x.fill?x.fill(a,e):x.fill,o=l(v,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),p.push(o),v.line&&(v.line.stroke=n,p.push(v.line)))}}}return p},rows:function(e){let{settings:t,chart:n,nodes:r,renderer:i,style:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P$;const s=ID({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=ID({},s,t),c=t.labels.map((e=>ID({},l,e))),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=D$(t,n),{type:s,bounds:p}=T$(t);if(!p)continue;let h,f=0,m=[],g=[],y="circle"===s?2*p.r*.9:p.height;for(f+=l.padding,h=0;h<c.length;h++){let t=c[h],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let r=i.measureText(u);if(f+=r.height+t.padding,f>y)break;g.push(n),m.push(r)}const b=h,v=Math.max(0,y-f);let x;for(x="circle"===s?p.cy-.9*p.r:p.y,x+=l.justify*v+l.padding,h=0;h<b;h++){let t,n=c[h];if("circle"===s){let e=Math.max(Math.abs(x-p.cy),Math.abs(x+m[h].height-p.cy)),n=Math.sqrt(p.r*p.r-e*e);t={x:p.cx-n+l.padding,y:x,width:2*n-2*l.padding,height:m[h].height}}else t={x:p.x+l.padding,y:x,width:p.width-2*l.padding,height:m[h].height};x+=m[h].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let f=a(t,g[h],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[h]});if(f){if(f.text&&f.text!==s$){const e=w$(f,i.measureText);if(s$===e)continue;f.ellipsed=e}void 0!==u&&(f.data=u),d.push(f)}}}return d}};const q$={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&N$[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:r,rect:i,renderer:o,style:a}=e;if(!n.component(r.component))return[];const s=n.findShapes(r.selector).filter((e=>e.key===r.component));return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},N$[e.strategy.type]))})),t}};const F$={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25}};function j$(e){let{x:t=0,y:n,item:r,globalMetrics:i,createSymbol:o,direction:a="ltr"}=e,s=r.label.displayObject,l=r.label.bounds,c=r.symbol.meta;const u="rtl"===a;let d={x:u?t+i.maxLabelBounds.width:t+i.maxSymbolSize+i.spacing,y:n,width:i.maxLabelBounds.width,height:Math.max(i.maxSymbolSize,i.maxLabelBounds.height)},p=function(e,t,n){const r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:u?t+i.maxLabelBounds.width+i.spacing:t,y:n,width:i.maxSymbolSize,height:d.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const h=o(ID({},c,p));return delete h.collider,s.anchor=u?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(d,s,{textMetrics:l,fontSize:parseInt(s.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:r.label.displayObject.data,children:[h,s],collider:{type:"rect",x:t,y:n,width:i.maxItemBounds.width,height:i.maxItemBounds.height}},metrics:d}}function z$(e,t){const n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function B$(e,t){let n,r,i,o,{onScroll:a=()=>{}}=t,s=null,l=0;const c={itemize:t=>{n=function(e,t){let n,r,{resolved:i,dock:o}=e,a=[],s=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,p=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=ID({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),p=Math.max(r.label.bounds.height,p)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,p),width:u+8+d},maxLabelBounds:{width:d,height:p}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),s=isNaN(n.layout.scrollOffset)?s:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,l=c.getContentOverflow(i);const a=c.extent();s=Math.max(0,Math.min(s,l)),o=ID({},i);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=s,o["x"===u?"width":"height"]=a,function(e,t,n){let{viewRect:r}=e,{itemized:i,create:o=j$,parallels:a,createSymbol:s}=n;const l=i.layout.direction,c=i.globalMetrics,u=i.items,d="horizontal"===i.layout.orientation;let p=0;const h=[],f=c.maxItemBounds.height,m=c.maxItemBounds.width,g=i.layout.margin.vertical+f,y=i.layout.margin.horizontal+m;let b=t.x,v=t.y,x=r.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:v,x:"rtl"===l?r.x+x+r.width-m-(b-t.x):b,item:u[e],globalMetrics:c,direction:l,createSymbol:s});if((d&&b>=r.x-m||!d&&v>=r.y-f)&&h.push(n.item),p++,p>=a?(p=0,d?(b+=y,v=t.y):(v+=g,b=t.x)):d?v+=g:b+=y,!d&&v>r.y+r.height)break;if(d&&b>r.x+r.width)break}return h}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return z$(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,z$(n,r)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<i.x:o.y<i.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,s-e));t!==s&&(s=t,a())},offset:()=>s,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>z$(n,r),spread:()=>function(e,t){const n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)};return c}function W$(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const $$={up:"▲",right:"▶",down:"▼",left:"◀"};function H$(e,t){let{size:n,isActive:r,direction:i,nav:o,attrs:a}=t,s={},l="";const c=a;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:i}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(s).length||(u.border="0",u.background="none"),(!r||o&&o.disabled)&&(c.disabled="disabled"),e("button",ID({class:W$(s),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[$$[i]])])}function V$(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:r=>function(e,t,n,r){let{rect:i,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(i);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const d=s?["right","left"]:["down","up"];l&&s&&d.reverse();const p=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[H$(a,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),H$(a,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(p)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function G$(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const r=ID({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let{rect:r}=e;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(ID({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function U$(e,t,n,r){let i,o,a,{itemRenderer:s,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=r,d=0;const p={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:p.x,y:p.y,width:p.width,height:c.spread()},"horizontal"===n){i={x:p.x,y:p.y,width:c.extent(),height:c.spread()};const e=p.width-i.width-(i.width?t.spacing:0),n=p.height;s.parallelize(e,u?void 0:n);const r=s.extent()>e?l.extent():0,h=s.spread(),f=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:p.y+Math.max(0,(f-h)/2),width:p.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},a={x:o.x+o.width+(r?t.spacing:0),y:p.y,width:r,height:p.height},i.y=o.y;"rtl"===s.direction()&&(a.x=p.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),d=Math.max(i.height,f,s.spread())}else{const e=p.height-i.height-(i.height?t.spacing:0),n=p.width;s.parallelize(e,u?void 0:n);const r=s.extent()>e?l.extent():0;a={x:p.x,y:p.y+p.height-r,width:p.width,height:r},o={x:p.x,y:i.y+i.height+(i.height?t.spacing:0),width:p.width,height:p.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},d=Math.max(c.extent(),r?l.spread():0,s.spread())}return o=ID({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,i.x+=e.x,i.y+=e.y,{title:ID({},e,i),content:ID({},e,o),navigation:ID({},e,a),orientation:n,preferredSize:d}}function Y$(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const i=e.scale.datum?ID({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i}))}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:ID(!0,{},F$.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:F$.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:ID(!0,{},F$.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=ID(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:ID(!0,{},F$.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:ID(!0,{},{show:F$.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:i,labels:a,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function K$(e){const{rect:t,settings:n,state:r,itemRenderer:i,navigationRenderer:o,titleRenderer:a}=e,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=U$(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:ID({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),a.render({rect:c.title}),e.state.views={layout:c},u}const X$={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=K$(this);this.update(e)},this.itemRenderer=B$(this,{onScroll:this.onScroll}),this.navigationRenderer=V$(this),this.titleRenderer=G$(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Y$(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=U$(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){Y$(this)},render(){return K$(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function J$(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function Z$(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function Q$(e){return Z$(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function eH(e,t){const n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function tH(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String));const o=n.map(((n,i)=>{const o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}));return o}(e,i),a=function(e){return Z$(e.layout.dock,e.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"})}(e.settings);if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const s=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),l=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),c={isVertical:t,nodes:[],title:{anchor:Q$(e.settings),textMetrics:s,textBounds:l,requiredWidth:()=>{if(!n.show)return 0;let e=l.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,c.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=l.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...c.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return c}const nH={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=eH(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max(...t.ticks.values.map((e=>e.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=tH(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=tH(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=eH(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor;let o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return J$(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,r=t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))})));return r.sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return J$(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map((a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*a.textMetrics.height,i=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:c,text:a.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const rH={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function iH(e,t){let{generatorType:n,item:r,data:i,major:o,minor:a,layerObj:s,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function oH(e){const{metaLayers:t,coordinates:n,layers:r,lines:i,areas:o}=function(e){let{data:t,stngs:n,rect:r,resolver:i,style:o,domain:a}=e;const{width:s,height:l}=r,c=i.resolve({data:t,defaults:rH.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let p=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:p++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const h=Object.keys(d).map((e=>(d[e].consumableData=OD({points:d[e].dataItems},d[e].dataItems[0]),d[e]))),f={items:h.map((e=>e.consumableData))},m=n.layers||{};return{coordinates:c,metaLayers:h,layers:i.resolve({data:f,defaults:{curve:rH.layers.curve,show:rH.layers.show},settings:{curve:m.curve,show:m.show}}),lines:i.resolve({data:f,defaults:ID({},rH.layers.line,o.line),settings:m.line}),areas:i.resolve({data:f,defaults:ID({},rH.layers.area,o.area),settings:m.area})}}(e),a=[];return t.forEach(((t,s)=>{const l=r.items[s];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let d,p;for(let r=0;r<t.items.length;r++){if(d=t.items[r],p=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=n.settings.minor.scale?n.settings.minor.scale(p.minor0?p.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const h=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:i.items[s],areaObj:o.items[s],median:h,points:u,consumableData:t.consumableData})})),a}const aH={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:r}=this.rect;this.stngs=this.settings.settings||{};const i=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=oH({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:i,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:r,missingMinor0:i,stngs:o}=t;const a=[],s=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let d={size:r,p:"y"},p={size:n,p:"x"};if("vertical"===o.orientation){const e=ID(!0,{},p);p=ID(!0,{},d),d=ID(!0,{},e)}s.area&&!1!==c.show&&a.push(iH(u,{data:e.consumableData,item:c,generatorType:"area",major:p,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(iH(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:p,minor:d,layerObj:l,stngs:o},"none")),!i&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(iH(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:p,minor:d,layerObj:l,stngs:o},"none")))})),a}(o,{width:n,height:r,missingMinor0:i,stngs:this.stngs})}};function sH(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function lH(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function cH(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}const uH={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=sH(this,e,!1);Xj({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})))}(this.settings),this.state.start=sH(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=sH(this,e),function(e){if(e.state.active){const t=lH(e,e.state.start),n=lH(e,e.state.end),r=e.chart.shapesAt(cH(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([ID({type:"rect"},cH(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function dH(e,t,n){let{renderer:r,style:i,props:o,h:a}=n;const s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),c=a("div",{dir:o.direction,class:W$(ID({"pic-tooltip":!0},s.tooltip)),style:ID({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:W$(ID({"pic-tooltip-content":!0},s.content))},l),a("div",{class:W$(ID({"pic-tooltip-arrow":!0},s.arrow)),style:ID({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function pH(e){let{defaultDuration:t,defaultDelay:n}=e,r=null,i=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),s=function(){},l=()=>{r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout((()=>{e(),o=!0,r=null,a.set("active")}),c),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function hH(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function fH(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function mH(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function gH(e,t,n,r,i,o){const a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function yH(e){let{area:t,vx:n,vy:r,width:i,height:o,offset:a}=e;const s=n+a.x,l=r+a.y,c=i,u=o;let d=s<0?-s:0,p=l<0?-l:0;return d+=s+c>t.width?-(s+c-t.width):0,p+=l+u>t.height?-(l+u-t.height):0,{x:d,y:p}}function bH(e){let{options:t,pointer:n,width:r,height:i,dockOrder:o,x:a,y:s}=e;const{targetBounds:l}=n,c=hH(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:mH(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},p=fH(r,i,t.offset),h=[],f="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=yH({area:d,vx:f,vy:m,width:r,height:i,offset:p[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=mH(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,h.push(y)}return h.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),h[0]}function vH(e,t,n){const r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const i=r.rect;return ID({scaleRatio:i.scaleRatio},i.computedInner)}const xH={bounds:function(e){let{resources:t,nodes:n,pointer:r,width:i,height:o,options:a}=e;const{targetBounds:s}=r,{x:l,y:c,width:u,height:d}=t.getNodeBoundsRelativeToTarget(n[0]),p={left:{x:l,y:c+d/2},right:{x:l+u,y:c+d/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+d},inside:{x:l+u/2,y:c+d/2}},h=hH(a.offset),f=h[a.dock];if(f)return{computedTooltipStyle:{left:"".concat(p[a.dock].x,"px"),top:"".concat(p[a.dock].y,"px"),transform:f},computedArrowStyle:mH(a.offset)[a.dock],dock:a.dock};const m={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},g=fH(i,o,a.offset),y=["top","left","right","bottom","inside"];for(let e=0;e<y.length;e+=1){const t=y[e];if(gH(m,"target"===a.area?p[t].x:s.left+p[t].x,"target"===a.area?p[t].y:s.top+p[t].y,i,o,g[t]))return{computedTooltipStyle:{left:"".concat(p[t].x,"px"),top:"".concat(p[t].y,"px"),transform:h[t]},computedArrowStyle:mH(a.offset)[t],dock:t}}const b=function(e){let{options:t,docks:n,dockOffsets:r,targetBounds:i,area:o,width:a}=e;const s="top",l="target"===t.area?n[s].x:i.left+n[s].x,c=("target"===t.area?n[s].y:(i.top,n[s].y),r[s]),u=l+c.x,d=(c.y,a);let p=n.top.x;return u<0&&u+d>o.width||(u<0?p-=u:u+d>o.width&&(p-=u+d-o.width)),p}({options:a,docks:p,dockOffsets:g,targetBounds:s,area:m,width:i});return{computedTooltipStyle:{left:"".concat(b,"px"),top:"".concat(p.top.y,"px"),transform:h.top},computedArrowStyle:mH(a.offset+b-p.top.x,a.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:r,height:i}=e;const{x:o,y:a}=n;return bH({x:o,y:a,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:r,height:i,nodes:o,resources:a}=e;const s=o[0],{dx:l,dy:c}=n,u=a.getComponentBoundsFromNode(s),d=l+u.x+u.width/2,p=c+u.y+u.height/2,{start:h,end:f,outerRadius:m}=s.desc.slice,g=(h+f)/2-Math.PI/2,y=2*Math.PI,b=(g%y+y)%y;let v=["top","left","right","bottom"];return"auto"===t.dock&&(v=b<=Math.PI/4||b>=7*Math.PI/4?["right","top","bottom","left"]:b<=3*Math.PI/4?["bottom","left","right","top"]:b<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),bH({x:d+m*u.scaleRatio.x*Math.cos(b),y:p+m*u.scaleRatio.y*Math.sin(b),pointer:n,width:r,height:i,options:t,dockOrder:v})}};function wH(e,t){let{width:n,height:r}=e,{chart:i,state:o,props:a}=t;const s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>vH(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=vH(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=ID(c,a.placement(s))),"object"===l&&xH[a.placement.type]?c=ID(c,a.placement):"string"===l&&xH[a.placement]&&(c=ID(c,{type:a.placement})),s.options=c;const u=xH[c.type](s);let{x:d,y:p,width:h,height:f}=s.resources.getComponentBoundsFromNode(s.nodes[0]);return d+=s.pointer.dx,h+=d,p+=s.pointer.dy,f+=p,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.left)),h),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,p,parseFloat(u.computedTooltipStyle.top)),f),"px"),u}let SH;function EH(){SH=null}const CH={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data))),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const MH={require:["chart","renderer"],defaultSettings:{settings:CH,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:r,delay:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:r}=t,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,c=o,u=a.left-s.left,d=a.top-s.top,p=i-a.left,h=o-a.top;return i-=s.left,o-=s.top,{x:i,y:o,dx:u,dy:d,cx:p,cy:h,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(n)?this.props.filter(n):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),r,i)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=pH({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){SH&&SH!==e&&SH()}(t),SH=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,ID({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,ID({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),SH===t&&(SH=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),EH()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),EH()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:r,props:i,h:o}=t;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach((e=>{if("function"==typeof i.extract){const t=ID({node:e},a);s.push(i.extract(t))}})),s}(e,this),n=wH(dH(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=dH(t,n,this)}};const _H={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var kH={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},RH=/([astvzqmhlc])([^astvzqmhlc]*)/gi,AH=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function IH(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(RH,((e,n,r)=>{const i=function(e){const t=e.match(AH);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),a=n;if("m"===o&&i.length>2&&(t.push([a,...i.splice(0,2)]),o="l",a="m"===a?"l":"L"),i.length<kH[o])return"";for(t.push([a,...i.splice(0,kH[o])]);i.length>=kH[o]&&i.length&&kH[o];)t.push([a,...i.splice(0,kH[o])]);return""})),t}const LH=2*Math.PI;function DH(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function PH(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function OH(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const a=DH(e,t),s=DH(t,n),l=DH(n,r),c={x:PH(.5,e.x,t.x,n.x,r.x),y:PH(.5,e.y,t.y,n.y,r.y)},u=DH(a,s),d=DH(s,l);return OH(e,a,u,c,i,o-1),OH(c,d,l,r,i,o-1),i}function TH(e,t,n){const{cp1:r,cp2:i}=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return OH(e,r,i,n)}function NH(e,t,n){const r=[],i=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,d=e[6],p=e[7],h=e[1],f=e[2];if("a"===e[0]&&(d+=t,p+=n),t===p&&n===p)return r;if(!h||!f)return r.push({x:d,y:p}),r;({cx:s,cy:l,rx:h,ry:f,sweepAngle:c,startAngle:u}=function(e,t,n,r,i,o,a,s,l){let c,u,d,p,h,f;const m=dj(n%360),g=Math.cos(m),y=Math.sin(m),b=(s-o)/2,v=(l-a)/2,x=g*b+y*v,w=g*v-y*b;f=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,f>1&&(f=Math.sqrt(f),e*=f,t*=f);const S=e*w,E=t*x,C=S**2+E**2,M=(e*t)**2-C;let _=Math.sqrt(Math.max(M/C,0));r===i&&(_=-_);const k=_*(S/t),R=_*(-E/e);p=g*k-y*R+(s+o)/2,h=y*k+g*R+(l+a)/2;const A=(x-k)/e,I=(w-R)/t,L=(-x-k)/e,D=(-w-R)/t;return c=Math.atan2(I,A),c+=c<0?LH:0,u=Math.atan2(D,L),u+=u<0?LH:0,d=u-c,!i&&c<u?d-=LH:i&&u<c&&(d+=LH),d%=LH,{startAngle:c,sweepAngle:d,cx:p,cy:h,rx:e,ry:t}}(h,f,a,i,o,d,p,t,n));const m=Math.abs(c*Math.sqrt((h**2+f**2)/2)),g=Math.ceil(m/10),y=c/g;for(let e=1;e<=g;e++){const t=(u+y*e)%LH,n=Math.cos(t),i=Math.sin(t);r.push({x:s+n*h+-i*n,y:l+i*f+n*i})}return r}function qH(e){const t=IH(e),n=[],r=[];let i=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],d=u[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(a=null,s=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,c=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(...NH(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...NH(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...OH({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),a=u[3]+i,s=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...OH({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],i=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push(...OH({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),a=u[1]+i,s=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push(...OH({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],i=u[3],o=u[4];break;case"Q":r.push(...TH({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...TH({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...TH({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...TH({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}const FH={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{qH(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var jH=[function(e){e.component("box",Xz),e.component("box-marker",Xz)},function(e){e.component("point",rB),e.component("point-marker",rB)},function(e){e.component("pie",sB)},function(e){e.component("grid-line",pB)},function(e){e.component("ref-line",wB)},function(e){e.component("axis",$B)},function(e){e.component("container",HB)},function(e){e.component("text",UB)},function(e){e.component("scrollbar",XB)},function(e){e.component("brush-range",dW),e.component("brush-area-dir",mW)},function(e){e.component("range",vW)},function(e){e.component("brush-lasso",MW)},function(e){e.component("labels",q$)},function(e){e.component("legend-cat",X$)},function(e){e.component("legend-seq",nH)},function(e){e.component("line",aH)},function(e){e.component("brush-area",uH)},function(e){e.component("tooltip",MH)},function(e){e.component("debug-collider",_H)},function(e){e.component("debug-path-to-points",FH)}];class zH{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}}class BH{constructor(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:r,minWidth:i,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,i)):(this.x=e+Math.min(n,-i),this.width=-Math.min(n,-i)),r>=0?(this.y=t,this.height=Math.max(r,o)):(this.y=t+Math.min(r,-o),this.height=-Math.min(r,-o))}containsPoint(e){return Xj(this,e)}intersectsLine(e){return Jj(this,WD(e))}intersectsRect(e){return Yj(this,BD(e))}intersectsCircle(e){return Wj(e,this)}intersectsPolygon(e){return Uj(e,this)}intersectsGeoPolygon(e){return oz(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class WH{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:r})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,r),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return Bj(this,e)}intersectsLine(e){return $j(this,WD(e))}intersectsRect(e){return Wj(this,BD(e))}intersectsCircle(e){return n=e,!qj(t=this)&&!qj(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return Hj(this,e)}intersectsGeoPolygon(e){return nz(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class $H{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:r,tolerance:i})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=r,this.tolerance=Math.max(0,Math.round(i)),this.vectors=this.points(),this.zeroSize=e===n&&t===r}containsPoint(e){if(this.tolerance>0){return $j({cx:e.x,cy:e.y,r:this.tolerance},this)}return Qj(this,e)}intersectsLine(e){return Zj(this,WD(e))}intersectsRect(e){return Jj(BD(e),this)}intersectsCircle(e){return $j(e,this)}intersectsPolygon(e){return Gj(e,this)}intersectsGeoPolygon(e){return iz(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class HH{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return Vj(this,e)}intersectsCircle(e){return Hj(e,this)}intersectsLine(e){return Gj(this,WD(e))}intersectsRect(e){return Uj(this,BD(e))}intersectsPolygon(e){return ez(this,e)}intersectsGeoPolygon(e){return tz(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function VH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new HH(...t)}function GH(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function UH(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class YH{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)UH(this.vertices[e]),this.vertices[e].length>2&&GH(this.vertices[e]),this.polygons[e]=VH({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return rz(this,e)}intersectsCircle(e){return nz(e,this)}intersectsLine(e){return iz(this,WD(e))}intersectsRect(e){return oz(this,BD(e))}intersectsPolygon(e){return tz(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Yj(n,r)&&(Kj(r,n)?zj(t,e):zj(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function KH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new YH(...t)}class XH{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,r=this._points.length-1;e<r;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>Qj(t,e)))}intersectsCircle(e){return this.segments.some((t=>$j(e,t)))}intersectsLine(e){const t=WD(e);return this.segments.some((e=>Zj(e,t)))}intersectsRect(e){const t=BD(e);return this.segments.some((e=>Jj(t,e)))}intersectsPolygon(e){return this.segments.some((t=>Gj(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>iz(e,t)))}points(){return this._points}}const JH=UP();function ZH(e,t){return JH.get(e)(t)}JH.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new BH(...t)})),JH.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new WH(...t)})),JH.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new $H(...t)})),JH.add("polygon",VH),JH.add("geopolygon",KH),JH.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new XH(...t)}));class QH{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=ZH(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class eV{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new eV).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,r,i;if(e instanceof eV&&(e=e._elements),Array.isArray(e)){for(r=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-a*l,r*l-n*c,n*a-r*o],[a*s-i*c,t*c-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];s.push({x:o[0],y:o[1]})}return s}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const tV=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function nV(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function rV(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function iV(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function oV(e,t){t.args.length>=6&&e.transform(...t.args)}function aV(e,t){const n=function(e){let t,n=[];for(;null!==(t=tV.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?nV(t,r):"scale"===r.cmd?rV(t,r):"matrix"===r.cmd?oV(t,r):"translate"===r.cmd&&iV(t,r)}const sV={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},lV={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,r)=>r.filter((r=>{const i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function cV(e,t){if(!t||!t.length||!e||"function"!=typeof lV[e.type])return[];switch(e.type){case"type":case"tag":return lV[e.type](e.value,t);case"attr":return lV[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return lV[e.type](t);default:return[]}}var uV={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let a;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const a=t=>{i=e.match(sV[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(sV).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){a=i[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=cV(e,n),s=!0})),s&&t.push(n);const l=t[0].filter((e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0}));r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function dV(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every((e=>Array.isArray(e)))?i.map((e=>n.transformPoints(e))):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=BD(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=WD(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:cj(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=cj(i[t],!0);o={type:"path",d:e}}return o}class pV{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:r,width:i,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:r,width:i,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>dV(e,t,n)))}:dV(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new pV(e))),this._parent=()=>e.parent?new pV(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();i-=t,o-=n}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function hV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pV(...t)}class fV{constructor(e){this._node=hV(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function mV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new fV(...t)}function gV(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=mV(n);const e=n.parent;e&&"stage"!==e.type&&gV(e,t.parent)}}function yV(e,t,n){if(null===e.colliderType)return null;const r=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const r={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(r)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?KH(n):VH(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=mV(i);return gV(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=mV(e);return gV(e,t),t}return null}(e,t,r)}function bV(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],a=yV(i,t,r);a&&n.push(a),!i.children||a||i.collider||bV(i.children,t,n,r)}}function vV(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==yV(r,t,n))return!0;if(r.children&&!r.collider)return vV(r.children,t,n)}return!1}function xV(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch($D(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=zD(e).map((e=>mj(e,t))),["intersectsRect",n];case"line":return n=jD(e).map((e=>mj(e,t))),["intersectsLine",n];case"point":return n=mj(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>mj(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>mj(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function wV(e,t){const[n,r]=xV(t,e.dpi),i=[];return n&&(bV([e],n,i,r),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,i)),i}function SV(e,t){const[n,r]=xV(t,e.dpi);return vV([e],n,r)}class EV extends zH{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:r,strokeReference:i,fillReference:o}=e;var a,s;a=this.attrs,s=e,Object.keys(lj).forEach((e=>{const t=s[e];void 0!==t&&(a[lj[e]]=t)})),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=ID(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return uV.find(e,this).map((e=>hV(e)))}getItemsFrom(e){return wV(this,e)}containsPoint(e){return SV(this,e)}intersectsLine(e){return SV(this,e)}intersectsRect(e){return SV(this,e)}intersectsCircle(e){return SV(this,e)}intersectsPolygon(e){return SV(this,e)}intersectsGeoPolygon(e){return SV(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new eV;void 0!==this.attrs.transform&&aV(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new eV;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new QH(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=ZH("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=ZH(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class CV extends zH{addChild(e){if(!(e&&e instanceof zH))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const MV=CV.prototype;class _V extends EV{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=ID({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[r,,i]=e.bounds(t),{x:o,y:a}=r,{x:s,y:l}=i,c=isNaN(n.width)?s:Math.max(s,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?a:Math.min(a,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=ID({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=MV.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=ID({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=MV.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=ID({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(MV.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=ID(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(MV.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=ID(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function kV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _V(...t)}class RV extends _V{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const AV=CV.prototype,IV=["x1","x2","y1","y2","id","offset","style"];class LV extends EV{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=IV.length;r!==i;r++)n=IV[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return AV.addChild.call(this,e)}addChildren(e){return AV.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return AV.removeChild.call(this,e),this}removeChildren(e){return AV.removeChildren.call(this,e),this}}function DV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new LV(...t)}const PV=CV.prototype,OV=["patternUnits","x","y","width","height","id"];class TV extends EV{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=OV.length;r!==i;r++)n=OV[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return PV.addChild.call(this,e)}addChildren(e){return PV.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return PV.removeChild.call(this,e),this}removeChildren(e){return PV.removeChildren.call(this,e),this}}class NV extends EV{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:r=0,height:i=0,rx:o=0,ry:a=0,collider:s}=e,l=ID({type:"rect",x:t,y:n,width:r,height:i},s);super.set(e),r>=0?(this.attrs.x=t,this.attrs.width=r):(this.attrs.x=t+r,this.attrs.width=-r),i>=0?(this.attrs.y=n,this.attrs.height=i):(this.attrs.y=n+i,this.attrs.height=-i),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=zD(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[r,i,o,a]=FD(n);return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class qV extends EV{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:r=0,collider:i}=e,o=ID({type:"circle",cx:t,cy:n,r:r},i);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=r,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:r,r:i}=this.attrs,o=t-r,a=n-i;let s=2*r,l=2*i,c=[{x:o,y:a},{x:o+s,y:a},{x:o+s,y:a+l},{x:o,y:a+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,r,i]=FD(c);s=r-t,l=i-n,this.__bounds[e]=[{x:t,y:n},{x:t+s,y:n},{x:t+s,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class FV extends EV{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:r=0,y2:i=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=r,this.attrs.y2=i;const a={type:"line",x1:t,y1:n,x2:r,y2:i};this.collider=ID(a,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=jD(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,r,i,o]=FD(t),a=n!==i||r!==o;return this.__boundingRect[e]={x:n,y:r,width:a?Math.max(1,i-n):0,height:a?Math.max(1,o-r):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const jV=Math.PI/2;function zV(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function BV(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const WV={step:function(e){return new BP(e,.5)},stepAfter:function(e){return new BP(e,1)},stepBefore:function(e){return new BP(e,0)},linear:bP,basis:function(e){return new _P(e)},cardinal:AP.tension(0),catmullRom:LP,monotonex:function(e){return new NP(e)},monotoney:function(e){return new qP(e)},natural:function(e){return new jP(e)}};function $V(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class HV extends EV{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=gP();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:r,points:i,stngs:o,generatorType:a}=e,s=wP(),l=o.coordinates?o.coordinates.defined:null;s[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(WV["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?i.filter(s.defined()):i,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=qH(this.attrs.d),this.segments.length>1&&this.segments.every((e=>$V(e))))return void(this.collider=ID({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if($V(t))this.collider=ID({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=[],i=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=zV(s,a),u=zV(s,l),d=(c+u)/2,p=d+Math.PI,h=Math.max(d,p),f=Math.min(d,p),m=c>u;if(1===n){const e=zV(a,s);r.push(BV(a,e-jV,t)),i.unshift(BV(a,e+jV,t))}const g=m?h:f,y=m?f:h;if(r.push(BV(s,g,t)),i.unshift(BV(s,y,t)),n===o-1){const e=zV(l,s);r.push(BV(l,e+jV,t)),i.unshift(BV(l,e-jV,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=ID({type:"polyline",points:t},e.collider)}))}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:qH(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,r,i,o]=FD(t);return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function VV(e){let{data:t,_boundingRect:n,_textBoundsFn:r}=e;return null!=t&&(n||r)}let GV=class extends EV{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:r=0,dy:i=0,textBoundsFn:o,text:a,title:s,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=r,this.attrs.dy=i,this.attrs.text=a,void 0!==s&&(this.attrs.title=String(s)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=ID({type:VV(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=zD(e),r=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[i,o,a,s]=FD(r);return this.__boundingRect[t]={x:i,y:o,width:a-i,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}};const UV=UP();function YV(e,t){return UV.get(e)(t)}UV.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new NV(...t)})),UV.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qV(...t)})),UV.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new GV(...t)})),UV.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new FV(...t)})),UV.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new HV(...t)})),UV.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new RV(...t)})),UV.add("container",kV),UV.add("defs",kV),UV.add("linearGradient",DV),UV.add("radialGradient",DV),UV.add("stop",DV),UV.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new TV(...t)}));const KV=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==i[a]&&(o[a]=i[a]);return ID(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function XV(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function JV(e,t,n){e.node=n[t],e.index=t}function ZV(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(JV(o,a,e),XV(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=KV.save(o.node);const s=YV(o.node.type,o.node);s&&(o.node.transform&&(n.save(),aV(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&ZV(o.node.children,s,n,r),o.node.transform&&n.restore()),KV.restore()}}function QV(e){let{items:t,stage:n,dpi:r,on:i={}}=e;return n||(n=YV("stage",r)),ZV(t,n,new eV,i),n}function eG(e,t,n){const{orientation:r,degree:i,stops:o=[]}=n;let a=null;if("radial"===r){const n=t.boundingRect();a=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else{const r=pj(i);["x1","x2","y1","y2"].forEach((e=>{e in n&&(r[e]=n[e])}));const o=t.boundingRect();a=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];a.addColorStop(t.offset,t.color)}return a}function tG(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function nG(){let{x:e,y:t,width:n,height:r,scaleRatio:i,margin:o,edgeBleed:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return s.x=isNaN(e)?s.x:e,s.y=isNaN(t)?s.y:t,s.width=isNaN(n)?s.width:n,s.height=isNaN(r)?s.height:r,void 0!==i&&(s.scaleRatio.x=isNaN(i.x)?s.scaleRatio.x:i.x,s.scaleRatio.y=isNaN(i.y)?s.scaleRatio.y:i.y),void 0!==o&&(s.margin.left=isNaN(o.left)?0:o.left,s.margin.top=isNaN(o.top)?0:o.top),"object"==typeof a&&["left","right","top","bottom"].forEach((e=>{!isNaN(a[e])&&a[e]>0&&(s.edgeBleed[e]=a[e],s.edgeBleed.bool=!0)})),s.computedPhysical={x:Math.round(s.margin.left+(s.x-s.edgeBleed.left)*s.scaleRatio.x),y:Math.round(s.margin.top+(s.y-s.edgeBleed.top)*s.scaleRatio.y),width:Math.round((s.width+s.edgeBleed.left+s.edgeBleed.right)*s.scaleRatio.x),height:Math.round((s.height+s.edgeBleed.top+s.edgeBleed.bottom)*s.scaleRatio.y)},s}function rG(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:A$,textBounds:L$,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function iG(e){return t=>{let{node:n}=t;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=e.textBounds)}}const oG=200,aG=200;class sG{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:r,canvasBufferSize:i}=e;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*oG,height:n.computedPhysical.height+2*aG},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const lG=UP();function cG(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function uG(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function dG(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function pG(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in r)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function hG(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],a={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=eG(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=eG(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=r.patterns.create(o.attrs.stroke))),pG(t,o,n,a),o.modelViewMatrix&&dG(o.modelViewMatrix.elements,t),lG.has(o.type)&&lG.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&hG(o.children,t,n,r),t.restore()}}function fG(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:QV;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,a=nG();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",cG]];let l;const c=rG();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach((t=>{void 0!==e[t]&&(r[t]=e[t])})),r),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof r.transform||t||(t=new sG(e)),n.appendChild(e),e),c.getScene=r=>{const i=uG(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:r,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*i*o,", ").concat(a.edgeBleed.top*i*s,")"):""};return 1===i&&1===o&&1===s||(l.transform+="scale(".concat(i*o,", ").concat(i*s,")")),n({items:[l],dpi:i,on:{create:[x$(c.measureText),iG(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||tG(e,t,n),r[i]):tG(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=uG(u),p=t&&r.transform();if(p)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:r}=e;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:d,transform:p}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*d),e.height=Math.round(a.computedPhysical.height*d),t&&t.updateSize({rect:a,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const h=c.getScene(n),f=!i||!h.equals(i);l.clear();const m=o||f,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),hG(h.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&h.children.unshift(...i.children),i=h,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=nG(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function mG(e,t){lG.add(e,t)}function gG(e,t){return Math.max(0,Math.min(e,t))}const yG=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),bG=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),vG=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function xG(e){return yG.test(e)}function wG(e){return bG.test(e)||vG.test(e)}function SG(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],xG(n))return"ltr";if(wG(n))return"rtl"}return"ltr"}const EG={start:"end",end:"start",center:"center",middle:"middle"};function CG(e,t){return"rtl"===t?EG[e]:e}function MG(e,t){const n=[];let r;const i=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?i.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=MG([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=MG(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,a.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:i,items:r}}function _G(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function kG(e,t){for(let n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function RG(e,t,n,r){let i;for(let o=0,a=e.length;o<a;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(_G(i.diff.added,i.object,t),kG(i.diff.removed,r),RG(i.diff.items,t,n,r)))}function AG(e,t,n,r,i,o){const a=MG(e,t);return _G(a.added,n,r),kG(a.removed,o),RG(a.items,r,i,o),a.items}mG("rect",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=gG(r/2,o>0?o:a),a=gG(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()})),mG("circle",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()})),mG("line",(function(e,t){let{g:n,doStroke:r}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()})),mG("path",(function(e,t){let{g:n,doStroke:r,doFill:i}=t;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)})),mG("text",(function(e,t){let{g:n,ellipsed:r,doStroke:i}=t;const o=r||w$(e,A$);e["font-weight"]?n.font="".concat(e["font-weight"]," ").concat(e["font-size"]," ").concat(e["font-family"]):n.font="".concat(e["font-size"]," ").concat(e["font-family"]);const a=SG(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=CG("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=S$(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));const IG="http://www.w3.org/2000/svg",LG=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(IG,"container"===e?"g":e);return t.appendChild(n),n},DG=e=>{e.parentNode&&e.parentNode.removeChild(e)},PG=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||w$(t.attrs,A$);const n=SG(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",CG(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(IG,"title");n.textContent=t.attrs.title,e.appendChild(n)}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?S$(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class OG{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function TG(){return new OG(AG,LG,PG,DG)}function NG(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function qG(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:IG,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:QV;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:TG)();let r,i,o,a=!1,s=nG();const l={transform:void 0},c=rG(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NG,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach((a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")}))},clear(){n={}}};return i}(u.children),p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NG,n={},r=Date.now();const i={getOrCreateGradient(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){let{orientation:t,degree:r,stops:a=[]}=i[o],c={};void 0===r&&(r=90),"radial"===t?c.type="radialGradient":(c=pj(r),["x1","x2","y1","y2"].forEach((e=>{e in i[o]&&(c[e]=i[o][e])})),c.type="linearGradient"),c.id=l,c.children=a.map((e=>{let{offset:t,color:n,opacity:r}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}})),e.push(c),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=s.scaleRatio.x,r=s.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},p.onCreate,d.onCreate,x$(c.measureText),iG(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{horizontalScaling:e,horizontalSkewing:n,verticalSkewing:r,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}i.style.transform="",a&&(r.style.left="".concat(s.computedPhysical.x,"px"),r.style.top="".concat(s.computedPhysical.y,"px"),r.setAttribute("width",s.computedPhysical.width),r.setAttribute("height",s.computedPhysical.height)),p.clear(),d.clear(),u.children.length=0;const h=c.getScene(e),f=!o||!h.equals(o),m=a||f;return m&&(c.clear(),n.render(h.children,i)),a=!1,o=h,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=nG(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var FG,jG,zG,BG,WG,$G,HG,VG={},GG=[],UG=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function YG(e,t){for(var n in t)e[n]=t[n];return e}function KG(e){var t=e.parentNode;t&&t.removeChild(e)}function XG(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?FG.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return JG(e,a,r,i,null)}function JG(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++zG:i};return null==i&&null!=jG.vnode&&jG.vnode(o),o}function ZG(e){return e.children}function QG(e,t){this.props=e,this.context=t}function eU(e,t){if(null==t)return e.__?eU(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?eU(e):null}function tU(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return tU(e)}}function nU(e){(!e.__d&&(e.__d=!0)&&BG.push(e)&&!rU.__r++||WG!==jG.debounceRendering)&&((WG=jG.debounceRendering)||$G)(rU)}function rU(){var e,t,n,r,i,o,a,s;for(BG.sort(HG);e=BG.shift();)e.__d&&(t=BG.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=YG({},o)).__v=o.__v+1,pU(s,o,i,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,r,null==a?eU(o):a,o.__h),hU(r,o),o.__e!=a&&tU(o)),BG.length>t&&BG.sort(HG));rU.__r=0}function iU(e,t,n,r,i,o,a,s,l,c){var u,d,p,h,f,m,g,y=r&&r.__k||GG,b=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(h=n.__k[u]=null==(h=t[u])||"boolean"==typeof h||"function"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?JG(null,h,null,null,h):Array.isArray(h)?JG(ZG,{children:h},null,null,null):h.__b>0?JG(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(p=y[u])||p&&h.key==p.key&&h.type===p.type)y[u]=void 0;else for(d=0;d<b;d++){if((p=y[d])&&h.key==p.key&&h.type===p.type){y[d]=void 0;break}p=null}pU(e,h,p=p||VG,i,o,a,s,l,c),f=h.__e,(d=h.ref)&&p.ref!=d&&(g||(g=[]),p.ref&&g.push(p.ref,null,h),g.push(d,h.__c||f,h)),null!=f?(null==m&&(m=f),"function"==typeof h.type&&h.__k===p.__k?h.__d=l=oU(h,l,e):l=aU(e,h,p,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=eU(p))}for(n.__e=m,u=b;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=sU(r).nextSibling),gU(y[u],y[u]));if(g)for(u=0;u<g.length;u++)mU(g[u],g[++u],g[++u])}function oU(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?oU(r,t,n):aU(n,r,r,i,r.__e,t));return t}function aU(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function sU(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=sU(n)))return r;return null}function lU(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||UG.test(t)?n:n+"px"}function cU(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||lU(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||lU(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?dU:uU,o):e.removeEventListener(t,o?dU:uU,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function uU(e){return this.l[e.type+!1](jG.event?jG.event(e):e)}function dU(e){return this.l[e.type+!0](jG.event?jG.event(e):e)}function pU(e,t,n,r,i,o,a,s,l){var c,u,d,p,h,f,m,g,y,b,v,x,w,S,E,C=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(c=jG.__b)&&c(t);try{e:if("function"==typeof C){if(g=t.props,y=(c=C.contextType)&&r[c.__c],b=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in C&&C.prototype.render?t.__c=u=new C(g,b):(t.__c=u=new QG(g,b),u.constructor=C,u.render=yU),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=b,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=C.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=YG({},u.__s)),YG(u.__s,C.getDerivedStateFromProps(g,u.__s))),p=u.props,h=u.state,u.__v=t,d)null==C.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==C.getDerivedStateFromProps&&g!==p&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,b),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,b)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,b),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(p,h,f)}))}if(u.context=b,u.props=g,u.__P=e,x=jG.__r,w=0,"prototype"in C&&C.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(r=YG(YG({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(p,h)),E=null!=c&&c.type===ZG&&null==c.key?c.props.children:c,iU(e,Array.isArray(E)?E:[E],t,n,r,i,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=fU(n.__e,t,n,r,i,o,a,l);(c=jG.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),jG.__e(e,t,n)}}function hU(e,t){jG.__c&&jG.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){jG.__e(e,t.__v)}}))}function fU(e,t,n,r,i,o,a,s){var l,c,u,d=n.props,p=t.props,h=t.type,f=0;if("svg"===h&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===h)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,p.is&&p),o=null,s=!1}if(null===h)d===p||s&&e.data===p||(e.data=p);else{if(o=o&&FG.call(e.childNodes),c=(d=n.props||VG).dangerouslySetInnerHTML,u=p.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||cU(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||cU(e,o,t[o],n[o],r)}(e,p,d,i,s),u)t.__k=[];else if(f=t.props.children,iU(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==h,o,a,o?o[0]:n.__k&&eU(n,0),s),null!=o)for(f=o.length;f--;)null!=o[f]&&KG(o[f]);s||("value"in p&&void 0!==(f=p.value)&&(f!==e.value||"progress"===h&&!f||"option"===h&&f!==d.value)&&cU(e,"value",f,d.value,!1),"checked"in p&&void 0!==(f=p.checked)&&f!==e.checked&&cU(e,"checked",f,d.checked,!1))}return e}function mU(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){jG.__e(e,n)}}function gU(e,t,n){var r,i;if(jG.unmount&&jG.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||mU(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){jG.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&gU(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||KG(e.__e),e.__=e.__e=e.__d=void 0}function yU(e,t,n){return this.constructor(e,n)}function bU(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,r,i=nG();const o={transform:void 0},a=rG();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{horizontalScaling:e,horizontalSkewing:r,verticalSkewing:i,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}let a;return n.style.transform="",n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),a=Array.isArray(e)?XG("div",null,e):e,r=function(e,t,n){var r,i,o;jG.__&&jG.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],pU(t,e=(!r&&n||t).__k=XG(ZG,null,[e]),i||VG,VG,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?FG.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),hU(o,e)}(a,n,r),!0},a.renderArgs=[XG],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},a.size=e=>(e&&(i=nG(e)),i),a}FG=GG.slice,jG={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},zG=0,QG.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=YG({},this.state),"function"==typeof e&&(e=e(YG({},n),this.props)),e&&YG(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),nU(this))},QG.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),nU(this))},QG.prototype.render=ZG,BG=[],$G="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,HG=function(e,t){return e.__v.__b-t.__v.__b},rU.__r=0;var vU=[function(e){e.renderer("svg",qG)},function(e){e.renderer("canvas",fG)},function(e){e.renderer("dom",bU)}];const xU={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const wU=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let{level:e=xU.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const r={[xU.OFF]:()=>{},[xU.ERROR]:function(){return t.error(...arguments)},[xU.WARN]:function(){return t.warn(...arguments)},[xU.INFO]:function(){return t.info(...arguments)},[xU.DEBUG]:function(){return t.log(...arguments)}},i=function(e){if(e&&!(n<e)){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];(r[e]||r[xU.DEBUG])(...i)}};return{log:i,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(xU.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(xU.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(xU.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(xU.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:xU}}(t.logger),i={component:UP(n.component,"component",r),data:UP(n.data,"data",r),formatter:UP(n.formatter,"formatter",r),interaction:UP(n.interaction,"interaction",r),renderer:Oz(n.renderer),scale:UP(n.scale,"scale",r),symbol:UP(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:ID({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i)},o.chart=e=>Pz(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach((e=>{o[e]=i[e]})),o.version=LD,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:Tz,data:zz,formatter:yN,interaction:Bz,renderer:Oz(),scale:bF,symbol:Cj});jH.forEach(wU.use),vU.forEach(wU.use),[].forEach(wU.use);const SU=wU();SU.use(wD),SU.renderer.prio(["canvas"]);const EU=({cell:e,representation:t,textStyle:n,imageContainerHorizontalAlignment:r})=>{var i,o;const{imageBox:a}=t,{styleService:{grid:{lineClamp:s}}}=_E();return Hn.jsxs("div",{style:{display:"grid",gridTemplateColumns:`${null!==(i=null==a?void 0:a.width)&&void 0!==i?i:24}px 1fr`,maxHeight:"fit-content",alignItems:"center",justifyContent:"flex-start",overflow:"hidden",boxSizing:"border-box"},children:[Hn.jsx("div",{"data-key":"image-container--partial-image",style:{display:"flex",flexDirection:"column",justifyContent:Q_(e),alignItems:r,overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",width:null!==(o=null==a?void 0:a.width)&&void 0!==o?o:24,height:"100%"},children:Hn.jsx(vk,{representation:t,textStyle:n})}),Hn.jsx("span",{style:{paddingRight:0,padding:4/(s<=2?2:1),alignSelf:Q_(e)},children:!!t.labelStructure&&yk(t.labelStructure)})]})},CU=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`,MU=({href:e,text:t,labelStructure:n,interactions:r,color:i})=>Hn.jsxs("span",{children:[Hn.jsx(sA,{...PI({href:e,text:t,interactions:r,color:i}),children:null!=n&&n.maskedValue?n.maskedValue:null==n?void 0:n.originalValue}),!!n&&CU(n)]}),_U=({children:e,textStyle:t})=>Hn.jsx("span",{style:{...t,border:"4px solid transparent",boxSizing:"border-box"},children:e}),kU=({cell:e,isCellSelected:t,isLeftColumn:n})=>{const{isActive:r}=J_(),{layoutService:i,styleService:o}=_E(),{interactions:a}=EE();let s=n&&!e.isNull?(e=>{const{representation:{text:t,labelStructure:n}}=e;if(!n||!n.originalValue)return t;const{originalValue:r,maskedValue:i,suffix:o,delimeter:a}=n;return`${0!==i.length?i:r} ${o?a:""} ${o}`.trim()})(e):e.representation.text;if(e.isEmpty)return null;const l=(({cell:e,styleService:t,isCellSelected:n,isLeftColumn:r})=>({...lg,...cg(r?Math.max(t.grid.lineClamp,e.leafCount*t.grid.lineClamp):t.grid.columnLineClamp),color:ik({cell:e,styleService:t,isCellSelected:n}),fontWeight:ok({cell:e,styleService:t}),fontStyle:ak({cell:e,styleService:t}),textDecoration:sk({cell:e,styleService:t}),fontFamily:t.dimensionValues.fontFamily,fontSize:t.dimensionValues.fontSize}))({cell:e,styleService:o,isCellSelected:t,isLeftColumn:n});if(e.representation.type===Wt.Image&&!e.isTotal&&!e.isNull){const{labelStructure:t}=e.representation,r=n&&t&&t.suffix?EU:xk;return Hn.jsx(r,{cell:e,representation:e.representation,textStyle:l,isLeftColumn:n,canExpandOrCollapse:e.ref.qCanCollapse||e.ref.qCanExpand,imageContainerHorizontalAlignment:AI(e,i,n)})}if(e.representation.type===Wt.Link&&!r&&!e.isTotal){const t=n&&e.representation.labelStructure?MU:OI;s=Hn.jsx(t,{text:e.representation.text,labelStructure:e.representation.labelStructure,href:e.representation.url,interactions:a,color:e.expressionColor.color})}return Hn.jsx(_U,{textStyle:{...l,...e.representation.type===Wt.Image&&e.isNull?{alignSelf:Q_(e)}:{}},children:s})},RU=({index:e,style:t,data:n})=>{const{styleService:r,layoutService:i}=_E(),{isSelected:o}=J_(),{isLeftColumn:a=!1,showLastBorder:s,itemCount:l,isLast:c,totalDividerIndex:u}=n,{isAdjustingWidth:d,setIsAdjustingWidth:p}=Bk([n]),h=RI(e,n),f=a?e===l-1:c,m=a?c:e===l-1,g=F_(h,u,i.isIndentModeEnabled);if(void 0===h){const{background:n}=r.dimensionValues;return Hn.jsx(j_,{style:{...t,background:n},index:e,isLastRow:f,isLastColumn:m,showLastBorder:s,isLeftColumn:a,showTotalCellDivider:g})}const y=o(h);return Hn.jsxs(LI,{reactWindowStyle:t,isLeftColumn:a,isLastRow:f,isLastColumn:m,isCellSelected:y,showTotalCellDivider:g,cell:h,data:n,isAdjustingWidth:d,index:e,children:[Hn.jsxs(z_,{verticalAlign:Q_(h),width:B_(h.representation),right:h.isLeftColumn?void 0:4,isLeftColumn:a,children:[Hn.jsx(dk,{isLeftColumn:a,isCellSelected:y,cell:h}),Hn.jsx(kU,{isLeftColumn:a,isCellSelected:y,cell:h})]}),Hn.jsx(Hk,{cellInfo:{...h,columnWidthLocation:h.isPseudoDimension?Jt.Measures:Jt.Dimension},columnWidth:t.width,isLastColumn:m,setIsAdjustingWidth:p})]})};var AU=t.memo(RU,E_);const IU=({list:e,listValues:t,isLastRow:n,getRightGridColumnWidth:r})=>i=>{var o;const a=n?e[i]:t.at(i);return a&&0===i&&a.x>0?(a.leafCount+a.x+a.distanceToNextCell)*r():!n&&a?(a.leafCount+a.distanceToNextCell)*r():r(null!==(o=null==a?void 0:a.x)&&void 0!==o?o:i)},LU=(e,t,n,r)=>{const i=Object.values(e);let o,a=i.length;return r&&(a=n,o=t/a),{itemCount:a,estimatedItemSize:o,listValues:i}},DU=(e,t)=>n=>{e.current&&(e.current[t]=n)},PU={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...ag},OU={overflow:"hidden",willChange:"auto",flexShrink:0},TU=({leftGridRef:e,width:t,height:n,columnWidths:r,showLastBorder:i})=>{const{pageInfo:o}=xE(),{layoutService:a,styleService:{contentCellHeight:s,grid:{divider:l}}}=_E(),{qSize:c}=a.layout.qHyperCube,{gridSectionsData:{leftDimensionData:u},visibleDimensionsInfo:{visibleLeftDimensionInfo:d}}=hM();kI(e,u),_I(e,t,n,s);const p=o.rowsOnCurrentPage*s,h={...PU,borderColor:l,width:r.reduce(((e,t)=>e+t),0)};return Hn.jsx("div",{style:h,"data-section-id":"LEFT_GRID",children:u.grid.map(((t,l)=>{const h=l===u.columnCount-1,f=jE(d[l]),{itemCount:m,estimatedItemSize:g,listValues:y}=LU(t,p,o.rowsOnCurrentPage,h),b=a.isIndentModeEnabled?()=>s:((e,t,n,r,i)=>o=>{const a=r?e[o]:t.at(o);if(a&&0===o&&a.pageY>0)return(a.leafCount+a.pageY+a.distanceToNextCell)*n;if(a&&a.leafCount>0){const e=a.y===i-a.leafCount;return(a.leafCount-(e?a.ref.qUp:0)+a.distanceToNextCell)*n}return n})(t,y,s,h,c.qcy);return Hn.jsx(v_,{ref:DU(e,l),style:{...OU,flexGrow:h?1:0},height:n,width:r[l],itemCount:m,itemSize:b,layout:"vertical",itemData:{list:t,isLeftColumn:!0,isLast:h,itemCount:m,showLastBorder:i,listValues:y,totalDividerIndex:u.totalDividerIndex},itemKey:Pk,estimatedItemSize:g,children:AU},f)}))})};var NU=f(TU);const qU={overflow:"hidden",willChange:"auto"},FU={...ag,borderWidth:"0px 0px 0px 1px"},jU=({topGridRef:e,rowHightCallback:t,width:n,height:r,showLastBorder:i,getRightGridColumnWidth:o})=>{const{layoutService:a,styleService:{grid:{divider:s},headerCellHeight:l}}=_E(),{gridSectionsData:{headersData:c,topDimensionData:u}}=hM(),d={...FU,borderColor:s,height:r};kI(e,u),_I(e,n,r,l);const p=a.size.x*o();return 0===u.rowCount?Hn.jsx("div",{style:{width:n,height:r,...FU}}):Hn.jsx("div",{style:d,"data-section-id":"TOP_GRID",children:u.grid.map(((r,s)=>{const l=s===u.rowCount-1,{itemCount:d,estimatedItemSize:h,listValues:f}=LU(r,p,a.size.x,l),m=(({layoutService:e,headersData:t,topRowIndex:n})=>{const r=t.data.at(n);if(void 0===r)return;const i=t.size.x-1,o=SI({layoutService:e,headersData:t,topRowIndex:n})?0:i,a=r.at(o),s=Array.isArray(a)?a.at(i):a;return s?e.getDimensionInfo(s.dimensionInfoIndex):void 0})({layoutService:a,headersData:c,topRowIndex:s}),g=m?jE(m):`empty ${s}`;return Hn.jsx(v_,{ref:DU(e,s),style:qU,height:t(),width:n,itemCount:d,itemSize:IU({list:r,listValues:f,isLastRow:l,getRightGridColumnWidth:o}),layout:"horizontal",itemData:{list:r,isLast:l,itemCount:d,showLastBorder:i,listValues:f,totalDividerIndex:u.totalDividerIndex},itemKey:Pk,estimatedItemSize:h,children:AU},g)}))})};var zU=f(jU);const BU=()=>{const{styleService:{headerCellHeight:e,contentCellHeight:t}}=_E(),n=FM(),r=(()=>{const{model:e}=EE(),t=d((async(t,n)=>{if(!e)throw new Error("No Model provided!");const{qReverseSort:r,dimensionInfoIndex:i,sortDirection:o}=t,a=[];if(n===o)return!1;a.push({qPath:`/qHyperCubeDef/qDimensions/${i}/qDef/qReverseSort`,qOp:"Replace",qValue:(!r).toString()});try{return await e.applyPatches(a,!0),!0}catch(e){return console.error("Error while applying patch: ",e),!1}}),[e]);return t})(),{gridSectionsWrapperRefs:{headerGridWrapperRef:i,topGridWrapperRef:o,leftGridWrapperRef:a,dataGridWrapperRef:s},gridRefs:{topGridRef:l,leftGridRef:c,dataGridRef:u},scrollDirectionRefs:{verticalScrollDirection:h,horizontalScrollDirection:f},scrollbarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g,resetHorizontalScrollbarHeight:y}}=qM(),{leftGridWidth:b,leftGridFullWidth:v,leftGridColumnWidths:x,rightGridFullWidth:w,showLastRightBorder:S,getRightGridColumnWidth:E,getHeaderCellsIconsVisibilityStatus:C,overrideLeftGridWidth:M}=function({tableWidth:e,verticalScrollbarWidth:t,resetHorizontalScrollbarHeight:n}){const{layoutService:r,styleService:i}=_E(),{gridSectionsData:{headersData:o}}=hM(),{measureText:a}=Tg(i.header),s=IM({tableWidth:e}),l=LM({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:s.leftGridWidth}),c=s.leftGridWidth+l.rightGridFullWidth+1<e,u=d(((e,t,n="")=>{let i=e;r.isIndentModeEnabled&&(i=1,1===o.size.x&&(i=0));const l=s.leftGridColumnWidths[i];let c=!1,u=!1,d=a(n)+mM;return t&&d+20<=l&&(u=!0,d+=20),d+20<=l&&(c=!0),{shouldShowMenuIcon:c,shouldShowLockIcon:u}}),[s.leftGridColumnWidths,a,r.isIndentModeEnabled,o.size.x]);return p((()=>{const e=s.leftGridWidth===s.leftGridFullWidth,t=l.rightGridWidth===l.rightGridFullWidth;e&&t&&n()}),[n,s.leftGridWidth,s.leftGridFullWidth,l.rightGridWidth,l.rightGridFullWidth]),{...s,...l,showLastRightBorder:c,getHeaderCellsIconsVisibilityStatus:u}}({tableWidth:n.width,verticalScrollbarWidth:m,resetHorizontalScrollbarHeight:y}),{gridScaffoldDimensions:_,headerGridDims:k,topGridDims:R,leftGridDims:A,dataGridDims:I,metadata:{everyThingFitsInTableRectHeight:L,scrollbarsVisibilityStatus:D}}=(({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:n,leftGridOriginalWidth:r,rightGridOriginalWidth:i},scrollBarsDimensions:{verticalScrollbarWidth:o,horizontalScrollbarHeight:a}})=>{const s=FM(),{pageInfo:l}=xE(),{gridSectionsData:{headersData:c,topDimensionData:u}}=hM(),d=Math.min(s.height*gM,Math.max(s.height*gM-25,s.height-t-a)),p=s.width*gM,h=l.rowsOnCurrentPage*t,f=Math.max(c.size.y,u.rowCount,1),m=e*f,g=e*f,y=Math.min(p,n),b=s.width-p,v=Math.max(b,s.width-y),x=Math.min(d,m,g),{availableHeight:w,everyThingFitsInTableRectHeight:S,everyThingFitsInTableRectWidth:E}=((e,t,n)=>{const r=t+1+n+o<=s.width,i=e+1+h+a,l=i-s.height<a||i<=s.height;return{availableHeight:l?i:s.height,everyThingFitsInTableRectHeight:l,everyThingFitsInTableRectWidth:r}})(x,y,v),C=w-d,M=Math.max(C,w-x),_=Math.min(M,h),k=Math.min(M,h),R=m+1+h,{visibilityStatus:A,metadata:{hasLeftGridOverflowX:I,hasDataGridOverflowX:L}}=(e=>{const{gridScaffold:{X_AXIS:{leftSectionWidth:t,rightSectionWidth:n},Y_AXIS:{topSectionHeight:r,bottomSectionHeight:i}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:o,rightSectionFullWidth:a},Y_AXIS:{topSectionFullHeight:s,bottomSectionFullHeight:l}}}=e,c=s>r,u=o>t,d=a>n,p=l>i;return{visibilityStatus:{topGrid:{overflowX:"hidden",overflowY:c?"scroll":"hidden"},leftGrid:{overflowX:u?"scroll":"hidden",overflowY:"hidden"},dataGrid:{overflowX:d?"scroll":"hidden",overflowY:p?"scroll":"hidden"}},metadata:{hasTopGridOverflowY:c,hasLeftGridOverflowX:u,hasDataGridOverflowX:d,hasDataGridOverflowY:p}}})({gridScaffold:{X_AXIS:{leftSectionWidth:y,rightSectionWidth:v},Y_AXIS:{topSectionHeight:x,bottomSectionHeight:M}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:r,rightSectionFullWidth:i},Y_AXIS:{topSectionFullHeight:g,bottomSectionFullHeight:R-g}}});return{gridScaffoldDimensions:{width:s.width,height:s.height,gridTemplateColumns:`${y}px ${v}px`,gridTemplateRows:`${x}px ${M}px`},headerGridDims:{width:-1,height:x},topGridDims:{fullSizeWrapper:{width:i-o+(L?o:0),height:g},stickyWrapper:{width:v-1-o,height:-1},self:{width:Math.min(i,v)-(E?1:0)-o,height:g}},leftGridDims:{fullSizeWrapper:{width:y,height:R-g+(!I&&L?a:0)},stickyWrapper:{width:y,height:M-1-a},self:{width:y,height:Math.max(t,_-(S?0:a-1))}},dataGridDims:{fullSizeWrapper:{width:i-o+(L?o:0),height:R-g+(!L&&I?a:0)},stickyWrapper:{width:v-1-o,height:M-1-a},self:{width:Math.min(i,v)-(E?1:0)-o,height:Math.max(t,k-(S?0:a-1))}},metadata:{everyThingFitsInTableRectHeight:S,scrollbarsVisibilityStatus:A}}})({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:b,leftGridOriginalWidth:v,rightGridOriginalWidth:w},scrollBarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g}}),P=d((()=>e),[e]),O=d((()=>t),[t]);return(()=>{const{downloadService:e}=_E();p((()=>{e.isDownloadedAsPDForImage&&e.notifyIsDoneRendering()}))})(),Hn.jsxs(zM,{style:_,children:[Hn.jsx("div",{style:{overflow:"hidden"},ref:i,children:Hn.jsx(MI,{tableWidth:n.width,leftGridWidth:b,columnWidths:x,getHeaderCellsIconsVisibilityStatus:C,rowHight:e,height:k.height,changeSortOrder:r,overrideLeftGridWidth:M})}),Hn.jsx($M,{style:D.topGrid,origin:Qt.TopGrid,ref:o,children:Hn.jsx(jM,{style:R.fullSizeWrapper,children:Hn.jsx(HM,{style:R.stickyWrapper,children:Hn.jsx(zU,{topGridRef:l,rowHightCallback:P,...R.self,showLastBorder:{right:S,bottom:!1},getRightGridColumnWidth:E})})})}),Hn.jsx($M,{style:D.leftGrid,origin:Qt.LeftGrid,ref:a,children:Hn.jsx(jM,{style:A.fullSizeWrapper,children:Hn.jsx(HM,{style:A.stickyWrapper,children:Hn.jsx(NU,{leftGridRef:c,...A.self,columnWidths:x,showLastBorder:{right:!1,bottom:L}})})})}),Hn.jsx($M,{style:D.dataGrid,origin:Qt.DataGrid,ref:s,children:Hn.jsx(jM,{style:I.fullSizeWrapper,children:Hn.jsx(HM,{style:I.stickyWrapper,children:Hn.jsx(qk,{dataGridRef:u,rowHightCallback:O,...I.self,showLastBorder:{right:S,bottom:L},getRightGridColumnWidth:E,verticalScrollDirection:h,horizontalScrollDirection:f})})})})]})},WU=()=>{const{keyboard:e,theme:t,interactions:n,translator:r}=EE(),{pageInfo:i,updatePageInfo:o,rect:a}=xE(),{layoutService:s}=_E(),{layout:l,hasData:c}=s;return Hn.jsxs(Hn.Fragment,{children:[c?Hn.jsx(BU,{}):null,Hn.jsx(RE,{}),Hn.jsx(bE,{paginationNeeded:i.shouldShowPagination,handleChangePage:e=>{o({page:e})},pageInfo:i,totalRowCount:i.totalRowCount,totalColumnCount:0,totalPages:i.totalPages,keyboard:e,translator:r,theme:t,interactions:n,rect:a,layout:l})]})},$U={WHITE:"#FFFFFF",GREEN_ULTRA_LIGHT:"#F2F9F5",GREEN:"#00873D",GREEN_PALE:"#15AA51",GREEN_DARK:"#0D6932",GREEN_EXTRA_DARK:"#094923",BLUE_ULTRA_LIGHT:"#EDF7FC",BLUE:"#005DB9",BLUE_PALE:"#048DEC",BLUE_DARK:"#003A8F",BLUE_EXTRA_DARK:"#002D6D",RED_ULTRA_LIGHT:"#FEF2F6",RED:"#D7004B",RED_PALE:"#F15A81",RED_DARK:"#8B0041",RED_EXTRA_DARK:"#5C002B",ORANGE_ULTRA_LIGHT:"#FFF7EB",ORANGE:"#EF6D00",ORANGE_PALE:"#FF9800",ORANGE_DARK:"#BF3900",ORANGE_EXTRA_DARK:"#611100",PURPLE:"#655dc6",PURPLE_PALE:"#8D8BCE",PURPLE_DARK:"#413885",GREYSCALE_0:"#000000",GREYSCALE_5:"#0E0E0E",GREYSCALE_10:"#1A1A1A",GREYSCALE_15:"#262626",GREYSCALE_20:"#333333",GREYSCALE_25:"#404040",GREYSCALE_30:"#4D4D4D",GREYSCALE_35:"#595959",GREYSCALE_40:"#666666",GREYSCALE_45:"#737373",GREYSCALE_50:"#808080",GREYSCALE_55:"#8C8C8C",GREYSCALE_60:"#999999",GREYSCALE_65:"#A6A6A6",GREYSCALE_70:"#B3B3B3",GREYSCALE_75:"#BFBFBF",GREYSCALE_80:"#CCCCCC",GREYSCALE_85:"#D9D9D9",GREYSCALE_90:"#E6E6E6",GREYSCALE_95:"#F2F2F2",GREYSCALE_98:"#FAFAFA",GREYSCALE_100:"#FFFFFF",GREYSCALE_0_0:"rgba(0, 0, 0, 0)",GREYSCALE_0_03:"rgba(0, 0, 0, 0.03)",GREYSCALE_0_05:"rgba(0, 0, 0, 0.05)",GREYSCALE_0_06:"rgba(0, 0, 0, 0.06)",GREYSCALE_0_10:"rgba(0, 0, 0, 0.1)",GREYSCALE_0_15:"rgba(0, 0, 0, 0.15)",GREYSCALE_0_20:"rgba(0, 0, 0, 0.2)",GREYSCALE_0_30:"rgba(0, 0, 0, 0.3)",GREYSCALE_0_42:"rgba(0, 0, 0, 0.42)",GREYSCALE_0_55:"rgba(0, 0, 0, 0.55)",GREYSCALE_0_60:"rgba(0, 0, 0, 0.6)",GREYSCALE_100_15:"rgba(255, 255, 255, 0.15)",GREYSCALE_100_50:"rgba(255, 255, 255, 0.5)",GREYSCALE_100_60:"rgba(255, 255, 255, 0.6)",MISC_FOCUS_BORDER:"#0275D9",TEXT_PRIMARY:"#404040",TEXT_SECONDARY:"rgba(0, 0, 0, 0.55)"},HU=12,VU=14,GU=16,UU=24,YU=3,KU=300,XU=400,JU=600,ZU=700,QU={FONT_FAMILY:"'Source Sans Pro', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif"};yn($U.GREYSCALE_0,.05),yn($U.GREEN_PALE,.5),yn($U.BLUE_PALE,.5),yn($U.GREEN_PALE,.5),yn($U.BLUE_PALE,.5),yn($U.GREEN_PALE,.5),yn($U.BLUE_PALE,.5);var eY;function tY(){return tY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tY.apply(null,arguments)}yn($U.GREEN_PALE,.5),yn($U.BLUE_PALE,.5),yn($U.GREEN_PALE,.5),yn($U.BLUE_PALE,.5);var nY,rY=function(t){return e.createElement("svg",tY({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),eY||(eY=e.createElement("path",{d:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5z"})))};function iY(){return iY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iY.apply(null,arguments)}var oY=function(t){return e.createElement("svg",iY({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),nY||(nY=e.createElement("path",{d:"m9.345 8 3.982 3.982a.951.951 0 0 1-1.345 1.345L8 9.345l-3.982 3.982a.951.951 0 0 1-1.345-1.345L6.655 8 2.673 4.018a.951.951 0 0 1 1.345-1.345L8 6.655l3.982-3.982a.951.951 0 1 1 1.345 1.345z"})))};function aY({fontSize:e="medium",children:t=null,className:n=""}={}){const r="small"===e?"16px":"20px",i="small"===e?"-2px 0":void 0;return Hn.jsx("i",{style:{fontSize:r,margin:i,display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-.125em",textRendering:"optimizeLegibility",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},className:n,children:t})}function sY(e={}){return Hn.jsx(aY,{...e,children:Hn.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20",children:[Hn.jsx("rect",{width:"20",height:"20",fill:"currentColor",rx:"3"}),Hn.jsx("path",{fill:"#FFFFFF",fillRule:"evenodd",d:"m12.627 6.617-4.206 4.205-1.037-1.035a1.25 1.25 0 1 0-1.768 1.767l1.92 1.919a1.25 1.25 0 0 0 1.769 0l5.09-5.089a1.25 1.25 0 1 0-1.768-1.768Z",clipRule:"evenodd"})]})})}function lY(e={}){return Hn.jsx(aY,{...e,children:Hn.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:Hn.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[Hn.jsx("rect",{fill:"currentColor",x:"0",y:"0",width:"16",height:"16",rx:"3"}),Hn.jsx("rect",{fill:"#FFFFFF",x:"4",y:"7",width:"8",height:"2",rx:"1"})]})})})}function cY(e={}){return Hn.jsx(aY,{fontSize:"medium",...e,children:Hn.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:Hn.jsx("g",{strokeWidth:"1",fillRule:"evenodd",fillOpacity:"0.603119339",strokeOpacity:"0.146654212",children:Hn.jsx("rect",{stroke:"currentStroke",fill:"currentFill",x:"0.5",y:"0.5",width:"15",height:"15",rx:"7.5"})})})})}function uY(e={}){return Hn.jsx(aY,{fontSize:"medium",...e,children:Hn.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Hn.jsx("rect",{stroke:"none",width:"16",height:"16",rx:"8",fill:"currentColor"}),Hn.jsx("path",{d:"M11 8C11 9.65685 9.65685 11 8 11C6.34315 11 5 9.65685 5 8C5 6.34315 6.34315 5 8 5C9.65685 5 11 6.34315 11 8Z",stroke:"none",fill:"white"})]})})}function dY({className:e}){return Hn.jsx(aY,{fontSize:"small",className:e,children:Hn.jsx("svg",{width:"8px",height:"14px",viewBox:"0 0 8 14",version:"1.1","aria-labelledby":"SortIcon",children:Hn.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:Hn.jsx("g",{transform:"translate(-4.000000, -1.000000)",fill:"#404040",fillRule:"nonzero",children:Hn.jsxs("g",{transform:"translate(4.324187, 1.300372)",children:[Hn.jsx("path",{d:"M4.06624695,13.2115849 L7.28588573,9.1870364 C7.3893886,9.05765782 7.36841219,8.8688701 7.23903361,8.76536724 C7.18583969,8.72281211 7.11974654,8.69962788 7.05162509,8.69962788 L0.3,8.69962788 C0.134314575,8.69962788 -1.25807407e-14,8.83394246 -1.26010313e-14,8.99962788 C-1.26093738e-14,9.06774933 0.0231842256,9.13384248 0.0657393572,9.1870364 L3.28537814,13.2115849 C3.45788292,13.4272158 3.7725291,13.4621765 3.98816007,13.2896718 C4.01699242,13.2666059 4.04318107,13.2404172 4.06624695,13.2115849 Z",opacity:"0.300390625"}),Hn.jsx("path",{d:"M4.06624695,0.187670888 L7.28588573,4.21221937 C7.3893886,4.34159795 7.36841219,4.53038566 7.23903361,4.63388852 C7.18583969,4.67644366 7.11974654,4.69962788 7.05162509,4.69962788 L0.3,4.69962788 C0.134314575,4.69962788 2.1918781e-12,4.56531331 2.19185781e-12,4.39962788 C2.19184946e-12,4.33150643 0.0231842256,4.26541328 0.0657393572,4.21221937 L3.28537814,0.187670888 C3.45788292,-0.0279600799 3.7725291,-0.0629207673 3.98816007,0.109584007 C4.01699242,0.132649888 4.04318107,0.158838536 4.06624695,0.187670888 Z"})]})})})})})}function pY(e={}){return Hn.jsx(aY,{...e,children:Hn.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:Hn.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:Hn.jsx("rect",{stroke:$U.GREYSCALE_0_42,fill:"currentColor",x:"0.5",y:"0.5",width:"15",height:"15",rx:"3"})})})})}Hn.jsx(oY,{"aria-hidden":"true",viewBox:"0 0 16 16",width:12,height:12}),Hn.jsx(rY,{"aria-hidden":"true",viewBox:"0 0 16 16",width:12,height:12}),Hn.jsx(cY,{}),Hn.jsx(uY,{}),Hn.jsx((function(e={}){return Hn.jsx(aY,{...e,children:Hn.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:Hn.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:"0.603119339",strokeOpacity:"0.146654212",children:Hn.jsx("rect",{stroke:"#000000",fill:"currentColor",x:"0.5",y:"0.5",width:"15",height:"15",rx:"3"})})})})}),{}),Hn.jsx(sY,{}),Hn.jsx(lY,{}),Hn.jsx(rY,{style:{color:$U.TEXT_PRIMARY},"aria-hidden":"true",viewBox:"0 0 16 16",width:16,height:16});const hY={MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0,focusVisibleClassName:"sprout-focus-visible"},styleOverrides:{root:{}}},MuiButton:{defaultProps:{color:"inherit",disableRipple:!0,focusVisibleClassName:"sprout-focus-visible"},styleOverrides:{root:{height:"32px",lineHeight:"16px",minWidth:"24px",fontSize:14,borderRadius:YU,"& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"},transition:"unset",color:"var(--sprout-common-foreground-color-default)",boxShadow:"none","&:hover":{backgroundColor:"var(--sprout-common-background-color-hover)"},"&:active":{backgroundColor:"var(--sprout-common-background-color-pressed)"},"&.Mui-disabled":{backgroundColor:"var(--sprout-common-background-color-disabled)"},"&.Mui-focusVisible":{outline:"var(--sprout-focus-border-default)",outlineOffset:"calc(var(--sprout-focus-border-default-width) / -2)",backgroundColor:"var(--sprout-focus-background-color-default)",zIndex:100}},text:{padding:"8px 16px",backgroundColor:"transparent"},textPrimary:{color:"var(--sprout-brand-primary-color-default)"},textSecondary:{color:"var(--sprout-info-color-default)"},textWarning:{color:"var(--sprout-warning-color-default)"},textError:{color:"var(--sprout-danger-color-default)"},outlined:{padding:"7px 16px",border:"var(--sprout-common-border-moderate)",backgroundColor:"var(--sprout-common-background-color-enabled)","&.Mui-focusVisible":{borderColor:"transparent"},"&:hover":{border:"var(--sprout-common-border-moderate)"}},outlinedPrimary:{borderColor:"var(--sprout-brand-primary-color-default)",color:"var(--sprout-brand-primary-color-default)","&:hover":{borderColor:"var(--sprout-brand-primary-color-default)"}},outlinedSecondary:{borderColor:"var(--sprout-info-color-default)",color:"var(--sprout-info-color-default)","&:hover":{borderColor:"var(--sprout-info-color-default)"}},outlinedWarning:{borderColor:"var(--sprout-warning-color-default)",color:"var(--sprout-warning-color-default)","&:hover":{borderColor:"var(--sprout-warning-color-default)"}},outlinedError:{borderColor:"var(--sprout-danger-color-default)",color:"var(--sprout-danger-color-default)","&:hover":{borderColor:"var(--sprout-danger-color-default)"}},contained:{color:"var(--sprout-brand-primary-color-inverse)",backgroundColor:"var(--sprout-brand-primary-color-default)",padding:"8px 16px","&:hover":{backgroundColor:"var(--sprout-brand-primary-color-hover)"},"&:active":{backgroundColor:"var(--sprout-brand-primary-color-pressed)"},"&.Mui-focusVisible":{outline:"var(--sprout-focus-border-default)",outlineOffset:"var(--sprout-focus-border-default-width)",background:"var(--sprout-brand-primary-color-focus)"}},containedError:{backgroundColor:"var(--sprout-danger-color-default)","&:hover":{backgroundColor:"var(--sprout-danger-color-hover)"},"&:active":{backgroundColor:"var(--sprout-danger-color-pressed)"},"&.Mui-focusVisible":{outlineColor:"var(--sprout-danger-color-inverse)",backgroundColor:"var(--sprout-danger-color-focus)"}},sizeSmall:{fontSize:12,height:"24px","& > svg:only-child, & > i:only-child":{marginLeft:"-7px",marginRight:"-7px"}},sizeLarge:{fontSize:16,height:"40px",lineHeight:"20px","& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},textSizeSmall:{padding:"4px 11px"},textSizeLarge:{padding:"10px 19px"},outlinedSizeSmall:{padding:"3px 11px"},outlinedSizeLarge:{padding:"9px 19px"},containedSizeSmall:{padding:"4px 11px"},containedSizeLarge:{padding:"10px 19px"}},variants:[]}};var fY=(e,t)=>(e=>({MuiAccordion:{styleOverrides:{root:{backgroundColor:$U.GREYSCALE_98,"&:before":{backgroundColor:"unset"},"&.Mui-expanded":{margin:"0px"}}}},MuiAccordionDetails:{styleOverrides:{root:{backgroundColor:$U.WHITE}}},MuiAccordionSummary:{defaultProps:{expandIcon:Hn.jsx(rY,{"aria-hidden":"true",viewBox:"0 0 16 16",width:16,height:16})},styleOverrides:{root:{padding:"0px 12px 0px 16px",minHeight:"auto",boxShadow:`inset 0px -1px 0px 0px ${$U.GREYSCALE_0_15}`,"&.Mui-focusVisible":{borderColor:$U.MISC_FOCUS_BORDER,boxShadow:`inset 0 0 0 2px ${$U.MISC_FOCUS_BORDER}`,borderRadius:YU,backgroundColor:$U.GREYSCALE_0_03},"&.Mui-expanded":{minHeight:"auto"}},content:{overflow:"hidden",textOverflow:"ellipsis","&.Mui-expanded":{margin:"12px 0px"}}}},MuiAppBar:{defaultProps:{elevation:0},styleOverrides:{root:{flex:"0 0 48px",boxShadow:`inset 0 -1px 0 0 ${$U.GREYSCALE_0_15}`},colorPrimary:{backgroundColor:$U.WHITE,color:$U.TEXT_PRIMARY}}},MuiBadge:{styleOverrides:{badge:{height:"16px",minWidth:"16px",fontSize:"12px",padding:"0px 5px"},anchorOriginTopRightRectangular:{top:"-3px",right:"-3px"}}},MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0,focusVisibleClassName:"sprout-focus-visible"}},MuiButtonGroup:{defaultProps:{disableRipple:!0},styleOverrides:{root:{height:"32px",lineHeight:"16px",fontSize:14,borderRadius:YU},text:{padding:"8px 16px","&.Mui-focusVisible":{boxShadow:`0 0 0 2px ${$U.MISC_FOCUS_BORDER}`}},outlined:{padding:"7px 16px",borderColor:$U.GREYSCALE_0_15,backgroundColor:$U.GREYSCALE_100_60,"&.Mui-focusVisible":{borderColor:$U.MISC_FOCUS_BORDER,boxShadow:`0 0 0 1px ${$U.MISC_FOCUS_BORDER}`}},contained:{padding:"8px 16px",boxShadow:"none","&:hover":{boxShadow:"none"},"&:active":{boxShadow:"none"}},groupedContainedPrimary:{"&:hover":{backgroundColor:$U.GREEN_PALE},"&:active":{backgroundColor:$U.GREEN_DARK},"&.Mui-focusVisible":{borderColor:$U.GREEN_PALE,boxShadow:`0 0 0 3px ${Sb($U.GREEN_PALE,.5)}`}},groupedContainedSecondary:{"&:hover":{backgroundColor:$U.BLUE_PALE},"&:active":{backgroundColor:$U.BLUE_DARK},"&.Mui-focusVisible":{borderColor:$U.BLUE_PALE,boxShadow:`0 0 0 3px ${Sb($U.BLUE_PALE,.5)}`}}},variants:[{props:{size:"small"},style:{height:"24px"}},{props:{size:"large"},style:{height:"40px"}}]},MuiButton:{defaultProps:{color:"inherit",disableRipple:!0,focusVisibleClassName:"sprout-focus-visible"},styleOverrides:{root:{height:"32px",lineHeight:"16px",minWidth:"24px",fontSize:14,borderRadius:YU,"& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},text:{padding:"8px 16px","&:active":{backgroundColor:$U.GREYSCALE_0_10},"&.Mui-focusVisible":{boxShadow:`0 0 0 2px ${$U.MISC_FOCUS_BORDER}`}},outlined:({ownerState:e})=>({padding:"7px 16px",borderColor:$U.GREYSCALE_0_15,backgroundColor:$U.GREYSCALE_100_60,"&:active":{backgroundColor:$U.GREYSCALE_0_10},"&.Mui-focusVisible":{borderColor:$U.MISC_FOCUS_BORDER,boxShadow:`0 0 0 1px ${$U.MISC_FOCUS_BORDER}`},..."amethyst"===e.color&&{borderColor:$U.PURPLE,"&.Mui-focusVisible":{borderColor:$U.PURPLE,boxShadow:`0 0 0 3px ${Sb($U.PURPLE_PALE,.5)}`}}}),outlinedPrimary:{borderColor:$U.GREEN,"&.Mui-focusVisible":{borderColor:$U.GREEN,boxShadow:`0 0 0 3px ${Sb($U.GREEN_PALE,.5)}`}},outlinedSecondary:{borderColor:$U.BLUE,"&.Mui-focusVisible":{borderColor:$U.BLUE,boxShadow:`0 0 0 3px ${Sb($U.BLUE_PALE,.5)}`}},outlinedWarning:{borderColor:$U.ORANGE,"&.Mui-focusVisible":{borderColor:$U.ORANGE,boxShadow:`0 0 0 3px ${Sb($U.ORANGE_PALE,.5)}`}},outlinedError:{borderColor:$U.RED,"&.Mui-focusVisible":{borderColor:$U.RED,boxShadow:`0 0 0 3px ${Sb($U.RED_PALE,.5)}`}},contained:({ownerState:e})=>({color:$U.WHITE,padding:"8px 16px",boxShadow:"none","&:hover":{boxShadow:"none"},"&:active":{boxShadow:"none"},..."amethyst"===e.color&&{"&:hover":{backgroundColor:$U.PURPLE_PALE},"&:active":{backgroundColor:$U.PURPLE_DARK},"&.Mui-focusVisible":{borderColor:$U.PURPLE_PALE,boxShadow:`0 0 0 3px ${Sb($U.PURPLE_PALE,.5)}`}}}),containedPrimary:{"&:hover":{backgroundColor:$U.GREEN_PALE},"&:active":{backgroundColor:$U.GREEN_DARK},"&.Mui-focusVisible":{borderColor:$U.GREEN_PALE,boxShadow:`0 0 0 3px ${Sb($U.GREEN_PALE,.5)}`}},containedSecondary:{"&:hover":{backgroundColor:$U.BLUE_PALE},"&:active":{backgroundColor:$U.BLUE_DARK},"&.Mui-focusVisible":{borderColor:$U.BLUE_PALE,boxShadow:`0 0 0 3px ${Sb($U.BLUE_PALE,.5)}`}},containedWarning:{"&:hover":{backgroundColor:$U.ORANGE_PALE},"&:active":{backgroundColor:$U.ORANGE_DARK},"&.Mui-focusVisible":{borderColor:$U.ORANGE_PALE,boxShadow:`0 0 0 3px ${Sb($U.ORANGE_PALE,.5)}`}},containedError:{"&:hover":{backgroundColor:$U.RED_PALE},"&:active":{backgroundColor:$U.RED_DARK},"&.Mui-focusVisible":{borderColor:$U.RED_PALE,boxShadow:`0 0 0 3px ${Sb($U.RED_PALE,.5)}`}},sizeSmall:{fontSize:12,height:"24px","& > svg:only-child, & > i:only-child":{marginLeft:"-7px",marginRight:"-7px"}},sizeLarge:{fontSize:16,height:"40px",lineHeight:"20px","& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},textSizeSmall:{padding:"4px 11px"},textSizeLarge:{padding:"10px 19px"},outlinedSizeSmall:{padding:"3px 11px"},outlinedSizeLarge:{padding:"9px 19px"},containedSizeSmall:{padding:"4px 11px"},containedSizeLarge:{padding:"10px 19px"}},variants:[]},MuiCardActionArea:{styleOverrides:{root:{height:"100%","&.MuiCardActionArea-focusHighlight":{opacity:0},"&:hover":{boxShadow:"none",backgroundColor:$U.GREYSCALE_0_03,"&.MuiCardActionArea-focusHighlight":{opacity:0}},"&:active":{backgroundColor:$U.GREYSCALE_95,boxShadow:"none"},"&.Mui-focusVisible":{borderRadius:YU,boxShadow:`inset 0 0 0 2px ${$U.MISC_FOCUS_BORDER}`,"&.MuiCardActionArea-focusHighlight":{opacity:0}}}}},MuiChip:{defaultProps:{deleteIcon:Hn.jsx(oY,{"aria-hidden":"true",viewBox:"0 0 16 16",width:12,height:12}),variant:"outlined"},styleOverrides:{root:{height:"24px",fontSize:HU,borderRadius:YU,color:$U.TEXT_PRIMARY,backgroundColor:$U.GREYSCALE_100_15,"&.sprout-focus-visible":{borderColor:$U.MISC_FOCUS_BORDER,boxShadow:`0px 0px 0px 1px ${$U.MISC_FOCUS_BORDER}`},"&.Mui-focusVisible":{backgroundColor:$U.GREYSCALE_0_03},"&.Mui-disabled":{backgroundColor:$U.GREYSCALE_0_05,color:$U.GREYSCALE_0_30,border:"none",opacity:1},"&.MuiChip-outlinedSuccess":{color:$U.GREEN,borderColor:$U.GREEN},"&.MuiChip-outlinedInfo":{color:$U.BLUE,borderColor:$U.BLUE},"&.MuiChip-outlinedWarning":{color:$U.ORANGE,borderColor:$U.ORANGE},"&.MuiChip-outlinedError":{color:$U.RED,borderColor:$U.RED}},outlined:{border:`solid 1px ${$U.GREYSCALE_0_15}`,backgroundColor:$U.GREYSCALE_100_15,".MuiChip-clickable&:active ":{boxSizing:"border-box",borderRadius:YU,boxShadow:"none",backgroundColor:$U.GREYSCALE_0_10},"&.MuiChip-deleteIconSmall":{height:13,color:"inherit"}},outlinedPrimary:{color:$U.GREEN,borderColor:$U.GREEN},outlinedSecondary:{color:$U.BLUE,borderColor:$U.BLUE},label:{fontFamily:QU.FONT_FAMILY,lineHeight:"16px"}}},MuiAutocomplete:{defaultProps:{clearIcon:Hn.jsx(oY,{"aria-hidden":"true",viewBox:"0 0 16 16",height:12,width:12}),popupIcon:Hn.jsx(rY,{"aria-hidden":"true",viewBox:"0 0 16 16",width:12,height:12}),forcePopupIcon:!0},styleOverrides:{root:{"& .MuiAutocomplete-endAdornment > button":{border:"none",backgroundColor:"unset"}},input:{"&.MuiAutocomplete-input":{padding:"6px 4px"}},inputRoot:{padding:"0px 2px",boxSizing:"border-box",borderRadius:YU},listbox:{padding:"0","& .MuiAutocomplete-option":{height:"32px",minHeight:"32px"}},option:{borderRadius:YU,fontSize:VU,height:"32px",padding:"6px 16px",minHeight:"32px","&.MuiAutocomplete-option.Mui-focused":{backgroundColor:$U.GREYSCALE_0_03,"&.Mui-focusVisible":{border:`solid 2px ${$U.MISC_FOCUS_BORDER}`,padding:"4px 14px"}},'&.MuiAutocomplete-option[aria-selected="true"]':{backgroundColor:$U.GREYSCALE_0_05,"&.Mui-focused":{backgroundColor:$U.GREYSCALE_0_05},"&.Mui-focusVisible":{backgroundColor:$U.GREYSCALE_0_05}}},popupIndicator:{borderRadius:YU,border:`solid 1px ${$U.GREYSCALE_0_15}`,color:$U.GREYSCALE_0_60,marginRight:0,width:UU,height:UU},paper:{marginTop:"4px",boxShadow:`0px 2px 4px 0px ${$U.GREYSCALE_0_15}`},clearIndicator:{borderRadius:YU,marginRight:"4px"},popupIndicatorOpen:{backgroundColor:$U.GREYSCALE_0_10}}},MuiFormControlLabel:{styleOverrides:{root:{marginLeft:"-10px"},label:{fontSize:VU}}},MuiFormHelperText:{styleOverrides:{root:{fontSize:HU,lineHeight:"16px",margin:"4px 0 0 0","&.Mui-error":{color:$U.RED}},contained:{marginLeft:0,marginRight:0}}},MuiFormLabel:{styleOverrides:{root:{color:$U.GREYSCALE_25,fontSize:HU,fontFamily:QU.FONT_FAMILY,fontWeight:JU,fontStretch:"normal",fontStyle:"normal",letterSpacing:"normal",lineHeight:1,"&.Mui-focused":{color:$U.TEXT_PRIMARY},"&.Mui-error":{color:$U.TEXT_SECONDARY},"&[optional=true]":{"&:after":{color:$U.TEXT_SECONDARY,content:"'(optional)'",fontWeight:XU,marginLeft:"4px"}}},asterisk:{visibility:"collapse",display:"inline-flex","&::after":{visibility:"visible",color:$U.TEXT_SECONDARY,content:"'(required)'",fontWeight:XU,marginLeft:"4px"}}}},MuiOutlinedInput:{defaultProps:{notched:!1},styleOverrides:{root:{fontSize:VU,lineHeight:"16px",backgroundColor:$U.WHITE,borderRadius:YU,"&:not(.Mui-focused):not(.Mui-error):not(.Mui-disabled):hover .MuiOutlinedInput-notchedOutline":{border:`solid 1px ${$U.GREYSCALE_0_05}`,borderColor:$U.GREYSCALE_0_30},"&.Mui-focused:not(.Mui-error) .MuiOutlinedInput-notchedOutline":{border:`solid 1px ${$U.MISC_FOCUS_BORDER}`,boxShadow:`0px 0px 0px 1px ${$U.MISC_FOCUS_BORDER}, inset 0 2px 0 0 ${$U.GREYSCALE_0_05}`},"&.Mui-focused.Mui-error .MuiOutlinedInput-notchedOutline":{border:`solid 1px ${$U.RED}`,boxShadow:`0px 0px 0px 1px ${$U.RED}, inset 0 2px 0 0 ${$U.GREYSCALE_0_05}`},"&.Mui-disabled":{backgroundColor:"transparent"},"&.Mui-disabled .MuiOutlinedInput-notchedOutline":{border:`solid 1px ${$U.GREYSCALE_0_10}`,borderColor:$U.GREYSCALE_0_10,backgroundColor:$U.GREYSCALE_0_05}},adornedStart:{paddingLeft:0},adornedEnd:{paddingRight:0},input:{color:$U.TEXT_PRIMARY,padding:"6px 12px","&.Mui-disabled":{opacity:.45}},inputSizeSmall:{padding:"0px 12px"},notchedOutline:{borderColor:$U.GREYSCALE_0_15,borderRadius:YU,boxShadow:`inset 0 2px 0 0 ${$U.GREYSCALE_0_05}`},multiline:{padding:"0"}}},MuiSelect:{defaultProps:{IconComponent:e=>Hn.jsx(rY,{...e,"aria-hidden":"true",viewBox:"0 0 16 16",width:12,height:12}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}}},styleOverrides:{select:{padding:"7px 12px",borderRadius:"3px !important",minHeight:"1em","& em":{color:$U.TEXT_SECONDARY},"& ~svg":{position:"absolute",right:"12px",top:"unset",cursor:"pointer"},"&[aria-expanded=true]":{backgroundColor:$U.GREYSCALE_0_05},"& ~fieldset":{boxShadow:"none !important",border:"none !important",backgroundColor:"unset !important"},"&:hover":{backgroundColor:$U.GREYSCALE_0_03},"&:active":{backgroundColor:$U.GREYSCALE_0_10},"&:focus":{backgroundColor:$U.GREYSCALE_0_03,borderRadius:"3px !important",border:`solid 1px ${$U.MISC_FOCUS_BORDER}`,boxShadow:`inset 0px 0px 0px 1px ${$U.MISC_FOCUS_BORDER}`},"&.Mui-disabled":{opacity:"unset",color:$U.GREYSCALE_0_30,"&:hover":{backgroundColor:$U.GREYSCALE_0_0,borderColor:$U.GREYSCALE_0_15},"& ~svg":{color:$U.GREYSCALE_0_30}}},outlined:{border:`solid 1px ${$U.GREYSCALE_0_15}`},nativeInput:{height:"42px"}}},MuiIconButton:{styleOverrides:{root:{borderRadius:YU}}},MuiInput:{styleOverrides:{root:{"&.Mui-focused":{borderColor:$U.MISC_FOCUS_BORDER,boxShadow:`0 0 0 2px ${$U.MISC_FOCUS_BORDER}`}}}},MuiInputAdornment:{styleOverrides:{root:{padding:"4px 8px",color:$U.GREYSCALE_55},positionStart:{marginRight:0},positionEnd:{marginLeft:0}}},MuiInputBase:{styleOverrides:{root:{fieldset:{boxShadow:"none"}},input:{height:"20px",fontSize:VU,padding:"8px 12px",lineHeight:"16px","&.MuiInputBase-inputAdornedStart":{paddingLeft:0},"&.MuiInputBase-inputAdornedEnd":{paddingRight:0}},sizeSmall:{height:"24px",input:{fontSize:HU,paddingLeft:"8px"}}}},MuiInputLabel:{defaultProps:{shrink:!0},styleOverrides:{outlined:{fontSize:HU,fontWeight:JU,color:$U.GREYSCALE_25,"&.MuiInputLabel-shrink":{transform:"translate(0px, -16px)",fontWeight:JU}}}},MuiPopover:{styleOverrides:{paper:{minWidth:"160px",top:"60px",marginTop:"5px","&ul":{padding:"0px"},boxShadow:`0px 4px 10px ${$U.GREYSCALE_0_15}, 0px 0px 0px 1px ${$U.GREYSCALE_0_05}`}}},MuiRadio:{defaultProps:{size:"small",icon:Hn.jsx(cY,{}),checkedIcon:Hn.jsx(uY,{})},styleOverrides:{root:{"&:hover":{backgroundColor:"unset"},fill:$U.GREYSCALE_100_60,stroke:"black","&.sprout-focus-visible":{borderColor:"transparent",boxShadow:"none"},"&.sprout-focus-visible i":{borderRadius:"50%",boxShadow:`0 0 0 2px ${$U.MISC_FOCUS_BORDER}`},"&.Mui-checked":{"&.MuiRadio-colorPrimary":{"&.sprout-focus-visible i":{borderColor:$U.GREEN_PALE,boxShadow:`0 0 0 3px ${Sb($U.GREEN_PALE,.5)}`}},"&.MuiRadio-colorSecondary":{"&.sprout-focus-visible i":{borderColor:$U.BLUE_PALE,boxShadow:`0 0 0 3px ${Sb($U.BLUE_PALE,.5)}`}},"&.Mui-disabled":{color:$U.GREYSCALE_0_20}},"&.Mui-disabled":{fill:$U.GREYSCALE_0_20,stroke:"none"}}}},MuiCheckbox:{defaultProps:{size:"small",icon:Hn.jsx(pY,{}),checkedIcon:Hn.jsx(sY,{}),indeterminateIcon:Hn.jsx(lY,{})},styleOverrides:{root:{borderWidth:1,"&:hover":{backgroundColor:"unset"},"&.sprout-focus-visible":{borderColor:"transparent",boxShadow:"none"},"&.sprout-focus-visible i":{borderRadius:YU,boxShadow:" 0px 0px 0px 2px #FFFFFF, 0px 0px 0px 4px #177FE6"},"&:not(.Mui-disabled)":{"&:not(.Mui-checked)":{"&:not(.MuiCheckbox-indeterminate)":{color:$U.GREYSCALE_100_60,"&:hover":{g:{rect:{stroke:$U.GREYSCALE_0_55,color:$U.GREYSCALE_0_03}}},"&.sprout-focus-visible i":{boxShadow:"0px 0px 0px 2px #0275D9",g:{rect:{stroke:"none"}}}}}},"&.Mui-disabled":{"& i":{pointerEvents:"auto",cursor:"not-allowed !important",color:$U.GREYSCALE_0_15,g:{rect:{stroke:"none"}}}}},colorPrimary:{"&.MuiCheckbox-root":{"&:not(.Mui-disabled)":{"&:hover":{color:$U.GREEN_DARK}}}},colorSecondary:{"&.MuiCheckbox-root":{"&:not(.Mui-disabled)":{color:$U.GREYSCALE_0_55,"&:hover":{color:$U.GREYSCALE_25}}}}}},MuiCircularProgress:{defaultProps:{thickness:3,disableShrink:!0}},MuiDialog:{defaultProps:{fullWidth:!0}},MuiDialogActions:{styleOverrides:{root:{padding:"16px"}}},MuiDialogTitle:{styleOverrides:{root:{display:"flex",alignItems:"center",justifyContent:"space-between",boxSizing:"content-box",minHeight:"31px",padding:"16px 16px 16px 24px",fontSize:"16px",lineHeight:"24px"}}},MuiDialogContentText:{defaultProps:{variant:"body2"},styleOverrides:{root:{marginBottom:0}}},MuiDialogContent:{styleOverrides:{root:{padding:"16px 24px !important"}}},MuiDivider:{styleOverrides:{middle:{margin:"4px 8px"}}},MuiLink:{defaultProps:{underline:"none",color:$U.MISC_FOCUS_BORDER}},MuiListItemIcon:{styleOverrides:{root:{color:$U.GREYSCALE_25,minWidth:"16px",marginRight:"16px"}}},MuiListItemText:{styleOverrides:{root:{fontSize:"12px"},primary:{fontSize:VU,color:$U.TEXT_PRIMARY,lineHeight:"16px",fontWeight:JU},secondary:{fontSize:HU,color:$U.GREYSCALE_45,fontWeight:XU,lineHeight:"16px"}}},MuiListItem:{styleOverrides:{root:{fontSize:VU,minHeight:"32px"},gutters:{paddingLeft:"12px",paddingRight:"12px"}}},MuiListItemButton:{styleOverrides:{root:{fontSize:VU,height:"32px"}}},MuiListSubheader:{styleOverrides:{root:{'&[role="option"]':{color:$U.TEXT_PRIMARY,lineHeight:1.33,padding:"4px 12px",fontWeight:600,fontSize:HU,borderBottom:`solid 1px ${$U.GREYSCALE_0_15}`,pointerEvents:"none"}}}},MuiList:{styleOverrides:{padding:{paddingTop:"0px",paddingBottom:"0px"}}},MuiMenuItem:{styleOverrides:{root:{fontSize:VU,color:$U.GREYSCALE_25,height:"32px",'[class*="MuiListItemIcon-root"]':{minWidth:"16px"},"&:hover":{backgroundColor:$U.GREYSCALE_0_03},"&.Mui-selected":{backgroundColor:"unset","&:hover":{backgroundColor:$U.GREYSCALE_0_10},"&.Mui-focusVisible":{backgroundColor:$U.GREYSCALE_0_10},"&:not(.Mui-disabled)":{"&::after":{content:"url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%228px%22%20height%3D%227px%22%20viewBox%3D%220%200%208%207%22%20version%3D%221.1%22%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20aria-labelledby%3D%22Tick%22%3E%20%20%3Cg%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%3Cg%20transform%3D%22translate%280.000000%2C%20-1.000000%29%22%3E%20%20%20%20%20%20%3Cpath%20d%3D%22M7.51662484%2C1.29325%20C7.12545778%2C0.90225%206.49218732%2C0.90225%206.10202068%2C1.29325%20L2.73658335%2C4.65725%20L1.90722914%2C3.82925%20C1.5170625%2C3.43825%200.883792042%2C3.43825%200.492624979%2C3.82925%20C0.102458344%2C4.21925%200.102458344%2C4.85225%200.492624979%2C5.24325%20L2.02928127%2C6.77825%20C2.4194479%2C7.16925%203.05271836%2C7.16925%203.44388542%2C6.77825%20L7.51662484%2C2.70725%20C7.9077919%2C2.31725%207.9077919%2C1.68425%207.51662484%2C1.29325%22%3E%3C%2Fpath%3E%20%20%20%20%3C%2Fg%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E')",fontFamily:"LUI icons",position:"absolute",fontSize:"10px",right:"10px",color:$U.RED}}},"&.Mui-focusVisible":{backgroundColor:$U.GREYSCALE_0_03}},divider:{marginTop:"8px",marginBottom:"8px"},gutters:{paddingLeft:"12px",paddingRight:"12px"}}},MuiMenu:{styleOverrides:{list:{paddingTop:"4px",paddingBottom:"4px"},paper:{marginTop:"4px !important",marginBottom:"4px",background:$U.WHITE,boxShadow:"0 0 0 1px rgba(0,0,0,0.05), 0 4px 10px 0 rgba(0,0,0,0.15) !important",borderRadius:"2px !important"}}},MuiSlider:{styleOverrides:{root:{color:$U.GREEN,height:"24px","&.Mui-disabled":{color:$U.GREYSCALE_0_15}},rail:{backgroundColor:$U.GREYSCALE_0_05,height:"4px",opacity:"1",border:`solid 1px ${$U.GREYSCALE_0_05}`,borderRadius:YU,boxShadow:`inset 0px 0px 0px 1px ${$U.GREYSCALE_0_05}`},track:{height:"4px",backgroundColor:"currentColor",opacity:"1",border:`solid 1px ${$U.GREYSCALE_0_05}`,borderRadius:YU},thumb:{height:"16px",width:"16px",borderRadius:YU,backgroundColor:$U.WHITE,boxShadow:`0px 1px 2px 0px ${$U.GREYSCALE_0_15}, 0px 0px 0px 1px ${$U.GREYSCALE_0_05}`,"&:hover":{borderRadius:YU,boxShadow:`0 2px 4px 0 ${$U.GREYSCALE_0_30}, 0 0 0 1px ${$U.GREYSCALE_0_06}`},"&:focus":{boxShadow:`0 1px 2px 0 ${$U.GREYSCALE_0_15}, 0 0 0 1px ${$U.GREYSCALE_0_06}, 0 0 0 2px ${$U.MISC_FOCUS_BORDER}`},"&.Mui-focusVisible":{boxShadow:`0 1px 2px 0 ${$U.GREYSCALE_0_15}, 0 0 0 1px ${$U.GREYSCALE_0_06}, 0 0 0 2px ${$U.MISC_FOCUS_BORDER}`},"&.Mui-disabled":{width:"16px",height:"16px",marginTop:"-5px",marginLeft:"-8px",backgroundColor:$U.GREYSCALE_90},"& .custom-bar":{height:"8px",width:"1px",backgroundColor:$U.GREYSCALE_0_30,marginLeft:1,marginRight:1}},mark:{width:"1px",height:"4px",margin:"16px 0px 0px 0px",backgroundColor:$U.GREYSCALE_0_15},markActive:{opacity:1,backgroundColor:$U.GREYSCALE_0_15},markLabel:{color:$U.TEXT_SECONDARY,transform:"translateX(-50%)",top:"35px"},markLabelActive:{color:$U.TEXT_SECONDARY,transform:"translateX(-50%)",top:"35px"}}},MuiSnackbar:{defaultProps:{anchorOrigin:{vertical:"bottom",horizontal:"center"}}},MuiSnackbarContent:{styleOverrides:{root:{backgroundColor:$U.WHITE,color:$U.GREYSCALE_25}}},MuiSwitch:{defaultProps:{color:"primary",size:"small"},styleOverrides:{root:{padding:"10px",width:"60px",height:"40px","& .MuiSwitch-switchBase":{"&:hover":{backgroundColor:"unset"},"&.Mui-checked":{"&:hover":{backgroundColor:"unset"}}}},switchBase:{padding:"12px","&.Mui-disabled":{"&.MuiSwitch-thumb":{backgroundColor:$U.GREYSCALE_100_50}},"&.Mui-checked + .MuiSwitch-track":{opacity:1},"&.Mui-disabled + .MuiSwitch-track":{opacity:.12},"&.sprout-focus-visible":{borderColor:"transparent",boxShadow:"none"}},colorPrimary:{"&.sprout-focus-visible + .MuiSwitch-track":{borderColor:$U.GREEN_PALE,boxShadow:`0 0 0 3px ${Sb($U.GREEN_PALE,.5)}`}},colorSecondary:{"&.sprout-focus-visible + .MuiSwitch-track":{borderColor:$U.BLUE_PALE,boxShadow:`0 0 0 3px ${Sb($U.BLUE_PALE,.5)}`}},track:{opacity:1,backgroundColor:$U.GREYSCALE_0_15,borderRadius:YU},thumb:{height:"16px",width:"16px",borderRadius:YU,backgroundColor:$U.GREYSCALE_100},sizeSmall:{height:"32px",width:"52px",padding:"8px 10px","& .MuiSwitch-thumb":{height:"12px",width:"12px"},"& .MuiSwitch-switchBase":{padding:"10px 12px"}}}},MuiTextField:{defaultProps:{margin:"dense",variant:"outlined"},styleOverrides:{root:{marginBottom:0}}},MuiTab:{styleOverrides:{root:{fontSize:VU,fontWeight:JU,textTransform:"none",minWidth:"auto",boxSizing:"border-box",paddingBottom:"12px","&:hover":{borderBottom:`2px solid ${$U.GREYSCALE_80}`,paddingBottom:"10px"},"&.sprout-focus-visible":{boxShadow:`inset 0 0 0 2px ${$U.MISC_FOCUS_BORDER}`,backgroundColor:$U.GREYSCALE_0_03,borderRadius:YU},"&.Mui-disabled":{opacity:.3}},textColorPrimary:{color:$U.GREYSCALE_25,"&.Mui-selected":{color:$U.GREYSCALE_25}},textColorInherit:{opacity:"unset"},labelIcon:{minWidth:"40px",minHeight:"48px"}}},MuiTabs:{defaultProps:{indicatorColor:"primary",textColor:"primary"},styleOverrides:{root:{fontSize:VU,fontWeight:"bold"},scroller:{height:"100%"},flexContainer:{"&:not(.MuiTabs-flexContainerVertical)":{height:"100%",marginLeft:2,marginRight:2}},indicator:{height:2},scrollButtons:{borderRadius:YU,"&:hover":{backgroundColor:$U.GREYSCALE_0_03},"&.Mui-disabled":{opacity:"unset","& .MuiSvgIcon-root":{opacity:.3}}},vertical:{padding:"8px",boxSizing:"border-box","& .MuiTabs-indicator":{left:0,right:"unset",transition:"none",clipPath:"inset(12px 0 12px 0)",marginLeft:"1px"},"& .MuiTabs-scrollButtons":{flexDirection:"column",position:"relative","&:first-child":{marginBottom:"4px","&::before":{content:'""',display:"block",width:"100%",height:"1px",borderBottom:`1px solid ${$U.GREYSCALE_0_15}`,position:"absolute",bottom:0,left:0}},"&:last-child":{marginTop:"4px","&::before":{content:'""',display:"block",width:"100%",height:"1px",borderBottom:`1px solid ${$U.GREYSCALE_0_15}`,position:"absolute",top:0,left:0}}},"& .MuiTab-root":{fontWeight:"normal",borderRadius:YU,marginBlock:"4px","&:first-child":{marginTop:"0px"},"&:last-child":{marginBottom:"0px"},"&.Mui-selected":{backgroundColor:$U.GREYSCALE_0_05},"&:hover":{backgroundColor:$U.GREYSCALE_0_03,borderBottomColor:"transparent"}}}}},MuiTableCell:{styleOverrides:{root:{padding:"0px 8px 0px 16px",borderBottom:`1px solid ${$U.GREYSCALE_85}`,borderRight:`1px solid ${$U.GREYSCALE_85}`,height:"39px"},head:{height:"41px",fontWeight:JU,backgroundColor:$U.GREYSCALE_98},paddingCheckbox:{width:"40px",padding:"0px"},paddingNone:{padding:"0px"},sizeSmall:{padding:"0px 8px",height:"29px","&.MuiTableCell-head":{height:"31px"},"&.MuiTableCell-paddingCheckbox":{width:"40px",padding:"0px"}},stickyHeader:{backgroundColor:$U.GREYSCALE_98,borderBottom:`1px solid ${$U.GREYSCALE_85}`}}},MuiTableContainer:{styleOverrides:{root:{borderBottom:`1px solid ${$U.GREYSCALE_85}`,borderTop:`1px solid ${$U.GREYSCALE_85}`}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:$U.GREYSCALE_98}}},MuiTableRow:{styleOverrides:{root:{"&.Mui-selected":{backgroundColor:$U.GREYSCALE_0_05,"&:hover":{backgroundColor:$U.GREYSCALE_0_03}},"&&:hover":{backgroundColor:$U.GREYSCALE_0_03}}}},MuiTableSortLabel:{defaultProps:{IconComponent:({className:e})=>Hn.jsx(dY,{className:e})},styleOverrides:{root:{display:"flex",justifyContent:"space-between","&:hover":{"& icon":{opacity:.5}},"&.Mui-active":{"&& icon":{opacity:1}}},icon:{opacity:0},iconDirectionDesc:{transform:"rotate(180deg)"},iconDirectionAsc:{transform:"rotate(0deg)"}}},MuiTable:{styleOverrides:{root:{borderLeft:`1px solid ${$U.GREYSCALE_85}`}}},MuiToggleButton:{styleOverrides:{root:{height:32,lineHeight:"16px",width:32,fontSize:VU,borderRadius:YU,padding:"7px 16px",border:`1px solid ${$U.GREYSCALE_0_15}`,backgroundColor:$U.GREYSCALE_100_60,color:$U.GREYSCALE_25,zIndex:1,"&:active":{backgroundColor:$U.GREYSCALE_0_10,border:`1px solid ${$U.GREYSCALE_0_30}`},"&:hover":{backgroundColor:$U.GREYSCALE_0_03,border:`1px solid ${$U.GREYSCALE_0_30}`},"&.sprout-focus-visible":{backgroundColor:$U.GREYSCALE_0_03,boxShadow:`0 0 0 1px ${$U.MISC_FOCUS_BORDER}`,border:`1px solid ${$U.MISC_FOCUS_BORDER}`,zIndex:2},"&.Mui-selected":{color:$U.GREYSCALE_25,backgroundColor:$U.GREYSCALE_0_10,zIndex:2,"&:hover":{backgroundColor:$U.GREYSCALE_0_10,border:`1px solid ${$U.GREYSCALE_0_15}`}}},sizeSmall:{fontSize:HU,height:24,width:24,padding:7},sizeLarge:{fontSize:GU,height:40,width:40,lineHeight:"20px"}}},MuiToggleButtonGroup:{styleOverrides:{root:{height:"32px",lineHeight:"16px",fontSize:VU,borderRadius:YU}}},MuiToolbar:{defaultProps:{disableGutters:!0},styleOverrides:{root:{display:"flex",flex:1,padding:"0 16px"},dense:{minHeight:"46px",padding:"0 8px"}}},MuiTooltip:{defaultProps:{arrow:!0},styleOverrides:{arrow:{color:$U.GREYSCALE_20},tooltip:{backgroundColor:$U.GREYSCALE_20,fontSize:HU,lineHeight:"16px"},popper:{whiteSpace:"pre-line"}}},...e?{...hY}:{}}))(t);const mY=e=>({mode:"light",primary:{ultraLight:$U.GREEN_ULTRA_LIGHT,light:$U.GREEN_PALE,main:$U.GREEN,dark:$U.GREEN_DARK,extraDark:$U.GREEN_EXTRA_DARK,contrastText:$U.WHITE},secondary:{ultraLight:$U.BLUE_ULTRA_LIGHT,light:$U.BLUE_PALE,main:$U.BLUE,dark:$U.BLUE_DARK,extraDark:$U.BLUE_EXTRA_DARK,contrastText:$U.WHITE},error:{ultraLight:$U.RED_ULTRA_LIGHT,light:$U.RED_PALE,main:$U.RED,dark:$U.RED_DARK,extraDark:$U.RED_EXTRA_DARK,contrastText:$U.WHITE},warning:{ultraLight:$U.ORANGE_ULTRA_LIGHT,light:$U.ORANGE_PALE,main:$U.ORANGE,dark:$U.ORANGE_DARK,extraDark:$U.ORANGE_EXTRA_DARK,contrastText:$U.WHITE},success:{ultraLight:$U.GREEN_ULTRA_LIGHT,light:$U.GREEN_PALE,main:$U.GREEN,dark:$U.GREEN_DARK,extraDark:$U.GREEN_EXTRA_DARK,contrastText:$U.WHITE},info:{ultraLight:$U.BLUE_ULTRA_LIGHT,light:$U.BLUE_PALE,main:$U.BLUE,dark:$U.BLUE_DARK,extraDark:$U.BLUE_EXTRA_DARK,contrastText:$U.WHITE},text:{primary:$U.TEXT_PRIMARY,secondary:$U.TEXT_SECONDARY,disabled:$U.GREYSCALE_0_30},action:{hover:$U.GREYSCALE_0_03,hoverOpacity:.03,selected:$U.GREYSCALE_0_05,selectedOpacity:.05,focus:$U.MISC_FOCUS_BORDER},amethyst:{ultraLight:$U.WHITE,main:$U.PURPLE,light:$U.PURPLE_PALE,dark:$U.PURPLE_DARK,extraDark:$U.GREYSCALE_0_0,contrastText:$U.WHITE},background:{paper:$U.WHITE,default:$U.GREYSCALE_95},divider:$U.GREYSCALE_0_15}),gY=(e="light",t=!1)=>((e,t=!1)=>({components:fY(0,t),palette:mY(),breakpoints:{keys:["xs","sm","md","lg","xl"],values:{xs:0,sm:600,md:960,lg:1280,xl:1920}},spacing:8,shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],transitions:{easing:{easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration:{standard:300,short:250,enteringScreen:225,shorter:200,leavingScreen:195,shortest:150,complex:375}},typography:{fontSize:VU,fontWeightLight:KU,fontWeightRegular:XU,fontWeightMedium:JU,fontWeightBold:ZU,htmlFontSize:VU,fontFamily:QU.FONT_FAMILY,button:{fontWeight:JU,fontSize:VU,textTransform:"none"},body1:{fontSize:GU,lineHeight:"24px"},body2:{fontSize:VU,lineHeight:"20px"},h1:{fontSize:32,lineHeight:"32px"},h2:{fontSize:28,lineHeight:"32px"},h3:{fontSize:UU,lineHeight:"24px"},h4:{fontSize:20,lineHeight:"24px"},h5:{fontSize:GU,fontWeight:JU,lineHeight:"16px"},h6:{fontSize:VU,fontWeight:JU,lineHeight:"16px"},caption:{color:$U.TEXT_SECONDARY},subtitle1:{fontSize:VU,color:$U.TEXT_SECONDARY},subtitle2:{fontSize:HU,color:$U.TEXT_SECONDARY}},shape:{borderRadius:YU}}))(0,t);const yY=(e,{selections:n,baseObjects:r,coreServices:i,nebulaObjects:o})=>{const a=function(e){var t;const n=gY();return null!=n&&null!==(t=n.components)&&void 0!==t&&null!==(t=t.MuiTable)&&void 0!==t&&t.styleOverrides&&(n.components.MuiTable.styleOverrides.root={}),Px({...n,direction:e})}("ltr");e.render(Hn.jsx(t.StrictMode,{children:Hn.jsx(fw,{theme:a,children:Hn.jsx(CE,{...o,children:Hn.jsx(wE,{...r,children:Hn.jsx(Z_,{selections:n,children:Hn.jsx(kE,{...i,children:Hn.jsx(fM,{children:Hn.jsx(WU,{})})})})})})})}))};var bY,vY,xY,wY;!function(e){e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="fontColor",e.FontStyle="fontStyle",e.Background="background",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.Border="border",e.Divider="divider"}(bY||(bY={})),function(e){e.Dimension="object.pivotTableV2.dimension",e.Measure="object.pivotTableV2.measure",e.Total="object.pivotTableV2.total",e.Null="object.pivotTableV2.null",e.Grid="object.pivotTableV2"}(vY||(vY={})),function(e){e.Grid="grid",e.Divider="grid.divider",e.LabelName="label.name",e.LabelValue="label.value"}(xY||(xY={})),function(e){e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="color",e.BackgroundColor="backgroundColor",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.BorderColor="borderColor"}(wY||(wY={}));const SY=e=>e?`${parseInt(e,10)}px`:void 0,EY=(e,t)=>{if(t){const n=e.getColorPickerColor(t);return"none"===n?rg.Transparent:n}},CY=(e,t)=>+(parseInt(e,10)*ng*t+8).toFixed(2),MY=(e,t)=>void 0===e?t:e.some((e=>"bold"===e))?eg:"normal",_Y=e=>null!=e&&e.some((e=>"italic"===e))?"italic":"normal",kY=e=>null!=e&&e.some((e=>"underline"===e))?"underline":"none",RY=document.createElement("textarea");function AY(e){RY.value=e,document.body.appendChild(RY),RY.select(),RY.setSelectionRange(0,RY.value.length),document.execCommand("copy"),document.body.removeChild(RY)}RY.style.position="absolute",RY.style.left="-9999px",RY.setAttribute("readonly","");function IY(e){null==M||M(((t,n)=>{const r=n.target,i=null==r?void 0:r.closest(`.${Ot}`);null!=i&&i.title&&t.addItem({translation:"contextMenu.copyCellValue",icon:"lui-icon lui-icon--copy",tid:"copy-cell-context-item",select:async()=>{(e=>{var t;const n=e.title;n&&(null!==(t=navigator.clipboard)&&void 0!==t&&t.writeText?navigator.clipboard.writeText(n).catch((()=>{AY(n)})):AY(n))})(i)}}),null==e||e.forEach((e=>{e(t,n,i)}))}))}const LY=({model:e,env:t,layoutService:n,effectivePropertiesService:r,translator:i})=>Cg(((o,a,s)=>{if(!e||r.qAlwaysFullyExpanded||!t.flags.isEnabled("CLIENT_IM_6273_EXPAND_OR_COLLAPSE_DIM"))return;const l=e,c=o.addItem({translation:"Object.PivotTable.ContextMenu.ExpandCollapse",tid:"expand-collapse-group"}),{qEffectiveDimensionName:u,label:d}=((e,t)=>{const n=((e,t)=>{const n=null==e?void 0:e.getAttribute("data-dimension-info-index");if("string"==typeof n)return t.getDimensionInfo(+n)})(e,t);return"object"==typeof n?{qEffectiveDimensionName:n.qEffectiveDimensionName,label:n.qFallbackTitle}:{qEffectiveDimensionName:void 0,label:void 0}})(s,n);c.addItem((e=>({icon:"lui-icon lui-icon--plus",translation:"Object.PivotTable.ContextMenu.ExpandAll",tid:"expand-all",select:async()=>{try{await e.expandTop(AE,0,0,!0),await e.expandLeft(AE,0,0,!0)}catch(e){console.error("Failed to expand all",e)}}}))(l)),"string"==typeof u&&c.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--plus",translation:i.get("SNPivotTable.ContextMenu.ExpandDimension",[null!=r?r:""]),tid:"expand-dimension",select:iI({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:tI.Expand})}))({model:l,effectivePropertiesService:r,qEffectiveDimensionName:u,label:d,translator:i})),c.addItem((e=>({icon:"lui-icon lui-icon--minus",translation:"Object.PivotTable.ContextMenu.CollapseAll",tid:"collapse-all",select:async()=>{try{await e.collapseTop(AE,0,0,!0),await e.collapseLeft(AE,0,0,!0)}catch(e){console.error("Failed to collapse all",e)}}}))(l)),"string"==typeof u&&c.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--minus",translation:i.get("SNPivotTable.ContextMenu.CollapseDimension",[null!=r?r:""]),tid:"collapse-dimension",select:iI({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:tI.Collapse})}))({model:l,effectivePropertiesService:r,qEffectiveDimensionName:u,label:d,translator:i}))}),[e,n,r]),DY=(e,t)=>b((()=>(({layout:e,flags:t})=>{var n,r,i,o;const{qHyperCube:a,nullValueRepresentation:s,snapshotData:l}=e,{qNoOfLeftDims:c,qEffectiveInterColumnSortOrder:u,qMeasureInfo:d,qDimensionInfo:p}=a,h=!!l,f=null!==(n=null==l||null===(r=l.content)||void 0===r?void 0:r.rowsPerPage)&&void 0!==n?n:15e3,m={x:Math.min(e.qHyperCube.qSize.qcx,tg),y:Math.min(e.qHyperCube.qSize.qcy,f)},g=u.slice(0,c),y=e=>g.some((t=>t===e)),b=y(IE),v=new Map(u.map((e=>{var t;return[null!==(t=p[e])&&void 0!==t?t:IE,e]}))),x=d.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)}));return{layout:e,getNullValueText:()=>{var e;return null!==(e=null==s?void 0:s.text)&&void 0!==e?e:"-"},getMeasureInfoIndexFromCellIndex:(e,t=!1)=>{if(b)return 0;const n=e%x.length;return t?n:d.findIndex((e=>e===x[n]))},getDimensionInfo:e=>e===IE?void 0:p.at(e),getDimensionInfoIndex:e=>{var t;return null!==(t=v.get(e))&&void 0!==t?t:-1},size:m,isSnapshot:h,hasLimitedData:!h&&m.x<e.qHyperCube.qSize.qcx,hasData:m.x>0&&m.y>0,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims,hasPseudoDimOnLeft:b,leftDimensionInfoIndexes:g,isLeftDimension:y,triggerdByExpandOrCollapse:!!e.qHyperCube.qLastExpandedPos,visibleMeasureInfo:x,isIndentModeEnabled:Boolean(e.qHyperCube.qIndentMode)&&t.isEnabled("CLIENT_IM_5975_INDENT_MODE"),indentModeFeatures:{isLinksSupported:t.isEnabled("CLIENT_IM_5975_INDENT_MODE_LINKS"),isImagesSupported:t.isEnabled("CLIENT_IM_5975_INDENT_MODE_IMAGES")},indentModeColumnWidth:null!==(i=e.qHyperCube.indentModeColumnWidth)&&void 0!==i?i:{type:Ft.Auto,pixels:qt.PixelsDefault,percentage:qt.PercentageDefault},searchSortFromDimension:"inherit"===(null===(o=e.search)||void 0===o?void 0:o.sorting)}})({layout:e,flags:t})),[e,t]),PY=({model:e,layoutService:t,viewService:n,pageInfo:r,rect:i})=>{const{layout:o,isSnapshot:a,triggerdByExpandOrCollapse:s}=t,l=(e=>{const t=_g(e);return t.current=e,t})(sM(i));return Dg((async()=>{const{qHyperCube:t}=o,{maxNumberOfVisibleRows:i,maxNumberOfVisibleColumns:c}=l.current;var u,d;if(a)return null!==(u=null===(d=o.snapshotData)||void 0===d||null===(d=d.content)||void 0===d?void 0:d.qPivotDataPages)&&void 0!==u?u:[];if(void 0!==e&&"getHyperCubePivotData"in e&&(((e,t,n,r)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=r||t.gridRowStartIndex+t.gridHeight>=n))(s,n,i,c)||((e,t,n,r)=>{var i,o;const{qHyperCube:{qPivotDataPages:a,qSize:s}}=e,{qTop:l,qWidth:c,qHeight:u}=null!==(i=null===(o=a[0])||void 0===o?void 0:o.qArea)&&void 0!==i?i:{qTop:0,qWidth:0,qHeight:0};return l<t.page*t.rowsPerPage||c<Math.min(r,s.qcx)||u<Math.min(n,s.qcy)})(o,r,i,c))){const t=((e,t,n,r,i,o)=>{const a=r.page*r.rowsPerPage,s=Math.min(a+r.rowsPerPage,n.qcy),l=Math.min(tg,n.qcx);if(n.qcy<a)return null;let c=0,u=a;if(e){c=t.gridColumnStartIndex,u=a+t.gridRowStartIndex;const e=u+t.gridHeight,n=t.gridColumnStartIndex+t.gridWidth;e>s&&(u=Math.max(0,s-i)),n>l&&(c=Math.max(0,l-o))}return{qLeft:c,qTop:u,qWidth:Math.min(l-c,o),qHeight:Math.min(s-u,i)}})(s,n,o.qHyperCube.qSize,r,i,c);return t?e.getHyperCubePivotData(AE,lM(t)):[]}return t.qPivotDataPages}),[o,a,e,n,r.page,r.rowsPerPage,l,s])},OY=({rowsPerPage:e,totalRowCount:t,page:n})=>Math.min(e,t-n*e),TY=(e,t,n=15e3)=>({rowsPerPage:n,totalPages:Math.max(1,Math.ceil(e/n)),totalRowCount:e,rowsOnCurrentPage:OY({rowsPerPage:n,totalRowCount:e,page:t})}),NY=15,qY=({layoutService:e,viewService:t,rect:n,model:r,pageInfo:i})=>{var o;return _((async e=>{const o=e;if(!o.snapshotData||!r||o.snapshotData.content)return o;if("getHyperCubePivotData"in r){const{scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l}=t,c=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=e,s=t.page*t.rowsPerPage,l=Math.max(r-NY,0),c=Math.max(s+i-NY,s,0),u=tg-l,d=s+t.rowsOnCurrentPage-c;if((e=>0===e.gridWidth&&0===e.gridHeight)(e)){const{maxNumberOfVisibleColumns:e,maxNumberOfVisibleRows:t}=sM(n);return{qLeft:l,qTop:c,qWidth:Math.min(u,e+30),qHeight:Math.min(d,t+30)}}return{qLeft:l,qTop:c,qWidth:Math.min(u,o+30),qHeight:Math.min(d,a+30)}})(t,i,n),u=lM(c),d={qLeft:0,qTop:i.page*i.rowsPerPage,qWidth:1,qHeight:1};o.snapshotData.content={qPivotDataPages:await r.getHyperCubePivotData(AE,[d,...u]),scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l,page:i.page,rowsPerPage:i.rowsPerPage},o.snapshotData.object.size.w=n.width,o.snapshotData.object.size.h=n.height}return o})),k((()=>({getViewState:()=>((e,t)=>({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,leftGridScrollLeft:e.leftGridScrollLeft,topGridScrollTop:e.topGridScrollTop,renderPage:t.page}))(t,i)})),[t]),null!==(o=e.layout.snapshotData)&&void 0!==o&&o.content?{left:n.left,top:n.top,width:e.layout.snapshotData.object.size.w,height:e.layout.snapshotData.object.size.h}:n};var FY={SNPivotTable_ContextMenu_CollapseDimension:{id:"SNPivotTable.ContextMenu.CollapseDimension",locale:{"de-DE":"{0} reduzieren","en-US":"Collapse {0}","es-ES":"Contraer {0}","fr-FR":"Réduire {0}","it-IT":"Comprimi {0}","ja-JP":"{0} を折りたたむ","ko-KR":"{0} 축소","nl-NL":"{0} samenvouwen","pl-PL":"Zwiń {0}","pt-BR":"Recolher {0}","ru-RU":"Свернуть {0}","sv-SE":"Dölj {0}","tr-TR":"{0} öğelerini daralt","zh-CN":"折叠 {0}","zh-TW":"收合 {0}"}},SNPivotTable_ContextMenu_ExpandDimension:{id:"SNPivotTable.ContextMenu.ExpandDimension",locale:{"de-DE":"{0} erweitern","en-US":"Expand {0}","es-ES":"Expandir {0}","fr-FR":"Développer {0}","it-IT":"Espandi {0}","ja-JP":"{0} を展開","ko-KR":"{0} 확장","nl-NL":"{0} uitvouwen","pl-PL":"Rozwiń {0}","pt-BR":"Expandir {0}","ru-RU":"Развернуть {0}","sv-SE":"Visa {0}","tr-TR":"{0} öğelerini genişlet","zh-CN":"展开 {0}","zh-TW":"展開 {0}"}},SNPivotTable_IndentMode_Rows:{id:"SNPivotTable.IndentMode.Rows",locale:{"de-DE":"Zeilen","en-US":"Rows","es-ES":"Filas","fr-FR":"Lignes","it-IT":"Righe","ja-JP":"行","ko-KR":"행","nl-NL":"Rijen","pl-PL":"Wiersze","pt-BR":"Linhas","ru-RU":"Строки","sv-SE":"Rader","tr-TR":"Satırlar","zh-CN":"行","zh-TW":"列"}},SNPivotTable_LimitedData:{id:"SNPivotTable.LimitedData",locale:{"de-DE":"* Derzeit wird eine begrenzte Anzahl Spalten angezeigt","en-US":"* Currently showing a limited number of columns","es-ES":"* Actualmente mostrando un número limitado de columnas","fr-FR":"*Affichage actuel d'un nombre limité de colonnes","it-IT":"* Attualmente visualizzato un numero limitato di colonne","ja-JP":"* 現在、限られた列の数を表示","ko-KR":"* 현재 제한된 수의 열만 표시","nl-NL":"* Op dit moment wordt slechts een beperkt aantal kolommen getoond","pl-PL":"* Obecnie wyświetlana jest ograniczona liczba kolumn","pt-BR":"* Atualmente mostrando um número limitado de colunas","ru-RU":"* В настоящее время отображается ограниченное количество столбцов","sv-SE":"* Visar för närvarande ett begränsat antal kolumner","tr-TR":"*Şu anda sınırlı sayıda sütun gösteriliyor","zh-CN":"* 当前显示的列数有限","zh-TW":"* 目前顯示有限欄數"}},SNPivotTable_NoData:{id:"SNPivotTable.NoData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, weil es keine Werte enthält.","en-US":"The chart is not displayed because it contains no values.","es-ES":"El gráfico no se muestra porque no contiene valores.","fr-FR":"Le graphique n'est pas affiché, car il ne contient aucune valeur.","it-IT":"Il grafico non è visualizzato poiché non contiene alcun valore.","ja-JP":"チャートには値が含まれていないため、チャートは表示されません。","ko-KR":"차트에 값이 없으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze geen waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ nie zawiera wartości.","pt-BR":"O gráfico não foi exibido porque não contém valores.","ru-RU":"Диаграмма не отображается, так как не содержит значений.","sv-SE":"Diagrammet visas inte eftersom det inte innehåller några värden.","tr-TR":"Değer içermemesi nedeniyle grafik görüntülenmiyor.","zh-CN":"图表未显示,因为它不包含任何值。","zh-TW":"系統不會顯示圖表,因為這沒有包含任何值。"}}};const jY=()=>{const e=R(),t=e.language();return b((()=>{!function(e){const t="SNPivotTable_LimitedData";e.get(t)===t&&Object.keys(FY).forEach((t=>{e.add(FY[t])}))}(e)}),[e]),{translator:e,language:t}},zY=e=>{const{flags:t}=e,n=A(),r=(e=>{const t=b((()=>Ng(e)),[e]);return S((()=>()=>{t.unmount()}),[t]),t})(n),i=I(),o=L(),a=D(),s=P(),l=O(),c=kg(),u=((e,t)=>{const[n]=Dg((async()=>{if(void 0!==e&&!t.snapshotData&&"getEffectiveProperties"in e)return{...await e.getEffectiveProperties()}}),[e,t]),r=b((()=>{var e,t;const r=void 0!==(null==n?void 0:n.qHyperCubeDef.qSortbyYValue)&&1===Math.abs(n.qHyperCubeDef.qSortbyYValue),i=null!==(e=null==n?void 0:n.qHyperCubeDef.qDimensions.map((e=>e.qDef.qSortCriterias)))&&void 0!==e?e:[];return{qAlwaysFullyExpanded:null!==(t=null==n?void 0:n.qHyperCubeDef.qAlwaysFullyExpanded)&&void 0!==t&&t,qExpansionState:null==n?void 0:n.qHyperCubeDef.qExpansionState,isSortedByFirstMeasure:r,getSortCriteriaForDimension:e=>i[e]}}),[n]);return r})(o,i),d=DY(i,t),p=(e=>{const t=C();return{...t,select:!!t.active&&!!t.select&&!e,active:!!t.active&&!e,scroll:!!t.active}})(d.isSnapshot),h=T(),f=Lg(i,n),{translator:m,language:g}=jY(),{pageInfo:y,updatePageInfo:v}=((e,t)=>{const{size:n,layout:{qHyperCube:{qSize:r}}}=e,i=t.isDownloadedAsPDForImage||e.isSnapshot,o=(e=>{var t;return null===(t=e.layout.snapshotData)||void 0===t||null===(t=t.content)||void 0===t?void 0:t.rowsPerPage})(e),[a,s]=w((()=>{const a=((e,t)=>{var n,r,i,o;return t.isDownloadedAsPDForImage?null!==(n=null===(r=t.viewState)||void 0===r?void 0:r.renderPage)&&void 0!==n?n:0:e.isSnapshot&&null!==(i=null===(o=e.layout.snapshotData)||void 0===o||null===(o=o.content)||void 0===o?void 0:o.page)&&void 0!==i?i:0})(e,t);return{page:a,shouldShowPagination:r.qcy>n.y&&!i,...TY(r.qcy,a,o)}})),l=e.layout.qHyperCube.qSize.qcy;return S((()=>{s((t=>({...t,...TY(l,t.page,o),shouldShowPagination:l>e.size.y&&!i})))}),[l,e.size.y,s,i,o]),S((()=>{const{page:e,totalPages:t}=a;if(e+1>t){const e=t-1,n=OY({...a,page:e});s({...a,page:e,rowsOnCurrentPage:n})}}),[a]),{pageInfo:a,updatePageInfo:e=>{s({...a,...e,rowsOnCurrentPage:OY({...a,...e})})}}})(d,c),x=((e,t,n)=>b((()=>((e,t)=>{var n,r,i,o,a,s,l,c;if(e.isDownloadedAsPDForImage){var u,d,p,h;const{viewState:t}=e;return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:null!==(u=null==t?void 0:t.scrollTop)&&void 0!==u?u:0,scrollLeft:null!==(d=null==t?void 0:t.scrollLeft)&&void 0!==d?d:0,leftGridScrollLeft:null!==(p=null==t?void 0:t.leftGridScrollLeft)&&void 0!==p?p:0,topGridScrollTop:null!==(h=null==t?void 0:t.topGridScrollTop)&&void 0!==h?h:0}}return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:null!==(n=null==t||null===(r=t.content)||void 0===r?void 0:r.scrollTop)&&void 0!==n?n:0,scrollLeft:null!==(i=null==t||null===(o=t.content)||void 0===o?void 0:o.scrollLeft)&&void 0!==i?i:0,leftGridScrollLeft:null!==(a=null==t||null===(s=t.content)||void 0===s?void 0:s.leftGridScrollLeft)&&void 0!==a?a:0,topGridScrollTop:null!==(l=null==t||null===(c=t.content)||void 0===c?void 0:c.topGridScrollTop)&&void 0!==l?l:0}})(n,t.snapshotData)),[n,e.page,t.snapshotData]))(y,i,c),E=qY({rect:N(),layoutService:d,viewService:x,model:o,pageInfo:y}),[M,_]=PY({model:o,layoutService:d,viewService:x,pageInfo:y,rect:E}),k=b((()=>((e,t,n)=>{var r,i,o,a,s,l,c,u,d,p,h,f,m,g,y,b,v,x,w,S,E,C,M,_,k,R,A,I,L,D,P,O,T,N,q,F,j,z,B,W,$,H,V,G,U,Y,K;const X=null===(r=t.layout.components)||void 0===r?void 0:r.find((e=>"theme"===e.key)),J=null==X?void 0:X.header,Z=null==X?void 0:X.dimensionValues,Q=null==X?void 0:X.measureValues,ee=null==X?void 0:X.measureLabels,te=null==X?void 0:X.totalValues,ne=null==X?void 0:X.nullValues,re=null==X?void 0:X.grid,ie=(t,n,r)=>e.getStyle(t,n,r),oe=+(null!==(i=null!==(o=null==re?void 0:re[bY.LineClamp])&&void 0!==o?o:ie(vY.Grid,xY.Grid,wY.LineClamp))&&void 0!==i?i:1),ae=n.isEnabled("CLIENT_IM_5715_LINKS_AND_IMAGES")?+(null!==(a=null!==(s=null==re?void 0:re[bY.ColumnLineClamp])&&void 0!==s?s:ie(vY.Grid,xY.Grid,wY.ColumnLineClamp))&&void 0!==a?a:1):1,se=null!==(l=null!==(c=EY(e,null==J?void 0:J[bY.Background]))&&void 0!==c?c:ie(vY.Dimension,xY.LabelName,wY.BackgroundColor))&&void 0!==l?l:rg.Transparent,le={header:{fontSize:null!==(u=null!==(d=SY(null==J?void 0:J[bY.FontSize]))&&void 0!==d?d:ie(vY.Dimension,xY.LabelName,wY.FontSize))&&void 0!==u?u:Zm,fontFamily:null!==(p=null!==(h=null==J?void 0:J[bY.FontFamily])&&void 0!==h?h:ie(vY.Dimension,xY.LabelName,wY.FontFamily))&&void 0!==p?p:Qm,fontWeight:MY(null==J?void 0:J[bY.FontStyle],eg),fontStyle:_Y(null==J?void 0:J[bY.FontStyle]),textDecoration:kY(null==J?void 0:J[bY.FontStyle]),color:null!==(f=null!==(m=EY(e,null==J?void 0:J[bY.FontColor]))&&void 0!==m?m:ie(vY.Dimension,xY.LabelName,wY.FontColor))&&void 0!==f?f:cf.TEXT,background:se,hoverBackground:zm(se,jt),activeBackground:zm(se,zt)},dimensionValues:{fontSize:null!==(g=null!==(y=SY(null==Z?void 0:Z[bY.FontSize]))&&void 0!==y?y:ie(vY.Dimension,xY.LabelValue,wY.FontSize))&&void 0!==g?g:Zm,fontFamily:null!==(b=null!==(v=null==Z?void 0:Z[bY.FontFamily])&&void 0!==v?v:ie(vY.Dimension,xY.LabelValue,wY.FontFamily))&&void 0!==b?b:Qm,fontWeight:MY(null==Z?void 0:Z[bY.FontStyle],void 0),fontStyle:_Y(null==Z?void 0:Z[bY.FontStyle]),textDecoration:kY(null==Z?void 0:Z[bY.FontStyle]),color:null!==(x=null!==(w=EY(e,null==Z?void 0:Z[bY.FontColor]))&&void 0!==w?w:ie(vY.Dimension,xY.LabelValue,wY.FontColor))&&void 0!==x?x:cf.TEXT,background:null!==(S=null!==(E=EY(e,null==Z?void 0:Z[bY.Background]))&&void 0!==E?E:ie(vY.Dimension,xY.LabelValue,wY.BackgroundColor))&&void 0!==S?S:rg.Transparent},measureValues:{fontSize:null!==(C=null!==(M=SY(null==Q?void 0:Q[bY.FontSize]))&&void 0!==M?M:ie(vY.Measure,xY.LabelValue,wY.FontSize))&&void 0!==C?C:Zm,fontFamily:null!==(_=null!==(k=null==Q?void 0:Q[bY.FontFamily])&&void 0!==k?k:ie(vY.Measure,xY.LabelValue,wY.FontFamily))&&void 0!==_?_:Qm,fontWeight:MY(null==Q?void 0:Q[bY.FontStyle],"normal"),fontStyle:_Y(null==Q?void 0:Q[bY.FontStyle]),textDecoration:kY(null==Q?void 0:Q[bY.FontStyle]),color:null!==(R=null!==(A=EY(e,null==Q?void 0:Q[bY.FontColor]))&&void 0!==A?A:ie(vY.Measure,xY.LabelValue,wY.FontColor))&&void 0!==R?R:rg.FontSecondary,background:null!==(I=null!==(L=EY(e,null==Q?void 0:Q[bY.Background]))&&void 0!==L?L:ie(vY.Measure,xY.LabelValue,wY.BackgroundColor))&&void 0!==I?I:rg.Transparent},measureLabels:{fontWeight:MY(null==ee?void 0:ee[bY.FontStyle],"normal"),fontStyle:_Y(null==ee?void 0:ee[bY.FontStyle]),textDecoration:kY(null==ee?void 0:ee[bY.FontStyle]),color:null!==(D=null!==(P=EY(e,null==ee?void 0:ee[bY.FontColor]))&&void 0!==P?P:ie(vY.Measure,xY.LabelName,wY.FontColor))&&void 0!==D?D:rg.FontSecondary,background:null!==(O=null!==(T=EY(e,null==ee?void 0:ee[bY.Background]))&&void 0!==T?T:ie(vY.Measure,xY.LabelName,wY.BackgroundColor))&&void 0!==O?O:rg.Transparent},totalValues:{fontWeight:MY(null==te?void 0:te[bY.FontStyle],eg),fontStyle:_Y(null==te?void 0:te[bY.FontStyle]),textDecoration:kY(null==te?void 0:te[bY.FontStyle]),color:null!==(N=null!==(q=EY(e,null==te?void 0:te[bY.FontColor]))&&void 0!==q?q:ie(vY.Total,xY.LabelValue,wY.FontColor))&&void 0!==N?N:cf.TEXT,background:null!==(F=null!==(j=EY(e,null==te?void 0:te[bY.Background]))&&void 0!==j?j:ie(vY.Total,xY.LabelValue,wY.BackgroundColor))&&void 0!==F?F:rg.Transparent},nullValues:{fontWeight:MY(null==ne?void 0:ne[bY.FontStyle],"normal"),fontStyle:_Y(null==ne?void 0:ne[bY.FontStyle]),textDecoration:kY(null==ne?void 0:ne[bY.FontStyle]),color:null!==(z=null!==(B=EY(e,null==ne?void 0:ne[bY.FontColor]))&&void 0!==B?B:ie(vY.Null,xY.LabelValue,wY.FontColor))&&void 0!==z?z:cf.TEXT,background:null!==(W=null!==($=EY(e,null==ne?void 0:ne[bY.Background]))&&void 0!==$?$:ie(vY.Null,xY.LabelValue,wY.BackgroundColor))&&void 0!==W?W:rg.NullValueBackground},grid:{columnLineClamp:ae,lineClamp:oe,border:null!==(H=null!==(V=EY(e,null==re?void 0:re[bY.Border]))&&void 0!==V?V:ie(vY.Grid,xY.Grid,wY.BorderColor))&&void 0!==H?H:rg.DividerLight,divider:null!==(G=null!==(U=EY(e,null==re?void 0:re[bY.Divider]))&&void 0!==U?U:ie(vY.Grid,xY.Divider,wY.BorderColor))&&void 0!==G?G:rg.DividerDark,background:null!==(Y=null!==(K=EY(e,null==re?void 0:re[bY.Background]))&&void 0!==K?K:ie(vY.Grid,xY.Grid,wY.BackgroundColor))&&void 0!==Y?Y:rg.Transparent},selectedColors:jm(e)};return le.headerCellHeight=Math.max(CY(le.header.fontSize,ae),CY(le.dimensionValues.fontSize,ae),32),le.contentCellHeight=Math.max(CY(le.measureValues.fontSize,oe),CY(le.dimensionValues.fontSize,oe),24),le.dimensionValueTextHeight=CY(le.dimensionValues.fontSize,1),le})(f,d,t)),[f,d,t]),R=((e,t,n)=>{const[,r,i]=Dg((async()=>{var t;const r=If(n.flags),i=e.getStyle("","","fontFamily"),o=e.getStyle("object","label.name","fontFamily"),a=e.getStyle("object","label.value","fontFamily"),s=null!==(t=e.getStyle("","","fontFamilies"))&&void 0!==t?t:[];return Promise.all([...r,...s,i,o,a,Fg].filter((e=>void 0!==e)).map((async e=>{await document.fonts.load(`600 12px ${e}`),await document.fonts.load(`12px ${e}`)})))}),[t,e,n]);return i?(console.warn("Failed to load fonts:",i),!0):!r})(f,i,e);IY([LY({model:o,env:e,layoutService:d,effectivePropertiesService:u,translator:m})]),S((()=>{!_&&o&&!!M&&R&&yY(r,{selections:h,baseObjects:{rect:E,pageInfo:y,qPivotDataPages:M,updatePageInfo:v},nebulaObjects:{env:e,app:a,model:o,embed:s,theme:f,keyboard:l,translator:m,interactions:p},coreServices:{styleService:k,viewService:x,layoutService:d,downloadService:c,effectivePropertiesService:u}})}),[o,a,E,p,h,x,d,c,_,M,k,r,R,m,g,y,v,u,s,l,f,e])},BY={version:"4.4.0",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]};function WY(e){return{qae:{properties:{initial:{...BY,qHyperCubeDef:{...BY.qHyperCubeDef,qIndentMode:!1}}},data:Et(e)},ext:Sg(e),component(){zY(e)}}}export{WY as default};
|
|
176
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,p=e.length,h=e.search(/[0-9\-\+#]/),f=h>0?e.substring(0,h):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=p-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=g>0?e.substring(v,p):"";if(n=(t="-"===(e=e.substring(h,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,p=d.length,v=0;v<p;v++)m+=d.charAt(v),!((v-y+1)%l)&&v<p-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),f+(n?"-":"")+r+x}}));function IL(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const LL={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},DL=/%\)?$/,PL=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,OL=/^\(oct\)/i,TL=/^\(dec\)/i,NL=/^\(hex\)/i,qL=/^\(bin\)/i,FL=/^\(rom\)/i,jL=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,zL=/#|0/g;function BL(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function WL(e,t,n){let r;return PL.test(t)?e=BL(e,Number(/\d{2}/.exec(t)[0]),t,n):OL.test(t)?e=BL(e,8,t,n):TL.test(t)?e=BL(e,10,t,n):NL.test(t)?e=BL(e,16,t,n):qL.test(t)?e=BL(e,2,t,n):FL.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function $L(e,t,n){const r=IL(e);return n?r:new RegExp(r||"",t)}function HL(e,t,n,r){let i,o,a,s,l,c,u,d,p,h=e.pattern;var f,m;r&&(e.abbreviate=!0),f=t,(m=n)&&(m=IL(m)),f&&(f=IL(f)),p=new RegExp("(?:[#0]+".concat(f,")?[#0]+(?:").concat(m,"[#0]+)?")),a=h.match(p),a=a?a[0]:"",s=a?h.substr(0,h.indexOf(a)):h,l=a?h.substring(h.indexOf(a)+a.length):"",a||(a=h?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace($L(c,"g"),t)),u=n,n=".",u&&(a=a.replace($L(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=h.split(u);let y;g[1]&&(y=g[1].match(zL)),e.prefix=s||"",e.postfix=l||"",e.pattern=h,e.maxPrecision=y?y.length:2,e.percentage=DL.test(h),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat($L(t,null,!0),"|").concat($L(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class VL{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return LL;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new VL(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],jL.test(e[0])&&(r.positive.isFunctional=!0),e[1]?jL.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?jL.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||HL(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&HL(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&HL(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",p="",h=e;if(isNaN(e))return"".concat(h);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=WL(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=AL(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),p=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=AL(l,e)}e=e.replace(u.numericRegex,(e=>e===a?u.groupTemp:e===o?u.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+p+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function GL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function UL(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new VL(...t)}(i,e,t,n,r),a=GL(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const YL="D",KL="T",XL="TS",JL="IV",ZL=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],QL=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],eD=["January","February","March","April","May","June","July","August","September","October","November","December"],tD=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function nD(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function rD(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function iD(e,t){let n,r=function(e){const t=e,n=24*rD(t),r=60*rD(n),i=60*rD(r),o=1e3*rD(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:a,s:s,f:l,t:u}}class oD{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:ZL,qDayNames:QL,qLongMonthNames:eD,qMonthNames:tD}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[KL]:r.qTimeFmt||"hh:mm:ss",[YL]:r.qDateFmt||"YYYY-MM-DD",[XL]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new oD(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=iD(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:nD("".concat(t.year).slice(-2),2),YYY:nD("".concat(t.year).slice(-3),3),def:e=>nD("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:nD("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:nD("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>nD("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>nD("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>nD("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>nD("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return s}}function aD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new oD(...t)}function sD(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=aD(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=GL(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==JL?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=aD(i,e,t),r=GL(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function lD(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return sD(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),UL(n,r,i,o,t)}(t,i),p="dimension"===s?"first":(e,t)=>d(t),h={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(h)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:p,formatter:()=>d,tags:()=>t.qTags};return h}function cD(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:lD(GI({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=cD("qAttrDimInfo",t,n,a,GI({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=cD("qAttrExprInfo",t,n,a,GI({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=cD("qMeasureInfo",t,n,a,GI({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function uD(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=uD.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=RL,a.hierarchy=kL,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=XI,a.pages=i.qDataPages,a.hierarchy=kL):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,c="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...cD("qDimensionInfo",i,e,"",GI({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...cD("qMeasureInfo",i,e,"",GI({},a,{value:c,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{r.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),i=lD(qI({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),s}const dD=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],pD=/\/qDimensionInfo(?:\/(\d+))?/,hD=/\/qMeasureInfo\/(\d+)/,fD=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,mD=/\/qAttrExprInfo\/(\d+)/,gD=/\/?qHyperCube/,yD=/\/?qTreeData/,bD=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),vD=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function xD(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;gD.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=bD):yD.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=vD);let s=!0;if(pD.test(e)&&(r=+pD.exec(e)[1]),hD.test(e)&&(i=+hD.exec(e)[1]),fD.test(e)){i=-1,r=0;const e=+fD.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(mD.test(e)){const e=i;if(t){i=0;const a=hL(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+mD.exec(n)[1]}else r>-1?(r=-1,i=+mD.exec(n)[1]):i+=+mD.exec(n)[1]+1}return dD.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function wD(e){uD.util=e.data("matrix").util,e.data("q",uD),e.formatter("q-number",UL),e.formatter("q-time",sD)}wD.qBrushHelper=xD,wD.selections=xD;var SD=Object.prototype.hasOwnProperty,ED=Object.prototype.toString,CD=Object.defineProperty,MD=Object.getOwnPropertyDescriptor,_D=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===ED.call(e)},kD=function(e){if(!e||"[object Object]"!==ED.call(e))return!1;var t,n=SD.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&SD.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||SD.call(e,t)},RD=function(e,t){CD&&"__proto__"===t.name?CD(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},AD=function(e,t){if("__proto__"===t){if(!SD.call(e,t))return;if(MD)return MD(e,t).value}return e[t]},ID=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=AD(s,n),s!==(i=AD(t,n))&&(u&&i&&(kD(i)||(o=_D(i)))?(o?(o=!1,a=r&&_D(r)?r:[]):a=r&&kD(r)?r:{},RD(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&RD(s,{name:n,newValue:i}));return s},LD="2.3.0";function DD(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function OD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PD(Object(n),!0).forEach((function(t){DD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PD(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function TD(e){return!!e.changedTouches}function ND(e){return"number"==typeof e&&!isNaN(e)}function qD(e){return"number"!=typeof e||isNaN(e)}function FD(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function jD(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function zD(e){return[{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}]}function BD(e){const[t,n,r,i]=FD(e);return{x:t,y:n,width:r-t,height:i-n}}function WD(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function $D(e){const{x:t,y:n,width:r,height:i,x1:o,x2:a,y1:s,y2:l,cx:c,cy:u,r:d,vertices:p}=e||{};return ND(c)&&ND(u)&&ND(d)?"circle":ND(o)&&ND(a)&&ND(s)&&ND(l)?"line":ND(t)&&ND(n)&&ND(r)&&ND(i)?"rect":ND(t)&&ND(n)?"point":Array.isArray(p)?p.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function HD(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var VD=Math.PI,GD=2*VD,UD=1e-6,YD=GD-UD;function KD(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function XD(){return new KD}function JD(e){return function(){return e}}KD.prototype=XD.prototype={constructor:KD,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-e,l=r-t,c=o-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>UD)if(Math.abs(u*s-l*c)>UD&&i){var p=n-o,h=r-a,f=s*s+l*l,m=p*p+h*h,g=Math.sqrt(f),y=Math.sqrt(d),b=i*Math.tan((VD-Math.acos((f+d-m)/(2*g*y)))/2),v=b/y,x=b/g;Math.abs(v-1)>UD&&(this._+="L"+(e+v*c)+","+(t+v*u)),this._+="A"+i+","+i+",0,0,"+ +(u*p>c*h)+","+(this._x1=e+x*s)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=e+a,c=t+s,u=1^o,d=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>UD||Math.abs(this._y1-c)>UD)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%GD+GD),d>YD?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>UD&&(this._+="A"+n+","+n+",0,"+ +(d>=VD)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var ZD=Math.abs,QD=Math.atan2,eP=Math.cos,tP=Math.max,nP=Math.min,rP=Math.sin,iP=Math.sqrt,oP=1e-12,aP=Math.PI,sP=aP/2,lP=2*aP;function cP(e){return e>=1?sP:e<=-1?-sP:Math.asin(e)}function uP(e){return e.innerRadius}function dP(e){return e.outerRadius}function pP(e){return e.startAngle}function hP(e){return e.endAngle}function fP(e){return e&&e.padAngle}function mP(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/iP(s*s+l*l),u=c*l,d=-c*s,p=e+u,h=t+d,f=n+u,m=r+d,g=(p+f)/2,y=(h+m)/2,b=f-p,v=m-h,x=b*b+v*v,w=i-o,S=p*m-f*h,E=(v<0?-1:1)*iP(tP(0,w*w*x-S*S)),C=(S*v-b*E)/x,M=(-S*b-v*E)/x,_=(S*v+b*E)/x,k=(-S*b+v*E)/x,R=C-g,A=M-y,I=_-g,L=k-y;return R*R+A*A>I*I+L*L&&(C=_,M=k),{cx:C,cy:M,x01:-u,y01:-d,x11:C*(i/w-1),y11:M*(i/w-1)}}function gP(){var e=uP,t=dP,n=JD(0),r=null,i=pP,o=hP,a=fP,s=null;function l(){var l,c,u=+e.apply(this,arguments),d=+t.apply(this,arguments),p=i.apply(this,arguments)-sP,h=o.apply(this,arguments)-sP,f=ZD(h-p),m=h>p;if(s||(s=l=XD()),d<u&&(c=d,d=u,u=c),d>oP)if(f>lP-oP)s.moveTo(d*eP(p),d*rP(p)),s.arc(0,0,d,p,h,!m),u>oP&&(s.moveTo(u*eP(h),u*rP(h)),s.arc(0,0,u,h,p,m));else{var g,y,b=p,v=h,x=p,w=h,S=f,E=f,C=a.apply(this,arguments)/2,M=C>oP&&(r?+r.apply(this,arguments):iP(u*u+d*d)),_=nP(ZD(d-u)/2,+n.apply(this,arguments)),k=_,R=_;if(M>oP){var A=cP(M/u*rP(C)),I=cP(M/d*rP(C));(S-=2*A)>oP?(x+=A*=m?1:-1,w-=A):(S=0,x=w=(p+h)/2),(E-=2*I)>oP?(b+=I*=m?1:-1,v-=I):(E=0,b=v=(p+h)/2)}var L=d*eP(b),D=d*rP(b),P=u*eP(w),O=u*rP(w);if(_>oP){var T,N=d*eP(v),q=d*rP(v),F=u*eP(x),j=u*rP(x);if(f<aP&&(T=function(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,d=s-o,p=d*l-u*c;if(!(p*p<oP))return[e+(p=(u*(t-o)-d*(e-i))/p)*l,t+p*c]}(L,D,F,j,N,q,P,O))){var z=L-T[0],B=D-T[1],W=N-T[0],$=q-T[1],H=1/rP(function(e){return e>1?0:e<-1?aP:Math.acos(e)}((z*W+B*$)/(iP(z*z+B*B)*iP(W*W+$*$)))/2),V=iP(T[0]*T[0]+T[1]*T[1]);k=nP(_,(u-V)/(H-1)),R=nP(_,(d-V)/(H+1))}}E>oP?R>oP?(g=mP(F,j,L,D,d,R,m),y=mP(N,q,P,O,d,R,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),R<_?s.arc(g.cx,g.cy,R,QD(g.y01,g.x01),QD(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,R,QD(g.y01,g.x01),QD(g.y11,g.x11),!m),s.arc(0,0,d,QD(g.cy+g.y11,g.cx+g.x11),QD(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,R,QD(y.y11,y.x11),QD(y.y01,y.x01),!m))):(s.moveTo(L,D),s.arc(0,0,d,b,v,!m)):s.moveTo(L,D),u>oP&&S>oP?k>oP?(g=mP(P,O,N,q,u,-k,m),y=mP(L,D,F,j,u,-k,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),k<_?s.arc(g.cx,g.cy,k,QD(g.y01,g.x01),QD(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,k,QD(g.y01,g.x01),QD(g.y11,g.x11),!m),s.arc(0,0,u,QD(g.cy+g.y11,g.cx+g.x11),QD(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,k,QD(y.y11,y.x11),QD(y.y01,y.x01),!m))):s.arc(0,0,u,w,x,m):s.lineTo(P,O)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-aP/2;return[eP(r)*n,rP(r)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:JD(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:JD(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:JD(+e),l):n},l.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:JD(+e),l):r},l.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:JD(+e),l):i},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:JD(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:JD(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function yP(e){this._context=e}function bP(e){return new yP(e)}function vP(e){return e[0]}function xP(e){return e[1]}function wP(){var e=vP,t=null,n=JD(0),r=xP,i=JD(!0),o=null,a=bP,s=null;function l(l){var c,u,d,p,h,f=l.length,m=!1,g=new Array(f),y=new Array(f);for(null==o&&(s=a(h=XD())),c=0;c<=f;++c){if(!(c<f&&i(p=l[c],c,l))===m)if(m=!m)u=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=c-1;d>=u;--d)s.point(g[d],y[d]);s.lineEnd(),s.areaEnd()}m&&(g[c]=+e(p,c,l),y[c]=+n(p,c,l),s.point(t?+t(p,c,l):g[c],r?+r(p,c,l):y[c]))}if(h)return s=null,h+""||null}function c(){return function(){var e=vP,t=xP,n=JD(!0),r=null,i=bP,o=null;function a(a){var s,l,c,u=a.length,d=!1;for(null==r&&(o=i(c=XD())),s=0;s<=u;++s)!(s<u&&n(l=a[s],s,a))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(l,s,a),+t(l,s,a));if(c)return o=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:JD(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:JD(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:JD(!!e),a):n},a.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),a):i},a.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),a):r},a}().defined(i).curve(a).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:JD(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:JD(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:JD(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:JD(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:JD(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:JD(+e),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:JD(!!e),l):i},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}function SP(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function EP(e){return e}yP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var CP=Array.prototype.slice;function MP(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function _P(e){this._context=e}function kP(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function RP(e,t){this._context=e,this._k=(1-t)/6}_P.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:MP(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:MP(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},RP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:kP(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:kP(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var AP=function e(t){function n(e){return new RP(e,t)}return n.tension=function(t){return e(+t)},n}(0);function IP(e,t){this._context=e,this._alpha=t}IP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>oP){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>oP){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var LP=function e(t){function n(e){return t?new IP(e,t):new RP(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function DP(e){return e<0?-1:1}function PP(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(DP(o)+DP(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function OP(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function TP(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function NP(e){this._context=e}function qP(e){this._context=new FP(e)}function FP(e){this._context=e}function jP(e){this._context=e}function zP(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function BP(e,t){this._context=e,this._t=t}function WP(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function $P(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function HP(e,t){return e[t]}function VP(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function GP(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function UP(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return a(e,i);const o=s(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),l.add=a,l.get=s,l.has=function(e){return!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map((e=>i[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function YP(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function KP(e){return(e=YP(Math.abs(e)))?e[1]:NaN}NP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:TP(this,this._t0,OP(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,TP(this,OP(this,n=PP(this,e,t)),n);break;default:TP(this,this._t0,n=PP(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(qP.prototype=Object.create(NP.prototype)).point=function(e,t){NP.prototype.point.call(this,t,e)},FP.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},jP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=zP(e),i=zP(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},BP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var XP,JP=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ZP(e){if(!(t=JP.exec(e)))throw new Error("invalid format: "+e);var t;return new QP({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function QP(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function eO(e,t){var n=YP(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}ZP.prototype=QP.prototype,QP.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var tO={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>eO(100*e,t),r:eO,s:function(e,t){var n=YP(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(XP=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+YP(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function nO(e){return e}var rO,iO,oO,aO=Array.prototype.map,sO=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function lO(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?nO:(t=aO.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?nO:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(aO.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=ZP(e)).fill,n=e.align,d=e.sign,p=e.symbol,h=e.zero,f=e.width,m=e.comma,g=e.precision,y=e.trim,b=e.type;"n"===b?(m=!0,b="g"):tO[b]||(void 0===g&&(g=12),y=!0,b="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var v="$"===p?i:"#"===p&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",x="$"===p?o:/[%p]/.test(b)?l:"",w=tO[b],S=/[defgprs%]/.test(b);function E(e){var i,o,l,p=v,E=x;if("c"===b)E=w(e)+E,e="";else{var C=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),C&&0==+e&&"+"!==d&&(C=!1),p=(C?"("===d?d:c:"-"===d||"("===d?"":d)+p,E=("s"===b?sO[8+XP/3]:"")+E+(C&&"("===d?")":""),S)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){E=(46===l?a+e.slice(i+1):e.slice(i))+E,e=e.slice(0,i);break}}m&&!h&&(e=r(e,1/0));var M=p.length+e.length+E.length,_=M<f?new Array(f-M+1).join(t):"";switch(m&&h&&(e=r(_+e,_.length?f-E.length:1/0),_=""),n){case"<":e=p+e+E+_;break;case"=":e=p+_+e+E;break;case"^":e=_.slice(0,M=_.length>>1)+p+e+E+_.slice(M);break;default:e=_+p+e+E}return s(e)}return g=void 0===g?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),E.toString=function(){return e+""},E}return{format:d,formatPrefix:function(e,t){var n=d(((e=ZP(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(KP(t)/3))),i=Math.pow(10,-r),o=sO[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){rO=lO(e),iO=rO.format,oO=rO.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const cO=new Date,uO=new Date;function dO(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>dO((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(i.count=(t,r)=>(cO.setTime(+t),uO.setTime(+r),e(cO),e(uO),Math.floor(n(cO,uO))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const pO=6e4,hO=864e5,fO=6048e5,mO=dO((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pO)/hO),(e=>e.getDate()-1));mO.range;const gO=dO((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/hO),(e=>e.getUTCDate()-1));gO.range;const yO=dO((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/hO),(e=>Math.floor(e/hO)));function bO(e){return dO((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pO)/fO))}yO.range;const vO=bO(0),xO=bO(1),wO=bO(2),SO=bO(3),EO=bO(4),CO=bO(5),MO=bO(6);function _O(e){return dO((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/fO))}vO.range,xO.range,wO.range,SO.range,EO.range,CO.range,MO.range;const kO=_O(0),RO=_O(1),AO=_O(2),IO=_O(3),LO=_O(4),DO=_O(5),PO=_O(6);kO.range,RO.range,AO.range,IO.range,LO.range,DO.range,PO.range;const OO=dO((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));OO.every=e=>isFinite(e=Math.floor(e))&&e>0?dO((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,OO.range;const TO=dO((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function NO(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function qO(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function FO(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=NO,n=(t,n)=>NO(e(t),n),r=(t,n)=>e(t)-n):(t=e===NO||e===qO?e:jO,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function jO(){return 0}TO.every=e=>isFinite(e=Math.floor(e))&&e>0?dO((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,TO.range;const zO=FO(NO).right;FO((function(e){return null===e?NaN:+e})).center;var BO=zO;class WO extends Map{constructor(e,t=HO){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get($O(this,e))}has(e){return super.has($O(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function $O({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function HO(e){return null!==e&&"object"==typeof e?e.valueOf():e}const VO=Math.sqrt(50),GO=Math.sqrt(10),UO=Math.sqrt(2);function YO(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=VO?10:o>=GO?5:o>=UO?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?YO(e,t,2*n):[s,l,c]}function KO(e,t,n){return YO(e=+e,t=+t,n=+n)[2]}function XO(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function JO(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ZO(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function QO(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=aT(i),u=sT(i),d=aT(o),p=sT(o),h=aT(a),f=sT(a),m=aT(s),g=sT(s),y=aT(l),b=sT(l),v={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:RT,e:RT,f:PT,g:HT,G:GT,H:AT,I:IT,j:LT,L:DT,m:OT,M:TT,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:mN,s:gN,S:NT,u:qT,U:FT,V:zT,w:BT,W:WT,x:null,X:null,y:$T,Y:VT,Z:UT,"%":fN},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:YT,e:YT,f:QT,g:uN,G:pN,H:KT,I:XT,j:JT,L:ZT,m:eN,M:tN,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:mN,s:gN,S:nN,u:rN,U:iN,V:aN,w:sN,W:lN,x:null,X:null,y:cN,Y:dN,Z:hN,"%":fN},w={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return C(e,t,n,r)},d:bT,e:bT,f:CT,g:fT,G:hT,H:xT,I:xT,j:vT,L:ET,m:yT,M:wT,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:gT,Q:_T,s:kT,S:ST,u:cT,U:uT,V:dT,w:lT,W:pT,x:function(e,t,r){return C(e,n,t,r)},X:function(e,t,n){return C(e,r,t,n)},y:fT,Y:hT,Z:mT,"%":MT};function S(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=eT[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function E(e,t){return function(n){var r,i,o=ZO(1900,void 0,1);if(C(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=JO(ZO(o.y,0,1))).getUTCDay(),r=i>4||0===i?RO.ceil(r):RO(r),r=gO.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=XO(ZO(o.y,0,1))).getDay(),r=i>4||0===i?xO.ceil(r):xO(r),r=mO.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?JO(ZO(o.y,0,1)).getUTCDay():XO(ZO(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,JO(o)):XO(o)}}function C(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in eT?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return v.x=S(n,v),v.X=S(r,v),v.c=S(t,v),x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),{format:function(e){var t=S(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=E(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=E(e+="",!0);return t.toString=function(){return e},t}}}var eT={"-":"",_:" ",0:"0"},tT=/^\s*\d+/,nT=/^%/,rT=/[\\^$*+?|[\]().{}]/g;function iT(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function oT(e){return e.replace(rT,"\\$&")}function aT(e){return new RegExp("^(?:"+e.map(oT).join("|")+")","i")}function sT(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function lT(e,t,n){var r=tT.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function cT(e,t,n){var r=tT.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function uT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function dT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function pT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function hT(e,t,n){var r=tT.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function fT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function mT(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function gT(e,t,n){var r=tT.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function yT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function bT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function vT(e,t,n){var r=tT.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function xT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function wT(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ST(e,t,n){var r=tT.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ET(e,t,n){var r=tT.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function CT(e,t,n){var r=tT.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function MT(e,t,n){var r=nT.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function _T(e,t,n){var r=tT.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function kT(e,t,n){var r=tT.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function RT(e,t){return iT(e.getDate(),t,2)}function AT(e,t){return iT(e.getHours(),t,2)}function IT(e,t){return iT(e.getHours()%12||12,t,2)}function LT(e,t){return iT(1+mO.count(OO(e),e),t,3)}function DT(e,t){return iT(e.getMilliseconds(),t,3)}function PT(e,t){return DT(e,t)+"000"}function OT(e,t){return iT(e.getMonth()+1,t,2)}function TT(e,t){return iT(e.getMinutes(),t,2)}function NT(e,t){return iT(e.getSeconds(),t,2)}function qT(e){var t=e.getDay();return 0===t?7:t}function FT(e,t){return iT(vO.count(OO(e)-1,e),t,2)}function jT(e){var t=e.getDay();return t>=4||0===t?EO(e):EO.ceil(e)}function zT(e,t){return e=jT(e),iT(EO.count(OO(e),e)+(4===OO(e).getDay()),t,2)}function BT(e){return e.getDay()}function WT(e,t){return iT(xO.count(OO(e)-1,e),t,2)}function $T(e,t){return iT(e.getFullYear()%100,t,2)}function HT(e,t){return iT((e=jT(e)).getFullYear()%100,t,2)}function VT(e,t){return iT(e.getFullYear()%1e4,t,4)}function GT(e,t){var n=e.getDay();return iT((e=n>=4||0===n?EO(e):EO.ceil(e)).getFullYear()%1e4,t,4)}function UT(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+iT(t/60|0,"0",2)+iT(t%60,"0",2)}function YT(e,t){return iT(e.getUTCDate(),t,2)}function KT(e,t){return iT(e.getUTCHours(),t,2)}function XT(e,t){return iT(e.getUTCHours()%12||12,t,2)}function JT(e,t){return iT(1+gO.count(TO(e),e),t,3)}function ZT(e,t){return iT(e.getUTCMilliseconds(),t,3)}function QT(e,t){return ZT(e,t)+"000"}function eN(e,t){return iT(e.getUTCMonth()+1,t,2)}function tN(e,t){return iT(e.getUTCMinutes(),t,2)}function nN(e,t){return iT(e.getUTCSeconds(),t,2)}function rN(e){var t=e.getUTCDay();return 0===t?7:t}function iN(e,t){return iT(kO.count(TO(e)-1,e),t,2)}function oN(e){var t=e.getUTCDay();return t>=4||0===t?LO(e):LO.ceil(e)}function aN(e,t){return e=oN(e),iT(LO.count(TO(e),e)+(4===TO(e).getUTCDay()),t,2)}function sN(e){return e.getUTCDay()}function lN(e,t){return iT(RO.count(TO(e)-1,e),t,2)}function cN(e,t){return iT(e.getUTCFullYear()%100,t,2)}function uN(e,t){return iT((e=oN(e)).getUTCFullYear()%100,t,2)}function dN(e,t){return iT(e.getUTCFullYear()%1e4,t,4)}function pN(e,t){var n=e.getUTCDay();return iT((e=n>=4||0===n?LO(e):LO.ceil(e)).getUTCFullYear()%1e4,t,4)}function hN(){return"+0000"}function fN(){return"%"}function mN(e){return+e}function gN(e){return Math.floor(+e/1e3)}const yN=UP();yN("d3-number",(function(e,t,n){let r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=lO(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o})),yN("d3-time",(function(e){let t=QO({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=QO(...arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r}));const bN={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return yN(t.type||"d3-number")(t.format||"")})(e)};function vN(e){let{id:t=bN.id,key:n=bN.key,min:r=bN.min,max:i=bN.max,type:o=bN.type,tags:a=bN.tags,title:s=bN.title,values:l=bN.values,value:c=bN.value,label:u=bN.label,formatter:d=bN.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>a(e),type:()=>o(e),min:()=>r(e),max:()=>i(e),title:()=>s(e),items:()=>l(e),formatter:()=>d(e),value:c,label:u}}const xN=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),wN=e=>e.reduce(((e,t)=>e+t),0),SN={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=xN(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=xN(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=xN(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=xN(e),n=t.length;return n?wN(t)/n:NaN}};function EN(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((a=>{const s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map((n=>EN(e,t,{main:n},r).main)):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=SN[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?SN[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=SN[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?SN[l.field.reduceLabel]:l.field.reduceLabel))})),i}function CN(e,t){const{main:n}=EN(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:EN(e,t,e.props||{},n),main:n}}function MN(e,t,n,r){const i=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=r?e[t][r]:e[t],i[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function _N(e,t){let{main:n,propsArr:r,props:i}=t,o=[];const a=n.field.formatter(),s={};return r.forEach((e=>{s[e]=i[e].field?i[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=MN(e.items,n,a);return r.forEach((n=>{t[n]=MN(e.items,i[n],s[n],n)})),t}))),o}function kN(e){let{cfg:t,itemData:n,obj:r,target:i,tracker:o,trackType:a}=e;const s="function"===a?t.trackBy(n):n[t.trackBy];let l=o[s];l||(l=o[s]={items:[],id:s},i.push(l)),l.items.push(r)}function RN(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function AN(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const IN={diverging:function(e,t){if((s=e.length)>0)for(var n,r,i,o,a,s,l=0,c=e[t[0]].length;l<c;++l)for(o=a=0,n=0;n<s;++n)(i=(r=e[t[n]][l])[1]-r[0])>=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o},none:WP,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}WP(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}WP(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,c=0;s<i;++s){for(var u=e[t[s]],d=u[a][1]||0,p=(d-(u[a-1][1]||0))/2,h=0;h<s;++h){var f=e[t[h]];p+=(f[a][1]||0)-(f[a-1][1]||0)}l+=d,c+=p*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,WP(e,t)}}},LN={ascending:function(e){var t=e.map(GP);return $P(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,r=e.length,i=e.map(GP),o=function(e){var t=e.map(VP);return $P(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],c.push(n));return c.reverse().concat(l)},none:$P,reverse:function(e){return $P(e).reverse()}};function DN(e,t,n){const r={},i=t.stackKey,o=t.value,a=t.startProp||"start",s=t.endProp||"end",l=t.offset||"none",c=t.order||"none",u=t.valueRef||"";let d=0,p={};for(let t=0;t<e.items.length;t++){let n=e.items[t],o=u?n[u]:null;if(o&&o.source){let e="".concat(o.source.key||"","/").concat(o.source.field);p[e]||(p[e]=o.source)}let a=i(n);r[a]=r[a]||{items:[]},r[a].items.push(n),d=Math.max(d,r[a].items.length)}const h=Array.apply(null,{length:d}).map(Number.call,Number),f=Object.keys(r).map((e=>r[e].items)),m=function(){var e=JD([]),t=$P,n=WP,r=HP;function i(i){var o,a,s=e.apply(this,arguments),l=i.length,c=s.length,u=new Array(c);for(o=0;o<c;++o){for(var d,p=s[o],h=u[o]=new Array(l),f=0;f<l;++f)h[f]=d=[0,+r(i[f],p,f,i)],d.data=i[f];h.key=p}for(o=0,a=t(u);o<c;++o)u[a[o]].index=o;return n(u,a),u}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:JD(CP.call(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:JD(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?$P:"function"==typeof e?e:JD(CP.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?WP:e,i):n},i}().keys(h).value(((e,t)=>e[t]?o(e[t]):0)).order(LN[c]).offset(IN[l]);let g=m(f),y=[];for(let e=0;e<g.length;e++){let t=g[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[a]={value:n[0]},r[s]={value:n[1]},y.push(n[0],n[1]))}}let b=Object.keys(p).map((e=>{let t=n(p[e].key);return t?t.field(p[e].field):null})).filter((e=>!!e));const v=vN({title:b.map((e=>e.title())).join(", "),min:AN(y),max:RN(y),type:"measure",formatter:b[0]?b[0].formatter:void 0});e.fields.push(v)}function PN(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=OD({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.fields();else if(e.items)n.items=e.items.map((e=>({value:o(e),label:String(a(e))})));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach((e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&i){const t=i.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(a(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&DN(n,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function ON(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:PN;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function TN(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const NN=Symbol("implicit");function qN(){var e=new WO,t=[],n=[],r=NN;function i(i){let o=e.get(i);if(void 0===o){if(r!==NN)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new WO;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return qN(t,n).unknown(r)},TN.apply(i,arguments),i}function FN(){var e,t,n=qN().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=a<o,p=d?a:o,h=d?o:a;e=(h-p)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),p+=(h-p-e*(n-l))*u,t=e*(1-l),s&&(p=Math.round(p),t=Math.round(t));var f=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map((function(t){return p+e*t}));return i(d?f.reverse():f)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,d()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,d()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return FN(r(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},TN.apply(d(),arguments)}function jN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zN(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function BN(){}var WN=.7,$N=1/WN,HN="\\s*([+-]?\\d+)\\s*",VN="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",GN="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",UN=/^#([0-9a-f]{3,8})$/,YN=new RegExp(`^rgb\\(${HN},${HN},${HN}\\)$`),KN=new RegExp(`^rgb\\(${GN},${GN},${GN}\\)$`),XN=new RegExp(`^rgba\\(${HN},${HN},${HN},${VN}\\)$`),JN=new RegExp(`^rgba\\(${GN},${GN},${GN},${VN}\\)$`),ZN=new RegExp(`^hsl\\(${VN},${GN},${GN}\\)$`),QN=new RegExp(`^hsla\\(${VN},${GN},${GN},${VN}\\)$`),eq={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function tq(){return this.rgb().formatHex()}function nq(){return this.rgb().formatRgb()}function rq(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=UN.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?iq(t):3===n?new sq(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?oq(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?oq(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=YN.exec(e))?new sq(t[1],t[2],t[3],1):(t=KN.exec(e))?new sq(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=XN.exec(e))?oq(t[1],t[2],t[3],t[4]):(t=JN.exec(e))?oq(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ZN.exec(e))?hq(t[1],t[2]/100,t[3]/100,1):(t=QN.exec(e))?hq(t[1],t[2]/100,t[3]/100,t[4]):eq.hasOwnProperty(e)?iq(eq[e]):"transparent"===e?new sq(NaN,NaN,NaN,0):null}function iq(e){return new sq(e>>16&255,e>>8&255,255&e,1)}function oq(e,t,n,r){return r<=0&&(e=t=n=NaN),new sq(e,t,n,r)}function aq(e,t,n,r){return 1===arguments.length?function(e){return e instanceof BN||(e=rq(e)),e?new sq((e=e.rgb()).r,e.g,e.b,e.opacity):new sq}(e):new sq(e,t,n,null==r?1:r)}function sq(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function lq(){return`#${pq(this.r)}${pq(this.g)}${pq(this.b)}`}function cq(){const e=uq(this.opacity);return`${1===e?"rgb(":"rgba("}${dq(this.r)}, ${dq(this.g)}, ${dq(this.b)}${1===e?")":`, ${e})`}`}function uq(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function dq(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function pq(e){return((e=dq(e))<16?"0":"")+e.toString(16)}function hq(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new mq(e,t,n,r)}function fq(e){if(e instanceof mq)return new mq(e.h,e.s,e.l,e.opacity);if(e instanceof BN||(e=rq(e)),!e)return new mq;if(e instanceof mq)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new mq(a,s,l,e.opacity)}function mq(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function gq(e){return(e=(e||0)%360)<0?e+360:e}function yq(e){return Math.max(0,Math.min(1,e||0))}function bq(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}jN(BN,rq,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tq,formatHex:tq,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return fq(this).formatHsl()},formatRgb:nq,toString:nq}),jN(sq,aq,zN(BN,{brighter(e){return e=null==e?$N:Math.pow($N,e),new sq(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?WN:Math.pow(WN,e),new sq(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new sq(dq(this.r),dq(this.g),dq(this.b),uq(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:lq,formatHex:lq,formatHex8:function(){return`#${pq(this.r)}${pq(this.g)}${pq(this.b)}${pq(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:cq,toString:cq})),jN(mq,(function(e,t,n,r){return 1===arguments.length?fq(e):new mq(e,t,n,null==r?1:r)}),zN(BN,{brighter(e){return e=null==e?$N:Math.pow($N,e),new mq(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?WN:Math.pow(WN,e),new mq(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new sq(bq(e>=240?e-240:e+120,i,r),bq(e,i,r),bq(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new mq(gq(this.h),yq(this.s),yq(this.l),uq(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=uq(this.opacity);return`${1===e?"hsl(":"hsla("}${gq(this.h)}, ${100*yq(this.s)}%, ${100*yq(this.l)}%${1===e?")":`, ${e})`}`}}));var vq=e=>()=>e;function xq(e){return 1==(e=+e)?wq:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):vq(isNaN(t)?n:t)}}function wq(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):vq(isNaN(e)?t:e)}var Sq=function e(t){var n=xq(t);function r(e,t){var r=n((e=aq(e)).r,(t=aq(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=wq(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Eq(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function Cq(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Lq(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function Mq(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function _q(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function kq(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Lq(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Rq=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Aq=new RegExp(Rq.source,"g");function Iq(e,t){var n,r,i,o=Rq.lastIndex=Aq.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Rq.exec(e))&&(r=Aq.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:_q(n,r)})),o=Aq.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Lq(e,t){var n,r=typeof t;return null==t||"boolean"===r?vq(t):("number"===r?_q:"string"===r?(n=rq(t))?(t=n,Sq):Iq:t instanceof rq?Sq:t instanceof Date?Mq:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Eq:Array.isArray(t)?Cq:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?kq:_q)(e,t)}function Dq(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Pq(e){return+e}var Oq=[0,1];function Tq(e){return e}function Nq(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function qq(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Nq(i,r),o=n(a,o)):(r=Nq(r,i),o=n(o,a)),function(e){return o(r(e))}}function Fq(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Nq(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=BO(e,t,1,r)-1;return o[n](i[n](t))}}function jq(){var e,t,n,r,i,o,a=Oq,s=Oq,l=Lq,c=Tq;function u(){var e=Math.min(a.length,s.length);return c!==Tq&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?Fq:qq,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),_q)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,Pq),u()):a.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=Dq,u()},d.clamp=function(e){return arguments.length?(c=!!e||Tq,u()):c!==Tq},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function zq(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?KO(t,e,n):KO(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=ZP(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(KP(t)/3)))-KP(Math.abs(e)))}(o,a))||(r.precision=i),oO(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,KP(t)-KP(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-KP(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return iO(r)}function Bq(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const r=t<e,[i,o,a]=r?YO(t,e,n):YO(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(i+e)/-a;else for(let e=0;e<s;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return zq(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(i=l,l=c,c=i,i=a,a=s,s=i);u-- >0;){if((i=KO(l,c,n))===r)return o[a]=l,o[s]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function Wq(){var e=jq()(Tq,Tq);return e.copy=function(){return t=e,Wq().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},TN.apply(e,arguments),Bq(e)}function $q(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[BO(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return $q().domain(t).range(n).unknown(e)},TN.apply(i,arguments)}function Hq(e){return void 0===e?e=>e:t=>e(t)}function Vq(e){return Math.max(0,Math.min(1,e))}function Gq(e){return"object"==typeof e}function Uq(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function Yq(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push(...Uq(t,o,a)),o-=a-o,a=e[i],r.push(...Uq(t,o,a))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push(...Uq(t,o,a))):r.push(...Uq(t,o,a))}return r.filter((e=>e>=n.min()&&e<=n.max()))}function Kq(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const a=qD(i)||qD(t)?2:Math.max(t/i,2),s=Math.min(1e3,Math.round(a));let l=n.ticks(s);l.length<=1&&(l=n.ticks(s+1));const c=r>0?Yq(l,r,n):l;c.sort(((e,t)=>e-t));const u=c.map(Hq(o));return c.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function Xq(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const a=qD(i)||qD(t)?2:Math.max(t/i,2),s=Math.min(1e3,Math.round(a)),l=s>10?10:s;n.nice(l);const c=n.ticks(s),u=r>0?Yq(c,r,n):c;u.sort(((e,t)=>e-t));const d=u.map(Hq(o));return u.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:d[t],value:e,isMinor:-1===c.indexOf(e)}}))}function Jq(e){let t,{settings:n,scale:r,distance:i,formatter:o=e=>e}=e;const a=n.minorTicks&&!qD(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!qD(e.value):!qD(e)));t=function(e){let{values:t,scale:n,formatter:r=e=>e}=e;return t.sort(((e,t)=>(Gq(e)?e.value:e)-(Gq(t)?t.value:t))).filter(((e,t,r)=>{const i=Gq(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t})).map((e=>{const t=Gq(e),i=t?e.value:e,o=n(i);return{position:o,value:i,label:t&&void 0!==e.label?e.label:r(i),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?Vq(n(e.start)):o,end:t&&!isNaN(e.end)?Vq(n(e.end)):o}}))}({values:e,scale:r.copy(),formatter:o})}else if(qD(n.ticks.count)){t=(n.ticks.tight?Xq:Kq)({distance:i,minorCount:a,unitDivider:n.ticks.distance,scale:r,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const r=e.map((e=>e.position)),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,o)}else{t=function(e){let{count:t,minorCount:n,scale:r,formatter:i}=e;return r.ticks((t-1)*n+t).map(((e,t)=>{const o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:a,scale:r.copy(),formatter:o})}return t}function Zq(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={};return Object.keys(t).forEach((i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]})),r}const Qq={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},eF={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},tF={count:NaN};function nF(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function rF(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Wq(),i={instance:null,invert:!1},o={data:t,resources:n},a=Zq(e,Qq,o);let s;function l(e){return qD(e)?NaN:r(e)}a.ticks=Zq(e.ticks,eF,o),a.minorTicks=Zq(e.minorTicks,tF,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=ID(!0,{},a,e.settings),e.scale=l,s=Jq(e),s):(s=r.ticks(e),s)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+i);n.push(o,o),r.push(a,a)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=rF(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return nF(i,l),i.instance(e)},l.normInvert=function(e){return nF(i,l),i.instance.invert(e)};const{mini:c,maxi:u}=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),r=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(a,t?t.fields:[]);return l.domain([c,u]),l.range(a.invert?[1,0]:[0,1]),i.invert=a.invert,l}const iF={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function oF(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},r=Zq(e,iF,n),i=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>i[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}}))}(t,n.trackBy)}}const c=FN();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(r.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<i.length;e++){const t=ID({datum:i[e]},n),r=u(t,e);-1===a.indexOf(r)&&(a.push(r),s.push(d(t,e)),o[r]=e)}return c.domain(a),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const aF={depth:0};function sF(e,t,n){return e.ancestors().map((e=>t(ID({datum:e.data},n)))).reverse().slice(1).toString()}const lF=e=>e.min(),cF=e=>e.max();function uF(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map(lF).filter(ND);i=e.length?Math.min(...e):i}if(!r){const e=t.map(cF).filter(ND);o=e.length?Math.max(...e):o}}return[i,o]}const dF={domain:[],range:[],invert:!1,min:NaN,max:NaN};function pF(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=rF(e,t,n).clamp(!0).interpolate(Sq),i=Zq(e,dF,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;ID(!0,s,r);const[l,c]=uF(i,t?t.fields:[]),u=o?i.domain.length:-1,d=n.theme?n.theme.palette("sequential",u>0?u:2):[],p=a?i.range:d;return s.range(i.invert?p.slice().reverse():p.slice()),s.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(s.range(),l,c)),s}const hF={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function fF(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const mF={domain:[],range:[]};const gF={domain:[],range:[],unknown:void 0},yF={domain:[],range:[],override:!1};const bF=UP();function vF(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{r.extract.push({field:e})})));const i=PN(r,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(i);return"color"===a&&(a=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=a),o}bF("linear",rF),bF("band",oF),bF("h-band",(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={data:n,resources:r},o=Zq(t,iF,i);o.ticks=Zq(t.ticks,aF,i),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=oF(o);const{values:s,labels:l,items:c,ticks:u}=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=sF(e,i,n),d=e.leaves()||[e],p=i(ID({datum:e.data},n)),h=o(ID({datum:e.data},n)),f=Array.isArray(e.children),m={key:t,count:d.length,value:p,label:h,leftEdge:sF(d[0],i,n),rightEdge:sF(d[Math.max(d.length-1,0)],i,n),node:e};f?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(h)),(r<=0&&!f||e.depth===r)&&c.push(m),l[t]=m}}));const d=e.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:c}}(n.root,o,i),d=function(e){const t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};ID(!0,d,a),d.bandwidth=function(e){const t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=d(t.leftEdge),r=d(t.rightEdge);return Math.abs(e-r)+n}return n},d.step=function(e){const t=c[String(e)],n=t?t.count:1;let r=a.step();return r*=n,r},d.data=()=>n,d.datum=e=>{const t=c[String(e)];return t?t.node.data:null},d.copy=()=>e(t,n,r),d.labels=()=>l,d.ticks=()=>u.map((e=>{const t=d(e.key),n=d.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const p=a.pxScale;return d.pxScale=function(e){return a=p(e),d},d.domain(s),d})),bF("sequential-color",pF),bF("threshold-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=$q(),i=Zq(e,hF,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return qD(e)?NaN:r(e)}Object.keys(r).forEach((e=>s[e]=r[e]));const l=t.fields,[c,u]=uF(i,l),d=o?i.domain.length:-1,p=n.theme?n.theme.palette("sequential",d>0?d:2):[];let h=a?i.range:p,f=[];return f=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=Wq().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(h,c,u):[c+(u-c)/2],h.length>f.length+1?f=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(h,c,u):h.length<f.length+1&&(h=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=pF().domain([n,r]).range(t);return[n,...fF(e),r].map((e=>i(e)))}(f,h,c,u)),s.data=()=>t,s.range(i.invert?h.slice().reverse():h),s.domain(f),s})),bF("categorical-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=qN(),i={data:t,resources:n},o=Zq(e,mF,i),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],d=[];for(let e=0;e<l.length;e++){const t=ID({datum:l[e]},i),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(s(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>d,r.label=e=>d[u.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(u),r}(e,t,n),i=n.theme,o=Zq(e,gF,{data:t,resources:n});let a;if(o.explicit=Zq(e.explicit,yF,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/a.length);for(let e=1;e<i+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(a[i]=n[r])}else{const r=t.map(((t,r)=>[e.indexOf(t),t,n[r]])).sort(((e,t)=>e[0]-t[0]));r.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])}))}a.length=e.length}return r.range(a),r}));var xF={};function wF(){wF.init.call(this)}xF.isObject=function(e){return"object"==typeof e&&null!==e},xF.isNumber=function(e){return"number"==typeof e},xF.isUndefined=function(e){return void 0===e},xF.isFunction=function(e){return"function"==typeof e};var SF=wF;wF.EventEmitter=wF,wF.prototype._events=void 0,wF.prototype._maxListeners=void 0,wF.defaultMaxListeners=10,wF.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},wF.prototype.setMaxListeners=function(e){if(!xF.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},wF.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],xF.isUndefined(n))return!1;if(xF.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(xF.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},wF.prototype.addListener=function(e,t){var n;if(!xF.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,xF.isFunction(t.listener)?t.listener:t),this._events[e]?xF.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,xF.isObject(this._events[e])&&!this._events[e].warned)&&((n=xF.isUndefined(this._maxListeners)?wF.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,xF.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),xF.isFunction(console.trace)&&console.trace()));return this},wF.prototype.on=wF.prototype.addListener,wF.prototype.once=function(e,t){if(!xF.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},wF.prototype.removeListener=function(e,t){var n,r,i,o;if(!xF.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||xF.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(xF.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},wF.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],xF.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},wF.prototype.listeners=function(e){return this._events&&this._events[e]?xF.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},wF.listenerCount=function(e,t){return e._events&&e._events[t]?xF.isFunction(e._events[t])?1:e._events[t].length:0};var EF={mixin:e=>(Object.keys(SF.prototype).forEach((t=>{e[t]=SF.prototype[t]})),SF.init(e),e)};function CF(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update(o){let a=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);const s=Math.max(e,Math.min(t-r,n));n!==s&&(n=s,a=!0),a&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return EF.mixin(i),i}function MF(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||CF();return o.update({min:n,max:r,viewSize:i}),o}function _F(e,t){return e<=t}function kF(e,t){return e<t}function RF(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function AF(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:r=!0,includeMin:i=!0}=n;e=r?_F:kF,t=i?_F:kF},i.add=e=>{let{min:t,max:n}=e;const i=RF(r,t),o=RF(r,n,!0),a=[i,o-i];i%2==0&&a.push(t),o%2==0&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.remove=e=>{let{min:t,max:n}=e;const i=RF(r,t),o=RF(r,n,!0),a=[i,o-i];i%2==1&&a.push(t),o%2==1&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let{min:t,max:n}=e;const i=RF(r,t,!0),o=RF(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function IF(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const LF={key:void 0,includeMin:!0,includeMax:!0};function DF(e){let{items:t,collection:n,vc:r}=e;const i={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=r()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(i[a]=i[a]||[],i[a].push(s[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:i[a]});return o}function PF(e){let{items:t,collection:n}=e;const r={},i=[];let o,a;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(r[o]=r[o]||[],r[o].push(a[e]))}const s=Object.keys(r);for(let e=0,t=s.length;e<t;e++)o=s[e],i.push({id:o,values:r[o]});return i}function OF(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function TF(e){let{key:t,collection:n,obj:r,fn:i,value:o}=e;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function NF(e,t){const n=[],r=Object.keys(e);let i,o;const a=e=>-1===t[i].indexOf(e);for(let s=0,l=r.length;s<l;s++)i=r[s],t[i]?(o=e[i].filter(a),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function qF(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?ID({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),r):r}function FF(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function jF(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function zF(e,t,n){let{ranges:r,interceptors:i,rc:o,aliases:a,rangeConfig:s}=n;const l=qF(i["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach((e=>{const n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}})),c}function BF(){let{vc:e=IF,rc:t=AF}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,r={},i={},o={},a={sources:{},default:ID({},LF)};const s={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(i).forEach((t=>{e.values[t]=i[t].values()})),Object.keys(r).forEach((t=>{e.ranges[t]=r[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(a={sources:{},default:ID({},LF)},e.ranges.forEach((e=>{const t={};Object.keys(LF).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:LF[n]})),void 0!==e.key?a.sources[e.key]=t:a.default=t})),Object.keys(r).forEach((e=>r[e].configure(a.sources[e]||a.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{i[n]&&e.values[n].join(";")===i[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(i).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{r[n]&&e.ranges[n].join(";")===r[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(r).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,r={},i={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(r).length>0||e.length;r={},i={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(r).map((e=>({type:"range",id:e,brush:r[e]})))),e=e.concat(Object.keys(i).map((e=>({type:"value",id:e,brush:i[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const r=qF(s.addValues,t,o),a=DF({vc:e,collection:i,items:r});u.emit("add-values",r),a.length&&(n||(n=!0,u.emit("start")),u.emit("update",a,[]),c.updateValues())}};return u.setValues=t=>{const r=qF(s.setValues,t,o),a=function(e){let{items:t,vCollection:n,vc:r}=e;const i={},o=OF(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const d=e=>{n[a]&&n[a].contains(e)||TF({key:a,value:e,collection:n,obj:i,fn:r})},p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)a=p[e],o[a].forEach(d);return l=NF(c,i),s=NF(i,c),[s,l]}({items:r,vCollection:i,vc:e});u.emit("set-values",r),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.removeValue=(e,t)=>{u.removeValues([{key:e,value:t}])},u.removeValues=e=>{const t=qF(s.removeValues,e,o),n=PF({collection:i,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(t,r)=>{const a=qF(s.addValues,t,o),l=qF(s.removeValues,r,o),d=DF({vc:e,collection:i,items:a}),p=PF({collection:i,items:l});u.emit("add-values",a),u.emit("remove-values",l),(d.length||p.length)&&(n||(n=!0,u.emit("start")),u.emit("update",d,p),c.updateValues())},u.toggleValue=(e,t)=>{u.toggleValues([{key:e,value:t}])},u.toggleValues=t=>{const r=qF(s.toggleValues,t,o),a=function(e){let{items:t,values:n,vc:r}=e;const i={},o={},a=[],s=[],l=OF(t);let c,u,d;const p=Object.keys(l);for(let e=0,t=p.length;e<t;e++){c=p[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):TF({key:c,value:u,collection:n,obj:i,fn:r})}const h=Object.keys(i);for(let e=0,t=h.length;e<t;e++)c=h[e],a.push({id:c,values:i[c]});const f=Object.keys(o);for(let e=0,t=f.length;e<t;e++)c=f[e],s.push({id:c,values:o[c]});return[a,s]}({items:r,values:i,vc:e});u.emit("toggle-values",r),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.containsValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].contains(t)},u.addRange=(e,t)=>{u.addRanges([{key:e,range:t}])},u.addRanges=e=>{zF(e,"add",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(e,t)=>{u.removeRanges([{key:e,range:t}])},u.removeRanges=e=>{zF(e,"remove",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(e,t)=>{u.setRanges([{key:e,range:t}])},u.setRanges=e=>{zF(e,"set",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(e,t)=>{u.toggleRanges([{key:e,range:t}])},u.toggleRanges=e=>{zF(e,"toggle",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsValue(t)},u.containsRange=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsRange(t)},u.containsMappedData=(e,t,n)=>{let a=[];const s=Object.keys(e);let l,c,u,d;for(let t=0,n=s.length;t<n;t++){if(l=s[t],"value"===l)c=e,a[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],a[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),d=c.value,r[u]?a[t].bool=Array.isArray(d)?r[u].containsRange({min:d[0],max:d[1]}):r[u].containsValue(d):i[u]&&i[u].contains(d)&&(a[t].bool=!0))}return t?(a=a.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!a.length&&!a.some((e=>!1===e.bool)):"xor"===n?!!a.length&&a.some((e=>e.bool))&&a.some((e=>!1===e.bool)):a.some((e=>e.bool))):a.some((e=>e.bool))},u.intercept=(e,t)=>{const n=FF(e);s[n]&&s[n].push(t)},u.removeInterceptor=(e,t)=>{const n=FF(e);if(!s[n])return;const r=s[n].indexOf(t);-1!==r&&s[n].splice(r,1)},u.removeAllInterceptors=e=>{const t=[];if(e){const n=FF(e);s[n]&&s[n].length&&t.push({name:e,handlers:s[n]})}else Object.keys(s).forEach((e=>{s[e].length&&t.push({name:jF(e),handlers:s[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},u.addKeyAlias=(e,t)=>{o[e]=t},u.removeKeyAlias=e=>{delete o[e]},EF.mixin(u),u}function WF(e){return e*e*e}function $F(e){return--e*e*e+1}function HF(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}UP();const VF=["stroke","fill","color","backgroundColor","thumbColor"];function GF(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let a;for(a=0;a<r;++a)i[a]=UF(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<r;++a)o[a]=i[a](e);return o}}function UF(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?_q:"string"===r?(i=rq(t))&&VF.includes(n)?(t=i,Sq):Iq:t instanceof rq?Sq:t instanceof Date?Mq:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Eq:Array.isArray(t)?GF:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?YF:_q)(e,t)}function YF(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=UF(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function KF(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const XF={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},JF=/^\$/;function ZF(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function QF(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function ej(e,t){return e.pxScale?e.pxScale(t):e}const tj={normalizeSettings:function(e,t,n){const r=ID({},e),i=ID({},t);return Object.keys(r).forEach((e=>{i[e]={};const o=r[e],a=typeof o;if("function"==typeof o)i[e].fn=o;else if(ZF(o)){let n=t[e];"string"==typeof n&&JF.test(n)&&(n=XF[n]);const r=typeof n;i[e]="undefined"===r||r===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in r)return;const n=t[e];"string"===typeof n&&JF.test(n)?i[e]=XF[n]:i[e]=n})),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof s&&void 0!==c,d=u&&"string"==typeof c.ref,p=u&&o in s,h=d?s[c.ref]:p?s[o]:a;ZF(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&h?(r[o]=c.scale(h.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&h?r[o]=h.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:QF};function nj(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...nj(t.children)),e):(e.push(t),e)),[])}function rj(e,t){let{context:n,data:r,style:i,filter:o,mode:a}=t;const s=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach((e=>{d.push(e)})),Object.keys(u).forEach((e=>{-1===d.indexOf(e)&&d.push(e)}));const p=[];let h=!1;const f=()=>{let t=nj(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=f(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:s}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},d.forEach((t=>{e[r].__style[t]=e[r][t]})));const t=s.containsMappedData(n,i,a),o=p.indexOf(e[r]);let l=!1;t&&-1===o?(p.push(e[r]),l=!0):t||-1===o||(p.splice(o,1),l=!0),e[r].needToUpdate=l||h,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=ID({},e[i],e[i].__style),n=e[i].isActive;d.forEach((r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,p):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,p):u[r]:e[i].__style[r]})),r=!0}delete e[i].needToUpdate}return h=!1,r},g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=f(),i=r.length;for(let e=0;e<i;e++)r[e].data&&(r[e].__style=r[e].__style||{},d.forEach((t=>{r[e].__style[t]=r[e][t],t in u&&(r[e][t]="function"==typeof u[t]?u[t].call(null,r[e]):u[t])})));h=!0,p.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=f(),i=r.length;for(let e=0;e<i;e++)r[e].__style&&(Object.keys(r[e].__style).forEach((t=>{r[e][t]=r[e].__style[t]})),r[e].__style=void 0);p.length=0,n||e.renderer.render(e.nodes)},b=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",y),s.on("update",b),{isActive:()=>s.isActive(),update:()=>{p.length=0,h=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",b)}}}function ij(e){let{nodes:t,action:n,chart:r,trigger:i}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:r,trigger:i}=e;if(!i)return;const o=i.data||[""];let a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}}))}i.contexts.forEach((e=>{a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)}))}({dataPoints:o,action:n,chart:r,trigger:i})}function oj(e){let{collisions:t,t:n,config:r,action:i}=e,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map((e=>e.node));return ij({nodes:s,action:i,chart:r.chart,data:r.data,trigger:n}),a}function aj(e,t,n){const r=n.element().getBoundingClientRect();let i=TD(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&TD(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!TD(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function sj(e,t,n){return e?"function"==typeof e?e(t):e:n}const lj={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function cj(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function uj(e,t,n,r){const i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function dj(e){return-e/180*Math.PI}function pj(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(dj(e))}function hj(e,t){return{x:e.x+t.x,y:e.y+t.y}}function fj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function mj(e,t){return{x:e.x*t,y:e.y*t}}function gj(e,t){return e.x-t.x}function yj(e,t){return e.y-t.y}function bj(e,t){return gj(e,t)**2+yj(e,t)**2}function vj(e,t){return Math.sqrt(bj(e,t))}function xj(e,t){return e.x*t.x+e.y*t.y}function wj(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=fj(e,n);return hj({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const Sj={up:0,down:180,left:90,right:-90};function Ej(e){let{x:t,y:n,size:r}=e;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const Cj=UP();Cj.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),Cj.add("diamond",(function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:cj([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}})),Cj.add("saltire",(function(e){const t=dj(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=uj(e.x,e.y,o,i).map((e=>wj(e,t,s)));return{type:"path",fill:"black",d:cj(l)}})),Cj.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),Cj.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},r=Sj[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i;let s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=dj(r);return s=s.map((e=>wj(e,l,n))),{type:"path",fill:"black",d:cj(s)}})),Cj.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:Ej(e)}})),Cj.add("star",(function(e){const t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i;for(let t=1;t<=i;t++){const i=s*t+a,l=dj(i),c=dj(i+s/2),u=Math.sin(l),d=Math.cos(l),p=Math.sin(c),h=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+h*o,y:e.y+p*o})}return{type:"path",fill:"black",d:cj(n)}})),Cj.add("n-polygon",(function(e){const t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=r;a++){const r=dj(i*a+o),s=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:cj(t)}})),Cj.add("cross",(function(e){const t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:cj(uj(t,n,e.size,o))}})),Cj.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){const e=dj(90);o=o.map((n=>wj(n,e,t)))}const a=BD(o);return a.type="rect",a.fill="black",a})),Cj.add("rect",(function(e){const{x:t,y:n,size:r}=e,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}));const Mj=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Cj;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==lj[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function _j(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:r=0,prioOrder:i=0,preferredSize:o=0,minimumLayoutMode:a,show:s=!0}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:r,children:i}=e;return"function"==typeof o?o({inner:n,outer:r,children:i,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},prioOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},minimumLayoutMode(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a},show(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s}}}function kj(e,t,n){const{require:r=[]}=t,i=t.mediator||{},{settings:o,formatter:a,scale:s,data:l,renderer:c,chart:u,dockConfig:d,mediator:p,instance:h,rect:f,style:m,registries:g,resolver:y,update:b,_DO_NOT_USE_getInfo:v,symbol:x,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:s}),Object.defineProperty(e,"mediator",{get:p}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:g}),f&&Object.defineProperty(e,"rect",{get:f}),v&&(e._DO_NOT_USE_getInfo=v),Object.keys(t).forEach((n=>{var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((e=>e===r))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),r.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:d}):"instance"===t?Object.defineProperty(e,"instance",{get:h}):"update"===t&&b?Object.defineProperty(e,"update",{get:b}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:x})})),Object.keys(i).forEach((t=>{e.mediator.on(t,i[t].bind(e))}))}function Rj(e,t,n){const r=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function Aj(e,t,n){Object.keys(n.on||{}).forEach((r=>{e.eventListeners=e.eventListeners||[];const i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)})),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit(e,...r)}}function Ij(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:r=()=>({})}=e,{chart:i,container:o,mediator:a,registries:s,theme:l,renderer:c}=t,u=EF.mixin({});let d,p,h,f,m,g=t.settings||{},y=ID(!0,{},n,g),b=[],v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tj,n={};return{resolve:function(r){let{data:i,settings:o,defaults:a={},scaled:s}=r;const l=n.norm=t.normalizeSettings(o,a,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};s&&Object.keys(s).forEach((e=>{l[e]&&t.updateScaleSize(l,e,s[e])}));const u=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:c};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:c};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:i}),x=!1;const w={nodes:[],chart:i,config:y.brush||{},renderer:null},S={tap:[],over:[]},E=[],C={},M=ID({},g);function _(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=void 0!==e[t],o=void 0!==g[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?a=e[t].call(C,...l):r&&(a=e[t])),o&&("function"==typeof g[t]?a=g[t].call(M,...l):r&&(a=g[t])),i||o||(a=n.call(C,...l)),a}}const k=_("preferredSize",(()=>0),!0),R=_("resize",(e=>{let{inner:t}=e;return t})),A=_("created"),I=_("beforeMount"),L=_("mounted"),D=_("beforeUnmount"),P=_("beforeUpdate"),O=_("updated"),T=_("beforeRender"),N=_("beforeDestroy"),q=_("destroyed"),F=e.render,j=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&E.push(rj(w,e))}))},z=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?S.over.push(e):S.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>b});const B=y.renderer||e.renderer,W=B?c||s.renderer(B)():c||s.renderer()();"function"==typeof W.settings&&W.settings(y.rendererSettings),w.renderer=W;const $={resources:i.logger?{logger:i.logger()}:{}};let H=_j(Rj(y,k,i.logger()),$);const V=e=>{e.key=y.key,e.element=W.element()},G=()=>{};G.dockConfig=()=>H,G.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(g=e.settings,y=ID(!0,{},n,e.settings),H=_j(Rj(y,k,i.logger()),$),w.config=y.brush||{}),y.scale&&(d=i.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=PN(y.data,{dataset:i.dataset,collection:i.dataCollection},{logger:i.logger()},i.dataCollection);t?t.isFirst?(b=n,b.items&&(b.items=[...n.items])):b.items&&(b.items=[...b.items,...n.items||[]]):b=n}else b=d?d.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?p=i.formatter(y.formatter):d&&d.data().fields&&(p=d.data().fields[0].formatter()),m=l.style(y.style||{})},G.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=R({inner:e,outer:t});f=n?W.size(n):W.size(e),M.rect=ID(!0,{computedPhysical:f.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),f=ID(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},f)},G.getRect=()=>M.rect;const U=()=>{const e=W.renderArgs?W.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=b;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return b.items&&r&&(n=OD(OD({},b),{},{items:b.items.slice(r.start,r.end)})),e.push({data:n}),e};let Y,K,X;function J(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}G.beforeMount=I,G.beforeRender=()=>{T({size:f})},G.render=()=>{const e=F.call(C,...U());J(e),W.render(e),Y=e,K=M.rect.computed},G.hide=()=>{G.unmount(),W.size({x:0,y:0,width:0,height:0}),W.clear()},G.beforeUpdate=()=>{P({settings:y,data:b})},G.update=()=>{X&&X.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return W.render(),void(Y=null);const r=F.call(C,...U());J(r),E.forEach((e=>e.cleanUp())),E.length=0,S.tap=[],S.over=[],t&&(j(),z()),E.forEach((e=>{e.isActive()&&e.update()})),Y&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:Y,currentRect:M.rect.computed,previousRect:K}),X=function(e,t,n,r){let i,{old:o,current:a}=e,{renderer:s}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},p=[],h=null;const f=n.trackBy||KF,m={start(){let e={};if(o.forEach(((t,n)=>{let r=f(t,n);e[r]=t})),a.forEach(((t,n)=>{let r=f(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),r=t.points.filter((e=>!e.dummy)),i=r.map((e=>e.data.major.value)),o=n.filter((e=>i.includes(e.data.major.value))).map((e=>e.data.major.value)),a=n.filter((e=>o.includes(e.data.major.value))),s=r.filter((e=>o.includes(e.data.major.value)));return{old:a,current:s}}(e[r],t);d.ips.push(YF(ID({},e[r],{points:n.old}),ID({},t,{points:n.current}))),l.push(ID({},e[r],{commonPoints:n.old}))}else d.ips.push(YF(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(YF(ID({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(YF(e[t],ID({},e[t],{r:1e-4,opacity:0}))))})),p.push({name:"exiting",easing:WF,duration:200,tweens:u.ips,nodes:[...l]}),p.push({name:"updating",easing:HF,duration:400,tweens:d.ips,nodes:[]}),p.push({name:"entering",easing:$F,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,i=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:a}=r.getValue("animations.updatingStageMeta");!1===o?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===i)}p.length&&(h=s.getScene(a),p[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(m.tick)))},tick(){let e=p[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,n=[],o=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));if(n.push(...o),n.push(...e.nodes),s.render(n),t>=1){p.shift();const{isInit:e,shouldBeRemoved:t}=r.getValue("animations.updatingStageMeta");p.length?"updating"===p[0].name&&t&&p.shift():(!0===e&&r.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}i&&(i=window.requestAnimationFrame(m.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return h}};return m}({old:Y,current:r},{renderer:W},n,i.storage),X.start()):W.render(r),Y=r,K=M.rect.computed,W.setKey&&"string"==typeof g.key&&W.setKey(g.key)},G.updated=O,G.destroy=()=>{G.unmount(),N(h),W.destroy(),q(),h=null};const Z=e=>{w.nodes=e,E.forEach((e=>{e.isActive()&&e.update()})),W.render(e)};return kj(C,e,{settings:()=>y,data:()=>b,scale:()=>d,formatter:()=>p,renderer:()=>W,chart:()=>i,dockConfig:()=>H,mediator:()=>a,instance:()=>M,rect:()=>M.rect,style:()=>m,update:()=>Z,registries:()=>s,resolver:()=>v,symbol:()=>Mj(s.symbol)}),kj(M,g,{settings:()=>y,data:()=>b,scale:()=>d,formatter:()=>p,renderer:()=>W,chart:()=>i,dockConfig:()=>H,mediator:()=>a,style:()=>m,_DO_NOT_USE_getInfo:r.bind(C),isVisible:()=>x}),G.getBrushedShapes=function(e,t,n){const r=[];if(y.brush&&y.brush.consume){const o=i.brush(e),a=W.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let i=0;i<a.length;i++){const s=a[i];s.data&&o.containsMappedData(s.data,n||e.data,t)&&(V(s),r.push(s),a.splice(i,1),i--)}}))}return r},G.findShapes=e=>{var t;const n=(null!==(t=X)&&void 0!==t&&t.inProgress()?X.targetScene:W).findShapes(e);for(let e=0,t=n.length;e<t;e++)V(n[e]);return n},G.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=W.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=r.length;e<t;e++)V(r[e]);return r},G.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];ij({nodes:e,action:t.action||"toggle",trigger:t,chart:i,data:w.data})},G.mount=()=>{h=W.element&&W.element()?h:W.appendTo(o),W.setKey&&"string"==typeof g.key&&W.setKey(g.key),y.brush&&(j(),z()),Aj(M,u,g),Aj(C,u,e),x=!0},G.mounted=()=>L(h),G.unmount=()=>{[M,C].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:r}=e;t.removeListener(n,r)})),e.eventListeners.length=0),e.emit=()=>{}}(e,u)})),S.tap=[],S.over=[],E.forEach((e=>{e.cleanUp()})),E.length=0,D(),x=!1},G.onBrushTap=e=>{S.tap.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return oj({collisions:aj(t,n,r.renderer),t:n,config:r,action:sj(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},G.onBrushOver=e=>{S.over.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return oj({collisions:aj(t,n,r.renderer),t:n,config:r,action:sj(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},G.def=C,G.ctx=M,G.renderer=()=>W,G.set({settings:g}),A(),G}function Lj(e){const t=ID(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function Dj(e,t,n){const r=hj(function(e,t){const n=xj(e,t)/xj(t,t)||1;return{x:t.x*n,y:t.y*n}}(fj(n,e),fj(t,e)),e);return r}function Pj(e,t,n){return vj(e,n)+vj(t,n)-vj(e,t)<1e-12}function Oj(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function Tj(e){return e.x1===e.x2&&e.y1===e.y2}function Nj(e){return e.width<=0||e.height<=0}function qj(e){return e.r<=0}function Fj(e){return e.edges.length<=2}function jj(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=Gj(e,WD(t.edges[r])),!0===n)return!0;return!1}function zj(e,t){let n=!1;const{numPolygons:r,polygons:i}=t;for(let t=0;t<r;t++){if(n=tz(e,i[t]),!0===n)return!0}return!1}function Bj(e,t){if(qj(e))return!1;return bj({x:e.cx,y:e.cy},t)<=e.r**2}function Wj(e,t){if(Nj(t)||qj(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,c=Math.abs(s-i),u=Math.abs(l-o);if(c>n+a||u>r+a)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=a**2}function $j(e,t){if(qj(e)||Tj(t))return!1;const[n,r]=jD(t);if(Bj(e,n)||Bj(e,r))return!0;const i={x:e.cx,y:e.cy},o=Dj(n,r,i);return bj(o,i)<=e.r**2&&Pj(n,r,o)}function Hj(e,t){if(Fj(t)||qj(e))return!1;if(Vj(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if($j(e,WD(t.edges[r])))return!0}return!1}function Vj(e,t){if(Fj(e)||!Xj(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=i.length,s=a-1;++l<a;s=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[s].y&&i[l].y===r&&(n-i[l].x)*(n-i[s].x)<=0)return!0;if(i[l].y<r&&r<=i[s].y||i[s].y<r&&r<=i[l].y){if(c=(i[s].x-i[l].x)*(r-i[l].y)/(i[s].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function Gj(e,t){if(Fj(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(Zj(t,WD(e.edges[n])))return!0}const[n,r]=jD(t);return Vj(e,n)||Vj(e,r)}function Uj(e,t){if(Fj(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(Jj(t,WD(e.edges[n])))return!0}const[n,r,i,o]=zD(t);return Vj(e,n)||Vj(e,r)||Vj(e,i)||Vj(e,o)}function Yj(e,t){return!Nj(e)&&!Nj(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function Kj(e,t){if(Nj(e)||Nj(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((t=>Xj(e,t)))}function Xj(e,t){return!Nj(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function Jj(e,t){if(Tj(t)||Nj(e))return!1;const[n,r]=jD(t);if(Xj(e,n)||Xj(e,r))return!0;const i=zD(e);let o=i.length;for(let e=0;e<o;e++){if(Zj(WD([i[e],i[3!==e?e+1:0]]),t))return!0}return!1}function Zj(e,t){const[n,r]=jD(e),[i,o]=jD(t),a=gj(r,n),s=yj(r,n),l=gj(o,i),c=yj(o,i),u=gj(n,i),d=yj(n,i);let p=c*a-l*s;const h=l*d-c*u,f=a*d-s*u;let m,g;if(0===a&&0===s)return!1;if(0===l&&0===c)return!1;if(0===p){if(0===h&&0===f){if(0===a){if(0===s)return n.x===r.x&&n.y===r.y;m=yj(i,n)/s,g=yj(o,n)/s}else m=(i.x-n.x)/a,g=(o.x-n.x)/a;return!(m<0&&g<0||m>1&&g>1)}return!1}const y=h/p;return p=f/p,y>=0&&y<=1&&p>=0&&p<=1}function Qj(e,t){if(Tj(e))return!1;const[n,r]=jD(e);return Pj(n,r,t)}function ez(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Yj(n,r)&&(Kj(n,r)?jj(e,t):jj(t,e))}function tz(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Yj(n,r)&&(Kj(r,n)?function(e,t){let n=!1;const{numPolygons:r,polygons:i}=e;for(let e=0;e<r;e++)if(n=ez(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=iz(e,WD(t.edges[r])),!0===n)return!0;return!1}(e,t))}function nz(e,t){if(qj(e))return!1;if(rz(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:r}=t;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if($j(e,WD(n.edges[t])))return!0}}return!1}function rz(e,t){if(!Xj(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.numPolygons;let o,a,s,l,c,u,d=!1;for(a=0;a<i;a++)for(o=e.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(d=!d)}}return d}function iz(e,t){const[n,r]=jD(t);if(rz(e,n)||rz(e,r))return!0;const{numPolygons:i,polygons:o}=e;for(let e=0;e<i;e++){const n=o[e];for(let e=0,r=n.edges.length;e<r;e++){if(Zj(t,WD(n.edges[e])))return!0}}return!1}function oz(e,t){const[n,r,i,o]=zD(t);if(rz(e,n)||rz(e,r)||rz(e,i)||rz(e,o))return!0;const{numPolygons:a,polygons:s}=e;for(let e=0;e<a;e++){const n=s[e];for(let e=0,r=n.edges.length;e<r;e++){if(Jj(t,WD(n.edges[e])))return!0}}return!1}const az=/^\$/,sz="@extend";function lz(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function cz(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&lz(e),az.test(r)?(n.push(e),cz(r,t,n)):r}let r=e;const i=ID(!0,{},t,e),o={};if(e[sz]){const o=e[sz];-1!==n.indexOf(o)&&lz(o);let a=n.slice();a.push(o),r=ID(!0,{},cz(i[o],t,a),e)}return Object.keys(r).forEach((e=>{let t=n.slice();if(e===sz||az.test(e))return;o[e]=r[e];let a=o[e];az.test(a)&&a in i?(-1!==n.indexOf(a)&&lz(a),t.push(a),a=i[a],"object"==typeof a||az.test(a)&&a in i?o[e]=cz(a,i,t):o[e]=a):"object"==typeof a&&(o[e]=cz(a,i,t))})),o}function uz(e,t){return cz(e,t,[])}function dz(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>uz(e,n),setStyle:t=>{n=ID({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function pz(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function hz(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return ID(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function fz(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function mz(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function gz(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function yz(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function bz(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function vz(e,t,n,r,i){const o=ID({},t),a=ID({},n);gz(o,r),yz(a,r),bz(e,o,a);const s=function(e,t,n){const r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i);return!!s&&(gz(t,r),yz(n,r),!0)}function xz(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function wz(e){return BD([].concat(...e.map(zD)))}function Sz(e){let{visible:t,layoutRect:n,reducedRect:r,containerRect:i,translation:o}=e;const a=fz(r.x,r.y,r.width,r.height),s=fz(r.x,r.y,r.width,r.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=wz(n.map((e=>e.outerRect))),c=wz(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const a=e?"height":"width",s=(r[a]-n[a]*i.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=xz(c),t.edgeBleed=e.edgeBleed,t.computed=xz(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function Ez(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof i?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function Cz(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function Mz(e){let t=hz(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:r,containerRect:i}=function(e,t){const n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),pz(r),pz(n),{logicalContainerRect:r,containerRect:n}}(e,t),[o,a]=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o];Cz(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];Ez(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:u}):i.push({comp:a,key:l,config:s,referencedDocks:u})}return[r,i]}(n,t,r),s=function(e){let{layoutRect:t,visible:n,hidden:r,settings:i}=e;const o=fz(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<s.length;++e){const n=s[e];mz(n,o,t),vz(t,o,a,n,i)||(r.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every((e=>t.some((t=>t.key===e))));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter((e=>-1!==s.indexOf(e)));return n.length=0,n.push(...l),bz(t,o,a),o}({layoutRect:r,visible:o,hidden:a,settings:t}),l=Sz({visible:o,layoutRect:r,reducedRect:s,containerRect:i,translation:{x:e.x,y:e.y}});return a.forEach((e=>{e.comp.visible=!1;const t=fz();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:a.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=hz(e)},n}const _z=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},kz=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(OD(OD({},n),{},{children:kz(e.children)}))}})),Rz=(e,t)=>({visible:[],hidden:t,ordered:[]}),Az=e=>(t,n)=>{var r;const i=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(OD(OD({},t),{},{children:kz(e.children)}))}})),o=e=>n[e.index],{visible:a=i,hidden:s=[],ordered:l=a}=null!==(r=e(t,i))&&void 0!==r?r:{};return{visible:a.map(o),hidden:s.map(o),ordered:l.map(o)}},Iz=e=>"function"==typeof e?Az(e):(e=>{const t=Mz(e);return Az(((e,n)=>t.layout(e,n)))})(e);function Lz(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=$D(e),a=ID(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=r,n.y+=i}}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function Dz(e,t){const n=[];let r=0;t.forEach((e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)})),t.forEach(((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach((t=>{e.insertBefore(t,r)}))):(o&&o.forEach((t=>{e.appendChild(t,r)})),e.appendChild(r))})(e,t,n[r])))}function Pz(e,t){let{element:n,data:r=[],settings:i={},on:o={}}=e;const a=t.registries,s=t.logger,l=dz(t.style,t.palettes),c=[],u=ID({},e),d=function(){const e={};return EF.mixin(e),e}();let p=[],h=null,f=null,m=null,g=[],y=()=>{},b=()=>{};const v={};let x=!1;const w=function(e){let{createComponent:t}=e;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},a=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find((e=>r.hasKey&&r.key===e.key));i?r.children&&i.components&&s(r.children,i.components):(e.splice(n,1),a(r),r.children&&s(r.children,[]),r.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:s}=e;return s.map((e=>{const s=_z(t,e.key);return r.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:i,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:e.components})),s)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:r,ordered:i,rect:o,visible:a}=e;const{visible:s,hidden:l,ordered:u}=r(o,t);a.push(...s),n.push(...l),i.push(...u),s.forEach((e=>{if(e.children){var t,r;const o=Iz(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:a})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:Rz,ordered:i,rect:null,visible:a})}))};return n.destroy=()=>{r.forEach((e=>e.instance.destroy())),r=[],i=[]},n.findComponentByKey=e=>_z(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const r=[],o=[],a=[],s=Iz(t);return c({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=e=>{let{components:t}=e;i=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:r,formatters:o,scales:a}=e;s(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!a.component.has(e.type))return s.warn("Unknown component: ".concat(e.type)),!1;return{instance:Ij(a.component(e.type),{settings:e,chart:u,mediator:d,registries:a,theme:l,container:n}),settings:ID(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function S(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=r?e[t].call(u,...a):n.call(u,...a),i}}const E=()=>{let e;i.dockLayout?(s.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=i.dockLayout):e=i.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},C=S("created"),M=S("beforeMount"),_=S("mounted"),k=S("beforeUpdate"),R=S("updated"),A=S("beforeRender"),I=S("beforeDestroy"),L=S("destroyed"),D=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:r={},scales:i={},scroll:o={}}=t;y=function(e,t){let{types:n,logger:r}=t;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});i[n]=a}})),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:s,types:a.data}),n||Object.keys(v).forEach((e=>v[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),b=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:PN;const i={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=()=>r(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=ID(r,{fields:e}))}return r}}(t.collections,{dataset:y},{logger:s});const c={theme:l,logger:s};h=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vF;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:y,collection:b},OD(OD({},c),{},{scale:a.scale})),f=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ON;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(a=o.type),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(r,{dataset:y,collection:b},OD(OD({},c),{},{formatter:a.formatter})),m=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=MF(e[r],t?t[r]:null));return n}(o,m)};function P(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter((e=>!!e.key)).map((e=>e.key));g.forEach((e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()})),g=e.map((e=>{const r=e.key&&t[e.key]?t[e.key]:a.interaction(e.type)(u,d,n);return r.set(e),r}))}const O=e=>{const t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return p.forEach((e=>{const t=e.instance.getRect();Xj(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)})),a},T=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=O(e)},r=t=>{const n=e.comps||O(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=TD(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),x){x=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=O(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),x){x=!1;break}}}}),i.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},N=()=>{c.forEach((e=>{let{key:t,listener:r}=e;return n.removeEventListener(t,r)})),c.length=0},q=()=>{n.innerHTML="",(()=>{const{components:e=[]}=i;A(),D(r,i),w.set({components:e});const{visible:t,hidden:o,ordered:a}=E();p=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),Dz(n,a)})(),T(),P(i.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(r=e.data),e.settings&&(i=e.settings,P(e.settings.interactions)),k(),D(r,i);const{formatters:n,scales:o,components:a=[]}=i;w.update({components:a,data:r,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),E()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let a;e.data&&(r=e.data),e.settings&&(i=e.settings,P(e.settings.interactions)),k(),D(r,i,{partialData:t});const{formatters:s,scales:l,components:c=[]}=i;w.update({components:c,data:r,excludeFromUpdate:o,formatters:s,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],d=[];let h;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),h=u;else{const{visible:e,hidden:t,ordered:n}=E();p=e,h=e,a=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):d.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}d.forEach((e=>e.instance.beforeMount())),d.forEach((e=>e.instance.mount())),h.forEach((e=>e.instance.beforeRender())),h.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||Dz(n,a),d.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),p.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),R()},u.destroy=()=>{I(),w.destroy(),N(),P(),delete u.update,delete u.destroy,L()},u.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return p.filter((e=>null==r||e.key===r)).forEach((r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]})),i},u.findShapes=e=>{let t=[];return p.forEach((n=>{const r=n.instance.findShapes(e);t=[...t,...r]})),t},u.componentsFromPoint=e=>O(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=p;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=p.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=Lz(e,i,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const r=t.components[n].key;p.filter((e=>r===e.key)).forEach((r=>{let i=e.filter((e=>e.key===r.key));r.instance.brushFromShapes(i,t.components[n])}))}},u.scroll=function(){return function(e,t){return t[e]||(t[e]=CF()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",m)},u.dataset=e=>y(e),u.dataCollection=e=>b(e),u.scales=function(){return h.all()},u.formatters=function(){return f.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return v[e]||(v[e]=BF()),v[e]},u.scale=function(e){return h.get(e)},u.formatter=function(e){return f.get(e)},u.toggleBrushing=function(e){x=void 0!==e?e:!x},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>s,u.theme=()=>l,u.storage=Lj({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:g,on(){T(),g.forEach((e=>e.on()))},off(){N(),g.forEach((e=>e.off()))}})}),C(),n&&(M(),q(),_(n),u.element=n),u}const Oz=e=>{let t=UP(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var Tz=UP();function Nz(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}const qz=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const Fz=e=>{let{key:t,data:n,cache:r,config:i}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const r=t.split("\n"),i=r[0],o=r[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){a=n;break}}else n.test(i)&&(a=n)}}return r.map((e=>e.split(a)))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,{source:n,data:r,cache:i,config:o}=e,a=r;const s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map(((e,t)=>t)):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(r[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=d(e),r=qz(t),o=r.length>0,a=o?"measure":"dimension",s=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(vN(ID({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function jz(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[]},i={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:r}),fields:()=>r.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let r=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:a}=CN(e,t),s=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},d=[],p=n.items(),h=[];for(let t=0;t<p.length;t++){const n=p[t];if(a.filter&&!a.filter(n))continue;const r=Nz(a,n,{key:i});s.forEach((e=>{const a=o[e];let s=a.field?a.field.items()[t]:n;r[e]=Nz(a,s,{key:i})})),l&&kN({cfg:e,itemData:n,obj:r,target:d,tracker:u,trackType:c}),h.push(r)}r=l?[...r,..._N(d,{main:a,propsArr:s,props:o})]:[...r,...h]}})),r}(e,i),hierarchy:()=>null};return Fz({key:e,data:t,config:n,cache:r}),i}jz.util={normalizeConfig:CN,collect:_N,track:kN};const zz=UP();zz.default("matrix"),zz("matrix",jz),zz("default",jz);const Bz=UP();function Wz(e,t,n){return Math.max(e,Math.min(t,n))}function $z(e){let{item:t,value:n,boxCenter:r,rendWidth:i,rendHeight:o,flipXY:a,symbol:s}=e,l="x",c="y",u=i,d=o,p=n<.5?90:-90;return a&&(l="y",c="x",u=o,d=i,p=n<.5?180:0),s(ID({},t.oob,{[l]:r*u,[c]:Math.max(t.oob.size/2,Math.min(n*d,d-t.oob.size/2)),startAngle:p}))}function Hz(e){let{item:t,boxWidth:n,boxPadding:r,rendWidth:i,rendHeight:o,flipXY:a}=e,s="x",l="y",c="width",u="height",d=i,p=o;a&&(s="y",l="x",c="height",u="width",d=o,p=i);const{actualDiff:h,actualLow:f}=function(e){let{start:t,end:n,minPx:r=.1,maxPx:i=1}=e;const o=Math.max(t,n),a=Math.min(t,n),s=Wz(-.1,1.2,o),l=Wz(-.1,1.2,a),c=s*i-l*i,u=Math.max(r,c),d=(u-c)/2;return{actualDiff:u,startModifier:d,actualLow:l*i-d}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:p});return ID({},t.box,{type:"rect",[s]:(r+t.major)*d,[l]:f,[u]:h,[c]:n*d,data:t.data||{},collider:{type:null}})}function Vz(e){let{item:t,from:n,to:r,boxCenter:i,rendWidth:o,rendHeight:a,flipXY:s}=e,l="x1",c="y1",u="x2",d="y2",p=o,h=a;return s&&(l="y1",c="x1",u="y2",d="x2",p=a,h=o),ID({},t.line,{type:"line",[d]:Math.floor(n*h),[l]:i*p,[c]:Math.floor(r*h),[u]:i*p,data:t.data||{},collider:{type:null}})}function Gz(e){let{item:t,key:n,position:r,width:i,boxCenter:o,rendWidth:a,rendHeight:s,flipXY:l}=e,c="x1",u="y1",d="x2",p="y2",h=a,f=s;l&&(c="y1",u="x1",d="y2",p="x2",h=s,f=a);const m=i/2;return ID({type:"line"},t[n],{[u]:Math.floor(r*f),[c]:(o-m)*h,[p]:Math.floor(r*f),[d]:(o+m)*h,r:m*h,cx:o*h,cy:r*f,width:i*h,data:t.data||{},collider:{type:null}})}function Uz(e,t,n){const{width:r,maxWidthPx:i,minWidthPx:o}=t.box,a=e>=0?1:-1;let s=Math.min(a*e*r,isNaN(i)?n:i/n);return s=isNaN(o)?s:Math.max(o/n,s),s*a}Bz("native",(function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach((e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function c(){a.forEach((e=>{let{key:t,listener:r}=e;n.removeEventListener(t,r)})),a=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,r=null}}}));const Yz={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},Kz=Object.keys(Yz),Xz={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:r}=this.rect,i="horizontal"===this.settings.settings.orientation,{style:o,resolver:a,symbol:s}=this,l=Kz.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=Yz[e]));const u=function(e){let{keys:t,data:n,defaultSettings:r,style:i,settings:o,width:a,height:s,resolver:l}=e;const c=ID(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},d=o.major;let p;p="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:ID(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:ID(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const h=o.minor||{},f={};["start","end","min","max","med"].forEach((e=>{(h[e]||n.items&&n.items.length&&n.items[0][e])&&(f[e]={scale:h.scale,ref:e})}));let m,g={major:p,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:ID(!0,{},f,h)})};for(let e=0,r=t.length;e<r;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:r,resolver:a}),{settings:d,items:p}=u,h=function(e){let{width:t,height:n,flipXY:r,resolved:i,keys:o,symbol:a}=e;const s=[],l=i.major.items;if(!l.length)return s;const c=t,u=n,d=r?n:t,p=i.major.settings,h=["start","end","min","max","med"].filter((e=>void 0!==i.minor.settings[e])),f=h.length,m=o.filter((e=>"oob"!==e));let g,y,b,v,x,w,S,E,C;const M=o?o.length:0,_=m?m.length:0,k={box:function(){b.box&&ND(b.start)&&ND(b.end)&&g.push(Hz({item:b,boxWidth:v,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){ND(b.min)&&ND(b.start)&&g.push(Vz({item:b,from:b.min,to:b.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),ND(b.max)&&ND(b.end)&&g.push(Vz({item:b,from:b.max,to:b.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){b.median&&ND(b.med)&&g.push(Gz({item:b,key:"median",position:b.med,width:v,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(b.whisker){const e=v*b.whisker.width;ND(b.min)&&g.push(Gz({item:b,key:"whisker",position:b.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),ND(b.max)&&g.push(Gz({item:b,key:"whisker",position:b.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))}}};function R(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<f;r++)e=b[h[r]],ND(e)&&(t<e&&(t=e),n>e&&(n=e));S=t<0&&t!==-Number.MAX_VALUE,E=n>1&&n!==Number.MAX_VALUE,C=S||E}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let h=null,f=null;void 0!==p.binStart?(h=t.binStart,f=t.binEnd,y=p.binStart.scale):(y=p.major.scale,h=y?t.major:0);let A=0;y?y.bandwidth?(A=y.bandwidth(),h-=A/2):A=f-h:A=1,b=ID({},{major:h,majorEnd:f},i.minor.items[e]);for(let t=0;t<M;t++)b[o[t]]=i[o[t]].items[e];if(v=Uz(A,b,d),x=(A-v)/2,w=x+b.major+v/2,R(),C)b.oob&&(S?g.push($z({item:b,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})):E&&g.push($z({item:b,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})));else for(let e=0;e<_;e++)b[m[e]]&&!1===b[m[e]].show||k[m[e]]();const I={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(I)}return s}({width:n,height:r,flipXY:i,resolved:u,keys:l,symbol:s});return h}};const Jz={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},Zz=/px$/,Qz={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},eB={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function tB(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function nB(e,t,n,r){let{width:i,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,a=Zz.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);qD(a)&&(t=Jz,a=n.min+t.size*(n.max-n.min));const[s,l]=function(e){let t=Qz.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=OD(OD({},l),{},{type:s,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(c.width=t.width);const u=r(c);return u.data=e.data,u}))}const rB={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:ID({},Qz,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:r,height:i}=this.rect,o=ID({},eB,this.settings.settings.sizeLimits),a=n.items,s=function(e,t,n,r,i){const o=tB(e?e.scale:void 0,n),a=tB(t?t.scale:void 0,r);let s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,r,i,o);return nB(a,this.rect,s,this.settings.shapeFn||this.symbol)}};const iB={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function oB(e,t,n,r){let{x:i,y:o,width:a,height:s}=t;const l=gP(),c={x:i+a/2,y:o+s/2},u=Math.min(a,s)/2,d=Math.min(a,s)/2,p=d/100;return e.map(((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,a=u*i.innerRadius,s=p*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;const h=l.centroid(e),f=i.offset?function(e,t,n,r){let[i,o]=e;const a=Math.sqrt(i*i+o*o);i/=a,o/=a;const s=n-r;return{x:i*t*s,y:o*t*s}}(h,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(f.x,", ").concat(f.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+f.x,y:c.y+f.y}}},i}))}function aB(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const sB={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],r=[],i=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:ID({},iB,this.style.slice),settings:i.slice});let a=0;for(let e=0,t=o.length;e<t;e++){const t=aB(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),a+=t)}const s=function(){var e=EP,t=SP,n=null,r=JD(0),i=JD(lP),o=JD(0);function a(a){var s,l,c,u,d,p=a.length,h=0,f=new Array(p),m=new Array(p),g=+r.apply(this,arguments),y=Math.min(lP,Math.max(-lP,i.apply(this,arguments)-g)),b=Math.min(Math.abs(y)/p,o.apply(this,arguments)),v=b*(y<0?-1:1);for(s=0;s<p;++s)(d=m[f[s]=s]=+e(a[s],s,a))>0&&(h+=d);for(null!=t?f.sort((function(e,n){return t(m[e],m[n])})):null!=n&&f.sort((function(e,t){return n(a[e],a[t])})),s=0,c=h?(y-p*v)/h:0;s<p;++s,g=u)l=f[s],u=g+((d=m[l])>0?d*c:0)+v,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:u,padAngle:b};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:JD(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:JD(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:JD(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:JD(+e),a):o},a}().sortValues(null);s.startAngle(i.startAngle),s.endAngle(i.endAngle),s.padAngle(i.padAngle);return oB(s(n),ID({},this.rect,{x:0,y:0}),r,a)}};const lB=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class cB{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[cB.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const a=cB.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return r&&lB(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function uB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cB(...t)}function dB(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const pB={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=uB(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,QF(this,"x",this.rect.width),QF(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=ID({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=ID({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=dB(this.x,this.rect.width),this.lines.y=dB(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>ID(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,r=this.lines[t].filter((e=>!!e.isMinor===n)),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach((e=>{let n=e.data;var r,i;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function hB(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function fB(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return t+=i?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function mB(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function gB(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function yB(e){let{chart:t,blueprint:n,renderer:r,p:i,settings:o,items:a,slopeLine:s}=e,l=!0,c=!1,u=!1,d=!1,p=!1,h=ID(!0,{},o.style.line,i.line||{}),f=ID(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:h.stroke});if(c=s?n.processItem({type:"line",x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,stroke:h.stroke||"black",strokeWidth:h.strokeWidth||1,strokeDasharray:h.strokeDasharray,flipXY:!1,value:i.valueInfo?i.valueInfo.id:i.value}):n.processItem({type:"line",x1:i.position,y1:0,x2:i.position,y2:1,stroke:h.stroke||"black",strokeWidth:h.strokeWidth||1,strokeDasharray:h.strokeDasharray,flipXY:i.flipXY||!1,value:i.valueInfo?i.valueInfo.id:i.value}),i.label){const e=ID(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:h.stroke},i.label);let s,c={width:0,height:0},f="";s=mB(i,t),!1!==i.label.showValue&&(s?f=" (".concat(s(i.value),")"):i.scale&&(f=" (".concat(i.value,")"))),f&&(c=r.measureText({text:f,fontFamily:e.fontFamily,fontSize:e.fontSize}));let m=r.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:m.width+c.width,height:Math.max(m.height,c.height)},y=e.padding,b=gB(i.flipXY?e.vAlign:e.align),v=gB(i.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*n.width,e.maxWidthPx),w=g.height+2*y,S=i.flipXY?w:x,E=i.flipXY?x:w;if(u=n.processItem({fn:t=>{let{width:r,height:o}=t,a=i.position*r-(i.flipXY?w:x)*(1-b);a=i.flipXY?a:Math.max(a,0);return{type:"rect",x:a,y:Math.max(Math.abs(v*o-E*v),0),width:i.flipXY?S:Math.min(S,n.width-a),height:E,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:i.flipXY||!1}),u.x<-1||u.x+u.width>n.width+1||u.y<-1||u.y+u.height>n.height+1)u=void 0;else{d={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:u.x+y,y:u.y+u.height/2+g.height/3,maxWidth:u.width-2*y-c.width,anchor:"start"},f&&(p={type:"text",text:f||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:d.x+3+(u.width-(c.width+2*y)),y:d.y});for(let e=0,t=a.length;e<t;e++){let t=a[e];"rect"===t.type?Yj(u,t)&&(l=!1):"line"===t.type&&i.flipXY===t.flipXY&&Jj(u,t)&&(l=!1)}}}if(a.push(c),0!==(null==s?void 0:s.slope)&&(null!=s&&s.showLabel||null!=s&&s.showValue)){let e,o;const l=120;let u=s.showLabel?s.refLineLabel:"";if(s.showValue){const n=mB(i,t),r=n?n(s.value):s.value;e="(".concat(s.slope,"x + ").concat(r,")"),u+=s.refLineLabel?" ".concat(e):e}if(u.length>1){var m;const e=r.measureText({text:u,fontFamily:f.fontFamily,fontSize:f.fontSize});e.width=e.width>l?l:e.width;const i=s.slope>0&&!s.isRtl?4*f.padding:f.padding/2,d=s.slope>0?3*f.padding:f.padding,p=function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});if(t>0){if(r.max()*t+n>=i.max())return!0}else if(t<0&&r.max()*t+n<=i.min())return!0;return!1}(t,s.slope,s.value)?function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});return r(t<0?(i.min()-n)/t:(i.max()-n)/t)}(t,s.slope,s.value):void 0,g=void 0===p?Math.abs(c.y2):1,y=function(e,t,n,r,i,o){return e.slope>0?n<.8?e.isRtl?n*i.width-(r.width+o.padding):n*i.width:n>.8?e.isRtl?n*i.width+(r.width+2*o.padding):n*i.width-(r.width+6*o.padding):1===n?e.isRtl?n*i.width+(r.width+3*o.padding):n*i.width-(r.width+6*o.padding):t.x2-(r.width+2*o.padding):e.isRtl?t.x1-(r.width+2*o.padding):t.x1}(s,c,p,e,n,f),b=s.slope>0?g:c.y1;s.labelStroke&&(o={type:"rect",x:s.isRtl?Math.max(y,i)-2:Math.max(y,i)+2,y:Math.abs(Math.max(b,d)-e.height),rx:3,ry:3,width:e.width+f.padding,height:e.height-2,stroke:h.stroke,fill:h.stroke});const v={type:"text",text:u,fill:null!==(m=s.labelStroke)&&void 0!==m?m:h.stroke,opacity:f.opacity,fontFamily:f.fontFamily,fontSize:f.fontSize,x:o?o.x+2:Math.max(y,i)+2,y:o?o.y+e.height-f.padding:Math.abs(Math.max(b,d)-f.padding/2),anchor:"start",title:u,maxWidth:l,width:e.width};(function(e,t,n,r,i,o,a){for(let s=0,l=e.length;s<l;s++){const l=e[s];if("text"===(null==l?void 0:l.type))if(n>0&&void 0!==i){if(Math.abs(l.x-t.x)<l.width+o&&Math.abs(l.y-t.y)<r.height+a)return!0}else if(Math.abs(l.y-t.y)<r.height+a)return!0}return!1})(a,v,s.slope,e,p,i,d)||(o&&a.push(o),a.push(v))}}l&&u&&d&&(a.push(u,d),p&&a.push(p))}function bB(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function vB(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function xB(e,t){const n=e.min();if(n===e.max()){const r=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}const wB={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=uB(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(vB).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=xB(t,e.value);return ID(e,{scale:t,position:n})}return ID(e,{position:e.value})})),this.lines.y=this.lines.y.filter(vB).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=xB(t,e.value);return ID(e,{scale:t,position:n,flipXY:!0})}return ID(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(bB(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(bB(e)),!1))));let n=[];return[...this.lines.x,...this.lines.y].forEach((r=>{if(!0===r.show||void 0===r.show){let i;if(r.slope&&0!==r.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max();i=OD({},r),i.x1=xB(e,o),i.x2=xB(e,a);const s=o*r.slope+r.value,l=a*r.slope+r.value;if(i.y1=xB(n,s),i.y2=xB(n,l),i.y1>1&&i.y2>1)return r.slope,void t["y".concat(i.y1>1?1:0)].push(bB(r));if(i.y1<0)return void t["y".concat(i.y1>1?1:0)].push(bB(r))}else i=void 0;yB({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:r,settings:e,items:n,slopeLine:i})}})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:r,items:i}=e;const o=Object.keys(n);let a=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],s=n[r];if(s.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:r,height:i}=t,u=e*r+("1"===e?-o:o),d=n?l:i-l;return"arc"===a.type?{type:"path",d:hB(n?d:u,n?u:d,a.width,c),x:u,y:d,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),d=u.cx||u.x,p=u.cy||u.y,h={type:"text",text:s.length||"",x:d-.4*a.width,y:p+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},f={type:"path",d:fB(d,p,a.width,c),x:d,y:p,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(u,h,f)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function SB(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){ID(e,t.style)}(t,e),t}function EB(e){return"string"==typeof e||"number"==typeof e?e:"-"}function CB(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map((e=>wj(e,r,{x:t.x,y:t.y}))),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},p=r>=0?[u,d]:[d,u];c.push(...p),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function MB(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function _B(e,t){var n,r;const i={type:"text",text:EB(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+MB(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+MB(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,a=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,a=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>r&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){const n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),CB(e,i,t),i}function kB(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){ID(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function RB(e){return!e.isMinor&&e.position>=0&&e.position<=1}function AB(e){let{rect:t,state:n,majorTicks:r,measure:i,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:r,state:i}=e;const o="layered"===i.labels.activeMode?2:1,a=r.width,s=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*a*Math.abs(n.start-n.end)<s[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:r}=e;const i=r.height,o=n("M").height;return!(t.length<2)&&i*Math.abs(t[0].position-t[1].position)<o}({majorTicks:r,measureText:i,rect:t})}function IB(e){let{value:t,maxValue:n,minValue:r,range:i,modifier:o}=e;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function LB(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:d}=a.labels;if(a.labels.show){const e=a.align,p="top"===e||"bottom"===e,h=p?n.inner.width:n.inner.height,f=o.ticks({settings:a,distance:h,formatter:r}).filter(RB),m=e=>{const t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=IB({value:t.width,maxValue:u,minValue:d}),t};if(t&&p&&"auto"===a.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:r,state:i,settings:o}=e;const a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,p=0;if(isNaN(a))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(p=s*u*Math.abs(r.start-r.end),o+c>p)return!0}else{const e=t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0);if(p=s*u*e,d=n("M").width*l*a,d+c>p)return!0}return!1}({majorTicks:f,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&AB({rect:n.inner,state:s,majorTicks:f,measure:m,horizontal:p})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>IB({value:t.width,maxValue:u,minValue:d})*Math.sin(e)+t.height*Math.cos(e)}else g=p?e=>e.height:e=>IB({value:e.width,maxValue:u,minValue:d});if(p&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=f.map((e=>e.label));else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const b=y.map(m),v=b.map(g),x=Math.max(...v,0);if(l+=x,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=f[r]?f[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...b.map(i).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:r,bleedSize:i,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:f,measureText:m,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const DB=(e,t,n)=>e.width*Math.abs(t.position-n.position);function PB(e){let{layered:t,major:n,innerRect:r,outerRect:i,tick:o,index:a}=e;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?DB(r,o,l)/2-2:1/0,d=c?DB(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,d):(e=>{let{innerRect:t,outerRect:n,tick:r,prevWidth:i}=e;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:r,nextWidth:i}=e;const o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function OB(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function TB(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=OB(e)+e.labels.margin,t}function NB(e,t){return e.map((e=>kB(e,t)))}function qB(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function FB(e){let{textMetrics:t,settings:n,innerRect:r,scale:i,tilted:o,layered:a,tick:s}=e;const l=t.height,c=qB(i,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-TB(n)-n.paddingEnd;else if(a)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-TB(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=IB({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function jB(e){let{textMetrics:t,settings:n,innerRect:r,outerRect:i,tilted:o,layered:a,tick:s,index:l,major:c}=e;const u=t.height,d={width:0,height:u};if("left"===n.align||"right"===n.align)d.width=r.width-TB(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-TB(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=PB({layered:a,major:c,innerRect:r,outerRect:i,tick:s,index:l});return d.width=IB({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function zB(e){let t;function n(){return t=jB,n}function r(){return t=FB,r}function i(e){let{settings:n,scale:r,innerRect:i,outerRect:o,measureText:a,ticks:s,state:l,textBounds:c}=e;const u=[],d=function(e){return e.filter((e=>!e.isMinor))}(s),p=function(e){return e.filter((e=>e.isMinor))}(s),h={innerRect:i,align:n.align,outerRect:o},f="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.line.show&&(h.style=n.line,h.padding=n.paddingStart,u.push(SB(h))),n.ticks.show&&(h.style=n.ticks,h.tickSize=n.ticks.tickSize,h.padding=OB(n),g=NB(d,h)),n.labels.show){const e=TB(n);h.style=n.labels,h.padding=e,h.tilted=f,h.layered=m,h.angle=n.labels.tiltAngle,h.paddingEnd=n.paddingEnd,h.textBounds=c;const s=(e,s)=>{h.textRect=function(e){let{style:t,measureText:n,tick:r}=e;return n({text:r.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:h.style});const l=t({textMetrics:h.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:f,layered:m,tick:e,major:d,index:s});h.maxWidth=l.width,h.maxHeight=l.height,h.stepSize=function(e){let{innerRect:t,scale:n,settings:r,tick:i}=e;return("top"===r.align||"bottom"===r.align?t.width:t.height)*qB(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=_B(e,t);return i.data=e.data,i}))}(d,h,s):function(e,t,n,r){const i=t.padding,o=TB(n);return e.map(((e,a)=>{r(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;const l=_B(e,t);return l.data=e.data,l}))}(d,h,n,s),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>Yj(HD(1,e[t].boundingRect),HD(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,h),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&p.length>0&&(h.style=n.minorTicks,h.tickSize=n.minorTicks.tickSize,h.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...NB(p,h))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const BB={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},WB={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const $B={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:r}=e;const i=ID(!0,{},t.isDiscrete?BB:WB,n),o=ID(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:s,paddingEnd:l}=o;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=zB(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:r}=this,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=ej(r,i);const o=function(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s}=e,l=0;const{size:c,edgeBleed:u,isToLarge:d}=LB({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s});if(l+=c,d)return{size:l};if(a.ticks.show&&(l+=a.ticks.margin,l+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>l&&(l=e)}if(a.line.show){const e=a.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(e)}return l+=a.paddingStart,l+=a.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,r=ID({},t,function(e){let{align:t,inner:n}=e;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return ID(this.state.innerRect,r),ID(this.state.outerRect,i),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=ej(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),lB.multiple(t),t}};const HB={render:()=>[]};function VB(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));r=e.join(t)}return r}function GB(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const UB={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=VB(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const{title:e,definitionSettings:t,rect:n}=this,r=[];return r.push(function(e){let{title:t,definitionSettings:n,dock:r,rect:i,measureText:o,style:a}=e;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:GB(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};ID(s,a.text);const l=o(s);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),s.x=e,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),s.y=e,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;s.transform="rotate(".concat(t,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate(e){e.settings&&(ID(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=VB(t,n,this.scale)}};function YB(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[i?"x":"y"];if(r&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),r=l.startScroll+e;s.moveTo(r)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function KB(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const XB={require:["chart","renderer"],on:{panStart(e){const t=KB(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=YB(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=KB(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=KB(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=KB(e,this.renderer);YB(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[r?"left":"top"]:"".concat(s,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function JB(e){let{h:t,isVertical:n,value:r,pos:i,align:o,borderHit:a,state:s,idx:l}=e;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,p="100%",h="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(p="".concat(s.targetRect.x+s.targetRect.width,"px"),h="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(d=n?s.targetRect.x:s.targetRect.y,p="".concat(s.rect.width-d,"px"),h="".concat(s.rect.height-d,"px")),c||(i-=a),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:i,"px"),top:"".concat(n?i:d,"px"),height:n?"".concat(a,"px"):h,width:n?p:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:ID({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function ZB(e){let{h:t,isVertical:n,label:r,otherValue:i,rangeIdx:o,idx:a,pos:s,align:l,state:c,value:u}=e;const d="end"!==l,p="outside"===c.settings.bubbles.placement;let h,f="none";n?(h=d?"left":"right",p&&(f=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(h=d?"top":"bottom",p&&(f=d?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const b=m?t("input",{type:"text",value:u,style:OD(OD({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":a,style:g},[r]);return t("div",{style:{position:"absolute",[h]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:f}},[b])}function QB(e){let{h:t,isVertical:n,top:r,height:i,color:o,on:a,opacity:s}=e;return t("div",ID({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function eW(e){let{borderHit:t,els:n,isVertical:r,state:i,vStart:o,vEnd:a,idx:s}=e,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,d=c?i.scale.norm(a)*i.size:a,p=Math.abs(u-d),h=Math.min(u,d)+l,f=h+p;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,s=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(a)*t:a,u=Math.abs(s-l),d=Math.min(s,l),p={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(p.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[QB(p)]))}const m=u<d?o:a,g=u<d?a:o,[y,b]=c?i.scale.domain():[Math.min(o,a),Math.max(o,a)],v=m+1e-5>=y&&m-1e-5<=b,x=g-1e-5<=b&&g+1e-5>=y;v&&n.push(JB({h:i.h,isVertical:r,borderHit:t,value:m,pos:h,align:"start",state:i,idx:s})),x&&n.push(JB({h:i.h,isVertical:r,borderHit:t,value:g,pos:f,align:"end",state:i,idx:s}));const w=i.settings.bubbles;if(w&&w.show){w.fontSize,w.fontFamily,w.fill;const e=[o,a];v&&n.push(ZB({h:i.h,isVertical:r,align:w.align,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:h,state:i})),x&&n.push(ZB({h:i.h,isVertical:r,align:w.align,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:f,state:i}))}}function tW(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function nW(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((r,i)=>{e.active&&i===e.active.idx||eW({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})})),e.active){let r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{const t=tW(e);r=e.active.start+t,i=e.active.end+t}eW({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function rW(e){return{min:e.scale.min(),max:e.scale.max()}}function iW(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function oW(e,t,n){let r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function aW(e){e.renderer.render(nW(e))}function sW(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}function lW(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let a=0;a<i.length;++a){const s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function cW(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function uW(e){const t=e.reduce(((e,t)=>(e.push(...zD(t.bounds)),e)),[]);return BD(t)}const dW={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=sW(this.state,this.state.brushInstance),this.state.active=null,aW(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=ej(this.chart.scale(t.scale),r);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){const r=uW(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=ej(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=uW(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)})),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,r){let i=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=OD({},i[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)}))}(this.state,e,t,n),this.emit("bubbleEnd"),aW(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,aW(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=i;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=rF(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>cW(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(lW(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=BF(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach((e=>{if(!cW(r,[e.min,e.max]))return;const o=n.indexOf(lW(e.min,t)),a=n.indexOf(lW(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))})),i}(e,i);return this.state.ranges=sW(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[nW(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;t.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=ID({},r.element().getBoundingClientRect());const u=a-t.offset.left,d=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);const p=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(h/t.size),c.start=t.scale.normInvert(p/t.size);let f=t.ranges;const m=rW(t);let g,y,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),m.min=b>0?f[b-1].max:m.min,m.max=b+1<f.length?f[b+1].min:m.max;else{for(g=0;g<f.length;g++){if(f[g].min<=c.start&&c.start<=f[g].max){b=g,m.min=g?f[g-1].max:m.min,m.max=g+1<f.length?f[g+1].min:m.max;break}if(c.start<f[g].min){m.max=f[g].min,m.min=g?f[g-1].max:m.min;break}}-1===b&&f.length&&g>=f.length&&(m.min=f[f.length-1].max)}if(-1!==b||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==b)if(y={idx:b,start:f[b].min,end:f[b].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(p-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(p-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!Xj(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:sW,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=rW(e);oW(e,e.current,n)}(this.state,sW),aW(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=tW(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let r=sW(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter((e=>-1===i.indexOf(e))),s=i.filter((e=>-1===o.indexOf(e))),l=a.map((e=>({key:n.id(),value:e}))),c=s.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),aW(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(r.rangeIdx)||JSON.stringify(r)===JSON.stringify(this.state.edit))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;aW(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function pW(e){e.renderer.render(nW(e))}function hW(e){return e.rc.ranges()}function fW(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const mW={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,r=this.state.rect[0===n?"height":"width"],i=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),a=o[0]?o.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)})),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=AF(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const r=Math.min(...n),i=Math.max(...n),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce(((n,i)=>{const o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i})),l=e.settings.brush.components.reduce(((e,t)=>e.key===s.key?e:t));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=a-t.offset.left,d=s-t.offset.top,p=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let f=h,m=p;c.start=p,c.current=h;let g=t.ranges;const y=iW(t);let b,v,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(b=0;b<g.length;b++){if(g[b].min<=m&&m<=g[b].max){x=b,y.min=b?g[b-1].max:y.min,y.max=b+1<g.length?g[b+1].min:y.max;break}if(m<g[b].min){y.max=g[b].min,y.min=b?g[b-1].max:y.min;break}}-1===x&&g.length&&b>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(v={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let e=v.start,t=v.end;Math.abs(p-e)<=o?(c.start=v.end,v.mode="modify"):Math.abs(p-t)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:m,end:f,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=v,"modify"!==v.mode&&t.targetRect&&!Xj(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:hW,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=iW(e);oW(e,e.current,n)}(this.state,hW),pW(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=tW(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach((t=>{n=[...n,...fW(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),pW(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function gW(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}(e).map((i=>{const o=e.scale(i.min)*n,a=e.scale(i.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?r:l,y:t?s:0,height:t?l:r}}))}function yW(e,t,n,r){function i(){!function(e){e.renderer.render(gW(e))}(e)}function o(){!function(e){e.renderer.render(gW(e))}(e)}function a(){!function(e){e.renderer.render(gW(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function bW(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const vW={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=ej(this.chart.scale(e.scale),r);return bW(this.state),yW(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,gW(this.state)},beforeDestroy(){bW(this.state)}};function xW(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function wW(e,t,n){return bj(e,t.points[0])<n.settings.snapIndicator.threshold**2}function SW(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function EW(e){let{state:t,start:n=null,end:r=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==r&&(t.snapIndicator.x2=r.x,t.snapIndicator.y2=r.y)}function CW(e,t){e.snapIndicator.visible=t}const MW={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})))}(this.settings);const n=xW(this.state.rendererBounds,e);SW(this.state,n),EW({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=xW(this.state.rendererBounds,e);wW(t,this.state,this.settings)?CW(this.state,!0):CW(this.state,!1),SW(this.state,t),EW({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;CW(this.state,!1);wW(xW(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map((e=>({x:e.x+n,y:e.y+r}))),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function _W(e,t,n,r,i){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=i(t[l]),o[n]+o[r]<e[n]?a=l+1:s=l}return a}function kW(e){let{orientation:t,targetNodes:n,labels:r,container:i}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_W;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:d,node:p}=r[t];if(d[s]<i[s]||d[s]+d[l]>i[s]+i[l])return!1;for(let e=o(d,a,s,l,c);e<a.length;e++)if(Yj(d,a[e].textBounds))return!1;const h=o(d,n,s,l,u),f=d[s]+d[l];for(let e=h;e<n.length;e++){const t=n[e].node;if(f<t.localBounds[s])break;if(Yj(d,t.localBounds)&&p!==t)return!1}return a.push(r[t]),!0}}const RW=4;function AW(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function IW(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function LW(e){return OD(OD({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function DW(e,t,n){return n?e.width>=t.height:e.width>=t.width}function PW(e,t,n){return n?e.height>=t.width:e.height>=t.height}function OW(e,t,n,r,i){let o,a;return"v"===e?(o=r||i||DW(t,n,!0),a=PW(t,n,!r)):(o=DW(t,n),a=i||PW(t,n,!1)),o&&a}function TW(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function NW(e,t,n){const r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return DW(e,t,n.rotate)&&PW(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=TW(e.x,e.width,i.height,n.align)+o,r.y=TW(e.y,e.height,i.width,n.justify),r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=TW(e.x,e.width,i.width,n.align),r.y=TW(e.y,e.height,i.height,n.justify)+o),r}function qW(e){let{bar:t,view:n,direction:r,position:i,padding:o=RW}=e;const a={};if(ID(a,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(a.y=0,a.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(a.y=o,a.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(a.x=0,a.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(a.x=o,a.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(a,n),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{top:n=RW,bottom:r=RW,left:i=RW,right:o=RW}=t;e.x+=i,e.width-=i+o,e.y+=n,e.height-=n+r}(a,o),a}function FW(e){let t,n,r,i,o,{direction:a,fitsHorizontally:s,measured:l,node:c,orientation:u,placementSettings:d,rect:p}=e,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qW;const f=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=h({bar:c.localBounds,view:p,direction:a,position:r.position,padding:r.padding}),f.push(i),t=!o||i[m]>t[m]?i:t,OW(u,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=f.indexOf(n)),r=d[o],{bounds:n,placement:r}}function jW(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=RW,bottom:a=RW,left:s=RW,right:l=RW}=i,c=e.x+e.dx,u=e.y+e.dy,d=n?Math.min(t.width,r.height):Math.min(t.height,r.width),p=n?Math.min(t.height,r.height):Math.min(t.width,r.width),h=.5*t.height,f=1e-9;return{x:(n?c-h:c)-s-f,y:(n?u:u-h)-o-f,width:p+(s+l)-f,height:d+(o+a)-f}}function zW(e){let{chart:t,targetNodes:n,rect:r,fitsHorizontally:i,collectiveOrientation:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:FW,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NW,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:kW;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,p,h,f,m,g,y,b,v,x,w,S,E,C;for(let e=0,l=n.length;e<l;e++){g=null,p=n[e],h=p.node,E=AW(h,t),v=p.direction,C="left"===v||"right"===v?"h":"v";for(let t=0;t<p.texts.length;t++){if(f=p.texts[t],!IW(f))continue;x=p.labelSettings[t],b=p.measurements[t],S=x.placements;const n=a({direction:v,fitsHorizontally:i,lblStngs:x,measured:b,node:h,orientation:C,placements:S,placementSettings:p.placementSettings[t],rect:r});if(g=n.bounds,w=n.placement,g&&w){m=w.justify;const t="function"==typeof x.linkData?x.linkData(E,e):void 0,n="function"==typeof w.overflow?w.overflow(E,e):w.overflow;"up"===v&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===v&&(m=1-m);const r=!("h"===o||i);if(d=s(g,f,{justify:"h"===C?w.align:m,align:"h"===C?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:b,rotate:r,overflow:!!n}),d){const n=jW(d,b,r,g,w.padding);y="function"==typeof w.fill?w.fill(OD(OD({},E),{},{textBounds:n}),e):w.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof w.background&&(d.backgroundColor="function"==typeof w.background.fill?w.background.fill(OD(OD({},E),{},{textBounds:n}),e):w.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=jW(d,b,r,g,w.background.padding))),c.push(d),u.labels.push({node:h,textBounds:n})}}}}const M=c.filter(l(u));return[...M.filter((e=>void 0!==e.backgroundBounds)).map(LW),...M]}function BW(e){const t=2*Math.PI;return(e%t+t)%t}function WW(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function $W(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function HW(e,t,n){let{x:r,y:i}=t;if(r*r+i*i>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function VW(e){let t,n,{radius:r,size:i,angle:o}=e,{width:a,height:s}=i,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=HW(r,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=HW(r,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=HW(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=HW(r,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function GW(e){let{slice:t,measured:n,padding:r}=e,{start:i,end:o,innerRadius:a,outerRadius:s}=t,l=s-a-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>a&&(l=s-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=BW((i+o)/2);let d=s-r,p={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(p.angle=u-Math.PI/2,p.anchor="end"):(p.angle=u+Math.PI/2,p.anchor="start"),p}function UW(e){let{context:t,node:n,bounds:r}=e;let{start:i,end:o}=n.desc.slice;const a=BW((i+o)/2);switch(Math.floor(a/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function YW(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function KW(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function XW(e){let t,n,{slice:r,direction:i,position:o,padding:a,measured:s,view:l,context:c,store:u}=e,{start:d,end:p,innerRadius:h,offset:f}=r;switch(o){case"into":t="rotate"===i?GW({slice:r,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:r}=e,{start:i,end:o,innerRadius:a,outerRadius:s}=t;const l=BW((i+o)/2);let c=VW({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",Jj(c,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||Jj(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||Wj({cx:0,cy:0,r:a},c)?null:(WW(c,n),c)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:p,innerRadius:0,outerRadius:h},t="rotate"===i?GW({slice:n,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:r,store:i}=e;const{start:o,end:a,outerRadius:s}=t,l=BW((o+a)/2);let c=VW({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",WW(c,n),i.insideLabelBounds.some((e=>Yj(e,c)))?null:(i.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":t="rotate"===i?function(e){let{slice:t,measured:n,padding:r,view:i}=e,{start:o,end:a,outerRadius:s,offset:l}=t,c=s+r,u=a-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=BW((o+a)/2);let p=Math.sin(d)*c,h=-Math.cos(d)*c,f=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=h<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;t<f&&(f=t)}if(Math.sin(m)>.001){let e=p<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;t<f&&(f=t)}if(f<=0||f<n.minReqWidth)return null;let g={x:p,y:h,width:f,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:s,padding:a,view:l}):function(e){let{slice:t,measured:n,padding:r,view:i,context:o}=e,{start:a,end:s,outerRadius:l,offset:c}=t;const u=BW((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),i))return null;let d=l+r+n.height/2,p=Math.sin(u)*d,h=-Math.cos(u)*d,f=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(p+c.x));e<f&&(f=e)}else{let e=Math.abs(i.x-(p+c.x));e<f&&(f=e)}if(f<n.minReqWidth)return null;let m={x:p,y:h,width:f,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=f.x,t.y+=f.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const{start:r,end:i,offset:o,outerRadius:a}=n,s=BW((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,r)),t}function JW(e){let{context:t,direction:n,measured:r,node:i,placementSettings:o,rect:a,store:s}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:XW;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function ZW(e,t,n){const r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}const QW=/\n+|\r+|\r\n/,e$=/\s/,t$=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function n$(e){return"string"==typeof e?-1!==e.search(QW):-1!==String(e).search(QW)}function r$(e){return-1!==e.search(e$)}function i$(e){return-1!==e.search(t$)}function o$(e,t,n){return Math.max(t,Math.min(n,e))}function a$(){let{string:e,separator:t="",reverse:n=!1,measureText:r=e=>({width:e.length,height:1}),mandatoryBreakIdentifiers:i=[n$],noBreakAllowedIdentifiers:o=[],suppressIdentifier:a=[r$,n$,e=>""===e],hyphenationIdentifiers:s=[i$]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let d=n?c:-1;function p(e){const t=o$(e,0,c-1),n=l[t],u=r(n),d=function(e,t,n,r,i){return r.some((r=>r(e,t,n)))?1:i.some((r=>r(e,t,n)))?0:2}(n,t,l,i,o);return{index:t,value:n,breakOpportunity:d,suppress:a.some((e=>e(n,t,l))),hyphenation:s.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?d--:d++:d=o$(e,0,c-1),u(d)?p(d):{done:!0}},peek:p,length:c}}const s$="…",l$=/^\s*\d+(\.\d+)?px\s*$/i;function c$(e){return"string"===typeof e&&l$.test(e)}function u$(e){const t=e["font-size"]||e.fontSize;return c$(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function d$(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=u$(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function p$(e,t){return{lines:[],line:"",width:0,maxLines:d$(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function h$(e){e.lines.push(e.line),e.line="",e.width=0}function f$(e,t){e.line+=t.value,e.width+=t.width}function m$(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function g$(e,t,n){const r=a$({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?m$(e,t,r):t,h$(e),f$(e,t)):f$(e,t)}}function y$(e,t){const n=a$({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=p$(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){h$(r),i=!1;break}1===e.breakOpportunity?h$(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?m$(r,e,n):e,h$(r),f$(r,e)):f$(r,e)}return{lines:r.lines,reduced:i}}function b$(e,t){const n=a$({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=p$(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){h$(r),i=!1;break}1===e.breakOpportunity?h$(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?h$(r):e.width>r.maxWidth?g$(r,e,t):(h$(r),f$(r,e)):f$(r,e)}return{lines:r.lines,reduced:i}}function v$(e){return{"break-all":y$,"break-word":b$}[e.wordBreak]}function x$(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=v$(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||n$(n.text)){const o=(u$(n)-i.height)/2,a=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach(((a,s)=>{const l=ID({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=s$:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)})),i}(a,n,o,i.height)}}}}function w$(e,t){let{text:n,"font-size":r,"font-family":i,maxWidth:o}=e;if(n="string"==typeof n?n:"".concat(n),void 0===o)return n;let a=t({text:n,fontSize:r,fontFamily:i}).width;if(a<=o)return n;let s=0,l=n.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:n.substr(0,e)+s$,fontSize:r,fontFamily:i}).width,a<=o?s=e+1:l=e-1}return n.substr(0,l)+s$}function S$(e){const t=e.baseline||e["dominant-baseline"];let n=0;const r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}const E$={},C$={},M$={fontSize:void 0,fontFamily:void 0};let _$;function k$(e,t,n){const r=e+t+n;return"number"!=typeof C$[r]&&(_$=_$||document.createElement("canvas").getContext("2d"),function(e,t){M$.fontSize===e&&M$.fontFamily===t||(_$.font=e+" "+t,M$.fontSize=e,M$.fontFamily=t)}(t,n),C$[r]=_$.measureText(e).width),C$[r]}function R$(e){return"number"!=typeof E$[e]&&(E$[e]=function(e){if(c$(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),E$[e]}function A$(e){let{text:t,fontSize:n,fontFamily:r}=e;return{width:k$(t,n,r),height:R$(n)}}function I$(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A$;const n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+S$(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function L$(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A$;const n=v$(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||n$(e.text))){const o=n(e,(e=>t({text:e,fontFamily:i,fontSize:r}))),a=ID({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?s$:"";const c=t({text:a,fontSize:r,fontFamily:i}).width;c>=s&&(s=c,l=a)}a.text=l;const c=I$(a,t);return c.height=u$(e)*o.lines.length,c}return I$(e,t)}function D$(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function P$(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function O$(e){let{cx:t,cy:n,r:r}=e;return{type:"circle",bounds:{cx:t,cy:n,r:r}}}function T$(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:r,outerRadius:i,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==r?r:i;return O$({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?O$(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var N$={bar:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zW;const l=ID({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>ID({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>ID({},l,t,e,n))))),{fitsHorizontally:d,hasHorizontalDirection:p,targetNodes:h}=function(e){let{nodes:t,rect:n,chart:r,labelSettings:i,placementSettings:o,settings:a,renderer:s}=e;const l={},c=[];let u,d,p,h,f,m,g,y=!0,b=!1;for(let e=0;e<t.length;e++){if(d=t[e],h=d.localBounds,!Yj(h,n))continue;let v=AW(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],p="function"==typeof m.label?m.label(v,e):void 0,IW(p)&&(g="function"==typeof a.direction?a.direction(v,e):a.direction||"up",b=b||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=p,f=s.measureText(l),u.measurements.push(f),u.texts.push(p),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&f.width<=h.width-2*RW);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:b}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),f=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:p?"h":"v"}),m="h"===f?"y":"x",g="h"===f?"height":"width";return h.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[g]-(t.node.localBounds[m]+t.node.localBounds[g]))),s({chart:n,targetNodes:h,stngs:t,rect:i,fitsHorizontally:d,collectiveOrientation:f})},slice:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JW,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:KW;const c=ID({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>ID({},c,t,e))),d=t.labels.map((e=>e.placements.map((n=>ID({},c,t,e,n))))),p=[],h={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const{start:a,end:s}=e[o].desc.slice,l=BW((a+s)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}const o=(e,t)=>BW((e.desc.slice.start+e.desc.slice.end)/2)-BW((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),r.sort(a),i.sort(o),t.concat(n,i,r)}(r);const f={};for(let e=0,t=r.length;e<t;e++){const t=r[e],a=YW(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(a,e):"";if(!c)continue;const m="function"==typeof r.direction?r.direction(a,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(a,e):void 0,y=ZW(c,r,o),b=s({context:f,direction:m,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:h}),v=b.bounds,x=b.placement;if(v&&x){if("outside"===x.position&&"rotate"!==m){UW({context:f,node:t,bounds:v});if(!Oj($W(v),i))continue}const n="function"==typeof x.fill?x.fill(a,e):x.fill,o=l(v,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),p.push(o),v.line&&(v.line.stroke=n,p.push(v.line)))}}}return p},rows:function(e){let{settings:t,chart:n,nodes:r,renderer:i,style:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P$;const s=ID({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=ID({},s,t),c=t.labels.map((e=>ID({},l,e))),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=D$(t,n),{type:s,bounds:p}=T$(t);if(!p)continue;let h,f=0,m=[],g=[],y="circle"===s?2*p.r*.9:p.height;for(f+=l.padding,h=0;h<c.length;h++){let t=c[h],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let r=i.measureText(u);if(f+=r.height+t.padding,f>y)break;g.push(n),m.push(r)}const b=h,v=Math.max(0,y-f);let x;for(x="circle"===s?p.cy-.9*p.r:p.y,x+=l.justify*v+l.padding,h=0;h<b;h++){let t,n=c[h];if("circle"===s){let e=Math.max(Math.abs(x-p.cy),Math.abs(x+m[h].height-p.cy)),n=Math.sqrt(p.r*p.r-e*e);t={x:p.cx-n+l.padding,y:x,width:2*n-2*l.padding,height:m[h].height}}else t={x:p.x+l.padding,y:x,width:p.width-2*l.padding,height:m[h].height};x+=m[h].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let f=a(t,g[h],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[h]});if(f){if(f.text&&f.text!==s$){const e=w$(f,i.measureText);if(s$===e)continue;f.ellipsed=e}void 0!==u&&(f.data=u),d.push(f)}}}return d}};const q$={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&N$[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:r,rect:i,renderer:o,style:a}=e;if(!n.component(r.component))return[];const s=n.findShapes(r.selector).filter((e=>e.key===r.component));return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},N$[e.strategy.type]))})),t}};const F$={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25}};function j$(e){let{x:t=0,y:n,item:r,globalMetrics:i,createSymbol:o,direction:a="ltr"}=e,s=r.label.displayObject,l=r.label.bounds,c=r.symbol.meta;const u="rtl"===a;let d={x:u?t+i.maxLabelBounds.width:t+i.maxSymbolSize+i.spacing,y:n,width:i.maxLabelBounds.width,height:Math.max(i.maxSymbolSize,i.maxLabelBounds.height)},p=function(e,t,n){const r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:u?t+i.maxLabelBounds.width+i.spacing:t,y:n,width:i.maxSymbolSize,height:d.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const h=o(ID({},c,p));return delete h.collider,s.anchor=u?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(d,s,{textMetrics:l,fontSize:parseInt(s.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:r.label.displayObject.data,children:[h,s],collider:{type:"rect",x:t,y:n,width:i.maxItemBounds.width,height:i.maxItemBounds.height}},metrics:d}}function z$(e,t){const n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function B$(e,t){let n,r,i,o,{onScroll:a=()=>{}}=t,s=null,l=0;const c={itemize:t=>{n=function(e,t){let n,r,{resolved:i,dock:o}=e,a=[],s=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,p=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=ID({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),p=Math.max(r.label.bounds.height,p)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,p),width:u+8+d},maxLabelBounds:{width:d,height:p}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),s=isNaN(n.layout.scrollOffset)?s:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,l=c.getContentOverflow(i);const a=c.extent();s=Math.max(0,Math.min(s,l)),o=ID({},i);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=s,o["x"===u?"width":"height"]=a,function(e,t,n){let{viewRect:r}=e,{itemized:i,create:o=j$,parallels:a,createSymbol:s}=n;const l=i.layout.direction,c=i.globalMetrics,u=i.items,d="horizontal"===i.layout.orientation;let p=0;const h=[],f=c.maxItemBounds.height,m=c.maxItemBounds.width,g=i.layout.margin.vertical+f,y=i.layout.margin.horizontal+m;let b=t.x,v=t.y,x=r.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:v,x:"rtl"===l?r.x+x+r.width-m-(b-t.x):b,item:u[e],globalMetrics:c,direction:l,createSymbol:s});if((d&&b>=r.x-m||!d&&v>=r.y-f)&&h.push(n.item),p++,p>=a?(p=0,d?(b+=y,v=t.y):(v+=g,b=t.x)):d?v+=g:b+=y,!d&&v>r.y+r.height)break;if(d&&b>r.x+r.width)break}return h}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return z$(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,z$(n,r)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<i.x:o.y<i.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,s-e));t!==s&&(s=t,a())},offset:()=>s,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>z$(n,r),spread:()=>function(e,t){const n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)};return c}function W$(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const $$={up:"▲",right:"▶",down:"▼",left:"◀"};function H$(e,t){let{size:n,isActive:r,direction:i,nav:o,attrs:a}=t,s={},l="";const c=a;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:i}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(s).length||(u.border="0",u.background="none"),(!r||o&&o.disabled)&&(c.disabled="disabled"),e("button",ID({class:W$(s),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[$$[i]])])}function V$(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:r=>function(e,t,n,r){let{rect:i,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(i);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const d=s?["right","left"]:["down","up"];l&&s&&d.reverse();const p=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[H$(a,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),H$(a,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(p)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function G$(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const r=ID({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let{rect:r}=e;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(ID({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function U$(e,t,n,r){let i,o,a,{itemRenderer:s,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=r,d=0;const p={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:p.x,y:p.y,width:p.width,height:c.spread()},"horizontal"===n){i={x:p.x,y:p.y,width:c.extent(),height:c.spread()};const e=p.width-i.width-(i.width?t.spacing:0),n=p.height;s.parallelize(e,u?void 0:n);const r=s.extent()>e?l.extent():0,h=s.spread(),f=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:p.y+Math.max(0,(f-h)/2),width:p.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},a={x:o.x+o.width+(r?t.spacing:0),y:p.y,width:r,height:p.height},i.y=o.y;"rtl"===s.direction()&&(a.x=p.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),d=Math.max(i.height,f,s.spread())}else{const e=p.height-i.height-(i.height?t.spacing:0),n=p.width;s.parallelize(e,u?void 0:n);const r=s.extent()>e?l.extent():0;a={x:p.x,y:p.y+p.height-r,width:p.width,height:r},o={x:p.x,y:i.y+i.height+(i.height?t.spacing:0),width:p.width,height:p.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},d=Math.max(c.extent(),r?l.spread():0,s.spread())}return o=ID({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,i.x+=e.x,i.y+=e.y,{title:ID({},e,i),content:ID({},e,o),navigation:ID({},e,a),orientation:n,preferredSize:d}}function Y$(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const i=e.scale.datum?ID({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i}))}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:ID(!0,{},F$.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:F$.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:ID(!0,{},F$.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=ID(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:ID(!0,{},F$.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:ID(!0,{},{show:F$.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:i,labels:a,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function K$(e){const{rect:t,settings:n,state:r,itemRenderer:i,navigationRenderer:o,titleRenderer:a}=e,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=U$(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:ID({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),a.render({rect:c.title}),e.state.views={layout:c},u}const X$={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=K$(this);this.update(e)},this.itemRenderer=B$(this,{onScroll:this.onScroll}),this.navigationRenderer=V$(this),this.titleRenderer=G$(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Y$(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=U$(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){Y$(this)},render(){return K$(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function J$(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function Z$(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function Q$(e){return Z$(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function eH(e,t){const n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function tH(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String));const o=n.map(((n,i)=>{const o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}));return o}(e,i),a=function(e){return Z$(e.layout.dock,e.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"})}(e.settings);if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const s=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),l=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),c={isVertical:t,nodes:[],title:{anchor:Q$(e.settings),textMetrics:s,textBounds:l,requiredWidth:()=>{if(!n.show)return 0;let e=l.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,c.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=l.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...c.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return c}const nH={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=eH(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max(...t.ticks.values.map((e=>e.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=tH(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=tH(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=eH(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor;let o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return J$(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,r=t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))})));return r.sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return J$(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map((a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*a.textMetrics.height,i=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:c,text:a.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const rH={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function iH(e,t){let{generatorType:n,item:r,data:i,major:o,minor:a,layerObj:s,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function oH(e){const{metaLayers:t,coordinates:n,layers:r,lines:i,areas:o}=function(e){let{data:t,stngs:n,rect:r,resolver:i,style:o,domain:a}=e;const{width:s,height:l}=r,c=i.resolve({data:t,defaults:rH.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let p=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:p++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const h=Object.keys(d).map((e=>(d[e].consumableData=OD({points:d[e].dataItems},d[e].dataItems[0]),d[e]))),f={items:h.map((e=>e.consumableData))},m=n.layers||{};return{coordinates:c,metaLayers:h,layers:i.resolve({data:f,defaults:{curve:rH.layers.curve,show:rH.layers.show},settings:{curve:m.curve,show:m.show}}),lines:i.resolve({data:f,defaults:ID({},rH.layers.line,o.line),settings:m.line}),areas:i.resolve({data:f,defaults:ID({},rH.layers.area,o.area),settings:m.area})}}(e),a=[];return t.forEach(((t,s)=>{const l=r.items[s];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let d,p;for(let r=0;r<t.items.length;r++){if(d=t.items[r],p=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=n.settings.minor.scale?n.settings.minor.scale(p.minor0?p.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const h=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:i.items[s],areaObj:o.items[s],median:h,points:u,consumableData:t.consumableData})})),a}const aH={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:r}=this.rect;this.stngs=this.settings.settings||{};const i=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=oH({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:i,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:r,missingMinor0:i,stngs:o}=t;const a=[],s=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let d={size:r,p:"y"},p={size:n,p:"x"};if("vertical"===o.orientation){const e=ID(!0,{},p);p=ID(!0,{},d),d=ID(!0,{},e)}s.area&&!1!==c.show&&a.push(iH(u,{data:e.consumableData,item:c,generatorType:"area",major:p,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(iH(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:p,minor:d,layerObj:l,stngs:o},"none")),!i&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(iH(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:p,minor:d,layerObj:l,stngs:o},"none")))})),a}(o,{width:n,height:r,missingMinor0:i,stngs:this.stngs})}};function sH(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function lH(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function cH(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}const uH={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=sH(this,e,!1);Xj({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})))}(this.settings),this.state.start=sH(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=sH(this,e),function(e){if(e.state.active){const t=lH(e,e.state.start),n=lH(e,e.state.end),r=e.chart.shapesAt(cH(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([ID({type:"rect"},cH(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function dH(e,t,n){let{renderer:r,style:i,props:o,h:a}=n;const s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),c=a("div",{dir:o.direction,class:W$(ID({"pic-tooltip":!0},s.tooltip)),style:ID({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:W$(ID({"pic-tooltip-content":!0},s.content))},l),a("div",{class:W$(ID({"pic-tooltip-arrow":!0},s.arrow)),style:ID({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function pH(e){let{defaultDuration:t,defaultDelay:n}=e,r=null,i=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),s=function(){},l=()=>{r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout((()=>{e(),o=!0,r=null,a.set("active")}),c),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function hH(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function fH(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function mH(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function gH(e,t,n,r,i,o){const a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function yH(e){let{area:t,vx:n,vy:r,width:i,height:o,offset:a}=e;const s=n+a.x,l=r+a.y,c=i,u=o;let d=s<0?-s:0,p=l<0?-l:0;return d+=s+c>t.width?-(s+c-t.width):0,p+=l+u>t.height?-(l+u-t.height):0,{x:d,y:p}}function bH(e){let{options:t,pointer:n,width:r,height:i,dockOrder:o,x:a,y:s}=e;const{targetBounds:l}=n,c=hH(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:mH(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},p=fH(r,i,t.offset),h=[],f="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=yH({area:d,vx:f,vy:m,width:r,height:i,offset:p[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=mH(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,h.push(y)}return h.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),h[0]}function vH(e,t,n){const r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const i=r.rect;return ID({scaleRatio:i.scaleRatio},i.computedInner)}const xH={bounds:function(e){let{resources:t,nodes:n,pointer:r,width:i,height:o,options:a}=e;const{targetBounds:s}=r,{x:l,y:c,width:u,height:d}=t.getNodeBoundsRelativeToTarget(n[0]),p={left:{x:l,y:c+d/2},right:{x:l+u,y:c+d/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+d},inside:{x:l+u/2,y:c+d/2}},h=hH(a.offset),f=h[a.dock];if(f)return{computedTooltipStyle:{left:"".concat(p[a.dock].x,"px"),top:"".concat(p[a.dock].y,"px"),transform:f},computedArrowStyle:mH(a.offset)[a.dock],dock:a.dock};const m={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},g=fH(i,o,a.offset),y=["top","left","right","bottom","inside"];for(let e=0;e<y.length;e+=1){const t=y[e];if(gH(m,"target"===a.area?p[t].x:s.left+p[t].x,"target"===a.area?p[t].y:s.top+p[t].y,i,o,g[t]))return{computedTooltipStyle:{left:"".concat(p[t].x,"px"),top:"".concat(p[t].y,"px"),transform:h[t]},computedArrowStyle:mH(a.offset)[t],dock:t}}const b=function(e){let{options:t,docks:n,dockOffsets:r,targetBounds:i,area:o,width:a}=e;const s="top",l="target"===t.area?n[s].x:i.left+n[s].x,c=("target"===t.area?n[s].y:(i.top,n[s].y),r[s]),u=l+c.x,d=(c.y,a);let p=n.top.x;return u<0&&u+d>o.width||(u<0?p-=u:u+d>o.width&&(p-=u+d-o.width)),p}({options:a,docks:p,dockOffsets:g,targetBounds:s,area:m,width:i});return{computedTooltipStyle:{left:"".concat(b,"px"),top:"".concat(p.top.y,"px"),transform:h.top},computedArrowStyle:mH(a.offset+b-p.top.x,a.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:r,height:i}=e;const{x:o,y:a}=n;return bH({x:o,y:a,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:r,height:i,nodes:o,resources:a}=e;const s=o[0],{dx:l,dy:c}=n,u=a.getComponentBoundsFromNode(s),d=l+u.x+u.width/2,p=c+u.y+u.height/2,{start:h,end:f,outerRadius:m}=s.desc.slice,g=(h+f)/2-Math.PI/2,y=2*Math.PI,b=(g%y+y)%y;let v=["top","left","right","bottom"];return"auto"===t.dock&&(v=b<=Math.PI/4||b>=7*Math.PI/4?["right","top","bottom","left"]:b<=3*Math.PI/4?["bottom","left","right","top"]:b<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),bH({x:d+m*u.scaleRatio.x*Math.cos(b),y:p+m*u.scaleRatio.y*Math.sin(b),pointer:n,width:r,height:i,options:t,dockOrder:v})}};function wH(e,t){let{width:n,height:r}=e,{chart:i,state:o,props:a}=t;const s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>vH(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=vH(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=ID(c,a.placement(s))),"object"===l&&xH[a.placement.type]?c=ID(c,a.placement):"string"===l&&xH[a.placement]&&(c=ID(c,{type:a.placement})),s.options=c;const u=xH[c.type](s);let{x:d,y:p,width:h,height:f}=s.resources.getComponentBoundsFromNode(s.nodes[0]);return d+=s.pointer.dx,h+=d,p+=s.pointer.dy,f+=p,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.left)),h),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,p,parseFloat(u.computedTooltipStyle.top)),f),"px"),u}let SH;function EH(){SH=null}const CH={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data))),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const MH={require:["chart","renderer"],defaultSettings:{settings:CH,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:r,delay:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:r}=t,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,c=o,u=a.left-s.left,d=a.top-s.top,p=i-a.left,h=o-a.top;return i-=s.left,o-=s.top,{x:i,y:o,dx:u,dy:d,cx:p,cy:h,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(n)?this.props.filter(n):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),r,i)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=pH({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){SH&&SH!==e&&SH()}(t),SH=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,ID({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,ID({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),SH===t&&(SH=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),EH()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),EH()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:r,props:i,h:o}=t;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach((e=>{if("function"==typeof i.extract){const t=ID({node:e},a);s.push(i.extract(t))}})),s}(e,this),n=wH(dH(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=dH(t,n,this)}};const _H={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var kH={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},RH=/([astvzqmhlc])([^astvzqmhlc]*)/gi,AH=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function IH(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(RH,((e,n,r)=>{const i=function(e){const t=e.match(AH);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),a=n;if("m"===o&&i.length>2&&(t.push([a,...i.splice(0,2)]),o="l",a="m"===a?"l":"L"),i.length<kH[o])return"";for(t.push([a,...i.splice(0,kH[o])]);i.length>=kH[o]&&i.length&&kH[o];)t.push([a,...i.splice(0,kH[o])]);return""})),t}const LH=2*Math.PI;function DH(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function PH(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function OH(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const a=DH(e,t),s=DH(t,n),l=DH(n,r),c={x:PH(.5,e.x,t.x,n.x,r.x),y:PH(.5,e.y,t.y,n.y,r.y)},u=DH(a,s),d=DH(s,l);return OH(e,a,u,c,i,o-1),OH(c,d,l,r,i,o-1),i}function TH(e,t,n){const{cp1:r,cp2:i}=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return OH(e,r,i,n)}function NH(e,t,n){const r=[],i=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,d=e[6],p=e[7],h=e[1],f=e[2];if("a"===e[0]&&(d+=t,p+=n),t===p&&n===p)return r;if(!h||!f)return r.push({x:d,y:p}),r;({cx:s,cy:l,rx:h,ry:f,sweepAngle:c,startAngle:u}=function(e,t,n,r,i,o,a,s,l){let c,u,d,p,h,f;const m=dj(n%360),g=Math.cos(m),y=Math.sin(m),b=(s-o)/2,v=(l-a)/2,x=g*b+y*v,w=g*v-y*b;f=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,f>1&&(f=Math.sqrt(f),e*=f,t*=f);const S=e*w,E=t*x,C=S**2+E**2,M=(e*t)**2-C;let _=Math.sqrt(Math.max(M/C,0));r===i&&(_=-_);const k=_*(S/t),R=_*(-E/e);p=g*k-y*R+(s+o)/2,h=y*k+g*R+(l+a)/2;const A=(x-k)/e,I=(w-R)/t,L=(-x-k)/e,D=(-w-R)/t;return c=Math.atan2(I,A),c+=c<0?LH:0,u=Math.atan2(D,L),u+=u<0?LH:0,d=u-c,!i&&c<u?d-=LH:i&&u<c&&(d+=LH),d%=LH,{startAngle:c,sweepAngle:d,cx:p,cy:h,rx:e,ry:t}}(h,f,a,i,o,d,p,t,n));const m=Math.abs(c*Math.sqrt((h**2+f**2)/2)),g=Math.ceil(m/10),y=c/g;for(let e=1;e<=g;e++){const t=(u+y*e)%LH,n=Math.cos(t),i=Math.sin(t);r.push({x:s+n*h+-i*n,y:l+i*f+n*i})}return r}function qH(e){const t=IH(e),n=[],r=[];let i=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],d=u[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(a=null,s=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,c=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(...NH(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...NH(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...OH({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),a=u[3]+i,s=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...OH({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],i=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push(...OH({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),a=u[1]+i,s=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push(...OH({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],i=u[3],o=u[4];break;case"Q":r.push(...TH({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...TH({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...TH({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...TH({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}const FH={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{qH(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var jH=[function(e){e.component("box",Xz),e.component("box-marker",Xz)},function(e){e.component("point",rB),e.component("point-marker",rB)},function(e){e.component("pie",sB)},function(e){e.component("grid-line",pB)},function(e){e.component("ref-line",wB)},function(e){e.component("axis",$B)},function(e){e.component("container",HB)},function(e){e.component("text",UB)},function(e){e.component("scrollbar",XB)},function(e){e.component("brush-range",dW),e.component("brush-area-dir",mW)},function(e){e.component("range",vW)},function(e){e.component("brush-lasso",MW)},function(e){e.component("labels",q$)},function(e){e.component("legend-cat",X$)},function(e){e.component("legend-seq",nH)},function(e){e.component("line",aH)},function(e){e.component("brush-area",uH)},function(e){e.component("tooltip",MH)},function(e){e.component("debug-collider",_H)},function(e){e.component("debug-path-to-points",FH)}];class zH{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}}class BH{constructor(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:r,minWidth:i,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,i)):(this.x=e+Math.min(n,-i),this.width=-Math.min(n,-i)),r>=0?(this.y=t,this.height=Math.max(r,o)):(this.y=t+Math.min(r,-o),this.height=-Math.min(r,-o))}containsPoint(e){return Xj(this,e)}intersectsLine(e){return Jj(this,WD(e))}intersectsRect(e){return Yj(this,BD(e))}intersectsCircle(e){return Wj(e,this)}intersectsPolygon(e){return Uj(e,this)}intersectsGeoPolygon(e){return oz(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class WH{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:r})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,r),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return Bj(this,e)}intersectsLine(e){return $j(this,WD(e))}intersectsRect(e){return Wj(this,BD(e))}intersectsCircle(e){return n=e,!qj(t=this)&&!qj(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return Hj(this,e)}intersectsGeoPolygon(e){return nz(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class $H{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:r,tolerance:i})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=r,this.tolerance=Math.max(0,Math.round(i)),this.vectors=this.points(),this.zeroSize=e===n&&t===r}containsPoint(e){if(this.tolerance>0){return $j({cx:e.x,cy:e.y,r:this.tolerance},this)}return Qj(this,e)}intersectsLine(e){return Zj(this,WD(e))}intersectsRect(e){return Jj(BD(e),this)}intersectsCircle(e){return $j(e,this)}intersectsPolygon(e){return Gj(e,this)}intersectsGeoPolygon(e){return iz(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class HH{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return Vj(this,e)}intersectsCircle(e){return Hj(e,this)}intersectsLine(e){return Gj(this,WD(e))}intersectsRect(e){return Uj(this,BD(e))}intersectsPolygon(e){return ez(this,e)}intersectsGeoPolygon(e){return tz(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function VH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new HH(...t)}function GH(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function UH(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class YH{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)UH(this.vertices[e]),this.vertices[e].length>2&&GH(this.vertices[e]),this.polygons[e]=VH({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return rz(this,e)}intersectsCircle(e){return nz(e,this)}intersectsLine(e){return iz(this,WD(e))}intersectsRect(e){return oz(this,BD(e))}intersectsPolygon(e){return tz(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Yj(n,r)&&(Kj(r,n)?zj(t,e):zj(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function KH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new YH(...t)}class XH{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,r=this._points.length-1;e<r;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>Qj(t,e)))}intersectsCircle(e){return this.segments.some((t=>$j(e,t)))}intersectsLine(e){const t=WD(e);return this.segments.some((e=>Zj(e,t)))}intersectsRect(e){const t=BD(e);return this.segments.some((e=>Jj(t,e)))}intersectsPolygon(e){return this.segments.some((t=>Gj(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>iz(e,t)))}points(){return this._points}}const JH=UP();function ZH(e,t){return JH.get(e)(t)}JH.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new BH(...t)})),JH.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new WH(...t)})),JH.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new $H(...t)})),JH.add("polygon",VH),JH.add("geopolygon",KH),JH.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new XH(...t)}));class QH{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=ZH(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class eV{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new eV).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,r,i;if(e instanceof eV&&(e=e._elements),Array.isArray(e)){for(r=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-a*l,r*l-n*c,n*a-r*o],[a*s-i*c,t*c-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];s.push({x:o[0],y:o[1]})}return s}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const tV=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function nV(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function rV(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function iV(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function oV(e,t){t.args.length>=6&&e.transform(...t.args)}function aV(e,t){const n=function(e){let t,n=[];for(;null!==(t=tV.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?nV(t,r):"scale"===r.cmd?rV(t,r):"matrix"===r.cmd?oV(t,r):"translate"===r.cmd&&iV(t,r)}const sV={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},lV={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,r)=>r.filter((r=>{const i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function cV(e,t){if(!t||!t.length||!e||"function"!=typeof lV[e.type])return[];switch(e.type){case"type":case"tag":return lV[e.type](e.value,t);case"attr":return lV[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return lV[e.type](t);default:return[]}}var uV={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let a;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const a=t=>{i=e.match(sV[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(sV).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){a=i[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=cV(e,n),s=!0})),s&&t.push(n);const l=t[0].filter((e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0}));r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function dV(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every((e=>Array.isArray(e)))?i.map((e=>n.transformPoints(e))):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=BD(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=WD(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:cj(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=cj(i[t],!0);o={type:"path",d:e}}return o}class pV{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:r,width:i,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:r,width:i,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>dV(e,t,n)))}:dV(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new pV(e))),this._parent=()=>e.parent?new pV(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();i-=t,o-=n}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function hV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pV(...t)}class fV{constructor(e){this._node=hV(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function mV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new fV(...t)}function gV(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=mV(n);const e=n.parent;e&&"stage"!==e.type&&gV(e,t.parent)}}function yV(e,t,n){if(null===e.colliderType)return null;const r=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const r={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(r)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?KH(n):VH(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=mV(i);return gV(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=mV(e);return gV(e,t),t}return null}(e,t,r)}function bV(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],a=yV(i,t,r);a&&n.push(a),!i.children||a||i.collider||bV(i.children,t,n,r)}}function vV(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==yV(r,t,n))return!0;if(r.children&&!r.collider)return vV(r.children,t,n)}return!1}function xV(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch($D(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=zD(e).map((e=>mj(e,t))),["intersectsRect",n];case"line":return n=jD(e).map((e=>mj(e,t))),["intersectsLine",n];case"point":return n=mj(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>mj(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>mj(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function wV(e,t){const[n,r]=xV(t,e.dpi),i=[];return n&&(bV([e],n,i,r),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,i)),i}function SV(e,t){const[n,r]=xV(t,e.dpi);return vV([e],n,r)}class EV extends zH{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:r,strokeReference:i,fillReference:o}=e;var a,s;a=this.attrs,s=e,Object.keys(lj).forEach((e=>{const t=s[e];void 0!==t&&(a[lj[e]]=t)})),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=ID(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return uV.find(e,this).map((e=>hV(e)))}getItemsFrom(e){return wV(this,e)}containsPoint(e){return SV(this,e)}intersectsLine(e){return SV(this,e)}intersectsRect(e){return SV(this,e)}intersectsCircle(e){return SV(this,e)}intersectsPolygon(e){return SV(this,e)}intersectsGeoPolygon(e){return SV(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new eV;void 0!==this.attrs.transform&&aV(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new eV;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new QH(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=ZH("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=ZH(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class CV extends zH{addChild(e){if(!(e&&e instanceof zH))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const MV=CV.prototype;class _V extends EV{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=ID({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[r,,i]=e.bounds(t),{x:o,y:a}=r,{x:s,y:l}=i,c=isNaN(n.width)?s:Math.max(s,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?a:Math.min(a,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=ID({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=MV.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=ID({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=MV.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=ID({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(MV.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=ID(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(MV.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=ID(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function kV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _V(...t)}class RV extends _V{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const AV=CV.prototype,IV=["x1","x2","y1","y2","id","offset","style"];class LV extends EV{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=IV.length;r!==i;r++)n=IV[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return AV.addChild.call(this,e)}addChildren(e){return AV.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return AV.removeChild.call(this,e),this}removeChildren(e){return AV.removeChildren.call(this,e),this}}function DV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new LV(...t)}const PV=CV.prototype,OV=["patternUnits","x","y","width","height","id"];class TV extends EV{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=OV.length;r!==i;r++)n=OV[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return PV.addChild.call(this,e)}addChildren(e){return PV.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return PV.removeChild.call(this,e),this}removeChildren(e){return PV.removeChildren.call(this,e),this}}class NV extends EV{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:r=0,height:i=0,rx:o=0,ry:a=0,collider:s}=e,l=ID({type:"rect",x:t,y:n,width:r,height:i},s);super.set(e),r>=0?(this.attrs.x=t,this.attrs.width=r):(this.attrs.x=t+r,this.attrs.width=-r),i>=0?(this.attrs.y=n,this.attrs.height=i):(this.attrs.y=n+i,this.attrs.height=-i),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=zD(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[r,i,o,a]=FD(n);return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class qV extends EV{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:r=0,collider:i}=e,o=ID({type:"circle",cx:t,cy:n,r:r},i);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=r,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:r,r:i}=this.attrs,o=t-r,a=n-i;let s=2*r,l=2*i,c=[{x:o,y:a},{x:o+s,y:a},{x:o+s,y:a+l},{x:o,y:a+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,r,i]=FD(c);s=r-t,l=i-n,this.__bounds[e]=[{x:t,y:n},{x:t+s,y:n},{x:t+s,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class FV extends EV{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:r=0,y2:i=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=r,this.attrs.y2=i;const a={type:"line",x1:t,y1:n,x2:r,y2:i};this.collider=ID(a,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=jD(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,r,i,o]=FD(t),a=n!==i||r!==o;return this.__boundingRect[e]={x:n,y:r,width:a?Math.max(1,i-n):0,height:a?Math.max(1,o-r):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const jV=Math.PI/2;function zV(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function BV(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const WV={step:function(e){return new BP(e,.5)},stepAfter:function(e){return new BP(e,1)},stepBefore:function(e){return new BP(e,0)},linear:bP,basis:function(e){return new _P(e)},cardinal:AP.tension(0),catmullRom:LP,monotonex:function(e){return new NP(e)},monotoney:function(e){return new qP(e)},natural:function(e){return new jP(e)}};function $V(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class HV extends EV{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=gP();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:r,points:i,stngs:o,generatorType:a}=e,s=wP(),l=o.coordinates?o.coordinates.defined:null;s[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(WV["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?i.filter(s.defined()):i,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=qH(this.attrs.d),this.segments.length>1&&this.segments.every((e=>$V(e))))return void(this.collider=ID({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if($V(t))this.collider=ID({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=[],i=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=zV(s,a),u=zV(s,l),d=(c+u)/2,p=d+Math.PI,h=Math.max(d,p),f=Math.min(d,p),m=c>u;if(1===n){const e=zV(a,s);r.push(BV(a,e-jV,t)),i.unshift(BV(a,e+jV,t))}const g=m?h:f,y=m?f:h;if(r.push(BV(s,g,t)),i.unshift(BV(s,y,t)),n===o-1){const e=zV(l,s);r.push(BV(l,e+jV,t)),i.unshift(BV(l,e-jV,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=ID({type:"polyline",points:t},e.collider)}))}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:qH(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,r,i,o]=FD(t);return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function VV(e){let{data:t,_boundingRect:n,_textBoundsFn:r}=e;return null!=t&&(n||r)}let GV=class extends EV{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:r=0,dy:i=0,textBoundsFn:o,text:a,title:s,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=r,this.attrs.dy=i,this.attrs.text=a,void 0!==s&&(this.attrs.title=String(s)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=ID({type:VV(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=zD(e),r=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[i,o,a,s]=FD(r);return this.__boundingRect[t]={x:i,y:o,width:a-i,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}};const UV=UP();function YV(e,t){return UV.get(e)(t)}UV.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new NV(...t)})),UV.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qV(...t)})),UV.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new GV(...t)})),UV.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new FV(...t)})),UV.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new HV(...t)})),UV.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new RV(...t)})),UV.add("container",kV),UV.add("defs",kV),UV.add("linearGradient",DV),UV.add("radialGradient",DV),UV.add("stop",DV),UV.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new TV(...t)}));const KV=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==i[a]&&(o[a]=i[a]);return ID(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function XV(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function JV(e,t,n){e.node=n[t],e.index=t}function ZV(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(JV(o,a,e),XV(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=KV.save(o.node);const s=YV(o.node.type,o.node);s&&(o.node.transform&&(n.save(),aV(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&ZV(o.node.children,s,n,r),o.node.transform&&n.restore()),KV.restore()}}function QV(e){let{items:t,stage:n,dpi:r,on:i={}}=e;return n||(n=YV("stage",r)),ZV(t,n,new eV,i),n}function eG(e,t,n){const{orientation:r,degree:i,stops:o=[]}=n;let a=null;if("radial"===r){const n=t.boundingRect();a=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else{const r=pj(i);["x1","x2","y1","y2"].forEach((e=>{e in n&&(r[e]=n[e])}));const o=t.boundingRect();a=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];a.addColorStop(t.offset,t.color)}return a}function tG(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function nG(){let{x:e,y:t,width:n,height:r,scaleRatio:i,margin:o,edgeBleed:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return s.x=isNaN(e)?s.x:e,s.y=isNaN(t)?s.y:t,s.width=isNaN(n)?s.width:n,s.height=isNaN(r)?s.height:r,void 0!==i&&(s.scaleRatio.x=isNaN(i.x)?s.scaleRatio.x:i.x,s.scaleRatio.y=isNaN(i.y)?s.scaleRatio.y:i.y),void 0!==o&&(s.margin.left=isNaN(o.left)?0:o.left,s.margin.top=isNaN(o.top)?0:o.top),"object"==typeof a&&["left","right","top","bottom"].forEach((e=>{!isNaN(a[e])&&a[e]>0&&(s.edgeBleed[e]=a[e],s.edgeBleed.bool=!0)})),s.computedPhysical={x:Math.round(s.margin.left+(s.x-s.edgeBleed.left)*s.scaleRatio.x),y:Math.round(s.margin.top+(s.y-s.edgeBleed.top)*s.scaleRatio.y),width:Math.round((s.width+s.edgeBleed.left+s.edgeBleed.right)*s.scaleRatio.x),height:Math.round((s.height+s.edgeBleed.top+s.edgeBleed.bottom)*s.scaleRatio.y)},s}function rG(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:A$,textBounds:L$,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function iG(e){return t=>{let{node:n}=t;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=e.textBounds)}}const oG=200,aG=200;class sG{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:r,canvasBufferSize:i}=e;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*oG,height:n.computedPhysical.height+2*aG},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const lG=UP();function cG(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function uG(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function dG(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function pG(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in r)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function hG(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],a={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=eG(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=eG(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=r.patterns.create(o.attrs.stroke))),pG(t,o,n,a),o.modelViewMatrix&&dG(o.modelViewMatrix.elements,t),lG.has(o.type)&&lG.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&hG(o.children,t,n,r),t.restore()}}function fG(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:QV;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,a=nG();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",cG]];let l;const c=rG();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach((t=>{void 0!==e[t]&&(r[t]=e[t])})),r),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof r.transform||t||(t=new sG(e)),n.appendChild(e),e),c.getScene=r=>{const i=uG(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:r,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*i*o,", ").concat(a.edgeBleed.top*i*s,")"):""};return 1===i&&1===o&&1===s||(l.transform+="scale(".concat(i*o,", ").concat(i*s,")")),n({items:[l],dpi:i,on:{create:[x$(c.measureText),iG(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||tG(e,t,n),r[i]):tG(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=uG(u),p=t&&r.transform();if(p)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:r}=e;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:d,transform:p}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*d),e.height=Math.round(a.computedPhysical.height*d),t&&t.updateSize({rect:a,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const h=c.getScene(n),f=!i||!h.equals(i);l.clear();const m=o||f,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),hG(h.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&h.children.unshift(...i.children),i=h,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=nG(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function mG(e,t){lG.add(e,t)}function gG(e,t){return Math.max(0,Math.min(e,t))}const yG=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),bG=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),vG=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function xG(e){return yG.test(e)}function wG(e){return bG.test(e)||vG.test(e)}function SG(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],xG(n))return"ltr";if(wG(n))return"rtl"}return"ltr"}const EG={start:"end",end:"start",center:"center",middle:"middle"};function CG(e,t){return"rtl"===t?EG[e]:e}function MG(e,t){const n=[];let r;const i=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?i.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=MG([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=MG(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,a.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:i,items:r}}function _G(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function kG(e,t){for(let n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function RG(e,t,n,r){let i;for(let o=0,a=e.length;o<a;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(_G(i.diff.added,i.object,t),kG(i.diff.removed,r),RG(i.diff.items,t,n,r)))}function AG(e,t,n,r,i,o){const a=MG(e,t);return _G(a.added,n,r),kG(a.removed,o),RG(a.items,r,i,o),a.items}mG("rect",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=gG(r/2,o>0?o:a),a=gG(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()})),mG("circle",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()})),mG("line",(function(e,t){let{g:n,doStroke:r}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()})),mG("path",(function(e,t){let{g:n,doStroke:r,doFill:i}=t;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)})),mG("text",(function(e,t){let{g:n,ellipsed:r,doStroke:i}=t;const o=r||w$(e,A$);e["font-weight"]?n.font="".concat(e["font-weight"]," ").concat(e["font-size"]," ").concat(e["font-family"]):n.font="".concat(e["font-size"]," ").concat(e["font-family"]);const a=SG(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=CG("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=S$(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));const IG="http://www.w3.org/2000/svg",LG=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(IG,"container"===e?"g":e);return t.appendChild(n),n},DG=e=>{e.parentNode&&e.parentNode.removeChild(e)},PG=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||w$(t.attrs,A$);const n=SG(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",CG(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(IG,"title");n.textContent=t.attrs.title,e.appendChild(n)}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?S$(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class OG{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function TG(){return new OG(AG,LG,PG,DG)}function NG(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function qG(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:IG,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:QV;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:TG)();let r,i,o,a=!1,s=nG();const l={transform:void 0},c=rG(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NG,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach((a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")}))},clear(){n={}}};return i}(u.children),p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NG,n={},r=Date.now();const i={getOrCreateGradient(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){let{orientation:t,degree:r,stops:a=[]}=i[o],c={};void 0===r&&(r=90),"radial"===t?c.type="radialGradient":(c=pj(r),["x1","x2","y1","y2"].forEach((e=>{e in i[o]&&(c[e]=i[o][e])})),c.type="linearGradient"),c.id=l,c.children=a.map((e=>{let{offset:t,color:n,opacity:r}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}})),e.push(c),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=s.scaleRatio.x,r=s.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},p.onCreate,d.onCreate,x$(c.measureText),iG(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{horizontalScaling:e,horizontalSkewing:n,verticalSkewing:r,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}i.style.transform="",a&&(r.style.left="".concat(s.computedPhysical.x,"px"),r.style.top="".concat(s.computedPhysical.y,"px"),r.setAttribute("width",s.computedPhysical.width),r.setAttribute("height",s.computedPhysical.height)),p.clear(),d.clear(),u.children.length=0;const h=c.getScene(e),f=!o||!h.equals(o),m=a||f;return m&&(c.clear(),n.render(h.children,i)),a=!1,o=h,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=nG(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var FG,jG,zG,BG,WG,$G,HG,VG={},GG=[],UG=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function YG(e,t){for(var n in t)e[n]=t[n];return e}function KG(e){var t=e.parentNode;t&&t.removeChild(e)}function XG(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?FG.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return JG(e,a,r,i,null)}function JG(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++zG:i};return null==i&&null!=jG.vnode&&jG.vnode(o),o}function ZG(e){return e.children}function QG(e,t){this.props=e,this.context=t}function eU(e,t){if(null==t)return e.__?eU(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?eU(e):null}function tU(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return tU(e)}}function nU(e){(!e.__d&&(e.__d=!0)&&BG.push(e)&&!rU.__r++||WG!==jG.debounceRendering)&&((WG=jG.debounceRendering)||$G)(rU)}function rU(){var e,t,n,r,i,o,a,s;for(BG.sort(HG);e=BG.shift();)e.__d&&(t=BG.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=YG({},o)).__v=o.__v+1,pU(s,o,i,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,r,null==a?eU(o):a,o.__h),hU(r,o),o.__e!=a&&tU(o)),BG.length>t&&BG.sort(HG));rU.__r=0}function iU(e,t,n,r,i,o,a,s,l,c){var u,d,p,h,f,m,g,y=r&&r.__k||GG,b=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(h=n.__k[u]=null==(h=t[u])||"boolean"==typeof h||"function"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?JG(null,h,null,null,h):Array.isArray(h)?JG(ZG,{children:h},null,null,null):h.__b>0?JG(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(p=y[u])||p&&h.key==p.key&&h.type===p.type)y[u]=void 0;else for(d=0;d<b;d++){if((p=y[d])&&h.key==p.key&&h.type===p.type){y[d]=void 0;break}p=null}pU(e,h,p=p||VG,i,o,a,s,l,c),f=h.__e,(d=h.ref)&&p.ref!=d&&(g||(g=[]),p.ref&&g.push(p.ref,null,h),g.push(d,h.__c||f,h)),null!=f?(null==m&&(m=f),"function"==typeof h.type&&h.__k===p.__k?h.__d=l=oU(h,l,e):l=aU(e,h,p,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=eU(p))}for(n.__e=m,u=b;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=sU(r).nextSibling),gU(y[u],y[u]));if(g)for(u=0;u<g.length;u++)mU(g[u],g[++u],g[++u])}function oU(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?oU(r,t,n):aU(n,r,r,i,r.__e,t));return t}function aU(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function sU(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=sU(n)))return r;return null}function lU(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||UG.test(t)?n:n+"px"}function cU(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||lU(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||lU(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?dU:uU,o):e.removeEventListener(t,o?dU:uU,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function uU(e){return this.l[e.type+!1](jG.event?jG.event(e):e)}function dU(e){return this.l[e.type+!0](jG.event?jG.event(e):e)}function pU(e,t,n,r,i,o,a,s,l){var c,u,d,p,h,f,m,g,y,b,v,x,w,S,E,C=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(c=jG.__b)&&c(t);try{e:if("function"==typeof C){if(g=t.props,y=(c=C.contextType)&&r[c.__c],b=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in C&&C.prototype.render?t.__c=u=new C(g,b):(t.__c=u=new QG(g,b),u.constructor=C,u.render=yU),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=b,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=C.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=YG({},u.__s)),YG(u.__s,C.getDerivedStateFromProps(g,u.__s))),p=u.props,h=u.state,u.__v=t,d)null==C.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==C.getDerivedStateFromProps&&g!==p&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,b),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,b)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,b),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(p,h,f)}))}if(u.context=b,u.props=g,u.__P=e,x=jG.__r,w=0,"prototype"in C&&C.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(r=YG(YG({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(p,h)),E=null!=c&&c.type===ZG&&null==c.key?c.props.children:c,iU(e,Array.isArray(E)?E:[E],t,n,r,i,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=fU(n.__e,t,n,r,i,o,a,l);(c=jG.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),jG.__e(e,t,n)}}function hU(e,t){jG.__c&&jG.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){jG.__e(e,t.__v)}}))}function fU(e,t,n,r,i,o,a,s){var l,c,u,d=n.props,p=t.props,h=t.type,f=0;if("svg"===h&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===h)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,p.is&&p),o=null,s=!1}if(null===h)d===p||s&&e.data===p||(e.data=p);else{if(o=o&&FG.call(e.childNodes),c=(d=n.props||VG).dangerouslySetInnerHTML,u=p.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||cU(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||cU(e,o,t[o],n[o],r)}(e,p,d,i,s),u)t.__k=[];else if(f=t.props.children,iU(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==h,o,a,o?o[0]:n.__k&&eU(n,0),s),null!=o)for(f=o.length;f--;)null!=o[f]&&KG(o[f]);s||("value"in p&&void 0!==(f=p.value)&&(f!==e.value||"progress"===h&&!f||"option"===h&&f!==d.value)&&cU(e,"value",f,d.value,!1),"checked"in p&&void 0!==(f=p.checked)&&f!==e.checked&&cU(e,"checked",f,d.checked,!1))}return e}function mU(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){jG.__e(e,n)}}function gU(e,t,n){var r,i;if(jG.unmount&&jG.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||mU(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){jG.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&gU(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||KG(e.__e),e.__=e.__e=e.__d=void 0}function yU(e,t,n){return this.constructor(e,n)}function bU(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,r,i=nG();const o={transform:void 0},a=rG();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{horizontalScaling:e,horizontalSkewing:r,verticalSkewing:i,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}let a;return n.style.transform="",n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),a=Array.isArray(e)?XG("div",null,e):e,r=function(e,t,n){var r,i,o;jG.__&&jG.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],pU(t,e=(!r&&n||t).__k=XG(ZG,null,[e]),i||VG,VG,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?FG.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),hU(o,e)}(a,n,r),!0},a.renderArgs=[XG],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},a.size=e=>(e&&(i=nG(e)),i),a}FG=GG.slice,jG={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},zG=0,QG.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=YG({},this.state),"function"==typeof e&&(e=e(YG({},n),this.props)),e&&YG(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),nU(this))},QG.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),nU(this))},QG.prototype.render=ZG,BG=[],$G="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,HG=function(e,t){return e.__v.__b-t.__v.__b},rU.__r=0;var vU=[function(e){e.renderer("svg",qG)},function(e){e.renderer("canvas",fG)},function(e){e.renderer("dom",bU)}];const xU={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const wU=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let{level:e=xU.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const r={[xU.OFF]:()=>{},[xU.ERROR]:function(){return t.error(...arguments)},[xU.WARN]:function(){return t.warn(...arguments)},[xU.INFO]:function(){return t.info(...arguments)},[xU.DEBUG]:function(){return t.log(...arguments)}},i=function(e){if(e&&!(n<e)){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];(r[e]||r[xU.DEBUG])(...i)}};return{log:i,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(xU.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(xU.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(xU.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(xU.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:xU}}(t.logger),i={component:UP(n.component,"component",r),data:UP(n.data,"data",r),formatter:UP(n.formatter,"formatter",r),interaction:UP(n.interaction,"interaction",r),renderer:Oz(n.renderer),scale:UP(n.scale,"scale",r),symbol:UP(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:ID({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i)},o.chart=e=>Pz(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach((e=>{o[e]=i[e]})),o.version=LD,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:Tz,data:zz,formatter:yN,interaction:Bz,renderer:Oz(),scale:bF,symbol:Cj});jH.forEach(wU.use),vU.forEach(wU.use),[].forEach(wU.use);const SU=wU();SU.use(wD),SU.renderer.prio(["canvas"]);const EU=({cell:e,representation:t,textStyle:n,imageContainerHorizontalAlignment:r})=>{var i,o;const{imageBox:a}=t,{styleService:{grid:{lineClamp:s}}}=_E();return Hn.jsxs("div",{style:{display:"grid",gridTemplateColumns:`${null!==(i=null==a?void 0:a.width)&&void 0!==i?i:24}px 1fr`,maxHeight:"fit-content",alignItems:"center",justifyContent:"flex-start",overflow:"hidden",boxSizing:"border-box"},children:[Hn.jsx("div",{"data-key":"image-container--partial-image",style:{display:"flex",flexDirection:"column",justifyContent:Q_(e),alignItems:r,overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",width:null!==(o=null==a?void 0:a.width)&&void 0!==o?o:24,height:"100%"},children:Hn.jsx(vk,{representation:t,textStyle:n})}),Hn.jsx("span",{style:{paddingRight:0,padding:4/(s<=2?2:1),alignSelf:Q_(e)},children:!!t.labelStructure&&yk(t.labelStructure)})]})},CU=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`,MU=({href:e,text:t,labelStructure:n,interactions:r,color:i})=>Hn.jsxs("span",{children:[Hn.jsx(sA,{...PI({href:e,text:t,interactions:r,color:i}),children:null!=n&&n.maskedValue?n.maskedValue:null==n?void 0:n.originalValue}),!!n&&CU(n)]}),_U=({children:e,textStyle:t})=>Hn.jsx("span",{style:{...t,border:"4px solid transparent",boxSizing:"border-box"},children:e}),kU=({cell:e,isCellSelected:t,isLeftColumn:n})=>{const{isActive:r}=J_(),{layoutService:i,styleService:o}=_E(),{interactions:a}=EE();let s=n&&!e.isNull?(e=>{const{representation:{text:t,labelStructure:n}}=e;if(!n||!n.originalValue)return t;const{originalValue:r,maskedValue:i,suffix:o,delimeter:a}=n;return`${0!==i.length?i:r} ${o?a:""} ${o}`.trim()})(e):e.representation.text;if(e.isEmpty)return null;const l=(({cell:e,styleService:t,isCellSelected:n,isLeftColumn:r})=>({...lg,...cg(r?Math.max(t.grid.lineClamp,e.leafCount*t.grid.lineClamp):t.grid.columnLineClamp),color:ik({cell:e,styleService:t,isCellSelected:n}),fontWeight:ok({cell:e,styleService:t}),fontStyle:ak({cell:e,styleService:t}),textDecoration:sk({cell:e,styleService:t}),fontFamily:t.dimensionValues.fontFamily,fontSize:t.dimensionValues.fontSize}))({cell:e,styleService:o,isCellSelected:t,isLeftColumn:n});if(e.representation.type===Wt.Image&&!e.isTotal&&!e.isNull){const{labelStructure:t}=e.representation,r=n&&t&&t.suffix?EU:xk;return Hn.jsx(r,{cell:e,representation:e.representation,textStyle:l,isLeftColumn:n,canExpandOrCollapse:e.ref.qCanCollapse||e.ref.qCanExpand,imageContainerHorizontalAlignment:AI(e,i,n)})}if(e.representation.type===Wt.Link&&!r&&!e.isTotal){const t=n&&e.representation.labelStructure?MU:OI;s=Hn.jsx(t,{text:e.representation.text,labelStructure:e.representation.labelStructure,href:e.representation.url,interactions:a,color:e.expressionColor.color})}return Hn.jsx(_U,{textStyle:{...l,...e.representation.type===Wt.Image&&e.isNull?{alignSelf:Q_(e)}:{}},children:s})},RU=({index:e,style:t,data:n})=>{const{styleService:r,layoutService:i}=_E(),{isSelected:o}=J_(),{isLeftColumn:a=!1,showLastBorder:s,itemCount:l,isLast:c,totalDividerIndex:u}=n,{isAdjustingWidth:d,setIsAdjustingWidth:p}=Bk([n]),h=RI(e,n),f=a?e===l-1:c,m=a?c:e===l-1,g=F_(h,u,i.isIndentModeEnabled);if(void 0===h){const{background:n}=r.dimensionValues;return Hn.jsx(j_,{style:{...t,background:n},index:e,isLastRow:f,isLastColumn:m,showLastBorder:s,isLeftColumn:a,showTotalCellDivider:g})}const y=o(h);return Hn.jsxs(LI,{reactWindowStyle:t,isLeftColumn:a,isLastRow:f,isLastColumn:m,isCellSelected:y,showTotalCellDivider:g,cell:h,data:n,isAdjustingWidth:d,index:e,children:[Hn.jsxs(z_,{verticalAlign:Q_(h),width:B_(h.representation),right:h.isLeftColumn?void 0:4,isLeftColumn:a,children:[Hn.jsx(dk,{isLeftColumn:a,isCellSelected:y,cell:h}),Hn.jsx(kU,{isLeftColumn:a,isCellSelected:y,cell:h})]}),Hn.jsx(Hk,{cellInfo:{...h,columnWidthLocation:h.isPseudoDimension?Jt.Measures:Jt.Dimension},columnWidth:t.width,isLastColumn:m,setIsAdjustingWidth:p})]})};var AU=t.memo(RU,E_);const IU=({list:e,listValues:t,isLastRow:n,getRightGridColumnWidth:r})=>i=>{var o;const a=n?e[i]:t.at(i);return a&&0===i&&a.x>0?(a.leafCount+a.x+a.distanceToNextCell)*r():!n&&a?(a.leafCount+a.distanceToNextCell)*r():r(null!==(o=null==a?void 0:a.x)&&void 0!==o?o:i)},LU=(e,t,n,r)=>{const i=Object.values(e);let o,a=i.length;return r&&(a=n,o=t/a),{itemCount:a,estimatedItemSize:o,listValues:i}},DU=(e,t)=>n=>{e.current&&(e.current[t]=n)},PU={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...ag},OU={overflow:"hidden",willChange:"auto",flexShrink:0},TU=({leftGridRef:e,width:t,height:n,columnWidths:r,showLastBorder:i})=>{const{pageInfo:o}=xE(),{layoutService:a,styleService:{contentCellHeight:s,grid:{divider:l}}}=_E(),{qSize:c}=a.layout.qHyperCube,{gridSectionsData:{leftDimensionData:u},visibleDimensionsInfo:{visibleLeftDimensionInfo:d}}=hM();kI(e,u),_I(e,t,n,s);const p=o.rowsOnCurrentPage*s,h={...PU,borderColor:l,width:r.reduce(((e,t)=>e+t),0)};return Hn.jsx("div",{style:h,"data-section-id":"LEFT_GRID",children:u.grid.map(((t,l)=>{const h=l===u.columnCount-1,f=jE(d[l]),{itemCount:m,estimatedItemSize:g,listValues:y}=LU(t,p,o.rowsOnCurrentPage,h),b=a.isIndentModeEnabled?()=>s:((e,t,n,r,i)=>o=>{const a=r?e[o]:t.at(o);if(a&&0===o&&a.pageY>0)return(a.leafCount+a.pageY+a.distanceToNextCell)*n;if(a&&a.leafCount>0){const e=a.y===i-a.leafCount;return(a.leafCount-(e?a.ref.qUp:0)+a.distanceToNextCell)*n}return n})(t,y,s,h,c.qcy);return Hn.jsx(v_,{ref:DU(e,l),style:{...OU,flexGrow:h?1:0},height:n,width:r[l],itemCount:m,itemSize:b,layout:"vertical",itemData:{list:t,isLeftColumn:!0,isLast:h,itemCount:m,showLastBorder:i,listValues:y,totalDividerIndex:u.totalDividerIndex},itemKey:Pk,estimatedItemSize:g,children:AU},f)}))})};var NU=f(TU);const qU={overflow:"hidden",willChange:"auto"},FU={...ag,borderWidth:"0px 0px 0px 1px"},jU=({topGridRef:e,rowHightCallback:t,width:n,height:r,showLastBorder:i,getRightGridColumnWidth:o})=>{const{layoutService:a,styleService:{grid:{divider:s},headerCellHeight:l}}=_E(),{gridSectionsData:{headersData:c,topDimensionData:u}}=hM(),d={...FU,borderColor:s,height:r};kI(e,u),_I(e,n,r,l);const p=a.size.x*o();return 0===u.rowCount?Hn.jsx("div",{style:{width:n,height:r,...FU}}):Hn.jsx("div",{style:d,"data-section-id":"TOP_GRID",children:u.grid.map(((r,s)=>{const l=s===u.rowCount-1,{itemCount:d,estimatedItemSize:h,listValues:f}=LU(r,p,a.size.x,l),m=(({layoutService:e,headersData:t,topRowIndex:n})=>{const r=t.data.at(n);if(void 0===r)return;const i=t.size.x-1,o=SI({layoutService:e,headersData:t,topRowIndex:n})?0:i,a=r.at(o),s=Array.isArray(a)?a.at(i):a;return s?e.getDimensionInfo(s.dimensionInfoIndex):void 0})({layoutService:a,headersData:c,topRowIndex:s}),g=m?jE(m):`empty ${s}`;return Hn.jsx(v_,{ref:DU(e,s),style:qU,height:t(),width:n,itemCount:d,itemSize:IU({list:r,listValues:f,isLastRow:l,getRightGridColumnWidth:o}),layout:"horizontal",itemData:{list:r,isLast:l,itemCount:d,showLastBorder:i,listValues:f,totalDividerIndex:u.totalDividerIndex},itemKey:Pk,estimatedItemSize:h,children:AU},g)}))})};var zU=f(jU);const BU=()=>{const{styleService:{headerCellHeight:e,contentCellHeight:t}}=_E(),n=FM(),r=(()=>{const{model:e}=EE(),t=d((async(t,n)=>{if(!e)throw new Error("No Model provided!");const{qReverseSort:r,dimensionInfoIndex:i,sortDirection:o}=t,a=[];if(n===o)return!1;a.push({qPath:`/qHyperCubeDef/qDimensions/${i}/qDef/qReverseSort`,qOp:"Replace",qValue:(!r).toString()});try{return await e.applyPatches(a,!0),!0}catch(e){return console.error("Error while applying patch: ",e),!1}}),[e]);return t})(),{gridSectionsWrapperRefs:{headerGridWrapperRef:i,topGridWrapperRef:o,leftGridWrapperRef:a,dataGridWrapperRef:s},gridRefs:{topGridRef:l,leftGridRef:c,dataGridRef:u},scrollDirectionRefs:{verticalScrollDirection:h,horizontalScrollDirection:f},scrollbarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g,resetHorizontalScrollbarHeight:y}}=qM(),{leftGridWidth:b,leftGridFullWidth:v,leftGridColumnWidths:x,rightGridFullWidth:w,showLastRightBorder:S,getRightGridColumnWidth:E,getHeaderCellsIconsVisibilityStatus:C,overrideLeftGridWidth:M}=function({tableWidth:e,verticalScrollbarWidth:t,resetHorizontalScrollbarHeight:n}){const{layoutService:r,styleService:i}=_E(),{gridSectionsData:{headersData:o}}=hM(),{measureText:a}=Tg(i.header),s=IM({tableWidth:e}),l=LM({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:s.leftGridWidth}),c=s.leftGridWidth+l.rightGridFullWidth+1<e,u=d(((e,t,n="")=>{let i=e;r.isIndentModeEnabled&&(i=1,1===o.size.x&&(i=0));const l=s.leftGridColumnWidths[i];let c=!1,u=!1,d=a(n)+mM;return t&&d+20<=l&&(u=!0,d+=20),d+20<=l&&(c=!0),{shouldShowMenuIcon:c,shouldShowLockIcon:u}}),[s.leftGridColumnWidths,a,r.isIndentModeEnabled,o.size.x]);return p((()=>{const e=s.leftGridWidth===s.leftGridFullWidth,t=l.rightGridWidth===l.rightGridFullWidth;e&&t&&n()}),[n,s.leftGridWidth,s.leftGridFullWidth,l.rightGridWidth,l.rightGridFullWidth]),{...s,...l,showLastRightBorder:c,getHeaderCellsIconsVisibilityStatus:u}}({tableWidth:n.width,verticalScrollbarWidth:m,resetHorizontalScrollbarHeight:y}),{gridScaffoldDimensions:_,headerGridDims:k,topGridDims:R,leftGridDims:A,dataGridDims:I,metadata:{everyThingFitsInTableRectHeight:L,scrollbarsVisibilityStatus:D}}=(({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:n,leftGridOriginalWidth:r,rightGridOriginalWidth:i},scrollBarsDimensions:{verticalScrollbarWidth:o,horizontalScrollbarHeight:a}})=>{const s=FM(),{pageInfo:l}=xE(),{gridSectionsData:{headersData:c,topDimensionData:u}}=hM(),d=Math.min(s.height*gM,Math.max(s.height*gM-25,s.height-t-a)),p=s.width*gM,h=l.rowsOnCurrentPage*t,f=Math.max(c.size.y,u.rowCount,1),m=e*f,g=e*f,y=Math.min(p,n),b=s.width-p,v=Math.max(b,s.width-y),x=Math.min(d,m,g),{availableHeight:w,everyThingFitsInTableRectHeight:S,everyThingFitsInTableRectWidth:E}=((e,t,n)=>{const r=t+1+n+o<=s.width,i=e+1+h+a,l=i-s.height<a||i<=s.height;return{availableHeight:l?i:s.height,everyThingFitsInTableRectHeight:l,everyThingFitsInTableRectWidth:r}})(x,y,v),C=w-d,M=Math.max(C,w-x),_=Math.min(M,h),k=Math.min(M,h),R=m+1+h,{visibilityStatus:A,metadata:{hasLeftGridOverflowX:I,hasDataGridOverflowX:L}}=(e=>{const{gridScaffold:{X_AXIS:{leftSectionWidth:t,rightSectionWidth:n},Y_AXIS:{topSectionHeight:r,bottomSectionHeight:i}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:o,rightSectionFullWidth:a},Y_AXIS:{topSectionFullHeight:s,bottomSectionFullHeight:l}}}=e,c=s>r,u=o>t,d=a>n,p=l>i;return{visibilityStatus:{topGrid:{overflowX:"hidden",overflowY:c?"scroll":"hidden"},leftGrid:{overflowX:u?"scroll":"hidden",overflowY:"hidden"},dataGrid:{overflowX:d?"scroll":"hidden",overflowY:p?"scroll":"hidden"}},metadata:{hasTopGridOverflowY:c,hasLeftGridOverflowX:u,hasDataGridOverflowX:d,hasDataGridOverflowY:p}}})({gridScaffold:{X_AXIS:{leftSectionWidth:y,rightSectionWidth:v},Y_AXIS:{topSectionHeight:x,bottomSectionHeight:M}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:r,rightSectionFullWidth:i},Y_AXIS:{topSectionFullHeight:g,bottomSectionFullHeight:R-g}}});return{gridScaffoldDimensions:{width:s.width,height:s.height,gridTemplateColumns:`${y}px ${v}px`,gridTemplateRows:`${x}px ${M}px`},headerGridDims:{width:-1,height:x},topGridDims:{fullSizeWrapper:{width:i-o+(L?o:0),height:g},stickyWrapper:{width:v-1-o,height:-1},self:{width:Math.min(i,v)-(E?1:0)-o,height:g}},leftGridDims:{fullSizeWrapper:{width:y,height:R-g+(!I&&L?a:0)},stickyWrapper:{width:y,height:M-1-a},self:{width:y,height:Math.max(t,_-(S?0:a-1))}},dataGridDims:{fullSizeWrapper:{width:i-o+(L?o:0),height:R-g+(!L&&I?a:0)},stickyWrapper:{width:v-1-o,height:M-1-a},self:{width:Math.min(i,v)-(E?1:0)-o,height:Math.max(t,k-(S?0:a-1))}},metadata:{everyThingFitsInTableRectHeight:S,scrollbarsVisibilityStatus:A}}})({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:b,leftGridOriginalWidth:v,rightGridOriginalWidth:w},scrollBarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g}}),P=d((()=>e),[e]),O=d((()=>t),[t]);return(()=>{const{downloadService:e}=_E();p((()=>{e.isDownloadedAsPDForImage&&e.notifyIsDoneRendering()}))})(),Hn.jsxs(zM,{style:_,children:[Hn.jsx("div",{style:{overflow:"hidden"},ref:i,children:Hn.jsx(MI,{tableWidth:n.width,leftGridWidth:b,columnWidths:x,getHeaderCellsIconsVisibilityStatus:C,rowHight:e,height:k.height,changeSortOrder:r,overrideLeftGridWidth:M})}),Hn.jsx($M,{style:D.topGrid,origin:Qt.TopGrid,ref:o,children:Hn.jsx(jM,{style:R.fullSizeWrapper,children:Hn.jsx(HM,{style:R.stickyWrapper,children:Hn.jsx(zU,{topGridRef:l,rowHightCallback:P,...R.self,showLastBorder:{right:S,bottom:!1},getRightGridColumnWidth:E})})})}),Hn.jsx($M,{style:D.leftGrid,origin:Qt.LeftGrid,ref:a,children:Hn.jsx(jM,{style:A.fullSizeWrapper,children:Hn.jsx(HM,{style:A.stickyWrapper,children:Hn.jsx(NU,{leftGridRef:c,...A.self,columnWidths:x,showLastBorder:{right:!1,bottom:L}})})})}),Hn.jsx($M,{style:D.dataGrid,origin:Qt.DataGrid,ref:s,children:Hn.jsx(jM,{style:I.fullSizeWrapper,children:Hn.jsx(HM,{style:I.stickyWrapper,children:Hn.jsx(qk,{dataGridRef:u,rowHightCallback:O,...I.self,showLastBorder:{right:S,bottom:L},getRightGridColumnWidth:E,verticalScrollDirection:h,horizontalScrollDirection:f})})})})]})},WU=()=>{const{keyboard:e,theme:t,interactions:n,translator:r}=EE(),{pageInfo:i,updatePageInfo:o,rect:a}=xE(),{layoutService:s}=_E(),{layout:l,hasData:c}=s;return Hn.jsxs(Hn.Fragment,{children:[c?Hn.jsx(BU,{}):null,Hn.jsx(RE,{}),Hn.jsx(bE,{paginationNeeded:i.shouldShowPagination,handleChangePage:e=>{o({page:e})},pageInfo:i,totalRowCount:i.totalRowCount,totalColumnCount:0,totalPages:i.totalPages,keyboard:e,translator:r,theme:t,interactions:n,rect:a,layout:l})]})},$U={WHITE:"#FFFFFF",GREEN_ULTRA_LIGHT:"#F2F9F5",GREEN:"#00873D",GREEN_PALE:"#15AA51",GREEN_DARK:"#0D6932",GREEN_EXTRA_DARK:"#094923",BLUE_ULTRA_LIGHT:"#EDF7FC",BLUE:"#005DB9",BLUE_PALE:"#048DEC",BLUE_DARK:"#003A8F",BLUE_EXTRA_DARK:"#002D6D",RED_ULTRA_LIGHT:"#FEF2F6",RED:"#D7004B",RED_PALE:"#F15A81",RED_DARK:"#8B0041",RED_EXTRA_DARK:"#5C002B",ORANGE_ULTRA_LIGHT:"#FFF7EB",ORANGE:"#EF6D00",ORANGE_PALE:"#FF9800",ORANGE_DARK:"#BF3900",ORANGE_EXTRA_DARK:"#611100",PURPLE:"#655dc6",PURPLE_PALE:"#8D8BCE",PURPLE_DARK:"#413885",GREYSCALE_0:"#000000",GREYSCALE_5:"#0E0E0E",GREYSCALE_10:"#1A1A1A",GREYSCALE_15:"#262626",GREYSCALE_20:"#333333",GREYSCALE_25:"#404040",GREYSCALE_30:"#4D4D4D",GREYSCALE_35:"#595959",GREYSCALE_40:"#666666",GREYSCALE_45:"#737373",GREYSCALE_50:"#808080",GREYSCALE_55:"#8C8C8C",GREYSCALE_60:"#999999",GREYSCALE_65:"#A6A6A6",GREYSCALE_70:"#B3B3B3",GREYSCALE_75:"#BFBFBF",GREYSCALE_80:"#CCCCCC",GREYSCALE_85:"#D9D9D9",GREYSCALE_90:"#E6E6E6",GREYSCALE_95:"#F2F2F2",GREYSCALE_98:"#FAFAFA",GREYSCALE_100:"#FFFFFF",GREYSCALE_0_0:"rgba(0, 0, 0, 0)",GREYSCALE_0_03:"rgba(0, 0, 0, 0.03)",GREYSCALE_0_05:"rgba(0, 0, 0, 0.05)",GREYSCALE_0_06:"rgba(0, 0, 0, 0.06)",GREYSCALE_0_10:"rgba(0, 0, 0, 0.1)",GREYSCALE_0_15:"rgba(0, 0, 0, 0.15)",GREYSCALE_0_20:"rgba(0, 0, 0, 0.2)",GREYSCALE_0_30:"rgba(0, 0, 0, 0.3)",GREYSCALE_0_42:"rgba(0, 0, 0, 0.42)",GREYSCALE_0_55:"rgba(0, 0, 0, 0.55)",GREYSCALE_0_60:"rgba(0, 0, 0, 0.6)",GREYSCALE_100_15:"rgba(255, 255, 255, 0.15)",GREYSCALE_100_50:"rgba(255, 255, 255, 0.5)",GREYSCALE_100_60:"rgba(255, 255, 255, 0.6)",MISC_FOCUS_BORDER:"#0275D9",TEXT_PRIMARY:"#404040",TEXT_SECONDARY:"rgba(0, 0, 0, 0.55)"},HU=12,VU=14,GU=16,UU=24,YU=3,KU=300,XU=400,JU=600,ZU=700,QU={FONT_FAMILY:"'Source Sans Pro', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif"};yn($U.GREYSCALE_0,.05),yn($U.GREEN_PALE,.5),yn($U.BLUE_PALE,.5),yn($U.GREEN_PALE,.5),yn($U.BLUE_PALE,.5),yn($U.GREEN_PALE,.5),yn($U.BLUE_PALE,.5);var eY;function tY(){return tY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tY.apply(null,arguments)}yn($U.GREEN_PALE,.5),yn($U.BLUE_PALE,.5),yn($U.GREEN_PALE,.5),yn($U.BLUE_PALE,.5);var nY,rY=function(t){return e.createElement("svg",tY({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),eY||(eY=e.createElement("path",{d:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5z"})))};function iY(){return iY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iY.apply(null,arguments)}var oY=function(t){return e.createElement("svg",iY({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),nY||(nY=e.createElement("path",{d:"m9.345 8 3.982 3.982a.951.951 0 0 1-1.345 1.345L8 9.345l-3.982 3.982a.951.951 0 0 1-1.345-1.345L6.655 8 2.673 4.018a.951.951 0 0 1 1.345-1.345L8 6.655l3.982-3.982a.951.951 0 1 1 1.345 1.345z"})))};function aY({fontSize:e="medium",children:t=null,className:n=""}={}){const r="small"===e?"16px":"20px",i="small"===e?"-2px 0":void 0;return Hn.jsx("i",{style:{fontSize:r,margin:i,display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-.125em",textRendering:"optimizeLegibility",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},className:n,children:t})}function sY(e={}){return Hn.jsx(aY,{...e,children:Hn.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20",children:[Hn.jsx("rect",{width:"20",height:"20",fill:"currentColor",rx:"3"}),Hn.jsx("path",{fill:"#FFFFFF",fillRule:"evenodd",d:"m12.627 6.617-4.206 4.205-1.037-1.035a1.25 1.25 0 1 0-1.768 1.767l1.92 1.919a1.25 1.25 0 0 0 1.769 0l5.09-5.089a1.25 1.25 0 1 0-1.768-1.768Z",clipRule:"evenodd"})]})})}function lY(e={}){return Hn.jsx(aY,{...e,children:Hn.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:Hn.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[Hn.jsx("rect",{fill:"currentColor",x:"0",y:"0",width:"16",height:"16",rx:"3"}),Hn.jsx("rect",{fill:"#FFFFFF",x:"4",y:"7",width:"8",height:"2",rx:"1"})]})})})}function cY(e={}){return Hn.jsx(aY,{fontSize:"medium",...e,children:Hn.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:Hn.jsx("g",{strokeWidth:"1",fillRule:"evenodd",fillOpacity:"0.603119339",strokeOpacity:"0.146654212",children:Hn.jsx("rect",{stroke:"currentStroke",fill:"currentFill",x:"0.5",y:"0.5",width:"15",height:"15",rx:"7.5"})})})})}function uY(e={}){return Hn.jsx(aY,{fontSize:"medium",...e,children:Hn.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Hn.jsx("rect",{stroke:"none",width:"16",height:"16",rx:"8",fill:"currentColor"}),Hn.jsx("path",{d:"M11 8C11 9.65685 9.65685 11 8 11C6.34315 11 5 9.65685 5 8C5 6.34315 6.34315 5 8 5C9.65685 5 11 6.34315 11 8Z",stroke:"none",fill:"white"})]})})}function dY({className:e}){return Hn.jsx(aY,{fontSize:"small",className:e,children:Hn.jsx("svg",{width:"8px",height:"14px",viewBox:"0 0 8 14",version:"1.1","aria-labelledby":"SortIcon",children:Hn.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:Hn.jsx("g",{transform:"translate(-4.000000, -1.000000)",fill:"#404040",fillRule:"nonzero",children:Hn.jsxs("g",{transform:"translate(4.324187, 1.300372)",children:[Hn.jsx("path",{d:"M4.06624695,13.2115849 L7.28588573,9.1870364 C7.3893886,9.05765782 7.36841219,8.8688701 7.23903361,8.76536724 C7.18583969,8.72281211 7.11974654,8.69962788 7.05162509,8.69962788 L0.3,8.69962788 C0.134314575,8.69962788 -1.25807407e-14,8.83394246 -1.26010313e-14,8.99962788 C-1.26093738e-14,9.06774933 0.0231842256,9.13384248 0.0657393572,9.1870364 L3.28537814,13.2115849 C3.45788292,13.4272158 3.7725291,13.4621765 3.98816007,13.2896718 C4.01699242,13.2666059 4.04318107,13.2404172 4.06624695,13.2115849 Z",opacity:"0.300390625"}),Hn.jsx("path",{d:"M4.06624695,0.187670888 L7.28588573,4.21221937 C7.3893886,4.34159795 7.36841219,4.53038566 7.23903361,4.63388852 C7.18583969,4.67644366 7.11974654,4.69962788 7.05162509,4.69962788 L0.3,4.69962788 C0.134314575,4.69962788 2.1918781e-12,4.56531331 2.19185781e-12,4.39962788 C2.19184946e-12,4.33150643 0.0231842256,4.26541328 0.0657393572,4.21221937 L3.28537814,0.187670888 C3.45788292,-0.0279600799 3.7725291,-0.0629207673 3.98816007,0.109584007 C4.01699242,0.132649888 4.04318107,0.158838536 4.06624695,0.187670888 Z"})]})})})})})}function pY(e={}){return Hn.jsx(aY,{...e,children:Hn.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:Hn.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:Hn.jsx("rect",{stroke:$U.GREYSCALE_0_42,fill:"currentColor",x:"0.5",y:"0.5",width:"15",height:"15",rx:"3"})})})})}Hn.jsx(oY,{"aria-hidden":"true",viewBox:"0 0 16 16",width:12,height:12}),Hn.jsx(rY,{"aria-hidden":"true",viewBox:"0 0 16 16",width:12,height:12}),Hn.jsx(cY,{}),Hn.jsx(uY,{}),Hn.jsx((function(e={}){return Hn.jsx(aY,{...e,children:Hn.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:Hn.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:"0.603119339",strokeOpacity:"0.146654212",children:Hn.jsx("rect",{stroke:"#000000",fill:"currentColor",x:"0.5",y:"0.5",width:"15",height:"15",rx:"3"})})})})}),{}),Hn.jsx(sY,{}),Hn.jsx(lY,{}),Hn.jsx(rY,{style:{color:$U.TEXT_PRIMARY},"aria-hidden":"true",viewBox:"0 0 16 16",width:16,height:16});const hY={MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0,focusVisibleClassName:"sprout-focus-visible"},styleOverrides:{root:{}}},MuiButton:{defaultProps:{color:"inherit",disableRipple:!0,focusVisibleClassName:"sprout-focus-visible"},styleOverrides:{root:{height:"32px",lineHeight:"16px",minWidth:"24px",fontSize:14,borderRadius:YU,"& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"},transition:"unset",color:"var(--sprout-common-foreground-color-default)",boxShadow:"none","&:hover":{backgroundColor:"var(--sprout-common-background-color-hover)"},"&:active":{backgroundColor:"var(--sprout-common-background-color-pressed)"},"&.Mui-disabled":{backgroundColor:"var(--sprout-common-background-color-disabled)"},"&.Mui-focusVisible":{outline:"var(--sprout-focus-border-default)",outlineOffset:"calc(var(--sprout-focus-border-default-width) / -2)",backgroundColor:"var(--sprout-focus-background-color-default)",zIndex:100}},text:{padding:"8px 16px",backgroundColor:"transparent"},textPrimary:{color:"var(--sprout-brand-primary-color-default)"},textSecondary:{color:"var(--sprout-info-color-default)"},textWarning:{color:"var(--sprout-warning-color-default)"},textError:{color:"var(--sprout-danger-color-default)"},outlined:{padding:"7px 16px",border:"var(--sprout-common-border-moderate)",backgroundColor:"var(--sprout-common-background-color-enabled)","&.Mui-focusVisible":{borderColor:"transparent"},"&:hover":{border:"var(--sprout-common-border-moderate)"}},outlinedPrimary:{borderColor:"var(--sprout-brand-primary-color-default)",color:"var(--sprout-brand-primary-color-default)","&:hover":{borderColor:"var(--sprout-brand-primary-color-default)"}},outlinedSecondary:{borderColor:"var(--sprout-info-color-default)",color:"var(--sprout-info-color-default)","&:hover":{borderColor:"var(--sprout-info-color-default)"}},outlinedWarning:{borderColor:"var(--sprout-warning-color-default)",color:"var(--sprout-warning-color-default)","&:hover":{borderColor:"var(--sprout-warning-color-default)"}},outlinedError:{borderColor:"var(--sprout-danger-color-default)",color:"var(--sprout-danger-color-default)","&:hover":{borderColor:"var(--sprout-danger-color-default)"}},contained:{color:"var(--sprout-brand-primary-color-inverse)",backgroundColor:"var(--sprout-brand-primary-color-default)",padding:"8px 16px","&:hover":{backgroundColor:"var(--sprout-brand-primary-color-hover)"},"&:active":{backgroundColor:"var(--sprout-brand-primary-color-pressed)"},"&.Mui-focusVisible":{outline:"var(--sprout-focus-border-default)",outlineOffset:"var(--sprout-focus-border-default-width)",background:"var(--sprout-brand-primary-color-focus)"}},containedError:{backgroundColor:"var(--sprout-danger-color-default)","&:hover":{backgroundColor:"var(--sprout-danger-color-hover)"},"&:active":{backgroundColor:"var(--sprout-danger-color-pressed)"},"&.Mui-focusVisible":{outlineColor:"var(--sprout-danger-color-inverse)",backgroundColor:"var(--sprout-danger-color-focus)"}},sizeSmall:{fontSize:12,height:"24px","& > svg:only-child, & > i:only-child":{marginLeft:"-7px",marginRight:"-7px"}},sizeLarge:{fontSize:16,height:"40px",lineHeight:"20px","& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},textSizeSmall:{padding:"4px 11px"},textSizeLarge:{padding:"10px 19px"},outlinedSizeSmall:{padding:"3px 11px"},outlinedSizeLarge:{padding:"9px 19px"},containedSizeSmall:{padding:"4px 11px"},containedSizeLarge:{padding:"10px 19px"}},variants:[]}};var fY=(e,t)=>(e=>({MuiAccordion:{styleOverrides:{root:{backgroundColor:$U.GREYSCALE_98,"&:before":{backgroundColor:"unset"},"&.Mui-expanded":{margin:"0px"}}}},MuiAccordionDetails:{styleOverrides:{root:{backgroundColor:$U.WHITE}}},MuiAccordionSummary:{defaultProps:{expandIcon:Hn.jsx(rY,{"aria-hidden":"true",viewBox:"0 0 16 16",width:16,height:16})},styleOverrides:{root:{padding:"0px 12px 0px 16px",minHeight:"auto",boxShadow:`inset 0px -1px 0px 0px ${$U.GREYSCALE_0_15}`,"&.Mui-focusVisible":{borderColor:$U.MISC_FOCUS_BORDER,boxShadow:`inset 0 0 0 2px ${$U.MISC_FOCUS_BORDER}`,borderRadius:YU,backgroundColor:$U.GREYSCALE_0_03},"&.Mui-expanded":{minHeight:"auto"}},content:{overflow:"hidden",textOverflow:"ellipsis","&.Mui-expanded":{margin:"12px 0px"}}}},MuiAppBar:{defaultProps:{elevation:0},styleOverrides:{root:{flex:"0 0 48px",boxShadow:`inset 0 -1px 0 0 ${$U.GREYSCALE_0_15}`},colorPrimary:{backgroundColor:$U.WHITE,color:$U.TEXT_PRIMARY}}},MuiBadge:{styleOverrides:{badge:{height:"16px",minWidth:"16px",fontSize:"12px",padding:"0px 5px"},anchorOriginTopRightRectangular:{top:"-3px",right:"-3px"}}},MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0,focusVisibleClassName:"sprout-focus-visible"}},MuiButtonGroup:{defaultProps:{disableRipple:!0},styleOverrides:{root:{height:"32px",lineHeight:"16px",fontSize:14,borderRadius:YU},text:{padding:"8px 16px","&.Mui-focusVisible":{boxShadow:`0 0 0 2px ${$U.MISC_FOCUS_BORDER}`}},outlined:{padding:"7px 16px",borderColor:$U.GREYSCALE_0_15,backgroundColor:$U.GREYSCALE_100_60,"&.Mui-focusVisible":{borderColor:$U.MISC_FOCUS_BORDER,boxShadow:`0 0 0 1px ${$U.MISC_FOCUS_BORDER}`}},contained:{padding:"8px 16px",boxShadow:"none","&:hover":{boxShadow:"none"},"&:active":{boxShadow:"none"}},groupedContainedPrimary:{"&:hover":{backgroundColor:$U.GREEN_PALE},"&:active":{backgroundColor:$U.GREEN_DARK},"&.Mui-focusVisible":{borderColor:$U.GREEN_PALE,boxShadow:`0 0 0 3px ${Sb($U.GREEN_PALE,.5)}`}},groupedContainedSecondary:{"&:hover":{backgroundColor:$U.BLUE_PALE},"&:active":{backgroundColor:$U.BLUE_DARK},"&.Mui-focusVisible":{borderColor:$U.BLUE_PALE,boxShadow:`0 0 0 3px ${Sb($U.BLUE_PALE,.5)}`}}},variants:[{props:{size:"small"},style:{height:"24px"}},{props:{size:"large"},style:{height:"40px"}}]},MuiButton:{defaultProps:{color:"inherit",disableRipple:!0,focusVisibleClassName:"sprout-focus-visible"},styleOverrides:{root:{height:"32px",lineHeight:"16px",minWidth:"24px",fontSize:14,borderRadius:YU,"& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},text:{padding:"8px 16px","&:active":{backgroundColor:$U.GREYSCALE_0_10},"&.Mui-focusVisible":{boxShadow:`0 0 0 2px ${$U.MISC_FOCUS_BORDER}`}},outlined:({ownerState:e})=>({padding:"7px 16px",borderColor:$U.GREYSCALE_0_15,backgroundColor:$U.GREYSCALE_100_60,"&:active":{backgroundColor:$U.GREYSCALE_0_10},"&.Mui-focusVisible":{borderColor:$U.MISC_FOCUS_BORDER,boxShadow:`0 0 0 1px ${$U.MISC_FOCUS_BORDER}`},..."amethyst"===e.color&&{borderColor:$U.PURPLE,"&.Mui-focusVisible":{borderColor:$U.PURPLE,boxShadow:`0 0 0 3px ${Sb($U.PURPLE_PALE,.5)}`}}}),outlinedPrimary:{borderColor:$U.GREEN,"&.Mui-focusVisible":{borderColor:$U.GREEN,boxShadow:`0 0 0 3px ${Sb($U.GREEN_PALE,.5)}`}},outlinedSecondary:{borderColor:$U.BLUE,"&.Mui-focusVisible":{borderColor:$U.BLUE,boxShadow:`0 0 0 3px ${Sb($U.BLUE_PALE,.5)}`}},outlinedWarning:{borderColor:$U.ORANGE,"&.Mui-focusVisible":{borderColor:$U.ORANGE,boxShadow:`0 0 0 3px ${Sb($U.ORANGE_PALE,.5)}`}},outlinedError:{borderColor:$U.RED,"&.Mui-focusVisible":{borderColor:$U.RED,boxShadow:`0 0 0 3px ${Sb($U.RED_PALE,.5)}`}},contained:({ownerState:e})=>({color:$U.WHITE,padding:"8px 16px",boxShadow:"none","&:hover":{boxShadow:"none"},"&:active":{boxShadow:"none"},..."amethyst"===e.color&&{"&:hover":{backgroundColor:$U.PURPLE_PALE},"&:active":{backgroundColor:$U.PURPLE_DARK},"&.Mui-focusVisible":{borderColor:$U.PURPLE_PALE,boxShadow:`0 0 0 3px ${Sb($U.PURPLE_PALE,.5)}`}}}),containedPrimary:{"&:hover":{backgroundColor:$U.GREEN_PALE},"&:active":{backgroundColor:$U.GREEN_DARK},"&.Mui-focusVisible":{borderColor:$U.GREEN_PALE,boxShadow:`0 0 0 3px ${Sb($U.GREEN_PALE,.5)}`}},containedSecondary:{"&:hover":{backgroundColor:$U.BLUE_PALE},"&:active":{backgroundColor:$U.BLUE_DARK},"&.Mui-focusVisible":{borderColor:$U.BLUE_PALE,boxShadow:`0 0 0 3px ${Sb($U.BLUE_PALE,.5)}`}},containedWarning:{"&:hover":{backgroundColor:$U.ORANGE_PALE},"&:active":{backgroundColor:$U.ORANGE_DARK},"&.Mui-focusVisible":{borderColor:$U.ORANGE_PALE,boxShadow:`0 0 0 3px ${Sb($U.ORANGE_PALE,.5)}`}},containedError:{"&:hover":{backgroundColor:$U.RED_PALE},"&:active":{backgroundColor:$U.RED_DARK},"&.Mui-focusVisible":{borderColor:$U.RED_PALE,boxShadow:`0 0 0 3px ${Sb($U.RED_PALE,.5)}`}},sizeSmall:{fontSize:12,height:"24px","& > svg:only-child, & > i:only-child":{marginLeft:"-7px",marginRight:"-7px"}},sizeLarge:{fontSize:16,height:"40px",lineHeight:"20px","& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},textSizeSmall:{padding:"4px 11px"},textSizeLarge:{padding:"10px 19px"},outlinedSizeSmall:{padding:"3px 11px"},outlinedSizeLarge:{padding:"9px 19px"},containedSizeSmall:{padding:"4px 11px"},containedSizeLarge:{padding:"10px 19px"}},variants:[]},MuiCardActionArea:{styleOverrides:{root:{height:"100%","&.MuiCardActionArea-focusHighlight":{opacity:0},"&:hover":{boxShadow:"none",backgroundColor:$U.GREYSCALE_0_03,"&.MuiCardActionArea-focusHighlight":{opacity:0}},"&:active":{backgroundColor:$U.GREYSCALE_95,boxShadow:"none"},"&.Mui-focusVisible":{borderRadius:YU,boxShadow:`inset 0 0 0 2px ${$U.MISC_FOCUS_BORDER}`,"&.MuiCardActionArea-focusHighlight":{opacity:0}}}}},MuiChip:{defaultProps:{deleteIcon:Hn.jsx(oY,{"aria-hidden":"true",viewBox:"0 0 16 16",width:12,height:12}),variant:"outlined"},styleOverrides:{root:{height:"24px",fontSize:HU,borderRadius:YU,color:$U.TEXT_PRIMARY,backgroundColor:$U.GREYSCALE_100_15,"&.sprout-focus-visible":{borderColor:$U.MISC_FOCUS_BORDER,boxShadow:`0px 0px 0px 1px ${$U.MISC_FOCUS_BORDER}`},"&.Mui-focusVisible":{backgroundColor:$U.GREYSCALE_0_03},"&.Mui-disabled":{backgroundColor:$U.GREYSCALE_0_05,color:$U.GREYSCALE_0_30,border:"none",opacity:1},"&.MuiChip-outlinedSuccess":{color:$U.GREEN,borderColor:$U.GREEN},"&.MuiChip-outlinedInfo":{color:$U.BLUE,borderColor:$U.BLUE},"&.MuiChip-outlinedWarning":{color:$U.ORANGE,borderColor:$U.ORANGE},"&.MuiChip-outlinedError":{color:$U.RED,borderColor:$U.RED}},outlined:{border:`solid 1px ${$U.GREYSCALE_0_15}`,backgroundColor:$U.GREYSCALE_100_15,".MuiChip-clickable&:active ":{boxSizing:"border-box",borderRadius:YU,boxShadow:"none",backgroundColor:$U.GREYSCALE_0_10},"&.MuiChip-deleteIconSmall":{height:13,color:"inherit"}},outlinedPrimary:{color:$U.GREEN,borderColor:$U.GREEN},outlinedSecondary:{color:$U.BLUE,borderColor:$U.BLUE},label:{fontFamily:QU.FONT_FAMILY,lineHeight:"16px"}}},MuiAutocomplete:{defaultProps:{clearIcon:Hn.jsx(oY,{"aria-hidden":"true",viewBox:"0 0 16 16",height:12,width:12}),popupIcon:Hn.jsx(rY,{"aria-hidden":"true",viewBox:"0 0 16 16",width:12,height:12}),forcePopupIcon:!0},styleOverrides:{root:{"& .MuiAutocomplete-endAdornment > button":{border:"none",backgroundColor:"unset"}},input:{"&.MuiAutocomplete-input":{padding:"6px 4px"}},inputRoot:{padding:"0px 2px",boxSizing:"border-box",borderRadius:YU},listbox:{padding:"0","& .MuiAutocomplete-option":{height:"32px",minHeight:"32px"}},option:{borderRadius:YU,fontSize:VU,height:"32px",padding:"6px 16px",minHeight:"32px","&.MuiAutocomplete-option.Mui-focused":{backgroundColor:$U.GREYSCALE_0_03,"&.Mui-focusVisible":{border:`solid 2px ${$U.MISC_FOCUS_BORDER}`,padding:"4px 14px"}},'&.MuiAutocomplete-option[aria-selected="true"]':{backgroundColor:$U.GREYSCALE_0_05,"&.Mui-focused":{backgroundColor:$U.GREYSCALE_0_05},"&.Mui-focusVisible":{backgroundColor:$U.GREYSCALE_0_05}}},popupIndicator:{borderRadius:YU,border:`solid 1px ${$U.GREYSCALE_0_15}`,color:$U.GREYSCALE_0_60,marginRight:0,width:UU,height:UU},paper:{marginTop:"4px",boxShadow:`0px 2px 4px 0px ${$U.GREYSCALE_0_15}`},clearIndicator:{borderRadius:YU,marginRight:"4px"},popupIndicatorOpen:{backgroundColor:$U.GREYSCALE_0_10}}},MuiFormControlLabel:{styleOverrides:{root:{marginLeft:"-10px"},label:{fontSize:VU}}},MuiFormHelperText:{styleOverrides:{root:{fontSize:HU,lineHeight:"16px",margin:"4px 0 0 0","&.Mui-error":{color:$U.RED}},contained:{marginLeft:0,marginRight:0}}},MuiFormLabel:{styleOverrides:{root:{color:$U.GREYSCALE_25,fontSize:HU,fontFamily:QU.FONT_FAMILY,fontWeight:JU,fontStretch:"normal",fontStyle:"normal",letterSpacing:"normal",lineHeight:1,"&.Mui-focused":{color:$U.TEXT_PRIMARY},"&.Mui-error":{color:$U.TEXT_SECONDARY},"&[optional=true]":{"&:after":{color:$U.TEXT_SECONDARY,content:"'(optional)'",fontWeight:XU,marginLeft:"4px"}}},asterisk:{visibility:"collapse",display:"inline-flex","&::after":{visibility:"visible",color:$U.TEXT_SECONDARY,content:"'(required)'",fontWeight:XU,marginLeft:"4px"}}}},MuiOutlinedInput:{defaultProps:{notched:!1},styleOverrides:{root:{fontSize:VU,lineHeight:"16px",backgroundColor:$U.WHITE,borderRadius:YU,"&:not(.Mui-focused):not(.Mui-error):not(.Mui-disabled):hover .MuiOutlinedInput-notchedOutline":{border:`solid 1px ${$U.GREYSCALE_0_05}`,borderColor:$U.GREYSCALE_0_30},"&.Mui-focused:not(.Mui-error) .MuiOutlinedInput-notchedOutline":{border:`solid 1px ${$U.MISC_FOCUS_BORDER}`,boxShadow:`0px 0px 0px 1px ${$U.MISC_FOCUS_BORDER}, inset 0 2px 0 0 ${$U.GREYSCALE_0_05}`},"&.Mui-focused.Mui-error .MuiOutlinedInput-notchedOutline":{border:`solid 1px ${$U.RED}`,boxShadow:`0px 0px 0px 1px ${$U.RED}, inset 0 2px 0 0 ${$U.GREYSCALE_0_05}`},"&.Mui-disabled":{backgroundColor:"transparent"},"&.Mui-disabled .MuiOutlinedInput-notchedOutline":{border:`solid 1px ${$U.GREYSCALE_0_10}`,borderColor:$U.GREYSCALE_0_10,backgroundColor:$U.GREYSCALE_0_05}},adornedStart:{paddingLeft:0},adornedEnd:{paddingRight:0},input:{color:$U.TEXT_PRIMARY,padding:"6px 12px","&.Mui-disabled":{opacity:.45}},inputSizeSmall:{padding:"0px 12px"},notchedOutline:{borderColor:$U.GREYSCALE_0_15,borderRadius:YU,boxShadow:`inset 0 2px 0 0 ${$U.GREYSCALE_0_05}`},multiline:{padding:"0"}}},MuiSelect:{defaultProps:{IconComponent:e=>Hn.jsx(rY,{...e,"aria-hidden":"true",viewBox:"0 0 16 16",width:12,height:12}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}}},styleOverrides:{select:{padding:"7px 12px",borderRadius:"3px !important",minHeight:"1em","& em":{color:$U.TEXT_SECONDARY},"& ~svg":{position:"absolute",right:"12px",top:"unset",cursor:"pointer"},"&[aria-expanded=true]":{backgroundColor:$U.GREYSCALE_0_05},"& ~fieldset":{boxShadow:"none !important",border:"none !important",backgroundColor:"unset !important"},"&:hover":{backgroundColor:$U.GREYSCALE_0_03},"&:active":{backgroundColor:$U.GREYSCALE_0_10},"&:focus":{backgroundColor:$U.GREYSCALE_0_03,borderRadius:"3px !important",border:`solid 1px ${$U.MISC_FOCUS_BORDER}`,boxShadow:`inset 0px 0px 0px 1px ${$U.MISC_FOCUS_BORDER}`},"&.Mui-disabled":{opacity:"unset",color:$U.GREYSCALE_0_30,"&:hover":{backgroundColor:$U.GREYSCALE_0_0,borderColor:$U.GREYSCALE_0_15},"& ~svg":{color:$U.GREYSCALE_0_30}}},outlined:{border:`solid 1px ${$U.GREYSCALE_0_15}`},nativeInput:{height:"42px"}}},MuiIconButton:{styleOverrides:{root:{borderRadius:YU}}},MuiInput:{styleOverrides:{root:{"&.Mui-focused":{borderColor:$U.MISC_FOCUS_BORDER,boxShadow:`0 0 0 2px ${$U.MISC_FOCUS_BORDER}`}}}},MuiInputAdornment:{styleOverrides:{root:{padding:"4px 8px",color:$U.GREYSCALE_55},positionStart:{marginRight:0},positionEnd:{marginLeft:0}}},MuiInputBase:{styleOverrides:{root:{fieldset:{boxShadow:"none"}},input:{height:"20px",fontSize:VU,padding:"8px 12px",lineHeight:"16px","&.MuiInputBase-inputAdornedStart":{paddingLeft:0},"&.MuiInputBase-inputAdornedEnd":{paddingRight:0}},sizeSmall:{height:"24px",input:{fontSize:HU,paddingLeft:"8px"}}}},MuiInputLabel:{defaultProps:{shrink:!0},styleOverrides:{outlined:{fontSize:HU,fontWeight:JU,color:$U.GREYSCALE_25,"&.MuiInputLabel-shrink":{transform:"translate(0px, -16px)",fontWeight:JU}}}},MuiPopover:{styleOverrides:{paper:{minWidth:"160px",top:"60px",marginTop:"5px","&ul":{padding:"0px"},boxShadow:`0px 4px 10px ${$U.GREYSCALE_0_15}, 0px 0px 0px 1px ${$U.GREYSCALE_0_05}`}}},MuiRadio:{defaultProps:{size:"small",icon:Hn.jsx(cY,{}),checkedIcon:Hn.jsx(uY,{})},styleOverrides:{root:{"&:hover":{backgroundColor:"unset"},fill:$U.GREYSCALE_100_60,stroke:"black","&.sprout-focus-visible":{borderColor:"transparent",boxShadow:"none"},"&.sprout-focus-visible i":{borderRadius:"50%",boxShadow:`0 0 0 2px ${$U.MISC_FOCUS_BORDER}`},"&.Mui-checked":{"&.MuiRadio-colorPrimary":{"&.sprout-focus-visible i":{borderColor:$U.GREEN_PALE,boxShadow:`0 0 0 3px ${Sb($U.GREEN_PALE,.5)}`}},"&.MuiRadio-colorSecondary":{"&.sprout-focus-visible i":{borderColor:$U.BLUE_PALE,boxShadow:`0 0 0 3px ${Sb($U.BLUE_PALE,.5)}`}},"&.Mui-disabled":{color:$U.GREYSCALE_0_20}},"&.Mui-disabled":{fill:$U.GREYSCALE_0_20,stroke:"none"}}}},MuiCheckbox:{defaultProps:{size:"small",icon:Hn.jsx(pY,{}),checkedIcon:Hn.jsx(sY,{}),indeterminateIcon:Hn.jsx(lY,{})},styleOverrides:{root:{borderWidth:1,"&:hover":{backgroundColor:"unset"},"&.sprout-focus-visible":{borderColor:"transparent",boxShadow:"none"},"&.sprout-focus-visible i":{borderRadius:YU,boxShadow:" 0px 0px 0px 2px #FFFFFF, 0px 0px 0px 4px #177FE6"},"&:not(.Mui-disabled)":{"&:not(.Mui-checked)":{"&:not(.MuiCheckbox-indeterminate)":{color:$U.GREYSCALE_100_60,"&:hover":{g:{rect:{stroke:$U.GREYSCALE_0_55,color:$U.GREYSCALE_0_03}}},"&.sprout-focus-visible i":{boxShadow:"0px 0px 0px 2px #0275D9",g:{rect:{stroke:"none"}}}}}},"&.Mui-disabled":{"& i":{pointerEvents:"auto",cursor:"not-allowed !important",color:$U.GREYSCALE_0_15,g:{rect:{stroke:"none"}}}}},colorPrimary:{"&.MuiCheckbox-root":{"&:not(.Mui-disabled)":{"&:hover":{color:$U.GREEN_DARK}}}},colorSecondary:{"&.MuiCheckbox-root":{"&:not(.Mui-disabled)":{color:$U.GREYSCALE_0_55,"&:hover":{color:$U.GREYSCALE_25}}}}}},MuiCircularProgress:{defaultProps:{thickness:3,disableShrink:!0}},MuiDialog:{defaultProps:{fullWidth:!0}},MuiDialogActions:{styleOverrides:{root:{padding:"16px"}}},MuiDialogTitle:{styleOverrides:{root:{display:"flex",alignItems:"center",justifyContent:"space-between",boxSizing:"content-box",minHeight:"31px",padding:"16px 16px 16px 24px",fontSize:"16px",lineHeight:"24px"}}},MuiDialogContentText:{defaultProps:{variant:"body2"},styleOverrides:{root:{marginBottom:0}}},MuiDialogContent:{styleOverrides:{root:{padding:"16px 24px !important"}}},MuiDivider:{styleOverrides:{middle:{margin:"4px 8px"}}},MuiLink:{defaultProps:{underline:"none",color:$U.MISC_FOCUS_BORDER}},MuiListItemIcon:{styleOverrides:{root:{color:$U.GREYSCALE_25,minWidth:"16px",marginRight:"16px"}}},MuiListItemText:{styleOverrides:{root:{fontSize:"12px"},primary:{fontSize:VU,color:$U.TEXT_PRIMARY,lineHeight:"16px",fontWeight:JU},secondary:{fontSize:HU,color:$U.GREYSCALE_45,fontWeight:XU,lineHeight:"16px"}}},MuiListItem:{styleOverrides:{root:{fontSize:VU,minHeight:"32px"},gutters:{paddingLeft:"12px",paddingRight:"12px"}}},MuiListItemButton:{styleOverrides:{root:{fontSize:VU,height:"32px"}}},MuiListSubheader:{styleOverrides:{root:{'&[role="option"]':{color:$U.TEXT_PRIMARY,lineHeight:1.33,padding:"4px 12px",fontWeight:600,fontSize:HU,borderBottom:`solid 1px ${$U.GREYSCALE_0_15}`,pointerEvents:"none"}}}},MuiList:{styleOverrides:{padding:{paddingTop:"0px",paddingBottom:"0px"}}},MuiMenuItem:{styleOverrides:{root:{fontSize:VU,color:$U.GREYSCALE_25,height:"32px",'[class*="MuiListItemIcon-root"]':{minWidth:"16px"},"&:hover":{backgroundColor:$U.GREYSCALE_0_03},"&.Mui-selected":{backgroundColor:"unset","&:hover":{backgroundColor:$U.GREYSCALE_0_10},"&.Mui-focusVisible":{backgroundColor:$U.GREYSCALE_0_10},"&:not(.Mui-disabled)":{"&::after":{content:"url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%228px%22%20height%3D%227px%22%20viewBox%3D%220%200%208%207%22%20version%3D%221.1%22%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20aria-labelledby%3D%22Tick%22%3E%20%20%3Cg%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%3Cg%20transform%3D%22translate%280.000000%2C%20-1.000000%29%22%3E%20%20%20%20%20%20%3Cpath%20d%3D%22M7.51662484%2C1.29325%20C7.12545778%2C0.90225%206.49218732%2C0.90225%206.10202068%2C1.29325%20L2.73658335%2C4.65725%20L1.90722914%2C3.82925%20C1.5170625%2C3.43825%200.883792042%2C3.43825%200.492624979%2C3.82925%20C0.102458344%2C4.21925%200.102458344%2C4.85225%200.492624979%2C5.24325%20L2.02928127%2C6.77825%20C2.4194479%2C7.16925%203.05271836%2C7.16925%203.44388542%2C6.77825%20L7.51662484%2C2.70725%20C7.9077919%2C2.31725%207.9077919%2C1.68425%207.51662484%2C1.29325%22%3E%3C%2Fpath%3E%20%20%20%20%3C%2Fg%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E')",fontFamily:"LUI icons",position:"absolute",fontSize:"10px",right:"10px",color:$U.RED}}},"&.Mui-focusVisible":{backgroundColor:$U.GREYSCALE_0_03}},divider:{marginTop:"8px",marginBottom:"8px"},gutters:{paddingLeft:"12px",paddingRight:"12px"}}},MuiMenu:{styleOverrides:{list:{paddingTop:"4px",paddingBottom:"4px"},paper:{marginTop:"4px !important",marginBottom:"4px",background:$U.WHITE,boxShadow:"0 0 0 1px rgba(0,0,0,0.05), 0 4px 10px 0 rgba(0,0,0,0.15) !important",borderRadius:"2px !important"}}},MuiSlider:{styleOverrides:{root:{color:$U.GREEN,height:"24px","&.Mui-disabled":{color:$U.GREYSCALE_0_15}},rail:{backgroundColor:$U.GREYSCALE_0_05,height:"4px",opacity:"1",border:`solid 1px ${$U.GREYSCALE_0_05}`,borderRadius:YU,boxShadow:`inset 0px 0px 0px 1px ${$U.GREYSCALE_0_05}`},track:{height:"4px",backgroundColor:"currentColor",opacity:"1",border:`solid 1px ${$U.GREYSCALE_0_05}`,borderRadius:YU},thumb:{height:"16px",width:"16px",borderRadius:YU,backgroundColor:$U.WHITE,boxShadow:`0px 1px 2px 0px ${$U.GREYSCALE_0_15}, 0px 0px 0px 1px ${$U.GREYSCALE_0_05}`,"&:hover":{borderRadius:YU,boxShadow:`0 2px 4px 0 ${$U.GREYSCALE_0_30}, 0 0 0 1px ${$U.GREYSCALE_0_06}`},"&:focus":{boxShadow:`0 1px 2px 0 ${$U.GREYSCALE_0_15}, 0 0 0 1px ${$U.GREYSCALE_0_06}, 0 0 0 2px ${$U.MISC_FOCUS_BORDER}`},"&.Mui-focusVisible":{boxShadow:`0 1px 2px 0 ${$U.GREYSCALE_0_15}, 0 0 0 1px ${$U.GREYSCALE_0_06}, 0 0 0 2px ${$U.MISC_FOCUS_BORDER}`},"&.Mui-disabled":{width:"16px",height:"16px",marginTop:"-5px",marginLeft:"-8px",backgroundColor:$U.GREYSCALE_90},"& .custom-bar":{height:"8px",width:"1px",backgroundColor:$U.GREYSCALE_0_30,marginLeft:1,marginRight:1}},mark:{width:"1px",height:"4px",margin:"16px 0px 0px 0px",backgroundColor:$U.GREYSCALE_0_15},markActive:{opacity:1,backgroundColor:$U.GREYSCALE_0_15},markLabel:{color:$U.TEXT_SECONDARY,transform:"translateX(-50%)",top:"35px"},markLabelActive:{color:$U.TEXT_SECONDARY,transform:"translateX(-50%)",top:"35px"}}},MuiSnackbar:{defaultProps:{anchorOrigin:{vertical:"bottom",horizontal:"center"}}},MuiSnackbarContent:{styleOverrides:{root:{backgroundColor:$U.WHITE,color:$U.GREYSCALE_25}}},MuiSwitch:{defaultProps:{color:"primary",size:"small"},styleOverrides:{root:{padding:"10px",width:"60px",height:"40px","& .MuiSwitch-switchBase":{"&:hover":{backgroundColor:"unset"},"&.Mui-checked":{"&:hover":{backgroundColor:"unset"}}}},switchBase:{padding:"12px","&.Mui-disabled":{"&.MuiSwitch-thumb":{backgroundColor:$U.GREYSCALE_100_50}},"&.Mui-checked + .MuiSwitch-track":{opacity:1},"&.Mui-disabled + .MuiSwitch-track":{opacity:.12},"&.sprout-focus-visible":{borderColor:"transparent",boxShadow:"none"}},colorPrimary:{"&.sprout-focus-visible + .MuiSwitch-track":{borderColor:$U.GREEN_PALE,boxShadow:`0 0 0 3px ${Sb($U.GREEN_PALE,.5)}`}},colorSecondary:{"&.sprout-focus-visible + .MuiSwitch-track":{borderColor:$U.BLUE_PALE,boxShadow:`0 0 0 3px ${Sb($U.BLUE_PALE,.5)}`}},track:{opacity:1,backgroundColor:$U.GREYSCALE_0_15,borderRadius:YU},thumb:{height:"16px",width:"16px",borderRadius:YU,backgroundColor:$U.GREYSCALE_100},sizeSmall:{height:"32px",width:"52px",padding:"8px 10px","& .MuiSwitch-thumb":{height:"12px",width:"12px"},"& .MuiSwitch-switchBase":{padding:"10px 12px"}}}},MuiTextField:{defaultProps:{margin:"dense",variant:"outlined"},styleOverrides:{root:{marginBottom:0}}},MuiTab:{styleOverrides:{root:{fontSize:VU,fontWeight:JU,textTransform:"none",minWidth:"auto",boxSizing:"border-box",paddingBottom:"12px","&:hover":{borderBottom:`2px solid ${$U.GREYSCALE_80}`,paddingBottom:"10px"},"&.sprout-focus-visible":{boxShadow:`inset 0 0 0 2px ${$U.MISC_FOCUS_BORDER}`,backgroundColor:$U.GREYSCALE_0_03,borderRadius:YU},"&.Mui-disabled":{opacity:.3}},textColorPrimary:{color:$U.GREYSCALE_25,"&.Mui-selected":{color:$U.GREYSCALE_25}},textColorInherit:{opacity:"unset"},labelIcon:{minWidth:"40px",minHeight:"48px"}}},MuiTabs:{defaultProps:{indicatorColor:"primary",textColor:"primary"},styleOverrides:{root:{fontSize:VU,fontWeight:"bold"},scroller:{height:"100%"},flexContainer:{"&:not(.MuiTabs-flexContainerVertical)":{height:"100%",marginLeft:2,marginRight:2}},indicator:{height:2},scrollButtons:{borderRadius:YU,"&:hover":{backgroundColor:$U.GREYSCALE_0_03},"&.Mui-disabled":{opacity:"unset","& .MuiSvgIcon-root":{opacity:.3}}},vertical:{padding:"8px",boxSizing:"border-box","& .MuiTabs-indicator":{left:0,right:"unset",transition:"none",clipPath:"inset(12px 0 12px 0)",marginLeft:"1px"},"& .MuiTabs-scrollButtons":{flexDirection:"column",position:"relative","&:first-child":{marginBottom:"4px","&::before":{content:'""',display:"block",width:"100%",height:"1px",borderBottom:`1px solid ${$U.GREYSCALE_0_15}`,position:"absolute",bottom:0,left:0}},"&:last-child":{marginTop:"4px","&::before":{content:'""',display:"block",width:"100%",height:"1px",borderBottom:`1px solid ${$U.GREYSCALE_0_15}`,position:"absolute",top:0,left:0}}},"& .MuiTab-root":{fontWeight:"normal",borderRadius:YU,marginBlock:"4px","&:first-child":{marginTop:"0px"},"&:last-child":{marginBottom:"0px"},"&.Mui-selected":{backgroundColor:$U.GREYSCALE_0_05},"&:hover":{backgroundColor:$U.GREYSCALE_0_03,borderBottomColor:"transparent"}}}}},MuiTableCell:{styleOverrides:{root:{padding:"0px 8px 0px 16px",borderBottom:`1px solid ${$U.GREYSCALE_85}`,borderRight:`1px solid ${$U.GREYSCALE_85}`,height:"39px"},head:{height:"41px",fontWeight:JU,backgroundColor:$U.GREYSCALE_98},paddingCheckbox:{width:"40px",padding:"0px"},paddingNone:{padding:"0px"},sizeSmall:{padding:"0px 8px",height:"29px","&.MuiTableCell-head":{height:"31px"},"&.MuiTableCell-paddingCheckbox":{width:"40px",padding:"0px"}},stickyHeader:{backgroundColor:$U.GREYSCALE_98,borderBottom:`1px solid ${$U.GREYSCALE_85}`}}},MuiTableContainer:{styleOverrides:{root:{borderBottom:`1px solid ${$U.GREYSCALE_85}`,borderTop:`1px solid ${$U.GREYSCALE_85}`}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:$U.GREYSCALE_98}}},MuiTableRow:{styleOverrides:{root:{"&.Mui-selected":{backgroundColor:$U.GREYSCALE_0_05,"&:hover":{backgroundColor:$U.GREYSCALE_0_03}},"&&:hover":{backgroundColor:$U.GREYSCALE_0_03}}}},MuiTableSortLabel:{defaultProps:{IconComponent:({className:e})=>Hn.jsx(dY,{className:e})},styleOverrides:{root:{display:"flex",justifyContent:"space-between","&:hover":{"& icon":{opacity:.5}},"&.Mui-active":{"&& icon":{opacity:1}}},icon:{opacity:0},iconDirectionDesc:{transform:"rotate(180deg)"},iconDirectionAsc:{transform:"rotate(0deg)"}}},MuiTable:{styleOverrides:{root:{borderLeft:`1px solid ${$U.GREYSCALE_85}`}}},MuiToggleButton:{styleOverrides:{root:{height:32,lineHeight:"16px",width:32,fontSize:VU,borderRadius:YU,padding:"7px 16px",border:`1px solid ${$U.GREYSCALE_0_15}`,backgroundColor:$U.GREYSCALE_100_60,color:$U.GREYSCALE_25,zIndex:1,"&:active":{backgroundColor:$U.GREYSCALE_0_10,border:`1px solid ${$U.GREYSCALE_0_30}`},"&:hover":{backgroundColor:$U.GREYSCALE_0_03,border:`1px solid ${$U.GREYSCALE_0_30}`},"&.sprout-focus-visible":{backgroundColor:$U.GREYSCALE_0_03,boxShadow:`0 0 0 1px ${$U.MISC_FOCUS_BORDER}`,border:`1px solid ${$U.MISC_FOCUS_BORDER}`,zIndex:2},"&.Mui-selected":{color:$U.GREYSCALE_25,backgroundColor:$U.GREYSCALE_0_10,zIndex:2,"&:hover":{backgroundColor:$U.GREYSCALE_0_10,border:`1px solid ${$U.GREYSCALE_0_15}`}}},sizeSmall:{fontSize:HU,height:24,width:24,padding:7},sizeLarge:{fontSize:GU,height:40,width:40,lineHeight:"20px"}}},MuiToggleButtonGroup:{styleOverrides:{root:{height:"32px",lineHeight:"16px",fontSize:VU,borderRadius:YU}}},MuiToolbar:{defaultProps:{disableGutters:!0},styleOverrides:{root:{display:"flex",flex:1,padding:"0 16px"},dense:{minHeight:"46px",padding:"0 8px"}}},MuiTooltip:{defaultProps:{arrow:!0},styleOverrides:{arrow:{color:$U.GREYSCALE_20},tooltip:{backgroundColor:$U.GREYSCALE_20,fontSize:HU,lineHeight:"16px"},popper:{whiteSpace:"pre-line"}}},...e?{...hY}:{}}))(t);const mY=e=>({mode:"light",primary:{ultraLight:$U.GREEN_ULTRA_LIGHT,light:$U.GREEN_PALE,main:$U.GREEN,dark:$U.GREEN_DARK,extraDark:$U.GREEN_EXTRA_DARK,contrastText:$U.WHITE},secondary:{ultraLight:$U.BLUE_ULTRA_LIGHT,light:$U.BLUE_PALE,main:$U.BLUE,dark:$U.BLUE_DARK,extraDark:$U.BLUE_EXTRA_DARK,contrastText:$U.WHITE},error:{ultraLight:$U.RED_ULTRA_LIGHT,light:$U.RED_PALE,main:$U.RED,dark:$U.RED_DARK,extraDark:$U.RED_EXTRA_DARK,contrastText:$U.WHITE},warning:{ultraLight:$U.ORANGE_ULTRA_LIGHT,light:$U.ORANGE_PALE,main:$U.ORANGE,dark:$U.ORANGE_DARK,extraDark:$U.ORANGE_EXTRA_DARK,contrastText:$U.WHITE},success:{ultraLight:$U.GREEN_ULTRA_LIGHT,light:$U.GREEN_PALE,main:$U.GREEN,dark:$U.GREEN_DARK,extraDark:$U.GREEN_EXTRA_DARK,contrastText:$U.WHITE},info:{ultraLight:$U.BLUE_ULTRA_LIGHT,light:$U.BLUE_PALE,main:$U.BLUE,dark:$U.BLUE_DARK,extraDark:$U.BLUE_EXTRA_DARK,contrastText:$U.WHITE},text:{primary:$U.TEXT_PRIMARY,secondary:$U.TEXT_SECONDARY,disabled:$U.GREYSCALE_0_30},action:{hover:$U.GREYSCALE_0_03,hoverOpacity:.03,selected:$U.GREYSCALE_0_05,selectedOpacity:.05,focus:$U.MISC_FOCUS_BORDER},amethyst:{ultraLight:$U.WHITE,main:$U.PURPLE,light:$U.PURPLE_PALE,dark:$U.PURPLE_DARK,extraDark:$U.GREYSCALE_0_0,contrastText:$U.WHITE},background:{paper:$U.WHITE,default:$U.GREYSCALE_95},divider:$U.GREYSCALE_0_15}),gY=(e="light",t=!1)=>((e,t=!1)=>({components:fY(0,t),palette:mY(),breakpoints:{keys:["xs","sm","md","lg","xl"],values:{xs:0,sm:600,md:960,lg:1280,xl:1920}},spacing:8,shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],transitions:{easing:{easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration:{standard:300,short:250,enteringScreen:225,shorter:200,leavingScreen:195,shortest:150,complex:375}},typography:{fontSize:VU,fontWeightLight:KU,fontWeightRegular:XU,fontWeightMedium:JU,fontWeightBold:ZU,htmlFontSize:VU,fontFamily:QU.FONT_FAMILY,button:{fontWeight:JU,fontSize:VU,textTransform:"none"},body1:{fontSize:GU,lineHeight:"24px"},body2:{fontSize:VU,lineHeight:"20px"},h1:{fontSize:32,lineHeight:"32px"},h2:{fontSize:28,lineHeight:"32px"},h3:{fontSize:UU,lineHeight:"24px"},h4:{fontSize:20,lineHeight:"24px"},h5:{fontSize:GU,fontWeight:JU,lineHeight:"16px"},h6:{fontSize:VU,fontWeight:JU,lineHeight:"16px"},caption:{color:$U.TEXT_SECONDARY},subtitle1:{fontSize:VU,color:$U.TEXT_SECONDARY},subtitle2:{fontSize:HU,color:$U.TEXT_SECONDARY}},shape:{borderRadius:YU}}))(0,t);const yY=(e,{selections:n,baseObjects:r,coreServices:i,nebulaObjects:o})=>{const a=function(e){var t;const n=gY();return null!=n&&null!==(t=n.components)&&void 0!==t&&null!==(t=t.MuiTable)&&void 0!==t&&t.styleOverrides&&(n.components.MuiTable.styleOverrides.root={}),Px({...n,direction:e})}("ltr");e.render(Hn.jsx(t.StrictMode,{children:Hn.jsx(fw,{theme:a,children:Hn.jsx(CE,{...o,children:Hn.jsx(wE,{...r,children:Hn.jsx(Z_,{selections:n,children:Hn.jsx(kE,{...i,children:Hn.jsx(fM,{children:Hn.jsx(WU,{})})})})})})})}))};var bY,vY,xY,wY;!function(e){e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="fontColor",e.FontStyle="fontStyle",e.Background="background",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.Border="border",e.Divider="divider"}(bY||(bY={})),function(e){e.Dimension="object.pivotTableV2.dimension",e.Measure="object.pivotTableV2.measure",e.Total="object.pivotTableV2.total",e.Null="object.pivotTableV2.null",e.Grid="object.pivotTableV2"}(vY||(vY={})),function(e){e.Grid="grid",e.Divider="grid.divider",e.LabelName="label.name",e.LabelValue="label.value"}(xY||(xY={})),function(e){e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="color",e.BackgroundColor="backgroundColor",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.BorderColor="borderColor"}(wY||(wY={}));const SY=e=>e?`${parseInt(e,10)}px`:void 0,EY=(e,t)=>{if(t){const n=e.getColorPickerColor(t);return"none"===n?rg.Transparent:n}},CY=(e,t)=>+(parseInt(e,10)*ng*t+8).toFixed(2),MY=(e,t)=>void 0===e?t:e.some((e=>"bold"===e))?eg:"normal",_Y=e=>null!=e&&e.some((e=>"italic"===e))?"italic":"normal",kY=e=>null!=e&&e.some((e=>"underline"===e))?"underline":"none",RY=document.createElement("textarea");function AY(e){RY.value=e,document.body.appendChild(RY),RY.select(),RY.setSelectionRange(0,RY.value.length),document.execCommand("copy"),document.body.removeChild(RY)}RY.style.position="absolute",RY.style.left="-9999px",RY.setAttribute("readonly","");function IY(e){null==M||M(((t,n)=>{const r=n.target,i=null==r?void 0:r.closest(`.${Ot}`);null!=i&&i.title&&t.addItem({translation:"contextMenu.copyCellValue",icon:"lui-icon lui-icon--copy",tid:"copy-cell-context-item",select:async()=>{(e=>{var t;const n=e.title;n&&(null!==(t=navigator.clipboard)&&void 0!==t&&t.writeText?navigator.clipboard.writeText(n).catch((()=>{AY(n)})):AY(n))})(i)}}),null==e||e.forEach((e=>{e(t,n,i)}))}))}const LY=({model:e,env:t,layoutService:n,effectivePropertiesService:r,translator:i})=>Cg(((o,a,s)=>{if(!e||r.qAlwaysFullyExpanded||!t.flags.isEnabled("CLIENT_IM_6273_EXPAND_OR_COLLAPSE_DIM"))return;const l=e,c=o.addItem({translation:"Object.PivotTable.ContextMenu.ExpandCollapse",tid:"expand-collapse-group"}),{qEffectiveDimensionName:u,label:d}=((e,t)=>{const n=((e,t)=>{const n=null==e?void 0:e.getAttribute("data-dimension-info-index");if("string"==typeof n)return t.getDimensionInfo(+n)})(e,t);return"object"==typeof n?{qEffectiveDimensionName:n.qEffectiveDimensionName,label:n.qFallbackTitle}:{qEffectiveDimensionName:void 0,label:void 0}})(s,n);c.addItem((e=>({icon:"lui-icon lui-icon--plus",translation:"Object.PivotTable.ContextMenu.ExpandAll",tid:"expand-all",select:async()=>{try{await e.expandTop(AE,0,0,!0),await e.expandLeft(AE,0,0,!0)}catch(e){console.error("Failed to expand all",e)}}}))(l)),"string"==typeof u&&c.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--plus",translation:i.get("SNPivotTable.ContextMenu.ExpandDimension",[null!=r?r:""]),tid:"expand-dimension",select:iI({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:tI.Expand})}))({model:l,effectivePropertiesService:r,qEffectiveDimensionName:u,label:d,translator:i})),c.addItem((e=>({icon:"lui-icon lui-icon--minus",translation:"Object.PivotTable.ContextMenu.CollapseAll",tid:"collapse-all",select:async()=>{try{await e.collapseTop(AE,0,0,!0),await e.collapseLeft(AE,0,0,!0)}catch(e){console.error("Failed to collapse all",e)}}}))(l)),"string"==typeof u&&c.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--minus",translation:i.get("SNPivotTable.ContextMenu.CollapseDimension",[null!=r?r:""]),tid:"collapse-dimension",select:iI({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:tI.Collapse})}))({model:l,effectivePropertiesService:r,qEffectiveDimensionName:u,label:d,translator:i}))}),[e,n,r]),DY=(e,t)=>b((()=>(({layout:e,flags:t})=>{var n,r,i,o;const{qHyperCube:a,nullValueRepresentation:s,snapshotData:l}=e,{qNoOfLeftDims:c,qEffectiveInterColumnSortOrder:u,qMeasureInfo:d,qDimensionInfo:p}=a,h=!!l,f=null!==(n=null==l||null===(r=l.content)||void 0===r?void 0:r.rowsPerPage)&&void 0!==n?n:15e3,m={x:Math.min(e.qHyperCube.qSize.qcx,tg),y:Math.min(e.qHyperCube.qSize.qcy,f)},g=u.slice(0,c),y=e=>g.some((t=>t===e)),b=y(IE),v=new Map(u.map((e=>{var t;return[null!==(t=p[e])&&void 0!==t?t:IE,e]}))),x=d.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)}));return{layout:e,getNullValueText:()=>{var e;return null!==(e=null==s?void 0:s.text)&&void 0!==e?e:"-"},getMeasureInfoIndexFromCellIndex:(e,t=!1)=>{if(b)return 0;const n=e%x.length;return t?n:d.findIndex((e=>e===x[n]))},getDimensionInfo:e=>e===IE?void 0:p.at(e),getDimensionInfoIndex:e=>{var t;return null!==(t=v.get(e))&&void 0!==t?t:-1},size:m,isSnapshot:h,hasLimitedData:!h&&m.x<e.qHyperCube.qSize.qcx,hasData:m.x>0&&m.y>0,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims,hasPseudoDimOnLeft:b,leftDimensionInfoIndexes:g,isLeftDimension:y,triggerdByExpandOrCollapse:!!e.qHyperCube.qLastExpandedPos,visibleMeasureInfo:x,isIndentModeEnabled:Boolean(e.qHyperCube.qIndentMode)&&t.isEnabled("CLIENT_IM_5975_INDENT_MODE"),indentModeFeatures:{isLinksSupported:t.isEnabled("CLIENT_IM_5975_INDENT_MODE_LINKS"),isImagesSupported:t.isEnabled("CLIENT_IM_5975_INDENT_MODE_IMAGES")},indentModeColumnWidth:null!==(i=e.qHyperCube.indentModeColumnWidth)&&void 0!==i?i:{type:Ft.Auto,pixels:qt.PixelsDefault,percentage:qt.PercentageDefault},searchSortFromDimension:"inherit"===(null===(o=e.search)||void 0===o?void 0:o.sorting)}})({layout:e,flags:t})),[e,t]),PY=({model:e,layoutService:t,viewService:n,pageInfo:r,rect:i})=>{const{layout:o,isSnapshot:a,triggerdByExpandOrCollapse:s}=t,l=(e=>{const t=_g(e);return t.current=e,t})(sM(i));return Dg((async()=>{const{qHyperCube:t}=o,{maxNumberOfVisibleRows:i,maxNumberOfVisibleColumns:c}=l.current;var u,d;if(a)return null!==(u=null===(d=o.snapshotData)||void 0===d||null===(d=d.content)||void 0===d?void 0:d.qPivotDataPages)&&void 0!==u?u:[];if(void 0!==e&&"getHyperCubePivotData"in e&&(((e,t,n,r)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=r||t.gridRowStartIndex+t.gridHeight>=n))(s,n,i,c)||((e,t,n,r)=>{var i,o;const{qHyperCube:{qPivotDataPages:a,qSize:s}}=e,{qTop:l,qWidth:c,qHeight:u}=null!==(i=null===(o=a[0])||void 0===o?void 0:o.qArea)&&void 0!==i?i:{qTop:0,qWidth:0,qHeight:0};return l<t.page*t.rowsPerPage||c<Math.min(r,s.qcx)||u<Math.min(n,s.qcy)})(o,r,i,c))){const t=((e,t,n,r,i,o)=>{const a=r.page*r.rowsPerPage,s=Math.min(a+r.rowsPerPage,n.qcy),l=Math.min(tg,n.qcx);if(n.qcy<a)return null;let c=0,u=a;if(e){c=t.gridColumnStartIndex,u=a+t.gridRowStartIndex;const e=u+t.gridHeight,n=t.gridColumnStartIndex+t.gridWidth;e>s&&(u=Math.max(0,s-i)),n>l&&(c=Math.max(0,l-o))}return{qLeft:c,qTop:u,qWidth:Math.min(l-c,o),qHeight:Math.min(s-u,i)}})(s,n,o.qHyperCube.qSize,r,i,c);return t?e.getHyperCubePivotData(AE,lM(t)):[]}return t.qPivotDataPages}),[o,a,e,n,r.page,r.rowsPerPage,l,s])},OY=({rowsPerPage:e,totalRowCount:t,page:n})=>Math.min(e,t-n*e),TY=(e,t,n=15e3)=>({rowsPerPage:n,totalPages:Math.max(1,Math.ceil(e/n)),totalRowCount:e,rowsOnCurrentPage:OY({rowsPerPage:n,totalRowCount:e,page:t})}),NY=15,qY=({layoutService:e,viewService:t,rect:n,model:r,pageInfo:i})=>{var o;return _((async e=>{const o=e;if(!o.snapshotData||!r||o.snapshotData.content)return o;if("getHyperCubePivotData"in r){const{scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l}=t,c=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=e,s=t.page*t.rowsPerPage,l=Math.max(r-NY,0),c=Math.max(s+i-NY,s,0),u=tg-l,d=s+t.rowsOnCurrentPage-c;if((e=>0===e.gridWidth&&0===e.gridHeight)(e)){const{maxNumberOfVisibleColumns:e,maxNumberOfVisibleRows:t}=sM(n);return{qLeft:l,qTop:c,qWidth:Math.min(u,e+30),qHeight:Math.min(d,t+30)}}return{qLeft:l,qTop:c,qWidth:Math.min(u,o+30),qHeight:Math.min(d,a+30)}})(t,i,n),u=lM(c),d={qLeft:0,qTop:i.page*i.rowsPerPage,qWidth:1,qHeight:1};o.snapshotData.content={qPivotDataPages:await r.getHyperCubePivotData(AE,[d,...u]),scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l,page:i.page,rowsPerPage:i.rowsPerPage},o.snapshotData.object.size.w=n.width,o.snapshotData.object.size.h=n.height}return o})),k((()=>({getViewState:()=>((e,t)=>({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,leftGridScrollLeft:e.leftGridScrollLeft,topGridScrollTop:e.topGridScrollTop,renderPage:t.page}))(t,i)})),[t]),null!==(o=e.layout.snapshotData)&&void 0!==o&&o.content?{left:n.left,top:n.top,width:e.layout.snapshotData.object.size.w,height:e.layout.snapshotData.object.size.h}:n};var FY={SNPivotTable_ContextMenu_CollapseDimension:{id:"SNPivotTable.ContextMenu.CollapseDimension",locale:{"de-DE":"{0} reduzieren","en-US":"Collapse {0}","es-ES":"Contraer {0}","fr-FR":"Réduire {0}","it-IT":"Comprimi {0}","ja-JP":"{0} を折りたたむ","ko-KR":"{0} 축소","nl-NL":"{0} samenvouwen","pl-PL":"Zwiń {0}","pt-BR":"Recolher {0}","ru-RU":"Свернуть {0}","sv-SE":"Dölj {0}","tr-TR":"{0} öğelerini daralt","zh-CN":"折叠 {0}","zh-TW":"收合 {0}"}},SNPivotTable_ContextMenu_ExpandDimension:{id:"SNPivotTable.ContextMenu.ExpandDimension",locale:{"de-DE":"{0} erweitern","en-US":"Expand {0}","es-ES":"Expandir {0}","fr-FR":"Développer {0}","it-IT":"Espandi {0}","ja-JP":"{0} を展開","ko-KR":"{0} 확장","nl-NL":"{0} uitvouwen","pl-PL":"Rozwiń {0}","pt-BR":"Expandir {0}","ru-RU":"Развернуть {0}","sv-SE":"Visa {0}","tr-TR":"{0} öğelerini genişlet","zh-CN":"展开 {0}","zh-TW":"展開 {0}"}},SNPivotTable_IndentMode_Rows:{id:"SNPivotTable.IndentMode.Rows",locale:{"de-DE":"Zeilen","en-US":"Rows","es-ES":"Filas","fr-FR":"Lignes","it-IT":"Righe","ja-JP":"行","ko-KR":"행","nl-NL":"Rijen","pl-PL":"Wiersze","pt-BR":"Linhas","ru-RU":"Строки","sv-SE":"Rader","tr-TR":"Satırlar","zh-CN":"行","zh-TW":"列"}},SNPivotTable_LimitedData:{id:"SNPivotTable.LimitedData",locale:{"de-DE":"* Derzeit wird eine begrenzte Anzahl Spalten angezeigt","en-US":"* Currently showing a limited number of columns","es-ES":"* Actualmente mostrando un número limitado de columnas","fr-FR":"*Affichage actuel d'un nombre limité de colonnes","it-IT":"* Attualmente visualizzato un numero limitato di colonne","ja-JP":"* 現在、限られた列の数を表示","ko-KR":"* 현재 제한된 수의 열만 표시","nl-NL":"* Op dit moment wordt slechts een beperkt aantal kolommen getoond","pl-PL":"* Obecnie wyświetlana jest ograniczona liczba kolumn","pt-BR":"* Atualmente mostrando um número limitado de colunas","ru-RU":"* В настоящее время отображается ограниченное количество столбцов","sv-SE":"* Visar för närvarande ett begränsat antal kolumner","tr-TR":"*Şu anda sınırlı sayıda sütun gösteriliyor","zh-CN":"* 当前显示的列数有限","zh-TW":"* 目前顯示有限欄數"}},SNPivotTable_NoData:{id:"SNPivotTable.NoData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, weil es keine Werte enthält.","en-US":"The chart is not displayed because it contains no values.","es-ES":"El gráfico no se muestra porque no contiene valores.","fr-FR":"Le graphique n'est pas affiché, car il ne contient aucune valeur.","it-IT":"Il grafico non è visualizzato poiché non contiene alcun valore.","ja-JP":"チャートには値が含まれていないため、チャートは表示されません。","ko-KR":"차트에 값이 없으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze geen waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ nie zawiera wartości.","pt-BR":"O gráfico não foi exibido porque não contém valores.","ru-RU":"Диаграмма не отображается, так как не содержит значений.","sv-SE":"Diagrammet visas inte eftersom det inte innehåller några värden.","tr-TR":"Değer içermemesi nedeniyle grafik görüntülenmiyor.","zh-CN":"图表未显示,因为它不包含任何值。","zh-TW":"系統不會顯示圖表,因為這沒有包含任何值。"}}};const jY=()=>{const e=R(),t=e.language();return b((()=>{!function(e){const t="SNPivotTable_LimitedData";e.get(t)===t&&Object.keys(FY).forEach((t=>{e.add(FY[t])}))}(e)}),[e]),{translator:e,language:t}},zY=e=>{const{flags:t}=e,n=A(),r=(e=>{const t=b((()=>Ng(e)),[e]);return S((()=>()=>{t.unmount()}),[t]),t})(n),i=I(),o=L(),a=D(),s=P(),l=O(),c=kg(),u=((e,t)=>{const[n]=Dg((async()=>{if(void 0!==e&&!t.snapshotData&&"getEffectiveProperties"in e)return{...await e.getEffectiveProperties()}}),[e,t]),r=b((()=>{var e,t;const r=void 0!==(null==n?void 0:n.qHyperCubeDef.qSortbyYValue)&&1===Math.abs(n.qHyperCubeDef.qSortbyYValue),i=null!==(e=null==n?void 0:n.qHyperCubeDef.qDimensions.map((e=>e.qDef.qSortCriterias)))&&void 0!==e?e:[];return{qAlwaysFullyExpanded:null!==(t=null==n?void 0:n.qHyperCubeDef.qAlwaysFullyExpanded)&&void 0!==t&&t,qExpansionState:null==n?void 0:n.qHyperCubeDef.qExpansionState,isSortedByFirstMeasure:r,getSortCriteriaForDimension:e=>i[e]}}),[n]);return r})(o,i),d=DY(i,t),p=(e=>{const t=C();return{...t,select:!!t.active&&!!t.select&&!e,active:!!t.active&&!e,scroll:!!t.active}})(d.isSnapshot),h=T(),f=Lg(i,n),{translator:m,language:g}=jY(),{pageInfo:y,updatePageInfo:v}=((e,t)=>{const{size:n,layout:{qHyperCube:{qSize:r}}}=e,i=t.isDownloadedAsPDForImage||e.isSnapshot,o=(e=>{var t;return null===(t=e.layout.snapshotData)||void 0===t||null===(t=t.content)||void 0===t?void 0:t.rowsPerPage})(e),[a,s]=w((()=>{const a=((e,t)=>{var n,r,i,o;return t.isDownloadedAsPDForImage?null!==(n=null===(r=t.viewState)||void 0===r?void 0:r.renderPage)&&void 0!==n?n:0:e.isSnapshot&&null!==(i=null===(o=e.layout.snapshotData)||void 0===o||null===(o=o.content)||void 0===o?void 0:o.page)&&void 0!==i?i:0})(e,t);return{page:a,shouldShowPagination:r.qcy>n.y&&!i,...TY(r.qcy,a,o)}})),l=e.layout.qHyperCube.qSize.qcy;return S((()=>{s((t=>({...t,...TY(l,t.page,o),shouldShowPagination:l>e.size.y&&!i})))}),[l,e.size.y,s,i,o]),S((()=>{const{page:e,totalPages:t}=a;if(e+1>t){const e=t-1,n=OY({...a,page:e});s({...a,page:e,rowsOnCurrentPage:n})}}),[a]),{pageInfo:a,updatePageInfo:e=>{s({...a,...e,rowsOnCurrentPage:OY({...a,...e})})}}})(d,c),x=((e,t,n)=>b((()=>((e,t)=>{var n,r,i,o,a,s,l,c;if(e.isDownloadedAsPDForImage){var u,d,p,h;const{viewState:t}=e;return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:null!==(u=null==t?void 0:t.scrollTop)&&void 0!==u?u:0,scrollLeft:null!==(d=null==t?void 0:t.scrollLeft)&&void 0!==d?d:0,leftGridScrollLeft:null!==(p=null==t?void 0:t.leftGridScrollLeft)&&void 0!==p?p:0,topGridScrollTop:null!==(h=null==t?void 0:t.topGridScrollTop)&&void 0!==h?h:0}}return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:null!==(n=null==t||null===(r=t.content)||void 0===r?void 0:r.scrollTop)&&void 0!==n?n:0,scrollLeft:null!==(i=null==t||null===(o=t.content)||void 0===o?void 0:o.scrollLeft)&&void 0!==i?i:0,leftGridScrollLeft:null!==(a=null==t||null===(s=t.content)||void 0===s?void 0:s.leftGridScrollLeft)&&void 0!==a?a:0,topGridScrollTop:null!==(l=null==t||null===(c=t.content)||void 0===c?void 0:c.topGridScrollTop)&&void 0!==l?l:0}})(n,t.snapshotData)),[n,e.page,t.snapshotData]))(y,i,c),E=qY({rect:N(),layoutService:d,viewService:x,model:o,pageInfo:y}),[M,_]=PY({model:o,layoutService:d,viewService:x,pageInfo:y,rect:E}),k=b((()=>((e,t,n)=>{var r,i,o,a,s,l,c,u,d,p,h,f,m,g,y,b,v,x,w,S,E,C,M,_,k,R,A,I,L,D,P,O,T,N,q,F,j,z,B,W,$,H,V,G,U,Y,K;const X=null===(r=t.layout.components)||void 0===r?void 0:r.find((e=>"theme"===e.key)),J=null==X?void 0:X.header,Z=null==X?void 0:X.dimensionValues,Q=null==X?void 0:X.measureValues,ee=null==X?void 0:X.measureLabels,te=null==X?void 0:X.totalValues,ne=null==X?void 0:X.nullValues,re=null==X?void 0:X.grid,ie=(t,n,r)=>e.getStyle(t,n,r),oe=+(null!==(i=null!==(o=null==re?void 0:re[bY.LineClamp])&&void 0!==o?o:ie(vY.Grid,xY.Grid,wY.LineClamp))&&void 0!==i?i:1),ae=n.isEnabled("CLIENT_IM_5715_LINKS_AND_IMAGES")?+(null!==(a=null!==(s=null==re?void 0:re[bY.ColumnLineClamp])&&void 0!==s?s:ie(vY.Grid,xY.Grid,wY.ColumnLineClamp))&&void 0!==a?a:1):1,se=null!==(l=null!==(c=EY(e,null==J?void 0:J[bY.Background]))&&void 0!==c?c:ie(vY.Dimension,xY.LabelName,wY.BackgroundColor))&&void 0!==l?l:rg.Transparent,le={header:{fontSize:null!==(u=null!==(d=SY(null==J?void 0:J[bY.FontSize]))&&void 0!==d?d:ie(vY.Dimension,xY.LabelName,wY.FontSize))&&void 0!==u?u:Zm,fontFamily:null!==(p=null!==(h=null==J?void 0:J[bY.FontFamily])&&void 0!==h?h:ie(vY.Dimension,xY.LabelName,wY.FontFamily))&&void 0!==p?p:Qm,fontWeight:MY(null==J?void 0:J[bY.FontStyle],eg),fontStyle:_Y(null==J?void 0:J[bY.FontStyle]),textDecoration:kY(null==J?void 0:J[bY.FontStyle]),color:null!==(f=null!==(m=EY(e,null==J?void 0:J[bY.FontColor]))&&void 0!==m?m:ie(vY.Dimension,xY.LabelName,wY.FontColor))&&void 0!==f?f:cf.TEXT,background:se,hoverBackground:zm(se,jt),activeBackground:zm(se,zt)},dimensionValues:{fontSize:null!==(g=null!==(y=SY(null==Z?void 0:Z[bY.FontSize]))&&void 0!==y?y:ie(vY.Dimension,xY.LabelValue,wY.FontSize))&&void 0!==g?g:Zm,fontFamily:null!==(b=null!==(v=null==Z?void 0:Z[bY.FontFamily])&&void 0!==v?v:ie(vY.Dimension,xY.LabelValue,wY.FontFamily))&&void 0!==b?b:Qm,fontWeight:MY(null==Z?void 0:Z[bY.FontStyle],void 0),fontStyle:_Y(null==Z?void 0:Z[bY.FontStyle]),textDecoration:kY(null==Z?void 0:Z[bY.FontStyle]),color:null!==(x=null!==(w=EY(e,null==Z?void 0:Z[bY.FontColor]))&&void 0!==w?w:ie(vY.Dimension,xY.LabelValue,wY.FontColor))&&void 0!==x?x:cf.TEXT,background:null!==(S=null!==(E=EY(e,null==Z?void 0:Z[bY.Background]))&&void 0!==E?E:ie(vY.Dimension,xY.LabelValue,wY.BackgroundColor))&&void 0!==S?S:rg.Transparent},measureValues:{fontSize:null!==(C=null!==(M=SY(null==Q?void 0:Q[bY.FontSize]))&&void 0!==M?M:ie(vY.Measure,xY.LabelValue,wY.FontSize))&&void 0!==C?C:Zm,fontFamily:null!==(_=null!==(k=null==Q?void 0:Q[bY.FontFamily])&&void 0!==k?k:ie(vY.Measure,xY.LabelValue,wY.FontFamily))&&void 0!==_?_:Qm,fontWeight:MY(null==Q?void 0:Q[bY.FontStyle],"normal"),fontStyle:_Y(null==Q?void 0:Q[bY.FontStyle]),textDecoration:kY(null==Q?void 0:Q[bY.FontStyle]),color:null!==(R=null!==(A=EY(e,null==Q?void 0:Q[bY.FontColor]))&&void 0!==A?A:ie(vY.Measure,xY.LabelValue,wY.FontColor))&&void 0!==R?R:rg.FontSecondary,background:null!==(I=null!==(L=EY(e,null==Q?void 0:Q[bY.Background]))&&void 0!==L?L:ie(vY.Measure,xY.LabelValue,wY.BackgroundColor))&&void 0!==I?I:rg.Transparent},measureLabels:{fontWeight:MY(null==ee?void 0:ee[bY.FontStyle],"normal"),fontStyle:_Y(null==ee?void 0:ee[bY.FontStyle]),textDecoration:kY(null==ee?void 0:ee[bY.FontStyle]),color:null!==(D=null!==(P=EY(e,null==ee?void 0:ee[bY.FontColor]))&&void 0!==P?P:ie(vY.Measure,xY.LabelName,wY.FontColor))&&void 0!==D?D:rg.FontSecondary,background:null!==(O=null!==(T=EY(e,null==ee?void 0:ee[bY.Background]))&&void 0!==T?T:ie(vY.Measure,xY.LabelName,wY.BackgroundColor))&&void 0!==O?O:rg.Transparent},totalValues:{fontWeight:MY(null==te?void 0:te[bY.FontStyle],eg),fontStyle:_Y(null==te?void 0:te[bY.FontStyle]),textDecoration:kY(null==te?void 0:te[bY.FontStyle]),color:null!==(N=null!==(q=EY(e,null==te?void 0:te[bY.FontColor]))&&void 0!==q?q:ie(vY.Total,xY.LabelValue,wY.FontColor))&&void 0!==N?N:cf.TEXT,background:null!==(F=null!==(j=EY(e,null==te?void 0:te[bY.Background]))&&void 0!==j?j:ie(vY.Total,xY.LabelValue,wY.BackgroundColor))&&void 0!==F?F:rg.Transparent},nullValues:{fontWeight:MY(null==ne?void 0:ne[bY.FontStyle],"normal"),fontStyle:_Y(null==ne?void 0:ne[bY.FontStyle]),textDecoration:kY(null==ne?void 0:ne[bY.FontStyle]),color:null!==(z=null!==(B=EY(e,null==ne?void 0:ne[bY.FontColor]))&&void 0!==B?B:ie(vY.Null,xY.LabelValue,wY.FontColor))&&void 0!==z?z:cf.TEXT,background:null!==(W=null!==($=EY(e,null==ne?void 0:ne[bY.Background]))&&void 0!==$?$:ie(vY.Null,xY.LabelValue,wY.BackgroundColor))&&void 0!==W?W:rg.NullValueBackground},grid:{columnLineClamp:ae,lineClamp:oe,border:null!==(H=null!==(V=EY(e,null==re?void 0:re[bY.Border]))&&void 0!==V?V:ie(vY.Grid,xY.Grid,wY.BorderColor))&&void 0!==H?H:rg.DividerLight,divider:null!==(G=null!==(U=EY(e,null==re?void 0:re[bY.Divider]))&&void 0!==U?U:ie(vY.Grid,xY.Divider,wY.BorderColor))&&void 0!==G?G:rg.DividerDark,background:null!==(Y=null!==(K=EY(e,null==re?void 0:re[bY.Background]))&&void 0!==K?K:ie(vY.Grid,xY.Grid,wY.BackgroundColor))&&void 0!==Y?Y:rg.Transparent},selectedColors:jm(e)};return le.headerCellHeight=Math.max(CY(le.header.fontSize,ae),CY(le.dimensionValues.fontSize,ae),32),le.contentCellHeight=Math.max(CY(le.measureValues.fontSize,oe),CY(le.dimensionValues.fontSize,oe),24),le.dimensionValueTextHeight=CY(le.dimensionValues.fontSize,1),le})(f,d,t)),[f,d,t]),R=((e,t,n)=>{const[,r,i]=Dg((async()=>{var t;const r=If(n.flags),i=e.getStyle("","","fontFamily"),o=e.getStyle("object","label.name","fontFamily"),a=e.getStyle("object","label.value","fontFamily"),s=null!==(t=e.getStyle("","","fontFamilies"))&&void 0!==t?t:[];return Promise.all([...r,...s,i,o,a,Fg].filter((e=>void 0!==e)).map((async e=>{await document.fonts.load(`600 12px ${e}`),await document.fonts.load(`12px ${e}`)})))}),[t,e,n]);return i?(console.warn("Failed to load fonts:",i),!0):!r})(f,i,e);IY([LY({model:o,env:e,layoutService:d,effectivePropertiesService:u,translator:m})]),S((()=>{!_&&o&&!!M&&R&&yY(r,{selections:h,baseObjects:{rect:E,pageInfo:y,qPivotDataPages:M,updatePageInfo:v},nebulaObjects:{env:e,app:a,model:o,embed:s,theme:f,keyboard:l,translator:m,interactions:p},coreServices:{styleService:k,viewService:x,layoutService:d,downloadService:c,effectivePropertiesService:u}})}),[o,a,E,p,h,x,d,c,_,M,k,r,R,m,g,y,v,u,s,l,f,e])},BY={version:"4.4.1",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]};function WY(e){return{qae:{properties:{initial:{...BY,qHyperCubeDef:{...BY.qHyperCubeDef,qIndentMode:!1}}},data:Et(e)},ext:Sg(e),component(){zY(e)}}}export{WY as default};
|