var cg=Object.defineProperty;var fg=(e,t,r)=>t in e?cg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ea=(e,t,r)=>fg(e,typeof t!="symbol"?t+"":t,r);import{a as v,B as Au,o as I,C as Cr,L as dg,r as _u,q as hg}from"./chunk-NL6KNZEE-DfxmOBHd.js";import{a as vg}from"./color.esm-brSKLyvp.js";import{r as Sd,s as Id,h as pg,j as mg,k as gg,n as yg,o as bg,p as xg,q as wg,t as Sg,i as is,v as Ig}from"./api-BuTqLiNI.js";import{u as Pg}from"./AppProvider-DDBhlShu.js";import{M as cn,S as Cg,T as Ou}from"./SearchResults-DjG_lSbe.js";import{A as rt}from"./AsyncButton-Dzd9rf7C.js";import{k as Ki,q as Ag,u as _g}from"./useTheme-DylenN4B.js";import{c as qi}from"./createLucideIcon-Bp-vR5YK.js";import{a as Og}from"./index-0dO883bS.js";/**
 * @license lucide-react v0.513.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Eg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Mg=qi("image",Eg);/**
 * @license lucide-react v0.513.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kg=[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]],Tg=qi("merge",kg);/**
 * @license lucide-react v0.513.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dg=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jg=qi("plus",Dg);/**
 * @license lucide-react v0.513.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ng=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],$g=qi("square-pen",Ng);function Rg({itemType:e,onComplete:t}){return v.useEffect(()=>{const r=i=>{console.log("dragover!!"),i.preventDefault()},n=async i=>{var f;if(i.preventDefault(),!((f=i.dataTransfer)!=null&&f.files.length))return;const a=Array.from(i.dataTransfer.files).find(d=>d.type.startsWith("image/"));if(!a)return;const o=new FormData;o.append("image",a);const s=window.location.pathname.split("/").filter(d=>d!==""),c=s[s.length-1];o.append(e.toLowerCase()+"_id",c),Sd(o).then(d=>{d.status>=200&&d.status<300?(t(),console.log("Replacement image uploaded successfully")):d.json().then(h=>{console.log(`Upload failed: ${d.statusText} - ${h}`)})}).catch(d=>{console.log(`Upload failed: ${d}`)})};return window.addEventListener("dragover",r),window.addEventListener("drop",n),()=>{window.removeEventListener("dragover",r),window.removeEventListener("drop",n)}},[]),null}function Lg(e){const[t,r]=v.useState(e.currentTitle),[n,i]=v.useState(),a=v.useDeferredValue(t),[o,u]=v.useState({title:"",id:0}),[l,s]=v.useState(!1),[c,f]=v.useState(!1),d=Au(),h=()=>{e.setOpen(!1),r(""),i(void 0),s(!1),u({title:"",id:0})},p=({title:m,id:y})=>{u({title:m,id:y})};v.useEffect(()=>{console.log("mergeTarget",o)},[o]);const g=()=>{let m,y;l?(m={id:e.currentId,title:e.currentTitle},y=o):(m=o,y={id:e.currentId,title:e.currentTitle}),e.mergeFunc(m.id,y.id,c).then(x=>{x.ok?l?(d(`/${e.type.toLowerCase()}/${o.id}`),h()):window.location.reload():console.log(x)}).catch(x=>console.log(x))};return v.useEffect(()=>{a&&Id(a).then(m=>{m=e.mergeCleanerFunc(m,e.currentId),i(m)})},[a]),I.jsxs(cn,{isOpen:e.open,onClose:h,children:[I.jsxs("h3",{children:["Merge ",e.type,"s"]}),I.jsxs("div",{className:"flex flex-col items-center",children:[I.jsx("input",{type:"text",autoFocus:!0,defaultValue:e.currentTitle,placeholder:`Search for a${e.type.toLowerCase()[0]==="a"?"n":""} ${e.type.toLowerCase()} to be merged into the current ${e.type.toLowerCase()}`,className:"w-full mx-auto fg bg rounded p-2",onFocus:m=>{r(m.target.value),m.target.select()},onChange:m=>r(m.target.value)}),I.jsx(Cg,{selectorMode:!0,data:n,onSelect:p}),o.id!==0?I.jsxs(I.Fragment,{children:[l?I.jsxs("p",{className:"mt-5",children:[I.jsx("strong",{children:e.currentTitle})," will be merged into"," ",I.jsx("strong",{children:o.title})]}):I.jsxs("p",{className:"mt-5",children:[I.jsx("strong",{children:o.title})," will be merged into"," ",I.jsx("strong",{children:e.currentTitle})]}),I.jsx("button",{className:"hover:cursor-pointer px-5 py-2 rounded-md mt-5 bg-(--color-bg) hover:bg-(--color-bg-tertiary)",onClick:g,children:"Merge Items"}),I.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[I.jsx("input",{type:"checkbox",name:"reverse-merge-order",checked:l,onChange:()=>s(!l)}),I.jsx("label",{htmlFor:"reverse-merge-order",children:"Reverse merge order"})]}),(e.type.toLowerCase()==="album"||e.type.toLowerCase()==="artist")&&I.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[I.jsx("input",{type:"checkbox",name:"replace-image",checked:c,onChange:()=>f(!c)}),I.jsx("label",{htmlFor:"replace-image",children:"Replace image"})]})]}):""]})]})}function zg({musicbrainzId:e,type:t,id:r,open:n,setOpen:i}){const[a,o]=v.useState(""),[u,l]=v.useState(!1),[s,c]=v.useState(""),[f,d]=v.useState(!0),h=g=>{l(!0),c("");const m=new FormData;m.set(`${t.toLowerCase()}_id`,r.toString()),m.set("image_url",g),Sd(m).then(y=>{y.status>=200&&y.status<300?window.location.reload():(y.json().then(x=>c(x.error)),l(!1))}).catch(y=>c(y))},p=()=>{i(!1),o(""),c("")};return I.jsxs(cn,{isOpen:n,onClose:p,children:[I.jsx("h3",{children:"Replace Image"}),I.jsxs("div",{className:"flex flex-col items-center",children:[I.jsx("input",{type:"text",autoFocus:!0,placeholder:"Enter image URL, or drag-and-drop a local file",className:"w-full mx-auto fg bg rounded p-2",value:a,onChange:g=>o(g.target.value)}),a!=""?I.jsx("div",{className:"flex gap-2 mt-4",children:I.jsx(rt,{loading:u,onClick:()=>h(a),children:"Submit"})}):"",t==="Album"&&e?I.jsxs(I.Fragment,{children:[I.jsx("h3",{className:"mt-5",children:"Suggested Image (Click to Apply)"}),I.jsx("button",{className:"mt-4",disabled:u,onClick:()=>h(`https://coverartarchive.org/release/${e}/front`),children:I.jsxs("div",{className:"relative",children:[f&&I.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:I.jsx("div",{className:"animate-spin rounded-full border-2 border-gray-300 border-t-transparent",style:{width:20,height:20}})}),I.jsx("img",{src:`https://coverartarchive.org/release/${e}/front`,onLoad:()=>d(!1),onError:()=>d(!1),className:`block w-[130px] h-auto ${f?"opacity-0":"opacity-100"} transition-opacity duration-300`})]})})]}):"",I.jsx("p",{className:"error",children:s})]})]})}function Fg({open:e,setOpen:t,title:r,id:n,type:i}){const[a,o]=v.useState(!1),u=Au(),l=()=>{o(!0),pg(i.toLowerCase(),n).then(s=>{s.ok?u(-1):console.log(s)})};return I.jsxs(cn,{isOpen:e,onClose:()=>t(!1),children:[I.jsxs("h3",{children:['Delete "',r,'"?']}),I.jsx("p",{children:"This action is irreversible!"}),I.jsx("div",{className:"flex flex-col mt-3 items-center",children:I.jsx(rt,{loading:a,onClick:l,children:"Yes, Delete It"})})]})}function Bg({type:e,id:t}){const[r,n]=v.useState(""),[i,a]=v.useState(!1),[o,u]=v.useState(),[l,s]=v.useState([]),{isPending:c,isError:f,data:d,error:h}=Ki({queryKey:["aliases",{type:e,id:t}],queryFn:({queryKey:y})=>{const x=y[1];return bg(x.type,x.id)}});if(v.useEffect(()=>{d&&s(d)},[d]),f)return I.jsxs("p",{className:"error",children:["Error: ",h.message]});if(c)return I.jsx("p",{children:"Loading..."});const p=y=>{u(void 0),a(!0),mg(e,t,y).then(x=>{x.ok?window.location.reload():x.json().then(w=>u(w.error))}),a(!1)},g=()=>{if(u(void 0),r===""){u("no input");return}a(!0),gg(e,t,r).then(y=>{y.ok?s([...l,{alias:r,source:"Manual",is_primary:!1,id:t}]):y.json().then(x=>u(x.error))}),a(!1)},m=y=>{u(void 0),a(!0),yg(e,t,y).then(x=>{x.ok?s(l.filter(w=>w.alias!=y)):x.json().then(w=>u(w.error))}),a(!1)};return I.jsxs("div",{className:"w-full",children:[I.jsx("h3",{children:"Alias Manager"}),I.jsxs("div",{className:"flex flex-col gap-4",children:[l.map(y=>I.jsxs("div",{className:"flex gap-2",children:[I.jsxs("div",{className:"bg p-3 rounded-md flex-grow",children:[y.alias," (source: ",y.source,")"]},y.alias),I.jsx(rt,{loading:i,onClick:()=>p(y.alias),disabled:y.is_primary,children:"Set Primary"}),I.jsx(rt,{loading:i,onClick:()=>m(y.alias),confirm:!0,disabled:y.is_primary,children:I.jsx(Ou,{size:16})})]})),I.jsxs("div",{className:"flex gap-2 w-3/5",children:[I.jsx("input",{type:"text",placeholder:"Add a new alias",className:"mx-auto fg bg rounded-md p-3 flex-grow",value:r,onChange:y=>n(y.target.value)}),I.jsx(rt,{loading:i,onClick:g,children:"Submit"})]}),o&&I.jsx("p",{className:"error",children:o})]})]})}function Ug({id:e}){const[t,r]=v.useState(""),[n,i]=v.useState(!1),[a,o]=v.useState(""),{isPending:u,isError:l,data:s,error:c}=Ki({queryKey:["get-album",{id:e}],queryFn:({queryKey:d})=>{const h=d[1];return xg(h.id)}});if(v.useEffect(()=>{s&&i(s.is_various_artists)},[s]),l)return I.jsxs("p",{className:"error",children:["Error: ",c.message]});if(u)return I.jsx("p",{children:"Loading..."});const f=d=>{r(""),o(""),fetch(`/apis/web/v1/album?id=${e}&is_various_artists=${d}`,{method:"PATCH"}).then(h=>{h.ok?o("Successfully updated album"):h.json().then(p=>r(p.error))})};return I.jsxs("div",{className:"w-full",children:[I.jsx("h3",{children:"Mark as Various Artists"}),I.jsxs("div",{className:"flex flex-col gap-4",children:[I.jsxs("select",{name:"mark-various-artists",id:"mark-various-artists",className:"w-30 px-3 py-2 rounded-md",value:n.toString(),onChange:d=>{const h=d.target.value==="true";i(h),f(h)},children:[I.jsx("option",{value:"true",children:"True"}),I.jsx("option",{value:"false",children:"False"})]}),t&&I.jsx("p",{className:"error",children:t}),a&&I.jsx("p",{className:"success",children:a})]})]})}function Kg({type:e,id:t}){const[r,n]=v.useState(),[i,a]=v.useState(""),[o,u]=v.useState(!1),[l,s]=v.useState(),[c,f]=v.useState(""),d=()=>{if(n(void 0),i===""){n("no input");return}u(!0),wg(e,t,i).then(h=>{h.ok?f("successfully updated MusicBrainz ID"):h.json().then(p=>n(p.error))}),u(!1)};return I.jsxs("div",{className:"w-full",children:[I.jsx("h3",{children:"Update MusicBrainz ID"}),I.jsxs("div",{className:"flex gap-2 w-3/5",children:[I.jsx("input",{type:"text",placeholder:"Update MusicBrainz ID",className:"mx-auto fg bg rounded-md p-3 flex-grow",value:i,onChange:h=>a(h.target.value)}),I.jsx(rt,{loading:o,onClick:d,children:"Submit"})]}),r&&I.jsx("p",{className:"error",children:r}),c&&I.jsx("p",{className:"success",children:c})]})}function Dn(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Z.apply(null,arguments)}var Ma={exports:{}},ka,as;function qg(){if(as)return ka;as=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ka=e,ka}var Ta,os;function Wg(){if(os)return Ta;os=1;var e=qg();function t(){}function r(){}return r.resetWarningCache=t,Ta=function(){function n(o,u,l,s,c,f){if(f!==e){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}n.isRequired=n;function i(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:t};return a.PropTypes=a,a},Ta}var us;function Hg(){return us||(us=1,Ma.exports=Wg()()),Ma.exports}var Vg=Hg();const j=Cr(Vg);var Da={exports:{}},V={};/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ls;function Yg(){if(ls)return V;ls=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),u=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),p;p=Symbol.for("react.module.reference");function g(m){if(typeof m=="object"&&m!==null){var y=m.$$typeof;switch(y){case e:switch(m=m.type,m){case r:case i:case n:case s:case c:return m;default:switch(m=m&&m.$$typeof,m){case u:case o:case l:case d:case f:case a:return m;default:return y}}case t:return y}}}return V.ContextConsumer=o,V.ContextProvider=a,V.Element=e,V.ForwardRef=l,V.Fragment=r,V.Lazy=d,V.Memo=f,V.Portal=t,V.Profiler=i,V.StrictMode=n,V.Suspense=s,V.SuspenseList=c,V.isAsyncMode=function(){return!1},V.isConcurrentMode=function(){return!1},V.isContextConsumer=function(m){return g(m)===o},V.isContextProvider=function(m){return g(m)===a},V.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===e},V.isForwardRef=function(m){return g(m)===l},V.isFragment=function(m){return g(m)===r},V.isLazy=function(m){return g(m)===d},V.isMemo=function(m){return g(m)===f},V.isPortal=function(m){return g(m)===t},V.isProfiler=function(m){return g(m)===i},V.isStrictMode=function(m){return g(m)===n},V.isSuspense=function(m){return g(m)===s},V.isSuspenseList=function(m){return g(m)===c},V.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===r||m===i||m===n||m===s||m===c||m===h||typeof m=="object"&&m!==null&&(m.$$typeof===d||m.$$typeof===f||m.$$typeof===a||m.$$typeof===o||m.$$typeof===l||m.$$typeof===p||m.getModuleId!==void 0)},V.typeOf=g,V}var ss;function Gg(){return ss||(ss=1,Da.exports=Yg()),Da.exports}Gg();const cs=e=>typeof e=="object"&&e!=null&&e.nodeType===1,fs=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",jn=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const r=getComputedStyle(e,null);return fs(r.overflowY,t)||fs(r.overflowX,t)||(n=>{const i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!i&&(i.clientHeight<n.scrollHeight||i.clientWidth<n.scrollWidth)})(e)}return!1},Nn=(e,t,r,n,i,a,o,u)=>a<e&&o>t||a>e&&o<t?0:a<=e&&u<=r||o>=t&&u>=r?a-e-n:o>t&&u<r||a<e&&u>r?o-t+i:0,Xg=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},Zg=(e,t)=>{var r,n,i,a;if(typeof document>"u")return[];const{inline:o,boundary:u,skipOverflowHiddenElements:l}=t,s=typeof u=="function"?u:K=>K!==u;if(!cs(e))throw new TypeError("Invalid target");const c=document.scrollingElement||document.documentElement,f=[];let d=e;for(;cs(d)&&s(d);){if(d=Xg(d),d===c){f.push(d);break}d!=null&&d===document.body&&jn(d)&&!jn(document.documentElement)||d!=null&&jn(d,l)&&f.push(d)}const h=(n=(r=window.visualViewport)==null?void 0:r.width)!=null?n:innerWidth,p=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,{scrollX:g,scrollY:m}=window,{height:y,width:x,top:w,right:S,bottom:b,left:P}=e.getBoundingClientRect(),{top:E,right:k,left:D}=(K=>{const $=window.getComputedStyle(K);return{top:parseFloat($.scrollMarginTop)||0,right:parseFloat($.scrollMarginRight)||0,bottom:parseFloat($.scrollMarginBottom)||0,left:parseFloat($.scrollMarginLeft)||0}})(e);let z=w-E,O=o==="center"?P+x/2-D+k:o==="end"?S+k:P-D;const M=[];for(let K=0;K<f.length;K++){const $=f[K],{height:ae,width:ge,top:Te,right:Oe,bottom:he,left:Qe}=$.getBoundingClientRect();if(w>=0&&P>=0&&b<=p&&S<=h&&($===c&&!jn($)||w>=Te&&b<=he&&P>=Qe&&S<=Oe))return M;const Je=getComputedStyle($),et=parseInt(Je.borderLeftWidth,10),ut=parseInt(Je.borderTopWidth,10),B=parseInt(Je.borderRightWidth,10),L=parseInt(Je.borderBottomWidth,10);let N=0,U=0;const ye="offsetWidth"in $?$.offsetWidth-$.clientWidth-et-B:0,A="offsetHeight"in $?$.offsetHeight-$.clientHeight-ut-L:0,R="offsetWidth"in $?$.offsetWidth===0?0:ge/$.offsetWidth:0,F="offsetHeight"in $?$.offsetHeight===0?0:ae/$.offsetHeight:0;if(c===$)N=Nn(m,m+p,p,ut,L,m+z,m+z+y,y),U=o==="start"?O:o==="center"?O-h/2:o==="end"?O-h:Nn(g,g+h,h,et,B,g+O,g+O+x,x),N=Math.max(0,N+m),U=Math.max(0,U+g);else{N=Nn(Te,he,ae,ut,L+A,z,z+y,y),U=o==="start"?O-Qe-et:o==="center"?O-(Qe+ge/2)+ye/2:o==="end"?O-Oe+B+ye:Nn(Qe,Oe,ge,et,B+ye,O,O+x,x);const{scrollLeft:_,scrollTop:X}=$;N=F===0?0:Math.max(0,Math.min(X+N/F,$.scrollHeight-ae/F+A)),U=R===0?0:Math.max(0,Math.min(_+U/R,$.scrollWidth-ge/R+ye)),z+=X-N,O+=_-U}M.push({el:$,top:N,left:U})}return M};var Qg=0;function Jg(){return String(Qg++)}function Pd(e){var t=v.useRef(e);return t.current=e,t}function Cd(e,t){var r;function n(){r&&clearTimeout(r)}function i(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];n(),r=setTimeout(function(){r=null,e.apply(void 0,o)},t)}return i.cancel=n,i}var ey=Cd(function(e){Ad(e).textContent=""},500);function Ad(e){var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function ty(e,t){if(!(!e||!t)){var r=Ad(t);r.textContent=e,ey(t)}}function ry(e){var t=e==null?void 0:e.getElementById("a11y-status-message");t&&t.remove()}function _d(){}function zo(e,t){if(!t)return e;var r=Object.keys(e);return r.reduce(function(n,i){return t[i]!==void 0&&(n[i]=t[i]),n},Z({},e))}function ny(e,t){if(e){var r=Zg(e,{boundary:t});r.forEach(function(n){var i=n.el,a=n.top,o=n.left;i.scrollTop=a,i.scrollLeft=o})}}function ds(e,t,r){var n=e===t||t instanceof r.Node&&e.contains&&e.contains(t);return n}function st(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return t.some(function(u){return u&&u.apply(void 0,[n].concat(a)),n.preventDownshiftDefault||n.hasOwnProperty("nativeEvent")&&n.nativeEvent.preventDownshiftDefault})}}function $n(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){t.forEach(function(i){typeof i=="function"?i(n):i&&(i.current=n)})}}function iy(e,t){return e[t]!==void 0}function ay(e){var t=e.key,r=e.keyCode;return r>=37&&r<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function Rn(e,t,r,n,i){var a=r.length;if(a===0)return-1;var o=a-1;(typeof e!="number"||e<0||e>o)&&(e=t>0?-1:o+1);var u=e+t;u<0?u=o:u>o&&(u=0);var l=ti(u,t<0,r,n,i);return l===-1?e>=a?-1:e:l}function ti(e,t,r,n,i){i===void 0&&(i=!1);var a=r.length;if(t){for(var o=e;o>=0;o--)if(!n(r[o],o))return o}else for(var u=e;u<a;u++)if(!n(r[u],u))return u;return i?ti(t?a-1:0,t,r,n):-1}function hs(e,t,r,n){return n===void 0&&(n=!0),r&&t.some(function(i){return i&&(ds(i,e,r)||n&&ds(i,r.document.activeElement,r))})}function Eu(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function oy(e,t,r,n){for(var i=e.type,a={},o=Object.keys(r),u=0,l=o;u<l.length;u++){var s=l[u];uy(s,e,t,r,n),n[s]!==r[s]&&(a[s]=n[s])}t.onStateChange&&Object.keys(a).length&&t.onStateChange(Z({type:i},a))}function uy(e,t,r,n,i){if(i[e]!==n[e]){var a="on"+Eu(e)+"Change",o=r[a];if(typeof o=="function"){var u=t.type;o(Z({type:u},i))}}}function ly(e,t,r,n){var i=v.useRef(null),a=v.useRef(void 0),o=Pd(t),u=v.useCallback(function(d,h){a.current=h,d=zo(d,o.current);var p=e(d,o.current,h),g=o.current.stateReducer(d,Z({},h,{changes:p}));return Z({},d,g)},[o,e]),l=v.useReducer(u,t,r),s=l[0],c=l[1],f=a.current;return v.useEffect(function(){var d,h=zo((d=i.current)!=null?d:{},o.current),p=f&&i.current&&!n(h,s);p&&oy(f,o.current,h,s),i.current=s},[s,f,n,o]),[s,c]}function sy(e,t,r,n){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){var i=r.indexOf(e);if(i<0)throw new Error(n);return[e,r.indexOf(e)]}if(t!==void 0){var a=r[t];if(a===void 0)throw new Error(n);return[a,t]}throw new Error(n)}function Mu(){var e=v.useRef(!0);return v.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function cy(e,t){return t.changes}var fy={environment:j.shape({addEventListener:j.func.isRequired,removeEventListener:j.func.isRequired,document:j.shape({createElement:j.func.isRequired,getElementById:j.func.isRequired,activeElement:j.any.isRequired,body:j.any.isRequired}).isRequired,Node:j.func.isRequired}),itemToKey:j.func,stateReducer:j.func};function Tt(e,t,r){var n=e["default"+Eu(t)];return n!==void 0?n:r[t]}function Kr(e,t,r){var n=e[t];if(n!==void 0)return n;var i=e["initial"+Eu(t)];return i!==void 0?i:Tt(e,t,r)}var vs=Cd(function(e,t){ty(e,t)},200);function dy(e,t,r,n){var i=n==null?void 0:n.document,a=Mu();v.useEffect(function(){if(!(!e||a||!i)){var o=e(t);vs(o,i)}},r),v.useEffect(function(){return function(){vs.cancel(),ry(i)}},[i])}var qr=Z({},fy,{getA11yStatusMessage:j.func,highlightedIndex:j.number,defaultHighlightedIndex:j.number,initialHighlightedIndex:j.number,isOpen:j.bool,defaultIsOpen:j.bool,initialIsOpen:j.bool,selectedItem:j.any,initialSelectedItem:j.any,defaultSelectedItem:j.any,id:j.string,labelId:j.string,menuId:j.string,getItemId:j.func,toggleButtonId:j.string,onSelectedItemChange:j.func,onHighlightedIndexChange:j.func,onStateChange:j.func,onIsOpenChange:j.func,scrollIntoView:j.func}),Wr={itemToString:function(t){return t?String(t):""},itemToKey:function(t){return t},stateReducer:cy,scrollIntoView:ny,environment:typeof window>"u"?void 0:window},Be={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""},hy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?v.useLayoutEffect:v.useEffect;function vy(e){var t=Kr(e,"selectedItem",Be),r=Kr(e,"isOpen",Be),n=by(e),i=Kr(e,"inputValue",Be);return{highlightedIndex:n<0&&t&&r?e.items.findIndex(function(a){return e.itemToKey(a)===e.itemToKey(t)}):n,isOpen:r,selectedItem:t,inputValue:i}}function Hr(e,t,r){var n=e.items,i=e.initialHighlightedIndex,a=e.defaultHighlightedIndex,o=e.isItemDisabled,u=e.itemToKey,l=t.selectedItem,s=t.highlightedIndex;return n.length===0?-1:i!==void 0&&s===i&&!o(n[i],i)?i:a!==void 0&&!o(n[a],a)?a:l?n.findIndex(function(c){return u(l)===u(c)}):r<0&&!o(n[n.length-1],n.length-1)?n.length-1:r>0&&!o(n[0],0)?0:-1}function py(e,t,r){var n=v.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),i=v.useCallback(function(){return r.map(function(a){return a.current})},[r]);return v.useEffect(function(){if(!e)return _d;function a(){n.current.isTouchEnd=!1,n.current.isMouseDown=!0}function o(c){n.current.isMouseDown=!1,hs(c.target,i(),e)||t()}function u(){n.current.isTouchEnd=!1,n.current.isTouchMove=!1}function l(){n.current.isTouchMove=!0}function s(c){n.current.isTouchEnd=!0,!n.current.isTouchMove&&!hs(c.target,i(),e,!1)&&t()}return e.addEventListener("mousedown",a),e.addEventListener("mouseup",o),e.addEventListener("touchstart",u),e.addEventListener("touchmove",l),e.addEventListener("touchend",s),function(){e.removeEventListener("mousedown",a),e.removeEventListener("mouseup",o),e.removeEventListener("touchstart",u),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",s)}},[e,i,t]),n.current}var my=function(){return _d};function gy(e){var t=e.highlightedIndex,r=e.isOpen,n=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,u=v.useRef(!0);return hy(function(){t<0||!r||!Object.keys(n.current).length||(u.current===!1?u.current=!0:o(i(t),a))},[t]),u}function ps(e,t,r){var n;r===void 0&&(r=!0);var i=((n=e.items)==null?void 0:n.length)&&t>=0;return Z({isOpen:!1,highlightedIndex:-1},i&&Z({selectedItem:e.items[t],isOpen:Tt(e,"isOpen",Be),highlightedIndex:Tt(e,"highlightedIndex",Be)},r&&{inputValue:e.itemToString(e.items[t])}))}function yy(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function Fo(e){var t=Tt(e,"highlightedIndex",Be);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function by(e){var t=Kr(e,"highlightedIndex",Be);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function xy(e,t,r,n){var i=r.type,a;switch(i){case n.ItemMouseMove:a={highlightedIndex:r.disabled?-1:r.index};break;case n.MenuMouseLeave:a={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Hr(t,e,0)};break;case n.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:Hr(t,e,0)};break;case n.FunctionCloseMenu:a={isOpen:!1};break;case n.FunctionSetHighlightedIndex:a={highlightedIndex:t.isItemDisabled(t.items[r.highlightedIndex],r.highlightedIndex)?-1:r.highlightedIndex};break;case n.FunctionSetInputValue:a={inputValue:r.inputValue};break;case n.FunctionReset:a={highlightedIndex:Fo(t),isOpen:Tt(t,"isOpen",Be),selectedItem:Tt(t,"selectedItem",Be),inputValue:Tt(t,"inputValue",Be)};break;default:throw new Error("Reducer called without proper action type.")}return Z({},e,a)}Z({},qr,{items:j.array.isRequired,isItemDisabled:j.func});Z({},Wr,{isItemDisabled:function(){return!1}});var Od=v.useId,wy=typeof Od=="function"?Sy:Iy;function Sy(e){var t=e.id,r=e.labelId,n=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,u="downshift-"+Od();t||(t=u);var l=v.useMemo(function(){return{labelId:r??t+"-label",menuId:n??t+"-menu",getItemId:i??function(s){return t+"-item-"+s},toggleButtonId:a??t+"-toggle-button",inputId:o??t+"-input"}},[i,t,o,r,n,a]);return l}function Iy(e){var t=e.id,r=e.labelId,n=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,u=v.useRef(t??"downshift-"+Jg()),l=u.current,s=v.useMemo(function(){return{labelId:r??l+"-label",menuId:n??l+"-menu",getItemId:i??function(c){return l+"-item-"+c},toggleButtonId:a??l+"-toggle-button",inputId:o??l+"-input"}},[i,o,r,n,a,l]);return s}var ku=0,Tu=1,Du=2,ju=3,Nu=4,$u=5,Ru=6,Lu=7,zu=8,ri=9,Fu=10,Ed=11,Md=12,Bu=13,kd=14,Td=15,Dd=16,jd=17,Nd=18,Uu=19,$d=20,Rd=21,Ku=22,Ld=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:Ku,FunctionCloseMenu:jd,FunctionOpenMenu:Dd,FunctionReset:Rd,FunctionSelectItem:Uu,FunctionSetHighlightedIndex:Nd,FunctionSetInputValue:$d,FunctionToggleMenu:Td,InputBlur:ri,InputChange:zu,InputClick:Fu,InputKeyDownArrowDown:ku,InputKeyDownArrowUp:Tu,InputKeyDownEnd:Nu,InputKeyDownEnter:Lu,InputKeyDownEscape:Du,InputKeyDownHome:ju,InputKeyDownPageDown:Ru,InputKeyDownPageUp:$u,ItemClick:Bu,ItemMouseMove:Md,MenuMouseLeave:Ed,ToggleButtonClick:kd});function Py(e){var t=vy(e),r=t.selectedItem,n=t.inputValue;return n===""&&r&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(n=e.itemToString(r)),Z({},t,{inputValue:n})}Z({},qr,{items:j.array.isRequired,isItemDisabled:j.func,inputValue:j.string,defaultInputValue:j.string,initialInputValue:j.string,inputId:j.string,onInputValueChange:j.func});function Cy(e,t,r,n){var i=v.useRef(),a=ly(e,t,r,n),o=a[0],u=a[1],l=Mu();return v.useEffect(function(){if(iy(t,"selectedItem")){if(!l){var s=t.itemToKey(t.selectedItem)!==t.itemToKey(i.current);s&&u({type:Ku,inputValue:t.itemToString(t.selectedItem)})}i.current=o.selectedItem===i.current?t.selectedItem:o.selectedItem}},[o.selectedItem,t.selectedItem]),[zo(o,t),u]}var Ay=Z({},Wr,{isItemDisabled:function(){return!1}});function _y(e,t,r){var n,i=r.type,a=r.altKey,o;switch(i){case Bu:o={isOpen:Tt(t,"isOpen",Be),highlightedIndex:Fo(t),selectedItem:t.items[r.index],inputValue:t.itemToString(t.items[r.index])};break;case ku:e.isOpen?o={highlightedIndex:Rn(e.highlightedIndex,1,t.items,t.isItemDisabled,!0)}:o={highlightedIndex:a&&e.selectedItem==null?-1:Hr(t,e,1),isOpen:t.items.length>=0};break;case Tu:e.isOpen?a?o=ps(t,e.highlightedIndex):o={highlightedIndex:Rn(e.highlightedIndex,-1,t.items,t.isItemDisabled,!0)}:o={highlightedIndex:Hr(t,e,-1),isOpen:t.items.length>=0};break;case Lu:o=ps(t,e.highlightedIndex);break;case Du:o=Z({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case $u:o={highlightedIndex:Rn(e.highlightedIndex,-10,t.items,t.isItemDisabled,!0)};break;case Ru:o={highlightedIndex:Rn(e.highlightedIndex,10,t.items,t.isItemDisabled,!0)};break;case ju:o={highlightedIndex:ti(0,!1,t.items,t.isItemDisabled)};break;case Nu:o={highlightedIndex:ti(t.items.length-1,!0,t.items,t.isItemDisabled)};break;case ri:o=Z({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((n=t.items)==null?void 0:n.length)&&r.selectItem&&{selectedItem:t.items[e.highlightedIndex],inputValue:t.itemToString(t.items[e.highlightedIndex])});break;case zu:o={isOpen:!0,highlightedIndex:Fo(t),inputValue:r.inputValue};break;case Fu:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Hr(t,e,0)};break;case Uu:o={selectedItem:r.selectedItem,inputValue:t.itemToString(r.selectedItem)};break;case Ku:o={inputValue:r.inputValue};break;default:return xy(e,t,r,Ld)}return Z({},e,o)}var Oy=["onMouseLeave","refKey","ref"],Ey=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],My=["onClick","onPress","refKey","ref"],ky=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];zd.stateChangeTypes=Ld;function zd(e){e===void 0&&(e={});var t=Z({},Ay,e),r=t.items,n=t.scrollIntoView,i=t.environment,a=t.getA11yStatusMessage,o=Cy(_y,t,Py,yy),u=o[0],l=o[1],s=u.isOpen,c=u.highlightedIndex,f=u.selectedItem,d=u.inputValue,h=v.useRef(null),p=v.useRef({}),g=v.useRef(null),m=v.useRef(null),y=Mu(),x=wy(t),w=v.useRef(),S=Pd({state:u,props:t}),b=v.useCallback(function(B){return p.current[x.getItemId(B)]},[x]);dy(a,u,[s,c,f,d],i);var P=gy({menuElement:h.current,highlightedIndex:c,isOpen:s,itemRefs:p,scrollIntoView:n,getItemNodeFromIndex:b});v.useEffect(function(){var B=Kr(t,"isOpen",Be);B&&g.current&&g.current.focus()},[]),v.useEffect(function(){y||(w.current=r.length)});var E=v.useCallback(function(){S.current.state.isOpen&&l({type:ri})},[l,S]),k=v.useMemo(function(){return[h,m,g]},[]),D=py(i,E,k),z=my();v.useEffect(function(){s||(p.current={})},[s]),v.useEffect(function(){var B;!s||!(i!=null&&i.document)||!(g!=null&&(B=g.current)!=null&&B.focus)||i.document.activeElement!==g.current&&g.current.focus()},[s,i]);var O=v.useMemo(function(){return{ArrowDown:function(L){L.preventDefault(),l({type:ku,altKey:L.altKey})},ArrowUp:function(L){L.preventDefault(),l({type:Tu,altKey:L.altKey})},Home:function(L){S.current.state.isOpen&&(L.preventDefault(),l({type:ju}))},End:function(L){S.current.state.isOpen&&(L.preventDefault(),l({type:Nu}))},Escape:function(L){var N=S.current.state;(N.isOpen||N.inputValue||N.selectedItem||N.highlightedIndex>-1)&&(L.preventDefault(),l({type:Du}))},Enter:function(L){var N=S.current.state;!N.isOpen||L.which===229||(L.preventDefault(),l({type:Lu}))},PageUp:function(L){S.current.state.isOpen&&(L.preventDefault(),l({type:$u}))},PageDown:function(L){S.current.state.isOpen&&(L.preventDefault(),l({type:Ru}))}}},[l,S]),M=v.useCallback(function(B){return Z({id:x.labelId,htmlFor:x.inputId},B)},[x]),K=v.useCallback(function(B,L){var N,U=B===void 0?{}:B,ye=U.onMouseLeave,A=U.refKey,R=A===void 0?"ref":A,F=U.ref,_=Dn(U,Oy),X=L===void 0?{}:L;return X.suppressRefError,Z((N={},N[R]=$n(F,function(q){h.current=q}),N.id=x.menuId,N.role="listbox",N["aria-labelledby"]=_&&_["aria-label"]?void 0:""+x.labelId,N.onMouseLeave=st(ye,function(){l({type:Ed})}),N),_)},[l,z,x]),$=v.useCallback(function(B){var L,N,U=B===void 0?{}:B,ye=U.item,A=U.index,R=U.refKey,F=R===void 0?"ref":R,_=U.ref,X=U.onMouseMove,q=U.onMouseDown,be=U.onClick;U.onPress;var oe=U.disabled,We=Dn(U,Ey);oe!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var Le=S.current,Mn=Le.props,kn=Le.state,Tn=sy(ye,A,Mn.items,"Pass either item or index to getItemProps!"),Oa=Tn[0],lt=Tn[1],lr=Mn.isItemDisabled(Oa,lt),_t="onClick",Ft=be,Ot=function(){D.isTouchEnd||lt===kn.highlightedIndex||(P.current=!1,l({type:Md,index:lt,disabled:lr}))},Bt=function(){l({type:Bu,index:lt})},lg=function(sg){return sg.preventDefault()};return Z((L={},L[F]=$n(_,function(jr){jr&&(p.current[x.getItemId(lt)]=jr)}),L["aria-disabled"]=lr,L["aria-selected"]=lt===kn.highlightedIndex,L.id=x.getItemId(lt),L.role="option",L),!lr&&(N={},N[_t]=st(Ft,Bt),N),{onMouseMove:st(X,Ot),onMouseDown:st(q,lg)},We)},[l,x,S,D,P]),ae=v.useCallback(function(B){var L,N=B===void 0?{}:B,U=N.onClick;N.onPress;var ye=N.refKey,A=ye===void 0?"ref":ye,R=N.ref,F=Dn(N,My),_=S.current.state,X=function(){l({type:kd})};return Z((L={},L[A]=$n(R,function(q){m.current=q}),L["aria-controls"]=x.menuId,L["aria-expanded"]=_.isOpen,L.id=x.toggleButtonId,L.tabIndex=-1,L),!F.disabled&&Z({},{onClick:st(U,X)}),F)},[l,S,x]),ge=v.useCallback(function(B,L){var N,U=B===void 0?{}:B,ye=U.onKeyDown,A=U.onChange,R=U.onInput,F=U.onBlur;U.onChangeText;var _=U.onClick,X=U.refKey,q=X===void 0?"ref":X,be=U.ref,oe=Dn(U,ky),We=L===void 0?{}:L;We.suppressRefError;var Le=S.current.state,Mn=function(Ot){var Bt=ay(Ot);Bt&&O[Bt]&&O[Bt](Ot)},kn=function(Ot){l({type:zu,inputValue:Ot.target.value})},Tn=function(Ot){if(i!=null&&i.document&&Le.isOpen&&!D.isMouseDown){var Bt=Ot.relatedTarget===null&&i.document.activeElement!==i.document.body;l({type:ri,selectItem:!Bt})}},Oa=function(){l({type:Fu})},lt="onChange",lr={};if(!oe.disabled){var _t;lr=(_t={},_t[lt]=st(A,R,kn),_t.onKeyDown=st(ye,Mn),_t.onBlur=st(F,Tn),_t.onClick=st(_,Oa),_t)}return Z((N={},N[q]=$n(be,function(Ft){g.current=Ft}),N["aria-activedescendant"]=Le.isOpen&&Le.highlightedIndex>-1?x.getItemId(Le.highlightedIndex):"",N["aria-autocomplete"]="list",N["aria-controls"]=x.menuId,N["aria-expanded"]=Le.isOpen,N["aria-labelledby"]=oe&&oe["aria-label"]?void 0:x.labelId,N.autoComplete="off",N.id=x.inputId,N.role="combobox",N.value=Le.inputValue,N),lr,oe)},[l,x,i,O,S,D,z]),Te=v.useCallback(function(){l({type:Td})},[l]),Oe=v.useCallback(function(){l({type:jd})},[l]),he=v.useCallback(function(){l({type:Dd})},[l]),Qe=v.useCallback(function(B){l({type:Nd,highlightedIndex:B})},[l]),Je=v.useCallback(function(B){l({type:Uu,selectedItem:B})},[l]),et=v.useCallback(function(B){l({type:$d,inputValue:B})},[l]),ut=v.useCallback(function(){l({type:Rd})},[l]);return{getItemProps:$,getLabelProps:M,getMenuProps:K,getInputProps:ge,getToggleButtonProps:ae,toggleMenu:Te,openMenu:he,closeMenu:Oe,setHighlightedIndex:Qe,setInputValue:et,selectItem:Je,reset:ut,highlightedIndex:c,isOpen:s,selectedItem:f,inputValue:d}}qr.stateReducer,qr.itemToKey,qr.environment,j.array,j.array,j.array,j.func,j.number,j.number,j.number,j.func,j.func,j.string,j.string;Wr.itemToKey,Wr.stateReducer,Wr.environment;j.func;function Ty({onSelection:e,filterFunction:t}){const[r,n]=v.useState(""),i=v.useDeferredValue(r),[a,o]=v.useState([]);v.useEffect(()=>{i&&Id(i).then(d=>{const h=t(d);o([...h.artists,...h.albums,...h.tracks])})},[i]);const{isOpen:u,getMenuProps:l,getInputProps:s,getItemProps:c,selectedItem:f}=zd({items:a,itemToString(d){return d?d.title||d.name:""},onInputValueChange:({inputValue:d})=>{n(d)},onSelectedItemChange:({selectedItem:d})=>{d&&(n(d.name),e(f))}});return I.jsxs("div",{className:"flex-grow",children:[I.jsx("input",{...s(),value:r,placeholder:"Add an artist",className:"mx-auto fg bg rounded-md p-3 w-full"}),I.jsx("ul",{...l(),className:`bg rounded-b-md p-3 absolute ${!(u&&a.length)&&"hidden"}`,children:u&&a&&a.map((d,h)=>I.jsx("li",{className:"fg py-2 px-3 rounded-md shadow-sm cursor-pointer hover:bg-(--color-bg-tertiary)",...c({item:d,index:h}),children:d.title||d.name},d.id))})]})}function Dy({type:e,id:t}){const[r,n]=v.useState(!1),[i,a]=v.useState(),[o,u]=v.useState([]),[l,s]=v.useState(),c=Ag(),{isPending:f,isError:d,data:h,error:p}=Ki({queryKey:["get-artists-"+e.toLowerCase(),{id:t}],queryFn:()=>fetch("/apis/web/v1/artists?"+e.toLowerCase()+"_id="+t).then(w=>w.json())}),g=v.useCallback(w=>{s(w)},[e,t]);if(v.useEffect(()=>{h&&u(h)},[h]),d)return I.jsxs("p",{className:"error",children:["Error: ",p.message]});if(f)return I.jsx("p",{children:"Loading..."});const m=(w,S)=>{a(void 0),n(!0),fetch(`/apis/web/v1/artists/primary?artist_id=${w.id}&${e.toLowerCase()}_id=${t}&is_primary=${S}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(async b=>{b.ok?await c.invalidateQueries({queryKey:["get-artists-"+e.toLowerCase(),{id:t}]}):b.json().then(P=>a(P.error))}),n(!1)},y=()=>{if(a(void 0),!l){a("no artist selected");return}const w=new URLSearchParams;w.append("add_artist",String(l.id)),n(!0),fetch(`/apis/web/v1/${e}?id=${t}`,{method:"PATCH",body:w}).then(async S=>{S.ok?await c.invalidateQueries({queryKey:["get-artists-"+e.toLowerCase(),{id:t}]}):S.json().then(b=>a(b.error))}),n(!1)},x=w=>{a(void 0),n(!0);const S=new URLSearchParams;S.append("remove_artist",String(w)),fetch(`/apis/web/v1/${e}?id=${t}`,{method:"PATCH",body:S}).then(async b=>{b.ok?await c.invalidateQueries({queryKey:["get-artists-"+e.toLowerCase(),{id:t}]}):b.json().then(P=>a(P.error))}),n(!1)};return I.jsxs("div",{className:"w-full",children:[I.jsx("h3",{children:"Artist Manager"}),I.jsxs("div",{className:"flex flex-col gap-4",children:[o.map(w=>I.jsxs("div",{className:"flex gap-2",children:[I.jsx("div",{className:"bg p-3 rounded-md flex-grow",children:w.name},w.name),I.jsx(rt,{loading:r,onClick:()=>m(w,!0),disabled:w.is_primary,children:"Set Primary"}),e=="track"&&I.jsx(rt,{loading:r,onClick:()=>x(w.id),confirm:!0,disabled:w.is_primary,children:I.jsx(Ou,{size:16})})]})),e=="track"&&I.jsxs("div",{className:"flex gap-2 w-3/5",children:[I.jsx(Ty,{onSelection:g,filterFunction:w=>{w.albums=[],w.tracks=[];const S=o.map(b=>b.id);return w.artists=w.artists.filter(b=>!S.includes(b.id)),w}}),I.jsx(rt,{loading:r,onClick:y,children:"Submit"})]}),i&&I.jsx("p",{className:"error",children:i})]})]})}function jy({open:e,setOpen:t,type:r,id:n}){r=r.toLowerCase();const i=()=>{t(!1)};return I.jsx(cn,{maxW:1e3,isOpen:e,onClose:i,children:I.jsxs("div",{className:"flex flex-col items-start gap-6 w-full",children:[I.jsx(Bg,{id:n,type:r}),r==="album"&&I.jsx(I.Fragment,{children:I.jsx(Ug,{id:n})}),r!=="artist"&&I.jsx(Dy,{id:n,type:r}),I.jsx(Kg,{type:r,id:n})]})})}function Ny({open:e,setOpen:t,trackid:r}){const[n,i]=v.useState(new Date),[a,o]=v.useState(!1),[u,l]=v.useState(""),s=Au(),c=()=>{t(!1)},f=()=>{o(!0),Sg(r.toString(),n).then(h=>{h.ok?(o(!1),s(0)):(h.json().then(p=>l(p.error)),o(!1))})},d=h=>{const p=g=>g.toString().padStart(2,"0");return`${h.getFullYear()}-${p(h.getMonth()+1)}-${p(h.getDate())}T${p(h.getHours())}:${p(h.getMinutes())}`};return I.jsxs(cn,{isOpen:e,onClose:c,children:[I.jsx("h3",{children:"Add Listen"}),I.jsxs("div",{className:"flex flex-col items-center gap-4",children:[I.jsx("input",{type:"datetime-local",className:"w-full mx-auto fg bg rounded p-2",value:d(n),onChange:h=>i(new Date(h.target.value))}),I.jsx(rt,{loading:a,onClick:f,children:"Submit"}),I.jsx("p",{className:"error",children:u})]})]})}function $y({size:e,hover:t}){let r="";return t&&(r+="icon-hover-fill"),I.jsx("div",{className:r,children:I.jsx("svg",{width:`${e}px`,height:`${e}px`,viewBox:"0 0 24 24",fill:"var(--color-fg)",xmlns:"http://www.w3.org/2000/svg",children:I.jsx("path",{d:"M11.582 0L1.418 5.832v12.336L11.582 24V10.01L7.1 12.668v3.664c.01.111.01.225 0 .336-.103.435-.54.804-1 1.111-.802.537-1.752.509-2.166-.111-.413-.62-.141-1.631.666-2.168.384-.28.863-.399 1.334-.332V6.619c0-.154.134-.252.226-.308L11.582 3zm.836 0v6.162c.574.03 1.14.16 1.668.387a2.225 2.225 0 0 0 1.656-.717 1.02 1.02 0 1 1 1.832-.803l.004.006a1.022 1.022 0 0 1-1.295 1.197c-.34.403-.792.698-1.297.85.34.263.641.576.891.928a1.04 1.04 0 0 1 .777.125c.768.486.568 1.657-.318 1.857-.886.2-1.574-.77-1.09-1.539.02-.03.042-.06.065-.09a3.598 3.598 0 0 0-1.436-1.166 4.142 4.142 0 0 0-1.457-.369v4.01c.855.06 1.256.493 1.555.834.227.256.356.39.578.402.323.018.568.008.806 0a5.44 5.44 0 0 1 .895.022c.94-.017 1.272-.226 1.605-.446a2.533 2.533 0 0 1 1.131-.463 1.027 1.027 0 0 1 .12-.263 1.04 1.04 0 0 1 .105-.137c.023-.025.047-.044.07-.066a4.775 4.775 0 0 1 0-2.405l-.012-.01a1.02 1.02 0 1 1 .692.272h-.057a4.288 4.288 0 0 0 0 1.877h.063a1.02 1.02 0 1 1-.545 1.883l-.047-.033a1 1 0 0 1-.352-.442 1.885 1.885 0 0 0-.814.354 3.03 3.03 0 0 1-.703.365c.757.555 1.772 1.6 2.199 2.299a1.03 1.03 0 0 1 .256-.033 1.02 1.02 0 1 1-.545 1.88l-.047-.03a1.017 1.017 0 0 1-.27-1.376.72.72 0 0 1 .051-.072c-.445-.775-2.026-2.28-2.46-2.387a4.037 4.037 0 0 0-1.31-.117c-.24.008-.513.018-.866 0-.515-.027-.783-.333-1.043-.629-.26-.296-.51-.56-1.055-.611V18.5a1.877 1.877 0 0 0 .426-.135.333.333 0 0 1 .058-.027c.56-.267 1.421-.91 2.096-2.447a1.02 1.02 0 0 1-.27-1.344 1.02 1.02 0 1 1 .915 1.54 6.273 6.273 0 0 1-1.432 2.136 1.785 1.785 0 0 1 .691.306.667.667 0 0 0 .37.168 3.31 3.31 0 0 0 .888-.222 1.02 1.02 0 0 1 1.787-.79v-.005a1.02 1.02 0 0 1-.773 1.683 1.022 1.022 0 0 1-.719-.287 3.935 3.935 0 0 1-1.168.287h-.05a1.313 1.313 0 0 1-.71-.275c-.262-.177-.51-.345-1.402-.12a2.098 2.098 0 0 1-.707.2V24l10.164-5.832V5.832zm4.154 4.904a.352.352 0 0 0-.197.639l.018.01c.163.1.378.053.484-.108v-.002a.352.352 0 0 0-.303-.539zm-4.99 1.928L7.082 9.5v2l4.5-2.668zm8.385.38a.352.352 0 0 0-.295.165v.002a.35.35 0 0 0 .096.473l.013.01a.357.357 0 0 0 .487-.108.352.352 0 0 0-.301-.541zM16.09 8.647a.352.352 0 0 0-.277.163.355.355 0 0 0 .296.54c.482 0 .463-.73-.02-.703zm3.877 2.477a.352.352 0 0 0-.295.164.35.35 0 0 0 .094.475l.015.01a.357.357 0 0 0 .485-.11.352.352 0 0 0-.3-.539zm-4.375 3.594a.352.352 0 0 0-.291.172.35.35 0 0 0-.04.265.352.352 0 1 0 .33-.437zm4.375.789a.352.352 0 0 0-.295.164v.002a.352.352 0 0 0 .094.473l.015.01a.357.357 0 0 0 .485-.108.352.352 0 0 0-.3-.54zm-2.803 2.488v.002a.347.347 0 0 0-.223.084.352.352 0 0 0 .23.62.347.347 0 0 0 .23-.085.348.348 0 0 0 .12-.24.353.353 0 0 0-.35-.38.347.347 0 0 0-.007 0Z"})})})}function mM(e){const[t,r]=v.useState("(--color-bg)"),[n,i]=v.useState(!1),[a,o]=v.useState(!1),[u,l]=v.useState(!1),[s,c]=v.useState(!1),[f,d]=v.useState(!1),{user:h}=Pg();v.useEffect(()=>{vg(is(e.img,"small"),{amount:1}).then(S=>{r(`rgba(${S[0]},${S[1]},${S[2]},0.4)`)})},[e.img]);const p=()=>{window.location.reload()},g=`${e.title} - Koito`;let w=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)>768?30:22;return console.log("MBZ:",e.musicbrainzId),I.jsxs("main",{className:"w-full flex flex-col flex-grow",style:{background:`linear-gradient(to bottom, ${t}, var(--color-bg) 700px)`,transition:"1000"},children:[I.jsx(Rg,{itemType:e.type.toLowerCase()==="artist"?"artist":"album",onComplete:p}),I.jsx("title",{children:g}),I.jsx("meta",{property:"og:title",content:g}),I.jsx("meta",{name:"description",content:g}),I.jsxs("div",{className:"w-19/20 mx-auto pt-12",children:[I.jsxs("div",{className:"flex gap-8 flex-wrap md:flex-nowrap relative",children:[I.jsx("div",{className:"flex flex-col justify-around",children:I.jsx("img",{style:{zIndex:5},src:is(e.img,"large"),alt:e.title,className:"md:min-w-[385px] w-[220px] h-auto shadow-(--color-shadow) shadow-lg"})}),I.jsxs("div",{className:"flex flex-col items-start",children:[I.jsx("h3",{children:e.type}),I.jsx("div",{className:"flex",children:I.jsxs("h1",{children:[e.title,I.jsxs("span",{className:"text-xl font-medium text-(--color-fg-secondary)",children:[" ",e.rank!==0&&"#"+e.rank]})]})}),e.subContent]}),I.jsxs("div",{className:"absolute left-1 sm:right-1 sm:left-auto -top-9 sm:top-1 flex gap-3 items-center",children:[e.musicbrainzId&&I.jsx(dg,{title:"View on MusicBrainz",target:"_blank",to:`https://musicbrainz.org/${e.type.toLowerCase()}/${e.musicbrainzId}`,children:I.jsx($y,{size:w,hover:!0})}),h&&I.jsxs(I.Fragment,{children:[e.type==="Track"&&I.jsxs(I.Fragment,{children:[I.jsx("button",{title:"Add Listen",className:"hover:cursor-pointer",onClick:()=>d(!0),children:I.jsx(jg,{size:w})}),I.jsx(Ny,{open:f,setOpen:d,trackid:e.id})]}),I.jsx("button",{title:"Edit Item",className:"hover:cursor-pointer",onClick:()=>c(!0),children:I.jsx($g,{size:w})}),e.type!=="Track"&&I.jsx("button",{title:"Replace Image",className:"hover:cursor-pointer",onClick:()=>l(!0),children:I.jsx(Mg,{size:w})}),I.jsx("button",{title:"Merge Items",className:"hover:cursor-pointer",onClick:()=>i(!0),children:I.jsx(Tg,{size:w})}),I.jsx("button",{title:"Delete Item",className:"hover:cursor-pointer",onClick:()=>o(!0),children:I.jsx(Ou,{size:w})}),I.jsx(jy,{open:s,setOpen:c,type:e.type.toLowerCase(),id:e.id}),I.jsx(zg,{open:u,setOpen:l,id:e.imgItemId,musicbrainzId:e.musicbrainzId,type:e.type==="Track"?"Album":e.type}),I.jsx(Lg,{currentTitle:e.title,mergeFunc:e.mergeFunc,mergeCleanerFunc:e.mergeCleanerFunc,type:e.type,currentId:e.id,open:n,setOpen:i}),I.jsx(Fg,{open:a,setOpen:o,title:e.title,id:e.id,type:e.type})]})]})]}),e.children]})]})}function Fd(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Fd(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ot(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Fd(e))&&(n&&(n+=" "),n+=t);return n}var Ry=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Bd(e){if(typeof e!="string")return!1;var t=Ry;return t.includes(e)}var Ly=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],zy=new Set(Ly);function Ud(e){return typeof e!="string"?!1:zy.has(e)}function Kd(e){return typeof e=="string"&&e.startsWith("data-")}function Zt(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Ud(r)||Kd(r))&&(t[r]=e[r]);return t}function qd(e){if(e==null)return null;if(v.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Zt(t)}return typeof e=="object"&&!Array.isArray(e)?Zt(e):null}function jt(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Ud(r)||Kd(r)||Bd(r))&&(t[r]=e[r]);return t}function Fy(e){return e==null?null:v.isValidElement(e)?jt(e.props):typeof e=="object"&&!Array.isArray(e)?jt(e):null}var By=["children","width","height","viewBox","className","style","title","desc"];function Bo(){return Bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bo.apply(null,arguments)}function Uy(e,t){if(e==null)return{};var r,n,i=Ky(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Ky(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Wd=v.forwardRef((e,t)=>{var{children:r,width:n,height:i,viewBox:a,className:o,style:u,title:l,desc:s}=e,c=Uy(e,By),f=a||{width:n,height:i,x:0,y:0},d=ot("recharts-surface",o);return v.createElement("svg",Bo({},jt(c),{className:d,width:n,height:i,style:u,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),v.createElement("title",null,l),v.createElement("desc",null,s),r)}),qy=["children","className"];function Uo(){return Uo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uo.apply(null,arguments)}function Wy(e,t){if(e==null)return{};var r,n,i=Hy(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Hy(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Qt=v.forwardRef((e,t)=>{var{children:r,className:n}=e,i=Wy(e,qy),a=ot("recharts-layer",n);return v.createElement("g",Uo({className:a},jt(i),{ref:t}),r)}),Vy=v.createContext(null);function ie(e){return function(){return e}}const Ko=Math.PI,qo=2*Ko,Ut=1e-6,Yy=qo-Ut;function Hd(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Gy(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Hd;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class Xy{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Hd:Gy(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,o){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,u=this._y1,l=n-t,s=i-r,c=o-t,f=u-r,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(d>Ut)if(!(Math.abs(f*l-s*c)>Ut)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,p=i-u,g=l*l+s*s,m=h*h+p*p,y=Math.sqrt(g),x=Math.sqrt(d),w=a*Math.tan((Ko-Math.acos((g+d-m)/(2*y*x)))/2),S=w/x,b=w/y;Math.abs(S-1)>Ut&&this._append`L${t+S*c},${r+S*f}`,this._append`A${a},${a},0,0,${+(f*h>c*p)},${this._x1=t+b*l},${this._y1=r+b*s}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),l=n*Math.sin(i),s=t+u,c=r+l,f=1^o,d=o?i-a:a-i;this._x1===null?this._append`M${s},${c}`:(Math.abs(this._x1-s)>Ut||Math.abs(this._y1-c)>Ut)&&this._append`L${s},${c}`,n&&(d<0&&(d=d%qo+qo),d>Yy?this._append`A${n},${n},0,1,${f},${t-u},${r-l}A${n},${n},0,1,${f},${this._x1=s},${this._y1=c}`:d>Ut&&this._append`A${n},${n},0,${+(d>=Ko)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Vd(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Xy(t)}function qu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Yd(e){this._context=e}Yd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Wi(e){return new Yd(e)}function Gd(e){return e[0]}function Xd(e){return e[1]}function Zd(e,t){var r=ie(!0),n=null,i=Wi,a=null,o=Vd(u);e=typeof e=="function"?e:e===void 0?Gd:ie(e),t=typeof t=="function"?t:t===void 0?Xd:ie(t);function u(l){var s,c=(l=qu(l)).length,f,d=!1,h;for(n==null&&(a=i(h=o())),s=0;s<=c;++s)!(s<c&&r(f=l[s],s,l))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(f,s,l),+t(f,s,l));if(h)return a=null,h+""||null}return u.x=function(l){return arguments.length?(e=typeof l=="function"?l:ie(+l),u):e},u.y=function(l){return arguments.length?(t=typeof l=="function"?l:ie(+l),u):t},u.defined=function(l){return arguments.length?(r=typeof l=="function"?l:ie(!!l),u):r},u.curve=function(l){return arguments.length?(i=l,n!=null&&(a=i(n)),u):i},u.context=function(l){return arguments.length?(l==null?n=a=null:a=i(n=l),u):n},u}function Ln(e,t,r){var n=null,i=ie(!0),a=null,o=Wi,u=null,l=Vd(s);e=typeof e=="function"?e:e===void 0?Gd:ie(+e),t=typeof t=="function"?t:ie(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?Xd:ie(+r);function s(f){var d,h,p,g=(f=qu(f)).length,m,y=!1,x,w=new Array(g),S=new Array(g);for(a==null&&(u=o(x=l())),d=0;d<=g;++d){if(!(d<g&&i(m=f[d],d,f))===y)if(y=!y)h=d,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),p=d-1;p>=h;--p)u.point(w[p],S[p]);u.lineEnd(),u.areaEnd()}y&&(w[d]=+e(m,d,f),S[d]=+t(m,d,f),u.point(n?+n(m,d,f):w[d],r?+r(m,d,f):S[d]))}if(x)return u=null,x+""||null}function c(){return Zd().defined(i).curve(o).context(a)}return s.x=function(f){return arguments.length?(e=typeof f=="function"?f:ie(+f),n=null,s):e},s.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ie(+f),s):e},s.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ie(+f),s):n},s.y=function(f){return arguments.length?(t=typeof f=="function"?f:ie(+f),r=null,s):t},s.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ie(+f),s):t},s.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ie(+f),s):r},s.lineX0=s.lineY0=function(){return c().x(e).y(t)},s.lineY1=function(){return c().x(e).y(r)},s.lineX1=function(){return c().x(n).y(t)},s.defined=function(f){return arguments.length?(i=typeof f=="function"?f:ie(!!f),s):i},s.curve=function(f){return arguments.length?(o=f,a!=null&&(u=o(a)),s):o},s.context=function(f){return arguments.length?(f==null?a=u=null:u=o(a=f),s):a},s}class Qd{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Zy(e){return new Qd(e,!0)}function Qy(e){return new Qd(e,!1)}function ni(){}function ii(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Jd(e){this._context=e}Jd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ii(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ii(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Jy(e){return new Jd(e)}function eh(e){this._context=e}eh.prototype={areaStart:ni,areaEnd:ni,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ii(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function e0(e){return new eh(e)}function th(e){this._context=e}th.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ii(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function t0(e){return new th(e)}function rh(e){this._context=e}rh.prototype={areaStart:ni,areaEnd:ni,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function r0(e){return new rh(e)}function ms(e){return e<0?-1:1}function gs(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(ms(a)+ms(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function ys(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function ja(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,o-u*r,a,o)}function ai(e){this._context=e}ai.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ja(this,this._t0,ys(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ja(this,ys(this,r=gs(this,e,t)),r);break;default:ja(this,this._t0,r=gs(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function nh(e){this._context=new ih(e)}(nh.prototype=Object.create(ai.prototype)).point=function(e,t){ai.prototype.point.call(this,t,e)};function ih(e){this._context=e}ih.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function n0(e){return new ai(e)}function i0(e){return new nh(e)}function ah(e){this._context=e}ah.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=bs(e),i=bs(t),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function bs(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,o[t]-=n*o[t-1];for(i[r-1]=o[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function a0(e){return new ah(e)}function Hi(e,t){this._context=e,this._t=t}Hi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function o0(e){return new Hi(e,.5)}function u0(e){return new Hi(e,0)}function l0(e){return new Hi(e,1)}function Jt(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,u=a.length;r<o;++r)for(i=a,a=e[t[r]],n=0;n<u;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Wo(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function s0(e,t){return e[t]}function c0(e){const t=[];return t.key=e,t}function f0(){var e=ie([]),t=Wo,r=Jt,n=s0;function i(a){var o=Array.from(e.apply(this,arguments),c0),u,l=o.length,s=-1,c;for(const f of a)for(u=0,++s;u<l;++u)(o[u][s]=[0,+n(f,o[u].key,s,a)]).data=f;for(u=0,c=qu(t(o));u<l;++u)o[c[u]].index=u;return r(o,c),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:ie(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:ie(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?Wo:typeof a=="function"?a:ie(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??Jt,i):r},i}function d0(e,t){if((n=e.length)>0){for(var r,n,i=0,a=e[0].length,o;i<a;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}Jt(e,t)}}function h0(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,a=n.length;r<a;++r){for(var o=0,u=0;o<i;++o)u+=e[o][r][1]||0;n[r][1]+=n[r][0]=-u/2}Jt(e,t)}}function v0(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n<a;++n){for(var u=0,l=0,s=0;u<o;++u){for(var c=e[t[u]],f=c[n][1]||0,d=c[n-1][1]||0,h=(f-d)/2,p=0;p<u;++p){var g=e[t[p]],m=g[n][1]||0,y=g[n-1][1]||0;h+=m-y}l+=f,s+=h*f}i[n-1][1]+=i[n-1][0]=r,l&&(r-=s/l)}i[n-1][1]+=i[n-1][0]=r,Jt(e,t)}}var Na={},$a={},xs;function p0(){return xs||(xs=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t}($a)),$a}var Ra={},ws;function m0(){return ws||(ws=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=t}(Ra)),Ra}var La={},Ss;function oh(){return Ss||(Ss=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var n;return typeof r=="string"||typeof r=="symbol"?r:Object.is((n=r==null?void 0:r.valueOf)==null?void 0:n.call(r),-0)?"-0":String(r)}e.toKey=t}(La)),La}var za={},Fa={},Is;function g0(){return Is||(Is=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(r==null)return"";if(typeof r=="string")return r;if(Array.isArray(r))return r.map(t).join(",");const n=String(r);return n==="0"&&Object.is(Number(r),-0)?"-0":n}e.toString=t}(Fa)),Fa}var Ps;function uh(){return Ps||(Ps=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=g0(),r=oh();function n(i){if(Array.isArray(i))return i.map(r.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],o=i.length;if(o===0)return a;let u=0,l="",s="",c=!1;for(i.charCodeAt(0)===46&&(a.push(""),u++);u<o;){const f=i[u];s?f==="\\"&&u+1<o?(u++,l+=i[u]):f===s?s="":l+=f:c?f==='"'||f==="'"?s=f:f==="]"?(c=!1,a.push(l),l=""):l+=f:f==="["?(c=!0,l&&(a.push(l),l="")):f==="."?l&&(a.push(l),l=""):l+=f,u++}return l&&a.push(l),a}e.toPath=n}(za)),za}var Cs;function y0(){return Cs||(Cs=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=p0(),r=m0(),n=oh(),i=uh();function a(u,l,s){if(u==null)return s;switch(typeof l){case"string":{if(t.isUnsafeProperty(l))return s;const c=u[l];return c===void 0?r.isDeepKey(l)?a(u,i.toPath(l),s):s:c}case"number":case"symbol":{typeof l=="number"&&(l=n.toKey(l));const c=u[l];return c===void 0?s:c}default:{if(Array.isArray(l))return o(u,l,s);if(Object.is(l==null?void 0:l.valueOf(),-0)?l="-0":l=String(l),t.isUnsafeProperty(l))return s;const c=u[l];return c===void 0?s:c}}}function o(u,l,s){if(l.length===0)return s;let c=u;for(let f=0;f<l.length;f++){if(c==null||t.isUnsafeProperty(l[f]))return s;c=c[l[f]]}return c===void 0?s:c}e.get=a}(Na)),Na}var Ba,As;function b0(){return As||(As=1,Ba=y0().get),Ba}var x0=b0();const lh=Cr(x0);var w0=4;function S0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w0,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}var kt=e=>e===0?0:e>0?1:-1,it=e=>typeof e=="number"&&e!=+e,Vr=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,W=e=>(typeof e=="number"||e instanceof Number)&&!it(e),Yr=e=>W(e)||typeof e=="string",I0=0,Gr=e=>{var t=++I0;return"".concat(e||"").concat(t)},er=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!W(t)&&typeof t!="string")return n;var a;if(Vr(t)){if(r==null)return n;var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return it(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},sh=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[String(e[n])])r[String(e[n])]=!0;else return!0;return!1};function sr(e,t,r){return W(e)&&W(t)?S0(e+r*(t-e)):t}function ch(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):lh(n,t))===r)}var Ie=e=>e===null||typeof e>"u",Wu=e=>Ie(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function P0(e){return e!=null}function Vi(){}var Hu=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(v.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{Bd(i)&&(n[i]=a=>r[i](r,a))}),n};function _s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function C0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_s(Object(r),!0).forEach(function(n){A0(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_s(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function A0(e,t,r){return(t=_0(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _0(e){var t=O0(e,"string");return typeof t=="symbol"?t:t+""}function O0(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ar(e,t){var r=C0({},e),n=t,i=Object.keys(t),a=i.reduce((o,u)=>(o[u]===void 0&&n[u]!==void 0&&(o[u]=n[u]),o),r);return a}var Ua={},Ka={},Os;function E0(){return Os||(Os=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t}(Ka)),Ka}var Es;function fh(){return Es||(Es=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=E0();function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r}(Ua)),Ua}var qa={},Ms;function M0(){return Ms||(Ms=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t}(qa)),qa}var Wa={},ks;function k0(){return ks||(ks=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return r===n||Number.isNaN(r)&&Number.isNaN(n)}e.eq=t}(Wa)),Wa}var Ha={},Ts;function T0(){return Ts||(Ts=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(n,i=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<i;case"symbol":return!1;case"string":return t.test(n)}}e.isIndex=r}(Ha)),Ha}var Va={exports:{}},Ya={},Ga={exports:{}},Xa={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ds;function D0(){if(Ds)return Xa;Ds=1;var e=_u();function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function u(f,d){var h=d(),p=n({inst:{value:h,getSnapshot:d}}),g=p[0].inst,m=p[1];return a(function(){g.value=h,g.getSnapshot=d,l(g)&&m({inst:g})},[f,h,d]),i(function(){return l(g)&&m({inst:g}),f(function(){l(g)&&m({inst:g})})},[f]),o(h),h}function l(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!r(f,h)}catch{return!0}}function s(f,d){return d()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:u;return Xa.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,Xa}var js;function j0(){return js||(js=1,Ga.exports=D0()),Ga.exports}/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ns;function N0(){if(Ns)return Ya;Ns=1;var e=_u(),t=j0();function r(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,u=e.useMemo,l=e.useDebugValue;return Ya.useSyncExternalStoreWithSelector=function(s,c,f,d,h){var p=a(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=u(function(){function y(P){if(!x){if(x=!0,w=P,P=d(P),h!==void 0&&g.hasValue){var E=g.value;if(h(E,P))return S=E}return S=P}if(E=S,n(w,P))return E;var k=d(P);return h!==void 0&&h(E,k)?(w=P,E):(w=P,S=k)}var x=!1,w,S,b=f===void 0?null:f;return[function(){return y(c())},b===null?void 0:function(){return y(b())}]},[c,f,d,h]);var m=i(s,p[0],p[1]);return o(function(){g.hasValue=!0,g.value=m},[m]),l(m),m},Ya}var $s;function $0(){return $s||($s=1,Va.exports=N0()),Va.exports}var R0=$0(),Vu=v.createContext(null),L0=e=>e,Me=()=>{var e=v.useContext(Vu);return e?e.store.dispatch:L0},Xn=()=>{},z0=()=>Xn,F0=(e,t)=>e===t;function Q(e){var t=v.useContext(Vu);return R0.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:z0,t?t.store.getState:Xn,t?t.store.getState:Xn,t?e:Xn,F0)}function B0(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function U0(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function K0(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Rs=e=>Array.isArray(e)?e:[e];function q0(e){const t=Array.isArray(e[0])?e[0]:e;return K0(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function W0(e,t){const r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var H0=class{constructor(e){this.value=e}deref(){return this.value}},V0=typeof WeakRef<"u"?WeakRef:H0,Y0=0,Ls=1;function zn(){return{s:Y0,v:void 0,o:null,p:null}}function dh(e,t={}){let r=zn();const{resultEqualityCheck:n}=t;let i,a=0;function o(){var f;let u=r;const{length:l}=arguments;for(let d=0,h=l;d<h;d++){const p=arguments[d];if(typeof p=="function"||typeof p=="object"&&p!==null){let g=u.o;g===null&&(u.o=g=new WeakMap);const m=g.get(p);m===void 0?(u=zn(),g.set(p,u)):u=m}else{let g=u.p;g===null&&(u.p=g=new Map);const m=g.get(p);m===void 0?(u=zn(),g.set(p,u)):u=m}}const s=u;let c;if(u.s===Ls)c=u.v;else if(c=e.apply(null,arguments),a++,n){const d=((f=i==null?void 0:i.deref)==null?void 0:f.call(i))??i;d!=null&&n(d,c)&&(c=d,a!==0&&a--),i=typeof c=="object"&&c!==null||typeof c=="function"?new V0(c):c}return s.s=Ls,s.v=c,c}return o.clearCache=()=>{r=zn(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function G0(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let a=0,o=0,u,l={},s=i.pop();typeof s=="object"&&(l=s,s=i.pop()),B0(s,`createSelector expects an output function after the inputs, but received: [${typeof s}]`);const c={...r,...l},{memoize:f,memoizeOptions:d=[],argsMemoize:h=dh,argsMemoizeOptions:p=[]}=c,g=Rs(d),m=Rs(p),y=q0(i),x=f(function(){return a++,s.apply(null,arguments)},...g),w=h(function(){o++;const b=W0(y,arguments);return u=x.apply(null,b),u},...m);return Object.assign(w,{resultFunc:s,memoizedResultFunc:x,dependencies:y,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var C=G0(dh),X0=Object.assign((e,t=C)=>{U0(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((o,u,l)=>(o[r[l]]=u,o),{}))},{withTypes:()=>X0}),Za={},Qa={},Ja={},zs;function Z0(){return zs||(zs=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const r=(n,i,a)=>{if(n!==i){const o=t(n),u=t(i);if(o===u&&o===0){if(n<i)return a==="desc"?1:-1;if(n>i)return a==="desc"?-1:1}return a==="desc"?u-o:o-u}return 0};e.compareValues=r}(Ja)),Ja}var eo={},to={},Fs;function hh(){return Fs||(Fs=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t}(to)),to}var Bs;function Q0(){return Bs||(Bs=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hh(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(n.test(a)||!r.test(a))||o!=null&&Object.hasOwn(o,a)}e.isKey=i}(eo)),eo}var Us;function J0(){return Us||(Us=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Z0(),r=Q0(),n=uh();function i(a,o,u,l){if(a==null)return[];u=l?void 0:u,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(h=>String(h));const s=(h,p)=>{let g=h;for(let m=0;m<p.length&&g!=null;++m)g=g[p[m]];return g},c=(h,p)=>p==null||h==null?p:typeof h=="object"&&"key"in h?Object.hasOwn(p,h.key)?p[h.key]:s(p,h.path):typeof h=="function"?h(p):Array.isArray(h)?s(p,h):typeof p=="object"?p[h]:p,f=o.map(h=>(Array.isArray(h)&&h.length===1&&(h=h[0]),h==null||typeof h=="function"||Array.isArray(h)||r.isKey(h)?h:{key:h,path:n.toPath(h)}));return a.map(h=>({original:h,criteria:f.map(p=>c(p,h))})).slice().sort((h,p)=>{for(let g=0;g<f.length;g++){const m=t.compareValues(h.criteria[g],p.criteria[g],u[g]);if(m!==0)return m}return 0}).map(h=>h.original)}e.orderBy=i}(Qa)),Qa}var ro={},Ks;function eb(){return Ks||(Ks=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n=1){const i=[],a=Math.floor(n),o=(u,l)=>{for(let s=0;s<u.length;s++){const c=u[s];Array.isArray(c)&&l<a?o(c,l+1):i.push(c)}};return o(r,0),i}e.flatten=t}(ro)),ro}var no={},qs;function vh(){return qs||(qs=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=T0(),r=fh(),n=M0(),i=k0();function a(o,u,l){return n.isObject(l)&&(typeof u=="number"&&r.isArrayLike(l)&&t.isIndex(u)&&u<l.length||typeof u=="string"&&u in l)?i.eq(l[u],o):!1}e.isIterateeCall=a}(no)),no}var Ws;function tb(){return Ws||(Ws=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=J0(),r=eb(),n=vh();function i(a,...o){const u=o.length;return u>1&&n.isIterateeCall(a,o[0],o[1])?o=[]:u>2&&n.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,r.flatten(o),["asc"])}e.sortBy=i}(Za)),Za}var io,Hs;function rb(){return Hs||(Hs=1,io=tb().sortBy),io}var nb=rb();const Yu=Cr(nb);var ph=e=>e.legend.settings,ib=e=>e.legend.size,ab=e=>e.legend.payload;C([ab,ph],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?Yu(n,r):n});function xe(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ob=typeof Symbol=="function"&&Symbol.observable||"@@observable",Vs=ob,ao=()=>Math.random().toString(36).substring(7).split("").join("."),ub={INIT:`@@redux/INIT${ao()}`,REPLACE:`@@redux/REPLACE${ao()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ao()}`},oi=ub;function Gu(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function mh(e,t,r){if(typeof e!="function")throw new Error(xe(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(xe(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(xe(1));return r(mh)(e,t)}let n=e,i=t,a=new Map,o=a,u=0,l=!1;function s(){o===a&&(o=new Map,a.forEach((m,y)=>{o.set(y,m)}))}function c(){if(l)throw new Error(xe(3));return i}function f(m){if(typeof m!="function")throw new Error(xe(4));if(l)throw new Error(xe(5));let y=!0;s();const x=u++;return o.set(x,m),function(){if(y){if(l)throw new Error(xe(6));y=!1,s(),o.delete(x),a=null}}}function d(m){if(!Gu(m))throw new Error(xe(7));if(typeof m.type>"u")throw new Error(xe(8));if(typeof m.type!="string")throw new Error(xe(17));if(l)throw new Error(xe(9));try{l=!0,i=n(i,m)}finally{l=!1}return(a=o).forEach(x=>{x()}),m}function h(m){if(typeof m!="function")throw new Error(xe(10));n=m,d({type:oi.REPLACE})}function p(){const m=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(xe(11));function x(){const S=y;S.next&&S.next(c())}return x(),{unsubscribe:m(x)}},[Vs](){return this}}}return d({type:oi.INIT}),{dispatch:d,subscribe:f,getState:c,replaceReducer:h,[Vs]:p}}function lb(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:oi.INIT})>"u")throw new Error(xe(12));if(typeof r(void 0,{type:oi.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(xe(13))})}function gh(e){const t=Object.keys(e),r={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(r[o]=e[o])}const n=Object.keys(r);let i;try{lb(r)}catch(a){i=a}return function(o={},u){if(i)throw i;let l=!1;const s={};for(let c=0;c<n.length;c++){const f=n[c],d=r[f],h=o[f],p=d(h,u);if(typeof p>"u")throw u&&u.type,new Error(xe(14));s[f]=p,l=l||p!==h}return l=l||n.length!==Object.keys(o).length,l?s:o}}function ui(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function sb(...e){return t=>(r,n)=>{const i=t(r,n);let a=()=>{throw new Error(xe(15))};const o={getState:i.getState,dispatch:(l,...s)=>a(l,...s)},u=e.map(l=>l(o));return a=ui(...u)(i.dispatch),{...i,dispatch:a}}}function yh(e){return Gu(e)&&"type"in e&&typeof e.type=="string"}var bh=Symbol.for("immer-nothing"),Ys=Symbol.for("immer-draftable"),Ae=Symbol.for("immer-state");function He(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ne=Object,br=Ne.getPrototypeOf,li="constructor",Yi="prototype",Ho="configurable",si="enumerable",Zn="writable",Xr="value",pt=e=>!!e&&!!e[Ae];function Xe(e){var t;return e?xh(e)||Xi(e)||!!e[Ys]||!!((t=e[li])!=null&&t[Ys])||Zi(e)||Qi(e):!1}var cb=Ne[Yi][li].toString(),Gs=new WeakMap;function xh(e){if(!e||!Xu(e))return!1;const t=br(e);if(t===null||t===Ne[Yi])return!0;const r=Ne.hasOwnProperty.call(t,li)&&t[li];if(r===Object)return!0;if(!hr(r))return!1;let n=Gs.get(r);return n===void 0&&(n=Function.toString.call(r),Gs.set(r,n)),n===cb}function Gi(e,t,r=!0){fn(e)===0?(r?Reflect.ownKeys(e):Ne.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function fn(e){const t=e[Ae];return t?t.type_:Xi(e)?1:Zi(e)?2:Qi(e)?3:0}var Xs=(e,t,r=fn(e))=>r===2?e.has(t):Ne[Yi].hasOwnProperty.call(e,t),Vo=(e,t,r=fn(e))=>r===2?e.get(t):e[t],ci=(e,t,r,n=fn(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function fb(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Xi=Array.isArray,Zi=e=>e instanceof Map,Qi=e=>e instanceof Set,Xu=e=>typeof e=="object",hr=e=>typeof e=="function",oo=e=>typeof e=="boolean";function db(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ct=e=>e.copy_||e.base_,Zu=e=>e.modified_?e.copy_:e.base_;function Yo(e,t){if(Zi(e))return new Map(e);if(Qi(e))return new Set(e);if(Xi(e))return Array[Yi].slice.call(e);const r=xh(e);if(t===!0||t==="class_only"&&!r){const n=Ne.getOwnPropertyDescriptors(e);delete n[Ae];let i=Reflect.ownKeys(n);for(let a=0;a<i.length;a++){const o=i[a],u=n[o];u[Zn]===!1&&(u[Zn]=!0,u[Ho]=!0),(u.get||u.set)&&(n[o]={[Ho]:!0,[Zn]:!0,[si]:u[si],[Xr]:e[o]})}return Ne.create(br(e),n)}else{const n=br(e);if(n!==null&&r)return{...e};const i=Ne.create(n);return Ne.assign(i,e)}}function Qu(e,t=!1){return Ji(e)||pt(e)||!Xe(e)||(fn(e)>1&&Ne.defineProperties(e,{set:Fn,add:Fn,clear:Fn,delete:Fn}),Ne.freeze(e),t&&Gi(e,(r,n)=>{Qu(n,!0)},!1)),e}function hb(){He(2)}var Fn={[Xr]:hb};function Ji(e){return e===null||!Xu(e)?!0:Ne.isFrozen(e)}var fi="MapSet",Go="Patches",Zs="ArrayMethods",wh={};function tr(e){const t=wh[e];return t||He(0,e),t}var Qs=e=>!!wh[e],Zr,Sh=()=>Zr,vb=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Qs(fi)?tr(fi):void 0,arrayMethodsPlugin_:Qs(Zs)?tr(Zs):void 0});function Js(e,t){t&&(e.patchPlugin_=tr(Go),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Xo(e){Zo(e),e.drafts_.forEach(pb),e.drafts_=null}function Zo(e){e===Zr&&(Zr=e.parent_)}var ec=e=>Zr=vb(Zr,e);function pb(e){const t=e[Ae];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function tc(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[Ae].modified_&&(Xo(t),He(4)),Xe(e)&&(e=rc(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(r[Ae].base_,e,t)}else e=rc(t,r);return mb(t,e,!0),Xo(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==bh?e:void 0}function rc(e,t){if(Ji(t))return t;const r=t[Ae];if(!r)return di(t,e.handledSet_,e);if(!ea(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);Ch(r,e)}return r.copy_}function mb(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Qu(t,r)}function Ih(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var ea=(e,t)=>e.scope_===t,gb=[];function Ph(e,t,r,n){const i=ct(e),a=e.type_;if(n!==void 0&&Vo(i,n,a)===t){ci(i,n,r,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;Gi(i,(l,s)=>{if(pt(s)){const c=u.get(s)||[];c.push(l),u.set(s,c)}})}const o=e.draftLocations_.get(t)??gb;for(const u of o)ci(i,u,r,a)}function yb(e,t,r){e.callbacks_.push(function(i){var u;const a=t;if(!a||!ea(a,i))return;(u=i.mapSetPlugin_)==null||u.fixSetContents(a);const o=Zu(a);Ph(e,a.draft_??a,o,r),Ch(a,i)})}function Ch(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}Ih(e)}}function bb(e,t,r){const{scope_:n}=e;if(pt(r)){const i=r[Ae];ea(i,n)&&i.callbacks_.push(function(){Qn(e);const o=Zu(i);Ph(e,r,o,t)})}else Xe(r)&&e.callbacks_.push(function(){const a=ct(e);e.type_===3?a.has(r)&&di(r,n.handledSet_,n):Vo(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&di(Vo(e.copy_,t,e.type_),n.handledSet_,n)})}function di(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||pt(e)||t.has(e)||!Xe(e)||Ji(e)||(t.add(e),Gi(e,(n,i)=>{if(pt(i)){const a=i[Ae];if(ea(a,r)){const o=Zu(a);ci(e,n,o,e.type_),Ih(a)}}else Xe(i)&&di(i,t,r)})),e}function xb(e,t){const r=Xi(e),n={type_:r?1:0,scope_:t?t.scope_:Sh(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,a=hi;r&&(i=[n],a=Qr);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return n.draft_=u,n.revoke_=o,[u,n]}var hi={get(e,t){if(t===Ae)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=ct(e);if(!Xs(i,t,e.type_))return wb(e,i,t);const a=i[t];if(e.finalized_||!Xe(a)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&db(t))return a;if(a===uo(e.base_,t)){Qn(e);const o=e.type_===1?+t:t,u=Jo(e.scope_,a,e,o);return e.copy_[o]=u}return a},has(e,t){return t in ct(e)},ownKeys(e){return Reflect.ownKeys(ct(e))},set(e,t,r){const n=Ah(ct(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=uo(ct(e),t),a=i==null?void 0:i[Ae];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(fb(r,i)&&(r!==void 0||Xs(e.base_,t,e.type_)))return!0;Qn(e),Qo(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),bb(e,t,r)),!0},deleteProperty(e,t){return Qn(e),uo(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Qo(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ct(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Zn]:!0,[Ho]:e.type_!==1||t!=="length",[si]:n[si],[Xr]:r[t]}},defineProperty(){He(11)},getPrototypeOf(e){return br(e.base_)},setPrototypeOf(){He(12)}},Qr={};for(let e in hi){let t=hi[e];Qr[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Qr.deleteProperty=function(e,t){return Qr.set.call(this,e,t,void 0)};Qr.set=function(e,t,r){return hi.set.call(this,e[0],t,r,e[0])};function uo(e,t){const r=e[Ae];return(r?ct(r):e)[t]}function wb(e,t,r){var i;const n=Ah(t,r);return n?Xr in n?n[Xr]:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function Ah(e,t){if(!(t in e))return;let r=br(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=br(r)}}function Qo(e){e.modified_||(e.modified_=!0,e.parent_&&Qo(e.parent_))}function Qn(e){e.copy_||(e.assigned_=new Map,e.copy_=Yo(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Sb=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,i)=>{if(hr(r)&&!hr(n)){const o=n;n=r;const u=this;return function(s=o,...c){return u.produce(s,f=>n.call(this,f,...c))}}hr(n)||He(6),i!==void 0&&!hr(i)&&He(7);let a;if(Xe(r)){const o=ec(this),u=Jo(o,r,void 0);let l=!0;try{a=n(u),l=!1}finally{l?Xo(o):Zo(o)}return Js(o,i),tc(a,o)}else if(!r||!Xu(r)){if(a=n(r),a===void 0&&(a=r),a===bh&&(a=void 0),this.autoFreeze_&&Qu(a,!0),i){const o=[],u=[];tr(Go).generateReplacementPatches_(r,a,{patches_:o,inversePatches_:u}),i(o,u)}return a}else He(1,r)},this.produceWithPatches=(r,n)=>{if(hr(r))return(u,...l)=>this.produceWithPatches(u,s=>r(s,...l));let i,a;return[this.produce(r,n,(u,l)=>{i=u,a=l}),i,a]},oo(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),oo(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),oo(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Xe(t)||He(8),pt(t)&&(t=Ge(t));const r=ec(this),n=Jo(r,t,void 0);return n[Ae].isManual_=!0,Zo(r),n}finishDraft(t,r){const n=t&&t[Ae];(!n||!n.isManual_)&&He(9);const{scope_:i}=n;return Js(i,r),tc(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const a=r[n];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}n>-1&&(r=r.slice(n+1));const i=tr(Go).applyPatches_;return pt(t)?i(t,r):this.produce(t,a=>i(a,r))}};function Jo(e,t,r,n){const[i,a]=Zi(t)?tr(fi).proxyMap_(t,r):Qi(t)?tr(fi).proxySet_(t,r):xb(t,r);return((r==null?void 0:r.scope_)??Sh()).drafts_.push(i),a.callbacks_=(r==null?void 0:r.callbacks_)??[],a.key_=n,r&&n!==void 0?yb(r,a,n):a.callbacks_.push(function(l){var c;(c=l.mapSetPlugin_)==null||c.fixSetContents(a);const{patchPlugin_:s}=l;a.modified_&&s&&s.generatePatches_(a,[],l)}),i}function Ge(e){return pt(e)||He(10,e),_h(e)}function _h(e){if(!Xe(e)||Ji(e))return e;const t=e[Ae];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Yo(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Yo(e,!0);return Gi(r,(i,a)=>{ci(r,i,_h(a))},n),t&&(t.finalized_=!1),r}var Ib=new Sb,Oh=Ib.produce;function Eh(e){return({dispatch:r,getState:n})=>i=>a=>typeof a=="function"?a(r,n,e):i(a)}var Pb=Eh(),Cb=Eh,Ab=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ui:ui.apply(null,arguments)};function Ue(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error($e(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>yh(n)&&n.type===e,r}var Mh=class Br extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Br.prototype)}static get[Symbol.species](){return Br}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Br(...t[0].concat(this)):new Br(...t.concat(this))}};function nc(e){return Xe(e)?Oh(e,()=>{}):e}function Bn(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function _b(e){return typeof e=="boolean"}var Ob=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new Mh;return r&&(_b(r)?o.push(Pb):o.push(Cb(r.extraArgument))),o},kh="RTK_autoBatch",te=()=>e=>({payload:e,meta:{[kh]:!0}}),ic=e=>t=>{setTimeout(t,e)},Th=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,a=!1,o=!1;const u=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ic(10):e.type==="callback"?e.queueNotification:ic(e.timeout),s=()=>{o=!1,a&&(a=!1,u.forEach(c=>c()))};return Object.assign({},n,{subscribe(c){const f=()=>i&&c(),d=n.subscribe(f);return u.add(c),()=>{d(),u.delete(c)}},dispatch(c){var f;try{return i=!((f=c==null?void 0:c.meta)!=null&&f[kh]),a=!i,a&&(o||(o=!0,l(s))),n.dispatch(c)}finally{i=!0}}})},Eb=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new Mh(e);return n&&i.push(Th(typeof n=="object"?n:void 0)),i};function Mb(e){const t=Ob(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let u;if(typeof r=="function")u=r;else if(Gu(r))u=gh(r);else throw new Error($e(1));let l;typeof n=="function"?l=n(t):l=t();let s=ui;i&&(s=Ab({trace:!1,...typeof i=="object"&&i}));const c=sb(...l),f=Eb(c);let d=typeof o=="function"?o(f):f();const h=s(...d);return mh(u,a,h)}function Dh(e){const t={},r=[];let n;const i={addCase(a,o){const u=typeof a=="string"?a:a.type;if(!u)throw new Error($e(28));if(u in t)throw new Error($e(29));return t[u]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return r.push({matcher:a,reducer:o}),i},addDefaultCase(a){return n=a,i}};return e(i),[t,r,n]}function kb(e){return typeof e=="function"}function Tb(e,t){let[r,n,i]=Dh(t),a;if(kb(e))a=()=>nc(e());else{const u=nc(e);a=()=>u}function o(u=a(),l){let s=[r[l.type],...n.filter(({matcher:c})=>c(l)).map(({reducer:c})=>c)];return s.filter(c=>!!c).length===0&&(s=[i]),s.reduce((c,f)=>{if(f)if(pt(c)){const h=f(c,l);return h===void 0?c:h}else{if(Xe(c))return Oh(c,d=>f(d,l));{const d=f(c,l);if(d===void 0){if(c===null)return c;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return c},u)}return o.getInitialState=a,o}var Db="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",jb=(e=21)=>{let t="",r=e;for(;r--;)t+=Db[Math.random()*64|0];return t},Nb=Symbol.for("rtk-slice-createasyncthunk");function $b(e,t){return`${e}/${t}`}function Rb({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[Nb];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error($e(11));const u=(typeof i.reducers=="function"?i.reducers(zb()):i.reducers)||{},l=Object.keys(u),s={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(S,b){const P=typeof S=="string"?S:S.type;if(!P)throw new Error($e(12));if(P in s.sliceCaseReducersByType)throw new Error($e(13));return s.sliceCaseReducersByType[P]=b,c},addMatcher(S,b){return s.sliceMatchers.push({matcher:S,reducer:b}),c},exposeAction(S,b){return s.actionCreators[S]=b,c},exposeCaseReducer(S,b){return s.sliceCaseReducersByName[S]=b,c}};l.forEach(S=>{const b=u[S],P={reducerName:S,type:$b(a,S),createNotation:typeof i.reducers=="function"};Bb(b)?Kb(P,b,c,t):Fb(P,b,c)});function f(){const[S={},b=[],P=void 0]=typeof i.extraReducers=="function"?Dh(i.extraReducers):[i.extraReducers],E={...S,...s.sliceCaseReducersByType};return Tb(i.initialState,k=>{for(let D in E)k.addCase(D,E[D]);for(let D of s.sliceMatchers)k.addMatcher(D.matcher,D.reducer);for(let D of b)k.addMatcher(D.matcher,D.reducer);P&&k.addDefaultCase(P)})}const d=S=>S,h=new Map,p=new WeakMap;let g;function m(S,b){return g||(g=f()),g(S,b)}function y(){return g||(g=f()),g.getInitialState()}function x(S,b=!1){function P(k){let D=k[S];return typeof D>"u"&&b&&(D=Bn(p,P,y)),D}function E(k=d){const D=Bn(h,b,()=>new WeakMap);return Bn(D,k,()=>{const z={};for(const[O,M]of Object.entries(i.selectors??{}))z[O]=Lb(M,k,()=>Bn(p,k,y),b);return z})}return{reducerPath:S,getSelectors:E,get selectors(){return E(P)},selectSlice:P}}const w={name:a,reducer:m,actions:s.actionCreators,caseReducers:s.sliceCaseReducersByName,getInitialState:y,...x(o),injectInto(S,{reducerPath:b,...P}={}){const E=b??o;return S.inject({reducerPath:E,reducer:m},P),{...w,...x(E,!0)}}};return w}}function Lb(e,t,r,n){function i(a,...o){let u=t(a);return typeof u>"u"&&n&&(u=r()),e(u,...o)}return i.unwrapped=e,i}var ke=Rb();function zb(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Fb({type:e,reducerName:t,createNotation:r},n,i){let a,o;if("reducer"in n){if(r&&!Ub(n))throw new Error($e(17));a=n.reducer,o=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Ue(e,o):Ue(e))}function Bb(e){return e._reducerDefinitionType==="asyncThunk"}function Ub(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Kb({type:e,reducerName:t},r,n,i){if(!i)throw new Error($e(18));const{payloadCreator:a,fulfilled:o,pending:u,rejected:l,settled:s,options:c}=r,f=i(e,a,c);n.exposeAction(t,f),o&&n.addCase(f.fulfilled,o),u&&n.addCase(f.pending,u),l&&n.addCase(f.rejected,l),s&&n.addMatcher(f.settled,s),n.exposeCaseReducer(t,{fulfilled:o||Un,pending:u||Un,rejected:l||Un,settled:s||Un})}function Un(){}var qb="task",jh="listener",Nh="completed",Ju="cancelled",Wb=`task-${Ju}`,Hb=`task-${Nh}`,eu=`${jh}-${Ju}`,Vb=`${jh}-${Nh}`,ta=class{constructor(e){Ea(this,"name","TaskAbortError");Ea(this,"message");this.code=e,this.message=`${qb} ${Ju} (reason: ${e})`}},el=(e,t)=>{if(typeof e!="function")throw new TypeError($e(32))},vi=()=>{},$h=(e,t=vi)=>(e.catch(t),e),Rh=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Vt=e=>{if(e.aborted)throw new ta(e.reason)};function Lh(e,t){let r=vi;return new Promise((n,i)=>{const a=()=>i(new ta(e.reason));if(e.aborted){a();return}r=Rh(e,a),t.finally(()=>r()).then(n,i)}).finally(()=>{r=vi})}var Yb=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof ta?"cancelled":"rejected",error:r}}finally{t==null||t()}},pi=e=>t=>$h(Lh(e,t).then(r=>(Vt(e),r))),zh=e=>{const t=pi(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:gr}=Object,ac={},ra="listenerMiddleware",Gb=(e,t)=>{const r=n=>Rh(e,()=>n.abort(e.reason));return(n,i)=>{el(n);const a=new AbortController;r(a);const o=Yb(async()=>{Vt(e),Vt(a.signal);const u=await n({pause:pi(a.signal),delay:zh(a.signal),signal:a.signal});return Vt(a.signal),u},()=>a.abort(Hb));return i!=null&&i.autoJoin&&t.push(o.catch(vi)),{result:pi(e)(o),cancel(){a.abort(Wb)}}}},Xb=(e,t)=>{const r=async(n,i)=>{Vt(t);let a=()=>{};const u=[new Promise((l,s)=>{let c=e({predicate:n,effect:(f,d)=>{d.unsubscribe(),l([f,d.getState(),d.getOriginalState()])}});a=()=>{c(),s()}})];i!=null&&u.push(new Promise(l=>setTimeout(l,i,null)));try{const l=await Lh(t,Promise.race(u));return Vt(t),l}finally{a()}};return(n,i)=>$h(r(n,i))},Fh=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:a}=e;if(t)i=Ue(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error($e(21));return el(a),{predicate:i,type:t,effect:a}},Bh=gr(e=>{const{type:t,predicate:r,effect:n}=Fh(e);return{id:jb(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error($e(22))}}},{withTypes:()=>Bh}),oc=(e,t)=>{const{type:r,effect:n,predicate:i}=Fh(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===i)&&a.effect===n)},tu=e=>{e.pending.forEach(t=>{t.abort(eu)})},Zb=(e,t)=>()=>{for(const r of t.keys())tu(r);e.clear()},uc=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Uh=gr(Ue(`${ra}/add`),{withTypes:()=>Uh}),Qb=Ue(`${ra}/removeAll`),Kh=gr(Ue(`${ra}/remove`),{withTypes:()=>Kh}),Jb=(...e)=>{console.error(`${ra}/error`,...e)},dn=(e={})=>{const t=new Map,r=new Map,n=h=>{const p=r.get(h)??0;r.set(h,p+1)},i=h=>{const p=r.get(h)??1;p===1?r.delete(h):r.set(h,p-1)},{extra:a,onError:o=Jb}=e;el(o);const u=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),p=>{h.unsubscribe(),p!=null&&p.cancelActive&&tu(h)}),l=h=>{const p=oc(t,h)??Bh(h);return u(p)};gr(l,{withTypes:()=>l});const s=h=>{const p=oc(t,h);return p&&(p.unsubscribe(),h.cancelActive&&tu(p)),!!p};gr(s,{withTypes:()=>s});const c=async(h,p,g,m)=>{const y=new AbortController,x=Xb(l,y.signal),w=[];try{h.pending.add(y),n(h),await Promise.resolve(h.effect(p,gr({},g,{getOriginalState:m,condition:(S,b)=>x(S,b).then(Boolean),take:x,delay:zh(y.signal),pause:pi(y.signal),extra:a,signal:y.signal,fork:Gb(y.signal,w),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((S,b,P)=>{S!==y&&(S.abort(eu),P.delete(S))})},cancel:()=>{y.abort(eu),h.pending.delete(y)},throwIfCancelled:()=>{Vt(y.signal)}})))}catch(S){S instanceof ta||uc(o,S,{raisedBy:"effect"})}finally{await Promise.all(w),y.abort(Vb),i(h),h.pending.delete(y)}},f=Zb(t,r);return{middleware:h=>p=>g=>{if(!yh(g))return p(g);if(Uh.match(g))return l(g.payload);if(Qb.match(g)){f();return}if(Kh.match(g))return s(g.payload);let m=h.getState();const y=()=>{if(m===ac)throw new Error($e(23));return m};let x;try{if(x=p(g),t.size>0){const w=h.getState(),S=Array.from(t.values());for(const b of S){let P=!1;try{P=b.predicate(g,w,m)}catch(E){P=!1,uc(o,E,{raisedBy:"predicate"})}P&&c(b,g,h,y)}}}finally{m=ac}return x},startListening:l,stopListening:s,clearListeners:f}};function $e(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ex={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},qh=ke({name:"chartLayout",initialState:ex,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,i,a;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:tx,setLayout:rx,setChartSize:nx,setScale:ix}=qh.actions,ax=qh.reducer;function Wh(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function ne(e){return Number.isFinite(e)}function mi(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function lc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lc(Object(r),!0).forEach(function(n){ox(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ox(e,t,r){return(t=ux(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ux(e){var t=lx(e,"string");return typeof t=="symbol"?t:t+""}function lx(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Se(e,t,r){return Ie(e)||Ie(t)?r:Yr(t)?lh(e,t,r):typeof t=="function"?t(e):r}var sx=(e,t,r)=>{if(t&&r){var{width:n,height:i}=r,{align:a,verticalAlign:o,layout:u}=t;if((u==="vertical"||u==="horizontal"&&o==="middle")&&a!=="center"&&W(e[a]))return vr(vr({},e),{},{[a]:e[a]+(n||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&o!=="middle"&&W(e[o]))return vr(vr({},e),{},{[o]:e[o]+(i||0)})}return e},xt=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",sc=1e-4,cx=e=>{var t=e.domain();if(!(!t||t.length<=2)){var r=t.length,n=e.range(),i=Math.min(n[0],n[1])-sc,a=Math.max(n[0],n[1])+sc,o=e(t[0]),u=e(t[r-1]);(o<i||o>a||u<i||u>a)&&e.domain([t[0],t[r-1]])}},fx=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i<n;++i)for(var a=0,o=0,u=0;u<r;++u){var l=e[u],s=l==null?void 0:l[i];if(s!=null){var c=s[1],f=s[0],d=it(c)?f:c;d>=0?(s[0]=a,s[1]=a+d,a=c):(s[0]=o,s[1]=o+d,o=c)}}}},dx=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i<n;++i)for(var a=0,o=0;o<r;++o){var u=e[o],l=u==null?void 0:u[i];if(l!=null){var s=it(l[1])?l[0]:l[1];s>=0?(l[0]=a,l[1]=a+s,a=l[1]):(l[0]=0,l[1]=0)}}}},hx={sign:fx,expand:d0,none:Jt,silhouette:h0,wiggle:v0,positive:dx},vx=(e,t,r)=>{var n,i=(n=hx[r])!==null&&n!==void 0?n:Jt,a=f0().keys(t).value((u,l)=>Number(Se(u,l,0))).order(Wo).offset(i),o=a(e);return o.forEach((u,l)=>{u.forEach((s,c)=>{var f=Se(e[c],t[l],0);Array.isArray(f)&&f.length===2&&W(f[0])&&W(f[1])&&(s[0]=f[0],s[1]=f[1])})}),o};function px(e){return e==null?void 0:String(e)}function cc(e){var{axis:t,ticks:r,bandSize:n,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ie(i[t.dataKey])){var u=ch(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=Se(i,Ie(o)?t.dataKey:o);return Ie(l)?null:t.scale(l)}var mx=e=>{var t=e.flat(2).filter(W);return[Math.min(...t),Math.max(...t)]},gx=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],yx=(e,t,r)=>{if(e!=null)return gx(Object.keys(e).reduce((n,i)=>{var a=e[i];if(!a)return n;var{stackedData:o}=a,u=o.reduce((l,s)=>{var c=Wh(s,t,r),f=mx(c);return!ne(f[0])||!ne(f[1])?l:[Math.min(l[0],f[0]),Math.max(l[1],f[1])]},[1/0,-1/0]);return[Math.min(u[0],n[0]),Math.max(u[1],n[1])]},[1/0,-1/0]))},fc=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,dc=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,hc=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();return n}if(e&&t&&t.length>=2){for(var i=Yu(t,c=>c.coordinate),a=1/0,o=1,u=i.length;o<u;o++){var l=i[o],s=i[o-1];a=Math.min(((l==null?void 0:l.coordinate)||0)-((s==null?void 0:s.coordinate)||0),a)}return a===1/0?0:a}return r?void 0:0};function vc(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:i,name:a}=e;return vr(vr({},t),{},{dataKey:r,payload:n,value:i,name:a})}function Hh(e,t){if(e)return String(e);if(typeof t=="string")return t}var bx=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},xx=(e,t)=>t==="centric"?e.angle:e.radius,wt=e=>e.layout.width,St=e=>e.layout.height,wx=e=>e.layout.scale,Vh=e=>e.layout.margin,na=C(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),ia=C(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Sx="data-recharts-item-index",Ix="data-recharts-item-id",hn=60;function pc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Kn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pc(Object(r),!0).forEach(function(n){Px(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Px(e,t,r){return(t=Cx(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cx(e){var t=Ax(e,"string");return typeof t=="symbol"?t:t+""}function Ax(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _x=e=>e.brush.height;function Ox(e){var t=ia(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:hn;return r+i}return r},0)}function Ex(e){var t=ia(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:hn;return r+i}return r},0)}function Mx(e){var t=na(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function kx(e){var t=na(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Pe=C([wt,St,Vh,_x,Ox,Ex,Mx,kx,ph,ib],(e,t,r,n,i,a,o,u,l,s)=>{var c={left:(r.left||0)+i,right:(r.right||0)+a},f={top:(r.top||0)+o,bottom:(r.bottom||0)+u},d=Kn(Kn({},f),c),h=d.bottom;d.bottom+=n,d=sx(d,l,s);var p=e-d.left-d.right,g=t-d.top-d.bottom;return Kn(Kn({brushBottom:h},d),{},{width:Math.max(p,0),height:Math.max(g,0)})}),Tx=C(Pe,e=>({x:e.left,y:e.top,width:e.width,height:e.height}));C(wt,St,(e,t)=>({x:0,y:0,width:e,height:t}));var Dx=v.createContext(null),Ze=()=>v.useContext(Dx)!=null,aa=e=>e.brush,oa=C([aa,Pe,Vh],(e,t,r)=>({height:e.height,x:W(e.x)?e.x:t.left,y:W(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:W(e.width)?e.width:t.width})),jx=v.createContext({width:-1,height:-1}),Yh=()=>v.useContext(jx);function Gh(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Xh=()=>{var e,t=Ze(),r=Q(Tx),n=Q(oa),i=(e=Q(aa))===null||e===void 0?void 0:e.padding;return!t||!n||!i?r:{width:n.width-i.left-i.right,height:n.height-i.top-i.bottom,x:i.left,y:i.top}},Nx=()=>Q(wt),$x=()=>Q(St),J=e=>e.layout.layoutType,vn=()=>Q(J),Rx=()=>{var e=vn();if(e==="horizontal"||e==="vertical")return e},Lx=()=>{var e=vn();return e!==void 0},ua=e=>{var t=Me(),r=Ze(),{width:n,height:i}=e,a=Yh(),o=n,u=i;return a&&(o=a.width>0?a.width:n,u=a.height>0?a.height:i),v.useEffect(()=>{!r&&mi(o)&&mi(u)&&t(nx({width:o,height:u}))},[t,r,o,u]),null},Zh=Symbol.for("immer-nothing"),mc=Symbol.for("immer-draftable"),Re=Symbol.for("immer-state");function Ve(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Jr=Object.getPrototypeOf;function xr(e){return!!e&&!!e[Re]}function rr(e){var t;return e?Qh(e)||Array.isArray(e)||!!e[mc]||!!((t=e.constructor)!=null&&t[mc])||pn(e)||sa(e):!1}var zx=Object.prototype.constructor.toString(),gc=new WeakMap;function Qh(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=gc.get(r);return n===void 0&&(n=Function.toString.call(r),gc.set(r,n)),n===zx}function gi(e,t,r=!0){la(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function la(e){const t=e[Re];return t?t.type_:Array.isArray(e)?1:pn(e)?2:sa(e)?3:0}function ru(e,t){return la(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Jh(e,t,r){const n=la(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Fx(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function pn(e){return e instanceof Map}function sa(e){return e instanceof Set}function Kt(e){return e.copy_||e.base_}function nu(e,t){if(pn(e))return new Map(e);if(sa(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=Qh(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Re];let i=Reflect.ownKeys(n);for(let a=0;a<i.length;a++){const o=i[a],u=n[o];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[o]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[o]})}return Object.create(Jr(e),n)}else{const n=Jr(e);if(n!==null&&r)return{...e};const i=Object.create(n);return Object.assign(i,e)}}function tl(e,t=!1){return ca(e)||xr(e)||!rr(e)||(la(e)>1&&Object.defineProperties(e,{set:qn,add:qn,clear:qn,delete:qn}),Object.freeze(e),t&&Object.values(e).forEach(r=>tl(r,!0))),e}function Bx(){Ve(2)}var qn={value:Bx};function ca(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Ux={};function nr(e){const t=Ux[e];return t||Ve(0,e),t}var en;function ev(){return en}function Kx(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function yc(e,t){t&&(nr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function iu(e){au(e),e.drafts_.forEach(qx),e.drafts_=null}function au(e){e===en&&(en=e.parent_)}function bc(e){return en=Kx(en,e)}function qx(e){const t=e[Re];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function xc(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Re].modified_&&(iu(t),Ve(4)),rr(e)&&(e=yi(t,e),t.parent_||bi(t,e)),t.patches_&&nr("Patches").generateReplacementPatches_(r[Re].base_,e,t.patches_,t.inversePatches_)):e=yi(t,r,[]),iu(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Zh?e:void 0}function yi(e,t,r){if(ca(t))return t;const n=e.immer_.shouldUseStrictIteration(),i=t[Re];if(!i)return gi(t,(a,o)=>wc(e,i,t,a,o,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return bi(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,u=!1;i.type_===3&&(o=new Set(a),a.clear(),u=!0),gi(o,(l,s)=>wc(e,i,a,l,s,r,u),n),bi(e,a,!1),r&&e.patches_&&nr("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function wc(e,t,r,n,i,a,o){if(i==null||typeof i!="object"&&!o)return;const u=ca(i);if(!(u&&!o)){if(xr(i)){const l=a&&t&&t.type_!==3&&!ru(t.assigned_,n)?a.concat(n):void 0,s=yi(e,i,l);if(Jh(r,n,s),xr(s))e.canAutoFreeze_=!1;else return}else o&&r.add(i);if(rr(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===i&&u)return;yi(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(pn(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&bi(e,i)}}}function bi(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&tl(t,r)}function Wx(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:ev(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,a=rl;r&&(i=[n],a=tn);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return n.draft_=u,n.revoke_=o,u}var rl={get(e,t){if(t===Re)return e;const r=Kt(e);if(!ru(r,t))return Hx(e,r,t);const n=r[t];return e.finalized_||!rr(n)?n:n===lo(e.base_,t)?(so(e),e.copy_[t]=uu(n,e)):n},has(e,t){return t in Kt(e)},ownKeys(e){return Reflect.ownKeys(Kt(e))},set(e,t,r){const n=tv(Kt(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=lo(Kt(e),t),a=i==null?void 0:i[Re];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Fx(r,i)&&(r!==void 0||ru(e.base_,t)))return!0;so(e),ou(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return lo(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,so(e),ou(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Kt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ve(11)},getPrototypeOf(e){return Jr(e.base_)},setPrototypeOf(){Ve(12)}},tn={};gi(rl,(e,t)=>{tn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});tn.deleteProperty=function(e,t){return tn.set.call(this,e,t,void 0)};tn.set=function(e,t,r){return rl.set.call(this,e[0],t,r,e[0])};function lo(e,t){const r=e[Re];return(r?Kt(r):e)[t]}function Hx(e,t,r){var i;const n=tv(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function tv(e,t){if(!(t in e))return;let r=Jr(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Jr(r)}}function ou(e){e.modified_||(e.modified_=!0,e.parent_&&ou(e.parent_))}function so(e){e.copy_||(e.copy_=nu(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Vx=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const a=r;r=t;const o=this;return function(l=a,...s){return o.produce(l,c=>r.call(this,c,...s))}}typeof r!="function"&&Ve(6),n!==void 0&&typeof n!="function"&&Ve(7);let i;if(rr(t)){const a=bc(this),o=uu(t,void 0);let u=!0;try{i=r(o),u=!1}finally{u?iu(a):au(a)}return yc(a,n),xc(i,a)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Zh&&(i=void 0),this.autoFreeze_&&tl(i,!0),n){const a=[],o=[];nr("Patches").generateReplacementPatches_(t,i,a,o),n(a,o)}return i}else Ve(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...u)=>this.produceWithPatches(o,l=>t(l,...u));let n,i;return[this.produce(t,r,(o,u)=>{n=o,i=u}),n,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){rr(e)||Ve(8),xr(e)&&(e=Yx(e));const t=bc(this),r=uu(e,void 0);return r[Re].isManual_=!0,au(t),r}finishDraft(e,t){const r=e&&e[Re];(!r||!r.isManual_)&&Ve(9);const{scope_:n}=r;return yc(n,t),xc(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=nr("Patches").applyPatches_;return xr(e)?n(e,t):this.produce(e,i=>n(i,t))}};function uu(e,t){const r=pn(e)?nr("MapSet").proxyMap_(e,t):sa(e)?nr("MapSet").proxySet_(e,t):Wx(e,t);return(t?t.scope_:ev()).drafts_.push(r),r}function Yx(e){return xr(e)||Ve(10,e),rv(e)}function rv(e){if(!rr(e)||ca(e))return e;const t=e[Re];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=nu(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=nu(e,!0);return gi(r,(i,a)=>{Jh(r,i,rv(a))},n),t&&(t.finalized_=!1),r}var Gx=new Vx;Gx.produce;var Xx={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},nv=ke({name:"legend",initialState:Xx,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:te()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,i=Ge(e).payload.indexOf(r);i>-1&&(e.payload[i]=n)},prepare:te()},removeLegendPayload:{reducer(e,t){var r=Ge(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:te()}}}),{setLegendSize:yM,setLegendSettings:bM,addLegendPayload:Zx,replaceLegendPayload:Qx,removeLegendPayload:Jx}=nv.actions,e1=nv.reducer,t1=()=>{var e;return(e=Q(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function lu(){return lu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lu.apply(null,arguments)}function Sc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ic(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sc(Object(r),!0).forEach(function(n){r1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function r1(e,t,r){return(t=n1(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n1(e){var t=i1(e,"string");return typeof t=="symbol"?t:t+""}function i1(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Pc={curveBasisClosed:e0,curveBasisOpen:t0,curveBasis:Jy,curveBumpX:Zy,curveBumpY:Qy,curveLinearClosed:r0,curveLinear:Wi,curveMonotoneX:n0,curveMonotoneY:i0,curveNatural:a0,curveStep:o0,curveStepAfter:l0,curveStepBefore:u0},xi=e=>ne(e.x)&&ne(e.y),Cc=e=>e.base!=null&&xi(e.base)&&xi(e),Nr=e=>e.x,$r=e=>e.y,a1=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(Wu(e));return(r==="curveMonotone"||r==="curveBump")&&t?Pc["".concat(r).concat(t==="vertical"?"Y":"X")]:Pc[r]||Wi},o1=e=>{var{type:t="linear",points:r=[],baseLine:n,layout:i,connectNulls:a=!1}=e,o=a1(t,i),u=a?r.filter(xi):r,l;if(Array.isArray(n)){var s=r.map((h,p)=>Ic(Ic({},h),{},{base:n[p]}));i==="vertical"?l=Ln().y($r).x1(Nr).x0(h=>h.base.x):l=Ln().x(Nr).y1($r).y0(h=>h.base.y);var c=l.defined(Cc).curve(o),f=a?s.filter(Cc):s;return c(f)}i==="vertical"&&W(n)?l=Ln().y($r).x1(Nr).x0(n):W(n)?l=Ln().x(Nr).y1($r).y0(n):l=Zd().x(Nr).y($r);var d=l.defined(xi).curve(o);return d(u)},co=e=>{var{className:t,points:r,path:n,pathRef:i}=e,a=vn();if((!r||!r.length)&&!n)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=r&&r.length?o1(o):n;return v.createElement("path",lu({},Zt(e),Hu(e),{className:ot("recharts-curve",t),d:u===null?void 0:u,ref:i}))};function Ac(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _c(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ac(Object(r),!0).forEach(function(n){u1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ac(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function u1(e,t,r){return(t=l1(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l1(e){var t=s1(e,"string");return typeof t=="symbol"?t:t+""}function s1(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var c1=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,n)=>r.filter(i=>n.includes(i))),rn=(e,t)=>Object.keys(t).reduce((r,n)=>_c(_c({},r),{},{[n]:e(n,t[n])}),{});function Oc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Oc(Object(r),!0).forEach(function(n){f1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function f1(e,t,r){return(t=d1(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d1(e){var t=h1(e,"string");return typeof t=="symbol"?t:t+""}function h1(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wi=(e,t,r)=>e+(t-e)*r,su=e=>{var{from:t,to:r}=e;return t!==r},iv=(e,t,r)=>{var n=rn((i,a)=>{if(su(a)){var[o,u]=e(a.from,a.to,a.velocity);return se(se({},a),{},{from:o,velocity:u})}return a},t);return r<1?rn((i,a)=>su(a)&&n[i]!=null?se(se({},a),{},{velocity:wi(a.velocity,n[i].velocity,r),from:wi(a.from,n[i].from,r)}):a,t):iv(e,n,r-1)};function v1(e,t,r,n,i,a){var o,u=n.reduce((d,h)=>se(se({},d),{},{[h]:{from:e[h],velocity:0,to:t[h]}}),{}),l=()=>rn((d,h)=>h.from,u),s=()=>!Object.values(u).filter(su).length,c=null,f=d=>{o||(o=d);var h=d-o,p=h/r.dt;u=iv(r,u,p),i(se(se(se({},e),t),l())),o=d,s()||(c=a.setTimeout(f))};return()=>(c=a.setTimeout(f),()=>{var d;(d=c)===null||d===void 0||d()})}function p1(e,t,r,n,i,a,o){var u=null,l=i.reduce((f,d)=>{var h=e[d],p=t[d];return h==null||p==null?f:se(se({},f),{},{[d]:[h,p]})},{}),s,c=f=>{s||(s=f);var d=(f-s)/n,h=rn((g,m)=>wi(...m,r(d)),l);if(a(se(se(se({},e),t),h)),d<1)u=o.setTimeout(c);else{var p=rn((g,m)=>wi(...m,r(1)),l);a(se(se(se({},e),t),p))}};return()=>(u=o.setTimeout(c),()=>{var f;(f=u)===null||f===void 0||f()})}const m1=(e,t,r,n,i,a)=>{var o=c1(e,t);return r==null?()=>(i(se(se({},e),t)),()=>{}):r.isStepper===!0?v1(e,t,r,o,i,a):p1(e,t,r,n,o,i,a)};var Si=1e-4,av=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],ov=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),Ec=(e,t)=>r=>{var n=av(e,t);return ov(n,r)},g1=(e,t)=>r=>{var n=av(e,t),i=[...n.map((a,o)=>a*o).slice(1),0];return ov(i,r)},y1=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var i=n.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},b1=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length===1)switch(r[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=y1(r[0]);if(i)return i}}return r.length===4?r:[0,0,1,1]},x1=(e,t,r,n)=>{var i=Ec(e,r),a=Ec(t,n),o=g1(e,r),u=s=>s>1?1:s<0?0:s,l=s=>{for(var c=s>1?1:s,f=c,d=0;d<8;++d){var h=i(f)-c,p=o(f);if(Math.abs(h-c)<Si||p<Si)return a(f);f=u(f-h/p)}return a(f)};return l.isStepper=!1,l},Mc=function(){return x1(...b1(...arguments))},w1=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:n=8,dt:i=17}=t,a=(o,u,l)=>{var s=-(o-u)*r,c=l*n,f=l+(s-c)*i/1e3,d=l*i/1e3+o;return Math.abs(d-u)<Si&&Math.abs(f)<Si?[u,0]:[d,f]};return a.isStepper=!0,a.dt=i,a},S1=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Mc(e);case"spring":return w1();default:if(e.split("(")[0]==="cubic-bezier")return Mc(e)}return typeof e=="function"?e:null};function I1(e){var t,r=()=>null,n=!1,i=null,a=o=>{if(!n){if(Array.isArray(o)){if(!o.length)return;var u=o,[l,...s]=u;if(typeof l=="number"){i=e.setTimeout(a.bind(null,s),l);return}a(l),i=e.setTimeout(a.bind(null,s));return}typeof o=="string"&&(t=o,r(t)),typeof o=="object"&&(t=o,r(t)),typeof o=="function"&&o()}};return{stop:()=>{n=!0},start:o=>{n=!1,i&&(i(),i=null),a(o)},subscribe:o=>(r=o,()=>{r=()=>null}),getTimeoutController:()=>e}}class P1{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),i=null,a=o=>{o-n>=r?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function C1(){return I1(new P1)}var A1=v.createContext(C1);function _1(e,t){var r=v.useContext(A1);return v.useMemo(()=>t??r(e),[e,t,r])}var O1=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),fa={isSsr:O1()},E1={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},kc={t:0},fo={t:1};function M1(e){var t=Ar(e,E1),{isActive:r,canBegin:n,duration:i,easing:a,begin:o,onAnimationEnd:u,onAnimationStart:l,children:s}=t,c=r==="auto"?!fa.isSsr:r,f=_1(t.animationId,t.animationManager),[d,h]=v.useState(c?kc:fo),p=v.useRef(null);return v.useEffect(()=>{c||h(fo)},[c]),v.useEffect(()=>{if(!c||!n)return Vi;var g=m1(kc,fo,S1(a),i,h,f.getTimeoutController()),m=()=>{p.current=g()};return f.start([l,o,m,i,u]),()=>{f.stop(),p.current&&p.current(),u()}},[c,n,i,a,o,l,u,f]),s(d.t)}function k1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=v.useRef(Gr(t)),n=v.useRef(e);return n.current!==e&&(r.current=Gr(t),n.current=e),r.current}function Tc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Dc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tc(Object(r),!0).forEach(function(n){T1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function T1(e,t,r){return(t=D1(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D1(e){var t=j1(e,"string");return typeof t=="symbol"?t:t+""}function j1(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jc=Math.PI/180,N1=e=>e*180/Math.PI,wr=(e,t,r,n)=>({x:e+Math.cos(-jc*n)*r,y:t+Math.sin(-jc*n)*r}),$1=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},R1=(e,t)=>{var{x:r,y:n}=e,{x:i,y:a}=t;return Math.sqrt((r-i)**2+(n-a)**2)},L1=(e,t)=>{var{x:r,y:n}=e,{cx:i,cy:a}=t,o=R1({x:r,y:n},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var u=(r-i)/o,l=Math.acos(u);return n>a&&(l=2*Math.PI-l),{radius:o,angle:N1(l),angleInRadian:l}},z1=e=>{var{startAngle:t,endAngle:r}=e,n=Math.floor(t/360),i=Math.floor(r/360),a=Math.min(n,i);return{startAngle:t-a*360,endAngle:r-a*360}},F1=(e,t)=>{var{startAngle:r,endAngle:n}=t,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return e+o*360},B1=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:i,angle:a}=L1({x:r,y:n},t),{innerRadius:o,outerRadius:u}=t;if(i<o||i>u||i===0)return null;var{startAngle:l,endAngle:s}=z1(t),c=a,f;if(l<=s){for(;c>s;)c-=360;for(;c<l;)c+=360;f=c>=l&&c<=s}else{for(;c>l;)c-=360;for(;c<s;)c+=360;f=c>=s&&c<=l}return f?Dc(Dc({},t),{},{radius:i,angle:F1(c,t)}):null},ho={},vo={},po={},Nc;function U1(){return Nc||(Nc=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hh();function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r}(po)),po}var $c;function K1(){return $c||($c=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=U1();function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r}(vo)),vo}var Rc;function q1(){return Rc||(Rc=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vh(),r=K1();function n(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=r.toFinite(i),a===void 0?(a=i,i=0):a=r.toFinite(a),o=o===void 0?i<a?1:-1:r.toFinite(o);const u=Math.max(Math.ceil((a-i)/(o||1)),0),l=new Array(u);for(let s=0;s<u;s++)l[s]=i,i+=o;return l}e.range=n}(ho)),ho}var mo,Lc;function W1(){return Lc||(Lc=1,mo=q1().range),mo}var H1=W1();const uv=Cr(H1);function Dt(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function V1(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function nl(e){let t,r,n;e.length!==2?(t=Dt,r=(u,l)=>Dt(e(u),l),n=(u,l)=>e(u)-l):(t=e===Dt||e===V1?e:Y1,r=e,n=e);function i(u,l,s=0,c=u.length){if(s<c){if(t(l,l)!==0)return c;do{const f=s+c>>>1;r(u[f],l)<0?s=f+1:c=f}while(s<c)}return s}function a(u,l,s=0,c=u.length){if(s<c){if(t(l,l)!==0)return c;do{const f=s+c>>>1;r(u[f],l)<=0?s=f+1:c=f}while(s<c)}return s}function o(u,l,s=0,c=u.length){const f=i(u,l,s,c-1);return f>s&&n(u[f-1],l)>-n(u[f],l)?f-1:f}return{left:i,center:o,right:a}}function Y1(){return 0}function lv(e){return e===null?NaN:+e}function*G1(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const X1=nl(Dt),mn=X1.right;nl(lv).center;class zc extends Map{constructor(t,r=J1){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Fc(this,t))}has(t){return super.has(Fc(this,t))}set(t,r){return super.set(Z1(this,t),r)}delete(t){return super.delete(Q1(this,t))}}function Fc({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function Z1({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Q1({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function J1(e){return e!==null&&typeof e=="object"?e.valueOf():e}function ew(e=Dt){if(e===Dt)return sv;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function sv(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const tw=Math.sqrt(50),rw=Math.sqrt(10),nw=Math.sqrt(2);function Ii(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=tw?10:a>=rw?5:a>=nw?2:1;let u,l,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(e*s),l=Math.round(t*s),u/s<e&&++u,l/s>t&&--l,s=-s):(s=Math.pow(10,i)*o,u=Math.round(e/s),l=Math.round(t/s),u*s<e&&++u,l*s>t&&--l),l<u&&.5<=r&&r<2?Ii(e,t,r*2):[u,l,s]}function cu(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,a,o]=n?Ii(t,e,r):Ii(e,t,r);if(!(a>=i))return[];const u=a-i+1,l=new Array(u);if(n)if(o<0)for(let s=0;s<u;++s)l[s]=(a-s)/-o;else for(let s=0;s<u;++s)l[s]=(a-s)*o;else if(o<0)for(let s=0;s<u;++s)l[s]=(i+s)/-o;else for(let s=0;s<u;++s)l[s]=(i+s)*o;return l}function fu(e,t,r){return t=+t,e=+e,r=+r,Ii(e,t,r)[2]}function du(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?fu(t,e,r):fu(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function Bc(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function Uc(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function cv(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?sv:ew(i);n>r;){if(n-r>600){const l=n-r+1,s=t-r+1,c=Math.log(l),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(l-f)/l)*(s-l/2<0?-1:1),h=Math.max(r,Math.floor(t-s*f/l+d)),p=Math.min(n,Math.floor(t+(l-s)*f/l+d));cv(e,t,h,p,i)}const a=e[t];let o=r,u=n;for(Rr(e,r,t),i(e[n],a)>0&&Rr(e,r,n);o<u;){for(Rr(e,o,u),++o,--u;i(e[o],a)<0;)++o;for(;i(e[u],a)>0;)--u}i(e[r],a)===0?Rr(e,r,u):(++u,Rr(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function Rr(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function iw(e,t,r){if(e=Float64Array.from(G1(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Uc(e);if(t>=1)return Bc(e);var n,i=(n-1)*t,a=Math.floor(i),o=Bc(cv(e,a).subarray(0,a+1)),u=Uc(e.subarray(a+1));return o+(u-o)*(i-a)}}function aw(e,t,r=lv){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function ow(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n<i;)a[n]=e+n*r;return a}function qe(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function It(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 hu=Symbol("implicit");function il(){var e=new zc,t=[],r=[],n=hu;function i(a){let o=e.get(a);if(o===void 0){if(n!==hu)return n;e.set(a,o=t.push(a)-1)}return r[o%r.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new zc;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return il(t,r).unknown(n)},qe.apply(i,arguments),i}function al(){var e=il().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,a,o,u=!1,l=0,s=0,c=.5;delete e.unknown;function f(){var d=t().length,h=i<n,p=h?i:n,g=h?n:i;a=(g-p)/Math.max(1,d-l+s*2),u&&(a=Math.floor(a)),p+=(g-p-a*(d-l))*c,o=a*(1-l),u&&(p=Math.round(p),o=Math.round(o));var m=ow(d).map(function(y){return p+a*y});return r(h?m.reverse():m)}return e.domain=function(d){return arguments.length?(t(d),f()):t()},e.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,f()):[n,i]},e.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,u=!0,f()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(d){return arguments.length?(u=!!d,f()):u},e.padding=function(d){return arguments.length?(l=Math.min(1,s=+d),f()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),f()):l},e.paddingOuter=function(d){return arguments.length?(s=+d,f()):s},e.align=function(d){return arguments.length?(c=Math.max(0,Math.min(1,d)),f()):c},e.copy=function(){return al(t(),[n,i]).round(u).paddingInner(l).paddingOuter(s).align(c)},qe.apply(f(),arguments)}function fv(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return fv(t())},e}function uw(){return fv(al.apply(null,arguments).paddingInner(1))}function ol(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function dv(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function gn(){}var nn=.7,Pi=1/nn,yr="\\s*([+-]?\\d+)\\s*",an="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",nt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lw=/^#([0-9a-f]{3,8})$/,sw=new RegExp(`^rgb\\(${yr},${yr},${yr}\\)$`),cw=new RegExp(`^rgb\\(${nt},${nt},${nt}\\)$`),fw=new RegExp(`^rgba\\(${yr},${yr},${yr},${an}\\)$`),dw=new RegExp(`^rgba\\(${nt},${nt},${nt},${an}\\)$`),hw=new RegExp(`^hsl\\(${an},${nt},${nt}\\)$`),vw=new RegExp(`^hsla\\(${an},${nt},${nt},${an}\\)$`),Kc={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};ol(gn,on,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qc,formatHex:qc,formatHex8:pw,formatHsl:mw,formatRgb:Wc,toString:Wc});function qc(){return this.rgb().formatHex()}function pw(){return this.rgb().formatHex8()}function mw(){return hv(this).formatHsl()}function Wc(){return this.rgb().formatRgb()}function on(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=lw.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Hc(t):r===3?new Ee(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Wn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Wn(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=sw.exec(e))?new Ee(t[1],t[2],t[3],1):(t=cw.exec(e))?new Ee(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=fw.exec(e))?Wn(t[1],t[2],t[3],t[4]):(t=dw.exec(e))?Wn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hw.exec(e))?Gc(t[1],t[2]/100,t[3]/100,1):(t=vw.exec(e))?Gc(t[1],t[2]/100,t[3]/100,t[4]):Kc.hasOwnProperty(e)?Hc(Kc[e]):e==="transparent"?new Ee(NaN,NaN,NaN,0):null}function Hc(e){return new Ee(e>>16&255,e>>8&255,e&255,1)}function Wn(e,t,r,n){return n<=0&&(e=t=r=NaN),new Ee(e,t,r,n)}function gw(e){return e instanceof gn||(e=on(e)),e?(e=e.rgb(),new Ee(e.r,e.g,e.b,e.opacity)):new Ee}function vu(e,t,r,n){return arguments.length===1?gw(e):new Ee(e,t,r,n??1)}function Ee(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}ol(Ee,vu,dv(gn,{brighter(e){return e=e==null?Pi:Math.pow(Pi,e),new Ee(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?nn:Math.pow(nn,e),new Ee(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ee(Yt(this.r),Yt(this.g),Yt(this.b),Ci(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:Vc,formatHex:Vc,formatHex8:yw,formatRgb:Yc,toString:Yc}));function Vc(){return`#${Wt(this.r)}${Wt(this.g)}${Wt(this.b)}`}function yw(){return`#${Wt(this.r)}${Wt(this.g)}${Wt(this.b)}${Wt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Yc(){const e=Ci(this.opacity);return`${e===1?"rgb(":"rgba("}${Yt(this.r)}, ${Yt(this.g)}, ${Yt(this.b)}${e===1?")":`, ${e})`}`}function Ci(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Yt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wt(e){return e=Yt(e),(e<16?"0":"")+e.toString(16)}function Gc(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ye(e,t,r,n)}function hv(e){if(e instanceof Ye)return new Ye(e.h,e.s,e.l,e.opacity);if(e instanceof gn||(e=on(e)),!e)return new Ye;if(e instanceof Ye)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,u=a-i,l=(a+i)/2;return u?(t===a?o=(r-n)/u+(r<n)*6:r===a?o=(n-t)/u+2:o=(t-r)/u+4,u/=l<.5?a+i:2-a-i,o*=60):u=l>0&&l<1?0:o,new Ye(o,u,l,e.opacity)}function bw(e,t,r,n){return arguments.length===1?hv(e):new Ye(e,t,r,n??1)}function Ye(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}ol(Ye,bw,dv(gn,{brighter(e){return e=e==null?Pi:Math.pow(Pi,e),new Ye(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nn:Math.pow(nn,e),new Ye(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,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Ee(go(e>=240?e-240:e+120,i,n),go(e,i,n),go(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Ye(Xc(this.h),Hn(this.s),Hn(this.l),Ci(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=Ci(this.opacity);return`${e===1?"hsl(":"hsla("}${Xc(this.h)}, ${Hn(this.s)*100}%, ${Hn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Xc(e){return e=(e||0)%360,e<0?e+360:e}function Hn(e){return Math.max(0,Math.min(1,e||0))}function go(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const ul=e=>()=>e;function xw(e,t){return function(r){return e+r*t}}function ww(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Sw(e){return(e=+e)==1?vv:function(t,r){return r-t?ww(t,r,e):ul(isNaN(t)?r:t)}}function vv(e,t){var r=t-e;return r?xw(e,r):ul(isNaN(e)?t:e)}const Zc=function e(t){var r=Sw(t);function n(i,a){var o=r((i=vu(i)).r,(a=vu(a)).r),u=r(i.g,a.g),l=r(i.b,a.b),s=vv(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=u(c),i.b=l(c),i.opacity=s(c),i+""}}return n.gamma=e,n}(1);function Iw(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function Pw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Cw(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=_r(e[o],t[o]);for(;o<r;++o)a[o]=t[o];return function(u){for(o=0;o<n;++o)a[o]=i[o](u);return a}}function Aw(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Ai(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function _w(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=_r(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var pu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yo=new RegExp(pu.source,"g");function Ow(e){return function(){return e}}function Ew(e){return function(t){return e(t)+""}}function Mw(e,t){var r=pu.lastIndex=yo.lastIndex=0,n,i,a,o=-1,u=[],l=[];for(e=e+"",t=t+"";(n=pu.exec(e))&&(i=yo.exec(t));)(a=i.index)>r&&(a=t.slice(r,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,l.push({i:o,x:Ai(n,i)})),r=yo.lastIndex;return r<t.length&&(a=t.slice(r),u[o]?u[o]+=a:u[++o]=a),u.length<2?l[0]?Ew(l[0].x):Ow(t):(t=l.length,function(s){for(var c=0,f;c<t;++c)u[(f=l[c]).i]=f.x(s);return u.join("")})}function _r(e,t){var r=typeof t,n;return t==null||r==="boolean"?ul(t):(r==="number"?Ai:r==="string"?(n=on(t))?(t=n,Zc):Mw:t instanceof on?Zc:t instanceof Date?Aw:Pw(t)?Iw:Array.isArray(t)?Cw:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?_w:Ai)(e,t)}function ll(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function kw(e,t){t===void 0&&(t=e,e=_r);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(o){var u=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return a[u](o-u)}}function Tw(e){return function(){return e}}function _i(e){return+e}var Qc=[0,1];function Ce(e){return e}function mu(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Tw(isNaN(t)?NaN:.5)}function Dw(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function jw(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i<n?(n=mu(i,n),a=r(o,a)):(n=mu(n,i),a=r(a,o)),function(u){return a(n(u))}}function Nw(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),a=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)i[o]=mu(e[o],e[o+1]),a[o]=r(t[o],t[o+1]);return function(u){var l=mn(e,u,1,n)-1;return a[l](i[l](u))}}function yn(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function da(){var e=Qc,t=Qc,r=_r,n,i,a,o=Ce,u,l,s;function c(){var d=Math.min(e.length,t.length);return o!==Ce&&(o=Dw(e[0],e[d-1])),u=d>2?Nw:jw,l=s=null,f}function f(d){return d==null||isNaN(d=+d)?a:(l||(l=u(e.map(n),t,r)))(n(o(d)))}return f.invert=function(d){return o(i((s||(s=u(t,e.map(n),Ai)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,_i),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),r=ll,c()},f.clamp=function(d){return arguments.length?(o=d?!0:Ce,c()):o!==Ce},f.interpolate=function(d){return arguments.length?(r=d,c()):r},f.unknown=function(d){return arguments.length?(a=d,f):a},function(d,h){return n=d,i=h,c()}}function sl(){return da()(Ce,Ce)}function $w(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Oi(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Sr(e){return e=Oi(Math.abs(e)),e?e[1]:NaN}function Rw(e,t){return function(r,n){for(var i=r.length,a=[],o=0,u=e[0],l=0;i>0&&u>0&&(l+u+1>n&&(u=Math.max(1,n-l)),a.push(r.substring(i-=u,i+u)),!((l+=u+1)>n));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Lw(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var zw=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function un(e){if(!(t=zw.exec(e)))throw new Error("invalid format: "+e);var t;return new cl({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]})}un.prototype=cl.prototype;function cl(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+""}cl.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 Fw(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var pv;function Bw(e,t){var r=Oi(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(pv=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Oi(e,Math.max(0,t+a-1))[0]}function Jc(e,t){var r=Oi(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const ef={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:$w,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)=>Jc(e*100,t),r:Jc,s:Bw,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function tf(e){return e}var rf=Array.prototype.map,nf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Uw(e){var t=e.grouping===void 0||e.thousands===void 0?tf:Rw(rf.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?tf:Lw(rf.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function s(f){f=un(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,y=f.width,x=f.comma,w=f.precision,S=f.trim,b=f.type;b==="n"?(x=!0,b="g"):ef[b]||(w===void 0&&(w=12),S=!0,b="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var P=g==="$"?r:g==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",E=g==="$"?n:/[%p]/.test(b)?o:"",k=ef[b],D=/[defgprs%]/.test(b);w=w===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function z(O){var M=P,K=E,$,ae,ge;if(b==="c")K=k(O)+K,O="";else{O=+O;var Te=O<0||1/O<0;if(O=isNaN(O)?l:k(Math.abs(O),w),S&&(O=Fw(O)),Te&&+O==0&&p!=="+"&&(Te=!1),M=(Te?p==="("?p:u:p==="-"||p==="("?"":p)+M,K=(b==="s"?nf[8+pv/3]:"")+K+(Te&&p==="("?")":""),D){for($=-1,ae=O.length;++$<ae;)if(ge=O.charCodeAt($),48>ge||ge>57){K=(ge===46?i+O.slice($+1):O.slice($))+K,O=O.slice(0,$);break}}}x&&!m&&(O=t(O,1/0));var Oe=M.length+O.length+K.length,he=Oe<y?new Array(y-Oe+1).join(d):"";switch(x&&m&&(O=t(he+O,he.length?y-K.length:1/0),he=""),h){case"<":O=M+O+K+he;break;case"=":O=M+he+O+K;break;case"^":O=he.slice(0,Oe=he.length>>1)+M+O+K+he.slice(Oe);break;default:O=he+M+O+K;break}return a(O)}return z.toString=function(){return f+""},z}function c(f,d){var h=s((f=un(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Sr(d)/3)))*3,g=Math.pow(10,-p),m=nf[8+p/3];return function(y){return h(g*y)+m}}return{format:s,formatPrefix:c}}var Vn,fl,mv;Kw({thousands:",",grouping:[3],currency:["$",""]});function Kw(e){return Vn=Uw(e),fl=Vn.format,mv=Vn.formatPrefix,Vn}function qw(e){return Math.max(0,-Sr(Math.abs(e)))}function Ww(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sr(t)/3)))*3-Sr(Math.abs(e)))}function Hw(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Sr(t)-Sr(e))+1}function gv(e,t,r,n){var i=du(e,t,r),a;switch(n=un(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=Ww(i,o))&&(n.precision=a),mv(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Hw(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=qw(i))&&(n.precision=a-(n.type==="%")*2);break}}return fl(n)}function $t(e){var t=e.domain;return e.ticks=function(r){var n=t();return cu(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return gv(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],u=n[a],l,s,c=10;for(u<o&&(s=o,o=u,u=s,s=i,i=a,a=s);c-- >0;){if(s=fu(o,u,r),s===l)return n[i]=o,n[a]=u,t(n);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;l=s}return e},e}function yv(){var e=sl();return e.copy=function(){return yn(e,yv())},qe.apply(e,arguments),$t(e)}function bv(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,_i),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return bv(e).unknown(t)},e=arguments.length?Array.from(e,_i):[0,1],$t(r)}function xv(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return a<i&&(o=r,r=n,n=o,o=i,i=a,a=o),e[r]=t.floor(i),e[n]=t.ceil(a),e}function af(e){return Math.log(e)}function of(e){return Math.exp(e)}function Vw(e){return-Math.log(-e)}function Yw(e){return-Math.exp(-e)}function Gw(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Xw(e){return e===10?Gw:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Zw(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 uf(e){return(t,r)=>-e(-t,r)}function dl(e){const t=e(af,of),r=t.domain;let n=10,i,a;function o(){return i=Zw(n),a=Xw(n),r()[0]<0?(i=uf(i),a=uf(a),e(Vw,Yw)):e(af,of),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const l=r();let s=l[0],c=l[l.length-1];const f=c<s;f&&([s,c]=[c,s]);let d=i(s),h=i(c),p,g;const m=u==null?10:+u;let y=[];if(!(n%1)&&h-d<m){if(d=Math.floor(d),h=Math.ceil(h),s>0){for(;d<=h;++d)for(p=1;p<n;++p)if(g=d<0?p/a(-d):p*a(d),!(g<s)){if(g>c)break;y.push(g)}}else for(;d<=h;++d)for(p=n-1;p>=1;--p)if(g=d>0?p/a(-d):p*a(d),!(g<s)){if(g>c)break;y.push(g)}y.length*2<m&&(y=cu(s,c,m))}else y=cu(d,h,Math.min(h-d,m)).map(a);return f?y.reverse():y},t.tickFormat=(u,l)=>{if(u==null&&(u=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=un(l)).precision==null&&(l.trim=!0),l=fl(l)),u===1/0)return l;const s=Math.max(1,n*u/t.ticks().length);return c=>{let f=c/a(Math.round(i(c)));return f*n<n-.5&&(f*=n),f<=s?l(c):""}},t.nice=()=>r(xv(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function wv(){const e=dl(da()).domain([1,10]);return e.copy=()=>yn(e,wv()).base(e.base()),qe.apply(e,arguments),e}function lf(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function sf(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function hl(e){var t=1,r=e(lf(t),sf(t));return r.constant=function(n){return arguments.length?e(lf(t=+n),sf(t)):t},$t(r)}function Sv(){var e=hl(da());return e.copy=function(){return yn(e,Sv()).constant(e.constant())},qe.apply(e,arguments)}function cf(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Qw(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Jw(e){return e<0?-e*e:e*e}function vl(e){var t=e(Ce,Ce),r=1;function n(){return r===1?e(Ce,Ce):r===.5?e(Qw,Jw):e(cf(r),cf(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},$t(t)}function pl(){var e=vl(da());return e.copy=function(){return yn(e,pl()).exponent(e.exponent())},qe.apply(e,arguments),e}function eS(){return pl.apply(null,arguments).exponent(.5)}function ff(e){return Math.sign(e)*e*e}function tS(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Iv(){var e=sl(),t=[0,1],r=!1,n;function i(a){var o=tS(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(ff(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,_i)).map(ff)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Iv(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},qe.apply(i,arguments),$t(i)}function Pv(){var e=[],t=[],r=[],n;function i(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o<u;)r[o-1]=aw(e,o/u);return a}function a(o){return o==null||isNaN(o=+o)?n:t[mn(r,o)]}return a.invertExtent=function(o){var u=t.indexOf(o);return u<0?[NaN,NaN]:[u>0?r[u-1]:e[0],u<r.length?r[u]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let u of o)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(Dt),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(n=o,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return Pv().domain(e).range(t).unknown(n)},qe.apply(a,arguments)}function Cv(){var e=0,t=1,r=1,n=[.5],i=[0,1],a;function o(l){return l!=null&&l<=l?i[mn(n,l,0,r)]:a}function u(){var l=-1;for(n=new Array(r);++l<r;)n[l]=((l+1)*t-(l-r)*e)/(r+1);return o}return o.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,u()):[e,t]},o.range=function(l){return arguments.length?(r=(i=Array.from(l)).length-1,u()):i.slice()},o.invertExtent=function(l){var s=i.indexOf(l);return s<0?[NaN,NaN]:s<1?[e,n[0]]:s>=r?[n[r-1],t]:[n[s-1],n[s]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Cv().domain([e,t]).range(i).unknown(a)},qe.apply($t(o),arguments)}function Av(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[mn(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Av().domain(e).range(t).unknown(r)},qe.apply(i,arguments)}const bo=new Date,xo=new Date;function ce(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o<u-a?o:u},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const l=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<o)||!(u>0))return l;let s;do l.push(s=new Date(+a)),t(a,u),e(a);while(s<a&&a<o);return l},i.filter=a=>ce(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(bo.setTime(+a),xo.setTime(+o),e(bo),e(xo),Math.floor(r(bo,xo))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Ei=ce(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ei.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ce(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Ei);Ei.range;const dt=1e3,Fe=dt*60,ht=Fe*60,mt=ht*24,ml=mt*7,df=mt*30,wo=mt*365,Ht=ce(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*dt)},(e,t)=>(t-e)/dt,e=>e.getUTCSeconds());Ht.range;const gl=ce(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*dt)},(e,t)=>{e.setTime(+e+t*Fe)},(e,t)=>(t-e)/Fe,e=>e.getMinutes());gl.range;const yl=ce(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Fe)},(e,t)=>(t-e)/Fe,e=>e.getUTCMinutes());yl.range;const bl=ce(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*dt-e.getMinutes()*Fe)},(e,t)=>{e.setTime(+e+t*ht)},(e,t)=>(t-e)/ht,e=>e.getHours());bl.range;const xl=ce(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ht)},(e,t)=>(t-e)/ht,e=>e.getUTCHours());xl.range;const bn=ce(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Fe)/mt,e=>e.getDate()-1);bn.range;const ha=ce(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/mt,e=>e.getUTCDate()-1);ha.range;const _v=ce(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/mt,e=>Math.floor(e/mt));_v.range;function or(e){return ce(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Fe)/ml)}const va=or(0),Mi=or(1),rS=or(2),nS=or(3),Ir=or(4),iS=or(5),aS=or(6);va.range;Mi.range;rS.range;nS.range;Ir.range;iS.range;aS.range;function ur(e){return ce(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/ml)}const pa=ur(0),ki=ur(1),oS=ur(2),uS=ur(3),Pr=ur(4),lS=ur(5),sS=ur(6);pa.range;ki.range;oS.range;uS.range;Pr.range;lS.range;sS.range;const wl=ce(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());wl.range;const Sl=ce(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());Sl.range;const gt=ce(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());gt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ce(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});gt.range;const yt=ce(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());yt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ce(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});yt.range;function Ov(e,t,r,n,i,a){const o=[[Ht,1,dt],[Ht,5,5*dt],[Ht,15,15*dt],[Ht,30,30*dt],[a,1,Fe],[a,5,5*Fe],[a,15,15*Fe],[a,30,30*Fe],[i,1,ht],[i,3,3*ht],[i,6,6*ht],[i,12,12*ht],[n,1,mt],[n,2,2*mt],[r,1,ml],[t,1,df],[t,3,3*df],[e,1,wo]];function u(s,c,f){const d=c<s;d&&([s,c]=[c,s]);const h=f&&typeof f.range=="function"?f:l(s,c,f),p=h?h.range(s,+c+1):[];return d?p.reverse():p}function l(s,c,f){const d=Math.abs(c-s)/f,h=nl(([,,m])=>m).right(o,d);if(h===o.length)return e.every(du(s/wo,c/wo,f));if(h===0)return Ei.every(Math.max(du(s,c,f),1));const[p,g]=o[d/o[h-1][2]<o[h][2]/d?h-1:h];return p.every(g)}return[u,l]}const[cS,fS]=Ov(yt,Sl,pa,_v,xl,yl),[dS,hS]=Ov(gt,wl,va,bn,bl,gl);function So(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 Io(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 Lr(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function vS(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,o=e.shortDays,u=e.months,l=e.shortMonths,s=zr(i),c=Fr(i),f=zr(a),d=Fr(a),h=zr(o),p=Fr(o),g=zr(u),m=Fr(u),y=zr(l),x=Fr(l),w={a:Te,A:Oe,b:he,B:Qe,c:null,d:yf,e:yf,f:RS,g:VS,G:GS,H:jS,I:NS,j:$S,L:Ev,m:LS,M:zS,p:Je,q:et,Q:wf,s:Sf,S:FS,u:BS,U:US,V:KS,w:qS,W:WS,x:null,X:null,y:HS,Y:YS,Z:XS,"%":xf},S={a:ut,A:B,b:L,B:N,c:null,d:bf,e:bf,f:eI,g:cI,G:dI,H:ZS,I:QS,j:JS,L:kv,m:tI,M:rI,p:U,q:ye,Q:wf,s:Sf,S:nI,u:iI,U:aI,V:oI,w:uI,W:lI,x:null,X:null,y:sI,Y:fI,Z:hI,"%":xf},b={a:z,A:O,b:M,B:K,c:$,d:mf,e:mf,f:MS,g:pf,G:vf,H:gf,I:gf,j:AS,L:ES,m:CS,M:_S,p:D,q:PS,Q:TS,s:DS,S:OS,u:bS,U:xS,V:wS,w:yS,W:SS,x:ae,X:ge,y:pf,Y:vf,Z:IS,"%":kS};w.x=P(r,w),w.X=P(n,w),w.c=P(t,w),S.x=P(r,S),S.X=P(n,S),S.c=P(t,S);function P(A,R){return function(F){var _=[],X=-1,q=0,be=A.length,oe,We,Le;for(F instanceof Date||(F=new Date(+F));++X<be;)A.charCodeAt(X)===37&&(_.push(A.slice(q,X)),(We=hf[oe=A.charAt(++X)])!=null?oe=A.charAt(++X):We=oe==="e"?" ":"0",(Le=R[oe])&&(oe=Le(F,We)),_.push(oe),q=X+1);return _.push(A.slice(q,X)),_.join("")}}function E(A,R){return function(F){var _=Lr(1900,void 0,1),X=k(_,A,F+="",0),q,be;if(X!=F.length)return null;if("Q"in _)return new Date(_.Q);if("s"in _)return new Date(_.s*1e3+("L"in _?_.L:0));if(R&&!("Z"in _)&&(_.Z=0),"p"in _&&(_.H=_.H%12+_.p*12),_.m===void 0&&(_.m="q"in _?_.q:0),"V"in _){if(_.V<1||_.V>53)return null;"w"in _||(_.w=1),"Z"in _?(q=Io(Lr(_.y,0,1)),be=q.getUTCDay(),q=be>4||be===0?ki.ceil(q):ki(q),q=ha.offset(q,(_.V-1)*7),_.y=q.getUTCFullYear(),_.m=q.getUTCMonth(),_.d=q.getUTCDate()+(_.w+6)%7):(q=So(Lr(_.y,0,1)),be=q.getDay(),q=be>4||be===0?Mi.ceil(q):Mi(q),q=bn.offset(q,(_.V-1)*7),_.y=q.getFullYear(),_.m=q.getMonth(),_.d=q.getDate()+(_.w+6)%7)}else("W"in _||"U"in _)&&("w"in _||(_.w="u"in _?_.u%7:"W"in _?1:0),be="Z"in _?Io(Lr(_.y,0,1)).getUTCDay():So(Lr(_.y,0,1)).getDay(),_.m=0,_.d="W"in _?(_.w+6)%7+_.W*7-(be+5)%7:_.w+_.U*7-(be+6)%7);return"Z"in _?(_.H+=_.Z/100|0,_.M+=_.Z%100,Io(_)):So(_)}}function k(A,R,F,_){for(var X=0,q=R.length,be=F.length,oe,We;X<q;){if(_>=be)return-1;if(oe=R.charCodeAt(X++),oe===37){if(oe=R.charAt(X++),We=b[oe in hf?R.charAt(X++):oe],!We||(_=We(A,F,_))<0)return-1}else if(oe!=F.charCodeAt(_++))return-1}return _}function D(A,R,F){var _=s.exec(R.slice(F));return _?(A.p=c.get(_[0].toLowerCase()),F+_[0].length):-1}function z(A,R,F){var _=h.exec(R.slice(F));return _?(A.w=p.get(_[0].toLowerCase()),F+_[0].length):-1}function O(A,R,F){var _=f.exec(R.slice(F));return _?(A.w=d.get(_[0].toLowerCase()),F+_[0].length):-1}function M(A,R,F){var _=y.exec(R.slice(F));return _?(A.m=x.get(_[0].toLowerCase()),F+_[0].length):-1}function K(A,R,F){var _=g.exec(R.slice(F));return _?(A.m=m.get(_[0].toLowerCase()),F+_[0].length):-1}function $(A,R,F){return k(A,t,R,F)}function ae(A,R,F){return k(A,r,R,F)}function ge(A,R,F){return k(A,n,R,F)}function Te(A){return o[A.getDay()]}function Oe(A){return a[A.getDay()]}function he(A){return l[A.getMonth()]}function Qe(A){return u[A.getMonth()]}function Je(A){return i[+(A.getHours()>=12)]}function et(A){return 1+~~(A.getMonth()/3)}function ut(A){return o[A.getUTCDay()]}function B(A){return a[A.getUTCDay()]}function L(A){return l[A.getUTCMonth()]}function N(A){return u[A.getUTCMonth()]}function U(A){return i[+(A.getUTCHours()>=12)]}function ye(A){return 1+~~(A.getUTCMonth()/3)}return{format:function(A){var R=P(A+="",w);return R.toString=function(){return A},R},parse:function(A){var R=E(A+="",!1);return R.toString=function(){return A},R},utcFormat:function(A){var R=P(A+="",S);return R.toString=function(){return A},R},utcParse:function(A){var R=E(A+="",!0);return R.toString=function(){return A},R}}}var hf={"-":"",_:" ",0:"0"},pe=/^\s*\d+/,pS=/^%/,mS=/[\\^$*+?|[\]().{}]/g;function H(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(t)+i:i)}function gS(e){return e.replace(mS,"\\$&")}function zr(e){return new RegExp("^(?:"+e.map(gS).join("|")+")","i")}function Fr(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function yS(e,t,r){var n=pe.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function bS(e,t,r){var n=pe.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function xS(e,t,r){var n=pe.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function wS(e,t,r){var n=pe.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function SS(e,t,r){var n=pe.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function vf(e,t,r){var n=pe.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function pf(e,t,r){var n=pe.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function IS(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function PS(e,t,r){var n=pe.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function CS(e,t,r){var n=pe.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function mf(e,t,r){var n=pe.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function AS(e,t,r){var n=pe.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function gf(e,t,r){var n=pe.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function _S(e,t,r){var n=pe.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function OS(e,t,r){var n=pe.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function ES(e,t,r){var n=pe.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function MS(e,t,r){var n=pe.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function kS(e,t,r){var n=pS.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function TS(e,t,r){var n=pe.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function DS(e,t,r){var n=pe.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function yf(e,t){return H(e.getDate(),t,2)}function jS(e,t){return H(e.getHours(),t,2)}function NS(e,t){return H(e.getHours()%12||12,t,2)}function $S(e,t){return H(1+bn.count(gt(e),e),t,3)}function Ev(e,t){return H(e.getMilliseconds(),t,3)}function RS(e,t){return Ev(e,t)+"000"}function LS(e,t){return H(e.getMonth()+1,t,2)}function zS(e,t){return H(e.getMinutes(),t,2)}function FS(e,t){return H(e.getSeconds(),t,2)}function BS(e){var t=e.getDay();return t===0?7:t}function US(e,t){return H(va.count(gt(e)-1,e),t,2)}function Mv(e){var t=e.getDay();return t>=4||t===0?Ir(e):Ir.ceil(e)}function KS(e,t){return e=Mv(e),H(Ir.count(gt(e),e)+(gt(e).getDay()===4),t,2)}function qS(e){return e.getDay()}function WS(e,t){return H(Mi.count(gt(e)-1,e),t,2)}function HS(e,t){return H(e.getFullYear()%100,t,2)}function VS(e,t){return e=Mv(e),H(e.getFullYear()%100,t,2)}function YS(e,t){return H(e.getFullYear()%1e4,t,4)}function GS(e,t){var r=e.getDay();return e=r>=4||r===0?Ir(e):Ir.ceil(e),H(e.getFullYear()%1e4,t,4)}function XS(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+H(t/60|0,"0",2)+H(t%60,"0",2)}function bf(e,t){return H(e.getUTCDate(),t,2)}function ZS(e,t){return H(e.getUTCHours(),t,2)}function QS(e,t){return H(e.getUTCHours()%12||12,t,2)}function JS(e,t){return H(1+ha.count(yt(e),e),t,3)}function kv(e,t){return H(e.getUTCMilliseconds(),t,3)}function eI(e,t){return kv(e,t)+"000"}function tI(e,t){return H(e.getUTCMonth()+1,t,2)}function rI(e,t){return H(e.getUTCMinutes(),t,2)}function nI(e,t){return H(e.getUTCSeconds(),t,2)}function iI(e){var t=e.getUTCDay();return t===0?7:t}function aI(e,t){return H(pa.count(yt(e)-1,e),t,2)}function Tv(e){var t=e.getUTCDay();return t>=4||t===0?Pr(e):Pr.ceil(e)}function oI(e,t){return e=Tv(e),H(Pr.count(yt(e),e)+(yt(e).getUTCDay()===4),t,2)}function uI(e){return e.getUTCDay()}function lI(e,t){return H(ki.count(yt(e)-1,e),t,2)}function sI(e,t){return H(e.getUTCFullYear()%100,t,2)}function cI(e,t){return e=Tv(e),H(e.getUTCFullYear()%100,t,2)}function fI(e,t){return H(e.getUTCFullYear()%1e4,t,4)}function dI(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Pr(e):Pr.ceil(e),H(e.getUTCFullYear()%1e4,t,4)}function hI(){return"+0000"}function xf(){return"%"}function wf(e){return+e}function Sf(e){return Math.floor(+e/1e3)}var cr,Dv,jv;vI({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 vI(e){return cr=vS(e),Dv=cr.format,cr.parse,jv=cr.utcFormat,cr.utcParse,cr}function pI(e){return new Date(e)}function mI(e){return e instanceof Date?+e:+new Date(+e)}function Il(e,t,r,n,i,a,o,u,l,s){var c=sl(),f=c.invert,d=c.domain,h=s(".%L"),p=s(":%S"),g=s("%I:%M"),m=s("%I %p"),y=s("%a %d"),x=s("%b %d"),w=s("%B"),S=s("%Y");function b(P){return(l(P)<P?h:u(P)<P?p:o(P)<P?g:a(P)<P?m:n(P)<P?i(P)<P?y:x:r(P)<P?w:S)(P)}return c.invert=function(P){return new Date(f(P))},c.domain=function(P){return arguments.length?d(Array.from(P,mI)):d().map(pI)},c.ticks=function(P){var E=d();return e(E[0],E[E.length-1],P??10)},c.tickFormat=function(P,E){return E==null?b:s(E)},c.nice=function(P){var E=d();return(!P||typeof P.range!="function")&&(P=t(E[0],E[E.length-1],P??10)),P?d(xv(E,P)):c},c.copy=function(){return yn(c,Il(e,t,r,n,i,a,o,u,l,s))},c}function gI(){return qe.apply(Il(dS,hS,gt,wl,va,bn,bl,gl,Ht,Dv).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function yI(){return qe.apply(Il(cS,fS,yt,Sl,pa,ha,xl,yl,Ht,jv).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ma(){var e=0,t=1,r,n,i,a,o=Ce,u=!1,l;function s(f){return f==null||isNaN(f=+f)?l:o(i===0?.5:(f=(a(f)-r)*i,u?Math.max(0,Math.min(1,f)):f))}s.domain=function(f){return arguments.length?([e,t]=f,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),s):[e,t]},s.clamp=function(f){return arguments.length?(u=!!f,s):u},s.interpolator=function(f){return arguments.length?(o=f,s):o};function c(f){return function(d){var h,p;return arguments.length?([h,p]=d,o=f(h,p),s):[o(0),o(1)]}}return s.range=c(_r),s.rangeRound=c(ll),s.unknown=function(f){return arguments.length?(l=f,s):l},function(f){return a=f,r=f(e),n=f(t),i=r===n?0:1/(n-r),s}}function Rt(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Nv(){var e=$t(ma()(Ce));return e.copy=function(){return Rt(e,Nv())},It.apply(e,arguments)}function $v(){var e=dl(ma()).domain([1,10]);return e.copy=function(){return Rt(e,$v()).base(e.base())},It.apply(e,arguments)}function Rv(){var e=hl(ma());return e.copy=function(){return Rt(e,Rv()).constant(e.constant())},It.apply(e,arguments)}function Pl(){var e=vl(ma());return e.copy=function(){return Rt(e,Pl()).exponent(e.exponent())},It.apply(e,arguments)}function bI(){return Pl.apply(null,arguments).exponent(.5)}function Lv(){var e=[],t=Ce;function r(n){if(n!=null&&!isNaN(n=+n))return t((mn(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Dt),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>iw(e,a/n))},r.copy=function(){return Lv(t).domain(e)},It.apply(r,arguments)}function ga(){var e=0,t=.5,r=1,n=1,i,a,o,u,l,s=Ce,c,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+c(g))-a)*(n*g<n*a?u:l),s(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t,r]=g,i=c(e=+e),a=c(t=+t),o=c(r=+r),u=i===a?0:.5/(a-i),l=a===o?0:.5/(o-a),n=a<i?-1:1,h):[e,t,r]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(s=g,h):s};function p(g){return function(m){var y,x,w;return arguments.length?([y,x,w]=m,s=kw(g,[y,x,w]),h):[s(0),s(.5),s(1)]}}return h.range=p(_r),h.rangeRound=p(ll),h.unknown=function(g){return arguments.length?(d=g,h):d},function(g){return c=g,i=g(e),a=g(t),o=g(r),u=i===a?0:.5/(a-i),l=a===o?0:.5/(o-a),n=a<i?-1:1,h}}function zv(){var e=$t(ga()(Ce));return e.copy=function(){return Rt(e,zv())},It.apply(e,arguments)}function Fv(){var e=dl(ga()).domain([.1,1,10]);return e.copy=function(){return Rt(e,Fv()).base(e.base())},It.apply(e,arguments)}function Bv(){var e=hl(ga());return e.copy=function(){return Rt(e,Bv()).constant(e.constant())},It.apply(e,arguments)}function Cl(){var e=vl(ga());return e.copy=function(){return Rt(e,Cl()).exponent(e.exponent())},It.apply(e,arguments)}function xI(){return Cl.apply(null,arguments).exponent(.5)}const Ur=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:al,scaleDiverging:zv,scaleDivergingLog:Fv,scaleDivergingPow:Cl,scaleDivergingSqrt:xI,scaleDivergingSymlog:Bv,scaleIdentity:bv,scaleImplicit:hu,scaleLinear:yv,scaleLog:wv,scaleOrdinal:il,scalePoint:uw,scalePow:pl,scaleQuantile:Pv,scaleQuantize:Cv,scaleRadial:Iv,scaleSequential:Nv,scaleSequentialLog:$v,scaleSequentialPow:Pl,scaleSequentialQuantile:Lv,scaleSequentialSqrt:bI,scaleSequentialSymlog:Rv,scaleSqrt:eS,scaleSymlog:Sv,scaleThreshold:Av,scaleTime:gI,scaleUtc:yI,tickFormat:gv},Symbol.toStringTag,{value:"Module"}));var Pt=e=>e.chartData,Uv=C([Pt],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Kv=(e,t,r,n)=>n?Uv(e):Pt(e),wI=(e,t,r)=>r?Uv(e):Pt(e);function Nt(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(ne(t)&&ne(r))return!0}return!1}function If(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function qv(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,i,a;if(ne(r))i=r;else if(typeof r=="function")return;if(ne(n))a=n;else if(typeof n=="function")return;var o=[i,a];if(Nt(o))return o}}function SI(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(Nt(n))return If(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,u;if(i==="auto")t!=null&&(o=Math.min(...t));else if(W(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&fc.test(i)){var l=fc.exec(i);if(l==null||l[1]==null||t==null)o=void 0;else{var s=+l[1];o=t[0]-s}}else o=t==null?void 0:t[0];if(a==="auto")t!=null&&(u=Math.max(...t));else if(W(a))u=a;else if(typeof a=="function")try{t!=null&&(u=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&dc.test(a)){var c=dc.exec(a);if(c==null||c[1]==null||t==null)u=void 0;else{var f=+c[1];u=t[1]+f}}else u=t==null?void 0:t[1];var d=[o,u];if(Nt(d))return t==null?d:If(d,t,r)}}}var Or=1e9,II={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},_l,re=!0,Ke="[DecimalError] ",Gt=Ke+"Invalid argument: ",Al=Ke+"Exponent out of range: ",Er=Math.floor,qt=Math.pow,PI=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,je,ve=1e7,ee=7,Wv=9007199254740991,Ti=Er(Wv/ee),T={};T.absoluteValue=T.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};T.comparedTo=T.cmp=function(e){var t,r,n,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};T.decimalPlaces=T.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ee;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};T.dividedBy=T.div=function(e){return vt(this,new this.constructor(e))};T.dividedToIntegerBy=T.idiv=function(e){var t=this,r=t.constructor;return G(vt(t,new r(e),0,1),r.precision)};T.equals=T.eq=function(e){return!this.cmp(e)};T.exponent=function(){return le(this)};T.greaterThan=T.gt=function(e){return this.cmp(e)>0};T.greaterThanOrEqualTo=T.gte=function(e){return this.cmp(e)>=0};T.isInteger=T.isint=function(){return this.e>this.d.length-2};T.isNegative=T.isneg=function(){return this.s<0};T.isPositive=T.ispos=function(){return this.s>0};T.isZero=function(){return this.s===0};T.lessThan=T.lt=function(e){return this.cmp(e)<0};T.lessThanOrEqualTo=T.lte=function(e){return this.cmp(e)<1};T.logarithm=T.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(je))throw Error(Ke+"NaN");if(r.s<1)throw Error(Ke+(r.s?"NaN":"-Infinity"));return r.eq(je)?new n(0):(re=!1,t=vt(ln(r,a),ln(e,a),a),re=!0,G(t,i))};T.minus=T.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Yv(t,e):Hv(t,(e.s=-e.s,e))};T.modulo=T.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Ke+"NaN");return r.s?(re=!1,t=vt(r,e,0,1).times(e),re=!0,r.minus(t)):G(new n(r),i)};T.naturalExponential=T.exp=function(){return Vv(this)};T.naturalLogarithm=T.ln=function(){return ln(this)};T.negated=T.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};T.plus=T.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Hv(t,e):Yv(t,(e.s=-e.s,e))};T.precision=T.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Gt+e);if(t=le(i)+1,n=i.d.length-1,r=n*ee+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};T.squareRoot=T.sqrt=function(){var e,t,r,n,i,a,o,u=this,l=u.constructor;if(u.s<1){if(!u.s)return new l(0);throw Error(Ke+"NaN")}for(e=le(u),re=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=tt(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Er((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(vt(u,a,o+2)).times(.5),tt(a.d).slice(0,o)===(t=tt(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(G(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;o+=4}return re=!0,G(n,r)};T.times=T.mul=function(e){var t,r,n,i,a,o,u,l,s,c=this,f=c.constructor,d=c.d,h=(e=new f(e)).d;if(!c.s||!e.s)return new f(0);for(e.s*=c.s,r=c.e+e.e,l=d.length,s=h.length,l<s&&(a=d,d=h,h=a,o=l,l=s,s=o),a=[],o=l+s,n=o;n--;)a.push(0);for(n=s;--n>=0;){for(t=0,i=l+n;i>n;)u=a[i]+h[n]*d[i-n-1]+t,a[i--]=u%ve|0,t=u/ve|0;a[i]=(a[i]+t)%ve|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,re?G(e,f.precision):e};T.toDecimalPlaces=T.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(at(e,0,Or),t===void 0?t=n.rounding:at(t,0,8),G(r,e+le(r)+1,t))};T.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ir(n,!0):(at(e,0,Or),t===void 0?t=i.rounding:at(t,0,8),n=G(new i(n),e+1,t),r=ir(n,!0,e+1)),r};T.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?ir(i):(at(e,0,Or),t===void 0?t=a.rounding:at(t,0,8),n=G(new a(i),e+le(i)+1,t),r=ir(n.abs(),!1,e+le(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};T.toInteger=T.toint=function(){var e=this,t=e.constructor;return G(new t(e),le(e)+1,t.rounding)};T.toNumber=function(){return+this};T.toPower=T.pow=function(e){var t,r,n,i,a,o,u=this,l=u.constructor,s=12,c=+(e=new l(e));if(!e.s)return new l(je);if(u=new l(u),!u.s){if(e.s<1)throw Error(Ke+"Infinity");return u}if(u.eq(je))return u;if(n=l.precision,e.eq(je))return G(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=u.s,o){if((r=c<0?-c:c)<=Wv){for(i=new l(je),t=Math.ceil(n/ee+4),re=!1;r%2&&(i=i.times(u),Cf(i.d,t)),r=Er(r/2),r!==0;)u=u.times(u),Cf(u.d,t);return re=!0,e.s<0?new l(je).div(i):G(i,n)}}else if(a<0)throw Error(Ke+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,re=!1,i=e.times(ln(u,n+s)),re=!0,i=Vv(i),i.s=a,i};T.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=le(i),n=ir(i,r<=a.toExpNeg||r>=a.toExpPos)):(at(e,1,Or),t===void 0?t=a.rounding:at(t,0,8),i=G(new a(i),e,t),r=le(i),n=ir(i,e<=r||r<=a.toExpNeg,e)),n};T.toSignificantDigits=T.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(at(e,1,Or),t===void 0?t=n.rounding:at(t,0,8)),G(new n(r),e,t)};T.toString=T.valueOf=T.val=T.toJSON=T[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=le(e),r=e.constructor;return ir(e,t<=r.toExpNeg||t>=r.toExpPos)};function Hv(e,t){var r,n,i,a,o,u,l,s,c=e.constructor,f=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),re?G(t,f):t;if(l=e.d,s=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,u=s.length):(n=s,i=o,u=l.length),o=Math.ceil(f/ee),u=o>u?o+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=l.length,a=s.length,u-a<0&&(a=u,n=s,s=l,l=n),r=0;a;)r=(l[--a]=l[a]+s[a]+r)/ve|0,l[a]%=ve;for(r&&(l.unshift(r),++i),u=l.length;l[--u]==0;)l.pop();return t.d=l,t.e=i,re?G(t,f):t}function at(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Gt+e)}function tt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)n=e[t]+"",r=ee-n.length,r&&(a+=Et(r)),a+=n;o=e[t],n=o+"",r=ee-n.length,r&&(a+=Et(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var vt=function(){function e(n,i){var a,o=0,u=n.length;for(n=n.slice();u--;)a=n[u]*i+o,n[u]=a%ve|0,o=a/ve|0;return o&&n.unshift(o),n}function t(n,i,a,o){var u,l;if(a!=o)l=a>o?1:-1;else for(u=l=0;u<a;u++)if(n[u]!=i[u]){l=n[u]>i[u]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]<i[a]?1:0,n[a]=o*ve+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,o){var u,l,s,c,f,d,h,p,g,m,y,x,w,S,b,P,E,k,D=n.constructor,z=n.s==i.s?1:-1,O=n.d,M=i.d;if(!n.s)return new D(n);if(!i.s)throw Error(Ke+"Division by zero");for(l=n.e-i.e,E=M.length,b=O.length,h=new D(z),p=h.d=[],s=0;M[s]==(O[s]||0);)++s;if(M[s]>(O[s]||0)&&--l,a==null?x=a=D.precision:o?x=a+(le(n)-le(i))+1:x=a,x<0)return new D(0);if(x=x/ee+2|0,s=0,E==1)for(c=0,M=M[0],x++;(s<b||c)&&x--;s++)w=c*ve+(O[s]||0),p[s]=w/M|0,c=w%M|0;else{for(c=ve/(M[0]+1)|0,c>1&&(M=e(M,c),O=e(O,c),E=M.length,b=O.length),S=E,g=O.slice(0,E),m=g.length;m<E;)g[m++]=0;k=M.slice(),k.unshift(0),P=M[0],M[1]>=ve/2&&++P;do c=0,u=t(M,g,E,m),u<0?(y=g[0],E!=m&&(y=y*ve+(g[1]||0)),c=y/P|0,c>1?(c>=ve&&(c=ve-1),f=e(M,c),d=f.length,m=g.length,u=t(f,g,d,m),u==1&&(c--,r(f,E<d?k:M,d))):(c==0&&(u=c=1),f=M.slice()),d=f.length,d<m&&f.unshift(0),r(g,f,m),u==-1&&(m=g.length,u=t(M,g,E,m),u<1&&(c++,r(g,E<m?k:M,m))),m=g.length):u===0&&(c++,g=[0]),p[s++]=c,u&&g[0]?g[m++]=O[S]||0:(g=[O[S]],m=1);while((S++<b||g[0]!==void 0)&&x--)}return p[0]||p.shift(),h.e=l,G(h,o?a+le(h)+1:a)}}();function Vv(e,t){var r,n,i,a,o,u,l=0,s=0,c=e.constructor,f=c.precision;if(le(e)>16)throw Error(Al+le(e));if(!e.s)return new c(je);for(re=!1,u=f,o=new c(.03125);e.abs().gte(.1);)e=e.times(o),s+=5;for(n=Math.log(qt(2,s))/Math.LN10*2+5|0,u+=n,r=i=a=new c(je),c.precision=u;;){if(i=G(i.times(e),u),r=r.times(++l),o=a.plus(vt(i,r,u)),tt(o.d).slice(0,u)===tt(a.d).slice(0,u)){for(;s--;)a=G(a.times(a),u);return c.precision=f,t==null?(re=!0,G(a,f)):a}a=o}}function le(e){for(var t=e.e*ee,r=e.d[0];r>=10;r/=10)t++;return t}function Po(e,t,r){if(t>e.LN10.sd())throw re=!0,r&&(e.precision=r),Error(Ke+"LN10 precision limit exceeded");return G(new e(e.LN10),t)}function Et(e){for(var t="";e--;)t+="0";return t}function ln(e,t){var r,n,i,a,o,u,l,s,c,f=1,d=10,h=e,p=h.d,g=h.constructor,m=g.precision;if(h.s<1)throw Error(Ke+(h.s?"NaN":"-Infinity"));if(h.eq(je))return new g(0);if(t==null?(re=!1,s=m):s=t,h.eq(10))return t==null&&(re=!0),Po(g,s);if(s+=d,g.precision=s,r=tt(p),n=r.charAt(0),a=le(h),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=tt(h.d),n=r.charAt(0),f++;a=le(h),n>1?(h=new g("0."+r),a++):h=new g(n+"."+r.slice(1))}else return l=Po(g,s+2,m).times(a+""),h=ln(new g(n+"."+r.slice(1)),s-d).plus(l),g.precision=m,t==null?(re=!0,G(h,m)):h;for(u=o=h=vt(h.minus(je),h.plus(je),s),c=G(h.times(h),s),i=3;;){if(o=G(o.times(c),s),l=u.plus(vt(o,new g(i),s)),tt(l.d).slice(0,s)===tt(u.d).slice(0,s))return u=u.times(2),a!==0&&(u=u.plus(Po(g,s+2,m).times(a+""))),u=vt(u,new g(f),s),g.precision=m,t==null?(re=!0,G(u,m)):u;u=l,i+=2}}function Pf(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Er(r/ee),e.d=[],n=(r+1)%ee,r<0&&(n+=ee),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=ee;n<i;)e.d.push(+t.slice(n,n+=ee));t=t.slice(n),n=ee-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),re&&(e.e>Ti||e.e<-Ti))throw Error(Al+r)}else e.s=0,e.e=0,e.d=[0];return e}function G(e,t,r){var n,i,a,o,u,l,s,c,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=ee,i=t,s=f[c=0];else{if(c=Math.ceil((n+1)/ee),a=f.length,c>=a)return e;for(s=a=f[c],o=1;a>=10;a/=10)o++;n%=ee,i=n-ee+o}if(r!==void 0&&(a=qt(10,o-i-1),u=s/a%10|0,l=t<0||f[c+1]!==void 0||s%a,l=r<4?(u||l)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||l||r==6&&(n>0?i>0?s/qt(10,o-i):0:f[c-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return l?(a=le(e),f.length=1,t=t-a-1,f[0]=qt(10,(ee-t%ee)%ee),e.e=Er(-t/ee)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=c,a=1,c--):(f.length=c+1,a=qt(10,ee-n),f[c]=i>0?(s/qt(10,o-i)%qt(10,i)|0)*a:0),l)for(;;)if(c==0){(f[0]+=a)==ve&&(f[0]=1,++e.e);break}else{if(f[c]+=a,f[c]!=ve)break;f[c--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(re&&(e.e>Ti||e.e<-Ti))throw Error(Al+le(e));return e}function Yv(e,t){var r,n,i,a,o,u,l,s,c,f,d=e.constructor,h=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),re?G(t,h):t;if(l=e.d,f=t.d,n=t.e,s=e.e,l=l.slice(),o=s-n,o){for(c=o<0,c?(r=l,o=-o,u=f.length):(r=f,n=s,u=l.length),i=Math.max(Math.ceil(h/ee),u)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,u=f.length,c=i<u,c&&(u=i),i=0;i<u;i++)if(l[i]!=f[i]){c=l[i]<f[i];break}o=0}for(c&&(r=l,l=f,f=r,t.s=-t.s),u=l.length,i=f.length-u;i>0;--i)l[u++]=0;for(i=f.length;i>o;){if(l[--i]<f[i]){for(a=i;a&&l[--a]===0;)l[a]=ve-1;--l[a],l[i]+=ve}l[i]-=f[i]}for(;l[--u]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(t.d=l,t.e=n,re?G(t,h):t):new d(0)}function ir(e,t,r){var n,i=le(e),a=tt(e.d),o=a.length;return t?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Et(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Et(-i-1)+a,r&&(n=r-o)>0&&(a+=Et(n))):i>=o?(a+=Et(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Et(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Et(n))),e.s<0?"-"+a:a}function Cf(e,t){if(e.length>t)return e.length=t,!0}function Gv(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Gt+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return Pf(o,a.toString())}else if(typeof a!="string")throw Error(Gt+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,PI.test(a))Pf(o,a);else throw Error(Gt+a)}if(i.prototype=T,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Gv,i.config=i.set=CI,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function CI(e){if(!e||typeof e!="object")throw Error(Ke+"Object expected");var t,r,n,i=["precision",1,Or,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(Er(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Gt+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Gt+r+": "+n);return this}var _l=Gv(II);je=new _l(1);const Y=_l;var AI=e=>e,Xv={},Zv=e=>e===Xv,Af=e=>function t(){return arguments.length===0||arguments.length===1&&Zv(arguments.length<=0?void 0:arguments[0])?t:e(...arguments)},Qv=(e,t)=>e===1?t:Af(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var a=n.filter(o=>o!==Xv).length;return a>=e?t(...n):Qv(e-a,Af(function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];var s=n.map(c=>Zv(c)?u.shift():c);return t(...s,...u)}))}),_I=e=>Qv(e.length,e),gu=(e,t)=>{for(var r=[],n=e;n<t;++n)r[n-e]=n;return r},OI=_I((e,t)=>Array.isArray(t)?t.map(e):Object.keys(t).map(r=>t[r]).map(e)),EI=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return AI;var i=r.reverse(),a=i[0],o=i.slice(1);return function(){return o.reduce((u,l)=>l(u),a(...arguments))}};function Jv(e){var t;return e===0?t=1:t=Math.floor(new Y(e).abs().log(10).toNumber())+1,t}function ep(e,t,r){for(var n=new Y(e),i=0,a=[];n.lt(t)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var tp=e=>{var[t,r]=e,[n,i]=[t,r];return t>r&&([n,i]=[r,t]),[n,i]},rp=(e,t,r)=>{if(e.lte(0))return new Y(0);var n=Jv(e.toNumber()),i=new Y(10).pow(n),a=e.div(i),o=n!==1?.05:.1,u=new Y(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=u.mul(i);return t?new Y(l.toNumber()):new Y(Math.ceil(l.toNumber()))},MI=(e,t,r)=>{var n=new Y(1),i=new Y(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Y(10).pow(Jv(e)-1),i=new Y(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Y(Math.floor(e)))}else e===0?i=new Y(Math.floor((t-1)/2)):r||(i=new Y(Math.floor(e)));var o=Math.floor((t-1)/2),u=EI(OI(l=>i.add(new Y(l-o).mul(n)).toNumber()),gu);return u(0,t)},np=function(t,r,n,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(n-1)))return{step:new Y(0),tickMin:new Y(0),tickMax:new Y(0)};var o=rp(new Y(r).sub(t).div(n-1),i,a),u;t<=0&&r>=0?u=new Y(0):(u=new Y(t).add(r).div(2),u=u.sub(new Y(u).mod(o)));var l=Math.ceil(u.sub(t).div(o).toNumber()),s=Math.ceil(new Y(r).sub(u).div(o).toNumber()),c=l+s+1;return c>n?np(t,r,n,i,a+1):(c<n&&(s=r>0?s+(n-c):s,l=r>0?l:l+(n-c)),{step:o,tickMin:u.sub(new Y(l).mul(o)),tickMax:u.add(new Y(s).mul(o))})},kI=function(t){var[r,n]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),[u,l]=tp([r,n]);if(u===-1/0||l===1/0){var s=l===1/0?[u,...gu(0,i-1).map(()=>1/0)]:[...gu(0,i-1).map(()=>-1/0),l];return r>n?s.reverse():s}if(u===l)return MI(u,i,a);var{step:c,tickMin:f,tickMax:d}=np(u,l,o,a,0),h=ep(f,d.add(new Y(.1).mul(c)),c);return r>n?h.reverse():h},TI=function(t,r){var[n,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[o,u]=tp([n,i]);if(o===-1/0||u===1/0)return[n,i];if(o===u)return[o];var l=Math.max(r,2),s=rp(new Y(u).sub(o).div(l-1),a,0),c=[...ep(new Y(o),new Y(u),s),u];return a===!1&&(c=c.map(f=>Math.round(f))),n>i?c.reverse():c},DI=e=>e.rootProps.barCategoryGap,ya=e=>e.rootProps.stackOffset,ip=e=>e.rootProps.reverseStackOrder,Ol=e=>e.options.chartName,ap=e=>e.rootProps.syncId,jI=e=>e.rootProps.syncMethod,op=e=>e.options.eventEmitter,NI=e=>e.rootProps.baseValue,Lt={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},ft={allowDuplicatedCategory:!0,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"category"},De={allowDataOverflow:!1,allowDuplicatedCategory:!0,radiusAxisId:0,scale:"auto",tick:!0,tickCount:5,type:"number"},ba=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t},$I={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:ft.angleAxisId,includeHidden:!1,name:void 0,reversed:ft.reversed,scale:ft.scale,tick:ft.tick,tickCount:void 0,ticks:void 0,type:ft.type,unit:void 0},RI={allowDataOverflow:De.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:De.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:De.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:De.scale,tick:De.tick,tickCount:De.tickCount,ticks:void 0,type:De.type,unit:void 0},LI={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:ft.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:ft.angleAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:ft.scale,tick:ft.tick,tickCount:void 0,ticks:void 0,type:"number",unit:void 0},zI={allowDataOverflow:De.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:De.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:De.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:De.scale,tick:De.tick,tickCount:De.tickCount,ticks:void 0,type:"category",unit:void 0},El=(e,t)=>e.polarAxis.angleAxis[t]!=null?e.polarAxis.angleAxis[t]:e.layout.layoutType==="radial"?LI:$I,Ml=(e,t)=>e.polarAxis.radiusAxis[t]!=null?e.polarAxis.radiusAxis[t]:e.layout.layoutType==="radial"?zI:RI,xa=e=>e.polarOptions,kl=C([wt,St,Pe],$1),up=C([xa,kl],(e,t)=>{if(e!=null)return er(e.innerRadius,t,0)}),lp=C([xa,kl],(e,t)=>{if(e!=null)return er(e.outerRadius,t,t*.8)}),FI=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},sp=C([xa],FI);C([El,sp],ba);var cp=C([kl,up,lp],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});C([Ml,cp],ba);var fp=C([J,xa,up,lp,wt,St],(e,t,r,n,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:o,cy:u,startAngle:l,endAngle:s}=t;return{cx:er(o,i,i/2),cy:er(u,a,a/2),innerRadius:r,outerRadius:n,startAngle:l,endAngle:s,clockWise:!1}}}),fe=(e,t)=>t,wa=(e,t,r)=>r;function Tl(e){return e==null?void 0:e.id}function dp(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=r,o=new Map;return e.forEach(u=>{var l,s=(l=u.data)!==null&&l!==void 0?l:n;if(!(s==null||s.length===0)){var c=Tl(u);s.forEach((f,d)=>{var h=a==null||i?d:String(Se(f,a,null)),p=Se(f,u.dataKey,0),g;o.has(h)?g=o.get(h):g={},Object.assign(g,{[c]:p}),o.set(h,g)})}}),Array.from(o.values())}function Dl(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Sa=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Ia(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function BI(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}var de=e=>{var t=J(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Mr=e=>e.tooltip.settings.axisId;function _f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Di(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_f(Object(r),!0).forEach(function(n){UI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_f(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function UI(e,t,r){return(t=KI(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KI(e){var t=qI(e,"string");return typeof t=="symbol"?t:t+""}function qI(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yu=[0,"auto"],hp={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0},WI=(e,t)=>e.cartesianAxis.xAxis[t],Ct=(e,t)=>{var r=WI(e,t);return r??hp},vp={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:yu,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:hn},HI=(e,t)=>e.cartesianAxis.yAxis[t],At=(e,t)=>{var r=HI(e,t);return r??vp},VI={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},jl=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??VI},_e=(e,t,r)=>{switch(t){case"xAxis":return Ct(e,r);case"yAxis":return At(e,r);case"zAxis":return jl(e,r);case"angleAxis":return El(e,r);case"radiusAxis":return Ml(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},YI=(e,t,r)=>{switch(t){case"xAxis":return Ct(e,r);case"yAxis":return At(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},xn=(e,t,r)=>{switch(t){case"xAxis":return Ct(e,r);case"yAxis":return At(e,r);case"angleAxis":return El(e,r);case"radiusAxis":return Ml(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},pp=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function mp(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var gp=e=>e.graphicalItems.cartesianItems,GI=C([fe,wa],mp),yp=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),wn=C([gp,_e,GI],yp,{memoizeOptions:{resultEqualityCheck:Ia}}),bp=C([wn],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Dl)),xp=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),XI=C([wn],xp),wp=e=>e.map(t=>t.data).filter(Boolean).flat(1),ZI=C([wn],wp,{memoizeOptions:{resultEqualityCheck:Ia}}),Sp=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:i}=t;return e.length>0?e:r.slice(n,i+1)},Nl=C([ZI,Kv],Sp),Ip=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:Se(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(i=>({value:Se(i,n)}))):e.map(n=>({value:n})),Pa=C([Nl,_e,wn],Ip);function Pp(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Jn(e){if(Yr(e)||e instanceof Date){var t=Number(e);if(ne(t))return t}}function Of(e){if(Array.isArray(e)){var t=[Jn(e[0]),Jn(e[1])];return Nt(t)?t:void 0}var r=Jn(e);if(r!=null)return[r,r]}function bt(e){return e.map(Jn).filter(P0)}function QI(e,t,r){return!r||typeof t!="number"||it(t)?[]:r.length?bt(r.flatMap(n=>{var i=Se(e,n.dataKey),a,o;if(Array.isArray(i)?[a,o]=i:a=o=i,!(!ne(a)||!ne(o)))return[t-a,t+o]})):[]}var me=e=>{var t=de(e),r=Mr(e);return xn(e,t,r)},Sn=C([me],e=>e==null?void 0:e.dataKey),JI=C([bp,Kv,me],dp),Cp=(e,t,r,n)=>{var i={},a=t.reduce((o,u)=>{if(u.stackId==null)return o;var l=o[u.stackId];return l==null&&(l=[]),l.push(u),o[u.stackId]=l,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[u,l]=o,s=n?[...l].reverse():l,c=s.map(Tl);return[u,{stackedData:vx(e,c,r),graphicalItems:s}]}))},Ap=C([JI,bp,ya,ip],Cp),_p=(e,t,r,n)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(n==null&&r!=="zAxis"){var o=yx(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},eP=C([_e],e=>e.allowDataOverflow),$l=e=>{var t;if(e==null||!("domain"in e))return yu;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=bt(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:yu},Op=C([_e],$l),Ep=C([Op,eP],qv),tP=C([Ap,Pt,fe,Ep],_p,{memoizeOptions:{resultEqualityCheck:Sa}}),Rl=e=>e.errorBars,rP=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>Pp(r,n)),ji=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r.filter(Boolean);if(i.length!==0){var a=i.flat(),o=Math.min(...a),u=Math.max(...a);return[o,u]}},Mp=(e,t,r,n,i)=>{var a,o;if(r.length>0&&e.forEach(u=>{r.forEach(l=>{var s,c,f=(s=n[l.id])===null||s===void 0?void 0:s.filter(y=>Pp(i,y)),d=Se(u,(c=t.dataKey)!==null&&c!==void 0?c:l.dataKey),h=QI(u,d,f);if(h.length>=2){var p=Math.min(...h),g=Math.max(...h);(a==null||p<a)&&(a=p),(o==null||g>o)&&(o=g)}var m=Of(d);m!=null&&(a=a==null?m[0]:Math.min(a,m[0]),o=o==null?m[1]:Math.max(o,m[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(u=>{var l=Of(Se(u,t.dataKey));l!=null&&(a=a==null?l[0]:Math.min(a,l[0]),o=o==null?l[1]:Math.max(o,l[1]))}),ne(a)&&ne(o))return[a,o]},nP=C([Nl,_e,XI,Rl,fe],Mp,{memoizeOptions:{resultEqualityCheck:Sa}});function iP(e){var{value:t}=e;if(Yr(t)||t instanceof Date)return t}var aP=(e,t,r)=>{var n=e.map(iP).filter(i=>i!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&sh(n))?uv(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},kp=e=>e.referenceElements.dots,kr=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),oP=C([kp,fe,wa],kr),Tp=e=>e.referenceElements.areas,uP=C([Tp,fe,wa],kr),Dp=e=>e.referenceElements.lines,lP=C([Dp,fe,wa],kr),jp=(e,t)=>{if(e!=null){var r=bt(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},sP=C(oP,fe,jp),Np=(e,t)=>{if(e!=null){var r=bt(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},cP=C([uP,fe],Np);function fP(e){var t;if(e.x!=null)return bt([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:bt(r)}function dP(e){var t;if(e.y!=null)return bt([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:bt(r)}var $p=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?fP(n):dP(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},hP=C([lP,fe],$p),vP=C(sP,hP,cP,(e,t,r)=>ji(e,r,t)),Rp=(e,t,r,n,i,a,o,u)=>{if(r!=null)return r;var l=o==="vertical"&&u==="xAxis"||o==="horizontal"&&u==="yAxis",s=l?ji(n,a,i):ji(a,i);return SI(t,s,e.allowDataOverflow)},pP=C([_e,Op,Ep,tP,nP,vP,J,fe],Rp,{memoizeOptions:{resultEqualityCheck:Sa}}),mP=[0,1],Lp=(e,t,r,n,i,a,o)=>{if(!((e==null||r==null||r.length===0)&&o===void 0)){var{dataKey:u,type:l}=e,s=xt(t,a);if(s&&u==null){var c;return uv(0,(c=r==null?void 0:r.length)!==null&&c!==void 0?c:0)}return l==="category"?aP(n,e,s):i==="expand"?mP:o}},Ll=C([_e,J,Nl,Pa,ya,fe,pP],Lp),zp=(e,t,r,n,i)=>{if(e!=null){var{scale:a,type:o}=e;if(a==="auto")return t==="radial"&&i==="radiusAxis"?"band":t==="radial"&&i==="angleAxis"?"linear":o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?"point":o==="category"?"band":"linear";if(typeof a=="string"){var u="scale".concat(Wu(a));return u in Ur?u:"point"}}},In=C([_e,J,pp,Ol,fe],zp);function gP(e){if(e!=null){if(e in Ur)return Ur[e]();var t="scale".concat(Wu(e));if(t in Ur)return Ur[t]()}}function zl(e,t,r,n){if(!(r==null||n==null)){if(typeof e.scale=="function")return e.scale.copy().domain(r).range(n);var i=gP(t);if(i!=null){var a=i.domain(r).range(n);return cx(a),a}}}var Fp=(e,t,r)=>{var n=$l(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&Nt(e))return kI(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&Nt(e))return TI(e,t.tickCount,t.allowDecimals)}},Fl=C([Ll,xn,In],Fp),Bp=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Nt(t)&&Array.isArray(r)&&r.length>0){var i=t[0],a=r[0],o=t[1],u=r[r.length-1];return[Math.min(i,a),Math.max(o,u)]}return t},yP=C([_e,Ll,Fl,fe],Bp),bP=C(Pa,_e,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(bt(e.map(f=>f.value))).sort((f,d)=>f-d),i=n[0],a=n[n.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var u=0;u<n.length-1;u++){var l=n[u],s=n[u+1];if(!(l==null||s==null)){var c=s-l;r=Math.min(r,c)}}return r/o}}),Up=C(bP,J,DI,Pe,(e,t,r,n,i)=>i,(e,t,r,n,i)=>{if(!ne(e))return 0;var a=t==="vertical"?n.height:n.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=er(r,e*a),u=e*a/2;return u-o-(u-o)/a*o}return 0}),xP=(e,t,r)=>{var n=Ct(e,t);return n==null||typeof n.padding!="string"?0:Up(e,"xAxis",t,r,n.padding)},wP=(e,t,r)=>{var n=At(e,t);return n==null||typeof n.padding!="string"?0:Up(e,"yAxis",t,r,n.padding)},SP=C(Ct,xP,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((r=i.left)!==null&&r!==void 0?r:0)+t,right:((n=i.right)!==null&&n!==void 0?n:0)+t}}),IP=C(At,wP,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((r=i.top)!==null&&r!==void 0?r:0)+t,bottom:((n=i.bottom)!==null&&n!==void 0?n:0)+t}}),PP=C([Pe,SP,oa,aa,(e,t,r)=>r],(e,t,r,n,i)=>{var{padding:a}=n;return i?[a.left,r.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),CP=C([Pe,J,IP,oa,aa,(e,t,r)=>r],(e,t,r,n,i,a)=>{var{padding:o}=i;return a?[n.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),Pn=(e,t,r,n)=>{var i;switch(t){case"xAxis":return PP(e,r,n);case"yAxis":return CP(e,r,n);case"zAxis":return(i=jl(e,r))===null||i===void 0?void 0:i.range;case"angleAxis":return sp(e);case"radiusAxis":return cp(e,r);default:return}},Kp=C([_e,Pn],ba),Ca=C([_e,In,yP,Kp],zl);C([wn,Rl,fe],rP);function qp(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Aa=(e,t)=>t,_a=(e,t,r)=>r,AP=C(na,Aa,_a,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(qp)),_P=C(ia,Aa,_a,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(qp)),Wp=(e,t)=>({width:e.width,height:t.height}),OP=(e,t)=>{var r=typeof t.width=="number"?t.width:hn;return{width:r,height:e.height}};C(Pe,Ct,Wp);var EP=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},MP=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},kP=C(St,Pe,AP,Aa,_a,(e,t,r,n,i)=>{var a={},o;return r.forEach(u=>{var l=Wp(t,u);o==null&&(o=EP(t,n,e));var s=n==="top"&&!i||n==="bottom"&&i;a[u.id]=o-Number(s)*l.height,o+=(s?-1:1)*l.height}),a}),TP=C(wt,Pe,_P,Aa,_a,(e,t,r,n,i)=>{var a={},o;return r.forEach(u=>{var l=OP(t,u);o==null&&(o=MP(t,n,e));var s=n==="left"&&!i||n==="right"&&i;a[u.id]=o-Number(s)*l.width,o+=(s?-1:1)*l.width}),a}),DP=(e,t)=>{var r=Ct(e,t);if(r!=null)return kP(e,r.orientation,r.mirror)};C([Pe,Ct,DP,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}});var jP=(e,t)=>{var r=At(e,t);if(r!=null)return TP(e,r.orientation,r.mirror)};C([Pe,At,jP,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}});C(Pe,At,(e,t)=>{var r=typeof t.width=="number"?t.width:hn;return{width:r,height:e.height}});var Hp=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=r,u=xt(e,n),l=t.map(s=>s.value);if(o&&u&&a==="category"&&i&&sh(l))return l}},Bl=C([J,Pa,_e,fe],Hp),Vp=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:i,scale:a}=r,o=xt(e,n);if(o&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},Ul=C([J,Pa,xn,fe],Vp);C([J,YI,In,Ca,Bl,Ul,Pn,Fl,fe],(e,t,r,n,i,a,o,u,l)=>{if(t!=null){var s=xt(e,l);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:l,categoricalDomain:a,duplicateDomain:i,isCategorical:s,niceTicks:u,range:o,realScaleType:r,scale:n}}});var NP=(e,t,r,n,i,a,o,u,l)=>{if(!(t==null||n==null)){var s=xt(e,l),{type:c,ticks:f,tickCount:d}=t,h=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,p=c==="category"&&n.bandwidth?n.bandwidth()/h:0;p=l==="angleAxis"&&a!=null&&a.length>=2?kt(a[0]-a[1])*2*p:p;var g=f||i;if(g){var m=g.map((y,x)=>{var w=o?o.indexOf(y):y;return{index:x,coordinate:n(w)+p,value:y,offset:p}});return m.filter(y=>ne(y.coordinate))}return s&&u?u.map((y,x)=>({coordinate:n(y)+p,value:y,index:x,offset:p})).filter(y=>ne(y.coordinate)):n.ticks?n.ticks(d).map(y=>({coordinate:n(y)+p,value:y,offset:p})):n.domain().map((y,x)=>({coordinate:n(y)+p,value:o?o[y]:y,index:x,offset:p}))}};C([J,xn,In,Ca,Fl,Pn,Bl,Ul,fe],NP);var $P=(e,t,r,n,i,a,o)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var u=xt(e,o),{tickCount:l}=t,s=0;return s=o==="angleAxis"&&(n==null?void 0:n.length)>=2?kt(n[0]-n[1])*2*s:s,u&&a?a.map((c,f)=>({coordinate:r(c)+s,value:c,index:f,offset:s})):r.ticks?r.ticks(l).map(c=>({coordinate:r(c)+s,value:c,offset:s})):r.domain().map((c,f)=>({coordinate:r(c)+s,value:i?i[c]:c,index:f,offset:s}))}},Yp=C([J,xn,Ca,Pn,Bl,Ul,fe],$P),Gp=C(_e,Ca,(e,t)=>{if(!(e==null||t==null))return Di(Di({},e),{},{scale:t})}),RP=C([_e,In,Ll,Kp],zl);C((e,t,r)=>jl(e,r),RP,(e,t)=>{if(!(e==null||t==null))return Di(Di({},e),{},{scale:t})});var LP=C([J,na,ia],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),Xp=e=>e.options.defaultTooltipEventType,Zp=e=>e.options.validateTooltipEventTypes;function Qp(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function Jp(e,t){var r=Xp(e),n=Zp(e);return Qp(t,r,n)}var em=(e,t)=>{var r,n=Number(t);if(!(it(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},zP=e=>e.tooltip.settings,Mt={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},FP={itemInteraction:{click:Mt,hover:Mt},axisInteraction:{click:Mt,hover:Mt},keyboardInteraction:Mt,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},tm=ke({name:"tooltip",initialState:FP,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:te()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,i=Ge(e).tooltipItemPayloads.indexOf(r);i>-1&&(e.tooltipItemPayloads[i]=n)},prepare:te()},removeTooltipEntrySettings:{reducer(e,t){var r=Ge(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:te()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:BP,replaceTooltipEntrySettings:UP,removeTooltipEntrySettings:KP,setTooltipSettingsState:xM,setActiveMouseOverItemIndex:qP,mouseLeaveItem:wM,mouseLeaveChart:rm,setActiveClickItemIndex:SM,setMouseOverAxisIndex:nm,setMouseClickAxisIndex:WP,setSyncInteraction:Ef,setKeyboardInteraction:bu}=tm.actions,HP=tm.reducer;function Mf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Yn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mf(Object(r),!0).forEach(function(n){VP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function VP(e,t,r){return(t=YP(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YP(e){var t=GP(e,"string");return typeof t=="symbol"?t:t+""}function GP(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function XP(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function ZP(e){return e.index!=null}var im=(e,t,r,n)=>{if(t==null)return Mt;var i=XP(e,t,r);if(i==null)return Mt;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(ZP(i)){if(a)return Yn(Yn({},i),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return Yn(Yn({},Mt),{},{coordinate:i.coordinate})};function QP(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function JP(e,t){var r=QP(e),n=t[0],i=t[1];if(r===void 0)return!1;var a=Math.min(n,i),o=Math.max(n,i);return r>=a&&r<=o}function eC(e,t,r){if(r==null||t==null)return!0;var n=Se(e,t);return n==null||!Nt(r)?!0:JP(n,r)}var Kl=(e,t,r,n)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!ne(a))return i;var o=0,u=1/0;t.length>0&&(u=t.length-1);var l=Math.max(o,Math.min(a,u)),s=t[l];return s==null||eC(s,r,n)?String(l):null},am=(e,t,r,n,i,a,o,u)=>{if(!(a==null||u==null)){var l=o[0],s=l==null?void 0:u(l.positions,a);if(s!=null)return s;var c=i==null?void 0:i[Number(a)];if(c)switch(r){case"horizontal":return{x:c.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:c.coordinate}}}},om=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(r==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,i==null&&n!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var u;return((u=o.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},Cn=e=>e.options.tooltipPayloadSearcher,An=e=>e.tooltip;function kf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kf(Object(r),!0).forEach(function(n){tC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tC(e,t,r){return(t=rC(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rC(e){var t=nC(e,"string");return typeof t=="symbol"?t:t+""}function nC(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iC(e,t){return e??t}var um=(e,t,r,n,i,a,o)=>{if(!(t==null||a==null)){var{chartData:u,computedData:l,dataStartIndex:s,dataEndIndex:c}=r,f=[];return e.reduce((d,h)=>{var p,{dataDefinedOnItem:g,settings:m}=h,y=iC(g,u),x=Array.isArray(y)?Wh(y,s,c):y,w=(p=m==null?void 0:m.dataKey)!==null&&p!==void 0?p:n,S=m==null?void 0:m.nameKey,b;if(n&&Array.isArray(x)&&!Array.isArray(x[0])&&o==="axis"?b=ch(x,n,i):b=a(x,t,l,S),Array.isArray(b))b.forEach(E=>{var k=Tf(Tf({},m),{},{name:E.name,unit:E.unit,color:void 0,fill:void 0});d.push(vc({tooltipEntrySettings:k,dataKey:E.dataKey,payload:E.payload,value:Se(E.payload,E.dataKey),name:E.name}))});else{var P;d.push(vc({tooltipEntrySettings:m,dataKey:w,payload:b,value:Se(b,w),name:(P=Se(b,S))!==null&&P!==void 0?P:m==null?void 0:m.name}))}return d},f)}},ql=C([me,J,pp,Ol,de],zp),aC=C([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),oC=C([de,Mr],mp),Tr=C([aC,me,oC],yp,{memoizeOptions:{resultEqualityCheck:Ia}}),uC=C([Tr],e=>e.filter(Dl)),lC=C([Tr],wp,{memoizeOptions:{resultEqualityCheck:Ia}}),Dr=C([lC,Pt],Sp),sC=C([uC,Pt,me],dp),Wl=C([Dr,me,Tr],Ip),lm=C([me],$l),cC=C([me],e=>e.allowDataOverflow),sm=C([lm,cC],qv),fC=C([Tr],e=>e.filter(Dl)),dC=C([sC,fC,ya,ip],Cp),hC=C([dC,Pt,de,sm],_p),vC=C([Tr],xp),pC=C([Dr,me,vC,Rl,de],Mp,{memoizeOptions:{resultEqualityCheck:Sa}}),mC=C([kp,de,Mr],kr),gC=C([mC,de],jp),yC=C([Tp,de,Mr],kr),bC=C([yC,de],Np),xC=C([Dp,de,Mr],kr),wC=C([xC,de],$p),SC=C([gC,wC,bC],ji),IC=C([me,lm,sm,hC,pC,SC,J,de],Rp),_n=C([me,J,Dr,Wl,ya,de,IC],Lp),PC=C([_n,me,ql],Fp),CC=C([me,_n,PC,de],Bp),cm=e=>{var t=de(e),r=Mr(e),n=!1;return Pn(e,t,r,n)},fm=C([me,cm],ba),AC=C([me,ql,CC,fm],zl),_C=C([J,Wl,me,de],Hp),OC=C([J,Wl,me,de],Vp),EC=(e,t,r,n,i,a,o,u)=>{if(t){var{type:l}=t,s=xt(e,u);if(n){var c=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=l==="category"&&n.bandwidth?n.bandwidth()/c:0;return f=u==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?kt(i[0]-i[1])*2*f:f,s&&o?o.map((d,h)=>({coordinate:n(d)+f,value:d,index:h,offset:f})):n.domain().map((d,h)=>({coordinate:n(d)+f,value:a?a[d]:d,index:h,offset:f}))}}},zt=C([J,me,ql,AC,cm,_C,OC,de],EC),Hl=C([Xp,Zp,zP],(e,t,r)=>Qp(r.shared,e,t)),dm=e=>e.tooltip.settings.trigger,Vl=e=>e.tooltip.settings.defaultIndex,On=C([An,Hl,dm,Vl],im),sn=C([On,Dr,Sn,_n],Kl),hm=C([zt,sn],em),MC=C([On],e=>{if(e)return e.dataKey});C([On],e=>{if(e)return e.graphicalItemId});var vm=C([An,Hl,dm,Vl],om),kC=C([wt,St,J,Pe,zt,Vl,vm,Cn],am),TC=C([On,kC],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),DC=C([On],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),jC=C([vm,sn,Pt,Sn,hm,Cn,Hl],um),NC=C([jC],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function Df(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Df(Object(r),!0).forEach(function(n){$C(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Df(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $C(e,t,r){return(t=RC(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RC(e){var t=LC(e,"string");return typeof t=="symbol"?t:t+""}function LC(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zC=(e,t,r,n)=>{var i=t.find(a=>a&&a.index===r);if(i){if(e==="horizontal")return{x:i.coordinate,y:n.chartY};if(e==="vertical")return{x:n.chartX,y:i.coordinate}}return{x:0,y:0}},FC=(e,t,r,n)=>{var i=t.find(s=>s&&s.index===r);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=n;return fr(fr(fr({},n),wr(n.cx,n.cy,o,a)),{},{angle:a,radius:o})}var u=i.coordinate,{angle:l}=n;return fr(fr(fr({},n),wr(n.cx,n.cy,u,l)),{},{angle:l,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function BC(e,t){var{chartX:r,chartY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var pm=(e,t,r,n,i)=>{var a,o=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(n==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u<o;u++){var l,s,c,f,d,h=u>0?(l=r[u-1])===null||l===void 0?void 0:l.coordinate:(s=r[o-1])===null||s===void 0?void 0:s.coordinate,p=(c=r[u])===null||c===void 0?void 0:c.coordinate,g=u>=o-1?(f=r[0])===null||f===void 0?void 0:f.coordinate:(d=r[u+1])===null||d===void 0?void 0:d.coordinate,m=void 0;if(!(h==null||p==null||g==null))if(kt(p-h)!==kt(g-p)){var y=[];if(kt(g-p)===kt(i[1]-i[0])){m=g;var x=p+i[1]-i[0];y[0]=Math.min(x,(x+h)/2),y[1]=Math.max(x,(x+h)/2)}else{m=h;var w=g+i[1]-i[0];y[0]=Math.min(p,(w+p)/2),y[1]=Math.max(p,(w+p)/2)}var S=[Math.min(p,(m+p)/2),Math.max(p,(m+p)/2)];if(e>S[0]&&e<=S[1]||e>=y[0]&&e<=y[1]){var b;return(b=r[u])===null||b===void 0?void 0:b.index}}else{var P=Math.min(h,g),E=Math.max(h,g);if(e>(P+p)/2&&e<=(E+p)/2){var k;return(k=r[u])===null||k===void 0?void 0:k.index}}}else if(t)for(var D=0;D<o;D++){var z=t[D];if(z!=null){var O=t[D+1],M=t[D-1];if(D===0&&O!=null&&e<=(z.coordinate+O.coordinate)/2||D===o-1&&M!=null&&e>(z.coordinate+M.coordinate)/2||D>0&&D<o-1&&M!=null&&O!=null&&e>(z.coordinate+M.coordinate)/2&&e<=(z.coordinate+O.coordinate)/2)return z.index}}return-1},UC=()=>Q(Ol),Yl=(e,t)=>t,mm=(e,t,r)=>r,Gl=(e,t,r,n)=>n,KC=C(zt,e=>Yu(e,t=>t.coordinate)),Xl=C([An,Yl,mm,Gl],im),Zl=C([Xl,Dr,Sn,_n],Kl),gm=C([An,Yl,mm,Gl],om),Ni=C([wt,St,J,Pe,zt,Gl,gm,Cn],am);C([Xl,Ni],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t});var qC=C([zt,Zl],em);C([gm,Zl,Pt,Sn,qC,Cn,Yl],um);C([Xl,Zl],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t}));var WC=(e,t,r,n,i,a,o)=>{if(!(!e||!r||!n||!i)&&BC(e,o)){var u=bx(e,t),l=pm(u,a,i,r,n),s=zC(t,i,l,e);return{activeIndex:String(l),activeCoordinate:s}}},HC=(e,t,r,n,i,a,o)=>{if(!(!e||!n||!i||!a||!r)){var u=B1(e,r);if(u){var l=xx(u,t),s=pm(l,o,a,n,i),c=FC(t,a,s,u);return{activeIndex:String(s),activeCoordinate:c}}}},VC=(e,t,r,n,i,a,o,u)=>{if(!(!e||!t||!n||!i||!a))return t==="horizontal"||t==="vertical"?WC(e,t,n,i,a,o,u):HC(e,t,r,n,i,a,o)},YC=C(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),GC=C(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(Lt)),r=Array.from(new Set(t));return r.sort((n,i)=>n-i)},{memoizeOptions:{resultEqualityCheck:BI}});function jf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Nf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jf(Object(r),!0).forEach(function(n){XC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function XC(e,t,r){return(t=ZC(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZC(e){var t=QC(e,"string");return typeof t=="symbol"?t:t+""}function QC(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JC={},eA={zIndexMap:Object.values(Lt).reduce((e,t)=>Nf(Nf({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),JC)},tA=new Set(Object.values(Lt));function rA(e){return tA.has(e)}var ym=ke({name:"zIndex",initialState:eA,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:te()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!rA(r)&&delete e.zIndexMap[r])},prepare:te()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:n,isPanorama:i}=t.payload;e.zIndexMap[r]?i?e.zIndexMap[r].panoramaElement=n:e.zIndexMap[r].element=n:e.zIndexMap[r]={consumers:0,element:i?void 0:n,panoramaElement:i?n:void 0}},prepare:te()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:te()}}}),{registerZIndexPortal:nA,unregisterZIndexPortal:iA,registerZIndexPortalElement:aA,unregisterZIndexPortalElement:oA}=ym.actions,uA=ym.reducer;function En(e){var{zIndex:t,children:r}=e,n=Lx(),i=n&&t!==void 0&&t!==0,a=Ze(),o=Me();v.useLayoutEffect(()=>i?(o(nA({zIndex:t})),()=>{o(iA({zIndex:t}))}):Vi,[o,t,i]);var u=Q(l=>YC(l,t,a));return i?u?Og.createPortal(r,u):null:r}var lA=v.createContext(null),Co={exports:{}},$f;function sA(){return $f||($f=1,function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,s,c){this.fn=l,this.context=s,this.once=c||!1}function a(l,s,c,f,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var h=new i(c,f||l,d),p=r?r+s:s;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],h]:l._events[p].push(h):(l._events[p]=h,l._eventsCount++),l}function o(l,s){--l._eventsCount===0?l._events=new n:delete l._events[s]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var s=[],c,f;if(this._eventsCount===0)return s;for(f in c=this._events)t.call(c,f)&&s.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(c)):s},u.prototype.listeners=function(s){var c=r?r+s:s,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d<h;d++)p[d]=f[d].fn;return p},u.prototype.listenerCount=function(s){var c=r?r+s:s,f=this._events[c];return f?f.fn?1:f.length:0},u.prototype.emit=function(s,c,f,d,h,p){var g=r?r+s:s;if(!this._events[g])return!1;var m=this._events[g],y=arguments.length,x,w;if(m.fn){switch(m.once&&this.removeListener(s,m.fn,void 0,!0),y){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,c),!0;case 3:return m.fn.call(m.context,c,f),!0;case 4:return m.fn.call(m.context,c,f,d),!0;case 5:return m.fn.call(m.context,c,f,d,h),!0;case 6:return m.fn.call(m.context,c,f,d,h,p),!0}for(w=1,x=new Array(y-1);w<y;w++)x[w-1]=arguments[w];m.fn.apply(m.context,x)}else{var S=m.length,b;for(w=0;w<S;w++)switch(m[w].once&&this.removeListener(s,m[w].fn,void 0,!0),y){case 1:m[w].fn.call(m[w].context);break;case 2:m[w].fn.call(m[w].context,c);break;case 3:m[w].fn.call(m[w].context,c,f);break;case 4:m[w].fn.call(m[w].context,c,f,d);break;default:if(!x)for(b=1,x=new Array(y-1);b<y;b++)x[b-1]=arguments[b];m[w].fn.apply(m[w].context,x)}}return!0},u.prototype.on=function(s,c,f){return a(this,s,c,f,!1)},u.prototype.once=function(s,c,f){return a(this,s,c,f,!0)},u.prototype.removeListener=function(s,c,f,d){var h=r?r+s:s;if(!this._events[h])return this;if(!c)return o(this,h),this;var p=this._events[h];if(p.fn)p.fn===c&&(!d||p.once)&&(!f||p.context===f)&&o(this,h);else{for(var g=0,m=[],y=p.length;g<y;g++)(p[g].fn!==c||d&&!p[g].once||f&&p[g].context!==f)&&m.push(p[g]);m.length?this._events[h]=m.length===1?m[0]:m:o(this,h)}return this},u.prototype.removeAllListeners=function(s){var c;return s?(c=r?r+s:s,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,e.exports=u}(Co)),Co.exports}var cA=sA();const fA=Cr(cA);var $i=new fA,Rf="recharts.syncEvent.tooltip",Lf="recharts.syncEvent.brush";function dA(e,t){if(t){var r=Number.parseInt(t,10);if(!it(r))return e==null?void 0:e[r]}}var hA={chartName:"",tooltipPayloadSearcher:void 0,eventEmitter:void 0,defaultTooltipEventType:"axis"},bm=ke({name:"options",initialState:hA,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),vA=bm.reducer,{createEventEmitter:pA}=bm.actions,mA={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},xm=ke({name:"chartData",initialState:mA,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:n}=t.payload;r!=null&&(e.dataStartIndex=r),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:zf,setDataStartEndIndexes:gA,setComputedData:IM}=xm.actions,yA=xm.reducer,bA=["x","y"];function Ff(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ff(Object(r),!0).forEach(function(n){xA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ff(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xA(e,t,r){return(t=wA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wA(e){var t=SA(e,"string");return typeof t=="symbol"?t:t+""}function SA(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function IA(e,t){if(e==null)return{};var r,n,i=PA(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function PA(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function CA(){var e=Q(ap),t=Q(op),r=Me(),n=Q(jI),i=Q(zt),a=vn(),o=Xh(),u=Q(l=>l.rootProps.className);v.useEffect(()=>{if(e==null)return Vi;var l=(s,c,f)=>{if(t!==f&&e===s){if(n==="index"){var d;if(o&&c!==null&&c!==void 0&&(d=c.payload)!==null&&d!==void 0&&d.coordinate&&c.payload.sourceViewBox){var h=c.payload.coordinate,{x:p,y:g}=h,m=IA(h,bA),{x:y,y:x,width:w,height:S}=c.payload.sourceViewBox,b=dr(dr({},m),{},{x:o.x+(w?(p-y)/w:0)*o.width,y:o.y+(S?(g-x)/S:0)*o.height});r(dr(dr({},c),{},{payload:dr(dr({},c.payload),{},{coordinate:b})}))}else r(c);return}if(i!=null){var P;if(typeof n=="function"){var E={activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate},k=n(i,E);P=i[k]}else n==="value"&&(P=i.find(ge=>String(ge.value)===c.payload.label));var{coordinate:D}=c.payload;if(P==null||c.payload.active===!1||D==null||o==null){r(Ef({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:z,y:O}=D,M=Math.min(z,o.x+o.width),K=Math.min(O,o.y+o.height),$={x:a==="horizontal"?P.coordinate:M,y:a==="horizontal"?K:P.coordinate},ae=Ef({active:c.payload.active,coordinate:$,dataKey:c.payload.dataKey,index:String(P.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId});r(ae)}}};return $i.on(Rf,l),()=>{$i.off(Rf,l)}},[u,r,t,e,n,i,a,o])}function AA(){var e=Q(ap),t=Q(op),r=Me();v.useEffect(()=>{if(e==null)return Vi;var n=(i,a,o)=>{t!==o&&e===i&&r(gA(a))};return $i.on(Lf,n),()=>{$i.off(Lf,n)}},[r,t,e])}function _A(){var e=Me();v.useEffect(()=>{e(pA())},[e]),CA(),AA()}function OA(e,t,r){return(t=EA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EA(e){var t=MA(e,"string");return typeof t=="symbol"?t:t+""}function MA(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class kA{constructor(t){OA(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function Bf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function TA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bf(Object(r),!0).forEach(function(n){DA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DA(e,t,r){return(t=jA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jA(e){var t=NA(e,"string");return typeof t=="symbol"?t:t+""}function NA(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $A={cacheSize:2e3,enableCache:!0},wm=TA({},$A),Uf=new kA(wm.cacheSize),RA={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Kf="recharts_measurement_span";function LA(e,t){var r=t.fontSize||"",n=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",o=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(n,"|").concat(i,"|").concat(a,"|").concat(o,"|").concat(u)}var qf=(e,t)=>{try{var r=document.getElementById(Kf);r||(r=document.createElement("span"),r.setAttribute("id",Kf),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,RA,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},Wf=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||fa.isSsr)return{width:0,height:0};if(!wm.enableCache)return qf(t,r);var n=LA(t,r),i=Uf.get(n);if(i)return i;var a=qf(t,r);return Uf.set(n,a),a},Sm;function zA(e,t,r){return(t=FA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FA(e){var t=BA(e,"string");return typeof t=="symbol"?t:t+""}function BA(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hf=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Vf=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,UA=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,KA=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,qA={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},WA=["cm","mm","pt","pc","in","Q","px"];function HA(e){return WA.includes(e)}var pr="NaN";function VA(e,t){return e*qA[t]}class we{static parse(t){var r,[,n,i]=(r=KA.exec(t))!==null&&r!==void 0?r:[];return n==null?we.NaN:new we(parseFloat(n),i??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,it(t)&&(this.unit=""),r!==""&&!UA.test(r)&&(this.num=NaN,this.unit=""),HA(r)&&(this.num=VA(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new we(NaN,""):new we(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new we(NaN,""):new we(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new we(NaN,""):new we(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new we(NaN,""):new we(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return it(this.num)}}Sm=we;zA(we,"NaN",new Sm(NaN,""));function Im(e){if(e==null||e.includes(pr))return pr;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,i,a]=(r=Hf.exec(t))!==null&&r!==void 0?r:[],o=we.parse(n??""),u=we.parse(a??""),l=i==="*"?o.multiply(u):o.divide(u);if(l.isNaN())return pr;t=t.replace(Hf,l.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var s,[,c,f,d]=(s=Vf.exec(t))!==null&&s!==void 0?s:[],h=we.parse(c??""),p=we.parse(d??""),g=f==="+"?h.add(p):h.subtract(p);if(g.isNaN())return pr;t=t.replace(Vf,g.toString())}return t}var Yf=/\(([^()]*)\)/;function YA(e){for(var t=e,r;(r=Yf.exec(t))!=null;){var[,n]=r;t=t.replace(Yf,Im(n))}return t}function GA(e){var t=e.replace(/\s+/g,"");return t=YA(t),t=Im(t),t}function XA(e){try{return GA(e)}catch{return pr}}function Ao(e){var t=XA(e.slice(5,-1));return t===pr?"":t}var ZA=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],QA=["dx","dy","angle","className","breakAll"];function xu(){return xu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xu.apply(null,arguments)}function Gf(e,t){if(e==null)return{};var r,n,i=JA(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function JA(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Pm=/[ \f\n\r\t\v\u2028\u2029]+/,Cm=e=>{var{children:t,breakAll:r,style:n}=e;try{var i=[];Ie(t)||(r?i=t.toString().split(""):i=t.toString().split(Pm));var a=i.map(u=>({word:u,width:Wf(u,n).width})),o=r?0:Wf(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function e_(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var Am=(e,t,r,n)=>e.reduce((i,a)=>{var{word:o,width:u}=a,l=i[i.length-1];if(l&&u!=null&&(t==null||n||l.width+u+r<Number(t)))l.words.push(o),l.width+=u+r;else{var s={words:[o],width:u};i.push(s)}return i},[]),_m=e=>e.reduce((t,r)=>t.width>r.width?t:r),t_="…",Xf=(e,t,r,n,i,a,o,u)=>{var l=e.slice(0,t),s=Cm({breakAll:r,style:n,children:l+t_});if(!s)return[!1,[]];var c=Am(s.wordsWithComputedWidth,a,o,u),f=c.length>i||_m(c).width>Number(a);return[f,c]},r_=(e,t,r,n,i)=>{var{maxLines:a,children:o,style:u,breakAll:l}=e,s=W(a),c=String(o),f=Am(t,n,r,i);if(!s||i)return f;var d=f.length>a||_m(f).width>Number(n);if(!d)return f;for(var h=0,p=c.length-1,g=0,m;h<=p&&g<=c.length-1;){var y=Math.floor((h+p)/2),x=y-1,[w,S]=Xf(c,x,l,u,a,n,r,i),[b]=Xf(c,y,l,u,a,n,r,i);if(!w&&!b&&(h=y+1),w&&b&&(p=y-1),!w&&b){m=S;break}g++}return m||f},Zf=e=>{var t=Ie(e)?[]:e.toString().split(Pm);return[{words:t,width:void 0}]},n_=e=>{var{width:t,scaleToFit:r,children:n,style:i,breakAll:a,maxLines:o}=e;if((t||r)&&!fa.isSsr){var u,l,s=Cm({breakAll:a,children:n,style:i});if(s){var{wordsWithComputedWidth:c,spaceWidth:f}=s;u=c,l=f}else return Zf(n);return r_({breakAll:a,children:n,maxLines:o,style:i},u,l,t,!!r)}return Zf(n)},Om="#808080",i_={angle:0,breakAll:!1,capHeight:"0.71em",fill:Om,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Em=v.forwardRef((e,t)=>{var r=Ar(e,i_),{x:n,y:i,lineHeight:a,capHeight:o,fill:u,scaleToFit:l,textAnchor:s,verticalAnchor:c}=r,f=Gf(r,ZA),d=v.useMemo(()=>n_({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:l,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,l,f.style,f.width]),{dx:h,dy:p,angle:g,className:m,breakAll:y}=f,x=Gf(f,QA);if(!Yr(n)||!Yr(i)||d.length===0)return null;var w=Number(n)+(W(h)?h:0),S=Number(i)+(W(p)?p:0);if(!ne(w)||!ne(S))return null;var b;switch(c){case"start":b=Ao("calc(".concat(o,")"));break;case"middle":b=Ao("calc(".concat((d.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:b=Ao("calc(".concat(d.length-1," * -").concat(a,")"));break}var P=[];if(l){var E=d[0].width,{width:k}=f;P.push("scale(".concat(W(k)&&W(E)?k/E:1,")"))}return g&&P.push("rotate(".concat(g,", ").concat(w,", ").concat(S,")")),P.length&&(x.transform=P.join(" ")),v.createElement("text",xu({},jt(x),{ref:t,x:w,y:S,className:ot("recharts-text",m),textAnchor:s,fill:u.includes("url")?Om:u}),d.map((D,z)=>{var O=D.words.join(y?"":" ");return v.createElement("tspan",{x:w,dy:z===0?b:a,key:"".concat(O,"-").concat(z)},O)}))});Em.displayName="Text";var a_=["labelRef"],o_=["content"];function Qf(e,t){if(e==null)return{};var r,n,i=u_(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function u_(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Jf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jf(Object(r),!0).forEach(function(n){l_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function l_(e,t,r){return(t=s_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s_(e){var t=c_(e,"string");return typeof t=="symbol"?t:t+""}function c_(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ri(){return Ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ri.apply(null,arguments)}var f_=v.createContext(null),d_=()=>{var e=v.useContext(f_),t=Xh();return e||Gh(t)},h_=v.createContext(null),v_=()=>{var e=v.useContext(h_),t=Q(fp);return e||t},p_=e=>{var{value:t,formatter:r}=e,n=Ie(e.children)?t:e.children;return typeof r=="function"?r(n):n},m_=e=>e!=null&&typeof e=="function",g_=(e,t)=>{var r=kt(t-e),n=Math.min(Math.abs(t-e),360);return r*n},y_=(e,t,r,n,i)=>{var{offset:a,className:o}=e,{cx:u,cy:l,innerRadius:s,outerRadius:c,startAngle:f,endAngle:d,clockWise:h}=i,p=(s+c)/2,g=g_(f,d),m=g>=0?1:-1,y,x;switch(t){case"insideStart":y=f+m*a,x=h;break;case"insideEnd":y=d-m*a,x=!h;break;case"end":y=d+m*a,x=h;break;default:throw new Error("Unsupported position ".concat(t))}x=g<=0?x:!x;var w=wr(u,l,p,y),S=wr(u,l,p,y+(x?1:-1)*359),b="M".concat(w.x,",").concat(w.y,`
    A`).concat(p,",").concat(p,",0,1,").concat(x?0:1,`,
    `).concat(S.x,",").concat(S.y),P=Ie(e.id)?Gr("recharts-radial-line-"):e.id;return v.createElement("text",Ri({},n,{dominantBaseline:"central",className:ot("recharts-radial-bar-label",o)}),v.createElement("defs",null,v.createElement("path",{id:P,d:b})),v.createElement("textPath",{xlinkHref:"#".concat(P)},r))},b_=(e,t,r)=>{var{cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:u,endAngle:l}=e,s=(u+l)/2;if(r==="outside"){var{x:c,y:f}=wr(n,i,o+t,s);return{x:c,y:f,textAnchor:c>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var d=(a+o)/2,{x:h,y:p}=wr(n,i,d,s);return{x:h,y:p,textAnchor:"middle",verticalAnchor:"middle"}},wu=e=>"cx"in e&&W(e.cx),x_=(e,t)=>{var{parentViewBox:r,offset:n,position:i}=e,a;r!=null&&!wu(r)&&(a=r);var{x:o,y:u,upperWidth:l,lowerWidth:s,height:c}=t,f=o,d=o+(l-s)/2,h=(f+d)/2,p=(l+s)/2,g=f+l/2,m=c>=0?1:-1,y=m*n,x=m>0?"end":"start",w=m>0?"start":"end",S=l>=0?1:-1,b=S*n,P=S>0?"end":"start",E=S>0?"start":"end";if(i==="top"){var k={x:f+l/2,y:u-y,textAnchor:"middle",verticalAnchor:x};return ue(ue({},k),a?{height:Math.max(u-a.y,0),width:l}:{})}if(i==="bottom"){var D={x:d+s/2,y:u+c+y,textAnchor:"middle",verticalAnchor:w};return ue(ue({},D),a?{height:Math.max(a.y+a.height-(u+c),0),width:s}:{})}if(i==="left"){var z={x:h-b,y:u+c/2,textAnchor:P,verticalAnchor:"middle"};return ue(ue({},z),a?{width:Math.max(z.x-a.x,0),height:c}:{})}if(i==="right"){var O={x:h+p+b,y:u+c/2,textAnchor:E,verticalAnchor:"middle"};return ue(ue({},O),a?{width:Math.max(a.x+a.width-O.x,0),height:c}:{})}var M=a?{width:p,height:c}:{};return i==="insideLeft"?ue({x:h+b,y:u+c/2,textAnchor:E,verticalAnchor:"middle"},M):i==="insideRight"?ue({x:h+p-b,y:u+c/2,textAnchor:P,verticalAnchor:"middle"},M):i==="insideTop"?ue({x:f+l/2,y:u+y,textAnchor:"middle",verticalAnchor:w},M):i==="insideBottom"?ue({x:d+s/2,y:u+c-y,textAnchor:"middle",verticalAnchor:x},M):i==="insideTopLeft"?ue({x:f+b,y:u+y,textAnchor:E,verticalAnchor:w},M):i==="insideTopRight"?ue({x:f+l-b,y:u+y,textAnchor:P,verticalAnchor:w},M):i==="insideBottomLeft"?ue({x:d+b,y:u+c-y,textAnchor:E,verticalAnchor:x},M):i==="insideBottomRight"?ue({x:d+s-b,y:u+c-y,textAnchor:P,verticalAnchor:x},M):i&&typeof i=="object"&&(W(i.x)||Vr(i.x))&&(W(i.y)||Vr(i.y))?ue({x:o+er(i.x,p),y:u+er(i.y,c),textAnchor:"end",verticalAnchor:"end"},M):ue({x:g,y:u+c/2,textAnchor:"middle",verticalAnchor:"middle"},M)},w_={angle:0,offset:5,zIndex:Lt.label,position:"middle",textBreakAll:!1};function Mm(e){var t=Ar(e,w_),{viewBox:r,position:n,value:i,children:a,content:o,className:u="",textBreakAll:l,labelRef:s}=t,c=v_(),f=d_(),d=n==="center"?f:c??f,h,p,g;if(r==null?h=d:wu(r)?h=r:h=Gh(r),!h||Ie(i)&&Ie(a)&&!v.isValidElement(o)&&typeof o!="function")return null;var m=ue(ue({},t),{},{viewBox:h});if(v.isValidElement(o)){var{labelRef:y}=m,x=Qf(m,a_);return v.cloneElement(o,x)}if(typeof o=="function"){var{content:w}=m,S=Qf(m,o_);if(p=v.createElement(o,S),v.isValidElement(p))return p}else p=p_(t);var b=jt(t);if(wu(h)){if(n==="insideStart"||n==="insideEnd"||n==="end")return y_(t,n,p,b,h);g=b_(h,t.offset,t.position)}else g=x_(t,h);return v.createElement(En,{zIndex:t.zIndex},v.createElement(Em,Ri({ref:s,className:ot("recharts-label",u)},b,g,{textAnchor:e_(b.textAnchor)?b.textAnchor:g.textAnchor,breakAll:l}),p))}Mm.displayName="Label";var _o={},Oo={},ed;function S_(){return ed||(ed=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t}(Oo)),Oo}var Eo={},td;function I_(){return td||(td=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t}(Eo)),Eo}var rd;function P_(){return rd||(rd=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=S_(),r=I_(),n=fh();function i(a){if(n.isArrayLike(a))return t.last(r.toArray(a))}e.last=i}(_o)),_o}var Mo,nd;function C_(){return nd||(nd=1,Mo=P_().last),Mo}var A_=C_();const __=Cr(A_);var O_=["valueAccessor"],E_=["dataKey","clockWise","id","textBreakAll","zIndex"];function Li(){return Li=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Li.apply(null,arguments)}function id(e,t){if(e==null)return{};var r,n,i=M_(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function M_(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var k_=e=>Array.isArray(e.value)?__(e.value):e.value,km=v.createContext(void 0),T_=km.Provider,Tm=v.createContext(void 0);Tm.Provider;function D_(){return v.useContext(km)}function j_(){return v.useContext(Tm)}function ei(e){var{valueAccessor:t=k_}=e,r=id(e,O_),{dataKey:n,clockWise:i,id:a,textBreakAll:o,zIndex:u}=r,l=id(r,E_),s=D_(),c=j_(),f=s||c;return!f||!f.length?null:v.createElement(En,{zIndex:u??Lt.label},v.createElement(Qt,{className:"recharts-label-list"},f.map((d,h)=>{var p,g=Ie(n)?t(d,h):Se(d&&d.payload,n),m=Ie(a)?{}:{id:"".concat(a,"-").concat(h)};return v.createElement(Mm,Li({key:"label-".concat(h)},jt(d),l,m,{fill:(p=r.fill)!==null&&p!==void 0?p:d.fill,parentViewBox:d.parentViewBox,value:g,textBreakAll:o,viewBox:d.viewBox,index:h,zIndex:0}))})))}ei.displayName="LabelList";function N_(e){var{label:t}=e;return t?t===!0?v.createElement(ei,{key:"labelList-implicit"}):v.isValidElement(t)||m_(t)?v.createElement(ei,{key:"labelList-implicit",content:t}):typeof t=="object"?v.createElement(ei,Li({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Su(){return Su=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Su.apply(null,arguments)}var Dm=e=>{var{cx:t,cy:r,r:n,className:i}=e,a=ot("recharts-dot",i);return W(t)&&W(r)&&W(n)?v.createElement("circle",Su({},Zt(e),Hu(e),{className:a,cx:t,cy:r,r:n})):null},$_={radiusAxis:{},angleAxis:{}},jm=ke({name:"polarAxis",initialState:$_,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:PM,removeRadiusAxis:CM,addAngleAxis:AM,removeAngleAxis:_M}=jm.actions,R_=jm.reducer,Nm=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function L_(e){var{tooltipEntrySettings:t}=e,r=Me(),n=Ze(),i=v.useRef(null);return v.useLayoutEffect(()=>{n||(i.current===null?r(BP(t)):i.current!==t&&r(UP({prev:i.current,next:t})),i.current=t)},[t,r,n]),v.useLayoutEffect(()=>()=>{i.current&&(r(KP(i.current)),i.current=null)},[r]),null}function z_(e){var{legendPayload:t}=e,r=Me(),n=Ze(),i=v.useRef(null);return v.useLayoutEffect(()=>{n||(i.current===null?r(Zx(t)):i.current!==t&&r(Qx({prev:i.current,next:t})),i.current=t)},[r,n,t]),v.useLayoutEffect(()=>()=>{i.current&&(r(Jx(i.current)),i.current=null)},[r]),null}var ko,F_=()=>{var[e]=v.useState(()=>Gr("uid-"));return e},B_=(ko=hg.useId)!==null&&ko!==void 0?ko:F_;function U_(e,t){var r=B_();return t||(e?"".concat(e,"-").concat(r):r)}var K_=v.createContext(void 0),q_=e=>{var{id:t,type:r,children:n}=e,i=U_("recharts-".concat(r),t);return v.createElement(K_.Provider,{value:i},n(i))},W_={cartesianItems:[],polarItems:[]},$m=ke({name:"graphicalItems",initialState:W_,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:te()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,i=Ge(e).cartesianItems.indexOf(r);i>-1&&(e.cartesianItems[i]=n)},prepare:te()},removeCartesianGraphicalItem:{reducer(e,t){var r=Ge(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:te()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:te()},removePolarGraphicalItem:{reducer(e,t){var r=Ge(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:te()}}}),{addCartesianGraphicalItem:H_,replaceCartesianGraphicalItem:V_,removeCartesianGraphicalItem:Y_,addPolarGraphicalItem:OM,removePolarGraphicalItem:EM}=$m.actions,G_=$m.reducer,X_=e=>{var t=Me(),r=v.useRef(null);return v.useLayoutEffect(()=>{r.current===null?t(H_(e)):r.current!==e&&t(V_({prev:r.current,next:e})),r.current=e},[t,e]),v.useLayoutEffect(()=>()=>{r.current&&(t(Y_(r.current)),r.current=null)},[t]),null},Z_=v.memo(X_),Q_=["points"];function ad(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function To(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ad(Object(r),!0).forEach(function(n){J_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ad(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function J_(e,t,r){return(t=eO(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eO(e){var t=tO(e,"string");return typeof t=="symbol"?t:t+""}function tO(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zi(){return zi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zi.apply(null,arguments)}function rO(e,t){if(e==null)return{};var r,n,i=nO(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function nO(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function iO(e){var{option:t,dotProps:r,className:n}=e;if(v.isValidElement(t))return v.cloneElement(t,r);if(typeof t=="function")return t(r);var i=ot(n,typeof t!="boolean"?t.className:""),a=r??{},{points:o}=a,u=rO(a,Q_);return v.createElement(Dm,zi({},u,{className:i}))}function aO(e,t){return e==null?!1:t?!0:e.length===1}function oO(e){var{points:t,dot:r,className:n,dotClassName:i,dataKey:a,baseProps:o,needClip:u,clipPathId:l,zIndex:s=Lt.scatter}=e;if(!aO(t,r))return null;var c=Nm(r),f=Fy(r),d=t.map((p,g)=>{var m,y,x=To(To(To({r:3},o),f),{},{index:g,cx:(m=p.x)!==null&&m!==void 0?m:void 0,cy:(y=p.y)!==null&&y!==void 0?y:void 0,dataKey:a,value:p.value,payload:p.payload,points:t});return v.createElement(iO,{key:"dot-".concat(g),option:r,dotProps:x,className:i})}),h={};return u&&l!=null&&(h.clipPath="url(#clipPath-".concat(c?"":"dots-").concat(l,")")),v.createElement(En,{zIndex:s},v.createElement(Qt,zi({className:n},h),d))}function od(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ud(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?od(Object(r),!0).forEach(function(n){uO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):od(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uO(e,t,r){return(t=lO(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lO(e){var t=sO(e,"string");return typeof t=="symbol"?t:t+""}function sO(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Rm=0,cO={xAxis:{},yAxis:{},zAxis:{}},Lm=ke({name:"cartesianAxis",initialState:cO,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:te()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=n)},prepare:te()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:te()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:te()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=n)},prepare:te()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:te()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:te()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=n)},prepare:te()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:te()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,i=e.yAxis[r];if(i){var a=i.widthHistory||[];if(a.length===3&&a[0]===a[2]&&n===a[1]&&n!==i.width&&Math.abs(n-a[0])<=1)return;var o=[...a,n].slice(-3);e.yAxis[r]=ud(ud({},e.yAxis[r]),{},{width:n,widthHistory:o})}}}}),{addXAxis:MM,replaceXAxis:kM,removeXAxis:TM,addYAxis:DM,replaceYAxis:jM,removeYAxis:NM,addZAxis:$M,replaceZAxis:RM,removeZAxis:LM,updateYAxisWidth:zM}=Lm.actions,fO=Lm.reducer,dO=C([Pe],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),hO=C([dO,wt,St],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),Ql=()=>Q(hO),vO=()=>Q(NC);function ld(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Do(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ld(Object(r),!0).forEach(function(n){pO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ld(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pO(e,t,r){return(t=mO(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mO(e){var t=gO(e,"string");return typeof t=="symbol"?t:t+""}function gO(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yO=e=>{var{point:t,childIndex:r,mainColor:n,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var u={index:r,dataKey:a,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},l=Do(Do(Do({},u),qd(i)),Hu(i)),s;return v.isValidElement(i)?s=v.cloneElement(i,l):typeof i=="function"?s=i(l):s=v.createElement(Dm,l),v.createElement(Qt,{className:"recharts-active-dot",clipPath:o},s)};function sd(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:i,clipPath:a,zIndex:o=Lt.activeDot}=e,u=Q(sn),l=vO();if(t==null||l==null)return null;var s=t.find(c=>l.includes(c.payload));return Ie(s)?null:v.createElement(En,{zIndex:o},v.createElement(yO,{point:s,childIndex:Number(u),mainColor:r,dataKey:i,activeDot:n,clipPath:a}))}var bO=e=>{var{chartData:t}=e,r=Me(),n=Ze();return v.useEffect(()=>n?()=>{}:(r(zf(t)),()=>{r(zf(void 0))}),[t,r,n]),null},cd={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},zm=ke({name:"brush",initialState:cd,reducers:{setBrushSettings(e,t){return t.payload==null?cd:t.payload}}}),{setBrushSettings:FM}=zm.actions,xO=zm.reducer,wO={dots:[],areas:[],lines:[]},Fm=ke({name:"referenceElements",initialState:wO,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Ge(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=Ge(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=Ge(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:BM,removeDot:UM,addArea:KM,removeArea:qM,addLine:WM,removeLine:HM}=Fm.actions,SO=Fm.reducer,IO=v.createContext(void 0),PO=e=>{var{children:t}=e,[r]=v.useState("".concat(Gr("recharts"),"-clip")),n=Ql();if(n==null)return null;var{x:i,y:a,width:o,height:u}=n;return v.createElement(IO.Provider,{value:r},v.createElement("defs",null,v.createElement("clipPath",{id:r},v.createElement("rect",{x:i,y:a,height:u,width:o}))),t)},CO={},Bm=ke({name:"errorBars",initialState:CO,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:i}=t.payload;e[r]&&(e[r]=e[r].map(a=>a.dataKey===n.dataKey&&a.direction===n.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(i=>i.dataKey!==n.dataKey||i.direction!==n.direction))}}}),{addErrorBar:VM,replaceErrorBar:YM,removeErrorBar:GM}=Bm.actions,AO=Bm.reducer;function Um(e,t){var r,n,i=Q(s=>Ct(s,e)),a=Q(s=>At(s,t)),o=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:hp.allowDataOverflow,u=(n=a==null?void 0:a.allowDataOverflow)!==null&&n!==void 0?n:vp.allowDataOverflow,l=o||u;return{needClip:l,needClipX:o,needClipY:u}}function _O(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,i=Ql(),{needClipX:a,needClipY:o,needClip:u}=Um(t,r);if(!u||!i)return null;var{x:l,y:s,width:c,height:f}=i;return v.createElement("clipPath",{id:"clipPath-".concat(n)},v.createElement("rect",{x:a?l:l-c/2,y:o?s:s-f/2,width:a?c:c*2,height:o?f:f*2}))}function OO(e){var t=qd(e),r=3,n=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),u=Number(a);return(Number.isNaN(o)||o<0)&&(o=r),(Number.isNaN(u)||u<0)&&(u=n),{r:o,strokeWidth:u}}return{r,strokeWidth:n}}var jo={exports:{}},No={};/**
 * @license React
 * use-sync-external-store-with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var fd;function EO(){if(fd)return No;fd=1;var e=_u();function t(l,s){return l===s&&(l!==0||1/l===1/s)||l!==l&&s!==s}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,u=e.useDebugValue;return No.useSyncExternalStoreWithSelector=function(l,s,c,f,d){var h=i(null);if(h.current===null){var p={hasValue:!1,value:null};h.current=p}else p=h.current;h=o(function(){function m(b){if(!y){if(y=!0,x=b,b=f(b),d!==void 0&&p.hasValue){var P=p.value;if(d(P,b))return w=P}return w=b}if(P=w,r(x,b))return P;var E=f(b);return d!==void 0&&d(P,E)?(x=b,P):(x=b,w=E)}var y=!1,x,w,S=c===void 0?null:c;return[function(){return m(s())},S===null?void 0:function(){return m(S())}]},[s,c,f,d]);var g=n(l,h[0],h[1]);return a(function(){p.hasValue=!0,p.value=g},[g]),u(g),g},No}var dd;function MO(){return dd||(dd=1,jo.exports=EO()),jo.exports}MO();function kO(e){e()}function TO(){let e=null,t=null;return{clear(){e=null,t=null},notify(){kO(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var hd={notify(){},get:()=>[]};function DO(e,t){let r,n=hd,i=0,a=!1;function o(g){c();const m=n.subscribe(g);let y=!1;return()=>{y||(y=!0,m(),f())}}function u(){n.notify()}function l(){p.onStateChange&&p.onStateChange()}function s(){return a}function c(){i++,r||(r=e.subscribe(l),n=TO())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=hd)}function d(){a||(a=!0,c())}function h(){a&&(a=!1,f())}const p={addNestedSub:o,notifyNestedSubs:u,handleChangeWrapper:l,isSubscribed:s,trySubscribe:d,tryUnsubscribe:h,getListeners:()=>n};return p}var jO=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",NO=jO(),$O=()=>typeof navigator<"u"&&navigator.product==="ReactNative",RO=$O(),LO=()=>NO||RO?v.useLayoutEffect:v.useEffect,zO=LO();function vd(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function FO(e,t){if(vd(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i=0;i<r.length;i++)if(!Object.prototype.hasOwnProperty.call(t,r[i])||!vd(e[r[i]],t[r[i]]))return!1;return!0}var $o=Symbol.for("react-redux-context"),Ro=typeof globalThis<"u"?globalThis:{};function BO(){if(!v.createContext)return{};const e=Ro[$o]??(Ro[$o]=new Map);let t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var UO=BO();function KO(e){const{children:t,context:r,serverState:n,store:i}=e,a=v.useMemo(()=>{const l=DO(i);return{store:i,subscription:l,getServerState:n?()=>n:void 0}},[i,n]),o=v.useMemo(()=>i.getState(),[i]);zO(()=>{const{subscription:l}=a;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[a,o]);const u=r||UO;return v.createElement(u.Provider,{value:a},t)}var qO=KO,WO=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function HO(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Km(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(WO.has(n)){if(e[n]==null&&t[n]==null)continue;if(!FO(e[n],t[n]))return!1}else if(!HO(e[n],t[n]))return!1;return!0}function Jl(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:Rm}function es(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:Rm}var qm=(e,t,r)=>Gp(e,"xAxis",Jl(e,t),r),Wm=(e,t,r)=>Yp(e,"xAxis",Jl(e,t),r),Hm=(e,t,r)=>Gp(e,"yAxis",es(e,t),r),Vm=(e,t,r)=>Yp(e,"yAxis",es(e,t),r),VO=C([J,qm,Hm,Wm,Vm],(e,t,r,n,i)=>xt(e,"xAxis")?hc(t,n,!1):hc(r,i,!1)),YO=(e,t)=>t,Ym=C([gp,YO],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),Gm=e=>{var t=J(e),r=xt(t,"xAxis");return r?"yAxis":"xAxis"},GO=(e,t)=>{var r=Gm(e);return r==="yAxis"?es(e,t):Jl(e,t)},XO=(e,t,r)=>Ap(e,Gm(e),GO(e,t),r),ZO=C([Ym,XO],(e,t)=>{var r;if(!(e==null||t==null)){var{stackId:n}=e,i=Tl(e);if(!(n==null||i==null)){var a=(r=t[n])===null||r===void 0?void 0:r.stackedData,o=a==null?void 0:a.find(u=>u.key===i);if(o!=null)return o.map(u=>[u[0],u[1]])}}}),QO=C([J,qm,Hm,Wm,Vm,ZO,wI,VO,Ym,NI],(e,t,r,n,i,a,o,u,l,s)=>{var{chartData:c,dataStartIndex:f,dataEndIndex:d}=o;if(!(l==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||n==null||i==null||n.length===0||i.length===0||u==null)){var{data:h}=l,p;if(h&&h.length>0?p=h:p=c==null?void 0:c.slice(f,d+1),p!=null)return gE({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataStartIndex:f,areaSettings:l,stackedData:a,displayedData:p,chartBaseValue:s,bandSize:u})}}),JO=["id"],eE=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Xt(){return Xt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xt.apply(null,arguments)}function Xm(e,t){if(e==null)return{};var r,n,i=tE(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function tE(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function pd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pd(Object(r),!0).forEach(function(n){rE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rE(e,t,r){return(t=nE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nE(e){var t=iE(e,"string");return typeof t=="symbol"?t:t+""}function iE(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fi(e,t){return e&&e!=="none"?e:t}var aE=e=>{var{dataKey:t,name:r,stroke:n,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:Fi(n,i),value:Hh(r,t),payload:e}]},oE=v.memo(e=>{var{dataKey:t,data:r,stroke:n,strokeWidth:i,fill:a,name:o,hide:u,unit:l,tooltipType:s,id:c}=e,f={dataDefinedOnItem:r,positions:void 0,settings:{stroke:n,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Hh(o,t),hide:u,type:s,color:Fi(n,a),unit:l,graphicalItemId:c}};return v.createElement(L_,{tooltipEntrySettings:f})});function uE(e){var{clipPathId:t,points:r,props:n}=e,{needClip:i,dot:a,dataKey:o}=n,u=Zt(n);return v.createElement(oO,{points:r,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:u,needClip:i,clipPathId:t})}function lE(e){var{showLabels:t,children:r,points:n}=e,i=n.map(a=>{var o,u,l={x:(o=a.x)!==null&&o!==void 0?o:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return mr(mr({},l),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:l,fill:void 0})});return v.createElement(T_,{value:t?i:void 0},r)}function md(e){var{points:t,baseLine:r,needClip:n,clipPathId:i,props:a}=e,{layout:o,type:u,stroke:l,connectNulls:s,isRange:c}=a,{id:f}=a,d=Xm(a,JO),h=Zt(d),p=jt(d);return v.createElement(v.Fragment,null,(t==null?void 0:t.length)>1&&v.createElement(Qt,{clipPath:n?"url(#clipPath-".concat(i,")"):void 0},v.createElement(co,Xt({},p,{id:f,points:t,connectNulls:s,type:u,baseLine:r,layout:o,stroke:"none",className:"recharts-area-area"})),l!=="none"&&v.createElement(co,Xt({},h,{className:"recharts-area-curve",layout:o,type:u,connectNulls:s,fill:"none",points:t})),l!=="none"&&c&&v.createElement(co,Xt({},h,{className:"recharts-area-curve",layout:o,type:u,connectNulls:s,fill:"none",points:r}))),v.createElement(uE,{points:t,props:d,clipPathId:i}))}function sE(e){var t,r,{alpha:n,baseLine:i,points:a,strokeWidth:o}=e,u=(t=a[0])===null||t===void 0?void 0:t.y,l=(r=a[a.length-1])===null||r===void 0?void 0:r.y;if(!ne(u)||!ne(l))return null;var s=n*Math.abs(u-l),c=Math.max(...a.map(f=>f.x||0));return W(i)?c=Math.max(i,c):i&&Array.isArray(i)&&i.length&&(c=Math.max(...i.map(f=>f.x||0),c)),W(c)?v.createElement("rect",{x:0,y:u<l?u:u-s,width:c+(o?parseInt("".concat(o),10):1),height:Math.floor(s)}):null}function cE(e){var t,r,{alpha:n,baseLine:i,points:a,strokeWidth:o}=e,u=(t=a[0])===null||t===void 0?void 0:t.x,l=(r=a[a.length-1])===null||r===void 0?void 0:r.x;if(!ne(u)||!ne(l))return null;var s=n*Math.abs(u-l),c=Math.max(...a.map(f=>f.y||0));return W(i)?c=Math.max(i,c):i&&Array.isArray(i)&&i.length&&(c=Math.max(...i.map(f=>f.y||0),c)),W(c)?v.createElement("rect",{x:u<l?u:u-s,y:0,width:s,height:Math.floor(c+(o?parseInt("".concat(o),10):1))}):null}function fE(e){var{alpha:t,layout:r,points:n,baseLine:i,strokeWidth:a}=e;return r==="vertical"?v.createElement(sE,{alpha:t,points:n,baseLine:i,strokeWidth:a}):v.createElement(cE,{alpha:t,points:n,baseLine:i,strokeWidth:a})}function dE(e){var{needClip:t,clipPathId:r,props:n,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:u,isAnimationActive:l,animationBegin:s,animationDuration:c,animationEasing:f,onAnimationStart:d,onAnimationEnd:h}=n,p=v.useMemo(()=>({points:o,baseLine:u}),[o,u]),g=k1(p,"recharts-area-"),m=Rx(),[y,x]=v.useState(!1),w=!y,S=v.useCallback(()=>{typeof h=="function"&&h(),x(!1)},[h]),b=v.useCallback(()=>{typeof d=="function"&&d(),x(!0)},[d]);if(m==null)return null;var P=i.current,E=a.current;return v.createElement(lE,{showLabels:w,points:o},n.children,v.createElement(M1,{animationId:g,begin:s,duration:c,isActive:l,easing:f,onAnimationEnd:S,onAnimationStart:b,key:g},k=>{if(P){var D=P.length/o.length,z=k===1?o:o.map((M,K)=>{var $=Math.floor(K*D);if(P[$]){var ae=P[$];return mr(mr({},M),{},{x:sr(ae.x,M.x,k),y:sr(ae.y,M.y,k)})}return M}),O;return W(u)?O=sr(E,u,k):Ie(u)||it(u)?O=sr(E,0,k):O=u.map((M,K)=>{var $=Math.floor(K*D);if(Array.isArray(E)&&E[$]){var ae=E[$];return mr(mr({},M),{},{x:sr(ae.x,M.x,k),y:sr(ae.y,M.y,k)})}return M}),k>0&&(i.current=z,a.current=O),v.createElement(md,{points:z,baseLine:O,needClip:t,clipPathId:r,props:n})}return k>0&&(i.current=o,a.current=u),v.createElement(Qt,null,l&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(fE,{alpha:k,points:o,baseLine:u,layout:m,strokeWidth:n.strokeWidth}))),v.createElement(Qt,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(md,{points:o,baseLine:u,needClip:t,clipPathId:r,props:n})))}),v.createElement(N_,{label:n.label}))}function hE(e){var{needClip:t,clipPathId:r,props:n}=e,i=v.useRef(null),a=v.useRef();return v.createElement(dE,{needClip:t,clipPathId:r,props:n,previousPointsRef:i,previousBaselineRef:a})}class vE extends v.PureComponent{render(){var{hide:t,dot:r,points:n,className:i,top:a,left:o,needClip:u,xAxisId:l,yAxisId:s,width:c,height:f,id:d,baseLine:h,zIndex:p}=this.props;if(t)return null;var g=ot("recharts-area",i),m=d,{r:y,strokeWidth:x}=OO(r),w=Nm(r),S=y*2+x,b=u?"url(#clipPath-".concat(w?"":"dots-").concat(m,")"):void 0;return v.createElement(En,{zIndex:p},v.createElement(Qt,{className:g},u&&v.createElement("defs",null,v.createElement(_O,{clipPathId:m,xAxisId:l,yAxisId:s}),!w&&v.createElement("clipPath",{id:"clipPath-dots-".concat(m)},v.createElement("rect",{x:o-S/2,y:a-S/2,width:c+S,height:f+S}))),v.createElement(hE,{needClip:u,clipPathId:m,props:this.props})),v.createElement(sd,{points:n,mainColor:Fi(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:b}),this.props.isRange&&Array.isArray(h)&&v.createElement(sd,{points:h,mainColor:Fi(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:b}))}}var Zm={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Lt.area};function pE(e){var t,r=Ar(e,Zm),{activeDot:n,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:u,dot:l,fill:s,fillOpacity:c,hide:f,isAnimationActive:d,legendType:h,stroke:p,xAxisId:g,yAxisId:m}=r,y=Xm(r,eE),x=vn(),w=UC(),{needClip:S}=Um(g,m),b=Ze(),{points:P,isRange:E,baseLine:k}=(t=Q($=>QO($,e.id,b)))!==null&&t!==void 0?t:{},D=Ql();if(x!=="horizontal"&&x!=="vertical"||D==null||w!=="AreaChart"&&w!=="ComposedChart")return null;var{height:z,width:O,x:M,y:K}=D;return!P||!P.length?null:v.createElement(vE,Xt({},y,{activeDot:n,animationBegin:i,animationDuration:a,animationEasing:o,baseLine:k,connectNulls:u,dot:l,fill:s,fillOpacity:c,height:z,hide:f,layout:x,isAnimationActive:d==="auto"?!fa.isSsr:d,isRange:E,legendType:h,needClip:S,points:P,stroke:p,width:O,left:M,top:K,xAxisId:g,yAxisId:m}))}var mE=(e,t,r,n,i)=>{var a=r??t;if(W(a))return a;var o=e==="horizontal"?i:n,u=o.scale.domain();if(o.type==="number"){var l=Math.max(u[0],u[1]),s=Math.min(u[0],u[1]);return a==="dataMin"?s:a==="dataMax"||l<0?l:Math.max(Math.min(u[0],u[1]),0)}return a==="dataMin"?u[0]:a==="dataMax"?u[1]:u[0]};function gE(e){var{areaSettings:{connectNulls:t,baseValue:r,dataKey:n},stackedData:i,layout:a,chartBaseValue:o,xAxis:u,yAxis:l,displayedData:s,dataStartIndex:c,xAxisTicks:f,yAxisTicks:d,bandSize:h}=e,p=i&&i.length,g=mE(a,o,r,u,l),m=a==="horizontal",y=!1,x=s.map((S,b)=>{var P,E,k;if(p)k=i[c+b];else{var D=Se(S,n);Array.isArray(D)?(k=D,y=!0):k=[g,D]}var z=(P=(E=k)===null||E===void 0?void 0:E[1])!==null&&P!==void 0?P:null,O=z==null||p&&!t&&Se(S,n)==null;return m?{x:cc({axis:u,ticks:f,bandSize:h,entry:S,index:b}),y:O?null:l.scale(z),value:k,payload:S}:{x:O?null:u.scale(z),y:cc({axis:l,ticks:d,bandSize:h,entry:S,index:b}),value:k,payload:S}}),w;return p||y?w=x.map(S=>{var b=Array.isArray(S.value)?S.value[0]:null;return m?{x:S.x,y:b!=null&&S.y!=null?l.scale(b):null,payload:S.payload}:{x:b!=null?u.scale(b):null,y:S.y,payload:S.payload}}):w=m?l.scale(g):u.scale(g),{points:x,baseLine:w,isRange:y}}function yE(e){var t=Ar(e,Zm),r=Ze();return v.createElement(q_,{id:t.id,type:"area"},n=>v.createElement(v.Fragment,null,v.createElement(z_,{legendPayload:aE(t)}),v.createElement(oE,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:n}),v.createElement(Z_,{type:"area",id:n,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:px(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),v.createElement(pE,Xt({},t,{id:n}))))}var Iu=v.memo(yE,Km);Iu.displayName="Area";var bE=(e,t)=>t,ts=C([bE,J,fp,de,fm,zt,KC,Pe],VC),rs=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},Qm=Ue("mouseClick"),Jm=dn();Jm.startListening({actionCreator:Qm,effect:(e,t)=>{var r=e.payload,n=ts(t.getState(),rs(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(WP({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Pu=Ue("mouseMove"),eg=dn(),Gn=null;eg.startListening({actionCreator:Pu,effect:(e,t)=>{var r=e.payload;Gn!==null&&cancelAnimationFrame(Gn);var n=rs(r);Gn=requestAnimationFrame(()=>{var i=t.getState(),a=Jp(i,i.tooltip.settings.shared);if(a==="axis"){var o=ts(i,n);(o==null?void 0:o.activeIndex)!=null?t.dispatch(nm({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate})):t.dispatch(rm())}Gn=null})}});function xE(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var gd={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},tg=ke({name:"rootProps",initialState:gd,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:gd.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),wE=tg.reducer,{updateOptions:SE}=tg.actions,rg=ke({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:XM}=rg.actions,IE=rg.reducer,ng=Ue("keyDown"),ig=Ue("focus"),ns=dn();ns.startListening({actionCreator:ng,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var o=Kl(i,Dr(r),Sn(r),_n(r)),u=o==null?-1:Number(o);if(!(!Number.isFinite(u)||u<0)){var l=zt(r);if(a==="Enter"){var s=Ni(r,"axis","hover",String(i.index));t.dispatch(bu({active:!i.active,activeIndex:i.index,activeCoordinate:s}));return}var c=LP(r),f=c==="left-to-right"?1:-1,d=a==="ArrowRight"?1:-1,h=u+d*f;if(!(l==null||h>=l.length||h<0)){var p=Ni(r,"axis","hover",String(h));t.dispatch(bu({active:!0,activeIndex:h.toString(),activeCoordinate:p}))}}}}}});ns.startListening({actionCreator:ig,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var a="0",o=Ni(r,"axis","hover",String(a));t.dispatch(bu({active:!0,activeIndex:a,activeCoordinate:o}))}}}});var ze=Ue("externalEvent"),ag=dn(),Lo=new Map;ag.startListening({actionCreator:ze,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){n.persist();var i=n.type,a=Lo.get(i);a!==void 0&&cancelAnimationFrame(a);var o=requestAnimationFrame(()=>{try{var u=t.getState(),l={activeCoordinate:TC(u),activeDataKey:MC(u),activeIndex:sn(u),activeLabel:hm(u),activeTooltipIndex:sn(u),isTooltipActive:DC(u)};r(l,n)}finally{Lo.delete(i)}});Lo.set(i,o)}}});var PE=C([An],e=>e.tooltipItemPayloads),CE=C([PE,Cn,(e,t)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(u=>u.settings.graphicalItemId===n);if(i!=null){var{positions:a}=i;if(a!=null){var o=t(a,r);return o}}}),og=Ue("touchMove"),ug=dn();ug.startListening({actionCreator:og,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var n=t.getState(),i=Jp(n,n.tooltip.settings.shared);if(i==="axis"){var a=r.touches[0];if(a==null)return;var o=ts(n,rs({clientX:a.clientX,clientY:a.clientY,currentTarget:r.currentTarget}));(o==null?void 0:o.activeIndex)!=null&&t.dispatch(nm({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate}))}else if(i==="item"){var u,l=r.touches[0];if(document.elementFromPoint==null||l==null)return;var s=document.elementFromPoint(l.clientX,l.clientY);if(!s||!s.getAttribute)return;var c=s.getAttribute(Sx),f=(u=s.getAttribute(Ix))!==null&&u!==void 0?u:void 0,d=Tr(n).find(g=>g.id===f);if(c==null||d==null||f==null)return;var{dataKey:h}=d,p=CE(n,c,f);t.dispatch(qP({activeDataKey:h,activeIndex:c,activeCoordinate:p,activeGraphicalItemId:f}))}}}});var AE=gh({brush:xO,cartesianAxis:fO,chartData:yA,errorBars:AO,graphicalItems:G_,layout:ax,legend:e1,options:vA,polarAxis:R_,polarOptions:IE,referenceElements:SO,rootProps:wE,tooltip:HP,zIndex:uA}),_E=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Mb({reducer:AE,preloadedState:t,middleware:n=>{var i;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([Jm.middleware,eg.middleware,ns.middleware,ag.middleware,ug.middleware])},enhancers:n=>{var i=n;return typeof n=="function"&&(i=n()),i.concat(Th({type:"raf"}))},devTools:{serialize:{replacer:xE},name:"recharts-".concat(r)}})};function OE(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=Ze(),a=v.useRef(null);if(i)return r;a.current==null&&(a.current=_E(t,n));var o=Vu;return v.createElement(qO,{context:o,store:a.current},r)}function EE(e){var{layout:t,margin:r}=e,n=Me(),i=Ze();return v.useEffect(()=>{i||(n(rx(t)),n(tx(r)))},[n,i,t,r]),null}var ME=v.memo(EE,Km);function kE(e){var t=Me();return v.useEffect(()=>{t(SE(e))},[t,e]),null}function yd(e){var{zIndex:t,isPanorama:r}=e,n=v.useRef(null),i=Me();return v.useLayoutEffect(()=>(n.current&&i(aA({zIndex:t,element:n.current,isPanorama:r})),()=>{i(oA({zIndex:t,isPanorama:r}))}),[i,t,r]),v.createElement("g",{tabIndex:-1,ref:n})}function bd(e){var{children:t,isPanorama:r}=e,n=Q(GC);if(!n||n.length===0)return t;var i=n.filter(o=>o<0),a=n.filter(o=>o>0);return v.createElement(v.Fragment,null,i.map(o=>v.createElement(yd,{key:o,zIndex:o,isPanorama:r})),t,a.map(o=>v.createElement(yd,{key:o,zIndex:o,isPanorama:r})))}var TE=["children"];function DE(e,t){if(e==null)return{};var r,n,i=jE(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function jE(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Bi(){return Bi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bi.apply(null,arguments)}var NE={width:"100%",height:"100%",display:"block"},$E=v.forwardRef((e,t)=>{var r=Nx(),n=$x(),i=t1();if(!mi(r)||!mi(n))return null;var{children:a,otherAttributes:o,title:u,desc:l}=e,s,c;return o!=null&&(typeof o.tabIndex=="number"?s=o.tabIndex:s=i?0:void 0,typeof o.role=="string"?c=o.role:c=i?"application":void 0),v.createElement(Wd,Bi({},o,{title:u,desc:l,role:c,tabIndex:s,width:r,height:n,style:NE,ref:t}),a)}),RE=e=>{var{children:t}=e,r=Q(oa);if(!r)return null;var{width:n,height:i,y:a,x:o}=r;return v.createElement(Wd,{width:n,height:i,x:o,y:a},t)},xd=v.forwardRef((e,t)=>{var{children:r}=e,n=DE(e,TE),i=Ze();return i?v.createElement(RE,null,v.createElement(bd,{isPanorama:!0},r)):v.createElement($E,Bi({ref:t},n),v.createElement(bd,{isPanorama:!1},r))});function LE(){var e=Me(),[t,r]=v.useState(null),n=Q(wx);return v.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;ne(a)&&a!==n&&e(ix(a))}},[t,e,n]),r}function wd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wd(Object(r),!0).forEach(function(n){FE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function FE(e,t,r){return(t=BE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BE(e){var t=UE(e,"string");return typeof t=="symbol"?t:t+""}function UE(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ar(){return ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ar.apply(null,arguments)}var KE=()=>(_A(),null);function Ui(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var qE=v.forwardRef((e,t)=>{var r,n,i=v.useRef(null),[a,o]=v.useState({containerWidth:Ui((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Ui((n=e.style)===null||n===void 0?void 0:n.height)}),u=v.useCallback((s,c)=>{o(f=>{var d=Math.round(s),h=Math.round(c);return f.containerWidth===d&&f.containerHeight===h?f:{containerWidth:d,containerHeight:h}})},[]),l=v.useCallback(s=>{if(typeof t=="function"&&t(s),s!=null&&typeof ResizeObserver<"u"){var{width:c,height:f}=s.getBoundingClientRect();u(c,f);var d=p=>{var{width:g,height:m}=p[0].contentRect;u(g,m)},h=new ResizeObserver(d);h.observe(s),i.current=h}},[t,u]);return v.useEffect(()=>()=>{var s=i.current;s!=null&&s.disconnect()},[u]),v.createElement(v.Fragment,null,v.createElement(ua,{width:a.containerWidth,height:a.containerHeight}),v.createElement("div",ar({ref:l},e)))}),WE=v.forwardRef((e,t)=>{var{width:r,height:n}=e,[i,a]=v.useState({containerWidth:Ui(r),containerHeight:Ui(n)}),o=v.useCallback((l,s)=>{a(c=>{var f=Math.round(l),d=Math.round(s);return c.containerWidth===f&&c.containerHeight===d?c:{containerWidth:f,containerHeight:d}})},[]),u=v.useCallback(l=>{if(typeof t=="function"&&t(l),l!=null){var{width:s,height:c}=l.getBoundingClientRect();o(s,c)}},[t,o]);return v.createElement(v.Fragment,null,v.createElement(ua,{width:i.containerWidth,height:i.containerHeight}),v.createElement("div",ar({ref:u},e)))}),HE=v.forwardRef((e,t)=>{var{width:r,height:n}=e;return v.createElement(v.Fragment,null,v.createElement(ua,{width:r,height:n}),v.createElement("div",ar({ref:t},e)))}),VE=v.forwardRef((e,t)=>{var{width:r,height:n}=e;return Vr(r)||Vr(n)?v.createElement(WE,ar({},e,{ref:t})):v.createElement(HE,ar({},e,{ref:t}))});function YE(e){return e===!0?qE:VE}var GE=v.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:o,onDoubleClick:u,onMouseDown:l,onMouseEnter:s,onMouseLeave:c,onMouseMove:f,onMouseUp:d,onTouchEnd:h,onTouchMove:p,onTouchStart:g,style:m,width:y,responsive:x,dispatchTouchEvents:w=!0}=e,S=v.useRef(null),b=Me(),[P,E]=v.useState(null),[k,D]=v.useState(null),z=LE(),O=Yh(),M=(O==null?void 0:O.width)>0?O.width:y,K=(O==null?void 0:O.height)>0?O.height:i,$=v.useCallback(A=>{z(A),typeof t=="function"&&t(A),E(A),D(A),A!=null&&(S.current=A)},[z,t,E,D]),ae=v.useCallback(A=>{b(Qm(A)),b(ze({handler:a,reactEvent:A}))},[b,a]),ge=v.useCallback(A=>{b(Pu(A)),b(ze({handler:s,reactEvent:A}))},[b,s]),Te=v.useCallback(A=>{b(rm()),b(ze({handler:c,reactEvent:A}))},[b,c]),Oe=v.useCallback(A=>{b(Pu(A)),b(ze({handler:f,reactEvent:A}))},[b,f]),he=v.useCallback(()=>{b(ig())},[b]),Qe=v.useCallback(A=>{b(ng(A.key))},[b]),Je=v.useCallback(A=>{b(ze({handler:o,reactEvent:A}))},[b,o]),et=v.useCallback(A=>{b(ze({handler:u,reactEvent:A}))},[b,u]),ut=v.useCallback(A=>{b(ze({handler:l,reactEvent:A}))},[b,l]),B=v.useCallback(A=>{b(ze({handler:d,reactEvent:A}))},[b,d]),L=v.useCallback(A=>{b(ze({handler:g,reactEvent:A}))},[b,g]),N=v.useCallback(A=>{w&&b(og(A)),b(ze({handler:p,reactEvent:A}))},[b,w,p]),U=v.useCallback(A=>{b(ze({handler:h,reactEvent:A}))},[b,h]),ye=YE(x);return v.createElement(lA.Provider,{value:P},v.createElement(Vy.Provider,{value:k},v.createElement(ye,{width:M??(m==null?void 0:m.width),height:K??(m==null?void 0:m.height),className:ot("recharts-wrapper",n),style:zE({position:"relative",cursor:"default",width:M,height:K},m),onClick:ae,onContextMenu:Je,onDoubleClick:et,onFocus:he,onKeyDown:Qe,onMouseDown:ut,onMouseEnter:ge,onMouseLeave:Te,onMouseMove:Oe,onMouseUp:B,onTouchEnd:U,onTouchMove:N,onTouchStart:L,ref:$},v.createElement(KE,null),r)))}),XE=["width","height","responsive","children","className","style","compact","title","desc"];function ZE(e,t){if(e==null)return{};var r,n,i=QE(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function QE(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var JE=v.forwardRef((e,t)=>{var{width:r,height:n,responsive:i,children:a,className:o,style:u,compact:l,title:s,desc:c}=e,f=ZE(e,XE),d=Zt(f);return l?v.createElement(v.Fragment,null,v.createElement(ua,{width:r,height:n}),v.createElement(xd,{otherAttributes:d,title:s,desc:c},a)):v.createElement(GE,{className:o,style:u,width:r,height:n,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},v.createElement(xd,{otherAttributes:d,title:s,desc:c,ref:t},v.createElement(PO,null,a)))});function Cu(){return Cu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cu.apply(null,arguments)}var eM={top:5,right:5,bottom:5,left:5},tM={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:eM,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},rM=v.forwardRef(function(t,r){var n,i=Ar(t.categoricalChartProps,tM),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:u,tooltipPayloadSearcher:l,categoricalChartProps:s}=t,c={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:u,tooltipPayloadSearcher:l,eventEmitter:void 0};return v.createElement(OE,{preloadedState:{options:c},reduxStoreName:(n=s.id)!==null&&n!==void 0?n:a},v.createElement(bO,{chartData:s.data}),v.createElement(ME,{layout:i.layout,margin:i.margin}),v.createElement(kE,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),v.createElement(JE,Cu({},i,{ref:r})))}),nM=["axis"],iM=v.forwardRef((e,t)=>v.createElement(rM,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:nM,tooltipPayloadSearcher:dA,categoricalChartProps:e,ref:t}));v.createContext(null);function aM(e){const t=e.primary,r=t.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/);if(r){const[,n,i,a]=r.map(Number);return"#"+[n,i,a].map(o=>o.toString(16).padStart(2,"0")).join("")}return t}function ZM({buckets:e=16,artistId:t=0,albumId:r=0,trackId:n=0}){const{isPending:i,isError:a,data:o,error:u}=Ki({queryKey:["interest",{buckets:e,artist_id:t,album_id:r,track_id:n}],queryFn:({queryKey:c})=>Ig(c[1])}),{theme:l}=_g(),s=aM(l);return i?I.jsxs("div",{className:"w-[350px] sm:w-[500px]",children:[I.jsx("h3",{children:"Interest over time"}),I.jsx("p",{children:"Loading..."})]}):a?I.jsxs("div",{className:"w-[350px] sm:w-[500px]",children:[I.jsx("h3",{children:"Interest over time"}),I.jsxs("p",{className:"error",children:["Error: ",u.message]})]}):I.jsxs("div",{className:"flex flex-col items-start w-full max-w-[335px] sm:max-w-[500px]",children:[I.jsx("h3",{children:"Interest over time"}),I.jsxs(iM,{style:{width:"100%",aspectRatio:3.5,maxWidth:440,overflow:"visible"},data:o,margin:{top:15,bottom:20},children:[I.jsx("defs",{children:I.jsxs("linearGradient",{id:"colorGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[I.jsx("stop",{offset:"5%",stopColor:s,stopOpacity:.5}),I.jsx("stop",{offset:"95%",stopColor:s,stopOpacity:0})]})}),I.jsx(Iu,{dataKey:"listen_count",type:"natural",stroke:"none",fill:"url(#colorGradient)",animationDuration:0,animationEasing:"ease-in-out",activeDot:!1}),I.jsx(Iu,{dataKey:"listen_count",type:"natural",stroke:s,fill:"none",strokeWidth:2,animationDuration:0,animationEasing:"ease-in-out",dot:!1,activeDot:!1,style:{filter:`drop-shadow(0px 0px 0px ${s})`}})]})]})}export{ZM as I,mM as M};
