????

Your IP : 3.144.235.50


Current Path : C:/inetpub/vhost/hotrochinhsach.nextform.vn/www/assets/
Upload File :
Current File : C:/inetpub/vhost/hotrochinhsach.nextform.vn/www/assets/index-3d8a9b07.js

import{r as w,E as ul,G as y,H as Z,j as h,J as bo,p as Zn,a as dl,t as fl,L as Dr,k as hl,K as Et,h as Bi}from"./index-3ac6b886.js";import{F as ml}from"./DropdownList-92e339e1.js";import{F as Qe}from"./FontAwesome4-4d1c8e97.js";import{N as gl}from"./Nav-7adab22f.js";import{B as pl}from"./Button-d32d698a.js";import{N as xl}from"./Notify-52ad6082.js";/* empty css                  */import{h as yl,I as bl}from"./DefaultHeader-267e02eb.js";import{T as vl}from"./TabsBasic-8d0666c0.js";import{c as wl,r as Cl,u as Ml,d as kl,T as Tl,a as Oe,g as _e,b as Ne,s as ee,e as vo,f as Sl,h as Al,i as Ce,j as Pl,k as Tt}from"./DefaultPropsProvider-2b143db4.js";import{c as Rl}from"./Popper-c3a92014.js";import"./DataSelect-21292454.js";import"./useTheme-cc71593c.js";import"./classCallCheck-22a738c0.js";import"./withStyles-be05542d.js";import"./possibleConstructorReturn-b2959138.js";import"./DialogCustomize-f58e33cd.js";import"./capitalize-2c2e3657.js";import"./Transition-41b94a89.js";import"./OdataUtils-69f581ff.js";import"./Button-9ef33eb6.js";import"./Modal-834c96f4.js";import"./utils-1da25c48.js";import"./Fade-c1d8e31e.js";import"./function-c7c2f09a.js";import"./TextArea-5c5d2643.js";import"./InputNumber-e0e8281b.js";import"./Input-a404c875.js";import"./Required-a585e744.js";import"./InputTime-6c25e67a.js";import"./SelectCustom-a3812854.js";import"./Dropdown-fd6014de.js";import"./SelectPanelMulti-30b66e05.js";import"./TransitionGroup-a6d13137.js";import"./Collapse-9244e6b2.js";import"./Row-ef702d16.js";import"./DataTable-4f7de56a.js";import"./Badge-69f10678.js";import"./_commonjs-dynamic-modules-302442b1.js";import"./Empty-c1579b18.js";import"./const-0478bc07.js";import"./react-alert-template-basic-cff12200.js";import"./objectWithoutPropertiesLoose-881a77c7.js";function $l(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}wl();function jl(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:Cl(t.components[n].defaultProps,r)}function Il({props:e,name:t,defaultTheme:n,themeId:r}){let i=Ml(n);return r&&(i=i[r]||i),jl({theme:i,name:t,props:e})}const _l=typeof window<"u"?w.useLayoutEffect:w.useEffect,at=_l;function Fr(e){return e&&e.ownerDocument||document}function Nl(e){return Fr(e).defaultView||window}function Or(e,t){typeof e=="function"?e(t):e&&(e.current=t)}let Wi=0;function Ll(e){const[t,n]=w.useState(e),r=e||t;return w.useEffect(()=>{t==null&&(Wi+=1,n(`mui-${Wi}`))},[t]),r}const Yi=ul["useId".toString()];function wo(e){if(Yi!==void 0){const t=Yi();return e??t}return Ll(e)}function El({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=w.useRef(e!==void 0),[s,o]=w.useState(t),a=i?e:s,c=w.useCallback(l=>{i||o(l)},[]);return[a,c]}function Ht(...e){return w.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{Or(n,t)})},e)}function St({props:e,name:t}){return Il({props:e,name:t,defaultTheme:kl,themeId:Tl})}function Dl(e){return typeof e=="string"}function Fl(e,t,n){return e===void 0||Dl(e)?t:y({},t,{ownerState:y({},t.ownerState,n)})}const Ol={disableDefaultClasses:!1},Ul=w.createContext(Ol);function Hl(e){const{disableDefaultClasses:t}=w.useContext(Ul);return n=>t?"":e(n)}function zl(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function Vl(e,t,n){return typeof e=="function"?e(t,n):e}function Gi(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function Bl(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:s}=e;if(!t){const g=Oe(n==null?void 0:n.className,s,i==null?void 0:i.className,r==null?void 0:r.className),m=y({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),p=y({},n,i,r);return g.length>0&&(p.className=g),Object.keys(m).length>0&&(p.style=m),{props:p,internalRef:void 0}}const o=zl(y({},i,r)),a=Gi(r),c=Gi(i),l=t(o),u=Oe(l==null?void 0:l.className,n==null?void 0:n.className,s,i==null?void 0:i.className,r==null?void 0:r.className),d=y({},l==null?void 0:l.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),f=y({},l,n,c,a);return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:l.ref}}const Wl=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Ae(e){var t;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:s=!1}=e,o=Z(e,Wl),a=s?{}:Vl(r,i),{props:c,internalRef:l}=Bl(y({},o,{externalSlotProps:a})),u=Ht(l,a==null?void 0:a.ref,(t=e.additionalProps)==null?void 0:t.ref);return Fl(n,y({},c,{ref:u}),i)}function Yl(e){return _e("MuiTypography",e)}Ne("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Gl=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],ql=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:s,classes:o}=e,a={root:["root",s,e.align!=="inherit"&&`align${vo(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return Ce(a,Yl,o)},Xl=ee("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${vo(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>y({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),qi={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Kl={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Ql=e=>Kl[e]||e,Zl=w.forwardRef(function(t,n){const r=Sl({props:t,name:"MuiTypography"}),i=Ql(r.color),s=Al(y({},r,{color:i})),{align:o="inherit",className:a,component:c,gutterBottom:l=!1,noWrap:u=!1,paragraph:d=!1,variant:f="body1",variantMapping:g=qi}=s,m=Z(s,Gl),p=y({},s,{align:o,color:i,className:a,component:c,gutterBottom:l,noWrap:u,paragraph:d,variant:f,variantMapping:g}),x=c||(d?"p":g[f]||qi[f])||"span",b=ql(p);return h.jsx(Xl,y({as:x,ref:n,ownerState:p,className:Oe(b.root,a)},m))}),gr=Zl,Co="base";function Jl(e){return`${Co}--${e}`}function ec(e,t){return`${Co}-${e}-${t}`}function Mo(e,t){const n=Pl[t];return n?Jl(n):ec(e,t)}function tc(e,t){const n={};return t.forEach(r=>{n[r]=Mo(e,r)}),n}function nc(e){return typeof e=="function"?e():e}const rc=w.forwardRef(function(t,n){const{children:r,container:i,disablePortal:s=!1}=t,[o,a]=w.useState(null),c=Ht(w.isValidElement(r)?r.ref:null,n);if(at(()=>{s||a(nc(i)||document.body)},[i,s]),at(()=>{if(o&&!s)return Or(n,o),()=>{Or(n,null)}},[n,o,s]),s){if(w.isValidElement(r)){const l={ref:c};return w.cloneElement(r,l)}return h.jsx(w.Fragment,{children:r})}return h.jsx(w.Fragment,{children:o&&bo.createPortal(r,o)})});function ko(e){const{children:t,defer:n=!1,fallback:r=null}=e,[i,s]=w.useState(!1);return at(()=>{n||s(!0)},[n]),w.useEffect(()=>{n&&s(!0)},[n]),h.jsx(w.Fragment,{children:i?t:r})}const To="Popper";function ic(e){return Mo(To,e)}tc(To,["root"]);const sc=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],oc=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function ac(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function Ur(e){return typeof e=="function"?e():e}function lc(e){return e.nodeType!==void 0}const cc=()=>Ce({root:["root"]},Hl(ic)),uc={},dc=w.forwardRef(function(t,n){var r;const{anchorEl:i,children:s,direction:o,disablePortal:a,modifiers:c,open:l,placement:u,popperOptions:d,popperRef:f,slotProps:g={},slots:m={},TransitionProps:p}=t,x=Z(t,sc),b=w.useRef(null),T=Ht(b,n),v=w.useRef(null),C=Ht(v,f),k=w.useRef(C);at(()=>{k.current=C},[C]),w.useImperativeHandle(f,()=>v.current,[]);const M=ac(u,o),[$,E]=w.useState(M),[N,D]=w.useState(Ur(i));w.useEffect(()=>{v.current&&v.current.forceUpdate()}),w.useEffect(()=>{i&&D(Ur(i))},[i]),at(()=>{if(!N||!l)return;const _=O=>{E(O.placement)};let F=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:O})=>{_(O)}}];c!=null&&(F=F.concat(c)),d&&d.modifiers!=null&&(F=F.concat(d.modifiers));const H=Rl(N,b.current,y({placement:M},d,{modifiers:F}));return k.current(H),()=>{H.destroy(),k.current(null)}},[N,a,c,l,d,M]);const S={placement:$};p!==null&&(S.TransitionProps=p);const L=cc(),P=(r=m.root)!=null?r:"div",A=Ae({elementType:P,externalSlotProps:g.root,externalForwardedProps:x,additionalProps:{role:"tooltip",ref:T},ownerState:t,className:L.root});return h.jsx(P,y({},A,{children:typeof s=="function"?s(S):s}))}),fc=w.forwardRef(function(t,n){const{anchorEl:r,children:i,container:s,direction:o="ltr",disablePortal:a=!1,keepMounted:c=!1,modifiers:l,open:u,placement:d="bottom",popperOptions:f=uc,popperRef:g,style:m,transition:p=!1,slotProps:x={},slots:b={}}=t,T=Z(t,oc),[v,C]=w.useState(!0),k=()=>{C(!1)},M=()=>{C(!0)};if(!c&&!u&&(!p||v))return null;let $;if(s)$=s;else if(r){const D=Ur(r);$=D&&lc(D)?Fr(D).body:Fr(null).body}const E=!u&&c&&(!p||v)?"none":void 0,N=p?{in:u,onEnter:k,onExited:M}:void 0;return h.jsx(rc,{disablePortal:a,container:$,children:h.jsx(dc,y({anchorEl:r,direction:o,disablePortal:a,modifiers:l,ref:n,open:p?!v:u,placement:d,popperOptions:f,popperRef:g,slotProps:x,slots:b},T,{style:y({position:"fixed",top:0,left:0,display:E},m),TransitionProps:N,children:i}))})}),$n=Zn.div`
  position: relative;
  &:hover > ul.dropdown-menu {
    display: block;
    width: 200%;
  }
`,hc=Zn.ul`
  margin-top: 0;
  box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
  position: absolute !important;
  border: none;
  padding: 0.5rem;
  background: white;
  box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px,
    rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
`,mc=Zn.ul`
  top: 0;
  left: -100%;
  margin-top: 0px;
  margin-left: 0;
  margin-right: 0;
  background: #f5f7ff;
`,jn=Zn(Dr)`
  font-weight: 500;
  color: black;
  font-size: 12px;
  padding: 0.3rem 1rem !important;
  border-radius: 1rem;
  &:hover {
    ${e=>e.ismain&&"text-align: center;"}
    background: #0000005c !important;
    color: white;
  }
  &.active {
    background: #0000005c !important;
    color: white !important;
    box-shadow: rgba(0, 0, 0, 0.06) 0px 2px 4px 0px inset;
  }
`,In=e=>e??"#",_n=e=>e.children&&e.children.length>0,gc=e=>{const{items:t,drop:n}=e;return h.jsx(hc,{className:"dropdown-menu","aria-labelledby":"navbarDropdownMenuLink",style:{width:"max-content"},children:t.map((r,i)=>h.jsxs($n,{className:n?"dropleft":"dropright",children:[h.jsxs(jn,{style:{borderRadius:"5px",padding:"1rem 0.5rem !important",fontSize:"15px",listStyle:"none"},to:In(r.url),className:"dropdown-item "+(_n(r)?"dropdown-toggle":""),children:[r.icon&&h.jsxs(h.Fragment,{children:[h.jsx("i",{style:{marginLeft:"0px",color:"rgba(0, 0, 0, 0.7)"},className:r.icon,"aria-hidden":!0})," "]}),`${i+1}. ${r.name}`]}),_n(r)&&h.jsx(mc,{className:"dropdown-menu",style:{margin:0},children:r.children.map((s,o)=>{let a=s.name;return h.jsx($n,{children:h.jsxs(jn,{style:{borderRadius:"5px",padding:"1rem 0.5rem !important",fontSize:"15px"},className:"dropdown-item",to:In(s.url),children:[s.icon&&h.jsxs(h.Fragment,{children:[h.jsx("i",{style:{marginLeft:"0px",color:"rgba(0, 0, 0, 0.7)"},className:s.icon,"aria-hidden":!0})," "]}),`${o+1}. ${a}`]})},o)})})]},i))})};class pc extends w.Component{constructor(t){super(t),this.state={navigation:dl(),ParentID:null,OpenFakeHeader:!1}}checkActiveTab(t){return t===window.location.pathname}render(){const{navigation:t,ParentID:n}=this.state;return h.jsx(h.Fragment,{children:h.jsx("div",{style:{top:"5.5rem",background:"white",borderRadius:"2rem",padding:"0.4rem 0.4rem 0.4rem 0.2rem",zIndex:1,boxShadow:"rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px"},className:"d-flex position-absolute",children:t&&t.map((r,i)=>r.name==="BÁO CÁO THỐNG KÊ"?h.jsx(h.Fragment,{children:h.jsx($n,{style:{listStyleType:"none"},className:"nav-item",children:h.jsx(jn,{ismain:"true",style:{marginLeft:"5px"},to:In("/gdnn/bao-cao-thong-ke/menu-bao-cao-thong-ke"),onClick:()=>{this.setState({activeIndex:i})},className:"nav-link "+(this.checkActiveTab("/gdnn/bao-cao-thong-ke/menu-bao-cao-thong-ke")?" active":""),children:r.name})},i)}):h.jsxs($n,{className:"nav-item",children:[h.jsxs(jn,{ismain:"true",style:{marginLeft:"5px"},to:In(r.url),onClick:()=>{this.setState({activeIndex:i})},className:"nav-link "+(_n(r)&&"dropdown-toggle")+(this.checkActiveTab(r.url)?" active":""),children:[r.icon&&h.jsx(h.Fragment,{children:h.jsx("i",{style:{width:"1rem"},className:r.icon,"aria-hidden":!0})}),r.name]}),_n(r)&&h.jsx(gc,{parent_id:n,items:r.children,drop:i>t.length/2})]},i))})})}}const xc=()=>{const e=w.useContext(fl);return h.jsx(h.Fragment,{children:h.jsxs(gl,{className:"ms-auto d-flex align-items-center gap-2 me-4 hidden-screen-phone",children:[h.jsx(xl,{}),h.jsx("div",{className:"d-flex align-items-center",children:h.jsx(Dr,{tag:Dr,to:"/thong-tin-tai-khoan",className:"form-icon-header-custom",children:h.jsx("img",{src:e.urlAvt?`${hl}${e.urlAvt}`:"../../assets/iconUser.png",style:{height:"2.2rem",width:"2.2rem"},className:"img-avatar-custom rounded-circle",alt:"gdtvietnam"})})}),h.jsx("p",{style:{fontSize:"1.5rem",color:"lightgray"},className:"mb-1 mx-2",children:"|"}),h.jsxs(pl,{onClick:t=>{yl()},className:"btn-dang-xuat-all",children:[h.jsx("img",{src:"../../assets/iconLogout.png",className:"img-avatar-custom rounded-circle",alt:"gdtvietnam"}),h.jsx("span",{children:"Đăng xuất"})]})]})})};var yc=Object.defineProperty,bc=(e,t)=>{for(var n in t)yc(e,n,{get:t[n],enumerable:!0})},xe={};bc(xe,{assign:()=>Cc,colors:()=>Xe,createStringInterpolator:()=>hi,skipAnimation:()=>Io,to:()=>jo,willAdvance:()=>mi});var ai=on(),V=e=>sn(e,ai),li=on();V.write=e=>sn(e,li);var Jn=on();V.onStart=e=>sn(e,Jn);var ci=on();V.onFrame=e=>sn(e,ci);var ui=on();V.onFinish=e=>sn(e,ui);var gt=[];V.setTimeout=(e,t)=>{const n=V.now()+t,r=()=>{const s=gt.findIndex(o=>o.cancel==r);~s&&gt.splice(s,1),Ge-=~s?1:0},i={time:n,handler:e,cancel:r};return gt.splice(So(n),0,i),Ge+=1,Ao(),i};var So=e=>~(~gt.findIndex(t=>t.time>e)||~gt.length);V.cancel=e=>{Jn.delete(e),ci.delete(e),ui.delete(e),ai.delete(e),li.delete(e)};V.sync=e=>{Hr=!0,V.batchedUpdates(e),Hr=!1};V.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...i){t=i,V.onStart(n)}return r.handler=e,r.cancel=()=>{Jn.delete(n),t=null},r};var di=typeof window<"u"?window.requestAnimationFrame:()=>{};V.use=e=>di=e;V.now=typeof performance<"u"?()=>performance.now():Date.now;V.batchedUpdates=e=>e();V.catch=console.error;V.frameLoop="always";V.advance=()=>{V.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Ro()};var Ye=-1,Ge=0,Hr=!1;function sn(e,t){Hr?(t.delete(e),e(0)):(t.add(e),Ao())}function Ao(){Ye<0&&(Ye=0,V.frameLoop!=="demand"&&di(Po))}function vc(){Ye=-1}function Po(){~Ye&&(di(Po),V.batchedUpdates(Ro))}function Ro(){const e=Ye;Ye=V.now();const t=So(Ye);if(t&&($o(gt.splice(0,t),n=>n.handler()),Ge-=t),!Ge){vc();return}Jn.flush(),ai.flush(e?Math.min(64,Ye-e):16.667),ci.flush(),li.flush(),ui.flush()}function on(){let e=new Set,t=e;return{add(n){Ge+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return Ge-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Ge-=t.size,$o(t,r=>r(n)&&e.add(r)),Ge+=e.size,t=e)}}}function $o(e,t){e.forEach(n=>{try{t(n)}catch(r){V.catch(r)}})}function zr(){}var wc=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),j={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function Ee(e,t){if(j.arr(e)){if(!j.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var Y=(e,t)=>e.forEach(t);function Ie(e,t,n){if(j.arr(e)){for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);return}for(const r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var fe=e=>j.und(e)?[]:j.arr(e)?e:[e];function Dt(e,t){if(e.size){const n=Array.from(e);e.clear(),Y(n,t)}}var Lt=(e,...t)=>Dt(e,n=>n(...t)),fi=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),hi,jo,Xe=null,Io=!1,mi=zr,Cc=e=>{e.to&&(jo=e.to),e.now&&(V.now=e.now),e.colors!==void 0&&(Xe=e.colors),e.skipAnimation!=null&&(Io=e.skipAnimation),e.createStringInterpolator&&(hi=e.createStringInterpolator),e.requestAnimationFrame&&V.use(e.requestAnimationFrame),e.batchedUpdates&&(V.batchedUpdates=e.batchedUpdates),e.willAdvance&&(mi=e.willAdvance),e.frameLoop&&(V.frameLoop=e.frameLoop)},Ft=new Set,be=[],pr=[],Nn=0,er={get idle(){return!Ft.size&&!be.length},start(e){Nn>e.priority?(Ft.add(e),V.onStart(Mc)):(_o(e),V(Vr))},advance:Vr,sort(e){if(Nn)V.onFrame(()=>er.sort(e));else{const t=be.indexOf(e);~t&&(be.splice(t,1),No(e))}},clear(){be=[],Ft.clear()}};function Mc(){Ft.forEach(_o),Ft.clear(),V(Vr)}function _o(e){be.includes(e)||No(e)}function No(e){be.splice(kc(be,t=>t.priority>e.priority),0,e)}function Vr(e){const t=pr;for(let n=0;n<be.length;n++){const r=be[n];Nn=r.priority,r.idle||(mi(r),r.advance(e),r.idle||t.push(r))}return Nn=0,pr=be,pr.length=0,be=t,be.length>0}function kc(e,t){const n=e.findIndex(t);return n<0?e.length:n}var Tc=(e,t,n)=>Math.min(Math.max(n,e),t),Sc={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Te="[-+]?\\d*\\.?\\d+",Ln=Te+"%";function tr(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Ac=new RegExp("rgb"+tr(Te,Te,Te)),Pc=new RegExp("rgba"+tr(Te,Te,Te,Te)),Rc=new RegExp("hsl"+tr(Te,Ln,Ln)),$c=new RegExp("hsla"+tr(Te,Ln,Ln,Te)),jc=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ic=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,_c=/^#([0-9a-fA-F]{6})$/,Nc=/^#([0-9a-fA-F]{8})$/;function Lc(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=_c.exec(e))?parseInt(t[1]+"ff",16)>>>0:Xe&&Xe[e]!==void 0?Xe[e]:(t=Ac.exec(e))?(dt(t[1])<<24|dt(t[2])<<16|dt(t[3])<<8|255)>>>0:(t=Pc.exec(e))?(dt(t[1])<<24|dt(t[2])<<16|dt(t[3])<<8|Qi(t[4]))>>>0:(t=jc.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Nc.exec(e))?parseInt(t[1],16)>>>0:(t=Ic.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Rc.exec(e))?(Xi(Ki(t[1]),fn(t[2]),fn(t[3]))|255)>>>0:(t=$c.exec(e))?(Xi(Ki(t[1]),fn(t[2]),fn(t[3]))|Qi(t[4]))>>>0:null}function xr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Xi(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,s=xr(i,r,e+1/3),o=xr(i,r,e),a=xr(i,r,e-1/3);return Math.round(s*255)<<24|Math.round(o*255)<<16|Math.round(a*255)<<8}function dt(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Ki(e){return(parseFloat(e)%360+360)%360/360}function Qi(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function fn(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Zi(e){let t=Lc(e);if(t===null)return e;t=t||0;const n=(t&4278190080)>>>24,r=(t&16711680)>>>16,i=(t&65280)>>>8,s=(t&255)/255;return`rgba(${n}, ${r}, ${i}, ${s})`}var zt=(e,t,n)=>{if(j.fun(e))return e;if(j.arr(e))return zt({range:e,output:t,extrapolate:n});if(j.str(e.output[0]))return hi(e);const r=e,i=r.output,s=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(l=>l);return l=>{const u=Dc(l,s);return Ec(l,s[u],s[u+1],i[u],i[u+1],c,o,a,r.map)}};function Ec(e,t,n,r,i,s,o,a,c){let l=c?c(e):e;if(l<t){if(o==="identity")return l;o==="clamp"&&(l=t)}if(l>n){if(a==="identity")return l;a==="clamp"&&(l=n)}return r===i?r:t===n?e<=t?r:i:(t===-1/0?l=-l:n===1/0?l=l-t:l=(l-t)/(n-t),l=s(l),r===-1/0?l=-l:i===1/0?l=l+r:l=l*(i-r)+r,l)}function Dc(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var Fc=(e,t="end")=>n=>{n=t==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*e,i=t==="end"?Math.floor(r):Math.ceil(r);return Tc(0,1,i/e)},En=1.70158,hn=En*1.525,Ji=En+1,es=2*Math.PI/3,ts=2*Math.PI/4.5,mn=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Oc={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>Ji*e*e*e-En*e*e,easeOutBack:e=>1+Ji*Math.pow(e-1,3)+En*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((hn+1)*2*e-hn)/2:(Math.pow(2*e-2,2)*((hn+1)*(e*2-2)+hn)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*es),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*es)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*ts))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*ts)/2+1,easeInBounce:e=>1-mn(1-e),easeOutBounce:mn,easeInOutBounce:e=>e<.5?(1-mn(1-2*e))/2:(1+mn(2*e-1))/2,steps:Fc},Vt=Symbol.for("FluidValue.get"),yt=Symbol.for("FluidValue.observers"),ye=e=>!!(e&&e[Vt]),me=e=>e&&e[Vt]?e[Vt]():e,ns=e=>e[yt]||null;function Uc(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Bt(e,t){const n=e[yt];n&&n.forEach(r=>{Uc(r,t)})}var Lo=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Hc(this,e)}},Hc=(e,t)=>Eo(e,Vt,t);function At(e,t){if(e[Vt]){let n=e[yt];n||Eo(e,yt,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Wt(e,t){const n=e[yt];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[yt]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var Eo=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Tn=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,zc=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,rs=new RegExp(`(${Tn.source})(%|[a-z]+)`,"i"),Vc=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,nr=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Do=e=>{const[t,n]=Bc(e);if(!t||fi())return e;const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){const i=window.getComputedStyle(document.documentElement).getPropertyValue(n);return i||e}else{if(n&&nr.test(n))return Do(n);if(n)return n}return e},Bc=e=>{const t=nr.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},yr,Wc=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,Fo=e=>{yr||(yr=Xe?new RegExp(`(${Object.keys(Xe).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(s=>me(s).replace(nr,Do).replace(zc,Zi).replace(yr,Zi)),n=t.map(s=>s.match(Tn).map(Number)),i=n[0].map((s,o)=>n.map(a=>{if(!(o in a))throw Error('The arity of each "output" value must be equal');return a[o]})).map(s=>zt({...e,output:s}));return s=>{var c;const o=!rs.test(t[0])&&((c=t.find(l=>rs.test(l)))==null?void 0:c.replace(Tn,""));let a=0;return t[0].replace(Tn,()=>`${i[a++](s)}${o||""}`).replace(Vc,Wc)}},gi="react-spring: ",Oo=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${gi}once requires a function parameter`);return(...r)=>{n||(t(...r),n=!0)}},Yc=Oo(console.warn);function Gc(){Yc(`${gi}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var qc=Oo(console.warn);function Xc(){qc(`${gi}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function rr(e){return j.str(e)&&(e[0]=="#"||/\d/.test(e)||!fi()&&nr.test(e)||e in(Xe||{}))}var nt=fi()?w.useEffect:w.useLayoutEffect,Kc=()=>{const e=w.useRef(!1);return nt(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Uo(){const e=w.useState()[1],t=Kc();return()=>{t.current&&e(Math.random())}}function Qc(e,t){const[n]=w.useState(()=>({inputs:t,result:e()})),r=w.useRef(),i=r.current;let s=i;return s?t&&s.inputs&&Zc(t,s.inputs)||(s={inputs:t,result:e()}):s=n,w.useEffect(()=>{r.current=s,i==n&&(n.inputs=n.result=void 0)},[s]),s.result}function Zc(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Ho=e=>w.useEffect(e,Jc),Jc=[];function eu(e){const t=w.useRef();return w.useEffect(()=>{t.current=e}),t.current}var Yt=Symbol.for("Animated:node"),tu=e=>!!e&&e[Yt]===e,$e=e=>e&&e[Yt],pi=(e,t)=>wc(e,Yt,t),ir=e=>e&&e[Yt]&&e[Yt].getPayload(),zo=class{constructor(){pi(this,this)}getPayload(){return this.payload||[]}},an=class extends zo{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,j.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new an(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return j.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,j.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Gt=class extends an{constructor(e){super(0),this._string=null,this._toString=zt({output:[e,e]})}static create(e){return new Gt(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(j.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=zt({output:[this.getValue(),e]})),this._value=0,super.reset()}},Dn={dependencies:null},sr=class extends zo{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Ie(this.source,(n,r)=>{tu(n)?t[r]=n.getValue(e):ye(n)?t[r]=me(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Y(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return Ie(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Dn.dependencies&&ye(e)&&Dn.dependencies.add(e);const t=ir(e);t&&Y(t,n=>this.add(n))}},Vo=class extends sr{constructor(e){super(e)}static create(e){return new Vo(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,r)=>n.setValue(e[r])).some(Boolean):(super.setValue(e.map(nu)),!0)}};function nu(e){return(rr(e)?Gt:an).create(e)}function Br(e){const t=$e(e);return t?t.constructor:j.arr(e)?Vo:rr(e)?Gt:an}var is=(e,t)=>{const n=!j.fun(e)||e.prototype&&e.prototype.isReactComponent;return w.forwardRef((r,i)=>{const s=w.useRef(null),o=n&&w.useCallback(m=>{s.current=su(i,m)},[i]),[a,c]=iu(r,t),l=Uo(),u=()=>{const m=s.current;if(n&&!m)return;(m?t.applyAnimatedValues(m,a.getValue(!0)):!1)===!1&&l()},d=new ru(u,c),f=w.useRef();nt(()=>(f.current=d,Y(c,m=>At(m,d)),()=>{f.current&&(Y(f.current.deps,m=>Wt(m,f.current)),V.cancel(f.current.update))})),w.useEffect(u,[]),Ho(()=>()=>{const m=f.current;Y(m.deps,p=>Wt(p,m))});const g=t.getComponentProps(a.getValue());return w.createElement(e,{...g,ref:o})})},ru=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&V.write(this.update)}};function iu(e,t){const n=new Set;return Dn.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new sr(e),Dn.dependencies=null,[e,n]}function su(e,t){return e&&(j.fun(e)?e(t):e.current=t),t}var ss=Symbol.for("AnimatedComponent"),ou=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=i=>new sr(i),getComponentProps:r=i=>i}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},s=o=>{const a=os(o)||"Anonymous";return j.str(o)?o=s[o]||(s[o]=is(o,i)):o=o[ss]||(o[ss]=is(o,i)),o.displayName=`Animated(${a})`,o};return Ie(e,(o,a)=>{j.arr(e)&&(a=os(o)),s[a]=s(o)}),{animated:s}},os=e=>j.str(e)?e:e&&j.str(e.displayName)?e.displayName:j.fun(e)&&e.name||null;function ge(e,...t){return j.fun(e)?e(...t):e}var Ot=(e,t)=>e===!0||!!(t&&e&&(j.fun(e)?e(t):fe(e).includes(t))),Bo=(e,t)=>j.obj(e)?t&&e[t]:e,Wo=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,au=e=>e,xi=(e,t=au)=>{let n=lu;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));const r={};for(const i of n){const s=t(e[i],i);j.und(s)||(r[i]=s)}return r},lu=["config","onProps","onStart","onChange","onPause","onResume","onRest"],cu={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function uu(e){const t={};let n=0;if(Ie(e,(r,i)=>{cu[i]||(t[i]=r,n++)}),n)return t}function yi(e){const t=uu(e);if(t){const n={to:t};return Ie(e,(r,i)=>i in t||(n[i]=r)),n}return{...e}}function qt(e){return e=me(e),j.arr(e)?e.map(qt):rr(e)?xe.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function du(e){for(const t in e)return!0;return!1}function Wr(e){return j.fun(e)||j.arr(e)&&j.obj(e[0])}function as(e,t){var n;(n=e.ref)==null||n.delete(e),t==null||t.delete(e)}function fu(e,t){var n;t&&e.ref!==t&&((n=e.ref)==null||n.delete(e),t.add(e),e.ref=t)}var hu={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},Yr={...hu.default,mass:1,damping:1,easing:Oc.linear,clamp:!1},mu=class{constructor(){this.velocity=0,Object.assign(this,Yr)}};function gu(e,t,n){n&&(n={...n},ls(n,t),t={...n,...t}),ls(e,t),Object.assign(e,t);for(const o in Yr)e[o]==null&&(e[o]=Yr[o]);let{frequency:r,damping:i}=e;const{mass:s}=e;return j.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/r,2)*s,e.friction=4*Math.PI*i*s/r),e}function ls(e,t){if(!j.und(t.decay))e.duration=void 0;else{const n=!j.und(t.tension)||!j.und(t.friction);(n||!j.und(t.frequency)||!j.und(t.damping)||!j.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var cs=[],pu=class{constructor(){this.changed=!1,this.values=cs,this.toValues=null,this.fromValues=cs,this.config=new mu,this.immediate=!1}};function Yo(e,{key:t,props:n,defaultProps:r,state:i,actions:s}){return new Promise((o,a)=>{let c,l,u=Ot(n.cancel??(r==null?void 0:r.cancel),t);if(u)g();else{j.und(n.pause)||(i.paused=Ot(n.pause,t));let m=r==null?void 0:r.pause;m!==!0&&(m=i.paused||Ot(m,t)),c=ge(n.delay||0,t),m?(i.resumeQueue.add(f),s.pause()):(s.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(l),l.cancel(),c=l.time-V.now()}function f(){c>0&&!xe.skipAnimation?(i.delayed=!0,l=V.setTimeout(g,c),i.pauseQueue.add(d),i.timeouts.add(l)):g()}function g(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(d),i.timeouts.delete(l),e<=(i.cancelId||0)&&(u=!0);try{s.start({...n,callId:e,cancel:u},o)}catch(m){a(m)}}})}var bi=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?pt(e.get()):t.every(n=>n.noop)?Go(e.get()):Me(e.get(),t.every(n=>n.finished)),Go=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Me=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),pt=e=>({value:e,cancelled:!0,finished:!1});function qo(e,t,n,r){const{callId:i,parentId:s,onRest:o}=t,{asyncTo:a,promise:c}=n;return!s&&e===a&&!t.reset?c:n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;const l=xi(t,(x,b)=>b==="onRest"?void 0:x);let u,d;const f=new Promise((x,b)=>(u=x,d=b)),g=x=>{const b=i<=(n.cancelId||0)&&pt(r)||i!==n.asyncId&&Me(r,!1);if(b)throw x.result=b,d(x),x},m=(x,b)=>{const T=new us,v=new ds;return(async()=>{if(xe.skipAnimation)throw Xt(n),v.result=Me(r,!1),d(v),v;g(T);const C=j.obj(x)?{...x}:{...b,to:x};C.parentId=i,Ie(l,(M,$)=>{j.und(C[$])&&(C[$]=M)});const k=await r.start(C);return g(T),n.paused&&await new Promise(M=>{n.resumeQueue.add(M)}),k})()};let p;if(xe.skipAnimation)return Xt(n),Me(r,!1);try{let x;j.arr(e)?x=(async b=>{for(const T of b)await m(T)})(e):x=Promise.resolve(e(m,r.stop.bind(r))),await Promise.all([x.then(u),f]),p=Me(r.get(),!0,!1)}catch(x){if(x instanceof us)p=x.result;else if(x instanceof ds)p=x.result;else throw x}finally{i==n.asyncId&&(n.asyncId=s,n.asyncTo=s?a:void 0,n.promise=s?c:void 0)}return j.fun(o)&&V.batchedUpdates(()=>{o(p,r,r.item)}),p})()}function Xt(e,t){Dt(e.timeouts,n=>n.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var us=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},ds=class extends Error{constructor(){super("SkipAnimationSignal")}},Gr=e=>e instanceof vi,xu=1,vi=class extends Lo{constructor(){super(...arguments),this.id=xu++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=$e(this);return e&&e.getValue()}to(...e){return xe.to(this,e)}interpolate(...e){return Gc(),xe.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Bt(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||er.sort(this),Bt(this,{type:"priority",parent:this,priority:e})}},lt=Symbol.for("SpringPhase"),Xo=1,qr=2,Xr=4,br=e=>(e[lt]&Xo)>0,We=e=>(e[lt]&qr)>0,Rt=e=>(e[lt]&Xr)>0,fs=(e,t)=>t?e[lt]|=qr|Xo:e[lt]&=~qr,hs=(e,t)=>t?e[lt]|=Xr:e[lt]&=~Xr,yu=class extends vi{constructor(e,t){if(super(),this.animation=new pu,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!j.und(e)||!j.und(t)){const n=j.obj(e)?{...e}:{...t,from:e};j.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(We(this)||this._state.asyncTo)||Rt(this)}get goal(){return me(this.animation.to)}get velocity(){const e=$e(this);return e instanceof an?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return br(this)}get isAnimating(){return We(this)}get isPaused(){return Rt(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{toValues:i}=r;const{config:s}=r,o=ir(r.to);!o&&ye(r.to)&&(i=fe(me(r.to))),r.values.forEach((l,u)=>{if(l.done)return;const d=l.constructor==Gt?1:o?o[u].lastPosition:i[u];let f=r.immediate,g=d;if(!f){if(g=l.lastPosition,s.tension<=0){l.done=!0;return}let m=l.elapsedTime+=e;const p=r.fromValues[u],x=l.v0!=null?l.v0:l.v0=j.arr(s.velocity)?s.velocity[u]:s.velocity;let b;const T=s.precision||(p==d?.005:Math.min(1,Math.abs(d-p)*.001));if(j.und(s.duration))if(s.decay){const v=s.decay===!0?.998:s.decay,C=Math.exp(-(1-v)*m);g=p+x/(1-v)*(1-C),f=Math.abs(l.lastPosition-g)<=T,b=x*C}else{b=l.lastVelocity==null?x:l.lastVelocity;const v=s.restVelocity||T/10,C=s.clamp?0:s.bounce,k=!j.und(C),M=p==d?l.v0>0:p<d;let $,E=!1;const N=1,D=Math.ceil(e/N);for(let S=0;S<D&&($=Math.abs(b)>v,!(!$&&(f=Math.abs(d-g)<=T,f)));++S){k&&(E=g==d||g>d==M,E&&(b=-b*C,g=d));const L=-s.tension*1e-6*(g-d),P=-s.friction*.001*b,A=(L+P)/s.mass;b=b+A*N,g=g+b*N}}else{let v=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,l.durationProgress>0&&(l.elapsedTime=s.duration*l.durationProgress,m=l.elapsedTime+=e)),v=(s.progress||0)+m/this._memoizedDuration,v=v>1?1:v<0?0:v,l.durationProgress=v),g=p+s.easing(v)*(d-p),b=(g-l.lastPosition)/e,f=v==1}l.lastVelocity=b,Number.isNaN(g)&&(console.warn("Got NaN while animating:",this),f=!0)}o&&!o[u].done&&(f=!1),f?l.done=!0:t=!1,l.setValue(g,s.round)&&(n=!0)});const a=$e(this),c=a.getValue();if(t){const l=me(r.to);(c!==l||n)&&!s.decay?(a.setValue(l),this._onChange(l)):n&&s.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(e){return V.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(We(this)){const{to:e,config:t}=this.animation;V.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return j.und(e)?(n=this.queue||[],this.queue=[]):n=[j.obj(e)?e:{...t,to:e}],Promise.all(n.map(r=>this._update(r))).then(r=>bi(this,r))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Xt(this._state,e&&this._lastCallId),V.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:r}=e;n=j.obj(n)?n[t]:n,(n==null||Wr(n))&&(n=void 0),r=j.obj(r)?r[t]:r,r==null&&(r=void 0);const i={to:n,from:r};return br(this)||(e.reverse&&([n,r]=[r,n]),r=me(r),j.und(r)?$e(this)||this._set(n):this._set(r)),i}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,xi(e,(o,a)=>/^on/.test(a)?Bo(o,n):o)),gs(this,e,"onProps"),jt(this,"onProps",e,this);const i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const s=this._state;return Yo(++this._lastCallId,{key:n,props:e,defaultProps:r,state:s,actions:{pause:()=>{Rt(this)||(hs(this,!0),Lt(s.pauseQueue),jt(this,"onPause",Me(this,$t(this,this.animation.to)),this))},resume:()=>{Rt(this)&&(hs(this,!1),We(this)&&this._resume(),Lt(s.resumeQueue),jt(this,"onResume",Me(this,$t(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(o=>{if(e.loop&&o.finished&&!(t&&o.noop)){const a=Ko(e);if(a)return this._update(a,!0)}return o})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(pt(this));const r=!j.und(e.to),i=!j.und(e.from);if(r||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(pt(this));const{key:s,defaultProps:o,animation:a}=this,{to:c,from:l}=a;let{to:u=c,from:d=l}=e;i&&!r&&(!t.default||j.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);const f=!Ee(d,l);f&&(a.from=d),d=me(d);const g=!Ee(u,c);g&&this._focus(u);const m=Wr(t.to),{config:p}=a,{decay:x,velocity:b}=p;(r||i)&&(p.velocity=0),t.config&&!m&&gu(p,ge(t.config,s),t.config!==o.config?ge(o.config,s):void 0);let T=$e(this);if(!T||j.und(u))return n(Me(this,!0));const v=j.und(t.reset)?i&&!t.default:!j.und(d)&&Ot(t.reset,s),C=v?d:this.get(),k=qt(u),M=j.num(k)||j.arr(k)||rr(k),$=!m&&(!M||Ot(o.immediate||t.immediate,s));if(g){const S=Br(u);if(S!==T.constructor)if($)T=this._set(k);else throw Error(`Cannot animate between ${T.constructor.name} and ${S.name}, as the "to" prop suggests`)}const E=T.constructor;let N=ye(u),D=!1;if(!N){const S=v||!br(this)&&f;(g||S)&&(D=Ee(qt(C),k),N=!D),(!Ee(a.immediate,$)&&!$||!Ee(p.decay,x)||!Ee(p.velocity,b))&&(N=!0)}if(D&&We(this)&&(a.changed&&!v?N=!0:N||this._stop(c)),!m&&((N||ye(c))&&(a.values=T.getPayload(),a.toValues=ye(u)?null:E==Gt?[1]:fe(k)),a.immediate!=$&&(a.immediate=$,!$&&!v&&this._set(c)),N)){const{onRest:S}=a;Y(bu,P=>gs(this,t,P));const L=Me(this,$t(this,c));Lt(this._pendingCalls,L),this._pendingCalls.add(n),a.changed&&V.batchedUpdates(()=>{var P;a.changed=!v,S==null||S(L,this),v?ge(o.onRest,L):(P=a.onStart)==null||P.call(a,L,this)})}v&&this._set(C),m?n(qo(t.to,t,this._state,this)):N?this._start():We(this)&&!g?this._pendingCalls.add(n):n(Go(C))}_focus(e){const t=this.animation;e!==t.to&&(ns(this)&&this._detach(),t.to=e,ns(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;ye(t)&&(At(t,this),Gr(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;ye(e)&&Wt(e,this)}_set(e,t=!0){const n=me(e);if(!j.und(n)){const r=$e(this);if(!r||!Ee(n,r.getValue())){const i=Br(n);!r||r.constructor!=i?pi(this,i.create(n)):r.setValue(n),r&&V.batchedUpdates(()=>{this._onChange(n,t)})}}return $e(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,jt(this,"onStart",Me(this,$t(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),ge(this.animation.onChange,e,this)),ge(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;$e(this).reset(me(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),We(this)||(fs(this,!0),Rt(this)||this._resume())}_resume(){xe.skipAnimation?this.finish():er.start(this)}_stop(e,t){if(We(this)){fs(this,!1);const n=this.animation;Y(n.values,i=>{i.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Bt(this,{type:"idle",parent:this});const r=t?pt(this.get()):Me(this.get(),$t(this,e??n.to));Lt(this._pendingCalls,r),n.changed&&(n.changed=!1,jt(this,"onRest",r,this))}}};function $t(e,t){const n=qt(t),r=qt(e.get());return Ee(r,n)}function Ko(e,t=e.loop,n=e.to){const r=ge(t);if(r){const i=r!==!0&&yi(r),s=(i||e).reverse,o=!i||i.reset;return Fn({...e,loop:t,default:!1,pause:void 0,to:!s||Wr(n)?n:void 0,from:o?e.from:void 0,reset:o,...i})}}function Fn(e){const{to:t,from:n}=e=yi(e),r=new Set;return j.obj(t)&&ms(t,r),j.obj(n)&&ms(n,r),e.keys=r.size?Array.from(r):null,e}function ms(e,t){Ie(e,(n,r)=>n!=null&&t.add(r))}var bu=["onStart","onRest","onChange","onPause","onResume"];function gs(e,t,n){e.animation[n]=t[n]!==Wo(t,n)?Bo(t[n],e.key):void 0}function jt(e,t,...n){var r,i,s,o;(i=(r=e.animation)[t])==null||i.call(r,...n),(o=(s=e.defaultProps)[t])==null||o.call(s,...n)}var vu=["onStart","onChange","onRest"],wu=1,Cu=class{constructor(e,t){this.id=wu++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];j.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Fn(e)),this}start(e){let{queue:t}=this;return e?t=fe(e).map(Fn):this.queue=[],this._flush?this._flush(this,t):(ea(this,t),Mu(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Y(fe(t),r=>n[r].stop(!!e))}else Xt(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(j.und(e))this.start({pause:!0});else{const t=this.springs;Y(fe(e),n=>t[n].pause())}return this}resume(e){if(j.und(e))this.start({pause:!1});else{const t=this.springs;Y(fe(e),n=>t[n].resume())}return this}each(e){Ie(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,i=this._changed.size>0;(r&&!this._started||i&&!this._started)&&(this._started=!0,Dt(e,([a,c])=>{c.value=this.get(),a(c,this,this._item)}));const s=!r&&this._started,o=i||s&&n.size?this.get():null;i&&t.size&&Dt(t,([a,c])=>{c.value=o,a(c,this,this._item)}),s&&(this._started=!1,Dt(n,([a,c])=>{c.value=o,a(c,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;V.onFrame(this._onFrame)}};function Mu(e,t){return Promise.all(t.map(n=>Qo(e,n))).then(n=>bi(e,n))}async function Qo(e,t,n){const{keys:r,to:i,from:s,loop:o,onRest:a,onResolve:c}=t,l=j.obj(t.default)&&t.default;o&&(t.loop=!1),i===!1&&(t.to=null),s===!1&&(t.from=null);const u=j.arr(i)||j.fun(i)?i:void 0;u?(t.to=void 0,t.onRest=void 0,l&&(l.onRest=void 0)):Y(vu,p=>{const x=t[p];if(j.fun(x)){const b=e._events[p];t[p]=({finished:T,cancelled:v})=>{const C=b.get(x);C?(T||(C.finished=!1),v&&(C.cancelled=!0)):b.set(x,{value:null,finished:T||!1,cancelled:v||!1})},l&&(l[p]=t[p])}});const d=e._state;t.pause===!d.paused?(d.paused=t.pause,Lt(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const f=(r||Object.keys(e.springs)).map(p=>e.springs[p].start(t)),g=t.cancel===!0||Wo(t,"cancel")===!0;(u||g&&d.asyncId)&&f.push(Yo(++e._lastAsyncId,{props:t,state:d,actions:{pause:zr,resume:zr,start(p,x){g?(Xt(d,e._lastAsyncId),x(pt(e))):(p.onRest=a,x(qo(u,p,d,e)))}}})),d.paused&&await new Promise(p=>{d.resumeQueue.add(p)});const m=bi(e,await Promise.all(f));if(o&&m.finished&&!(n&&m.noop)){const p=Ko(t,o,i);if(p)return ea(e,[p]),Qo(e,p,!0)}return c&&V.batchedUpdates(()=>c(m,e,e.item)),m}function ku(e,t){const n={...e.springs};return t&&Y(fe(t),r=>{j.und(r.keys)&&(r=Fn(r)),j.obj(r.to)||(r={...r,to:void 0}),Jo(n,r,i=>Zo(i))}),Tu(e,n),n}function Tu(e,t){Ie(t,(n,r)=>{e.springs[r]||(e.springs[r]=n,At(n,e))})}function Zo(e,t){const n=new yu;return n.key=e,t&&At(n,t),n}function Jo(e,t,n){t.keys&&Y(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function ea(e,t){Y(t,n=>{Jo(e.springs,n,r=>Zo(r,e))})}var or=({children:e,...t})=>{const n=w.useContext(On),r=t.pause||!!n.pause,i=t.immediate||!!n.immediate;t=Qc(()=>({pause:r,immediate:i}),[r,i]);const{Provider:s}=On;return w.createElement(s,{value:t},e)},On=Su(or,{});or.Provider=On.Provider;or.Consumer=On.Consumer;function Su(e,t){return Object.assign(e,w.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var Au=()=>{const e=[],t=function(r){Xc();const i=[];return Y(e,(s,o)=>{if(j.und(r))i.push(s.start());else{const a=n(r,s,o);a&&i.push(s.start(a))}}),i};t.current=e,t.add=function(r){e.includes(r)||e.push(r)},t.delete=function(r){const i=e.indexOf(r);~i&&e.splice(i,1)},t.pause=function(){return Y(e,r=>r.pause(...arguments)),this},t.resume=function(){return Y(e,r=>r.resume(...arguments)),this},t.set=function(r){Y(e,(i,s)=>{const o=j.fun(r)?r(s,i):r;o&&i.set(o)})},t.start=function(r){const i=[];return Y(e,(s,o)=>{if(j.und(r))i.push(s.start());else{const a=this._getProps(r,s,o);a&&i.push(s.start(a))}}),i},t.stop=function(){return Y(e,r=>r.stop(...arguments)),this},t.update=function(r){return Y(e,(i,s)=>i.update(this._getProps(r,i,s))),this};const n=function(r,i,s){return j.fun(r)?r(s,i):r};return t._getProps=n,t};function Kt(e,t,n){const r=j.fun(t)&&t,{reset:i,sort:s,trail:o=0,expires:a=!0,exitBeforeEnter:c=!1,onDestroyed:l,ref:u,config:d}=r?r():t,f=w.useMemo(()=>r||arguments.length==3?Au():void 0,[]),g=fe(e),m=[],p=w.useRef(null),x=i?null:p.current;nt(()=>{p.current=m}),Ho(()=>(Y(m,A=>{f==null||f.add(A.ctrl),A.ctrl.ref=f}),()=>{Y(p.current,A=>{A.expired&&clearTimeout(A.expirationId),as(A.ctrl,f),A.ctrl.stop(!0)})}));const b=Ru(g,r?r():t,x),T=i&&p.current||[];nt(()=>Y(T,({ctrl:A,item:_,key:F})=>{as(A,f),ge(l,_,F)}));const v=[];if(x&&Y(x,(A,_)=>{A.expired?(clearTimeout(A.expirationId),T.push(A)):(_=v[_]=b.indexOf(A.key),~_&&(m[_]=A))}),Y(g,(A,_)=>{m[_]||(m[_]={key:b[_],item:A,phase:"mount",ctrl:new Cu},m[_].ctrl.item=A)}),v.length){let A=-1;const{leave:_}=r?r():t;Y(v,(F,H)=>{const O=x[H];~F?(A=m.indexOf(O),m[A]={...O,item:g[F]}):_&&m.splice(++A,0,O)})}j.fun(s)&&m.sort((A,_)=>s(A.item,_.item));let C=-o;const k=Uo(),M=xi(t),$=new Map,E=w.useRef(new Map),N=w.useRef(!1);Y(m,(A,_)=>{const F=A.key,H=A.phase,O=r?r():t;let B,W;const z=ge(O.delay||0,F);if(H=="mount")B=O.enter,W="enter";else{const Q=b.indexOf(F)<0;if(H!="leave")if(Q)B=O.leave,W="leave";else if(B=O.update)W="update";else return;else if(!Q)B=O.enter,W="enter";else return}if(B=ge(B,A.item,_),B=j.obj(B)?yi(B):{to:B},!B.config){const Q=d||M.config;B.config=ge(Q,A.item,_,W)}C+=o;const q={...M,delay:z+C,ref:u,immediate:O.immediate,reset:!1,...B};if(W=="enter"&&j.und(q.from)){const Q=r?r():t,le=j.und(Q.initial)||x?Q.from:Q.initial;q.from=ge(le,A.item,_)}const{onResolve:ie}=q;q.onResolve=Q=>{ge(ie,Q);const le=p.current,J=le.find(te=>te.key===F);if(J&&!(Q.cancelled&&J.phase!="update")&&J.ctrl.idle){const te=le.every(I=>I.ctrl.idle);if(J.phase=="leave"){const I=ge(a,J.item);if(I!==!1){const U=I===!0?0:I;if(J.expired=!0,!te&&U>0){U<=2147483647&&(J.expirationId=setTimeout(k,U));return}}}te&&le.some(I=>I.expired)&&(E.current.delete(J),c&&(N.current=!0),k())}};const ae=ku(A.ctrl,q);W==="leave"&&c?E.current.set(A,{phase:W,springs:ae,payload:q}):$.set(A,{phase:W,springs:ae,payload:q})});const D=w.useContext(or),S=eu(D),L=D!==S&&du(D);nt(()=>{L&&Y(m,A=>{A.ctrl.start({default:D})})},[D]),Y($,(A,_)=>{if(E.current.size){const F=m.findIndex(H=>H.key===_.key);m.splice(F,1)}}),nt(()=>{Y(E.current.size?E.current:$,({phase:A,payload:_},F)=>{const{ctrl:H}=F;F.phase=A,f==null||f.add(H),L&&A=="enter"&&H.start({default:D}),_&&(fu(H,_.ref),(H.ref||f)&&!N.current?H.update(_):(H.start(_),N.current&&(N.current=!1)))})},i?void 0:n);const P=A=>w.createElement(w.Fragment,null,m.map((_,F)=>{const{springs:H}=$.get(_)||_.ctrl,O=A({...H},_.item,_,F);return O&&O.type?w.createElement(O.type,{...O.props,key:j.str(_.key)||j.num(_.key)?_.key:_.ctrl.id,ref:O.ref}):O}));return f?[P,f]:P}var Pu=1;function Ru(e,{key:t,keys:n=t},r){if(n===null){const i=new Set;return e.map(s=>{const o=r&&r.find(a=>a.item===s&&a.phase!=="leave"&&!i.has(a));return o?(i.add(o),o.key):Pu++})}return j.und(n)?e:j.fun(n)?e.map(n):fe(n)}var ta=class extends vi{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=zt(...t);const n=this._get(),r=Br(n);pi(this,r.create(n))}advance(e){const t=this._get(),n=this.get();Ee(t,n)||($e(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&ps(this._active)&&vr(this)}_get(){const e=j.arr(this.source)?this.source.map(me):fe(me(this.source));return this.calc(...e)}_start(){this.idle&&!ps(this._active)&&(this.idle=!1,Y(ir(this),e=>{e.done=!1}),xe.skipAnimation?(V.batchedUpdates(()=>this.advance()),vr(this)):er.start(this))}_attach(){let e=1;Y(fe(this.source),t=>{ye(t)&&At(t,this),Gr(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Y(fe(this.source),e=>{ye(e)&&Wt(e,this)}),this._active.clear(),vr(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=fe(this.source).reduce((t,n)=>Math.max(t,(Gr(n)?n.priority:0)+1),0))}};function $u(e){return e.idle!==!1}function ps(e){return!e.size||Array.from(e).every($u)}function vr(e){e.idle||(e.idle=!0,Y(ir(e),t=>{t.done=!0}),Bt(e,{type:"idle",parent:e}))}var Kr=(e,...t)=>new ta(e,t);xe.assign({createStringInterpolator:Fo,to:(e,t)=>new ta(e,t)});var na=/^--/;function ju(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!na.test(e)&&!(Ut.hasOwnProperty(e)&&Ut[e])?t+"px":(""+t).trim()}var xs={};function Iu(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{style:r,children:i,scrollTop:s,scrollLeft:o,viewBox:a,...c}=t,l=Object.values(c),u=Object.keys(c).map(d=>n||e.hasAttribute(d)?d:xs[d]||(xs[d]=d.replace(/([A-Z])/g,f=>"-"+f.toLowerCase())));i!==void 0&&(e.textContent=i);for(const d in r)if(r.hasOwnProperty(d)){const f=ju(d,r[d]);na.test(d)?e.style.setProperty(d,f):e.style[d]=f}u.forEach((d,f)=>{e.setAttribute(d,l[f])}),s!==void 0&&(e.scrollTop=s),o!==void 0&&(e.scrollLeft=o),a!==void 0&&e.setAttribute("viewBox",a)}var Ut={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_u=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),Nu=["Webkit","Ms","Moz","O"];Ut=Object.keys(Ut).reduce((e,t)=>(Nu.forEach(n=>e[_u(n,t)]=e[t]),e),Ut);var Lu=/^(matrix|translate|scale|rotate|skew)/,Eu=/^(translate)/,Du=/^(rotate|skew)/,wr=(e,t)=>j.num(e)&&e!==0?e+t:e,Sn=(e,t)=>j.arr(e)?e.every(n=>Sn(n,t)):j.num(e)?e===t:parseFloat(e)===t,Fu=class extends sr{constructor({x:e,y:t,z:n,...r}){const i=[],s=[];(e||t||n)&&(i.push([e||0,t||0,n||0]),s.push(o=>[`translate3d(${o.map(a=>wr(a,"px")).join(",")})`,Sn(o,0)])),Ie(r,(o,a)=>{if(a==="transform")i.push([o||""]),s.push(c=>[c,c===""]);else if(Lu.test(a)){if(delete r[a],j.und(o))return;const c=Eu.test(a)?"px":Du.test(a)?"deg":"";i.push(fe(o)),s.push(a==="rotate3d"?([l,u,d,f])=>[`rotate3d(${l},${u},${d},${wr(f,c)})`,Sn(f,0)]:l=>[`${a}(${l.map(u=>wr(u,c)).join(",")})`,Sn(l,a.startsWith("scale")?1:0)])}}),i.length&&(r.transform=new Ou(i,s)),super(r)}},Ou=class extends Lo{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Y(this.inputs,(n,r)=>{const i=me(n[0]),[s,o]=this.transforms[r](j.arr(i)?i:n.map(me));e+=" "+s,t=t&&o}),t?"none":e}observerAdded(e){e==1&&Y(this.inputs,t=>Y(t,n=>ye(n)&&At(n,this)))}observerRemoved(e){e==0&&Y(this.inputs,t=>Y(t,n=>ye(n)&&Wt(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Bt(this,e)}},Uu=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];xe.assign({batchedUpdates:bo.unstable_batchedUpdates,createStringInterpolator:Fo,colors:Sc});var Hu=ou(Uu,{applyAnimatedValues:Iu,createAnimatedStyle:e=>new Fu(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),ln=Hu.animated;function An(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function zu(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function wi(e){let t,n,r;e.length!==2?(t=An,n=(a,c)=>An(e(a),c),r=(a,c)=>e(a)-c):(t=e===An||e===zu?e:Vu,n=e,r=e);function i(a,c,l=0,u=a.length){if(l<u){if(t(c,c)!==0)return u;do{const d=l+u>>>1;n(a[d],c)<0?l=d+1:u=d}while(l<u)}return l}function s(a,c,l=0,u=a.length){if(l<u){if(t(c,c)!==0)return u;do{const d=l+u>>>1;n(a[d],c)<=0?l=d+1:u=d}while(l<u)}return l}function o(a,c,l=0,u=a.length){const d=i(a,c,l,u-1);return d>l&&r(a[d-1],c)>-r(a[d],c)?d-1:d}return{left:i,center:o,right:s}}function Vu(){return 0}function Bu(e){return e===null?NaN:+e}const Wu=wi(An),Yu=Wu.right;wi(Bu).center;const ra=Yu;class ys extends Map{constructor(t,n=Xu){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(bs(this,t))}has(t){return super.has(bs(this,t))}set(t,n){return super.set(Gu(this,t),n)}delete(t){return super.delete(qu(this,t))}}function bs({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Gu({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function qu({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Xu(e){return e!==null&&typeof e=="object"?e.valueOf():e}const Ku=Math.sqrt(50),Qu=Math.sqrt(10),Zu=Math.sqrt(2);function Un(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),o=s>=Ku?10:s>=Qu?5:s>=Zu?2:1;let a,c,l;return i<0?(l=Math.pow(10,-i)/o,a=Math.round(e*l),c=Math.round(t*l),a/l<e&&++a,c/l>t&&--c,l=-l):(l=Math.pow(10,i)*o,a=Math.round(e/l),c=Math.round(t/l),a*l<e&&++a,c*l>t&&--c),c<a&&.5<=n&&n<2?Un(e,t,n*2):[a,c,l]}function Qr(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,o]=r?Un(t,e,n):Un(e,t,n);if(!(s>=i))return[];const a=s-i+1,c=new Array(a);if(r)if(o<0)for(let l=0;l<a;++l)c[l]=(s-l)/-o;else for(let l=0;l<a;++l)c[l]=(s-l)*o;else if(o<0)for(let l=0;l<a;++l)c[l]=(i+l)/-o;else for(let l=0;l<a;++l)c[l]=(i+l)*o;return c}function Zr(e,t,n){return t=+t,e=+e,n=+n,Un(e,t,n)[2]}function Jr(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Zr(t,e,n):Zr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Ju(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=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function Ke(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ed(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const vs=Symbol("implicit");function Hn(){var e=new ys,t=[],n=[],r=vs;function i(s){let o=e.get(s);if(o===void 0){if(r!==vs)return r;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new ys;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return Hn(t,n).unknown(r)},Ke.apply(i,arguments),i}function Ci(){var e=Hn().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,o,a=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var f=t().length,g=i<r,m=g?i:r,p=g?r:i;s=(p-m)/Math.max(1,f-c+l*2),a&&(s=Math.floor(s)),m+=(p-m-s*(f-c))*u,o=s*(1-c),a&&(m=Math.round(m),o=Math.round(o));var x=Ju(f).map(function(b){return m+s*b});return n(g?x.reverse():x)}return e.domain=function(f){return arguments.length?(t(f),d()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,a=!0,d()},e.bandwidth=function(){return o},e.step=function(){return s},e.round=function(f){return arguments.length?(a=!!f,d()):a},e.padding=function(f){return arguments.length?(c=Math.min(1,l=+f),d()):c},e.paddingInner=function(f){return arguments.length?(c=Math.min(1,f),d()):c},e.paddingOuter=function(f){return arguments.length?(l=+f,d()):l},e.align=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),d()):u},e.copy=function(){return Ci(t(),[r,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},Ke.apply(d(),arguments)}function ia(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return ia(t())},e}function td(){return ia(Ci.apply(null,arguments).paddingInner(1))}function Mi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function sa(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function cn(){}var Qt=.7,zn=1/Qt,xt="\\s*([+-]?\\d+)\\s*",Zt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nd=/^#([0-9a-f]{3,8})$/,rd=new RegExp(`^rgb\\(${xt},${xt},${xt}\\)$`),id=new RegExp(`^rgb\\(${je},${je},${je}\\)$`),sd=new RegExp(`^rgba\\(${xt},${xt},${xt},${Zt}\\)$`),od=new RegExp(`^rgba\\(${je},${je},${je},${Zt}\\)$`),ad=new RegExp(`^hsl\\(${Zt},${je},${je}\\)$`),ld=new RegExp(`^hsla\\(${Zt},${je},${je},${Zt}\\)$`),ws={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};Mi(cn,bt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Cs,formatHex:Cs,formatHex8:cd,formatHsl:ud,formatRgb:Ms,toString:Ms});function Cs(){return this.rgb().formatHex()}function cd(){return this.rgb().formatHex8()}function ud(){return oa(this).formatHsl()}function Ms(){return this.rgb().formatRgb()}function bt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=nd.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ks(t):n===3?new pe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?gn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?gn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=rd.exec(e))?new pe(t[1],t[2],t[3],1):(t=id.exec(e))?new pe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=sd.exec(e))?gn(t[1],t[2],t[3],t[4]):(t=od.exec(e))?gn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ad.exec(e))?As(t[1],t[2]/100,t[3]/100,1):(t=ld.exec(e))?As(t[1],t[2]/100,t[3]/100,t[4]):ws.hasOwnProperty(e)?ks(ws[e]):e==="transparent"?new pe(NaN,NaN,NaN,0):null}function ks(e){return new pe(e>>16&255,e>>8&255,e&255,1)}function gn(e,t,n,r){return r<=0&&(e=t=n=NaN),new pe(e,t,n,r)}function dd(e){return e instanceof cn||(e=bt(e)),e?(e=e.rgb(),new pe(e.r,e.g,e.b,e.opacity)):new pe}function ei(e,t,n,r){return arguments.length===1?dd(e):new pe(e,t,n,r??1)}function pe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Mi(pe,ei,sa(cn,{brighter(e){return e=e==null?zn:Math.pow(zn,e),new pe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qt:Math.pow(Qt,e),new pe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pe(ot(this.r),ot(this.g),ot(this.b),Vn(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:Ts,formatHex:Ts,formatHex8:fd,formatRgb:Ss,toString:Ss}));function Ts(){return`#${rt(this.r)}${rt(this.g)}${rt(this.b)}`}function fd(){return`#${rt(this.r)}${rt(this.g)}${rt(this.b)}${rt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ss(){const e=Vn(this.opacity);return`${e===1?"rgb(":"rgba("}${ot(this.r)}, ${ot(this.g)}, ${ot(this.b)}${e===1?")":`, ${e})`}`}function Vn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ot(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rt(e){return e=ot(e),(e<16?"0":"")+e.toString(16)}function As(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ke(e,t,n,r)}function oa(e){if(e instanceof ke)return new ke(e.h,e.s,e.l,e.opacity);if(e instanceof cn||(e=bt(e)),!e)return new ke;if(e instanceof ke)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,a=s-i,c=(s+i)/2;return a?(t===s?o=(n-r)/a+(n<r)*6:n===s?o=(r-t)/a+2:o=(t-n)/a+4,a/=c<.5?s+i:2-s-i,o*=60):a=c>0&&c<1?0:o,new ke(o,a,c,e.opacity)}function hd(e,t,n,r){return arguments.length===1?oa(e):new ke(e,t,n,r??1)}function ke(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Mi(ke,hd,sa(cn,{brighter(e){return e=e==null?zn:Math.pow(zn,e),new ke(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qt:Math.pow(Qt,e),new ke(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,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 pe(Cr(e>=240?e-240:e+120,i,r),Cr(e,i,r),Cr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ke(Ps(this.h),pn(this.s),pn(this.l),Vn(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=Vn(this.opacity);return`${e===1?"hsl(":"hsla("}${Ps(this.h)}, ${pn(this.s)*100}%, ${pn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ps(e){return e=(e||0)%360,e<0?e+360:e}function pn(e){return Math.max(0,Math.min(1,e||0))}function Cr(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ki=e=>()=>e;function md(e,t){return function(n){return e+n*t}}function gd(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)}}function pd(e){return(e=+e)==1?aa:function(t,n){return n-t?gd(t,n,e):ki(isNaN(t)?n:t)}}function aa(e,t){var n=t-e;return n?md(e,n):ki(isNaN(e)?t:e)}const Rs=function e(t){var n=pd(t);function r(i,s){var o=n((i=ei(i)).r,(s=ei(s)).r),a=n(i.g,s.g),c=n(i.b,s.b),l=aa(i.opacity,s.opacity);return function(u){return i.r=o(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=e,r}(1);function xd(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function yd(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function bd(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),o;for(o=0;o<r;++o)i[o]=ar(e[o],t[o]);for(;o<n;++o)s[o]=t[o];return function(a){for(o=0;o<r;++o)s[o]=i[o](a);return s}}function la(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Jt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function vd(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=ar(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var ti=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mr=new RegExp(ti.source,"g");function wd(e){return function(){return e}}function Cd(e){return function(t){return e(t)+""}}function Md(e,t){var n=ti.lastIndex=Mr.lastIndex=0,r,i,s,o=-1,a=[],c=[];for(e=e+"",t=t+"";(r=ti.exec(e))&&(i=Mr.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(r=r[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,c.push({i:o,x:Jt(r,i)})),n=Mr.lastIndex;return n<t.length&&(s=t.slice(n),a[o]?a[o]+=s:a[++o]=s),a.length<2?c[0]?Cd(c[0].x):wd(t):(t=c.length,function(l){for(var u=0,d;u<t;++u)a[(d=c[u]).i]=d.x(l);return a.join("")})}function ar(e,t){var n=typeof t,r;return t==null||n==="boolean"?ki(t):(n==="number"?Jt:n==="string"?(r=bt(t))?(t=r,Rs):Md:t instanceof bt?Rs:t instanceof Date?la:yd(t)?xd:Array.isArray(t)?bd:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?vd:Jt)(e,t)}function ca(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function kd(e){return function(){return e}}function Td(e){return+e}var $s=[0,1];function ve(e){return e}function ni(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:kd(isNaN(t)?NaN:.5)}function Sd(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Ad(e,t,n){var r=e[0],i=e[1],s=t[0],o=t[1];return i<r?(r=ni(i,r),s=n(o,s)):(r=ni(r,i),s=n(s,o)),function(a){return s(r(a))}}function Pd(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=ni(e[o],e[o+1]),s[o]=n(t[o],t[o+1]);return function(a){var c=ra(e,a,1,r)-1;return s[c](i[c](a))}}function lr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ti(){var e=$s,t=$s,n=ar,r,i,s,o=ve,a,c,l;function u(){var f=Math.min(e.length,t.length);return o!==ve&&(o=Sd(e[0],e[f-1])),a=f>2?Pd:Ad,c=l=null,d}function d(f){return f==null||isNaN(f=+f)?s:(c||(c=a(e.map(r),t,n)))(r(o(f)))}return d.invert=function(f){return o(i((l||(l=a(t,e.map(r),Jt)))(f)))},d.domain=function(f){return arguments.length?(e=Array.from(f,Td),u()):e.slice()},d.range=function(f){return arguments.length?(t=Array.from(f),u()):t.slice()},d.rangeRound=function(f){return t=Array.from(f),n=ca,u()},d.clamp=function(f){return arguments.length?(o=f?!0:ve,u()):o!==ve},d.interpolate=function(f){return arguments.length?(n=f,u()):n},d.unknown=function(f){return arguments.length?(s=f,d):s},function(f,g){return r=f,i=g,u()}}function ua(){return Ti()(ve,ve)}function Rd(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Bn(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 vt(e){return e=Bn(Math.abs(e)),e?e[1]:NaN}function $d(e,t){return function(n,r){for(var i=n.length,s=[],o=0,a=e[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),s.push(n.substring(i-=a,i+a)),!((c+=a+1)>r));)a=e[o=(o+1)%e.length];return s.reverse().join(t)}}function jd(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Id=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function en(e){if(!(t=Id.exec(e)))throw new Error("invalid format: "+e);var t;return new Si({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]})}en.prototype=Si.prototype;function Si(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Si.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function _d(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var da;function Nd(e,t){var n=Bn(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(da=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return s===o?r:s>o?r+new Array(s-o+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+Bn(e,Math.max(0,t+s-1))[0]}function js(e,t){var n=Bn(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")}const Is={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Rd,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)=>js(e*100,t),r:js,s:Nd,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function _s(e){return e}var Ns=Array.prototype.map,Ls=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ld(e){var t=e.grouping===void 0||e.thousands===void 0?_s:$d(Ns.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?_s:jd(Ns.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(d){d=en(d);var f=d.fill,g=d.align,m=d.sign,p=d.symbol,x=d.zero,b=d.width,T=d.comma,v=d.precision,C=d.trim,k=d.type;k==="n"?(T=!0,k="g"):Is[k]||(v===void 0&&(v=12),C=!0,k="g"),(x||f==="0"&&g==="=")&&(x=!0,f="0",g="=");var M=p==="$"?n:p==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():"",$=p==="$"?r:/[%p]/.test(k)?o:"",E=Is[k],N=/[defgprs%]/.test(k);v=v===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function D(S){var L=M,P=$,A,_,F;if(k==="c")P=E(S)+P,S="";else{S=+S;var H=S<0||1/S<0;if(S=isNaN(S)?c:E(Math.abs(S),v),C&&(S=_d(S)),H&&+S==0&&m!=="+"&&(H=!1),L=(H?m==="("?m:a:m==="-"||m==="("?"":m)+L,P=(k==="s"?Ls[8+da/3]:"")+P+(H&&m==="("?")":""),N){for(A=-1,_=S.length;++A<_;)if(F=S.charCodeAt(A),48>F||F>57){P=(F===46?i+S.slice(A+1):S.slice(A))+P,S=S.slice(0,A);break}}}T&&!x&&(S=t(S,1/0));var O=L.length+S.length+P.length,B=O<b?new Array(b-O+1).join(f):"";switch(T&&x&&(S=t(B+S,B.length?b-P.length:1/0),B=""),g){case"<":S=L+S+P+B;break;case"=":S=L+B+S+P;break;case"^":S=B.slice(0,O=B.length>>1)+L+S+P+B.slice(O);break;default:S=B+L+S+P;break}return s(S)}return D.toString=function(){return d+""},D}function u(d,f){var g=l((d=en(d),d.type="f",d)),m=Math.max(-8,Math.min(8,Math.floor(vt(f)/3)))*3,p=Math.pow(10,-m),x=Ls[8+m/3];return function(b){return g(p*b)+x}}return{format:l,formatPrefix:u}}var xn,Ai,fa;Ed({thousands:",",grouping:[3],currency:["$",""]});function Ed(e){return xn=Ld(e),Ai=xn.format,fa=xn.formatPrefix,xn}function Dd(e){return Math.max(0,-vt(Math.abs(e)))}function Fd(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vt(t)/3)))*3-vt(Math.abs(e)))}function Od(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,vt(t)-vt(e))+1}function Ud(e,t,n,r){var i=Jr(e,t,n),s;switch(r=en(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=Fd(i,o))&&(r.precision=s),fa(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Od(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=Dd(i))&&(r.precision=s-(r.type==="%")*2);break}}return Ai(r)}function Pi(e){var t=e.domain;return e.ticks=function(n){var r=t();return Qr(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Ud(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,o=r[i],a=r[s],c,l,u=10;for(a<o&&(l=o,o=a,a=l,l=i,i=s,s=l);u-- >0;){if(l=Zr(o,a,n),l===c)return r[i]=o,r[s]=a,t(r);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;c=l}return e},e}function ha(){var e=ua();return e.copy=function(){return lr(e,ha())},Ke.apply(e,arguments),Pi(e)}function ma(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],o;return s<i&&(o=n,n=r,r=o,o=i,i=s,s=o),e[n]=t.floor(i),e[r]=t.ceil(s),e}function Es(e){return Math.log(e)}function Ds(e){return Math.exp(e)}function Hd(e){return-Math.log(-e)}function zd(e){return-Math.exp(-e)}function Vd(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Bd(e){return e===10?Vd:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Wd(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Fs(e){return(t,n)=>-e(-t,n)}function Yd(e){const t=e(Es,Ds),n=t.domain;let r=10,i,s;function o(){return i=Wd(r),s=Bd(r),n()[0]<0?(i=Fs(i),s=Fs(s),e(Hd,zd)):e(Es,Ds),t}return t.base=function(a){return arguments.length?(r=+a,o()):r},t.domain=function(a){return arguments.length?(n(a),o()):n()},t.ticks=a=>{const c=n();let l=c[0],u=c[c.length-1];const d=u<l;d&&([l,u]=[u,l]);let f=i(l),g=i(u),m,p;const x=a==null?10:+a;let b=[];if(!(r%1)&&g-f<x){if(f=Math.floor(f),g=Math.ceil(g),l>0){for(;f<=g;++f)for(m=1;m<r;++m)if(p=f<0?m/s(-f):m*s(f),!(p<l)){if(p>u)break;b.push(p)}}else for(;f<=g;++f)for(m=r-1;m>=1;--m)if(p=f>0?m/s(-f):m*s(f),!(p<l)){if(p>u)break;b.push(p)}b.length*2<x&&(b=Qr(l,u,x))}else b=Qr(f,g,Math.min(g-f,x)).map(s);return d?b.reverse():b},t.tickFormat=(a,c)=>{if(a==null&&(a=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=en(c)).precision==null&&(c.trim=!0),c=Ai(c)),a===1/0)return c;const l=Math.max(1,r*a/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=l?c(u):""}},t.nice=()=>n(ma(n(),{floor:a=>s(Math.floor(i(a))),ceil:a=>s(Math.ceil(i(a)))})),t}function ga(){const e=Yd(Ti()).domain([1,10]);return e.copy=()=>lr(e,ga()).base(e.base()),Ke.apply(e,arguments),e}function Os(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Gd(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function qd(e){return e<0?-e*e:e*e}function Xd(e){var t=e(ve,ve),n=1;function r(){return n===1?e(ve,ve):n===.5?e(Gd,qd):e(Os(n),Os(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Pi(t)}function Ri(){var e=Xd(Ti());return e.copy=function(){return lr(e,Ri()).exponent(e.exponent())},Ke.apply(e,arguments),e}function Kd(){return Ri.apply(null,arguments).exponent(.5)}function pa(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[ra(e,s,0,r)]:n}return i.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return pa().domain(e).range(t).unknown(n)},Ke.apply(i,arguments)}const kr=new Date,Tr=new Date;function re(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const o=i(s),a=i.ceil(s);return s-o<a-s?o:a},i.offset=(s,o)=>(t(s=new Date(+s),o==null?1:Math.floor(o)),s),i.range=(s,o,a)=>{const c=[];if(s=i.ceil(s),a=a==null?1:Math.floor(a),!(s<o)||!(a>0))return c;let l;do c.push(l=new Date(+s)),t(s,a),e(s);while(l<s&&s<o);return c},i.filter=s=>re(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!s(o););else for(;--a>=0;)for(;t(o,1),!s(o););}),n&&(i.count=(s,o)=>(kr.setTime(+s),Tr.setTime(+o),e(kr),e(Tr),Math.floor(n(kr,Tr))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?o=>r(o)%s===0:o=>i.count(0,o)%s===0):i)),i}const Wn=re(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Wn.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?re(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Wn);Wn.range;const De=1e3,we=De*60,Fe=we*60,Ue=Fe*24,$i=Ue*7,Us=Ue*30,Sr=Ue*365,it=re(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*De)},(e,t)=>(t-e)/De,e=>e.getUTCSeconds());it.range;const ji=re(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*De)},(e,t)=>{e.setTime(+e+t*we)},(e,t)=>(t-e)/we,e=>e.getMinutes());ji.range;const Ii=re(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*we)},(e,t)=>(t-e)/we,e=>e.getUTCMinutes());Ii.range;const _i=re(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*De-e.getMinutes()*we)},(e,t)=>{e.setTime(+e+t*Fe)},(e,t)=>(t-e)/Fe,e=>e.getHours());_i.range;const Ni=re(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Fe)},(e,t)=>(t-e)/Fe,e=>e.getUTCHours());Ni.range;const un=re(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*we)/Ue,e=>e.getDate()-1);un.range;const cr=re(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ue,e=>e.getUTCDate()-1);cr.range;const xa=re(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ue,e=>Math.floor(e/Ue));xa.range;function ct(e){return re(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*we)/$i)}const ur=ct(0),Yn=ct(1),Qd=ct(2),Zd=ct(3),wt=ct(4),Jd=ct(5),ef=ct(6);ur.range;Yn.range;Qd.range;Zd.range;wt.range;Jd.range;ef.range;function ut(e){return re(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/$i)}const dr=ut(0),Gn=ut(1),tf=ut(2),nf=ut(3),Ct=ut(4),rf=ut(5),sf=ut(6);dr.range;Gn.range;tf.range;nf.range;Ct.range;rf.range;sf.range;const Li=re(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Li.range;const Ei=re(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Ei.range;const He=re(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());He.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:re(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)});He.range;const ze=re(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());ze.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:re(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)});ze.range;function ya(e,t,n,r,i,s){const o=[[it,1,De],[it,5,5*De],[it,15,15*De],[it,30,30*De],[s,1,we],[s,5,5*we],[s,15,15*we],[s,30,30*we],[i,1,Fe],[i,3,3*Fe],[i,6,6*Fe],[i,12,12*Fe],[r,1,Ue],[r,2,2*Ue],[n,1,$i],[t,1,Us],[t,3,3*Us],[e,1,Sr]];function a(l,u,d){const f=u<l;f&&([l,u]=[u,l]);const g=d&&typeof d.range=="function"?d:c(l,u,d),m=g?g.range(l,+u+1):[];return f?m.reverse():m}function c(l,u,d){const f=Math.abs(u-l)/d,g=wi(([,,x])=>x).right(o,f);if(g===o.length)return e.every(Jr(l/Sr,u/Sr,d));if(g===0)return Wn.every(Math.max(Jr(l,u,d),1));const[m,p]=o[f/o[g-1][2]<o[g][2]/f?g-1:g];return m.every(p)}return[a,c]}const[of,af]=ya(ze,Ei,dr,xa,Ni,Ii),[lf,cf]=ya(He,Li,ur,un,_i,ji);function Ar(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 Pr(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 It(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function uf(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,o=e.shortDays,a=e.months,c=e.shortMonths,l=_t(i),u=Nt(i),d=_t(s),f=Nt(s),g=_t(o),m=Nt(o),p=_t(a),x=Nt(a),b=_t(c),T=Nt(c),v={a:H,A:O,b:B,B:W,c:null,d:Ys,e:Ys,f:_f,g:Vf,G:Wf,H:$f,I:jf,j:If,L:ba,m:Nf,M:Lf,p:z,q,Q:Xs,s:Ks,S:Ef,u:Df,U:Ff,V:Of,w:Uf,W:Hf,x:null,X:null,y:zf,Y:Bf,Z:Yf,"%":qs},C={a:ie,A:ae,b:Q,B:le,c:null,d:Gs,e:Gs,f:Kf,g:oh,G:lh,H:Gf,I:qf,j:Xf,L:wa,m:Qf,M:Zf,p:J,q:te,Q:Xs,s:Ks,S:Jf,u:eh,U:th,V:nh,w:rh,W:ih,x:null,X:null,y:sh,Y:ah,Z:ch,"%":qs},k={a:D,A:S,b:L,B:P,c:A,d:Bs,e:Bs,f:Sf,g:Vs,G:zs,H:Ws,I:Ws,j:Cf,L:Tf,m:wf,M:Mf,p:N,q:vf,Q:Pf,s:Rf,S:kf,u:gf,U:pf,V:xf,w:mf,W:yf,x:_,X:F,y:Vs,Y:zs,Z:bf,"%":Af};v.x=M(n,v),v.X=M(r,v),v.c=M(t,v),C.x=M(n,C),C.X=M(r,C),C.c=M(t,C);function M(I,U){return function(G){var R=[],se=-1,X=0,ce=I.length,de,Le,Vi;for(G instanceof Date||(G=new Date(+G));++se<ce;)I.charCodeAt(se)===37&&(R.push(I.slice(X,se)),(Le=Hs[de=I.charAt(++se)])!=null?de=I.charAt(++se):Le=de==="e"?" ":"0",(Vi=U[de])&&(de=Vi(G,Le)),R.push(de),X=se+1);return R.push(I.slice(X,se)),R.join("")}}function $(I,U){return function(G){var R=It(1900,void 0,1),se=E(R,I,G+="",0),X,ce;if(se!=G.length)return null;if("Q"in R)return new Date(R.Q);if("s"in R)return new Date(R.s*1e3+("L"in R?R.L:0));if(U&&!("Z"in R)&&(R.Z=0),"p"in R&&(R.H=R.H%12+R.p*12),R.m===void 0&&(R.m="q"in R?R.q:0),"V"in R){if(R.V<1||R.V>53)return null;"w"in R||(R.w=1),"Z"in R?(X=Pr(It(R.y,0,1)),ce=X.getUTCDay(),X=ce>4||ce===0?Gn.ceil(X):Gn(X),X=cr.offset(X,(R.V-1)*7),R.y=X.getUTCFullYear(),R.m=X.getUTCMonth(),R.d=X.getUTCDate()+(R.w+6)%7):(X=Ar(It(R.y,0,1)),ce=X.getDay(),X=ce>4||ce===0?Yn.ceil(X):Yn(X),X=un.offset(X,(R.V-1)*7),R.y=X.getFullYear(),R.m=X.getMonth(),R.d=X.getDate()+(R.w+6)%7)}else("W"in R||"U"in R)&&("w"in R||(R.w="u"in R?R.u%7:"W"in R?1:0),ce="Z"in R?Pr(It(R.y,0,1)).getUTCDay():Ar(It(R.y,0,1)).getDay(),R.m=0,R.d="W"in R?(R.w+6)%7+R.W*7-(ce+5)%7:R.w+R.U*7-(ce+6)%7);return"Z"in R?(R.H+=R.Z/100|0,R.M+=R.Z%100,Pr(R)):Ar(R)}}function E(I,U,G,R){for(var se=0,X=U.length,ce=G.length,de,Le;se<X;){if(R>=ce)return-1;if(de=U.charCodeAt(se++),de===37){if(de=U.charAt(se++),Le=k[de in Hs?U.charAt(se++):de],!Le||(R=Le(I,G,R))<0)return-1}else if(de!=G.charCodeAt(R++))return-1}return R}function N(I,U,G){var R=l.exec(U.slice(G));return R?(I.p=u.get(R[0].toLowerCase()),G+R[0].length):-1}function D(I,U,G){var R=g.exec(U.slice(G));return R?(I.w=m.get(R[0].toLowerCase()),G+R[0].length):-1}function S(I,U,G){var R=d.exec(U.slice(G));return R?(I.w=f.get(R[0].toLowerCase()),G+R[0].length):-1}function L(I,U,G){var R=b.exec(U.slice(G));return R?(I.m=T.get(R[0].toLowerCase()),G+R[0].length):-1}function P(I,U,G){var R=p.exec(U.slice(G));return R?(I.m=x.get(R[0].toLowerCase()),G+R[0].length):-1}function A(I,U,G){return E(I,t,U,G)}function _(I,U,G){return E(I,n,U,G)}function F(I,U,G){return E(I,r,U,G)}function H(I){return o[I.getDay()]}function O(I){return s[I.getDay()]}function B(I){return c[I.getMonth()]}function W(I){return a[I.getMonth()]}function z(I){return i[+(I.getHours()>=12)]}function q(I){return 1+~~(I.getMonth()/3)}function ie(I){return o[I.getUTCDay()]}function ae(I){return s[I.getUTCDay()]}function Q(I){return c[I.getUTCMonth()]}function le(I){return a[I.getUTCMonth()]}function J(I){return i[+(I.getUTCHours()>=12)]}function te(I){return 1+~~(I.getUTCMonth()/3)}return{format:function(I){var U=M(I+="",v);return U.toString=function(){return I},U},parse:function(I){var U=$(I+="",!1);return U.toString=function(){return I},U},utcFormat:function(I){var U=M(I+="",C);return U.toString=function(){return I},U},utcParse:function(I){var U=$(I+="",!0);return U.toString=function(){return I},U}}}var Hs={"-":"",_:" ",0:"0"},oe=/^\s*\d+/,df=/^%/,ff=/[\\^$*+?|[\]().{}]/g;function K(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function hf(e){return e.replace(ff,"\\$&")}function _t(e){return new RegExp("^(?:"+e.map(hf).join("|")+")","i")}function Nt(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function mf(e,t,n){var r=oe.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function gf(e,t,n){var r=oe.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function pf(e,t,n){var r=oe.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function xf(e,t,n){var r=oe.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function yf(e,t,n){var r=oe.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function zs(e,t,n){var r=oe.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Vs(e,t,n){var r=oe.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function bf(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 vf(e,t,n){var r=oe.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function wf(e,t,n){var r=oe.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Bs(e,t,n){var r=oe.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Cf(e,t,n){var r=oe.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Ws(e,t,n){var r=oe.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Mf(e,t,n){var r=oe.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function kf(e,t,n){var r=oe.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Tf(e,t,n){var r=oe.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Sf(e,t,n){var r=oe.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Af(e,t,n){var r=df.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Pf(e,t,n){var r=oe.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Rf(e,t,n){var r=oe.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Ys(e,t){return K(e.getDate(),t,2)}function $f(e,t){return K(e.getHours(),t,2)}function jf(e,t){return K(e.getHours()%12||12,t,2)}function If(e,t){return K(1+un.count(He(e),e),t,3)}function ba(e,t){return K(e.getMilliseconds(),t,3)}function _f(e,t){return ba(e,t)+"000"}function Nf(e,t){return K(e.getMonth()+1,t,2)}function Lf(e,t){return K(e.getMinutes(),t,2)}function Ef(e,t){return K(e.getSeconds(),t,2)}function Df(e){var t=e.getDay();return t===0?7:t}function Ff(e,t){return K(ur.count(He(e)-1,e),t,2)}function va(e){var t=e.getDay();return t>=4||t===0?wt(e):wt.ceil(e)}function Of(e,t){return e=va(e),K(wt.count(He(e),e)+(He(e).getDay()===4),t,2)}function Uf(e){return e.getDay()}function Hf(e,t){return K(Yn.count(He(e)-1,e),t,2)}function zf(e,t){return K(e.getFullYear()%100,t,2)}function Vf(e,t){return e=va(e),K(e.getFullYear()%100,t,2)}function Bf(e,t){return K(e.getFullYear()%1e4,t,4)}function Wf(e,t){var n=e.getDay();return e=n>=4||n===0?wt(e):wt.ceil(e),K(e.getFullYear()%1e4,t,4)}function Yf(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+K(t/60|0,"0",2)+K(t%60,"0",2)}function Gs(e,t){return K(e.getUTCDate(),t,2)}function Gf(e,t){return K(e.getUTCHours(),t,2)}function qf(e,t){return K(e.getUTCHours()%12||12,t,2)}function Xf(e,t){return K(1+cr.count(ze(e),e),t,3)}function wa(e,t){return K(e.getUTCMilliseconds(),t,3)}function Kf(e,t){return wa(e,t)+"000"}function Qf(e,t){return K(e.getUTCMonth()+1,t,2)}function Zf(e,t){return K(e.getUTCMinutes(),t,2)}function Jf(e,t){return K(e.getUTCSeconds(),t,2)}function eh(e){var t=e.getUTCDay();return t===0?7:t}function th(e,t){return K(dr.count(ze(e)-1,e),t,2)}function Ca(e){var t=e.getUTCDay();return t>=4||t===0?Ct(e):Ct.ceil(e)}function nh(e,t){return e=Ca(e),K(Ct.count(ze(e),e)+(ze(e).getUTCDay()===4),t,2)}function rh(e){return e.getUTCDay()}function ih(e,t){return K(Gn.count(ze(e)-1,e),t,2)}function sh(e,t){return K(e.getUTCFullYear()%100,t,2)}function oh(e,t){return e=Ca(e),K(e.getUTCFullYear()%100,t,2)}function ah(e,t){return K(e.getUTCFullYear()%1e4,t,4)}function lh(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ct(e):Ct.ceil(e),K(e.getUTCFullYear()%1e4,t,4)}function ch(){return"+0000"}function qs(){return"%"}function Xs(e){return+e}function Ks(e){return Math.floor(+e/1e3)}var ft,Ma,ka;uh({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"]});function uh(e){return ft=uf(e),Ma=ft.format,ft.parse,ka=ft.utcFormat,ft.utcParse,ft}function dh(e){return new Date(e)}function fh(e){return e instanceof Date?+e:+new Date(+e)}function Di(e,t,n,r,i,s,o,a,c,l){var u=ua(),d=u.invert,f=u.domain,g=l(".%L"),m=l(":%S"),p=l("%I:%M"),x=l("%I %p"),b=l("%a %d"),T=l("%b %d"),v=l("%B"),C=l("%Y");function k(M){return(c(M)<M?g:a(M)<M?m:o(M)<M?p:s(M)<M?x:r(M)<M?i(M)<M?b:T:n(M)<M?v:C)(M)}return u.invert=function(M){return new Date(d(M))},u.domain=function(M){return arguments.length?f(Array.from(M,fh)):f().map(dh)},u.ticks=function(M){var $=f();return e($[0],$[$.length-1],M??10)},u.tickFormat=function(M,$){return $==null?k:l($)},u.nice=function(M){var $=f();return(!M||typeof M.range!="function")&&(M=t($[0],$[$.length-1],M??10)),M?f(ma($,M)):u},u.copy=function(){return lr(u,Di(e,t,n,r,i,s,o,a,c,l))},u}function Ta(){return Ke.apply(Di(lf,cf,He,Li,ur,un,_i,ji,it,Ma).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function hh(){return Ke.apply(Di(of,af,ze,Ei,dr,cr,Ni,Ii,it,ka).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function mh(){var e=0,t=1,n,r,i,s,o=ve,a=!1,c;function l(d){return d==null||isNaN(d=+d)?c:o(i===0?.5:(d=(s(d)-n)*i,a?Math.max(0,Math.min(1,d)):d))}l.domain=function(d){return arguments.length?([e,t]=d,n=s(e=+e),r=s(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(d){return arguments.length?(a=!!d,l):a},l.interpolator=function(d){return arguments.length?(o=d,l):o};function u(d){return function(f){var g,m;return arguments.length?([g,m]=f,o=d(g,m),l):[o(0),o(1)]}}return l.range=u(ar),l.rangeRound=u(ca),l.unknown=function(d){return arguments.length?(c=d,l):c},function(d){return s=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),l}}function gh(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Sa(){var e=Pi(mh()(ve));return e.copy=function(){return gh(e,Sa())},ed.apply(e,arguments)}const fr="DEFAULT_X_AXIS_KEY",Fi="DEFAULT_Y_AXIS_KEY",ph={top:50,bottom:50,left:50,right:50};function ri(e){return e.scaleType==="band"}function Aa(e){return e.scaleType==="point"}function xh(e){return e.type==="piecewise"?pa(e.thresholds,e.colors):Sa([e.min??0,e.max??100],e.color)}function qn(e){return e.values?Hn(e.values,e.colors).unknown(e.unknownColor??null):Hn(e.colors.map((t,n)=>n),e.colors).unknown(e.unknownColor??null)}function Pn(e){return e.type==="ordinal"?qn(e):xh(e)}function tn(e){return e.bandwidth!==void 0}function yh(e){const{tickMaxStep:t,tickMinStep:n,tickNumber:r,range:i,domain:s}=e,o=n===void 0?999:Math.floor(Math.abs(s[1]-s[0])/n),a=t===void 0?2:Math.ceil(Math.abs(s[1]-s[0])/t),c=r??Math.floor(Math.abs(i[1]-i[0])/50);return Math.min(o,Math.max(a,c))}const Rr={start:0,extremities:0,end:1,middle:.5};function Xn(e){const{scale:t,tickNumber:n,valueFormatter:r,tickInterval:i,tickPlacement:s="extremities",tickLabelPlacement:o="middle"}=e;return w.useMemo(()=>{if(tn(t)){const c=t.domain();return t.bandwidth()>0?[...(typeof i=="function"&&c.filter(i)||typeof i=="object"&&i||c).map(d=>({value:d,formattedValue:(r==null?void 0:r(d,{location:"tick"}))??`${d}`,offset:t(d)-(t.step()-t.bandwidth())/2+Rr[s]*t.step(),labelOffset:o==="tick"?0:t.step()*(Rr[o]-Rr[s])})),...s==="extremities"?[{formattedValue:void 0,offset:t.range()[1],labelOffset:0}]:[]]:(typeof i=="function"&&c.filter(i)||typeof i=="object"&&i||c).map(u=>({value:u,formattedValue:(r==null?void 0:r(u,{location:"tick"}))??`${u}`,offset:t(u),labelOffset:0}))}return t.domain().length===0||t.domain()[0]===t.domain()[1]?[]:(typeof i=="object"?i:t.ticks(n)).map(c=>({value:c,formattedValue:(r==null?void 0:r(c,{location:"tick"}))??t.tickFormat(n)(c),offset:t(c),labelOffset:0}))},[t,i,n,r,s,o])}function bh(e,t,n){switch(e){case"log":return ga(t,n);case"pow":return Ri(t,n);case"sqrt":return Kd(t,n);case"time":return Ta(t,n);case"utc":return hh(t,n);default:return ha(t,n)}}const vh=(e,t,n,r,i,s)=>{var f;const o=r[t],a=((f=s[t])==null?void 0:f.series)??{},[c,l]=(o==null?void 0:o({series:a,axis:n,isDefaultAxis:i}))??[null,null],[u,d]=e;return u===null||d===null?[c,l]:c===null||l===null?[u,d]:[Math.min(c,u),Math.max(l,d)]},wh=(e,t,n,r)=>Object.keys(t).reduce((s,o)=>vh(s,o,e,t,n,r),[null,null]),Ch=(e,t,n)=>{const r=t==="x"?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n?r.reverse():r},$r=(e,t)=>{const n=e[1]-e[0],r=t[1]-t[0],i=e[0]-t[0]*n/r,s=e[1]+(100-t[1])*n/r;return[i,s]},Qs=e=>(e==null?void 0:e[0])instanceof Date;function Zs(e,t){const n=Ta(e.data,t);return(r,{location:i})=>i==="tick"?n.tickFormat(e.tickNumber)(r):`${r.toLocaleString()}`}const Mh=.2,kh=.1;function Js(e,t,n,r,i,s=[0,100]){const o=i==="x"?fr:Fi,a=[...(n==null?void 0:n.map((l,u)=>y({id:`defaultized-${i}-axis-${u}`},l)))??[],...n===void 0||n.findIndex(({id:l})=>l===o)===-1?[{id:o,scaleType:"linear"}]:[]],c={};return a.forEach((l,u)=>{const d=u===0,[f,g]=wh(l,r,d,t),m=Ch(e,i,l.reverse);if(ri(l)){const E=l.categoryGapRatio??Mh,N=l.barGapRatio??kh,D=i==="x"?m:[m[1],m[0]],S=$r(D,s);if(c[l.id]=y({categoryGapRatio:E,barGapRatio:N},l,{scale:Ci(l.data,S).paddingInner(E).paddingOuter(E/2),tickNumber:l.data.length,colorScale:l.colorMap&&(l.colorMap.type==="ordinal"?qn(y({values:l.data},l.colorMap)):Pn(l.colorMap))}),Qs(l.data)){const L=Zs(l,D);c[l.id].valueFormatter=l.valueFormatter??L}}if(Aa(l)){const E=i==="x"?m:[...m].reverse(),N=$r(E,s);if(c[l.id]=y({},l,{scale:td(l.data,N),tickNumber:l.data.length,colorScale:l.colorMap&&(l.colorMap.type==="ordinal"?qn(y({values:l.data},l.colorMap)):Pn(l.colorMap))}),Qs(l.data)){const D=Zs(l,E);c[l.id].valueFormatter=l.valueFormatter??D}}if(l.scaleType==="band"||l.scaleType==="point")return;const p=l.scaleType??"linear",x=[l.min??f,l.max??g],b=yh(y({},l,{range:m,domain:x})),T=b/((s[1]-s[0])/100),v=$r(m,s),C=bh(p,x,v).nice(b),[k,M]=C.domain(),$=[l.min??k,l.max??M];c[l.id]=y({},l,{scaleType:p,scale:C.domain($),tickNumber:T,colorScale:l.colorMap&&Pn(l.colorMap)})}),{axis:c,axisIds:a.map(({id:l})=>l)}}const eo=(e,t,n)=>e==null?void 0:e.map(r=>{const i=r.dataKey;if(i===void 0||r.data!==void 0)return r;if(t===void 0)throw Error(`MUI X Charts: ${n}-axis uses \`dataKey\` but no \`dataset\` is provided.`);return y({},r,{data:t.map(s=>s[i])})}),Th=(e,t,n)=>{const r=y({},ph,n);return w.useMemo(()=>({left:r.left,top:r.top,right:r.right,bottom:r.bottom,width:Math.max(0,e-r.left-r.right),height:Math.max(0,t-r.top-r.bottom)}),[e,t,r.top,r.bottom,r.left,r.right])},Sh=Th,dn=w.createContext({top:0,left:0,bottom:0,right:0,height:300,width:400,chartId:""}),Pa=w.createContext({isInitialized:!1,data:{current:null}});function Ah(e){const{width:t,height:n,margin:r,svgRef:i,children:s}=e,o=Sh(t,n,r),a=wo(),c=w.useMemo(()=>y({chartId:a??""},o),[a,o]),l=w.useMemo(()=>({isInitialized:!0,data:i}),[i]);return h.jsx(Pa.Provider,{value:l,children:h.jsx(dn.Provider,{value:c,children:s})})}function Ve(){const{left:e,top:t,width:n,height:r,bottom:i,right:s}=w.useContext(dn);return w.useMemo(()=>({left:e,top:t,width:n,height:r,bottom:i,right:s}),[r,e,t,n,i,s])}const Ph=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];function Rh(e,t,n=Ph){return e.type==="pie"?y({},e,{data:e.data.map((r,i)=>y({color:n[i%n.length]},r))}):y({color:n[t%n.length]},e)}const $h=["#02B2AF","#2E96FF","#B800D8","#60009B","#2731C8","#03008D"],jh=["#02B2AF","#72CCFF","#DA00FF","#9001CB","#2E96FF","#3B48E0"],Ih=e=>e==="dark"?jh:$h,Ra=w.createContext({isInitialized:!1,data:{}}),_h=(e,t,n,r)=>{const i={};e.forEach((o,a)=>{var u;const{id:c=`auto-generated-id-${a}`,type:l}=o;if(i[l]===void 0&&(i[l]={series:{},seriesOrder:[]}),((u=i[l])==null?void 0:u.series[c])!==void 0)throw new Error(`MUI X Charts: series' id "${c}" is not unique.`);i[l].series[c]=y({id:c},Rh(o,a,t)),i[l].seriesOrder.push(c)});const s={};return Object.keys(n).forEach(o=>{var c;const a=i[o];a!==void 0&&(s[o]=((c=n[o])==null?void 0:c.call(n,a,r))??i[o])}),s};function Nh(e){const{series:t,dataset:n,colors:r=Ih,seriesFormatters:i,children:s}=e,o=Tt(),a=w.useMemo(()=>({isInitialized:!0,data:_h(t,typeof r=="function"?r(o.palette.mode):r,i,n)}),[t,r,o.palette.mode,i,n]);return h.jsx(Ra.Provider,{value:a,children:s})}function Be(){const{isInitialized:e,data:t}=w.useContext(Ra);if(!e)throw new Error(["MUI X: Could not find the series ref context.","It looks like you rendered your component outside of a ChartsContainer parent component."].join(`
`));return t}function Lh(){const e=Be();return w.useMemo(()=>e.pie,[e.pie])}function Eh(){const e=Be();return w.useMemo(()=>e.bar,[e.bar])}const $a=w.createContext({isInitialized:!1,data:{xAxis:{},yAxis:{},xAxisIds:[],yAxisIds:[]}});function Dh(e){const{xAxis:t,yAxis:n,dataset:r,xExtremumGetters:i,yExtremumGetters:s,children:o}=e,a=Be(),c=Ve(),l=w.useMemo(()=>eo(t,r,"x"),[t,r]),u=w.useMemo(()=>eo(n,r,"y"),[n,r]),d=w.useMemo(()=>Js(c,a,l,i,"x"),[c,a,l,i]),f=w.useMemo(()=>Js(c,a,u,s,"y"),[c,a,u,s]),g=w.useMemo(()=>({isInitialized:!0,data:{xAxis:d.axis,yAxis:f.axis,xAxisIds:d.axisIds,yAxisIds:f.axisIds}}),[d,f]);return h.jsx($a.Provider,{value:g,children:o})}const Pe=()=>{const{data:e}=w.useContext($a);return e},Pt=w.createContext({item:null,axis:{x:null,y:null},useVoronoiInteraction:!1,dispatch:()=>null}),Fh=(e,t)=>{switch(t.type){case"enterItem":return y({},e,{item:t.data});case"exitChart":return e.item===null&&e.axis.x===null&&e.axis.y===null?e:y({},e,{axis:{x:null,y:null},item:null});case"updateVoronoiUsage":return y({},e,{useVoronoiInteraction:t.useVoronoiInteraction});case"leaveItem":return e.item===null||Object.keys(t.data).some(n=>t.data[n]!==e.item[n])?e:y({},e,{item:null});case"updateAxis":return t.data.x===e.axis.x&&t.data.y===e.axis.y?e:y({},e,{axis:t.data});default:return e}};function Oh(e){const{children:t}=e,[n,r]=w.useReducer(Fh,{item:null,axis:{x:null,y:null},useVoronoiInteraction:!1}),i=w.useMemo(()=>y({},n,{dispatch:r}),[n]);return h.jsx(Pt.Provider,{value:i,children:t})}const ja=w.createContext({isInitialized:!1,data:{highlightedItem:null,setHighlighted:()=>{},clearHighlighted:()=>{},isHighlighted:()=>!1,isFaded:()=>!1}}),Uh=(e,t)=>n=>e?e.fade==="series"?n.seriesId===(t==null?void 0:t.seriesId)&&n.dataIndex!==(t==null?void 0:t.dataIndex):e.fade==="global"?n.seriesId!==(t==null?void 0:t.seriesId)||n.dataIndex!==(t==null?void 0:t.dataIndex):!1:!1,Hh=(e,t)=>n=>e?e.highlight==="series"?n.seriesId===(t==null?void 0:t.seriesId):e.highlight==="item"?n.dataIndex===(t==null?void 0:t.dataIndex)&&n.seriesId===(t==null?void 0:t.seriesId):!1:!1,zh=["highlighted","faded"],Vh=e=>{const t=e??{},{highlighted:n,faded:r}=t,i=Z(t,zh);return y({highlight:n,fade:r},i)};function Bh({children:e,highlightedItem:t,onHighlightChange:n}){const[r,i]=El({controlled:t,default:null,name:"HighlightedProvider",state:"highlightedItem"}),s=Be(),o=w.useMemo(()=>{const l=new Map;return Object.keys(s).forEach(u=>{const d=s[u];Object.keys((d==null?void 0:d.series)??{}).forEach(f=>{const g=d==null?void 0:d.series[f];l.set(f,Vh(g==null?void 0:g.highlightScope))})}),l},[s]),a=r&&r.seriesId?o.get(r.seriesId)??void 0:void 0,c=w.useMemo(()=>({isInitialized:!0,data:{highlightScope:a,highlightedItem:r,setHighlighted:l=>{i(l),n==null||n(l)},clearHighlighted:()=>{i(null),n==null||n(null)},isHighlighted:Hh(a,r),isFaded:Uh(a,r)}}),[r,a,i,n]);return h.jsx(ja.Provider,{value:c,children:e})}function hr(){const{isInitialized:e,data:t}=w.useContext(ja);if(!e)throw new Error(["MUI X: Could not find the highlighted ref context.","It looks like you rendered your component outside of a ChartsContainer parent component."].join(`
`));return t}function Ia(e){const t=hr();if(!e)return{isHighlighted:!1,isFaded:!1};const n=t.isHighlighted(e),r=!n&&t.isFaded(e);return{isHighlighted:n,isFaded:r}}const Oi=w.createContext({zAxis:{},zAxisIds:[]});function Wh(e){const{zAxis:t,dataset:n,children:r}=e,i=w.useMemo(()=>t==null?void 0:t.map(o=>{const a=o.dataKey;if(a===void 0||o.data!==void 0)return o;if(n===void 0)throw Error("MUI X Charts: z-axis uses `dataKey` but no `dataset` is provided.");return y({},o,{data:n.map(c=>c[a])})}),[t,n]),s=w.useMemo(()=>{const o=(i==null?void 0:i.map((c,l)=>y({id:`defaultized-z-axis-${l}`},c)))??[],a={};return o.forEach(c=>{a[c.id]=y({},c,{colorScale:c.colorMap&&(c.colorMap.type==="ordinal"&&c.data?qn(y({values:c.data},c.colorMap)):Pn(c.colorMap.type==="continuous"?y({min:c.min,max:c.max},c.colorMap):c.colorMap))})}),{zAxis:a,zAxisIds:o.map(({id:c})=>c)}},[i]);return h.jsx(Oi.Provider,{value:s,children:r})}const _a=e=>{const{dispatch:t}=w.useContext(Pt),{setHighlighted:n,clearHighlighted:r}=hr();return e?()=>({}):s=>({onPointerEnter:()=>{t({type:"enterItem",data:s}),n({seriesId:s.seriesId,dataIndex:s.dataIndex})},onPointerLeave:l=>{l.currentTarget.releasePointerCapture(l.pointerId),t({type:"leaveItem",data:s}),r()},onPointerDown:l=>{l.currentTarget.hasPointerCapture(l.pointerId)&&l.currentTarget.releasePointerCapture(l.pointerId)}})},Yh=["id","dataIndex","classes","color","slots","slotProps","style","onClick"];function Gh(e){return _e("MuiBarElement",e)}Ne("MuiBarElement",["root"]);const qh=e=>{const{classes:t,id:n}=e,r={root:["root",`series-${n}`]};return Ce(r,Gh,t)},Xh=ee(ln.rect,{name:"MuiBarElement",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e})=>({stroke:"none",fill:e.isHighlighted?bt(e.color).brighter(.5).formatHex():e.color,transition:"opacity 0.2s ease-in, fill 0.2s ease-in",opacity:e.isFaded&&.3||1}));function Kh(e){const{id:t,dataIndex:n,classes:r,color:i,slots:s,slotProps:o,style:a,onClick:c}=e,l=Z(e,Yh),u=_a(),{isFaded:d,isHighlighted:f}=Ia({seriesId:t,dataIndex:n}),g={id:t,dataIndex:n,classes:r,color:i,isFaded:d,isHighlighted:f},m=qh(g),p=(s==null?void 0:s.bar)??Xh,x=Ae({elementType:p,externalSlotProps:o==null?void 0:o.bar,externalForwardedProps:l,additionalProps:y({},u({type:"bar",seriesId:t,dataIndex:n}),{style:a,onClick:c,cursor:c?"pointer":"unset"}),className:m.root,ownerState:g});return h.jsx(p,y({},x))}function Na(e,t,n){const r=e.layout==="vertical",i=r?t==null?void 0:t.colorScale:n==null?void 0:n.colorScale,s=r?n==null?void 0:n.colorScale:t==null?void 0:t.colorScale,o=r?t==null?void 0:t.data:n==null?void 0:n.data;return s?a=>{const c=e.data[a],l=c===null?e.color:s(c);return l===null?e.color:l}:i&&o?a=>{const c=o[a],l=c===null?e.color:i(c);return l===null?e.color:l}:()=>e.color}function Qh(){const{chartId:e}=w.useContext(dn);return w.useMemo(()=>e,[e])}function to(e){return tn(e)?t=>(e(t)??0)+e.bandwidth()/2:t=>e(t)}function Ui(){const{isInitialized:e,data:t}=w.useContext(Pa);if(!e)throw new Error(["MUI X: Could not find the svg ref context.","It looks like you rendered your component outside of a ChartsContainer parent component."].join(`
`));return t}const yn=(e,{hasNegative:t,hasPositive:n,borderRadius:r,layout:i})=>{if(!r)return 0;const s=i==="vertical";return e==="top-left"&&(s&&n||!s&&t)||e==="top-right"&&(s&&n||!s&&n)||e==="bottom-right"&&(s&&t||!s&&n)||e==="bottom-left"&&(s&&t||!s&&t)?r:0},Zh=["style","maskId"],Jh=e=>`inset(0px round ${e.topLeft}px ${e.topRight}px ${e.bottomRight}px ${e.bottomLeft}px)`;function em(e){var n,r;const t=e.ownerState;return h.jsx(ln.rect,{style:y({},e.style,{clipPath:(e.ownerState.layout==="vertical"?(n=e.style)==null?void 0:n.height:(r=e.style)==null?void 0:r.width).to(i=>Jh({topLeft:Math.min(i,yn("top-left",t)),topRight:Math.min(i,yn("top-right",t)),bottomRight:Math.min(i,yn("bottom-right",t)),bottomLeft:Math.min(i,yn("bottom-left",t))}))})})}function tm(e){const{style:t,maskId:n}=e,r=Z(e,Zh);return!e.borderRadius||e.borderRadius<=0?null:h.jsx("clipPath",{id:n,children:h.jsx(em,{ownerState:r,style:t})})}function nm(e){return _e("MuiBarLabel",e)}const jr=Ne("MuiBarLabel",["root","highlighted","faded"]),rm=e=>{const{classes:t,seriesId:n,isFaded:r,isHighlighted:i}=e,s={root:["root",`series-${n}`,i&&"highlighted",r&&"faded"]};return Ce(s,nm,t)},im=e=>{const{barLabel:t,value:n,dataIndex:r,seriesId:i,height:s,width:o}=e;return t==="value"?n?n==null?void 0:n.toString():null:t({seriesId:i,dataIndex:r,value:n},{bar:{height:s,width:o}})},sm=["seriesId","dataIndex","color","isFaded","isHighlighted","classes"],om=ee(ln.text,{name:"MuiBarLabel",slot:"Root",overridesResolver:(e,t)=>[{[`&.${jr.faded}`]:t.faded},{[`&.${jr.highlighted}`]:t.highlighted},t.root]})(({theme:e})=>{var t,n,r,i;return y({},(t=e==null?void 0:e.typography)==null?void 0:t.body2,{stroke:"none",fill:(i=(r=(n=e.vars||e)==null?void 0:n.palette)==null?void 0:r.text)==null?void 0:i.primary,transition:"opacity 0.2s ease-in, fill 0.2s ease-in",textAnchor:"middle",dominantBaseline:"central",pointerEvents:"none",opacity:1,[`&.${jr.faded}`]:{opacity:.3}})});function am(e){const t=St({props:e,name:"MuiBarLabel"}),n=Z(t,sm);return h.jsx(om,y({},n))}const lm=["seriesId","classes","color","style","dataIndex","barLabel","slots","slotProps","height","width","value"],cm=["ownerState"];function um(e){const{seriesId:t,classes:n,color:r,style:i,dataIndex:s,barLabel:o,slots:a,slotProps:c,height:l,width:u,value:d}=e,f=Z(e,lm),{isFaded:g,isHighlighted:m}=Ia({seriesId:t,dataIndex:s}),p={seriesId:t,classes:n,color:r,isFaded:g,isHighlighted:m,dataIndex:s},x=rm(p),b=(a==null?void 0:a.barLabel)??am,T=Ae({elementType:b,externalSlotProps:c==null?void 0:c.barLabel,additionalProps:y({},f,{style:i,className:x.root}),ownerState:p}),{ownerState:v}=T,C=Z(T,cm);if(!o)return null;const k=im({barLabel:o,value:d,dataIndex:s,seriesId:t,height:l,width:u});return k?h.jsx(b,y({},C,v,{children:k})):null}const dm=["bars","skipAnimation"],fm=({layout:e,yOrigin:t,x:n,width:r,y:i,xOrigin:s,height:o})=>y({},e==="vertical"?{y:t,x:n+r/2,height:0,width:r}:{y:i+o/2,x:s,height:o,width:0}),no=({x:e,width:t,y:n,height:r})=>({x:e+t/2,y:n+r/2,height:r,width:t});function hm(e){const{bars:t,skipAnimation:n}=e,r=Z(e,dm),i=Kt(t,{keys:s=>`${s.seriesId}-${s.dataIndex}`,from:fm,leave:null,enter:no,update:no,immediate:n});return h.jsx(w.Fragment,{children:i((s,{seriesId:o,dataIndex:a,color:c,value:l,width:u,height:d})=>h.jsx(um,y({seriesId:o,dataIndex:a,value:l,color:c,width:u,height:d},r,{style:s})))})}const Ir=(e,t)=>{const n=`${e}-axis`,r=`${e}Axis`;return t===(e==="x"?fr:Fi)?`The first \`${r}\``:`The ${n} with id "${t}"`};function mm(e,t,n,r,i,s){const o=r[n],a=s[i],c=e?o:a,l=e?a:o,u=e?n:i,d=e?i:n,f=e?"x":"y",g=e?"y":"x";if(!ri(c))throw new Error(`MUI X Charts: ${Ir(f,u)} should be of type "band" to display the bar series of id "${t}".`);if(c.data===void 0)throw new Error(`MUI X Charts: ${Ir(f,u)} should have data property.`);if(ri(l)||Aa(l))throw new Error(`MUI X Charts: ${Ir(g,d)} should be a continuous type to display the bar series of id "${t}".`)}const gm=["skipAnimation","onItemClick","borderRadius","barLabel"];function pm({bandWidth:e,numberOfGroups:t,gapRatio:n}){if(n===0)return{barWidth:e/t,offset:0};const r=e/(t+(t-1)*n),i=n*r;return{barWidth:r,offset:i}}const xm=()=>{const e=Eh()??{series:{},stackingGroups:[],seriesOrder:[]},t=Pe(),n=Qh(),{series:r,stackingGroups:i}=e,{xAxis:s,yAxis:o,xAxisIds:a,yAxisIds:c}=t,l=a[0],u=c[0],d={};return{completedData:i.flatMap(({ids:g},m)=>g.flatMap(p=>{const x=r[p].xAxisKey??l,b=r[p].yAxisKey??u,T=s[x],v=o[b],C=r[p].layout==="vertical";mm(C,p,x,s,b,o);const k=C?T:v,M=T.scale,$=v.scale,E=Na(r[p],s[x],o[b]),N=k.scale.bandwidth(),{barWidth:D,offset:S}=pm({bandWidth:N,numberOfGroups:i.length,gapRatio:k.barGapRatio}),L=m*(D+S),{stackedData:P}=r[p];return P.map((A,_)=>{var q,ie;const F=A.map(ae=>C?$(ae):M(ae)),H=Math.round(Math.min(...F)),O=Math.round(Math.max(...F)),B=r[p].stack,W={seriesId:p,dataIndex:_,layout:r[p].layout,x:C?M((q=s[x].data)==null?void 0:q[_])+L:H,y:C?H:$((ie=o[b].data)==null?void 0:ie[_])+L,xOrigin:M(0),yOrigin:$(0),height:C?O-H:D,width:C?D:O-H,color:E(_),value:r[p].data[_],maskId:`${n}_${B||p}_${m}_${_}`};d[W.maskId]||(d[W.maskId]={id:W.maskId,width:0,height:0,hasNegative:!1,hasPositive:!1,layout:W.layout,xOrigin:M(0),yOrigin:$(0),x:0,y:0});const z=d[W.maskId];return z.width=W.layout==="vertical"?W.width:z.width+W.width,z.height=W.layout==="vertical"?z.height+W.height:W.height,z.x=Math.min(z.x===0?1/0:z.x,W.x),z.y=Math.min(z.y===0?1/0:z.y,W.y),z.hasNegative=z.hasNegative||(W.value??0)<0,z.hasPositive=z.hasPositive||(W.value??0)>0,W})})),masksData:Object.values(d)}},bn=({layout:e,yOrigin:t,x:n,width:r,y:i,xOrigin:s,height:o})=>y({},e==="vertical"?{y:t,x:n,height:0,width:r}:{y:i,x:s,height:o,width:0}),vn=({x:e,width:t,y:n,height:r})=>({y:n,x:e,height:r,width:t});function ym(e){const{completedData:t,masksData:n}=xm(),{skipAnimation:r,onItemClick:i,borderRadius:s,barLabel:o}=e,a=Z(e,gm),c=Kt(t,{keys:u=>`${u.seriesId}-${u.dataIndex}`,from:bn,leave:bn,enter:vn,update:vn,immediate:r}),l=Kt(n,{keys:u=>u.id,from:bn,leave:bn,enter:vn,update:vn,immediate:r});return h.jsxs(w.Fragment,{children:[l((u,{id:d,hasPositive:f,hasNegative:g,layout:m})=>h.jsx(tm,{maskId:d,borderRadius:s,hasNegative:g,hasPositive:f,layout:m,style:u})),c((u,{seriesId:d,dataIndex:f,color:g,maskId:m})=>{const p=h.jsx(Kh,y({id:d,dataIndex:f,color:g},a,{onClick:i&&(x=>{i(x,{type:"bar",seriesId:d,dataIndex:f})}),style:u}));return!s||s<=0?p:h.jsx("g",{clipPath:`url(#${m})`,children:p})}),o&&h.jsx(hm,y({bars:t,skipAnimation:r,barLabel:o},a))]})}const La=w.createContext({});function bm(e){const{colorProcessors:t,children:n}=e;return h.jsx(La.Provider,{value:t,children:n})}function vm(e,t){const n=e.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n.matrixTransform(e.getScreenCTM().inverse())}function ht(e){return e instanceof Date?e.getTime():e}const wm=e=>{const t=Ui(),{left:n,top:r,width:i,height:s}=Ve(),{xAxis:o,yAxis:a,xAxisIds:c,yAxisIds:l}=Pe(),{dispatch:u}=w.useContext(Pt),d=c[0],f=l[0],g=w.useRef({x:-1,y:-1});w.useEffect(()=>{const m=t.current;if(m===null||e)return()=>{};function p(v,C){const{scale:k,data:M,reverse:$}=v;if(!tn(k)){const N=k.invert(C);if(M===void 0)return{value:N};const D=ht(N),S=M==null?void 0:M.findIndex((L,P)=>{const A=ht(L);return A>D&&(P===0||Math.abs(D-A)<=Math.abs(D-ht(M[P-1])))||A<=D&&(P===M.length-1||Math.abs(ht(N)-A)<Math.abs(ht(N)-ht(M[P+1])))});return{value:S!==void 0&&S>=0?M[S]:N,index:S}}const E=k.bandwidth()===0?Math.floor((C-Math.min(...k.range())+k.step()/2)/k.step()):Math.floor((C-Math.min(...k.range()))/k.step());if(E<0||E>=M.length)return null;if($){const N=M.length-1-E;return{index:N,value:M[N]}}return{index:E,value:M[E]}}const x=()=>{g.current={x:-1,y:-1},u({type:"exitChart"})},b=v=>{const C="targetTouches"in v?v.targetTouches[0]:v,k=vm(m,C);g.current={x:k.x,y:k.y};const M=k.x<n||k.x>n+i,$=k.y<r||k.y>r+s;if(M||$){u({type:"exitChart"});return}const E=p(o[d],k.x),N=p(a[f],k.y);u({type:"updateAxis",data:{x:E,y:N}})},T=v=>{const C=v.currentTarget;C&&C.hasPointerCapture(v.pointerId)&&C.releasePointerCapture(v.pointerId)};return m.addEventListener("pointerdown",T),m.addEventListener("pointermove",b),m.addEventListener("pointerout",x),m.addEventListener("pointercancel",x),m.addEventListener("pointerleave",x),()=>{m.removeEventListener("pointerdown",T),m.removeEventListener("pointermove",b),m.removeEventListener("pointerout",x),m.removeEventListener("pointercancel",x),m.removeEventListener("pointerleave",x)}},[t,u,n,i,r,s,f,a,d,o,e])},Cm=["children","width","height","viewBox","disableAxisListener","className","title","desc"],Mm=ee("svg",{name:"MuiChartsSurface",slot:"Root"})(()=>({touchAction:"none"})),km=w.forwardRef(function(t,n){const{children:r,width:i,height:s,viewBox:o,disableAxisListener:a=!1,title:c,desc:l}=t,u=Z(t,Cm),d=y({width:i,height:s,x:0,y:0},o);return wm(a),h.jsxs(Mm,y({width:i,height:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:n},u,{children:[h.jsx("title",{children:c}),h.jsx("desc",{children:l}),r]}))});function ro(e){const{isReversed:t,gradientId:n,size:r,direction:i,scale:s,colorMap:o}=e;return h.jsx("linearGradient",{id:n,x1:"0",x2:"0",y1:"0",y2:"0",[`${i}${t?1:2}`]:`${r}px`,gradientUnits:"userSpaceOnUse",children:o.thresholds.map((a,c)=>{const l=s(a);if(l===void 0)return null;const u=t?1-l/r:l/r;return h.jsxs(w.Fragment,{children:[h.jsx("stop",{offset:u,stopColor:o.colors[c],stopOpacity:1}),h.jsx("stop",{offset:u,stopColor:o.colors[c+1],stopOpacity:1})]},a.toString()+c)})})}const Tm=10;function io(e){const{isReversed:t,gradientId:n,size:r,direction:i,scale:s,colorScale:o,colorMap:a}=e,c=[a.min??0,a.max??100],l=c.map(s).filter(g=>g!==void 0);if(l.length!==2)return null;const u=typeof c[0]=="number"?Jt(c[0],c[1]):la(c[0],c[1]),d=Math.round((Math.max(...l)-Math.min(...l))/Tm),f=`${c[0]}-${c[1]}-`;return h.jsx("linearGradient",{id:n,x1:"0",x2:"0",y1:"0",y2:"0",[`${i}${t?1:2}`]:`${r}px`,gradientUnits:"userSpaceOnUse",children:Array.from({length:d+1},(g,m)=>{const p=u(m/d);if(p===void 0)return null;const x=s(p);if(x===void 0)return null;const b=t?1-x/r:x/r,T=o(p);return T===null?null:h.jsx("stop",{offset:b,stopColor:T,stopOpacity:1},f+m)})})}function Sm(){const{chartId:e}=w.useContext(dn);return w.useCallback((t,n)=>`${e}-gradient-${n}-${t}`,[e])}function Am(){const{top:e,height:t,bottom:n,left:r,width:i,right:s}=Ve(),o=e+t+n,a=r+i+s,c=Sm(),{xAxisIds:l,xAxis:u,yAxisIds:d,yAxis:f}=Pe();return h.jsxs("defs",{children:[d.filter(g=>f[g].colorMap!==void 0).map(g=>{const m=c(g,"y"),{colorMap:p,scale:x,colorScale:b,reverse:T}=f[g];return(p==null?void 0:p.type)==="piecewise"?h.jsx(ro,{isReversed:!T,scale:x,colorMap:p,size:o,gradientId:m,direction:"y"},m):(p==null?void 0:p.type)==="continuous"?h.jsx(io,{isReversed:!T,scale:x,colorScale:b,colorMap:p,size:o,gradientId:m,direction:"y"},m):null}),l.filter(g=>u[g].colorMap!==void 0).map(g=>{const m=c(g,"x"),{colorMap:p,scale:x,reverse:b,colorScale:T}=u[g];return(p==null?void 0:p.type)==="piecewise"?h.jsx(ro,{isReversed:b,scale:x,colorMap:p,size:a,gradientId:m,direction:"x"},m):(p==null?void 0:p.type)==="continuous"?h.jsx(io,{isReversed:b,scale:x,colorScale:T,colorMap:p,size:a,gradientId:m,direction:"x"},m):null})]})}const Ea=e=>{const{axis:t}=e,n=Math.min(...t.data??[]),r=Math.max(...t.data??[]);return[n,r]},Da=e=>{const{series:t,axis:n,isDefaultAxis:r}=e;return Object.keys(t).filter(i=>t[i].yAxisKey===n.id||r&&t[i].yAxisKey===void 0).reduce((i,s)=>{var c;const[o,a]=((c=t[s].stackedData)==null?void 0:c.reduce((l,u)=>[Math.min(...u,...l[0]===null?[]:[l[0]]),Math.max(...u,...l[1]===null?[]:[l[1]])],t[s].stackedData[0]))??[null,null];return[i[0]===null?o:Math.min(o,i[0]),i[1]===null?a:Math.max(a,i[1])]},[null,null])},Pm=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?Da(e):Ea(e),Rm=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?Ea(e):Da(e);function ne(e){return function(){return e}}const so=Math.abs,ue=Math.atan2,Ze=Math.cos,$m=Math.max,_r=Math.min,Re=Math.sin,mt=Math.sqrt,he=1e-12,nn=Math.PI,Kn=nn/2,Rn=2*nn;function jm(e){return e>1?0:e<-1?nn:Math.acos(e)}function oo(e){return e>=1?Kn:e<=-1?-Kn:Math.asin(e)}const ii=Math.PI,si=2*ii,et=1e-6,Im=si-et;function Fa(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function _m(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Fa;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Nm{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Fa:_m(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+o}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,a=this._y1,c=r-t,l=i-n,u=o-t,d=a-n,f=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>et)if(!(Math.abs(d*c-l*u)>et)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,m=i-a,p=c*c+l*l,x=g*g+m*m,b=Math.sqrt(p),T=Math.sqrt(f),v=s*Math.tan((ii-Math.acos((p+f-x)/(2*b*T)))/2),C=v/T,k=v/b;Math.abs(C-1)>et&&this._append`L${t+C*u},${n+C*d}`,this._append`A${s},${s},0,0,${+(d*g>u*m)},${this._x1=t+k*c},${this._y1=n+k*l}`}}arc(t,n,r,i,s,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),c=r*Math.sin(i),l=t+a,u=n+c,d=1^o,f=o?i-s:s-i;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>et||Math.abs(this._y1-u)>et)&&this._append`L${l},${u}`,r&&(f<0&&(f=f%si+si),f>Im?this._append`A${r},${r},0,1,${d},${t-a},${n-c}A${r},${r},0,1,${d},${this._x1=l},${this._y1=u}`:f>et&&this._append`A${r},${r},0,${+(f>=ii)},${d},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Lm(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Nm(t)}function Em(e){return e.innerRadius}function Dm(e){return e.outerRadius}function Fm(e){return e.startAngle}function Om(e){return e.endAngle}function Um(e){return e&&e.padAngle}function Hm(e,t,n,r,i,s,o,a){var c=n-e,l=r-t,u=o-i,d=a-s,f=d*c-u*l;if(!(f*f<he))return f=(u*(t-s)-d*(e-i))/f,[e+f*c,t+f*l]}function wn(e,t,n,r,i,s,o){var a=e-n,c=t-r,l=(o?s:-s)/mt(a*a+c*c),u=l*c,d=-l*a,f=e+u,g=t+d,m=n+u,p=r+d,x=(f+m)/2,b=(g+p)/2,T=m-f,v=p-g,C=T*T+v*v,k=i-s,M=f*p-m*g,$=(v<0?-1:1)*mt($m(0,k*k*C-M*M)),E=(M*v-T*$)/C,N=(-M*T-v*$)/C,D=(M*v+T*$)/C,S=(-M*T+v*$)/C,L=E-x,P=N-b,A=D-x,_=S-b;return L*L+P*P>A*A+_*_&&(E=D,N=S),{cx:E,cy:N,x01:-u,y01:-d,x11:E*(i/k-1),y11:N*(i/k-1)}}function Oa(){var e=Em,t=Dm,n=ne(0),r=null,i=Fm,s=Om,o=Um,a=null,c=Lm(l);function l(){var u,d,f=+e.apply(this,arguments),g=+t.apply(this,arguments),m=i.apply(this,arguments)-Kn,p=s.apply(this,arguments)-Kn,x=so(p-m),b=p>m;if(a||(a=u=c()),g<f&&(d=g,g=f,f=d),!(g>he))a.moveTo(0,0);else if(x>Rn-he)a.moveTo(g*Ze(m),g*Re(m)),a.arc(0,0,g,m,p,!b),f>he&&(a.moveTo(f*Ze(p),f*Re(p)),a.arc(0,0,f,p,m,b));else{var T=m,v=p,C=m,k=p,M=x,$=x,E=o.apply(this,arguments)/2,N=E>he&&(r?+r.apply(this,arguments):mt(f*f+g*g)),D=_r(so(g-f)/2,+n.apply(this,arguments)),S=D,L=D,P,A;if(N>he){var _=oo(N/f*Re(E)),F=oo(N/g*Re(E));(M-=_*2)>he?(_*=b?1:-1,C+=_,k-=_):(M=0,C=k=(m+p)/2),($-=F*2)>he?(F*=b?1:-1,T+=F,v-=F):($=0,T=v=(m+p)/2)}var H=g*Ze(T),O=g*Re(T),B=f*Ze(k),W=f*Re(k);if(D>he){var z=g*Ze(v),q=g*Re(v),ie=f*Ze(C),ae=f*Re(C),Q;if(x<nn)if(Q=Hm(H,O,ie,ae,z,q,B,W)){var le=H-Q[0],J=O-Q[1],te=z-Q[0],I=q-Q[1],U=1/Re(jm((le*te+J*I)/(mt(le*le+J*J)*mt(te*te+I*I)))/2),G=mt(Q[0]*Q[0]+Q[1]*Q[1]);S=_r(D,(f-G)/(U-1)),L=_r(D,(g-G)/(U+1))}else S=L=0}$>he?L>he?(P=wn(ie,ae,H,O,g,L,b),A=wn(z,q,B,W,g,L,b),a.moveTo(P.cx+P.x01,P.cy+P.y01),L<D?a.arc(P.cx,P.cy,L,ue(P.y01,P.x01),ue(A.y01,A.x01),!b):(a.arc(P.cx,P.cy,L,ue(P.y01,P.x01),ue(P.y11,P.x11),!b),a.arc(0,0,g,ue(P.cy+P.y11,P.cx+P.x11),ue(A.cy+A.y11,A.cx+A.x11),!b),a.arc(A.cx,A.cy,L,ue(A.y11,A.x11),ue(A.y01,A.x01),!b))):(a.moveTo(H,O),a.arc(0,0,g,T,v,!b)):a.moveTo(H,O),!(f>he)||!(M>he)?a.lineTo(B,W):S>he?(P=wn(B,W,z,q,f,-S,b),A=wn(H,O,ie,ae,f,-S,b),a.lineTo(P.cx+P.x01,P.cy+P.y01),S<D?a.arc(P.cx,P.cy,S,ue(P.y01,P.x01),ue(A.y01,A.x01),!b):(a.arc(P.cx,P.cy,S,ue(P.y01,P.x01),ue(P.y11,P.x11),!b),a.arc(0,0,f,ue(P.cy+P.y11,P.cx+P.x11),ue(A.cy+A.y11,A.cx+A.x11),b),a.arc(A.cx,A.cy,S,ue(A.y11,A.x11),ue(A.y01,A.x01),!b))):a.arc(0,0,f,k,C,b)}if(a.closePath(),u)return a=null,u+""||null}return l.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-nn/2;return[Ze(d)*u,Re(d)*u]},l.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ne(+u),l):e},l.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ne(+u),l):t},l.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ne(+u),l):n},l.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:ne(+u),l):r},l.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:ne(+u),l):i},l.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ne(+u),l):s},l.padAngle=function(u){return arguments.length?(o=typeof u=="function"?u:ne(+u),l):o},l.context=function(u){return arguments.length?(a=u??null,l):a},l}function Ua(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function zm(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Vm(e){return e}function Bm(){var e=Vm,t=zm,n=null,r=ne(0),i=ne(Rn),s=ne(0);function o(a){var c,l=(a=Ua(a)).length,u,d,f=0,g=new Array(l),m=new Array(l),p=+r.apply(this,arguments),x=Math.min(Rn,Math.max(-Rn,i.apply(this,arguments)-p)),b,T=Math.min(Math.abs(x)/l,s.apply(this,arguments)),v=T*(x<0?-1:1),C;for(c=0;c<l;++c)(C=m[g[c]=c]=+e(a[c],c,a))>0&&(f+=C);for(t!=null?g.sort(function(k,M){return t(m[k],m[M])}):n!=null&&g.sort(function(k,M){return n(a[k],a[M])}),c=0,d=f?(x-l*v)/f:0;c<l;++c,p=b)u=g[c],C=m[u],b=p+(C>0?C*d:0)+v,m[u]={data:a[u],index:c,value:C,startAngle:p,endAngle:b,padAngle:T};return m}return o.value=function(a){return arguments.length?(e=typeof a=="function"?a:ne(+a),o):e},o.sortValues=function(a){return arguments.length?(t=a,n=null,o):t},o.sort=function(a){return arguments.length?(n=a,t=null,o):n},o.startAngle=function(a){return arguments.length?(r=typeof a=="function"?a:ne(+a),o):r},o.endAngle=function(a){return arguments.length?(i=typeof a=="function"?a:ne(+a),o):i},o.padAngle=function(a){return arguments.length?(s=typeof a=="function"?a:ne(+a),o):s},o}function Mt(e,t){if((o=e.length)>1)for(var n=1,r,i,s=e[t[0]],o,a=s.length;n<o;++n)for(i=s,s=e[t[n]],r=0;r<a;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function kt(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Wm(e,t){return e[t]}function Ym(e){const t=[];return t.key=e,t}function Ha(){var e=ne([]),t=kt,n=Mt,r=Wm;function i(s){var o=Array.from(e.apply(this,arguments),Ym),a,c=o.length,l=-1,u;for(const d of s)for(a=0,++l;a<c;++a)(o[a][l]=[0,+r(d,o[a].key,l,s)]).data=d;for(a=0,u=Ua(t(o));a<c;++a)o[u[a]].index=a;return n(o,u),o}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:ne(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:ne(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?kt:typeof s=="function"?s:ne(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Mt,i):n},i}function Gm(e,t){if((r=e.length)>0){for(var n,r,i=0,s=e[0].length,o;i<s;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}Mt(e,t)}}function qm(e,t){if((c=e.length)>0)for(var n,r=0,i,s,o,a,c,l=e[t[0]].length;r<l;++r)for(o=a=0,n=0;n<c;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=o,i[1]=o+=s):s<0?(i[1]=a,i[0]=a+=s):(i[0]=0,i[1]=s)}function Xm(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,s=r.length;n<s;++n){for(var o=0,a=0;o<i;++o)a+=e[o][n][1]||0;r[n][1]+=r[n][0]=-a/2}Mt(e,t)}}function Km(e,t){if(!(!((o=e.length)>0)||!((s=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,s,o;r<s;++r){for(var a=0,c=0,l=0;a<o;++a){for(var u=e[t[a]],d=u[r][1]||0,f=u[r-1][1]||0,g=(d-f)/2,m=0;m<a;++m){var p=e[t[m]],x=p[r][1]||0,b=p[r-1][1]||0;g+=x-b}c+=d,l+=g*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,Mt(e,t)}}function za(e){var t=e.map(Qm);return kt(e).sort(function(n,r){return t[n]-t[r]})}function Qm(e){for(var t=-1,n=0,r=e.length,i,s=-1/0;++t<r;)(i=+e[t][1])>s&&(s=i,n=t);return n}function Va(e){var t=e.map(Ba);return kt(e).sort(function(n,r){return t[n]-t[r]})}function Ba(e){for(var t=0,n=-1,r=e.length,i;++n<r;)(i=+e[n][1])&&(t+=i);return t}function Zm(e){return Va(e).reverse()}function Jm(e){var t=e.length,n,r,i=e.map(Ba),s=za(e),o=0,a=0,c=[],l=[];for(n=0;n<t;++n)r=s[n],o<a?(o+=i[r],c.push(r)):(a+=i[r],l.push(r));return l.reverse().concat(c)}function eg(e){return kt(e).reverse()}const Nr={appearance:za,ascending:Va,descending:Zm,insideOut:Jm,none:kt,reverse:eg},Lr={expand:Gm,diverging:qm,none:Mt,silhouette:Xm,wiggle:Km},Wa=e=>{const{series:t,seriesOrder:n,defaultStrategy:r}=e,i=[],s={};return n.forEach(o=>{const{stack:a,stackOrder:c,stackOffset:l}=t[o];a===void 0?i.push({ids:[o],stackingOrder:Nr.none,stackingOffset:Lr.none}):s[a]===void 0?(s[a]=i.length,i.push({ids:[o],stackingOrder:Nr[c??(r==null?void 0:r.stackOrder)??"none"],stackingOffset:Lr[l??(r==null?void 0:r.stackOffset)??"diverging"]})):(i[s[a]].ids.push(o),c!==void 0&&(i[s[a]].stackingOrder=Nr[c]),l!==void 0&&(i[s[a]].stackingOffset=Lr[l]))}),i};function Hi(e,t){const n={};return Object.keys(e).forEach(r=>{n[r]=y({},e[r],{valueFormatter:e[r].valueFormatter??t})}),n}const tg=(e,t)=>{const{seriesOrder:n,series:r}=e,i=Wa(e),s=t??[];n.forEach(a=>{const c=r[a].data;if(c!==void 0)c.forEach((l,u)=>{s.length<=u?s.push({[a]:l}):s[u][a]=l});else if(t===void 0)throw new Error([`MUI X Charts: bar series with id='${a}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join(`
`))});const o={};return i.forEach(a=>{const{ids:c,stackingOffset:l,stackingOrder:u}=a,d=Ha().keys(c.map(f=>{const g=r[f].dataKey;return r[f].data===void 0&&g!==void 0?g:f})).value((f,g)=>f[g]??0).order(u).offset(l)(s);c.forEach((f,g)=>{const m=r[f].dataKey;o[f]=y({layout:"vertical"},r[f],{data:m?t.map(p=>{const x=p[m];return typeof x!="number"?0:x}):r[f].data,stackedData:d[g].map(([p,x])=>[p,x])})})}),{seriesOrder:n,stackingGroups:i,series:Hi(o,a=>a==null?"":a.toLocaleString())}},ng=tg,rg={seriesType:"bar",seriesFormatter:ng,colorProcessor:Na,xExtremumGetter:Pm,yExtremumGetter:Rm},Qn=(e,t)=>e[0]===null||e[1]===null?t:t[0]===null||t[1]===null?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])],ig=e=>{const{series:t,axis:n,isDefaultAxis:r}=e;return Object.keys(t).filter(i=>t[i].xAxisKey===n.id||t[i].xAxisKey===void 0&&r).reduce((i,s)=>{const o=t[s].data.reduce((a,{x:c})=>Qn(a,[c,c]),[null,null]);return Qn(i,o)},[null,null])},sg=e=>{const{series:t,axis:n,isDefaultAxis:r}=e;return Object.keys(t).filter(i=>t[i].yAxisKey===n.id||t[i].yAxisKey===void 0&&r).reduce((i,s)=>{const o=t[s].data.reduce((a,{y:c})=>Qn(a,[c,c]),[null,null]);return Qn(i,o)},[null,null])},og=({series:e,seriesOrder:t})=>({series:Hi(e,n=>`(${n.x}, ${n.y})`),seriesOrder:t}),ag=og;function lg(e,t,n,r){const i=r==null?void 0:r.colorScale,s=n==null?void 0:n.colorScale,o=t==null?void 0:t.colorScale;return i?a=>{var u,d;if(((u=r==null?void 0:r.data)==null?void 0:u[a])!==void 0){const f=i((d=r==null?void 0:r.data)==null?void 0:d[a]);if(f!==null)return f}const c=e.data[a],l=c===null?e.color:i(c.z);return l===null?e.color:l}:s?a=>{const c=e.data[a],l=c===null?e.color:s(c.y);return l===null?e.color:l}:o?a=>{const c=e.data[a],l=c===null?e.color:o(c.x);return l===null?e.color:l}:()=>e.color}const cg={seriesType:"scatter",seriesFormatter:ag,colorProcessor:lg,xExtremumGetter:ig,yExtremumGetter:sg},ug=e=>{const{axis:t}=e,n=Math.min(...t.data??[]),r=Math.max(...t.data??[]);return[n,r]};function dg(e,t){return t.length===0?[null,null]:t.reduce((n,r)=>{const[i,s]=e(r);return n[0]===null?[Math.min(i,s),Math.max(i,s)]:[Math.min(i,s,n[0]),Math.max(i,s,n[1])]},e(t[0]))}const fg=e=>{const{series:t,axis:n,isDefaultAxis:r}=e;return Object.keys(t).filter(i=>t[i].yAxisKey===n.id||r&&t[i].yAxisKey===void 0).reduce((i,s)=>{const{area:o,stackedData:a}=t[s],u=dg(o!==void 0?g=>g:g=>[g[1],g[1]],a);if(i[0]===null)return u;if(u[0]===null)return i;const[d,f]=u;return[Math.min(d,i[0]),Math.max(f,i[1])]},[null,null])},hg=(e,t)=>{const{seriesOrder:n,series:r}=e,i=Wa(y({},e,{defaultStrategy:{stackOffset:"none"}})),s=t??[];n.forEach(a=>{const c=r[a].data;c!==void 0&&c.forEach((l,u)=>{s.length<=u?s.push({[a]:l}):s[u][a]=l})});const o={};return i.forEach(a=>{const{ids:c,stackingOrder:l,stackingOffset:u}=a,d=Ha().keys(c.map(f=>{const g=r[f].dataKey;return r[f].data===void 0&&g!==void 0?g:f})).value((f,g)=>f[g]??0).order(l).offset(u)(s);c.forEach((f,g)=>{const m=r[f].dataKey;o[f]=y({},r[f],{data:m?t.map(p=>{const x=p[m];return typeof x!="number"?null:x}):r[f].data,stackedData:d[g].map(([p,x])=>[p,x])})})}),{seriesOrder:n,stackingGroups:i,series:Hi(o,a=>a==null?"":a.toLocaleString())}},mg=hg;function gg(e,t,n){const r=n==null?void 0:n.colorScale,i=t==null?void 0:t.colorScale;return r?s=>{const o=e.data[s],a=o===null?e.color:r(o);return a===null?e.color:a}:i?s=>{var c;const o=(c=t.data)==null?void 0:c[s],a=o===null?e.color:i(o);return a===null?e.color:a}:()=>e.color}const pg={seriesType:"line",colorProcessor:gg,seriesFormatter:mg,xExtremumGetter:ug,yExtremumGetter:fg};function Se(e,t){return typeof e=="function"?e(t):e}const xg=(e="none")=>{if(typeof e=="function")return e;switch(e){case"none":return null;case"desc":return(t,n)=>n-t;case"asc":return(t,n)=>t-n;default:return null}},yg=e=>{const{seriesOrder:t,series:n}=e,r={};return t.forEach(i=>{const s=Bm().startAngle(2*Math.PI*(n[i].startAngle??0)/360).endAngle(2*Math.PI*(n[i].endAngle??360)/360).padAngle(2*Math.PI*(n[i].paddingAngle??0)/360).sortValues(xg(n[i].sortingValues??"none"))(n[i].data.map(o=>o.value));r[i]=y({valueFormatter:o=>o.value.toLocaleString()},n[i],{data:n[i].data.map((o,a)=>y({},o,{id:o.id??`auto-generated-pie-id-${i}-${a}`},s[a])).map((o,a)=>{var c,l;return y({},o,{formattedValue:((l=(c=n[i]).valueFormatter)==null?void 0:l.call(c,y({},o,{label:Se(o.label,"arc")}),{dataIndex:a}))??o.value.toLocaleString()})})})}),{seriesOrder:t,series:r}},bg=yg;function vg(e){return t=>e.data[t].color}const wg={seriesType:"pie",colorProcessor:vg,seriesFormatter:bg},Cg=[rg,cg,pg,wg];function Mg(e){const t=e??Cg;return w.useMemo(()=>{const n={},r={},i={},s={};for(let o=0;o<t.length;o+=1){const a=t[o];n[a.seriesType]=a.seriesFormatter,r[a.seriesType]=a.colorProcessor,a.xExtremumGetter&&(i[a.seriesType]=a.xExtremumGetter),a.yExtremumGetter&&(s[a.seriesType]=a.yExtremumGetter)}return{seriesFormatters:n,colorProcessors:r,xExtremumGetters:i,yExtremumGetters:s}},[t])}const kg=()=>{nt(()=>{if(!window.matchMedia)return xe.assign({skipAnimation:!0}),()=>{};const e=window.matchMedia("(prefers-reduced-motion)"),t=n=>{xe.assign({skipAnimation:n.matches||void 0})};return t(e),e.addEventListener("change",t),()=>{e.removeEventListener("change",t)}},[])},Tg=(e,t)=>{const n=w.useRef(null),r=Ht(e,n),{xExtremumGetters:i,yExtremumGetters:s,seriesFormatters:o,colorProcessors:a}=Mg(t);return kg(),{svgRef:n,handleRef:r,xExtremumGetters:i,yExtremumGetters:s,seriesFormatters:o,colorProcessors:a}},Sg=w.forwardRef(function(t,n){const{width:r,height:i,series:s,margin:o,xAxis:a,yAxis:c,zAxis:l,colors:u,dataset:d,sx:f,title:g,desc:m,disableAxisListener:p,highlightedItem:x,onHighlightChange:b,plugins:T,children:v}=t,{svgRef:C,handleRef:k,xExtremumGetters:M,yExtremumGetters:$,seriesFormatters:E,colorProcessors:N}=Tg(n,T);return h.jsx(Ah,{width:r,height:i,margin:o,svgRef:C,children:h.jsx(bm,{colorProcessors:N,children:h.jsx(Nh,{series:s,colors:u,dataset:d,seriesFormatters:E,children:h.jsx(Dh,{xAxis:a,yAxis:c,dataset:d,xExtremumGetters:M,yExtremumGetters:$,children:h.jsx(Wh,{zAxis:l,dataset:d,children:h.jsx(Oh,{children:h.jsx(Bh,{highlightedItem:x,onHighlightChange:b,children:h.jsxs(km,{width:r,height:i,ref:k,sx:f,title:g,desc:m,disableAxisListener:p,children:[h.jsx(Am,{}),v]})})})})})})})})}),Ag=(e,t)=>{const n=w.useRef(null),r=w.useRef(!1),[i,s]=w.useState(0),[o,a]=w.useState(0),c=w.useCallback(()=>{const l=n==null?void 0:n.current;if(!l)return;const d=Nl(l).getComputedStyle(l),f=Math.floor(parseFloat(d.height))||0,g=Math.floor(parseFloat(d.width))||0;s(g),a(f)},[]);return w.useEffect(()=>{r.current=!0},[]),at(()=>{if(e!==void 0&&t!==void 0)return()=>{};c();const l=n.current;if(typeof ResizeObserver>"u")return()=>{};let u;const d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{c()})});return l&&d.observe(l),()=>{u&&window.cancelAnimationFrame(u),l&&d.unobserve(l)}},[c,t,e]),[n,e??i,t??o]},Pg=ee("div",{name:"MuiResponsiveChart",slot:"Container"})(({ownerState:e})=>({width:e.width??"100%",height:e.height??"100%",display:"flex",position:"relative",flexGrow:1,flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden","&>svg":{width:"100%",height:"100%"}})),Rg=["width","height"],Ya=w.forwardRef(function(t,n){const{width:r,height:i}=t,s=Z(t,Rg),[o,a,c]=Ag(r,i);return h.jsx(Pg,{ref:o,ownerState:{width:r,height:i},children:a&&c?h.jsx(Sg,y({},s,{width:a,height:c,ref:n})):null})});function Ga(e){return _e("MuiChartsAxis",e)}const qe=Ne("MuiChartsAxis",["root","line","tickContainer","tick","tickLabel","label","directionX","directionY","top","bottom","left","right"]),qa=ee("g",{name:"MuiChartsAxis",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({[`& .${qe.tickLabel}`]:y({},e.typography.caption,{fill:(e.vars||e).palette.text.primary}),[`& .${qe.label}`]:y({},e.typography.body1,{fill:(e.vars||e).palette.text.primary}),[`& .${qe.line}`]:{stroke:(e.vars||e).palette.text.primary,shapeRendering:"crispEdges",strokeWidth:1},[`& .${qe.tick}`]:{stroke:(e.vars||e).palette.text.primary,shapeRendering:"crispEdges"}}));function $g(){return typeof window>"u"}const Je={widthCache:{},cacheCount:0},jg=2e3,Ig={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},_g=["minWidth","maxWidth","width","minHeight","maxHeight","height","top","left","fontSize","padding","margin","paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom"],ao="mui_measurement_span";function Xa(e,t){return _g.indexOf(e)>=0&&t===+t?`${t}px`:t}function Ka(e){return e.split("").reduce((r,i)=>i===i.toUpperCase()?[...r,"-",i.toLowerCase()]:[...r,i],[]).join("")}const Ng=e=>Object.keys(e).sort().reduce((t,n)=>`${t}${Ka(n)}:${Xa(n,e[n])};`,""),Lg=(e,t={})=>{if(e==null||$g())return{width:0,height:0};const n=`${e}`,r=Ng(t),i=`${n}-${r}`;if(Je.widthCache[i])return Je.widthCache[i];try{let s=document.getElementById(ao);s===null&&(s=document.createElement("span"),s.setAttribute("id",ao),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));const o=y({},Ig,t);Object.keys(o).map(l=>(s.style[Ka(l)]=Xa(l,o[l]),l)),s.textContent=n;const a=s.getBoundingClientRect(),c={width:a.width,height:a.height};return Je.widthCache[i]=c,Je.cacheCount+1>jg?(Je.cacheCount=0,Je.widthCache={}):Je.cacheCount+=1,c}catch{return{width:0,height:0}}};function zi({style:e,needsComputation:t,text:n}){return n.split(`
`).map(r=>y({text:r},t?Lg(r,e):{width:0,height:0}))}const Eg=["x","y","style","text","ownerState"],Dg=["angle","textAnchor","dominantBaseline"];function rn(e){const{x:t,y:n,style:r,text:i}=e,s=Z(e,Eg),o=r??{},{angle:a,textAnchor:c,dominantBaseline:l}=o,u=Z(o,Dg),d=w.useMemo(()=>zi({style:u,needsComputation:i.includes(`
`),text:i}),[u,i]);let f;switch(l){case"hanging":f=0;break;case"central":f=(d.length-1)/2*-d[0].height;break;default:f=(d.length-1)*-d[0].height;break}const g=[];return a&&g.push(`rotate(${a}, ${t}, ${n})`),h.jsx("text",y({},s,{transform:g.length>0?g.join(" "):void 0,x:t,y:n,textAnchor:c,dominantBaseline:l,style:u,children:d.map((m,p)=>h.jsx("tspan",{x:t,dy:`${p===0?f:d[0].height}px`,dominantBaseline:l,children:m.text},p))}))}const lo=5;function Fg(e,t,n=0){const r=Math.min(Math.abs(n)%180,Math.abs(Math.abs(n)%180-180)%180);if(r<lo)return e;if(r>90-lo)return t;const i=r*Math.PI/180,s=Math.atan2(t,e);return i<s?e/Math.cos(i):t/Math.sin(i)}function Og(e=!1){const[t,n]=w.useState(!1);return at(()=>{e||n(!0)},[e]),w.useEffect(()=>{e&&n(!0)},[e]),t}const Ug=["scale","tickNumber","reverse"],Hg=e=>{const{classes:t,position:n}=e;return Ce({root:["root","directionX",n],line:["line"],tickContainer:["tickContainer"],tick:["tick"],tickLabel:["tickLabel"],label:["label"]},Ga,t)};function zg(e,{tickLabelStyle:t,tickLabelInterval:n,reverse:r,isMounted:i}){const s=e.map(l=>{if(!i||l.formattedValue===void 0)return y({},l,{width:0,height:0});const u=zi({style:t,needsComputation:!0,text:l.formattedValue});return y({},l,{width:Math.max(...u.map(d=>d.width)),height:Math.max(u.length*u[0].height)})});if(typeof n=="function")return s.map((l,u)=>y({},l,{skipLabel:!n(l.value,u)}));let o=0,a=0;const c=r?-1:1;return s.map((l,u)=>{const{width:d,offset:f,labelOffset:g,height:m}=l,p=Fg(d,m,t==null?void 0:t.angle),x=f+g,b=1.2;return o=x-c*(b*p)/2,u>0&&c*o<c*a?y({},l,{skipLabel:!0}):(a=x+c*(b*p)/2,l)})}const Vg={position:"bottom",disableLine:!1,disableTicks:!1,tickSize:6};function co(e){const{xAxisIds:t,xAxis:n}=Pe(),r=n[e.axisId??t[0]],{scale:i,tickNumber:s,reverse:o}=r,a=Z(r,Ug),c=Og(),l=St({props:y({},a,e),name:"MuiChartsXAxis"}),u=y({},Vg,l),{position:d,disableLine:f,disableTicks:g,tickLabelStyle:m,label:p,labelStyle:x,tickFontSize:b,labelFontSize:T,tickSize:v,valueFormatter:C,slots:k,slotProps:M,tickInterval:$,tickLabelInterval:E,tickPlacement:N,tickLabelPlacement:D}=u,S=Tt(),L=Hg(y({},u,{theme:S})),{left:P,top:A,width:_,height:F}=Ve(),H=g?4:v,O=d==="bottom"?1:-1,B=(k==null?void 0:k.axisLine)??"line",W=(k==null?void 0:k.axisTick)??"line",z=(k==null?void 0:k.axisTickLabel)??rn,q=(k==null?void 0:k.axisLabel)??rn,ie=Ae({elementType:z,externalSlotProps:M==null?void 0:M.axisTickLabel,additionalProps:{style:y({textAnchor:"middle",dominantBaseline:d==="bottom"?"hanging":"auto",fontSize:b??12},m)},className:L.tickLabel,ownerState:{}}),ae=Xn({scale:i,tickNumber:s,valueFormatter:C,tickInterval:$,tickPlacement:N,tickLabelPlacement:D}),Q=zg(ae,{tickLabelStyle:ie.style,tickLabelInterval:E,reverse:o,isMounted:c}),le={x:P+_/2,y:O*(H+22)},J=Ae({elementType:q,externalSlotProps:M==null?void 0:M.axisLabel,additionalProps:{style:y({fontSize:T??14,textAnchor:"middle",dominantBaseline:d==="bottom"?"hanging":"auto"},x)},ownerState:{}}),te=i.domain();return te.length===0||te[0]===te[1]?null:h.jsxs(qa,{transform:`translate(0, ${d==="bottom"?A+F:A})`,className:L.root,children:[!f&&h.jsx(B,y({x1:P,x2:P+_,className:L.line},M==null?void 0:M.axisLine)),Q.filter(I=>I.offset>=P-1&&I.offset<=P+_+1).map(({formattedValue:I,offset:U,labelOffset:G,skipLabel:R},se)=>{const X=G??0,ce=O*(H+3),de=U>=P-1&&U<=P+_+1,Le=U+X>=P-1&&U+X<=P+_+1;return h.jsxs("g",{transform:`translate(${U}, 0)`,className:L.tickContainer,children:[!g&&de&&h.jsx(W,y({y2:O*H,className:L.tick},M==null?void 0:M.axisTick)),I!==void 0&&!R&&Le&&h.jsx(z,y({x:X,y:ce},ie,{text:I.toString()}))]},se)}),p&&h.jsx("g",{className:L.label,children:h.jsx(q,y({},le,J,{text:p}))})]})}const Bg=["scale","tickNumber"],Wg=e=>{const{classes:t,position:n}=e;return Ce({root:["root","directionY",n],line:["line"],tickContainer:["tickContainer"],tick:["tick"],tickLabel:["tickLabel"],label:["label"]},Ga,t)},Yg={position:"left",disableLine:!1,disableTicks:!1,tickFontSize:12,labelFontSize:14,tickSize:6};function uo(e){const{yAxisIds:t,yAxis:n}=Pe(),r=n[e.axisId??t[0]],{scale:i,tickNumber:s}=r,o=Z(r,Bg),a=St({props:y({},o,e),name:"MuiChartsYAxis"}),c=y({},Yg,a),{position:l,disableLine:u,disableTicks:d,tickFontSize:f,label:g,labelFontSize:m,labelStyle:p,tickLabelStyle:x,tickSize:b,valueFormatter:T,slots:v,slotProps:C,tickPlacement:k,tickLabelPlacement:M,tickInterval:$,tickLabelInterval:E}=c,N=Tt(),D=N.direction==="rtl",S=Wg(y({},c,{theme:N})),{left:L,top:P,width:A,height:_}=Ve(),F=d?4:b,H=Xn({scale:i,tickNumber:s,valueFormatter:T,tickPlacement:k,tickLabelPlacement:M,tickInterval:$}),O=l==="right"?1:-1,B={x:O*(f+F+10),y:P+_/2},W=(v==null?void 0:v.axisLine)??"line",z=(v==null?void 0:v.axisTick)??"line",q=(v==null?void 0:v.axisTickLabel)??rn,ie=(v==null?void 0:v.axisLabel)??rn,ae=!D&&l==="right"||D&&l!=="right",Q=Ae({elementType:q,externalSlotProps:C==null?void 0:C.axisTickLabel,additionalProps:{style:y({fontSize:f,textAnchor:ae?"start":"end",dominantBaseline:"central"},x)},className:S.tickLabel,ownerState:{}}),le=Ae({elementType:ie,externalSlotProps:C==null?void 0:C.axisLabel,additionalProps:{style:y({fontSize:m,angle:O*90,textAnchor:"middle",dominantBaseline:"auto"},p)},ownerState:{}}),J=i.domain();return J.length===0||J[0]===J[1]?null:h.jsxs(qa,{transform:`translate(${l==="right"?L+A:L}, 0)`,className:S.root,children:[!u&&h.jsx(W,y({y1:i.range()[0],y2:i.range()[1],className:S.line},C==null?void 0:C.axisLine)),H.map(({formattedValue:te,offset:I,labelOffset:U,value:G},R)=>{const se=O*(F+2),X=U,ce=typeof E=="function"&&!(E!=null&&E(G,R));return h.jsxs("g",{transform:`translate(0, ${I})`,className:S.tickContainer,children:[!d&&h.jsx(z,y({x2:O*F,className:S.tick},C==null?void 0:C.axisTick)),te!==void 0&&!ce&&h.jsx(q,y({x:se,y:X,text:te.toString()},Q))]},R)}),g&&h.jsx("g",{className:S.label,children:h.jsx(ie,y({},B,le,{text:g}))})]})}const Cn=(e,t)=>e==null?null:typeof e=="object"?e.axisId??t??null:e,Mn=(e,t,n)=>typeof e=="object"?y({},e,{slots:y({},t,e==null?void 0:e.slots),slotProps:y({},n,e==null?void 0:e.slotProps)}):{slots:t,slotProps:n};function Qa(e){const{topAxis:t,leftAxis:n,rightAxis:r,bottomAxis:i,slots:s,slotProps:o}=e,{xAxis:a,xAxisIds:c,yAxis:l,yAxisIds:u}=Pe(),d=Cn(n===void 0?u[0]:n,u[0]),f=Cn(i===void 0?c[0]:i,c[0]),g=Cn(t,c[0]),m=Cn(r,u[0]);if(g!==null&&!a[g])throw Error([`MUI X Charts: id used for top axis "${g}" is not defined.`,`Available ids are: ${c.join(", ")}.`].join(`
`));if(d!==null&&!l[d])throw Error([`MUI X Charts: id used for left axis "${d}" is not defined.`,`Available ids are: ${u.join(", ")}.`].join(`
`));if(m!==null&&!l[m])throw Error([`MUI X Charts: id used for right axis "${m}" is not defined.`,`Available ids are: ${u.join(", ")}.`].join(`
`));if(f!==null&&!a[f])throw Error([`MUI X Charts: id used for bottom axis "${f}" is not defined.`,`Available ids are: ${c.join(", ")}.`].join(`
`));const p=Mn(t,s,o),x=Mn(i,s,o),b=Mn(n,s,o),T=Mn(r,s,o);return h.jsxs(w.Fragment,{children:[g&&h.jsx(co,y({},p,{position:"top",axisId:g})),f&&h.jsx(co,y({},x,{position:"bottom",axisId:f})),d&&h.jsx(uo,y({},b,{position:"left",axisId:d})),m&&h.jsx(uo,y({},T,{position:"right",axisId:m}))]})}function Gg(e){if(e===null)return{getBoundingClientRect:()=>({width:0,height:0,x:0,y:0,top:0,right:0,bottom:0,left:0,toJSON:()=>""})};const{x:t,y:n}=e,r={width:0,height:0,x:t,y:n,top:n,right:t,bottom:n,left:t};return{getBoundingClientRect:()=>y({},r,{toJSON:()=>JSON.stringify(r)})}}function qg(){const e=Ui(),[t,n]=w.useState(null);return w.useEffect(()=>{const r=e.current;if(r===null)return()=>{};const i=()=>{n(null)},s=o=>{n({x:o.clientX,y:o.clientY,height:o.height,pointerType:o.pointerType})};return r.addEventListener("pointerdown",s),r.addEventListener("pointermove",s),r.addEventListener("pointerup",i),()=>{r.removeEventListener("pointerdown",s),r.removeEventListener("pointermove",s),r.removeEventListener("pointerup",i)}},[e]),t}function Xg(e,t){if(e==="item")return t!==null;const n=t.x!==null,r=t.y!==null;return n||r}function Kg(e){return e instanceof Date?e.toUTCString():e.toLocaleString()}function Qg(e){return _e("MuiChartsTooltip",e)}const fo=Ne("MuiChartsTooltip",["root","table","row","cell","mark","markCell","labelCell","valueCell"]),Za=ee("div",{name:"MuiChartsTooltip",slot:"Container"})(({theme:e})=>({boxShadow:e.shadows[1],backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),borderRadius:e.shape.borderRadius})),Ja=ee("table",{name:"MuiChartsTooltip",slot:"Table"})(({theme:e})=>({borderSpacing:0,"& thead td":{borderBottom:`solid ${(e.vars||e).palette.divider} 1px`}})),oi=ee("tr",{name:"MuiChartsTooltip",slot:"Row"})(({theme:e})=>({"tr:first-of-type& td":{paddingTop:e.spacing(1)},"tr:last-of-type& td":{paddingBottom:e.spacing(1)}})),st=ee("td",{name:"MuiChartsTooltip",slot:"Cell"})(({theme:e})=>({verticalAlign:"middle",color:(e.vars||e).palette.text.secondary,[`&.${fo.labelCell}`]:{paddingLeft:e.spacing(1)},[`&.${fo.valueCell}`]:{paddingLeft:e.spacing(4),color:(e.vars||e).palette.text.primary},"td:first-of-type&":{paddingLeft:e.spacing(2)},"td:last-of-type&":{paddingRight:e.spacing(2)}})),el=ee("div",{name:"MuiChartsTooltip",slot:"Mark",shouldForwardProp:e=>$l(e)&&e!=="color"})(({theme:e,color:t})=>({width:e.spacing(1),height:e.spacing(1),borderRadius:"50%",boxShadow:e.shadows[1],backgroundColor:t,borderColor:(e.vars||e).palette.background.paper,border:`solid ${(e.vars||e).palette.background.paper} ${e.spacing(.25)}`,boxSizing:"content-box"}));function Zg(e){var u;const{series:t,itemData:n,sx:r,classes:i,getColor:s}=e;if(n.dataIndex===void 0||!t.data[n.dataIndex])return null;const{displayedLabel:o,color:a}=t.type==="pie"?{color:s(n.dataIndex),displayedLabel:Se(t.data[n.dataIndex].label,"tooltip")}:{color:s(n.dataIndex),displayedLabel:Se(t.label,"tooltip")},c=t.type==="pie"?y({},t.data[n.dataIndex],{label:Se(t.data[n.dataIndex].label,"tooltip")}):t.data[n.dataIndex],l=(u=t.valueFormatter)==null?void 0:u.call(t,c,{dataIndex:n.dataIndex});return h.jsx(Za,{sx:r,className:i.root,children:h.jsx(Ja,{className:i.table,children:h.jsx("tbody",{children:h.jsxs(oi,{className:i.row,children:[h.jsx(st,{className:Oe(i.markCell,i.cell),children:h.jsx(el,{color:a,className:i.mark})}),h.jsx(st,{className:Oe(i.labelCell,i.cell),children:o}),h.jsx(st,{className:Oe(i.valueCell,i.cell),children:l})]})})})})}function tl(e){const t=w.useContext(La);return e?t[e]:t}function Jg(e){var C;const{content:t,itemData:n,sx:r,classes:i,contentProps:s}=e,o=Be()[n.type].series[n.seriesId],{xAxis:a,yAxis:c,xAxisIds:l,yAxisIds:u}=Pe(),{zAxis:d,zAxisIds:f}=w.useContext(Oi),g=tl(),m=o.xAxisKey??l[0],p=o.yAxisKey??u[0],x=o.zAxisKey??f[0],b=((C=g[o.type])==null?void 0:C.call(g,o,m&&a[m],p&&c[p],x&&d[x]))??(()=>""),T=t??Zg,v=Ae({elementType:T,externalSlotProps:s,additionalProps:{itemData:n,series:o,sx:r,classes:i,getColor:b},ownerState:{}});return h.jsx(T,y({},v))}let ho;class ep{constructor(){if(this.types=new Set,ho)throw new Error("You can only create one instance!");ho=this.types}addType(t){this.types.add(t)}getTypes(){return this.types}}const mr=new ep;mr.addType("bar");mr.addType("line");mr.addType("scatter");function nl(e){return mr.getTypes().has(e)}function tp(e){return nl(e.type)}function np(e){const{series:t,axis:n,dataIndex:r,axisValue:i,sx:s,classes:o}=e;if(r==null)return null;const a=n.valueFormatter??(c=>n.scaleType==="utc"?Kg(c):c.toLocaleString());return h.jsx(Za,{sx:s,className:o.root,children:h.jsxs(Ja,{className:o.table,children:[i!=null&&!n.hideTooltip&&h.jsx("thead",{children:h.jsx(oi,{children:h.jsx(st,{colSpan:3,children:h.jsx(gr,{children:a(i,{location:"tooltip"})})})})}),h.jsx("tbody",{children:t.filter(tp).map(({id:c,label:l,valueFormatter:u,data:d,getColor:f})=>{const g=u(d[r]??null,{dataIndex:r});if(g==null)return null;const m=Se(l,"tooltip"),p=f(r);return h.jsxs(oi,{className:o.row,children:[h.jsx(st,{className:Oe(o.markCell,o.cell),children:p&&h.jsx(el,{color:p,className:o.mark})}),h.jsx(st,{className:Oe(o.labelCell,o.cell),children:m?h.jsx(gr,{children:m}):null}),h.jsx(st,{className:Oe(o.valueCell,o.cell),children:h.jsx(gr,{children:g})})]},c)})})]})})}function rp(e){const{content:t,contentProps:n,axisData:r,sx:i,classes:s}=e,o=(r.x&&r.x.index)!==void 0,a=o?r.x&&r.x.index:r.y&&r.y.index,c=o?r.x&&r.x.value:r.y&&r.y.value,{xAxisIds:l,xAxis:u,yAxisIds:d,yAxis:f}=Pe(),{zAxisIds:g,zAxis:m}=w.useContext(Oi),p=Be(),x=tl(),b=o?l[0]:d[0],T=w.useMemo(()=>{const M=[];return Object.keys(p).filter(nl).forEach($=>{p[$].seriesOrder.forEach(E=>{var S;const N=p[$].series[E],D=o?N.xAxisKey:N.yAxisKey;if(D===void 0||D===b){const L=p[$].series[E],P=L.zAxisKey??g[0],A=((S=x[$])==null?void 0:S.call(x,L,u[L.xAxisKey??l[0]],f[L.yAxisKey??d[0]],P&&m[P]))??(()=>"");M.push(y({},L,{getColor:A}))}})}),M},[b,x,o,p,u,l,f,d,m,g]),v=w.useMemo(()=>o?u[b]:f[b],[b,o,u,f]),C=t??np,k=Ae({elementType:C,externalSlotProps:n,additionalProps:{axisData:r,series:T,axis:v,dataIndex:a,axisValue:c,sx:i,classes:s},ownerState:{}});return h.jsx(C,y({},k))}const ip=e=>{const{classes:t}=e;return Ce({root:["root"],table:["table"],row:["row"],cell:["cell"],mark:["mark"],markCell:["markCell"],labelCell:["labelCell"],valueCell:["valueCell"]},Qg,t)},sp=ee(fc,{name:"MuiChartsTooltip",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({pointerEvents:"none",zIndex:e.zIndex.modal}));function rl(e){const t=St({props:e,name:"MuiChartsTooltip"}),{trigger:n="axis",itemContent:r,axisContent:i,slots:s,slotProps:o}=t,a=qg(),{item:c,axis:l}=w.useContext(Pt),u=n==="item"?c:l,d=Xg(n,u),f=a!==null&&d,g=ip({classes:t.classes}),m=(s==null?void 0:s.popper)??sp,p=Ae({elementType:m,externalSlotProps:o==null?void 0:o.popper,additionalProps:{open:f,placement:(a==null?void 0:a.pointerType)==="mouse"?"right-start":"top",anchorEl:Gg(a),modifiers:[{name:"offset",options:{offset:[0,(a==null?void 0:a.pointerType)==="touch"?40-a.height:0]}}]},ownerState:{}});return n==="none"?null:h.jsx(ko,{children:f&&h.jsx(m,y({},p,{children:n==="item"?h.jsx(Jg,{itemData:u,content:(s==null?void 0:s.itemContent)??r,contentProps:o==null?void 0:o.itemContent,sx:{mx:2},classes:g}):h.jsx(rp,{axisData:u,content:(s==null?void 0:s.axisContent)??i,contentProps:o==null?void 0:o.axisContent,sx:{mx:2},classes:g})}))})}const op=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((r,i)=>{const s=Se(n[i].label,"legend");return s===void 0||r.push({color:n[i].color,label:s,id:i}),r},[])},ap=op,lp=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((r,i)=>{const s=Se(n[i].label,"legend");return s===void 0||r.push({color:n[i].color,label:s,id:i}),r},[])},cp=lp,up=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((r,i)=>{const s=Se(n[i].label,"legend");return s===void 0||r.push({color:n[i].color,label:s,id:i}),r},[])},dp=up,fp=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((r,i)=>(n[i].data.forEach(s=>{const o=Se(s.label,"legend");o!==void 0&&r.push({color:s.color,label:o,id:s.id})}),r),[])},hp=fp,mp={bar:ap,scatter:cp,line:dp,pie:hp};function gp(e){return Object.keys(e).flatMap(t=>{const n=mp[t];return n===void 0?[]:n(e[t])})}function pp(e){return _e("MuiChartsLegend",e)}Ne("MuiChartsLegend",["root","series","mark","label","column","row"]);const xp=["rotate","dominantBaseline"],yp=["label"],bp=ee("g",{name:"MuiChartsLegend",slot:"Root",overridesResolver:(e,t)=>t.root})({}),vp=e=>typeof e=="number"?{left:e,right:e,top:e,bottom:e}:y({left:0,right:0,top:0,bottom:0},e);function wp(e){const{hidden:t,position:n,direction:r,seriesToDisplay:i,drawingArea:s,classes:o,itemMarkWidth:a=20,itemMarkHeight:c=20,markGap:l=5,itemGap:u=10,padding:d=10,labelStyle:f}=e,g=Tt(),m=g.direction==="rtl",p=w.useMemo(()=>y({},g.typography.subtitle1,{color:"inherit",dominantBaseline:"central",textAnchor:"start",fill:(g.vars||g).palette.text.primary,lineHeight:1},f),[f,g]),x=w.useMemo(()=>vp(d),[d]),b=w.useCallback((S,L={})=>{const P=Z(L,xp),A=zi({style:P,needsComputation:!0,text:S}),_={innerWidth:a+l+Math.max(...A.map(F=>F.width)),innerHeight:Math.max(c,A.length*A[0].height)};return y({},_,{outerWidth:_.innerWidth+u,outerHeight:_.innerHeight+u})},[u,c,a,l]),T=s.left+s.width+s.right,v=s.top+s.height+s.bottom,C=T-x.left-x.right,k=v-x.top-x.bottom,[M,$,E]=w.useMemo(()=>{let S=0,L=0,P=0,A=0,_=0;const F=[0];return[i.map(O=>{let{label:B}=O,W=Z(O,yp);const z=b(B,p),q=y({},W,{label:B,positionX:S,positionY:L,innerHeight:z.innerHeight,innerWidth:z.innerWidth,outerHeight:z.outerHeight,outerWidth:z.outerWidth,rowIndex:_});return r==="row"&&(S+z.innerWidth>C&&(S=0,L+=F[_],_+=1,F.length<=_&&F.push(0),q.positionX=S,q.positionY=L,q.rowIndex=_),P=Math.max(P,S+z.outerWidth),A=Math.max(A,L+z.outerHeight),F[_]=Math.max(F[_],z.outerHeight),S+=z.outerWidth),r==="column"&&(L+z.innerHeight>k&&(S=P+u,L=0,_=0,q.positionX=S,q.positionY=L,q.rowIndex=_),F.length<=_&&F.push(0),P=Math.max(P,S+z.outerWidth),A=Math.max(A,L+z.outerHeight),_+=1,L+=z.outerHeight),q}).map(O=>y({},O,{positionY:O.positionY+(r==="row"?F[O.rowIndex]/2:O.outerHeight/2)})),P,A]},[i,b,p,r,C,k,u]),N=w.useMemo(()=>{switch(n.horizontal){case"left":return x.left;case"right":return T-x.right-$;default:return(T-$)/2}},[n.horizontal,x.left,x.right,T,$]),D=w.useMemo(()=>{switch(n.vertical){case"top":return x.top;case"bottom":return v-x.bottom-E;default:return(v-E)/2}},[n.vertical,x.top,x.bottom,v,E]);return t?null:h.jsx(ko,{children:h.jsx(bp,{className:o.root,children:M.map(({id:S,label:L,color:P,positionX:A,positionY:_})=>h.jsxs("g",{className:o.series,transform:`translate(${N+(m?$-A:A)} ${D+_})`,children:[h.jsx("rect",{className:o.mark,x:m?-a:0,y:-c/2,width:a,height:c,fill:P}),h.jsx(rn,{style:p,text:L,x:(m?-1:1)*(a+l),y:0})]},S))})})}const Cp=e=>{const{classes:t,direction:n}=e;return Ce({root:["root",n],mark:["mark"],label:["label"],series:["series"]},pp,t)},Mp={position:{horizontal:"middle",vertical:"top"},direction:"row"};function il(e){const t=St({props:y({},Mp,e),name:"MuiChartsLegend"}),{position:n,direction:r,hidden:i,slots:s,slotProps:o}=t,a=Tt(),c=Cp(y({},t,{theme:a})),l=Ve(),u=Be(),d=gp(u),f=(s==null?void 0:s.legend)??wp,g=Ae({elementType:f,externalSlotProps:o==null?void 0:o.legend,additionalProps:{position:n,direction:r,classes:c,drawingArea:l,series:u,hidden:i,seriesToDisplay:d},ownerState:{}});return h.jsx(f,y({},g))}function kp(e){return _e("MuiChartsAxisHighlight",e)}Ne("MuiChartsAxisHighlight",["root"]);const Tp=()=>Ce({root:["root"]},kp),kn=ee("path",{name:"MuiChartsAxisHighlight",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>y({pointerEvents:"none"},e.axisHighlight==="band"&&{fill:t.palette.mode==="light"?"gray":"white",fillOpacity:.1},e.axisHighlight==="line"&&{strokeDasharray:"5 2",stroke:t.palette.mode==="light"?"#000000":"#ffffff"}));function sl(e){const{x:t,y:n}=e,{xAxisIds:r,xAxis:i,yAxisIds:s,yAxis:o}=Pe(),a=Tp(),c=r[0],l=s[0],u=i[c].scale,d=o[l].scale,{axis:f}=w.useContext(Pt),g=to(u),m=to(d),p=f.x,x=f.y,b=t==="band"&&p!==null&&tn(u),T=n==="band"&&x!==null&&tn(d);return h.jsxs(w.Fragment,{children:[b&&u(p.value)!==void 0&&h.jsx(kn,{d:`M ${u(p.value)-(u.step()-u.bandwidth())/2} ${d.range()[0]} l ${u.step()} 0 l 0 ${d.range()[1]-d.range()[0]} l ${-u.step()} 0 Z`,className:a.root,ownerState:{axisHighlight:"band"}}),T&&d(x.value)!==void 0&&h.jsx(kn,{d:`M ${u.range()[0]} ${d(x.value)-(d.step()-d.bandwidth())/2} l 0 ${d.step()} l ${u.range()[1]-u.range()[0]} 0 l 0 ${-d.step()} Z`,className:a.root,ownerState:{axisHighlight:"band"}}),t==="line"&&f.x!==null&&h.jsx(kn,{d:`M ${g(f.x.value)} ${d.range()[0]} L ${g(f.x.value)} ${d.range()[1]}`,className:a.root,ownerState:{axisHighlight:"line"}}),n==="line"&&f.y!==null&&h.jsx(kn,{d:`M ${u.range()[0]} ${m(f.y.value)} L ${u.range()[1]} ${m(f.y.value)}`,className:a.root,ownerState:{axisHighlight:"line"}})]})}function Sp(e){const{id:t,offset:n}=e,{left:r,top:i,width:s,height:o}=Ve(),a=y({top:0,right:0,bottom:0,left:0},n);return h.jsx("clipPath",{id:t,children:h.jsx("rect",{x:r-a.left,y:i-a.top,width:s+a.left+a.right,height:o+a.top+a.bottom})})}function Ap(e){return _e("MuiChartsGrid",e)}const mo=Ne("MuiChartsGrid",["root","line","horizontalLine","verticalLine"]),Pp=["vertical","horizontal"],Rp=ee("g",{name:"MuiChartsGrid",slot:"Root",overridesResolver:(e,t)=>[{[`&.${mo.verticalLine}`]:t.verticalLine},{[`&.${mo.horizontalLine}`]:t.horizontalLine},t.root]})({}),go=ee("line",{name:"MuiChartsGrid",slot:"Line",overridesResolver:(e,t)=>t.line})(({theme:e})=>({stroke:(e.vars||e).palette.divider,shapeRendering:"crispEdges",strokeWidth:1})),$p=({classes:e})=>Ce({root:["root"],verticalLine:["line","verticalLine"],horizontalLine:["line","horizontalLine"]},Ap,e);function jp(e){const t=St({props:e,name:"MuiChartsGrid"}),{vertical:n,horizontal:r}=t,i=Z(t,Pp),{xAxis:s,xAxisIds:o,yAxis:a,yAxisIds:c}=Pe(),l=$p(t),u=c[0],d=o[0],{scale:f,tickNumber:g,tickInterval:m}=s[d],{scale:p,tickNumber:x,tickInterval:b}=a[u],T=Xn({scale:f,tickNumber:g,tickInterval:m}),v=Xn({scale:p,tickNumber:x,tickInterval:b});return h.jsxs(Rp,y({},i,{className:l.root,children:[n&&T.map(({formattedValue:C,offset:k})=>h.jsx(go,{y1:p.range()[0],y2:p.range()[1],x1:k,x2:k,className:l.verticalLine},`vertical-${C}`)),r&&v.map(({formattedValue:C,offset:k})=>h.jsx(go,{y1:k,y2:k,x1:f.range()[0],x2:f.range()[1],className:l.horizontalLine},`horizontal-${C}`))]}))}function Ip(e){const{onAxisClick:t}=e,n=Ui(),r=Be(),{axis:i}=w.useContext(Pt),{xAxisIds:s,xAxis:o,yAxisIds:a,yAxis:c}=Pe();return w.useEffect(()=>{const l=n.current;if(l===null||!t)return()=>{};const u=d=>{var b;d.preventDefault();const f=(i.x&&i.x.index)!==void 0,g=f?s[0]:a[0],m=f?i.x&&i.x.index:i.y&&i.y.index;if(m==null)return;const p={};Object.keys(r).filter(T=>["bar","line"].includes(T)).forEach(T=>{var v;(v=r[T])==null||v.seriesOrder.forEach(C=>{const k=r[T].series[C],M=f?k.xAxisKey:k.yAxisKey;(M===void 0||M===g)&&(p[C]=k.data[m])})});const x=(b=(f?o:c)[g].data)==null?void 0:b[m];t(d,{dataIndex:m,axisValue:x,seriesValues:p})};return l.addEventListener("click",u),()=>{l.removeEventListener("click",u)}},[i.x,i.y,t,r,n,o,s,c,a]),h.jsx(w.Fragment,{})}const _p=["message"],Np=ee("text")(({theme:e})=>y({},e.typography.body2,{stroke:"none",fill:e.palette.text.primary,shapeRendering:"crispEdges",textAnchor:"middle",dominantBaseline:"middle"}));function Lp(e){const{message:t}=e,n=Z(e,_p),{top:r,left:i,height:s,width:o}=Ve();return h.jsx(Np,y({x:i+o/2,y:r+s/2},n,{children:t??"Loading data…"}))}const Ep=["message"],Dp=ee("text")(({theme:e})=>y({},e.typography.body2,{stroke:"none",fill:e.palette.text.primary,shapeRendering:"crispEdges",textAnchor:"middle",dominantBaseline:"middle"}));function Fp(e){const{message:t}=e,n=Z(e,Ep),{top:r,left:i,height:s,width:o}=Ve();return h.jsx(Dp,y({x:i+o/2,y:r+s/2},n,{children:t??"No data to display"}))}function Op(){const e=Be();return Object.values(e).every(t=>{if(!t)return!0;const{series:n,seriesOrder:r}=t;return r.every(i=>n[i].data.length===0)})}function ol(e){var n,r,i,s;const t=Op();if(e.loading){const o=((n=e.slots)==null?void 0:n.loadingOverlay)??Lp;return h.jsx(o,y({},(r=e.slotProps)==null?void 0:r.loadingOverlay))}if(t){const o=((i=e.slots)==null?void 0:i.noDataOverlay)??Fp;return h.jsx(o,y({},(s=e.slotProps)==null?void 0:s.noDataOverlay))}return null}const Up=e=>{const{xAxis:t,yAxis:n,series:r,width:i,height:s,margin:o,colors:a,dataset:c,sx:l,tooltip:u,onAxisClick:d,axisHighlight:f,legend:g,grid:m,topAxis:p,leftAxis:x,rightAxis:b,bottomAxis:T,children:v,slots:C,slotProps:k,skipAnimation:M,loading:$,layout:E,onItemClick:N,highlightedItem:D,onHighlightChange:S,borderRadius:L,barLabel:P}=e,_=`${wo()}-clip-path`,F=E==="horizontal"||E===void 0&&r.some(I=>I.layout==="horizontal"),H={scaleType:"band",data:Array.from({length:Math.max(...r.map(I=>(I.data??c??[]).length))},(I,U)=>U)},O={series:r.map(I=>y({type:"bar"},I,{layout:F?"horizontal":"vertical"})),width:i,height:s,margin:o,colors:a,dataset:c,xAxis:t??(F?void 0:[y({id:fr},H)]),yAxis:n??(F?[y({id:Fi},H)]:void 0),sx:l,highlightedItem:D,onHighlightChange:S,disableAxisListener:(u==null?void 0:u.trigger)!=="axis"&&(f==null?void 0:f.x)==="none"&&(f==null?void 0:f.y)==="none"&&!d},B={onItemClick:N,slots:C,slotProps:k,skipAnimation:M,borderRadius:L,barLabel:P},W={onAxisClick:d},z={vertical:m==null?void 0:m.vertical,horizontal:m==null?void 0:m.horizontal},q={clipPath:`url(#${_})`},ie={id:_},ae={slots:C,slotProps:k,loading:$},Q={topAxis:p,leftAxis:x,rightAxis:b,bottomAxis:T,slots:C,slotProps:k},le=y({},F?{y:"band"}:{x:"band"},f),J=y({},g,{slots:C,slotProps:k}),te=y({},u,{slots:C,slotProps:k});return{chartContainerProps:O,barPlotProps:B,axisClickHandlerProps:W,gridProps:z,clipPathProps:ie,clipPathGroupProps:q,overlayProps:ae,chartsAxisProps:Q,axisHighlightProps:le,legendProps:J,tooltipProps:te,children:v}},al=w.forwardRef(function(t,n){const{chartContainerProps:r,barPlotProps:i,axisClickHandlerProps:s,gridProps:o,clipPathProps:a,clipPathGroupProps:c,overlayProps:l,chartsAxisProps:u,axisHighlightProps:d,legendProps:f,tooltipProps:g,children:m}=Up(t);return h.jsxs(Ya,y({ref:n},r,{children:[t.onAxisClick&&h.jsx(Ip,y({},s)),t.grid&&h.jsx(jp,y({},o)),h.jsxs("g",y({},c,{children:[h.jsx(ym,y({},i)),h.jsx(ol,y({},l))]})),h.jsx(Qa,y({},u)),h.jsx(il,y({},f)),h.jsx(sl,y({},d)),!t.loading&&h.jsx(rl,y({},g)),h.jsx(Sp,y({},a)),m]}))});function tt(e,t){if(typeof e=="number")return e;if(e==="100%")return t;if(e.endsWith("%")){const n=Number.parseFloat(e.slice(0,e.length-1));if(!Number.isNaN(n))return n*t/100}if(e.endsWith("px")){const n=Number.parseFloat(e.slice(0,e.length-2));if(!Number.isNaN(n))return n}throw Error(`MUI-Charts: Received an unknown value "${e}". It should be a number, or a string with a percentage value.`)}const Hp=["classes","color","cornerRadius","dataIndex","endAngle","id","innerRadius","isFaded","isHighlighted","onClick","outerRadius","paddingAngle","startAngle","highlightScope"];function zp(e){return _e("MuiPieArc",e)}Ne("MuiPieArc",["root","highlighted","faded"]);const Vp=e=>{const{classes:t,id:n,isFaded:r,isHighlighted:i}=e,s={root:["root",`series-${n}`,i&&"highlighted",r&&"faded"]};return Ce(s,zp,t)},Bp=ee(ln.path,{name:"MuiPieArc",slot:"Root",overridesResolver:(e,t)=>t.arc})(({theme:e})=>({stroke:(e.vars||e).palette.background.paper,strokeWidth:1,strokeLinejoin:"round"}));function Wp(e){const{classes:t,color:n,cornerRadius:r,dataIndex:i,endAngle:s,id:o,innerRadius:a,isFaded:c,isHighlighted:l,onClick:u,outerRadius:d,paddingAngle:f,startAngle:g}=e,m=Z(e,Hp),p={id:o,dataIndex:i,classes:t,color:n,isFaded:c,isHighlighted:l},x=Vp(p),b=_a();return h.jsx(Bp,y({d:Kr([g,s,f,a,d,r],(T,v,C,k,M,$)=>Oa().cornerRadius($)({padAngle:C,startAngle:T,endAngle:v,innerRadius:k,outerRadius:M})),onClick:u,cursor:u?"pointer":"unset",ownerState:p,className:x.root},m,b({type:"pie",seriesId:o,dataIndex:i})))}const Yp={keys:e=>e.id,from:({innerRadius:e,outerRadius:t,cornerRadius:n,startAngle:r,endAngle:i,paddingAngle:s,color:o,isFaded:a})=>({innerRadius:e,outerRadius:(e+t)/2,cornerRadius:n,startAngle:(r+i)/2,endAngle:(r+i)/2,paddingAngle:s,fill:o,opacity:a?.3:1}),leave:({innerRadius:e,startAngle:t,endAngle:n})=>({innerRadius:e,outerRadius:e,startAngle:(t+n)/2,endAngle:(t+n)/2}),enter:({innerRadius:e,outerRadius:t,startAngle:n,endAngle:r})=>({innerRadius:e,outerRadius:t,startAngle:n,endAngle:r}),update:({innerRadius:e,outerRadius:t,cornerRadius:n,startAngle:r,endAngle:i,paddingAngle:s,color:o,isFaded:a})=>({innerRadius:e,outerRadius:t,cornerRadius:n,startAngle:r,endAngle:i,paddingAngle:s,fill:o,opacity:a?.3:1}),config:{tension:120,friction:14,clamp:!0}},Gp={keys:e=>e.id,from:({innerRadius:e,outerRadius:t,arcLabelRadius:n,cornerRadius:r,startAngle:i,endAngle:s,paddingAngle:o})=>({innerRadius:e,outerRadius:(e+t)/2,cornerRadius:r,arcLabelRadius:n,startAngle:(i+s)/2,endAngle:(i+s)/2,paddingAngle:o,opacity:0}),leave:({innerRadius:e,startAngle:t,endAngle:n})=>({innerRadius:e,outerRadius:e,arcLabelRadius:e,startAngle:(t+n)/2,endAngle:(t+n)/2,opacity:0}),enter:({innerRadius:e,outerRadius:t,startAngle:n,endAngle:r,arcLabelRadius:i})=>({innerRadius:e,outerRadius:t,startAngle:n,endAngle:r,arcLabelRadius:i,opacity:1}),update:({innerRadius:e,outerRadius:t,cornerRadius:n,startAngle:r,endAngle:i,paddingAngle:s,arcLabelRadius:o})=>({innerRadius:e,outerRadius:t,cornerRadius:n,startAngle:r,endAngle:i,paddingAngle:s,arcLabelRadius:o,opacity:1}),config:{tension:120,friction:14,clamp:!0}};function ll(e){const{id:t,data:n,faded:r,highlighted:i,paddingAngle:s=0,innerRadius:o=0,arcLabelRadius:a,outerRadius:c,cornerRadius:l=0}=e,{isFaded:u,isHighlighted:d}=hr();return w.useMemo(()=>n.map((g,m)=>{const p={seriesId:t,dataIndex:m},x=d(p),b=!x&&u(p),T=y({additionalRadius:0},b&&r||x&&i||{}),v=Math.max(0,Math.PI*(T.paddingAngle??s)/180),C=Math.max(0,T.innerRadius??o),k=Math.max(0,T.outerRadius??c+T.additionalRadius),M=T.cornerRadius??l,$=T.arcLabelRadius??a??(C+k)/2;return y({},g,T,{isFaded:b,isHighlighted:x,paddingAngle:v,innerRadius:C,outerRadius:k,cornerRadius:M,arcLabelRadius:$})}),[l,o,c,s,a,n,r,i,u,d,t])}const qp=["slots","slotProps","innerRadius","outerRadius","cornerRadius","paddingAngle","id","highlighted","faded","data","onItemClick","skipAnimation"],Xp=["startAngle","endAngle","paddingAngle","innerRadius","arcLabelRadius","outerRadius","cornerRadius"];function Kp(e){const{slots:t,slotProps:n,innerRadius:r=0,outerRadius:i,cornerRadius:s=0,paddingAngle:o=0,id:a,highlighted:c,faded:l={additionalRadius:-5},data:u,onItemClick:d,skipAnimation:f}=e,g=Z(e,qp),m=ll({innerRadius:r,outerRadius:i,cornerRadius:s,paddingAngle:o,id:a,highlighted:c,faded:l,data:u}),p=Kt(m,y({},Yp,{immediate:f})),{highlightScope:x}=hr();if(u.length===0)return null;const b=(t==null?void 0:t.pieArc)??Wp;return h.jsx("g",y({},g,{children:p((T,v,C,k)=>{let{startAngle:M,endAngle:$,paddingAngle:E,innerRadius:N,outerRadius:D,cornerRadius:S}=T,L=Z(T,Xp);return h.jsx(b,y({startAngle:M,endAngle:$,paddingAngle:E,innerRadius:N,outerRadius:D,cornerRadius:S,style:L,id:a,color:v.color,dataIndex:k,highlightScope:x,isFaded:v.isFaded,isHighlighted:v.isHighlighted,onClick:d&&(P=>{d(P,{type:"pie",seriesId:a,dataIndex:k},v)})},n==null?void 0:n.pieArc))})}))}const Qp=["id","classes","color","startAngle","endAngle","paddingAngle","arcLabelRadius","innerRadius","outerRadius","cornerRadius","formattedArcLabel","isHighlighted","isFaded","style"];function Zp(e){return _e("MuiPieArcLabel",e)}Ne("MuiPieArcLabel",["root","highlighted","faded"]);const Jp=e=>{const{classes:t,id:n,isFaded:r,isHighlighted:i}=e,s={root:["root",`series-${n}`,i&&"highlighted",r&&"faded"]};return Ce(s,Zp,t)},e0=ee(ln.text,{name:"MuiPieArcLabel",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({fill:(e.vars||e).palette.text.primary,textAnchor:"middle",dominantBaseline:"middle",pointerEvents:"none"})),po=(e,t)=>(n,r,i,s,o)=>{if(!e)return 0;const[a,c]=Oa().cornerRadius(o).centroid({padAngle:i,startAngle:n,endAngle:r,innerRadius:s,outerRadius:s});return t==="x"?a:c};function t0(e){const{id:t,classes:n,color:r,startAngle:i,endAngle:s,paddingAngle:o,arcLabelRadius:a,cornerRadius:c,formattedArcLabel:l,isHighlighted:u,isFaded:d,style:f}=e,g=Z(e,Qp),p=Jp({id:t,classes:n,color:r,isFaded:d,isHighlighted:u});return h.jsx(e0,y({className:p.root},g,{style:y({x:Kr([i,s,o,a,c],po(l,"x")),y:Kr([i,s,o,a,c],po(l,"y"))},f),children:l}))}const n0=["arcLabel","arcLabelMinAngle","arcLabelRadius","cornerRadius","data","faded","highlighted","id","innerRadius","outerRadius","paddingAngle","skipAnimation","slotProps","slots"],r0=["startAngle","endAngle","paddingAngle","innerRadius","outerRadius","arcLabelRadius","cornerRadius"],i0=180/Math.PI;function s0(e,t,n){var i;if(!e||(n.endAngle-n.startAngle)*i0<t)return null;switch(e){case"label":return Se(n.label,"arc");case"value":return(i=n.value)==null?void 0:i.toString();case"formattedValue":return n.formattedValue;default:return e(y({},n,{label:Se(n.label,"arc")}))}}function o0(e){const{arcLabel:t,arcLabelMinAngle:n=0,arcLabelRadius:r,cornerRadius:i=0,data:s,faded:o={additionalRadius:-5},highlighted:a,id:c,innerRadius:l,outerRadius:u,paddingAngle:d=0,skipAnimation:f,slotProps:g,slots:m}=e,p=Z(e,n0),x=ll({innerRadius:l,outerRadius:u,arcLabelRadius:r,cornerRadius:i,paddingAngle:d,id:c,highlighted:a,faded:o,data:s}),b=Kt(x,y({},Gp,{immediate:f}));if(s.length===0)return null;const T=(m==null?void 0:m.pieArcLabel)??t0;return h.jsx("g",y({},p,{children:b((v,C)=>{let{startAngle:k,endAngle:M,paddingAngle:$,innerRadius:E,outerRadius:N,arcLabelRadius:D,cornerRadius:S}=v,L=Z(v,r0);return h.jsx(T,y({startAngle:k,endAngle:M,paddingAngle:$,innerRadius:E,outerRadius:N,arcLabelRadius:D,cornerRadius:S,style:L,id:c,color:C.color,isFaded:C.isFaded,isHighlighted:C.isHighlighted,formattedArcLabel:s0(t,n,C)},g==null?void 0:g.pieArcLabel))})}))}function xo(e,t){const{height:n,width:r}=t,{cx:i,cy:s}=e,o=Math.min(r,n)/2,a=tt(i??"50%",r),c=tt(s??"50%",n);return{cx:a,cy:c,availableRadius:o}}function a0(e){const{skipAnimation:t,slots:n,slotProps:r,onItemClick:i}=e,s=Lh(),{left:o,top:a,width:c,height:l}=w.useContext(dn);if(s===void 0)return null;const{series:u,seriesOrder:d}=s;return h.jsxs("g",{children:[d.map(f=>{const{innerRadius:g,outerRadius:m,cornerRadius:p,paddingAngle:x,data:b,cx:T,cy:v,highlighted:C,faded:k}=u[f],{cx:M,cy:$,availableRadius:E}=xo({cx:T,cy:v},{width:c,height:l}),N=tt(m??E,E),D=tt(g??0,E);return h.jsx("g",{transform:`translate(${o+M}, ${a+$})`,children:h.jsx(Kp,{innerRadius:D,outerRadius:N,cornerRadius:p,paddingAngle:x,id:f,data:b,skipAnimation:t,highlighted:C,faded:k,onItemClick:i,slots:n,slotProps:r})},f)}),d.map(f=>{const{innerRadius:g,outerRadius:m,arcLabelRadius:p,cornerRadius:x,paddingAngle:b,arcLabel:T,arcLabelMinAngle:v,data:C,cx:k,cy:M}=u[f],{cx:$,cy:E,availableRadius:N}=xo({cx:k,cy:M},{width:c,height:l}),D=tt(m??N,N),S=tt(g??0,N),L=p===void 0?(D+S)/2:tt(p,N);return h.jsx("g",{transform:`translate(${o+$}, ${a+E})`,children:h.jsx(o0,{innerRadius:S,outerRadius:D??N,arcLabelRadius:L,cornerRadius:x,paddingAngle:b,id:f,data:C,skipAnimation:t,arcLabel:T,arcLabelMinAngle:v,slots:n,slotProps:r})},f)})]})}const l0=()=>Tt().direction==="rtl",c0={top:5,bottom:5,left:5,right:100},u0={top:5,bottom:5,left:100,right:5};function d0(e){const{xAxis:t,yAxis:n,series:r,width:i,height:s,margin:o,colors:a,sx:c,tooltip:l={trigger:"item"},axisHighlight:u={x:"none",y:"none"},skipAnimation:d,legend:f,topAxis:g=null,leftAxis:m=null,rightAxis:p=null,bottomAxis:x=null,children:b,slots:T,slotProps:v,onItemClick:C,loading:k,highlightedItem:M,onHighlightChange:$}=e,E=l0(),N=y({},E?u0:c0,o),D=y({direction:"column",position:{vertical:"middle",horizontal:E?"left":"right"}},f);return h.jsxs(Ya,{series:r.map(S=>y({type:"pie"},S)),width:i,height:s,margin:N,xAxis:t??[{id:fr,scaleType:"point",data:[...new Array(Math.max(...r.map(S=>S.data.length)))].map((S,L)=>L)}],yAxis:n,colors:a,sx:c,disableAxisListener:(l==null?void 0:l.trigger)!=="axis"&&(u==null?void 0:u.x)==="none"&&(u==null?void 0:u.y)==="none",highlightedItem:M,onHighlightChange:$,children:[h.jsx(Qa,{topAxis:g,leftAxis:m,rightAxis:p,bottomAxis:x,slots:T,slotProps:v}),h.jsx(a0,{slots:T,slotProps:v,onItemClick:C,skipAnimation:d}),h.jsx(ol,{loading:k,slots:T,slotProps:v}),h.jsx(il,y({},D,{slots:T,slotProps:v})),h.jsx(sl,y({},u)),!k&&h.jsx(rl,y({},l,{slots:T,slotProps:v})),b]})}const f0={height:400,sx:{[`.${qe.left} .${qe.label}`]:{transform:"translate(-20px, 0)"}}},Er=e=>`${e} Hộ`,h0=({data:e})=>h.jsx(h.Fragment,{children:h.jsx("div",{className:"form-chart bg-1",children:h.jsx(al,{borderRadius:10,dataset:e,xAxis:[{scaleType:"band",dataKey:"TenDonVi"}],series:[{dataKey:"DoiTuongDuocDuyet",label:"Đối tượng được duyệt",valueFormatter:Er,color:"#0d9990"},{dataKey:"DoiTuongTuChoi",label:"Đối tượng bị từ chối",valueFormatter:Er,color:"#b10000"},{dataKey:"DoiTuongChuaDuocDuyet",label:"Đối tượng chưa được duyệt",valueFormatter:Er,color:"rgba(220, 235, 255, 1)"}],...f0})})}),cl=({title:e,column:t,data:n})=>{let r=t.map((i,s)=>s===0?"2fr":"1fr");return h.jsxs(h.Fragment,{children:[e,n!=null&&n.length?h.jsx(h.Fragment,{children:h.jsx("div",{className:"table-chart-custom",children:n.map(i=>h.jsx("div",{style:{gridTemplateColumns:r.join(" ")},className:"row-table",children:t.map((s,o)=>h.jsx(h.Fragment,{children:h.jsxs("div",{children:[h.jsx("span",{className:"title",children:s==null?void 0:s.title}),h.jsx("div",{className:"td",children:s!=null&&s.isFormat?`${Et(i[s==null?void 0:s.field]*1e6)} VNĐ`:i[s==null?void 0:s.field]})]})}))}))})}):h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-flex align-items-center justify-content-center w-100",children:h.jsx("i",{children:"Không có dữ liệu"})})})]})};let m0=[{title:"Tên đơn vị",field:"TenDonVi"},{title:"Số tiền đã chi",field:"SoTienDaChi",isFormat:!0},{title:"Số tiền chưa chi",field:"SoTienChuaChi",isFormat:!0},{title:"Tổng cộng",field:"SoTien",isFormat:!0}];const g0={height:400,sx:{[`.${qe.left} .${qe.label}`]:{transform:"translateY(-1rem)"}}},yo=e=>`${Et(+e)} triệu VNĐ`,p0=({data:e})=>{let t=e==null?void 0:e.map(r=>r==null?void 0:r.SoTienDaChi),n=e==null?void 0:e.map(r=>r==null?void 0:r.SoTienChuaChi);return h.jsx(h.Fragment,{children:h.jsx("div",{children:h.jsx(vl,{data:[{TabName:"Biểu đồ",TabContent:h.jsx(h.Fragment,{children:h.jsx("div",{className:"p-3",children:h.jsx(al,{borderRadius:10,dataset:e,xAxis:[{scaleType:"band",dataKey:"TenDonVi"}],series:[{data:t,label:"Số tiền đã chi",id:"dachi",stack:"total",color:"#0d9990",valueFormatter:yo},{data:n,label:"Số tiền chưa chi",id:"chuachi",stack:"total",color:"#2b566f",valueFormatter:yo}],tooltip:{trigger:"axis"},...g0})})})},{TabName:"Bảng thống kê",TabContent:h.jsx(h.Fragment,{children:h.jsx("div",{style:{minHeight:400},className:"p-4",children:h.jsx(cl,{column:m0,data:e})})})}]})})})},x0=({data:e})=>{let t=+(e==null?void 0:e.tongDuyet)+ +(e==null?void 0:e.tongTuChoi)+ +(e==null?void 0:e.tongChoDuyet),n=+(e==null?void 0:e.tongDuyet)*100/t,r=+(e==null?void 0:e.tongTuChoi)*100/t,i=+(e==null?void 0:e.tongChoDuyet)*100/t;return h.jsxs(h.Fragment,{children:[h.jsx(d0,{height:300,series:[{data:[{id:0,value:+(e==null?void 0:e.tongDuyet)||0,label:"Đã duyệt",color:"#0b978f"},{id:1,value:+(e==null?void 0:e.tongTuChoi)||0,label:"Từ chối",color:"#4f446f"},{id:2,value:+(e==null?void 0:e.tongChoDuyet)||0,label:"Chờ duyệt",color:"#ecb087"}],innerRadius:30,outerRadius:100,paddingAngle:1,cornerRadius:5,cx:100,cy:150}]}),h.jsxs("div",{className:"d-flex",children:[h.jsxs("div",{className:"w-100 text-center",children:[h.jsx("span",{children:"Đã duyệt"}),h.jsxs("h5",{className:"fw-bold",children:[n?n.toFixed(1):0,"%"]})]}),h.jsxs("div",{className:"w-100 text-center",children:[h.jsx("span",{children:"Từ chối"}),h.jsxs("h5",{className:"fw-bold",children:[r?r.toFixed(1):0,"%"]})]}),h.jsxs("div",{className:"w-100 text-center",children:[h.jsx("span",{children:"Chờ duyệt"}),h.jsxs("h5",{className:"fw-bold",children:[i?i.toFixed(1):0,"%"]})]})]})]})};const ax=()=>{const[e,t]=w.useState(new Date().getFullYear()),[n,r]=w.useState([]),[i,s]=w.useState([]),[o,a]=w.useState({tongTien:0,tongTienDaChi:0,tongTienChuaChi:0,tongDuyet:0,tongTuChoi:0,tongChoDuyet:0}),c=(l,u)=>(l==null?void 0:l.reduce((f,g)=>{const m=g[u]??0;return f+m},0))??0;return w.useEffect(()=>{Bi(`ThongKeDoiTuong?Nam=${e}`,"GET",null,{odata:!1}).then(l=>{let u=c(l,"DoiTuongDuocDuyet"),d=c(l,"DoiTuongTuChoi"),f=c(l,"DoiTuongChuaDuocDuyet");r(l),a(g=>({...g,tongDuyet:u,tongTuChoi:d,tongChoDuyet:f}))})},[e]),w.useEffect(()=>{Bi(`ThongKeChiTra?Nam=${e}`,"GET",null,{odata:!1}).then(l=>{let u=c(l,"SoTien"),d=c(l,"SoTienDaChi"),f=c(l,"SoTienChuaChi"),g=l!=null&&l.length?l.map(m=>({SoTien:(m==null?void 0:m.SoTien)/1e6,SoTienChuaChi:(m==null?void 0:m.SoTienChuaChi)/1e6,SoTienDaChi:(m==null?void 0:m.SoTienDaChi)/1e6,TenDonVi:m==null?void 0:m.TenDonVi})):[];s(g),a(m=>({...m,tongTien:u,tongTienDaChi:d,tongTienChuaChi:f}))})},[e]),h.jsx(h.Fragment,{children:h.jsxs("div",{className:"form-dashboard",children:[h.jsxs("div",{className:"header-dashboard",children:[h.jsxs("div",{className:"form-logo-left",children:[h.jsx("div",{className:"item left",children:"NEXT"}),h.jsx("div",{className:"item",children:"FORM"})]}),h.jsx(bl,{}),h.jsx(xc,{})]}),h.jsx("div",{className:"d-flex bg-danger w-100 justify-content-center",children:h.jsx(pc,{})}),h.jsxs("div",{className:"outline-fomr-body-dashboard",children:[h.jsxs("div",{className:"fomr-body-dashboard",children:[h.jsxs("div",{className:"div-1",children:[h.jsxs("div",{className:"d-flex gap-3 align-items-center",children:[h.jsx(Qe,{style:{fontSize:"2rem"},fa:"dashcube"})," Hệ thống quản lý"]}),h.jsxs("div",{className:"title",children:[h.jsx("h1",{children:"Quản lý"}),h.jsx("h1",{children:"Hỗ trợ"}),h.jsx("h1",{children:"Chính sách"})]}),h.jsx("p",{style:{fontSize:"large"},children:"Quản lý và xử lý thông tin thông minh, lưu trữ và bảo mật an toàn."})]}),h.jsxs("div",{className:"div-2",children:[h.jsxs("div",{className:"form-select-year",children:[h.jsx("div",{}),h.jsx(ml,{data:{type:"select-year",hidden_label:!0},value:e,onChange:(l,u)=>u&&t(u)})]}),h.jsxs("div",{className:"list-number",children:[h.jsxs("div",{className:"item-list-number item-card-money",children:[h.jsx(Qe,{fa:"cc-mastercard"}),h.jsx("p",{className:"tt-card",children:"Tổng số tiền"}),h.jsxs("h5",{children:[Et(o==null?void 0:o.tongTien)," VNĐ"]}),h.jsxs("div",{className:"footer-item",children:[h.jsxs("div",{children:[h.jsx("p",{children:"Người chi"}),h.jsx("h6",{children:"UBMT Tỉnh"})]}),h.jsxs("div",{children:[h.jsx("p",{children:"Thời gian"}),h.jsx("h6",{children:e})]})]})]}),h.jsxs("div",{className:"item-list-number item-card-money-3",children:[h.jsx(Qe,{fa:"cc-mastercard"}),h.jsx("p",{className:"tt-card",children:"Số tiền đã chi trả"}),h.jsxs("h5",{children:[Et(o==null?void 0:o.tongTienDaChi)," VNĐ"]}),h.jsxs("div",{className:"footer-item",children:[h.jsxs("div",{children:[h.jsx("p",{children:"Người chi"}),h.jsx("h6",{children:"UBMT Tỉnh"})]}),h.jsxs("div",{children:[h.jsx("p",{children:"Thời gian"}),h.jsx("h6",{children:e})]})]})]}),h.jsxs("div",{className:"item-list-number item-card-money-2",children:[h.jsx(Qe,{fa:"cc-mastercard"}),h.jsx("p",{className:"tt-card",children:"Số tiền chưa chi trả"}),h.jsxs("h5",{children:[Et(o==null?void 0:o.tongTienChuaChi)," VNĐ"]}),h.jsxs("div",{className:"footer-item",children:[h.jsxs("div",{children:[h.jsx("p",{children:"Người chi"}),h.jsx("h6",{children:"Chưa có"})]}),h.jsxs("div",{children:[h.jsx("p",{children:"Thời gian"}),h.jsx("h6",{children:e})]})]})]})]}),h.jsxs("div",{className:"list-number-2",children:[h.jsxs("div",{className:"list-item",children:[h.jsxs("div",{className:"item",children:[h.jsxs("div",{className:"d-flex justify-content-between",children:["Được duyệt",h.jsx(Qe,{fa:"pied-piper"})]}),h.jsx("h5",{children:o==null?void 0:o.tongDuyet})]}),h.jsxs("div",{className:"item cho-duyet",children:[h.jsxs("div",{className:"d-flex justify-content-between",children:["Đang chờ duyệt",h.jsx(Qe,{fa:"ravelry"})]}),h.jsx("h5",{children:o==null?void 0:o.tongChoDuyet})]}),h.jsxs("div",{className:"item tu-choi",children:[h.jsxs("div",{className:"d-flex justify-content-between",children:["Bị từ chối",h.jsx(Qe,{fa:"xing"})]}),h.jsx("h5",{children:o==null?void 0:o.tongTuChoi})]})]}),h.jsx("div",{className:"chart",children:h.jsx(x0,{data:o})})]})]})]}),h.jsxs("div",{style:{display:"grid",gap:"2rem"},children:[h.jsx(p0,{data:i}),h.jsx("div",{style:{minHeight:400},className:"form-chart p-4",children:h.jsx(cl,{title:h.jsx(h.Fragment,{children:h.jsx("h5",{className:"mb-4 ms-3 fw-bold",children:"Thống Kê Phê Duyệt Theo Đơn Vị"})}),column:[{title:"Tên đơn vị",field:"TenDonVi"},{title:"Đối tượng được duyệt",field:"DoiTuongDuocDuyet"},{title:"Đối tượng từ chối",field:"DoiTuongTuChoi"},{title:"Đối tượng chưa được duyệt",field:"DoiTuongChuaDuocDuyet"}],data:n})}),h.jsx(h0,{data:n})]})]})]})})};export{ax as default};