From 73f780d5aecda53156012c202833a7dac5284132 Mon Sep 17 00:00:00 2001 From: flyworker Date: Mon, 7 Sep 2026 06:17:10 +0000 Subject: [PATCH] fix(dashboard): stop re-pricing finished history from live counters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A completed day changed value whenever the process restarted. The same 30-day window read $32.58, $85.88 and $16.83 within an hour today, and the day of 2026-08-30 — a fixed 12,604,819 tokens in every reading — was reported at $7.83, $21.74 and $4.07. Only the multiplier moved. Buckets recorded before the per-model column existed carry token counts but no split, so they can only be valued at an average rate. That average came from blendedRate(metrics, ...), which reads the in-memory model counters — counters that reset on restart and reflect only what has served since. Nine days of history, 94% of the window, were priced by whichever models happened to have traffic in the current process. The blend now comes from the per-model splits stored in the window itself, so it is a function of persisted data and prices the same window the same way twice running. It is still an estimate and the card still says so; it is now a reproducible one. The live mix remains the fallback for a window that carries no split at all. Model colours had the same root cause: they were assigned from the lifetime per-model earnings, also in-memory, so after a restart every model that had not yet served folded into "Other" despite the history holding its figures. The stored history is merged in, ranking each model on whichever total is larger. On this node that took the 30-day breakdown from one named model to four. --- internal/computing/earnings_history.go | 71 ++++++++++++++++++- internal/computing/earnings_history_test.go | 42 +++++++++++ .../{index-Jdi25-n1.js => index-C7GAs1KU.js} | 22 +++--- internal/dashboard/ui/dist/index.html | 2 +- .../ui/src/components/EarningsChart.tsx | 41 ++++++++++- 5 files changed, 164 insertions(+), 14 deletions(-) rename internal/dashboard/ui/dist/assets/{index-Jdi25-n1.js => index-C7GAs1KU.js} (89%) diff --git a/internal/computing/earnings_history.go b/internal/computing/earnings_history.go index 233ebaf..162bfbe 100644 --- a/internal/computing/earnings_history.go +++ b/internal/computing/earnings_history.go @@ -64,6 +64,70 @@ type EarningsSeries struct { // by the tokens each model has actually served is the closest available // approximation, and it is why this series is explicitly the node's own // estimate rather than a statement of earnings. +// historyBlendedRate prices unattributed history from the history itself. +// +// Buckets recorded before the per-model column existed carry token counts but +// no split, so they can only be valued at some average rate. That average used +// to come from the live in-memory metrics — counters that reset on every +// restart. The result was that a finished day was re-priced whenever the +// process bounced or the model mix changed: one day holding a fixed 12,604,819 +// tokens was reported at $7.83, $21.74 and $4.07 within a single hour, because +// only the multiplier had moved. +// +// Deriving the blend from the per-model splits stored *in the window* makes it +// a function of persisted data instead. It is still an estimate — the card says +// so — but it is a reproducible one: the same window prices the same way twice +// running, across restarts. +func historyBlendedRate(snapshots []HistoricalDataPoint, rates map[string]ModelPrice) (in, out float64) { + totals := map[string]ModelTokenCounts{} + prev := map[string]ModelTokenCounts{} + for _, s := range snapshots { + if s.ModelTokens == nil { + continue + } + for id, c := range s.ModelTokens { + p, seen := prev[id] + var dIn, dOut int64 + switch { + case !seen: + // First sighting sets the baseline, exactly as the main loop + // does — counting the cumulative value here would weight the + // blend by traffic served before the window. + case c.In < p.In || c.Out < p.Out: + dIn, dOut = c.In, c.Out // restart + default: + dIn, dOut = c.In-p.In, c.Out-p.Out + } + t := totals[id] + t.In += dIn + t.Out += dOut + totals[id] = t + } + for id, c := range s.ModelTokens { + prev[id] = c + } + } + + var tin, tout int64 + for id, t := range totals { + r, ok := rates[id] + if !ok { + continue + } + in += float64(t.In) * r.ProviderInputPrice + out += float64(t.Out) * r.ProviderOutputPrice + tin += t.In + tout += t.Out + } + if tin > 0 { + in /= float64(tin) + } + if tout > 0 { + out /= float64(tout) + } + return in, out +} + func blendedRate(metrics *InferenceMetricsData, rates map[string]ModelPrice) (in, out float64) { var tin, tout int64 for id, m := range metrics.ModelMetrics { @@ -117,7 +181,12 @@ func CalculateEarningsHistory(ctx context.Context, snapshots []HistoricalDataPoi rates = p } } - inRate, outRate := blendedRate(metrics, rates) + inRate, outRate := historyBlendedRate(snapshots, rates) + if inRate == 0 && outRate == 0 { + // No sample in the window carries a per-model split — every bucket + // predates the column. Fall back to the live mix, which is all there is. + inRate, outRate = blendedRate(metrics, rates) + } var prevIn, prevOut int64 var prevPlatform *float64 diff --git a/internal/computing/earnings_history_test.go b/internal/computing/earnings_history_test.go index 5d843e6..a48ae83 100644 --- a/internal/computing/earnings_history_test.go +++ b/internal/computing/earnings_history_test.go @@ -187,3 +187,45 @@ func TestHistorySplitNeverExceedsBucketTotal(t *testing.T) { } } } + +// A finished bucket must not change value because the live counters moved. +// +// Buckets with no per-model split are priced at an average rate. That average +// used to come from the in-memory metrics, which reset on restart, so the same +// historical day was re-priced whenever the process bounced: one real day of +// 12.6M tokens read $7.83, $21.74 and $4.07 within an hour. +func TestHistoryPricingDoesNotDependOnLiveCounters(t *testing.T) { + withModels := func(min int, in, out int64, split map[string]ModelTokenCounts) HistoricalDataPoint { + p := pt(min, in, out) + p.ModelTokens = split + return p + } + // Two early samples carry no split (the pre-column history), two later ones + // do — the same shape as a real window. + snapshots := []HistoricalDataPoint{ + pt(0, 1_000_000, 0), + pt(60, 3_000_000, 0), + withModels(120, 5_000_000, 0, map[string]ModelTokenCounts{"org/a": {In: 1_000_000}}), + withModels(180, 7_000_000, 0, map[string]ModelTokenCounts{"org/a": {In: 3_000_000}}), + } + rates := fakePrices{rates: map[string]ModelPrice{ + "org/a": {ProviderInputPrice: 1.0}, + "org/b": {ProviderInputPrice: 50.0}, + }} + + // The same window, priced against two very different live mixes. Before the + // fix the expensive mix inflated every unattributed bucket. + cheap := CalculateEarningsHistory(context.Background(), snapshots, + &InferenceMetricsData{ModelMetrics: map[string]*ModelMetrics{ + "org/a": {TotalTokensIn: 1_000_000}, + }}, rates, "30d", 0) + expensive := CalculateEarningsHistory(context.Background(), snapshots, + &InferenceMetricsData{ModelMetrics: map[string]*ModelMetrics{ + "org/b": {TotalTokensIn: 9_000_000}, + }}, rates, "30d", 0) + + if cheap.TotalUSD != expensive.TotalUSD { + t.Errorf("the same window priced differently depending on the live model mix: %.6f vs %.6f", + cheap.TotalUSD, expensive.TotalUSD) + } +} diff --git a/internal/dashboard/ui/dist/assets/index-Jdi25-n1.js b/internal/dashboard/ui/dist/assets/index-C7GAs1KU.js similarity index 89% rename from internal/dashboard/ui/dist/assets/index-Jdi25-n1.js rename to internal/dashboard/ui/dist/assets/index-C7GAs1KU.js index 622bf52..f9f6c94 100644 --- a/internal/dashboard/ui/dist/assets/index-Jdi25-n1.js +++ b/internal/dashboard/ui/dist/assets/index-C7GAs1KU.js @@ -1,18 +1,18 @@ -function _4(e,t){for(var n=0;na[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function Qr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lm={exports:{}},Lu={};var CS;function A4(){if(CS)return Lu;CS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var c=null;if(o!==void 0&&(c=""+o),l.key!==void 0&&(c=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:a,key:c,ref:l!==void 0?l:null,props:o}}return Lu.Fragment=t,Lu.jsx=n,Lu.jsxs=n,Lu}var DS;function E4(){return DS||(DS=1,Lm.exports=A4()),Lm.exports}var g=E4(),$m={exports:{}},xe={};var kS;function N4(){if(kS)return xe;kS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function x(k){return k===null||typeof k!="object"?null:(k=b&&k[b]||k["@@iterator"],typeof k=="function"?k:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,_={};function E(k,F,ie){this.props=k,this.context=F,this.refs=_,this.updater=ie||O}E.prototype.isReactComponent={},E.prototype.setState=function(k,F){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,F,"setState")},E.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function N(){}N.prototype=E.prototype;function M(k,F,ie){this.props=k,this.context=F,this.refs=_,this.updater=ie||O}var P=M.prototype=new N;P.constructor=M,j(P,E.prototype),P.isPureReactComponent=!0;var T=Array.isArray;function C(){}var L={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function ne(k,F,ie){var le=ie.ref;return{$$typeof:e,type:k,key:F,ref:le!==void 0?le:null,props:ie}}function q(k,F){return ne(k.type,F,k.props)}function U(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function B(k){var F={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ie){return F[ie]})}var ue=/\/+/g;function oe(k,F){return typeof k=="object"&&k!==null&&k.key!=null?B(""+k.key):F.toString(36)}function ve(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(C,C):(k.status="pending",k.then(function(F){k.status==="pending"&&(k.status="fulfilled",k.value=F)},function(F){k.status==="pending"&&(k.status="rejected",k.reason=F)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function K(k,F,ie,le,ye){var be=typeof k;(be==="undefined"||be==="boolean")&&(k=null);var he=!1;if(k===null)he=!0;else switch(be){case"bigint":case"string":case"number":he=!0;break;case"object":switch(k.$$typeof){case e:case t:he=!0;break;case v:return he=k._init,K(he(k._payload),F,ie,le,ye)}}if(he)return ye=ye(k),he=le===""?"."+oe(k,0):le,T(ye)?(ie="",he!=null&&(ie=he.replace(ue,"$&/")+"/"),K(ye,F,ie,"",function(Se){return Se})):ye!=null&&(U(ye)&&(ye=q(ye,ie+(ye.key==null||k&&k.key===ye.key?"":(""+ye.key).replace(ue,"$&/")+"/")+he)),F.push(ye)),1;he=0;var ut=le===""?".":le+":";if(T(k))for(var W=0;W>>1,re=K[G];if(0>>1;Gl(ie,z))lel(ye,ie)?(K[G]=ye,K[le]=z,G=le):(K[G]=ie,K[F]=z,G=F);else if(lel(ye,z))K[G]=ye,K[le]=z,G=le;else break e}}return ee}function l(K,ee){var z=K.sortIndex-ee.sortIndex;return z!==0?z:K.id-ee.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var d=[],h=[],v=1,p=null,b=3,x=!1,O=!1,j=!1,_=!1,E=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function P(K){for(var ee=n(h);ee!==null;){if(ee.callback===null)a(h);else if(ee.startTime<=K)a(h),ee.sortIndex=ee.expirationTime,t(d,ee);else break;ee=n(h)}}function T(K){if(j=!1,P(K),!O)if(n(d)!==null)O=!0,C||(C=!0,B());else{var ee=n(h);ee!==null&&ve(T,ee.startTime-K)}}var C=!1,L=-1,Z=5,ne=-1;function q(){return _?!0:!(e.unstable_now()-neK&&q());){var G=p.callback;if(typeof G=="function"){p.callback=null,b=p.priorityLevel;var re=G(p.expirationTime<=K);if(K=e.unstable_now(),typeof re=="function"){p.callback=re,P(K),ee=!0;break t}p===n(d)&&a(d),P(K)}else a(d);p=n(d)}if(p!==null)ee=!0;else{var k=n(h);k!==null&&ve(T,k.startTime-K),ee=!1}}break e}finally{p=null,b=z,x=!1}ee=void 0}}finally{ee?B():C=!1}}}var B;if(typeof M=="function")B=function(){M(U)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,oe=ue.port2;ue.port1.onmessage=U,B=function(){oe.postMessage(null)}}else B=function(){E(U,0)};function ve(K,ee){L=E(function(){K(e.unstable_now())},ee)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_forceFrameRate=function(K){0>K||125G?(K.sortIndex=z,t(h,K),n(d)===null&&K===n(h)&&(j?(N(L),L=-1):j=!0,ve(T,z-G))):(K.sortIndex=re,t(d,K),O||x||(O=!0,C||(C=!0,B()))),K},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(K){var ee=b;return function(){var z=b;b=ee;try{return K.apply(this,arguments)}finally{b=z}}}})(Bm)),Bm}var RS;function D4(){return RS||(RS=1,qm.exports=C4()),qm.exports}var Im={exports:{}},Xt={};var LS;function k4(){if(LS)return Xt;LS=1;var e=kl();function t(d){var h="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Im.exports=k4(),Im.exports}var US;function P4(){if(US)return $u;US=1;var e=D4(),t=kl(),n=G_();function a(r){var i="https://react.dev/errors/"+r;if(1re||(r.current=G[re],G[re]=null,re--)}function ie(r,i){re++,G[re]=r.current,r.current=i}var le=k(null),ye=k(null),be=k(null),he=k(null);function ut(r,i){switch(ie(be,i),ie(ye,r),ie(le,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?eS(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=eS(i),r=tS(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}F(le),ie(le,r)}function W(){F(le),F(ye),F(be)}function Se(r){r.memoizedState!==null&&ie(he,r);var i=le.current,u=tS(i,r.type);i!==u&&(ie(ye,r),ie(le,u))}function _e(r){ye.current===r&&(F(le),F(ye)),he.current===r&&(F(he),ku._currentValue=z)}var ae,Lt;function Ce(r){if(ae===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);ae=i&&i[1]||"",Lt=-1a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function Qr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lm={exports:{}},Lu={};var CS;function A4(){if(CS)return Lu;CS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var c=null;if(o!==void 0&&(c=""+o),l.key!==void 0&&(c=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:a,key:c,ref:l!==void 0?l:null,props:o}}return Lu.Fragment=t,Lu.jsx=n,Lu.jsxs=n,Lu}var DS;function E4(){return DS||(DS=1,Lm.exports=A4()),Lm.exports}var g=E4(),$m={exports:{}},xe={};var kS;function N4(){if(kS)return xe;kS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function x(k){return k===null||typeof k!="object"?null:(k=b&&k[b]||k["@@iterator"],typeof k=="function"?k:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,_={};function E(k,Z,ie){this.props=k,this.context=Z,this.refs=_,this.updater=ie||O}E.prototype.isReactComponent={},E.prototype.setState=function(k,Z){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,Z,"setState")},E.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function N(){}N.prototype=E.prototype;function M(k,Z,ie){this.props=k,this.context=Z,this.refs=_,this.updater=ie||O}var P=M.prototype=new N;P.constructor=M,j(P,E.prototype),P.isPureReactComponent=!0;var T=Array.isArray;function C(){}var R={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function ee(k,Z,ie){var le=ie.ref;return{$$typeof:e,type:k,key:Z,ref:le!==void 0?le:null,props:ie}}function q(k,Z){return ee(k.type,Z,k.props)}function U(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function B(k){var Z={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ie){return Z[ie]})}var ue=/\/+/g;function oe(k,Z){return typeof k=="object"&&k!==null&&k.key!=null?B(""+k.key):Z.toString(36)}function ve(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(C,C):(k.status="pending",k.then(function(Z){k.status==="pending"&&(k.status="fulfilled",k.value=Z)},function(Z){k.status==="pending"&&(k.status="rejected",k.reason=Z)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function K(k,Z,ie,le,ye){var be=typeof k;(be==="undefined"||be==="boolean")&&(k=null);var he=!1;if(k===null)he=!0;else switch(be){case"bigint":case"string":case"number":he=!0;break;case"object":switch(k.$$typeof){case e:case t:he=!0;break;case v:return he=k._init,K(he(k._payload),Z,ie,le,ye)}}if(he)return ye=ye(k),he=le===""?"."+oe(k,0):le,T(ye)?(ie="",he!=null&&(ie=he.replace(ue,"$&/")+"/"),K(ye,Z,ie,"",function(Se){return Se})):ye!=null&&(U(ye)&&(ye=q(ye,ie+(ye.key==null||k&&k.key===ye.key?"":(""+ye.key).replace(ue,"$&/")+"/")+he)),Z.push(ye)),1;he=0;var ut=le===""?".":le+":";if(T(k))for(var W=0;W>>1,re=K[G];if(0>>1;Gl(ie,z))lel(ye,ie)?(K[G]=ye,K[le]=z,G=le):(K[G]=ie,K[Z]=z,G=Z);else if(lel(ye,z))K[G]=ye,K[le]=z,G=le;else break e}}return te}function l(K,te){var z=K.sortIndex-te.sortIndex;return z!==0?z:K.id-te.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var d=[],h=[],v=1,p=null,b=3,x=!1,O=!1,j=!1,_=!1,E=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function P(K){for(var te=n(h);te!==null;){if(te.callback===null)a(h);else if(te.startTime<=K)a(h),te.sortIndex=te.expirationTime,t(d,te);else break;te=n(h)}}function T(K){if(j=!1,P(K),!O)if(n(d)!==null)O=!0,C||(C=!0,B());else{var te=n(h);te!==null&&ve(T,te.startTime-K)}}var C=!1,R=-1,F=5,ee=-1;function q(){return _?!0:!(e.unstable_now()-eeK&&q());){var G=p.callback;if(typeof G=="function"){p.callback=null,b=p.priorityLevel;var re=G(p.expirationTime<=K);if(K=e.unstable_now(),typeof re=="function"){p.callback=re,P(K),te=!0;break t}p===n(d)&&a(d),P(K)}else a(d);p=n(d)}if(p!==null)te=!0;else{var k=n(h);k!==null&&ve(T,k.startTime-K),te=!1}}break e}finally{p=null,b=z,x=!1}te=void 0}}finally{te?B():C=!1}}}var B;if(typeof M=="function")B=function(){M(U)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,oe=ue.port2;ue.port1.onmessage=U,B=function(){oe.postMessage(null)}}else B=function(){E(U,0)};function ve(K,te){R=E(function(){K(e.unstable_now())},te)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_forceFrameRate=function(K){0>K||125G?(K.sortIndex=z,t(h,K),n(d)===null&&K===n(h)&&(j?(N(R),R=-1):j=!0,ve(T,z-G))):(K.sortIndex=re,t(d,K),O||x||(O=!0,C||(C=!0,B()))),K},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(K){var te=b;return function(){var z=b;b=te;try{return K.apply(this,arguments)}finally{b=z}}}})(Bm)),Bm}var RS;function D4(){return RS||(RS=1,qm.exports=C4()),qm.exports}var Im={exports:{}},Xt={};var LS;function k4(){if(LS)return Xt;LS=1;var e=kl();function t(d){var h="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Im.exports=k4(),Im.exports}var US;function P4(){if(US)return $u;US=1;var e=D4(),t=kl(),n=G_();function a(r){var i="https://react.dev/errors/"+r;if(1re||(r.current=G[re],G[re]=null,re--)}function ie(r,i){re++,G[re]=r.current,r.current=i}var le=k(null),ye=k(null),be=k(null),he=k(null);function ut(r,i){switch(ie(be,i),ie(ye,r),ie(le,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?eS(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=eS(i),r=tS(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}Z(le),ie(le,r)}function W(){Z(le),Z(ye),Z(be)}function Se(r){r.memoizedState!==null&&ie(he,r);var i=le.current,u=tS(i,r.type);i!==u&&(ie(ye,r),ie(le,u))}function _e(r){ye.current===r&&(Z(le),Z(ye)),he.current===r&&(Z(he),ku._currentValue=z)}var ae,Lt;function Ce(r){if(ae===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);ae=i&&i[1]||"",Lt=-1)":-1m||D[s]!==H[m]){var Q=` `+D[s].replace(" at new "," at ");return r.displayName&&Q.includes("")&&(Q=Q.replace("",r.displayName)),Q}while(1<=s&&0<=m);break}}}finally{$t=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?Ce(u):""}function br(r,i){switch(r.tag){case 26:case 27:case 5:return Ce(r.type);case 16:return Ce("Lazy");case 13:return r.child!==i&&i!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return Ut(r.type,!1);case 11:return Ut(r.type.render,!1);case 1:return Ut(r.type,!0);case 31:return Ce("Activity");default:return""}}function Kl(r){try{var i="",u=null;do i+=br(r,u),u=r,r=r.return;while(r);return i}catch(s){return` Error generating stack: `+s.message+` -`+s.stack}}var wd=Object.prototype.hasOwnProperty,jd=e.unstable_scheduleCallback,Od=e.unstable_cancelCallback,r3=e.unstable_shouldYield,a3=e.unstable_requestPaint,vn=e.unstable_now,i3=e.unstable_getCurrentPriorityLevel,Dg=e.unstable_ImmediatePriority,kg=e.unstable_UserBlockingPriority,Ko=e.unstable_NormalPriority,l3=e.unstable_LowPriority,Pg=e.unstable_IdlePriority,u3=e.log,o3=e.unstable_setDisableYieldValue,Yl=null,pn=null;function aa(r){if(typeof u3=="function"&&o3(r),pn&&typeof pn.setStrictMode=="function")try{pn.setStrictMode(Yl,r)}catch{}}var yn=Math.clz32?Math.clz32:f3,s3=Math.log,c3=Math.LN2;function f3(r){return r>>>=0,r===0?32:31-(s3(r)/c3|0)|0}var Yo=256,Go=262144,Vo=4194304;function Ha(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Xo(r,i,u){var s=r.pendingLanes;if(s===0)return 0;var m=0,y=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var A=s&134217727;return A!==0?(s=A&~y,s!==0?m=Ha(s):(w&=A,w!==0?m=Ha(w):u||(u=A&~r,u!==0&&(m=Ha(u))))):(A=s&~y,A!==0?m=Ha(A):w!==0?m=Ha(w):u||(u=s&~r,u!==0&&(m=Ha(u)))),m===0?0:i!==0&&i!==m&&(i&y)===0&&(y=m&-m,u=i&-i,y>=u||y===32&&(u&4194048)!==0)?i:m}function Gl(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function d3(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zg(){var r=Vo;return Vo<<=1,(Vo&62914560)===0&&(Vo=4194304),r}function _d(r){for(var i=[],u=0;31>u;u++)i.push(r);return i}function Vl(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function h3(r,i,u,s,m,y){var w=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var A=r.entanglements,D=r.expirationTimes,H=r.hiddenUpdates;for(u=w&~u;0"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var b3=/[\n"\\]/g;function Dn(r){return r.replace(b3,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Cd(r,i,u,s,m,y,w,A){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),i!=null?w==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Cn(i)):r.value!==""+Cn(i)&&(r.value=""+Cn(i)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),i!=null?Dd(r,w,Cn(i)):u!=null?Dd(r,w,Cn(u)):s!=null&&r.removeAttribute("value"),m==null&&y!=null&&(r.defaultChecked=!!y),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?r.name=""+Cn(A):r.removeAttribute("name")}function Xg(r,i,u,s,m,y,w,A){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||u!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){Md(r);return}u=u!=null?""+Cn(u):"",i=i!=null?""+Cn(i):u,A||i===r.value||(r.value=i),r.defaultValue=i}s=s??m,s=typeof s!="function"&&typeof s!="symbol"&&!!s,r.checked=A?r.checked:!!s,r.defaultChecked=!!s,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),Md(r)}function Dd(r,i,u){i==="number"&&Qo(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function Pi(r,i,u,s){if(r=r.options,i){i={};for(var m=0;m"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ld=!1;if(wr)try{var Ql={};Object.defineProperty(Ql,"passive",{get:function(){Ld=!0}}),window.addEventListener("test",Ql,Ql),window.removeEventListener("test",Ql,Ql)}catch{Ld=!1}var la=null,$d=null,Jo=null;function tb(){if(Jo)return Jo;var r,i=$d,u=i.length,s,m="value"in la?la.value:la.textContent,y=m.length;for(r=0;r=eu),ub=" ",ob=!1;function sb(r,i){switch(r){case"keyup":return V3.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cb(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var $i=!1;function F3(r,i){switch(r){case"compositionend":return cb(i);case"keypress":return i.which!==32?null:(ob=!0,ub);case"textInput":return r=i.data,r===ub&&ob?null:r;default:return null}}function Z3(r,i){if($i)return r==="compositionend"||!Hd&&sb(r,i)?(r=tb(),Jo=$d=la=null,$i=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:u,offset:i-r};r=s}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=gb(u)}}function xb(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?xb(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Sb(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Qo(r.document);i instanceof r.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)r=i.contentWindow;else break;i=Qo(r.document)}return i}function Gd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var aC=wr&&"documentMode"in document&&11>=document.documentMode,Ui=null,Vd=null,au=null,Xd=!1;function wb(r,i,u){var s=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Xd||Ui==null||Ui!==Qo(s)||(s=Ui,"selectionStart"in s&&Gd(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),au&&ru(au,s)||(au=s,s=Gs(Vd,"onSelect"),0>=w,m-=w,lr=1<<32-yn(i)+m|u<Oe?(Te=fe,fe=null):Te=fe.sibling;var ke=Y($,fe,I[Oe],J);if(ke===null){fe===null&&(fe=Te);break}r&&fe&&ke.alternate===null&&i($,fe),R=y(ke,R,Oe),De===null?pe=ke:De.sibling=ke,De=ke,fe=Te}if(Oe===I.length)return u($,fe),Me&&Or($,Oe),pe;if(fe===null){for(;OeOe?(Te=fe,fe=null):Te=fe.sibling;var Na=Y($,fe,ke.value,J);if(Na===null){fe===null&&(fe=Te);break}r&&fe&&Na.alternate===null&&i($,fe),R=y(Na,R,Oe),De===null?pe=Na:De.sibling=Na,De=Na,fe=Te}if(ke.done)return u($,fe),Me&&Or($,Oe),pe;if(fe===null){for(;!ke.done;Oe++,ke=I.next())ke=te($,ke.value,J),ke!==null&&(R=y(ke,R,Oe),De===null?pe=ke:De.sibling=ke,De=ke);return Me&&Or($,Oe),pe}for(fe=s(fe);!ke.done;Oe++,ke=I.next())ke=X(fe,$,Oe,ke.value,J),ke!==null&&(r&&ke.alternate!==null&&fe.delete(ke.key===null?Oe:ke.key),R=y(ke,R,Oe),De===null?pe=ke:De.sibling=ke,De=ke);return r&&fe.forEach(function(O4){return i($,O4)}),Me&&Or($,Oe),pe}function Ke($,R,I,J){if(typeof I=="object"&&I!==null&&I.type===j&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case x:e:{for(var pe=I.key;R!==null;){if(R.key===pe){if(pe=I.type,pe===j){if(R.tag===7){u($,R.sibling),J=m(R,I.props.children),J.return=$,$=J;break e}}else if(R.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===Z&&ei(pe)===R.type){u($,R.sibling),J=m(R,I.props),cu(J,I),J.return=$,$=J;break e}u($,R);break}else i($,R);R=R.sibling}I.type===j?(J=Fa(I.props.children,$.mode,J,I.key),J.return=$,$=J):(J=ss(I.type,I.key,I.props,null,$.mode,J),cu(J,I),J.return=$,$=J)}return w($);case O:e:{for(pe=I.key;R!==null;){if(R.key===pe)if(R.tag===4&&R.stateNode.containerInfo===I.containerInfo&&R.stateNode.implementation===I.implementation){u($,R.sibling),J=m(R,I.children||[]),J.return=$,$=J;break e}else{u($,R);break}else i($,R);R=R.sibling}J=th(I,$.mode,J),J.return=$,$=J}return w($);case Z:return I=ei(I),Ke($,R,I,J)}if(ve(I))return ce($,R,I,J);if(B(I)){if(pe=B(I),typeof pe!="function")throw Error(a(150));return I=pe.call(I),ge($,R,I,J)}if(typeof I.then=="function")return Ke($,R,ps(I),J);if(I.$$typeof===M)return Ke($,R,ds($,I),J);ys($,I)}return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,R!==null&&R.tag===6?(u($,R.sibling),J=m(R,I),J.return=$,$=J):(u($,R),J=eh(I,$.mode,J),J.return=$,$=J),w($)):u($,R)}return function($,R,I,J){try{su=0;var pe=Ke($,R,I,J);return Zi=null,pe}catch(fe){if(fe===Fi||fe===ms)throw fe;var De=bn(29,fe,null,$.mode);return De.lanes=J,De.return=$,De}}}var ni=Yb(!0),Gb=Yb(!1),fa=!1;function hh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mh(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function da(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ha(r,i,u){var s=r.updateQueue;if(s===null)return null;if(s=s.shared,(ze&2)!==0){var m=s.pending;return m===null?i.next=i:(i.next=m.next,m.next=i),s.pending=i,i=os(r),Tb(r,null,u),i}return us(r,s,i,u),os(r)}function fu(r,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var s=i.lanes;s&=r.pendingLanes,u|=s,i.lanes=u,Lg(r,u)}}function vh(r,i){var u=r.updateQueue,s=r.alternate;if(s!==null&&(s=s.updateQueue,u===s)){var m=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var w={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};y===null?m=y=w:y=y.next=w,u=u.next}while(u!==null);y===null?m=y=i:y=y.next=i}else m=y=i;u={baseState:s.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:s.shared,callbacks:s.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=i:r.next=i,u.lastBaseUpdate=i}var ph=!1;function du(){if(ph){var r=Xi;if(r!==null)throw r}}function hu(r,i,u,s){ph=!1;var m=r.updateQueue;fa=!1;var y=m.firstBaseUpdate,w=m.lastBaseUpdate,A=m.shared.pending;if(A!==null){m.shared.pending=null;var D=A,H=D.next;D.next=null,w===null?y=H:w.next=H,w=D;var Q=r.alternate;Q!==null&&(Q=Q.updateQueue,A=Q.lastBaseUpdate,A!==w&&(A===null?Q.firstBaseUpdate=H:A.next=H,Q.lastBaseUpdate=D))}if(y!==null){var te=m.baseState;w=0,Q=H=D=null,A=y;do{var Y=A.lane&-536870913,X=Y!==A.lane;if(X?(Ne&Y)===Y:(s&Y)===Y){Y!==0&&Y===Vi&&(ph=!0),Q!==null&&(Q=Q.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var ce=r,ge=A;Y=i;var Ke=u;switch(ge.tag){case 1:if(ce=ge.payload,typeof ce=="function"){te=ce.call(Ke,te,Y);break e}te=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=ge.payload,Y=typeof ce=="function"?ce.call(Ke,te,Y):ce,Y==null)break e;te=p({},te,Y);break e;case 2:fa=!0}}Y=A.callback,Y!==null&&(r.flags|=64,X&&(r.flags|=8192),X=m.callbacks,X===null?m.callbacks=[Y]:X.push(Y))}else X={lane:Y,tag:A.tag,payload:A.payload,callback:A.callback,next:null},Q===null?(H=Q=X,D=te):Q=Q.next=X,w|=Y;if(A=A.next,A===null){if(A=m.shared.pending,A===null)break;X=A,A=X.next,X.next=null,m.lastBaseUpdate=X,m.shared.pending=null}}while(!0);Q===null&&(D=te),m.baseState=D,m.firstBaseUpdate=H,m.lastBaseUpdate=Q,y===null&&(m.shared.lanes=0),ga|=w,r.lanes=w,r.memoizedState=te}}function Vb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Xb(r,i){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;ry?y:8;var w=K.T,A={};K.T=A,zh(r,!1,i,u);try{var D=m(),H=K.S;if(H!==null&&H(A,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var Q=hC(D,s);pu(r,i,Q,On(r))}else pu(r,i,s,On(r))}catch(te){pu(r,i,{then:function(){},status:"rejected",reason:te},On())}finally{ee.p=y,w!==null&&A.types!==null&&(w.types=A.types),K.T=w}}function bC(){}function kh(r,i,u,s){if(r.tag!==5)throw Error(a(476));var m=Ax(r).queue;_x(r,m,i,z,u===null?bC:function(){return Ex(r),u(s)})}function Ax(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:z},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:u},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Ex(r){var i=Ax(r);i.next===null&&(i=r.alternate.memoizedState),pu(r,i.next.queue,{},On())}function Ph(){return It(ku)}function Nx(){return ht().memoizedState}function Tx(){return ht().memoizedState}function xC(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var u=On();r=da(u);var s=ha(i,r,u);s!==null&&(cn(s,i,u),fu(s,i,u)),i={cache:sh()},r.payload=i;return}i=i.return}}function SC(r,i,u){var s=On();u={lane:s,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Es(r)?Cx(i,u):(u=Wd(r,i,u,s),u!==null&&(cn(u,r,s),Dx(u,i,s)))}function Mx(r,i,u){var s=On();pu(r,i,u,s)}function pu(r,i,u,s){var m={lane:s,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Es(r))Cx(i,m);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var w=i.lastRenderedState,A=y(w,u);if(m.hasEagerState=!0,m.eagerState=A,gn(A,w))return us(r,i,m,0),Ve===null&&ls(),!1}catch{}if(u=Wd(r,i,m,s),u!==null)return cn(u,r,s),Dx(u,i,s),!0}return!1}function zh(r,i,u,s){if(s={lane:2,revertLane:hm(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Es(r)){if(i)throw Error(a(479))}else i=Wd(r,u,s,2),i!==null&&cn(i,r,2)}function Es(r){var i=r.alternate;return r===we||i!==null&&i===we}function Cx(r,i){Wi=xs=!0;var u=r.pending;u===null?i.next=i:(i.next=u.next,u.next=i),r.pending=i}function Dx(r,i,u){if((u&4194048)!==0){var s=i.lanes;s&=r.pendingLanes,u|=s,i.lanes=u,Lg(r,u)}}var yu={readContext:It,use:js,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};yu.useEffectEvent=ot;var kx={readContext:It,use:js,useCallback:function(r,i){return Jt().memoizedState=[r,i===void 0?null:i],r},useContext:It,useEffect:px,useImperativeHandle:function(r,i,u){u=u!=null?u.concat([r]):null,_s(4194308,4,xx.bind(null,i,r),u)},useLayoutEffect:function(r,i){return _s(4194308,4,r,i)},useInsertionEffect:function(r,i){_s(4,2,r,i)},useMemo:function(r,i){var u=Jt();i=i===void 0?null:i;var s=r();if(ri){aa(!0);try{r()}finally{aa(!1)}}return u.memoizedState=[s,i],s},useReducer:function(r,i,u){var s=Jt();if(u!==void 0){var m=u(i);if(ri){aa(!0);try{u(i)}finally{aa(!1)}}}else m=i;return s.memoizedState=s.baseState=m,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:m},s.queue=r,r=r.dispatch=SC.bind(null,we,r),[s.memoizedState,r]},useRef:function(r){var i=Jt();return r={current:r},i.memoizedState=r},useState:function(r){r=Nh(r);var i=r.queue,u=Mx.bind(null,we,i);return i.dispatch=u,[r.memoizedState,u]},useDebugValue:Ch,useDeferredValue:function(r,i){var u=Jt();return Dh(u,r,i)},useTransition:function(){var r=Nh(!1);return r=_x.bind(null,we,r.queue,!0,!1),Jt().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,u){var s=we,m=Jt();if(Me){if(u===void 0)throw Error(a(407));u=u()}else{if(u=i(),Ve===null)throw Error(a(349));(Ne&127)!==0||ex(s,i,u)}m.memoizedState=u;var y={value:u,getSnapshot:i};return m.queue=y,px(nx.bind(null,s,y,r),[r]),s.flags|=2048,el(9,{destroy:void 0},tx.bind(null,s,y,u,i),null),u},useId:function(){var r=Jt(),i=Ve.identifierPrefix;if(Me){var u=ur,s=lr;u=(s&~(1<<32-yn(s)-1)).toString(32)+u,i="_"+i+"R_"+u,u=Ss++,0<\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof s.is=="string"?w.createElement("select",{is:s.is}):w.createElement("select"),s.multiple?y.multiple=!0:s.size&&(y.size=s.size);break;default:y=typeof s.is=="string"?w.createElement(m,{is:s.is}):w.createElement(m)}}y[qt]=i,y[rn]=s;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)y.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=y;e:switch(Kt(y,m,s),m){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Mr(i)}}return Je(i),Fh(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,u),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==s&&Mr(i);else{if(typeof s!="string"&&i.stateNode===null)throw Error(a(166));if(r=be.current,Yi(i)){if(r=i.stateNode,u=i.memoizedProps,s=null,m=Bt,m!==null)switch(m.tag){case 27:case 5:s=m.memoizedProps}r[qt]=i,r=!!(r.nodeValue===u||s!==null&&s.suppressHydrationWarning===!0||W1(r.nodeValue,u)),r||sa(i,!0)}else r=Vs(r).createTextNode(s),r[qt]=i,i.stateNode=r}return Je(i),null;case 31:if(u=i.memoizedState,r===null||r.memoizedState!==null){if(s=Yi(i),u!==null){if(r===null){if(!s)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[qt]=i}else Za(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Je(i),r=!1}else u=ih(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return i.flags&256?(Sn(i),i):(Sn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Je(i),null;case 13:if(s=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=Yi(i),s!==null&&s.dehydrated!==null){if(r===null){if(!m)throw Error(a(318));if(m=i.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(a(317));m[qt]=i}else Za(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Je(i),m=!1}else m=ih(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return i.flags&256?(Sn(i),i):(Sn(i),null)}return Sn(i),(i.flags&128)!==0?(i.lanes=u,i):(u=s!==null,r=r!==null&&r.memoizedState!==null,u&&(s=i.child,m=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(m=s.alternate.memoizedState.cachePool.pool),y=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(y=s.memoizedState.cachePool.pool),y!==m&&(s.flags|=2048)),u!==r&&u&&(i.child.flags|=8192),Ds(i,i.updateQueue),Je(i),null);case 4:return W(),r===null&&ym(i.stateNode.containerInfo),Je(i),null;case 10:return Ar(i.type),Je(i),null;case 19:if(F(dt),s=i.memoizedState,s===null)return Je(i),null;if(m=(i.flags&128)!==0,y=s.rendering,y===null)if(m)bu(s,!1);else{if(st!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=bs(r),y!==null){for(i.flags|=128,bu(s,!1),r=y.updateQueue,i.updateQueue=r,Ds(i,r),i.subtreeFlags=0,r=u,u=i.child;u!==null;)Mb(u,r),u=u.sibling;return ie(dt,dt.current&1|2),Me&&Or(i,s.treeForkCount),i.child}r=r.sibling}s.tail!==null&&vn()>Ls&&(i.flags|=128,m=!0,bu(s,!1),i.lanes=4194304)}else{if(!m)if(r=bs(y),r!==null){if(i.flags|=128,m=!0,r=r.updateQueue,i.updateQueue=r,Ds(i,r),bu(s,!0),s.tail===null&&s.tailMode==="hidden"&&!y.alternate&&!Me)return Je(i),null}else 2*vn()-s.renderingStartTime>Ls&&u!==536870912&&(i.flags|=128,m=!0,bu(s,!1),i.lanes=4194304);s.isBackwards?(y.sibling=i.child,i.child=y):(r=s.last,r!==null?r.sibling=y:i.child=y,s.last=y)}return s.tail!==null?(r=s.tail,s.rendering=r,s.tail=r.sibling,s.renderingStartTime=vn(),r.sibling=null,u=dt.current,ie(dt,m?u&1|2:u&1),Me&&Or(i,s.treeForkCount),r):(Je(i),null);case 22:case 23:return Sn(i),gh(),s=i.memoizedState!==null,r!==null?r.memoizedState!==null!==s&&(i.flags|=8192):s&&(i.flags|=8192),s?(u&536870912)!==0&&(i.flags&128)===0&&(Je(i),i.subtreeFlags&6&&(i.flags|=8192)):Je(i),u=i.updateQueue,u!==null&&Ds(i,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==u&&(i.flags|=2048),r!==null&&F(Ja),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Ar(vt),Je(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function AC(r,i){switch(rh(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Ar(vt),W(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return _e(i),null;case 31:if(i.memoizedState!==null){if(Sn(i),i.alternate===null)throw Error(a(340));Za()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Sn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Za()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return F(dt),null;case 4:return W(),null;case 10:return Ar(i.type),null;case 22:case 23:return Sn(i),gh(),r!==null&&F(Ja),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Ar(vt),null;case 25:return null;default:return null}}function r1(r,i){switch(rh(i),i.tag){case 3:Ar(vt),W();break;case 26:case 27:case 5:_e(i);break;case 4:W();break;case 31:i.memoizedState!==null&&Sn(i);break;case 13:Sn(i);break;case 19:F(dt);break;case 10:Ar(i.type);break;case 22:case 23:Sn(i),gh(),r!==null&&F(Ja);break;case 24:Ar(vt)}}function xu(r,i){try{var u=i.updateQueue,s=u!==null?u.lastEffect:null;if(s!==null){var m=s.next;u=m;do{if((u.tag&r)===r){s=void 0;var y=u.create,w=u.inst;s=y(),w.destroy=s}u=u.next}while(u!==m)}}catch(A){qe(i,i.return,A)}}function pa(r,i,u){try{var s=i.updateQueue,m=s!==null?s.lastEffect:null;if(m!==null){var y=m.next;s=y;do{if((s.tag&r)===r){var w=s.inst,A=w.destroy;if(A!==void 0){w.destroy=void 0,m=i;var D=u,H=A;try{H()}catch(Q){qe(m,D,Q)}}}s=s.next}while(s!==y)}}catch(Q){qe(i,i.return,Q)}}function a1(r){var i=r.updateQueue;if(i!==null){var u=r.stateNode;try{Xb(i,u)}catch(s){qe(r,r.return,s)}}}function i1(r,i,u){u.props=ai(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(s){qe(r,i,s)}}function Su(r,i){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var s=r.stateNode;break;case 30:s=r.stateNode;break;default:s=r.stateNode}typeof u=="function"?r.refCleanup=u(s):u.current=s}}catch(m){qe(r,i,m)}}function or(r,i){var u=r.ref,s=r.refCleanup;if(u!==null)if(typeof s=="function")try{s()}catch(m){qe(r,i,m)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(m){qe(r,i,m)}else u.current=null}function l1(r){var i=r.type,u=r.memoizedProps,s=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&s.focus();break e;case"img":u.src?s.src=u.src:u.srcSet&&(s.srcset=u.srcSet)}}catch(m){qe(r,r.return,m)}}function Zh(r,i,u){try{var s=r.stateNode;XC(s,r.type,u,i),s[rn]=i}catch(m){qe(r,r.return,m)}}function u1(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ja(r.type)||r.tag===4}function Qh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||u1(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&ja(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Wh(r,i,u){var s=r.tag;if(s===5||s===6)r=r.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(r),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Sr));else if(s!==4&&(s===27&&ja(r.type)&&(u=r.stateNode,i=null),r=r.child,r!==null))for(Wh(r,i,u),r=r.sibling;r!==null;)Wh(r,i,u),r=r.sibling}function ks(r,i,u){var s=r.tag;if(s===5||s===6)r=r.stateNode,i?u.insertBefore(r,i):u.appendChild(r);else if(s!==4&&(s===27&&ja(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(ks(r,i,u),r=r.sibling;r!==null;)ks(r,i,u),r=r.sibling}function o1(r){var i=r.stateNode,u=r.memoizedProps;try{for(var s=r.type,m=i.attributes;m.length;)i.removeAttributeNode(m[0]);Kt(i,s,u),i[qt]=r,i[rn]=u}catch(y){qe(r,r.return,y)}}var Cr=!1,gt=!1,Jh=!1,s1=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function EC(r,i){if(r=r.containerInfo,xm=ec,r=Sb(r),Gd(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var s=u.getSelection&&u.getSelection();if(s&&s.rangeCount!==0){u=s.anchorNode;var m=s.anchorOffset,y=s.focusNode;s=s.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var w=0,A=-1,D=-1,H=0,Q=0,te=r,Y=null;t:for(;;){for(var X;te!==u||m!==0&&te.nodeType!==3||(A=w+m),te!==y||s!==0&&te.nodeType!==3||(D=w+s),te.nodeType===3&&(w+=te.nodeValue.length),(X=te.firstChild)!==null;)Y=te,te=X;for(;;){if(te===r)break t;if(Y===u&&++H===m&&(A=w),Y===y&&++Q===s&&(D=w),(X=te.nextSibling)!==null)break;te=Y,Y=te.parentNode}te=X}u=A===-1||D===-1?null:{start:A,end:D}}else u=null}u=u||{start:0,end:0}}else u=null;for(Sm={focusedElem:r,selectionRange:u},ec=!1,Ct=i;Ct!==null;)if(i=Ct,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Ct=r;else for(;Ct!==null;){switch(i=Ct,y=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(u=0;u title"))),Kt(y,s,u),y[qt]=r,Mt(y),s=y;break e;case"link":var w=vS("link","href",m).get(s+(u.href||""));if(w){for(var A=0;AKe&&(w=Ke,Ke=ge,ge=w);var $=bb(A,ge),R=bb(A,Ke);if($&&R&&(X.rangeCount!==1||X.anchorNode!==$.node||X.anchorOffset!==$.offset||X.focusNode!==R.node||X.focusOffset!==R.offset)){var I=te.createRange();I.setStart($.node,$.offset),X.removeAllRanges(),ge>Ke?(X.addRange(I),X.extend(R.node,R.offset)):(I.setEnd(R.node,R.offset),X.addRange(I))}}}}for(te=[],X=A;X=X.parentNode;)X.nodeType===1&&te.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;Au?32:u,K.T=null,u=lm,lm=null;var y=xa,w=Rr;if(jt=0,il=xa=null,Rr=0,(ze&6)!==0)throw Error(a(331));var A=ze;if(ze|=4,x1(y.current),y1(y,y.current,w,u),ze=A,Eu(0,!1),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(Yl,y)}catch{}return!0}finally{ee.p=m,K.T=s,$1(r,i)}}function q1(r,i,u){i=Pn(u,i),i=Uh(r.stateNode,i,2),r=ha(r,i,2),r!==null&&(Vl(r,2),sr(r))}function qe(r,i,u){if(r.tag===3)q1(r,r,u);else for(;i!==null;){if(i.tag===3){q1(i,r,u);break}else if(i.tag===1){var s=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ba===null||!ba.has(s))){r=Pn(u,r),u=Bx(2),s=ha(i,u,2),s!==null&&(Ix(u,s,i,r),Vl(s,2),sr(s));break}}i=i.return}}function cm(r,i,u){var s=r.pingCache;if(s===null){s=r.pingCache=new MC;var m=new Set;s.set(i,m)}else m=s.get(i),m===void 0&&(m=new Set,s.set(i,m));m.has(u)||(nm=!0,m.add(u),r=zC.bind(null,r,i,u),i.then(r,r))}function zC(r,i,u){var s=r.pingCache;s!==null&&s.delete(i),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,Ve===r&&(Ne&u)===u&&(st===4||st===3&&(Ne&62914560)===Ne&&300>vn()-Rs?(ze&2)===0&&ll(r,0):rm|=u,al===Ne&&(al=0)),sr(r)}function B1(r,i){i===0&&(i=zg()),r=Xa(r,i),r!==null&&(Vl(r,i),sr(r))}function RC(r){var i=r.memoizedState,u=0;i!==null&&(u=i.retryLane),B1(r,u)}function LC(r,i){var u=0;switch(r.tag){case 31:case 13:var s=r.stateNode,m=r.memoizedState;m!==null&&(u=m.retryLane);break;case 19:s=r.stateNode;break;case 22:s=r.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(i),B1(r,u)}function $C(r,i){return jd(r,i)}var Hs=null,ol=null,fm=!1,Ks=!1,dm=!1,wa=0;function sr(r){r!==ol&&r.next===null&&(ol===null?Hs=ol=r:ol=ol.next=r),Ks=!0,fm||(fm=!0,qC())}function Eu(r,i){if(!dm&&Ks){dm=!0;do for(var u=!1,s=Hs;s!==null;){if(r!==0){var m=s.pendingLanes;if(m===0)var y=0;else{var w=s.suspendedLanes,A=s.pingedLanes;y=(1<<31-yn(42|r)+1)-1,y&=m&~(w&~A),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(u=!0,Y1(s,y))}else y=Ne,y=Xo(s,s===Ve?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(y&3)===0||Gl(s,y)||(u=!0,Y1(s,y));s=s.next}while(u);dm=!1}}function UC(){I1()}function I1(){Ks=fm=!1;var r=0;wa!==0&&ZC()&&(r=wa);for(var i=vn(),u=null,s=Hs;s!==null;){var m=s.next,y=H1(s,i);y===0?(s.next=null,u===null?Hs=m:u.next=m,m===null&&(ol=u)):(u=s,(r!==0||(y&3)!==0)&&(Ks=!0)),s=m}jt!==0&&jt!==5||Eu(r),wa!==0&&(wa=0)}function H1(r,i){for(var u=r.suspendedLanes,s=r.pingedLanes,m=r.expirationTimes,y=r.pendingLanes&-62914561;0A)break;var Q=D.transferSize,te=D.initiatorType;Q&&J1(te)&&(D=D.responseEnd,w+=Q*(D"u"?null:document;function fS(r,i,u){var s=sl;if(s&&typeof i=="string"&&i){var m=Dn(i);m='link[rel="'+r+'"][href="'+m+'"]',typeof u=="string"&&(m+='[crossorigin="'+u+'"]'),cS.has(m)||(cS.add(m),r={rel:r,crossOrigin:u,href:i},s.querySelector(m)===null&&(i=s.createElement("link"),Kt(i,"link",r),Mt(i),s.head.appendChild(i)))}}function i4(r){Lr.D(r),fS("dns-prefetch",r,null)}function l4(r,i){Lr.C(r,i),fS("preconnect",r,i)}function u4(r,i,u){Lr.L(r,i,u);var s=sl;if(s&&r&&i){var m='link[rel="preload"][as="'+Dn(i)+'"]';i==="image"&&u&&u.imageSrcSet?(m+='[imagesrcset="'+Dn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(m+='[imagesizes="'+Dn(u.imageSizes)+'"]')):m+='[href="'+Dn(r)+'"]';var y=m;switch(i){case"style":y=cl(r);break;case"script":y=fl(r)}qn.has(y)||(r=p({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:r,as:i},u),qn.set(y,r),s.querySelector(m)!==null||i==="style"&&s.querySelector(Cu(y))||i==="script"&&s.querySelector(Du(y))||(i=s.createElement("link"),Kt(i,"link",r),Mt(i),s.head.appendChild(i)))}}function o4(r,i){Lr.m(r,i);var u=sl;if(u&&r){var s=i&&typeof i.as=="string"?i.as:"script",m='link[rel="modulepreload"][as="'+Dn(s)+'"][href="'+Dn(r)+'"]',y=m;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=fl(r)}if(!qn.has(y)&&(r=p({rel:"modulepreload",href:r},i),qn.set(y,r),u.querySelector(m)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Du(y)))return}s=u.createElement("link"),Kt(s,"link",r),Mt(s),u.head.appendChild(s)}}}function s4(r,i,u){Lr.S(r,i,u);var s=sl;if(s&&r){var m=Di(s).hoistableStyles,y=cl(r);i=i||"default";var w=m.get(y);if(!w){var A={loading:0,preload:null};if(w=s.querySelector(Cu(y)))A.loading=5;else{r=p({rel:"stylesheet",href:r,"data-precedence":i},u),(u=qn.get(y))&&Nm(r,u);var D=w=s.createElement("link");Mt(D),Kt(D,"link",r),D._p=new Promise(function(H,Q){D.onload=H,D.onerror=Q}),D.addEventListener("load",function(){A.loading|=1}),D.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Fs(w,i,s)}w={type:"stylesheet",instance:w,count:1,state:A},m.set(y,w)}}}function c4(r,i){Lr.X(r,i);var u=sl;if(u&&r){var s=Di(u).hoistableScripts,m=fl(r),y=s.get(m);y||(y=u.querySelector(Du(m)),y||(r=p({src:r,async:!0},i),(i=qn.get(m))&&Tm(r,i),y=u.createElement("script"),Mt(y),Kt(y,"link",r),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(m,y))}}function f4(r,i){Lr.M(r,i);var u=sl;if(u&&r){var s=Di(u).hoistableScripts,m=fl(r),y=s.get(m);y||(y=u.querySelector(Du(m)),y||(r=p({src:r,async:!0,type:"module"},i),(i=qn.get(m))&&Tm(r,i),y=u.createElement("script"),Mt(y),Kt(y,"link",r),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(m,y))}}function dS(r,i,u,s){var m=(m=be.current)?Xs(m):null;if(!m)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=cl(u.href),u=Di(m).hoistableStyles,s=u.get(i),s||(s={type:"style",instance:null,count:0,state:null},u.set(i,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=cl(u.href);var y=Di(m).hoistableStyles,w=y.get(r);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,w),(y=m.querySelector(Cu(r)))&&!y._p&&(w.instance=y,w.state.loading=5),qn.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},qn.set(r,u),y||d4(m,r,u,w.state))),i&&s===null)throw Error(a(528,""));return w}if(i&&s!==null)throw Error(a(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=fl(u),u=Di(m).hoistableScripts,s=u.get(i),s||(s={type:"script",instance:null,count:0,state:null},u.set(i,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function cl(r){return'href="'+Dn(r)+'"'}function Cu(r){return'link[rel="stylesheet"]['+r+"]"}function hS(r){return p({},r,{"data-precedence":r.precedence,precedence:null})}function d4(r,i,u,s){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?s.loading=1:(i=r.createElement("link"),s.preload=i,i.addEventListener("load",function(){return s.loading|=1}),i.addEventListener("error",function(){return s.loading|=2}),Kt(i,"link",u),Mt(i),r.head.appendChild(i))}function fl(r){return'[src="'+Dn(r)+'"]'}function Du(r){return"script[async]"+r}function mS(r,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var s=r.querySelector('style[data-href~="'+Dn(u.href)+'"]');if(s)return i.instance=s,Mt(s),s;var m=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return s=(r.ownerDocument||r).createElement("style"),Mt(s),Kt(s,"style",m),Fs(s,u.precedence,r),i.instance=s;case"stylesheet":m=cl(u.href);var y=r.querySelector(Cu(m));if(y)return i.state.loading|=4,i.instance=y,Mt(y),y;s=hS(u),(m=qn.get(m))&&Nm(s,m),y=(r.ownerDocument||r).createElement("link"),Mt(y);var w=y;return w._p=new Promise(function(A,D){w.onload=A,w.onerror=D}),Kt(y,"link",s),i.state.loading|=4,Fs(y,u.precedence,r),i.instance=y;case"script":return y=fl(u.src),(m=r.querySelector(Du(y)))?(i.instance=m,Mt(m),m):(s=u,(m=qn.get(y))&&(s=p({},u),Tm(s,m)),r=r.ownerDocument||r,m=r.createElement("script"),Mt(m),Kt(m,"link",s),r.head.appendChild(m),i.instance=m);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(s=i.instance,i.state.loading|=4,Fs(s,u.precedence,r));return i.instance}function Fs(r,i,u){for(var s=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=s.length?s[s.length-1]:null,y=m,w=0;w title"):null)}function h4(r,i,u){if(u===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function yS(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function m4(r,i,u,s){if(u.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var m=cl(s.href),y=i.querySelector(Cu(m));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Qs.bind(r),i.then(r,r)),u.state.loading|=4,u.instance=y,Mt(y);return}y=i.ownerDocument||i,s=hS(s),(m=qn.get(m))&&Nm(s,m),y=y.createElement("link"),Mt(y);var w=y;w._p=new Promise(function(A,D){w.onload=A,w.onerror=D}),Kt(y,"link",s),u.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=Qs.bind(r),i.addEventListener("load",u),i.addEventListener("error",u))}}var Mm=0;function v4(r,i){return r.stylesheets&&r.count===0&&Js(r,r.stylesheets),0Mm?50:800)+i);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(s),clearTimeout(m)}}:null}function Qs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Js(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Ws=null;function Js(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Ws=new Map,i.forEach(p4,r),Ws=null,Qs.call(r))}function p4(r,i){if(!(i.state.loading&4)){var u=Ws.get(r);if(u)var s=u.get(null);else{u=new Map,Ws.set(r,u);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Um.exports=P4(),Um.exports}var R4=z4();const L4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$4=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase()),BS=e=>{const t=$4(e);return t.charAt(0).toUpperCase()+t.slice(1)},V_=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim(),U4=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var q4={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const B4=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:c,...f},d)=>S.createElement("svg",{ref:d,...q4,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:V_("lucide",l),...!o&&!U4(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,v])=>S.createElement(h,v)),...Array.isArray(o)?o:[o]]));const je=(e,t)=>{const n=S.forwardRef(({className:a,...l},o)=>S.createElement(B4,{ref:o,iconNode:t,className:V_(`lucide-${L4(BS(e))}`,`lucide-${e}`,a),...l}));return n.displayName=BS(e),n};const I4=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],X_=je("activity",I4);const H4=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],Hm=je("arrow-down-to-line",H4);const K4=[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]],Km=je("arrow-up-from-line",K4);const Y4=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],G4=je("bell",Y4);const V4=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],IS=je("calendar",V4);const X4=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],F4=je("check",X4);const Z4=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],kc=je("chevron-down",Z4);const Q4=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],W4=je("chevron-left",Q4);const J4=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],eD=je("chevron-right",J4);const tD=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ep=je("chevron-up",tD);const nD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Tf=je("circle-alert",nD);const rD=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],wl=je("circle-check-big",rD);const aD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],iD=je("circle-check",aD);const lD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],uD=je("circle-dollar-sign",lD);const oD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pa=je("circle-x",oD);const sD=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],T0=je("clock",sD);const cD=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],fD=je("coins",cD);const dD=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],hD=je("cpu",dD);const mD=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],M0=je("gauge",mD);const vD=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],F_=je("key-round",vD);const pD=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],yD=je("layers",pD);const gD=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],bD=je("layout-dashboard",gD);const xD=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],C0=je("lock-keyhole",xD);const SD=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],wD=je("log-out",SD);const jD=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],OD=je("plus",jD);const _D=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],AD=je("power",_D);const ED=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],ND=je("receipt-text",ED);const TD=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Pl=je("refresh-cw",TD);const MD=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],D0=je("rotate-ccw",MD);const CD=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],DD=je("save",CD);const kD=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],PD=je("server-cog",kD);const zD=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],RD=je("server",zD);const LD=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],$D=je("settings",LD);const UD=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Z_=je("settings-2",UD);const qD=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Q_=je("shield-check",qD);const BD=[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]],ID=je("thermometer",BD);const HD=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],KD=je("trash-2",HD);const YD=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Np=je("triangle-alert",YD);const GD=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],HS=je("wifi-off",GD);const VD=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],XD=je("wifi",VD);const FD=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],W_=je("x",FD);const ZD=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],QD=je("zap",ZD);function Da(e,t=5e3){const[n,a]=S.useState(null),[l,o]=S.useState(null),[c,f]=S.useState(!0),[d,h]=S.useState(!1),[v,p]=S.useState(null),b=S.useCallback(async()=>{h(!0);try{const x=await e();a(x),o(null),p(new Date)}catch(x){o(x instanceof Error?x:new Error(String(x)))}finally{f(!1),h(!1)}},[e]);return S.useEffect(()=>{if(b(),t<=0)return;const x=setInterval(b,t);return()=>clearInterval(x)},[b,t]),{data:n,error:l,loading:c,refreshing:d,lastUpdated:v,refetch:b}}const k0="/api/v1/computing/inference",_c="computing-provider-control-token";let fi=sessionStorage.getItem(_c)??"";function hl(e){return encodeURIComponent(e)}class P0 extends Error{status;constructor(t,n){super(n),this.name="ApiError",this.status=t}}function z0(){return fi?{Authorization:`Bearer ${fi}`}:{}}async function cr(e){const t=await fetch(`${k0}${e}`,{headers:z0()});if(!t.ok){const n=await t.json().catch(()=>null);throw new P0(t.status,n?.error??`API error: ${t.status} ${t.statusText}`)}return t.json()}async function Ta(e,t){const n=await fetch(`${k0}${e}`,{method:"POST",headers:{"Content-Type":"application/json",...z0()},body:t?JSON.stringify(t):void 0});if(!n.ok){const a=await n.json().catch(()=>null);throw new P0(n.status,a?.error??`API error: ${n.status} ${n.statusText}`)}return n.json()}async function Uu(e,t){const n=await fetch(`${k0}${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...z0()},body:JSON.stringify(t)});if(!n.ok){const a=await n.json().catch(()=>null);throw new P0(n.status,a?.error??`API error: ${n.status} ${n.statusText}`)}return n.json()}const Ze={setAccessToken:e=>{fi=e.trim(),fi?sessionStorage.setItem(_c,fi):sessionStorage.removeItem(_c)},hasAccessToken:()=>!!fi,clearAccessToken:()=>{fi="",sessionStorage.removeItem(_c)},getMetrics:()=>cr("/metrics"),getStatus:()=>cr("/status"),getModels:()=>cr("/models"),enableModel:e=>Ta(`/models/${hl(e)}/enable`),disableModel:e=>Ta(`/models/${hl(e)}/disable`),reloadModels:()=>Ta("/models/reload"),forceHealthCheck:e=>Ta(`/models/${hl(e)}/healthcheck`),getRequestManagement:()=>cr("/request-management"),setGlobalRateLimit:e=>Ta("/ratelimit/global",{rate:e}),setModelRateLimit:(e,t)=>Ta(`/ratelimit/model/${hl(e)}`,{rate:t}),setGlobalConcurrency:e=>Ta("/concurrency/global",{max:e}),setModelConcurrency:(e,t)=>Ta(`/concurrency/model/${hl(e)}`,{max:t}),getRequestHistory:(e={})=>{const t=new URLSearchParams;e.limit&&t.set("limit",e.limit.toString()),e.offset&&t.set("offset",e.offset.toString()),e.model&&t.set("model",e.model),e.source&&t.set("source",e.source);const n=t.toString();return cr(`/requests${n?`?${n}`:""}`)},getEarnings:()=>cr("/earnings"),getEarningsHistory:e=>cr(`/earnings/history?duration=${e}`),getMetricsHistory:(e,t)=>{const n=new URLSearchParams;e&&n.set("duration",e),t&&n.set("resolution",t);const a=n.toString();return cr(`/metrics/history${a?`?${a}`:""}`)},getModelMetrics:e=>cr(`/models/${hl(e)}/metrics`),getSettings:()=>cr("/settings"),updateAlerts:e=>Uu("/settings/alerts",e),updateSelfCheck:e=>Uu("/settings/self-check",e),updateLogging:e=>Uu("/settings/logging",e),updateLimits:e=>Uu("/settings/limits",e),updateModels:e=>Uu("/settings/models",{models:e})},J_=["#3987e5","#c98500","#d55181","#008300"],R0="#94a3b8",eA="Other",Tp="#5b6b82",tA="Unattributed",WD=J_.length;function nA(e){const t=[...e??[]].sort((o,c)=>c.total_usd!==o.total_usd?c.total_usd-o.total_usd:o.model.localeCompare(c.model)),n=new Map,a=[],l=new Set;return t.forEach((o,c)=>{c=86400?a.toLocaleDateString(void 0,{year:n?"numeric":void 0,month:"short",day:"numeric"}):n?a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function oc(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function ui(e){return e===0?"$0":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function YS(e,t){const n=[];let a=0,l=0,o=0;for(const[f,d]of Object.entries(e.models??{}))t.colours.has(f)?n.push({key:f,label:f,colour:Pc(t,f),usd:d.usd,tokensIn:d.tokens_in,tokensOut:d.tokens_out}):(a+=d.usd,l+=d.tokens_in,o+=d.tokens_out);n.sort((f,d)=>d.usd-f.usd),(a>0||l>0||o>0)&&n.push({key:"__other",label:eA,colour:R0,usd:a,tokensIn:l,tokensOut:o});const c=e.unattributed??0;return c>1e-6&&n.push({key:"__unattributed",label:tA,colour:Tp,usd:c,tokensIn:0,tokensOut:0}),n}function JD({models:e}){const[t,n]=S.useState("24h"),[a,l]=S.useState(null),{data:o,loading:c,error:f}=Da(S.useCallback(()=>Ze.getEarningsHistory(t),[t]),6e4),d=S.useMemo(()=>nA(e),[e]),h=S.useMemo(()=>o?.points??[],[o?.points]),v=o?.bucket_seconds,p=o?.authoritative_points??0,b=h.length>0&&p===h.length,x=h.reduce((T,C)=>Math.max(T,C.usd),0),O=a,j=O!==null?h[O]:null,_=S.useMemo(()=>{const T={};let C=0,L=0,Z=0,ne=0;for(const q of h){C+=q.usd,L+=q.tokens_in,Z+=q.tokens_out,ne+=q.unattributed??0;for(const[U,B]of Object.entries(q.models??{})){const ue=T[U]??={tokens_in:0,tokens_out:0,usd:0};ue.tokens_in+=B.tokens_in,ue.tokens_out+=B.tokens_out,ue.usd+=B.usd}}return{timestamp:"",usd:C,tokens_in:L,tokens_out:Z,models:T,unattributed:ne}},[h]),E=j??(h.length>0?_:null),N=j?uc(j.timestamp,v,!0):KS.find(T=>T.id===t)?.label??t,M=E?YS(E,d):[],P=S.useMemo(()=>{const T=new Set;let C=!1,L=!1;for(const ne of h){for(const q of Object.keys(ne.models??{}))d.colours.has(q)?T.add(q):C=!0;(ne.unattributed??0)>1e-6&&(L=!0)}const Z=d.ordered.filter(ne=>T.has(ne)).map(ne=>({key:ne,label:ne,colour:Pc(d,ne)}));return C&&Z.push({key:"__other",label:eA,colour:R0}),L&&Z.push({key:"__unattributed",label:tA,colour:Tp}),Z},[h,d]);return g.jsxs("div",{className:"min-w-0 overflow-hidden rounded-xl border border-slate-800 bg-slate-900/60",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-slate-800 px-4 py-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Earnings over time"}),g.jsx("p",{className:"text-xs text-slate-400",children:c&&!o?"Loading…":f&&o?`${ui(o.total_usd)} · showing stale data`:`${ui(o?.total_usd??0)} in this window`})]}),g.jsx("div",{className:"flex gap-1",role:"group","aria-label":"Time window",children:KS.map(T=>g.jsx("button",{type:"button",onClick:()=>n(T.id),"aria-pressed":t===T.id,className:`rounded-lg px-3 py-1.5 text-xs font-medium transition focus:outline-none focus:ring-2 focus:ring-blue-500 ${t===T.id?"bg-slate-700 text-white":"text-slate-400 hover:bg-slate-800 hover:text-slate-200"}`,children:T.label},T.id))})]}),f&&!o?g.jsxs("p",{className:"px-4 py-6 text-sm text-amber-300",children:["Could not load earnings history: ",f.message]}):h.length===0?g.jsx("p",{className:"px-4 py-6 text-sm text-slate-400",children:"No history for this window yet."}):g.jsxs("div",{className:"px-4 py-4",children:[g.jsx("div",{className:"mb-2 h-36","aria-live":"polite",children:E?g.jsxs("div",{className:"text-xs",children:[g.jsxs("div",{className:"flex items-baseline gap-2",children:[g.jsx("span",{className:"font-mono text-sm text-white",children:ui(E.usd)}),g.jsx("span",{className:"text-slate-400",children:N}),!j&&h.length>0&&g.jsx("span",{className:"text-slate-500",children:"· hover a bar for one interval"})]}),M.length>0?g.jsx("ul",{className:"mt-1 space-y-0.5 text-[11px]",children:M.map(T=>g.jsxs("li",{className:"flex items-center gap-2",children:[g.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 shrink-0 rounded-sm",style:{backgroundColor:T.colour}}),g.jsx("span",{className:"min-w-0 flex-1 truncate text-slate-300",children:T.label}),g.jsx("span",{className:"font-mono text-slate-400",children:ui(T.usd)}),T.key!=="__unattributed"&&g.jsxs("span",{className:"w-36 shrink-0 whitespace-nowrap text-right font-mono text-slate-400",children:[oc(T.tokensIn)," in / ",oc(T.tokensOut)," out"]})]},T.key))}):g.jsxs("div",{className:"mt-1 text-slate-400",children:[oc(E.tokens_in)," in / ",oc(E.tokens_out)," out",g.jsx("span",{className:"ml-2 text-slate-400",children:"— recorded before the per-model split"})]})]}):g.jsx("div",{className:"text-xs text-slate-400",children:"No earnings recorded in this window."})}),g.jsx("div",{className:"flex h-32 items-end gap-px",onMouseLeave:()=>l(null),role:"group","aria-label":`Earnings per interval over ${t}, split by model, totalling ${ui(o?.total_usd??0)}`,children:h.map((T,C)=>{const L=x>0?Math.max(2,T.usd/x*100):2,Z=O===C,ne=YS(T,d),q=ne.length?ne.map(U=>`${U.label} ${ui(U.usd)}`).join(", "):`${T.tokens_in.toLocaleString()} in, ${T.tokens_out.toLocaleString()} out`;return g.jsx("button",{type:"button",onMouseEnter:()=>l(C),onFocus:()=>l(C),onBlur:()=>l(null),"aria-label":`${uc(T.timestamp,v,!0)}: ${ui(T.usd)} — ${q}`,className:`flex h-full flex-1 flex-col justify-end rounded-t focus:outline-none focus:ring-1 focus:ring-blue-400 ${Z?"ring-1 ring-white/40":""}`,style:{height:`${L}%`},children:ne.length===0?g.jsx("span",{className:"block h-full w-full rounded-t",style:{backgroundColor:Tp}}):ne.map((U,B)=>{const ue=T.usd>0?U.usd/T.usd*100:0;return g.jsx("span",{className:B===0?"block w-full rounded-t":"block w-full",style:{height:`${ue}%`,backgroundColor:U.colour,marginTop:B===0?0:2,opacity:Z?1:.85}},U.key)})},T.timestamp)})}),g.jsxs("div",{className:"mt-2 flex justify-between text-xs text-slate-400",children:[g.jsx("span",{children:h[0]&&uc(h[0].timestamp,v,!0)}),g.jsx("span",{children:h[h.length-1]&&uc(h[h.length-1].timestamp,v,!0)})]}),P.length>0&&g.jsx("ul",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs","aria-label":"Models in this chart",children:P.map(T=>g.jsxs("li",{className:"flex min-w-0 items-center gap-1.5",children:[g.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 shrink-0 rounded-sm",style:{backgroundColor:T.colour}}),g.jsx("span",{className:"break-all text-slate-400",children:T.label})]},T.key))})]}),g.jsxs("p",{className:"flex items-start gap-2 border-t border-slate-800 px-4 py-3 text-xs text-slate-400",children:[g.jsx(Tf,{"aria-hidden":"true",size:14,className:"mt-px shrink-0"}),g.jsxs("span",{children:[b?"From Swan Inference’s own earnings figure, sampled and differenced per interval.":p>0?`${p} of ${h.length} intervals come from Swan Inference’s own figure; the rest are this node’s estimate, priced from stored history at current rates.`:"This node’s own estimate, priced from its stored history at current rates — not the platform’s ledger.",p>0&&" The split by model is still this node’s share of served tokens: the platform reports no per-model breakdown.",(o?.restarts??0)>0&&p{var{children:n,width:a,height:l,viewBox:o,className:c,style:f,title:d,desc:h}=e,v=ik(e,ak),p=o||{width:a,height:l,x:0,y:0},b=Re("recharts-surface",c);return S.createElement("svg",Mp({},tn(v),{className:b,width:a,height:l,style:f,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),S.createElement("title",null,d),S.createElement("desc",null,h),n)}),uk=["children","className"];function Cp(){return Cp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,className:a}=e,l=ok(e,uk),o=Re("recharts-layer",a);return S.createElement("g",Cp({className:o},tn(l),{ref:t}),n)}),U0=G_(),lA=S.createContext(null),ck=()=>S.useContext(lA);function Fe(e){return function(){return e}}const uA=Math.cos,zc=Math.sin,ar=Math.sqrt,Rc=Math.PI,Mf=2*Rc,Dp=Math.PI,kp=2*Dp,oi=1e-6,fk=kp-oi;function oA(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return oA;const n=10**t;return function(a){this._+=a[0];for(let l=1,o=a.length;loi)if(!(Math.abs(p*d-h*v)>oi)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let x=a-c,O=l-f,j=d*d+h*h,_=x*x+O*O,E=Math.sqrt(j),N=Math.sqrt(b),M=o*Math.tan((Dp-Math.acos((j+b-_)/(2*E*N)))/2),P=M/N,T=M/E;Math.abs(P-1)>oi&&this._append`L${t+P*v},${n+P*p}`,this._append`A${o},${o},0,0,${+(p*x>v*O)},${this._x1=t+T*d},${this._y1=n+T*h}`}}arc(t,n,a,l,o,c){if(t=+t,n=+n,a=+a,c=!!c,a<0)throw new Error(`negative radius: ${a}`);let f=a*Math.cos(l),d=a*Math.sin(l),h=t+f,v=n+d,p=1^c,b=c?l-o:o-l;this._x1===null?this._append`M${h},${v}`:(Math.abs(this._x1-h)>oi||Math.abs(this._y1-v)>oi)&&this._append`L${h},${v}`,a&&(b<0&&(b=b%kp+kp),b>fk?this._append`A${a},${a},0,1,${p},${t-f},${n-d}A${a},${a},0,1,${p},${this._x1=h},${this._y1=v}`:b>oi&&this._append`A${a},${a},0,${+(b>=Dp)},${p},${this._x1=t+a*Math.cos(o)},${this._y1=n+a*Math.sin(o)}`)}rect(t,n,a,l){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${a=+a}v${+l}h${-a}Z`}toString(){return this._}}function q0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const a=Math.floor(n);if(!(a>=0))throw new RangeError(`invalid digits: ${n}`);t=a}return e},()=>new hk(t)}function B0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sA(e){this._context=e}sA.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 Cf(e){return new sA(e)}function cA(e){return e[0]}function fA(e){return e[1]}function dA(e,t){var n=Fe(!0),a=null,l=Cf,o=null,c=q0(f);e=typeof e=="function"?e:e===void 0?cA:Fe(e),t=typeof t=="function"?t:t===void 0?fA:Fe(t);function f(d){var h,v=(d=B0(d)).length,p,b=!1,x;for(a==null&&(o=l(x=c())),h=0;h<=v;++h)!(h=x;--O)f.point(M[O],P[O]);f.lineEnd(),f.areaEnd()}E&&(M[b]=+e(_,b,p),P[b]=+t(_,b,p),f.point(a?+a(_,b,p):M[b],n?+n(_,b,p):P[b]))}if(N)return f=null,N+""||null}function v(){return dA().defined(l).curve(c).context(o)}return h.x=function(p){return arguments.length?(e=typeof p=="function"?p:Fe(+p),a=null,h):e},h.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Fe(+p),h):e},h.x1=function(p){return arguments.length?(a=p==null?null:typeof p=="function"?p:Fe(+p),h):a},h.y=function(p){return arguments.length?(t=typeof p=="function"?p:Fe(+p),n=null,h):t},h.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Fe(+p),h):t},h.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Fe(+p),h):n},h.lineX0=h.lineY0=function(){return v().x(e).y(t)},h.lineY1=function(){return v().x(e).y(n)},h.lineX1=function(){return v().x(a).y(t)},h.defined=function(p){return arguments.length?(l=typeof p=="function"?p:Fe(!!p),h):l},h.curve=function(p){return arguments.length?(c=p,o!=null&&(f=c(o)),h):c},h.context=function(p){return arguments.length?(p==null?o=f=null:f=c(o=p),h):o},h}class hA{constructor(t,n){this._context=t,this._x=n}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,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function mk(e){return new hA(e,!0)}function vk(e){return new hA(e,!1)}const I0={draw(e,t){const n=ar(t/Rc);e.moveTo(n,0),e.arc(0,0,n,0,Mf)}},pk={draw(e,t){const n=ar(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},mA=ar(1/3),yk=mA*2,gk={draw(e,t){const n=ar(t/yk),a=n*mA;e.moveTo(0,-n),e.lineTo(a,0),e.lineTo(0,n),e.lineTo(-a,0),e.closePath()}},bk={draw(e,t){const n=ar(t),a=-n/2;e.rect(a,a,n,n)}},xk=.8908130915292852,vA=zc(Rc/10)/zc(7*Rc/10),Sk=zc(Mf/10)*vA,wk=-uA(Mf/10)*vA,jk={draw(e,t){const n=ar(t*xk),a=Sk*n,l=wk*n;e.moveTo(0,-n),e.lineTo(a,l);for(let o=1;o<5;++o){const c=Mf*o/5,f=uA(c),d=zc(c);e.lineTo(d*n,-f*n),e.lineTo(f*a-d*l,d*a+f*l)}e.closePath()}},Ym=ar(3),Ok={draw(e,t){const n=-ar(t/(Ym*3));e.moveTo(0,n*2),e.lineTo(-Ym*n,-n),e.lineTo(Ym*n,-n),e.closePath()}},Bn=-.5,In=ar(3)/2,Pp=1/ar(12),_k=(Pp/2+1)*3,Ak={draw(e,t){const n=ar(t/_k),a=n/2,l=n*Pp,o=a,c=n*Pp+n,f=-o,d=c;e.moveTo(a,l),e.lineTo(o,c),e.lineTo(f,d),e.lineTo(Bn*a-In*l,In*a+Bn*l),e.lineTo(Bn*o-In*c,In*o+Bn*c),e.lineTo(Bn*f-In*d,In*f+Bn*d),e.lineTo(Bn*a+In*l,Bn*l-In*a),e.lineTo(Bn*o+In*c,Bn*c-In*o),e.lineTo(Bn*f+In*d,Bn*d-In*f),e.closePath()}};function Ek(e,t){let n=null,a=q0(l);e=typeof e=="function"?e:Fe(e||I0),t=typeof t=="function"?t:Fe(t===void 0?64:+t);function l(){let o;if(n||(n=o=a()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return l.type=function(o){return arguments.length?(e=typeof o=="function"?o:Fe(o),l):e},l.size=function(o){return arguments.length?(t=typeof o=="function"?o:Fe(+o),l):t},l.context=function(o){return arguments.length?(n=o??null,l):n},l}function Lc(){}function $c(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function pA(e){this._context=e}pA.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:$c(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:$c(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nk(e){return new pA(e)}function yA(e){this._context=e}yA.prototype={areaStart:Lc,areaEnd:Lc,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:$c(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Tk(e){return new yA(e)}function gA(e){this._context=e}gA.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 n=(this._x0+4*this._x1+e)/6,a=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,a):this._context.moveTo(n,a);break;case 3:this._point=4;default:$c(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Mk(e){return new gA(e)}function bA(e){this._context=e}bA.prototype={areaStart:Lc,areaEnd:Lc,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 Ck(e){return new bA(e)}function GS(e){return e<0?-1:1}function VS(e,t,n){var a=e._x1-e._x0,l=t-e._x1,o=(e._y1-e._y0)/(a||l<0&&-0),c=(n-e._y1)/(l||a<0&&-0),f=(o*l+c*a)/(a+l);return(GS(o)+GS(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(f))||0}function XS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Gm(e,t,n){var a=e._x0,l=e._y0,o=e._x1,c=e._y1,f=(o-a)/3;e._context.bezierCurveTo(a+f,l+f*t,o-f,c-f*n,o,c)}function Uc(e){this._context=e}Uc.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:Gm(this,this._t0,XS(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 n=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,Gm(this,XS(this,n=VS(this,e,t)),n);break;default:Gm(this,this._t0,n=VS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function xA(e){this._context=new SA(e)}(xA.prototype=Object.create(Uc.prototype)).point=function(e,t){Uc.prototype.point.call(this,t,e)};function SA(e){this._context=e}SA.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,a,l,o){this._context.bezierCurveTo(t,e,a,n,o,l)}};function Dk(e){return new Uc(e)}function kk(e){return new xA(e)}function wA(e){this._context=e}wA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var a=FS(e),l=FS(t),o=0,c=1;c=0;--t)l[t]=(c[t]-l[t+1])/o[t];for(o[n-1]=(e[n]+l[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function zk(e){return new Df(e,.5)}function Rk(e){return new Df(e,0)}function Lk(e){return new Df(e,1)}function bi(e,t){if((c=e.length)>1)for(var n=1,a,l,o=e[t[0]],c,f=o.length;n=0;)n[t]=t;return n}function $k(e,t){return e[t]}function Uk(e){const t=[];return t.key=e,t}function qk(){var e=Fe([]),t=zp,n=bi,a=$k;function l(o){var c=Array.from(e.apply(this,arguments),Uk),f,d=c.length,h=-1,v;for(const p of o)for(f=0,++h;f0){for(var n,a,l=0,o=e[0].length,c;l0){for(var n=0,a=e[t[0]],l,o=a.length;n0)||!((o=(l=e[t[0]]).length)>0))){for(var n=0,a=1,l,o,c;a1&&arguments[1]!==void 0?arguments[1]:Xk,n=10**t,a=Math.round(e*n)/n;return Object.is(a,-0)?0:a}function ct(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a{var f=n[c-1];return typeof f=="string"?l+f+o:f!==void 0?l+za(f)+o:l+o},"")}var Wt=e=>e===0?0:e>0?1:-1,vr=e=>typeof e=="number"&&e!=+e,Yr=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,me=e=>(typeof e=="number"||e instanceof Number)&&!vr(e),pr=e=>me(e)||typeof e=="string",Fk=0,uo=e=>{var t=++Fk;return"".concat(e||"").concat(t)},Nn=function(t,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!me(t)&&typeof t!="string")return a;var o;if(Yr(t)){if(n==null)return a;var c=t.indexOf("%");o=n*parseFloat(t.slice(0,c))/100}else o=+t;return vr(o)&&(o=a),l&&n!=null&&o>n&&(o=n),o},OA=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},a=0;aa&&(typeof t=="function"?t(a):xi(a,t))===n)}var _t=e=>e===null||typeof e>"u",Oo=e=>_t(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Zk(e){return e!=null}function _o(){}var Qk=["type","size","sizeType"];function Rp(){return Rp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t="symbol".concat(Oo(e));return AA[t]||I0},iP=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var a=18*rP;return 1.25*e*e*(Math.tan(a)-Math.tan(a*2)*Math.tan(a)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},lP=(e,t)=>{AA["symbol".concat(Oo(e))]=t},G0=e=>{var{type:t="circle",size:n=64,sizeType:a="area"}=e,l=tP(e,Qk),o=aw(aw({},l),{},{type:t,size:n,sizeType:a}),c="circle";typeof t=="string"&&(c=t);var f=()=>{var b=aP(c),x=Ek().type(b).size(iP(n,a,c)),O=x();if(O!==null)return O},{className:d,cx:h,cy:v}=o,p=tn(o);return me(h)&&me(v)&&me(n)?S.createElement("path",Rp({},p,{className:Re("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(v,")"),d:f()})):null};G0.registerSymbol=lP;var EA=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,V0=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(S.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var a={};return Object.keys(n).forEach(l=>{L0(l)&&(a[l]=(o=>n[l](n,o)))}),a},uP=(e,t,n)=>a=>(e(t,n,a),null),X0=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var a=null;return Object.keys(e).forEach(l=>{var o=e[l];L0(l)&&typeof o=="function"&&(a||(a={}),a[l]=uP(o,t,n))}),a};function iw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function oP(e){for(var t=1;t(c[f]===void 0&&a[f]!==void 0&&(c[f]=a[f]),c),n);return o}function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t>>=0,r===0?32:31-(s3(r)/c3|0)|0}var Yo=256,Go=262144,Vo=4194304;function Ha(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Xo(r,i,u){var s=r.pendingLanes;if(s===0)return 0;var m=0,y=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var A=s&134217727;return A!==0?(s=A&~y,s!==0?m=Ha(s):(w&=A,w!==0?m=Ha(w):u||(u=A&~r,u!==0&&(m=Ha(u))))):(A=s&~y,A!==0?m=Ha(A):w!==0?m=Ha(w):u||(u=s&~r,u!==0&&(m=Ha(u)))),m===0?0:i!==0&&i!==m&&(i&y)===0&&(y=m&-m,u=i&-i,y>=u||y===32&&(u&4194048)!==0)?i:m}function Gl(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function d3(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zg(){var r=Vo;return Vo<<=1,(Vo&62914560)===0&&(Vo=4194304),r}function _d(r){for(var i=[],u=0;31>u;u++)i.push(r);return i}function Vl(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function h3(r,i,u,s,m,y){var w=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var A=r.entanglements,D=r.expirationTimes,H=r.hiddenUpdates;for(u=w&~u;0"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var b3=/[\n"\\]/g;function Dn(r){return r.replace(b3,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Cd(r,i,u,s,m,y,w,A){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),i!=null?w==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Cn(i)):r.value!==""+Cn(i)&&(r.value=""+Cn(i)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),i!=null?Dd(r,w,Cn(i)):u!=null?Dd(r,w,Cn(u)):s!=null&&r.removeAttribute("value"),m==null&&y!=null&&(r.defaultChecked=!!y),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?r.name=""+Cn(A):r.removeAttribute("name")}function Xg(r,i,u,s,m,y,w,A){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||u!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){Md(r);return}u=u!=null?""+Cn(u):"",i=i!=null?""+Cn(i):u,A||i===r.value||(r.value=i),r.defaultValue=i}s=s??m,s=typeof s!="function"&&typeof s!="symbol"&&!!s,r.checked=A?r.checked:!!s,r.defaultChecked=!!s,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),Md(r)}function Dd(r,i,u){i==="number"&&Qo(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function Pi(r,i,u,s){if(r=r.options,i){i={};for(var m=0;m"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ld=!1;if(wr)try{var Ql={};Object.defineProperty(Ql,"passive",{get:function(){Ld=!0}}),window.addEventListener("test",Ql,Ql),window.removeEventListener("test",Ql,Ql)}catch{Ld=!1}var la=null,$d=null,Jo=null;function tb(){if(Jo)return Jo;var r,i=$d,u=i.length,s,m="value"in la?la.value:la.textContent,y=m.length;for(r=0;r=eu),ub=" ",ob=!1;function sb(r,i){switch(r){case"keyup":return V3.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cb(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var $i=!1;function F3(r,i){switch(r){case"compositionend":return cb(i);case"keypress":return i.which!==32?null:(ob=!0,ub);case"textInput":return r=i.data,r===ub&&ob?null:r;default:return null}}function Z3(r,i){if($i)return r==="compositionend"||!Hd&&sb(r,i)?(r=tb(),Jo=$d=la=null,$i=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:u,offset:i-r};r=s}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=gb(u)}}function xb(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?xb(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Sb(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Qo(r.document);i instanceof r.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)r=i.contentWindow;else break;i=Qo(r.document)}return i}function Gd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var aC=wr&&"documentMode"in document&&11>=document.documentMode,Ui=null,Vd=null,au=null,Xd=!1;function wb(r,i,u){var s=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Xd||Ui==null||Ui!==Qo(s)||(s=Ui,"selectionStart"in s&&Gd(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),au&&ru(au,s)||(au=s,s=Gs(Vd,"onSelect"),0>=w,m-=w,lr=1<<32-yn(i)+m|u<Oe?(Te=fe,fe=null):Te=fe.sibling;var ke=Y($,fe,I[Oe],J);if(ke===null){fe===null&&(fe=Te);break}r&&fe&&ke.alternate===null&&i($,fe),L=y(ke,L,Oe),De===null?pe=ke:De.sibling=ke,De=ke,fe=Te}if(Oe===I.length)return u($,fe),Me&&Or($,Oe),pe;if(fe===null){for(;OeOe?(Te=fe,fe=null):Te=fe.sibling;var Na=Y($,fe,ke.value,J);if(Na===null){fe===null&&(fe=Te);break}r&&fe&&Na.alternate===null&&i($,fe),L=y(Na,L,Oe),De===null?pe=Na:De.sibling=Na,De=Na,fe=Te}if(ke.done)return u($,fe),Me&&Or($,Oe),pe;if(fe===null){for(;!ke.done;Oe++,ke=I.next())ke=ne($,ke.value,J),ke!==null&&(L=y(ke,L,Oe),De===null?pe=ke:De.sibling=ke,De=ke);return Me&&Or($,Oe),pe}for(fe=s(fe);!ke.done;Oe++,ke=I.next())ke=X(fe,$,Oe,ke.value,J),ke!==null&&(r&&ke.alternate!==null&&fe.delete(ke.key===null?Oe:ke.key),L=y(ke,L,Oe),De===null?pe=ke:De.sibling=ke,De=ke);return r&&fe.forEach(function(O4){return i($,O4)}),Me&&Or($,Oe),pe}function Ke($,L,I,J){if(typeof I=="object"&&I!==null&&I.type===j&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case x:e:{for(var pe=I.key;L!==null;){if(L.key===pe){if(pe=I.type,pe===j){if(L.tag===7){u($,L.sibling),J=m(L,I.props.children),J.return=$,$=J;break e}}else if(L.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===F&&ei(pe)===L.type){u($,L.sibling),J=m(L,I.props),cu(J,I),J.return=$,$=J;break e}u($,L);break}else i($,L);L=L.sibling}I.type===j?(J=Fa(I.props.children,$.mode,J,I.key),J.return=$,$=J):(J=ss(I.type,I.key,I.props,null,$.mode,J),cu(J,I),J.return=$,$=J)}return w($);case O:e:{for(pe=I.key;L!==null;){if(L.key===pe)if(L.tag===4&&L.stateNode.containerInfo===I.containerInfo&&L.stateNode.implementation===I.implementation){u($,L.sibling),J=m(L,I.children||[]),J.return=$,$=J;break e}else{u($,L);break}else i($,L);L=L.sibling}J=th(I,$.mode,J),J.return=$,$=J}return w($);case F:return I=ei(I),Ke($,L,I,J)}if(ve(I))return ce($,L,I,J);if(B(I)){if(pe=B(I),typeof pe!="function")throw Error(a(150));return I=pe.call(I),ge($,L,I,J)}if(typeof I.then=="function")return Ke($,L,ps(I),J);if(I.$$typeof===M)return Ke($,L,ds($,I),J);ys($,I)}return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,L!==null&&L.tag===6?(u($,L.sibling),J=m(L,I),J.return=$,$=J):(u($,L),J=eh(I,$.mode,J),J.return=$,$=J),w($)):u($,L)}return function($,L,I,J){try{su=0;var pe=Ke($,L,I,J);return Zi=null,pe}catch(fe){if(fe===Fi||fe===ms)throw fe;var De=bn(29,fe,null,$.mode);return De.lanes=J,De.return=$,De}}}var ni=Yb(!0),Gb=Yb(!1),fa=!1;function hh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mh(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function da(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ha(r,i,u){var s=r.updateQueue;if(s===null)return null;if(s=s.shared,(ze&2)!==0){var m=s.pending;return m===null?i.next=i:(i.next=m.next,m.next=i),s.pending=i,i=os(r),Tb(r,null,u),i}return us(r,s,i,u),os(r)}function fu(r,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var s=i.lanes;s&=r.pendingLanes,u|=s,i.lanes=u,Lg(r,u)}}function vh(r,i){var u=r.updateQueue,s=r.alternate;if(s!==null&&(s=s.updateQueue,u===s)){var m=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var w={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};y===null?m=y=w:y=y.next=w,u=u.next}while(u!==null);y===null?m=y=i:y=y.next=i}else m=y=i;u={baseState:s.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:s.shared,callbacks:s.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=i:r.next=i,u.lastBaseUpdate=i}var ph=!1;function du(){if(ph){var r=Xi;if(r!==null)throw r}}function hu(r,i,u,s){ph=!1;var m=r.updateQueue;fa=!1;var y=m.firstBaseUpdate,w=m.lastBaseUpdate,A=m.shared.pending;if(A!==null){m.shared.pending=null;var D=A,H=D.next;D.next=null,w===null?y=H:w.next=H,w=D;var Q=r.alternate;Q!==null&&(Q=Q.updateQueue,A=Q.lastBaseUpdate,A!==w&&(A===null?Q.firstBaseUpdate=H:A.next=H,Q.lastBaseUpdate=D))}if(y!==null){var ne=m.baseState;w=0,Q=H=D=null,A=y;do{var Y=A.lane&-536870913,X=Y!==A.lane;if(X?(Ne&Y)===Y:(s&Y)===Y){Y!==0&&Y===Vi&&(ph=!0),Q!==null&&(Q=Q.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var ce=r,ge=A;Y=i;var Ke=u;switch(ge.tag){case 1:if(ce=ge.payload,typeof ce=="function"){ne=ce.call(Ke,ne,Y);break e}ne=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=ge.payload,Y=typeof ce=="function"?ce.call(Ke,ne,Y):ce,Y==null)break e;ne=p({},ne,Y);break e;case 2:fa=!0}}Y=A.callback,Y!==null&&(r.flags|=64,X&&(r.flags|=8192),X=m.callbacks,X===null?m.callbacks=[Y]:X.push(Y))}else X={lane:Y,tag:A.tag,payload:A.payload,callback:A.callback,next:null},Q===null?(H=Q=X,D=ne):Q=Q.next=X,w|=Y;if(A=A.next,A===null){if(A=m.shared.pending,A===null)break;X=A,A=X.next,X.next=null,m.lastBaseUpdate=X,m.shared.pending=null}}while(!0);Q===null&&(D=ne),m.baseState=D,m.firstBaseUpdate=H,m.lastBaseUpdate=Q,y===null&&(m.shared.lanes=0),ga|=w,r.lanes=w,r.memoizedState=ne}}function Vb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Xb(r,i){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;ry?y:8;var w=K.T,A={};K.T=A,zh(r,!1,i,u);try{var D=m(),H=K.S;if(H!==null&&H(A,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var Q=hC(D,s);pu(r,i,Q,On(r))}else pu(r,i,s,On(r))}catch(ne){pu(r,i,{then:function(){},status:"rejected",reason:ne},On())}finally{te.p=y,w!==null&&A.types!==null&&(w.types=A.types),K.T=w}}function bC(){}function kh(r,i,u,s){if(r.tag!==5)throw Error(a(476));var m=Ax(r).queue;_x(r,m,i,z,u===null?bC:function(){return Ex(r),u(s)})}function Ax(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:z},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:u},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Ex(r){var i=Ax(r);i.next===null&&(i=r.alternate.memoizedState),pu(r,i.next.queue,{},On())}function Ph(){return It(ku)}function Nx(){return ht().memoizedState}function Tx(){return ht().memoizedState}function xC(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var u=On();r=da(u);var s=ha(i,r,u);s!==null&&(cn(s,i,u),fu(s,i,u)),i={cache:sh()},r.payload=i;return}i=i.return}}function SC(r,i,u){var s=On();u={lane:s,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Es(r)?Cx(i,u):(u=Wd(r,i,u,s),u!==null&&(cn(u,r,s),Dx(u,i,s)))}function Mx(r,i,u){var s=On();pu(r,i,u,s)}function pu(r,i,u,s){var m={lane:s,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Es(r))Cx(i,m);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var w=i.lastRenderedState,A=y(w,u);if(m.hasEagerState=!0,m.eagerState=A,gn(A,w))return us(r,i,m,0),Ve===null&&ls(),!1}catch{}if(u=Wd(r,i,m,s),u!==null)return cn(u,r,s),Dx(u,i,s),!0}return!1}function zh(r,i,u,s){if(s={lane:2,revertLane:hm(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Es(r)){if(i)throw Error(a(479))}else i=Wd(r,u,s,2),i!==null&&cn(i,r,2)}function Es(r){var i=r.alternate;return r===we||i!==null&&i===we}function Cx(r,i){Wi=xs=!0;var u=r.pending;u===null?i.next=i:(i.next=u.next,u.next=i),r.pending=i}function Dx(r,i,u){if((u&4194048)!==0){var s=i.lanes;s&=r.pendingLanes,u|=s,i.lanes=u,Lg(r,u)}}var yu={readContext:It,use:js,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};yu.useEffectEvent=ot;var kx={readContext:It,use:js,useCallback:function(r,i){return Jt().memoizedState=[r,i===void 0?null:i],r},useContext:It,useEffect:px,useImperativeHandle:function(r,i,u){u=u!=null?u.concat([r]):null,_s(4194308,4,xx.bind(null,i,r),u)},useLayoutEffect:function(r,i){return _s(4194308,4,r,i)},useInsertionEffect:function(r,i){_s(4,2,r,i)},useMemo:function(r,i){var u=Jt();i=i===void 0?null:i;var s=r();if(ri){aa(!0);try{r()}finally{aa(!1)}}return u.memoizedState=[s,i],s},useReducer:function(r,i,u){var s=Jt();if(u!==void 0){var m=u(i);if(ri){aa(!0);try{u(i)}finally{aa(!1)}}}else m=i;return s.memoizedState=s.baseState=m,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:m},s.queue=r,r=r.dispatch=SC.bind(null,we,r),[s.memoizedState,r]},useRef:function(r){var i=Jt();return r={current:r},i.memoizedState=r},useState:function(r){r=Nh(r);var i=r.queue,u=Mx.bind(null,we,i);return i.dispatch=u,[r.memoizedState,u]},useDebugValue:Ch,useDeferredValue:function(r,i){var u=Jt();return Dh(u,r,i)},useTransition:function(){var r=Nh(!1);return r=_x.bind(null,we,r.queue,!0,!1),Jt().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,u){var s=we,m=Jt();if(Me){if(u===void 0)throw Error(a(407));u=u()}else{if(u=i(),Ve===null)throw Error(a(349));(Ne&127)!==0||ex(s,i,u)}m.memoizedState=u;var y={value:u,getSnapshot:i};return m.queue=y,px(nx.bind(null,s,y,r),[r]),s.flags|=2048,el(9,{destroy:void 0},tx.bind(null,s,y,u,i),null),u},useId:function(){var r=Jt(),i=Ve.identifierPrefix;if(Me){var u=ur,s=lr;u=(s&~(1<<32-yn(s)-1)).toString(32)+u,i="_"+i+"R_"+u,u=Ss++,0<\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof s.is=="string"?w.createElement("select",{is:s.is}):w.createElement("select"),s.multiple?y.multiple=!0:s.size&&(y.size=s.size);break;default:y=typeof s.is=="string"?w.createElement(m,{is:s.is}):w.createElement(m)}}y[qt]=i,y[rn]=s;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)y.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=y;e:switch(Kt(y,m,s),m){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Mr(i)}}return Je(i),Fh(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,u),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==s&&Mr(i);else{if(typeof s!="string"&&i.stateNode===null)throw Error(a(166));if(r=be.current,Yi(i)){if(r=i.stateNode,u=i.memoizedProps,s=null,m=Bt,m!==null)switch(m.tag){case 27:case 5:s=m.memoizedProps}r[qt]=i,r=!!(r.nodeValue===u||s!==null&&s.suppressHydrationWarning===!0||W1(r.nodeValue,u)),r||sa(i,!0)}else r=Vs(r).createTextNode(s),r[qt]=i,i.stateNode=r}return Je(i),null;case 31:if(u=i.memoizedState,r===null||r.memoizedState!==null){if(s=Yi(i),u!==null){if(r===null){if(!s)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[qt]=i}else Za(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Je(i),r=!1}else u=ih(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return i.flags&256?(Sn(i),i):(Sn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Je(i),null;case 13:if(s=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=Yi(i),s!==null&&s.dehydrated!==null){if(r===null){if(!m)throw Error(a(318));if(m=i.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(a(317));m[qt]=i}else Za(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Je(i),m=!1}else m=ih(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return i.flags&256?(Sn(i),i):(Sn(i),null)}return Sn(i),(i.flags&128)!==0?(i.lanes=u,i):(u=s!==null,r=r!==null&&r.memoizedState!==null,u&&(s=i.child,m=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(m=s.alternate.memoizedState.cachePool.pool),y=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(y=s.memoizedState.cachePool.pool),y!==m&&(s.flags|=2048)),u!==r&&u&&(i.child.flags|=8192),Ds(i,i.updateQueue),Je(i),null);case 4:return W(),r===null&&ym(i.stateNode.containerInfo),Je(i),null;case 10:return Ar(i.type),Je(i),null;case 19:if(Z(dt),s=i.memoizedState,s===null)return Je(i),null;if(m=(i.flags&128)!==0,y=s.rendering,y===null)if(m)bu(s,!1);else{if(st!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=bs(r),y!==null){for(i.flags|=128,bu(s,!1),r=y.updateQueue,i.updateQueue=r,Ds(i,r),i.subtreeFlags=0,r=u,u=i.child;u!==null;)Mb(u,r),u=u.sibling;return ie(dt,dt.current&1|2),Me&&Or(i,s.treeForkCount),i.child}r=r.sibling}s.tail!==null&&vn()>Ls&&(i.flags|=128,m=!0,bu(s,!1),i.lanes=4194304)}else{if(!m)if(r=bs(y),r!==null){if(i.flags|=128,m=!0,r=r.updateQueue,i.updateQueue=r,Ds(i,r),bu(s,!0),s.tail===null&&s.tailMode==="hidden"&&!y.alternate&&!Me)return Je(i),null}else 2*vn()-s.renderingStartTime>Ls&&u!==536870912&&(i.flags|=128,m=!0,bu(s,!1),i.lanes=4194304);s.isBackwards?(y.sibling=i.child,i.child=y):(r=s.last,r!==null?r.sibling=y:i.child=y,s.last=y)}return s.tail!==null?(r=s.tail,s.rendering=r,s.tail=r.sibling,s.renderingStartTime=vn(),r.sibling=null,u=dt.current,ie(dt,m?u&1|2:u&1),Me&&Or(i,s.treeForkCount),r):(Je(i),null);case 22:case 23:return Sn(i),gh(),s=i.memoizedState!==null,r!==null?r.memoizedState!==null!==s&&(i.flags|=8192):s&&(i.flags|=8192),s?(u&536870912)!==0&&(i.flags&128)===0&&(Je(i),i.subtreeFlags&6&&(i.flags|=8192)):Je(i),u=i.updateQueue,u!==null&&Ds(i,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==u&&(i.flags|=2048),r!==null&&Z(Ja),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Ar(vt),Je(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function AC(r,i){switch(rh(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Ar(vt),W(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return _e(i),null;case 31:if(i.memoizedState!==null){if(Sn(i),i.alternate===null)throw Error(a(340));Za()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Sn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Za()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return Z(dt),null;case 4:return W(),null;case 10:return Ar(i.type),null;case 22:case 23:return Sn(i),gh(),r!==null&&Z(Ja),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Ar(vt),null;case 25:return null;default:return null}}function r1(r,i){switch(rh(i),i.tag){case 3:Ar(vt),W();break;case 26:case 27:case 5:_e(i);break;case 4:W();break;case 31:i.memoizedState!==null&&Sn(i);break;case 13:Sn(i);break;case 19:Z(dt);break;case 10:Ar(i.type);break;case 22:case 23:Sn(i),gh(),r!==null&&Z(Ja);break;case 24:Ar(vt)}}function xu(r,i){try{var u=i.updateQueue,s=u!==null?u.lastEffect:null;if(s!==null){var m=s.next;u=m;do{if((u.tag&r)===r){s=void 0;var y=u.create,w=u.inst;s=y(),w.destroy=s}u=u.next}while(u!==m)}}catch(A){qe(i,i.return,A)}}function pa(r,i,u){try{var s=i.updateQueue,m=s!==null?s.lastEffect:null;if(m!==null){var y=m.next;s=y;do{if((s.tag&r)===r){var w=s.inst,A=w.destroy;if(A!==void 0){w.destroy=void 0,m=i;var D=u,H=A;try{H()}catch(Q){qe(m,D,Q)}}}s=s.next}while(s!==y)}}catch(Q){qe(i,i.return,Q)}}function a1(r){var i=r.updateQueue;if(i!==null){var u=r.stateNode;try{Xb(i,u)}catch(s){qe(r,r.return,s)}}}function i1(r,i,u){u.props=ai(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(s){qe(r,i,s)}}function Su(r,i){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var s=r.stateNode;break;case 30:s=r.stateNode;break;default:s=r.stateNode}typeof u=="function"?r.refCleanup=u(s):u.current=s}}catch(m){qe(r,i,m)}}function or(r,i){var u=r.ref,s=r.refCleanup;if(u!==null)if(typeof s=="function")try{s()}catch(m){qe(r,i,m)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(m){qe(r,i,m)}else u.current=null}function l1(r){var i=r.type,u=r.memoizedProps,s=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&s.focus();break e;case"img":u.src?s.src=u.src:u.srcSet&&(s.srcset=u.srcSet)}}catch(m){qe(r,r.return,m)}}function Zh(r,i,u){try{var s=r.stateNode;XC(s,r.type,u,i),s[rn]=i}catch(m){qe(r,r.return,m)}}function u1(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ja(r.type)||r.tag===4}function Qh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||u1(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&ja(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Wh(r,i,u){var s=r.tag;if(s===5||s===6)r=r.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(r),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Sr));else if(s!==4&&(s===27&&ja(r.type)&&(u=r.stateNode,i=null),r=r.child,r!==null))for(Wh(r,i,u),r=r.sibling;r!==null;)Wh(r,i,u),r=r.sibling}function ks(r,i,u){var s=r.tag;if(s===5||s===6)r=r.stateNode,i?u.insertBefore(r,i):u.appendChild(r);else if(s!==4&&(s===27&&ja(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(ks(r,i,u),r=r.sibling;r!==null;)ks(r,i,u),r=r.sibling}function o1(r){var i=r.stateNode,u=r.memoizedProps;try{for(var s=r.type,m=i.attributes;m.length;)i.removeAttributeNode(m[0]);Kt(i,s,u),i[qt]=r,i[rn]=u}catch(y){qe(r,r.return,y)}}var Cr=!1,gt=!1,Jh=!1,s1=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function EC(r,i){if(r=r.containerInfo,xm=ec,r=Sb(r),Gd(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var s=u.getSelection&&u.getSelection();if(s&&s.rangeCount!==0){u=s.anchorNode;var m=s.anchorOffset,y=s.focusNode;s=s.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var w=0,A=-1,D=-1,H=0,Q=0,ne=r,Y=null;t:for(;;){for(var X;ne!==u||m!==0&&ne.nodeType!==3||(A=w+m),ne!==y||s!==0&&ne.nodeType!==3||(D=w+s),ne.nodeType===3&&(w+=ne.nodeValue.length),(X=ne.firstChild)!==null;)Y=ne,ne=X;for(;;){if(ne===r)break t;if(Y===u&&++H===m&&(A=w),Y===y&&++Q===s&&(D=w),(X=ne.nextSibling)!==null)break;ne=Y,Y=ne.parentNode}ne=X}u=A===-1||D===-1?null:{start:A,end:D}}else u=null}u=u||{start:0,end:0}}else u=null;for(Sm={focusedElem:r,selectionRange:u},ec=!1,Ct=i;Ct!==null;)if(i=Ct,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Ct=r;else for(;Ct!==null;){switch(i=Ct,y=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(u=0;u title"))),Kt(y,s,u),y[qt]=r,Mt(y),s=y;break e;case"link":var w=vS("link","href",m).get(s+(u.href||""));if(w){for(var A=0;AKe&&(w=Ke,Ke=ge,ge=w);var $=bb(A,ge),L=bb(A,Ke);if($&&L&&(X.rangeCount!==1||X.anchorNode!==$.node||X.anchorOffset!==$.offset||X.focusNode!==L.node||X.focusOffset!==L.offset)){var I=ne.createRange();I.setStart($.node,$.offset),X.removeAllRanges(),ge>Ke?(X.addRange(I),X.extend(L.node,L.offset)):(I.setEnd(L.node,L.offset),X.addRange(I))}}}}for(ne=[],X=A;X=X.parentNode;)X.nodeType===1&&ne.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;Au?32:u,K.T=null,u=lm,lm=null;var y=xa,w=Rr;if(jt=0,il=xa=null,Rr=0,(ze&6)!==0)throw Error(a(331));var A=ze;if(ze|=4,x1(y.current),y1(y,y.current,w,u),ze=A,Eu(0,!1),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(Yl,y)}catch{}return!0}finally{te.p=m,K.T=s,$1(r,i)}}function q1(r,i,u){i=Pn(u,i),i=Uh(r.stateNode,i,2),r=ha(r,i,2),r!==null&&(Vl(r,2),sr(r))}function qe(r,i,u){if(r.tag===3)q1(r,r,u);else for(;i!==null;){if(i.tag===3){q1(i,r,u);break}else if(i.tag===1){var s=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ba===null||!ba.has(s))){r=Pn(u,r),u=Bx(2),s=ha(i,u,2),s!==null&&(Ix(u,s,i,r),Vl(s,2),sr(s));break}}i=i.return}}function cm(r,i,u){var s=r.pingCache;if(s===null){s=r.pingCache=new MC;var m=new Set;s.set(i,m)}else m=s.get(i),m===void 0&&(m=new Set,s.set(i,m));m.has(u)||(nm=!0,m.add(u),r=zC.bind(null,r,i,u),i.then(r,r))}function zC(r,i,u){var s=r.pingCache;s!==null&&s.delete(i),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,Ve===r&&(Ne&u)===u&&(st===4||st===3&&(Ne&62914560)===Ne&&300>vn()-Rs?(ze&2)===0&&ll(r,0):rm|=u,al===Ne&&(al=0)),sr(r)}function B1(r,i){i===0&&(i=zg()),r=Xa(r,i),r!==null&&(Vl(r,i),sr(r))}function RC(r){var i=r.memoizedState,u=0;i!==null&&(u=i.retryLane),B1(r,u)}function LC(r,i){var u=0;switch(r.tag){case 31:case 13:var s=r.stateNode,m=r.memoizedState;m!==null&&(u=m.retryLane);break;case 19:s=r.stateNode;break;case 22:s=r.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(i),B1(r,u)}function $C(r,i){return jd(r,i)}var Hs=null,ol=null,fm=!1,Ks=!1,dm=!1,wa=0;function sr(r){r!==ol&&r.next===null&&(ol===null?Hs=ol=r:ol=ol.next=r),Ks=!0,fm||(fm=!0,qC())}function Eu(r,i){if(!dm&&Ks){dm=!0;do for(var u=!1,s=Hs;s!==null;){if(r!==0){var m=s.pendingLanes;if(m===0)var y=0;else{var w=s.suspendedLanes,A=s.pingedLanes;y=(1<<31-yn(42|r)+1)-1,y&=m&~(w&~A),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(u=!0,Y1(s,y))}else y=Ne,y=Xo(s,s===Ve?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(y&3)===0||Gl(s,y)||(u=!0,Y1(s,y));s=s.next}while(u);dm=!1}}function UC(){I1()}function I1(){Ks=fm=!1;var r=0;wa!==0&&ZC()&&(r=wa);for(var i=vn(),u=null,s=Hs;s!==null;){var m=s.next,y=H1(s,i);y===0?(s.next=null,u===null?Hs=m:u.next=m,m===null&&(ol=u)):(u=s,(r!==0||(y&3)!==0)&&(Ks=!0)),s=m}jt!==0&&jt!==5||Eu(r),wa!==0&&(wa=0)}function H1(r,i){for(var u=r.suspendedLanes,s=r.pingedLanes,m=r.expirationTimes,y=r.pendingLanes&-62914561;0A)break;var Q=D.transferSize,ne=D.initiatorType;Q&&J1(ne)&&(D=D.responseEnd,w+=Q*(D"u"?null:document;function fS(r,i,u){var s=sl;if(s&&typeof i=="string"&&i){var m=Dn(i);m='link[rel="'+r+'"][href="'+m+'"]',typeof u=="string"&&(m+='[crossorigin="'+u+'"]'),cS.has(m)||(cS.add(m),r={rel:r,crossOrigin:u,href:i},s.querySelector(m)===null&&(i=s.createElement("link"),Kt(i,"link",r),Mt(i),s.head.appendChild(i)))}}function i4(r){Lr.D(r),fS("dns-prefetch",r,null)}function l4(r,i){Lr.C(r,i),fS("preconnect",r,i)}function u4(r,i,u){Lr.L(r,i,u);var s=sl;if(s&&r&&i){var m='link[rel="preload"][as="'+Dn(i)+'"]';i==="image"&&u&&u.imageSrcSet?(m+='[imagesrcset="'+Dn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(m+='[imagesizes="'+Dn(u.imageSizes)+'"]')):m+='[href="'+Dn(r)+'"]';var y=m;switch(i){case"style":y=cl(r);break;case"script":y=fl(r)}qn.has(y)||(r=p({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:r,as:i},u),qn.set(y,r),s.querySelector(m)!==null||i==="style"&&s.querySelector(Cu(y))||i==="script"&&s.querySelector(Du(y))||(i=s.createElement("link"),Kt(i,"link",r),Mt(i),s.head.appendChild(i)))}}function o4(r,i){Lr.m(r,i);var u=sl;if(u&&r){var s=i&&typeof i.as=="string"?i.as:"script",m='link[rel="modulepreload"][as="'+Dn(s)+'"][href="'+Dn(r)+'"]',y=m;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=fl(r)}if(!qn.has(y)&&(r=p({rel:"modulepreload",href:r},i),qn.set(y,r),u.querySelector(m)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Du(y)))return}s=u.createElement("link"),Kt(s,"link",r),Mt(s),u.head.appendChild(s)}}}function s4(r,i,u){Lr.S(r,i,u);var s=sl;if(s&&r){var m=Di(s).hoistableStyles,y=cl(r);i=i||"default";var w=m.get(y);if(!w){var A={loading:0,preload:null};if(w=s.querySelector(Cu(y)))A.loading=5;else{r=p({rel:"stylesheet",href:r,"data-precedence":i},u),(u=qn.get(y))&&Nm(r,u);var D=w=s.createElement("link");Mt(D),Kt(D,"link",r),D._p=new Promise(function(H,Q){D.onload=H,D.onerror=Q}),D.addEventListener("load",function(){A.loading|=1}),D.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Fs(w,i,s)}w={type:"stylesheet",instance:w,count:1,state:A},m.set(y,w)}}}function c4(r,i){Lr.X(r,i);var u=sl;if(u&&r){var s=Di(u).hoistableScripts,m=fl(r),y=s.get(m);y||(y=u.querySelector(Du(m)),y||(r=p({src:r,async:!0},i),(i=qn.get(m))&&Tm(r,i),y=u.createElement("script"),Mt(y),Kt(y,"link",r),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(m,y))}}function f4(r,i){Lr.M(r,i);var u=sl;if(u&&r){var s=Di(u).hoistableScripts,m=fl(r),y=s.get(m);y||(y=u.querySelector(Du(m)),y||(r=p({src:r,async:!0,type:"module"},i),(i=qn.get(m))&&Tm(r,i),y=u.createElement("script"),Mt(y),Kt(y,"link",r),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(m,y))}}function dS(r,i,u,s){var m=(m=be.current)?Xs(m):null;if(!m)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=cl(u.href),u=Di(m).hoistableStyles,s=u.get(i),s||(s={type:"style",instance:null,count:0,state:null},u.set(i,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=cl(u.href);var y=Di(m).hoistableStyles,w=y.get(r);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,w),(y=m.querySelector(Cu(r)))&&!y._p&&(w.instance=y,w.state.loading=5),qn.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},qn.set(r,u),y||d4(m,r,u,w.state))),i&&s===null)throw Error(a(528,""));return w}if(i&&s!==null)throw Error(a(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=fl(u),u=Di(m).hoistableScripts,s=u.get(i),s||(s={type:"script",instance:null,count:0,state:null},u.set(i,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function cl(r){return'href="'+Dn(r)+'"'}function Cu(r){return'link[rel="stylesheet"]['+r+"]"}function hS(r){return p({},r,{"data-precedence":r.precedence,precedence:null})}function d4(r,i,u,s){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?s.loading=1:(i=r.createElement("link"),s.preload=i,i.addEventListener("load",function(){return s.loading|=1}),i.addEventListener("error",function(){return s.loading|=2}),Kt(i,"link",u),Mt(i),r.head.appendChild(i))}function fl(r){return'[src="'+Dn(r)+'"]'}function Du(r){return"script[async]"+r}function mS(r,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var s=r.querySelector('style[data-href~="'+Dn(u.href)+'"]');if(s)return i.instance=s,Mt(s),s;var m=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return s=(r.ownerDocument||r).createElement("style"),Mt(s),Kt(s,"style",m),Fs(s,u.precedence,r),i.instance=s;case"stylesheet":m=cl(u.href);var y=r.querySelector(Cu(m));if(y)return i.state.loading|=4,i.instance=y,Mt(y),y;s=hS(u),(m=qn.get(m))&&Nm(s,m),y=(r.ownerDocument||r).createElement("link"),Mt(y);var w=y;return w._p=new Promise(function(A,D){w.onload=A,w.onerror=D}),Kt(y,"link",s),i.state.loading|=4,Fs(y,u.precedence,r),i.instance=y;case"script":return y=fl(u.src),(m=r.querySelector(Du(y)))?(i.instance=m,Mt(m),m):(s=u,(m=qn.get(y))&&(s=p({},u),Tm(s,m)),r=r.ownerDocument||r,m=r.createElement("script"),Mt(m),Kt(m,"link",s),r.head.appendChild(m),i.instance=m);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(s=i.instance,i.state.loading|=4,Fs(s,u.precedence,r));return i.instance}function Fs(r,i,u){for(var s=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=s.length?s[s.length-1]:null,y=m,w=0;w title"):null)}function h4(r,i,u){if(u===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function yS(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function m4(r,i,u,s){if(u.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var m=cl(s.href),y=i.querySelector(Cu(m));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Qs.bind(r),i.then(r,r)),u.state.loading|=4,u.instance=y,Mt(y);return}y=i.ownerDocument||i,s=hS(s),(m=qn.get(m))&&Nm(s,m),y=y.createElement("link"),Mt(y);var w=y;w._p=new Promise(function(A,D){w.onload=A,w.onerror=D}),Kt(y,"link",s),u.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=Qs.bind(r),i.addEventListener("load",u),i.addEventListener("error",u))}}var Mm=0;function v4(r,i){return r.stylesheets&&r.count===0&&Js(r,r.stylesheets),0Mm?50:800)+i);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(s),clearTimeout(m)}}:null}function Qs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Js(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Ws=null;function Js(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Ws=new Map,i.forEach(p4,r),Ws=null,Qs.call(r))}function p4(r,i){if(!(i.state.loading&4)){var u=Ws.get(r);if(u)var s=u.get(null);else{u=new Map,Ws.set(r,u);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Um.exports=P4(),Um.exports}var R4=z4();const L4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$4=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase()),BS=e=>{const t=$4(e);return t.charAt(0).toUpperCase()+t.slice(1)},V_=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim(),U4=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var q4={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const B4=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:c,...f},d)=>S.createElement("svg",{ref:d,...q4,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:V_("lucide",l),...!o&&!U4(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,v])=>S.createElement(h,v)),...Array.isArray(o)?o:[o]]));const je=(e,t)=>{const n=S.forwardRef(({className:a,...l},o)=>S.createElement(B4,{ref:o,iconNode:t,className:V_(`lucide-${L4(BS(e))}`,`lucide-${e}`,a),...l}));return n.displayName=BS(e),n};const I4=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],X_=je("activity",I4);const H4=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],Hm=je("arrow-down-to-line",H4);const K4=[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]],Km=je("arrow-up-from-line",K4);const Y4=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],G4=je("bell",Y4);const V4=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],IS=je("calendar",V4);const X4=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],F4=je("check",X4);const Z4=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],kc=je("chevron-down",Z4);const Q4=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],W4=je("chevron-left",Q4);const J4=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],eD=je("chevron-right",J4);const tD=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ep=je("chevron-up",tD);const nD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Tf=je("circle-alert",nD);const rD=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],wl=je("circle-check-big",rD);const aD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],iD=je("circle-check",aD);const lD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],uD=je("circle-dollar-sign",lD);const oD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pa=je("circle-x",oD);const sD=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],T0=je("clock",sD);const cD=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],fD=je("coins",cD);const dD=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],hD=je("cpu",dD);const mD=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],M0=je("gauge",mD);const vD=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],F_=je("key-round",vD);const pD=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],yD=je("layers",pD);const gD=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],bD=je("layout-dashboard",gD);const xD=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],C0=je("lock-keyhole",xD);const SD=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],wD=je("log-out",SD);const jD=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],OD=je("plus",jD);const _D=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],AD=je("power",_D);const ED=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],ND=je("receipt-text",ED);const TD=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Pl=je("refresh-cw",TD);const MD=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],D0=je("rotate-ccw",MD);const CD=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],DD=je("save",CD);const kD=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],PD=je("server-cog",kD);const zD=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],RD=je("server",zD);const LD=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],$D=je("settings",LD);const UD=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Z_=je("settings-2",UD);const qD=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Q_=je("shield-check",qD);const BD=[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]],ID=je("thermometer",BD);const HD=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],KD=je("trash-2",HD);const YD=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Np=je("triangle-alert",YD);const GD=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],HS=je("wifi-off",GD);const VD=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],XD=je("wifi",VD);const FD=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],W_=je("x",FD);const ZD=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],QD=je("zap",ZD);function Da(e,t=5e3){const[n,a]=S.useState(null),[l,o]=S.useState(null),[c,f]=S.useState(!0),[d,h]=S.useState(!1),[v,p]=S.useState(null),b=S.useCallback(async()=>{h(!0);try{const x=await e();a(x),o(null),p(new Date)}catch(x){o(x instanceof Error?x:new Error(String(x)))}finally{f(!1),h(!1)}},[e]);return S.useEffect(()=>{if(b(),t<=0)return;const x=setInterval(b,t);return()=>clearInterval(x)},[b,t]),{data:n,error:l,loading:c,refreshing:d,lastUpdated:v,refetch:b}}const k0="/api/v1/computing/inference",_c="computing-provider-control-token";let fi=sessionStorage.getItem(_c)??"";function hl(e){return encodeURIComponent(e)}class P0 extends Error{status;constructor(t,n){super(n),this.name="ApiError",this.status=t}}function z0(){return fi?{Authorization:`Bearer ${fi}`}:{}}async function cr(e){const t=await fetch(`${k0}${e}`,{headers:z0()});if(!t.ok){const n=await t.json().catch(()=>null);throw new P0(t.status,n?.error??`API error: ${t.status} ${t.statusText}`)}return t.json()}async function Ta(e,t){const n=await fetch(`${k0}${e}`,{method:"POST",headers:{"Content-Type":"application/json",...z0()},body:t?JSON.stringify(t):void 0});if(!n.ok){const a=await n.json().catch(()=>null);throw new P0(n.status,a?.error??`API error: ${n.status} ${n.statusText}`)}return n.json()}async function Uu(e,t){const n=await fetch(`${k0}${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...z0()},body:JSON.stringify(t)});if(!n.ok){const a=await n.json().catch(()=>null);throw new P0(n.status,a?.error??`API error: ${n.status} ${n.statusText}`)}return n.json()}const Ze={setAccessToken:e=>{fi=e.trim(),fi?sessionStorage.setItem(_c,fi):sessionStorage.removeItem(_c)},hasAccessToken:()=>!!fi,clearAccessToken:()=>{fi="",sessionStorage.removeItem(_c)},getMetrics:()=>cr("/metrics"),getStatus:()=>cr("/status"),getModels:()=>cr("/models"),enableModel:e=>Ta(`/models/${hl(e)}/enable`),disableModel:e=>Ta(`/models/${hl(e)}/disable`),reloadModels:()=>Ta("/models/reload"),forceHealthCheck:e=>Ta(`/models/${hl(e)}/healthcheck`),getRequestManagement:()=>cr("/request-management"),setGlobalRateLimit:e=>Ta("/ratelimit/global",{rate:e}),setModelRateLimit:(e,t)=>Ta(`/ratelimit/model/${hl(e)}`,{rate:t}),setGlobalConcurrency:e=>Ta("/concurrency/global",{max:e}),setModelConcurrency:(e,t)=>Ta(`/concurrency/model/${hl(e)}`,{max:t}),getRequestHistory:(e={})=>{const t=new URLSearchParams;e.limit&&t.set("limit",e.limit.toString()),e.offset&&t.set("offset",e.offset.toString()),e.model&&t.set("model",e.model),e.source&&t.set("source",e.source);const n=t.toString();return cr(`/requests${n?`?${n}`:""}`)},getEarnings:()=>cr("/earnings"),getEarningsHistory:e=>cr(`/earnings/history?duration=${e}`),getMetricsHistory:(e,t)=>{const n=new URLSearchParams;e&&n.set("duration",e),t&&n.set("resolution",t);const a=n.toString();return cr(`/metrics/history${a?`?${a}`:""}`)},getModelMetrics:e=>cr(`/models/${hl(e)}/metrics`),getSettings:()=>cr("/settings"),updateAlerts:e=>Uu("/settings/alerts",e),updateSelfCheck:e=>Uu("/settings/self-check",e),updateLogging:e=>Uu("/settings/logging",e),updateLimits:e=>Uu("/settings/limits",e),updateModels:e=>Uu("/settings/models",{models:e})},J_=["#3987e5","#c98500","#d55181","#008300"],R0="#94a3b8",eA="Other",Tp="#5b6b82",tA="Unattributed",WD=J_.length;function nA(e){const t=[...e??[]].sort((o,c)=>c.total_usd!==o.total_usd?c.total_usd-o.total_usd:o.model.localeCompare(c.model)),n=new Map,a=[],l=new Set;return t.forEach((o,c)=>{c=86400?a.toLocaleDateString(void 0,{year:n?"numeric":void 0,month:"short",day:"numeric"}):n?a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function oc(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function ui(e){return e===0?"$0":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function YS(e,t){const n=[];let a=0,l=0,o=0;for(const[f,d]of Object.entries(e.models??{}))t.colours.has(f)?n.push({key:f,label:f,colour:Pc(t,f),usd:d.usd,tokensIn:d.tokens_in,tokensOut:d.tokens_out}):(a+=d.usd,l+=d.tokens_in,o+=d.tokens_out);n.sort((f,d)=>d.usd-f.usd),(a>0||l>0||o>0)&&n.push({key:"__other",label:eA,colour:R0,usd:a,tokensIn:l,tokensOut:o});const c=e.unattributed??0;return c>1e-6&&n.push({key:"__unattributed",label:tA,colour:Tp,usd:c,tokensIn:0,tokensOut:0}),n}function JD({models:e}){const[t,n]=S.useState("24h"),[a,l]=S.useState(null),{data:o,loading:c,error:f}=Da(S.useCallback(()=>Ze.getEarningsHistory(t),[t]),6e4),d=S.useMemo(()=>{const T=new Map;for(const R of e??[])T.set(R.model,R.total_usd);const C=new Map;for(const R of o?.points??[])for(const[F,ee]of Object.entries(R.models??{}))C.set(F,(C.get(F)??0)+ee.usd);for(const[R,F]of C)T.set(R,Math.max(T.get(R)??0,F));return nA([...T].map(([R,F])=>({model:R,total_usd:F,tokens_in:0,tokens_out:0,input_usd:0,output_usd:0,priced:!0})))},[e,o?.points]),h=S.useMemo(()=>o?.points??[],[o?.points]),v=o?.bucket_seconds,p=o?.authoritative_points??0,b=h.length>0&&p===h.length,x=h.reduce((T,C)=>Math.max(T,C.usd),0),O=a,j=O!==null?h[O]:null,_=S.useMemo(()=>{const T={};let C=0,R=0,F=0,ee=0;for(const q of h){C+=q.usd,R+=q.tokens_in,F+=q.tokens_out,ee+=q.unattributed??0;for(const[U,B]of Object.entries(q.models??{})){const ue=T[U]??={tokens_in:0,tokens_out:0,usd:0};ue.tokens_in+=B.tokens_in,ue.tokens_out+=B.tokens_out,ue.usd+=B.usd}}return{timestamp:"",usd:C,tokens_in:R,tokens_out:F,models:T,unattributed:ee}},[h]),E=j??(h.length>0?_:null),N=j?uc(j.timestamp,v,!0):KS.find(T=>T.id===t)?.label??t,M=E?YS(E,d):[],P=S.useMemo(()=>{const T=new Set;let C=!1,R=!1;for(const ee of h){for(const q of Object.keys(ee.models??{}))d.colours.has(q)?T.add(q):C=!0;(ee.unattributed??0)>1e-6&&(R=!0)}const F=d.ordered.filter(ee=>T.has(ee)).map(ee=>({key:ee,label:ee,colour:Pc(d,ee)}));return C&&F.push({key:"__other",label:eA,colour:R0}),R&&F.push({key:"__unattributed",label:tA,colour:Tp}),F},[h,d]);return g.jsxs("div",{className:"min-w-0 overflow-hidden rounded-xl border border-slate-800 bg-slate-900/60",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-slate-800 px-4 py-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Earnings over time"}),g.jsx("p",{className:"text-xs text-slate-400",children:c&&!o?"Loading…":f&&o?`${ui(o.total_usd)} · showing stale data`:`${ui(o?.total_usd??0)} in this window`})]}),g.jsx("div",{className:"flex gap-1",role:"group","aria-label":"Time window",children:KS.map(T=>g.jsx("button",{type:"button",onClick:()=>n(T.id),"aria-pressed":t===T.id,className:`rounded-lg px-3 py-1.5 text-xs font-medium transition focus:outline-none focus:ring-2 focus:ring-blue-500 ${t===T.id?"bg-slate-700 text-white":"text-slate-400 hover:bg-slate-800 hover:text-slate-200"}`,children:T.label},T.id))})]}),f&&!o?g.jsxs("p",{className:"px-4 py-6 text-sm text-amber-300",children:["Could not load earnings history: ",f.message]}):h.length===0?g.jsx("p",{className:"px-4 py-6 text-sm text-slate-400",children:"No history for this window yet."}):g.jsxs("div",{className:"px-4 py-4",children:[g.jsx("div",{className:"mb-2 h-36","aria-live":"polite",children:E?g.jsxs("div",{className:"text-xs",children:[g.jsxs("div",{className:"flex items-baseline gap-2",children:[g.jsx("span",{className:"font-mono text-sm text-white",children:ui(E.usd)}),g.jsx("span",{className:"text-slate-400",children:N}),!j&&h.length>0&&g.jsx("span",{className:"text-slate-500",children:"· hover a bar for one interval"})]}),M.length>0?g.jsx("ul",{className:"mt-1 space-y-0.5 text-[11px]",children:M.map(T=>g.jsxs("li",{className:"flex items-center gap-2",children:[g.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 shrink-0 rounded-sm",style:{backgroundColor:T.colour}}),g.jsx("span",{className:"min-w-0 flex-1 truncate text-slate-300",children:T.label}),g.jsx("span",{className:"font-mono text-slate-400",children:ui(T.usd)}),T.key!=="__unattributed"&&g.jsxs("span",{className:"w-36 shrink-0 whitespace-nowrap text-right font-mono text-slate-400",children:[oc(T.tokensIn)," in / ",oc(T.tokensOut)," out"]})]},T.key))}):g.jsxs("div",{className:"mt-1 text-slate-400",children:[oc(E.tokens_in)," in / ",oc(E.tokens_out)," out",g.jsx("span",{className:"ml-2 text-slate-400",children:"— recorded before the per-model split"})]})]}):g.jsx("div",{className:"text-xs text-slate-400",children:"No earnings recorded in this window."})}),g.jsx("div",{className:"flex h-32 items-end gap-px",onMouseLeave:()=>l(null),role:"group","aria-label":`Earnings per interval over ${t}, split by model, totalling ${ui(o?.total_usd??0)}`,children:h.map((T,C)=>{const R=x>0?Math.max(2,T.usd/x*100):2,F=O===C,ee=YS(T,d),q=ee.length?ee.map(U=>`${U.label} ${ui(U.usd)}`).join(", "):`${T.tokens_in.toLocaleString()} in, ${T.tokens_out.toLocaleString()} out`;return g.jsx("button",{type:"button",onMouseEnter:()=>l(C),onFocus:()=>l(C),onBlur:()=>l(null),"aria-label":`${uc(T.timestamp,v,!0)}: ${ui(T.usd)} — ${q}`,className:`flex h-full flex-1 flex-col justify-end rounded-t focus:outline-none focus:ring-1 focus:ring-blue-400 ${F?"ring-1 ring-white/40":""}`,style:{height:`${R}%`},children:ee.length===0?g.jsx("span",{className:"block h-full w-full rounded-t",style:{backgroundColor:Tp}}):ee.map((U,B)=>{const ue=T.usd>0?U.usd/T.usd*100:0;return g.jsx("span",{className:B===0?"block w-full rounded-t":"block w-full",style:{height:`${ue}%`,backgroundColor:U.colour,marginTop:B===0?0:2,opacity:F?1:.85}},U.key)})},T.timestamp)})}),g.jsxs("div",{className:"mt-2 flex justify-between text-xs text-slate-400",children:[g.jsx("span",{children:h[0]&&uc(h[0].timestamp,v,!0)}),g.jsx("span",{children:h[h.length-1]&&uc(h[h.length-1].timestamp,v,!0)})]}),P.length>0&&g.jsx("ul",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs","aria-label":"Models in this chart",children:P.map(T=>g.jsxs("li",{className:"flex min-w-0 items-center gap-1.5",children:[g.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 shrink-0 rounded-sm",style:{backgroundColor:T.colour}}),g.jsx("span",{className:"break-all text-slate-400",children:T.label})]},T.key))})]}),g.jsxs("p",{className:"flex items-start gap-2 border-t border-slate-800 px-4 py-3 text-xs text-slate-400",children:[g.jsx(Tf,{"aria-hidden":"true",size:14,className:"mt-px shrink-0"}),g.jsxs("span",{children:[b?"From Swan Inference’s own earnings figure, sampled and differenced per interval.":p>0?`${p} of ${h.length} intervals come from Swan Inference’s own figure; the rest are this node’s estimate, priced from stored history at current rates.`:"This node’s own estimate, priced from its stored history at current rates — not the platform’s ledger.",p>0&&" The split by model is still this node’s share of served tokens: the platform reports no per-model breakdown.",(o?.restarts??0)>0&&p{var{children:n,width:a,height:l,viewBox:o,className:c,style:f,title:d,desc:h}=e,v=ik(e,ak),p=o||{width:a,height:l,x:0,y:0},b=Re("recharts-surface",c);return S.createElement("svg",Mp({},tn(v),{className:b,width:a,height:l,style:f,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),S.createElement("title",null,d),S.createElement("desc",null,h),n)}),uk=["children","className"];function Cp(){return Cp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,className:a}=e,l=ok(e,uk),o=Re("recharts-layer",a);return S.createElement("g",Cp({className:o},tn(l),{ref:t}),n)}),U0=G_(),lA=S.createContext(null),ck=()=>S.useContext(lA);function Fe(e){return function(){return e}}const uA=Math.cos,zc=Math.sin,ar=Math.sqrt,Rc=Math.PI,Mf=2*Rc,Dp=Math.PI,kp=2*Dp,oi=1e-6,fk=kp-oi;function oA(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return oA;const n=10**t;return function(a){this._+=a[0];for(let l=1,o=a.length;loi)if(!(Math.abs(p*d-h*v)>oi)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let x=a-c,O=l-f,j=d*d+h*h,_=x*x+O*O,E=Math.sqrt(j),N=Math.sqrt(b),M=o*Math.tan((Dp-Math.acos((j+b-_)/(2*E*N)))/2),P=M/N,T=M/E;Math.abs(P-1)>oi&&this._append`L${t+P*v},${n+P*p}`,this._append`A${o},${o},0,0,${+(p*x>v*O)},${this._x1=t+T*d},${this._y1=n+T*h}`}}arc(t,n,a,l,o,c){if(t=+t,n=+n,a=+a,c=!!c,a<0)throw new Error(`negative radius: ${a}`);let f=a*Math.cos(l),d=a*Math.sin(l),h=t+f,v=n+d,p=1^c,b=c?l-o:o-l;this._x1===null?this._append`M${h},${v}`:(Math.abs(this._x1-h)>oi||Math.abs(this._y1-v)>oi)&&this._append`L${h},${v}`,a&&(b<0&&(b=b%kp+kp),b>fk?this._append`A${a},${a},0,1,${p},${t-f},${n-d}A${a},${a},0,1,${p},${this._x1=h},${this._y1=v}`:b>oi&&this._append`A${a},${a},0,${+(b>=Dp)},${p},${this._x1=t+a*Math.cos(o)},${this._y1=n+a*Math.sin(o)}`)}rect(t,n,a,l){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${a=+a}v${+l}h${-a}Z`}toString(){return this._}}function q0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const a=Math.floor(n);if(!(a>=0))throw new RangeError(`invalid digits: ${n}`);t=a}return e},()=>new hk(t)}function B0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sA(e){this._context=e}sA.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 Cf(e){return new sA(e)}function cA(e){return e[0]}function fA(e){return e[1]}function dA(e,t){var n=Fe(!0),a=null,l=Cf,o=null,c=q0(f);e=typeof e=="function"?e:e===void 0?cA:Fe(e),t=typeof t=="function"?t:t===void 0?fA:Fe(t);function f(d){var h,v=(d=B0(d)).length,p,b=!1,x;for(a==null&&(o=l(x=c())),h=0;h<=v;++h)!(h=x;--O)f.point(M[O],P[O]);f.lineEnd(),f.areaEnd()}E&&(M[b]=+e(_,b,p),P[b]=+t(_,b,p),f.point(a?+a(_,b,p):M[b],n?+n(_,b,p):P[b]))}if(N)return f=null,N+""||null}function v(){return dA().defined(l).curve(c).context(o)}return h.x=function(p){return arguments.length?(e=typeof p=="function"?p:Fe(+p),a=null,h):e},h.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Fe(+p),h):e},h.x1=function(p){return arguments.length?(a=p==null?null:typeof p=="function"?p:Fe(+p),h):a},h.y=function(p){return arguments.length?(t=typeof p=="function"?p:Fe(+p),n=null,h):t},h.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Fe(+p),h):t},h.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Fe(+p),h):n},h.lineX0=h.lineY0=function(){return v().x(e).y(t)},h.lineY1=function(){return v().x(e).y(n)},h.lineX1=function(){return v().x(a).y(t)},h.defined=function(p){return arguments.length?(l=typeof p=="function"?p:Fe(!!p),h):l},h.curve=function(p){return arguments.length?(c=p,o!=null&&(f=c(o)),h):c},h.context=function(p){return arguments.length?(p==null?o=f=null:f=c(o=p),h):o},h}class hA{constructor(t,n){this._context=t,this._x=n}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,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function mk(e){return new hA(e,!0)}function vk(e){return new hA(e,!1)}const I0={draw(e,t){const n=ar(t/Rc);e.moveTo(n,0),e.arc(0,0,n,0,Mf)}},pk={draw(e,t){const n=ar(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},mA=ar(1/3),yk=mA*2,gk={draw(e,t){const n=ar(t/yk),a=n*mA;e.moveTo(0,-n),e.lineTo(a,0),e.lineTo(0,n),e.lineTo(-a,0),e.closePath()}},bk={draw(e,t){const n=ar(t),a=-n/2;e.rect(a,a,n,n)}},xk=.8908130915292852,vA=zc(Rc/10)/zc(7*Rc/10),Sk=zc(Mf/10)*vA,wk=-uA(Mf/10)*vA,jk={draw(e,t){const n=ar(t*xk),a=Sk*n,l=wk*n;e.moveTo(0,-n),e.lineTo(a,l);for(let o=1;o<5;++o){const c=Mf*o/5,f=uA(c),d=zc(c);e.lineTo(d*n,-f*n),e.lineTo(f*a-d*l,d*a+f*l)}e.closePath()}},Ym=ar(3),Ok={draw(e,t){const n=-ar(t/(Ym*3));e.moveTo(0,n*2),e.lineTo(-Ym*n,-n),e.lineTo(Ym*n,-n),e.closePath()}},Bn=-.5,In=ar(3)/2,Pp=1/ar(12),_k=(Pp/2+1)*3,Ak={draw(e,t){const n=ar(t/_k),a=n/2,l=n*Pp,o=a,c=n*Pp+n,f=-o,d=c;e.moveTo(a,l),e.lineTo(o,c),e.lineTo(f,d),e.lineTo(Bn*a-In*l,In*a+Bn*l),e.lineTo(Bn*o-In*c,In*o+Bn*c),e.lineTo(Bn*f-In*d,In*f+Bn*d),e.lineTo(Bn*a+In*l,Bn*l-In*a),e.lineTo(Bn*o+In*c,Bn*c-In*o),e.lineTo(Bn*f+In*d,Bn*d-In*f),e.closePath()}};function Ek(e,t){let n=null,a=q0(l);e=typeof e=="function"?e:Fe(e||I0),t=typeof t=="function"?t:Fe(t===void 0?64:+t);function l(){let o;if(n||(n=o=a()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return l.type=function(o){return arguments.length?(e=typeof o=="function"?o:Fe(o),l):e},l.size=function(o){return arguments.length?(t=typeof o=="function"?o:Fe(+o),l):t},l.context=function(o){return arguments.length?(n=o??null,l):n},l}function Lc(){}function $c(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function pA(e){this._context=e}pA.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:$c(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:$c(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nk(e){return new pA(e)}function yA(e){this._context=e}yA.prototype={areaStart:Lc,areaEnd:Lc,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:$c(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Tk(e){return new yA(e)}function gA(e){this._context=e}gA.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 n=(this._x0+4*this._x1+e)/6,a=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,a):this._context.moveTo(n,a);break;case 3:this._point=4;default:$c(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Mk(e){return new gA(e)}function bA(e){this._context=e}bA.prototype={areaStart:Lc,areaEnd:Lc,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 Ck(e){return new bA(e)}function GS(e){return e<0?-1:1}function VS(e,t,n){var a=e._x1-e._x0,l=t-e._x1,o=(e._y1-e._y0)/(a||l<0&&-0),c=(n-e._y1)/(l||a<0&&-0),f=(o*l+c*a)/(a+l);return(GS(o)+GS(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(f))||0}function XS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Gm(e,t,n){var a=e._x0,l=e._y0,o=e._x1,c=e._y1,f=(o-a)/3;e._context.bezierCurveTo(a+f,l+f*t,o-f,c-f*n,o,c)}function Uc(e){this._context=e}Uc.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:Gm(this,this._t0,XS(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 n=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,Gm(this,XS(this,n=VS(this,e,t)),n);break;default:Gm(this,this._t0,n=VS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function xA(e){this._context=new SA(e)}(xA.prototype=Object.create(Uc.prototype)).point=function(e,t){Uc.prototype.point.call(this,t,e)};function SA(e){this._context=e}SA.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,a,l,o){this._context.bezierCurveTo(t,e,a,n,o,l)}};function Dk(e){return new Uc(e)}function kk(e){return new xA(e)}function wA(e){this._context=e}wA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var a=FS(e),l=FS(t),o=0,c=1;c=0;--t)l[t]=(c[t]-l[t+1])/o[t];for(o[n-1]=(e[n]+l[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function zk(e){return new Df(e,.5)}function Rk(e){return new Df(e,0)}function Lk(e){return new Df(e,1)}function bi(e,t){if((c=e.length)>1)for(var n=1,a,l,o=e[t[0]],c,f=o.length;n=0;)n[t]=t;return n}function $k(e,t){return e[t]}function Uk(e){const t=[];return t.key=e,t}function qk(){var e=Fe([]),t=zp,n=bi,a=$k;function l(o){var c=Array.from(e.apply(this,arguments),Uk),f,d=c.length,h=-1,v;for(const p of o)for(f=0,++h;f0){for(var n,a,l=0,o=e[0].length,c;l0){for(var n=0,a=e[t[0]],l,o=a.length;n0)||!((o=(l=e[t[0]]).length)>0))){for(var n=0,a=1,l,o,c;a1&&arguments[1]!==void 0?arguments[1]:Xk,n=10**t,a=Math.round(e*n)/n;return Object.is(a,-0)?0:a}function ct(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a{var f=n[c-1];return typeof f=="string"?l+f+o:f!==void 0?l+za(f)+o:l+o},"")}var Wt=e=>e===0?0:e>0?1:-1,vr=e=>typeof e=="number"&&e!=+e,Yr=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,me=e=>(typeof e=="number"||e instanceof Number)&&!vr(e),pr=e=>me(e)||typeof e=="string",Fk=0,uo=e=>{var t=++Fk;return"".concat(e||"").concat(t)},Nn=function(t,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!me(t)&&typeof t!="string")return a;var o;if(Yr(t)){if(n==null)return a;var c=t.indexOf("%");o=n*parseFloat(t.slice(0,c))/100}else o=+t;return vr(o)&&(o=a),l&&n!=null&&o>n&&(o=n),o},OA=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},a=0;aa&&(typeof t=="function"?t(a):xi(a,t))===n)}var _t=e=>e===null||typeof e>"u",Oo=e=>_t(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Zk(e){return e!=null}function _o(){}var Qk=["type","size","sizeType"];function Rp(){return Rp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t="symbol".concat(Oo(e));return AA[t]||I0},iP=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var a=18*rP;return 1.25*e*e*(Math.tan(a)-Math.tan(a*2)*Math.tan(a)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},lP=(e,t)=>{AA["symbol".concat(Oo(e))]=t},G0=e=>{var{type:t="circle",size:n=64,sizeType:a="area"}=e,l=tP(e,Qk),o=aw(aw({},l),{},{type:t,size:n,sizeType:a}),c="circle";typeof t=="string"&&(c=t);var f=()=>{var b=aP(c),x=Ek().type(b).size(iP(n,a,c)),O=x();if(O!==null)return O},{className:d,cx:h,cy:v}=o,p=tn(o);return me(h)&&me(v)&&me(n)?S.createElement("path",Rp({},p,{className:Re("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(v,")"),d:f()})):null};G0.registerSymbol=lP;var EA=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,V0=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(S.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var a={};return Object.keys(n).forEach(l=>{L0(l)&&(a[l]=(o=>n[l](n,o)))}),a},uP=(e,t,n)=>a=>(e(t,n,a),null),X0=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var a=null;return Object.keys(e).forEach(l=>{var o=e[l];L0(l)&&typeof o=="function"&&(a||(a={}),a[l]=uP(o,t,n))}),a};function iw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function oP(e){for(var t=1;t(c[f]===void 0&&a[f]!==void 0&&(c[f]=a[f]),c),n);return o}function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var b=v.formatter||l,x=Re({"recharts-legend-item":!0,["legend-item-".concat(p)]:!0,inactive:v.inactive});if(v.type==="none")return null;var O=v.inactive?o:v.color,j=b?b(v.value,v,p):v.value;return S.createElement("li",qc({className:x,style:d,key:"legend-item-".concat(p)},X0(e,v,p)),S.createElement($0,{width:n,height:n,viewBox:f,style:h,"aria-label":"".concat(j," legend icon")},S.createElement(yP,{data:v,iconType:c,inactiveColor:o})),S.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},j))})}var bP=e=>{var t=At(e,pP),{payload:n,layout:a,align:l}=t;if(!n||!n.length)return null;var o={padding:0,margin:0,textAlign:a==="horizontal"?l:"left"};return S.createElement("ul",{className:"recharts-default-legend",style:o},S.createElement(gP,qc({},t,{payload:n})))},ev={},tv={},uw;function xP(){return uw||(uw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a){const l=new Map;for(let o=0;o=0}e.isLength=t})(lv)),lv}var fw;function F0(){return fw||(fw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wP();function n(a){return a!=null&&typeof a!="function"&&t.isLength(a.length)}e.isArrayLike=n})(iv)),iv}var uv={},dw;function jP(){return dw||(dw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(uv)),uv}var hw;function OP(){return hw||(hw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F0(),n=jP();function a(l){return n.isObjectLike(l)&&t.isArrayLike(l)}e.isArrayLikeObject=a})(av)),av}var ov={},sv={},mw;function _P(){return mw||(mw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Y0();function n(a){return function(l){return t.get(l,a)}}e.property=n})(sv)),sv}var cv={},fv={},dv={},hv={},vw;function TA(){return vw||(vw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(hv)),hv}var mv={},pw;function MA(){return pw||(pw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(mv)),mv}var vv={},yw;function CA(){return yw||(yw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a){return n===a||Number.isNaN(n)&&Number.isNaN(a)}e.isEqualsSameValueZero=t})(vv)),vv}var gw;function AP(){return gw||(gw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=TA(),n=MA(),a=CA();function l(v,p,b){return typeof b!="function"?l(v,p,()=>{}):o(v,p,function x(O,j,_,E,N,M){const P=b(O,j,_,E,N,M);return P!==void 0?!!P:o(O,j,x,M)},new Map)}function o(v,p,b,x){if(p===v)return!0;switch(typeof p){case"object":return c(v,p,b,x);case"function":return Object.keys(p).length>0?o(v,{...p},b,x):a.isEqualsSameValueZero(v,p);default:return t.isObject(v)?typeof p=="string"?p==="":!0:a.isEqualsSameValueZero(v,p)}}function c(v,p,b,x){if(p==null)return!0;if(Array.isArray(p))return d(v,p,b,x);if(p instanceof Map)return f(v,p,b,x);if(p instanceof Set)return h(v,p,b,x);const O=Object.keys(p);if(v==null||n.isPrimitive(v))return O.length===0;if(O.length===0)return!0;if(x?.has(p))return x.get(p)===v;x?.set(p,v);try{for(let j=0;j{})}e.isMatch=n})(fv)),fv}var pv={},yv={},gv={},xw;function EP(){return xw||(xw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(a=>Object.prototype.propertyIsEnumerable.call(n,a))}e.getSymbols=t})(gv)),gv}var bv={},Sw;function Z0(){return Sw||(Sw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(bv)),bv}var xv={},ww;function kA(){return ww||(ww=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",a="[object Number]",l="[object Boolean]",o="[object Arguments]",c="[object Symbol]",f="[object Date]",d="[object Map]",h="[object Set]",v="[object Array]",p="[object Function]",b="[object ArrayBuffer]",x="[object Object]",O="[object Error]",j="[object DataView]",_="[object Uint8Array]",E="[object Uint8ClampedArray]",N="[object Uint16Array]",M="[object Uint32Array]",P="[object BigUint64Array]",T="[object Int8Array]",C="[object Int16Array]",L="[object Int32Array]",Z="[object BigInt64Array]",ne="[object Float32Array]",q="[object Float64Array]";e.argumentsTag=o,e.arrayBufferTag=b,e.arrayTag=v,e.bigInt64ArrayTag=Z,e.bigUint64ArrayTag=P,e.booleanTag=l,e.dataViewTag=j,e.dateTag=f,e.errorTag=O,e.float32ArrayTag=ne,e.float64ArrayTag=q,e.functionTag=p,e.int16ArrayTag=C,e.int32ArrayTag=L,e.int8ArrayTag=T,e.mapTag=d,e.numberTag=a,e.objectTag=x,e.regexpTag=t,e.setTag=h,e.stringTag=n,e.symbolTag=c,e.uint16ArrayTag=N,e.uint32ArrayTag=M,e.uint8ArrayTag=_,e.uint8ClampedArrayTag=E})(xv)),xv}var Sv={},jw;function NP(){return jw||(jw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Sv)),Sv}var Ow;function PA(){return Ow||(Ow=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=EP(),n=Z0(),a=kA(),l=MA(),o=NP();function c(v,p){return f(v,void 0,v,new Map,p)}function f(v,p,b,x=new Map,O=void 0){const j=O?.(v,p,b,x);if(j!==void 0)return j;if(l.isPrimitive(v))return v;if(x.has(v))return x.get(v);if(Array.isArray(v)){const _=new Array(v.length);x.set(v,_);for(let E=0;Et.isMatch(o,l)}e.matches=a})(cv)),cv}var wv={},jv={},Ov={},Ew;function CP(){return Ew||(Ew=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=PA(),n=Z0(),a=kA();function l(o,c){return t.cloneDeepWith(o,(f,d,h,v)=>{const p=c?.(f,d,h,v);if(p!==void 0)return p;if(typeof o=="object"){if(n.getTag(o)===a.objectTag&&typeof o.constructor!="function"){const b={};return v.set(o,b),t.copyProperties(b,o,h,v),b}switch(Object.prototype.toString.call(o)){case a.numberTag:case a.stringTag:case a.booleanTag:{const b=new o.constructor(o?.valueOf());return t.copyProperties(b,o),b}case a.argumentsTag:{const b={};return t.copyProperties(b,o),b.length=o.length,b[Symbol.iterator]=o[Symbol.iterator],b}default:return}}})}e.cloneDeepWith=l})(Ov)),Ov}var Nw;function DP(){return Nw||(Nw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CP();function n(a){return t.cloneDeepWith(a)}e.cloneDeep=n})(jv)),jv}var _v={},Av={},Tw;function zA(){return Tw||(Tw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(a,l=Number.MAX_SAFE_INTEGER){switch(typeof a){case"number":return Number.isInteger(a)&&a>=0&&a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return Dv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Dv}var $w;function BP(){return $w||($w=1,Cv.exports=qP()),Cv.exports}var Uw;function IP(){if(Uw)return Mv;Uw=1;var e=kl(),t=BP();function n(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var a=typeof Object.is=="function"?Object.is:n,l=t.useSyncExternalStore,o=e.useRef,c=e.useEffect,f=e.useMemo,d=e.useDebugValue;return Mv.useSyncExternalStoreWithSelector=function(h,v,p,b,x){var O=o(null);if(O.current===null){var j={hasValue:!1,value:null};O.current=j}else j=O.current;O=f(function(){function E(C){if(!N){if(N=!0,M=C,C=b(C),x!==void 0&&j.hasValue){var L=j.value;if(x(L,C))return P=L}return P=C}if(L=P,a(M,C))return L;var Z=b(C);return x!==void 0&&x(L,Z)?(M=C,L):(M=C,P=Z)}var N=!1,M,P,T=p===void 0?null:p;return[function(){return E(v())},T===null?void 0:function(){return E(T())}]},[v,p,b,x]);var _=l(h,O[0],O[1]);return c(function(){j.hasValue=!0,j.value=_},[_]),d(_),_},Mv}var qw;function HP(){return qw||(qw=1,Tv.exports=IP()),Tv.exports}var KP=HP(),Q0=S.createContext(null),YP=e=>e,Qe=()=>{var e=S.useContext(Q0);return e?e.store.dispatch:YP},Ac=()=>{},GP=()=>Ac,VP=(e,t)=>e===t;function de(e){var t=S.useContext(Q0);return KP.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:GP,t?t.store.getState:Ac,t?t.store.getState:Ac,t?e:Ac,VP)}function XP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function FP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function ZP(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(a=>typeof a=="function"?`function ${a.name||"unnamed"}()`:typeof a).join(", ");throw new TypeError(`${t}[${n}]`)}}var Bw=e=>Array.isArray(e)?e:[e];function QP(e){const t=Array.isArray(e[0])?e[0]:e;return ZP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function WP(e,t){const n=[],{length:a}=e;for(let l=0;l{n=cc(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}function nz(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,a=(...l)=>{let o=0,c=0,f,d={},h=l.pop();typeof h=="object"&&(d=h,h=l.pop()),XP(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const v={...n,...d},{memoize:p,memoizeOptions:b=[],argsMemoize:x=LA,argsMemoizeOptions:O=[]}=v,j=Bw(b),_=Bw(O),E=QP(l),N=p(function(){return o++,h.apply(null,arguments)},...j),M=x(function(){c++;const T=WP(E,arguments);return f=N.apply(null,T),f},..._);return Object.assign(M,{resultFunc:h,memoizedResultFunc:N,dependencies:E,dependencyRecomputations:()=>c,resetDependencyRecomputations:()=>{c=0},lastResult:()=>f,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:p,argsMemoize:x})};return Object.assign(a,{withTypes:()=>a}),a}var V=nz(LA),rz=Object.assign((e,t=V)=>{FP(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),a=n.map(o=>e[o]);return t(a,(...o)=>o.reduce((c,f,d)=>(c[n[d]]=f,c),{}))},{withTypes:()=>rz}),kv={},Pv={},zv={},Hw;function az(){return Hw||(Hw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(a){return typeof a=="symbol"?1:a===null?2:a===void 0?3:a!==a?4:0}const n=(a,l,o)=>{if(a!==l){const c=t(a),f=t(l);if(c===f&&c===0){if(al)return o==="desc"?-1:1}return o==="desc"?f-c:c-f}return 0};e.compareValues=n})(zv)),zv}var Rv={},Lv={},Kw;function $A(){return Kw||(Kw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(Lv)),Lv}var Yw;function iz(){return Yw||(Yw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$A(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function l(o,c){return Array.isArray(o)?!1:typeof o=="number"||typeof o=="boolean"||o==null||t.isSymbol(o)?!0:typeof o=="string"&&(a.test(o)||!n.test(o))||c!=null&&Object.hasOwn(c,o)}e.isKey=l})(Rv)),Rv}var Gw;function lz(){return Gw||(Gw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=az(),n=iz(),a=K0();function l(o,c,f,d){if(o==null)return[];f=d?void 0:f,Array.isArray(o)||(o=Object.values(o)),Array.isArray(c)||(c=c==null?[null]:[c]),c.length===0&&(c=[null]),Array.isArray(f)||(f=f==null?[]:[f]),f=f.map(x=>String(x));const h=(x,O)=>{let j=x;for(let _=0;_O==null||x==null?O:typeof x=="object"&&"key"in x?Object.hasOwn(O,x.key)?O[x.key]:h(O,x.path):typeof x=="function"?x(O):Array.isArray(x)?h(O,x):typeof O=="object"?O[x]:O,p=c.map(x=>(Array.isArray(x)&&x.length===1&&(x=x[0]),x==null||typeof x=="function"||Array.isArray(x)||n.isKey(x)?x:{key:x,path:a.toPath(x)}));return o.map(x=>({original:x,criteria:p.map(O=>v(O,x))})).slice().sort((x,O)=>{for(let j=0;jx.original)}e.orderBy=l})(Pv)),Pv}var $v={},Vw;function uz(){return Vw||(Vw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a=1){const l=[],o=Math.floor(a),c=(f,d)=>{for(let h=0;h1&&a.isIterateeCall(o,c[0],c[1])?c=[]:f>2&&a.isIterateeCall(c[0],c[1],c[2])&&(c=[c[0]]),t.orderBy(o,n.flatten(c),["asc"])}e.sortBy=l})(kv)),kv}var qv,Zw;function sz(){return Zw||(Zw=1,qv=oz().sortBy),qv}var cz=sz();const kf=Qr(cz);var qA=e=>e.legend.settings,fz=e=>e.legend.size,dz=e=>e.legend.payload,hz=V([dz,qA],(e,t)=>{var{itemSorter:n}=t,a=e.flat(1);return n?kf(a,n):a});function mz(){return de(hz)}var fc=1;function BA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=S.useState({height:0,left:0,top:0,width:0}),a=S.useCallback(l=>{if(l!=null){var o=l.getBoundingClientRect(),c={height:o.height,left:o.left,top:o.top,width:o.width};(Math.abs(c.height-t.height)>fc||Math.abs(c.left-t.left)>fc||Math.abs(c.top-t.top)>fc||Math.abs(c.width-t.width)>fc)&&n({height:c.height,left:c.left,top:c.top,width:c.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,a]}function Yt(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 vz=typeof Symbol=="function"&&Symbol.observable||"@@observable",Qw=vz,Bv=()=>Math.random().toString(36).substring(7).split("").join("."),pz={INIT:`@@redux/INIT${Bv()}`,REPLACE:`@@redux/REPLACE${Bv()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bv()}`},Bc=pz;function W0(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 IA(e,t,n){if(typeof e!="function")throw new Error(Yt(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Yt(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Yt(1));return n(IA)(e,t)}let a=e,l=t,o=new Map,c=o,f=0,d=!1;function h(){c===o&&(c=new Map,o.forEach((_,E)=>{c.set(E,_)}))}function v(){if(d)throw new Error(Yt(3));return l}function p(_){if(typeof _!="function")throw new Error(Yt(4));if(d)throw new Error(Yt(5));let E=!0;h();const N=f++;return c.set(N,_),function(){if(E){if(d)throw new Error(Yt(6));E=!1,h(),c.delete(N),o=null}}}function b(_){if(!W0(_))throw new Error(Yt(7));if(typeof _.type>"u")throw new Error(Yt(8));if(typeof _.type!="string")throw new Error(Yt(17));if(d)throw new Error(Yt(9));try{d=!0,l=a(l,_)}finally{d=!1}return(o=c).forEach(N=>{N()}),_}function x(_){if(typeof _!="function")throw new Error(Yt(10));a=_,b({type:Bc.REPLACE})}function O(){const _=p;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(Yt(11));function N(){const P=E;P.next&&P.next(v())}return N(),{unsubscribe:_(N)}},[Qw](){return this}}}return b({type:Bc.INIT}),{dispatch:b,subscribe:p,getState:v,replaceReducer:x,[Qw]:O}}function yz(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Bc.INIT})>"u")throw new Error(Yt(12));if(typeof n(void 0,{type:Bc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Yt(13))})}function HA(e){const t=Object.keys(e),n={};for(let o=0;o"u")throw f&&f.type,new Error(Yt(14));h[p]=O,d=d||O!==x}return d=d||a.length!==Object.keys(c).length,d?h:c}}function Ic(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...a)=>t(n(...a)))}function gz(...e){return t=>(n,a)=>{const l=t(n,a);let o=()=>{throw new Error(Yt(15))};const c={getState:l.getState,dispatch:(d,...h)=>o(d,...h)},f=e.map(d=>d(c));return o=Ic(...f)(l.dispatch),{...l,dispatch:o}}}function KA(e){return W0(e)&&"type"in e&&typeof e.type=="string"}var YA=Symbol.for("immer-nothing"),Ww=Symbol.for("immer-draftable"),nn=Symbol.for("immer-state");function Jn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var En=Object,Al=En.getPrototypeOf,Hc="constructor",Pf="prototype",Lp="configurable",Kc="enumerable",Ec="writable",oo="value",Gr=e=>!!e&&!!e[nn];function rr(e){return e?GA(e)||Rf(e)||!!e[Ww]||!!e[Hc]?.[Ww]||Lf(e)||$f(e):!1}var bz=En[Pf][Hc].toString(),Jw=new WeakMap;function GA(e){if(!e||!J0(e))return!1;const t=Al(e);if(t===null||t===En[Pf])return!0;const n=En.hasOwnProperty.call(t,Hc)&&t[Hc];if(n===Object)return!0;if(!gl(n))return!1;let a=Jw.get(n);return a===void 0&&(a=Function.toString.call(n),Jw.set(n,a)),a===bz}function zf(e,t,n=!0){Ao(e)===0?(n?Reflect.ownKeys(e):En.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((a,l)=>t(l,a,e))}function Ao(e){const t=e[nn];return t?t.type_:Rf(e)?1:Lf(e)?2:$f(e)?3:0}var ej=(e,t,n=Ao(e))=>n===2?e.has(t):En[Pf].hasOwnProperty.call(e,t),$p=(e,t,n=Ao(e))=>n===2?e.get(t):e[t],Yc=(e,t,n,a=Ao(e))=>{a===2?e.set(t,n):a===3?e.add(n):e[t]=n};function xz(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Rf=Array.isArray,Lf=e=>e instanceof Map,$f=e=>e instanceof Set,J0=e=>typeof e=="object",gl=e=>typeof e=="function",Iv=e=>typeof e=="boolean";function Sz(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var $r=e=>e.copy_||e.base_,ey=e=>e.modified_?e.copy_:e.base_;function Up(e,t){if(Lf(e))return new Map(e);if($f(e))return new Set(e);if(Rf(e))return Array[Pf].slice.call(e);const n=GA(e);if(t===!0||t==="class_only"&&!n){const a=En.getOwnPropertyDescriptors(e);delete a[nn];let l=Reflect.ownKeys(a);for(let o=0;o1&&En.defineProperties(e,{set:dc,add:dc,clear:dc,delete:dc}),En.freeze(e),t&&zf(e,(n,a)=>{ty(a,!0)},!1)),e}function wz(){Jn(2)}var dc={[oo]:wz};function Uf(e){return e===null||!J0(e)?!0:En.isFrozen(e)}var Gc="MapSet",qp="Patches",tj="ArrayMethods",VA={};function Si(e){const t=VA[e];return t||Jn(0,e),t}var nj=e=>!!VA[e],so,XA=()=>so,jz=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:nj(Gc)?Si(Gc):void 0,arrayMethodsPlugin_:nj(tj)?Si(tj):void 0});function rj(e,t){t&&(e.patchPlugin_=Si(qp),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bp(e){Ip(e),e.drafts_.forEach(Oz),e.drafts_=null}function Ip(e){e===so&&(so=e.parent_)}var aj=e=>so=jz(so,e);function Oz(e){const t=e[nn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ij(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[nn].modified_&&(Bp(t),Jn(4)),rr(e)&&(e=lj(t,e));const{patchPlugin_:l}=t;l&&l.generateReplacementPatches_(n[nn].base_,e,t)}else e=lj(t,n);return _z(t,e,!0),Bp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==YA?e:void 0}function lj(e,t){if(Uf(t))return t;const n=t[nn];if(!n)return Vc(t,e.handledSet_,e);if(!qf(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:a}=n;if(a)for(;a.length>0;)a.pop()(e);QA(n,e)}return n.copy_}function _z(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ty(t,n)}function FA(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var qf=(e,t)=>e.scope_===t,Az=[];function ZA(e,t,n,a){const l=$r(e),o=e.type_;if(a!==void 0&&$p(l,a,o)===t){Yc(l,a,n,o);return}if(!e.draftLocations_){const f=e.draftLocations_=new Map;zf(l,(d,h)=>{if(Gr(h)){const v=f.get(h)||[];v.push(d),f.set(h,v)}})}const c=e.draftLocations_.get(t)??Az;for(const f of c)Yc(l,f,n,o)}function Ez(e,t,n){e.callbacks_.push(function(l){const o=t;if(!o||!qf(o,l))return;l.mapSetPlugin_?.fixSetContents(o);const c=ey(o);ZA(e,o.draft_??o,c,n),QA(o,l)})}function QA(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:a}=t;if(a){const l=a.getPath(e);l&&a.generatePatches_(e,l,t)}FA(e)}}function Nz(e,t,n){const{scope_:a}=e;if(Gr(n)){const l=n[nn];qf(l,a)&&l.callbacks_.push(function(){Nc(e);const c=ey(l);ZA(e,n,c,t)})}else rr(n)&&e.callbacks_.push(function(){const o=$r(e);e.type_===3?o.has(n)&&Vc(n,a.handledSet_,a):$p(o,t,e.type_)===n&&a.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Vc($p(e.copy_,t,e.type_),a.handledSet_,a)})}function Vc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Gr(e)||t.has(e)||!rr(e)||Uf(e)||(t.add(e),zf(e,(a,l)=>{if(Gr(l)){const o=l[nn];if(qf(o,n)){const c=ey(o);Yc(e,a,c,e.type_),FA(o)}}else rr(l)&&Vc(l,t,n)})),e}function Tz(e,t){const n=Rf(e),a={type_:n?1:0,scope_:t?t.scope_:XA(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let l=a,o=Xc;n&&(l=[a],o=co);const{revoke:c,proxy:f}=Proxy.revocable(l,o);return a.draft_=f,a.revoke_=c,[f,a]}var Xc={get(e,t){if(t===nn)return e;let n=e.scope_.arrayMethodsPlugin_;const a=e.type_===1&&typeof t=="string";if(a&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const l=$r(e);if(!ej(l,t,e.type_))return Mz(e,l,t);const o=l[t];if(e.finalized_||!rr(o)||a&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Sz(t))return o;if(o===Hv(e.base_,t)){Nc(e);const c=e.type_===1?+t:t,f=Kp(e.scope_,o,e,c);return e.copy_[c]=f}return o},has(e,t){return t in $r(e)},ownKeys(e){return Reflect.ownKeys($r(e))},set(e,t,n){const a=WA($r(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){const l=Hv($r(e),t),o=l?.[nn];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(xz(n,l)&&(n!==void 0||ej(e.base_,t,e.type_)))return!0;Nc(e),Hp(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Nz(e,t,n)),!0},deleteProperty(e,t){return Nc(e),Hv(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Hp(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=$r(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{[Ec]:!0,[Lp]:e.type_!==1||t!=="length",[Kc]:a[Kc],[oo]:n[t]}},defineProperty(){Jn(11)},getPrototypeOf(e){return Al(e.base_)},setPrototypeOf(){Jn(12)}},co={};for(let e in Xc){let t=Xc[e];co[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}co.deleteProperty=function(e,t){return co.set.call(this,e,t,void 0)};co.set=function(e,t,n){return Xc.set.call(this,e[0],t,n,e[0])};function Hv(e,t){const n=e[nn];return(n?$r(n):e)[t]}function Mz(e,t,n){const a=WA(t,n);return a?oo in a?a[oo]:a.get?.call(e.draft_):void 0}function WA(e,t){if(!(t in e))return;let n=Al(e);for(;n;){const a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=Al(n)}}function Hp(e){e.modified_||(e.modified_=!0,e.parent_&&Hp(e.parent_))}function Nc(e){e.copy_||(e.assigned_=new Map,e.copy_=Up(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Cz=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,a,l)=>{if(gl(n)&&!gl(a)){const c=a;a=n;const f=this;return function(h=c,...v){return f.produce(h,p=>a.call(this,p,...v))}}gl(a)||Jn(6),l!==void 0&&!gl(l)&&Jn(7);let o;if(rr(n)){const c=aj(this),f=Kp(c,n,void 0);let d=!0;try{o=a(f),d=!1}finally{d?Bp(c):Ip(c)}return rj(c,l),ij(o,c)}else if(!n||!J0(n)){if(o=a(n),o===void 0&&(o=n),o===YA&&(o=void 0),this.autoFreeze_&&ty(o,!0),l){const c=[],f=[];Si(qp).generateReplacementPatches_(n,o,{patches_:c,inversePatches_:f}),l(c,f)}return o}else Jn(1,n)},this.produceWithPatches=(n,a)=>{if(gl(n))return(f,...d)=>this.produceWithPatches(f,h=>n(h,...d));let l,o;return[this.produce(n,a,(f,d)=>{l=f,o=d}),l,o]},Iv(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Iv(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Iv(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){rr(t)||Jn(8),Gr(t)&&(t=nr(t));const n=aj(this),a=Kp(n,t,void 0);return a[nn].isManual_=!0,Ip(n),a}finishDraft(t,n){const a=t&&t[nn];(!a||!a.isManual_)&&Jn(9);const{scope_:l}=a;return rj(l,n),ij(void 0,l)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let a;for(a=n.length-1;a>=0;a--){const o=n[a];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}a>-1&&(n=n.slice(a+1));const l=Si(qp).applyPatches_;return Gr(t)?l(t,n):this.produce(t,o=>l(o,n))}};function Kp(e,t,n,a){const[l,o]=Lf(t)?Si(Gc).proxyMap_(t,n):$f(t)?Si(Gc).proxySet_(t,n):Tz(t,n);return(n?.scope_??XA()).drafts_.push(l),o.callbacks_=n?.callbacks_??[],o.key_=a,n&&a!==void 0?Ez(n,o,a):o.callbacks_.push(function(d){d.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:h}=d;o.modified_&&h&&h.generatePatches_(o,[],d)}),l}function nr(e){return Gr(e)||Jn(10,e),JA(e)}function JA(e){if(!rr(e)||Uf(e))return e;const t=e[nn];let n,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Up(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else n=Up(e,!0);return zf(n,(l,o)=>{Yc(n,l,JA(o))},a),t&&(t.finalized_=!1),n}var Dz=new Cz,eE=Dz.produce;function tE(e){return({dispatch:n,getState:a})=>l=>o=>typeof o=="function"?o(n,a,e):l(o)}var kz=tE(),Pz=tE,zz=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ic:Ic.apply(null,arguments)};function Vn(e,t){function n(...a){if(t){let l=t(...a);if(!l)throw new Error(Tn(0));return{type:e,payload:l.payload,..."meta"in l&&{meta:l.meta},..."error"in l&&{error:l.error}}}return{type:e,payload:a[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=a=>KA(a)&&a.type===e,n}var nE=class Ju extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ju.prototype)}static get[Symbol.species](){return Ju}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ju(...t[0].concat(this)):new Ju(...t.concat(this))}};function uj(e){return rr(e)?eE(e,()=>{}):e}function hc(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Rz(e){return typeof e=="boolean"}var Lz=()=>function(t){const{thunk:n=!0,immutableCheck:a=!0,serializableCheck:l=!0,actionCreatorCheck:o=!0}=t??{};let c=new nE;return n&&(Rz(n)?c.push(kz):c.push(Pz(n.extraArgument))),c},rE="RTK_autoBatch",rt=()=>e=>({payload:e,meta:{[rE]:!0}}),oj=e=>t=>{setTimeout(t,e)},aE=(e={type:"raf"})=>t=>(...n)=>{const a=t(...n);let l=!0,o=!1,c=!1;const f=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:oj(10):e.type==="callback"?e.queueNotification:oj(e.timeout),h=()=>{c=!1,o&&(o=!1,f.forEach(v=>v()))};return Object.assign({},a,{subscribe(v){const p=()=>l&&v(),b=a.subscribe(p);return f.add(v),()=>{b(),f.delete(v)}},dispatch(v){try{return l=!v?.meta?.[rE],o=!l,o&&(c||(c=!0,d(h))),a.dispatch(v)}finally{l=!0}}})},$z=e=>function(n){const{autoBatch:a=!0}=n??{};let l=new nE(e);return a&&l.push(aE(typeof a=="object"?a:void 0)),l};function Uz(e){const t=Lz(),{reducer:n=void 0,middleware:a,devTools:l=!0,preloadedState:o=void 0,enhancers:c=void 0}=e||{};let f;if(typeof n=="function")f=n;else if(W0(n))f=HA(n);else throw new Error(Tn(1));let d;typeof a=="function"?d=a(t):d=t();let h=Ic;l&&(h=zz({trace:!1,...typeof l=="object"&&l}));const v=gz(...d),p=$z(v);let b=typeof c=="function"?c(p):p();const x=h(...b);return IA(f,o,x)}function iE(e){const t={},n=[];let a;const l={addCase(o,c){const f=typeof o=="string"?o:o.type;if(!f)throw new Error(Tn(28));if(f in t)throw new Error(Tn(29));return t[f]=c,l},addAsyncThunk(o,c){return c.pending&&(t[o.pending.type]=c.pending),c.rejected&&(t[o.rejected.type]=c.rejected),c.fulfilled&&(t[o.fulfilled.type]=c.fulfilled),c.settled&&n.push({matcher:o.settled,reducer:c.settled}),l},addMatcher(o,c){return n.push({matcher:o,reducer:c}),l},addDefaultCase(o){return a=o,l}};return e(l),[t,n,a]}function qz(e){return typeof e=="function"}function Bz(e,t){let[n,a,l]=iE(t),o;if(qz(e))o=()=>uj(e());else{const f=uj(e);o=()=>f}function c(f=o(),d){let h=[n[d.type],...a.filter(({matcher:v})=>v(d)).map(({reducer:v})=>v)];return h.filter(v=>!!v).length===0&&(h=[l]),h.reduce((v,p)=>{if(p)if(Gr(v)){const x=p(v,d);return x===void 0?v:x}else{if(rr(v))return eE(v,b=>p(b,d));{const b=p(v,d);if(b===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}}return v},f)}return c.getInitialState=o,c}var Iz="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Hz=(e=21)=>{let t="",n=e;for(;n--;)t+=Iz[Math.random()*64|0];return t},Kz=Symbol.for("rtk-slice-createasyncthunk");function Yz(e,t){return`${e}/${t}`}function Gz({creators:e}={}){const t=e?.asyncThunk?.[Kz];return function(a){const{name:l,reducerPath:o=l}=a;if(!l)throw new Error(Tn(11));const c=(typeof a.reducers=="function"?a.reducers(Xz()):a.reducers)||{},f=Object.keys(c),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(M,P){const T=typeof M=="string"?M:M.type;if(!T)throw new Error(Tn(12));if(T in d.sliceCaseReducersByType)throw new Error(Tn(13));return d.sliceCaseReducersByType[T]=P,h},addMatcher(M,P){return d.sliceMatchers.push({matcher:M,reducer:P}),h},exposeAction(M,P){return d.actionCreators[M]=P,h},exposeCaseReducer(M,P){return d.sliceCaseReducersByName[M]=P,h}};f.forEach(M=>{const P=c[M],T={reducerName:M,type:Yz(l,M),createNotation:typeof a.reducers=="function"};Zz(P)?Wz(T,P,h,t):Fz(T,P,h)});function v(){const[M={},P=[],T=void 0]=typeof a.extraReducers=="function"?iE(a.extraReducers):[a.extraReducers],C={...M,...d.sliceCaseReducersByType};return Bz(a.initialState,L=>{for(let Z in C)L.addCase(Z,C[Z]);for(let Z of d.sliceMatchers)L.addMatcher(Z.matcher,Z.reducer);for(let Z of P)L.addMatcher(Z.matcher,Z.reducer);T&&L.addDefaultCase(T)})}const p=M=>M,b=new Map,x=new WeakMap;let O;function j(M,P){return O||(O=v()),O(M,P)}function _(){return O||(O=v()),O.getInitialState()}function E(M,P=!1){function T(L){let Z=L[M];return typeof Z>"u"&&P&&(Z=hc(x,T,_)),Z}function C(L=p){const Z=hc(b,P,()=>new WeakMap);return hc(Z,L,()=>{const ne={};for(const[q,U]of Object.entries(a.selectors??{}))ne[q]=Vz(U,L,()=>hc(x,L,_),P);return ne})}return{reducerPath:M,getSelectors:C,get selectors(){return C(T)},selectSlice:T}}const N={name:l,reducer:j,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:_,...E(o),injectInto(M,{reducerPath:P,...T}={}){const C=P??o;return M.inject({reducerPath:C,reducer:j},T),{...N,...E(C,!0)}}};return N}}function Vz(e,t,n,a){function l(o,...c){let f=t(o);return typeof f>"u"&&a&&(f=n()),e(f,...c)}return l.unwrapped=e,l}var hn=Gz();function Xz(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function Fz({type:e,reducerName:t,createNotation:n},a,l){let o,c;if("reducer"in a){if(n&&!Qz(a))throw new Error(Tn(17));o=a.reducer,c=a.prepare}else o=a;l.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,c?Vn(e,c):Vn(e))}function Zz(e){return e._reducerDefinitionType==="asyncThunk"}function Qz(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Wz({type:e,reducerName:t},n,a,l){if(!l)throw new Error(Tn(18));const{payloadCreator:o,fulfilled:c,pending:f,rejected:d,settled:h,options:v}=n,p=l(e,o,v);a.exposeAction(t,p),c&&a.addCase(p.fulfilled,c),f&&a.addCase(p.pending,f),d&&a.addCase(p.rejected,d),h&&a.addMatcher(p.settled,h),a.exposeCaseReducer(t,{fulfilled:c||mc,pending:f||mc,rejected:d||mc,settled:h||mc})}function mc(){}var Jz="task",lE="listener",uE="completed",ny="cancelled",e5=`task-${ny}`,t5=`task-${uE}`,Yp=`${lE}-${ny}`,n5=`${lE}-${uE}`,Bf=class{constructor(e){this.code=e,this.message=`${Jz} ${ny} (reason: ${e})`}name="TaskAbortError";message},ry=(e,t)=>{if(typeof e!="function")throw new TypeError(Tn(32))},Fc=()=>{},oE=(e,t=Fc)=>(e.catch(t),e),sE=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),pi=e=>{if(e.aborted)throw new Bf(e.reason)};function cE(e,t){let n=Fc;return new Promise((a,l)=>{const o=()=>l(new Bf(e.reason));if(e.aborted){o();return}n=sE(e,o),t.finally(()=>n()).then(a,l)}).finally(()=>{n=Fc})}var r5=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Bf?"cancelled":"rejected",error:n}}finally{t?.()}},Zc=e=>t=>oE(cE(e,t).then(n=>(pi(e),n))),fE=e=>{const t=Zc(e);return n=>t(new Promise(a=>setTimeout(a,n)))},{assign:jl}=Object,sj={},If="listenerMiddleware",a5=(e,t)=>{const n=a=>sE(e,()=>a.abort(e.reason));return(a,l)=>{ry(a);const o=new AbortController;n(o);const c=r5(async()=>{pi(e),pi(o.signal);const f=await a({pause:Zc(o.signal),delay:fE(o.signal),signal:o.signal});return pi(o.signal),f},()=>o.abort(t5));return l?.autoJoin&&t.push(c.catch(Fc)),{result:Zc(e)(c),cancel(){o.abort(e5)}}}},i5=(e,t)=>{const n=async(a,l)=>{pi(t);let o=()=>{};const f=[new Promise((d,h)=>{let v=e({predicate:a,effect:(p,b)=>{b.unsubscribe(),d([p,b.getState(),b.getOriginalState()])}});o=()=>{v(),h()}})];l!=null&&f.push(new Promise(d=>setTimeout(d,l,null)));try{const d=await cE(t,Promise.race(f));return pi(t),d}finally{o()}};return(a,l)=>oE(n(a,l))},dE=e=>{let{type:t,actionCreator:n,matcher:a,predicate:l,effect:o}=e;if(t)l=Vn(t).match;else if(n)t=n.type,l=n.match;else if(a)l=a;else if(!l)throw new Error(Tn(21));return ry(o),{predicate:l,type:t,effect:o}},hE=jl(e=>{const{type:t,predicate:n,effect:a}=dE(e);return{id:Hz(),effect:a,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Tn(22))}}},{withTypes:()=>hE}),cj=(e,t)=>{const{type:n,effect:a,predicate:l}=dE(t);return Array.from(e.values()).find(o=>(typeof n=="string"?o.type===n:o.predicate===l)&&o.effect===a)},Gp=e=>{e.pending.forEach(t=>{t.abort(Yp)})},l5=(e,t)=>()=>{for(const n of t.keys())Gp(n);e.clear()},fj=(e,t,n)=>{try{e(t,n)}catch(a){setTimeout(()=>{throw a},0)}},mE=jl(Vn(`${If}/add`),{withTypes:()=>mE}),u5=Vn(`${If}/removeAll`),vE=jl(Vn(`${If}/remove`),{withTypes:()=>vE}),o5=(...e)=>{console.error(`${If}/error`,...e)},Eo=(e={})=>{const t=new Map,n=new Map,a=x=>{const O=n.get(x)??0;n.set(x,O+1)},l=x=>{const O=n.get(x)??1;O===1?n.delete(x):n.set(x,O-1)},{extra:o,onError:c=o5}=e;ry(c);const f=x=>(x.unsubscribe=()=>t.delete(x.id),t.set(x.id,x),O=>{x.unsubscribe(),O?.cancelActive&&Gp(x)}),d=x=>{const O=cj(t,x)??hE(x);return f(O)};jl(d,{withTypes:()=>d});const h=x=>{const O=cj(t,x);return O&&(O.unsubscribe(),x.cancelActive&&Gp(O)),!!O};jl(h,{withTypes:()=>h});const v=async(x,O,j,_)=>{const E=new AbortController,N=i5(d,E.signal),M=[];try{x.pending.add(E),a(x),await Promise.resolve(x.effect(O,jl({},j,{getOriginalState:_,condition:(P,T)=>N(P,T).then(Boolean),take:N,delay:fE(E.signal),pause:Zc(E.signal),extra:o,signal:E.signal,fork:a5(E.signal,M),unsubscribe:x.unsubscribe,subscribe:()=>{t.set(x.id,x)},cancelActiveListeners:()=>{x.pending.forEach((P,T,C)=>{P!==E&&(P.abort(Yp),C.delete(P))})},cancel:()=>{E.abort(Yp),x.pending.delete(E)},throwIfCancelled:()=>{pi(E.signal)}})))}catch(P){P instanceof Bf||fj(c,P,{raisedBy:"effect"})}finally{await Promise.all(M),E.abort(n5),l(x),x.pending.delete(E)}},p=l5(t,n);return{middleware:x=>O=>j=>{if(!KA(j))return O(j);if(mE.match(j))return d(j.payload);if(u5.match(j)){p();return}if(vE.match(j))return h(j.payload);let _=x.getState();const E=()=>{if(_===sj)throw new Error(Tn(23));return _};let N;try{if(N=O(j),t.size>0){const M=x.getState(),P=Array.from(t.values());for(const T of P){let C=!1;try{C=T.predicate(j,M,_)}catch(L){C=!1,fj(c,L,{raisedBy:"predicate"})}C&&v(T,j,x,E)}}}finally{_=sj}return N},startListening:d,stopListening:h,clearListeners:p}};function Tn(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 s5={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},pE=hn({name:"chartLayout",initialState:s5,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 n,a,l,o;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(a=t.payload.right)!==null&&a!==void 0?a:0,e.margin.bottom=(l=t.payload.bottom)!==null&&l!==void 0?l:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:c5,setLayout:f5,setChartSize:d5,setScale:h5}=pE.actions,m5=pE.reducer;function yE(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function wt(e){return Number.isFinite(e)}function yr(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function dj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function bl(e){for(var t=1;t{if(t&&n){var{width:a,height:l}=n,{align:o,verticalAlign:c,layout:f}=t;if((f==="vertical"||f==="horizontal"&&c==="middle")&&o!=="center"&&me(e[o]))return bl(bl({},e),{},{[o]:e[o]+(a||0)});if((f==="horizontal"||f==="vertical"&&o==="center")&&c!=="middle"&&me(e[c]))return bl(bl({},e),{},{[c]:e[c]+(l||0)})}return e},Ua=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",gE=(e,t,n,a)=>{if(a)return e.map(f=>f.coordinate);var l,o,c=e.map(f=>(f.coordinate===t&&(l=!0),f.coordinate===n&&(o=!0),f.coordinate));return l||c.push(t),o||c.push(n),c},bE=(e,t,n)=>{if(!e)return null;var{duplicateDomain:a,type:l,range:o,scale:c,realScaleType:f,isCategorical:d,categoricalDomain:h,tickCount:v,ticks:p,niceTicks:b,axisType:x}=e;if(!c)return null;var O=f==="scaleBand"&&c.bandwidth?c.bandwidth()/2:2,j=l==="category"&&c.bandwidth?c.bandwidth()/O:0;if(j=x==="angleAxis"&&o&&o.length>=2?Wt(o[0]-o[1])*2*j:j,p||b){var _=(p||b||[]).map((E,N)=>{var M=a?a.indexOf(E):E;return{coordinate:c(M)+j,value:E,offset:j,index:N}});return _.filter(E=>!vr(E.coordinate))}return d&&h?h.map((E,N)=>({coordinate:c(E)+j,value:E,index:N,offset:j})):c.ticks&&v!=null?c.ticks(v).map((E,N)=>({coordinate:c(E)+j,value:E,offset:j,index:N})):c.domain().map((E,N)=>({coordinate:c(E)+j,value:a?a[E]:E,index:N,offset:j}))},hj=1e-4,b5=e=>{var t=e.domain();if(!(!t||t.length<=2)){var n=t.length,a=e.range(),l=Math.min(a[0],a[1])-hj,o=Math.max(a[0],a[1])+hj,c=e(t[0]),f=e(t[n-1]);(co||fo)&&e.domain([t[0],t[n-1]])}},x5=e=>{var t,n=e.length;if(!(n<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var l=0;l=0?(h[0]=o,h[1]=o+b,o=v):(h[0]=c,h[1]=c+b,c=v)}}}},S5=e=>{var t,n=e.length;if(!(n<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var l=0;l=0?(d[0]=o,d[1]=o+h,o=d[1]):(d[0]=0,d[1]=0)}}}},w5={sign:x5,expand:Bk,none:bi,silhouette:Ik,wiggle:Hk,positive:S5},j5=(e,t,n)=>{var a,l=(a=w5[n])!==null&&a!==void 0?a:bi,o=qk().keys(t).value((f,d)=>Number(tt(f,d,0))).order(zp).offset(l),c=o(e);return c.forEach((f,d)=>{f.forEach((h,v)=>{var p=tt(e[v],t[d],0);Array.isArray(p)&&p.length===2&&me(p[0])&&me(p[1])&&(h[0]=p[0],h[1]=p[1])})}),c};function mj(e){var{axis:t,ticks:n,bandSize:a,entry:l,index:o,dataKey:c}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!_t(l[t.dataKey])){var f=_A(n,"value",l[t.dataKey]);if(f)return f.coordinate+a/2}return n[o]?n[o].coordinate+a/2:null}var d=tt(l,_t(c)?t.dataKey:c);return _t(d)?null:t.scale(d)}var O5=e=>{var t=e.flat(2).filter(me);return[Math.min(...t),Math.max(...t)]},_5=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],A5=(e,t,n)=>{if(e!=null)return _5(Object.keys(e).reduce((a,l)=>{var o=e[l];if(!o)return a;var{stackedData:c}=o,f=c.reduce((d,h)=>{var v=yE(h,t,n),p=O5(v);return!wt(p[0])||!wt(p[1])?d:[Math.min(d[0],p[0]),Math.max(d[1],p[1])]},[1/0,-1/0]);return[Math.min(f[0],a[0]),Math.max(f[1],a[1])]},[1/0,-1/0]))},vj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,pj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Qc=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var a=e.scale.bandwidth();if(!n||a>0)return a}if(e&&t&&t.length>=2){for(var l=kf(t,v=>v.coordinate),o=1/0,c=1,f=l.length;c{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},N5=(e,t)=>t==="centric"?e.angle:e.radius,Wr=e=>e.layout.width,Jr=e=>e.layout.height,T5=e=>e.layout.scale,xE=e=>e.layout.margin,Kf=V(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Yf=V(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),SE="data-recharts-item-index",wE="data-recharts-item-id",No=60;function gj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function vc(e){for(var t=1;te.brush.height;function P5(e){var t=Yf(e);return t.reduce((n,a)=>{if(a.orientation==="left"&&!a.mirror&&!a.hide){var l=typeof a.width=="number"?a.width:No;return n+l}return n},0)}function z5(e){var t=Yf(e);return t.reduce((n,a)=>{if(a.orientation==="right"&&!a.mirror&&!a.hide){var l=typeof a.width=="number"?a.width:No;return n+l}return n},0)}function R5(e){var t=Kf(e);return t.reduce((n,a)=>a.orientation==="top"&&!a.mirror&&!a.hide?n+a.height:n,0)}function L5(e){var t=Kf(e);return t.reduce((n,a)=>a.orientation==="bottom"&&!a.mirror&&!a.hide?n+a.height:n,0)}var zt=V([Wr,Jr,xE,k5,P5,z5,R5,L5,qA,fz],(e,t,n,a,l,o,c,f,d,h)=>{var v={left:(n.left||0)+l,right:(n.right||0)+o},p={top:(n.top||0)+c,bottom:(n.bottom||0)+f},b=vc(vc({},p),v),x=b.bottom;b.bottom+=a,b=g5(b,d,h);var O=e-b.left-b.right,j=t-b.top-b.bottom;return vc(vc({brushBottom:x},b),{},{width:Math.max(O,0),height:Math.max(j,0)})}),$5=V(zt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),jE=V(Wr,Jr,(e,t)=>({x:0,y:0,width:e,height:t})),U5=S.createContext(null),mn=()=>S.useContext(U5)!=null,Gf=e=>e.brush,Vf=V([Gf,zt,xE],(e,t,n)=>({height:e.height,x:me(e.x)?e.x:t.left,y:me(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:me(e.width)?e.width:t.width})),Kv={},Yv={},Gv={},bj;function q5(){return bj||(bj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a,{signal:l,edges:o}={}){let c,f=null;const d=o!=null&&o.includes("leading"),h=o==null||o.includes("trailing"),v=()=>{f!==null&&(n.apply(c,f),c=void 0,f=null)},p=()=>{h&&v(),j()};let b=null;const x=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,p()},a)},O=()=>{b!==null&&(clearTimeout(b),b=null)},j=()=>{O(),c=void 0,f=null},_=()=>{v()},E=function(...N){if(l?.aborted)return;c=this,f=N;const M=b==null;x(),d&&M&&v()};return E.schedule=x,E.cancel=j,E.flush=_,l?.addEventListener("abort",j,{once:!0}),E}e.debounce=t})(Gv)),Gv}var xj;function B5(){return xj||(xj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=q5();function n(a,l=0,o={}){typeof o!="object"&&(o={});const{leading:c=!1,trailing:f=!0,maxWait:d}=o,h=Array(2);c&&(h[0]="leading"),f&&(h[1]="trailing");let v,p=null;const b=t.debounce(function(...j){v=a.apply(this,j),p=null},l,{edges:h}),x=function(...j){return d!=null&&(p===null&&(p=Date.now()),Date.now()-p>=d)?(v=a.apply(this,j),p=Date.now(),b.cancel(),b.schedule(),v):(b.apply(this,j),v)},O=()=>(b.flush(),v);return x.cancel=b.cancel,x.flush=O,x}e.debounce=n})(Yv)),Yv}var Sj;function I5(){return Sj||(Sj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=B5();function n(a,l=0,o={}){const{leading:c=!0,trailing:f=!0}=o;return t.debounce(a,l,{leading:c,maxWait:l,trailing:f})}e.throttle=n})(Kv)),Kv}var Vv,wj;function H5(){return wj||(wj=1,Vv=I5().throttle),Vv}var K5=H5();const Y5=Qr(K5);var Wc=function(t,n){for(var a=arguments.length,l=new Array(a>2?a-2:0),o=2;ol[c++]))}},OE=(e,t,n)=>{var{width:a="100%",height:l="100%",aspect:o,maxHeight:c}=n,f=Yr(a)?e:Number(a),d=Yr(l)?t:Number(l);return o&&o>0&&(f?d=f/o:d&&(f=d*o),c&&d!=null&&d>c&&(d=c)),{calculatedWidth:f,calculatedHeight:d}},G5={width:0,height:0,overflow:"visible"},V5={width:0,overflowX:"visible"},X5={height:0,overflowY:"visible"},F5={},Z5=e=>{var{width:t,height:n}=e,a=Yr(t),l=Yr(n);return a&&l?G5:a?V5:l?X5:F5};function Q5(e){var{width:t,height:n,aspect:a}=e,l=t,o=n;return l===void 0&&o===void 0?(l="100%",o="100%"):l===void 0?l=a&&a>0?void 0:"100%":o===void 0&&(o=a&&a>0?void 0:"100%"),{width:l,height:o}}function Vp(){return Vp=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:n,height:a}),[n,a]);return tR(l)?S.createElement(_E.Provider,{value:l},t):null}var ay=()=>S.useContext(_E),nR=S.forwardRef((e,t)=>{var{aspect:n,initialDimension:a={width:-1,height:-1},width:l,height:o,minWidth:c=0,minHeight:f,maxHeight:d,children:h,debounce:v=0,id:p,className:b,onResize:x,style:O={}}=e,j=S.useRef(null),_=S.useRef();_.current=x,S.useImperativeHandle(t,()=>j.current);var[E,N]=S.useState({containerWidth:a.width,containerHeight:a.height}),M=S.useCallback((Z,ne)=>{N(q=>{var U=Math.round(Z),B=Math.round(ne);return q.containerWidth===U&&q.containerHeight===B?q:{containerWidth:U,containerHeight:B}})},[]);S.useEffect(()=>{if(j.current==null||typeof ResizeObserver>"u")return _o;var Z=B=>{var ue,{width:oe,height:ve}=B[0].contentRect;M(oe,ve),(ue=_.current)===null||ue===void 0||ue.call(_,oe,ve)};v>0&&(Z=Y5(Z,v,{trailing:!0,leading:!1}));var ne=new ResizeObserver(Z),{width:q,height:U}=j.current.getBoundingClientRect();return M(q,U),ne.observe(j.current),()=>{ne.disconnect()}},[M,v]);var{containerWidth:P,containerHeight:T}=E;Wc(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:C,calculatedHeight:L}=OE(P,T,{width:l,height:o,aspect:n,maxHeight:d});return Wc(C!=null&&C>0||L!=null&&L>0,`The width(%s) and height(%s) of chart should be greater than 0, + A`).concat(o,",").concat(o,",0,1,1,").concat(c,",").concat(l),className:"recharts-legend-icon"});if(d==="rect")return S.createElement("path",{stroke:"none",fill:f,d:"M0,".concat(Kn/8,"h").concat(Kn,"v").concat(Kn*3/4,"h").concat(-Kn,"z"),className:"recharts-legend-icon"});if(S.isValidElement(t.legendIcon)){var v=dP({},t);return delete v.legendIcon,S.cloneElement(t.legendIcon,v)}return S.createElement(G0,{fill:f,cx:l,cy:l,size:Kn,sizeType:"diameter",type:d})}function gP(e){var{payload:t,iconSize:n,layout:a,formatter:l,inactiveColor:o,iconType:c}=e,f={x:0,y:0,width:Kn,height:Kn},d={display:a==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((v,p)=>{var b=v.formatter||l,x=Re({"recharts-legend-item":!0,["legend-item-".concat(p)]:!0,inactive:v.inactive});if(v.type==="none")return null;var O=v.inactive?o:v.color,j=b?b(v.value,v,p):v.value;return S.createElement("li",qc({className:x,style:d,key:"legend-item-".concat(p)},X0(e,v,p)),S.createElement($0,{width:n,height:n,viewBox:f,style:h,"aria-label":"".concat(j," legend icon")},S.createElement(yP,{data:v,iconType:c,inactiveColor:o})),S.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},j))})}var bP=e=>{var t=At(e,pP),{payload:n,layout:a,align:l}=t;if(!n||!n.length)return null;var o={padding:0,margin:0,textAlign:a==="horizontal"?l:"left"};return S.createElement("ul",{className:"recharts-default-legend",style:o},S.createElement(gP,qc({},t,{payload:n})))},ev={},tv={},uw;function xP(){return uw||(uw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a){const l=new Map;for(let o=0;o=0}e.isLength=t})(lv)),lv}var fw;function F0(){return fw||(fw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wP();function n(a){return a!=null&&typeof a!="function"&&t.isLength(a.length)}e.isArrayLike=n})(iv)),iv}var uv={},dw;function jP(){return dw||(dw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(uv)),uv}var hw;function OP(){return hw||(hw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F0(),n=jP();function a(l){return n.isObjectLike(l)&&t.isArrayLike(l)}e.isArrayLikeObject=a})(av)),av}var ov={},sv={},mw;function _P(){return mw||(mw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Y0();function n(a){return function(l){return t.get(l,a)}}e.property=n})(sv)),sv}var cv={},fv={},dv={},hv={},vw;function TA(){return vw||(vw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(hv)),hv}var mv={},pw;function MA(){return pw||(pw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(mv)),mv}var vv={},yw;function CA(){return yw||(yw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a){return n===a||Number.isNaN(n)&&Number.isNaN(a)}e.isEqualsSameValueZero=t})(vv)),vv}var gw;function AP(){return gw||(gw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=TA(),n=MA(),a=CA();function l(v,p,b){return typeof b!="function"?l(v,p,()=>{}):o(v,p,function x(O,j,_,E,N,M){const P=b(O,j,_,E,N,M);return P!==void 0?!!P:o(O,j,x,M)},new Map)}function o(v,p,b,x){if(p===v)return!0;switch(typeof p){case"object":return c(v,p,b,x);case"function":return Object.keys(p).length>0?o(v,{...p},b,x):a.isEqualsSameValueZero(v,p);default:return t.isObject(v)?typeof p=="string"?p==="":!0:a.isEqualsSameValueZero(v,p)}}function c(v,p,b,x){if(p==null)return!0;if(Array.isArray(p))return d(v,p,b,x);if(p instanceof Map)return f(v,p,b,x);if(p instanceof Set)return h(v,p,b,x);const O=Object.keys(p);if(v==null||n.isPrimitive(v))return O.length===0;if(O.length===0)return!0;if(x?.has(p))return x.get(p)===v;x?.set(p,v);try{for(let j=0;j{})}e.isMatch=n})(fv)),fv}var pv={},yv={},gv={},xw;function EP(){return xw||(xw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(a=>Object.prototype.propertyIsEnumerable.call(n,a))}e.getSymbols=t})(gv)),gv}var bv={},Sw;function Z0(){return Sw||(Sw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(bv)),bv}var xv={},ww;function kA(){return ww||(ww=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",a="[object Number]",l="[object Boolean]",o="[object Arguments]",c="[object Symbol]",f="[object Date]",d="[object Map]",h="[object Set]",v="[object Array]",p="[object Function]",b="[object ArrayBuffer]",x="[object Object]",O="[object Error]",j="[object DataView]",_="[object Uint8Array]",E="[object Uint8ClampedArray]",N="[object Uint16Array]",M="[object Uint32Array]",P="[object BigUint64Array]",T="[object Int8Array]",C="[object Int16Array]",R="[object Int32Array]",F="[object BigInt64Array]",ee="[object Float32Array]",q="[object Float64Array]";e.argumentsTag=o,e.arrayBufferTag=b,e.arrayTag=v,e.bigInt64ArrayTag=F,e.bigUint64ArrayTag=P,e.booleanTag=l,e.dataViewTag=j,e.dateTag=f,e.errorTag=O,e.float32ArrayTag=ee,e.float64ArrayTag=q,e.functionTag=p,e.int16ArrayTag=C,e.int32ArrayTag=R,e.int8ArrayTag=T,e.mapTag=d,e.numberTag=a,e.objectTag=x,e.regexpTag=t,e.setTag=h,e.stringTag=n,e.symbolTag=c,e.uint16ArrayTag=N,e.uint32ArrayTag=M,e.uint8ArrayTag=_,e.uint8ClampedArrayTag=E})(xv)),xv}var Sv={},jw;function NP(){return jw||(jw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Sv)),Sv}var Ow;function PA(){return Ow||(Ow=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=EP(),n=Z0(),a=kA(),l=MA(),o=NP();function c(v,p){return f(v,void 0,v,new Map,p)}function f(v,p,b,x=new Map,O=void 0){const j=O?.(v,p,b,x);if(j!==void 0)return j;if(l.isPrimitive(v))return v;if(x.has(v))return x.get(v);if(Array.isArray(v)){const _=new Array(v.length);x.set(v,_);for(let E=0;Et.isMatch(o,l)}e.matches=a})(cv)),cv}var wv={},jv={},Ov={},Ew;function CP(){return Ew||(Ew=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=PA(),n=Z0(),a=kA();function l(o,c){return t.cloneDeepWith(o,(f,d,h,v)=>{const p=c?.(f,d,h,v);if(p!==void 0)return p;if(typeof o=="object"){if(n.getTag(o)===a.objectTag&&typeof o.constructor!="function"){const b={};return v.set(o,b),t.copyProperties(b,o,h,v),b}switch(Object.prototype.toString.call(o)){case a.numberTag:case a.stringTag:case a.booleanTag:{const b=new o.constructor(o?.valueOf());return t.copyProperties(b,o),b}case a.argumentsTag:{const b={};return t.copyProperties(b,o),b.length=o.length,b[Symbol.iterator]=o[Symbol.iterator],b}default:return}}})}e.cloneDeepWith=l})(Ov)),Ov}var Nw;function DP(){return Nw||(Nw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CP();function n(a){return t.cloneDeepWith(a)}e.cloneDeep=n})(jv)),jv}var _v={},Av={},Tw;function zA(){return Tw||(Tw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(a,l=Number.MAX_SAFE_INTEGER){switch(typeof a){case"number":return Number.isInteger(a)&&a>=0&&a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return Dv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Dv}var $w;function BP(){return $w||($w=1,Cv.exports=qP()),Cv.exports}var Uw;function IP(){if(Uw)return Mv;Uw=1;var e=kl(),t=BP();function n(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var a=typeof Object.is=="function"?Object.is:n,l=t.useSyncExternalStore,o=e.useRef,c=e.useEffect,f=e.useMemo,d=e.useDebugValue;return Mv.useSyncExternalStoreWithSelector=function(h,v,p,b,x){var O=o(null);if(O.current===null){var j={hasValue:!1,value:null};O.current=j}else j=O.current;O=f(function(){function E(C){if(!N){if(N=!0,M=C,C=b(C),x!==void 0&&j.hasValue){var R=j.value;if(x(R,C))return P=R}return P=C}if(R=P,a(M,C))return R;var F=b(C);return x!==void 0&&x(R,F)?(M=C,R):(M=C,P=F)}var N=!1,M,P,T=p===void 0?null:p;return[function(){return E(v())},T===null?void 0:function(){return E(T())}]},[v,p,b,x]);var _=l(h,O[0],O[1]);return c(function(){j.hasValue=!0,j.value=_},[_]),d(_),_},Mv}var qw;function HP(){return qw||(qw=1,Tv.exports=IP()),Tv.exports}var KP=HP(),Q0=S.createContext(null),YP=e=>e,Qe=()=>{var e=S.useContext(Q0);return e?e.store.dispatch:YP},Ac=()=>{},GP=()=>Ac,VP=(e,t)=>e===t;function de(e){var t=S.useContext(Q0);return KP.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:GP,t?t.store.getState:Ac,t?t.store.getState:Ac,t?e:Ac,VP)}function XP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function FP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function ZP(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(a=>typeof a=="function"?`function ${a.name||"unnamed"}()`:typeof a).join(", ");throw new TypeError(`${t}[${n}]`)}}var Bw=e=>Array.isArray(e)?e:[e];function QP(e){const t=Array.isArray(e[0])?e[0]:e;return ZP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function WP(e,t){const n=[],{length:a}=e;for(let l=0;l{n=cc(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}function nz(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,a=(...l)=>{let o=0,c=0,f,d={},h=l.pop();typeof h=="object"&&(d=h,h=l.pop()),XP(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const v={...n,...d},{memoize:p,memoizeOptions:b=[],argsMemoize:x=LA,argsMemoizeOptions:O=[]}=v,j=Bw(b),_=Bw(O),E=QP(l),N=p(function(){return o++,h.apply(null,arguments)},...j),M=x(function(){c++;const T=WP(E,arguments);return f=N.apply(null,T),f},..._);return Object.assign(M,{resultFunc:h,memoizedResultFunc:N,dependencies:E,dependencyRecomputations:()=>c,resetDependencyRecomputations:()=>{c=0},lastResult:()=>f,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:p,argsMemoize:x})};return Object.assign(a,{withTypes:()=>a}),a}var V=nz(LA),rz=Object.assign((e,t=V)=>{FP(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),a=n.map(o=>e[o]);return t(a,(...o)=>o.reduce((c,f,d)=>(c[n[d]]=f,c),{}))},{withTypes:()=>rz}),kv={},Pv={},zv={},Hw;function az(){return Hw||(Hw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(a){return typeof a=="symbol"?1:a===null?2:a===void 0?3:a!==a?4:0}const n=(a,l,o)=>{if(a!==l){const c=t(a),f=t(l);if(c===f&&c===0){if(al)return o==="desc"?-1:1}return o==="desc"?f-c:c-f}return 0};e.compareValues=n})(zv)),zv}var Rv={},Lv={},Kw;function $A(){return Kw||(Kw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(Lv)),Lv}var Yw;function iz(){return Yw||(Yw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$A(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function l(o,c){return Array.isArray(o)?!1:typeof o=="number"||typeof o=="boolean"||o==null||t.isSymbol(o)?!0:typeof o=="string"&&(a.test(o)||!n.test(o))||c!=null&&Object.hasOwn(c,o)}e.isKey=l})(Rv)),Rv}var Gw;function lz(){return Gw||(Gw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=az(),n=iz(),a=K0();function l(o,c,f,d){if(o==null)return[];f=d?void 0:f,Array.isArray(o)||(o=Object.values(o)),Array.isArray(c)||(c=c==null?[null]:[c]),c.length===0&&(c=[null]),Array.isArray(f)||(f=f==null?[]:[f]),f=f.map(x=>String(x));const h=(x,O)=>{let j=x;for(let _=0;_O==null||x==null?O:typeof x=="object"&&"key"in x?Object.hasOwn(O,x.key)?O[x.key]:h(O,x.path):typeof x=="function"?x(O):Array.isArray(x)?h(O,x):typeof O=="object"?O[x]:O,p=c.map(x=>(Array.isArray(x)&&x.length===1&&(x=x[0]),x==null||typeof x=="function"||Array.isArray(x)||n.isKey(x)?x:{key:x,path:a.toPath(x)}));return o.map(x=>({original:x,criteria:p.map(O=>v(O,x))})).slice().sort((x,O)=>{for(let j=0;jx.original)}e.orderBy=l})(Pv)),Pv}var $v={},Vw;function uz(){return Vw||(Vw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a=1){const l=[],o=Math.floor(a),c=(f,d)=>{for(let h=0;h1&&a.isIterateeCall(o,c[0],c[1])?c=[]:f>2&&a.isIterateeCall(c[0],c[1],c[2])&&(c=[c[0]]),t.orderBy(o,n.flatten(c),["asc"])}e.sortBy=l})(kv)),kv}var qv,Zw;function sz(){return Zw||(Zw=1,qv=oz().sortBy),qv}var cz=sz();const kf=Qr(cz);var qA=e=>e.legend.settings,fz=e=>e.legend.size,dz=e=>e.legend.payload,hz=V([dz,qA],(e,t)=>{var{itemSorter:n}=t,a=e.flat(1);return n?kf(a,n):a});function mz(){return de(hz)}var fc=1;function BA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=S.useState({height:0,left:0,top:0,width:0}),a=S.useCallback(l=>{if(l!=null){var o=l.getBoundingClientRect(),c={height:o.height,left:o.left,top:o.top,width:o.width};(Math.abs(c.height-t.height)>fc||Math.abs(c.left-t.left)>fc||Math.abs(c.top-t.top)>fc||Math.abs(c.width-t.width)>fc)&&n({height:c.height,left:c.left,top:c.top,width:c.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,a]}function Yt(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 vz=typeof Symbol=="function"&&Symbol.observable||"@@observable",Qw=vz,Bv=()=>Math.random().toString(36).substring(7).split("").join("."),pz={INIT:`@@redux/INIT${Bv()}`,REPLACE:`@@redux/REPLACE${Bv()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bv()}`},Bc=pz;function W0(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 IA(e,t,n){if(typeof e!="function")throw new Error(Yt(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Yt(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Yt(1));return n(IA)(e,t)}let a=e,l=t,o=new Map,c=o,f=0,d=!1;function h(){c===o&&(c=new Map,o.forEach((_,E)=>{c.set(E,_)}))}function v(){if(d)throw new Error(Yt(3));return l}function p(_){if(typeof _!="function")throw new Error(Yt(4));if(d)throw new Error(Yt(5));let E=!0;h();const N=f++;return c.set(N,_),function(){if(E){if(d)throw new Error(Yt(6));E=!1,h(),c.delete(N),o=null}}}function b(_){if(!W0(_))throw new Error(Yt(7));if(typeof _.type>"u")throw new Error(Yt(8));if(typeof _.type!="string")throw new Error(Yt(17));if(d)throw new Error(Yt(9));try{d=!0,l=a(l,_)}finally{d=!1}return(o=c).forEach(N=>{N()}),_}function x(_){if(typeof _!="function")throw new Error(Yt(10));a=_,b({type:Bc.REPLACE})}function O(){const _=p;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(Yt(11));function N(){const P=E;P.next&&P.next(v())}return N(),{unsubscribe:_(N)}},[Qw](){return this}}}return b({type:Bc.INIT}),{dispatch:b,subscribe:p,getState:v,replaceReducer:x,[Qw]:O}}function yz(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Bc.INIT})>"u")throw new Error(Yt(12));if(typeof n(void 0,{type:Bc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Yt(13))})}function HA(e){const t=Object.keys(e),n={};for(let o=0;o"u")throw f&&f.type,new Error(Yt(14));h[p]=O,d=d||O!==x}return d=d||a.length!==Object.keys(c).length,d?h:c}}function Ic(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...a)=>t(n(...a)))}function gz(...e){return t=>(n,a)=>{const l=t(n,a);let o=()=>{throw new Error(Yt(15))};const c={getState:l.getState,dispatch:(d,...h)=>o(d,...h)},f=e.map(d=>d(c));return o=Ic(...f)(l.dispatch),{...l,dispatch:o}}}function KA(e){return W0(e)&&"type"in e&&typeof e.type=="string"}var YA=Symbol.for("immer-nothing"),Ww=Symbol.for("immer-draftable"),nn=Symbol.for("immer-state");function Jn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var En=Object,Al=En.getPrototypeOf,Hc="constructor",Pf="prototype",Lp="configurable",Kc="enumerable",Ec="writable",oo="value",Gr=e=>!!e&&!!e[nn];function rr(e){return e?GA(e)||Rf(e)||!!e[Ww]||!!e[Hc]?.[Ww]||Lf(e)||$f(e):!1}var bz=En[Pf][Hc].toString(),Jw=new WeakMap;function GA(e){if(!e||!J0(e))return!1;const t=Al(e);if(t===null||t===En[Pf])return!0;const n=En.hasOwnProperty.call(t,Hc)&&t[Hc];if(n===Object)return!0;if(!gl(n))return!1;let a=Jw.get(n);return a===void 0&&(a=Function.toString.call(n),Jw.set(n,a)),a===bz}function zf(e,t,n=!0){Ao(e)===0?(n?Reflect.ownKeys(e):En.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((a,l)=>t(l,a,e))}function Ao(e){const t=e[nn];return t?t.type_:Rf(e)?1:Lf(e)?2:$f(e)?3:0}var ej=(e,t,n=Ao(e))=>n===2?e.has(t):En[Pf].hasOwnProperty.call(e,t),$p=(e,t,n=Ao(e))=>n===2?e.get(t):e[t],Yc=(e,t,n,a=Ao(e))=>{a===2?e.set(t,n):a===3?e.add(n):e[t]=n};function xz(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Rf=Array.isArray,Lf=e=>e instanceof Map,$f=e=>e instanceof Set,J0=e=>typeof e=="object",gl=e=>typeof e=="function",Iv=e=>typeof e=="boolean";function Sz(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var $r=e=>e.copy_||e.base_,ey=e=>e.modified_?e.copy_:e.base_;function Up(e,t){if(Lf(e))return new Map(e);if($f(e))return new Set(e);if(Rf(e))return Array[Pf].slice.call(e);const n=GA(e);if(t===!0||t==="class_only"&&!n){const a=En.getOwnPropertyDescriptors(e);delete a[nn];let l=Reflect.ownKeys(a);for(let o=0;o1&&En.defineProperties(e,{set:dc,add:dc,clear:dc,delete:dc}),En.freeze(e),t&&zf(e,(n,a)=>{ty(a,!0)},!1)),e}function wz(){Jn(2)}var dc={[oo]:wz};function Uf(e){return e===null||!J0(e)?!0:En.isFrozen(e)}var Gc="MapSet",qp="Patches",tj="ArrayMethods",VA={};function Si(e){const t=VA[e];return t||Jn(0,e),t}var nj=e=>!!VA[e],so,XA=()=>so,jz=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:nj(Gc)?Si(Gc):void 0,arrayMethodsPlugin_:nj(tj)?Si(tj):void 0});function rj(e,t){t&&(e.patchPlugin_=Si(qp),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bp(e){Ip(e),e.drafts_.forEach(Oz),e.drafts_=null}function Ip(e){e===so&&(so=e.parent_)}var aj=e=>so=jz(so,e);function Oz(e){const t=e[nn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ij(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[nn].modified_&&(Bp(t),Jn(4)),rr(e)&&(e=lj(t,e));const{patchPlugin_:l}=t;l&&l.generateReplacementPatches_(n[nn].base_,e,t)}else e=lj(t,n);return _z(t,e,!0),Bp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==YA?e:void 0}function lj(e,t){if(Uf(t))return t;const n=t[nn];if(!n)return Vc(t,e.handledSet_,e);if(!qf(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:a}=n;if(a)for(;a.length>0;)a.pop()(e);QA(n,e)}return n.copy_}function _z(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ty(t,n)}function FA(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var qf=(e,t)=>e.scope_===t,Az=[];function ZA(e,t,n,a){const l=$r(e),o=e.type_;if(a!==void 0&&$p(l,a,o)===t){Yc(l,a,n,o);return}if(!e.draftLocations_){const f=e.draftLocations_=new Map;zf(l,(d,h)=>{if(Gr(h)){const v=f.get(h)||[];v.push(d),f.set(h,v)}})}const c=e.draftLocations_.get(t)??Az;for(const f of c)Yc(l,f,n,o)}function Ez(e,t,n){e.callbacks_.push(function(l){const o=t;if(!o||!qf(o,l))return;l.mapSetPlugin_?.fixSetContents(o);const c=ey(o);ZA(e,o.draft_??o,c,n),QA(o,l)})}function QA(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:a}=t;if(a){const l=a.getPath(e);l&&a.generatePatches_(e,l,t)}FA(e)}}function Nz(e,t,n){const{scope_:a}=e;if(Gr(n)){const l=n[nn];qf(l,a)&&l.callbacks_.push(function(){Nc(e);const c=ey(l);ZA(e,n,c,t)})}else rr(n)&&e.callbacks_.push(function(){const o=$r(e);e.type_===3?o.has(n)&&Vc(n,a.handledSet_,a):$p(o,t,e.type_)===n&&a.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Vc($p(e.copy_,t,e.type_),a.handledSet_,a)})}function Vc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Gr(e)||t.has(e)||!rr(e)||Uf(e)||(t.add(e),zf(e,(a,l)=>{if(Gr(l)){const o=l[nn];if(qf(o,n)){const c=ey(o);Yc(e,a,c,e.type_),FA(o)}}else rr(l)&&Vc(l,t,n)})),e}function Tz(e,t){const n=Rf(e),a={type_:n?1:0,scope_:t?t.scope_:XA(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let l=a,o=Xc;n&&(l=[a],o=co);const{revoke:c,proxy:f}=Proxy.revocable(l,o);return a.draft_=f,a.revoke_=c,[f,a]}var Xc={get(e,t){if(t===nn)return e;let n=e.scope_.arrayMethodsPlugin_;const a=e.type_===1&&typeof t=="string";if(a&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const l=$r(e);if(!ej(l,t,e.type_))return Mz(e,l,t);const o=l[t];if(e.finalized_||!rr(o)||a&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Sz(t))return o;if(o===Hv(e.base_,t)){Nc(e);const c=e.type_===1?+t:t,f=Kp(e.scope_,o,e,c);return e.copy_[c]=f}return o},has(e,t){return t in $r(e)},ownKeys(e){return Reflect.ownKeys($r(e))},set(e,t,n){const a=WA($r(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){const l=Hv($r(e),t),o=l?.[nn];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(xz(n,l)&&(n!==void 0||ej(e.base_,t,e.type_)))return!0;Nc(e),Hp(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Nz(e,t,n)),!0},deleteProperty(e,t){return Nc(e),Hv(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Hp(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=$r(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{[Ec]:!0,[Lp]:e.type_!==1||t!=="length",[Kc]:a[Kc],[oo]:n[t]}},defineProperty(){Jn(11)},getPrototypeOf(e){return Al(e.base_)},setPrototypeOf(){Jn(12)}},co={};for(let e in Xc){let t=Xc[e];co[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}co.deleteProperty=function(e,t){return co.set.call(this,e,t,void 0)};co.set=function(e,t,n){return Xc.set.call(this,e[0],t,n,e[0])};function Hv(e,t){const n=e[nn];return(n?$r(n):e)[t]}function Mz(e,t,n){const a=WA(t,n);return a?oo in a?a[oo]:a.get?.call(e.draft_):void 0}function WA(e,t){if(!(t in e))return;let n=Al(e);for(;n;){const a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=Al(n)}}function Hp(e){e.modified_||(e.modified_=!0,e.parent_&&Hp(e.parent_))}function Nc(e){e.copy_||(e.assigned_=new Map,e.copy_=Up(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Cz=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,a,l)=>{if(gl(n)&&!gl(a)){const c=a;a=n;const f=this;return function(h=c,...v){return f.produce(h,p=>a.call(this,p,...v))}}gl(a)||Jn(6),l!==void 0&&!gl(l)&&Jn(7);let o;if(rr(n)){const c=aj(this),f=Kp(c,n,void 0);let d=!0;try{o=a(f),d=!1}finally{d?Bp(c):Ip(c)}return rj(c,l),ij(o,c)}else if(!n||!J0(n)){if(o=a(n),o===void 0&&(o=n),o===YA&&(o=void 0),this.autoFreeze_&&ty(o,!0),l){const c=[],f=[];Si(qp).generateReplacementPatches_(n,o,{patches_:c,inversePatches_:f}),l(c,f)}return o}else Jn(1,n)},this.produceWithPatches=(n,a)=>{if(gl(n))return(f,...d)=>this.produceWithPatches(f,h=>n(h,...d));let l,o;return[this.produce(n,a,(f,d)=>{l=f,o=d}),l,o]},Iv(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Iv(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Iv(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){rr(t)||Jn(8),Gr(t)&&(t=nr(t));const n=aj(this),a=Kp(n,t,void 0);return a[nn].isManual_=!0,Ip(n),a}finishDraft(t,n){const a=t&&t[nn];(!a||!a.isManual_)&&Jn(9);const{scope_:l}=a;return rj(l,n),ij(void 0,l)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let a;for(a=n.length-1;a>=0;a--){const o=n[a];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}a>-1&&(n=n.slice(a+1));const l=Si(qp).applyPatches_;return Gr(t)?l(t,n):this.produce(t,o=>l(o,n))}};function Kp(e,t,n,a){const[l,o]=Lf(t)?Si(Gc).proxyMap_(t,n):$f(t)?Si(Gc).proxySet_(t,n):Tz(t,n);return(n?.scope_??XA()).drafts_.push(l),o.callbacks_=n?.callbacks_??[],o.key_=a,n&&a!==void 0?Ez(n,o,a):o.callbacks_.push(function(d){d.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:h}=d;o.modified_&&h&&h.generatePatches_(o,[],d)}),l}function nr(e){return Gr(e)||Jn(10,e),JA(e)}function JA(e){if(!rr(e)||Uf(e))return e;const t=e[nn];let n,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Up(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else n=Up(e,!0);return zf(n,(l,o)=>{Yc(n,l,JA(o))},a),t&&(t.finalized_=!1),n}var Dz=new Cz,eE=Dz.produce;function tE(e){return({dispatch:n,getState:a})=>l=>o=>typeof o=="function"?o(n,a,e):l(o)}var kz=tE(),Pz=tE,zz=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ic:Ic.apply(null,arguments)};function Vn(e,t){function n(...a){if(t){let l=t(...a);if(!l)throw new Error(Tn(0));return{type:e,payload:l.payload,..."meta"in l&&{meta:l.meta},..."error"in l&&{error:l.error}}}return{type:e,payload:a[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=a=>KA(a)&&a.type===e,n}var nE=class Ju extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ju.prototype)}static get[Symbol.species](){return Ju}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ju(...t[0].concat(this)):new Ju(...t.concat(this))}};function uj(e){return rr(e)?eE(e,()=>{}):e}function hc(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Rz(e){return typeof e=="boolean"}var Lz=()=>function(t){const{thunk:n=!0,immutableCheck:a=!0,serializableCheck:l=!0,actionCreatorCheck:o=!0}=t??{};let c=new nE;return n&&(Rz(n)?c.push(kz):c.push(Pz(n.extraArgument))),c},rE="RTK_autoBatch",rt=()=>e=>({payload:e,meta:{[rE]:!0}}),oj=e=>t=>{setTimeout(t,e)},aE=(e={type:"raf"})=>t=>(...n)=>{const a=t(...n);let l=!0,o=!1,c=!1;const f=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:oj(10):e.type==="callback"?e.queueNotification:oj(e.timeout),h=()=>{c=!1,o&&(o=!1,f.forEach(v=>v()))};return Object.assign({},a,{subscribe(v){const p=()=>l&&v(),b=a.subscribe(p);return f.add(v),()=>{b(),f.delete(v)}},dispatch(v){try{return l=!v?.meta?.[rE],o=!l,o&&(c||(c=!0,d(h))),a.dispatch(v)}finally{l=!0}}})},$z=e=>function(n){const{autoBatch:a=!0}=n??{};let l=new nE(e);return a&&l.push(aE(typeof a=="object"?a:void 0)),l};function Uz(e){const t=Lz(),{reducer:n=void 0,middleware:a,devTools:l=!0,preloadedState:o=void 0,enhancers:c=void 0}=e||{};let f;if(typeof n=="function")f=n;else if(W0(n))f=HA(n);else throw new Error(Tn(1));let d;typeof a=="function"?d=a(t):d=t();let h=Ic;l&&(h=zz({trace:!1,...typeof l=="object"&&l}));const v=gz(...d),p=$z(v);let b=typeof c=="function"?c(p):p();const x=h(...b);return IA(f,o,x)}function iE(e){const t={},n=[];let a;const l={addCase(o,c){const f=typeof o=="string"?o:o.type;if(!f)throw new Error(Tn(28));if(f in t)throw new Error(Tn(29));return t[f]=c,l},addAsyncThunk(o,c){return c.pending&&(t[o.pending.type]=c.pending),c.rejected&&(t[o.rejected.type]=c.rejected),c.fulfilled&&(t[o.fulfilled.type]=c.fulfilled),c.settled&&n.push({matcher:o.settled,reducer:c.settled}),l},addMatcher(o,c){return n.push({matcher:o,reducer:c}),l},addDefaultCase(o){return a=o,l}};return e(l),[t,n,a]}function qz(e){return typeof e=="function"}function Bz(e,t){let[n,a,l]=iE(t),o;if(qz(e))o=()=>uj(e());else{const f=uj(e);o=()=>f}function c(f=o(),d){let h=[n[d.type],...a.filter(({matcher:v})=>v(d)).map(({reducer:v})=>v)];return h.filter(v=>!!v).length===0&&(h=[l]),h.reduce((v,p)=>{if(p)if(Gr(v)){const x=p(v,d);return x===void 0?v:x}else{if(rr(v))return eE(v,b=>p(b,d));{const b=p(v,d);if(b===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}}return v},f)}return c.getInitialState=o,c}var Iz="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Hz=(e=21)=>{let t="",n=e;for(;n--;)t+=Iz[Math.random()*64|0];return t},Kz=Symbol.for("rtk-slice-createasyncthunk");function Yz(e,t){return`${e}/${t}`}function Gz({creators:e}={}){const t=e?.asyncThunk?.[Kz];return function(a){const{name:l,reducerPath:o=l}=a;if(!l)throw new Error(Tn(11));const c=(typeof a.reducers=="function"?a.reducers(Xz()):a.reducers)||{},f=Object.keys(c),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(M,P){const T=typeof M=="string"?M:M.type;if(!T)throw new Error(Tn(12));if(T in d.sliceCaseReducersByType)throw new Error(Tn(13));return d.sliceCaseReducersByType[T]=P,h},addMatcher(M,P){return d.sliceMatchers.push({matcher:M,reducer:P}),h},exposeAction(M,P){return d.actionCreators[M]=P,h},exposeCaseReducer(M,P){return d.sliceCaseReducersByName[M]=P,h}};f.forEach(M=>{const P=c[M],T={reducerName:M,type:Yz(l,M),createNotation:typeof a.reducers=="function"};Zz(P)?Wz(T,P,h,t):Fz(T,P,h)});function v(){const[M={},P=[],T=void 0]=typeof a.extraReducers=="function"?iE(a.extraReducers):[a.extraReducers],C={...M,...d.sliceCaseReducersByType};return Bz(a.initialState,R=>{for(let F in C)R.addCase(F,C[F]);for(let F of d.sliceMatchers)R.addMatcher(F.matcher,F.reducer);for(let F of P)R.addMatcher(F.matcher,F.reducer);T&&R.addDefaultCase(T)})}const p=M=>M,b=new Map,x=new WeakMap;let O;function j(M,P){return O||(O=v()),O(M,P)}function _(){return O||(O=v()),O.getInitialState()}function E(M,P=!1){function T(R){let F=R[M];return typeof F>"u"&&P&&(F=hc(x,T,_)),F}function C(R=p){const F=hc(b,P,()=>new WeakMap);return hc(F,R,()=>{const ee={};for(const[q,U]of Object.entries(a.selectors??{}))ee[q]=Vz(U,R,()=>hc(x,R,_),P);return ee})}return{reducerPath:M,getSelectors:C,get selectors(){return C(T)},selectSlice:T}}const N={name:l,reducer:j,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:_,...E(o),injectInto(M,{reducerPath:P,...T}={}){const C=P??o;return M.inject({reducerPath:C,reducer:j},T),{...N,...E(C,!0)}}};return N}}function Vz(e,t,n,a){function l(o,...c){let f=t(o);return typeof f>"u"&&a&&(f=n()),e(f,...c)}return l.unwrapped=e,l}var hn=Gz();function Xz(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function Fz({type:e,reducerName:t,createNotation:n},a,l){let o,c;if("reducer"in a){if(n&&!Qz(a))throw new Error(Tn(17));o=a.reducer,c=a.prepare}else o=a;l.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,c?Vn(e,c):Vn(e))}function Zz(e){return e._reducerDefinitionType==="asyncThunk"}function Qz(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Wz({type:e,reducerName:t},n,a,l){if(!l)throw new Error(Tn(18));const{payloadCreator:o,fulfilled:c,pending:f,rejected:d,settled:h,options:v}=n,p=l(e,o,v);a.exposeAction(t,p),c&&a.addCase(p.fulfilled,c),f&&a.addCase(p.pending,f),d&&a.addCase(p.rejected,d),h&&a.addMatcher(p.settled,h),a.exposeCaseReducer(t,{fulfilled:c||mc,pending:f||mc,rejected:d||mc,settled:h||mc})}function mc(){}var Jz="task",lE="listener",uE="completed",ny="cancelled",e5=`task-${ny}`,t5=`task-${uE}`,Yp=`${lE}-${ny}`,n5=`${lE}-${uE}`,Bf=class{constructor(e){this.code=e,this.message=`${Jz} ${ny} (reason: ${e})`}name="TaskAbortError";message},ry=(e,t)=>{if(typeof e!="function")throw new TypeError(Tn(32))},Fc=()=>{},oE=(e,t=Fc)=>(e.catch(t),e),sE=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),pi=e=>{if(e.aborted)throw new Bf(e.reason)};function cE(e,t){let n=Fc;return new Promise((a,l)=>{const o=()=>l(new Bf(e.reason));if(e.aborted){o();return}n=sE(e,o),t.finally(()=>n()).then(a,l)}).finally(()=>{n=Fc})}var r5=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Bf?"cancelled":"rejected",error:n}}finally{t?.()}},Zc=e=>t=>oE(cE(e,t).then(n=>(pi(e),n))),fE=e=>{const t=Zc(e);return n=>t(new Promise(a=>setTimeout(a,n)))},{assign:jl}=Object,sj={},If="listenerMiddleware",a5=(e,t)=>{const n=a=>sE(e,()=>a.abort(e.reason));return(a,l)=>{ry(a);const o=new AbortController;n(o);const c=r5(async()=>{pi(e),pi(o.signal);const f=await a({pause:Zc(o.signal),delay:fE(o.signal),signal:o.signal});return pi(o.signal),f},()=>o.abort(t5));return l?.autoJoin&&t.push(c.catch(Fc)),{result:Zc(e)(c),cancel(){o.abort(e5)}}}},i5=(e,t)=>{const n=async(a,l)=>{pi(t);let o=()=>{};const f=[new Promise((d,h)=>{let v=e({predicate:a,effect:(p,b)=>{b.unsubscribe(),d([p,b.getState(),b.getOriginalState()])}});o=()=>{v(),h()}})];l!=null&&f.push(new Promise(d=>setTimeout(d,l,null)));try{const d=await cE(t,Promise.race(f));return pi(t),d}finally{o()}};return(a,l)=>oE(n(a,l))},dE=e=>{let{type:t,actionCreator:n,matcher:a,predicate:l,effect:o}=e;if(t)l=Vn(t).match;else if(n)t=n.type,l=n.match;else if(a)l=a;else if(!l)throw new Error(Tn(21));return ry(o),{predicate:l,type:t,effect:o}},hE=jl(e=>{const{type:t,predicate:n,effect:a}=dE(e);return{id:Hz(),effect:a,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Tn(22))}}},{withTypes:()=>hE}),cj=(e,t)=>{const{type:n,effect:a,predicate:l}=dE(t);return Array.from(e.values()).find(o=>(typeof n=="string"?o.type===n:o.predicate===l)&&o.effect===a)},Gp=e=>{e.pending.forEach(t=>{t.abort(Yp)})},l5=(e,t)=>()=>{for(const n of t.keys())Gp(n);e.clear()},fj=(e,t,n)=>{try{e(t,n)}catch(a){setTimeout(()=>{throw a},0)}},mE=jl(Vn(`${If}/add`),{withTypes:()=>mE}),u5=Vn(`${If}/removeAll`),vE=jl(Vn(`${If}/remove`),{withTypes:()=>vE}),o5=(...e)=>{console.error(`${If}/error`,...e)},Eo=(e={})=>{const t=new Map,n=new Map,a=x=>{const O=n.get(x)??0;n.set(x,O+1)},l=x=>{const O=n.get(x)??1;O===1?n.delete(x):n.set(x,O-1)},{extra:o,onError:c=o5}=e;ry(c);const f=x=>(x.unsubscribe=()=>t.delete(x.id),t.set(x.id,x),O=>{x.unsubscribe(),O?.cancelActive&&Gp(x)}),d=x=>{const O=cj(t,x)??hE(x);return f(O)};jl(d,{withTypes:()=>d});const h=x=>{const O=cj(t,x);return O&&(O.unsubscribe(),x.cancelActive&&Gp(O)),!!O};jl(h,{withTypes:()=>h});const v=async(x,O,j,_)=>{const E=new AbortController,N=i5(d,E.signal),M=[];try{x.pending.add(E),a(x),await Promise.resolve(x.effect(O,jl({},j,{getOriginalState:_,condition:(P,T)=>N(P,T).then(Boolean),take:N,delay:fE(E.signal),pause:Zc(E.signal),extra:o,signal:E.signal,fork:a5(E.signal,M),unsubscribe:x.unsubscribe,subscribe:()=>{t.set(x.id,x)},cancelActiveListeners:()=>{x.pending.forEach((P,T,C)=>{P!==E&&(P.abort(Yp),C.delete(P))})},cancel:()=>{E.abort(Yp),x.pending.delete(E)},throwIfCancelled:()=>{pi(E.signal)}})))}catch(P){P instanceof Bf||fj(c,P,{raisedBy:"effect"})}finally{await Promise.all(M),E.abort(n5),l(x),x.pending.delete(E)}},p=l5(t,n);return{middleware:x=>O=>j=>{if(!KA(j))return O(j);if(mE.match(j))return d(j.payload);if(u5.match(j)){p();return}if(vE.match(j))return h(j.payload);let _=x.getState();const E=()=>{if(_===sj)throw new Error(Tn(23));return _};let N;try{if(N=O(j),t.size>0){const M=x.getState(),P=Array.from(t.values());for(const T of P){let C=!1;try{C=T.predicate(j,M,_)}catch(R){C=!1,fj(c,R,{raisedBy:"predicate"})}C&&v(T,j,x,E)}}}finally{_=sj}return N},startListening:d,stopListening:h,clearListeners:p}};function Tn(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 s5={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},pE=hn({name:"chartLayout",initialState:s5,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 n,a,l,o;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(a=t.payload.right)!==null&&a!==void 0?a:0,e.margin.bottom=(l=t.payload.bottom)!==null&&l!==void 0?l:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:c5,setLayout:f5,setChartSize:d5,setScale:h5}=pE.actions,m5=pE.reducer;function yE(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function wt(e){return Number.isFinite(e)}function yr(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function dj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function bl(e){for(var t=1;t{if(t&&n){var{width:a,height:l}=n,{align:o,verticalAlign:c,layout:f}=t;if((f==="vertical"||f==="horizontal"&&c==="middle")&&o!=="center"&&me(e[o]))return bl(bl({},e),{},{[o]:e[o]+(a||0)});if((f==="horizontal"||f==="vertical"&&o==="center")&&c!=="middle"&&me(e[c]))return bl(bl({},e),{},{[c]:e[c]+(l||0)})}return e},Ua=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",gE=(e,t,n,a)=>{if(a)return e.map(f=>f.coordinate);var l,o,c=e.map(f=>(f.coordinate===t&&(l=!0),f.coordinate===n&&(o=!0),f.coordinate));return l||c.push(t),o||c.push(n),c},bE=(e,t,n)=>{if(!e)return null;var{duplicateDomain:a,type:l,range:o,scale:c,realScaleType:f,isCategorical:d,categoricalDomain:h,tickCount:v,ticks:p,niceTicks:b,axisType:x}=e;if(!c)return null;var O=f==="scaleBand"&&c.bandwidth?c.bandwidth()/2:2,j=l==="category"&&c.bandwidth?c.bandwidth()/O:0;if(j=x==="angleAxis"&&o&&o.length>=2?Wt(o[0]-o[1])*2*j:j,p||b){var _=(p||b||[]).map((E,N)=>{var M=a?a.indexOf(E):E;return{coordinate:c(M)+j,value:E,offset:j,index:N}});return _.filter(E=>!vr(E.coordinate))}return d&&h?h.map((E,N)=>({coordinate:c(E)+j,value:E,index:N,offset:j})):c.ticks&&v!=null?c.ticks(v).map((E,N)=>({coordinate:c(E)+j,value:E,offset:j,index:N})):c.domain().map((E,N)=>({coordinate:c(E)+j,value:a?a[E]:E,index:N,offset:j}))},hj=1e-4,b5=e=>{var t=e.domain();if(!(!t||t.length<=2)){var n=t.length,a=e.range(),l=Math.min(a[0],a[1])-hj,o=Math.max(a[0],a[1])+hj,c=e(t[0]),f=e(t[n-1]);(co||fo)&&e.domain([t[0],t[n-1]])}},x5=e=>{var t,n=e.length;if(!(n<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var l=0;l=0?(h[0]=o,h[1]=o+b,o=v):(h[0]=c,h[1]=c+b,c=v)}}}},S5=e=>{var t,n=e.length;if(!(n<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var l=0;l=0?(d[0]=o,d[1]=o+h,o=d[1]):(d[0]=0,d[1]=0)}}}},w5={sign:x5,expand:Bk,none:bi,silhouette:Ik,wiggle:Hk,positive:S5},j5=(e,t,n)=>{var a,l=(a=w5[n])!==null&&a!==void 0?a:bi,o=qk().keys(t).value((f,d)=>Number(tt(f,d,0))).order(zp).offset(l),c=o(e);return c.forEach((f,d)=>{f.forEach((h,v)=>{var p=tt(e[v],t[d],0);Array.isArray(p)&&p.length===2&&me(p[0])&&me(p[1])&&(h[0]=p[0],h[1]=p[1])})}),c};function mj(e){var{axis:t,ticks:n,bandSize:a,entry:l,index:o,dataKey:c}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!_t(l[t.dataKey])){var f=_A(n,"value",l[t.dataKey]);if(f)return f.coordinate+a/2}return n[o]?n[o].coordinate+a/2:null}var d=tt(l,_t(c)?t.dataKey:c);return _t(d)?null:t.scale(d)}var O5=e=>{var t=e.flat(2).filter(me);return[Math.min(...t),Math.max(...t)]},_5=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],A5=(e,t,n)=>{if(e!=null)return _5(Object.keys(e).reduce((a,l)=>{var o=e[l];if(!o)return a;var{stackedData:c}=o,f=c.reduce((d,h)=>{var v=yE(h,t,n),p=O5(v);return!wt(p[0])||!wt(p[1])?d:[Math.min(d[0],p[0]),Math.max(d[1],p[1])]},[1/0,-1/0]);return[Math.min(f[0],a[0]),Math.max(f[1],a[1])]},[1/0,-1/0]))},vj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,pj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Qc=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var a=e.scale.bandwidth();if(!n||a>0)return a}if(e&&t&&t.length>=2){for(var l=kf(t,v=>v.coordinate),o=1/0,c=1,f=l.length;c{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},N5=(e,t)=>t==="centric"?e.angle:e.radius,Wr=e=>e.layout.width,Jr=e=>e.layout.height,T5=e=>e.layout.scale,xE=e=>e.layout.margin,Kf=V(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Yf=V(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),SE="data-recharts-item-index",wE="data-recharts-item-id",No=60;function gj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function vc(e){for(var t=1;te.brush.height;function P5(e){var t=Yf(e);return t.reduce((n,a)=>{if(a.orientation==="left"&&!a.mirror&&!a.hide){var l=typeof a.width=="number"?a.width:No;return n+l}return n},0)}function z5(e){var t=Yf(e);return t.reduce((n,a)=>{if(a.orientation==="right"&&!a.mirror&&!a.hide){var l=typeof a.width=="number"?a.width:No;return n+l}return n},0)}function R5(e){var t=Kf(e);return t.reduce((n,a)=>a.orientation==="top"&&!a.mirror&&!a.hide?n+a.height:n,0)}function L5(e){var t=Kf(e);return t.reduce((n,a)=>a.orientation==="bottom"&&!a.mirror&&!a.hide?n+a.height:n,0)}var zt=V([Wr,Jr,xE,k5,P5,z5,R5,L5,qA,fz],(e,t,n,a,l,o,c,f,d,h)=>{var v={left:(n.left||0)+l,right:(n.right||0)+o},p={top:(n.top||0)+c,bottom:(n.bottom||0)+f},b=vc(vc({},p),v),x=b.bottom;b.bottom+=a,b=g5(b,d,h);var O=e-b.left-b.right,j=t-b.top-b.bottom;return vc(vc({brushBottom:x},b),{},{width:Math.max(O,0),height:Math.max(j,0)})}),$5=V(zt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),jE=V(Wr,Jr,(e,t)=>({x:0,y:0,width:e,height:t})),U5=S.createContext(null),mn=()=>S.useContext(U5)!=null,Gf=e=>e.brush,Vf=V([Gf,zt,xE],(e,t,n)=>({height:e.height,x:me(e.x)?e.x:t.left,y:me(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:me(e.width)?e.width:t.width})),Kv={},Yv={},Gv={},bj;function q5(){return bj||(bj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a,{signal:l,edges:o}={}){let c,f=null;const d=o!=null&&o.includes("leading"),h=o==null||o.includes("trailing"),v=()=>{f!==null&&(n.apply(c,f),c=void 0,f=null)},p=()=>{h&&v(),j()};let b=null;const x=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,p()},a)},O=()=>{b!==null&&(clearTimeout(b),b=null)},j=()=>{O(),c=void 0,f=null},_=()=>{v()},E=function(...N){if(l?.aborted)return;c=this,f=N;const M=b==null;x(),d&&M&&v()};return E.schedule=x,E.cancel=j,E.flush=_,l?.addEventListener("abort",j,{once:!0}),E}e.debounce=t})(Gv)),Gv}var xj;function B5(){return xj||(xj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=q5();function n(a,l=0,o={}){typeof o!="object"&&(o={});const{leading:c=!1,trailing:f=!0,maxWait:d}=o,h=Array(2);c&&(h[0]="leading"),f&&(h[1]="trailing");let v,p=null;const b=t.debounce(function(...j){v=a.apply(this,j),p=null},l,{edges:h}),x=function(...j){return d!=null&&(p===null&&(p=Date.now()),Date.now()-p>=d)?(v=a.apply(this,j),p=Date.now(),b.cancel(),b.schedule(),v):(b.apply(this,j),v)},O=()=>(b.flush(),v);return x.cancel=b.cancel,x.flush=O,x}e.debounce=n})(Yv)),Yv}var Sj;function I5(){return Sj||(Sj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=B5();function n(a,l=0,o={}){const{leading:c=!0,trailing:f=!0}=o;return t.debounce(a,l,{leading:c,maxWait:l,trailing:f})}e.throttle=n})(Kv)),Kv}var Vv,wj;function H5(){return wj||(wj=1,Vv=I5().throttle),Vv}var K5=H5();const Y5=Qr(K5);var Wc=function(t,n){for(var a=arguments.length,l=new Array(a>2?a-2:0),o=2;ol[c++]))}},OE=(e,t,n)=>{var{width:a="100%",height:l="100%",aspect:o,maxHeight:c}=n,f=Yr(a)?e:Number(a),d=Yr(l)?t:Number(l);return o&&o>0&&(f?d=f/o:d&&(f=d*o),c&&d!=null&&d>c&&(d=c)),{calculatedWidth:f,calculatedHeight:d}},G5={width:0,height:0,overflow:"visible"},V5={width:0,overflowX:"visible"},X5={height:0,overflowY:"visible"},F5={},Z5=e=>{var{width:t,height:n}=e,a=Yr(t),l=Yr(n);return a&&l?G5:a?V5:l?X5:F5};function Q5(e){var{width:t,height:n,aspect:a}=e,l=t,o=n;return l===void 0&&o===void 0?(l="100%",o="100%"):l===void 0?l=a&&a>0?void 0:"100%":o===void 0&&(o=a&&a>0?void 0:"100%"),{width:l,height:o}}function Vp(){return Vp=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:n,height:a}),[n,a]);return tR(l)?S.createElement(_E.Provider,{value:l},t):null}var ay=()=>S.useContext(_E),nR=S.forwardRef((e,t)=>{var{aspect:n,initialDimension:a={width:-1,height:-1},width:l,height:o,minWidth:c=0,minHeight:f,maxHeight:d,children:h,debounce:v=0,id:p,className:b,onResize:x,style:O={}}=e,j=S.useRef(null),_=S.useRef();_.current=x,S.useImperativeHandle(t,()=>j.current);var[E,N]=S.useState({containerWidth:a.width,containerHeight:a.height}),M=S.useCallback((F,ee)=>{N(q=>{var U=Math.round(F),B=Math.round(ee);return q.containerWidth===U&&q.containerHeight===B?q:{containerWidth:U,containerHeight:B}})},[]);S.useEffect(()=>{if(j.current==null||typeof ResizeObserver>"u")return _o;var F=B=>{var ue,{width:oe,height:ve}=B[0].contentRect;M(oe,ve),(ue=_.current)===null||ue===void 0||ue.call(_,oe,ve)};v>0&&(F=Y5(F,v,{trailing:!0,leading:!1}));var ee=new ResizeObserver(F),{width:q,height:U}=j.current.getBoundingClientRect();return M(q,U),ee.observe(j.current),()=>{ee.disconnect()}},[M,v]);var{containerWidth:P,containerHeight:T}=E;Wc(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:C,calculatedHeight:R}=OE(P,T,{width:l,height:o,aspect:n,maxHeight:d});return Wc(C!=null&&C>0||R!=null&&R>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,C,L,l,o,c,f,n),S.createElement("div",{id:p?"".concat(p):void 0,className:Re("recharts-responsive-container",b),style:Oj(Oj({},O),{},{width:l,height:o,minWidth:c,minHeight:f,maxHeight:d}),ref:j},S.createElement("div",{style:Z5({width:l,height:o})},S.createElement(AE,{width:C,height:L},h)))}),to=S.forwardRef((e,t)=>{var n=ay();if(yr(n.width)&&yr(n.height))return e.children;var{width:a,height:l}=Q5({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:o,calculatedHeight:c}=OE(void 0,void 0,{width:a,height:l,aspect:e.aspect,maxHeight:e.maxHeight});return me(o)&&me(c)?S.createElement(AE,{width:o,height:c},e.children):S.createElement(nR,Vp({},e,{width:a,height:l,ref:t}))});function EE(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 Xf=()=>{var e,t=mn(),n=de($5),a=de(Vf),l=(e=de(Gf))===null||e===void 0?void 0:e.padding;return!t||!a||!l?n:{width:a.width-l.left-l.right,height:a.height-l.top-l.bottom,x:l.left,y:l.top}},rR={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},NE=()=>{var e;return(e=de(zt))!==null&&e!==void 0?e:rR},iy=()=>de(Wr),ly=()=>de(Jr),aR=()=>de(e=>e.layout.margin),Ge=e=>e.layout.layoutType,To=()=>de(Ge),iR=()=>{var e=To();return e!==void 0},Ff=e=>{var t=Qe(),n=mn(),{width:a,height:l}=e,o=ay(),c=a,f=l;return o&&(c=o.width>0?o.width:a,f=o.height>0?o.height:l),S.useEffect(()=>{!n&&yr(c)&&yr(f)&&t(d5({width:c,height:f}))},[t,n,c,f]),null},TE=Symbol.for("immer-nothing"),_j=Symbol.for("immer-draftable"),Mn=Symbol.for("immer-state");function er(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fo=Object.getPrototypeOf;function El(e){return!!e&&!!e[Mn]}function wi(e){return e?ME(e)||Array.isArray(e)||!!e[_j]||!!e.constructor?.[_j]||Mo(e)||Qf(e):!1}var lR=Object.prototype.constructor.toString(),Aj=new WeakMap;function ME(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let a=Aj.get(n);return a===void 0&&(a=Function.toString.call(n),Aj.set(n,a)),a===lR}function Jc(e,t,n=!0){Zf(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((a,l)=>t(l,a,e))}function Zf(e){const t=e[Mn];return t?t.type_:Array.isArray(e)?1:Mo(e)?2:Qf(e)?3:0}function Xp(e,t){return Zf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function CE(e,t,n){const a=Zf(e);a===2?e.set(t,n):a===3?e.add(n):e[t]=n}function uR(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Mo(e){return e instanceof Map}function Qf(e){return e instanceof Set}function si(e){return e.copy_||e.base_}function Fp(e,t){if(Mo(e))return new Map(e);if(Qf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=ME(e);if(t===!0||t==="class_only"&&!n){const a=Object.getOwnPropertyDescriptors(e);delete a[Mn];let l=Reflect.ownKeys(a);for(let o=0;o1&&Object.defineProperties(e,{set:pc,add:pc,clear:pc,delete:pc}),Object.freeze(e),t&&Object.values(e).forEach(n=>uy(n,!0))),e}function oR(){er(2)}var pc={value:oR};function Wf(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var sR={};function ji(e){const t=sR[e];return t||er(0,e),t}var ho;function DE(){return ho}function cR(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ej(e,t){t&&(ji("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Zp(e){Qp(e),e.drafts_.forEach(fR),e.drafts_=null}function Qp(e){e===ho&&(ho=e.parent_)}function Nj(e){return ho=cR(ho,e)}function fR(e){const t=e[Mn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Tj(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Mn].modified_&&(Zp(t),er(4)),wi(e)&&(e=ef(t,e),t.parent_||tf(t,e)),t.patches_&&ji("Patches").generateReplacementPatches_(n[Mn].base_,e,t.patches_,t.inversePatches_)):e=ef(t,n,[]),Zp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==TE?e:void 0}function ef(e,t,n){if(Wf(t))return t;const a=e.immer_.shouldUseStrictIteration(),l=t[Mn];if(!l)return Jc(t,(o,c)=>Mj(e,l,t,o,c,n),a),t;if(l.scope_!==e)return t;if(!l.modified_)return tf(e,l.base_,!0),l.base_;if(!l.finalized_){l.finalized_=!0,l.scope_.unfinalizedDrafts_--;const o=l.copy_;let c=o,f=!1;l.type_===3&&(c=new Set(o),o.clear(),f=!0),Jc(c,(d,h)=>Mj(e,l,o,d,h,n,f),a),tf(e,o,!1),n&&e.patches_&&ji("Patches").generatePatches_(l,n,e.patches_,e.inversePatches_)}return l.copy_}function Mj(e,t,n,a,l,o,c){if(l==null||typeof l!="object"&&!c)return;const f=Wf(l);if(!(f&&!c)){if(El(l)){const d=o&&t&&t.type_!==3&&!Xp(t.assigned_,a)?o.concat(a):void 0,h=ef(e,l,d);if(CE(n,a,h),El(h))e.canAutoFreeze_=!1;else return}else c&&n.add(l);if(wi(l)&&!f){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[a]===l&&f)return;ef(e,l),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&(Mo(n)?n.has(a):Object.prototype.propertyIsEnumerable.call(n,a))&&tf(e,l)}}}function tf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uy(t,n)}function dR(e,t){const n=Array.isArray(e),a={type_:n?1:0,scope_:t?t.scope_:DE(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let l=a,o=oy;n&&(l=[a],o=mo);const{revoke:c,proxy:f}=Proxy.revocable(l,o);return a.draft_=f,a.revoke_=c,f}var oy={get(e,t){if(t===Mn)return e;const n=si(e);if(!Xp(n,t))return hR(e,n,t);const a=n[t];return e.finalized_||!wi(a)?a:a===Xv(e.base_,t)?(Fv(e),e.copy_[t]=Jp(a,e)):a},has(e,t){return t in si(e)},ownKeys(e){return Reflect.ownKeys(si(e))},set(e,t,n){const a=kE(si(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){const l=Xv(si(e),t),o=l?.[Mn];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(uR(n,l)&&(n!==void 0||Xp(e.base_,t)))return!0;Fv(e),Wp(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Xv(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Fv(e),Wp(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=si(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:a.enumerable,value:n[t]}},defineProperty(){er(11)},getPrototypeOf(e){return fo(e.base_)},setPrototypeOf(){er(12)}},mo={};Jc(oy,(e,t)=>{mo[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});mo.deleteProperty=function(e,t){return mo.set.call(this,e,t,void 0)};mo.set=function(e,t,n){return oy.set.call(this,e[0],t,n,e[0])};function Xv(e,t){const n=e[Mn];return(n?si(n):e)[t]}function hR(e,t,n){const a=kE(t,n);return a?"value"in a?a.value:a.get?.call(e.draft_):void 0}function kE(e,t){if(!(t in e))return;let n=fo(e);for(;n;){const a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=fo(n)}}function Wp(e){e.modified_||(e.modified_=!0,e.parent_&&Wp(e.parent_))}function Fv(e){e.copy_||(e.copy_=Fp(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var mR=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,a)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const c=this;return function(d=o,...h){return c.produce(d,v=>n.call(this,v,...h))}}typeof n!="function"&&er(6),a!==void 0&&typeof a!="function"&&er(7);let l;if(wi(t)){const o=Nj(this),c=Jp(t,void 0);let f=!0;try{l=n(c),f=!1}finally{f?Zp(o):Qp(o)}return Ej(o,a),Tj(l,o)}else if(!t||typeof t!="object"){if(l=n(t),l===void 0&&(l=t),l===TE&&(l=void 0),this.autoFreeze_&&uy(l,!0),a){const o=[],c=[];ji("Patches").generateReplacementPatches_(t,l,o,c),a(o,c)}return l}else er(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(c,...f)=>this.produceWithPatches(c,d=>t(d,...f));let a,l;return[this.produce(t,n,(c,f)=>{a=c,l=f}),a,l]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){wi(e)||er(8),El(e)&&(e=vR(e));const t=Nj(this),n=Jp(e,void 0);return n[Mn].isManual_=!0,Qp(t),n}finishDraft(e,t){const n=e&&e[Mn];(!n||!n.isManual_)&&er(9);const{scope_:a}=n;return Ej(a,t),Tj(void 0,a)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const l=t[n];if(l.path.length===0&&l.op==="replace"){e=l.value;break}}n>-1&&(t=t.slice(n+1));const a=ji("Patches").applyPatches_;return El(e)?a(e,t):this.produce(e,l=>a(l,t))}};function Jp(e,t){const n=Mo(e)?ji("MapSet").proxyMap_(e,t):Qf(e)?ji("MapSet").proxySet_(e,t):dR(e,t);return(t?t.scope_:DE()).drafts_.push(n),n}function vR(e){return El(e)||er(10,e),PE(e)}function PE(e){if(!wi(e)||Wf(e))return e;const t=e[Mn];let n,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Fp(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else n=Fp(e,!0);return Jc(n,(l,o)=>{CE(n,l,PE(o))},a),t&&(t.finalized_=!1),n}var pR=new mR;pR.produce;var yR={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},zE=hn({name:"legend",initialState:yR,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:rt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).payload.indexOf(n);l>-1&&(e.payload[l]=a)},prepare:rt()},removeLegendPayload:{reducer(e,t){var n=nr(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:rt()}}}),{setLegendSize:Cj,setLegendSettings:gR,addLegendPayload:RE,replaceLegendPayload:LE,removeLegendPayload:$E}=zE.actions,bR=zE.reducer,xR=["contextPayload"];function e0(){return e0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t(gR(e))},[t,e]),null}function MR(e){var t=Qe();return S.useEffect(()=>(t(Cj(e)),()=>{t(Cj({width:0,height:0}))}),[t,e]),null}function CR(e,t,n,a){return e==="vertical"&&me(t)?{height:t}:e==="horizontal"?{width:n||a}:null}var DR={align:"center",iconSize:14,itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function UE(e){var t=At(e,DR),n=mz(),a=ck(),l=aR(),{width:o,height:c,wrapperStyle:f,portal:d}=t,[h,v]=BA([n]),p=iy(),b=ly();if(p==null||b==null)return null;var x=p-(l?.left||0)-(l?.right||0),O=CR(t.layout,c,o,x),j=d?f:Nl(Nl({position:"absolute",width:O?.width||o||"auto",height:O?.height||c||"auto"},NR(f,t,l,p,b,h)),f),_=d??a;if(_==null||n==null)return null;var E=S.createElement("div",{className:"recharts-legend-wrapper",style:j,ref:v},S.createElement(TR,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&S.createElement(MR,{width:h.width,height:h.height}),S.createElement(ER,e0({},t,O,{margin:l,chartWidth:p,chartHeight:b,contextPayload:n})));return U0.createPortal(E,_)}UE.displayName="Legend";function t0(){return t0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=" : ",contentStyle:n={},itemStyle:a={},labelStyle:l={},payload:o,formatter:c,itemSorter:f,wrapperClassName:d,labelClassName:h,label:v,labelFormatter:p,accessibilityLayer:b=!1}=e,x=()=>{if(o&&o.length){var T={padding:0,margin:0},C=(f?kf(o,f):o).map((L,Z)=>{if(L.type==="none")return null;var ne=L.formatter||c||RR,{value:q,name:U}=L,B=q,ue=U;if(ne){var oe=ne(q,U,L,Z,o);if(Array.isArray(oe))[B,ue]=oe;else if(oe!=null)B=oe;else return null}var ve=Zv({display:"block",paddingTop:4,paddingBottom:4,color:L.color||"#000"},a);return S.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(Z),style:ve},pr(ue)?S.createElement("span",{className:"recharts-tooltip-item-name"},ue):null,pr(ue)?S.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,S.createElement("span",{className:"recharts-tooltip-item-value"},B),S.createElement("span",{className:"recharts-tooltip-item-unit"},L.unit||""))});return S.createElement("ul",{className:"recharts-tooltip-item-list",style:T},C)}return null},O=Zv({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},n),j=Zv({margin:0},l),_=!_t(v),E=_?v:"",N=Re("recharts-default-tooltip",d),M=Re("recharts-tooltip-label",h);_&&p&&o!==void 0&&o!==null&&(E=p(v,o));var P=b?{role:"status","aria-live":"assertive"}:{};return S.createElement("div",t0({className:N,style:O},P),S.createElement("p",{className:M,style:j},S.isValidElement(E)?E:"".concat(E)),x())},qu="recharts-tooltip-wrapper",$R={visibility:"hidden"};function UR(e){var{coordinate:t,translateX:n,translateY:a}=e;return Re(qu,{["".concat(qu,"-right")]:me(n)&&t&&me(t.x)&&n>=t.x,["".concat(qu,"-left")]:me(n)&&t&&me(t.x)&&n=t.y,["".concat(qu,"-top")]:me(a)&&t&&me(t.y)&&a0?l:0),p=n[a]+l;if(t[a])return c[a]?v:p;var b=d[a];if(b==null)return 0;if(c[a]){var x=v,O=b;return x_?Math.max(v,b):Math.max(p,b)}function qR(e){var{translateX:t,translateY:n,useTranslate3d:a}=e;return{transform:a?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function BR(e){var{allowEscapeViewBox:t,coordinate:n,offsetTopLeft:a,position:l,reverseDirection:o,tooltipBox:c,useTranslate3d:f,viewBox:d}=e,h,v,p;return c.height>0&&c.width>0&&n?(v=Pj({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:a,position:l,reverseDirection:o,tooltipDimension:c.width,viewBox:d,viewBoxDimension:d.width}),p=Pj({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:a,position:l,reverseDirection:o,tooltipDimension:c.height,viewBox:d,viewBoxDimension:d.height}),h=qR({translateX:v,translateY:p,useTranslate3d:f})):h=$R,{cssProperties:h,cssClasses:UR({translateX:v,translateY:p,coordinate:n})}}function zj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function yc(e){for(var t=1;t{if(t.key==="Escape"){var n,a,l,o;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(n=(a=this.props.coordinate)===null||a===void 0?void 0:a.x)!==null&&n!==void 0?n:0,y:(l=(o=this.props.coordinate)===null||o===void 0?void 0:o.y)!==null&&l!==void 0?l:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,n;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:n,animationDuration:a,animationEasing:l,children:o,coordinate:c,hasPayload:f,isAnimationActive:d,offset:h,position:v,reverseDirection:p,useTranslate3d:b,viewBox:x,wrapperStyle:O,lastBoundingBox:j,innerRef:_,hasPortalFromProps:E}=this.props,{cssClasses:N,cssProperties:M}=BR({allowEscapeViewBox:n,coordinate:c,offsetTopLeft:h,position:v,reverseDirection:p,tooltipBox:{height:j.height,width:j.width},useTranslate3d:b,viewBox:x}),P=E?{}:yc(yc({transition:d&&t?"transform ".concat(a,"ms ").concat(l):void 0},M),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&f?"visible":"hidden",position:"absolute",top:0,left:0}),T=yc(yc({},P),{},{visibility:!this.state.dismissed&&t&&f?"visible":"hidden"},O);return S.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:N,style:T,ref:_},o)}}var qE=()=>{var e;return(e=de(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function r0(){return r0=Object.assign?Object.assign.bind():function(e){for(var t=1;twt(e.x)&&wt(e.y),Uj=e=>e.base!=null&&nf(e.base)&&nf(e),Bu=e=>e.x,Iu=e=>e.y,XR=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Oo(e));return(n==="curveMonotone"||n==="curveBump")&&t?$j["".concat(n).concat(t==="vertical"?"Y":"X")]:$j[n]||Cf},FR=e=>{var{type:t="linear",points:n=[],baseLine:a,layout:l,connectNulls:o=!1}=e,c=XR(t,l),f=o?n.filter(nf):n,d;if(Array.isArray(a)){var h=n.map((x,O)=>Lj(Lj({},x),{},{base:a[O]}));l==="vertical"?d=sc().y(Iu).x1(Bu).x0(x=>x.base.x):d=sc().x(Bu).y1(Iu).y0(x=>x.base.y);var v=d.defined(Uj).curve(c),p=o?h.filter(Uj):h;return v(p)}l==="vertical"&&me(a)?d=sc().y(Iu).x1(Bu).x0(a):me(a)?d=sc().x(Bu).y1(Iu).y0(a):d=dA().x(Bu).y(Iu);var b=d.defined(nf).curve(c);return b(f)},sy=e=>{var{className:t,points:n,path:a,pathRef:l}=e,o=To();if((!n||!n.length)&&!a)return null;var c={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},f=n&&n.length?FR(c):a;return S.createElement("path",r0({},Gn(e),V0(e),{className:Re("recharts-curve",t),d:f===null?void 0:f,ref:l}))},ZR=["x","y","top","left","width","height","className"];function a0(){return a0=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(l,"v").concat(a,"M").concat(o,",").concat(t,"h").concat(n),a6=e=>{var{x:t=0,y:n=0,top:a=0,left:l=0,width:o=0,height:c=0,className:f}=e,d=t6(e,ZR),h=QR({x:t,y:n,top:a,left:l,width:o,height:c},d);return!me(t)||!me(n)||!me(o)||!me(c)||!me(a)||!me(l)?null:S.createElement("path",a0({},tn(h),{className:Re("recharts-cross",f),d:r6(t,n,o,c,a,l)}))};function i6(e,t,n,a){var l=a/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-l:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-l,width:e==="horizontal"?a:n.width-1,height:e==="horizontal"?n.height-1:a}}function Bj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Ij(e){for(var t=1;te.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),BE=(e,t,n)=>e.map(a=>"".concat(s6(a)," ").concat(t,"ms ").concat(n)).join(","),c6=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,a)=>n.filter(l=>a.includes(l))),vo=(e,t)=>Object.keys(t).reduce((n,a)=>Ij(Ij({},n),{},{[a]:e(a,t[a])}),{});function Hj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Ot(e){for(var t=1;te+(t-e)*n,i0=e=>{var{from:t,to:n}=e;return t!==n},IE=(e,t,n)=>{var a=vo((l,o)=>{if(i0(o)){var[c,f]=e(o.from,o.to,o.velocity);return Ot(Ot({},o),{},{from:c,velocity:f})}return o},t);return n<1?vo((l,o)=>i0(o)&&a[l]!=null?Ot(Ot({},o),{},{velocity:rf(o.velocity,a[l].velocity,n),from:rf(o.from,a[l].from,n)}):o,t):IE(e,a,n-1)};function m6(e,t,n,a,l,o){var c,f=a.reduce((b,x)=>Ot(Ot({},b),{},{[x]:{from:e[x],velocity:0,to:t[x]}}),{}),d=()=>vo((b,x)=>x.from,f),h=()=>!Object.values(f).filter(i0).length,v=null,p=b=>{c||(c=b);var x=b-c,O=x/n.dt;f=IE(n,f,O),l(Ot(Ot(Ot({},e),t),d())),c=b,h()||(v=o.setTimeout(p))};return()=>(v=o.setTimeout(p),()=>{var b;(b=v)===null||b===void 0||b()})}function v6(e,t,n,a,l,o,c){var f=null,d=l.reduce((p,b)=>{var x=e[b],O=t[b];return x==null||O==null?p:Ot(Ot({},p),{},{[b]:[x,O]})},{}),h,v=p=>{h||(h=p);var b=(p-h)/a,x=vo((j,_)=>rf(..._,n(b)),d);if(o(Ot(Ot(Ot({},e),t),x)),b<1)f=c.setTimeout(v);else{var O=vo((j,_)=>rf(..._,n(1)),d);o(Ot(Ot(Ot({},e),t),O))}};return()=>(f=c.setTimeout(v),()=>{var p;(p=f)===null||p===void 0||p()})}const p6=(e,t,n,a,l,o)=>{var c=c6(e,t);return n==null?()=>(l(Ot(Ot({},e),t)),()=>{}):n.isStepper===!0?m6(e,t,n,c,l,o):v6(e,t,n,a,c,l,o)};var af=1e-4,HE=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],KE=(e,t)=>e.map((n,a)=>n*t**a).reduce((n,a)=>n+a),Kj=(e,t)=>n=>{var a=HE(e,t);return KE(a,n)},y6=(e,t)=>n=>{var a=HE(e,t),l=[...a.map((o,c)=>o*c).slice(1),0];return KE(l,n)},g6=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var a=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(a==null||a.length!==4)return null;var l=a.map(o=>parseFloat(o));return[l[0],l[1],l[2],l[3]]},b6=function(){for(var t=arguments.length,n=new Array(t),a=0;a{var l=Kj(e,n),o=Kj(t,a),c=y6(e,n),f=h=>h>1?1:h<0?0:h,d=h=>{for(var v=h>1?1:h,p=v,b=0;b<8;++b){var x=l(p)-v,O=c(p);if(Math.abs(x-v)0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:a=8,dt:l=17}=t,o=(c,f,d)=>{var h=-(c-f)*n,v=d*a,p=d+(h-v)*l/1e3,b=d*l/1e3+c;return Math.abs(b-f){if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Yj(e);case"spring":return S6();default:if(e.split("(")[0]==="cubic-bezier")return Yj(e)}return typeof e=="function"?e:null};function j6(e){var t,n=()=>null,a=!1,l=null,o=c=>{if(!a){if(Array.isArray(c)){if(!c.length)return;var f=c,[d,...h]=f;if(typeof d=="number"){l=e.setTimeout(o.bind(null,h),d);return}o(d),l=e.setTimeout(o.bind(null,h));return}typeof c=="string"&&(t=c,n(t)),typeof c=="object"&&(t=c,n(t)),typeof c=="function"&&c()}};return{stop:()=>{a=!0},start:c=>{a=!1,l&&(l(),l=null),o(c)},subscribe:c=>(n=c,()=>{n=()=>null}),getTimeoutController:()=>e}}class O6{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=performance.now(),l=null,o=c=>{c-a>=n?t(c):typeof requestAnimationFrame=="function"&&(l=requestAnimationFrame(o))};return l=requestAnimationFrame(o),()=>{l!=null&&cancelAnimationFrame(l)}}}function _6(){return j6(new O6)}var A6=S.createContext(_6);function E6(e,t){var n=S.useContext(A6);return S.useMemo(()=>t??n(e),[e,t,n])}var N6=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Jf={isSsr:N6()},T6={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Gj={t:0},Qv={t:1};function ed(e){var t=At(e,T6),{isActive:n,canBegin:a,duration:l,easing:o,begin:c,onAnimationEnd:f,onAnimationStart:d,children:h}=t,v=n==="auto"?!Jf.isSsr:n,p=E6(t.animationId,t.animationManager),[b,x]=S.useState(v?Gj:Qv),O=S.useRef(null);return S.useEffect(()=>{v||x(Qv)},[v]),S.useEffect(()=>{if(!v||!a)return _o;var j=p6(Gj,Qv,w6(o),l,x,p.getTimeoutController()),_=()=>{O.current=j()};return p.start([d,c,_,l,f]),()=>{p.stop(),O.current&&O.current(),f()}},[v,a,l,o,c,d,f,p]),h(b.t)}function td(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=S.useRef(uo(t)),a=S.useRef(e);return a.current!==e&&(n.current=uo(t),a.current=e),n.current}var M6=["radius"],C6=["radius"],Vj,Xj,Fj,Zj,Qj,Wj,Jj,e2,t2,n2;function r2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function a2(e){for(var t=1;t{var o=za(n),c=za(a),f=Math.min(Math.abs(o)/2,Math.abs(c)/2),d=c>=0?1:-1,h=o>=0?1:-1,v=c>=0&&o>=0||c<0&&o<0?1:0,p;if(f>0&&l instanceof Array){for(var b=[0,0,0,0],x=0,O=4;xf?f:l[x];p=ct(Vj||(Vj=fr(["M",",",""])),e,t+d*b[0]),b[0]>0&&(p+=ct(Xj||(Xj=fr(["A ",",",",0,0,",",",",",""])),b[0],b[0],v,e+h*b[0],t)),p+=ct(Fj||(Fj=fr(["L ",",",""])),e+n-h*b[1],t),b[1]>0&&(p+=ct(Zj||(Zj=fr(["A ",",",",0,0,",`, + height and width.`,C,R,l,o,c,f,n),S.createElement("div",{id:p?"".concat(p):void 0,className:Re("recharts-responsive-container",b),style:Oj(Oj({},O),{},{width:l,height:o,minWidth:c,minHeight:f,maxHeight:d}),ref:j},S.createElement("div",{style:Z5({width:l,height:o})},S.createElement(AE,{width:C,height:R},h)))}),to=S.forwardRef((e,t)=>{var n=ay();if(yr(n.width)&&yr(n.height))return e.children;var{width:a,height:l}=Q5({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:o,calculatedHeight:c}=OE(void 0,void 0,{width:a,height:l,aspect:e.aspect,maxHeight:e.maxHeight});return me(o)&&me(c)?S.createElement(AE,{width:o,height:c},e.children):S.createElement(nR,Vp({},e,{width:a,height:l,ref:t}))});function EE(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 Xf=()=>{var e,t=mn(),n=de($5),a=de(Vf),l=(e=de(Gf))===null||e===void 0?void 0:e.padding;return!t||!a||!l?n:{width:a.width-l.left-l.right,height:a.height-l.top-l.bottom,x:l.left,y:l.top}},rR={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},NE=()=>{var e;return(e=de(zt))!==null&&e!==void 0?e:rR},iy=()=>de(Wr),ly=()=>de(Jr),aR=()=>de(e=>e.layout.margin),Ge=e=>e.layout.layoutType,To=()=>de(Ge),iR=()=>{var e=To();return e!==void 0},Ff=e=>{var t=Qe(),n=mn(),{width:a,height:l}=e,o=ay(),c=a,f=l;return o&&(c=o.width>0?o.width:a,f=o.height>0?o.height:l),S.useEffect(()=>{!n&&yr(c)&&yr(f)&&t(d5({width:c,height:f}))},[t,n,c,f]),null},TE=Symbol.for("immer-nothing"),_j=Symbol.for("immer-draftable"),Mn=Symbol.for("immer-state");function er(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fo=Object.getPrototypeOf;function El(e){return!!e&&!!e[Mn]}function wi(e){return e?ME(e)||Array.isArray(e)||!!e[_j]||!!e.constructor?.[_j]||Mo(e)||Qf(e):!1}var lR=Object.prototype.constructor.toString(),Aj=new WeakMap;function ME(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let a=Aj.get(n);return a===void 0&&(a=Function.toString.call(n),Aj.set(n,a)),a===lR}function Jc(e,t,n=!0){Zf(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((a,l)=>t(l,a,e))}function Zf(e){const t=e[Mn];return t?t.type_:Array.isArray(e)?1:Mo(e)?2:Qf(e)?3:0}function Xp(e,t){return Zf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function CE(e,t,n){const a=Zf(e);a===2?e.set(t,n):a===3?e.add(n):e[t]=n}function uR(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Mo(e){return e instanceof Map}function Qf(e){return e instanceof Set}function si(e){return e.copy_||e.base_}function Fp(e,t){if(Mo(e))return new Map(e);if(Qf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=ME(e);if(t===!0||t==="class_only"&&!n){const a=Object.getOwnPropertyDescriptors(e);delete a[Mn];let l=Reflect.ownKeys(a);for(let o=0;o1&&Object.defineProperties(e,{set:pc,add:pc,clear:pc,delete:pc}),Object.freeze(e),t&&Object.values(e).forEach(n=>uy(n,!0))),e}function oR(){er(2)}var pc={value:oR};function Wf(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var sR={};function ji(e){const t=sR[e];return t||er(0,e),t}var ho;function DE(){return ho}function cR(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ej(e,t){t&&(ji("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Zp(e){Qp(e),e.drafts_.forEach(fR),e.drafts_=null}function Qp(e){e===ho&&(ho=e.parent_)}function Nj(e){return ho=cR(ho,e)}function fR(e){const t=e[Mn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Tj(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Mn].modified_&&(Zp(t),er(4)),wi(e)&&(e=ef(t,e),t.parent_||tf(t,e)),t.patches_&&ji("Patches").generateReplacementPatches_(n[Mn].base_,e,t.patches_,t.inversePatches_)):e=ef(t,n,[]),Zp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==TE?e:void 0}function ef(e,t,n){if(Wf(t))return t;const a=e.immer_.shouldUseStrictIteration(),l=t[Mn];if(!l)return Jc(t,(o,c)=>Mj(e,l,t,o,c,n),a),t;if(l.scope_!==e)return t;if(!l.modified_)return tf(e,l.base_,!0),l.base_;if(!l.finalized_){l.finalized_=!0,l.scope_.unfinalizedDrafts_--;const o=l.copy_;let c=o,f=!1;l.type_===3&&(c=new Set(o),o.clear(),f=!0),Jc(c,(d,h)=>Mj(e,l,o,d,h,n,f),a),tf(e,o,!1),n&&e.patches_&&ji("Patches").generatePatches_(l,n,e.patches_,e.inversePatches_)}return l.copy_}function Mj(e,t,n,a,l,o,c){if(l==null||typeof l!="object"&&!c)return;const f=Wf(l);if(!(f&&!c)){if(El(l)){const d=o&&t&&t.type_!==3&&!Xp(t.assigned_,a)?o.concat(a):void 0,h=ef(e,l,d);if(CE(n,a,h),El(h))e.canAutoFreeze_=!1;else return}else c&&n.add(l);if(wi(l)&&!f){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[a]===l&&f)return;ef(e,l),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&(Mo(n)?n.has(a):Object.prototype.propertyIsEnumerable.call(n,a))&&tf(e,l)}}}function tf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uy(t,n)}function dR(e,t){const n=Array.isArray(e),a={type_:n?1:0,scope_:t?t.scope_:DE(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let l=a,o=oy;n&&(l=[a],o=mo);const{revoke:c,proxy:f}=Proxy.revocable(l,o);return a.draft_=f,a.revoke_=c,f}var oy={get(e,t){if(t===Mn)return e;const n=si(e);if(!Xp(n,t))return hR(e,n,t);const a=n[t];return e.finalized_||!wi(a)?a:a===Xv(e.base_,t)?(Fv(e),e.copy_[t]=Jp(a,e)):a},has(e,t){return t in si(e)},ownKeys(e){return Reflect.ownKeys(si(e))},set(e,t,n){const a=kE(si(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){const l=Xv(si(e),t),o=l?.[Mn];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(uR(n,l)&&(n!==void 0||Xp(e.base_,t)))return!0;Fv(e),Wp(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Xv(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Fv(e),Wp(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=si(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:a.enumerable,value:n[t]}},defineProperty(){er(11)},getPrototypeOf(e){return fo(e.base_)},setPrototypeOf(){er(12)}},mo={};Jc(oy,(e,t)=>{mo[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});mo.deleteProperty=function(e,t){return mo.set.call(this,e,t,void 0)};mo.set=function(e,t,n){return oy.set.call(this,e[0],t,n,e[0])};function Xv(e,t){const n=e[Mn];return(n?si(n):e)[t]}function hR(e,t,n){const a=kE(t,n);return a?"value"in a?a.value:a.get?.call(e.draft_):void 0}function kE(e,t){if(!(t in e))return;let n=fo(e);for(;n;){const a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=fo(n)}}function Wp(e){e.modified_||(e.modified_=!0,e.parent_&&Wp(e.parent_))}function Fv(e){e.copy_||(e.copy_=Fp(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var mR=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,a)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const c=this;return function(d=o,...h){return c.produce(d,v=>n.call(this,v,...h))}}typeof n!="function"&&er(6),a!==void 0&&typeof a!="function"&&er(7);let l;if(wi(t)){const o=Nj(this),c=Jp(t,void 0);let f=!0;try{l=n(c),f=!1}finally{f?Zp(o):Qp(o)}return Ej(o,a),Tj(l,o)}else if(!t||typeof t!="object"){if(l=n(t),l===void 0&&(l=t),l===TE&&(l=void 0),this.autoFreeze_&&uy(l,!0),a){const o=[],c=[];ji("Patches").generateReplacementPatches_(t,l,o,c),a(o,c)}return l}else er(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(c,...f)=>this.produceWithPatches(c,d=>t(d,...f));let a,l;return[this.produce(t,n,(c,f)=>{a=c,l=f}),a,l]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){wi(e)||er(8),El(e)&&(e=vR(e));const t=Nj(this),n=Jp(e,void 0);return n[Mn].isManual_=!0,Qp(t),n}finishDraft(e,t){const n=e&&e[Mn];(!n||!n.isManual_)&&er(9);const{scope_:a}=n;return Ej(a,t),Tj(void 0,a)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const l=t[n];if(l.path.length===0&&l.op==="replace"){e=l.value;break}}n>-1&&(t=t.slice(n+1));const a=ji("Patches").applyPatches_;return El(e)?a(e,t):this.produce(e,l=>a(l,t))}};function Jp(e,t){const n=Mo(e)?ji("MapSet").proxyMap_(e,t):Qf(e)?ji("MapSet").proxySet_(e,t):dR(e,t);return(t?t.scope_:DE()).drafts_.push(n),n}function vR(e){return El(e)||er(10,e),PE(e)}function PE(e){if(!wi(e)||Wf(e))return e;const t=e[Mn];let n,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Fp(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else n=Fp(e,!0);return Jc(n,(l,o)=>{CE(n,l,PE(o))},a),t&&(t.finalized_=!1),n}var pR=new mR;pR.produce;var yR={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},zE=hn({name:"legend",initialState:yR,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:rt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).payload.indexOf(n);l>-1&&(e.payload[l]=a)},prepare:rt()},removeLegendPayload:{reducer(e,t){var n=nr(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:rt()}}}),{setLegendSize:Cj,setLegendSettings:gR,addLegendPayload:RE,replaceLegendPayload:LE,removeLegendPayload:$E}=zE.actions,bR=zE.reducer,xR=["contextPayload"];function e0(){return e0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t(gR(e))},[t,e]),null}function MR(e){var t=Qe();return S.useEffect(()=>(t(Cj(e)),()=>{t(Cj({width:0,height:0}))}),[t,e]),null}function CR(e,t,n,a){return e==="vertical"&&me(t)?{height:t}:e==="horizontal"?{width:n||a}:null}var DR={align:"center",iconSize:14,itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function UE(e){var t=At(e,DR),n=mz(),a=ck(),l=aR(),{width:o,height:c,wrapperStyle:f,portal:d}=t,[h,v]=BA([n]),p=iy(),b=ly();if(p==null||b==null)return null;var x=p-(l?.left||0)-(l?.right||0),O=CR(t.layout,c,o,x),j=d?f:Nl(Nl({position:"absolute",width:O?.width||o||"auto",height:O?.height||c||"auto"},NR(f,t,l,p,b,h)),f),_=d??a;if(_==null||n==null)return null;var E=S.createElement("div",{className:"recharts-legend-wrapper",style:j,ref:v},S.createElement(TR,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&S.createElement(MR,{width:h.width,height:h.height}),S.createElement(ER,e0({},t,O,{margin:l,chartWidth:p,chartHeight:b,contextPayload:n})));return U0.createPortal(E,_)}UE.displayName="Legend";function t0(){return t0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=" : ",contentStyle:n={},itemStyle:a={},labelStyle:l={},payload:o,formatter:c,itemSorter:f,wrapperClassName:d,labelClassName:h,label:v,labelFormatter:p,accessibilityLayer:b=!1}=e,x=()=>{if(o&&o.length){var T={padding:0,margin:0},C=(f?kf(o,f):o).map((R,F)=>{if(R.type==="none")return null;var ee=R.formatter||c||RR,{value:q,name:U}=R,B=q,ue=U;if(ee){var oe=ee(q,U,R,F,o);if(Array.isArray(oe))[B,ue]=oe;else if(oe!=null)B=oe;else return null}var ve=Zv({display:"block",paddingTop:4,paddingBottom:4,color:R.color||"#000"},a);return S.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(F),style:ve},pr(ue)?S.createElement("span",{className:"recharts-tooltip-item-name"},ue):null,pr(ue)?S.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,S.createElement("span",{className:"recharts-tooltip-item-value"},B),S.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return S.createElement("ul",{className:"recharts-tooltip-item-list",style:T},C)}return null},O=Zv({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},n),j=Zv({margin:0},l),_=!_t(v),E=_?v:"",N=Re("recharts-default-tooltip",d),M=Re("recharts-tooltip-label",h);_&&p&&o!==void 0&&o!==null&&(E=p(v,o));var P=b?{role:"status","aria-live":"assertive"}:{};return S.createElement("div",t0({className:N,style:O},P),S.createElement("p",{className:M,style:j},S.isValidElement(E)?E:"".concat(E)),x())},qu="recharts-tooltip-wrapper",$R={visibility:"hidden"};function UR(e){var{coordinate:t,translateX:n,translateY:a}=e;return Re(qu,{["".concat(qu,"-right")]:me(n)&&t&&me(t.x)&&n>=t.x,["".concat(qu,"-left")]:me(n)&&t&&me(t.x)&&n=t.y,["".concat(qu,"-top")]:me(a)&&t&&me(t.y)&&a0?l:0),p=n[a]+l;if(t[a])return c[a]?v:p;var b=d[a];if(b==null)return 0;if(c[a]){var x=v,O=b;return x_?Math.max(v,b):Math.max(p,b)}function qR(e){var{translateX:t,translateY:n,useTranslate3d:a}=e;return{transform:a?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function BR(e){var{allowEscapeViewBox:t,coordinate:n,offsetTopLeft:a,position:l,reverseDirection:o,tooltipBox:c,useTranslate3d:f,viewBox:d}=e,h,v,p;return c.height>0&&c.width>0&&n?(v=Pj({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:a,position:l,reverseDirection:o,tooltipDimension:c.width,viewBox:d,viewBoxDimension:d.width}),p=Pj({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:a,position:l,reverseDirection:o,tooltipDimension:c.height,viewBox:d,viewBoxDimension:d.height}),h=qR({translateX:v,translateY:p,useTranslate3d:f})):h=$R,{cssProperties:h,cssClasses:UR({translateX:v,translateY:p,coordinate:n})}}function zj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function yc(e){for(var t=1;t{if(t.key==="Escape"){var n,a,l,o;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(n=(a=this.props.coordinate)===null||a===void 0?void 0:a.x)!==null&&n!==void 0?n:0,y:(l=(o=this.props.coordinate)===null||o===void 0?void 0:o.y)!==null&&l!==void 0?l:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,n;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:n,animationDuration:a,animationEasing:l,children:o,coordinate:c,hasPayload:f,isAnimationActive:d,offset:h,position:v,reverseDirection:p,useTranslate3d:b,viewBox:x,wrapperStyle:O,lastBoundingBox:j,innerRef:_,hasPortalFromProps:E}=this.props,{cssClasses:N,cssProperties:M}=BR({allowEscapeViewBox:n,coordinate:c,offsetTopLeft:h,position:v,reverseDirection:p,tooltipBox:{height:j.height,width:j.width},useTranslate3d:b,viewBox:x}),P=E?{}:yc(yc({transition:d&&t?"transform ".concat(a,"ms ").concat(l):void 0},M),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&f?"visible":"hidden",position:"absolute",top:0,left:0}),T=yc(yc({},P),{},{visibility:!this.state.dismissed&&t&&f?"visible":"hidden"},O);return S.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:N,style:T,ref:_},o)}}var qE=()=>{var e;return(e=de(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function r0(){return r0=Object.assign?Object.assign.bind():function(e){for(var t=1;twt(e.x)&&wt(e.y),Uj=e=>e.base!=null&&nf(e.base)&&nf(e),Bu=e=>e.x,Iu=e=>e.y,XR=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Oo(e));return(n==="curveMonotone"||n==="curveBump")&&t?$j["".concat(n).concat(t==="vertical"?"Y":"X")]:$j[n]||Cf},FR=e=>{var{type:t="linear",points:n=[],baseLine:a,layout:l,connectNulls:o=!1}=e,c=XR(t,l),f=o?n.filter(nf):n,d;if(Array.isArray(a)){var h=n.map((x,O)=>Lj(Lj({},x),{},{base:a[O]}));l==="vertical"?d=sc().y(Iu).x1(Bu).x0(x=>x.base.x):d=sc().x(Bu).y1(Iu).y0(x=>x.base.y);var v=d.defined(Uj).curve(c),p=o?h.filter(Uj):h;return v(p)}l==="vertical"&&me(a)?d=sc().y(Iu).x1(Bu).x0(a):me(a)?d=sc().x(Bu).y1(Iu).y0(a):d=dA().x(Bu).y(Iu);var b=d.defined(nf).curve(c);return b(f)},sy=e=>{var{className:t,points:n,path:a,pathRef:l}=e,o=To();if((!n||!n.length)&&!a)return null;var c={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},f=n&&n.length?FR(c):a;return S.createElement("path",r0({},Gn(e),V0(e),{className:Re("recharts-curve",t),d:f===null?void 0:f,ref:l}))},ZR=["x","y","top","left","width","height","className"];function a0(){return a0=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(l,"v").concat(a,"M").concat(o,",").concat(t,"h").concat(n),a6=e=>{var{x:t=0,y:n=0,top:a=0,left:l=0,width:o=0,height:c=0,className:f}=e,d=t6(e,ZR),h=QR({x:t,y:n,top:a,left:l,width:o,height:c},d);return!me(t)||!me(n)||!me(o)||!me(c)||!me(a)||!me(l)?null:S.createElement("path",a0({},tn(h),{className:Re("recharts-cross",f),d:r6(t,n,o,c,a,l)}))};function i6(e,t,n,a){var l=a/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-l:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-l,width:e==="horizontal"?a:n.width-1,height:e==="horizontal"?n.height-1:a}}function Bj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Ij(e){for(var t=1;te.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),BE=(e,t,n)=>e.map(a=>"".concat(s6(a)," ").concat(t,"ms ").concat(n)).join(","),c6=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,a)=>n.filter(l=>a.includes(l))),vo=(e,t)=>Object.keys(t).reduce((n,a)=>Ij(Ij({},n),{},{[a]:e(a,t[a])}),{});function Hj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Ot(e){for(var t=1;te+(t-e)*n,i0=e=>{var{from:t,to:n}=e;return t!==n},IE=(e,t,n)=>{var a=vo((l,o)=>{if(i0(o)){var[c,f]=e(o.from,o.to,o.velocity);return Ot(Ot({},o),{},{from:c,velocity:f})}return o},t);return n<1?vo((l,o)=>i0(o)&&a[l]!=null?Ot(Ot({},o),{},{velocity:rf(o.velocity,a[l].velocity,n),from:rf(o.from,a[l].from,n)}):o,t):IE(e,a,n-1)};function m6(e,t,n,a,l,o){var c,f=a.reduce((b,x)=>Ot(Ot({},b),{},{[x]:{from:e[x],velocity:0,to:t[x]}}),{}),d=()=>vo((b,x)=>x.from,f),h=()=>!Object.values(f).filter(i0).length,v=null,p=b=>{c||(c=b);var x=b-c,O=x/n.dt;f=IE(n,f,O),l(Ot(Ot(Ot({},e),t),d())),c=b,h()||(v=o.setTimeout(p))};return()=>(v=o.setTimeout(p),()=>{var b;(b=v)===null||b===void 0||b()})}function v6(e,t,n,a,l,o,c){var f=null,d=l.reduce((p,b)=>{var x=e[b],O=t[b];return x==null||O==null?p:Ot(Ot({},p),{},{[b]:[x,O]})},{}),h,v=p=>{h||(h=p);var b=(p-h)/a,x=vo((j,_)=>rf(..._,n(b)),d);if(o(Ot(Ot(Ot({},e),t),x)),b<1)f=c.setTimeout(v);else{var O=vo((j,_)=>rf(..._,n(1)),d);o(Ot(Ot(Ot({},e),t),O))}};return()=>(f=c.setTimeout(v),()=>{var p;(p=f)===null||p===void 0||p()})}const p6=(e,t,n,a,l,o)=>{var c=c6(e,t);return n==null?()=>(l(Ot(Ot({},e),t)),()=>{}):n.isStepper===!0?m6(e,t,n,c,l,o):v6(e,t,n,a,c,l,o)};var af=1e-4,HE=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],KE=(e,t)=>e.map((n,a)=>n*t**a).reduce((n,a)=>n+a),Kj=(e,t)=>n=>{var a=HE(e,t);return KE(a,n)},y6=(e,t)=>n=>{var a=HE(e,t),l=[...a.map((o,c)=>o*c).slice(1),0];return KE(l,n)},g6=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var a=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(a==null||a.length!==4)return null;var l=a.map(o=>parseFloat(o));return[l[0],l[1],l[2],l[3]]},b6=function(){for(var t=arguments.length,n=new Array(t),a=0;a{var l=Kj(e,n),o=Kj(t,a),c=y6(e,n),f=h=>h>1?1:h<0?0:h,d=h=>{for(var v=h>1?1:h,p=v,b=0;b<8;++b){var x=l(p)-v,O=c(p);if(Math.abs(x-v)0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:a=8,dt:l=17}=t,o=(c,f,d)=>{var h=-(c-f)*n,v=d*a,p=d+(h-v)*l/1e3,b=d*l/1e3+c;return Math.abs(b-f){if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Yj(e);case"spring":return S6();default:if(e.split("(")[0]==="cubic-bezier")return Yj(e)}return typeof e=="function"?e:null};function j6(e){var t,n=()=>null,a=!1,l=null,o=c=>{if(!a){if(Array.isArray(c)){if(!c.length)return;var f=c,[d,...h]=f;if(typeof d=="number"){l=e.setTimeout(o.bind(null,h),d);return}o(d),l=e.setTimeout(o.bind(null,h));return}typeof c=="string"&&(t=c,n(t)),typeof c=="object"&&(t=c,n(t)),typeof c=="function"&&c()}};return{stop:()=>{a=!0},start:c=>{a=!1,l&&(l(),l=null),o(c)},subscribe:c=>(n=c,()=>{n=()=>null}),getTimeoutController:()=>e}}class O6{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=performance.now(),l=null,o=c=>{c-a>=n?t(c):typeof requestAnimationFrame=="function"&&(l=requestAnimationFrame(o))};return l=requestAnimationFrame(o),()=>{l!=null&&cancelAnimationFrame(l)}}}function _6(){return j6(new O6)}var A6=S.createContext(_6);function E6(e,t){var n=S.useContext(A6);return S.useMemo(()=>t??n(e),[e,t,n])}var N6=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Jf={isSsr:N6()},T6={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Gj={t:0},Qv={t:1};function ed(e){var t=At(e,T6),{isActive:n,canBegin:a,duration:l,easing:o,begin:c,onAnimationEnd:f,onAnimationStart:d,children:h}=t,v=n==="auto"?!Jf.isSsr:n,p=E6(t.animationId,t.animationManager),[b,x]=S.useState(v?Gj:Qv),O=S.useRef(null);return S.useEffect(()=>{v||x(Qv)},[v]),S.useEffect(()=>{if(!v||!a)return _o;var j=p6(Gj,Qv,w6(o),l,x,p.getTimeoutController()),_=()=>{O.current=j()};return p.start([d,c,_,l,f]),()=>{p.stop(),O.current&&O.current(),f()}},[v,a,l,o,c,d,f,p]),h(b.t)}function td(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=S.useRef(uo(t)),a=S.useRef(e);return a.current!==e&&(n.current=uo(t),a.current=e),n.current}var M6=["radius"],C6=["radius"],Vj,Xj,Fj,Zj,Qj,Wj,Jj,e2,t2,n2;function r2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function a2(e){for(var t=1;t{var o=za(n),c=za(a),f=Math.min(Math.abs(o)/2,Math.abs(c)/2),d=c>=0?1:-1,h=o>=0?1:-1,v=c>=0&&o>=0||c<0&&o<0?1:0,p;if(f>0&&l instanceof Array){for(var b=[0,0,0,0],x=0,O=4;xf?f:l[x];p=ct(Vj||(Vj=fr(["M",",",""])),e,t+d*b[0]),b[0]>0&&(p+=ct(Xj||(Xj=fr(["A ",",",",0,0,",",",",",""])),b[0],b[0],v,e+h*b[0],t)),p+=ct(Fj||(Fj=fr(["L ",",",""])),e+n-h*b[1],t),b[1]>0&&(p+=ct(Zj||(Zj=fr(["A ",",",",0,0,",`, `,",",""])),b[1],b[1],v,e+n,t+d*b[1])),p+=ct(Qj||(Qj=fr(["L ",",",""])),e+n,t+a-d*b[2]),b[2]>0&&(p+=ct(Wj||(Wj=fr(["A ",",",",0,0,",`, `,",",""])),b[2],b[2],v,e+n-h*b[2],t+a)),p+=ct(Jj||(Jj=fr(["L ",",",""])),e+h*b[3],t+a),b[3]>0&&(p+=ct(e2||(e2=fr(["A ",",",",0,0,",`, `,",",""])),b[3],b[3],v,e,t+a-d*b[3])),p+="Z"}else if(f>0&&l===+l&&l>0){var j=Math.min(f,l);p=ct(t2||(t2=fr(["M ",",",` @@ -22,7 +22,7 @@ Error generating stack: `+s.message+` L `,",",` A `,",",",0,0,",",",",",` L `,",",` - A `,",",",0,0,",",",","," Z"])),e,t+d*j,j,j,v,e+h*j,t,e+n-h*j,t,j,j,v,e+n,t+d*j,e+n,t+a-d*j,j,j,v,e+n-h*j,t+a,e+h*j,t+a,j,j,v,e,t+a-d*j)}else p=ct(n2||(n2=fr(["M ",","," h "," v "," h "," Z"])),e,t,n,a,-n);return p},u2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},YE=e=>{var t=At(e,u2),n=S.useRef(null),[a,l]=S.useState(-1);S.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var ee=n.current.getTotalLength();ee&&l(ee)}catch{}},[]);var{x:o,y:c,width:f,height:d,radius:h,className:v}=t,{animationEasing:p,animationDuration:b,animationBegin:x,isAnimationActive:O,isUpdateAnimationActive:j}=t,_=S.useRef(f),E=S.useRef(d),N=S.useRef(o),M=S.useRef(c),P=S.useMemo(()=>({x:o,y:c,width:f,height:d,radius:h}),[o,c,f,d,h]),T=td(P,"rectangle-");if(o!==+o||c!==+c||f!==+f||d!==+d||f===0||d===0)return null;var C=Re("recharts-rectangle",v);if(!j){var L=tn(t),{radius:Z}=L,ne=i2(L,M6);return S.createElement("path",lf({},ne,{x:za(o),y:za(c),width:za(f),height:za(d),radius:typeof h=="number"?h:void 0,className:C,d:l2(o,c,f,d,h)}))}var q=_.current,U=E.current,B=N.current,ue=M.current,oe="0px ".concat(a===-1?1:a,"px"),ve="".concat(a,"px 0px"),K=BE(["strokeDasharray"],b,typeof p=="string"?p:u2.animationEasing);return S.createElement(ed,{animationId:T,key:T,canBegin:a>0,duration:b,easing:p,isActive:j,begin:x},ee=>{var z=Qt(q,f,ee),G=Qt(U,d,ee),re=Qt(B,o,ee),k=Qt(ue,c,ee);n.current&&(_.current=z,E.current=G,N.current=re,M.current=k);var F;O?ee>0?F={transition:K,strokeDasharray:ve}:F={strokeDasharray:oe}:F={strokeDasharray:ve};var ie=tn(t),{radius:le}=ie,ye=i2(ie,C6);return S.createElement("path",lf({},ye,{radius:typeof h=="number"?h:void 0,className:C,d:l2(re,k,z,G,h),ref:n,style:a2(a2({},F),t.style)}))})};function o2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function s2(e){for(var t=1;te*180/Math.PI,xt=(e,t,n,a)=>({x:e+Math.cos(-uf*a)*n,y:t+Math.sin(-uf*a)*n}),GE=function(t,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(a.left||0)-(a.right||0)),Math.abs(n-(a.top||0)-(a.bottom||0)))/2},q6=(e,t)=>{var{x:n,y:a}=e,{x:l,y:o}=t;return Math.sqrt((n-l)**2+(a-o)**2)},B6=(e,t)=>{var{x:n,y:a}=e,{cx:l,cy:o}=t,c=q6({x:n,y:a},{x:l,y:o});if(c<=0)return{radius:c,angle:0};var f=(n-l)/c,d=Math.acos(f);return a>o&&(d=2*Math.PI-d),{radius:c,angle:U6(d),angleInRadian:d}},I6=e=>{var{startAngle:t,endAngle:n}=e,a=Math.floor(t/360),l=Math.floor(n/360),o=Math.min(a,l);return{startAngle:t-o*360,endAngle:n-o*360}},H6=(e,t)=>{var{startAngle:n,endAngle:a}=t,l=Math.floor(n/360),o=Math.floor(a/360),c=Math.min(l,o);return e+c*360},K6=(e,t)=>{var{chartX:n,chartY:a}=e,{radius:l,angle:o}=B6({x:n,y:a},t),{innerRadius:c,outerRadius:f}=t;if(lf||l===0)return null;var{startAngle:d,endAngle:h}=I6(t),v=o,p;if(d<=h){for(;v>h;)v-=360;for(;v=d&&v<=h}else{for(;v>d;)v-=360;for(;v=h&&v<=d}return p?s2(s2({},t),{},{radius:l,angle:H6(v,t)}):null};function VE(e){var{cx:t,cy:n,radius:a,startAngle:l,endAngle:o}=e,c=xt(t,n,a,l),f=xt(t,n,a,o);return{points:[c,f],cx:t,cy:n,radius:a,startAngle:l,endAngle:o}}var c2,f2,d2,h2,m2,v2,p2;function l0(){return l0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=Wt(t-e),a=Math.min(Math.abs(t-e),359.999);return n*a},gc=e=>{var{cx:t,cy:n,radius:a,angle:l,sign:o,isExternal:c,cornerRadius:f,cornerIsExternal:d}=e,h=f*(c?1:-1)+a,v=Math.asin(f/h)/uf,p=d?l:l+o*v,b=xt(t,n,h,p),x=xt(t,n,a,p),O=d?l-o*v:l,j=xt(t,n,h*Math.cos(v*uf),O);return{center:b,circleTangency:x,lineTangency:j,theta:v}},XE=e=>{var{cx:t,cy:n,innerRadius:a,outerRadius:l,startAngle:o,endAngle:c}=e,f=Y6(o,c),d=o+f,h=xt(t,n,l,o),v=xt(t,n,l,d),p=ct(c2||(c2=di(["M ",",",` + A `,",",",0,0,",",",","," Z"])),e,t+d*j,j,j,v,e+h*j,t,e+n-h*j,t,j,j,v,e+n,t+d*j,e+n,t+a-d*j,j,j,v,e+n-h*j,t+a,e+h*j,t+a,j,j,v,e,t+a-d*j)}else p=ct(n2||(n2=fr(["M ",","," h "," v "," h "," Z"])),e,t,n,a,-n);return p},u2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},YE=e=>{var t=At(e,u2),n=S.useRef(null),[a,l]=S.useState(-1);S.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var te=n.current.getTotalLength();te&&l(te)}catch{}},[]);var{x:o,y:c,width:f,height:d,radius:h,className:v}=t,{animationEasing:p,animationDuration:b,animationBegin:x,isAnimationActive:O,isUpdateAnimationActive:j}=t,_=S.useRef(f),E=S.useRef(d),N=S.useRef(o),M=S.useRef(c),P=S.useMemo(()=>({x:o,y:c,width:f,height:d,radius:h}),[o,c,f,d,h]),T=td(P,"rectangle-");if(o!==+o||c!==+c||f!==+f||d!==+d||f===0||d===0)return null;var C=Re("recharts-rectangle",v);if(!j){var R=tn(t),{radius:F}=R,ee=i2(R,M6);return S.createElement("path",lf({},ee,{x:za(o),y:za(c),width:za(f),height:za(d),radius:typeof h=="number"?h:void 0,className:C,d:l2(o,c,f,d,h)}))}var q=_.current,U=E.current,B=N.current,ue=M.current,oe="0px ".concat(a===-1?1:a,"px"),ve="".concat(a,"px 0px"),K=BE(["strokeDasharray"],b,typeof p=="string"?p:u2.animationEasing);return S.createElement(ed,{animationId:T,key:T,canBegin:a>0,duration:b,easing:p,isActive:j,begin:x},te=>{var z=Qt(q,f,te),G=Qt(U,d,te),re=Qt(B,o,te),k=Qt(ue,c,te);n.current&&(_.current=z,E.current=G,N.current=re,M.current=k);var Z;O?te>0?Z={transition:K,strokeDasharray:ve}:Z={strokeDasharray:oe}:Z={strokeDasharray:ve};var ie=tn(t),{radius:le}=ie,ye=i2(ie,C6);return S.createElement("path",lf({},ye,{radius:typeof h=="number"?h:void 0,className:C,d:l2(re,k,z,G,h),ref:n,style:a2(a2({},Z),t.style)}))})};function o2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function s2(e){for(var t=1;te*180/Math.PI,xt=(e,t,n,a)=>({x:e+Math.cos(-uf*a)*n,y:t+Math.sin(-uf*a)*n}),GE=function(t,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(a.left||0)-(a.right||0)),Math.abs(n-(a.top||0)-(a.bottom||0)))/2},q6=(e,t)=>{var{x:n,y:a}=e,{x:l,y:o}=t;return Math.sqrt((n-l)**2+(a-o)**2)},B6=(e,t)=>{var{x:n,y:a}=e,{cx:l,cy:o}=t,c=q6({x:n,y:a},{x:l,y:o});if(c<=0)return{radius:c,angle:0};var f=(n-l)/c,d=Math.acos(f);return a>o&&(d=2*Math.PI-d),{radius:c,angle:U6(d),angleInRadian:d}},I6=e=>{var{startAngle:t,endAngle:n}=e,a=Math.floor(t/360),l=Math.floor(n/360),o=Math.min(a,l);return{startAngle:t-o*360,endAngle:n-o*360}},H6=(e,t)=>{var{startAngle:n,endAngle:a}=t,l=Math.floor(n/360),o=Math.floor(a/360),c=Math.min(l,o);return e+c*360},K6=(e,t)=>{var{chartX:n,chartY:a}=e,{radius:l,angle:o}=B6({x:n,y:a},t),{innerRadius:c,outerRadius:f}=t;if(lf||l===0)return null;var{startAngle:d,endAngle:h}=I6(t),v=o,p;if(d<=h){for(;v>h;)v-=360;for(;v=d&&v<=h}else{for(;v>d;)v-=360;for(;v=h&&v<=d}return p?s2(s2({},t),{},{radius:l,angle:H6(v,t)}):null};function VE(e){var{cx:t,cy:n,radius:a,startAngle:l,endAngle:o}=e,c=xt(t,n,a,l),f=xt(t,n,a,o);return{points:[c,f],cx:t,cy:n,radius:a,startAngle:l,endAngle:o}}var c2,f2,d2,h2,m2,v2,p2;function l0(){return l0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=Wt(t-e),a=Math.min(Math.abs(t-e),359.999);return n*a},gc=e=>{var{cx:t,cy:n,radius:a,angle:l,sign:o,isExternal:c,cornerRadius:f,cornerIsExternal:d}=e,h=f*(c?1:-1)+a,v=Math.asin(f/h)/uf,p=d?l:l+o*v,b=xt(t,n,h,p),x=xt(t,n,a,p),O=d?l-o*v:l,j=xt(t,n,h*Math.cos(v*uf),O);return{center:b,circleTangency:x,lineTangency:j,theta:v}},XE=e=>{var{cx:t,cy:n,innerRadius:a,outerRadius:l,startAngle:o,endAngle:c}=e,f=Y6(o,c),d=o+f,h=xt(t,n,l,o),v=xt(t,n,l,d),p=ct(c2||(c2=di(["M ",",",` A `,",",`,0, `,",",`, `,",",` @@ -36,11 +36,11 @@ Error generating stack: `+s.message+` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",",` - `])),b.x,b.y,o,o,+(v<0),p.x,p.y,l,l,+(E>180),+(v<0),O.x,O.y,o,o,+(v<0),j.x,j.y);if(a>0){var{circleTangency:M,lineTangency:P,theta:T}=gc({cx:t,cy:n,radius:a,angle:d,sign:v,isExternal:!0,cornerRadius:o,cornerIsExternal:f}),{circleTangency:C,lineTangency:L,theta:Z}=gc({cx:t,cy:n,radius:a,angle:h,sign:-v,isExternal:!0,cornerRadius:o,cornerIsExternal:f}),ne=f?Math.abs(d-h):Math.abs(d-h)-T-Z;if(ne<0&&o===0)return"".concat(N,"L").concat(t,",").concat(n,"Z");N+=ct(v2||(v2=di(["L",",",` + `])),b.x,b.y,o,o,+(v<0),p.x,p.y,l,l,+(E>180),+(v<0),O.x,O.y,o,o,+(v<0),j.x,j.y);if(a>0){var{circleTangency:M,lineTangency:P,theta:T}=gc({cx:t,cy:n,radius:a,angle:d,sign:v,isExternal:!0,cornerRadius:o,cornerIsExternal:f}),{circleTangency:C,lineTangency:R,theta:F}=gc({cx:t,cy:n,radius:a,angle:h,sign:-v,isExternal:!0,cornerRadius:o,cornerIsExternal:f}),ee=f?Math.abs(d-h):Math.abs(d-h)-T-F;if(ee<0&&o===0)return"".concat(N,"L").concat(t,",").concat(n,"Z");N+=ct(v2||(v2=di(["L",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` - A`,",",",0,0,",",",",","Z"])),L.x,L.y,o,o,+(v<0),C.x,C.y,a,a,+(ne>180),+(v>0),M.x,M.y,o,o,+(v<0),P.x,P.y)}else N+=ct(p2||(p2=di(["L",",","Z"])),t,n);return N},V6={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},FE=e=>{var t=At(e,V6),{cx:n,cy:a,innerRadius:l,outerRadius:o,cornerRadius:c,forceCornerRadius:f,cornerIsExternal:d,startAngle:h,endAngle:v,className:p}=t;if(o0&&Math.abs(h-v)<360?j=G6({cx:n,cy:a,innerRadius:l,outerRadius:o,cornerRadius:Math.min(O,x/2),forceCornerRadius:f,cornerIsExternal:d,startAngle:h,endAngle:v}):j=XE({cx:n,cy:a,innerRadius:l,outerRadius:o,startAngle:h,endAngle:v}),S.createElement("path",l0({},tn(t),{className:b,d:j}))};function X6(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(EA(t)){if(e==="centric"){var{cx:a,cy:l,innerRadius:o,outerRadius:c,angle:f}=t,d=xt(a,l,o,f),h=xt(a,l,c,f);return[{x:d.x,y:d.y},{x:h.x,y:h.y}]}return VE(t)}}var Wv={},Jv={},ep={},y2;function F6(){return y2||(y2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$A();function n(a){return t.isSymbol(a)?NaN:Number(a)}e.toNumber=n})(ep)),ep}var g2;function Z6(){return g2||(g2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F6();function n(a){return a?(a=t.toNumber(a),a===1/0||a===-1/0?(a<0?-1:1)*Number.MAX_VALUE:a===a?a:0):a===0?a:0}e.toFinite=n})(Jv)),Jv}var b2;function Q6(){return b2||(b2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UA(),n=Z6();function a(l,o,c){c&&typeof c!="number"&&t.isIterateeCall(l,o,c)&&(o=c=void 0),l=n.toFinite(l),o===void 0?(o=l,l=0):o=n.toFinite(o),c=c===void 0?lt?1:e>=t?0:NaN}function e8(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function cy(e){let t,n,a;e.length!==2?(t=Ra,n=(f,d)=>Ra(e(f),d),a=(f,d)=>e(f)-d):(t=e===Ra||e===e8?e:t8,n=e,a=e);function l(f,d,h=0,v=f.length){if(h>>1;n(f[p],d)<0?h=p+1:v=p}while(h>>1;n(f[p],d)<=0?h=p+1:v=p}while(hh&&a(f[p-1],d)>-a(f[p],d)?p-1:p}return{left:l,center:c,right:o}}function t8(){return 0}function QE(e){return e===null?NaN:+e}function*n8(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const r8=cy(Ra),Co=r8.right;cy(QE).center;class S2 extends Map{constructor(t,n=l8){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[a,l]of t)this.set(a,l)}get(t){return super.get(w2(this,t))}has(t){return super.has(w2(this,t))}set(t,n){return super.set(a8(this,t),n)}delete(t){return super.delete(i8(this,t))}}function w2({_intern:e,_key:t},n){const a=t(n);return e.has(a)?e.get(a):n}function a8({_intern:e,_key:t},n){const a=t(n);return e.has(a)?e.get(a):(e.set(a,n),n)}function i8({_intern:e,_key:t},n){const a=t(n);return e.has(a)&&(n=e.get(a),e.delete(a)),n}function l8(e){return e!==null&&typeof e=="object"?e.valueOf():e}function u8(e=Ra){if(e===Ra)return WE;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const a=e(t,n);return a||a===0?a:(e(n,n)===0)-(e(t,t)===0)}}function WE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const o8=Math.sqrt(50),s8=Math.sqrt(10),c8=Math.sqrt(2);function of(e,t,n){const a=(t-e)/Math.max(0,n),l=Math.floor(Math.log10(a)),o=a/Math.pow(10,l),c=o>=o8?10:o>=s8?5:o>=c8?2:1;let f,d,h;return l<0?(h=Math.pow(10,-l)/c,f=Math.round(e*h),d=Math.round(t*h),f/ht&&--d,h=-h):(h=Math.pow(10,l)*c,f=Math.round(e/h),d=Math.round(t/h),f*ht&&--d),d0))return[];if(e===t)return[e];const a=t=l))return[];const f=o-l+1,d=new Array(f);if(a)if(c<0)for(let h=0;h=a)&&(n=a);return n}function O2(e,t){let n;for(const a of e)a!=null&&(n>a||n===void 0&&a>=a)&&(n=a);return n}function JE(e,t,n=0,a=1/0,l){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),a=Math.floor(Math.min(e.length-1,a)),!(n<=t&&t<=a))return e;for(l=l===void 0?WE:u8(l);a>n;){if(a-n>600){const d=a-n+1,h=t-n+1,v=Math.log(d),p=.5*Math.exp(2*v/3),b=.5*Math.sqrt(v*p*(d-p)/d)*(h-d/2<0?-1:1),x=Math.max(n,Math.floor(t-h*p/d+b)),O=Math.min(a,Math.floor(t+(d-h)*p/d+b));JE(e,t,x,O,l)}const o=e[t];let c=n,f=a;for(Hu(e,n,t),l(e[a],o)>0&&Hu(e,n,a);c0;)--f}l(e[n],o)===0?Hu(e,n,f):(++f,Hu(e,f,a)),f<=t&&(n=f+1),t<=f&&(a=f-1)}return e}function Hu(e,t,n){const a=e[t];e[t]=e[n],e[n]=a}function f8(e,t,n){if(e=Float64Array.from(n8(e)),!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return O2(e);if(t>=1)return j2(e);var a,l=(a-1)*t,o=Math.floor(l),c=j2(JE(e,o).subarray(0,o+1)),f=O2(e.subarray(o+1));return c+(f-c)*(l-o)}}function d8(e,t,n=QE){if(!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return+n(e[0],0,e);if(t>=1)return+n(e[a-1],a-1,e);var a,l=(a-1)*t,o=Math.floor(l),c=+n(e[o],o,e),f=+n(e[o+1],o+1,e);return c+(f-c)*(l-o)}}function h8(e,t,n){e=+e,t=+t,n=(l=arguments.length)<2?(t=e,e=0,1):l<3?1:+n;for(var a=-1,l=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(l);++a>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?bc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?bc(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=p8.exec(e))?new fn(t[1],t[2],t[3],1):(t=y8.exec(e))?new fn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=g8.exec(e))?bc(t[1],t[2],t[3],t[4]):(t=b8.exec(e))?bc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=x8.exec(e))?C2(t[1],t[2]/100,t[3]/100,1):(t=S8.exec(e))?C2(t[1],t[2]/100,t[3]/100,t[4]):_2.hasOwnProperty(e)?N2(_2[e]):e==="transparent"?new fn(NaN,NaN,NaN,0):null}function N2(e){return new fn(e>>16&255,e>>8&255,e&255,1)}function bc(e,t,n,a){return a<=0&&(e=t=n=NaN),new fn(e,t,n,a)}function O8(e){return e instanceof Do||(e=go(e)),e?(e=e.rgb(),new fn(e.r,e.g,e.b,e.opacity)):new fn}function f0(e,t,n,a){return arguments.length===1?O8(e):new fn(e,t,n,a??1)}function fn(e,t,n,a){this.r=+e,this.g=+t,this.b=+n,this.opacity=+a}hy(fn,f0,tN(Do,{brighter(e){return e=e==null?sf:Math.pow(sf,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?po:Math.pow(po,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fn(yi(this.r),yi(this.g),yi(this.b),cf(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:T2,formatHex:T2,formatHex8:_8,formatRgb:M2,toString:M2}));function T2(){return`#${hi(this.r)}${hi(this.g)}${hi(this.b)}`}function _8(){return`#${hi(this.r)}${hi(this.g)}${hi(this.b)}${hi((isNaN(this.opacity)?1:this.opacity)*255)}`}function M2(){const e=cf(this.opacity);return`${e===1?"rgb(":"rgba("}${yi(this.r)}, ${yi(this.g)}, ${yi(this.b)}${e===1?")":`, ${e})`}`}function cf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function hi(e){return e=yi(e),(e<16?"0":"")+e.toString(16)}function C2(e,t,n,a){return a<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tr(e,t,n,a)}function nN(e){if(e instanceof tr)return new tr(e.h,e.s,e.l,e.opacity);if(e instanceof Do||(e=go(e)),!e)return new tr;if(e instanceof tr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,a=e.b/255,l=Math.min(t,n,a),o=Math.max(t,n,a),c=NaN,f=o-l,d=(o+l)/2;return f?(t===o?c=(n-a)/f+(n0&&d<1?0:c,new tr(c,f,d,e.opacity)}function A8(e,t,n,a){return arguments.length===1?nN(e):new tr(e,t,n,a??1)}function tr(e,t,n,a){this.h=+e,this.s=+t,this.l=+n,this.opacity=+a}hy(tr,A8,tN(Do,{brighter(e){return e=e==null?sf:Math.pow(sf,e),new tr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?po:Math.pow(po,e),new tr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,a=n+(n<.5?n:1-n)*t,l=2*n-a;return new fn(np(e>=240?e-240:e+120,l,a),np(e,l,a),np(e<120?e+240:e-120,l,a),this.opacity)},clamp(){return new tr(D2(this.h),xc(this.s),xc(this.l),cf(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=cf(this.opacity);return`${e===1?"hsl(":"hsla("}${D2(this.h)}, ${xc(this.s)*100}%, ${xc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function D2(e){return e=(e||0)%360,e<0?e+360:e}function xc(e){return Math.max(0,Math.min(1,e||0))}function np(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const my=e=>()=>e;function E8(e,t){return function(n){return e+n*t}}function N8(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(a){return Math.pow(e+a*t,n)}}function T8(e){return(e=+e)==1?rN:function(t,n){return n-t?N8(t,n,e):my(isNaN(t)?n:t)}}function rN(e,t){var n=t-e;return n?E8(e,n):my(isNaN(e)?t:e)}const k2=(function e(t){var n=T8(t);function a(l,o){var c=n((l=f0(l)).r,(o=f0(o)).r),f=n(l.g,o.g),d=n(l.b,o.b),h=rN(l.opacity,o.opacity);return function(v){return l.r=c(v),l.g=f(v),l.b=d(v),l.opacity=h(v),l+""}}return a.gamma=e,a})(1);function M8(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,a=t.slice(),l;return function(o){for(l=0;ln&&(o=t.slice(n,o),f[c]?f[c]+=o:f[++c]=o),(a=a[0])===(l=l[0])?f[c]?f[c]+=l:f[++c]=l:(f[++c]=null,d.push({i:c,x:ff(a,l)})),n=rp.lastIndex;return nt&&(n=e,e=t,t=n),function(a){return Math.max(e,Math.min(t,a))}}function B8(e,t,n){var a=e[0],l=e[1],o=t[0],c=t[1];return l2?I8:B8,d=h=null,p}function p(b){return b==null||isNaN(b=+b)?o:(d||(d=f(e.map(a),t,n)))(a(c(b)))}return p.invert=function(b){return c(l((h||(h=f(t,e.map(a),ff)))(b)))},p.domain=function(b){return arguments.length?(e=Array.from(b,df),v()):e.slice()},p.range=function(b){return arguments.length?(t=Array.from(b),v()):t.slice()},p.rangeRound=function(b){return t=Array.from(b),n=vy,v()},p.clamp=function(b){return arguments.length?(c=b?!0:en,v()):c!==en},p.interpolate=function(b){return arguments.length?(n=b,v()):n},p.unknown=function(b){return arguments.length?(o=b,p):o},function(b,x){return a=b,l=x,v()}}function py(){return nd()(en,en)}function H8(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function hf(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),a=e.slice(0,n);return[a.length>1?a[0]+a.slice(2):a,+e.slice(n+1)]}function Tl(e){return e=hf(Math.abs(e)),e?e[1]:NaN}function K8(e,t){return function(n,a){for(var l=n.length,o=[],c=0,f=e[0],d=0;l>0&&f>0&&(d+f+1>a&&(f=Math.max(1,a-d)),o.push(n.substring(l-=f,l+f)),!((d+=f+1)>a));)f=e[c=(c+1)%e.length];return o.reverse().join(t)}}function Y8(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var G8=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function bo(e){if(!(t=G8.exec(e)))throw new Error("invalid format: "+e);var t;return new yy({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]})}bo.prototype=yy.prototype;function yy(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+""}yy.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 V8(e){e:for(var t=e.length,n=1,a=-1,l;n0&&(a=0);break}return a>0?e.slice(0,a)+e.slice(l+1):e}var mf;function X8(e,t){var n=hf(e,t);if(!n)return mf=void 0,e.toPrecision(t);var a=n[0],l=n[1],o=l-(mf=Math.max(-8,Math.min(8,Math.floor(l/3)))*3)+1,c=a.length;return o===c?a:o>c?a+new Array(o-c+1).join("0"):o>0?a.slice(0,o)+"."+a.slice(o):"0."+new Array(1-o).join("0")+hf(e,Math.max(0,t+o-1))[0]}function z2(e,t){var n=hf(e,t);if(!n)return e+"";var a=n[0],l=n[1];return l<0?"0."+new Array(-l).join("0")+a:a.length>l+1?a.slice(0,l+1)+"."+a.slice(l+1):a+new Array(l-a.length+2).join("0")}const R2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:H8,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)=>z2(e*100,t),r:z2,s:X8,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function L2(e){return e}var $2=Array.prototype.map,U2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function F8(e){var t=e.grouping===void 0||e.thousands===void 0?L2:K8($2.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",a=e.currency===void 0?"":e.currency[1]+"",l=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?L2:Y8($2.call(e.numerals,String)),c=e.percent===void 0?"%":e.percent+"",f=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function h(p,b){p=bo(p);var x=p.fill,O=p.align,j=p.sign,_=p.symbol,E=p.zero,N=p.width,M=p.comma,P=p.precision,T=p.trim,C=p.type;C==="n"?(M=!0,C="g"):R2[C]||(P===void 0&&(P=12),T=!0,C="g"),(E||x==="0"&&O==="=")&&(E=!0,x="0",O="=");var L=(b&&b.prefix!==void 0?b.prefix:"")+(_==="$"?n:_==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),Z=(_==="$"?a:/[%p]/.test(C)?c:"")+(b&&b.suffix!==void 0?b.suffix:""),ne=R2[C],q=/[defgprs%]/.test(C);P=P===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function U(B){var ue=L,oe=Z,ve,K,ee;if(C==="c")oe=ne(B)+oe,B="";else{B=+B;var z=B<0||1/B<0;if(B=isNaN(B)?d:ne(Math.abs(B),P),T&&(B=V8(B)),z&&+B==0&&j!=="+"&&(z=!1),ue=(z?j==="("?j:f:j==="-"||j==="("?"":j)+ue,oe=(C==="s"&&!isNaN(B)&&mf!==void 0?U2[8+mf/3]:"")+oe+(z&&j==="("?")":""),q){for(ve=-1,K=B.length;++veee||ee>57){oe=(ee===46?l+B.slice(ve+1):B.slice(ve))+oe,B=B.slice(0,ve);break}}}M&&!E&&(B=t(B,1/0));var G=ue.length+B.length+oe.length,re=G>1)+ue+B+oe+re.slice(G);break;default:B=re+ue+B+oe;break}return o(B)}return U.toString=function(){return p+""},U}function v(p,b){var x=Math.max(-8,Math.min(8,Math.floor(Tl(b)/3)))*3,O=Math.pow(10,-x),j=h((p=bo(p),p.type="f",p),{suffix:U2[8+x/3]});return function(_){return j(O*_)}}return{format:h,formatPrefix:v}}var Sc,gy,aN;Z8({thousands:",",grouping:[3],currency:["$",""]});function Z8(e){return Sc=F8(e),gy=Sc.format,aN=Sc.formatPrefix,Sc}function Q8(e){return Math.max(0,-Tl(Math.abs(e)))}function W8(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Tl(t)/3)))*3-Tl(Math.abs(e)))}function J8(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Tl(t)-Tl(e))+1}function iN(e,t,n,a){var l=s0(e,t,n),o;switch(a=bo(a??",f"),a.type){case"s":{var c=Math.max(Math.abs(e),Math.abs(t));return a.precision==null&&!isNaN(o=W8(l,c))&&(a.precision=o),aN(a,c)}case"":case"e":case"g":case"p":case"r":{a.precision==null&&!isNaN(o=J8(l,Math.max(Math.abs(e),Math.abs(t))))&&(a.precision=o-(a.type==="e"));break}case"f":case"%":{a.precision==null&&!isNaN(o=Q8(l))&&(a.precision=o-(a.type==="%")*2);break}}return gy(a)}function qa(e){var t=e.domain;return e.ticks=function(n){var a=t();return u0(a[0],a[a.length-1],n??10)},e.tickFormat=function(n,a){var l=t();return iN(l[0],l[l.length-1],n??10,a)},e.nice=function(n){n==null&&(n=10);var a=t(),l=0,o=a.length-1,c=a[l],f=a[o],d,h,v=10;for(f0;){if(h=o0(c,f,n),h===d)return a[l]=c,a[o]=f,t(a);if(h>0)c=Math.floor(c/h)*h,f=Math.ceil(f/h)*h;else if(h<0)c=Math.ceil(c*h)/h,f=Math.floor(f*h)/h;else break;d=h}return e},e}function lN(){var e=py();return e.copy=function(){return ko(e,lN())},Fn.apply(e,arguments),qa(e)}function uN(e){var t;function n(a){return a==null||isNaN(a=+a)?t:a}return n.invert=n,n.domain=n.range=function(a){return arguments.length?(e=Array.from(a,df),n):e.slice()},n.unknown=function(a){return arguments.length?(t=a,n):t},n.copy=function(){return uN(e).unknown(t)},e=arguments.length?Array.from(e,df):[0,1],qa(n)}function oN(e,t){e=e.slice();var n=0,a=e.length-1,l=e[n],o=e[a],c;return oMath.pow(e,t)}function aL(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 I2(e){return(t,n)=>-e(-t,n)}function by(e){const t=e(q2,B2),n=t.domain;let a=10,l,o;function c(){return l=aL(a),o=rL(a),n()[0]<0?(l=I2(l),o=I2(o),e(eL,tL)):e(q2,B2),t}return t.base=function(f){return arguments.length?(a=+f,c()):a},t.domain=function(f){return arguments.length?(n(f),c()):n()},t.ticks=f=>{const d=n();let h=d[0],v=d[d.length-1];const p=v0){for(;b<=x;++b)for(O=1;Ov)break;E.push(j)}}else for(;b<=x;++b)for(O=a-1;O>=1;--O)if(j=b>0?O/o(-b):O*o(b),!(jv)break;E.push(j)}E.length*2<_&&(E=u0(h,v,_))}else E=u0(b,x,Math.min(x-b,_)).map(o);return p?E.reverse():E},t.tickFormat=(f,d)=>{if(f==null&&(f=10),d==null&&(d=a===10?"s":","),typeof d!="function"&&(!(a%1)&&(d=bo(d)).precision==null&&(d.trim=!0),d=gy(d)),f===1/0)return d;const h=Math.max(1,a*f/t.ticks().length);return v=>{let p=v/o(Math.round(l(v)));return p*an(oN(n(),{floor:f=>o(Math.floor(l(f))),ceil:f=>o(Math.ceil(l(f)))})),t}function sN(){const e=by(nd()).domain([1,10]);return e.copy=()=>ko(e,sN()).base(e.base()),Fn.apply(e,arguments),e}function H2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function K2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function xy(e){var t=1,n=e(H2(t),K2(t));return n.constant=function(a){return arguments.length?e(H2(t=+a),K2(t)):t},qa(n)}function cN(){var e=xy(nd());return e.copy=function(){return ko(e,cN()).constant(e.constant())},Fn.apply(e,arguments)}function Y2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iL(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function lL(e){return e<0?-e*e:e*e}function Sy(e){var t=e(en,en),n=1;function a(){return n===1?e(en,en):n===.5?e(iL,lL):e(Y2(n),Y2(1/n))}return t.exponent=function(l){return arguments.length?(n=+l,a()):n},qa(t)}function wy(){var e=Sy(nd());return e.copy=function(){return ko(e,wy()).exponent(e.exponent())},Fn.apply(e,arguments),e}function uL(){return wy.apply(null,arguments).exponent(.5)}function G2(e){return Math.sign(e)*e*e}function oL(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function fN(){var e=py(),t=[0,1],n=!1,a;function l(o){var c=oL(e(o));return isNaN(c)?a:n?Math.round(c):c}return l.invert=function(o){return e.invert(G2(o))},l.domain=function(o){return arguments.length?(e.domain(o),l):e.domain()},l.range=function(o){return arguments.length?(e.range((t=Array.from(o,df)).map(G2)),l):t.slice()},l.rangeRound=function(o){return l.range(o).round(!0)},l.round=function(o){return arguments.length?(n=!!o,l):n},l.clamp=function(o){return arguments.length?(e.clamp(o),l):e.clamp()},l.unknown=function(o){return arguments.length?(a=o,l):a},l.copy=function(){return fN(e.domain(),t).round(n).clamp(e.clamp()).unknown(a)},Fn.apply(l,arguments),qa(l)}function dN(){var e=[],t=[],n=[],a;function l(){var c=0,f=Math.max(1,t.length);for(n=new Array(f-1);++c0?n[f-1]:e[0],f=n?[a[n-1],t]:[a[h-1],a[h]]},c.unknown=function(d){return arguments.length&&(o=d),c},c.thresholds=function(){return a.slice()},c.copy=function(){return hN().domain([e,t]).range(l).unknown(o)},Fn.apply(qa(c),arguments)}function mN(){var e=[.5],t=[0,1],n,a=1;function l(o){return o!=null&&o<=o?t[Co(e,o,0,a)]:n}return l.domain=function(o){return arguments.length?(e=Array.from(o),a=Math.min(e.length,t.length-1),l):e.slice()},l.range=function(o){return arguments.length?(t=Array.from(o),a=Math.min(e.length,t.length-1),l):t.slice()},l.invertExtent=function(o){var c=t.indexOf(o);return[e[c-1],e[c]]},l.unknown=function(o){return arguments.length?(n=o,l):n},l.copy=function(){return mN().domain(e).range(t).unknown(n)},Fn.apply(l,arguments)}const ap=new Date,ip=new Date;function Et(e,t,n,a){function l(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return l.floor=o=>(e(o=new Date(+o)),o),l.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),l.round=o=>{const c=l(o),f=l.ceil(o);return o-c(t(o=new Date(+o),c==null?1:Math.floor(c)),o),l.range=(o,c,f)=>{const d=[];if(o=l.ceil(o),f=f==null?1:Math.floor(f),!(o0))return d;let h;do d.push(h=new Date(+o)),t(o,f),e(o);while(hEt(c=>{if(c>=c)for(;e(c),!o(c);)c.setTime(c-1)},(c,f)=>{if(c>=c)if(f<0)for(;++f<=0;)for(;t(c,-1),!o(c););else for(;--f>=0;)for(;t(c,1),!o(c););}),n&&(l.count=(o,c)=>(ap.setTime(+o),ip.setTime(+c),e(ap),e(ip),Math.floor(n(ap,ip))),l.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?l.filter(a?c=>a(c)%o===0:c=>l.count(0,c)%o===0):l)),l}const vf=Et(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);vf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Et(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):vf);vf.range;const Br=1e3,Yn=Br*60,Ir=Yn*60,Vr=Ir*24,jy=Vr*7,V2=Vr*30,lp=Vr*365,mi=Et(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Br)},(e,t)=>(t-e)/Br,e=>e.getUTCSeconds());mi.range;const Oy=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Br)},(e,t)=>{e.setTime(+e+t*Yn)},(e,t)=>(t-e)/Yn,e=>e.getMinutes());Oy.range;const _y=Et(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Yn)},(e,t)=>(t-e)/Yn,e=>e.getUTCMinutes());_y.range;const Ay=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Br-e.getMinutes()*Yn)},(e,t)=>{e.setTime(+e+t*Ir)},(e,t)=>(t-e)/Ir,e=>e.getHours());Ay.range;const Ey=Et(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ir)},(e,t)=>(t-e)/Ir,e=>e.getUTCHours());Ey.range;const Po=Et(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Yn)/Vr,e=>e.getDate()-1);Po.range;const rd=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vr,e=>e.getUTCDate()-1);rd.range;const vN=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vr,e=>Math.floor(e/Vr));vN.range;function Ei(e){return Et(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Yn)/jy)}const ad=Ei(0),pf=Ei(1),sL=Ei(2),cL=Ei(3),Ml=Ei(4),fL=Ei(5),dL=Ei(6);ad.range;pf.range;sL.range;cL.range;Ml.range;fL.range;dL.range;function Ni(e){return Et(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/jy)}const id=Ni(0),yf=Ni(1),hL=Ni(2),mL=Ni(3),Cl=Ni(4),vL=Ni(5),pL=Ni(6);id.range;yf.range;hL.range;mL.range;Cl.range;vL.range;pL.range;const Ny=Et(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());Ny.range;const Ty=Et(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());Ty.range;const Xr=Et(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());Xr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Xr.range;const Fr=Et(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());Fr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Fr.range;function pN(e,t,n,a,l,o){const c=[[mi,1,Br],[mi,5,5*Br],[mi,15,15*Br],[mi,30,30*Br],[o,1,Yn],[o,5,5*Yn],[o,15,15*Yn],[o,30,30*Yn],[l,1,Ir],[l,3,3*Ir],[l,6,6*Ir],[l,12,12*Ir],[a,1,Vr],[a,2,2*Vr],[n,1,jy],[t,1,V2],[t,3,3*V2],[e,1,lp]];function f(h,v,p){const b=v_).right(c,b);if(x===c.length)return e.every(s0(h/lp,v/lp,p));if(x===0)return vf.every(Math.max(s0(h,v,p),1));const[O,j]=c[b/c[x-1][2]53)return null;"w"in ae||(ae.w=1),"Z"in ae?(Ce=op(Ku(ae.y,0,1)),$t=Ce.getUTCDay(),Ce=$t>4||$t===0?yf.ceil(Ce):yf(Ce),Ce=rd.offset(Ce,(ae.V-1)*7),ae.y=Ce.getUTCFullYear(),ae.m=Ce.getUTCMonth(),ae.d=Ce.getUTCDate()+(ae.w+6)%7):(Ce=up(Ku(ae.y,0,1)),$t=Ce.getDay(),Ce=$t>4||$t===0?pf.ceil(Ce):pf(Ce),Ce=Po.offset(Ce,(ae.V-1)*7),ae.y=Ce.getFullYear(),ae.m=Ce.getMonth(),ae.d=Ce.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),$t="Z"in ae?op(Ku(ae.y,0,1)).getUTCDay():up(Ku(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-($t+5)%7:ae.w+ae.U*7-($t+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,op(ae)):up(ae)}}function Z(W,Se,_e,ae){for(var Lt=0,Ce=Se.length,$t=_e.length,Ut,br;Lt=$t)return-1;if(Ut=Se.charCodeAt(Lt++),Ut===37){if(Ut=Se.charAt(Lt++),br=T[Ut in X2?Se.charAt(Lt++):Ut],!br||(ae=br(W,_e,ae))<0)return-1}else if(Ut!=_e.charCodeAt(ae++))return-1}return ae}function ne(W,Se,_e){var ae=h.exec(Se.slice(_e));return ae?(W.p=v.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function q(W,Se,_e){var ae=x.exec(Se.slice(_e));return ae?(W.w=O.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function U(W,Se,_e){var ae=p.exec(Se.slice(_e));return ae?(W.w=b.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function B(W,Se,_e){var ae=E.exec(Se.slice(_e));return ae?(W.m=N.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function ue(W,Se,_e){var ae=j.exec(Se.slice(_e));return ae?(W.m=_.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function oe(W,Se,_e){return Z(W,t,Se,_e)}function ve(W,Se,_e){return Z(W,n,Se,_e)}function K(W,Se,_e){return Z(W,a,Se,_e)}function ee(W){return c[W.getDay()]}function z(W){return o[W.getDay()]}function G(W){return d[W.getMonth()]}function re(W){return f[W.getMonth()]}function k(W){return l[+(W.getHours()>=12)]}function F(W){return 1+~~(W.getMonth()/3)}function ie(W){return c[W.getUTCDay()]}function le(W){return o[W.getUTCDay()]}function ye(W){return d[W.getUTCMonth()]}function be(W){return f[W.getUTCMonth()]}function he(W){return l[+(W.getUTCHours()>=12)]}function ut(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var Se=C(W+="",M);return Se.toString=function(){return W},Se},parse:function(W){var Se=L(W+="",!1);return Se.toString=function(){return W},Se},utcFormat:function(W){var Se=C(W+="",P);return Se.toString=function(){return W},Se},utcParse:function(W){var Se=L(W+="",!0);return Se.toString=function(){return W},Se}}}var X2={"-":"",_:" ",0:"0"},Rt=/^\s*\d+/,wL=/^%/,jL=/[\\^$*+?|[\]().{}]/g;function Pe(e,t,n){var a=e<0?"-":"",l=(a?-e:e)+"",o=l.length;return a+(o[t.toLowerCase(),n]))}function _L(e,t,n){var a=Rt.exec(t.slice(n,n+1));return a?(e.w=+a[0],n+a[0].length):-1}function AL(e,t,n){var a=Rt.exec(t.slice(n,n+1));return a?(e.u=+a[0],n+a[0].length):-1}function EL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.U=+a[0],n+a[0].length):-1}function NL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.V=+a[0],n+a[0].length):-1}function TL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.W=+a[0],n+a[0].length):-1}function F2(e,t,n){var a=Rt.exec(t.slice(n,n+4));return a?(e.y=+a[0],n+a[0].length):-1}function Z2(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.y=+a[0]+(+a[0]>68?1900:2e3),n+a[0].length):-1}function ML(e,t,n){var a=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return a?(e.Z=a[1]?0:-(a[2]+(a[3]||"00")),n+a[0].length):-1}function CL(e,t,n){var a=Rt.exec(t.slice(n,n+1));return a?(e.q=a[0]*3-3,n+a[0].length):-1}function DL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.m=a[0]-1,n+a[0].length):-1}function Q2(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.d=+a[0],n+a[0].length):-1}function kL(e,t,n){var a=Rt.exec(t.slice(n,n+3));return a?(e.m=0,e.d=+a[0],n+a[0].length):-1}function W2(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.H=+a[0],n+a[0].length):-1}function PL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.M=+a[0],n+a[0].length):-1}function zL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.S=+a[0],n+a[0].length):-1}function RL(e,t,n){var a=Rt.exec(t.slice(n,n+3));return a?(e.L=+a[0],n+a[0].length):-1}function LL(e,t,n){var a=Rt.exec(t.slice(n,n+6));return a?(e.L=Math.floor(a[0]/1e3),n+a[0].length):-1}function $L(e,t,n){var a=wL.exec(t.slice(n,n+1));return a?n+a[0].length:-1}function UL(e,t,n){var a=Rt.exec(t.slice(n));return a?(e.Q=+a[0],n+a[0].length):-1}function qL(e,t,n){var a=Rt.exec(t.slice(n));return a?(e.s=+a[0],n+a[0].length):-1}function J2(e,t){return Pe(e.getDate(),t,2)}function BL(e,t){return Pe(e.getHours(),t,2)}function IL(e,t){return Pe(e.getHours()%12||12,t,2)}function HL(e,t){return Pe(1+Po.count(Xr(e),e),t,3)}function yN(e,t){return Pe(e.getMilliseconds(),t,3)}function KL(e,t){return yN(e,t)+"000"}function YL(e,t){return Pe(e.getMonth()+1,t,2)}function GL(e,t){return Pe(e.getMinutes(),t,2)}function VL(e,t){return Pe(e.getSeconds(),t,2)}function XL(e){var t=e.getDay();return t===0?7:t}function FL(e,t){return Pe(ad.count(Xr(e)-1,e),t,2)}function gN(e){var t=e.getDay();return t>=4||t===0?Ml(e):Ml.ceil(e)}function ZL(e,t){return e=gN(e),Pe(Ml.count(Xr(e),e)+(Xr(e).getDay()===4),t,2)}function QL(e){return e.getDay()}function WL(e,t){return Pe(pf.count(Xr(e)-1,e),t,2)}function JL(e,t){return Pe(e.getFullYear()%100,t,2)}function e9(e,t){return e=gN(e),Pe(e.getFullYear()%100,t,2)}function t9(e,t){return Pe(e.getFullYear()%1e4,t,4)}function n9(e,t){var n=e.getDay();return e=n>=4||n===0?Ml(e):Ml.ceil(e),Pe(e.getFullYear()%1e4,t,4)}function r9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Pe(t/60|0,"0",2)+Pe(t%60,"0",2)}function eO(e,t){return Pe(e.getUTCDate(),t,2)}function a9(e,t){return Pe(e.getUTCHours(),t,2)}function i9(e,t){return Pe(e.getUTCHours()%12||12,t,2)}function l9(e,t){return Pe(1+rd.count(Fr(e),e),t,3)}function bN(e,t){return Pe(e.getUTCMilliseconds(),t,3)}function u9(e,t){return bN(e,t)+"000"}function o9(e,t){return Pe(e.getUTCMonth()+1,t,2)}function s9(e,t){return Pe(e.getUTCMinutes(),t,2)}function c9(e,t){return Pe(e.getUTCSeconds(),t,2)}function f9(e){var t=e.getUTCDay();return t===0?7:t}function d9(e,t){return Pe(id.count(Fr(e)-1,e),t,2)}function xN(e){var t=e.getUTCDay();return t>=4||t===0?Cl(e):Cl.ceil(e)}function h9(e,t){return e=xN(e),Pe(Cl.count(Fr(e),e)+(Fr(e).getUTCDay()===4),t,2)}function m9(e){return e.getUTCDay()}function v9(e,t){return Pe(yf.count(Fr(e)-1,e),t,2)}function p9(e,t){return Pe(e.getUTCFullYear()%100,t,2)}function y9(e,t){return e=xN(e),Pe(e.getUTCFullYear()%100,t,2)}function g9(e,t){return Pe(e.getUTCFullYear()%1e4,t,4)}function b9(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Cl(e):Cl.ceil(e),Pe(e.getUTCFullYear()%1e4,t,4)}function x9(){return"+0000"}function tO(){return"%"}function nO(e){return+e}function rO(e){return Math.floor(+e/1e3)}var ml,SN,wN;S9({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 S9(e){return ml=SL(e),SN=ml.format,ml.parse,wN=ml.utcFormat,ml.utcParse,ml}function w9(e){return new Date(e)}function j9(e){return e instanceof Date?+e:+new Date(+e)}function My(e,t,n,a,l,o,c,f,d,h){var v=py(),p=v.invert,b=v.domain,x=h(".%L"),O=h(":%S"),j=h("%I:%M"),_=h("%I %p"),E=h("%a %d"),N=h("%b %d"),M=h("%B"),P=h("%Y");function T(C){return(d(C)t(l/(e.length-1)))},n.quantiles=function(a){return Array.from({length:a+1},(l,o)=>f8(e,o/a))},n.copy=function(){return AN(t).domain(e)},ea.apply(n,arguments)}function ud(){var e=0,t=.5,n=1,a=1,l,o,c,f,d,h=en,v,p=!1,b;function x(j){return isNaN(j=+j)?b:(j=.5+((j=+v(j))-o)*(a*je.chartData,ky=V([Ia],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Py=(e,t,n,a)=>a?ky(e):Ia(e);function La(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(wt(t)&&wt(n))return!0}return!1}function aO(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function MN(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,a]=e,l,o;if(wt(n))l=n;else if(typeof n=="function")return;if(wt(a))o=a;else if(typeof a=="function")return;var c=[l,o];if(La(c))return c}}function N9(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var a=e(t,n);if(La(a))return aO(a,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[l,o]=e,c,f;if(l==="auto")t!=null&&(c=Math.min(...t));else if(me(l))c=l;else if(typeof l=="function")try{t!=null&&(c=l(t?.[0]))}catch{}else if(typeof l=="string"&&vj.test(l)){var d=vj.exec(l);if(d==null||d[1]==null||t==null)c=void 0;else{var h=+d[1];c=t[0]-h}}else c=t?.[0];if(o==="auto")t!=null&&(f=Math.max(...t));else if(me(o))f=o;else if(typeof o=="function")try{t!=null&&(f=o(t?.[1]))}catch{}else if(typeof o=="string"&&pj.test(o)){var v=pj.exec(o);if(v==null||v[1]==null||t==null)f=void 0;else{var p=+v[1];f=t[1]+p}}else f=t?.[1];var b=[c,f];if(La(b))return t==null?b:aO(b,t,n)}}}var Rl=1e9,T9={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Ry,at=!0,Xn="[DecimalError] ",gi=Xn+"Invalid argument: ",zy=Xn+"Exponent out of range: ",Ll=Math.floor,ci=Math.pow,M9=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,An,Pt=1e7,et=7,CN=9007199254740991,gf=Ll(CN/et),se={};se.absoluteValue=se.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};se.comparedTo=se.cmp=function(e){var t,n,a,l,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(a=o.d.length,l=e.d.length,t=0,n=ae.d[t]^o.s<0?1:-1;return a===l?0:a>l^o.s<0?1:-1};se.decimalPlaces=se.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*et;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};se.dividedBy=se.div=function(e){return Hr(this,new this.constructor(e))};se.dividedToIntegerBy=se.idiv=function(e){var t=this,n=t.constructor;return Xe(Hr(t,new n(e),0,1),n.precision)};se.equals=se.eq=function(e){return!this.cmp(e)};se.exponent=function(){return St(this)};se.greaterThan=se.gt=function(e){return this.cmp(e)>0};se.greaterThanOrEqualTo=se.gte=function(e){return this.cmp(e)>=0};se.isInteger=se.isint=function(){return this.e>this.d.length-2};se.isNegative=se.isneg=function(){return this.s<0};se.isPositive=se.ispos=function(){return this.s>0};se.isZero=function(){return this.s===0};se.lessThan=se.lt=function(e){return this.cmp(e)<0};se.lessThanOrEqualTo=se.lte=function(e){return this.cmp(e)<1};se.logarithm=se.log=function(e){var t,n=this,a=n.constructor,l=a.precision,o=l+5;if(e===void 0)e=new a(10);else if(e=new a(e),e.s<1||e.eq(An))throw Error(Xn+"NaN");if(n.s<1)throw Error(Xn+(n.s?"NaN":"-Infinity"));return n.eq(An)?new a(0):(at=!1,t=Hr(xo(n,o),xo(e,o),o),at=!0,Xe(t,l))};se.minus=se.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?PN(t,e):DN(t,(e.s=-e.s,e))};se.modulo=se.mod=function(e){var t,n=this,a=n.constructor,l=a.precision;if(e=new a(e),!e.s)throw Error(Xn+"NaN");return n.s?(at=!1,t=Hr(n,e,0,1).times(e),at=!0,n.minus(t)):Xe(new a(n),l)};se.naturalExponential=se.exp=function(){return kN(this)};se.naturalLogarithm=se.ln=function(){return xo(this)};se.negated=se.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};se.plus=se.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?DN(t,e):PN(t,(e.s=-e.s,e))};se.precision=se.sd=function(e){var t,n,a,l=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(gi+e);if(t=St(l)+1,a=l.d.length-1,n=a*et+1,a=l.d[a],a){for(;a%10==0;a/=10)n--;for(a=l.d[0];a>=10;a/=10)n++}return e&&t>n?t:n};se.squareRoot=se.sqrt=function(){var e,t,n,a,l,o,c,f=this,d=f.constructor;if(f.s<1){if(!f.s)return new d(0);throw Error(Xn+"NaN")}for(e=St(f),at=!1,l=Math.sqrt(+f),l==0||l==1/0?(t=hr(f.d),(t.length+e)%2==0&&(t+="0"),l=Math.sqrt(t),e=Ll((e+1)/2)-(e<0||e%2),l==1/0?t="5e"+e:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),a=new d(t)):a=new d(l.toString()),n=d.precision,l=c=n+3;;)if(o=a,a=o.plus(Hr(f,o,c+2)).times(.5),hr(o.d).slice(0,c)===(t=hr(a.d)).slice(0,c)){if(t=t.slice(c-3,c+1),l==c&&t=="4999"){if(Xe(o,n+1,0),o.times(o).eq(f)){a=o;break}}else if(t!="9999")break;c+=4}return at=!0,Xe(a,n)};se.times=se.mul=function(e){var t,n,a,l,o,c,f,d,h,v=this,p=v.constructor,b=v.d,x=(e=new p(e)).d;if(!v.s||!e.s)return new p(0);for(e.s*=v.s,n=v.e+e.e,d=b.length,h=x.length,d=0;){for(t=0,l=d+a;l>a;)f=o[l]+x[a]*b[l-a-1]+t,o[l--]=f%Pt|0,t=f/Pt|0;o[l]=(o[l]+t)%Pt|0}for(;!o[--c];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,at?Xe(e,p.precision):e};se.toDecimalPlaces=se.todp=function(e,t){var n=this,a=n.constructor;return n=new a(n),e===void 0?n:(gr(e,0,Rl),t===void 0?t=a.rounding:gr(t,0,8),Xe(n,e+St(n)+1,t))};se.toExponential=function(e,t){var n,a=this,l=a.constructor;return e===void 0?n=Oi(a,!0):(gr(e,0,Rl),t===void 0?t=l.rounding:gr(t,0,8),a=Xe(new l(a),e+1,t),n=Oi(a,!0,e+1)),n};se.toFixed=function(e,t){var n,a,l=this,o=l.constructor;return e===void 0?Oi(l):(gr(e,0,Rl),t===void 0?t=o.rounding:gr(t,0,8),a=Xe(new o(l),e+St(l)+1,t),n=Oi(a.abs(),!1,e+St(a)+1),l.isneg()&&!l.isZero()?"-"+n:n)};se.toInteger=se.toint=function(){var e=this,t=e.constructor;return Xe(new t(e),St(e)+1,t.rounding)};se.toNumber=function(){return+this};se.toPower=se.pow=function(e){var t,n,a,l,o,c,f=this,d=f.constructor,h=12,v=+(e=new d(e));if(!e.s)return new d(An);if(f=new d(f),!f.s){if(e.s<1)throw Error(Xn+"Infinity");return f}if(f.eq(An))return f;if(a=d.precision,e.eq(An))return Xe(f,a);if(t=e.e,n=e.d.length-1,c=t>=n,o=f.s,c){if((n=v<0?-v:v)<=CN){for(l=new d(An),t=Math.ceil(a/et+4),at=!1;n%2&&(l=l.times(f),lO(l.d,t)),n=Ll(n/2),n!==0;)f=f.times(f),lO(f.d,t);return at=!0,e.s<0?new d(An).div(l):Xe(l,a)}}else if(o<0)throw Error(Xn+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,f.s=1,at=!1,l=e.times(xo(f,a+h)),at=!0,l=kN(l),l.s=o,l};se.toPrecision=function(e,t){var n,a,l=this,o=l.constructor;return e===void 0?(n=St(l),a=Oi(l,n<=o.toExpNeg||n>=o.toExpPos)):(gr(e,1,Rl),t===void 0?t=o.rounding:gr(t,0,8),l=Xe(new o(l),e,t),n=St(l),a=Oi(l,e<=n||n<=o.toExpNeg,e)),a};se.toSignificantDigits=se.tosd=function(e,t){var n=this,a=n.constructor;return e===void 0?(e=a.precision,t=a.rounding):(gr(e,1,Rl),t===void 0?t=a.rounding:gr(t,0,8)),Xe(new a(n),e,t)};se.toString=se.valueOf=se.val=se.toJSON=se[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=St(e),n=e.constructor;return Oi(e,t<=n.toExpNeg||t>=n.toExpPos)};function DN(e,t){var n,a,l,o,c,f,d,h,v=e.constructor,p=v.precision;if(!e.s||!t.s)return t.s||(t=new v(e)),at?Xe(t,p):t;if(d=e.d,h=t.d,c=e.e,l=t.e,d=d.slice(),o=c-l,o){for(o<0?(a=d,o=-o,f=h.length):(a=h,l=c,f=d.length),c=Math.ceil(p/et),f=c>f?c+1:f+1,o>f&&(o=f,a.length=1),a.reverse();o--;)a.push(0);a.reverse()}for(f=d.length,o=h.length,f-o<0&&(o=f,a=h,h=d,d=a),n=0;o;)n=(d[--o]=d[o]+h[o]+n)/Pt|0,d[o]%=Pt;for(n&&(d.unshift(n),++l),f=d.length;d[--f]==0;)d.pop();return t.d=d,t.e=l,at?Xe(t,p):t}function gr(e,t,n){if(e!==~~e||en)throw Error(gi+e)}function hr(e){var t,n,a,l=e.length-1,o="",c=e[0];if(l>0){for(o+=c,t=1;tc?1:-1;else for(f=d=0;fl[f]?1:-1;break}return d}function n(a,l,o){for(var c=0;o--;)a[o]-=c,c=a[o]1;)a.shift()}return function(a,l,o,c){var f,d,h,v,p,b,x,O,j,_,E,N,M,P,T,C,L,Z,ne=a.constructor,q=a.s==l.s?1:-1,U=a.d,B=l.d;if(!a.s)return new ne(a);if(!l.s)throw Error(Xn+"Division by zero");for(d=a.e-l.e,L=B.length,T=U.length,x=new ne(q),O=x.d=[],h=0;B[h]==(U[h]||0);)++h;if(B[h]>(U[h]||0)&&--d,o==null?N=o=ne.precision:c?N=o+(St(a)-St(l))+1:N=o,N<0)return new ne(0);if(N=N/et+2|0,h=0,L==1)for(v=0,B=B[0],N++;(h1&&(B=e(B,v),U=e(U,v),L=B.length,T=U.length),P=L,j=U.slice(0,L),_=j.length;_=Pt/2&&++C;do v=0,f=t(B,j,L,_),f<0?(E=j[0],L!=_&&(E=E*Pt+(j[1]||0)),v=E/C|0,v>1?(v>=Pt&&(v=Pt-1),p=e(B,v),b=p.length,_=j.length,f=t(p,j,b,_),f==1&&(v--,n(p,L16)throw Error(zy+St(e));if(!e.s)return new v(An);for(at=!1,f=p,c=new v(.03125);e.abs().gte(.1);)e=e.times(c),h+=5;for(a=Math.log(ci(2,h))/Math.LN10*2+5|0,f+=a,n=l=o=new v(An),v.precision=f;;){if(l=Xe(l.times(e),f),n=n.times(++d),c=o.plus(Hr(l,n,f)),hr(c.d).slice(0,f)===hr(o.d).slice(0,f)){for(;h--;)o=Xe(o.times(o),f);return v.precision=p,t==null?(at=!0,Xe(o,p)):o}o=c}}function St(e){for(var t=e.e*et,n=e.d[0];n>=10;n/=10)t++;return t}function sp(e,t,n){if(t>e.LN10.sd())throw at=!0,n&&(e.precision=n),Error(Xn+"LN10 precision limit exceeded");return Xe(new e(e.LN10),t)}function Ma(e){for(var t="";e--;)t+="0";return t}function xo(e,t){var n,a,l,o,c,f,d,h,v,p=1,b=10,x=e,O=x.d,j=x.constructor,_=j.precision;if(x.s<1)throw Error(Xn+(x.s?"NaN":"-Infinity"));if(x.eq(An))return new j(0);if(t==null?(at=!1,h=_):h=t,x.eq(10))return t==null&&(at=!0),sp(j,h);if(h+=b,j.precision=h,n=hr(O),a=n.charAt(0),o=St(x),Math.abs(o)<15e14){for(;a<7&&a!=1||a==1&&n.charAt(1)>3;)x=x.times(e),n=hr(x.d),a=n.charAt(0),p++;o=St(x),a>1?(x=new j("0."+n),o++):x=new j(a+"."+n.slice(1))}else return d=sp(j,h+2,_).times(o+""),x=xo(new j(a+"."+n.slice(1)),h-b).plus(d),j.precision=_,t==null?(at=!0,Xe(x,_)):x;for(f=c=x=Hr(x.minus(An),x.plus(An),h),v=Xe(x.times(x),h),l=3;;){if(c=Xe(c.times(v),h),d=f.plus(Hr(c,new j(l),h)),hr(d.d).slice(0,h)===hr(f.d).slice(0,h))return f=f.times(2),o!==0&&(f=f.plus(sp(j,h+2,_).times(o+""))),f=Hr(f,new j(p),h),j.precision=_,t==null?(at=!0,Xe(f,_)):f;f=d,l+=2}}function iO(e,t){var n,a,l;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(n<0&&(n=a),n+=+t.slice(a+1),t=t.substring(0,a)):n<0&&(n=t.length),a=0;t.charCodeAt(a)===48;)++a;for(l=t.length;t.charCodeAt(l-1)===48;)--l;if(t=t.slice(a,l),t){if(l-=a,n=n-a-1,e.e=Ll(n/et),e.d=[],a=(n+1)%et,n<0&&(a+=et),agf||e.e<-gf))throw Error(zy+n)}else e.s=0,e.e=0,e.d=[0];return e}function Xe(e,t,n){var a,l,o,c,f,d,h,v,p=e.d;for(c=1,o=p[0];o>=10;o/=10)c++;if(a=t-c,a<0)a+=et,l=t,h=p[v=0];else{if(v=Math.ceil((a+1)/et),o=p.length,v>=o)return e;for(h=o=p[v],c=1;o>=10;o/=10)c++;a%=et,l=a-et+c}if(n!==void 0&&(o=ci(10,c-l-1),f=h/o%10|0,d=t<0||p[v+1]!==void 0||h%o,d=n<4?(f||d)&&(n==0||n==(e.s<0?3:2)):f>5||f==5&&(n==4||d||n==6&&(a>0?l>0?h/ci(10,c-l):0:p[v-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(o=St(e),p.length=1,t=t-o-1,p[0]=ci(10,(et-t%et)%et),e.e=Ll(-t/et)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(a==0?(p.length=v,o=1,v--):(p.length=v+1,o=ci(10,et-a),p[v]=l>0?(h/ci(10,c-l)%ci(10,l)|0)*o:0),d)for(;;)if(v==0){(p[0]+=o)==Pt&&(p[0]=1,++e.e);break}else{if(p[v]+=o,p[v]!=Pt)break;p[v--]=0,o=1}for(a=p.length;p[--a]===0;)p.pop();if(at&&(e.e>gf||e.e<-gf))throw Error(zy+St(e));return e}function PN(e,t){var n,a,l,o,c,f,d,h,v,p,b=e.constructor,x=b.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new b(e),at?Xe(t,x):t;if(d=e.d,p=t.d,a=t.e,h=e.e,d=d.slice(),c=h-a,c){for(v=c<0,v?(n=d,c=-c,f=p.length):(n=p,a=h,f=d.length),l=Math.max(Math.ceil(x/et),f)+2,c>l&&(c=l,n.length=1),n.reverse(),l=c;l--;)n.push(0);n.reverse()}else{for(l=d.length,f=p.length,v=l0;--l)d[f++]=0;for(l=p.length;l>c;){if(d[--l]0?o=o.charAt(0)+"."+o.slice(1)+Ma(a):c>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(l<0?"e":"e+")+l):l<0?(o="0."+Ma(-l-1)+o,n&&(a=n-c)>0&&(o+=Ma(a))):l>=c?(o+=Ma(l+1-c),n&&(a=n-l-1)>0&&(o=o+"."+Ma(a))):((a=l+1)0&&(l+1===c&&(o+="."),o+=Ma(a))),e.s<0?"-"+o:o}function lO(e,t){if(e.length>t)return e.length=t,!0}function zN(e){var t,n,a;function l(o){var c=this;if(!(c instanceof l))return new l(o);if(c.constructor=l,o instanceof l){c.s=o.s,c.e=o.e,c.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(gi+o);if(o>0)c.s=1;else if(o<0)o=-o,c.s=-1;else{c.s=0,c.e=0,c.d=[0];return}if(o===~~o&&o<1e7){c.e=0,c.d=[o];return}return iO(c,o.toString())}else if(typeof o!="string")throw Error(gi+o);if(o.charCodeAt(0)===45?(o=o.slice(1),c.s=-1):c.s=1,M9.test(o))iO(c,o);else throw Error(gi+o)}if(l.prototype=se,l.ROUND_UP=0,l.ROUND_DOWN=1,l.ROUND_CEIL=2,l.ROUND_FLOOR=3,l.ROUND_HALF_UP=4,l.ROUND_HALF_DOWN=5,l.ROUND_HALF_EVEN=6,l.ROUND_HALF_CEIL=7,l.ROUND_HALF_FLOOR=8,l.clone=zN,l.config=l.set=C9,e===void 0&&(e={}),e)for(a=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=l[t+1]&&a<=l[t+2])this[n]=a;else throw Error(gi+n+": "+a);if((a=e[n="LN10"])!==void 0)if(a==Math.LN10)this[n]=new this(a);else throw Error(gi+n+": "+a);return this}var Ry=zN(T9);An=new Ry(1);const Be=Ry;var D9=e=>e,RN={},LN=e=>e===RN,uO=e=>function t(){return arguments.length===0||arguments.length===1&&LN(arguments.length<=0?void 0:arguments[0])?t:e(...arguments)},$N=(e,t)=>e===1?t:uO(function(){for(var n=arguments.length,a=new Array(n),l=0;lc!==RN).length;return o>=e?t(...a):$N(e-o,uO(function(){for(var c=arguments.length,f=new Array(c),d=0;dLN(v)?f.shift():v);return t(...h,...f)}))}),k9=e=>$N(e.length,e),m0=(e,t)=>{for(var n=[],a=e;aArray.isArray(t)?t.map(e):Object.keys(t).map(n=>t[n]).map(e)),z9=function(){for(var t=arguments.length,n=new Array(t),a=0;ad(f),o(...arguments))}};function UN(e){var t;return e===0?t=1:t=Math.floor(new Be(e).abs().log(10).toNumber())+1,t}function qN(e,t,n){for(var a=new Be(e),l=0,o=[];a.lt(t)&&l<1e5;)o.push(a.toNumber()),a=a.add(n),l++;return o}var BN=e=>{var[t,n]=e,[a,l]=[t,n];return t>n&&([a,l]=[n,t]),[a,l]},IN=(e,t,n)=>{if(e.lte(0))return new Be(0);var a=UN(e.toNumber()),l=new Be(10).pow(a),o=e.div(l),c=a!==1?.05:.1,f=new Be(Math.ceil(o.div(c).toNumber())).add(n).mul(c),d=f.mul(l);return t?new Be(d.toNumber()):new Be(Math.ceil(d.toNumber()))},R9=(e,t,n)=>{var a=new Be(1),l=new Be(e);if(!l.isint()&&n){var o=Math.abs(e);o<1?(a=new Be(10).pow(UN(e)-1),l=new Be(Math.floor(l.div(a).toNumber())).mul(a)):o>1&&(l=new Be(Math.floor(e)))}else e===0?l=new Be(Math.floor((t-1)/2)):n||(l=new Be(Math.floor(e)));var c=Math.floor((t-1)/2),f=z9(P9(d=>l.add(new Be(d-c).mul(a)).toNumber()),m0);return f(0,t)},HN=function(t,n,a,l){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((n-t)/(a-1)))return{step:new Be(0),tickMin:new Be(0),tickMax:new Be(0)};var c=IN(new Be(n).sub(t).div(a-1),l,o),f;t<=0&&n>=0?f=new Be(0):(f=new Be(t).add(n).div(2),f=f.sub(new Be(f).mod(c)));var d=Math.ceil(f.sub(t).div(c).toNumber()),h=Math.ceil(new Be(n).sub(f).div(c).toNumber()),v=d+h+1;return v>a?HN(t,n,a,l,o+1):(v0?h+(a-v):h,d=n>0?d:d+(a-v)),{step:c,tickMin:f.sub(new Be(d).mul(c)),tickMax:f.add(new Be(h).mul(c))})},L9=function(t){var[n,a]=t,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,c=Math.max(l,2),[f,d]=BN([n,a]);if(f===-1/0||d===1/0){var h=d===1/0?[f,...m0(0,l-1).map(()=>1/0)]:[...m0(0,l-1).map(()=>-1/0),d];return n>a?h.reverse():h}if(f===d)return R9(f,l,o);var{step:v,tickMin:p,tickMax:b}=HN(f,d,c,o,0),x=qN(p,b.add(new Be(.1).mul(v)),v);return n>a?x.reverse():x},$9=function(t,n){var[a,l]=t,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[c,f]=BN([a,l]);if(c===-1/0||f===1/0)return[a,l];if(c===f)return[c];var d=Math.max(n,2),h=IN(new Be(f).sub(c).div(d-1),o,0),v=[...qN(new Be(c),new Be(f),h),f];return o===!1&&(v=v.map(p=>Math.round(p))),a>l?v.reverse():v},U9=e=>e.rootProps.barCategoryGap,zo=e=>e.rootProps.stackOffset,KN=e=>e.rootProps.reverseStackOrder,Ly=e=>e.options.chartName,$y=e=>e.rootProps.syncId,YN=e=>e.rootProps.syncMethod,Uy=e=>e.options.eventEmitter,Vt={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Ur={allowDuplicatedCategory:!0,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"category"},_n={allowDataOverflow:!1,allowDuplicatedCategory:!0,radiusAxisId:0,scale:"auto",tick:!0,tickCount:5,type:"number"},od=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t},q9={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Ur.angleAxisId,includeHidden:!1,name:void 0,reversed:Ur.reversed,scale:Ur.scale,tick:Ur.tick,tickCount:void 0,ticks:void 0,type:Ur.type,unit:void 0},B9={allowDataOverflow:_n.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:_n.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:_n.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:_n.scale,tick:_n.tick,tickCount:_n.tickCount,ticks:void 0,type:_n.type,unit:void 0},I9={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:Ur.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Ur.angleAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:Ur.scale,tick:Ur.tick,tickCount:void 0,ticks:void 0,type:"number",unit:void 0},H9={allowDataOverflow:_n.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:_n.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:_n.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:_n.scale,tick:_n.tick,tickCount:_n.tickCount,ticks:void 0,type:"category",unit:void 0},qy=(e,t)=>e.polarAxis.angleAxis[t]!=null?e.polarAxis.angleAxis[t]:e.layout.layoutType==="radial"?I9:q9,By=(e,t)=>e.polarAxis.radiusAxis[t]!=null?e.polarAxis.radiusAxis[t]:e.layout.layoutType==="radial"?H9:B9,sd=e=>e.polarOptions,Iy=V([Wr,Jr,zt],GE),GN=V([sd,Iy],(e,t)=>{if(e!=null)return Nn(e.innerRadius,t,0)}),VN=V([sd,Iy],(e,t)=>{if(e!=null)return Nn(e.outerRadius,t,t*.8)}),K9=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},XN=V([sd],K9);V([qy,XN],od);var FN=V([Iy,GN,VN],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});V([By,FN],od);var ZN=V([Ge,sd,GN,VN,Wr,Jr],(e,t,n,a,l,o)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||a==null)){var{cx:c,cy:f,startAngle:d,endAngle:h}=t;return{cx:Nn(c,l,l/2),cy:Nn(f,o,o/2),innerRadius:n,outerRadius:a,startAngle:d,endAngle:h,clockWise:!1}}}),it=(e,t)=>t,Ro=(e,t,n)=>n;function QN(e){return e?.id}function WN(e,t,n){var{chartData:a=[]}=t,{allowDuplicatedCategory:l,dataKey:o}=n,c=new Map;return e.forEach(f=>{var d,h=(d=f.data)!==null&&d!==void 0?d:a;if(!(h==null||h.length===0)){var v=QN(f);h.forEach((p,b)=>{var x=o==null||l?b:String(tt(p,o,null)),O=tt(p,f.dataKey,0),j;c.has(x)?j=c.get(x):j={},Object.assign(j,{[v]:O}),c.set(x,j)})}}),Array.from(c.values())}function Hy(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var cd=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function fd(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Y9(e,t){if(e.length===t.length){for(var n=0;n{var t=Ge(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},$l=e=>e.tooltip.settings.axisId;function oO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function bf(e){for(var t=1;te.cartesianAxis.xAxis[t],ta=(e,t)=>{var n=JN(e,t);return n??Dt},kt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:v0,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:No},eT=(e,t)=>e.cartesianAxis.yAxis[t],na=(e,t)=>{var n=eT(e,t);return n??kt},F9={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:""},Ky=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??F9},lt=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);case"zAxis":return Ky(e,n);case"angleAxis":return qy(e,n);case"radiusAxis":return By(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Z9=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Lo=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);case"angleAxis":return qy(e,n);case"radiusAxis":return By(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},tT=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Yy(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var nT=e=>e.graphicalItems.cartesianItems,Q9=V([it,Ro],Yy),Gy=(e,t,n)=>e.filter(n).filter(a=>t?.includeHidden===!0?!0:!a.hide),$o=V([nT,lt,Q9],Gy,{memoizeOptions:{resultEqualityCheck:fd}}),rT=V([$o],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Hy)),aT=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),W9=V([$o],aT),Vy=e=>e.map(t=>t.data).filter(Boolean).flat(1),J9=V([$o],Vy,{memoizeOptions:{resultEqualityCheck:fd}}),Xy=(e,t)=>{var{chartData:n=[],dataStartIndex:a,dataEndIndex:l}=t;return e.length>0?e:n.slice(a,l+1)},Fy=V([J9,Py],Xy),Zy=(e,t,n)=>t?.dataKey!=null?e.map(a=>({value:tt(a,t.dataKey)})):n.length>0?n.map(a=>a.dataKey).flatMap(a=>e.map(l=>({value:tt(l,a)}))):e.map(a=>({value:a})),dd=V([Fy,lt,$o],Zy);function iT(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Tc(e){if(pr(e)||e instanceof Date){var t=Number(e);if(wt(t))return t}}function sO(e){if(Array.isArray(e)){var t=[Tc(e[0]),Tc(e[1])];return La(t)?t:void 0}var n=Tc(e);if(n!=null)return[n,n]}function Zr(e){return e.map(Tc).filter(Zk)}function e$(e,t,n){return!n||typeof t!="number"||vr(t)?[]:n.length?Zr(n.flatMap(a=>{var l=tt(e,a.dataKey),o,c;if(Array.isArray(l)?[o,c]=l:o=c=l,!(!wt(o)||!wt(c)))return[t-o,t+c]})):[]}var Tt=e=>{var t=Nt(e),n=$l(e);return Lo(e,t,n)},Uo=V([Tt],e=>e?.dataKey),t$=V([rT,Py,Tt],WN),lT=(e,t,n,a)=>{var l={},o=t.reduce((c,f)=>{if(f.stackId==null)return c;var d=c[f.stackId];return d==null&&(d=[]),d.push(f),c[f.stackId]=d,c},l);return Object.fromEntries(Object.entries(o).map(c=>{var[f,d]=c,h=a?[...d].reverse():d,v=h.map(QN);return[f,{stackedData:j5(e,v,n),graphicalItems:h}]}))},n$=V([t$,rT,zo,KN],lT),uT=(e,t,n,a)=>{var{dataStartIndex:l,dataEndIndex:o}=t;if(a==null&&n!=="zAxis"){var c=A5(e,l,o);if(!(c!=null&&c[0]===0&&c[1]===0))return c}},r$=V([lt],e=>e.allowDataOverflow),Qy=e=>{var t;if(e==null||!("domain"in e))return v0;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Zr(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:v0},Wy=V([lt],Qy),Jy=V([Wy,r$],MN),a$=V([n$,Ia,it,Jy],uT,{memoizeOptions:{resultEqualityCheck:cd}}),hd=e=>e.errorBars,i$=(e,t,n)=>e.flatMap(a=>t[a.id]).filter(Boolean).filter(a=>iT(n,a)),xf=function(){for(var t=arguments.length,n=new Array(t),a=0;a{var o,c;if(n.length>0&&e.forEach(f=>{n.forEach(d=>{var h,v,p=(h=a[d.id])===null||h===void 0?void 0:h.filter(E=>iT(l,E)),b=tt(f,(v=t.dataKey)!==null&&v!==void 0?v:d.dataKey),x=e$(f,b,p);if(x.length>=2){var O=Math.min(...x),j=Math.max(...x);(o==null||Oc)&&(c=j)}var _=sO(b);_!=null&&(o=o==null?_[0]:Math.min(o,_[0]),c=c==null?_[1]:Math.max(c,_[1]))})}),t?.dataKey!=null&&e.forEach(f=>{var d=sO(tt(f,t.dataKey));d!=null&&(o=o==null?d[0]:Math.min(o,d[0]),c=c==null?d[1]:Math.max(c,d[1]))}),wt(o)&&wt(c))return[o,c]},l$=V([Fy,lt,W9,hd,it],eg,{memoizeOptions:{resultEqualityCheck:cd}});function u$(e){var{value:t}=e;if(pr(t)||t instanceof Date)return t}var o$=(e,t,n)=>{var a=e.map(u$).filter(l=>l!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&OA(a))?ZE(0,e.length):t.allowDuplicatedCategory?a:Array.from(new Set(a))},oT=e=>e.referenceElements.dots,Ul=(e,t,n)=>e.filter(a=>a.ifOverflow==="extendDomain").filter(a=>t==="xAxis"?a.xAxisId===n:a.yAxisId===n),s$=V([oT,it,Ro],Ul),sT=e=>e.referenceElements.areas,c$=V([sT,it,Ro],Ul),cT=e=>e.referenceElements.lines,f$=V([cT,it,Ro],Ul),fT=(e,t)=>{if(e!=null){var n=Zr(e.map(a=>t==="xAxis"?a.x:a.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},d$=V(s$,it,fT),dT=(e,t)=>{if(e!=null){var n=Zr(e.flatMap(a=>[t==="xAxis"?a.x1:a.y1,t==="xAxis"?a.x2:a.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},h$=V([c$,it],dT);function m$(e){var t;if(e.x!=null)return Zr([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.x);return n==null||n.length===0?[]:Zr(n)}function v$(e){var t;if(e.y!=null)return Zr([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.y);return n==null||n.length===0?[]:Zr(n)}var hT=(e,t)=>{if(e!=null){var n=e.flatMap(a=>t==="xAxis"?m$(a):v$(a));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},p$=V([f$,it],hT),y$=V(d$,p$,h$,(e,t,n)=>xf(e,n,t)),tg=(e,t,n,a,l,o,c,f)=>{if(n!=null)return n;var d=c==="vertical"&&f==="xAxis"||c==="horizontal"&&f==="yAxis",h=d?xf(a,o,l):xf(o,l);return N9(t,h,e.allowDataOverflow)},g$=V([lt,Wy,Jy,a$,l$,y$,Ge,it],tg,{memoizeOptions:{resultEqualityCheck:cd}}),b$=[0,1],ng=(e,t,n,a,l,o,c)=>{if(!((e==null||n==null||n.length===0)&&c===void 0)){var{dataKey:f,type:d}=e,h=Ua(t,o);if(h&&f==null){var v;return ZE(0,(v=n?.length)!==null&&v!==void 0?v:0)}return d==="category"?o$(a,e,h):l==="expand"?b$:c}},rg=V([lt,Ge,Fy,dd,zo,it,g$],ng),mT=(e,t,n,a,l)=>{if(e!=null){var{scale:o,type:c}=e;if(o==="auto")return t==="radial"&&l==="radiusAxis"?"band":t==="radial"&&l==="angleAxis"?"linear":c==="category"&&a&&(a.indexOf("LineChart")>=0||a.indexOf("AreaChart")>=0||a.indexOf("ComposedChart")>=0&&!n)?"point":c==="category"?"band":"linear";if(typeof o=="string"){var f="scale".concat(Oo(o));return f in eo?f:"point"}}},ql=V([lt,Ge,tT,Ly,it],mT);function x$(e){if(e!=null){if(e in eo)return eo[e]();var t="scale".concat(Oo(e));if(t in eo)return eo[t]()}}function ag(e,t,n,a){if(!(n==null||a==null)){if(typeof e.scale=="function")return e.scale.copy().domain(n).range(a);var l=x$(t);if(l!=null){var o=l.domain(n).range(a);return b5(o),o}}}var ig=(e,t,n)=>{var a=Qy(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(a)&&(a[0]==="auto"||a[1]==="auto")&&La(e))return L9(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&La(e))return $9(e,t.tickCount,t.allowDecimals)}},lg=V([rg,Lo,ql],ig),ug=(e,t,n,a)=>{if(a!=="angleAxis"&&e?.type==="number"&&La(t)&&Array.isArray(n)&&n.length>0){var l=t[0],o=n[0],c=t[1],f=n[n.length-1];return[Math.min(l,o),Math.max(c,f)]}return t},S$=V([lt,rg,lg,it],ug),w$=V(dd,lt,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,a=Array.from(Zr(e.map(p=>p.value))).sort((p,b)=>p-b),l=a[0],o=a[a.length-1];if(l==null||o==null)return 1/0;var c=o-l;if(c===0)return 1/0;for(var f=0;fl,(e,t,n,a,l)=>{if(!wt(e))return 0;var o=t==="vertical"?a.height:a.width;if(l==="gap")return e*o/2;if(l==="no-gap"){var c=Nn(n,e*o),f=e*o/2;return f-c-(f-c)/o*c}return 0}),j$=(e,t,n)=>{var a=ta(e,t);return a==null||typeof a.padding!="string"?0:vT(e,"xAxis",t,n,a.padding)},O$=(e,t,n)=>{var a=na(e,t);return a==null||typeof a.padding!="string"?0:vT(e,"yAxis",t,n,a.padding)},_$=V(ta,j$,(e,t)=>{var n,a;if(e==null)return{left:0,right:0};var{padding:l}=e;return typeof l=="string"?{left:t,right:t}:{left:((n=l.left)!==null&&n!==void 0?n:0)+t,right:((a=l.right)!==null&&a!==void 0?a:0)+t}}),A$=V(na,O$,(e,t)=>{var n,a;if(e==null)return{top:0,bottom:0};var{padding:l}=e;return typeof l=="string"?{top:t,bottom:t}:{top:((n=l.top)!==null&&n!==void 0?n:0)+t,bottom:((a=l.bottom)!==null&&a!==void 0?a:0)+t}}),E$=V([zt,_$,Vf,Gf,(e,t,n)=>n],(e,t,n,a,l)=>{var{padding:o}=a;return l?[o.left,n.width-o.right]:[e.left+t.left,e.left+e.width-t.right]}),N$=V([zt,Ge,A$,Vf,Gf,(e,t,n)=>n],(e,t,n,a,l,o)=>{var{padding:c}=l;return o?[a.height-c.bottom,c.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),qo=(e,t,n,a)=>{var l;switch(t){case"xAxis":return E$(e,n,a);case"yAxis":return N$(e,n,a);case"zAxis":return(l=Ky(e,n))===null||l===void 0?void 0:l.range;case"angleAxis":return XN(e);case"radiusAxis":return FN(e,n);default:return}},pT=V([lt,qo],od),md=V([lt,ql,S$,pT],ag);V([$o,hd,it],i$);function yT(e,t){return e.idt.id?1:0}var vd=(e,t)=>t,pd=(e,t,n)=>n,T$=V(Kf,vd,pd,(e,t,n)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===n).sort(yT)),M$=V(Yf,vd,pd,(e,t,n)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===n).sort(yT)),gT=(e,t)=>({width:e.width,height:t.height}),C$=(e,t)=>{var n=typeof t.width=="number"?t.width:No;return{width:n,height:e.height}},D$=V(zt,ta,gT),k$=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},P$=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},z$=V(Jr,zt,T$,vd,pd,(e,t,n,a,l)=>{var o={},c;return n.forEach(f=>{var d=gT(t,f);c==null&&(c=k$(t,a,e));var h=a==="top"&&!l||a==="bottom"&&l;o[f.id]=c-Number(h)*d.height,c+=(h?-1:1)*d.height}),o}),R$=V(Wr,zt,M$,vd,pd,(e,t,n,a,l)=>{var o={},c;return n.forEach(f=>{var d=C$(t,f);c==null&&(c=P$(t,a,e));var h=a==="left"&&!l||a==="right"&&l;o[f.id]=c-Number(h)*d.width,c+=(h?-1:1)*d.width}),o}),L$=(e,t)=>{var n=ta(e,t);if(n!=null)return z$(e,n.orientation,n.mirror)},$$=V([zt,ta,L$,(e,t)=>t],(e,t,n,a)=>{if(t!=null){var l=n?.[a];return l==null?{x:e.left,y:0}:{x:e.left,y:l}}}),U$=(e,t)=>{var n=na(e,t);if(n!=null)return R$(e,n.orientation,n.mirror)},q$=V([zt,na,U$,(e,t)=>t],(e,t,n,a)=>{if(t!=null){var l=n?.[a];return l==null?{x:0,y:e.top}:{x:l,y:e.top}}}),B$=V(zt,na,(e,t)=>{var n=typeof t.width=="number"?t.width:No;return{width:n,height:e.height}}),bT=(e,t,n,a)=>{if(n!=null){var{allowDuplicatedCategory:l,type:o,dataKey:c}=n,f=Ua(e,a),d=t.map(h=>h.value);if(c&&f&&o==="category"&&l&&OA(d))return d}},og=V([Ge,dd,lt,it],bT),xT=(e,t,n,a)=>{if(!(n==null||n.dataKey==null)){var{type:l,scale:o}=n,c=Ua(e,a);if(c&&(l==="number"||o!=="auto"))return t.map(f=>f.value)}},sg=V([Ge,dd,Lo,it],xT),cO=V([Ge,Z9,ql,md,og,sg,qo,lg,it],(e,t,n,a,l,o,c,f,d)=>{if(t!=null){var h=Ua(e,d);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:d,categoricalDomain:o,duplicateDomain:l,isCategorical:h,niceTicks:f,range:c,realScaleType:n,scale:a}}}),I$=(e,t,n,a,l,o,c,f,d)=>{if(!(t==null||a==null)){var h=Ua(e,d),{type:v,ticks:p,tickCount:b}=t,x=n==="scaleBand"&&typeof a.bandwidth=="function"?a.bandwidth()/2:2,O=v==="category"&&a.bandwidth?a.bandwidth()/x:0;O=d==="angleAxis"&&o!=null&&o.length>=2?Wt(o[0]-o[1])*2*O:O;var j=p||l;if(j){var _=j.map((E,N)=>{var M=c?c.indexOf(E):E;return{index:N,coordinate:a(M)+O,value:E,offset:O}});return _.filter(E=>wt(E.coordinate))}return h&&f?f.map((E,N)=>({coordinate:a(E)+O,value:E,index:N,offset:O})).filter(E=>wt(E.coordinate)):a.ticks?a.ticks(b).map(E=>({coordinate:a(E)+O,value:E,offset:O})):a.domain().map((E,N)=>({coordinate:a(E)+O,value:c?c[E]:E,index:N,offset:O}))}},ST=V([Ge,Lo,ql,md,lg,qo,og,sg,it],I$),H$=(e,t,n,a,l,o,c)=>{if(!(t==null||n==null||a==null||a[0]===a[1])){var f=Ua(e,c),{tickCount:d}=t,h=0;return h=c==="angleAxis"&&a?.length>=2?Wt(a[0]-a[1])*2*h:h,f&&o?o.map((v,p)=>({coordinate:n(v)+h,value:v,index:p,offset:h})):n.ticks?n.ticks(d).map(v=>({coordinate:n(v)+h,value:v,offset:h})):n.domain().map((v,p)=>({coordinate:n(v)+h,value:l?l[v]:v,index:p,offset:h}))}},wT=V([Ge,Lo,md,qo,og,sg,it],H$),jT=V(lt,md,(e,t)=>{if(!(e==null||t==null))return bf(bf({},e),{},{scale:t})}),K$=V([lt,ql,rg,pT],ag);V((e,t,n)=>Ky(e,n),K$,(e,t)=>{if(!(e==null||t==null))return bf(bf({},e),{},{scale:t})});var Y$=V([Ge,Kf,Yf],(e,t,n)=>{switch(e){case"horizontal":return t.some(a=>a.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(a=>a.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),OT=e=>e.options.defaultTooltipEventType,_T=e=>e.options.validateTooltipEventTypes;function AT(e,t,n){if(e==null)return t;var a=e?"axis":"item";return n==null?t:n.includes(a)?a:t}function cg(e,t){var n=OT(e),a=_T(e);return AT(t,n,a)}function G$(e){return de(t=>cg(t,e))}var ET=(e,t)=>{var n,a=Number(t);if(!(vr(a)||t==null))return a>=0?e==null||(n=e[a])===null||n===void 0?void 0:n.value:void 0},V$=e=>e.tooltip.settings,ka={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},X$={itemInteraction:{click:ka,hover:ka},axisInteraction:{click:ka,hover:ka},keyboardInteraction:ka,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}},NT=hn({name:"tooltip",initialState:X$,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:rt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).tooltipItemPayloads.indexOf(n);l>-1&&(e.tooltipItemPayloads[l]=a)},prepare:rt()},removeTooltipEntrySettings:{reducer(e,t){var n=nr(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:rt()},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:F$,replaceTooltipEntrySettings:Z$,removeTooltipEntrySettings:Q$,setTooltipSettingsState:W$,setActiveMouseOverItemIndex:TT,mouseLeaveItem:J$,mouseLeaveChart:MT,setActiveClickItemIndex:eU,setMouseOverAxisIndex:CT,setMouseClickAxisIndex:tU,setSyncInteraction:p0,setKeyboardInteraction:y0}=NT.actions,nU=NT.reducer;function fO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function wc(e){for(var t=1;t{if(t==null)return ka;var l=lU(e,t,n);if(l==null)return ka;if(l.active)return l;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var o=e.settings.active===!0;if(uU(l)){if(o)return wc(wc({},l),{},{active:!0})}else if(a!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:a,graphicalItemId:void 0};return wc(wc({},ka),{},{coordinate:l.coordinate})};function oU(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 n=Number(e);return Number.isFinite(n)?n:void 0}function sU(e,t){var n=oU(e),a=t[0],l=t[1];if(n===void 0)return!1;var o=Math.min(a,l),c=Math.max(a,l);return n>=o&&n<=c}function cU(e,t,n){if(n==null||t==null)return!0;var a=tt(e,t);return a==null||!La(n)?!0:sU(a,n)}var fg=(e,t,n,a)=>{var l=e?.index;if(l==null)return null;var o=Number(l);if(!wt(o))return l;var c=0,f=1/0;t.length>0&&(f=t.length-1);var d=Math.max(c,Math.min(o,f)),h=t[d];return h==null||cU(h,n,a)?String(d):null},kT=(e,t,n,a,l,o,c,f)=>{if(!(o==null||f==null)){var d=c[0],h=d==null?void 0:f(d.positions,o);if(h!=null)return h;var v=l?.[Number(o)];if(v)return n==="horizontal"?{x:v.coordinate,y:(a.top+t)/2}:{x:(a.left+e)/2,y:v.coordinate}}},PT=(e,t,n,a)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var l;if(n==="hover"?l=e.itemInteraction.hover.graphicalItemId:l=e.itemInteraction.click.graphicalItemId,l==null&&a!=null){var o=e.tooltipItemPayloads[0];return o!=null?[o]:[]}return e.tooltipItemPayloads.filter(c=>{var f;return((f=c.settings)===null||f===void 0?void 0:f.graphicalItemId)===l})},Bo=e=>e.options.tooltipPayloadSearcher,Bl=e=>e.tooltip;function dO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function hO(e){for(var t=1;t{if(!(t==null||o==null)){var{chartData:f,computedData:d,dataStartIndex:h,dataEndIndex:v}=n,p=[];return e.reduce((b,x)=>{var O,{dataDefinedOnItem:j,settings:_}=x,E=mU(j,f),N=Array.isArray(E)?yE(E,h,v):E,M=(O=_?.dataKey)!==null&&O!==void 0?O:a,P=_?.nameKey,T;if(a&&Array.isArray(N)&&!Array.isArray(N[0])&&c==="axis"?T=_A(N,a,l):T=o(N,t,d,P),Array.isArray(T))T.forEach(L=>{var Z=hO(hO({},_),{},{name:L.name,unit:L.unit,color:void 0,fill:void 0});b.push(yj({tooltipEntrySettings:Z,dataKey:L.dataKey,payload:L.payload,value:tt(L.payload,L.dataKey),name:L.name}))});else{var C;b.push(yj({tooltipEntrySettings:_,dataKey:M,payload:T,value:tt(T,M),name:(C=tt(T,P))!==null&&C!==void 0?C:_?.name}))}return b},p)}},dg=V([Tt,Ge,tT,Ly,Nt],mT),vU=V([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),pU=V([Nt,$l],Yy),Il=V([vU,Tt,pU],Gy,{memoizeOptions:{resultEqualityCheck:fd}}),yU=V([Il],e=>e.filter(Hy)),gU=V([Il],Vy,{memoizeOptions:{resultEqualityCheck:fd}}),Hl=V([gU,Ia],Xy),bU=V([yU,Ia,Tt],WN),hg=V([Hl,Tt,Il],Zy),RT=V([Tt],Qy),xU=V([Tt],e=>e.allowDataOverflow),LT=V([RT,xU],MN),SU=V([Il],e=>e.filter(Hy)),wU=V([bU,SU,zo,KN],lT),jU=V([wU,Ia,Nt,LT],uT),OU=V([Il],aT),_U=V([Hl,Tt,OU,hd,Nt],eg,{memoizeOptions:{resultEqualityCheck:cd}}),AU=V([oT,Nt,$l],Ul),EU=V([AU,Nt],fT),NU=V([sT,Nt,$l],Ul),TU=V([NU,Nt],dT),MU=V([cT,Nt,$l],Ul),CU=V([MU,Nt],hT),DU=V([EU,CU,TU],xf),kU=V([Tt,RT,LT,jU,_U,DU,Ge,Nt],tg),Io=V([Tt,Ge,Hl,hg,zo,Nt,kU],ng),PU=V([Io,Tt,dg],ig),zU=V([Tt,Io,PU,Nt],ug),$T=e=>{var t=Nt(e),n=$l(e),a=!1;return qo(e,t,n,a)},UT=V([Tt,$T],od),qT=V([Tt,dg,zU,UT],ag),RU=V([Ge,hg,Tt,Nt],bT),LU=V([Ge,hg,Tt,Nt],xT),$U=(e,t,n,a,l,o,c,f)=>{if(t){var{type:d}=t,h=Ua(e,f);if(a){var v=n==="scaleBand"&&a.bandwidth?a.bandwidth()/2:2,p=d==="category"&&a.bandwidth?a.bandwidth()/v:0;return p=f==="angleAxis"&&l!=null&&l?.length>=2?Wt(l[0]-l[1])*2*p:p,h&&c?c.map((b,x)=>({coordinate:a(b)+p,value:b,index:x,offset:p})):a.domain().map((b,x)=>({coordinate:a(b)+p,value:o?o[b]:b,index:x,offset:p}))}}},ra=V([Ge,Tt,dg,qT,$T,RU,LU,Nt],$U),mg=V([OT,_T,V$],(e,t,n)=>AT(n.shared,e,t)),BT=e=>e.tooltip.settings.trigger,vg=e=>e.tooltip.settings.defaultIndex,Ho=V([Bl,mg,BT,vg],DT),Dl=V([Ho,Hl,Uo,Io],fg),IT=V([ra,Dl],ET),HT=V([Ho],e=>{if(e)return e.dataKey}),UU=V([Ho],e=>{if(e)return e.graphicalItemId}),KT=V([Bl,mg,BT,vg],PT),qU=V([Wr,Jr,Ge,zt,ra,vg,KT,Bo],kT),BU=V([Ho,qU],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),IU=V([Ho],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),HU=V([KT,Dl,Ia,Uo,IT,Bo,mg],zT),KU=V([HU],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function mO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function vO(e){for(var t=1;tde(Tt),FU=()=>{var e=XU(),t=de(ra),n=de(qT);return Qc(!e||!n?void 0:vO(vO({},e),{},{scale:n}),t)};function pO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function vl(e){for(var t=1;t{var l=t.find(o=>o&&o.index===n);if(l){if(e==="horizontal")return{x:l.coordinate,y:a.chartY};if(e==="vertical")return{x:a.chartX,y:l.coordinate}}return{x:0,y:0}},e7=(e,t,n,a)=>{var l=t.find(h=>h&&h.index===n);if(l){if(e==="centric"){var o=l.coordinate,{radius:c}=a;return vl(vl(vl({},a),xt(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var f=l.coordinate,{angle:d}=a;return vl(vl(vl({},a),xt(a.cx,a.cy,f,d)),{},{angle:d,radius:f})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function t7(e,t){var{chartX:n,chartY:a}=e;return n>=t.left&&n<=t.left+t.width&&a>=t.top&&a<=t.top+t.height}var YT=(e,t,n,a,l)=>{var o,c=(o=t?.length)!==null&&o!==void 0?o:0;if(c<=1||e==null)return 0;if(a==="angleAxis"&&l!=null&&Math.abs(Math.abs(l[1]-l[0])-360)<=1e-6)for(var f=0;f0?(d=n[f-1])===null||d===void 0?void 0:d.coordinate:(h=n[c-1])===null||h===void 0?void 0:h.coordinate,O=(v=n[f])===null||v===void 0?void 0:v.coordinate,j=f>=c-1?(p=n[0])===null||p===void 0?void 0:p.coordinate:(b=n[f+1])===null||b===void 0?void 0:b.coordinate,_=void 0;if(!(x==null||O==null||j==null))if(Wt(O-x)!==Wt(j-O)){var E=[];if(Wt(j-O)===Wt(l[1]-l[0])){_=j;var N=O+l[1]-l[0];E[0]=Math.min(N,(N+x)/2),E[1]=Math.max(N,(N+x)/2)}else{_=x;var M=j+l[1]-l[0];E[0]=Math.min(O,(M+O)/2),E[1]=Math.max(O,(M+O)/2)}var P=[Math.min(O,(_+O)/2),Math.max(O,(_+O)/2)];if(e>P[0]&&e<=P[1]||e>=E[0]&&e<=E[1]){var T;return(T=n[f])===null||T===void 0?void 0:T.index}}else{var C=Math.min(x,j),L=Math.max(x,j);if(e>(C+O)/2&&e<=(L+O)/2){var Z;return(Z=n[f])===null||Z===void 0?void 0:Z.index}}}else if(t)for(var ne=0;ne(q.coordinate+B.coordinate)/2||ne>0&&ne(q.coordinate+B.coordinate)/2&&e<=(q.coordinate+U.coordinate)/2)return q.index}}return-1},n7=()=>de(Ly),pg=(e,t)=>t,GT=(e,t,n)=>n,yg=(e,t,n,a)=>a,r7=V(ra,e=>kf(e,t=>t.coordinate)),gg=V([Bl,pg,GT,yg],DT),bg=V([gg,Hl,Uo,Io],fg),a7=(e,t,n)=>{if(t!=null){var a=Bl(e);return t==="axis"?n==="hover"?a.axisInteraction.hover.dataKey:a.axisInteraction.click.dataKey:n==="hover"?a.itemInteraction.hover.dataKey:a.itemInteraction.click.dataKey}},VT=V([Bl,pg,GT,yg],PT),Sf=V([Wr,Jr,Ge,zt,ra,yg,VT,Bo],kT),i7=V([gg,Sf],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),XT=V([ra,bg],ET),l7=V([VT,bg,Ia,Uo,XT,Bo,pg],zT),u7=V([gg,bg],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),o7=(e,t,n,a,l,o,c)=>{if(!(!e||!n||!a||!l)&&t7(e,c)){var f=E5(e,t),d=YT(f,o,l,n,a),h=JU(t,l,d,e);return{activeIndex:String(d),activeCoordinate:h}}},s7=(e,t,n,a,l,o,c)=>{if(!(!e||!a||!l||!o||!n)){var f=K6(e,n);if(f){var d=N5(f,t),h=YT(d,c,o,a,l),v=e7(t,o,h,f);return{activeIndex:String(h),activeCoordinate:v}}}},c7=(e,t,n,a,l,o,c,f)=>{if(!(!e||!t||!a||!l||!o))return t==="horizontal"||t==="vertical"?o7(e,t,a,l,o,c,f):s7(e,t,n,a,l,o,c)},f7=V(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var a=e[t];if(a!=null)return n?a.panoramaElement:a.element}}),d7=V(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(a=>parseInt(a,10)).concat(Object.values(Vt)),n=Array.from(new Set(t));return n.sort((a,l)=>a-l)},{memoizeOptions:{resultEqualityCheck:Y9}});function yO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function gO(e){for(var t=1;tgO(gO({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),p7)},g7=new Set(Object.values(Vt));function b7(e){return g7.has(e)}var FT=hn({name:"zIndex",initialState:y7,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:rt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!b7(n)&&delete e.zIndexMap[n])},prepare:rt()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:a,isPanorama:l}=t.payload;e.zIndexMap[n]?l?e.zIndexMap[n].panoramaElement=a:e.zIndexMap[n].element=a:e.zIndexMap[n]={consumers:0,element:l?void 0:a,panoramaElement:l?a:void 0}},prepare:rt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:rt()}}}),{registerZIndexPortal:x7,unregisterZIndexPortal:S7,registerZIndexPortalElement:w7,unregisterZIndexPortalElement:j7}=FT.actions,O7=FT.reducer;function ir(e){var{zIndex:t,children:n}=e,a=iR(),l=a&&t!==void 0&&t!==0,o=mn(),c=Qe();S.useLayoutEffect(()=>l?(c(x7({zIndex:t})),()=>{c(S7({zIndex:t}))}):_o,[c,t,l]);var f=de(d=>f7(d,t,o));return l?f?U0.createPortal(n,f):null:n}function g0(){return g0=Object.assign?Object.assign.bind():function(e){for(var t=1;tS.useContext(ZT),cp={exports:{}},xO;function D7(){return xO||(xO=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(n=!1));function l(d,h,v){this.fn=d,this.context=h,this.once=v||!1}function o(d,h,v,p,b){if(typeof v!="function")throw new TypeError("The listener must be a function");var x=new l(v,p||d,b),O=n?n+h:h;return d._events[O]?d._events[O].fn?d._events[O]=[d._events[O],x]:d._events[O].push(x):(d._events[O]=x,d._eventsCount++),d}function c(d,h){--d._eventsCount===0?d._events=new a:delete d._events[h]}function f(){this._events=new a,this._eventsCount=0}f.prototype.eventNames=function(){var h=[],v,p;if(this._eventsCount===0)return h;for(p in v=this._events)t.call(v,p)&&h.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(v)):h},f.prototype.listeners=function(h){var v=n?n+h:h,p=this._events[v];if(!p)return[];if(p.fn)return[p.fn];for(var b=0,x=p.length,O=new Array(x);b{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),R7=WT.reducer,{createEventEmitter:L7}=WT.actions;function $7(e){return e.tooltip.syncInteraction}var U7={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},JT=hn({name:"chartData",initialState:U7,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:n,endIndex:a}=t.payload;n!=null&&(e.dataStartIndex=n),a!=null&&(e.dataEndIndex=a)}}}),{setChartData:wO,setDataStartEndIndexes:q7,setComputedData:KG}=JT.actions,B7=JT.reducer,I7=["x","y"];function jO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function pl(e){for(var t=1;td.rootProps.className);S.useEffect(()=>{if(e==null)return _o;var d=(h,v,p)=>{if(t!==p&&e===h){if(a==="index"){var b;if(c&&v!==null&&v!==void 0&&(b=v.payload)!==null&&b!==void 0&&b.coordinate&&v.payload.sourceViewBox){var x=v.payload.coordinate,{x:O,y:j}=x,_=G7(x,I7),{x:E,y:N,width:M,height:P}=v.payload.sourceViewBox,T=pl(pl({},_),{},{x:c.x+(M?(O-E)/M:0)*c.width,y:c.y+(P?(j-N)/P:0)*c.height});n(pl(pl({},v),{},{payload:pl(pl({},v.payload),{},{coordinate:T})}))}else n(v);return}if(l!=null){var C;if(typeof a=="function"){var L={activeTooltipIndex:v.payload.index==null?void 0:Number(v.payload.index),isTooltipActive:v.payload.active,activeIndex:v.payload.index==null?void 0:Number(v.payload.index),activeLabel:v.payload.label,activeDataKey:v.payload.dataKey,activeCoordinate:v.payload.coordinate},Z=a(l,L);C=l[Z]}else a==="value"&&(C=l.find(K=>String(K.value)===v.payload.label));var{coordinate:ne}=v.payload;if(C==null||v.payload.active===!1||ne==null||c==null){n(p0({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:q,y:U}=ne,B=Math.min(q,c.x+c.width),ue=Math.min(U,c.y+c.height),oe={x:o==="horizontal"?C.coordinate:B,y:o==="horizontal"?ue:C.coordinate},ve=p0({active:v.payload.active,coordinate:oe,dataKey:v.payload.dataKey,index:String(C.index),label:v.payload.label,sourceViewBox:v.payload.sourceViewBox,graphicalItemId:v.payload.graphicalItemId});n(ve)}}};return So.on(b0,d),()=>{So.off(b0,d)}},[f,n,t,e,a,l,o,c])}function F7(){var e=de($y),t=de(Uy),n=Qe();S.useEffect(()=>{if(e==null)return _o;var a=(l,o,c)=>{t!==c&&e===l&&n(q7(o))};return So.on(SO,a),()=>{So.off(SO,a)}},[n,t,e])}function Z7(){var e=Qe();S.useEffect(()=>{e(L7())},[e]),X7(),F7()}function Q7(e,t,n,a,l,o){var c=de(x=>a7(x,e,t)),f=de(Uy),d=de($y),h=de(YN),v=de($7),p=v?.active,b=Xf();S.useEffect(()=>{if(!p&&d!=null&&f!=null){var x=p0({active:o,coordinate:n,dataKey:c,index:l,label:typeof a=="number"?String(a):a,sourceViewBox:b,graphicalItemId:void 0});So.emit(b0,d,x,f)}},[p,n,c,l,a,f,d,h,o,b])}function OO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function _O(e){for(var t=1;t{L(W$({shared:N,trigger:M,axisId:C,active:l,defaultIndex:Z}))},[L,N,M,C,l,Z]);var ne=Xf(),q=qE(),U=G$(N),{activeIndex:B,isActive:ue}=(t=de(he=>u7(he,U,M,Z)))!==null&&t!==void 0?t:{},oe=de(he=>l7(he,U,M,Z)),ve=de(he=>XT(he,U,M,Z)),K=de(he=>i7(he,U,M,Z)),ee=oe,z=C7(),G=(n=l??ue)!==null&&n!==void 0?n:!1,[re,k]=BA([ee,G]),F=U==="axis"?ve:void 0;Q7(U,M,K,F,B,G);var ie=T??z;if(ie==null||ne==null||U==null)return null;var le=ee??AO;G||(le=AO),h&&le.length&&(le=RA(le.filter(he=>he.value!=null&&(he.hide!==!0||a.includeHidden)),b,tq));var ye=le.length>0,be=S.createElement(KR,{allowEscapeViewBox:o,animationDuration:c,animationEasing:f,isAnimationActive:v,active:G,coordinate:K,hasPayload:ye,offset:p,position:x,reverseDirection:O,useTranslate3d:j,viewBox:ne,wrapperStyle:_,lastBoundingBox:re,innerRef:k,hasPortalFromProps:!!T},nq(d,_O(_O({},a),{},{payload:le,label:F,active:G,activeIndex:B,coordinate:K,accessibilityLayer:q})));return S.createElement(S.Fragment,null,U0.createPortal(be,ie),G&&S.createElement(M7,{cursor:E,tooltipEventType:U,coordinate:K,payload:le,index:B}))}var yd=e=>null;yd.displayName="Cell";function aq(e,t,n){return(t=iq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iq(e){var t=lq(e,"string");return typeof t=="symbol"?t:t+""}function lq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class uq{constructor(t){aq(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var a=this.cache.keys().next().value;a!=null&&this.cache.delete(a)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function EO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function oq(e){for(var t=1;t{try{var n=document.getElementById(TO);n||(n=document.createElement("span"),n.setAttribute("id",TO),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,hq,t),n.textContent="".concat(e);var a=n.getBoundingClientRect();return{width:a.width,height:a.height}}catch{return{width:0,height:0}}},no=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Jf.isSsr)return{width:0,height:0};if(!eM.enableCache)return MO(t,n);var a=mq(t,n),l=NO.get(a);if(l)return l;var o=MO(t,n);return NO.set(a,o),o},tM;function vq(e,t,n){return(t=pq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pq(e){var t=yq(e,"string");return typeof t=="symbol"?t:t+""}function yq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CO=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,DO=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,gq=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,bq=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,xq={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Sq=["cm","mm","pt","pc","in","Q","px"];function wq(e){return Sq.includes(e)}var xl="NaN";function jq(e,t){return e*xq[t]}class Gt{static parse(t){var n,[,a,l]=(n=bq.exec(t))!==null&&n!==void 0?n:[];return a==null?Gt.NaN:new Gt(parseFloat(a),l??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,vr(t)&&(this.unit=""),n!==""&&!gq.test(n)&&(this.num=NaN,this.unit=""),wq(n)&&(this.num=jq(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return vr(this.num)}}tM=Gt;vq(Gt,"NaN",new tM(NaN,""));function nM(e){if(e==null||e.includes(xl))return xl;for(var t=e;t.includes("*")||t.includes("/");){var n,[,a,l,o]=(n=CO.exec(t))!==null&&n!==void 0?n:[],c=Gt.parse(a??""),f=Gt.parse(o??""),d=l==="*"?c.multiply(f):c.divide(f);if(d.isNaN())return xl;t=t.replace(CO,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,[,v,p,b]=(h=DO.exec(t))!==null&&h!==void 0?h:[],x=Gt.parse(v??""),O=Gt.parse(b??""),j=p==="+"?x.add(O):x.subtract(O);if(j.isNaN())return xl;t=t.replace(DO,j.toString())}return t}var kO=/\(([^()]*)\)/;function Oq(e){for(var t=e,n;(n=kO.exec(t))!=null;){var[,a]=n;t=t.replace(kO,nM(a))}return t}function _q(e){var t=e.replace(/\s+/g,"");return t=Oq(t),t=nM(t),t}function Aq(e){try{return _q(e)}catch{return xl}}function fp(e){var t=Aq(e.slice(5,-1));return t===xl?"":t}var Eq=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Nq=["dx","dy","angle","className","breakAll"];function x0(){return x0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:n,style:a}=e;try{var l=[];_t(t)||(n?l=t.toString().split(""):l=t.toString().split(rM));var o=l.map(f=>({word:f,width:no(f,a).width})),c=n?0:no(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}};function Mq(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var iM=(e,t,n,a)=>e.reduce((l,o)=>{var{word:c,width:f}=o,d=l[l.length-1];if(d&&f!=null&&(t==null||a||d.width+f+ne.reduce((t,n)=>t.width>n.width?t:n),Cq="…",zO=(e,t,n,a,l,o,c,f)=>{var d=e.slice(0,t),h=aM({breakAll:n,style:a,children:d+Cq});if(!h)return[!1,[]];var v=iM(h.wordsWithComputedWidth,o,c,f),p=v.length>l||lM(v).width>Number(o);return[p,v]},Dq=(e,t,n,a,l)=>{var{maxLines:o,children:c,style:f,breakAll:d}=e,h=me(o),v=String(c),p=iM(t,a,n,l);if(!h||l)return p;var b=p.length>o||lM(p).width>Number(a);if(!b)return p;for(var x=0,O=v.length-1,j=0,_;x<=O&&j<=v.length-1;){var E=Math.floor((x+O)/2),N=E-1,[M,P]=zO(v,N,d,f,o,a,n,l),[T]=zO(v,E,d,f,o,a,n,l);if(!M&&!T&&(x=E+1),M&&T&&(O=E-1),!M&&T){_=P;break}j++}return _||p},RO=e=>{var t=_t(e)?[]:e.toString().split(rM);return[{words:t,width:void 0}]},kq=e=>{var{width:t,scaleToFit:n,children:a,style:l,breakAll:o,maxLines:c}=e;if((t||n)&&!Jf.isSsr){var f,d,h=aM({breakAll:o,children:a,style:l});if(h){var{wordsWithComputedWidth:v,spaceWidth:p}=h;f=v,d=p}else return RO(a);return Dq({breakAll:o,children:a,maxLines:c,style:l},f,d,t,!!n)}return RO(a)},uM="#808080",Pq={angle:0,breakAll:!1,capHeight:"0.71em",fill:uM,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},gd=S.forwardRef((e,t)=>{var n=At(e,Pq),{x:a,y:l,lineHeight:o,capHeight:c,fill:f,scaleToFit:d,textAnchor:h,verticalAnchor:v}=n,p=PO(n,Eq),b=S.useMemo(()=>kq({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:d,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,d,p.style,p.width]),{dx:x,dy:O,angle:j,className:_,breakAll:E}=p,N=PO(p,Nq);if(!pr(a)||!pr(l)||b.length===0)return null;var M=Number(a)+(me(x)?x:0),P=Number(l)+(me(O)?O:0);if(!wt(M)||!wt(P))return null;var T;switch(v){case"start":T=fp("calc(".concat(c,")"));break;case"middle":T=fp("calc(".concat((b.length-1)/2," * -").concat(o," + (").concat(c," / 2))"));break;default:T=fp("calc(".concat(b.length-1," * -").concat(o,")"));break}var C=[];if(d){var L=b[0].width,{width:Z}=p;C.push("scale(".concat(me(Z)&&me(L)?Z/L:1,")"))}return j&&C.push("rotate(".concat(j,", ").concat(M,", ").concat(P,")")),C.length&&(N.transform=C.join(" ")),S.createElement("text",x0({},tn(N),{ref:t,x:M,y:P,className:Re("recharts-text",_),textAnchor:h,fill:f.includes("url")?uM:f}),b.map((ne,q)=>{var U=ne.words.join(E?"":" ");return S.createElement("tspan",{x:M,dy:q===0?T:o,key:"".concat(U,"-").concat(q)},U)}))});gd.displayName="Text";var zq=["labelRef"],Rq=["content"];function LO(e,t){if(e==null)return{};var n,a,l=Lq(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{x:t,y:n,upperWidth:a,lowerWidth:l,width:o,height:c,children:f}=e,d=S.useMemo(()=>({x:t,y:n,upperWidth:a,lowerWidth:l,width:o,height:c}),[t,n,a,l,o,c]);return S.createElement(oM.Provider,{value:d},f)},sM=()=>{var e=S.useContext(oM),t=Xf();return e||EE(t)},Iq=S.createContext(null),Hq=()=>{var e=S.useContext(Iq),t=de(ZN);return e||t},Kq=e=>{var{value:t,formatter:n}=e,a=_t(e.children)?t:e.children;return typeof n=="function"?n(a):a},xg=e=>e!=null&&typeof e=="function",Yq=(e,t)=>{var n=Wt(t-e),a=Math.min(Math.abs(t-e),360);return n*a},Gq=(e,t,n,a,l)=>{var{offset:o,className:c}=e,{cx:f,cy:d,innerRadius:h,outerRadius:v,startAngle:p,endAngle:b,clockWise:x}=l,O=(h+v)/2,j=Yq(p,b),_=j>=0?1:-1,E,N;switch(t){case"insideStart":E=p+_*o,N=x;break;case"insideEnd":E=b-_*o,N=!x;break;case"end":E=b+_*o,N=x;break;default:throw new Error("Unsupported position ".concat(t))}N=j<=0?N:!N;var M=xt(f,d,O,E),P=xt(f,d,O,E+(N?1:-1)*359),T="M".concat(M.x,",").concat(M.y,` + A`,",",",0,0,",",",",","Z"])),R.x,R.y,o,o,+(v<0),C.x,C.y,a,a,+(ee>180),+(v>0),M.x,M.y,o,o,+(v<0),P.x,P.y)}else N+=ct(p2||(p2=di(["L",",","Z"])),t,n);return N},V6={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},FE=e=>{var t=At(e,V6),{cx:n,cy:a,innerRadius:l,outerRadius:o,cornerRadius:c,forceCornerRadius:f,cornerIsExternal:d,startAngle:h,endAngle:v,className:p}=t;if(o0&&Math.abs(h-v)<360?j=G6({cx:n,cy:a,innerRadius:l,outerRadius:o,cornerRadius:Math.min(O,x/2),forceCornerRadius:f,cornerIsExternal:d,startAngle:h,endAngle:v}):j=XE({cx:n,cy:a,innerRadius:l,outerRadius:o,startAngle:h,endAngle:v}),S.createElement("path",l0({},tn(t),{className:b,d:j}))};function X6(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(EA(t)){if(e==="centric"){var{cx:a,cy:l,innerRadius:o,outerRadius:c,angle:f}=t,d=xt(a,l,o,f),h=xt(a,l,c,f);return[{x:d.x,y:d.y},{x:h.x,y:h.y}]}return VE(t)}}var Wv={},Jv={},ep={},y2;function F6(){return y2||(y2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$A();function n(a){return t.isSymbol(a)?NaN:Number(a)}e.toNumber=n})(ep)),ep}var g2;function Z6(){return g2||(g2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F6();function n(a){return a?(a=t.toNumber(a),a===1/0||a===-1/0?(a<0?-1:1)*Number.MAX_VALUE:a===a?a:0):a===0?a:0}e.toFinite=n})(Jv)),Jv}var b2;function Q6(){return b2||(b2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UA(),n=Z6();function a(l,o,c){c&&typeof c!="number"&&t.isIterateeCall(l,o,c)&&(o=c=void 0),l=n.toFinite(l),o===void 0?(o=l,l=0):o=n.toFinite(o),c=c===void 0?lt?1:e>=t?0:NaN}function e8(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function cy(e){let t,n,a;e.length!==2?(t=Ra,n=(f,d)=>Ra(e(f),d),a=(f,d)=>e(f)-d):(t=e===Ra||e===e8?e:t8,n=e,a=e);function l(f,d,h=0,v=f.length){if(h>>1;n(f[p],d)<0?h=p+1:v=p}while(h>>1;n(f[p],d)<=0?h=p+1:v=p}while(hh&&a(f[p-1],d)>-a(f[p],d)?p-1:p}return{left:l,center:c,right:o}}function t8(){return 0}function QE(e){return e===null?NaN:+e}function*n8(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const r8=cy(Ra),Co=r8.right;cy(QE).center;class S2 extends Map{constructor(t,n=l8){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[a,l]of t)this.set(a,l)}get(t){return super.get(w2(this,t))}has(t){return super.has(w2(this,t))}set(t,n){return super.set(a8(this,t),n)}delete(t){return super.delete(i8(this,t))}}function w2({_intern:e,_key:t},n){const a=t(n);return e.has(a)?e.get(a):n}function a8({_intern:e,_key:t},n){const a=t(n);return e.has(a)?e.get(a):(e.set(a,n),n)}function i8({_intern:e,_key:t},n){const a=t(n);return e.has(a)&&(n=e.get(a),e.delete(a)),n}function l8(e){return e!==null&&typeof e=="object"?e.valueOf():e}function u8(e=Ra){if(e===Ra)return WE;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const a=e(t,n);return a||a===0?a:(e(n,n)===0)-(e(t,t)===0)}}function WE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const o8=Math.sqrt(50),s8=Math.sqrt(10),c8=Math.sqrt(2);function of(e,t,n){const a=(t-e)/Math.max(0,n),l=Math.floor(Math.log10(a)),o=a/Math.pow(10,l),c=o>=o8?10:o>=s8?5:o>=c8?2:1;let f,d,h;return l<0?(h=Math.pow(10,-l)/c,f=Math.round(e*h),d=Math.round(t*h),f/ht&&--d,h=-h):(h=Math.pow(10,l)*c,f=Math.round(e/h),d=Math.round(t/h),f*ht&&--d),d0))return[];if(e===t)return[e];const a=t=l))return[];const f=o-l+1,d=new Array(f);if(a)if(c<0)for(let h=0;h=a)&&(n=a);return n}function O2(e,t){let n;for(const a of e)a!=null&&(n>a||n===void 0&&a>=a)&&(n=a);return n}function JE(e,t,n=0,a=1/0,l){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),a=Math.floor(Math.min(e.length-1,a)),!(n<=t&&t<=a))return e;for(l=l===void 0?WE:u8(l);a>n;){if(a-n>600){const d=a-n+1,h=t-n+1,v=Math.log(d),p=.5*Math.exp(2*v/3),b=.5*Math.sqrt(v*p*(d-p)/d)*(h-d/2<0?-1:1),x=Math.max(n,Math.floor(t-h*p/d+b)),O=Math.min(a,Math.floor(t+(d-h)*p/d+b));JE(e,t,x,O,l)}const o=e[t];let c=n,f=a;for(Hu(e,n,t),l(e[a],o)>0&&Hu(e,n,a);c0;)--f}l(e[n],o)===0?Hu(e,n,f):(++f,Hu(e,f,a)),f<=t&&(n=f+1),t<=f&&(a=f-1)}return e}function Hu(e,t,n){const a=e[t];e[t]=e[n],e[n]=a}function f8(e,t,n){if(e=Float64Array.from(n8(e)),!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return O2(e);if(t>=1)return j2(e);var a,l=(a-1)*t,o=Math.floor(l),c=j2(JE(e,o).subarray(0,o+1)),f=O2(e.subarray(o+1));return c+(f-c)*(l-o)}}function d8(e,t,n=QE){if(!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return+n(e[0],0,e);if(t>=1)return+n(e[a-1],a-1,e);var a,l=(a-1)*t,o=Math.floor(l),c=+n(e[o],o,e),f=+n(e[o+1],o+1,e);return c+(f-c)*(l-o)}}function h8(e,t,n){e=+e,t=+t,n=(l=arguments.length)<2?(t=e,e=0,1):l<3?1:+n;for(var a=-1,l=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(l);++a>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?bc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?bc(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=p8.exec(e))?new fn(t[1],t[2],t[3],1):(t=y8.exec(e))?new fn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=g8.exec(e))?bc(t[1],t[2],t[3],t[4]):(t=b8.exec(e))?bc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=x8.exec(e))?C2(t[1],t[2]/100,t[3]/100,1):(t=S8.exec(e))?C2(t[1],t[2]/100,t[3]/100,t[4]):_2.hasOwnProperty(e)?N2(_2[e]):e==="transparent"?new fn(NaN,NaN,NaN,0):null}function N2(e){return new fn(e>>16&255,e>>8&255,e&255,1)}function bc(e,t,n,a){return a<=0&&(e=t=n=NaN),new fn(e,t,n,a)}function O8(e){return e instanceof Do||(e=go(e)),e?(e=e.rgb(),new fn(e.r,e.g,e.b,e.opacity)):new fn}function f0(e,t,n,a){return arguments.length===1?O8(e):new fn(e,t,n,a??1)}function fn(e,t,n,a){this.r=+e,this.g=+t,this.b=+n,this.opacity=+a}hy(fn,f0,tN(Do,{brighter(e){return e=e==null?sf:Math.pow(sf,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?po:Math.pow(po,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fn(yi(this.r),yi(this.g),yi(this.b),cf(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:T2,formatHex:T2,formatHex8:_8,formatRgb:M2,toString:M2}));function T2(){return`#${hi(this.r)}${hi(this.g)}${hi(this.b)}`}function _8(){return`#${hi(this.r)}${hi(this.g)}${hi(this.b)}${hi((isNaN(this.opacity)?1:this.opacity)*255)}`}function M2(){const e=cf(this.opacity);return`${e===1?"rgb(":"rgba("}${yi(this.r)}, ${yi(this.g)}, ${yi(this.b)}${e===1?")":`, ${e})`}`}function cf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function hi(e){return e=yi(e),(e<16?"0":"")+e.toString(16)}function C2(e,t,n,a){return a<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tr(e,t,n,a)}function nN(e){if(e instanceof tr)return new tr(e.h,e.s,e.l,e.opacity);if(e instanceof Do||(e=go(e)),!e)return new tr;if(e instanceof tr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,a=e.b/255,l=Math.min(t,n,a),o=Math.max(t,n,a),c=NaN,f=o-l,d=(o+l)/2;return f?(t===o?c=(n-a)/f+(n0&&d<1?0:c,new tr(c,f,d,e.opacity)}function A8(e,t,n,a){return arguments.length===1?nN(e):new tr(e,t,n,a??1)}function tr(e,t,n,a){this.h=+e,this.s=+t,this.l=+n,this.opacity=+a}hy(tr,A8,tN(Do,{brighter(e){return e=e==null?sf:Math.pow(sf,e),new tr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?po:Math.pow(po,e),new tr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,a=n+(n<.5?n:1-n)*t,l=2*n-a;return new fn(np(e>=240?e-240:e+120,l,a),np(e,l,a),np(e<120?e+240:e-120,l,a),this.opacity)},clamp(){return new tr(D2(this.h),xc(this.s),xc(this.l),cf(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=cf(this.opacity);return`${e===1?"hsl(":"hsla("}${D2(this.h)}, ${xc(this.s)*100}%, ${xc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function D2(e){return e=(e||0)%360,e<0?e+360:e}function xc(e){return Math.max(0,Math.min(1,e||0))}function np(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const my=e=>()=>e;function E8(e,t){return function(n){return e+n*t}}function N8(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(a){return Math.pow(e+a*t,n)}}function T8(e){return(e=+e)==1?rN:function(t,n){return n-t?N8(t,n,e):my(isNaN(t)?n:t)}}function rN(e,t){var n=t-e;return n?E8(e,n):my(isNaN(e)?t:e)}const k2=(function e(t){var n=T8(t);function a(l,o){var c=n((l=f0(l)).r,(o=f0(o)).r),f=n(l.g,o.g),d=n(l.b,o.b),h=rN(l.opacity,o.opacity);return function(v){return l.r=c(v),l.g=f(v),l.b=d(v),l.opacity=h(v),l+""}}return a.gamma=e,a})(1);function M8(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,a=t.slice(),l;return function(o){for(l=0;ln&&(o=t.slice(n,o),f[c]?f[c]+=o:f[++c]=o),(a=a[0])===(l=l[0])?f[c]?f[c]+=l:f[++c]=l:(f[++c]=null,d.push({i:c,x:ff(a,l)})),n=rp.lastIndex;return nt&&(n=e,e=t,t=n),function(a){return Math.max(e,Math.min(t,a))}}function B8(e,t,n){var a=e[0],l=e[1],o=t[0],c=t[1];return l2?I8:B8,d=h=null,p}function p(b){return b==null||isNaN(b=+b)?o:(d||(d=f(e.map(a),t,n)))(a(c(b)))}return p.invert=function(b){return c(l((h||(h=f(t,e.map(a),ff)))(b)))},p.domain=function(b){return arguments.length?(e=Array.from(b,df),v()):e.slice()},p.range=function(b){return arguments.length?(t=Array.from(b),v()):t.slice()},p.rangeRound=function(b){return t=Array.from(b),n=vy,v()},p.clamp=function(b){return arguments.length?(c=b?!0:en,v()):c!==en},p.interpolate=function(b){return arguments.length?(n=b,v()):n},p.unknown=function(b){return arguments.length?(o=b,p):o},function(b,x){return a=b,l=x,v()}}function py(){return nd()(en,en)}function H8(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function hf(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),a=e.slice(0,n);return[a.length>1?a[0]+a.slice(2):a,+e.slice(n+1)]}function Tl(e){return e=hf(Math.abs(e)),e?e[1]:NaN}function K8(e,t){return function(n,a){for(var l=n.length,o=[],c=0,f=e[0],d=0;l>0&&f>0&&(d+f+1>a&&(f=Math.max(1,a-d)),o.push(n.substring(l-=f,l+f)),!((d+=f+1)>a));)f=e[c=(c+1)%e.length];return o.reverse().join(t)}}function Y8(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var G8=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function bo(e){if(!(t=G8.exec(e)))throw new Error("invalid format: "+e);var t;return new yy({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]})}bo.prototype=yy.prototype;function yy(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+""}yy.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 V8(e){e:for(var t=e.length,n=1,a=-1,l;n0&&(a=0);break}return a>0?e.slice(0,a)+e.slice(l+1):e}var mf;function X8(e,t){var n=hf(e,t);if(!n)return mf=void 0,e.toPrecision(t);var a=n[0],l=n[1],o=l-(mf=Math.max(-8,Math.min(8,Math.floor(l/3)))*3)+1,c=a.length;return o===c?a:o>c?a+new Array(o-c+1).join("0"):o>0?a.slice(0,o)+"."+a.slice(o):"0."+new Array(1-o).join("0")+hf(e,Math.max(0,t+o-1))[0]}function z2(e,t){var n=hf(e,t);if(!n)return e+"";var a=n[0],l=n[1];return l<0?"0."+new Array(-l).join("0")+a:a.length>l+1?a.slice(0,l+1)+"."+a.slice(l+1):a+new Array(l-a.length+2).join("0")}const R2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:H8,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)=>z2(e*100,t),r:z2,s:X8,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function L2(e){return e}var $2=Array.prototype.map,U2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function F8(e){var t=e.grouping===void 0||e.thousands===void 0?L2:K8($2.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",a=e.currency===void 0?"":e.currency[1]+"",l=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?L2:Y8($2.call(e.numerals,String)),c=e.percent===void 0?"%":e.percent+"",f=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function h(p,b){p=bo(p);var x=p.fill,O=p.align,j=p.sign,_=p.symbol,E=p.zero,N=p.width,M=p.comma,P=p.precision,T=p.trim,C=p.type;C==="n"?(M=!0,C="g"):R2[C]||(P===void 0&&(P=12),T=!0,C="g"),(E||x==="0"&&O==="=")&&(E=!0,x="0",O="=");var R=(b&&b.prefix!==void 0?b.prefix:"")+(_==="$"?n:_==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),F=(_==="$"?a:/[%p]/.test(C)?c:"")+(b&&b.suffix!==void 0?b.suffix:""),ee=R2[C],q=/[defgprs%]/.test(C);P=P===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function U(B){var ue=R,oe=F,ve,K,te;if(C==="c")oe=ee(B)+oe,B="";else{B=+B;var z=B<0||1/B<0;if(B=isNaN(B)?d:ee(Math.abs(B),P),T&&(B=V8(B)),z&&+B==0&&j!=="+"&&(z=!1),ue=(z?j==="("?j:f:j==="-"||j==="("?"":j)+ue,oe=(C==="s"&&!isNaN(B)&&mf!==void 0?U2[8+mf/3]:"")+oe+(z&&j==="("?")":""),q){for(ve=-1,K=B.length;++vete||te>57){oe=(te===46?l+B.slice(ve+1):B.slice(ve))+oe,B=B.slice(0,ve);break}}}M&&!E&&(B=t(B,1/0));var G=ue.length+B.length+oe.length,re=G>1)+ue+B+oe+re.slice(G);break;default:B=re+ue+B+oe;break}return o(B)}return U.toString=function(){return p+""},U}function v(p,b){var x=Math.max(-8,Math.min(8,Math.floor(Tl(b)/3)))*3,O=Math.pow(10,-x),j=h((p=bo(p),p.type="f",p),{suffix:U2[8+x/3]});return function(_){return j(O*_)}}return{format:h,formatPrefix:v}}var Sc,gy,aN;Z8({thousands:",",grouping:[3],currency:["$",""]});function Z8(e){return Sc=F8(e),gy=Sc.format,aN=Sc.formatPrefix,Sc}function Q8(e){return Math.max(0,-Tl(Math.abs(e)))}function W8(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Tl(t)/3)))*3-Tl(Math.abs(e)))}function J8(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Tl(t)-Tl(e))+1}function iN(e,t,n,a){var l=s0(e,t,n),o;switch(a=bo(a??",f"),a.type){case"s":{var c=Math.max(Math.abs(e),Math.abs(t));return a.precision==null&&!isNaN(o=W8(l,c))&&(a.precision=o),aN(a,c)}case"":case"e":case"g":case"p":case"r":{a.precision==null&&!isNaN(o=J8(l,Math.max(Math.abs(e),Math.abs(t))))&&(a.precision=o-(a.type==="e"));break}case"f":case"%":{a.precision==null&&!isNaN(o=Q8(l))&&(a.precision=o-(a.type==="%")*2);break}}return gy(a)}function qa(e){var t=e.domain;return e.ticks=function(n){var a=t();return u0(a[0],a[a.length-1],n??10)},e.tickFormat=function(n,a){var l=t();return iN(l[0],l[l.length-1],n??10,a)},e.nice=function(n){n==null&&(n=10);var a=t(),l=0,o=a.length-1,c=a[l],f=a[o],d,h,v=10;for(f0;){if(h=o0(c,f,n),h===d)return a[l]=c,a[o]=f,t(a);if(h>0)c=Math.floor(c/h)*h,f=Math.ceil(f/h)*h;else if(h<0)c=Math.ceil(c*h)/h,f=Math.floor(f*h)/h;else break;d=h}return e},e}function lN(){var e=py();return e.copy=function(){return ko(e,lN())},Fn.apply(e,arguments),qa(e)}function uN(e){var t;function n(a){return a==null||isNaN(a=+a)?t:a}return n.invert=n,n.domain=n.range=function(a){return arguments.length?(e=Array.from(a,df),n):e.slice()},n.unknown=function(a){return arguments.length?(t=a,n):t},n.copy=function(){return uN(e).unknown(t)},e=arguments.length?Array.from(e,df):[0,1],qa(n)}function oN(e,t){e=e.slice();var n=0,a=e.length-1,l=e[n],o=e[a],c;return oMath.pow(e,t)}function aL(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 I2(e){return(t,n)=>-e(-t,n)}function by(e){const t=e(q2,B2),n=t.domain;let a=10,l,o;function c(){return l=aL(a),o=rL(a),n()[0]<0?(l=I2(l),o=I2(o),e(eL,tL)):e(q2,B2),t}return t.base=function(f){return arguments.length?(a=+f,c()):a},t.domain=function(f){return arguments.length?(n(f),c()):n()},t.ticks=f=>{const d=n();let h=d[0],v=d[d.length-1];const p=v0){for(;b<=x;++b)for(O=1;Ov)break;E.push(j)}}else for(;b<=x;++b)for(O=a-1;O>=1;--O)if(j=b>0?O/o(-b):O*o(b),!(jv)break;E.push(j)}E.length*2<_&&(E=u0(h,v,_))}else E=u0(b,x,Math.min(x-b,_)).map(o);return p?E.reverse():E},t.tickFormat=(f,d)=>{if(f==null&&(f=10),d==null&&(d=a===10?"s":","),typeof d!="function"&&(!(a%1)&&(d=bo(d)).precision==null&&(d.trim=!0),d=gy(d)),f===1/0)return d;const h=Math.max(1,a*f/t.ticks().length);return v=>{let p=v/o(Math.round(l(v)));return p*an(oN(n(),{floor:f=>o(Math.floor(l(f))),ceil:f=>o(Math.ceil(l(f)))})),t}function sN(){const e=by(nd()).domain([1,10]);return e.copy=()=>ko(e,sN()).base(e.base()),Fn.apply(e,arguments),e}function H2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function K2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function xy(e){var t=1,n=e(H2(t),K2(t));return n.constant=function(a){return arguments.length?e(H2(t=+a),K2(t)):t},qa(n)}function cN(){var e=xy(nd());return e.copy=function(){return ko(e,cN()).constant(e.constant())},Fn.apply(e,arguments)}function Y2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iL(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function lL(e){return e<0?-e*e:e*e}function Sy(e){var t=e(en,en),n=1;function a(){return n===1?e(en,en):n===.5?e(iL,lL):e(Y2(n),Y2(1/n))}return t.exponent=function(l){return arguments.length?(n=+l,a()):n},qa(t)}function wy(){var e=Sy(nd());return e.copy=function(){return ko(e,wy()).exponent(e.exponent())},Fn.apply(e,arguments),e}function uL(){return wy.apply(null,arguments).exponent(.5)}function G2(e){return Math.sign(e)*e*e}function oL(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function fN(){var e=py(),t=[0,1],n=!1,a;function l(o){var c=oL(e(o));return isNaN(c)?a:n?Math.round(c):c}return l.invert=function(o){return e.invert(G2(o))},l.domain=function(o){return arguments.length?(e.domain(o),l):e.domain()},l.range=function(o){return arguments.length?(e.range((t=Array.from(o,df)).map(G2)),l):t.slice()},l.rangeRound=function(o){return l.range(o).round(!0)},l.round=function(o){return arguments.length?(n=!!o,l):n},l.clamp=function(o){return arguments.length?(e.clamp(o),l):e.clamp()},l.unknown=function(o){return arguments.length?(a=o,l):a},l.copy=function(){return fN(e.domain(),t).round(n).clamp(e.clamp()).unknown(a)},Fn.apply(l,arguments),qa(l)}function dN(){var e=[],t=[],n=[],a;function l(){var c=0,f=Math.max(1,t.length);for(n=new Array(f-1);++c0?n[f-1]:e[0],f=n?[a[n-1],t]:[a[h-1],a[h]]},c.unknown=function(d){return arguments.length&&(o=d),c},c.thresholds=function(){return a.slice()},c.copy=function(){return hN().domain([e,t]).range(l).unknown(o)},Fn.apply(qa(c),arguments)}function mN(){var e=[.5],t=[0,1],n,a=1;function l(o){return o!=null&&o<=o?t[Co(e,o,0,a)]:n}return l.domain=function(o){return arguments.length?(e=Array.from(o),a=Math.min(e.length,t.length-1),l):e.slice()},l.range=function(o){return arguments.length?(t=Array.from(o),a=Math.min(e.length,t.length-1),l):t.slice()},l.invertExtent=function(o){var c=t.indexOf(o);return[e[c-1],e[c]]},l.unknown=function(o){return arguments.length?(n=o,l):n},l.copy=function(){return mN().domain(e).range(t).unknown(n)},Fn.apply(l,arguments)}const ap=new Date,ip=new Date;function Et(e,t,n,a){function l(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return l.floor=o=>(e(o=new Date(+o)),o),l.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),l.round=o=>{const c=l(o),f=l.ceil(o);return o-c(t(o=new Date(+o),c==null?1:Math.floor(c)),o),l.range=(o,c,f)=>{const d=[];if(o=l.ceil(o),f=f==null?1:Math.floor(f),!(o0))return d;let h;do d.push(h=new Date(+o)),t(o,f),e(o);while(hEt(c=>{if(c>=c)for(;e(c),!o(c);)c.setTime(c-1)},(c,f)=>{if(c>=c)if(f<0)for(;++f<=0;)for(;t(c,-1),!o(c););else for(;--f>=0;)for(;t(c,1),!o(c););}),n&&(l.count=(o,c)=>(ap.setTime(+o),ip.setTime(+c),e(ap),e(ip),Math.floor(n(ap,ip))),l.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?l.filter(a?c=>a(c)%o===0:c=>l.count(0,c)%o===0):l)),l}const vf=Et(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);vf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Et(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):vf);vf.range;const Br=1e3,Yn=Br*60,Ir=Yn*60,Vr=Ir*24,jy=Vr*7,V2=Vr*30,lp=Vr*365,mi=Et(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Br)},(e,t)=>(t-e)/Br,e=>e.getUTCSeconds());mi.range;const Oy=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Br)},(e,t)=>{e.setTime(+e+t*Yn)},(e,t)=>(t-e)/Yn,e=>e.getMinutes());Oy.range;const _y=Et(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Yn)},(e,t)=>(t-e)/Yn,e=>e.getUTCMinutes());_y.range;const Ay=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Br-e.getMinutes()*Yn)},(e,t)=>{e.setTime(+e+t*Ir)},(e,t)=>(t-e)/Ir,e=>e.getHours());Ay.range;const Ey=Et(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ir)},(e,t)=>(t-e)/Ir,e=>e.getUTCHours());Ey.range;const Po=Et(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Yn)/Vr,e=>e.getDate()-1);Po.range;const rd=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vr,e=>e.getUTCDate()-1);rd.range;const vN=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vr,e=>Math.floor(e/Vr));vN.range;function Ei(e){return Et(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Yn)/jy)}const ad=Ei(0),pf=Ei(1),sL=Ei(2),cL=Ei(3),Ml=Ei(4),fL=Ei(5),dL=Ei(6);ad.range;pf.range;sL.range;cL.range;Ml.range;fL.range;dL.range;function Ni(e){return Et(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/jy)}const id=Ni(0),yf=Ni(1),hL=Ni(2),mL=Ni(3),Cl=Ni(4),vL=Ni(5),pL=Ni(6);id.range;yf.range;hL.range;mL.range;Cl.range;vL.range;pL.range;const Ny=Et(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());Ny.range;const Ty=Et(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());Ty.range;const Xr=Et(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());Xr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Xr.range;const Fr=Et(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());Fr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Fr.range;function pN(e,t,n,a,l,o){const c=[[mi,1,Br],[mi,5,5*Br],[mi,15,15*Br],[mi,30,30*Br],[o,1,Yn],[o,5,5*Yn],[o,15,15*Yn],[o,30,30*Yn],[l,1,Ir],[l,3,3*Ir],[l,6,6*Ir],[l,12,12*Ir],[a,1,Vr],[a,2,2*Vr],[n,1,jy],[t,1,V2],[t,3,3*V2],[e,1,lp]];function f(h,v,p){const b=v_).right(c,b);if(x===c.length)return e.every(s0(h/lp,v/lp,p));if(x===0)return vf.every(Math.max(s0(h,v,p),1));const[O,j]=c[b/c[x-1][2]53)return null;"w"in ae||(ae.w=1),"Z"in ae?(Ce=op(Ku(ae.y,0,1)),$t=Ce.getUTCDay(),Ce=$t>4||$t===0?yf.ceil(Ce):yf(Ce),Ce=rd.offset(Ce,(ae.V-1)*7),ae.y=Ce.getUTCFullYear(),ae.m=Ce.getUTCMonth(),ae.d=Ce.getUTCDate()+(ae.w+6)%7):(Ce=up(Ku(ae.y,0,1)),$t=Ce.getDay(),Ce=$t>4||$t===0?pf.ceil(Ce):pf(Ce),Ce=Po.offset(Ce,(ae.V-1)*7),ae.y=Ce.getFullYear(),ae.m=Ce.getMonth(),ae.d=Ce.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),$t="Z"in ae?op(Ku(ae.y,0,1)).getUTCDay():up(Ku(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-($t+5)%7:ae.w+ae.U*7-($t+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,op(ae)):up(ae)}}function F(W,Se,_e,ae){for(var Lt=0,Ce=Se.length,$t=_e.length,Ut,br;Lt=$t)return-1;if(Ut=Se.charCodeAt(Lt++),Ut===37){if(Ut=Se.charAt(Lt++),br=T[Ut in X2?Se.charAt(Lt++):Ut],!br||(ae=br(W,_e,ae))<0)return-1}else if(Ut!=_e.charCodeAt(ae++))return-1}return ae}function ee(W,Se,_e){var ae=h.exec(Se.slice(_e));return ae?(W.p=v.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function q(W,Se,_e){var ae=x.exec(Se.slice(_e));return ae?(W.w=O.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function U(W,Se,_e){var ae=p.exec(Se.slice(_e));return ae?(W.w=b.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function B(W,Se,_e){var ae=E.exec(Se.slice(_e));return ae?(W.m=N.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function ue(W,Se,_e){var ae=j.exec(Se.slice(_e));return ae?(W.m=_.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function oe(W,Se,_e){return F(W,t,Se,_e)}function ve(W,Se,_e){return F(W,n,Se,_e)}function K(W,Se,_e){return F(W,a,Se,_e)}function te(W){return c[W.getDay()]}function z(W){return o[W.getDay()]}function G(W){return d[W.getMonth()]}function re(W){return f[W.getMonth()]}function k(W){return l[+(W.getHours()>=12)]}function Z(W){return 1+~~(W.getMonth()/3)}function ie(W){return c[W.getUTCDay()]}function le(W){return o[W.getUTCDay()]}function ye(W){return d[W.getUTCMonth()]}function be(W){return f[W.getUTCMonth()]}function he(W){return l[+(W.getUTCHours()>=12)]}function ut(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var Se=C(W+="",M);return Se.toString=function(){return W},Se},parse:function(W){var Se=R(W+="",!1);return Se.toString=function(){return W},Se},utcFormat:function(W){var Se=C(W+="",P);return Se.toString=function(){return W},Se},utcParse:function(W){var Se=R(W+="",!0);return Se.toString=function(){return W},Se}}}var X2={"-":"",_:" ",0:"0"},Rt=/^\s*\d+/,wL=/^%/,jL=/[\\^$*+?|[\]().{}]/g;function Pe(e,t,n){var a=e<0?"-":"",l=(a?-e:e)+"",o=l.length;return a+(o[t.toLowerCase(),n]))}function _L(e,t,n){var a=Rt.exec(t.slice(n,n+1));return a?(e.w=+a[0],n+a[0].length):-1}function AL(e,t,n){var a=Rt.exec(t.slice(n,n+1));return a?(e.u=+a[0],n+a[0].length):-1}function EL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.U=+a[0],n+a[0].length):-1}function NL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.V=+a[0],n+a[0].length):-1}function TL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.W=+a[0],n+a[0].length):-1}function F2(e,t,n){var a=Rt.exec(t.slice(n,n+4));return a?(e.y=+a[0],n+a[0].length):-1}function Z2(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.y=+a[0]+(+a[0]>68?1900:2e3),n+a[0].length):-1}function ML(e,t,n){var a=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return a?(e.Z=a[1]?0:-(a[2]+(a[3]||"00")),n+a[0].length):-1}function CL(e,t,n){var a=Rt.exec(t.slice(n,n+1));return a?(e.q=a[0]*3-3,n+a[0].length):-1}function DL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.m=a[0]-1,n+a[0].length):-1}function Q2(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.d=+a[0],n+a[0].length):-1}function kL(e,t,n){var a=Rt.exec(t.slice(n,n+3));return a?(e.m=0,e.d=+a[0],n+a[0].length):-1}function W2(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.H=+a[0],n+a[0].length):-1}function PL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.M=+a[0],n+a[0].length):-1}function zL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.S=+a[0],n+a[0].length):-1}function RL(e,t,n){var a=Rt.exec(t.slice(n,n+3));return a?(e.L=+a[0],n+a[0].length):-1}function LL(e,t,n){var a=Rt.exec(t.slice(n,n+6));return a?(e.L=Math.floor(a[0]/1e3),n+a[0].length):-1}function $L(e,t,n){var a=wL.exec(t.slice(n,n+1));return a?n+a[0].length:-1}function UL(e,t,n){var a=Rt.exec(t.slice(n));return a?(e.Q=+a[0],n+a[0].length):-1}function qL(e,t,n){var a=Rt.exec(t.slice(n));return a?(e.s=+a[0],n+a[0].length):-1}function J2(e,t){return Pe(e.getDate(),t,2)}function BL(e,t){return Pe(e.getHours(),t,2)}function IL(e,t){return Pe(e.getHours()%12||12,t,2)}function HL(e,t){return Pe(1+Po.count(Xr(e),e),t,3)}function yN(e,t){return Pe(e.getMilliseconds(),t,3)}function KL(e,t){return yN(e,t)+"000"}function YL(e,t){return Pe(e.getMonth()+1,t,2)}function GL(e,t){return Pe(e.getMinutes(),t,2)}function VL(e,t){return Pe(e.getSeconds(),t,2)}function XL(e){var t=e.getDay();return t===0?7:t}function FL(e,t){return Pe(ad.count(Xr(e)-1,e),t,2)}function gN(e){var t=e.getDay();return t>=4||t===0?Ml(e):Ml.ceil(e)}function ZL(e,t){return e=gN(e),Pe(Ml.count(Xr(e),e)+(Xr(e).getDay()===4),t,2)}function QL(e){return e.getDay()}function WL(e,t){return Pe(pf.count(Xr(e)-1,e),t,2)}function JL(e,t){return Pe(e.getFullYear()%100,t,2)}function e9(e,t){return e=gN(e),Pe(e.getFullYear()%100,t,2)}function t9(e,t){return Pe(e.getFullYear()%1e4,t,4)}function n9(e,t){var n=e.getDay();return e=n>=4||n===0?Ml(e):Ml.ceil(e),Pe(e.getFullYear()%1e4,t,4)}function r9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Pe(t/60|0,"0",2)+Pe(t%60,"0",2)}function eO(e,t){return Pe(e.getUTCDate(),t,2)}function a9(e,t){return Pe(e.getUTCHours(),t,2)}function i9(e,t){return Pe(e.getUTCHours()%12||12,t,2)}function l9(e,t){return Pe(1+rd.count(Fr(e),e),t,3)}function bN(e,t){return Pe(e.getUTCMilliseconds(),t,3)}function u9(e,t){return bN(e,t)+"000"}function o9(e,t){return Pe(e.getUTCMonth()+1,t,2)}function s9(e,t){return Pe(e.getUTCMinutes(),t,2)}function c9(e,t){return Pe(e.getUTCSeconds(),t,2)}function f9(e){var t=e.getUTCDay();return t===0?7:t}function d9(e,t){return Pe(id.count(Fr(e)-1,e),t,2)}function xN(e){var t=e.getUTCDay();return t>=4||t===0?Cl(e):Cl.ceil(e)}function h9(e,t){return e=xN(e),Pe(Cl.count(Fr(e),e)+(Fr(e).getUTCDay()===4),t,2)}function m9(e){return e.getUTCDay()}function v9(e,t){return Pe(yf.count(Fr(e)-1,e),t,2)}function p9(e,t){return Pe(e.getUTCFullYear()%100,t,2)}function y9(e,t){return e=xN(e),Pe(e.getUTCFullYear()%100,t,2)}function g9(e,t){return Pe(e.getUTCFullYear()%1e4,t,4)}function b9(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Cl(e):Cl.ceil(e),Pe(e.getUTCFullYear()%1e4,t,4)}function x9(){return"+0000"}function tO(){return"%"}function nO(e){return+e}function rO(e){return Math.floor(+e/1e3)}var ml,SN,wN;S9({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 S9(e){return ml=SL(e),SN=ml.format,ml.parse,wN=ml.utcFormat,ml.utcParse,ml}function w9(e){return new Date(e)}function j9(e){return e instanceof Date?+e:+new Date(+e)}function My(e,t,n,a,l,o,c,f,d,h){var v=py(),p=v.invert,b=v.domain,x=h(".%L"),O=h(":%S"),j=h("%I:%M"),_=h("%I %p"),E=h("%a %d"),N=h("%b %d"),M=h("%B"),P=h("%Y");function T(C){return(d(C)t(l/(e.length-1)))},n.quantiles=function(a){return Array.from({length:a+1},(l,o)=>f8(e,o/a))},n.copy=function(){return AN(t).domain(e)},ea.apply(n,arguments)}function ud(){var e=0,t=.5,n=1,a=1,l,o,c,f,d,h=en,v,p=!1,b;function x(j){return isNaN(j=+j)?b:(j=.5+((j=+v(j))-o)*(a*je.chartData,ky=V([Ia],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Py=(e,t,n,a)=>a?ky(e):Ia(e);function La(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(wt(t)&&wt(n))return!0}return!1}function aO(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function MN(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,a]=e,l,o;if(wt(n))l=n;else if(typeof n=="function")return;if(wt(a))o=a;else if(typeof a=="function")return;var c=[l,o];if(La(c))return c}}function N9(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var a=e(t,n);if(La(a))return aO(a,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[l,o]=e,c,f;if(l==="auto")t!=null&&(c=Math.min(...t));else if(me(l))c=l;else if(typeof l=="function")try{t!=null&&(c=l(t?.[0]))}catch{}else if(typeof l=="string"&&vj.test(l)){var d=vj.exec(l);if(d==null||d[1]==null||t==null)c=void 0;else{var h=+d[1];c=t[0]-h}}else c=t?.[0];if(o==="auto")t!=null&&(f=Math.max(...t));else if(me(o))f=o;else if(typeof o=="function")try{t!=null&&(f=o(t?.[1]))}catch{}else if(typeof o=="string"&&pj.test(o)){var v=pj.exec(o);if(v==null||v[1]==null||t==null)f=void 0;else{var p=+v[1];f=t[1]+p}}else f=t?.[1];var b=[c,f];if(La(b))return t==null?b:aO(b,t,n)}}}var Rl=1e9,T9={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Ry,at=!0,Xn="[DecimalError] ",gi=Xn+"Invalid argument: ",zy=Xn+"Exponent out of range: ",Ll=Math.floor,ci=Math.pow,M9=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,An,Pt=1e7,et=7,CN=9007199254740991,gf=Ll(CN/et),se={};se.absoluteValue=se.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};se.comparedTo=se.cmp=function(e){var t,n,a,l,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(a=o.d.length,l=e.d.length,t=0,n=ae.d[t]^o.s<0?1:-1;return a===l?0:a>l^o.s<0?1:-1};se.decimalPlaces=se.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*et;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};se.dividedBy=se.div=function(e){return Hr(this,new this.constructor(e))};se.dividedToIntegerBy=se.idiv=function(e){var t=this,n=t.constructor;return Xe(Hr(t,new n(e),0,1),n.precision)};se.equals=se.eq=function(e){return!this.cmp(e)};se.exponent=function(){return St(this)};se.greaterThan=se.gt=function(e){return this.cmp(e)>0};se.greaterThanOrEqualTo=se.gte=function(e){return this.cmp(e)>=0};se.isInteger=se.isint=function(){return this.e>this.d.length-2};se.isNegative=se.isneg=function(){return this.s<0};se.isPositive=se.ispos=function(){return this.s>0};se.isZero=function(){return this.s===0};se.lessThan=se.lt=function(e){return this.cmp(e)<0};se.lessThanOrEqualTo=se.lte=function(e){return this.cmp(e)<1};se.logarithm=se.log=function(e){var t,n=this,a=n.constructor,l=a.precision,o=l+5;if(e===void 0)e=new a(10);else if(e=new a(e),e.s<1||e.eq(An))throw Error(Xn+"NaN");if(n.s<1)throw Error(Xn+(n.s?"NaN":"-Infinity"));return n.eq(An)?new a(0):(at=!1,t=Hr(xo(n,o),xo(e,o),o),at=!0,Xe(t,l))};se.minus=se.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?PN(t,e):DN(t,(e.s=-e.s,e))};se.modulo=se.mod=function(e){var t,n=this,a=n.constructor,l=a.precision;if(e=new a(e),!e.s)throw Error(Xn+"NaN");return n.s?(at=!1,t=Hr(n,e,0,1).times(e),at=!0,n.minus(t)):Xe(new a(n),l)};se.naturalExponential=se.exp=function(){return kN(this)};se.naturalLogarithm=se.ln=function(){return xo(this)};se.negated=se.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};se.plus=se.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?DN(t,e):PN(t,(e.s=-e.s,e))};se.precision=se.sd=function(e){var t,n,a,l=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(gi+e);if(t=St(l)+1,a=l.d.length-1,n=a*et+1,a=l.d[a],a){for(;a%10==0;a/=10)n--;for(a=l.d[0];a>=10;a/=10)n++}return e&&t>n?t:n};se.squareRoot=se.sqrt=function(){var e,t,n,a,l,o,c,f=this,d=f.constructor;if(f.s<1){if(!f.s)return new d(0);throw Error(Xn+"NaN")}for(e=St(f),at=!1,l=Math.sqrt(+f),l==0||l==1/0?(t=hr(f.d),(t.length+e)%2==0&&(t+="0"),l=Math.sqrt(t),e=Ll((e+1)/2)-(e<0||e%2),l==1/0?t="5e"+e:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),a=new d(t)):a=new d(l.toString()),n=d.precision,l=c=n+3;;)if(o=a,a=o.plus(Hr(f,o,c+2)).times(.5),hr(o.d).slice(0,c)===(t=hr(a.d)).slice(0,c)){if(t=t.slice(c-3,c+1),l==c&&t=="4999"){if(Xe(o,n+1,0),o.times(o).eq(f)){a=o;break}}else if(t!="9999")break;c+=4}return at=!0,Xe(a,n)};se.times=se.mul=function(e){var t,n,a,l,o,c,f,d,h,v=this,p=v.constructor,b=v.d,x=(e=new p(e)).d;if(!v.s||!e.s)return new p(0);for(e.s*=v.s,n=v.e+e.e,d=b.length,h=x.length,d=0;){for(t=0,l=d+a;l>a;)f=o[l]+x[a]*b[l-a-1]+t,o[l--]=f%Pt|0,t=f/Pt|0;o[l]=(o[l]+t)%Pt|0}for(;!o[--c];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,at?Xe(e,p.precision):e};se.toDecimalPlaces=se.todp=function(e,t){var n=this,a=n.constructor;return n=new a(n),e===void 0?n:(gr(e,0,Rl),t===void 0?t=a.rounding:gr(t,0,8),Xe(n,e+St(n)+1,t))};se.toExponential=function(e,t){var n,a=this,l=a.constructor;return e===void 0?n=Oi(a,!0):(gr(e,0,Rl),t===void 0?t=l.rounding:gr(t,0,8),a=Xe(new l(a),e+1,t),n=Oi(a,!0,e+1)),n};se.toFixed=function(e,t){var n,a,l=this,o=l.constructor;return e===void 0?Oi(l):(gr(e,0,Rl),t===void 0?t=o.rounding:gr(t,0,8),a=Xe(new o(l),e+St(l)+1,t),n=Oi(a.abs(),!1,e+St(a)+1),l.isneg()&&!l.isZero()?"-"+n:n)};se.toInteger=se.toint=function(){var e=this,t=e.constructor;return Xe(new t(e),St(e)+1,t.rounding)};se.toNumber=function(){return+this};se.toPower=se.pow=function(e){var t,n,a,l,o,c,f=this,d=f.constructor,h=12,v=+(e=new d(e));if(!e.s)return new d(An);if(f=new d(f),!f.s){if(e.s<1)throw Error(Xn+"Infinity");return f}if(f.eq(An))return f;if(a=d.precision,e.eq(An))return Xe(f,a);if(t=e.e,n=e.d.length-1,c=t>=n,o=f.s,c){if((n=v<0?-v:v)<=CN){for(l=new d(An),t=Math.ceil(a/et+4),at=!1;n%2&&(l=l.times(f),lO(l.d,t)),n=Ll(n/2),n!==0;)f=f.times(f),lO(f.d,t);return at=!0,e.s<0?new d(An).div(l):Xe(l,a)}}else if(o<0)throw Error(Xn+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,f.s=1,at=!1,l=e.times(xo(f,a+h)),at=!0,l=kN(l),l.s=o,l};se.toPrecision=function(e,t){var n,a,l=this,o=l.constructor;return e===void 0?(n=St(l),a=Oi(l,n<=o.toExpNeg||n>=o.toExpPos)):(gr(e,1,Rl),t===void 0?t=o.rounding:gr(t,0,8),l=Xe(new o(l),e,t),n=St(l),a=Oi(l,e<=n||n<=o.toExpNeg,e)),a};se.toSignificantDigits=se.tosd=function(e,t){var n=this,a=n.constructor;return e===void 0?(e=a.precision,t=a.rounding):(gr(e,1,Rl),t===void 0?t=a.rounding:gr(t,0,8)),Xe(new a(n),e,t)};se.toString=se.valueOf=se.val=se.toJSON=se[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=St(e),n=e.constructor;return Oi(e,t<=n.toExpNeg||t>=n.toExpPos)};function DN(e,t){var n,a,l,o,c,f,d,h,v=e.constructor,p=v.precision;if(!e.s||!t.s)return t.s||(t=new v(e)),at?Xe(t,p):t;if(d=e.d,h=t.d,c=e.e,l=t.e,d=d.slice(),o=c-l,o){for(o<0?(a=d,o=-o,f=h.length):(a=h,l=c,f=d.length),c=Math.ceil(p/et),f=c>f?c+1:f+1,o>f&&(o=f,a.length=1),a.reverse();o--;)a.push(0);a.reverse()}for(f=d.length,o=h.length,f-o<0&&(o=f,a=h,h=d,d=a),n=0;o;)n=(d[--o]=d[o]+h[o]+n)/Pt|0,d[o]%=Pt;for(n&&(d.unshift(n),++l),f=d.length;d[--f]==0;)d.pop();return t.d=d,t.e=l,at?Xe(t,p):t}function gr(e,t,n){if(e!==~~e||en)throw Error(gi+e)}function hr(e){var t,n,a,l=e.length-1,o="",c=e[0];if(l>0){for(o+=c,t=1;tc?1:-1;else for(f=d=0;fl[f]?1:-1;break}return d}function n(a,l,o){for(var c=0;o--;)a[o]-=c,c=a[o]1;)a.shift()}return function(a,l,o,c){var f,d,h,v,p,b,x,O,j,_,E,N,M,P,T,C,R,F,ee=a.constructor,q=a.s==l.s?1:-1,U=a.d,B=l.d;if(!a.s)return new ee(a);if(!l.s)throw Error(Xn+"Division by zero");for(d=a.e-l.e,R=B.length,T=U.length,x=new ee(q),O=x.d=[],h=0;B[h]==(U[h]||0);)++h;if(B[h]>(U[h]||0)&&--d,o==null?N=o=ee.precision:c?N=o+(St(a)-St(l))+1:N=o,N<0)return new ee(0);if(N=N/et+2|0,h=0,R==1)for(v=0,B=B[0],N++;(h1&&(B=e(B,v),U=e(U,v),R=B.length,T=U.length),P=R,j=U.slice(0,R),_=j.length;_=Pt/2&&++C;do v=0,f=t(B,j,R,_),f<0?(E=j[0],R!=_&&(E=E*Pt+(j[1]||0)),v=E/C|0,v>1?(v>=Pt&&(v=Pt-1),p=e(B,v),b=p.length,_=j.length,f=t(p,j,b,_),f==1&&(v--,n(p,R16)throw Error(zy+St(e));if(!e.s)return new v(An);for(at=!1,f=p,c=new v(.03125);e.abs().gte(.1);)e=e.times(c),h+=5;for(a=Math.log(ci(2,h))/Math.LN10*2+5|0,f+=a,n=l=o=new v(An),v.precision=f;;){if(l=Xe(l.times(e),f),n=n.times(++d),c=o.plus(Hr(l,n,f)),hr(c.d).slice(0,f)===hr(o.d).slice(0,f)){for(;h--;)o=Xe(o.times(o),f);return v.precision=p,t==null?(at=!0,Xe(o,p)):o}o=c}}function St(e){for(var t=e.e*et,n=e.d[0];n>=10;n/=10)t++;return t}function sp(e,t,n){if(t>e.LN10.sd())throw at=!0,n&&(e.precision=n),Error(Xn+"LN10 precision limit exceeded");return Xe(new e(e.LN10),t)}function Ma(e){for(var t="";e--;)t+="0";return t}function xo(e,t){var n,a,l,o,c,f,d,h,v,p=1,b=10,x=e,O=x.d,j=x.constructor,_=j.precision;if(x.s<1)throw Error(Xn+(x.s?"NaN":"-Infinity"));if(x.eq(An))return new j(0);if(t==null?(at=!1,h=_):h=t,x.eq(10))return t==null&&(at=!0),sp(j,h);if(h+=b,j.precision=h,n=hr(O),a=n.charAt(0),o=St(x),Math.abs(o)<15e14){for(;a<7&&a!=1||a==1&&n.charAt(1)>3;)x=x.times(e),n=hr(x.d),a=n.charAt(0),p++;o=St(x),a>1?(x=new j("0."+n),o++):x=new j(a+"."+n.slice(1))}else return d=sp(j,h+2,_).times(o+""),x=xo(new j(a+"."+n.slice(1)),h-b).plus(d),j.precision=_,t==null?(at=!0,Xe(x,_)):x;for(f=c=x=Hr(x.minus(An),x.plus(An),h),v=Xe(x.times(x),h),l=3;;){if(c=Xe(c.times(v),h),d=f.plus(Hr(c,new j(l),h)),hr(d.d).slice(0,h)===hr(f.d).slice(0,h))return f=f.times(2),o!==0&&(f=f.plus(sp(j,h+2,_).times(o+""))),f=Hr(f,new j(p),h),j.precision=_,t==null?(at=!0,Xe(f,_)):f;f=d,l+=2}}function iO(e,t){var n,a,l;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(n<0&&(n=a),n+=+t.slice(a+1),t=t.substring(0,a)):n<0&&(n=t.length),a=0;t.charCodeAt(a)===48;)++a;for(l=t.length;t.charCodeAt(l-1)===48;)--l;if(t=t.slice(a,l),t){if(l-=a,n=n-a-1,e.e=Ll(n/et),e.d=[],a=(n+1)%et,n<0&&(a+=et),agf||e.e<-gf))throw Error(zy+n)}else e.s=0,e.e=0,e.d=[0];return e}function Xe(e,t,n){var a,l,o,c,f,d,h,v,p=e.d;for(c=1,o=p[0];o>=10;o/=10)c++;if(a=t-c,a<0)a+=et,l=t,h=p[v=0];else{if(v=Math.ceil((a+1)/et),o=p.length,v>=o)return e;for(h=o=p[v],c=1;o>=10;o/=10)c++;a%=et,l=a-et+c}if(n!==void 0&&(o=ci(10,c-l-1),f=h/o%10|0,d=t<0||p[v+1]!==void 0||h%o,d=n<4?(f||d)&&(n==0||n==(e.s<0?3:2)):f>5||f==5&&(n==4||d||n==6&&(a>0?l>0?h/ci(10,c-l):0:p[v-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(o=St(e),p.length=1,t=t-o-1,p[0]=ci(10,(et-t%et)%et),e.e=Ll(-t/et)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(a==0?(p.length=v,o=1,v--):(p.length=v+1,o=ci(10,et-a),p[v]=l>0?(h/ci(10,c-l)%ci(10,l)|0)*o:0),d)for(;;)if(v==0){(p[0]+=o)==Pt&&(p[0]=1,++e.e);break}else{if(p[v]+=o,p[v]!=Pt)break;p[v--]=0,o=1}for(a=p.length;p[--a]===0;)p.pop();if(at&&(e.e>gf||e.e<-gf))throw Error(zy+St(e));return e}function PN(e,t){var n,a,l,o,c,f,d,h,v,p,b=e.constructor,x=b.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new b(e),at?Xe(t,x):t;if(d=e.d,p=t.d,a=t.e,h=e.e,d=d.slice(),c=h-a,c){for(v=c<0,v?(n=d,c=-c,f=p.length):(n=p,a=h,f=d.length),l=Math.max(Math.ceil(x/et),f)+2,c>l&&(c=l,n.length=1),n.reverse(),l=c;l--;)n.push(0);n.reverse()}else{for(l=d.length,f=p.length,v=l0;--l)d[f++]=0;for(l=p.length;l>c;){if(d[--l]0?o=o.charAt(0)+"."+o.slice(1)+Ma(a):c>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(l<0?"e":"e+")+l):l<0?(o="0."+Ma(-l-1)+o,n&&(a=n-c)>0&&(o+=Ma(a))):l>=c?(o+=Ma(l+1-c),n&&(a=n-l-1)>0&&(o=o+"."+Ma(a))):((a=l+1)0&&(l+1===c&&(o+="."),o+=Ma(a))),e.s<0?"-"+o:o}function lO(e,t){if(e.length>t)return e.length=t,!0}function zN(e){var t,n,a;function l(o){var c=this;if(!(c instanceof l))return new l(o);if(c.constructor=l,o instanceof l){c.s=o.s,c.e=o.e,c.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(gi+o);if(o>0)c.s=1;else if(o<0)o=-o,c.s=-1;else{c.s=0,c.e=0,c.d=[0];return}if(o===~~o&&o<1e7){c.e=0,c.d=[o];return}return iO(c,o.toString())}else if(typeof o!="string")throw Error(gi+o);if(o.charCodeAt(0)===45?(o=o.slice(1),c.s=-1):c.s=1,M9.test(o))iO(c,o);else throw Error(gi+o)}if(l.prototype=se,l.ROUND_UP=0,l.ROUND_DOWN=1,l.ROUND_CEIL=2,l.ROUND_FLOOR=3,l.ROUND_HALF_UP=4,l.ROUND_HALF_DOWN=5,l.ROUND_HALF_EVEN=6,l.ROUND_HALF_CEIL=7,l.ROUND_HALF_FLOOR=8,l.clone=zN,l.config=l.set=C9,e===void 0&&(e={}),e)for(a=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=l[t+1]&&a<=l[t+2])this[n]=a;else throw Error(gi+n+": "+a);if((a=e[n="LN10"])!==void 0)if(a==Math.LN10)this[n]=new this(a);else throw Error(gi+n+": "+a);return this}var Ry=zN(T9);An=new Ry(1);const Be=Ry;var D9=e=>e,RN={},LN=e=>e===RN,uO=e=>function t(){return arguments.length===0||arguments.length===1&&LN(arguments.length<=0?void 0:arguments[0])?t:e(...arguments)},$N=(e,t)=>e===1?t:uO(function(){for(var n=arguments.length,a=new Array(n),l=0;lc!==RN).length;return o>=e?t(...a):$N(e-o,uO(function(){for(var c=arguments.length,f=new Array(c),d=0;dLN(v)?f.shift():v);return t(...h,...f)}))}),k9=e=>$N(e.length,e),m0=(e,t)=>{for(var n=[],a=e;aArray.isArray(t)?t.map(e):Object.keys(t).map(n=>t[n]).map(e)),z9=function(){for(var t=arguments.length,n=new Array(t),a=0;ad(f),o(...arguments))}};function UN(e){var t;return e===0?t=1:t=Math.floor(new Be(e).abs().log(10).toNumber())+1,t}function qN(e,t,n){for(var a=new Be(e),l=0,o=[];a.lt(t)&&l<1e5;)o.push(a.toNumber()),a=a.add(n),l++;return o}var BN=e=>{var[t,n]=e,[a,l]=[t,n];return t>n&&([a,l]=[n,t]),[a,l]},IN=(e,t,n)=>{if(e.lte(0))return new Be(0);var a=UN(e.toNumber()),l=new Be(10).pow(a),o=e.div(l),c=a!==1?.05:.1,f=new Be(Math.ceil(o.div(c).toNumber())).add(n).mul(c),d=f.mul(l);return t?new Be(d.toNumber()):new Be(Math.ceil(d.toNumber()))},R9=(e,t,n)=>{var a=new Be(1),l=new Be(e);if(!l.isint()&&n){var o=Math.abs(e);o<1?(a=new Be(10).pow(UN(e)-1),l=new Be(Math.floor(l.div(a).toNumber())).mul(a)):o>1&&(l=new Be(Math.floor(e)))}else e===0?l=new Be(Math.floor((t-1)/2)):n||(l=new Be(Math.floor(e)));var c=Math.floor((t-1)/2),f=z9(P9(d=>l.add(new Be(d-c).mul(a)).toNumber()),m0);return f(0,t)},HN=function(t,n,a,l){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((n-t)/(a-1)))return{step:new Be(0),tickMin:new Be(0),tickMax:new Be(0)};var c=IN(new Be(n).sub(t).div(a-1),l,o),f;t<=0&&n>=0?f=new Be(0):(f=new Be(t).add(n).div(2),f=f.sub(new Be(f).mod(c)));var d=Math.ceil(f.sub(t).div(c).toNumber()),h=Math.ceil(new Be(n).sub(f).div(c).toNumber()),v=d+h+1;return v>a?HN(t,n,a,l,o+1):(v0?h+(a-v):h,d=n>0?d:d+(a-v)),{step:c,tickMin:f.sub(new Be(d).mul(c)),tickMax:f.add(new Be(h).mul(c))})},L9=function(t){var[n,a]=t,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,c=Math.max(l,2),[f,d]=BN([n,a]);if(f===-1/0||d===1/0){var h=d===1/0?[f,...m0(0,l-1).map(()=>1/0)]:[...m0(0,l-1).map(()=>-1/0),d];return n>a?h.reverse():h}if(f===d)return R9(f,l,o);var{step:v,tickMin:p,tickMax:b}=HN(f,d,c,o,0),x=qN(p,b.add(new Be(.1).mul(v)),v);return n>a?x.reverse():x},$9=function(t,n){var[a,l]=t,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[c,f]=BN([a,l]);if(c===-1/0||f===1/0)return[a,l];if(c===f)return[c];var d=Math.max(n,2),h=IN(new Be(f).sub(c).div(d-1),o,0),v=[...qN(new Be(c),new Be(f),h),f];return o===!1&&(v=v.map(p=>Math.round(p))),a>l?v.reverse():v},U9=e=>e.rootProps.barCategoryGap,zo=e=>e.rootProps.stackOffset,KN=e=>e.rootProps.reverseStackOrder,Ly=e=>e.options.chartName,$y=e=>e.rootProps.syncId,YN=e=>e.rootProps.syncMethod,Uy=e=>e.options.eventEmitter,Vt={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Ur={allowDuplicatedCategory:!0,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"category"},_n={allowDataOverflow:!1,allowDuplicatedCategory:!0,radiusAxisId:0,scale:"auto",tick:!0,tickCount:5,type:"number"},od=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t},q9={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Ur.angleAxisId,includeHidden:!1,name:void 0,reversed:Ur.reversed,scale:Ur.scale,tick:Ur.tick,tickCount:void 0,ticks:void 0,type:Ur.type,unit:void 0},B9={allowDataOverflow:_n.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:_n.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:_n.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:_n.scale,tick:_n.tick,tickCount:_n.tickCount,ticks:void 0,type:_n.type,unit:void 0},I9={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:Ur.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Ur.angleAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:Ur.scale,tick:Ur.tick,tickCount:void 0,ticks:void 0,type:"number",unit:void 0},H9={allowDataOverflow:_n.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:_n.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:_n.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:_n.scale,tick:_n.tick,tickCount:_n.tickCount,ticks:void 0,type:"category",unit:void 0},qy=(e,t)=>e.polarAxis.angleAxis[t]!=null?e.polarAxis.angleAxis[t]:e.layout.layoutType==="radial"?I9:q9,By=(e,t)=>e.polarAxis.radiusAxis[t]!=null?e.polarAxis.radiusAxis[t]:e.layout.layoutType==="radial"?H9:B9,sd=e=>e.polarOptions,Iy=V([Wr,Jr,zt],GE),GN=V([sd,Iy],(e,t)=>{if(e!=null)return Nn(e.innerRadius,t,0)}),VN=V([sd,Iy],(e,t)=>{if(e!=null)return Nn(e.outerRadius,t,t*.8)}),K9=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},XN=V([sd],K9);V([qy,XN],od);var FN=V([Iy,GN,VN],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});V([By,FN],od);var ZN=V([Ge,sd,GN,VN,Wr,Jr],(e,t,n,a,l,o)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||a==null)){var{cx:c,cy:f,startAngle:d,endAngle:h}=t;return{cx:Nn(c,l,l/2),cy:Nn(f,o,o/2),innerRadius:n,outerRadius:a,startAngle:d,endAngle:h,clockWise:!1}}}),it=(e,t)=>t,Ro=(e,t,n)=>n;function QN(e){return e?.id}function WN(e,t,n){var{chartData:a=[]}=t,{allowDuplicatedCategory:l,dataKey:o}=n,c=new Map;return e.forEach(f=>{var d,h=(d=f.data)!==null&&d!==void 0?d:a;if(!(h==null||h.length===0)){var v=QN(f);h.forEach((p,b)=>{var x=o==null||l?b:String(tt(p,o,null)),O=tt(p,f.dataKey,0),j;c.has(x)?j=c.get(x):j={},Object.assign(j,{[v]:O}),c.set(x,j)})}}),Array.from(c.values())}function Hy(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var cd=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function fd(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Y9(e,t){if(e.length===t.length){for(var n=0;n{var t=Ge(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},$l=e=>e.tooltip.settings.axisId;function oO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function bf(e){for(var t=1;te.cartesianAxis.xAxis[t],ta=(e,t)=>{var n=JN(e,t);return n??Dt},kt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:v0,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:No},eT=(e,t)=>e.cartesianAxis.yAxis[t],na=(e,t)=>{var n=eT(e,t);return n??kt},F9={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:""},Ky=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??F9},lt=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);case"zAxis":return Ky(e,n);case"angleAxis":return qy(e,n);case"radiusAxis":return By(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Z9=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Lo=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);case"angleAxis":return qy(e,n);case"radiusAxis":return By(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},tT=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Yy(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var nT=e=>e.graphicalItems.cartesianItems,Q9=V([it,Ro],Yy),Gy=(e,t,n)=>e.filter(n).filter(a=>t?.includeHidden===!0?!0:!a.hide),$o=V([nT,lt,Q9],Gy,{memoizeOptions:{resultEqualityCheck:fd}}),rT=V([$o],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Hy)),aT=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),W9=V([$o],aT),Vy=e=>e.map(t=>t.data).filter(Boolean).flat(1),J9=V([$o],Vy,{memoizeOptions:{resultEqualityCheck:fd}}),Xy=(e,t)=>{var{chartData:n=[],dataStartIndex:a,dataEndIndex:l}=t;return e.length>0?e:n.slice(a,l+1)},Fy=V([J9,Py],Xy),Zy=(e,t,n)=>t?.dataKey!=null?e.map(a=>({value:tt(a,t.dataKey)})):n.length>0?n.map(a=>a.dataKey).flatMap(a=>e.map(l=>({value:tt(l,a)}))):e.map(a=>({value:a})),dd=V([Fy,lt,$o],Zy);function iT(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Tc(e){if(pr(e)||e instanceof Date){var t=Number(e);if(wt(t))return t}}function sO(e){if(Array.isArray(e)){var t=[Tc(e[0]),Tc(e[1])];return La(t)?t:void 0}var n=Tc(e);if(n!=null)return[n,n]}function Zr(e){return e.map(Tc).filter(Zk)}function e$(e,t,n){return!n||typeof t!="number"||vr(t)?[]:n.length?Zr(n.flatMap(a=>{var l=tt(e,a.dataKey),o,c;if(Array.isArray(l)?[o,c]=l:o=c=l,!(!wt(o)||!wt(c)))return[t-o,t+c]})):[]}var Tt=e=>{var t=Nt(e),n=$l(e);return Lo(e,t,n)},Uo=V([Tt],e=>e?.dataKey),t$=V([rT,Py,Tt],WN),lT=(e,t,n,a)=>{var l={},o=t.reduce((c,f)=>{if(f.stackId==null)return c;var d=c[f.stackId];return d==null&&(d=[]),d.push(f),c[f.stackId]=d,c},l);return Object.fromEntries(Object.entries(o).map(c=>{var[f,d]=c,h=a?[...d].reverse():d,v=h.map(QN);return[f,{stackedData:j5(e,v,n),graphicalItems:h}]}))},n$=V([t$,rT,zo,KN],lT),uT=(e,t,n,a)=>{var{dataStartIndex:l,dataEndIndex:o}=t;if(a==null&&n!=="zAxis"){var c=A5(e,l,o);if(!(c!=null&&c[0]===0&&c[1]===0))return c}},r$=V([lt],e=>e.allowDataOverflow),Qy=e=>{var t;if(e==null||!("domain"in e))return v0;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Zr(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:v0},Wy=V([lt],Qy),Jy=V([Wy,r$],MN),a$=V([n$,Ia,it,Jy],uT,{memoizeOptions:{resultEqualityCheck:cd}}),hd=e=>e.errorBars,i$=(e,t,n)=>e.flatMap(a=>t[a.id]).filter(Boolean).filter(a=>iT(n,a)),xf=function(){for(var t=arguments.length,n=new Array(t),a=0;a{var o,c;if(n.length>0&&e.forEach(f=>{n.forEach(d=>{var h,v,p=(h=a[d.id])===null||h===void 0?void 0:h.filter(E=>iT(l,E)),b=tt(f,(v=t.dataKey)!==null&&v!==void 0?v:d.dataKey),x=e$(f,b,p);if(x.length>=2){var O=Math.min(...x),j=Math.max(...x);(o==null||Oc)&&(c=j)}var _=sO(b);_!=null&&(o=o==null?_[0]:Math.min(o,_[0]),c=c==null?_[1]:Math.max(c,_[1]))})}),t?.dataKey!=null&&e.forEach(f=>{var d=sO(tt(f,t.dataKey));d!=null&&(o=o==null?d[0]:Math.min(o,d[0]),c=c==null?d[1]:Math.max(c,d[1]))}),wt(o)&&wt(c))return[o,c]},l$=V([Fy,lt,W9,hd,it],eg,{memoizeOptions:{resultEqualityCheck:cd}});function u$(e){var{value:t}=e;if(pr(t)||t instanceof Date)return t}var o$=(e,t,n)=>{var a=e.map(u$).filter(l=>l!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&OA(a))?ZE(0,e.length):t.allowDuplicatedCategory?a:Array.from(new Set(a))},oT=e=>e.referenceElements.dots,Ul=(e,t,n)=>e.filter(a=>a.ifOverflow==="extendDomain").filter(a=>t==="xAxis"?a.xAxisId===n:a.yAxisId===n),s$=V([oT,it,Ro],Ul),sT=e=>e.referenceElements.areas,c$=V([sT,it,Ro],Ul),cT=e=>e.referenceElements.lines,f$=V([cT,it,Ro],Ul),fT=(e,t)=>{if(e!=null){var n=Zr(e.map(a=>t==="xAxis"?a.x:a.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},d$=V(s$,it,fT),dT=(e,t)=>{if(e!=null){var n=Zr(e.flatMap(a=>[t==="xAxis"?a.x1:a.y1,t==="xAxis"?a.x2:a.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},h$=V([c$,it],dT);function m$(e){var t;if(e.x!=null)return Zr([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.x);return n==null||n.length===0?[]:Zr(n)}function v$(e){var t;if(e.y!=null)return Zr([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.y);return n==null||n.length===0?[]:Zr(n)}var hT=(e,t)=>{if(e!=null){var n=e.flatMap(a=>t==="xAxis"?m$(a):v$(a));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},p$=V([f$,it],hT),y$=V(d$,p$,h$,(e,t,n)=>xf(e,n,t)),tg=(e,t,n,a,l,o,c,f)=>{if(n!=null)return n;var d=c==="vertical"&&f==="xAxis"||c==="horizontal"&&f==="yAxis",h=d?xf(a,o,l):xf(o,l);return N9(t,h,e.allowDataOverflow)},g$=V([lt,Wy,Jy,a$,l$,y$,Ge,it],tg,{memoizeOptions:{resultEqualityCheck:cd}}),b$=[0,1],ng=(e,t,n,a,l,o,c)=>{if(!((e==null||n==null||n.length===0)&&c===void 0)){var{dataKey:f,type:d}=e,h=Ua(t,o);if(h&&f==null){var v;return ZE(0,(v=n?.length)!==null&&v!==void 0?v:0)}return d==="category"?o$(a,e,h):l==="expand"?b$:c}},rg=V([lt,Ge,Fy,dd,zo,it,g$],ng),mT=(e,t,n,a,l)=>{if(e!=null){var{scale:o,type:c}=e;if(o==="auto")return t==="radial"&&l==="radiusAxis"?"band":t==="radial"&&l==="angleAxis"?"linear":c==="category"&&a&&(a.indexOf("LineChart")>=0||a.indexOf("AreaChart")>=0||a.indexOf("ComposedChart")>=0&&!n)?"point":c==="category"?"band":"linear";if(typeof o=="string"){var f="scale".concat(Oo(o));return f in eo?f:"point"}}},ql=V([lt,Ge,tT,Ly,it],mT);function x$(e){if(e!=null){if(e in eo)return eo[e]();var t="scale".concat(Oo(e));if(t in eo)return eo[t]()}}function ag(e,t,n,a){if(!(n==null||a==null)){if(typeof e.scale=="function")return e.scale.copy().domain(n).range(a);var l=x$(t);if(l!=null){var o=l.domain(n).range(a);return b5(o),o}}}var ig=(e,t,n)=>{var a=Qy(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(a)&&(a[0]==="auto"||a[1]==="auto")&&La(e))return L9(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&La(e))return $9(e,t.tickCount,t.allowDecimals)}},lg=V([rg,Lo,ql],ig),ug=(e,t,n,a)=>{if(a!=="angleAxis"&&e?.type==="number"&&La(t)&&Array.isArray(n)&&n.length>0){var l=t[0],o=n[0],c=t[1],f=n[n.length-1];return[Math.min(l,o),Math.max(c,f)]}return t},S$=V([lt,rg,lg,it],ug),w$=V(dd,lt,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,a=Array.from(Zr(e.map(p=>p.value))).sort((p,b)=>p-b),l=a[0],o=a[a.length-1];if(l==null||o==null)return 1/0;var c=o-l;if(c===0)return 1/0;for(var f=0;fl,(e,t,n,a,l)=>{if(!wt(e))return 0;var o=t==="vertical"?a.height:a.width;if(l==="gap")return e*o/2;if(l==="no-gap"){var c=Nn(n,e*o),f=e*o/2;return f-c-(f-c)/o*c}return 0}),j$=(e,t,n)=>{var a=ta(e,t);return a==null||typeof a.padding!="string"?0:vT(e,"xAxis",t,n,a.padding)},O$=(e,t,n)=>{var a=na(e,t);return a==null||typeof a.padding!="string"?0:vT(e,"yAxis",t,n,a.padding)},_$=V(ta,j$,(e,t)=>{var n,a;if(e==null)return{left:0,right:0};var{padding:l}=e;return typeof l=="string"?{left:t,right:t}:{left:((n=l.left)!==null&&n!==void 0?n:0)+t,right:((a=l.right)!==null&&a!==void 0?a:0)+t}}),A$=V(na,O$,(e,t)=>{var n,a;if(e==null)return{top:0,bottom:0};var{padding:l}=e;return typeof l=="string"?{top:t,bottom:t}:{top:((n=l.top)!==null&&n!==void 0?n:0)+t,bottom:((a=l.bottom)!==null&&a!==void 0?a:0)+t}}),E$=V([zt,_$,Vf,Gf,(e,t,n)=>n],(e,t,n,a,l)=>{var{padding:o}=a;return l?[o.left,n.width-o.right]:[e.left+t.left,e.left+e.width-t.right]}),N$=V([zt,Ge,A$,Vf,Gf,(e,t,n)=>n],(e,t,n,a,l,o)=>{var{padding:c}=l;return o?[a.height-c.bottom,c.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),qo=(e,t,n,a)=>{var l;switch(t){case"xAxis":return E$(e,n,a);case"yAxis":return N$(e,n,a);case"zAxis":return(l=Ky(e,n))===null||l===void 0?void 0:l.range;case"angleAxis":return XN(e);case"radiusAxis":return FN(e,n);default:return}},pT=V([lt,qo],od),md=V([lt,ql,S$,pT],ag);V([$o,hd,it],i$);function yT(e,t){return e.idt.id?1:0}var vd=(e,t)=>t,pd=(e,t,n)=>n,T$=V(Kf,vd,pd,(e,t,n)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===n).sort(yT)),M$=V(Yf,vd,pd,(e,t,n)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===n).sort(yT)),gT=(e,t)=>({width:e.width,height:t.height}),C$=(e,t)=>{var n=typeof t.width=="number"?t.width:No;return{width:n,height:e.height}},D$=V(zt,ta,gT),k$=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},P$=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},z$=V(Jr,zt,T$,vd,pd,(e,t,n,a,l)=>{var o={},c;return n.forEach(f=>{var d=gT(t,f);c==null&&(c=k$(t,a,e));var h=a==="top"&&!l||a==="bottom"&&l;o[f.id]=c-Number(h)*d.height,c+=(h?-1:1)*d.height}),o}),R$=V(Wr,zt,M$,vd,pd,(e,t,n,a,l)=>{var o={},c;return n.forEach(f=>{var d=C$(t,f);c==null&&(c=P$(t,a,e));var h=a==="left"&&!l||a==="right"&&l;o[f.id]=c-Number(h)*d.width,c+=(h?-1:1)*d.width}),o}),L$=(e,t)=>{var n=ta(e,t);if(n!=null)return z$(e,n.orientation,n.mirror)},$$=V([zt,ta,L$,(e,t)=>t],(e,t,n,a)=>{if(t!=null){var l=n?.[a];return l==null?{x:e.left,y:0}:{x:e.left,y:l}}}),U$=(e,t)=>{var n=na(e,t);if(n!=null)return R$(e,n.orientation,n.mirror)},q$=V([zt,na,U$,(e,t)=>t],(e,t,n,a)=>{if(t!=null){var l=n?.[a];return l==null?{x:0,y:e.top}:{x:l,y:e.top}}}),B$=V(zt,na,(e,t)=>{var n=typeof t.width=="number"?t.width:No;return{width:n,height:e.height}}),bT=(e,t,n,a)=>{if(n!=null){var{allowDuplicatedCategory:l,type:o,dataKey:c}=n,f=Ua(e,a),d=t.map(h=>h.value);if(c&&f&&o==="category"&&l&&OA(d))return d}},og=V([Ge,dd,lt,it],bT),xT=(e,t,n,a)=>{if(!(n==null||n.dataKey==null)){var{type:l,scale:o}=n,c=Ua(e,a);if(c&&(l==="number"||o!=="auto"))return t.map(f=>f.value)}},sg=V([Ge,dd,Lo,it],xT),cO=V([Ge,Z9,ql,md,og,sg,qo,lg,it],(e,t,n,a,l,o,c,f,d)=>{if(t!=null){var h=Ua(e,d);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:d,categoricalDomain:o,duplicateDomain:l,isCategorical:h,niceTicks:f,range:c,realScaleType:n,scale:a}}}),I$=(e,t,n,a,l,o,c,f,d)=>{if(!(t==null||a==null)){var h=Ua(e,d),{type:v,ticks:p,tickCount:b}=t,x=n==="scaleBand"&&typeof a.bandwidth=="function"?a.bandwidth()/2:2,O=v==="category"&&a.bandwidth?a.bandwidth()/x:0;O=d==="angleAxis"&&o!=null&&o.length>=2?Wt(o[0]-o[1])*2*O:O;var j=p||l;if(j){var _=j.map((E,N)=>{var M=c?c.indexOf(E):E;return{index:N,coordinate:a(M)+O,value:E,offset:O}});return _.filter(E=>wt(E.coordinate))}return h&&f?f.map((E,N)=>({coordinate:a(E)+O,value:E,index:N,offset:O})).filter(E=>wt(E.coordinate)):a.ticks?a.ticks(b).map(E=>({coordinate:a(E)+O,value:E,offset:O})):a.domain().map((E,N)=>({coordinate:a(E)+O,value:c?c[E]:E,index:N,offset:O}))}},ST=V([Ge,Lo,ql,md,lg,qo,og,sg,it],I$),H$=(e,t,n,a,l,o,c)=>{if(!(t==null||n==null||a==null||a[0]===a[1])){var f=Ua(e,c),{tickCount:d}=t,h=0;return h=c==="angleAxis"&&a?.length>=2?Wt(a[0]-a[1])*2*h:h,f&&o?o.map((v,p)=>({coordinate:n(v)+h,value:v,index:p,offset:h})):n.ticks?n.ticks(d).map(v=>({coordinate:n(v)+h,value:v,offset:h})):n.domain().map((v,p)=>({coordinate:n(v)+h,value:l?l[v]:v,index:p,offset:h}))}},wT=V([Ge,Lo,md,qo,og,sg,it],H$),jT=V(lt,md,(e,t)=>{if(!(e==null||t==null))return bf(bf({},e),{},{scale:t})}),K$=V([lt,ql,rg,pT],ag);V((e,t,n)=>Ky(e,n),K$,(e,t)=>{if(!(e==null||t==null))return bf(bf({},e),{},{scale:t})});var Y$=V([Ge,Kf,Yf],(e,t,n)=>{switch(e){case"horizontal":return t.some(a=>a.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(a=>a.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),OT=e=>e.options.defaultTooltipEventType,_T=e=>e.options.validateTooltipEventTypes;function AT(e,t,n){if(e==null)return t;var a=e?"axis":"item";return n==null?t:n.includes(a)?a:t}function cg(e,t){var n=OT(e),a=_T(e);return AT(t,n,a)}function G$(e){return de(t=>cg(t,e))}var ET=(e,t)=>{var n,a=Number(t);if(!(vr(a)||t==null))return a>=0?e==null||(n=e[a])===null||n===void 0?void 0:n.value:void 0},V$=e=>e.tooltip.settings,ka={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},X$={itemInteraction:{click:ka,hover:ka},axisInteraction:{click:ka,hover:ka},keyboardInteraction:ka,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}},NT=hn({name:"tooltip",initialState:X$,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:rt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).tooltipItemPayloads.indexOf(n);l>-1&&(e.tooltipItemPayloads[l]=a)},prepare:rt()},removeTooltipEntrySettings:{reducer(e,t){var n=nr(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:rt()},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:F$,replaceTooltipEntrySettings:Z$,removeTooltipEntrySettings:Q$,setTooltipSettingsState:W$,setActiveMouseOverItemIndex:TT,mouseLeaveItem:J$,mouseLeaveChart:MT,setActiveClickItemIndex:eU,setMouseOverAxisIndex:CT,setMouseClickAxisIndex:tU,setSyncInteraction:p0,setKeyboardInteraction:y0}=NT.actions,nU=NT.reducer;function fO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function wc(e){for(var t=1;t{if(t==null)return ka;var l=lU(e,t,n);if(l==null)return ka;if(l.active)return l;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var o=e.settings.active===!0;if(uU(l)){if(o)return wc(wc({},l),{},{active:!0})}else if(a!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:a,graphicalItemId:void 0};return wc(wc({},ka),{},{coordinate:l.coordinate})};function oU(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 n=Number(e);return Number.isFinite(n)?n:void 0}function sU(e,t){var n=oU(e),a=t[0],l=t[1];if(n===void 0)return!1;var o=Math.min(a,l),c=Math.max(a,l);return n>=o&&n<=c}function cU(e,t,n){if(n==null||t==null)return!0;var a=tt(e,t);return a==null||!La(n)?!0:sU(a,n)}var fg=(e,t,n,a)=>{var l=e?.index;if(l==null)return null;var o=Number(l);if(!wt(o))return l;var c=0,f=1/0;t.length>0&&(f=t.length-1);var d=Math.max(c,Math.min(o,f)),h=t[d];return h==null||cU(h,n,a)?String(d):null},kT=(e,t,n,a,l,o,c,f)=>{if(!(o==null||f==null)){var d=c[0],h=d==null?void 0:f(d.positions,o);if(h!=null)return h;var v=l?.[Number(o)];if(v)return n==="horizontal"?{x:v.coordinate,y:(a.top+t)/2}:{x:(a.left+e)/2,y:v.coordinate}}},PT=(e,t,n,a)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var l;if(n==="hover"?l=e.itemInteraction.hover.graphicalItemId:l=e.itemInteraction.click.graphicalItemId,l==null&&a!=null){var o=e.tooltipItemPayloads[0];return o!=null?[o]:[]}return e.tooltipItemPayloads.filter(c=>{var f;return((f=c.settings)===null||f===void 0?void 0:f.graphicalItemId)===l})},Bo=e=>e.options.tooltipPayloadSearcher,Bl=e=>e.tooltip;function dO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function hO(e){for(var t=1;t{if(!(t==null||o==null)){var{chartData:f,computedData:d,dataStartIndex:h,dataEndIndex:v}=n,p=[];return e.reduce((b,x)=>{var O,{dataDefinedOnItem:j,settings:_}=x,E=mU(j,f),N=Array.isArray(E)?yE(E,h,v):E,M=(O=_?.dataKey)!==null&&O!==void 0?O:a,P=_?.nameKey,T;if(a&&Array.isArray(N)&&!Array.isArray(N[0])&&c==="axis"?T=_A(N,a,l):T=o(N,t,d,P),Array.isArray(T))T.forEach(R=>{var F=hO(hO({},_),{},{name:R.name,unit:R.unit,color:void 0,fill:void 0});b.push(yj({tooltipEntrySettings:F,dataKey:R.dataKey,payload:R.payload,value:tt(R.payload,R.dataKey),name:R.name}))});else{var C;b.push(yj({tooltipEntrySettings:_,dataKey:M,payload:T,value:tt(T,M),name:(C=tt(T,P))!==null&&C!==void 0?C:_?.name}))}return b},p)}},dg=V([Tt,Ge,tT,Ly,Nt],mT),vU=V([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),pU=V([Nt,$l],Yy),Il=V([vU,Tt,pU],Gy,{memoizeOptions:{resultEqualityCheck:fd}}),yU=V([Il],e=>e.filter(Hy)),gU=V([Il],Vy,{memoizeOptions:{resultEqualityCheck:fd}}),Hl=V([gU,Ia],Xy),bU=V([yU,Ia,Tt],WN),hg=V([Hl,Tt,Il],Zy),RT=V([Tt],Qy),xU=V([Tt],e=>e.allowDataOverflow),LT=V([RT,xU],MN),SU=V([Il],e=>e.filter(Hy)),wU=V([bU,SU,zo,KN],lT),jU=V([wU,Ia,Nt,LT],uT),OU=V([Il],aT),_U=V([Hl,Tt,OU,hd,Nt],eg,{memoizeOptions:{resultEqualityCheck:cd}}),AU=V([oT,Nt,$l],Ul),EU=V([AU,Nt],fT),NU=V([sT,Nt,$l],Ul),TU=V([NU,Nt],dT),MU=V([cT,Nt,$l],Ul),CU=V([MU,Nt],hT),DU=V([EU,CU,TU],xf),kU=V([Tt,RT,LT,jU,_U,DU,Ge,Nt],tg),Io=V([Tt,Ge,Hl,hg,zo,Nt,kU],ng),PU=V([Io,Tt,dg],ig),zU=V([Tt,Io,PU,Nt],ug),$T=e=>{var t=Nt(e),n=$l(e),a=!1;return qo(e,t,n,a)},UT=V([Tt,$T],od),qT=V([Tt,dg,zU,UT],ag),RU=V([Ge,hg,Tt,Nt],bT),LU=V([Ge,hg,Tt,Nt],xT),$U=(e,t,n,a,l,o,c,f)=>{if(t){var{type:d}=t,h=Ua(e,f);if(a){var v=n==="scaleBand"&&a.bandwidth?a.bandwidth()/2:2,p=d==="category"&&a.bandwidth?a.bandwidth()/v:0;return p=f==="angleAxis"&&l!=null&&l?.length>=2?Wt(l[0]-l[1])*2*p:p,h&&c?c.map((b,x)=>({coordinate:a(b)+p,value:b,index:x,offset:p})):a.domain().map((b,x)=>({coordinate:a(b)+p,value:o?o[b]:b,index:x,offset:p}))}}},ra=V([Ge,Tt,dg,qT,$T,RU,LU,Nt],$U),mg=V([OT,_T,V$],(e,t,n)=>AT(n.shared,e,t)),BT=e=>e.tooltip.settings.trigger,vg=e=>e.tooltip.settings.defaultIndex,Ho=V([Bl,mg,BT,vg],DT),Dl=V([Ho,Hl,Uo,Io],fg),IT=V([ra,Dl],ET),HT=V([Ho],e=>{if(e)return e.dataKey}),UU=V([Ho],e=>{if(e)return e.graphicalItemId}),KT=V([Bl,mg,BT,vg],PT),qU=V([Wr,Jr,Ge,zt,ra,vg,KT,Bo],kT),BU=V([Ho,qU],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),IU=V([Ho],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),HU=V([KT,Dl,Ia,Uo,IT,Bo,mg],zT),KU=V([HU],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function mO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function vO(e){for(var t=1;tde(Tt),FU=()=>{var e=XU(),t=de(ra),n=de(qT);return Qc(!e||!n?void 0:vO(vO({},e),{},{scale:n}),t)};function pO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function vl(e){for(var t=1;t{var l=t.find(o=>o&&o.index===n);if(l){if(e==="horizontal")return{x:l.coordinate,y:a.chartY};if(e==="vertical")return{x:a.chartX,y:l.coordinate}}return{x:0,y:0}},e7=(e,t,n,a)=>{var l=t.find(h=>h&&h.index===n);if(l){if(e==="centric"){var o=l.coordinate,{radius:c}=a;return vl(vl(vl({},a),xt(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var f=l.coordinate,{angle:d}=a;return vl(vl(vl({},a),xt(a.cx,a.cy,f,d)),{},{angle:d,radius:f})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function t7(e,t){var{chartX:n,chartY:a}=e;return n>=t.left&&n<=t.left+t.width&&a>=t.top&&a<=t.top+t.height}var YT=(e,t,n,a,l)=>{var o,c=(o=t?.length)!==null&&o!==void 0?o:0;if(c<=1||e==null)return 0;if(a==="angleAxis"&&l!=null&&Math.abs(Math.abs(l[1]-l[0])-360)<=1e-6)for(var f=0;f0?(d=n[f-1])===null||d===void 0?void 0:d.coordinate:(h=n[c-1])===null||h===void 0?void 0:h.coordinate,O=(v=n[f])===null||v===void 0?void 0:v.coordinate,j=f>=c-1?(p=n[0])===null||p===void 0?void 0:p.coordinate:(b=n[f+1])===null||b===void 0?void 0:b.coordinate,_=void 0;if(!(x==null||O==null||j==null))if(Wt(O-x)!==Wt(j-O)){var E=[];if(Wt(j-O)===Wt(l[1]-l[0])){_=j;var N=O+l[1]-l[0];E[0]=Math.min(N,(N+x)/2),E[1]=Math.max(N,(N+x)/2)}else{_=x;var M=j+l[1]-l[0];E[0]=Math.min(O,(M+O)/2),E[1]=Math.max(O,(M+O)/2)}var P=[Math.min(O,(_+O)/2),Math.max(O,(_+O)/2)];if(e>P[0]&&e<=P[1]||e>=E[0]&&e<=E[1]){var T;return(T=n[f])===null||T===void 0?void 0:T.index}}else{var C=Math.min(x,j),R=Math.max(x,j);if(e>(C+O)/2&&e<=(R+O)/2){var F;return(F=n[f])===null||F===void 0?void 0:F.index}}}else if(t)for(var ee=0;ee(q.coordinate+B.coordinate)/2||ee>0&&ee(q.coordinate+B.coordinate)/2&&e<=(q.coordinate+U.coordinate)/2)return q.index}}return-1},n7=()=>de(Ly),pg=(e,t)=>t,GT=(e,t,n)=>n,yg=(e,t,n,a)=>a,r7=V(ra,e=>kf(e,t=>t.coordinate)),gg=V([Bl,pg,GT,yg],DT),bg=V([gg,Hl,Uo,Io],fg),a7=(e,t,n)=>{if(t!=null){var a=Bl(e);return t==="axis"?n==="hover"?a.axisInteraction.hover.dataKey:a.axisInteraction.click.dataKey:n==="hover"?a.itemInteraction.hover.dataKey:a.itemInteraction.click.dataKey}},VT=V([Bl,pg,GT,yg],PT),Sf=V([Wr,Jr,Ge,zt,ra,yg,VT,Bo],kT),i7=V([gg,Sf],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),XT=V([ra,bg],ET),l7=V([VT,bg,Ia,Uo,XT,Bo,pg],zT),u7=V([gg,bg],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),o7=(e,t,n,a,l,o,c)=>{if(!(!e||!n||!a||!l)&&t7(e,c)){var f=E5(e,t),d=YT(f,o,l,n,a),h=JU(t,l,d,e);return{activeIndex:String(d),activeCoordinate:h}}},s7=(e,t,n,a,l,o,c)=>{if(!(!e||!a||!l||!o||!n)){var f=K6(e,n);if(f){var d=N5(f,t),h=YT(d,c,o,a,l),v=e7(t,o,h,f);return{activeIndex:String(h),activeCoordinate:v}}}},c7=(e,t,n,a,l,o,c,f)=>{if(!(!e||!t||!a||!l||!o))return t==="horizontal"||t==="vertical"?o7(e,t,a,l,o,c,f):s7(e,t,n,a,l,o,c)},f7=V(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var a=e[t];if(a!=null)return n?a.panoramaElement:a.element}}),d7=V(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(a=>parseInt(a,10)).concat(Object.values(Vt)),n=Array.from(new Set(t));return n.sort((a,l)=>a-l)},{memoizeOptions:{resultEqualityCheck:Y9}});function yO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function gO(e){for(var t=1;tgO(gO({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),p7)},g7=new Set(Object.values(Vt));function b7(e){return g7.has(e)}var FT=hn({name:"zIndex",initialState:y7,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:rt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!b7(n)&&delete e.zIndexMap[n])},prepare:rt()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:a,isPanorama:l}=t.payload;e.zIndexMap[n]?l?e.zIndexMap[n].panoramaElement=a:e.zIndexMap[n].element=a:e.zIndexMap[n]={consumers:0,element:l?void 0:a,panoramaElement:l?a:void 0}},prepare:rt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:rt()}}}),{registerZIndexPortal:x7,unregisterZIndexPortal:S7,registerZIndexPortalElement:w7,unregisterZIndexPortalElement:j7}=FT.actions,O7=FT.reducer;function ir(e){var{zIndex:t,children:n}=e,a=iR(),l=a&&t!==void 0&&t!==0,o=mn(),c=Qe();S.useLayoutEffect(()=>l?(c(x7({zIndex:t})),()=>{c(S7({zIndex:t}))}):_o,[c,t,l]);var f=de(d=>f7(d,t,o));return l?f?U0.createPortal(n,f):null:n}function g0(){return g0=Object.assign?Object.assign.bind():function(e){for(var t=1;tS.useContext(ZT),cp={exports:{}},xO;function D7(){return xO||(xO=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(n=!1));function l(d,h,v){this.fn=d,this.context=h,this.once=v||!1}function o(d,h,v,p,b){if(typeof v!="function")throw new TypeError("The listener must be a function");var x=new l(v,p||d,b),O=n?n+h:h;return d._events[O]?d._events[O].fn?d._events[O]=[d._events[O],x]:d._events[O].push(x):(d._events[O]=x,d._eventsCount++),d}function c(d,h){--d._eventsCount===0?d._events=new a:delete d._events[h]}function f(){this._events=new a,this._eventsCount=0}f.prototype.eventNames=function(){var h=[],v,p;if(this._eventsCount===0)return h;for(p in v=this._events)t.call(v,p)&&h.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(v)):h},f.prototype.listeners=function(h){var v=n?n+h:h,p=this._events[v];if(!p)return[];if(p.fn)return[p.fn];for(var b=0,x=p.length,O=new Array(x);b{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),R7=WT.reducer,{createEventEmitter:L7}=WT.actions;function $7(e){return e.tooltip.syncInteraction}var U7={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},JT=hn({name:"chartData",initialState:U7,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:n,endIndex:a}=t.payload;n!=null&&(e.dataStartIndex=n),a!=null&&(e.dataEndIndex=a)}}}),{setChartData:wO,setDataStartEndIndexes:q7,setComputedData:KG}=JT.actions,B7=JT.reducer,I7=["x","y"];function jO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function pl(e){for(var t=1;td.rootProps.className);S.useEffect(()=>{if(e==null)return _o;var d=(h,v,p)=>{if(t!==p&&e===h){if(a==="index"){var b;if(c&&v!==null&&v!==void 0&&(b=v.payload)!==null&&b!==void 0&&b.coordinate&&v.payload.sourceViewBox){var x=v.payload.coordinate,{x:O,y:j}=x,_=G7(x,I7),{x:E,y:N,width:M,height:P}=v.payload.sourceViewBox,T=pl(pl({},_),{},{x:c.x+(M?(O-E)/M:0)*c.width,y:c.y+(P?(j-N)/P:0)*c.height});n(pl(pl({},v),{},{payload:pl(pl({},v.payload),{},{coordinate:T})}))}else n(v);return}if(l!=null){var C;if(typeof a=="function"){var R={activeTooltipIndex:v.payload.index==null?void 0:Number(v.payload.index),isTooltipActive:v.payload.active,activeIndex:v.payload.index==null?void 0:Number(v.payload.index),activeLabel:v.payload.label,activeDataKey:v.payload.dataKey,activeCoordinate:v.payload.coordinate},F=a(l,R);C=l[F]}else a==="value"&&(C=l.find(K=>String(K.value)===v.payload.label));var{coordinate:ee}=v.payload;if(C==null||v.payload.active===!1||ee==null||c==null){n(p0({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:q,y:U}=ee,B=Math.min(q,c.x+c.width),ue=Math.min(U,c.y+c.height),oe={x:o==="horizontal"?C.coordinate:B,y:o==="horizontal"?ue:C.coordinate},ve=p0({active:v.payload.active,coordinate:oe,dataKey:v.payload.dataKey,index:String(C.index),label:v.payload.label,sourceViewBox:v.payload.sourceViewBox,graphicalItemId:v.payload.graphicalItemId});n(ve)}}};return So.on(b0,d),()=>{So.off(b0,d)}},[f,n,t,e,a,l,o,c])}function F7(){var e=de($y),t=de(Uy),n=Qe();S.useEffect(()=>{if(e==null)return _o;var a=(l,o,c)=>{t!==c&&e===l&&n(q7(o))};return So.on(SO,a),()=>{So.off(SO,a)}},[n,t,e])}function Z7(){var e=Qe();S.useEffect(()=>{e(L7())},[e]),X7(),F7()}function Q7(e,t,n,a,l,o){var c=de(x=>a7(x,e,t)),f=de(Uy),d=de($y),h=de(YN),v=de($7),p=v?.active,b=Xf();S.useEffect(()=>{if(!p&&d!=null&&f!=null){var x=p0({active:o,coordinate:n,dataKey:c,index:l,label:typeof a=="number"?String(a):a,sourceViewBox:b,graphicalItemId:void 0});So.emit(b0,d,x,f)}},[p,n,c,l,a,f,d,h,o,b])}function OO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function _O(e){for(var t=1;t{R(W$({shared:N,trigger:M,axisId:C,active:l,defaultIndex:F}))},[R,N,M,C,l,F]);var ee=Xf(),q=qE(),U=G$(N),{activeIndex:B,isActive:ue}=(t=de(he=>u7(he,U,M,F)))!==null&&t!==void 0?t:{},oe=de(he=>l7(he,U,M,F)),ve=de(he=>XT(he,U,M,F)),K=de(he=>i7(he,U,M,F)),te=oe,z=C7(),G=(n=l??ue)!==null&&n!==void 0?n:!1,[re,k]=BA([te,G]),Z=U==="axis"?ve:void 0;Q7(U,M,K,Z,B,G);var ie=T??z;if(ie==null||ee==null||U==null)return null;var le=te??AO;G||(le=AO),h&&le.length&&(le=RA(le.filter(he=>he.value!=null&&(he.hide!==!0||a.includeHidden)),b,tq));var ye=le.length>0,be=S.createElement(KR,{allowEscapeViewBox:o,animationDuration:c,animationEasing:f,isAnimationActive:v,active:G,coordinate:K,hasPayload:ye,offset:p,position:x,reverseDirection:O,useTranslate3d:j,viewBox:ee,wrapperStyle:_,lastBoundingBox:re,innerRef:k,hasPortalFromProps:!!T},nq(d,_O(_O({},a),{},{payload:le,label:Z,active:G,activeIndex:B,coordinate:K,accessibilityLayer:q})));return S.createElement(S.Fragment,null,U0.createPortal(be,ie),G&&S.createElement(M7,{cursor:E,tooltipEventType:U,coordinate:K,payload:le,index:B}))}var yd=e=>null;yd.displayName="Cell";function aq(e,t,n){return(t=iq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iq(e){var t=lq(e,"string");return typeof t=="symbol"?t:t+""}function lq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class uq{constructor(t){aq(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var a=this.cache.keys().next().value;a!=null&&this.cache.delete(a)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function EO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function oq(e){for(var t=1;t{try{var n=document.getElementById(TO);n||(n=document.createElement("span"),n.setAttribute("id",TO),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,hq,t),n.textContent="".concat(e);var a=n.getBoundingClientRect();return{width:a.width,height:a.height}}catch{return{width:0,height:0}}},no=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Jf.isSsr)return{width:0,height:0};if(!eM.enableCache)return MO(t,n);var a=mq(t,n),l=NO.get(a);if(l)return l;var o=MO(t,n);return NO.set(a,o),o},tM;function vq(e,t,n){return(t=pq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pq(e){var t=yq(e,"string");return typeof t=="symbol"?t:t+""}function yq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CO=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,DO=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,gq=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,bq=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,xq={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Sq=["cm","mm","pt","pc","in","Q","px"];function wq(e){return Sq.includes(e)}var xl="NaN";function jq(e,t){return e*xq[t]}class Gt{static parse(t){var n,[,a,l]=(n=bq.exec(t))!==null&&n!==void 0?n:[];return a==null?Gt.NaN:new Gt(parseFloat(a),l??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,vr(t)&&(this.unit=""),n!==""&&!gq.test(n)&&(this.num=NaN,this.unit=""),wq(n)&&(this.num=jq(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return vr(this.num)}}tM=Gt;vq(Gt,"NaN",new tM(NaN,""));function nM(e){if(e==null||e.includes(xl))return xl;for(var t=e;t.includes("*")||t.includes("/");){var n,[,a,l,o]=(n=CO.exec(t))!==null&&n!==void 0?n:[],c=Gt.parse(a??""),f=Gt.parse(o??""),d=l==="*"?c.multiply(f):c.divide(f);if(d.isNaN())return xl;t=t.replace(CO,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,[,v,p,b]=(h=DO.exec(t))!==null&&h!==void 0?h:[],x=Gt.parse(v??""),O=Gt.parse(b??""),j=p==="+"?x.add(O):x.subtract(O);if(j.isNaN())return xl;t=t.replace(DO,j.toString())}return t}var kO=/\(([^()]*)\)/;function Oq(e){for(var t=e,n;(n=kO.exec(t))!=null;){var[,a]=n;t=t.replace(kO,nM(a))}return t}function _q(e){var t=e.replace(/\s+/g,"");return t=Oq(t),t=nM(t),t}function Aq(e){try{return _q(e)}catch{return xl}}function fp(e){var t=Aq(e.slice(5,-1));return t===xl?"":t}var Eq=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Nq=["dx","dy","angle","className","breakAll"];function x0(){return x0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:n,style:a}=e;try{var l=[];_t(t)||(n?l=t.toString().split(""):l=t.toString().split(rM));var o=l.map(f=>({word:f,width:no(f,a).width})),c=n?0:no(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}};function Mq(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var iM=(e,t,n,a)=>e.reduce((l,o)=>{var{word:c,width:f}=o,d=l[l.length-1];if(d&&f!=null&&(t==null||a||d.width+f+ne.reduce((t,n)=>t.width>n.width?t:n),Cq="…",zO=(e,t,n,a,l,o,c,f)=>{var d=e.slice(0,t),h=aM({breakAll:n,style:a,children:d+Cq});if(!h)return[!1,[]];var v=iM(h.wordsWithComputedWidth,o,c,f),p=v.length>l||lM(v).width>Number(o);return[p,v]},Dq=(e,t,n,a,l)=>{var{maxLines:o,children:c,style:f,breakAll:d}=e,h=me(o),v=String(c),p=iM(t,a,n,l);if(!h||l)return p;var b=p.length>o||lM(p).width>Number(a);if(!b)return p;for(var x=0,O=v.length-1,j=0,_;x<=O&&j<=v.length-1;){var E=Math.floor((x+O)/2),N=E-1,[M,P]=zO(v,N,d,f,o,a,n,l),[T]=zO(v,E,d,f,o,a,n,l);if(!M&&!T&&(x=E+1),M&&T&&(O=E-1),!M&&T){_=P;break}j++}return _||p},RO=e=>{var t=_t(e)?[]:e.toString().split(rM);return[{words:t,width:void 0}]},kq=e=>{var{width:t,scaleToFit:n,children:a,style:l,breakAll:o,maxLines:c}=e;if((t||n)&&!Jf.isSsr){var f,d,h=aM({breakAll:o,children:a,style:l});if(h){var{wordsWithComputedWidth:v,spaceWidth:p}=h;f=v,d=p}else return RO(a);return Dq({breakAll:o,children:a,maxLines:c,style:l},f,d,t,!!n)}return RO(a)},uM="#808080",Pq={angle:0,breakAll:!1,capHeight:"0.71em",fill:uM,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},gd=S.forwardRef((e,t)=>{var n=At(e,Pq),{x:a,y:l,lineHeight:o,capHeight:c,fill:f,scaleToFit:d,textAnchor:h,verticalAnchor:v}=n,p=PO(n,Eq),b=S.useMemo(()=>kq({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:d,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,d,p.style,p.width]),{dx:x,dy:O,angle:j,className:_,breakAll:E}=p,N=PO(p,Nq);if(!pr(a)||!pr(l)||b.length===0)return null;var M=Number(a)+(me(x)?x:0),P=Number(l)+(me(O)?O:0);if(!wt(M)||!wt(P))return null;var T;switch(v){case"start":T=fp("calc(".concat(c,")"));break;case"middle":T=fp("calc(".concat((b.length-1)/2," * -").concat(o," + (").concat(c," / 2))"));break;default:T=fp("calc(".concat(b.length-1," * -").concat(o,")"));break}var C=[];if(d){var R=b[0].width,{width:F}=p;C.push("scale(".concat(me(F)&&me(R)?F/R:1,")"))}return j&&C.push("rotate(".concat(j,", ").concat(M,", ").concat(P,")")),C.length&&(N.transform=C.join(" ")),S.createElement("text",x0({},tn(N),{ref:t,x:M,y:P,className:Re("recharts-text",_),textAnchor:h,fill:f.includes("url")?uM:f}),b.map((ee,q)=>{var U=ee.words.join(E?"":" ");return S.createElement("tspan",{x:M,dy:q===0?T:o,key:"".concat(U,"-").concat(q)},U)}))});gd.displayName="Text";var zq=["labelRef"],Rq=["content"];function LO(e,t){if(e==null)return{};var n,a,l=Lq(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{x:t,y:n,upperWidth:a,lowerWidth:l,width:o,height:c,children:f}=e,d=S.useMemo(()=>({x:t,y:n,upperWidth:a,lowerWidth:l,width:o,height:c}),[t,n,a,l,o,c]);return S.createElement(oM.Provider,{value:d},f)},sM=()=>{var e=S.useContext(oM),t=Xf();return e||EE(t)},Iq=S.createContext(null),Hq=()=>{var e=S.useContext(Iq),t=de(ZN);return e||t},Kq=e=>{var{value:t,formatter:n}=e,a=_t(e.children)?t:e.children;return typeof n=="function"?n(a):a},xg=e=>e!=null&&typeof e=="function",Yq=(e,t)=>{var n=Wt(t-e),a=Math.min(Math.abs(t-e),360);return n*a},Gq=(e,t,n,a,l)=>{var{offset:o,className:c}=e,{cx:f,cy:d,innerRadius:h,outerRadius:v,startAngle:p,endAngle:b,clockWise:x}=l,O=(h+v)/2,j=Yq(p,b),_=j>=0?1:-1,E,N;switch(t){case"insideStart":E=p+_*o,N=x;break;case"insideEnd":E=b-_*o,N=!x;break;case"end":E=b+_*o,N=x;break;default:throw new Error("Unsupported position ".concat(t))}N=j<=0?N:!N;var M=xt(f,d,O,E),P=xt(f,d,O,E+(N?1:-1)*359),T="M".concat(M.x,",").concat(M.y,` A`).concat(O,",").concat(O,",0,1,").concat(N?0:1,`, - `).concat(P.x,",").concat(P.y),C=_t(e.id)?uo("recharts-radial-line-"):e.id;return S.createElement("text",qr({},a,{dominantBaseline:"central",className:Re("recharts-radial-bar-label",c)}),S.createElement("defs",null,S.createElement("path",{id:C,d:T})),S.createElement("textPath",{xlinkHref:"#".concat(C)},n))},Vq=(e,t,n)=>{var{cx:a,cy:l,innerRadius:o,outerRadius:c,startAngle:f,endAngle:d}=e,h=(f+d)/2;if(n==="outside"){var{x:v,y:p}=xt(a,l,c+t,h);return{x:v,y:p,textAnchor:v>=a?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"end"};var b=(o+c)/2,{x,y:O}=xt(a,l,b,h);return{x,y:O,textAnchor:"middle",verticalAnchor:"middle"}},S0=e=>"cx"in e&&me(e.cx),Xq=(e,t)=>{var{parentViewBox:n,offset:a,position:l}=e,o;n!=null&&!S0(n)&&(o=n);var{x:c,y:f,upperWidth:d,lowerWidth:h,height:v}=t,p=c,b=c+(d-h)/2,x=(p+b)/2,O=(d+h)/2,j=p+d/2,_=v>=0?1:-1,E=_*a,N=_>0?"end":"start",M=_>0?"start":"end",P=d>=0?1:-1,T=P*a,C=P>0?"end":"start",L=P>0?"start":"end";if(l==="top"){var Z={x:p+d/2,y:f-E,textAnchor:"middle",verticalAnchor:N};return mt(mt({},Z),o?{height:Math.max(f-o.y,0),width:d}:{})}if(l==="bottom"){var ne={x:b+h/2,y:f+v+E,textAnchor:"middle",verticalAnchor:M};return mt(mt({},ne),o?{height:Math.max(o.y+o.height-(f+v),0),width:h}:{})}if(l==="left"){var q={x:x-T,y:f+v/2,textAnchor:C,verticalAnchor:"middle"};return mt(mt({},q),o?{width:Math.max(q.x-o.x,0),height:v}:{})}if(l==="right"){var U={x:x+O+T,y:f+v/2,textAnchor:L,verticalAnchor:"middle"};return mt(mt({},U),o?{width:Math.max(o.x+o.width-U.x,0),height:v}:{})}var B=o?{width:O,height:v}:{};return l==="insideLeft"?mt({x:x+T,y:f+v/2,textAnchor:L,verticalAnchor:"middle"},B):l==="insideRight"?mt({x:x+O-T,y:f+v/2,textAnchor:C,verticalAnchor:"middle"},B):l==="insideTop"?mt({x:p+d/2,y:f+E,textAnchor:"middle",verticalAnchor:M},B):l==="insideBottom"?mt({x:b+h/2,y:f+v-E,textAnchor:"middle",verticalAnchor:N},B):l==="insideTopLeft"?mt({x:p+T,y:f+E,textAnchor:L,verticalAnchor:M},B):l==="insideTopRight"?mt({x:p+d-T,y:f+E,textAnchor:C,verticalAnchor:M},B):l==="insideBottomLeft"?mt({x:b+T,y:f+v-E,textAnchor:L,verticalAnchor:N},B):l==="insideBottomRight"?mt({x:b+h-T,y:f+v-E,textAnchor:C,verticalAnchor:N},B):l&&typeof l=="object"&&(me(l.x)||Yr(l.x))&&(me(l.y)||Yr(l.y))?mt({x:c+Nn(l.x,O),y:f+Nn(l.y,v),textAnchor:"end",verticalAnchor:"end"},B):mt({x:j,y:f+v/2,textAnchor:"middle",verticalAnchor:"middle"},B)},Fq={angle:0,offset:5,zIndex:Vt.label,position:"middle",textBreakAll:!1};function Ca(e){var t=At(e,Fq),{viewBox:n,position:a,value:l,children:o,content:c,className:f="",textBreakAll:d,labelRef:h}=t,v=Hq(),p=sM(),b=a==="center"?p:v??p,x,O,j;if(n==null?x=b:S0(n)?x=n:x=EE(n),!x||_t(l)&&_t(o)&&!S.isValidElement(c)&&typeof c!="function")return null;var _=mt(mt({},t),{},{viewBox:x});if(S.isValidElement(c)){var{labelRef:E}=_,N=LO(_,zq);return S.cloneElement(c,N)}if(typeof c=="function"){var{content:M}=_,P=LO(_,Rq);if(O=S.createElement(c,P),S.isValidElement(O))return O}else O=Kq(t);var T=tn(t);if(S0(x)){if(a==="insideStart"||a==="insideEnd"||a==="end")return Gq(t,a,O,T,x);j=Vq(x,t.offset,t.position)}else j=Xq(t,x);return S.createElement(ir,{zIndex:t.zIndex},S.createElement(gd,qr({ref:h,className:Re("recharts-label",f)},T,j,{textAnchor:Mq(T.textAnchor)?T.textAnchor:j.textAnchor,breakAll:d}),O))}Ca.displayName="Label";var Zq=(e,t,n)=>{if(!e)return null;var a={viewBox:t,labelRef:n};return e===!0?S.createElement(Ca,qr({key:"label-implicit"},a)):pr(e)?S.createElement(Ca,qr({key:"label-implicit",value:e},a)):S.isValidElement(e)?e.type===Ca?S.cloneElement(e,mt({key:"label-implicit"},a)):S.createElement(Ca,qr({key:"label-implicit",content:e},a)):xg(e)?S.createElement(Ca,qr({key:"label-implicit",content:e},a)):e&&typeof e=="object"?S.createElement(Ca,qr({},e,{key:"label-implicit"},a)):null};function Qq(e){var{label:t,labelRef:n}=e,a=sM();return Zq(t,a,n)||null}var dp={},hp={},UO;function Wq(){return UO||(UO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(hp)),hp}var mp={},qO;function Jq(){return qO||(qO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(mp)),mp}var BO;function eB(){return BO||(BO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wq(),n=Jq(),a=F0();function l(o){if(a.isArrayLike(o))return t.last(n.toArray(o))}e.last=l})(dp)),dp}var vp,IO;function tB(){return IO||(IO=1,vp=eB().last),vp}var nB=tB();const rB=Qr(nB);var aB=["valueAccessor"],iB=["dataKey","clockWise","id","textBreakAll","zIndex"];function wf(){return wf=Object.assign?Object.assign.bind():function(e){for(var t=1;tArray.isArray(e.value)?rB(e.value):e.value,cM=S.createContext(void 0),oB=cM.Provider,fM=S.createContext(void 0),sB=fM.Provider;function cB(){return S.useContext(cM)}function fB(){return S.useContext(fM)}function Cc(e){var{valueAccessor:t=uB}=e,n=HO(e,aB),{dataKey:a,clockWise:l,id:o,textBreakAll:c,zIndex:f}=n,d=HO(n,iB),h=cB(),v=fB(),p=h||v;return!p||!p.length?null:S.createElement(ir,{zIndex:f??Vt.label},S.createElement(dn,{className:"recharts-label-list"},p.map((b,x)=>{var O,j=_t(a)?t(b,x):tt(b&&b.payload,a),_=_t(o)?{}:{id:"".concat(o,"-").concat(x)};return S.createElement(Ca,wf({key:"label-".concat(x)},tn(b),d,_,{fill:(O=n.fill)!==null&&O!==void 0?O:b.fill,parentViewBox:b.parentViewBox,value:j,textBreakAll:c,viewBox:b.viewBox,index:x,zIndex:0}))})))}Cc.displayName="LabelList";function dM(e){var{label:t}=e;return t?t===!0?S.createElement(Cc,{key:"labelList-implicit"}):S.isValidElement(t)||xg(t)?S.createElement(Cc,{key:"labelList-implicit",content:t}):typeof t=="object"?S.createElement(Cc,wf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function w0(){return w0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{cx:t,cy:n,r:a,className:l}=e,o=Re("recharts-dot",l);return me(t)&&me(n)&&me(a)?S.createElement("circle",w0({},Gn(e),V0(e),{className:o,cx:t,cy:n,r:a})):null},mM=e=>e.graphicalItems.polarItems,dB=V([it,Ro],Yy),bd=V([mM,lt,dB],Gy),hB=V([bd],Vy),xd=V([hB,ky],Xy),mB=V([xd,lt,bd],Zy);V([xd,lt,bd],(e,t,n)=>n.length>0?e.flatMap(a=>n.flatMap(l=>{var o,c=tt(a,(o=t.dataKey)!==null&&o!==void 0?o:l.dataKey);return{value:c,errorDomain:[]}})).filter(Boolean):t?.dataKey!=null?e.map(a=>({value:tt(a,t.dataKey),errorDomain:[]})):e.map(a=>({value:a,errorDomain:[]})));var KO=()=>{},vB=V([xd,lt,bd,hd,it],eg),pB=V([lt,Wy,Jy,KO,vB,KO,Ge,it],tg),vM=V([lt,Ge,xd,mB,zo,it,pB],ng),yB=V([vM,lt,ql],ig);V([lt,vM,yB,it],ug);var gB={radiusAxis:{},angleAxis:{}},pM=hn({name:"polarAxis",initialState:gB,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:YG,removeRadiusAxis:GG,addAngleAxis:VG,removeAngleAxis:XG}=pM.actions,bB=pM.reducer;function YO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function GO(e){for(var t=1;tt,Sg=V([mM,jB],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),OB=[],wg=(e,t,n)=>n?.length===0?OB:n,yM=V([ky,Sg,wg],(e,t,n)=>{var{chartData:a}=e;if(t!=null){var l;if(t?.data!=null&&t.data.length>0?l=t.data:l=a,(!l||!l.length)&&n!=null&&(l=n.map(o=>GO(GO({},t.presentationProps),o.props))),l!=null)return l}}),_B=V([yM,Sg,wg],(e,t,n)=>{if(!(e==null||t==null))return e.map((a,l)=>{var o,c=tt(a,t.nameKey,t.name),f;return n!=null&&(o=n[l])!==null&&o!==void 0&&(o=o.props)!==null&&o!==void 0&&o.fill?f=n[l].props.fill:typeof a=="object"&&a!=null&&"fill"in a?f=a.fill:f=t.fill,{value:Hf(c,t.dataKey),color:f,payload:a,type:t.legendType}})}),AB=V([yM,Sg,wg,zt],(e,t,n,a)=>{if(!(t==null||e==null))return kI({offset:a,pieSettings:t,displayedData:e,cells:n})}),pp={exports:{}},Ye={};var VO;function EB(){if(VO)return Ye;VO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function O(j){if(typeof j=="object"&&j!==null){var _=j.$$typeof;switch(_){case e:switch(j=j.type,j){case n:case l:case a:case d:case h:case b:return j;default:switch(j=j&&j.$$typeof,j){case c:case f:case p:case v:return j;case o:return j;default:return _}}case t:return _}}}return Ye.ContextConsumer=o,Ye.ContextProvider=c,Ye.Element=e,Ye.ForwardRef=f,Ye.Fragment=n,Ye.Lazy=p,Ye.Memo=v,Ye.Portal=t,Ye.Profiler=l,Ye.StrictMode=a,Ye.Suspense=d,Ye.SuspenseList=h,Ye.isContextConsumer=function(j){return O(j)===o},Ye.isContextProvider=function(j){return O(j)===c},Ye.isElement=function(j){return typeof j=="object"&&j!==null&&j.$$typeof===e},Ye.isForwardRef=function(j){return O(j)===f},Ye.isFragment=function(j){return O(j)===n},Ye.isLazy=function(j){return O(j)===p},Ye.isMemo=function(j){return O(j)===v},Ye.isPortal=function(j){return O(j)===t},Ye.isProfiler=function(j){return O(j)===l},Ye.isStrictMode=function(j){return O(j)===a},Ye.isSuspense=function(j){return O(j)===d},Ye.isSuspenseList=function(j){return O(j)===h},Ye.isValidElementType=function(j){return typeof j=="string"||typeof j=="function"||j===n||j===l||j===a||j===d||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===p||j.$$typeof===v||j.$$typeof===c||j.$$typeof===o||j.$$typeof===f||j.$$typeof===x||j.getModuleId!==void 0)},Ye.typeOf=O,Ye}var XO;function NB(){return XO||(XO=1,pp.exports=EB()),pp.exports}var TB=NB(),FO=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",ZO=null,yp=null,gM=e=>{if(e===ZO&&Array.isArray(yp))return yp;var t=[];return S.Children.forEach(e,n=>{_t(n)||(TB.isFragment(n)?t=t.concat(gM(n.props.children)):t.push(n))}),yp=t,ZO=e,t};function bM(e,t){var n=[],a=[];return Array.isArray(t)?a=t.map(l=>FO(l)):a=[FO(t)],gM(e).forEach(l=>{var o=xi(l,"type.displayName")||xi(l,"type.name");o&&a.indexOf(o)!==-1&&n.push(l)}),n}var xM=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,gp={},QO;function MB(){return QO||(QO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const l=n[Symbol.toStringTag];return l==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${l}]`}let a=n;for(;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(n)===a}e.isPlainObject=t})(gp)),gp}var bp,WO;function CB(){return WO||(WO=1,bp=MB().isPlainObject),bp}var DB=CB();const kB=Qr(DB);var JO,e_,t_,n_,r_;function a_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function i_(e){for(var t=1;t{var o=n-a,c;return c=ct(JO||(JO=Vu(["M ",",",""])),e,t),c+=ct(e_||(e_=Vu(["L ",",",""])),e+n,t),c+=ct(t_||(t_=Vu(["L ",",",""])),e+n-o/2,t+l),c+=ct(n_||(n_=Vu(["L ",",",""])),e+n-o/2-a,t+l),c+=ct(r_||(r_=Vu(["L ",","," Z"])),e,t),c},LB={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$B=e=>{var t=At(e,LB),{x:n,y:a,upperWidth:l,lowerWidth:o,height:c,className:f}=t,{animationEasing:d,animationDuration:h,animationBegin:v,isUpdateAnimationActive:p}=t,b=S.useRef(null),[x,O]=S.useState(-1),j=S.useRef(l),_=S.useRef(o),E=S.useRef(c),N=S.useRef(n),M=S.useRef(a),P=td(e,"trapezoid-");if(S.useEffect(()=>{if(b.current&&b.current.getTotalLength)try{var oe=b.current.getTotalLength();oe&&O(oe)}catch{}},[]),n!==+n||a!==+a||l!==+l||o!==+o||c!==+c||l===0&&o===0||c===0)return null;var T=Re("recharts-trapezoid",f);if(!p)return S.createElement("g",null,S.createElement("path",jf({},tn(t),{className:T,d:l_(n,a,l,o,c)})));var C=j.current,L=_.current,Z=E.current,ne=N.current,q=M.current,U="0px ".concat(x===-1?1:x,"px"),B="".concat(x,"px 0px"),ue=BE(["strokeDasharray"],h,d);return S.createElement(ed,{animationId:P,key:P,canBegin:x>0,duration:h,easing:d,isActive:p,begin:v},oe=>{var ve=Qt(C,l,oe),K=Qt(L,o,oe),ee=Qt(Z,c,oe),z=Qt(ne,n,oe),G=Qt(q,a,oe);b.current&&(j.current=ve,_.current=K,E.current=ee,N.current=z,M.current=G);var re=oe>0?{transition:ue,strokeDasharray:B}:{strokeDasharray:U};return S.createElement("path",jf({},tn(t),{className:T,d:l_(z,G,ve,K,ee),ref:b,style:i_(i_({},re),t.style)}))})},UB=["option","shapeType","activeClassName"];function qB(e,t){if(e==null)return{};var n,a,l=BB(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var a=Qe();return(l,o)=>c=>{e?.(l,o,c),a(TT({activeIndex:String(o),activeDataKey:t,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:n}))}},FB=e=>{var t=Qe();return(n,a)=>l=>{e?.(n,a,l),t(J$())}},ZB=(e,t,n)=>{var a=Qe();return(l,o)=>c=>{e?.(l,o,c),a(eU({activeIndex:String(o),activeDataKey:t,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:n}))}};function wM(e){var{tooltipEntrySettings:t}=e,n=Qe(),a=mn(),l=S.useRef(null);return S.useLayoutEffect(()=>{a||(l.current===null?n(F$(t)):l.current!==t&&n(Z$({prev:l.current,next:t})),l.current=t)},[t,n,a]),S.useLayoutEffect(()=>()=>{l.current&&(n(Q$(l.current)),l.current=null)},[n]),null}function QB(e){var{legendPayload:t}=e,n=Qe(),a=mn(),l=S.useRef(null);return S.useLayoutEffect(()=>{a||(l.current===null?n(RE(t)):l.current!==t&&n(LE({prev:l.current,next:t})),l.current=t)},[n,a,t]),S.useLayoutEffect(()=>()=>{l.current&&(n($E(l.current)),l.current=null)},[n]),null}function WB(e){var{legendPayload:t}=e,n=Qe(),a=de(Ge),l=S.useRef(null);return S.useLayoutEffect(()=>{a!=="centric"&&a!=="radial"||(l.current===null?n(RE(t)):l.current!==t&&n(LE({prev:l.current,next:t})),l.current=t)},[n,a,t]),S.useLayoutEffect(()=>()=>{l.current&&(n($E(l.current)),l.current=null)},[n]),null}var xp,JB=()=>{var[e]=S.useState(()=>uo("uid-"));return e},eI=(xp=M4.useId)!==null&&xp!==void 0?xp:JB;function tI(e,t){var n=eI();return t||(e?"".concat(e,"-").concat(n):n)}var nI=S.createContext(void 0),jM=e=>{var{id:t,type:n,children:a}=e,l=tI("recharts-".concat(n),t);return S.createElement(nI.Provider,{value:l},a(l))},rI={cartesianItems:[],polarItems:[]},OM=hn({name:"graphicalItems",initialState:rI,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:rt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).cartesianItems.indexOf(n);l>-1&&(e.cartesianItems[l]=a)},prepare:rt()},removeCartesianGraphicalItem:{reducer(e,t){var n=nr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:rt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:rt()},removePolarGraphicalItem:{reducer(e,t){var n=nr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:rt()}}}),{addCartesianGraphicalItem:aI,replaceCartesianGraphicalItem:iI,removeCartesianGraphicalItem:lI,addPolarGraphicalItem:uI,removePolarGraphicalItem:oI}=OM.actions,sI=OM.reducer,cI=e=>{var t=Qe(),n=S.useRef(null);return S.useLayoutEffect(()=>{n.current===null?t(aI(e)):n.current!==e&&t(iI({prev:n.current,next:e})),n.current=e},[t,e]),S.useLayoutEffect(()=>()=>{n.current&&(t(lI(n.current)),n.current=null)},[t]),null},fI=S.memo(cI);function dI(e){var t=Qe();return S.useLayoutEffect(()=>(t(uI(e)),()=>{t(oI(e))}),[t,e]),null}var hI=["key"],mI=["onMouseEnter","onClick","onMouseLeave"],vI=["id"],pI=["id"];function s_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function ft(e){for(var t=1;tbM(e.children,yd),[e.children]),n=de(a=>_B(a,e.id,t));return n==null?null:S.createElement(WB,{legendPayload:n})}var wI=S.memo(e=>{var{dataKey:t,nameKey:n,sectors:a,stroke:l,strokeWidth:o,fill:c,name:f,hide:d,tooltipType:h,id:v}=e,p={dataDefinedOnItem:a.map(b=>b.tooltipPayload),positions:a.map(b=>b.tooltipPosition),settings:{stroke:l,strokeWidth:o,fill:c,dataKey:t,nameKey:n,name:Hf(f,t),hide:d,type:h,color:c,unit:"",graphicalItemId:v}};return S.createElement(wM,{tooltipEntrySettings:p})}),jI=(e,t)=>e>t?"start":eNn(typeof t=="function"?t(e):t,n,n*.8),_I=(e,t,n)=>{var{top:a,left:l,width:o,height:c}=t,f=GE(o,c),d=l+Nn(e.cx,o,o/2),h=a+Nn(e.cy,c,c/2),v=Nn(e.innerRadius,f,0),p=OI(n,e.outerRadius,f),b=e.maxRadius||Math.sqrt(o*o+c*c)/2;return{cx:d,cy:h,innerRadius:v,outerRadius:p,maxRadius:b}},AI=(e,t)=>{var n=Wt(t-e),a=Math.min(Math.abs(t-e),360);return n*a};function EI(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var NI=(e,t)=>{if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Re("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:a}=t,l=Sd(t,hI);return S.createElement(sy,$a({},l,{type:"linear",className:n}))},TI=(e,t,n)=>{if(S.isValidElement(e))return S.cloneElement(e,t);var a=n;if(typeof e=="function"&&(a=e(t),S.isValidElement(a)))return a;var l=Re("recharts-pie-label-text",EI(e));return S.createElement(gd,$a({},t,{alignmentBaseline:"middle",className:l}),a)};function MI(e){var{sectors:t,props:n,showLabels:a}=e,{label:l,labelLine:o,dataKey:c}=n;if(!a||!l||!t)return null;var f=Gn(n),d=_l(l),h=_l(o),v=typeof l=="object"&&"offsetRadius"in l&&typeof l.offsetRadius=="number"&&l.offsetRadius||20,p=t.map((b,x)=>{var O=(b.startAngle+b.endAngle)/2,j=xt(b.cx,b.cy,b.outerRadius+v,O),_=ft(ft(ft(ft({},f),b),{},{stroke:"none"},d),{},{index:x,textAnchor:jI(j.x,b.cx)},j),E=ft(ft(ft(ft({},f),b),{},{fill:"none",stroke:b.fill},h),{},{index:x,points:[xt(b.cx,b.cy,b.outerRadius,O),j],key:"line"});return S.createElement(ir,{zIndex:Vt.label,key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(x)},S.createElement(dn,null,o&&NI(o,E),TI(l,_,tt(b,c))))});return S.createElement(dn,{className:"recharts-pie-labels"},p)}function CI(e){var{sectors:t,props:n,showLabels:a}=e,{label:l}=n;return typeof l=="object"&&l!=null&&"position"in l?S.createElement(dM,{label:l}):S.createElement(MI,{sectors:t,props:n,showLabels:a})}function DI(e){var{sectors:t,activeShape:n,inactiveShape:a,allOtherPieProps:l,shape:o,id:c}=e,f=de(Dl),d=de(HT),h=de(UU),{onMouseEnter:v,onClick:p,onMouseLeave:b}=l,x=Sd(l,mI),O=XB(v,l.dataKey,c),j=FB(b),_=ZB(p,l.dataKey,c);return t==null||t.length===0?null:S.createElement(S.Fragment,null,t.map((E,N)=>{if(E?.startAngle===0&&E?.endAngle===0&&t.length!==1)return null;var M=h==null||h===c,P=String(N)===f&&(d==null||l.dataKey===d)&&M,T=f?a:null,C=n&&P?n:T,L=ft(ft({},E),{},{stroke:E.stroke,tabIndex:-1,[SE]:N,[wE]:c});return S.createElement(dn,$a({key:"sector-".concat(E?.startAngle,"-").concat(E?.endAngle,"-").concat(E.midAngle,"-").concat(N),tabIndex:-1,className:"recharts-pie-sector"},X0(x,E,N),{onMouseEnter:O(E,N),onMouseLeave:j(E,N),onClick:_(E,N)}),S.createElement(SM,$a({option:o??C,index:N,shapeType:"sector",isActive:P},L)))}))}function kI(e){var t,{pieSettings:n,displayedData:a,cells:l,offset:o}=e,{cornerRadius:c,startAngle:f,endAngle:d,dataKey:h,nameKey:v,tooltipType:p}=n,b=Math.abs(n.minAngle),x=AI(f,d),O=Math.abs(x),j=a.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,_=a.filter(C=>tt(C,h,0)!==0).length,E=(O>=360?_:_-1)*j,N=O-_*b-E,M=a.reduce((C,L)=>{var Z=tt(L,h,0);return C+(me(Z)?Z:0)},0),P;if(M>0){var T;P=a.map((C,L)=>{var Z=tt(C,h,0),ne=tt(C,v,L),q=_I(n,o,C),U=(me(Z)?Z:0)/M,B,ue=ft(ft({},C),l&&l[L]&&l[L].props);L?B=T.endAngle+Wt(x)*j*(Z!==0?1:0):B=f;var oe=B+Wt(x)*((Z!==0?b:0)+U*N),ve=(B+oe)/2,K=(q.innerRadius+q.outerRadius)/2,ee=[{name:ne,value:Z,payload:ue,dataKey:h,type:p,graphicalItemId:n.id}],z=xt(q.cx,q.cy,K,ve);return T=ft(ft(ft(ft({},n.presentationProps),{},{percent:U,cornerRadius:typeof c=="string"?parseFloat(c):c,name:ne,tooltipPayload:ee,midAngle:ve,middleRadius:K,tooltipPosition:z},ue),q),{},{value:Z,dataKey:h,startAngle:B,endAngle:oe,payload:ue,paddingAngle:Wt(x)*j}),T})}return P}function PI(e){var{showLabels:t,sectors:n,children:a}=e,l=S.useMemo(()=>!t||!n?[]:n.map(o=>({value:o.value,payload:o.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:o.cx,cy:o.cy,innerRadius:o.innerRadius,outerRadius:o.outerRadius,startAngle:o.startAngle,endAngle:o.endAngle,clockWise:!1},fill:o.fill})),[n,t]);return S.createElement(sB,{value:t?l:void 0},a)}function zI(e){var{props:t,previousSectorsRef:n,id:a}=e,{sectors:l,isAnimationActive:o,animationBegin:c,animationDuration:f,animationEasing:d,activeShape:h,inactiveShape:v,onAnimationStart:p,onAnimationEnd:b}=t,x=td(t,"recharts-pie-"),O=n.current,[j,_]=S.useState(!1),E=S.useCallback(()=>{typeof b=="function"&&b(),_(!1)},[b]),N=S.useCallback(()=>{typeof p=="function"&&p(),_(!0)},[p]);return S.createElement(PI,{showLabels:!j,sectors:l},S.createElement(ed,{animationId:x,begin:c,duration:f,isActive:o,easing:d,onAnimationStart:N,onAnimationEnd:E,key:x},M=>{var P=[],T=l&&l[0],C=T?.startAngle;return l?.forEach((L,Z)=>{var ne=O&&O[Z],q=Z>0?xi(L,"paddingAngle",0):0;if(ne){var U=Qt(ne.endAngle-ne.startAngle,L.endAngle-L.startAngle,M),B=ft(ft({},L),{},{startAngle:C+q,endAngle:C+U+q});P.push(B),C=B.endAngle}else{var{endAngle:ue,startAngle:oe}=L,ve=Qt(0,ue-oe,M),K=ft(ft({},L),{},{startAngle:C+q,endAngle:C+ve+q});P.push(K),C=K.endAngle}}),n.current=P,S.createElement(dn,null,S.createElement(DI,{sectors:P,activeShape:h,inactiveShape:v,allOtherPieProps:t,shape:t.shape,id:a}))}),S.createElement(CI,{showLabels:!j,sectors:l,props:t}),t.children)}var RI={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Vt.area};function LI(e){var{id:t}=e,n=Sd(e,vI),{hide:a,className:l,rootTabIndex:o}=e,c=S.useMemo(()=>bM(e.children,yd),[e.children]),f=de(v=>AB(v,t,c)),d=S.useRef(null),h=Re("recharts-pie",l);return a||f==null?(d.current=null,S.createElement(dn,{tabIndex:o,className:h})):S.createElement(ir,{zIndex:e.zIndex},S.createElement(wI,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:f,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t}),S.createElement(dn,{tabIndex:o,className:h},S.createElement(zI,{props:ft(ft({},n),{},{sectors:f}),previousSectorsRef:d,id:t})))}function _M(e){var t=At(e,RI),{id:n}=t,a=Sd(t,pI),l=Gn(a);return S.createElement(jM,{id:n,type:"pie"},o=>S.createElement(S.Fragment,null,S.createElement(dI,{type:"pie",id:o,data:a.data,dataKey:a.dataKey,hide:a.hide,angleAxisId:0,radiusAxisId:0,name:a.name,nameKey:a.nameKey,tooltipType:a.tooltipType,legendType:a.legendType,fill:a.fill,cx:a.cx,cy:a.cy,startAngle:a.startAngle,endAngle:a.endAngle,paddingAngle:a.paddingAngle,minAngle:a.minAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius,cornerRadius:a.cornerRadius,presentationProps:l,maxRadius:t.maxRadius}),S.createElement(SI,$a({},a,{id:o})),S.createElement(LI,$a({},a,{id:o}))))}_M.displayName="Pie";var $I=["points"];function c_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Sp(e){for(var t=1;t{var _,E,N=Sp(Sp(Sp({r:3},c),p),{},{index:j,cx:(_=O.x)!==null&&_!==void 0?_:void 0,cy:(E=O.y)!==null&&E!==void 0?E:void 0,dataKey:o,value:O.value,payload:O.payload,points:t});return S.createElement(KI,{key:"dot-".concat(j),option:n,dotProps:N,className:l})}),x={};return f&&d!=null&&(x.clipPath="url(#clipPath-".concat(v?"":"dots-").concat(d,")")),S.createElement(ir,{zIndex:h},S.createElement(dn,_f({className:a},x),b))}function f_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function d_(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),lH=V([iH,Wr,Jr],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),jg=()=>de(lH),uH=()=>de(KU);function h_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function wp(e){for(var t=1;t{var{point:t,childIndex:n,mainColor:a,activeDot:l,dataKey:o,clipPath:c}=e;if(l===!1||t.x==null||t.y==null)return null;var f={index:n,dataKey:o,cx:t.x,cy:t.y,r:4,fill:a??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=wp(wp(wp({},f),_l(l)),V0(l)),h;return S.isValidElement(l)?h=S.cloneElement(l,d):typeof l=="function"?h=l(d):h=S.createElement(hM,d),S.createElement(dn,{className:"recharts-active-dot",clipPath:c},h)};function dH(e){var{points:t,mainColor:n,activeDot:a,itemDataKey:l,clipPath:o,zIndex:c=Vt.activeDot}=e,f=de(Dl),d=uH();if(t==null||d==null)return null;var h=t.find(v=>d.includes(v.payload));return _t(h)?null:S.createElement(ir,{zIndex:c},S.createElement(fH,{point:h,childIndex:Number(f),mainColor:n,dataKey:l,activeDot:a,clipPath:o}))}var EM=e=>{var{chartData:t}=e,n=Qe(),a=mn();return S.useEffect(()=>a?()=>{}:(n(wO(t)),()=>{n(wO(void 0))}),[t,n,a]),null},m_={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},NM=hn({name:"brush",initialState:m_,reducers:{setBrushSettings(e,t){return t.payload==null?m_:t.payload}}}),{setBrushSettings:WG}=NM.actions,hH=NM.reducer;function mH(e,t,n){return(t=vH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vH(e){var t=pH(e,"string");return typeof t=="symbol"?t:t+""}function pH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Og{static create(t){return new Og(t)}constructor(t){this.scale=t}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}apply(t){var{bandAware:n,position:a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t!==void 0){if(a)switch(a){case"start":return this.scale(t);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+l}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(t)+o}default:return this.scale(t)}if(n){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+c}return this.scale(t)}}isInRange(t){var n=this.range(),a=n[0],l=n[n.length-1];return a<=l?t>=a&&t<=l:t>=l&&t<=a}}mH(Og,"EPS",1e-4);function yH(e){return(e%180+180)%180}var gH=function(t){var{width:n,height:a}=t,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=yH(l),c=o*Math.PI/180,f=Math.atan(a/n),d=c>f&&c{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=nr(e).dots.findIndex(a=>a===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=nr(e).areas.findIndex(a=>a===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=nr(e).lines.findIndex(a=>a===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:JG,removeDot:eV,addArea:tV,removeArea:nV,addLine:rV,removeLine:aV}=TM.actions,xH=TM.reducer,SH=S.createContext(void 0),wH=e=>{var{children:t}=e,[n]=S.useState("".concat(uo("recharts"),"-clip")),a=jg();if(a==null)return null;var{x:l,y:o,width:c,height:f}=a;return S.createElement(SH.Provider,{value:n},S.createElement("defs",null,S.createElement("clipPath",{id:n},S.createElement("rect",{x:l,y:o,height:f,width:c}))),t)};function MM(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],a=0;ae*l)return!1;var o=n();return e*(t-e*o/2-a)>=0&&e*(t+e*o/2-l)<=0}function _H(e,t){return MM(e,t+1)}function AH(e,t,n,a,l){for(var o=(a||[]).slice(),{start:c,end:f}=t,d=0,h=1,v=c,p=function(){var O=a?.[d];if(O===void 0)return{v:MM(a,h)};var j=d,_,E=()=>(_===void 0&&(_=n(O,j)),_),N=O.coordinate,M=d===0||wo(e,N,E,v,f);M||(d=0,v=c,h+=1),M&&(v=N+e*(E()/2+l),d+=h)},b;h<=o.length;)if(b=p(),b)return b.v;return[]}function EH(e,t,n,a,l){var o=(a||[]).slice(),c=o.length;if(c===0)return[];for(var{start:f,end:d}=t,h=1;h<=c;h++){for(var v=(c-1)%h,p=f,b=!0,x=function(){var N=a[O],M=O,P,T=()=>(P===void 0&&(P=n(N,M)),P),C=N.coordinate,L=O===v||wo(e,C,T,p,d);if(!L)return b=!1,1;L&&(p=C+e*(T()/2+l))},O=v;O(O===void 0&&(O=n(x,b)),O);if(b===c-1){var _=e*(x.coordinate+e*j()/2-d);o[b]=x=Ft(Ft({},x),{},{tickCoord:_>0?x.coordinate-_*e:x.coordinate})}else o[b]=x=Ft(Ft({},x),{},{tickCoord:x.coordinate});if(x.tickCoord!=null){var E=wo(e,x.tickCoord,j,f,d);E&&(d=x.tickCoord-e*(j()/2+l),o[b]=Ft(Ft({},x),{},{isShow:!0}))}},v=c-1;v>=0;v--)h(v);return o}function DH(e,t,n,a,l,o){var c=(a||[]).slice(),f=c.length,{start:d,end:h}=t;if(o){var v=a[f-1],p=n(v,f-1),b=e*(v.coordinate+e*p/2-h);if(c[f-1]=v=Ft(Ft({},v),{},{tickCoord:b>0?v.coordinate-b*e:v.coordinate}),v.tickCoord!=null){var x=wo(e,v.tickCoord,()=>p,d,h);x&&(h=v.tickCoord-e*(p/2+l),c[f-1]=Ft(Ft({},v),{},{isShow:!0}))}}for(var O=o?f-1:f,j=function(N){var M=c[N],P,T=()=>(P===void 0&&(P=n(M,N)),P);if(N===0){var C=e*(M.coordinate-e*T()/2-d);c[N]=M=Ft(Ft({},M),{},{tickCoord:C<0?M.coordinate-C*e:M.coordinate})}else c[N]=M=Ft(Ft({},M),{},{tickCoord:M.coordinate});if(M.tickCoord!=null){var L=wo(e,M.tickCoord,T,d,h);L&&(d=M.tickCoord+e*(T()/2+l),c[N]=Ft(Ft({},M),{},{isShow:!0}))}},_=0;_{var T=typeof h=="function"?h(M.value,P):M.value;return O==="width"?jH(no(T,{fontSize:t,letterSpacing:n}),j,p):no(T,{fontSize:t,letterSpacing:n})[O]},E=l.length>=2?Wt(l[1].coordinate-l[0].coordinate):1,N=OH(o,E,O);return d==="equidistantPreserveStart"?AH(E,N,_,l,c):d==="equidistantPreserveEnd"?EH(E,N,_,l,c):(d==="preserveStart"||d==="preserveStartEnd"?x=DH(E,N,_,l,c,d==="preserveStartEnd"):x=CH(E,N,_,l,c),x.filter(M=>M.isShow))}var kH=e=>{var{ticks:t,label:n,labelGapWithTick:a=5,tickSize:l=0,tickMargin:o=0}=e,c=0;if(t){Array.from(t).forEach(v=>{if(v){var p=v.getBoundingClientRect();p.width>c&&(c=p.width)}});var f=n?n.getBoundingClientRect().width:0,d=l+o,h=c+d+f+(n?a:0);return Math.round(h)}return 0},PH=["axisLine","width","height","className","hide","ticks","axisType"];function zH(e,t){if(e==null)return{};var n,a,l=RH(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{ticks:n=[],tick:a,tickLine:l,stroke:o,tickFormatter:c,unit:f,padding:d,tickTextProps:h,orientation:v,mirror:p,x:b,y:x,width:O,height:j,tickSize:_,tickMargin:E,fontSize:N,letterSpacing:M,getTicksConfig:P,events:T,axisType:C}=e,L=_g(bt(bt({},P),{},{ticks:n}),N,M),Z=IH(v,p),ne=HH(v,p),q=Gn(P),U=_l(a),B={};typeof l=="object"&&(B=l);var ue=bt(bt({},q),{},{fill:"none"},B),oe=L.map(ee=>bt({entry:ee},BH(ee,b,x,O,j,v,_,p,E))),ve=oe.map(ee=>{var{entry:z,line:G}=ee;return S.createElement(dn,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(z.value,"-").concat(z.coordinate,"-").concat(z.tickCoord)},l&&S.createElement("line",_i({},ue,G,{className:Re("recharts-cartesian-axis-tick-line",xi(l,"className"))})))}),K=oe.map((ee,z)=>{var{entry:G,tick:re}=ee,k=bt(bt(bt(bt({textAnchor:Z,verticalAnchor:ne},q),{},{stroke:"none",fill:o},U),re),{},{index:z,payload:G,visibleTicksCount:L.length,tickFormatter:c,padding:d},h);return S.createElement(dn,_i({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(G.value,"-").concat(G.coordinate,"-").concat(G.tickCoord)},X0(T,G,z)),a&&S.createElement(KH,{option:a,tickProps:k,value:"".concat(typeof c=="function"?c(G.value,z):G.value).concat(f||"")}))});return S.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(C,"-ticks")},K.length>0&&S.createElement(ir,{zIndex:Vt.label},S.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(C,"-tick-labels"),ref:t},K)),ve.length>0&&S.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(C,"-tick-lines")},ve))}),GH=S.forwardRef((e,t)=>{var{axisLine:n,width:a,height:l,className:o,hide:c,ticks:f,axisType:d}=e,h=zH(e,PH),[v,p]=S.useState(""),[b,x]=S.useState(""),O=S.useRef(null);S.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var _;return kH({ticks:O.current,label:(_=e.labelRef)===null||_===void 0?void 0:_.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=S.useCallback(_=>{if(_){var E=_.getElementsByClassName("recharts-cartesian-axis-tick-value");O.current=E;var N=E[0];if(N){var M=window.getComputedStyle(N),P=M.fontSize,T=M.letterSpacing;(P!==v||T!==b)&&(p(P),x(T))}}},[v,b]);return c||a!=null&&a<=0||l!=null&&l<=0?null:S.createElement(ir,{zIndex:e.zIndex},S.createElement(dn,{className:Re("recharts-cartesian-axis",o)},S.createElement(qH,{x:e.x,y:e.y,width:a,height:l,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Gn(e)}),S.createElement(YH,{ref:j,axisType:d,events:h,fontSize:v,getTicksConfig:e,height:e.height,letterSpacing:b,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:f,unit:e.unit,width:e.width,x:e.x,y:e.y}),S.createElement(Bq,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},S.createElement(Qq,{label:e.label,labelRef:e.labelRef}),e.children)))}),Ag=S.forwardRef((e,t)=>{var n=At(e,Kr);return S.createElement(GH,_i({},n,{ref:t}))});Ag.displayName="CartesianAxis";var VH=["x1","y1","x2","y2","key"],XH=["offset"],FH=["xAxisId","yAxisId"],ZH=["xAxisId","yAxisId"];function y_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Zt(e){for(var t=1;t{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:a,y:l,width:o,height:c,ry:f}=e;return S.createElement("rect",{x:a,y:l,ry:f,width:o,height:c,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function CM(e){var{option:t,lineItemProps:n}=e,a;if(S.isValidElement(t))a=S.cloneElement(t,n);else if(typeof t=="function")a=t(n);else{var l,{x1:o,y1:c,x2:f,y2:d,key:h}=n,v=Af(n,VH),p=(l=Gn(v))!==null&&l!==void 0?l:{},{offset:b}=p,x=Af(p,XH);a=S.createElement("line",vi({},x,{x1:o,y1:c,x2:f,y2:d,fill:"none",key:h}))}return a}function nK(e){var{x:t,width:n,horizontal:a=!0,horizontalPoints:l}=e;if(!a||!l||!l.length)return null;var{xAxisId:o,yAxisId:c}=e,f=Af(e,FH),d=l.map((h,v)=>{var p=Zt(Zt({},f),{},{x1:t,y1:h,x2:t+n,y2:h,key:"line-".concat(v),index:v});return S.createElement(CM,{key:"line-".concat(v),option:a,lineItemProps:p})});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function rK(e){var{y:t,height:n,vertical:a=!0,verticalPoints:l}=e;if(!a||!l||!l.length)return null;var{xAxisId:o,yAxisId:c}=e,f=Af(e,ZH),d=l.map((h,v)=>{var p=Zt(Zt({},f),{},{x1:h,y1:t,x2:h,y2:t+n,key:"line-".concat(v),index:v});return S.createElement(CM,{option:a,lineItemProps:p,key:"line-".concat(v)})});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function aK(e){var{horizontalFill:t,fillOpacity:n,x:a,y:l,width:o,height:c,horizontalPoints:f,horizontal:d=!0}=e;if(!d||!t||!t.length||f==null)return null;var h=f.map(p=>Math.round(p+l-l)).sort((p,b)=>p-b);l!==h[0]&&h.unshift(0);var v=h.map((p,b)=>{var x=!h[b+1],O=x?l+c-p:h[b+1]-p;if(O<=0)return null;var j=b%t.length;return S.createElement("rect",{key:"react-".concat(b),y:p,x:a,height:O,width:o,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},v)}function iK(e){var{vertical:t=!0,verticalFill:n,fillOpacity:a,x:l,y:o,width:c,height:f,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var h=d.map(p=>Math.round(p+l-l)).sort((p,b)=>p-b);l!==h[0]&&h.unshift(0);var v=h.map((p,b)=>{var x=!h[b+1],O=x?l+c-p:h[b+1]-p;if(O<=0)return null;var j=b%n.length;return S.createElement("rect",{key:"react-".concat(b),x:p,y:o,width:O,height:f,stroke:"none",fill:n[j],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},v)}var lK=(e,t)=>{var{xAxis:n,width:a,height:l,offset:o}=e;return gE(_g(Zt(Zt(Zt({},Kr),n),{},{ticks:bE(n),viewBox:{x:0,y:0,width:a,height:l}})),o.left,o.left+o.width,t)},uK=(e,t)=>{var{yAxis:n,width:a,height:l,offset:o}=e;return gE(_g(Zt(Zt(Zt({},Kr),n),{},{ticks:bE(n),viewBox:{x:0,y:0,width:a,height:l}})),o.top,o.top+o.height,t)},oK={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Vt.grid};function ro(e){var t=iy(),n=ly(),a=NE(),l=Zt(Zt({},At(e,oK)),{},{x:me(e.x)?e.x:a.left,y:me(e.y)?e.y:a.top,width:me(e.width)?e.width:a.width,height:me(e.height)?e.height:a.height}),{xAxisId:o,yAxisId:c,x:f,y:d,width:h,height:v,syncWithTicks:p,horizontalValues:b,verticalValues:x}=l,O=mn(),j=de(ne=>cO(ne,"xAxis",o,O)),_=de(ne=>cO(ne,"yAxis",c,O));if(!yr(h)||!yr(v)||!me(f)||!me(d))return null;var E=l.verticalCoordinatesGenerator||lK,N=l.horizontalCoordinatesGenerator||uK,{horizontalPoints:M,verticalPoints:P}=l;if((!M||!M.length)&&typeof N=="function"){var T=b&&b.length,C=N({yAxis:_?Zt(Zt({},_),{},{ticks:T?b:_.ticks}):void 0,width:t??h,height:n??v,offset:a},T?!0:p);Wc(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof C,"]")),Array.isArray(C)&&(M=C)}if((!P||!P.length)&&typeof E=="function"){var L=x&&x.length,Z=E({xAxis:j?Zt(Zt({},j),{},{ticks:L?x:j.ticks}):void 0,width:t??h,height:n??v,offset:a},L?!0:p);Wc(Array.isArray(Z),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof Z,"]")),Array.isArray(Z)&&(P=Z)}return S.createElement(ir,{zIndex:l.zIndex},S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(tK,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),S.createElement(aK,vi({},l,{horizontalPoints:M})),S.createElement(iK,vi({},l,{verticalPoints:P})),S.createElement(nK,vi({},l,{offset:a,horizontalPoints:M,xAxis:j,yAxis:_})),S.createElement(rK,vi({},l,{offset:a,verticalPoints:P,xAxis:j,yAxis:_}))))}ro.displayName="CartesianGrid";var sK={},DM=hn({name:"errorBars",initialState:sK,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:a}=t.payload;e[n]||(e[n]=[]),e[n].push(a)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:a,next:l}=t.payload;e[n]&&(e[n]=e[n].map(o=>o.dataKey===a.dataKey&&o.direction===a.direction?l:o))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:a}=t.payload;e[n]&&(e[n]=e[n].filter(l=>l.dataKey!==a.dataKey||l.direction!==a.direction))}}}),{addErrorBar:iV,replaceErrorBar:lV,removeErrorBar:uV}=DM.actions,cK=DM.reducer,fK=["children"];function dK(e,t){if(e==null)return{};var n,a,l=hK(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a({x:0,y:0,value:0}),errorBarOffset:0},vK=S.createContext(mK);function pK(e){var{children:t}=e,n=dK(e,fK);return S.createElement(vK.Provider,{value:n},t)}function kM(e,t){var n,a,l=de(h=>ta(h,e)),o=de(h=>na(h,t)),c=(n=l?.allowDataOverflow)!==null&&n!==void 0?n:Dt.allowDataOverflow,f=(a=o?.allowDataOverflow)!==null&&a!==void 0?a:kt.allowDataOverflow,d=c||f;return{needClip:d,needClipX:c,needClipY:f}}function yK(e){var{xAxisId:t,yAxisId:n,clipPathId:a}=e,l=jg(),{needClipX:o,needClipY:c,needClip:f}=kM(t,n);if(!f||!l)return null;var{x:d,y:h,width:v,height:p}=l;return S.createElement("clipPath",{id:"clipPath-".concat(a)},S.createElement("rect",{x:o?d:d-v/2,y:c?h:h-p/2,width:o?v:v*2,height:c?p:p*2}))}var PM=(e,t,n,a)=>jT(e,"xAxis",t,a),zM=(e,t,n,a)=>wT(e,"xAxis",t,a),RM=(e,t,n,a)=>jT(e,"yAxis",n,a),LM=(e,t,n,a)=>wT(e,"yAxis",n,a),gK=V([Ge,PM,RM,zM,LM],(e,t,n,a,l)=>Ua(e,"xAxis")?Qc(t,a,!1):Qc(n,l,!1)),bK=(e,t,n,a,l)=>l;function xK(e){return e.type==="line"}var SK=V([nT,bK],(e,t)=>e.filter(xK).find(n=>n.id===t)),wK=V([Ge,PM,RM,zM,LM,SK,gK,Py],(e,t,n,a,l,o,c,f)=>{var{chartData:d,dataStartIndex:h,dataEndIndex:v}=f;if(!(o==null||t==null||n==null||a==null||l==null||a.length===0||l.length===0||c==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:p,data:b}=o,x;if(b!=null&&b.length>0?x=b:x=d?.slice(h,v+1),x!=null)return sY({layout:e,xAxis:t,yAxis:n,xAxisTicks:a,yAxisTicks:l,dataKey:p,bandSize:c,displayedData:x})}});function jK(e){var t=_l(e),n=3,a=2;if(t!=null){var{r:l,strokeWidth:o}=t,c=Number(l),f=Number(o);return(Number.isNaN(c)||c<0)&&(c=n),(Number.isNaN(f)||f<0)&&(f=a),{r:c,strokeWidth:f}}return{r:n,strokeWidth:a}}var jp={exports:{}},Op={};var g_;function OK(){if(g_)return Op;g_=1;var e=kl();function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,a=e.useSyncExternalStore,l=e.useRef,o=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Op.useSyncExternalStoreWithSelector=function(d,h,v,p,b){var x=l(null);if(x.current===null){var O={hasValue:!1,value:null};x.current=O}else O=x.current;x=c(function(){function _(T){if(!E){if(E=!0,N=T,T=p(T),b!==void 0&&O.hasValue){var C=O.value;if(b(C,T))return M=C}return M=T}if(C=M,n(N,T))return C;var L=p(T);return b!==void 0&&b(C,L)?(N=T,C):(N=T,M=L)}var E=!1,N,M,P=v===void 0?null:v;return[function(){return _(h())},P===null?void 0:function(){return _(P())}]},[h,v,p,b]);var j=a(d,x[0],x[1]);return o(function(){O.hasValue=!0,O.value=j},[j]),f(j),j},Op}var b_;function _K(){return b_||(b_=1,jp.exports=OK()),jp.exports}_K();function AK(e){e()}function EK(){let e=null,t=null;return{clear(){e=null,t=null},notify(){AK(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let a=e;for(;a;)n.push(a),a=a.next;return n},subscribe(n){let a=!0;const l=t={callback:n,next:null,prev:t};return l.prev?l.prev.next=l:e=l,function(){!a||e===null||(a=!1,l.next?l.next.prev=l.prev:t=l.prev,l.prev?l.prev.next=l.next:e=l.next)}}}}var x_={notify(){},get:()=>[]};function NK(e,t){let n,a=x_,l=0,o=!1;function c(j){v();const _=a.subscribe(j);let E=!1;return()=>{E||(E=!0,_(),p())}}function f(){a.notify()}function d(){O.onStateChange&&O.onStateChange()}function h(){return o}function v(){l++,n||(n=e.subscribe(d),a=EK())}function p(){l--,n&&l===0&&(n(),n=void 0,a.clear(),a=x_)}function b(){o||(o=!0,v())}function x(){o&&(o=!1,p())}const O={addNestedSub:c,notifyNestedSubs:f,handleChangeWrapper:d,isSubscribed:h,trySubscribe:b,tryUnsubscribe:x,getListeners:()=>a};return O}var TK=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",MK=TK(),CK=()=>typeof navigator<"u"&&navigator.product==="ReactNative",DK=CK(),kK=()=>MK||DK?S.useLayoutEffect:S.useEffect,PK=kK();function S_(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function zK(e,t){if(S_(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(let l=0;l{const d=NK(l);return{store:l,subscription:d,getServerState:a?()=>a:void 0}},[l,a]),c=S.useMemo(()=>l.getState(),[l]);PK(()=>{const{subscription:d}=o;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),c!==l.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[o,c]);const f=n||UK;return S.createElement(f.Provider,{value:o},t)}var BK=qK,IK=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function HK(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Eg(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var a of n)if(IK.has(a)){if(e[a]==null&&t[a]==null)continue;if(!zK(e[a],t[a]))return!1}else if(!HK(e[a],t[a]))return!1;return!0}var KK=["id"],YK=["type","layout","connectNulls","needClip","shape"],GK=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,stroke:a,legendType:l,hide:o}=e;return[{inactive:o,dataKey:t,type:l,color:a,value:Hf(n,t),payload:e}]},WK=S.memo(e=>{var{dataKey:t,data:n,stroke:a,strokeWidth:l,fill:o,name:c,hide:f,unit:d,tooltipType:h,id:v}=e,p={dataDefinedOnItem:n,positions:void 0,settings:{stroke:a,strokeWidth:l,fill:o,dataKey:t,nameKey:void 0,name:Hf(c,t),hide:f,type:h,color:a,unit:d,graphicalItemId:v}};return S.createElement(wM,{tooltipEntrySettings:p})}),$M=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function JK(e,t){for(var n=e.length%2!==0?[...e,0]:e,a=[],l=0;l{var a=n.reduce((p,b)=>p+b);if(!a)return $M(t,e);for(var l=Math.floor(e/a),o=e%a,c=t-e,f=[],d=0,h=0;do){f=[...n.slice(0,d),o-h];break}var v=f.length%2===0?[0,c]:[c];return[...JK(n,l),...f,...v].map(p=>"".concat(p,"px")).join(", ")};function tY(e){var{clipPathId:t,points:n,props:a}=e,{dot:l,dataKey:o,needClip:c}=a,{id:f}=a,d=Ng(a,KK),h=Gn(d);return S.createElement(GI,{points:n,dot:l,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:o,baseProps:h,needClip:c,clipPathId:t})}function nY(e){var{showLabels:t,children:n,points:a}=e,l=S.useMemo(()=>a?.map(o=>{var c,f,d={x:(c=o.x)!==null&&c!==void 0?c:0,y:(f=o.y)!==null&&f!==void 0?f:0,width:0,lowerWidth:0,upperWidth:0,height:0};return dr(dr({},d),{},{value:o.value,payload:o.payload,viewBox:d,parentViewBox:void 0,fill:void 0})}),[a]);return S.createElement(oB,{value:t?l:void 0},n)}function j_(e){var{clipPathId:t,pathRef:n,points:a,strokeDasharray:l,props:o}=e,{type:c,layout:f,connectNulls:d,needClip:h,shape:v}=o,p=Ng(o,YK),b=dr(dr({},tn(p)),{},{fill:"none",className:"recharts-line-curve",clipPath:h?"url(#clipPath-".concat(t,")"):void 0,points:a,type:c,layout:f,connectNulls:d,strokeDasharray:l??o.strokeDasharray});return S.createElement(S.Fragment,null,a?.length>1&&S.createElement(SM,jo({shapeType:"curve",option:v},b,{pathRef:n})),S.createElement(tY,{points:a,clipPathId:t,props:o}))}function rY(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function aY(e){var{clipPathId:t,props:n,pathRef:a,previousPointsRef:l,longestAnimatedLengthRef:o}=e,{points:c,strokeDasharray:f,isAnimationActive:d,animationBegin:h,animationDuration:v,animationEasing:p,animateNewValues:b,width:x,height:O,onAnimationEnd:j,onAnimationStart:_}=n,E=l.current,N=td(c,"recharts-line-"),M=S.useRef(N),[P,T]=S.useState(!1),C=!P,L=S.useCallback(()=>{typeof j=="function"&&j(),T(!1)},[j]),Z=S.useCallback(()=>{typeof _=="function"&&_(),T(!0)},[_]),ne=rY(a.current),q=S.useRef(0);M.current!==N&&(q.current=o.current,M.current=N);var U=q.current;return S.createElement(nY,{points:c,showLabels:C},n.children,S.createElement(ed,{animationId:N,begin:h,duration:v,isActive:d,easing:p,onAnimationEnd:L,onAnimationStart:Z,key:N},B=>{var ue=Qt(U,ne+U,B),oe=Math.min(ue,ne),ve;if(d)if(f){var K="".concat(f).split(/[,\s]+/gim).map(G=>parseFloat(G));ve=eY(oe,ne,K)}else ve=$M(ne,oe);else ve=f==null?void 0:String(f);if(B>0&&ne>0&&(l.current=c,o.current=Math.max(o.current,oe)),E){var ee=E.length/c.length,z=B===1?c:c.map((G,re)=>{var k=Math.floor(re*ee);if(E[k]){var F=E[k];return dr(dr({},G),{},{x:Qt(F.x,G.x,B),y:Qt(F.y,G.y,B)})}return b?dr(dr({},G),{},{x:Qt(x*2,G.x,B),y:Qt(O/2,G.y,B)}):dr(dr({},G),{},{x:G.x,y:G.y})});return l.current=z,S.createElement(j_,{props:n,points:z,clipPathId:t,pathRef:a,strokeDasharray:ve})}return S.createElement(j_,{props:n,points:c,clipPathId:t,pathRef:a,strokeDasharray:ve})}),S.createElement(dM,{label:n.label}))}function iY(e){var{clipPathId:t,props:n}=e,a=S.useRef(null),l=S.useRef(0),o=S.useRef(null);return S.createElement(aY,{props:n,clipPathId:t,previousPointsRef:a,longestAnimatedLengthRef:l,pathRef:o})}var lY=(e,t)=>{var n,a;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(a=e.y)!==null&&a!==void 0?a:void 0,value:e.value,errorVal:tt(e.payload,t)}};class uY extends S.Component{render(){var{hide:t,dot:n,points:a,className:l,xAxisId:o,yAxisId:c,top:f,left:d,width:h,height:v,id:p,needClip:b,zIndex:x}=this.props;if(t)return null;var O=Re("recharts-line",l),j=p,{r:_,strokeWidth:E}=jK(n),N=xM(n),M=_*2+E,P=b?"url(#clipPath-".concat(N?"":"dots-").concat(j,")"):void 0;return S.createElement(ir,{zIndex:x},S.createElement(dn,{className:O},b&&S.createElement("defs",null,S.createElement(yK,{clipPathId:j,xAxisId:o,yAxisId:c}),!N&&S.createElement("clipPath",{id:"clipPath-dots-".concat(j)},S.createElement("rect",{x:d-M/2,y:f-M/2,width:h+M,height:v+M}))),S.createElement(pK,{xAxisId:o,yAxisId:c,data:a,dataPointFormatter:lY,errorBarOffset:0},S.createElement(iY,{props:this.props,clipPathId:j}))),S.createElement(dH,{activeDot:this.props.activeDot,points:a,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:P}))}}var UM={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Vt.line,type:"linear"};function oY(e){var t=At(e,UM),{activeDot:n,animateNewValues:a,animationBegin:l,animationDuration:o,animationEasing:c,connectNulls:f,dot:d,hide:h,isAnimationActive:v,label:p,legendType:b,xAxisId:x,yAxisId:O,id:j}=t,_=Ng(t,GK),{needClip:E}=kM(x,O),N=jg(),M=To(),P=mn(),T=de(q=>wK(q,x,O,P,j));if(M!=="horizontal"&&M!=="vertical"||T==null||N==null)return null;var{height:C,width:L,x:Z,y:ne}=N;return S.createElement(uY,jo({},_,{id:j,connectNulls:f,dot:d,activeDot:n,animateNewValues:a,animationBegin:l,animationDuration:o,animationEasing:c,isAnimationActive:v,hide:h,label:p,legendType:b,xAxisId:x,yAxisId:O,points:T,layout:M,height:C,width:L,left:Z,top:ne,needClip:E}))}function sY(e){var{layout:t,xAxis:n,yAxis:a,xAxisTicks:l,yAxisTicks:o,dataKey:c,bandSize:f,displayedData:d}=e;return d.map((h,v)=>{var p=tt(h,c);if(t==="horizontal"){var b=mj({axis:n,ticks:l,bandSize:f,entry:h,index:v}),x=_t(p)?null:a.scale(p);return{x:b,y:x,value:p,payload:h}}var O=_t(p)?null:n.scale(p),j=mj({axis:a,ticks:o,bandSize:f,entry:h,index:v});return O==null||j==null?null:{x:O,y:j,value:p,payload:h}}).filter(Boolean)}function cY(e){var t=At(e,UM),n=mn();return S.createElement(jM,{id:t.id,type:"line"},a=>S.createElement(S.Fragment,null,S.createElement(QB,{legendPayload:QK(t)}),S.createElement(WK,{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:a}),S.createElement(fI,{type:"line",id:a,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),S.createElement(oY,jo({},t,{id:a}))))}var Sl=S.memo(cY,Eg);Sl.displayName="Line";var fY=["domain","range"],dY=["domain","range"];function O_(e,t){if(e==null)return{};var n,a,l=hY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{n.current===null?t(QI(e)):n.current!==e&&t(WI({prev:n.current,next:e})),n.current=e},[e,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(JI(n.current)),n.current=null)},[t]),null}var gY=e=>{var{xAxisId:t,className:n}=e,a=de(jE),l=mn(),o="xAxis",c=de(E=>ST(E,o,t,l)),f=de(E=>D$(E,t)),d=de(E=>$$(E,t)),h=de(E=>JN(E,t));if(f==null||d==null||h==null)return null;var{dangerouslySetInnerHTML:v,ticks:p,scale:b}=e,x=A_(e,mY),{id:O,scale:j}=h,_=A_(h,vY);return S.createElement(Ag,j0({},x,_,{x:d.x,y:d.y,width:f.width,height:f.height,className:Re("recharts-".concat(o," ").concat(o),n),viewBox:a,ticks:c,axisType:o}))},bY={allowDataOverflow:Dt.allowDataOverflow,allowDecimals:Dt.allowDecimals,allowDuplicatedCategory:Dt.allowDuplicatedCategory,angle:Dt.angle,axisLine:Kr.axisLine,height:Dt.height,hide:!1,includeHidden:Dt.includeHidden,interval:Dt.interval,minTickGap:Dt.minTickGap,mirror:Dt.mirror,orientation:Dt.orientation,padding:Dt.padding,reversed:Dt.reversed,scale:Dt.scale,tick:Dt.tick,tickCount:Dt.tickCount,tickLine:Kr.tickLine,tickSize:Kr.tickSize,type:Dt.type,xAxisId:0},xY=e=>{var t=At(e,bY);return S.createElement(S.Fragment,null,S.createElement(yY,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit}),S.createElement(gY,t))},ao=S.memo(xY,qM);ao.displayName="XAxis";var SY=["dangerouslySetInnerHTML","ticks","scale"],wY=["id","scale"];function O0(){return O0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.current===null?t(eH(e)):n.current!==e&&t(tH({prev:n.current,next:e})),n.current=e},[e,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(nH(n.current)),n.current=null)},[t]),null}var _Y=e=>{var{yAxisId:t,className:n,width:a,label:l}=e,o=S.useRef(null),c=S.useRef(null),f=de(jE),d=mn(),h=Qe(),v="yAxis",p=de(C=>B$(C,t)),b=de(C=>q$(C,t)),x=de(C=>ST(C,v,t,d)),O=de(C=>eT(C,t));if(S.useLayoutEffect(()=>{if(!(a!=="auto"||!p||xg(l)||S.isValidElement(l)||O==null)){var C=o.current;if(C){var L=C.getCalculatedWidth();Math.round(p.width)!==Math.round(L)&&h(rH({id:t,width:L}))}}},[x,p,h,l,t,a,O]),p==null||b==null||O==null)return null;var{dangerouslySetInnerHTML:j,ticks:_,scale:E}=e,N=E_(e,SY),{id:M,scale:P}=O,T=E_(O,wY);return S.createElement(Ag,O0({},N,T,{ref:o,labelRef:c,x:b.x,y:b.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:p.width,height:p.height,className:Re("recharts-".concat(v," ").concat(v),n),viewBox:f,ticks:x,axisType:v}))},AY={allowDataOverflow:kt.allowDataOverflow,allowDecimals:kt.allowDecimals,allowDuplicatedCategory:kt.allowDuplicatedCategory,angle:kt.angle,axisLine:Kr.axisLine,hide:!1,includeHidden:kt.includeHidden,interval:kt.interval,minTickGap:kt.minTickGap,mirror:kt.mirror,orientation:kt.orientation,padding:kt.padding,reversed:kt.reversed,scale:kt.scale,tick:kt.tick,tickCount:kt.tickCount,tickLine:Kr.tickLine,tickSize:Kr.tickSize,type:kt.type,width:kt.width,yAxisId:0},EY=e=>{var t=At(e,AY);return S.createElement(S.Fragment,null,S.createElement(OY,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter}),S.createElement(_Y,t))},io=S.memo(EY,qM);io.displayName="YAxis";var NY=(e,t)=>t,Tg=V([NY,Ge,ZN,Nt,UT,ra,r7,zt],c7),Mg=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,a=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/a)}},BM=Vn("mouseClick"),IM=Eo();IM.startListening({actionCreator:BM,effect:(e,t)=>{var n=e.payload,a=Tg(t.getState(),Mg(n));a?.activeIndex!=null&&t.dispatch(tU({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}});var _0=Vn("mouseMove"),HM=Eo(),Oc=null;HM.startListening({actionCreator:_0,effect:(e,t)=>{var n=e.payload;Oc!==null&&cancelAnimationFrame(Oc);var a=Mg(n);Oc=requestAnimationFrame(()=>{var l=t.getState(),o=cg(l,l.tooltip.settings.shared);if(o==="axis"){var c=Tg(l,a);c?.activeIndex!=null?t.dispatch(CT({activeIndex:c.activeIndex,activeDataKey:void 0,activeCoordinate:c.activeCoordinate})):t.dispatch(MT())}Oc=null})}});function TY(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?"<>":t}var N_={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},KM=hn({name:"rootProps",initialState:N_,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:N_.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}}}),MY=KM.reducer,{updateOptions:CY}=KM.actions,YM=hn({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:DY}=YM.actions,kY=YM.reducer,GM=Vn("keyDown"),VM=Vn("focus"),Cg=Eo();Cg.startListening({actionCreator:GM,effect:(e,t)=>{var n=t.getState(),a=n.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:l}=n.tooltip,o=e.payload;if(!(o!=="ArrowRight"&&o!=="ArrowLeft"&&o!=="Enter")){var c=fg(l,Hl(n),Uo(n),Io(n)),f=c==null?-1:Number(c);if(!(!Number.isFinite(f)||f<0)){var d=ra(n);if(o==="Enter"){var h=Sf(n,"axis","hover",String(l.index));t.dispatch(y0({active:!l.active,activeIndex:l.index,activeCoordinate:h}));return}var v=Y$(n),p=v==="left-to-right"?1:-1,b=o==="ArrowRight"?1:-1,x=f+b*p;if(!(d==null||x>=d.length||x<0)){var O=Sf(n,"axis","hover",String(x));t.dispatch(y0({active:!0,activeIndex:x.toString(),activeCoordinate:O}))}}}}}});Cg.startListening({actionCreator:VM,effect:(e,t)=>{var n=t.getState(),a=n.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:l}=n.tooltip;if(!l.active&&l.index==null){var o="0",c=Sf(n,"axis","hover",String(o));t.dispatch(y0({active:!0,activeIndex:o,activeCoordinate:c}))}}}});var Hn=Vn("externalEvent"),XM=Eo(),_p=new Map;XM.startListening({actionCreator:Hn,effect:(e,t)=>{var{handler:n,reactEvent:a}=e.payload;if(n!=null){a.persist();var l=a.type,o=_p.get(l);o!==void 0&&cancelAnimationFrame(o);var c=requestAnimationFrame(()=>{try{var f=t.getState(),d={activeCoordinate:BU(f),activeDataKey:HT(f),activeIndex:Dl(f),activeLabel:IT(f),activeTooltipIndex:Dl(f),isTooltipActive:IU(f)};n(d,a)}finally{_p.delete(l)}});_p.set(l,c)}}});var PY=V([Bl],e=>e.tooltipItemPayloads),zY=V([PY,Bo,(e,t)=>t,(e,t,n)=>n],(e,t,n,a)=>{var l=e.find(f=>f.settings.graphicalItemId===a);if(l!=null){var{positions:o}=l;if(o!=null){var c=t(o,n);return c}}}),FM=Vn("touchMove"),ZM=Eo();ZM.startListening({actionCreator:FM,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var a=t.getState(),l=cg(a,a.tooltip.settings.shared);if(l==="axis"){var o=n.touches[0];if(o==null)return;var c=Tg(a,Mg({clientX:o.clientX,clientY:o.clientY,currentTarget:n.currentTarget}));c?.activeIndex!=null&&t.dispatch(CT({activeIndex:c.activeIndex,activeDataKey:void 0,activeCoordinate:c.activeCoordinate}))}else if(l==="item"){var f,d=n.touches[0];if(document.elementFromPoint==null||d==null)return;var h=document.elementFromPoint(d.clientX,d.clientY);if(!h||!h.getAttribute)return;var v=h.getAttribute(SE),p=(f=h.getAttribute(wE))!==null&&f!==void 0?f:void 0,b=Il(a).find(j=>j.id===p);if(v==null||b==null||p==null)return;var{dataKey:x}=b,O=zY(a,v,p);t.dispatch(TT({activeDataKey:x,activeIndex:v,activeCoordinate:O,activeGraphicalItemId:p}))}}}});var RY=HA({brush:hH,cartesianAxis:aH,chartData:B7,errorBars:cK,graphicalItems:sI,layout:m5,legend:bR,options:R7,polarAxis:bB,polarOptions:kY,referenceElements:xH,rootProps:MY,tooltip:nU,zIndex:O7}),LY=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Uz({reducer:RY,preloadedState:t,middleware:a=>{var l;return a({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((l="es6")!==null&&l!==void 0?l:"")}).concat([IM.middleware,HM.middleware,Cg.middleware,XM.middleware,ZM.middleware])},enhancers:a=>{var l=a;return typeof a=="function"&&(l=a()),l.concat(aE({type:"raf"}))},devTools:{serialize:{replacer:TY},name:"recharts-".concat(n)}})};function QM(e){var{preloadedState:t,children:n,reduxStoreName:a}=e,l=mn(),o=S.useRef(null);if(l)return n;o.current==null&&(o.current=LY(t,a));var c=Q0;return S.createElement(BK,{context:c,store:o.current},n)}function $Y(e){var{layout:t,margin:n}=e,a=Qe(),l=mn();return S.useEffect(()=>{l||(a(f5(t)),a(c5(n)))},[a,l,t,n]),null}var WM=S.memo($Y,Eg);function JM(e){var t=Qe();return S.useEffect(()=>{t(CY(e))},[t,e]),null}function T_(e){var{zIndex:t,isPanorama:n}=e,a=S.useRef(null),l=Qe();return S.useLayoutEffect(()=>(a.current&&l(w7({zIndex:t,element:a.current,isPanorama:n})),()=>{l(j7({zIndex:t,isPanorama:n}))}),[l,t,n]),S.createElement("g",{tabIndex:-1,ref:a})}function M_(e){var{children:t,isPanorama:n}=e,a=de(d7);if(!a||a.length===0)return t;var l=a.filter(c=>c<0),o=a.filter(c=>c>0);return S.createElement(S.Fragment,null,l.map(c=>S.createElement(T_,{key:c,zIndex:c,isPanorama:n})),t,o.map(c=>S.createElement(T_,{key:c,zIndex:c,isPanorama:n})))}var UY=["children"];function qY(e,t){if(e==null)return{};var n,a,l=BY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var n=iy(),a=ly(),l=qE();if(!yr(n)||!yr(a))return null;var{children:o,otherAttributes:c,title:f,desc:d}=e,h,v;return c!=null&&(typeof c.tabIndex=="number"?h=c.tabIndex:h=l?0:void 0,typeof c.role=="string"?v=c.role:v=l?"application":void 0),S.createElement($0,Ef({},c,{title:f,desc:d,role:v,tabIndex:h,width:n,height:a,style:IY,ref:t}),o)}),KY=e=>{var{children:t}=e,n=de(Vf);if(!n)return null;var{width:a,height:l,y:o,x:c}=n;return S.createElement($0,{width:a,height:l,x:c,y:o},t)},C_=S.forwardRef((e,t)=>{var{children:n}=e,a=qY(e,UY),l=mn();return l?S.createElement(KY,null,S.createElement(M_,{isPanorama:!0},n)):S.createElement(HY,Ef({ref:t},a),S.createElement(M_,{isPanorama:!1},n))});function YY(){var e=Qe(),[t,n]=S.useState(null),a=de(T5);return S.useEffect(()=>{if(t!=null){var l=t.getBoundingClientRect(),o=l.width/t.offsetWidth;wt(o)&&o!==a&&e(h5(o))}},[t,e,a]),n}function D_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function GY(e){for(var t=1;t(Z7(),null);function Nf(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var QY=S.forwardRef((e,t)=>{var n,a,l=S.useRef(null),[o,c]=S.useState({containerWidth:Nf((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Nf((a=e.style)===null||a===void 0?void 0:a.height)}),f=S.useCallback((h,v)=>{c(p=>{var b=Math.round(h),x=Math.round(v);return p.containerWidth===b&&p.containerHeight===x?p:{containerWidth:b,containerHeight:x}})},[]),d=S.useCallback(h=>{if(typeof t=="function"&&t(h),h!=null&&typeof ResizeObserver<"u"){var{width:v,height:p}=h.getBoundingClientRect();f(v,p);var b=O=>{var{width:j,height:_}=O[0].contentRect;f(j,_)},x=new ResizeObserver(b);x.observe(h),l.current=x}},[t,f]);return S.useEffect(()=>()=>{var h=l.current;h?.disconnect()},[f]),S.createElement(S.Fragment,null,S.createElement(Ff,{width:o.containerWidth,height:o.containerHeight}),S.createElement("div",Ai({ref:d},e)))}),WY=S.forwardRef((e,t)=>{var{width:n,height:a}=e,[l,o]=S.useState({containerWidth:Nf(n),containerHeight:Nf(a)}),c=S.useCallback((d,h)=>{o(v=>{var p=Math.round(d),b=Math.round(h);return v.containerWidth===p&&v.containerHeight===b?v:{containerWidth:p,containerHeight:b}})},[]),f=S.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:h,height:v}=d.getBoundingClientRect();c(h,v)}},[t,c]);return S.createElement(S.Fragment,null,S.createElement(Ff,{width:l.containerWidth,height:l.containerHeight}),S.createElement("div",Ai({ref:f},e)))}),JY=S.forwardRef((e,t)=>{var{width:n,height:a}=e;return S.createElement(S.Fragment,null,S.createElement(Ff,{width:n,height:a}),S.createElement("div",Ai({ref:t},e)))}),eG=S.forwardRef((e,t)=>{var{width:n,height:a}=e;return Yr(n)||Yr(a)?S.createElement(WY,Ai({},e,{ref:t})):S.createElement(JY,Ai({},e,{ref:t}))});function tG(e){return e===!0?QY:eG}var nG=S.forwardRef((e,t)=>{var{children:n,className:a,height:l,onClick:o,onContextMenu:c,onDoubleClick:f,onMouseDown:d,onMouseEnter:h,onMouseLeave:v,onMouseMove:p,onMouseUp:b,onTouchEnd:x,onTouchMove:O,onTouchStart:j,style:_,width:E,responsive:N,dispatchTouchEvents:M=!0}=e,P=S.useRef(null),T=Qe(),[C,L]=S.useState(null),[Z,ne]=S.useState(null),q=YY(),U=ay(),B=U?.width>0?U.width:E,ue=U?.height>0?U.height:l,oe=S.useCallback(W=>{q(W),typeof t=="function"&&t(W),L(W),ne(W),W!=null&&(P.current=W)},[q,t,L,ne]),ve=S.useCallback(W=>{T(BM(W)),T(Hn({handler:o,reactEvent:W}))},[T,o]),K=S.useCallback(W=>{T(_0(W)),T(Hn({handler:h,reactEvent:W}))},[T,h]),ee=S.useCallback(W=>{T(MT()),T(Hn({handler:v,reactEvent:W}))},[T,v]),z=S.useCallback(W=>{T(_0(W)),T(Hn({handler:p,reactEvent:W}))},[T,p]),G=S.useCallback(()=>{T(VM())},[T]),re=S.useCallback(W=>{T(GM(W.key))},[T]),k=S.useCallback(W=>{T(Hn({handler:c,reactEvent:W}))},[T,c]),F=S.useCallback(W=>{T(Hn({handler:f,reactEvent:W}))},[T,f]),ie=S.useCallback(W=>{T(Hn({handler:d,reactEvent:W}))},[T,d]),le=S.useCallback(W=>{T(Hn({handler:b,reactEvent:W}))},[T,b]),ye=S.useCallback(W=>{T(Hn({handler:j,reactEvent:W}))},[T,j]),be=S.useCallback(W=>{M&&T(FM(W)),T(Hn({handler:O,reactEvent:W}))},[T,M,O]),he=S.useCallback(W=>{T(Hn({handler:x,reactEvent:W}))},[T,x]),ut=tG(N);return S.createElement(ZT.Provider,{value:C},S.createElement(lA.Provider,{value:Z},S.createElement(ut,{width:B??_?.width,height:ue??_?.height,className:Re("recharts-wrapper",a),style:GY({position:"relative",cursor:"default",width:B,height:ue},_),onClick:ve,onContextMenu:k,onDoubleClick:F,onFocus:G,onKeyDown:re,onMouseDown:ie,onMouseEnter:K,onMouseLeave:ee,onMouseMove:z,onMouseUp:le,onTouchEnd:he,onTouchMove:be,onTouchStart:ye,ref:oe},S.createElement(ZY,null),n)))}),rG=["width","height","responsive","children","className","style","compact","title","desc"];function aG(e,t){if(e==null)return{};var n,a,l=iG(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{width:n,height:a,responsive:l,children:o,className:c,style:f,compact:d,title:h,desc:v}=e,p=aG(e,rG),b=Gn(p);return d?S.createElement(S.Fragment,null,S.createElement(Ff,{width:n,height:a}),S.createElement(C_,{otherAttributes:b,title:h,desc:v},o)):S.createElement(nG,{className:c,style:f,width:n,height:a,responsive:l??!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},S.createElement(C_,{otherAttributes:b,title:h,desc:v,ref:t},S.createElement(wH,null,o)))});function A0(){return A0=Object.assign?Object.assign.bind():function(e){for(var t=1;tS.createElement(oG,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:sG,tooltipPayloadSearcher:QT,categoricalChartProps:e,ref:t}));function cG(e){var t=Qe();return S.useEffect(()=>{t(DY(e))},[t,e]),null}var fG=["layout"];function E0(){return E0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=At(e,xG);return S.createElement(vG,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:bG,tooltipPayloadSearcher:QT,categoricalChartProps:n,ref:t})});function wG(e){return e===0?"$0.00":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function jG(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function OG({earnings:e,loading:t,error:n}){const[a,l]=S.useState("earnings"),[o,c]=S.useState(null),f=(e?.models??[]).map(p=>({model:p.model,value:a==="earnings"?p.total_usd:p.tokens_in+p.tokens_out,usd:p.total_usd,tokens:p.tokens_in+p.tokens_out,priced:p.priced})).filter(p=>p.value>0).sort((p,b)=>b.value-p.value),d=nA(e?.models),h=f.reduce((p,b)=>p+b.value,0),v=(e?.models??[]).filter(p=>!p.priced).length;return t&&!e?g.jsx("div",{className:"h-64 animate-pulse rounded-xl bg-slate-800/50"}):g.jsxs("div",{className:"min-w-0 overflow-hidden rounded-xl border border-slate-800 bg-slate-900/60",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-slate-800 px-4 py-3",children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Share by model"}),g.jsx("div",{className:"flex gap-1",role:"group","aria-label":"Distribute by",children:["earnings","tokens"].map(p=>g.jsx("button",{type:"button",onClick:()=>l(p),"aria-pressed":a===p,className:`rounded-lg px-3 py-1.5 text-xs font-medium capitalize transition focus:outline-none focus:ring-2 focus:ring-blue-500 ${a===p?"bg-slate-700 text-white":"text-slate-400 hover:bg-slate-800 hover:text-slate-200"}`,children:p},p))})]}),n&&!e?g.jsxs("div",{className:"px-4 py-8",children:[g.jsx("p",{className:"text-sm font-medium text-amber-200",children:"Traffic mix is unavailable"}),g.jsx("p",{className:"mt-1 text-xs text-slate-300",children:n.message})]}):f.length===0?g.jsxs("p",{className:"px-4 py-8 text-sm text-slate-400",children:["No ",a==="earnings"?"priced earnings":"traffic"," recorded since the node started."]}):g.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4 sm:flex-row sm:items-center",children:[g.jsx("div",{className:"h-40 w-40 shrink-0 self-center",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsx(SG,{children:g.jsx(_M,{data:f,dataKey:"value",nameKey:"model",innerRadius:"55%",outerRadius:"100%",paddingAngle:1,stroke:"none",isAnimationActive:!1,onMouseEnter:(p,b)=>c(b),onMouseLeave:()=>c(null),children:f.map((p,b)=>g.jsx(yd,{fill:Pc(d,f[b]?.model??""),opacity:o===null||o===b?1:.35},b))})})})}),g.jsx("ul",{className:"min-w-0 flex-1 space-y-1",children:f.map((p,b)=>{const x=h>0?p.value/h*100:0;return g.jsxs("li",{onMouseEnter:()=>c(b),onMouseLeave:()=>c(null),className:`flex items-start gap-2 rounded px-1 py-0.5 text-xs transition ${o===b?"bg-slate-800":""}`,children:[g.jsx("span",{className:"mt-0.5 block h-2.5 w-2.5 shrink-0 rounded-sm",style:{background:Pc(d,p.model)}}),g.jsx("span",{className:"min-w-0 flex-1 break-all font-mono text-slate-300",children:p.model}),g.jsxs("span",{className:"shrink-0 tabular-nums text-slate-300",children:[x.toFixed(1),"%"]}),g.jsx("span",{className:"w-20 shrink-0 text-right tabular-nums text-slate-400",children:a==="earnings"?wG(p.usd):jG(p.tokens)})]},p.model)})})]}),g.jsxs("p",{className:"flex items-start gap-2 border-t border-slate-800 px-4 py-3 text-xs text-slate-300",children:[g.jsx(Tf,{"aria-hidden":"true",size:14,className:"mt-px shrink-0"}),g.jsxs("span",{children:["Share of traffic served since this node last started — its counters reset on restart, so this is the recent mix rather than an all-time split. Probes are excluded.",v>0&&a==="earnings"&&` ${v} model(s) had no rate available and are absent from the earnings split; switch to tokens to see them.`]})]})]})}const z_={green:"text-green-400",red:"text-red-400",yellow:"text-yellow-400",blue:"text-blue-400",gray:"text-gray-400"};function Xu({title:e,value:t,subtitle:n,icon:a,color:l="blue"}){return g.jsxs("div",{className:"min-w-0 rounded-xl border border-slate-700 bg-slate-900 p-3 sm:p-4",children:[g.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[g.jsx("span",{className:"truncate text-xs text-slate-300 sm:text-sm",children:e}),a&&g.jsx("span",{"aria-hidden":"true",className:z_[l],children:a})]}),g.jsx("div",{className:`truncate text-lg font-bold sm:text-2xl ${z_[l]}`,title:String(t),children:t}),n&&g.jsx("div",{className:"mt-1 truncate text-[11px] text-slate-400 sm:text-xs",title:n,children:n})]})}function _G(e){return e===0?"$0.00":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function AG(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toFixed(0)}function EG({metrics:e,loading:t,error:n,earnings:a,earningsError:l,earningsLoading:o}){if(t)return g.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 md:gap-4 xl:grid-cols-5",children:[...Array(5)].map((x,O)=>g.jsxs("div",{className:"animate-pulse rounded-xl border border-slate-700 bg-slate-900 p-3 sm:p-4",children:[g.jsx("div",{className:"h-4 bg-slate-700 rounded w-20 mb-2"}),g.jsx("div",{className:"h-8 bg-slate-700 rounded w-16"})]},O))});const c=!!(e&&e.total_requests>0),f=c&&e?(e.successful_requests/e.total_requests*100).toFixed(1):null,d=!!a?.platform?.unavailable,h=!!l||!a&&!o||d,v=h?null:a?.platform?.uptime_7d_percent,p=v==null?"gray":v>=99?"green":v>=95?"yellow":"red",b=f==null?"gray":parseFloat(f)>=99?"green":parseFloat(f)>=95?"yellow":"red";return g.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 md:gap-4 xl:grid-cols-5",children:[g.jsx(Xu,{title:"7-day uptime",value:v==null?"--":`${v.toFixed(2)}%`,subtitle:o&&!a?"Loading platform data":h?"Platform data unavailable":"reported by Swan Inference",icon:g.jsx(Q_,{"aria-hidden":"true",size:20}),color:p}),g.jsx(Xu,{title:"Session success",value:f==null?"--":`${f}%`,subtitle:e?c?`${e.failed_requests} failed of ${AG(e.total_requests)}`:"No requests served yet":n?"Metrics API unavailable":"No data",icon:g.jsx(X_,{"aria-hidden":"true",size:20}),color:b}),g.jsx(Xu,{title:"P95 latency",value:e&&c?`${e.p95_latency_ms.toFixed(0)}ms`:"--",subtitle:e?c?`Average ${e.avg_latency_ms.toFixed(0)}ms · no SLA applied`:"No requests served yet":n?"Metrics API unavailable":"No data",icon:g.jsx(T0,{"aria-hidden":"true",size:20}),color:"blue"}),g.jsx(Xu,{title:"Request rate",value:e?`${e.requests_per_minute.toFixed(1)}/min`:"--",subtitle:e?`${e.active_requests} active now`:n?"Metrics API unavailable":"No data",icon:g.jsx(M0,{"aria-hidden":"true",size:20}),color:"blue"}),g.jsx(Xu,{title:"Lifetime earned",value:h||!a?"--":_G(a.platform.total_usd),subtitle:o&&!a?"Loading platform data":h?"Platform data unavailable":"authoritative platform total",icon:g.jsx(fD,{"aria-hidden":"true",size:20}),color:h?"gray":"green"})]})}function R_({value:e,max:t,color:n,label:a}){const l=t>0?e/t*100:0;return g.jsx("div",{className:"h-2 w-full rounded-full bg-slate-700",role:"progressbar","aria-label":a,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(Math.min(l,100)),children:g.jsx("div",{className:`h-2 rounded-full ${n}`,style:{width:`${Math.min(l,100)}%`}})})}function NG({gpus:e,loading:t,error:n}){if(t)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"GPU Status"}),g.jsx("div",{className:"animate-pulse space-y-4",children:g.jsx("div",{className:"h-20 bg-slate-700 rounded"})})]});if(!e||e.length===0)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"GPU Status"}),g.jsx("p",{className:"text-slate-400",children:n?"API unreachable":"No GPUs detected"})]});const a=Math.max(...e.map(o=>o.temperature_c)),l=e.filter(o=>o.utilization_percent>5).length;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"flex items-center justify-between mb-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"GPU capacity"}),g.jsxs("p",{className:"mt-0.5 text-xs text-slate-400",children:[l," active · peak ",a,"°C"]})]}),g.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-300",children:[g.jsx(hD,{"aria-hidden":"true",size:16}),g.jsxs("span",{children:[e.length," GPU",e.length>1?"s":""]})]})]}),g.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:e.map(o=>g.jsxs("div",{className:"border border-slate-700 rounded-lg p-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-slate-200",title:o.name,children:o.name}),g.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[g.jsx(ID,{"aria-hidden":"true",size:14,className:o.temperature_c>=90?"text-red-300":o.temperature_c>=85?"text-amber-300":"text-slate-300"}),g.jsxs("span",{className:o.temperature_c>=90?"text-red-300":o.temperature_c>=85?"text-amber-300":"text-slate-300",children:[o.temperature_c,"°C"]})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 flex justify-between text-xs text-slate-300",children:[g.jsx("span",{children:"Utilization"}),g.jsxs("span",{children:[o.utilization_percent.toFixed(0),"%"]})]}),g.jsx(R_,{value:o.utilization_percent,max:100,color:"bg-blue-500",label:`${o.name} utilization`})]}),o.memory_total_mb>0&&g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 flex justify-between text-xs text-slate-300",children:[g.jsx("span",{children:"Memory"}),g.jsxs("span",{children:[(o.memory_used_mb/1024).toFixed(1)," / ",(o.memory_total_mb/1024).toFixed(1)," GB"]})]}),g.jsx(R_,{value:o.memory_used_mb,max:o.memory_total_mb,color:o.memory_used_mb/o.memory_total_mb>=.98?"bg-red-500":o.memory_used_mb/o.memory_total_mb>=.95?"bg-amber-400":"bg-blue-500",label:`${o.name} memory allocation`})]})]})]},o.index))})]})}const L_={healthy:"bg-emerald-400",degraded:"bg-amber-400",unhealthy:"bg-red-500",unknown:"bg-slate-600"};function TG({samples:e}){if(!e||e.length===0)return null;const t=e.slice(-40),n=t.reduce((l,o)=>(l[o]=(l[o]??0)+1,l),{}),a=Object.entries(n).map(([l,o])=>`${o} ${l}`).join(", ");return g.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[g.jsx("div",{className:"flex gap-px",role:"img","aria-label":`Recent health: ${a}`,children:t.map((l,o)=>g.jsx("span",{title:l,className:`block h-3 w-1 rounded-sm ${L_[l]??L_.unknown}`},o))}),g.jsx("span",{className:"text-[10px] text-slate-400",children:"recent"})]})}const $_=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4});function MG({models:e,healthLog:t,prices:n,loading:a,error:l,onRefresh:o,onModelClick:c,authenticated:f,onUnlock:d,summary:h,compact:v=!1}){const[p,b]=S.useState(null),[x,O]=S.useState(""),[j,_]=S.useState(!1),E=()=>f?!0:(d(),!1),N=async U=>{if(E()){b(U.id),O("");try{U.enabled?await Ze.disableModel(U.id):await Ze.enableModel(U.id),o()}catch(B){O(B instanceof Error?B.message:"Failed to update model")}finally{b(null)}}},M=async U=>{if(E()){b(`health-${U}`),O("");try{await Ze.forceHealthCheck(U),o()}catch(B){O(B instanceof Error?B.message:"Failed to run health check")}finally{b(null)}}},P=async()=>{if(E()){b("reload"),O("");try{await Ze.reloadModels(),o()}catch(U){O(U instanceof Error?U.message:"Failed to reload models")}finally{b(null)}}};if(a)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"Models"}),g.jsx("div",{className:"animate-pulse space-y-3",children:[...Array(2)].map((U,B)=>g.jsx("div",{className:"h-16 bg-slate-700 rounded"},B))})]});const T=U=>U.health_string==="healthy",C=e.filter(U=>!U.enabled||!T(U)),L=v&&!j?C:e,Z=h?.ready??e.filter(U=>U.enabled&&T(U)).length,ne=h?.unhealthy??e.filter(U=>U.enabled&&!T(U)).length,q=h?.disabled??e.filter(U=>!U.enabled).length;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Models"}),g.jsxs("p",{className:"mt-0.5 text-xs text-slate-400",children:[Z," ready",ne>0&&` · ${ne} unhealthy`,q>0&&` · ${q} disabled`]})]}),g.jsxs("button",{type:"button",onClick:P,disabled:p==="reload",className:"flex min-h-10 items-center gap-1.5 rounded-lg border border-slate-600 bg-slate-800 px-3 text-sm transition-colors hover:bg-slate-700 disabled:opacity-50",children:[f?g.jsx(D0,{"aria-hidden":"true",size:14,className:p==="reload"?"animate-spin":""}):g.jsx(C0,{"aria-hidden":"true",size:14}),"Reload Config"]})]}),x&&g.jsx("p",{role:"alert",className:"mb-3 rounded-lg border border-red-800/60 bg-red-950/30 px-3 py-2 text-sm text-red-300",children:x}),!e||e.length===0?g.jsx("p",{className:"text-slate-400",children:l?"API unreachable":"No models configured"}):v&&!j&&C.length===0?g.jsxs("div",{className:"rounded-lg border border-emerald-900/60 bg-emerald-950/20 px-4 py-5 text-center",children:[g.jsx(wl,{"aria-hidden":"true",size:24,className:"mx-auto text-emerald-300"}),g.jsx("p",{className:"mt-2 text-sm font-medium text-emerald-100",children:"All configured models are ready"}),g.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Healthy models are collapsed to keep operational exceptions visible."})]}):g.jsx("div",{className:"space-y-3",children:L.map(U=>{const B=n[U.id];return g.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border border-slate-600 bg-slate-700/50 p-3 transition-colors hover:border-slate-500 sm:items-center",children:[g.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-start gap-3 rounded text-left focus:outline-none focus:ring-2 focus:ring-blue-500 sm:items-center",onClick:()=>c?.(U.id),"aria-label":`View details for ${U.id}`,children:[g.jsx("div",{className:"flex-shrink-0",children:U.enabled?T(U)?g.jsx(wl,{size:20,className:"text-green-400"}):g.jsx(Pa,{size:20,className:"text-red-400"}):g.jsx(Tf,{size:20,className:"text-slate-400"})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"break-words font-medium text-slate-200",children:U.id}),g.jsxs("div",{className:"mt-0.5 break-all text-xs text-slate-400",children:[U.endpoint," • ",U.category,U.gpu_memory>0&&` • ${(U.gpu_memory/1024).toFixed(1)}GB VRAM`]}),g.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[U.state_string," • ",U.health_string]}),g.jsx(TG,{samples:t?.[U.id]??[]}),B&&g.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[g.jsx("span",{className:"font-medium text-emerald-300",children:"Provider payout / 1M"}),g.jsxs("span",{className:"text-blue-200",children:["In ",$_.format(B.provider_input_price)]}),g.jsxs("span",{className:"text-violet-200",children:["Out ",$_.format(B.provider_output_price)]})]})]})]}),g.jsxs("div",{className:"flex flex-shrink-0 items-center gap-1 sm:gap-2",children:[g.jsx("button",{type:"button",onClick:()=>M(U.id),disabled:p===`health-${U.id}`||!U.enabled,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-slate-600 rounded transition-colors disabled:opacity-50",title:"Force health check","aria-label":`Run health check for ${U.id}`,children:g.jsx(Pl,{size:16,className:p===`health-${U.id}`?"animate-spin":""})}),g.jsx("button",{type:"button",onClick:()=>N(U),disabled:p===U.id,className:`p-2 rounded transition-colors ${U.enabled?"text-green-400 hover:text-green-300 hover:bg-green-900/30":"text-slate-400 hover:text-slate-300 hover:bg-slate-600"} disabled:opacity-50`,title:U.enabled?"Disable model":"Enable model","aria-label":`${U.enabled?"Disable":"Enable"} ${U.id}`,children:g.jsx(AD,{size:16})})]})]},U.id)})}),v&&e.length>0&&g.jsxs("button",{type:"button",onClick:()=>_(U=>!U),className:"mt-4 inline-flex min-h-10 w-full items-center justify-center gap-2 rounded-lg border border-slate-700 bg-slate-950/40 px-3 text-sm text-slate-200 transition hover:border-slate-600 hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-expanded":j,children:[j?g.jsx(Ep,{"aria-hidden":"true",size:16}):g.jsx(kc,{"aria-hidden":"true",size:16}),j?"Hide healthy models":`Show all ${e.length} models`]})]})}function CG({data:e,loading:t,error:n,onOpenSettings:a}){if(t)return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsx("h3",{className:"mb-4 text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("div",{className:"h-28 animate-pulse rounded-lg bg-slate-800"})]});if(!e)return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsx("h3",{className:"mb-4 text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("p",{className:"text-sm text-slate-400",children:n?"API unreachable":"No control data available"})]});const{rate_limiter:l,concurrency_limiter:o,retry_policy:c}=e;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("p",{className:"mt-0.5 text-xs text-slate-400",children:"Current admission and retry state"})]}),g.jsx("button",{type:"button",onClick:a,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded-lg text-slate-400 transition hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Open request limit settings",children:g.jsx($D,{"aria-hidden":"true",size:18})})]}),g.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-3",children:[g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(M0,{"aria-hidden":"true",size:14,className:"text-blue-400"}),g.jsx("span",{children:"Rate limit"})]}),g.jsxs("div",{className:"mt-2 text-lg font-semibold text-white",children:[l.current_rate.toFixed(0)," ",g.jsx("span",{className:"text-xs font-normal text-slate-400",children:"req/s"})]}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[l.total_throttled," throttled · burst ",l.burst_size]})]}),g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(yD,{"aria-hidden":"true",size:14,className:"text-emerald-400"}),g.jsx("span",{children:"Concurrency"})]}),g.jsxs("div",{className:"mt-2 text-lg font-semibold text-white",children:[o.global_active,g.jsxs("span",{className:"text-slate-400",children:["/",o.global_max]})]}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:["active slots · ",o.total_rejected," rejected"]})]}),g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(D0,{"aria-hidden":"true",size:14,className:"text-amber-300"}),g.jsx("span",{children:"Retry recovery"})]}),g.jsx("div",{className:"mt-2 text-lg font-semibold text-white",children:c.total_retries>0?`${(c.retry_success_rate*100).toFixed(0)}%`:"—"}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[c.total_successes," recovered · ",c.total_failures," failed"]})]})]})]})}function DG(e){return e?`Updated ${e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"})}`:""}function kG({status:e,loading:t,error:n,lastUpdated:a}){return t?g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg bg-slate-700/50 px-3 py-2",children:[g.jsx("div",{className:"w-3 h-3 bg-slate-600 rounded-full animate-pulse"}),g.jsx("span",{className:"text-sm text-slate-300",children:"Connecting…"})]}):!e&&n?g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg border border-amber-800 bg-amber-900/20 px-3 py-2",children:[g.jsx(Np,{"aria-hidden":"true",size:16,className:"text-amber-300"}),g.jsx("span",{className:"text-sm text-amber-200",children:"API unavailable"})]}):e?g.jsxs("div",{title:n?.message,className:`flex min-h-10 items-center gap-2 rounded-lg border px-2.5 py-2 sm:gap-3 sm:px-3 ${n?"border-amber-800 bg-amber-900/20":e.connected?"border-green-800 bg-green-900/20":"border-red-800 bg-red-900/20"}`,children:[g.jsx("div",{className:"flex items-center gap-2",children:n?g.jsxs(g.Fragment,{children:[g.jsx(Np,{"aria-hidden":"true",size:16,className:"text-amber-300"}),g.jsx("span",{className:"text-sm font-medium text-amber-200",children:"Stale"})]}):e.connected?g.jsxs(g.Fragment,{children:[g.jsx(XD,{"aria-hidden":"true",size:16,className:"text-green-400"}),g.jsx("span",{className:"text-sm font-medium text-green-300",children:"Connected"})]}):g.jsxs(g.Fragment,{children:[g.jsx(HS,{"aria-hidden":"true",size:16,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-red-300",children:"Disconnected"})]})}),!n&&g.jsxs("div",{className:"ml-auto hidden text-xs text-slate-300 md:block",children:[DG(a),e.active_models?.length>0&&` · ${e.active_models.length} model${e.active_models.length>1?"s":""}`]})]}):g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg bg-slate-700/50 px-3 py-2",children:[g.jsx(HS,{"aria-hidden":"true",size:16,className:"text-slate-300"}),g.jsx("span",{className:"text-sm text-slate-300",children:"No data"})]})}function N0(e,t=!1){if(!e)return"—";const n=new Date(e);return t?n.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"}):n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"})}function U_(e){return e<1e3?`${e.toFixed(0)} ms`:`${(e/1e3).toFixed(2)} s`}function q_(e){return e>5e3?"text-red-300":e>2e3?"text-amber-300":"text-emerald-300"}const lo={hub:{label:"Hub",title:"Routed to this node by Swan Inference",className:"bg-blue-500/10 text-blue-300 ring-blue-500/30"},health:{label:"Health",title:"This node's own engine probe: a one-token completion checking the backend can serve",className:"bg-slate-500/10 text-slate-400 ring-slate-500/30"},selfcheck:{label:"Self-check",title:"This node's periodic audit probe",className:"bg-slate-500/10 text-slate-400 ring-slate-500/30"}},B_=[25,50,100];function I_({source:e}){const t=lo[e??"hub"]??lo.hub;return g.jsx("span",{title:t.title,className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset ${t.className}`,children:t.label})}function H_({success:e}){return e?g.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-emerald-800/70 bg-emerald-950/40 px-2 py-1 text-xs font-medium text-emerald-300",children:[g.jsx(wl,{"aria-hidden":"true",size:13})," Success"]}):g.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-red-800/70 bg-red-950/40 px-2 py-1 text-xs font-medium text-red-300",children:[g.jsx(Pa,{"aria-hidden":"true",size:13})," Failed"]})}function K_({request:e}){return g.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Request ID"}),g.jsx("span",{className:"mt-1 block break-all font-mono text-slate-300",children:e.request_id})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Completed"}),g.jsx("span",{className:"mt-1 block text-slate-300",children:N0(e.end_time,!0)})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Total tokens"}),g.jsx("span",{className:"mt-1 block font-mono text-slate-300",children:(e.tokens_in+e.tokens_out).toLocaleString()})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Delivery"}),g.jsx("span",{className:"mt-1 block text-slate-300",children:e.streaming?"Streaming":"Single response"})]}),e.error_reason&&g.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[g.jsx("span",{className:"block text-slate-400",children:"Error"}),g.jsx("span",{className:"mt-1 block break-words text-red-300",children:e.error_reason})]})]})}function PG({models:e}){const[t,n]=S.useState(""),[a,l]=S.useState(""),[o,c]=S.useState(B_[0]),[f,d]=S.useState(0),[h,v]=S.useState(null),p=q=>{q(),d(0),v(null)},{data:b,error:x,loading:O,refetch:j}=Da(S.useCallback(()=>Ze.getRequestHistory({limit:o,offset:f*o,model:t||void 0,source:a||void 0}),[o,f,t,a]),f===0?1e4:0),_=b?.requests??[],E=b?.total??0,N=_.reduce((q,U)=>q+U.tokens_in,0),M=_.reduce((q,U)=>q+U.tokens_out,0),P=q=>v(U=>U===q?null:q),T=Math.max(1,Math.ceil(E/o)),C=E===0?0:f*o+1,L=f*o+_.length,Z=f>0,ne=Lp(()=>n(q.target.value)),className:"min-h-10 min-w-0 flex-1 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 sm:min-w-56",children:[g.jsx("option",{value:"",children:"All models"}),e.map(q=>g.jsx("option",{value:q.id,children:q.id},q.id))]}),g.jsx("label",{htmlFor:"transaction-source-filter",className:"sr-only",children:"Filter requests by source"}),g.jsxs("select",{id:"transaction-source-filter",value:a,onChange:q=>p(()=>l(q.target.value)),className:"min-h-10 min-w-0 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",children:[g.jsx("option",{value:"",children:"All sources"}),Object.entries(lo).map(([q,U])=>g.jsx("option",{value:q,children:U.label},q))]}),g.jsx("button",{type:"button",onClick:j,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Refresh requests",children:g.jsx(Pl,{"aria-hidden":"true",size:16,className:O?"animate-spin":""})})]})]}),g.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[g.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-900 p-3 sm:p-4",children:[g.jsx("p",{className:"text-xs text-slate-400",children:"Matching"}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:E.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:t||a?"requests match the filters":"requests in history"})]}),g.jsxs("div",{className:"rounded-xl border border-blue-900/70 bg-blue-950/20 p-3 sm:p-4",children:[g.jsxs("p",{className:"flex items-center gap-1 text-xs text-blue-300",children:[g.jsx(Hm,{"aria-hidden":"true",size:13})," Input tokens"]}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:N.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:"across rows shown"})]}),g.jsxs("div",{className:"rounded-xl border border-violet-900/70 bg-violet-950/20 p-3 sm:p-4",children:[g.jsxs("p",{className:"flex items-center gap-1 text-xs text-violet-300",children:[g.jsx(Km,{"aria-hidden":"true",size:13})," Output tokens"]}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:M.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:"across rows shown"})]})]}),g.jsx("div",{className:"overflow-hidden rounded-xl border border-slate-800 bg-slate-900",children:O&&_.length===0?g.jsx("div",{className:"animate-pulse space-y-3 p-4",role:"status","aria-label":"Loading transactions",children:[...Array(6)].map((q,U)=>g.jsx("div",{className:"h-14 rounded-lg bg-slate-800"},U))}):x&&_.length===0?g.jsxs("div",{className:"px-4 py-12 text-center",children:[g.jsx(Pa,{"aria-hidden":"true",size:32,className:"mx-auto mb-3 text-red-400"}),g.jsx("p",{className:"font-medium text-red-200",children:"Requests are unavailable"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:x.message}),g.jsx("button",{type:"button",onClick:j,className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white",children:"Try again"})]}):_.length===0?g.jsxs("div",{className:"px-4 py-12 text-center text-slate-400",children:[g.jsx(T0,{"aria-hidden":"true",size:32,className:"mx-auto mb-3 text-slate-600"}),t||a?g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"font-medium text-slate-300",children:"No requests match these filters"}),g.jsxs("p",{className:"mt-1 text-sm",children:["Nothing recorded for ",a?`${lo[a].label.toLowerCase()} traffic`:"this source",t?` on ${t}`:""," yet."]}),g.jsx("button",{type:"button",onClick:()=>p(()=>{n(""),l("")}),className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-500",children:"Clear filters"})]}):g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"font-medium text-slate-300",children:"No requests yet"}),g.jsx("p",{className:"mt-1 text-sm",children:"Requests will appear here after the provider serves inference."})]})]}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"hidden overflow-x-auto md:block",children:g.jsxs("table",{className:"w-full min-w-[840px] text-sm",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"border-b border-slate-800 bg-slate-950/40 text-xs uppercase tracking-wide text-slate-400",children:[g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Started"}),g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Model"}),g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Source"}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Latency"}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx(Hm,{"aria-hidden":"true",size:13})," Input tokens"]})}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx(Km,{"aria-hidden":"true",size:13})," Output tokens"]})}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Status"}),g.jsx("th",{className:"w-12 px-3 py-3",children:g.jsx("span",{className:"sr-only",children:"Details"})})]})}),g.jsx("tbody",{children:_.map(q=>{const U=h===q.request_id;return g.jsxs(S.Fragment,{children:[g.jsxs("tr",{className:`border-b border-slate-800/80 ${q.success?"hover:bg-slate-800/35":"bg-red-950/10 hover:bg-red-950/20"}`,children:[g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-slate-300",title:new Date(q.start_time).toLocaleString(),children:N0(q.start_time)}),g.jsxs("td",{className:"max-w-xs px-4 py-3",children:[g.jsx("span",{className:"block truncate font-mono text-xs text-slate-200",title:q.model,children:q.model}),q.streaming&&g.jsx("span",{className:"mt-0.5 block text-xs text-blue-300",children:"Streaming"})]}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3",children:g.jsx(I_,{source:q.source})}),g.jsx("td",{className:`whitespace-nowrap px-4 py-3 text-right font-mono text-xs ${q_(q.latency_ms)}`,children:U_(q.latency_ms)}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-right font-mono text-sm text-blue-200",children:q.tokens_in.toLocaleString()}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-right font-mono text-sm text-violet-200",children:q.tokens_out.toLocaleString()}),g.jsx("td",{className:"px-4 py-3 text-right",children:g.jsx(H_,{success:q.success})}),g.jsx("td",{className:"px-3 py-3 text-right",children:g.jsx("button",{type:"button",onClick:()=>P(q.request_id),"aria-expanded":U,"aria-controls":`receipt-${q.request_id}`,className:"rounded-lg p-2 text-slate-400 hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":`${U?"Hide":"Show"} details for request ${q.request_id}`,children:U?g.jsx(Ep,{"aria-hidden":"true",size:16}):g.jsx(kc,{"aria-hidden":"true",size:16})})})]}),U&&g.jsx("tr",{id:`receipt-${q.request_id}`,className:"border-b border-slate-800 bg-slate-950/60",children:g.jsx("td",{colSpan:8,className:"px-4 py-4",children:g.jsx(K_,{request:q})})})]},q.request_id)})})]})}),g.jsx("div",{className:"divide-y divide-slate-800 md:hidden",children:_.map(q=>{const U=h===q.request_id;return g.jsxs("article",{className:q.success?"":"bg-red-950/10",children:[g.jsxs("button",{type:"button",onClick:()=>P(q.request_id),"aria-expanded":U,"aria-controls":`mobile-receipt-${q.request_id}`,className:"w-full p-4 text-left focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:"truncate font-mono text-sm text-white",children:q.model}),g.jsxs("p",{className:"mt-1 text-xs text-slate-400",children:[N0(q.start_time,!0),q.streaming?" · Streaming":""]})]}),g.jsxs("span",{className:"mt-0.5 flex shrink-0 items-center gap-2 text-slate-400",children:[g.jsx(I_,{source:q.source}),U?g.jsx(Ep,{"aria-hidden":"true",size:18}):g.jsx(kc,{"aria-hidden":"true",size:18})]})]}),g.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-2",children:[g.jsxs("div",{children:[g.jsx("span",{className:"block text-[11px] text-slate-400",children:"Latency"}),g.jsx("span",{className:`mt-0.5 block font-mono text-xs ${q_(q.latency_ms)}`,children:U_(q.latency_ms)})]}),g.jsxs("div",{children:[g.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-blue-300",children:[g.jsx(Hm,{"aria-hidden":"true",size:11})," Input"]}),g.jsx("span",{className:"mt-0.5 block font-mono text-sm text-blue-100",children:q.tokens_in.toLocaleString()})]}),g.jsxs("div",{children:[g.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-violet-300",children:[g.jsx(Km,{"aria-hidden":"true",size:11})," Output"]}),g.jsx("span",{className:"mt-0.5 block font-mono text-sm text-violet-100",children:q.tokens_out.toLocaleString()})]})]}),g.jsx("div",{className:"mt-3",children:g.jsx(H_,{success:q.success})})]}),U&&g.jsx("div",{id:`mobile-receipt-${q.request_id}`,className:"border-t border-slate-800 bg-slate-950/60 p-4",children:g.jsx(K_,{request:q})})]},q.request_id)})})]})}),g.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[g.jsxs("p",{className:"text-xs text-slate-400","aria-live":"polite",children:[E===0?"No requests to show.":`Showing ${C.toLocaleString()}–${L.toLocaleString()} of ${E.toLocaleString()}`,t?` for ${t}`:"",a?` from ${lo[a].label.toLowerCase()}`:"",". ",f===0?"Auto-refreshes every 10 seconds.":"Auto-refresh is paused while viewing older pages."]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("label",{htmlFor:"transaction-page-size",className:"text-xs text-slate-400",children:"Per page"}),g.jsx("select",{id:"transaction-page-size",value:o,onChange:q=>p(()=>c(Number(q.target.value))),className:"min-h-9 rounded-lg border border-slate-700 bg-slate-900 px-2 text-xs text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",children:B_.map(q=>g.jsx("option",{value:q,children:q},q))}),g.jsxs("div",{className:"ml-1 flex items-center gap-1",children:[g.jsx("button",{type:"button",onClick:()=>{d(q=>Math.max(0,q-1)),v(null)},disabled:!Z,className:"inline-flex min-h-9 min-w-9 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-40 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Previous page",children:g.jsx(W4,{"aria-hidden":"true",size:16})}),g.jsxs("span",{className:"px-2 text-xs tabular-nums text-slate-400",children:[f+1," / ",T]}),g.jsx("button",{type:"button",onClick:()=>{d(q=>q+1),v(null)},disabled:!ne,className:"inline-flex min-h-9 min-w-9 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-40 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Next page",children:g.jsx(eD,{"aria-hidden":"true",size:16})})]})]})]})]})}const Ap={"1h":{duration:"1h",resolution:"1m",label:"1 Hour"},"6h":{duration:"6h",resolution:"5m",label:"6 Hours"},"24h":{duration:"24h",resolution:"15m",label:"24 Hours"},"7d":{duration:"168h",resolution:"1h",label:"7 Days"}};function zG(){const[e,t]=S.useState("1h"),n=Ap[e],{data:a,error:l,loading:o,refetch:c}=Da(S.useCallback(()=>Ze.getMetricsHistory(n.duration,n.resolution),[n.duration,n.resolution]),6e4),f=a?.data??[],d=N=>{const M=new Date(N);return e==="7d"?M.toLocaleDateString(void 0,{weekday:"short",day:"numeric"}):e==="24h"?M.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):M.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})},h=f.map(N=>({time:d(N.timestamp),requests:N.total_requests,successRate:N.success_rate,avgLatency:N.avg_latency_ms,p99Latency:N.p99_latency_ms,tokensPerSec:N.tokens_per_second})),v=h[h.length-1],p=h.flatMap(N=>[N.avgLatency,N.p99Latency]),b=p.length>0?Math.min(...p):0,x=p.length>0?Math.max(...p):0,O=h.length>0?Math.min(...h.map(N=>N.successRate)):0,j=h.length>0?Math.max(...h.map(N=>N.successRate)):0,_=h.length>0?Math.min(...h.map(N=>N.tokensPerSec)):0,E=h.length>0?Math.max(...h.map(N=>N.tokensPerSec)):0;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(IS,{size:20,className:"text-purple-400"}),g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Performance trends"}),g.jsx("p",{className:"mt-0.5 text-xs text-slate-400",children:"Persisted service signals across one shared time range"})]})]}),g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("div",{className:"flex min-w-0 flex-1 overflow-x-auto rounded-lg bg-slate-800 p-0.5 sm:flex-none",children:Object.keys(Ap).map(N=>g.jsx("button",{onClick:()=>t(N),className:`min-h-10 flex-1 whitespace-nowrap rounded px-2 py-1 text-xs font-medium transition-colors sm:flex-none sm:px-3 ${e===N?"bg-blue-600 text-white":"text-slate-400 hover:text-slate-200"}`,children:Ap[N].label},N))}),g.jsx("button",{type:"button",onClick:c,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded text-slate-300 transition-colors hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500",title:"Refresh","aria-label":"Refresh performance trends",children:g.jsx(Pl,{size:16,className:o?"animate-spin":""})})]})]}),l&&g.jsxs("div",{role:"alert",className:"mb-4 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-800/70 bg-amber-950/30 px-3 py-2 text-sm text-amber-100",children:[g.jsx("span",{children:a?"Showing the last loaded trends; refresh failed.":`Performance trends are unavailable: ${l.message}`}),g.jsx("button",{type:"button",onClick:c,className:"min-h-10 rounded-lg border border-amber-700/70 px-3 text-sm hover:bg-amber-900/30",children:"Try again"})]}),o&&h.length===0?g.jsx("div",{className:"h-64 flex items-center justify-center",children:g.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full"})}):h.length<2?g.jsx("div",{className:"h-64 flex items-center justify-center text-slate-400",children:g.jsxs("div",{className:"text-center",children:[g.jsx(IS,{size:32,className:"mx-auto mb-2 opacity-50"}),g.jsx("p",{children:"Not enough historical data yet"}),g.jsx("p",{className:"text-xs mt-1",children:"Data is recorded every minute"})]})}):g.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[g.jsxs("div",{role:"img","aria-label":`Latency ranged from ${b.toFixed(0)} to ${x.toFixed(0)} milliseconds. Latest average ${v?.avgLatency.toFixed(0)} milliseconds and P99 ${v?.p99Latency.toFixed(0)} milliseconds.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Latency (ms)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:N=>[(typeof N=="number"?N.toFixed(1):N)+"ms",""]}),g.jsx(UE,{wrapperStyle:{fontSize:"10px"},formatter:N=>g.jsx("span",{className:"text-slate-400",children:N})}),g.jsx(Sl,{type:"monotone",dataKey:"avgLatency",stroke:"#3b82f6",strokeWidth:2,dot:!1,name:"Avg"}),g.jsx(Sl,{type:"monotone",dataKey:"p99Latency",stroke:"#ef4444",strokeWidth:1.5,dot:!1,name:"P99"})]})})})]}),g.jsxs("div",{role:"img","aria-label":`Success rate ranged from ${O.toFixed(1)} to ${j.toFixed(1)} percent. Latest ${v?.successRate.toFixed(1)} percent.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Success rate (%)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1,domain:[0,100]}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:N=>[(typeof N=="number"?N.toFixed(1):N)+"%","Success Rate"]}),g.jsx(Sl,{type:"monotone",dataKey:"successRate",stroke:"#22c55e",strokeWidth:2,dot:!1,name:"Success Rate"})]})})})]}),g.jsxs("div",{role:"img","aria-label":`Throughput ranged from ${_.toFixed(1)} to ${E.toFixed(1)} tokens per second. Latest ${v?.tokensPerSec.toFixed(1)} tokens per second.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Throughput (tokens/sec)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:N=>[typeof N=="number"?N.toFixed(1):N,"Tokens/sec"]}),g.jsx(Sl,{type:"monotone",dataKey:"tokensPerSec",stroke:"#a855f7",strokeWidth:2,dot:!1,name:"Tokens/sec"})]})})})]})]}),g.jsxs("div",{className:"mt-4 text-center text-xs text-slate-400",children:["Showing ",n.label," of data (",n.resolution," resolution)"]})]})}function RG({modelId:e,onClose:t}){const[n,a]=S.useState(null),[l,o]=S.useState(!0),[c,f]=S.useState(null),d=S.useRef(null),h=S.useRef(null),v=S.useRef(null);S.useEffect(()=>{v.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const N=document.body.style.overflow;document.body.style.overflow="hidden",window.setTimeout(()=>h.current?.focus(),0);const M=P=>{if(P.key==="Escape"){P.preventDefault(),t();return}if(P.key!=="Tab"||!d.current)return;const T=Array.from(d.current.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')),C=T[0],L=T[T.length-1];!C||!L||(P.shiftKey&&document.activeElement===C?(P.preventDefault(),L.focus()):!P.shiftKey&&document.activeElement===L&&(P.preventDefault(),C.focus()))};return window.addEventListener("keydown",M),()=>{window.removeEventListener("keydown",M),document.body.style.overflow=N,v.current?.focus()}},[t]),S.useEffect(()=>{const N=async()=>{o(!0),f(null);try{const P=await Ze.getModelMetrics(e);a(P)}catch(P){f(P instanceof Error?P.message:"Failed to load model metrics")}finally{o(!1)}};N();const M=setInterval(N,5e3);return()=>clearInterval(M)},[e]);const p=N=>N?new Date(N).toLocaleTimeString():"-",b=N=>N<1e3?`${N.toFixed(0)}ms`:`${(N/1e3).toFixed(2)}s`,x=N=>N<1e3?N.toLocaleString():N<1e6?`${(N/1e3).toFixed(1)}K`:`${(N/1e6).toFixed(1)}M`,O=N=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(N),j=n?.price?((n.metrics?.total_tokens_in??0)*n.price.provider_input_price+(n.metrics?.total_tokens_out??0)*n.price.provider_output_price)/1e6:null,_=n?.health?.health_string==="healthy"||n?.model?.health_string==="healthy",E=(n?.recent_requests??[]).slice().reverse().map(N=>({time:p(N.start_time),latency:N.latency_ms}));return g.jsx("div",{ref:d,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-2 sm:p-4",onClick:t,role:"dialog","aria-modal":"true","aria-labelledby":"model-detail-title","aria-describedby":"model-detail-description",children:g.jsxs("div",{className:"max-h-[94vh] w-full max-w-4xl overflow-y-auto rounded-xl border border-slate-700 bg-slate-900",onClick:N=>N.stopPropagation(),children:[g.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{children:[g.jsx("h2",{id:"model-detail-title",className:"break-words text-xl font-semibold text-slate-100",children:e}),g.jsx("p",{id:"model-detail-description",className:"text-sm text-slate-300",children:"Health, usage, pricing, and recent requests"})]}),g.jsx("button",{ref:h,type:"button",onClick:t,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded text-slate-300 transition-colors hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Close model details",children:g.jsx(W_,{"aria-hidden":"true",size:20})})]}),l&&!n?g.jsxs("div",{className:"p-8 text-center",children:[g.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full mx-auto"}),g.jsx("p",{className:"mt-4 text-slate-400",children:"Loading model metrics..."})]}):c?g.jsxs("div",{className:"p-8 text-center",children:[g.jsx(Pa,{size:32,className:"mx-auto text-red-400 mb-2"}),g.jsx("p",{className:"text-red-400",children:c})]}):g.jsxs("div",{className:"p-4 space-y-6",children:[g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[_?g.jsx(wl,{size:20,className:"text-green-400"}):g.jsx(Pa,{size:20,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Health Status"})]}),g.jsx("p",{className:`text-lg font-semibold ${_?"text-green-400":"text-red-400"}`,children:_?"Healthy":"Unhealthy"}),n?.health?.consecutive_fails?g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n.health.consecutive_fails," consecutive failures"]}):null]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(X_,{size:20,className:"text-blue-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Total Requests"})]}),g.jsx("p",{className:"text-lg font-semibold text-slate-100",children:n?.metrics?.total_requests?.toLocaleString()??0}),g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n?.metrics?.successful_requests??0," successful, ",n?.metrics?.failed_requests??0," failed"]})]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(T0,{size:20,className:"text-yellow-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Avg Latency"})]}),g.jsx("p",{className:"text-lg font-semibold text-slate-100",children:b(n?.metrics?.avg_latency_ms??0)}),g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n?.metrics?.active_requests??0," active requests"]})]})]}),g.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[g.jsxs("div",{className:"rounded-lg bg-slate-700/50 p-4",children:[g.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[g.jsx(QD,{size:20,className:"text-purple-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Token usage"})]}),g.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center sm:gap-4",children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:x(n?.metrics?.total_tokens_in??0)}),g.jsx("p",{className:"text-xs text-blue-200",children:"Input tokens"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:x(n?.metrics?.total_tokens_out??0)}),g.jsx("p",{className:"text-xs text-violet-200",children:"Output tokens"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:(n?.metrics?.tokens_per_second??0).toFixed(1)}),g.jsx("p",{className:"text-xs text-slate-400",children:"Tokens/sec"})]})]})]}),g.jsxs("div",{className:"rounded-lg border border-emerald-800/50 bg-emerald-950/20 p-4",children:[g.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[g.jsx(uD,{size:20,className:"text-emerald-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Provider payout / 1M tokens"}),n?.price?.tier&&g.jsx("span",{className:"ml-auto rounded-full border border-slate-600 px-2 py-0.5 text-[10px] uppercase tracking-wide text-slate-400",children:n.price.tier})]}),n?.price?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-xl font-semibold text-blue-100",children:O(n.price.provider_input_price)}),g.jsx("p",{className:"text-xs text-blue-300",children:"Input"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-xl font-semibold text-violet-100",children:O(n.price.provider_output_price)}),g.jsx("p",{className:"text-xs text-violet-300",children:"Output"})]})]}),j!==null&&g.jsxs("p",{className:"mt-3 border-t border-emerald-900/60 pt-2 text-xs text-slate-400",children:["Estimated payout for recorded tokens: ",g.jsx("span",{className:"font-medium text-emerald-300",children:O(j)})]})]}):g.jsx("p",{className:"text-sm text-slate-400",children:"Current catalog price is unavailable."})]})]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsx("h4",{className:"text-sm font-medium text-slate-200",children:"Transactions for this model"}),g.jsx("p",{className:"mb-3 mt-1 text-xs text-slate-400",children:"Latest 20 local requests, with input and output tokens shown separately."}),(n?.recent_requests??[]).length===0?g.jsx("p",{className:"text-slate-400 text-center py-4",children:"No transactions recorded for this model"}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"space-y-2 sm:hidden",children:(n?.recent_requests??[]).map(N=>g.jsxs("div",{className:"rounded-lg border border-slate-600 bg-slate-800/60 p-3",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:"truncate font-mono text-xs text-slate-300",title:N.request_id,children:N.request_id}),g.jsxs("p",{className:"mt-1 text-xs text-slate-400",children:[p(N.start_time)," · ",b(N.latency_ms)]})]}),N.success?g.jsx(wl,{size:16,className:"shrink-0 text-green-400"}):g.jsx(Pa,{size:16,className:"shrink-0 text-red-400"})]}),g.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[g.jsxs("div",{className:"rounded bg-blue-950/30 px-2 py-1.5 text-blue-200",children:["Input ",g.jsx("span",{className:"float-right font-mono",children:N.tokens_in.toLocaleString()})]}),g.jsxs("div",{className:"rounded bg-violet-950/30 px-2 py-1.5 text-violet-200",children:["Output ",g.jsx("span",{className:"float-right font-mono",children:N.tokens_out.toLocaleString()})]})]})]},N.request_id))}),g.jsx("div",{className:"hidden overflow-x-auto sm:block",children:g.jsxs("table",{className:"w-full text-sm",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"text-slate-400 border-b border-slate-600",children:[g.jsx("th",{className:"text-left py-2 px-2 font-medium",children:"Transaction"}),g.jsx("th",{className:"text-left py-2 px-2 font-medium",children:"Time"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Latency"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Input"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Output"}),g.jsx("th",{className:"text-center py-2 px-2 font-medium",children:"Status"})]})}),g.jsx("tbody",{children:(n?.recent_requests??[]).map(N=>g.jsxs("tr",{className:"border-b border-slate-600/50",children:[g.jsx("td",{className:"max-w-36 truncate px-2 py-2 font-mono text-xs text-slate-400",title:N.request_id,children:N.request_id}),g.jsx("td",{className:"py-2 px-2 text-slate-300 text-xs",children:p(N.start_time)}),g.jsx("td",{className:"py-2 px-2 text-right font-mono text-xs",children:g.jsx("span",{className:N.latency_ms>5e3?"text-red-400":N.latency_ms>2e3?"text-yellow-400":"text-green-400",children:b(N.latency_ms)})}),g.jsx("td",{className:"py-2 px-2 text-right text-blue-200 font-mono text-xs",children:N.tokens_in.toLocaleString()}),g.jsx("td",{className:"py-2 px-2 text-right text-violet-200 font-mono text-xs",children:N.tokens_out.toLocaleString()}),g.jsx("td",{className:"py-2 px-2 text-center",children:N.success?g.jsx(wl,{size:14,className:"inline text-green-400"}):g.jsx(Pa,{size:14,className:"inline text-red-400"})})]},N.request_id))})]})})]})]}),E.length>1&&g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-3",children:"Recent transaction latency"}),g.jsx("div",{className:"h-40",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:E,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1,unit:"ms"}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"}}),g.jsx(Sl,{type:"monotone",dataKey:"latency",stroke:"#3b82f6",strokeWidth:2,dot:{fill:"#3b82f6",strokeWidth:0,r:3},name:"Latency"})]})})})]}),n?.health?.last_error&&g.jsxs("div",{className:"bg-red-900/20 border border-red-800/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(Tf,{size:20,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-red-300",children:"Last Error"})]}),g.jsx("p",{className:"text-sm text-red-400 font-mono",children:n.health.last_error})]})]})]})})}function LG({open:e,onClose:t,onAuthenticated:n}){const[a,l]=S.useState(""),[o,c]=S.useState(""),[f,d]=S.useState(!1),h=S.useRef(null),v=S.useRef(null),p=S.useRef(null);if(S.useEffect(()=>{if(!e)return;c(""),p.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const x=document.body.style.overflow;document.body.style.overflow="hidden",window.setTimeout(()=>h.current?.focus(),0);const O=j=>{if(j.key==="Escape"){j.preventDefault(),t();return}if(j.key!=="Tab"||!v.current)return;const _=Array.from(v.current.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')),E=_[0],N=_[_.length-1];!E||!N||(j.shiftKey&&document.activeElement===E?(j.preventDefault(),N.focus()):!j.shiftKey&&document.activeElement===N&&(j.preventDefault(),E.focus()))};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O),document.body.style.overflow=x,p.current?.focus()}},[e,t]),!e)return null;const b=async x=>{if(x.preventDefault(),!!a.trim()){d(!0),c(""),Ze.setAccessToken(a);try{await Ze.getSettings(),l(""),n()}catch(O){Ze.clearAccessToken(),c(O instanceof Error?O.message:"The access token was rejected")}finally{d(!1)}}};return g.jsx("div",{ref:v,className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/80 p-4 backdrop-blur-sm",role:"dialog","aria-modal":"true","aria-labelledby":"unlock-title","aria-describedby":"unlock-description",onMouseDown:x=>{x.target===x.currentTarget&&t()},children:g.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-slate-700 bg-slate-900 shadow-2xl shadow-black/40",children:[g.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-slate-800 p-5",children:[g.jsxs("div",{className:"flex gap-3",children:[g.jsx("div",{className:"rounded-xl bg-blue-500/10 p-2 text-blue-400",children:g.jsx(F_,{"aria-hidden":"true",size:22})}),g.jsxs("div",{children:[g.jsx("h2",{id:"unlock-title",className:"text-lg font-semibold text-white",children:"Unlock operator controls"}),g.jsx("p",{id:"unlock-description",className:"mt-1 text-sm text-slate-300",children:"Monitoring stays read-only until this browser tab is unlocked."})]})]}),g.jsx("button",{type:"button",onClick:t,className:"rounded-lg p-2 text-slate-400 hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Close unlock dialog",children:g.jsx(W_,{"aria-hidden":"true",size:20})})]}),g.jsxs("form",{onSubmit:b,className:"space-y-4 p-5",children:[g.jsxs("div",{children:[g.jsx("label",{htmlFor:"control-token",className:"mb-2 block text-sm font-medium text-slate-200",children:"Control token"}),g.jsx("input",{ref:h,id:"control-token",type:"password",autoComplete:"off",value:a,onChange:x=>l(x.target.value),className:"min-h-11 w-full rounded-lg border border-slate-600 bg-slate-950 px-3 font-mono text-sm text-white outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30",placeholder:"Paste dashboard.token","aria-describedby":"token-help"}),g.jsxs("p",{id:"token-help",className:"mt-2 text-xs leading-5 text-slate-300",children:["On the provider host, read ",g.jsx("code",{className:"rounded bg-slate-800 px-1.5 py-0.5 text-slate-300",children:"$CP_PATH/dashboard.token"}),". The token is kept only for this browser tab."]})]}),o&&g.jsx("p",{role:"alert",className:"rounded-lg border border-red-800/70 bg-red-950/40 px-3 py-2 text-sm text-red-300",children:o}),g.jsxs("div",{className:"flex justify-end gap-3",children:[g.jsx("button",{type:"button",onClick:t,className:"min-h-10 rounded-lg px-4 text-sm text-slate-300 hover:bg-slate-800",children:"Cancel"}),g.jsx("button",{type:"submit",disabled:f||!a.trim(),className:"min-h-10 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white transition hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50",children:f?"Checking…":"Unlock"})]})]})]})})}const $G=[{id:"limits",label:"Limits"},{id:"models",label:"Models"},{id:"alerts",label:"Alerts"},{id:"self-check",label:"Self-check"},{id:"logging",label:"Logging"}],Le="min-h-11 w-full rounded-lg border border-slate-600 bg-slate-950 px-3 text-sm text-slate-100 outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",$e="mb-1.5 block text-sm font-medium text-slate-200";function UG({restartRequired:e}){return g.jsx("span",{className:`inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-medium ${e?"border-amber-800/70 bg-amber-950/40 text-amber-300":"border-emerald-800/70 bg-emerald-950/40 text-emerald-300"}`,children:e?"Restart required":"Applies now"})}function Fu({id:e,title:t,description:n,icon:a,restartRequired:l,dirty:o,children:c}){return g.jsxs("section",{"aria-labelledby":`${e}-title`,className:"scroll-mt-14 overflow-hidden rounded-xl border border-slate-800 bg-slate-900",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 border-b border-slate-800 px-4 py-4 sm:px-5",children:[g.jsxs("div",{className:"flex min-w-0 gap-3",children:[g.jsx("div",{className:"mt-0.5 rounded-lg bg-slate-800 p-2 text-blue-400",children:a}),g.jsxs("div",{children:[g.jsx("h2",{id:`${e}-title`,className:"font-semibold text-white",children:t}),g.jsx("p",{className:"mt-1 max-w-2xl text-sm leading-5 text-slate-400",children:n})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o&&g.jsx("span",{className:"inline-flex items-center rounded-full border border-blue-800/70 bg-blue-950/40 px-2.5 py-1 text-xs font-medium text-blue-200",children:"Unsaved"}),g.jsx(UG,{restartRequired:l})]})]}),g.jsx("div",{className:"p-4 sm:p-5",children:c})]})}function Zu({state:e,section:t}){return!e||e.key!==t?null:g.jsx("p",{role:e.type==="error"?"alert":"status",className:`rounded-lg border px-3 py-2 text-sm ${e.type==="error"?"border-red-800/70 bg-red-950/30 text-red-300":"border-emerald-800/70 bg-emerald-950/30 text-emerald-300"}`,children:e.message})}function Qu({checked:e,onChange:t,label:n,description:a}){return g.jsxs("label",{className:"flex min-h-11 cursor-pointer items-start justify-between gap-4 rounded-lg border border-slate-700 bg-slate-950/60 px-3 py-2.5",children:[g.jsxs("span",{children:[g.jsx("span",{className:"block text-sm font-medium text-slate-200",children:n}),a&&g.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-slate-400",children:a})]}),g.jsx("input",{type:"checkbox",checked:e,onChange:l=>t(l.target.checked),className:"mt-0.5 h-5 w-5 rounded border-slate-600 bg-slate-900 text-blue-600 focus:ring-2 focus:ring-blue-500"})]})}function Wu({saving:e,label:t="Save settings"}){return g.jsxs("button",{type:"submit",disabled:e,className:"inline-flex min-h-10 items-center justify-center gap-2 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white transition hover:bg-blue-500 disabled:cursor-wait disabled:opacity-60",children:[e?g.jsx(Pl,{"aria-hidden":"true",className:"animate-spin",size:16}):g.jsx(DD,{"aria-hidden":"true",size:16}),e?"Saving…":t]})}function qG({authenticated:e,onUnlock:t,onModelsSaved:n,onDirtyChange:a}){const[l,o]=S.useState(null),[c,f]=S.useState(!1),[d,h]=S.useState(""),[v,p]=S.useState(null),[b,x]=S.useState(null),[O,j]=S.useState([]),[_,E]=S.useState(()=>new Set),[N,M]=S.useState(()=>sessionStorage.getItem("computing-provider-restart-pending")==="true"),P=z=>{E(G=>{const re=new Set(G);return re.add(z),re}),x(G=>G?.key===z?null:G)},T=S.useCallback(async()=>{if(e){f(!0),h("");try{const z=await Ze.getSettings();o({...z,models:z.models.map(G=>({...G}))}),j(z.models.map(G=>G.id)),E(new Set)}catch(z){h(z instanceof Error?z.message:"Unable to load settings")}finally{f(!1)}}},[e]);S.useEffect(()=>{e?T():(o(null),E(new Set))},[e,T]),S.useEffect(()=>{const z=_.size>0;a(z);const G=re=>{z&&(re.preventDefault(),re.returnValue="")};return window.addEventListener("beforeunload",G),()=>{window.removeEventListener("beforeunload",G),a(!1)}},[_,a]);const C=async(z,G)=>{p(z),x(null);try{const re=await G();return x({key:z,type:"success",message:re.restart_required?"Saved. Restart computing-provider when convenient to apply this section.":"Saved and applied to the running provider."}),E(k=>{const F=new Set(k);return F.delete(z),F}),re.restart_required&&(sessionStorage.setItem("computing-provider-restart-pending","true"),M(!0)),!0}catch(re){return x({key:z,type:"error",message:re instanceof Error?re.message:"Save failed"}),!1}finally{p(null)}},L=S.useMemo(()=>{if(!l)return 0;const z=new Set(l.models.map(G=>G.id));return O.filter(G=>!z.has(G)).length},[O,l]);if(!e)return g.jsx("div",{className:"mx-auto max-w-2xl py-8 sm:py-16",children:g.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900 p-6 text-center sm:p-10",children:[g.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-blue-500/10 text-blue-400",children:g.jsx(C0,{"aria-hidden":"true",size:24})}),g.jsx("h2",{className:"text-xl font-semibold text-white",children:"Settings are locked"}),g.jsx("p",{className:"mx-auto mt-2 max-w-lg text-sm leading-6 text-slate-400",children:"Unlock this browser tab with the local control token before reading or changing provider configuration. Monitoring remains available without it."}),g.jsxs("button",{type:"button",onClick:t,className:"mt-5 inline-flex min-h-11 items-center gap-2 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white hover:bg-blue-500",children:[g.jsx(F_,{"aria-hidden":"true",size:17})," Unlock settings"]})]})});if(c&&!l)return g.jsxs("div",{className:"flex min-h-64 items-center justify-center text-slate-400",role:"status",children:[g.jsx(Pl,{"aria-hidden":"true",className:"mr-2 animate-spin",size:18})," Loading settings…"]});if(!l)return g.jsxs("div",{className:"rounded-xl border border-red-800/60 bg-red-950/20 p-5",children:[g.jsx("h2",{className:"font-semibold text-red-200",children:"Settings could not be loaded"}),g.jsx("p",{className:"mt-1 text-sm text-red-300",children:d}),g.jsx("button",{type:"button",onClick:T,className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white",children:"Try again"})]});const Z=z=>{P("alerts"),o(G=>G&&{...G,alerts:{...G.alerts,...z}})},ne=z=>{P("self-check"),o(G=>G&&{...G,self_check:{...G.self_check,...z}})},q=z=>{P("logging"),o(G=>G&&{...G,log:{...G.log,...z}})},U=z=>{P("limits"),o(G=>G&&{...G,limits:{...G.limits,...z}})},B=z=>Z({email:{...l.alerts.email,...z}}),ue=(z,G)=>{P("models"),o(re=>{if(!re)return re;const k=re.models.map((F,ie)=>ie===z?{...F,...G}:F);return{...re,models:k}})},oe=async z=>{z.preventDefault();const G=l.alerts.email.to.flatMap(k=>k.split(/[\n,]/)).map(k=>k.trim()).filter(Boolean),re={...l.alerts,email:{...l.alerts.email,to:G}};await C("alerts",()=>Ze.updateAlerts(re))&&o(k=>k&&{...k,alerts:{...k.alerts,email:{...k.alerts.email,password:"",clear_password:!1,to:G,password_set:re.email.clear_password?!1:re.email.password_set||!!re.email.password}}})},ve=async z=>{z.preventDefault(),!(L>0&&!window.confirm(`Save and remove ${L} model${L===1?"":"s"} from routing?`))&&await C("models",()=>Ze.updateModels(l.models))&&(n(),await T())},K=()=>{_.size>0&&!window.confirm("Reload settings from disk and discard unsaved changes?")||T()},ee=()=>{sessionStorage.removeItem("computing-provider-restart-pending"),M(!1)};return g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Provider settings"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"Validated edits to config.toml and models.json. Secrets are write-only."})]}),g.jsxs("button",{type:"button",onClick:K,disabled:c,className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 hover:bg-slate-800 disabled:opacity-50",children:[g.jsx(D0,{"aria-hidden":"true",className:c?"animate-spin":"",size:16})," Reload from disk"]})]}),g.jsx("nav",{"aria-label":"Settings sections",className:"sticky top-0 z-20 -mx-1 overflow-x-auto rounded-xl border border-slate-800 bg-slate-950/95 p-1 shadow-lg shadow-slate-950/30 backdrop-blur",children:g.jsx("div",{className:"flex min-w-max gap-1",children:$G.map(z=>g.jsxs("button",{type:"button",onClick:()=>document.getElementById(`${z.id}-title`)?.scrollIntoView({behavior:"smooth",block:"start"}),className:"inline-flex min-h-10 items-center rounded-lg px-3 text-sm text-slate-300 hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500",children:[z.label,_.has(z.id)&&g.jsx("span",{className:"ml-2 h-2 w-2 rounded-full bg-blue-400","aria-label":"Unsaved changes"})]},z.id))})}),_.size>0&&g.jsxs("p",{role:"status",className:"rounded-lg border border-blue-800/70 bg-blue-950/30 px-4 py-3 text-sm text-blue-100",children:["Unsaved changes in ",_.size," section",_.size===1?"":"s",". Save each marked section before leaving Settings."]}),N&&g.jsxs("div",{role:"status",className:"flex flex-col gap-3 rounded-lg border border-amber-800/70 bg-amber-950/30 px-4 py-3 text-sm text-amber-100 sm:flex-row sm:items-center sm:justify-between",children:[g.jsx("span",{children:"Saved configuration is waiting for a provider-daemon restart before it takes effect."}),g.jsx("button",{type:"button",onClick:ee,className:"min-h-10 self-start rounded-lg border border-amber-700/70 px-3 text-amber-100 hover:bg-amber-900/30 sm:self-auto",children:"Dismiss"})]}),d&&g.jsx("p",{role:"alert",className:"rounded-lg border border-red-800/60 bg-red-950/20 px-4 py-3 text-sm text-red-300",children:d}),g.jsx(Fu,{id:"limits",title:"Request limits",description:"Protect the provider from more work than it can serve. Both values are persisted and applied immediately.",icon:g.jsx(M0,{"aria-hidden":"true",size:19}),restartRequired:!1,dirty:_.has("limits"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),C("limits",()=>Ze.updateLimits(l.limits))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"requests-per-second",children:"Requests per second"}),g.jsx("input",{id:"requests-per-second",type:"number",min:"0.1",max:"100000",step:"0.1",required:!0,value:l.limits.requests_per_second,onChange:z=>U({requests_per_second:Number(z.target.value)}),className:Le}),g.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Base global rate; GPU-aware adaptation may lower or raise the live rate."})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"max-concurrent",children:"Maximum concurrent requests"}),g.jsx("input",{id:"max-concurrent",type:"number",min:"1",max:"100000",required:!0,value:l.limits.max_concurrent,onChange:z=>U({max_concurrent:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"limits"}),g.jsx(Wu,{saving:v==="limits"})]})]})}),g.jsx(Fu,{id:"models",title:"Model endpoint map",description:"Add, repoint, or remove local inference endpoints. Saving hot-reloads models.json and updates the advertised model list.",icon:g.jsx(PD,{"aria-hidden":"true",size:19}),restartRequired:!1,dirty:_.has("models"),children:g.jsxs("form",{onSubmit:ve,className:"space-y-4",children:[l.models.length===0?g.jsx("div",{className:"rounded-lg border border-dashed border-slate-700 px-4 py-8 text-center text-sm text-slate-400",children:"No models configured. Add one to begin serving inference."}):g.jsx("div",{className:"space-y-3",children:l.models.map((z,G)=>g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-950/50 p-4",children:[g.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(180px,0.8fr)_minmax(240px,1.2fr)_auto]",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`model-id-${G}`,children:"Model ID"}),g.jsx("input",{id:`model-id-${G}`,required:!0,readOnly:!z.isNew,value:z.id,onChange:re=>ue(G,{id:re.target.value}),className:`${Le} font-mono ${z.isNew?"":"cursor-not-allowed bg-slate-900 text-slate-400"}`})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`model-endpoint-${G}`,children:"Endpoint"}),g.jsx("input",{id:`model-endpoint-${G}`,type:"url",required:!0,value:z.endpoint,onChange:re=>ue(G,{endpoint:re.target.value}),placeholder:"http://127.0.0.1:8000",className:`${Le} font-mono`})]}),g.jsxs("button",{type:"button",onClick:()=>{window.confirm(`Remove ${z.id||"this model"} from the configuration? The change takes effect when you save.`)&&(P("models"),o(re=>re&&{...re,models:re.models.filter((k,F)=>F!==G)}))},className:"mt-auto inline-flex min-h-11 items-center justify-center gap-2 rounded-lg border border-red-900/70 px-3 text-sm text-red-300 hover:bg-red-950/40","aria-label":`Remove ${z.id||"new model"}`,children:[g.jsx(KD,{"aria-hidden":"true",size:16})," ",g.jsx("span",{className:"lg:hidden",children:"Remove"})]})]}),g.jsxs("div",{className:"mt-4 grid gap-4 sm:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`model-category-${G}`,children:"Category"}),g.jsx("input",{id:`model-category-${G}`,required:!0,value:z.category,onChange:re=>ue(G,{category:re.target.value}),placeholder:"text-generation",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`local-model-${G}`,children:"Local model name"}),g.jsx("input",{id:`local-model-${G}`,value:z.local_model??"",onChange:re=>ue(G,{local_model:re.target.value}),placeholder:"Optional Ollama name",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`context-length-${G}`,children:"Context length"}),g.jsx("input",{id:`context-length-${G}`,type:"number",min:"0",value:z.context_length??0,onChange:re=>ue(G,{context_length:Number(re.target.value)}),className:Le})]})]}),g.jsxs("details",{className:"mt-4 rounded-lg border border-slate-800 bg-slate-950/60",children:[g.jsx("summary",{className:"cursor-pointer px-3 py-2 text-sm font-medium text-slate-300",children:"Advanced endpoint details"}),g.jsxs("div",{className:"grid gap-4 border-t border-slate-800 p-3 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`gpu-memory-${G}`,children:"GPU memory (MB)"}),g.jsx("input",{id:`gpu-memory-${G}`,type:"number",min:"0",value:z.gpu_memory,onChange:re=>ue(G,{gpu_memory:Number(re.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`container-${G}`,children:"Container"}),g.jsx("input",{id:`container-${G}`,value:z.container??"",onChange:re=>ue(G,{container:re.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`format-${G}`,children:"Format"}),g.jsx("input",{id:`format-${G}`,value:z.format??"",onChange:re=>ue(G,{format:re.target.value}),placeholder:"awq, gguf…",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`quantization-${G}`,children:"Quantization"}),g.jsx("input",{id:`quantization-${G}`,value:z.quantization??"",onChange:re=>ue(G,{quantization:re.target.value}),className:Le})]}),g.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[g.jsx("label",{className:$e,htmlFor:`endpoint-key-${G}`,children:"Endpoint API key"}),g.jsx("input",{id:`endpoint-key-${G}`,type:"password",autoComplete:"new-password",value:z.api_key??"",onChange:re=>ue(G,{api_key:re.target.value,clear_api_key:!1}),placeholder:z.api_key_set?"Configured •••• — leave blank to keep":"Optional write-only replacement",className:Le}),z.api_key_set&&g.jsxs("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-slate-400",children:[g.jsx("input",{type:"checkbox",checked:!!z.clear_api_key,onChange:re=>ue(G,{clear_api_key:re.target.checked,api_key:""})})," Clear stored endpoint key"]})]})]})]})]},`${z.id}-${G}`))}),g.jsxs("button",{type:"button",onClick:()=>{P("models"),o(z=>z&&{...z,models:[...z.models,{id:"",endpoint:"",gpu_memory:0,category:"text-generation",api_key_set:!1,context_length:0,isNew:!0}]})},className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-dashed border-slate-600 px-3 text-sm text-slate-200 hover:border-blue-500 hover:text-white",children:[g.jsx(OD,{"aria-hidden":"true",size:16})," Add model"]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"models"}),g.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[L>0&&g.jsxs("span",{className:"text-xs text-amber-300",children:[L," removal pending"]}),g.jsx(Wu,{saving:v==="models",label:"Save and hot-reload"})]})]})]})}),g.jsx(Fu,{id:"alerts",title:"Alert delivery",description:"Configure webhook and SMTP delivery. Stored passwords are never returned to the browser.",icon:g.jsx(G4,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("alerts"),children:g.jsxs("form",{onSubmit:oe,className:"space-y-5",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"webhook-url",children:"Webhook URL"}),g.jsx("input",{id:"webhook-url",type:"url",value:l.alerts.webhook_url,onChange:z=>Z({webhook_url:z.target.value}),placeholder:"https://alerts.example.com/provider",className:Le})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"cooldown",children:"Repeat cooldown (minutes)"}),g.jsx("input",{id:"cooldown",type:"number",min:"1",max:"10080",required:!0,value:l.alerts.cooldown_minutes,onChange:z=>Z({cooldown_minutes:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"disconnect-delay",children:"Disconnect alert after (minutes)"}),g.jsx("input",{id:"disconnect-delay",type:"number",min:"1",max:"10080",required:!0,value:l.alerts.disconnect_after_min,onChange:z=>Z({disconnect_after_min:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"failure-threshold",children:"Failure threshold (%)"}),g.jsx("input",{id:"failure-threshold",type:"number",min:"1",max:"100",step:"1",required:!0,value:Math.round(l.alerts.error_rate_threshold*100),onChange:z=>Z({error_rate_threshold:Number(z.target.value)/100}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"minimum-requests",children:"Minimum requests"}),g.jsx("input",{id:"minimum-requests",type:"number",min:"1",required:!0,value:l.alerts.error_rate_min_requests,onChange:z=>Z({error_rate_min_requests:Number(z.target.value)}),className:Le})]})]}),g.jsxs("fieldset",{className:"rounded-xl border border-slate-700 p-4",children:[g.jsx("legend",{className:"px-2 text-sm font-semibold text-slate-200",children:"Email (SMTP)"}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[g.jsxs("div",{className:"sm:col-span-2",children:[g.jsx("label",{className:$e,htmlFor:"smtp-host",children:"SMTP host"}),g.jsx("input",{id:"smtp-host",value:l.alerts.email.host,onChange:z=>B({host:z.target.value}),placeholder:"smtp.example.com",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"smtp-port",children:"Port"}),g.jsx("input",{id:"smtp-port",type:"number",min:"1",max:"65535",value:l.alerts.email.port,onChange:z=>B({port:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"smtp-username",children:"Username"}),g.jsx("input",{id:"smtp-username",value:l.alerts.email.username,onChange:z=>B({username:z.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"smtp-from",children:"From address"}),g.jsx("input",{id:"smtp-from",type:"email",value:l.alerts.email.from,onChange:z=>B({from:z.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"smtp-recipients",children:"Recipients"}),g.jsx("textarea",{id:"smtp-recipients",rows:2,value:l.alerts.email.to.join(` + `).concat(P.x,",").concat(P.y),C=_t(e.id)?uo("recharts-radial-line-"):e.id;return S.createElement("text",qr({},a,{dominantBaseline:"central",className:Re("recharts-radial-bar-label",c)}),S.createElement("defs",null,S.createElement("path",{id:C,d:T})),S.createElement("textPath",{xlinkHref:"#".concat(C)},n))},Vq=(e,t,n)=>{var{cx:a,cy:l,innerRadius:o,outerRadius:c,startAngle:f,endAngle:d}=e,h=(f+d)/2;if(n==="outside"){var{x:v,y:p}=xt(a,l,c+t,h);return{x:v,y:p,textAnchor:v>=a?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"end"};var b=(o+c)/2,{x,y:O}=xt(a,l,b,h);return{x,y:O,textAnchor:"middle",verticalAnchor:"middle"}},S0=e=>"cx"in e&&me(e.cx),Xq=(e,t)=>{var{parentViewBox:n,offset:a,position:l}=e,o;n!=null&&!S0(n)&&(o=n);var{x:c,y:f,upperWidth:d,lowerWidth:h,height:v}=t,p=c,b=c+(d-h)/2,x=(p+b)/2,O=(d+h)/2,j=p+d/2,_=v>=0?1:-1,E=_*a,N=_>0?"end":"start",M=_>0?"start":"end",P=d>=0?1:-1,T=P*a,C=P>0?"end":"start",R=P>0?"start":"end";if(l==="top"){var F={x:p+d/2,y:f-E,textAnchor:"middle",verticalAnchor:N};return mt(mt({},F),o?{height:Math.max(f-o.y,0),width:d}:{})}if(l==="bottom"){var ee={x:b+h/2,y:f+v+E,textAnchor:"middle",verticalAnchor:M};return mt(mt({},ee),o?{height:Math.max(o.y+o.height-(f+v),0),width:h}:{})}if(l==="left"){var q={x:x-T,y:f+v/2,textAnchor:C,verticalAnchor:"middle"};return mt(mt({},q),o?{width:Math.max(q.x-o.x,0),height:v}:{})}if(l==="right"){var U={x:x+O+T,y:f+v/2,textAnchor:R,verticalAnchor:"middle"};return mt(mt({},U),o?{width:Math.max(o.x+o.width-U.x,0),height:v}:{})}var B=o?{width:O,height:v}:{};return l==="insideLeft"?mt({x:x+T,y:f+v/2,textAnchor:R,verticalAnchor:"middle"},B):l==="insideRight"?mt({x:x+O-T,y:f+v/2,textAnchor:C,verticalAnchor:"middle"},B):l==="insideTop"?mt({x:p+d/2,y:f+E,textAnchor:"middle",verticalAnchor:M},B):l==="insideBottom"?mt({x:b+h/2,y:f+v-E,textAnchor:"middle",verticalAnchor:N},B):l==="insideTopLeft"?mt({x:p+T,y:f+E,textAnchor:R,verticalAnchor:M},B):l==="insideTopRight"?mt({x:p+d-T,y:f+E,textAnchor:C,verticalAnchor:M},B):l==="insideBottomLeft"?mt({x:b+T,y:f+v-E,textAnchor:R,verticalAnchor:N},B):l==="insideBottomRight"?mt({x:b+h-T,y:f+v-E,textAnchor:C,verticalAnchor:N},B):l&&typeof l=="object"&&(me(l.x)||Yr(l.x))&&(me(l.y)||Yr(l.y))?mt({x:c+Nn(l.x,O),y:f+Nn(l.y,v),textAnchor:"end",verticalAnchor:"end"},B):mt({x:j,y:f+v/2,textAnchor:"middle",verticalAnchor:"middle"},B)},Fq={angle:0,offset:5,zIndex:Vt.label,position:"middle",textBreakAll:!1};function Ca(e){var t=At(e,Fq),{viewBox:n,position:a,value:l,children:o,content:c,className:f="",textBreakAll:d,labelRef:h}=t,v=Hq(),p=sM(),b=a==="center"?p:v??p,x,O,j;if(n==null?x=b:S0(n)?x=n:x=EE(n),!x||_t(l)&&_t(o)&&!S.isValidElement(c)&&typeof c!="function")return null;var _=mt(mt({},t),{},{viewBox:x});if(S.isValidElement(c)){var{labelRef:E}=_,N=LO(_,zq);return S.cloneElement(c,N)}if(typeof c=="function"){var{content:M}=_,P=LO(_,Rq);if(O=S.createElement(c,P),S.isValidElement(O))return O}else O=Kq(t);var T=tn(t);if(S0(x)){if(a==="insideStart"||a==="insideEnd"||a==="end")return Gq(t,a,O,T,x);j=Vq(x,t.offset,t.position)}else j=Xq(t,x);return S.createElement(ir,{zIndex:t.zIndex},S.createElement(gd,qr({ref:h,className:Re("recharts-label",f)},T,j,{textAnchor:Mq(T.textAnchor)?T.textAnchor:j.textAnchor,breakAll:d}),O))}Ca.displayName="Label";var Zq=(e,t,n)=>{if(!e)return null;var a={viewBox:t,labelRef:n};return e===!0?S.createElement(Ca,qr({key:"label-implicit"},a)):pr(e)?S.createElement(Ca,qr({key:"label-implicit",value:e},a)):S.isValidElement(e)?e.type===Ca?S.cloneElement(e,mt({key:"label-implicit"},a)):S.createElement(Ca,qr({key:"label-implicit",content:e},a)):xg(e)?S.createElement(Ca,qr({key:"label-implicit",content:e},a)):e&&typeof e=="object"?S.createElement(Ca,qr({},e,{key:"label-implicit"},a)):null};function Qq(e){var{label:t,labelRef:n}=e,a=sM();return Zq(t,a,n)||null}var dp={},hp={},UO;function Wq(){return UO||(UO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(hp)),hp}var mp={},qO;function Jq(){return qO||(qO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(mp)),mp}var BO;function eB(){return BO||(BO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wq(),n=Jq(),a=F0();function l(o){if(a.isArrayLike(o))return t.last(n.toArray(o))}e.last=l})(dp)),dp}var vp,IO;function tB(){return IO||(IO=1,vp=eB().last),vp}var nB=tB();const rB=Qr(nB);var aB=["valueAccessor"],iB=["dataKey","clockWise","id","textBreakAll","zIndex"];function wf(){return wf=Object.assign?Object.assign.bind():function(e){for(var t=1;tArray.isArray(e.value)?rB(e.value):e.value,cM=S.createContext(void 0),oB=cM.Provider,fM=S.createContext(void 0),sB=fM.Provider;function cB(){return S.useContext(cM)}function fB(){return S.useContext(fM)}function Cc(e){var{valueAccessor:t=uB}=e,n=HO(e,aB),{dataKey:a,clockWise:l,id:o,textBreakAll:c,zIndex:f}=n,d=HO(n,iB),h=cB(),v=fB(),p=h||v;return!p||!p.length?null:S.createElement(ir,{zIndex:f??Vt.label},S.createElement(dn,{className:"recharts-label-list"},p.map((b,x)=>{var O,j=_t(a)?t(b,x):tt(b&&b.payload,a),_=_t(o)?{}:{id:"".concat(o,"-").concat(x)};return S.createElement(Ca,wf({key:"label-".concat(x)},tn(b),d,_,{fill:(O=n.fill)!==null&&O!==void 0?O:b.fill,parentViewBox:b.parentViewBox,value:j,textBreakAll:c,viewBox:b.viewBox,index:x,zIndex:0}))})))}Cc.displayName="LabelList";function dM(e){var{label:t}=e;return t?t===!0?S.createElement(Cc,{key:"labelList-implicit"}):S.isValidElement(t)||xg(t)?S.createElement(Cc,{key:"labelList-implicit",content:t}):typeof t=="object"?S.createElement(Cc,wf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function w0(){return w0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{cx:t,cy:n,r:a,className:l}=e,o=Re("recharts-dot",l);return me(t)&&me(n)&&me(a)?S.createElement("circle",w0({},Gn(e),V0(e),{className:o,cx:t,cy:n,r:a})):null},mM=e=>e.graphicalItems.polarItems,dB=V([it,Ro],Yy),bd=V([mM,lt,dB],Gy),hB=V([bd],Vy),xd=V([hB,ky],Xy),mB=V([xd,lt,bd],Zy);V([xd,lt,bd],(e,t,n)=>n.length>0?e.flatMap(a=>n.flatMap(l=>{var o,c=tt(a,(o=t.dataKey)!==null&&o!==void 0?o:l.dataKey);return{value:c,errorDomain:[]}})).filter(Boolean):t?.dataKey!=null?e.map(a=>({value:tt(a,t.dataKey),errorDomain:[]})):e.map(a=>({value:a,errorDomain:[]})));var KO=()=>{},vB=V([xd,lt,bd,hd,it],eg),pB=V([lt,Wy,Jy,KO,vB,KO,Ge,it],tg),vM=V([lt,Ge,xd,mB,zo,it,pB],ng),yB=V([vM,lt,ql],ig);V([lt,vM,yB,it],ug);var gB={radiusAxis:{},angleAxis:{}},pM=hn({name:"polarAxis",initialState:gB,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:YG,removeRadiusAxis:GG,addAngleAxis:VG,removeAngleAxis:XG}=pM.actions,bB=pM.reducer;function YO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function GO(e){for(var t=1;tt,Sg=V([mM,jB],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),OB=[],wg=(e,t,n)=>n?.length===0?OB:n,yM=V([ky,Sg,wg],(e,t,n)=>{var{chartData:a}=e;if(t!=null){var l;if(t?.data!=null&&t.data.length>0?l=t.data:l=a,(!l||!l.length)&&n!=null&&(l=n.map(o=>GO(GO({},t.presentationProps),o.props))),l!=null)return l}}),_B=V([yM,Sg,wg],(e,t,n)=>{if(!(e==null||t==null))return e.map((a,l)=>{var o,c=tt(a,t.nameKey,t.name),f;return n!=null&&(o=n[l])!==null&&o!==void 0&&(o=o.props)!==null&&o!==void 0&&o.fill?f=n[l].props.fill:typeof a=="object"&&a!=null&&"fill"in a?f=a.fill:f=t.fill,{value:Hf(c,t.dataKey),color:f,payload:a,type:t.legendType}})}),AB=V([yM,Sg,wg,zt],(e,t,n,a)=>{if(!(t==null||e==null))return kI({offset:a,pieSettings:t,displayedData:e,cells:n})}),pp={exports:{}},Ye={};var VO;function EB(){if(VO)return Ye;VO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function O(j){if(typeof j=="object"&&j!==null){var _=j.$$typeof;switch(_){case e:switch(j=j.type,j){case n:case l:case a:case d:case h:case b:return j;default:switch(j=j&&j.$$typeof,j){case c:case f:case p:case v:return j;case o:return j;default:return _}}case t:return _}}}return Ye.ContextConsumer=o,Ye.ContextProvider=c,Ye.Element=e,Ye.ForwardRef=f,Ye.Fragment=n,Ye.Lazy=p,Ye.Memo=v,Ye.Portal=t,Ye.Profiler=l,Ye.StrictMode=a,Ye.Suspense=d,Ye.SuspenseList=h,Ye.isContextConsumer=function(j){return O(j)===o},Ye.isContextProvider=function(j){return O(j)===c},Ye.isElement=function(j){return typeof j=="object"&&j!==null&&j.$$typeof===e},Ye.isForwardRef=function(j){return O(j)===f},Ye.isFragment=function(j){return O(j)===n},Ye.isLazy=function(j){return O(j)===p},Ye.isMemo=function(j){return O(j)===v},Ye.isPortal=function(j){return O(j)===t},Ye.isProfiler=function(j){return O(j)===l},Ye.isStrictMode=function(j){return O(j)===a},Ye.isSuspense=function(j){return O(j)===d},Ye.isSuspenseList=function(j){return O(j)===h},Ye.isValidElementType=function(j){return typeof j=="string"||typeof j=="function"||j===n||j===l||j===a||j===d||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===p||j.$$typeof===v||j.$$typeof===c||j.$$typeof===o||j.$$typeof===f||j.$$typeof===x||j.getModuleId!==void 0)},Ye.typeOf=O,Ye}var XO;function NB(){return XO||(XO=1,pp.exports=EB()),pp.exports}var TB=NB(),FO=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",ZO=null,yp=null,gM=e=>{if(e===ZO&&Array.isArray(yp))return yp;var t=[];return S.Children.forEach(e,n=>{_t(n)||(TB.isFragment(n)?t=t.concat(gM(n.props.children)):t.push(n))}),yp=t,ZO=e,t};function bM(e,t){var n=[],a=[];return Array.isArray(t)?a=t.map(l=>FO(l)):a=[FO(t)],gM(e).forEach(l=>{var o=xi(l,"type.displayName")||xi(l,"type.name");o&&a.indexOf(o)!==-1&&n.push(l)}),n}var xM=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,gp={},QO;function MB(){return QO||(QO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const l=n[Symbol.toStringTag];return l==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${l}]`}let a=n;for(;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(n)===a}e.isPlainObject=t})(gp)),gp}var bp,WO;function CB(){return WO||(WO=1,bp=MB().isPlainObject),bp}var DB=CB();const kB=Qr(DB);var JO,e_,t_,n_,r_;function a_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function i_(e){for(var t=1;t{var o=n-a,c;return c=ct(JO||(JO=Vu(["M ",",",""])),e,t),c+=ct(e_||(e_=Vu(["L ",",",""])),e+n,t),c+=ct(t_||(t_=Vu(["L ",",",""])),e+n-o/2,t+l),c+=ct(n_||(n_=Vu(["L ",",",""])),e+n-o/2-a,t+l),c+=ct(r_||(r_=Vu(["L ",","," Z"])),e,t),c},LB={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$B=e=>{var t=At(e,LB),{x:n,y:a,upperWidth:l,lowerWidth:o,height:c,className:f}=t,{animationEasing:d,animationDuration:h,animationBegin:v,isUpdateAnimationActive:p}=t,b=S.useRef(null),[x,O]=S.useState(-1),j=S.useRef(l),_=S.useRef(o),E=S.useRef(c),N=S.useRef(n),M=S.useRef(a),P=td(e,"trapezoid-");if(S.useEffect(()=>{if(b.current&&b.current.getTotalLength)try{var oe=b.current.getTotalLength();oe&&O(oe)}catch{}},[]),n!==+n||a!==+a||l!==+l||o!==+o||c!==+c||l===0&&o===0||c===0)return null;var T=Re("recharts-trapezoid",f);if(!p)return S.createElement("g",null,S.createElement("path",jf({},tn(t),{className:T,d:l_(n,a,l,o,c)})));var C=j.current,R=_.current,F=E.current,ee=N.current,q=M.current,U="0px ".concat(x===-1?1:x,"px"),B="".concat(x,"px 0px"),ue=BE(["strokeDasharray"],h,d);return S.createElement(ed,{animationId:P,key:P,canBegin:x>0,duration:h,easing:d,isActive:p,begin:v},oe=>{var ve=Qt(C,l,oe),K=Qt(R,o,oe),te=Qt(F,c,oe),z=Qt(ee,n,oe),G=Qt(q,a,oe);b.current&&(j.current=ve,_.current=K,E.current=te,N.current=z,M.current=G);var re=oe>0?{transition:ue,strokeDasharray:B}:{strokeDasharray:U};return S.createElement("path",jf({},tn(t),{className:T,d:l_(z,G,ve,K,te),ref:b,style:i_(i_({},re),t.style)}))})},UB=["option","shapeType","activeClassName"];function qB(e,t){if(e==null)return{};var n,a,l=BB(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var a=Qe();return(l,o)=>c=>{e?.(l,o,c),a(TT({activeIndex:String(o),activeDataKey:t,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:n}))}},FB=e=>{var t=Qe();return(n,a)=>l=>{e?.(n,a,l),t(J$())}},ZB=(e,t,n)=>{var a=Qe();return(l,o)=>c=>{e?.(l,o,c),a(eU({activeIndex:String(o),activeDataKey:t,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:n}))}};function wM(e){var{tooltipEntrySettings:t}=e,n=Qe(),a=mn(),l=S.useRef(null);return S.useLayoutEffect(()=>{a||(l.current===null?n(F$(t)):l.current!==t&&n(Z$({prev:l.current,next:t})),l.current=t)},[t,n,a]),S.useLayoutEffect(()=>()=>{l.current&&(n(Q$(l.current)),l.current=null)},[n]),null}function QB(e){var{legendPayload:t}=e,n=Qe(),a=mn(),l=S.useRef(null);return S.useLayoutEffect(()=>{a||(l.current===null?n(RE(t)):l.current!==t&&n(LE({prev:l.current,next:t})),l.current=t)},[n,a,t]),S.useLayoutEffect(()=>()=>{l.current&&(n($E(l.current)),l.current=null)},[n]),null}function WB(e){var{legendPayload:t}=e,n=Qe(),a=de(Ge),l=S.useRef(null);return S.useLayoutEffect(()=>{a!=="centric"&&a!=="radial"||(l.current===null?n(RE(t)):l.current!==t&&n(LE({prev:l.current,next:t})),l.current=t)},[n,a,t]),S.useLayoutEffect(()=>()=>{l.current&&(n($E(l.current)),l.current=null)},[n]),null}var xp,JB=()=>{var[e]=S.useState(()=>uo("uid-"));return e},eI=(xp=M4.useId)!==null&&xp!==void 0?xp:JB;function tI(e,t){var n=eI();return t||(e?"".concat(e,"-").concat(n):n)}var nI=S.createContext(void 0),jM=e=>{var{id:t,type:n,children:a}=e,l=tI("recharts-".concat(n),t);return S.createElement(nI.Provider,{value:l},a(l))},rI={cartesianItems:[],polarItems:[]},OM=hn({name:"graphicalItems",initialState:rI,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:rt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).cartesianItems.indexOf(n);l>-1&&(e.cartesianItems[l]=a)},prepare:rt()},removeCartesianGraphicalItem:{reducer(e,t){var n=nr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:rt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:rt()},removePolarGraphicalItem:{reducer(e,t){var n=nr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:rt()}}}),{addCartesianGraphicalItem:aI,replaceCartesianGraphicalItem:iI,removeCartesianGraphicalItem:lI,addPolarGraphicalItem:uI,removePolarGraphicalItem:oI}=OM.actions,sI=OM.reducer,cI=e=>{var t=Qe(),n=S.useRef(null);return S.useLayoutEffect(()=>{n.current===null?t(aI(e)):n.current!==e&&t(iI({prev:n.current,next:e})),n.current=e},[t,e]),S.useLayoutEffect(()=>()=>{n.current&&(t(lI(n.current)),n.current=null)},[t]),null},fI=S.memo(cI);function dI(e){var t=Qe();return S.useLayoutEffect(()=>(t(uI(e)),()=>{t(oI(e))}),[t,e]),null}var hI=["key"],mI=["onMouseEnter","onClick","onMouseLeave"],vI=["id"],pI=["id"];function s_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function ft(e){for(var t=1;tbM(e.children,yd),[e.children]),n=de(a=>_B(a,e.id,t));return n==null?null:S.createElement(WB,{legendPayload:n})}var wI=S.memo(e=>{var{dataKey:t,nameKey:n,sectors:a,stroke:l,strokeWidth:o,fill:c,name:f,hide:d,tooltipType:h,id:v}=e,p={dataDefinedOnItem:a.map(b=>b.tooltipPayload),positions:a.map(b=>b.tooltipPosition),settings:{stroke:l,strokeWidth:o,fill:c,dataKey:t,nameKey:n,name:Hf(f,t),hide:d,type:h,color:c,unit:"",graphicalItemId:v}};return S.createElement(wM,{tooltipEntrySettings:p})}),jI=(e,t)=>e>t?"start":eNn(typeof t=="function"?t(e):t,n,n*.8),_I=(e,t,n)=>{var{top:a,left:l,width:o,height:c}=t,f=GE(o,c),d=l+Nn(e.cx,o,o/2),h=a+Nn(e.cy,c,c/2),v=Nn(e.innerRadius,f,0),p=OI(n,e.outerRadius,f),b=e.maxRadius||Math.sqrt(o*o+c*c)/2;return{cx:d,cy:h,innerRadius:v,outerRadius:p,maxRadius:b}},AI=(e,t)=>{var n=Wt(t-e),a=Math.min(Math.abs(t-e),360);return n*a};function EI(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var NI=(e,t)=>{if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Re("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:a}=t,l=Sd(t,hI);return S.createElement(sy,$a({},l,{type:"linear",className:n}))},TI=(e,t,n)=>{if(S.isValidElement(e))return S.cloneElement(e,t);var a=n;if(typeof e=="function"&&(a=e(t),S.isValidElement(a)))return a;var l=Re("recharts-pie-label-text",EI(e));return S.createElement(gd,$a({},t,{alignmentBaseline:"middle",className:l}),a)};function MI(e){var{sectors:t,props:n,showLabels:a}=e,{label:l,labelLine:o,dataKey:c}=n;if(!a||!l||!t)return null;var f=Gn(n),d=_l(l),h=_l(o),v=typeof l=="object"&&"offsetRadius"in l&&typeof l.offsetRadius=="number"&&l.offsetRadius||20,p=t.map((b,x)=>{var O=(b.startAngle+b.endAngle)/2,j=xt(b.cx,b.cy,b.outerRadius+v,O),_=ft(ft(ft(ft({},f),b),{},{stroke:"none"},d),{},{index:x,textAnchor:jI(j.x,b.cx)},j),E=ft(ft(ft(ft({},f),b),{},{fill:"none",stroke:b.fill},h),{},{index:x,points:[xt(b.cx,b.cy,b.outerRadius,O),j],key:"line"});return S.createElement(ir,{zIndex:Vt.label,key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(x)},S.createElement(dn,null,o&&NI(o,E),TI(l,_,tt(b,c))))});return S.createElement(dn,{className:"recharts-pie-labels"},p)}function CI(e){var{sectors:t,props:n,showLabels:a}=e,{label:l}=n;return typeof l=="object"&&l!=null&&"position"in l?S.createElement(dM,{label:l}):S.createElement(MI,{sectors:t,props:n,showLabels:a})}function DI(e){var{sectors:t,activeShape:n,inactiveShape:a,allOtherPieProps:l,shape:o,id:c}=e,f=de(Dl),d=de(HT),h=de(UU),{onMouseEnter:v,onClick:p,onMouseLeave:b}=l,x=Sd(l,mI),O=XB(v,l.dataKey,c),j=FB(b),_=ZB(p,l.dataKey,c);return t==null||t.length===0?null:S.createElement(S.Fragment,null,t.map((E,N)=>{if(E?.startAngle===0&&E?.endAngle===0&&t.length!==1)return null;var M=h==null||h===c,P=String(N)===f&&(d==null||l.dataKey===d)&&M,T=f?a:null,C=n&&P?n:T,R=ft(ft({},E),{},{stroke:E.stroke,tabIndex:-1,[SE]:N,[wE]:c});return S.createElement(dn,$a({key:"sector-".concat(E?.startAngle,"-").concat(E?.endAngle,"-").concat(E.midAngle,"-").concat(N),tabIndex:-1,className:"recharts-pie-sector"},X0(x,E,N),{onMouseEnter:O(E,N),onMouseLeave:j(E,N),onClick:_(E,N)}),S.createElement(SM,$a({option:o??C,index:N,shapeType:"sector",isActive:P},R)))}))}function kI(e){var t,{pieSettings:n,displayedData:a,cells:l,offset:o}=e,{cornerRadius:c,startAngle:f,endAngle:d,dataKey:h,nameKey:v,tooltipType:p}=n,b=Math.abs(n.minAngle),x=AI(f,d),O=Math.abs(x),j=a.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,_=a.filter(C=>tt(C,h,0)!==0).length,E=(O>=360?_:_-1)*j,N=O-_*b-E,M=a.reduce((C,R)=>{var F=tt(R,h,0);return C+(me(F)?F:0)},0),P;if(M>0){var T;P=a.map((C,R)=>{var F=tt(C,h,0),ee=tt(C,v,R),q=_I(n,o,C),U=(me(F)?F:0)/M,B,ue=ft(ft({},C),l&&l[R]&&l[R].props);R?B=T.endAngle+Wt(x)*j*(F!==0?1:0):B=f;var oe=B+Wt(x)*((F!==0?b:0)+U*N),ve=(B+oe)/2,K=(q.innerRadius+q.outerRadius)/2,te=[{name:ee,value:F,payload:ue,dataKey:h,type:p,graphicalItemId:n.id}],z=xt(q.cx,q.cy,K,ve);return T=ft(ft(ft(ft({},n.presentationProps),{},{percent:U,cornerRadius:typeof c=="string"?parseFloat(c):c,name:ee,tooltipPayload:te,midAngle:ve,middleRadius:K,tooltipPosition:z},ue),q),{},{value:F,dataKey:h,startAngle:B,endAngle:oe,payload:ue,paddingAngle:Wt(x)*j}),T})}return P}function PI(e){var{showLabels:t,sectors:n,children:a}=e,l=S.useMemo(()=>!t||!n?[]:n.map(o=>({value:o.value,payload:o.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:o.cx,cy:o.cy,innerRadius:o.innerRadius,outerRadius:o.outerRadius,startAngle:o.startAngle,endAngle:o.endAngle,clockWise:!1},fill:o.fill})),[n,t]);return S.createElement(sB,{value:t?l:void 0},a)}function zI(e){var{props:t,previousSectorsRef:n,id:a}=e,{sectors:l,isAnimationActive:o,animationBegin:c,animationDuration:f,animationEasing:d,activeShape:h,inactiveShape:v,onAnimationStart:p,onAnimationEnd:b}=t,x=td(t,"recharts-pie-"),O=n.current,[j,_]=S.useState(!1),E=S.useCallback(()=>{typeof b=="function"&&b(),_(!1)},[b]),N=S.useCallback(()=>{typeof p=="function"&&p(),_(!0)},[p]);return S.createElement(PI,{showLabels:!j,sectors:l},S.createElement(ed,{animationId:x,begin:c,duration:f,isActive:o,easing:d,onAnimationStart:N,onAnimationEnd:E,key:x},M=>{var P=[],T=l&&l[0],C=T?.startAngle;return l?.forEach((R,F)=>{var ee=O&&O[F],q=F>0?xi(R,"paddingAngle",0):0;if(ee){var U=Qt(ee.endAngle-ee.startAngle,R.endAngle-R.startAngle,M),B=ft(ft({},R),{},{startAngle:C+q,endAngle:C+U+q});P.push(B),C=B.endAngle}else{var{endAngle:ue,startAngle:oe}=R,ve=Qt(0,ue-oe,M),K=ft(ft({},R),{},{startAngle:C+q,endAngle:C+ve+q});P.push(K),C=K.endAngle}}),n.current=P,S.createElement(dn,null,S.createElement(DI,{sectors:P,activeShape:h,inactiveShape:v,allOtherPieProps:t,shape:t.shape,id:a}))}),S.createElement(CI,{showLabels:!j,sectors:l,props:t}),t.children)}var RI={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Vt.area};function LI(e){var{id:t}=e,n=Sd(e,vI),{hide:a,className:l,rootTabIndex:o}=e,c=S.useMemo(()=>bM(e.children,yd),[e.children]),f=de(v=>AB(v,t,c)),d=S.useRef(null),h=Re("recharts-pie",l);return a||f==null?(d.current=null,S.createElement(dn,{tabIndex:o,className:h})):S.createElement(ir,{zIndex:e.zIndex},S.createElement(wI,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:f,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t}),S.createElement(dn,{tabIndex:o,className:h},S.createElement(zI,{props:ft(ft({},n),{},{sectors:f}),previousSectorsRef:d,id:t})))}function _M(e){var t=At(e,RI),{id:n}=t,a=Sd(t,pI),l=Gn(a);return S.createElement(jM,{id:n,type:"pie"},o=>S.createElement(S.Fragment,null,S.createElement(dI,{type:"pie",id:o,data:a.data,dataKey:a.dataKey,hide:a.hide,angleAxisId:0,radiusAxisId:0,name:a.name,nameKey:a.nameKey,tooltipType:a.tooltipType,legendType:a.legendType,fill:a.fill,cx:a.cx,cy:a.cy,startAngle:a.startAngle,endAngle:a.endAngle,paddingAngle:a.paddingAngle,minAngle:a.minAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius,cornerRadius:a.cornerRadius,presentationProps:l,maxRadius:t.maxRadius}),S.createElement(SI,$a({},a,{id:o})),S.createElement(LI,$a({},a,{id:o}))))}_M.displayName="Pie";var $I=["points"];function c_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Sp(e){for(var t=1;t{var _,E,N=Sp(Sp(Sp({r:3},c),p),{},{index:j,cx:(_=O.x)!==null&&_!==void 0?_:void 0,cy:(E=O.y)!==null&&E!==void 0?E:void 0,dataKey:o,value:O.value,payload:O.payload,points:t});return S.createElement(KI,{key:"dot-".concat(j),option:n,dotProps:N,className:l})}),x={};return f&&d!=null&&(x.clipPath="url(#clipPath-".concat(v?"":"dots-").concat(d,")")),S.createElement(ir,{zIndex:h},S.createElement(dn,_f({className:a},x),b))}function f_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function d_(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),lH=V([iH,Wr,Jr],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),jg=()=>de(lH),uH=()=>de(KU);function h_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function wp(e){for(var t=1;t{var{point:t,childIndex:n,mainColor:a,activeDot:l,dataKey:o,clipPath:c}=e;if(l===!1||t.x==null||t.y==null)return null;var f={index:n,dataKey:o,cx:t.x,cy:t.y,r:4,fill:a??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=wp(wp(wp({},f),_l(l)),V0(l)),h;return S.isValidElement(l)?h=S.cloneElement(l,d):typeof l=="function"?h=l(d):h=S.createElement(hM,d),S.createElement(dn,{className:"recharts-active-dot",clipPath:c},h)};function dH(e){var{points:t,mainColor:n,activeDot:a,itemDataKey:l,clipPath:o,zIndex:c=Vt.activeDot}=e,f=de(Dl),d=uH();if(t==null||d==null)return null;var h=t.find(v=>d.includes(v.payload));return _t(h)?null:S.createElement(ir,{zIndex:c},S.createElement(fH,{point:h,childIndex:Number(f),mainColor:n,dataKey:l,activeDot:a,clipPath:o}))}var EM=e=>{var{chartData:t}=e,n=Qe(),a=mn();return S.useEffect(()=>a?()=>{}:(n(wO(t)),()=>{n(wO(void 0))}),[t,n,a]),null},m_={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},NM=hn({name:"brush",initialState:m_,reducers:{setBrushSettings(e,t){return t.payload==null?m_:t.payload}}}),{setBrushSettings:WG}=NM.actions,hH=NM.reducer;function mH(e,t,n){return(t=vH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vH(e){var t=pH(e,"string");return typeof t=="symbol"?t:t+""}function pH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Og{static create(t){return new Og(t)}constructor(t){this.scale=t}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}apply(t){var{bandAware:n,position:a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t!==void 0){if(a)switch(a){case"start":return this.scale(t);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+l}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(t)+o}default:return this.scale(t)}if(n){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+c}return this.scale(t)}}isInRange(t){var n=this.range(),a=n[0],l=n[n.length-1];return a<=l?t>=a&&t<=l:t>=l&&t<=a}}mH(Og,"EPS",1e-4);function yH(e){return(e%180+180)%180}var gH=function(t){var{width:n,height:a}=t,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=yH(l),c=o*Math.PI/180,f=Math.atan(a/n),d=c>f&&c{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=nr(e).dots.findIndex(a=>a===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=nr(e).areas.findIndex(a=>a===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=nr(e).lines.findIndex(a=>a===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:JG,removeDot:eV,addArea:tV,removeArea:nV,addLine:rV,removeLine:aV}=TM.actions,xH=TM.reducer,SH=S.createContext(void 0),wH=e=>{var{children:t}=e,[n]=S.useState("".concat(uo("recharts"),"-clip")),a=jg();if(a==null)return null;var{x:l,y:o,width:c,height:f}=a;return S.createElement(SH.Provider,{value:n},S.createElement("defs",null,S.createElement("clipPath",{id:n},S.createElement("rect",{x:l,y:o,height:f,width:c}))),t)};function MM(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],a=0;ae*l)return!1;var o=n();return e*(t-e*o/2-a)>=0&&e*(t+e*o/2-l)<=0}function _H(e,t){return MM(e,t+1)}function AH(e,t,n,a,l){for(var o=(a||[]).slice(),{start:c,end:f}=t,d=0,h=1,v=c,p=function(){var O=a?.[d];if(O===void 0)return{v:MM(a,h)};var j=d,_,E=()=>(_===void 0&&(_=n(O,j)),_),N=O.coordinate,M=d===0||wo(e,N,E,v,f);M||(d=0,v=c,h+=1),M&&(v=N+e*(E()/2+l),d+=h)},b;h<=o.length;)if(b=p(),b)return b.v;return[]}function EH(e,t,n,a,l){var o=(a||[]).slice(),c=o.length;if(c===0)return[];for(var{start:f,end:d}=t,h=1;h<=c;h++){for(var v=(c-1)%h,p=f,b=!0,x=function(){var N=a[O],M=O,P,T=()=>(P===void 0&&(P=n(N,M)),P),C=N.coordinate,R=O===v||wo(e,C,T,p,d);if(!R)return b=!1,1;R&&(p=C+e*(T()/2+l))},O=v;O(O===void 0&&(O=n(x,b)),O);if(b===c-1){var _=e*(x.coordinate+e*j()/2-d);o[b]=x=Ft(Ft({},x),{},{tickCoord:_>0?x.coordinate-_*e:x.coordinate})}else o[b]=x=Ft(Ft({},x),{},{tickCoord:x.coordinate});if(x.tickCoord!=null){var E=wo(e,x.tickCoord,j,f,d);E&&(d=x.tickCoord-e*(j()/2+l),o[b]=Ft(Ft({},x),{},{isShow:!0}))}},v=c-1;v>=0;v--)h(v);return o}function DH(e,t,n,a,l,o){var c=(a||[]).slice(),f=c.length,{start:d,end:h}=t;if(o){var v=a[f-1],p=n(v,f-1),b=e*(v.coordinate+e*p/2-h);if(c[f-1]=v=Ft(Ft({},v),{},{tickCoord:b>0?v.coordinate-b*e:v.coordinate}),v.tickCoord!=null){var x=wo(e,v.tickCoord,()=>p,d,h);x&&(h=v.tickCoord-e*(p/2+l),c[f-1]=Ft(Ft({},v),{},{isShow:!0}))}}for(var O=o?f-1:f,j=function(N){var M=c[N],P,T=()=>(P===void 0&&(P=n(M,N)),P);if(N===0){var C=e*(M.coordinate-e*T()/2-d);c[N]=M=Ft(Ft({},M),{},{tickCoord:C<0?M.coordinate-C*e:M.coordinate})}else c[N]=M=Ft(Ft({},M),{},{tickCoord:M.coordinate});if(M.tickCoord!=null){var R=wo(e,M.tickCoord,T,d,h);R&&(d=M.tickCoord+e*(T()/2+l),c[N]=Ft(Ft({},M),{},{isShow:!0}))}},_=0;_{var T=typeof h=="function"?h(M.value,P):M.value;return O==="width"?jH(no(T,{fontSize:t,letterSpacing:n}),j,p):no(T,{fontSize:t,letterSpacing:n})[O]},E=l.length>=2?Wt(l[1].coordinate-l[0].coordinate):1,N=OH(o,E,O);return d==="equidistantPreserveStart"?AH(E,N,_,l,c):d==="equidistantPreserveEnd"?EH(E,N,_,l,c):(d==="preserveStart"||d==="preserveStartEnd"?x=DH(E,N,_,l,c,d==="preserveStartEnd"):x=CH(E,N,_,l,c),x.filter(M=>M.isShow))}var kH=e=>{var{ticks:t,label:n,labelGapWithTick:a=5,tickSize:l=0,tickMargin:o=0}=e,c=0;if(t){Array.from(t).forEach(v=>{if(v){var p=v.getBoundingClientRect();p.width>c&&(c=p.width)}});var f=n?n.getBoundingClientRect().width:0,d=l+o,h=c+d+f+(n?a:0);return Math.round(h)}return 0},PH=["axisLine","width","height","className","hide","ticks","axisType"];function zH(e,t){if(e==null)return{};var n,a,l=RH(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{ticks:n=[],tick:a,tickLine:l,stroke:o,tickFormatter:c,unit:f,padding:d,tickTextProps:h,orientation:v,mirror:p,x:b,y:x,width:O,height:j,tickSize:_,tickMargin:E,fontSize:N,letterSpacing:M,getTicksConfig:P,events:T,axisType:C}=e,R=_g(bt(bt({},P),{},{ticks:n}),N,M),F=IH(v,p),ee=HH(v,p),q=Gn(P),U=_l(a),B={};typeof l=="object"&&(B=l);var ue=bt(bt({},q),{},{fill:"none"},B),oe=R.map(te=>bt({entry:te},BH(te,b,x,O,j,v,_,p,E))),ve=oe.map(te=>{var{entry:z,line:G}=te;return S.createElement(dn,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(z.value,"-").concat(z.coordinate,"-").concat(z.tickCoord)},l&&S.createElement("line",_i({},ue,G,{className:Re("recharts-cartesian-axis-tick-line",xi(l,"className"))})))}),K=oe.map((te,z)=>{var{entry:G,tick:re}=te,k=bt(bt(bt(bt({textAnchor:F,verticalAnchor:ee},q),{},{stroke:"none",fill:o},U),re),{},{index:z,payload:G,visibleTicksCount:R.length,tickFormatter:c,padding:d},h);return S.createElement(dn,_i({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(G.value,"-").concat(G.coordinate,"-").concat(G.tickCoord)},X0(T,G,z)),a&&S.createElement(KH,{option:a,tickProps:k,value:"".concat(typeof c=="function"?c(G.value,z):G.value).concat(f||"")}))});return S.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(C,"-ticks")},K.length>0&&S.createElement(ir,{zIndex:Vt.label},S.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(C,"-tick-labels"),ref:t},K)),ve.length>0&&S.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(C,"-tick-lines")},ve))}),GH=S.forwardRef((e,t)=>{var{axisLine:n,width:a,height:l,className:o,hide:c,ticks:f,axisType:d}=e,h=zH(e,PH),[v,p]=S.useState(""),[b,x]=S.useState(""),O=S.useRef(null);S.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var _;return kH({ticks:O.current,label:(_=e.labelRef)===null||_===void 0?void 0:_.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=S.useCallback(_=>{if(_){var E=_.getElementsByClassName("recharts-cartesian-axis-tick-value");O.current=E;var N=E[0];if(N){var M=window.getComputedStyle(N),P=M.fontSize,T=M.letterSpacing;(P!==v||T!==b)&&(p(P),x(T))}}},[v,b]);return c||a!=null&&a<=0||l!=null&&l<=0?null:S.createElement(ir,{zIndex:e.zIndex},S.createElement(dn,{className:Re("recharts-cartesian-axis",o)},S.createElement(qH,{x:e.x,y:e.y,width:a,height:l,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Gn(e)}),S.createElement(YH,{ref:j,axisType:d,events:h,fontSize:v,getTicksConfig:e,height:e.height,letterSpacing:b,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:f,unit:e.unit,width:e.width,x:e.x,y:e.y}),S.createElement(Bq,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},S.createElement(Qq,{label:e.label,labelRef:e.labelRef}),e.children)))}),Ag=S.forwardRef((e,t)=>{var n=At(e,Kr);return S.createElement(GH,_i({},n,{ref:t}))});Ag.displayName="CartesianAxis";var VH=["x1","y1","x2","y2","key"],XH=["offset"],FH=["xAxisId","yAxisId"],ZH=["xAxisId","yAxisId"];function y_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Zt(e){for(var t=1;t{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:a,y:l,width:o,height:c,ry:f}=e;return S.createElement("rect",{x:a,y:l,ry:f,width:o,height:c,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function CM(e){var{option:t,lineItemProps:n}=e,a;if(S.isValidElement(t))a=S.cloneElement(t,n);else if(typeof t=="function")a=t(n);else{var l,{x1:o,y1:c,x2:f,y2:d,key:h}=n,v=Af(n,VH),p=(l=Gn(v))!==null&&l!==void 0?l:{},{offset:b}=p,x=Af(p,XH);a=S.createElement("line",vi({},x,{x1:o,y1:c,x2:f,y2:d,fill:"none",key:h}))}return a}function nK(e){var{x:t,width:n,horizontal:a=!0,horizontalPoints:l}=e;if(!a||!l||!l.length)return null;var{xAxisId:o,yAxisId:c}=e,f=Af(e,FH),d=l.map((h,v)=>{var p=Zt(Zt({},f),{},{x1:t,y1:h,x2:t+n,y2:h,key:"line-".concat(v),index:v});return S.createElement(CM,{key:"line-".concat(v),option:a,lineItemProps:p})});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function rK(e){var{y:t,height:n,vertical:a=!0,verticalPoints:l}=e;if(!a||!l||!l.length)return null;var{xAxisId:o,yAxisId:c}=e,f=Af(e,ZH),d=l.map((h,v)=>{var p=Zt(Zt({},f),{},{x1:h,y1:t,x2:h,y2:t+n,key:"line-".concat(v),index:v});return S.createElement(CM,{option:a,lineItemProps:p,key:"line-".concat(v)})});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function aK(e){var{horizontalFill:t,fillOpacity:n,x:a,y:l,width:o,height:c,horizontalPoints:f,horizontal:d=!0}=e;if(!d||!t||!t.length||f==null)return null;var h=f.map(p=>Math.round(p+l-l)).sort((p,b)=>p-b);l!==h[0]&&h.unshift(0);var v=h.map((p,b)=>{var x=!h[b+1],O=x?l+c-p:h[b+1]-p;if(O<=0)return null;var j=b%t.length;return S.createElement("rect",{key:"react-".concat(b),y:p,x:a,height:O,width:o,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},v)}function iK(e){var{vertical:t=!0,verticalFill:n,fillOpacity:a,x:l,y:o,width:c,height:f,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var h=d.map(p=>Math.round(p+l-l)).sort((p,b)=>p-b);l!==h[0]&&h.unshift(0);var v=h.map((p,b)=>{var x=!h[b+1],O=x?l+c-p:h[b+1]-p;if(O<=0)return null;var j=b%n.length;return S.createElement("rect",{key:"react-".concat(b),x:p,y:o,width:O,height:f,stroke:"none",fill:n[j],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},v)}var lK=(e,t)=>{var{xAxis:n,width:a,height:l,offset:o}=e;return gE(_g(Zt(Zt(Zt({},Kr),n),{},{ticks:bE(n),viewBox:{x:0,y:0,width:a,height:l}})),o.left,o.left+o.width,t)},uK=(e,t)=>{var{yAxis:n,width:a,height:l,offset:o}=e;return gE(_g(Zt(Zt(Zt({},Kr),n),{},{ticks:bE(n),viewBox:{x:0,y:0,width:a,height:l}})),o.top,o.top+o.height,t)},oK={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Vt.grid};function ro(e){var t=iy(),n=ly(),a=NE(),l=Zt(Zt({},At(e,oK)),{},{x:me(e.x)?e.x:a.left,y:me(e.y)?e.y:a.top,width:me(e.width)?e.width:a.width,height:me(e.height)?e.height:a.height}),{xAxisId:o,yAxisId:c,x:f,y:d,width:h,height:v,syncWithTicks:p,horizontalValues:b,verticalValues:x}=l,O=mn(),j=de(ee=>cO(ee,"xAxis",o,O)),_=de(ee=>cO(ee,"yAxis",c,O));if(!yr(h)||!yr(v)||!me(f)||!me(d))return null;var E=l.verticalCoordinatesGenerator||lK,N=l.horizontalCoordinatesGenerator||uK,{horizontalPoints:M,verticalPoints:P}=l;if((!M||!M.length)&&typeof N=="function"){var T=b&&b.length,C=N({yAxis:_?Zt(Zt({},_),{},{ticks:T?b:_.ticks}):void 0,width:t??h,height:n??v,offset:a},T?!0:p);Wc(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof C,"]")),Array.isArray(C)&&(M=C)}if((!P||!P.length)&&typeof E=="function"){var R=x&&x.length,F=E({xAxis:j?Zt(Zt({},j),{},{ticks:R?x:j.ticks}):void 0,width:t??h,height:n??v,offset:a},R?!0:p);Wc(Array.isArray(F),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof F,"]")),Array.isArray(F)&&(P=F)}return S.createElement(ir,{zIndex:l.zIndex},S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(tK,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),S.createElement(aK,vi({},l,{horizontalPoints:M})),S.createElement(iK,vi({},l,{verticalPoints:P})),S.createElement(nK,vi({},l,{offset:a,horizontalPoints:M,xAxis:j,yAxis:_})),S.createElement(rK,vi({},l,{offset:a,verticalPoints:P,xAxis:j,yAxis:_}))))}ro.displayName="CartesianGrid";var sK={},DM=hn({name:"errorBars",initialState:sK,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:a}=t.payload;e[n]||(e[n]=[]),e[n].push(a)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:a,next:l}=t.payload;e[n]&&(e[n]=e[n].map(o=>o.dataKey===a.dataKey&&o.direction===a.direction?l:o))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:a}=t.payload;e[n]&&(e[n]=e[n].filter(l=>l.dataKey!==a.dataKey||l.direction!==a.direction))}}}),{addErrorBar:iV,replaceErrorBar:lV,removeErrorBar:uV}=DM.actions,cK=DM.reducer,fK=["children"];function dK(e,t){if(e==null)return{};var n,a,l=hK(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a({x:0,y:0,value:0}),errorBarOffset:0},vK=S.createContext(mK);function pK(e){var{children:t}=e,n=dK(e,fK);return S.createElement(vK.Provider,{value:n},t)}function kM(e,t){var n,a,l=de(h=>ta(h,e)),o=de(h=>na(h,t)),c=(n=l?.allowDataOverflow)!==null&&n!==void 0?n:Dt.allowDataOverflow,f=(a=o?.allowDataOverflow)!==null&&a!==void 0?a:kt.allowDataOverflow,d=c||f;return{needClip:d,needClipX:c,needClipY:f}}function yK(e){var{xAxisId:t,yAxisId:n,clipPathId:a}=e,l=jg(),{needClipX:o,needClipY:c,needClip:f}=kM(t,n);if(!f||!l)return null;var{x:d,y:h,width:v,height:p}=l;return S.createElement("clipPath",{id:"clipPath-".concat(a)},S.createElement("rect",{x:o?d:d-v/2,y:c?h:h-p/2,width:o?v:v*2,height:c?p:p*2}))}var PM=(e,t,n,a)=>jT(e,"xAxis",t,a),zM=(e,t,n,a)=>wT(e,"xAxis",t,a),RM=(e,t,n,a)=>jT(e,"yAxis",n,a),LM=(e,t,n,a)=>wT(e,"yAxis",n,a),gK=V([Ge,PM,RM,zM,LM],(e,t,n,a,l)=>Ua(e,"xAxis")?Qc(t,a,!1):Qc(n,l,!1)),bK=(e,t,n,a,l)=>l;function xK(e){return e.type==="line"}var SK=V([nT,bK],(e,t)=>e.filter(xK).find(n=>n.id===t)),wK=V([Ge,PM,RM,zM,LM,SK,gK,Py],(e,t,n,a,l,o,c,f)=>{var{chartData:d,dataStartIndex:h,dataEndIndex:v}=f;if(!(o==null||t==null||n==null||a==null||l==null||a.length===0||l.length===0||c==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:p,data:b}=o,x;if(b!=null&&b.length>0?x=b:x=d?.slice(h,v+1),x!=null)return sY({layout:e,xAxis:t,yAxis:n,xAxisTicks:a,yAxisTicks:l,dataKey:p,bandSize:c,displayedData:x})}});function jK(e){var t=_l(e),n=3,a=2;if(t!=null){var{r:l,strokeWidth:o}=t,c=Number(l),f=Number(o);return(Number.isNaN(c)||c<0)&&(c=n),(Number.isNaN(f)||f<0)&&(f=a),{r:c,strokeWidth:f}}return{r:n,strokeWidth:a}}var jp={exports:{}},Op={};var g_;function OK(){if(g_)return Op;g_=1;var e=kl();function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,a=e.useSyncExternalStore,l=e.useRef,o=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Op.useSyncExternalStoreWithSelector=function(d,h,v,p,b){var x=l(null);if(x.current===null){var O={hasValue:!1,value:null};x.current=O}else O=x.current;x=c(function(){function _(T){if(!E){if(E=!0,N=T,T=p(T),b!==void 0&&O.hasValue){var C=O.value;if(b(C,T))return M=C}return M=T}if(C=M,n(N,T))return C;var R=p(T);return b!==void 0&&b(C,R)?(N=T,C):(N=T,M=R)}var E=!1,N,M,P=v===void 0?null:v;return[function(){return _(h())},P===null?void 0:function(){return _(P())}]},[h,v,p,b]);var j=a(d,x[0],x[1]);return o(function(){O.hasValue=!0,O.value=j},[j]),f(j),j},Op}var b_;function _K(){return b_||(b_=1,jp.exports=OK()),jp.exports}_K();function AK(e){e()}function EK(){let e=null,t=null;return{clear(){e=null,t=null},notify(){AK(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let a=e;for(;a;)n.push(a),a=a.next;return n},subscribe(n){let a=!0;const l=t={callback:n,next:null,prev:t};return l.prev?l.prev.next=l:e=l,function(){!a||e===null||(a=!1,l.next?l.next.prev=l.prev:t=l.prev,l.prev?l.prev.next=l.next:e=l.next)}}}}var x_={notify(){},get:()=>[]};function NK(e,t){let n,a=x_,l=0,o=!1;function c(j){v();const _=a.subscribe(j);let E=!1;return()=>{E||(E=!0,_(),p())}}function f(){a.notify()}function d(){O.onStateChange&&O.onStateChange()}function h(){return o}function v(){l++,n||(n=e.subscribe(d),a=EK())}function p(){l--,n&&l===0&&(n(),n=void 0,a.clear(),a=x_)}function b(){o||(o=!0,v())}function x(){o&&(o=!1,p())}const O={addNestedSub:c,notifyNestedSubs:f,handleChangeWrapper:d,isSubscribed:h,trySubscribe:b,tryUnsubscribe:x,getListeners:()=>a};return O}var TK=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",MK=TK(),CK=()=>typeof navigator<"u"&&navigator.product==="ReactNative",DK=CK(),kK=()=>MK||DK?S.useLayoutEffect:S.useEffect,PK=kK();function S_(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function zK(e,t){if(S_(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(let l=0;l{const d=NK(l);return{store:l,subscription:d,getServerState:a?()=>a:void 0}},[l,a]),c=S.useMemo(()=>l.getState(),[l]);PK(()=>{const{subscription:d}=o;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),c!==l.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[o,c]);const f=n||UK;return S.createElement(f.Provider,{value:o},t)}var BK=qK,IK=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function HK(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Eg(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var a of n)if(IK.has(a)){if(e[a]==null&&t[a]==null)continue;if(!zK(e[a],t[a]))return!1}else if(!HK(e[a],t[a]))return!1;return!0}var KK=["id"],YK=["type","layout","connectNulls","needClip","shape"],GK=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,stroke:a,legendType:l,hide:o}=e;return[{inactive:o,dataKey:t,type:l,color:a,value:Hf(n,t),payload:e}]},WK=S.memo(e=>{var{dataKey:t,data:n,stroke:a,strokeWidth:l,fill:o,name:c,hide:f,unit:d,tooltipType:h,id:v}=e,p={dataDefinedOnItem:n,positions:void 0,settings:{stroke:a,strokeWidth:l,fill:o,dataKey:t,nameKey:void 0,name:Hf(c,t),hide:f,type:h,color:a,unit:d,graphicalItemId:v}};return S.createElement(wM,{tooltipEntrySettings:p})}),$M=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function JK(e,t){for(var n=e.length%2!==0?[...e,0]:e,a=[],l=0;l{var a=n.reduce((p,b)=>p+b);if(!a)return $M(t,e);for(var l=Math.floor(e/a),o=e%a,c=t-e,f=[],d=0,h=0;do){f=[...n.slice(0,d),o-h];break}var v=f.length%2===0?[0,c]:[c];return[...JK(n,l),...f,...v].map(p=>"".concat(p,"px")).join(", ")};function tY(e){var{clipPathId:t,points:n,props:a}=e,{dot:l,dataKey:o,needClip:c}=a,{id:f}=a,d=Ng(a,KK),h=Gn(d);return S.createElement(GI,{points:n,dot:l,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:o,baseProps:h,needClip:c,clipPathId:t})}function nY(e){var{showLabels:t,children:n,points:a}=e,l=S.useMemo(()=>a?.map(o=>{var c,f,d={x:(c=o.x)!==null&&c!==void 0?c:0,y:(f=o.y)!==null&&f!==void 0?f:0,width:0,lowerWidth:0,upperWidth:0,height:0};return dr(dr({},d),{},{value:o.value,payload:o.payload,viewBox:d,parentViewBox:void 0,fill:void 0})}),[a]);return S.createElement(oB,{value:t?l:void 0},n)}function j_(e){var{clipPathId:t,pathRef:n,points:a,strokeDasharray:l,props:o}=e,{type:c,layout:f,connectNulls:d,needClip:h,shape:v}=o,p=Ng(o,YK),b=dr(dr({},tn(p)),{},{fill:"none",className:"recharts-line-curve",clipPath:h?"url(#clipPath-".concat(t,")"):void 0,points:a,type:c,layout:f,connectNulls:d,strokeDasharray:l??o.strokeDasharray});return S.createElement(S.Fragment,null,a?.length>1&&S.createElement(SM,jo({shapeType:"curve",option:v},b,{pathRef:n})),S.createElement(tY,{points:a,clipPathId:t,props:o}))}function rY(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function aY(e){var{clipPathId:t,props:n,pathRef:a,previousPointsRef:l,longestAnimatedLengthRef:o}=e,{points:c,strokeDasharray:f,isAnimationActive:d,animationBegin:h,animationDuration:v,animationEasing:p,animateNewValues:b,width:x,height:O,onAnimationEnd:j,onAnimationStart:_}=n,E=l.current,N=td(c,"recharts-line-"),M=S.useRef(N),[P,T]=S.useState(!1),C=!P,R=S.useCallback(()=>{typeof j=="function"&&j(),T(!1)},[j]),F=S.useCallback(()=>{typeof _=="function"&&_(),T(!0)},[_]),ee=rY(a.current),q=S.useRef(0);M.current!==N&&(q.current=o.current,M.current=N);var U=q.current;return S.createElement(nY,{points:c,showLabels:C},n.children,S.createElement(ed,{animationId:N,begin:h,duration:v,isActive:d,easing:p,onAnimationEnd:R,onAnimationStart:F,key:N},B=>{var ue=Qt(U,ee+U,B),oe=Math.min(ue,ee),ve;if(d)if(f){var K="".concat(f).split(/[,\s]+/gim).map(G=>parseFloat(G));ve=eY(oe,ee,K)}else ve=$M(ee,oe);else ve=f==null?void 0:String(f);if(B>0&&ee>0&&(l.current=c,o.current=Math.max(o.current,oe)),E){var te=E.length/c.length,z=B===1?c:c.map((G,re)=>{var k=Math.floor(re*te);if(E[k]){var Z=E[k];return dr(dr({},G),{},{x:Qt(Z.x,G.x,B),y:Qt(Z.y,G.y,B)})}return b?dr(dr({},G),{},{x:Qt(x*2,G.x,B),y:Qt(O/2,G.y,B)}):dr(dr({},G),{},{x:G.x,y:G.y})});return l.current=z,S.createElement(j_,{props:n,points:z,clipPathId:t,pathRef:a,strokeDasharray:ve})}return S.createElement(j_,{props:n,points:c,clipPathId:t,pathRef:a,strokeDasharray:ve})}),S.createElement(dM,{label:n.label}))}function iY(e){var{clipPathId:t,props:n}=e,a=S.useRef(null),l=S.useRef(0),o=S.useRef(null);return S.createElement(aY,{props:n,clipPathId:t,previousPointsRef:a,longestAnimatedLengthRef:l,pathRef:o})}var lY=(e,t)=>{var n,a;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(a=e.y)!==null&&a!==void 0?a:void 0,value:e.value,errorVal:tt(e.payload,t)}};class uY extends S.Component{render(){var{hide:t,dot:n,points:a,className:l,xAxisId:o,yAxisId:c,top:f,left:d,width:h,height:v,id:p,needClip:b,zIndex:x}=this.props;if(t)return null;var O=Re("recharts-line",l),j=p,{r:_,strokeWidth:E}=jK(n),N=xM(n),M=_*2+E,P=b?"url(#clipPath-".concat(N?"":"dots-").concat(j,")"):void 0;return S.createElement(ir,{zIndex:x},S.createElement(dn,{className:O},b&&S.createElement("defs",null,S.createElement(yK,{clipPathId:j,xAxisId:o,yAxisId:c}),!N&&S.createElement("clipPath",{id:"clipPath-dots-".concat(j)},S.createElement("rect",{x:d-M/2,y:f-M/2,width:h+M,height:v+M}))),S.createElement(pK,{xAxisId:o,yAxisId:c,data:a,dataPointFormatter:lY,errorBarOffset:0},S.createElement(iY,{props:this.props,clipPathId:j}))),S.createElement(dH,{activeDot:this.props.activeDot,points:a,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:P}))}}var UM={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Vt.line,type:"linear"};function oY(e){var t=At(e,UM),{activeDot:n,animateNewValues:a,animationBegin:l,animationDuration:o,animationEasing:c,connectNulls:f,dot:d,hide:h,isAnimationActive:v,label:p,legendType:b,xAxisId:x,yAxisId:O,id:j}=t,_=Ng(t,GK),{needClip:E}=kM(x,O),N=jg(),M=To(),P=mn(),T=de(q=>wK(q,x,O,P,j));if(M!=="horizontal"&&M!=="vertical"||T==null||N==null)return null;var{height:C,width:R,x:F,y:ee}=N;return S.createElement(uY,jo({},_,{id:j,connectNulls:f,dot:d,activeDot:n,animateNewValues:a,animationBegin:l,animationDuration:o,animationEasing:c,isAnimationActive:v,hide:h,label:p,legendType:b,xAxisId:x,yAxisId:O,points:T,layout:M,height:C,width:R,left:F,top:ee,needClip:E}))}function sY(e){var{layout:t,xAxis:n,yAxis:a,xAxisTicks:l,yAxisTicks:o,dataKey:c,bandSize:f,displayedData:d}=e;return d.map((h,v)=>{var p=tt(h,c);if(t==="horizontal"){var b=mj({axis:n,ticks:l,bandSize:f,entry:h,index:v}),x=_t(p)?null:a.scale(p);return{x:b,y:x,value:p,payload:h}}var O=_t(p)?null:n.scale(p),j=mj({axis:a,ticks:o,bandSize:f,entry:h,index:v});return O==null||j==null?null:{x:O,y:j,value:p,payload:h}}).filter(Boolean)}function cY(e){var t=At(e,UM),n=mn();return S.createElement(jM,{id:t.id,type:"line"},a=>S.createElement(S.Fragment,null,S.createElement(QB,{legendPayload:QK(t)}),S.createElement(WK,{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:a}),S.createElement(fI,{type:"line",id:a,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),S.createElement(oY,jo({},t,{id:a}))))}var Sl=S.memo(cY,Eg);Sl.displayName="Line";var fY=["domain","range"],dY=["domain","range"];function O_(e,t){if(e==null)return{};var n,a,l=hY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{n.current===null?t(QI(e)):n.current!==e&&t(WI({prev:n.current,next:e})),n.current=e},[e,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(JI(n.current)),n.current=null)},[t]),null}var gY=e=>{var{xAxisId:t,className:n}=e,a=de(jE),l=mn(),o="xAxis",c=de(E=>ST(E,o,t,l)),f=de(E=>D$(E,t)),d=de(E=>$$(E,t)),h=de(E=>JN(E,t));if(f==null||d==null||h==null)return null;var{dangerouslySetInnerHTML:v,ticks:p,scale:b}=e,x=A_(e,mY),{id:O,scale:j}=h,_=A_(h,vY);return S.createElement(Ag,j0({},x,_,{x:d.x,y:d.y,width:f.width,height:f.height,className:Re("recharts-".concat(o," ").concat(o),n),viewBox:a,ticks:c,axisType:o}))},bY={allowDataOverflow:Dt.allowDataOverflow,allowDecimals:Dt.allowDecimals,allowDuplicatedCategory:Dt.allowDuplicatedCategory,angle:Dt.angle,axisLine:Kr.axisLine,height:Dt.height,hide:!1,includeHidden:Dt.includeHidden,interval:Dt.interval,minTickGap:Dt.minTickGap,mirror:Dt.mirror,orientation:Dt.orientation,padding:Dt.padding,reversed:Dt.reversed,scale:Dt.scale,tick:Dt.tick,tickCount:Dt.tickCount,tickLine:Kr.tickLine,tickSize:Kr.tickSize,type:Dt.type,xAxisId:0},xY=e=>{var t=At(e,bY);return S.createElement(S.Fragment,null,S.createElement(yY,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit}),S.createElement(gY,t))},ao=S.memo(xY,qM);ao.displayName="XAxis";var SY=["dangerouslySetInnerHTML","ticks","scale"],wY=["id","scale"];function O0(){return O0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.current===null?t(eH(e)):n.current!==e&&t(tH({prev:n.current,next:e})),n.current=e},[e,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(nH(n.current)),n.current=null)},[t]),null}var _Y=e=>{var{yAxisId:t,className:n,width:a,label:l}=e,o=S.useRef(null),c=S.useRef(null),f=de(jE),d=mn(),h=Qe(),v="yAxis",p=de(C=>B$(C,t)),b=de(C=>q$(C,t)),x=de(C=>ST(C,v,t,d)),O=de(C=>eT(C,t));if(S.useLayoutEffect(()=>{if(!(a!=="auto"||!p||xg(l)||S.isValidElement(l)||O==null)){var C=o.current;if(C){var R=C.getCalculatedWidth();Math.round(p.width)!==Math.round(R)&&h(rH({id:t,width:R}))}}},[x,p,h,l,t,a,O]),p==null||b==null||O==null)return null;var{dangerouslySetInnerHTML:j,ticks:_,scale:E}=e,N=E_(e,SY),{id:M,scale:P}=O,T=E_(O,wY);return S.createElement(Ag,O0({},N,T,{ref:o,labelRef:c,x:b.x,y:b.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:p.width,height:p.height,className:Re("recharts-".concat(v," ").concat(v),n),viewBox:f,ticks:x,axisType:v}))},AY={allowDataOverflow:kt.allowDataOverflow,allowDecimals:kt.allowDecimals,allowDuplicatedCategory:kt.allowDuplicatedCategory,angle:kt.angle,axisLine:Kr.axisLine,hide:!1,includeHidden:kt.includeHidden,interval:kt.interval,minTickGap:kt.minTickGap,mirror:kt.mirror,orientation:kt.orientation,padding:kt.padding,reversed:kt.reversed,scale:kt.scale,tick:kt.tick,tickCount:kt.tickCount,tickLine:Kr.tickLine,tickSize:Kr.tickSize,type:kt.type,width:kt.width,yAxisId:0},EY=e=>{var t=At(e,AY);return S.createElement(S.Fragment,null,S.createElement(OY,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter}),S.createElement(_Y,t))},io=S.memo(EY,qM);io.displayName="YAxis";var NY=(e,t)=>t,Tg=V([NY,Ge,ZN,Nt,UT,ra,r7,zt],c7),Mg=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,a=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/a)}},BM=Vn("mouseClick"),IM=Eo();IM.startListening({actionCreator:BM,effect:(e,t)=>{var n=e.payload,a=Tg(t.getState(),Mg(n));a?.activeIndex!=null&&t.dispatch(tU({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}});var _0=Vn("mouseMove"),HM=Eo(),Oc=null;HM.startListening({actionCreator:_0,effect:(e,t)=>{var n=e.payload;Oc!==null&&cancelAnimationFrame(Oc);var a=Mg(n);Oc=requestAnimationFrame(()=>{var l=t.getState(),o=cg(l,l.tooltip.settings.shared);if(o==="axis"){var c=Tg(l,a);c?.activeIndex!=null?t.dispatch(CT({activeIndex:c.activeIndex,activeDataKey:void 0,activeCoordinate:c.activeCoordinate})):t.dispatch(MT())}Oc=null})}});function TY(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?"<>":t}var N_={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},KM=hn({name:"rootProps",initialState:N_,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:N_.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}}}),MY=KM.reducer,{updateOptions:CY}=KM.actions,YM=hn({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:DY}=YM.actions,kY=YM.reducer,GM=Vn("keyDown"),VM=Vn("focus"),Cg=Eo();Cg.startListening({actionCreator:GM,effect:(e,t)=>{var n=t.getState(),a=n.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:l}=n.tooltip,o=e.payload;if(!(o!=="ArrowRight"&&o!=="ArrowLeft"&&o!=="Enter")){var c=fg(l,Hl(n),Uo(n),Io(n)),f=c==null?-1:Number(c);if(!(!Number.isFinite(f)||f<0)){var d=ra(n);if(o==="Enter"){var h=Sf(n,"axis","hover",String(l.index));t.dispatch(y0({active:!l.active,activeIndex:l.index,activeCoordinate:h}));return}var v=Y$(n),p=v==="left-to-right"?1:-1,b=o==="ArrowRight"?1:-1,x=f+b*p;if(!(d==null||x>=d.length||x<0)){var O=Sf(n,"axis","hover",String(x));t.dispatch(y0({active:!0,activeIndex:x.toString(),activeCoordinate:O}))}}}}}});Cg.startListening({actionCreator:VM,effect:(e,t)=>{var n=t.getState(),a=n.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:l}=n.tooltip;if(!l.active&&l.index==null){var o="0",c=Sf(n,"axis","hover",String(o));t.dispatch(y0({active:!0,activeIndex:o,activeCoordinate:c}))}}}});var Hn=Vn("externalEvent"),XM=Eo(),_p=new Map;XM.startListening({actionCreator:Hn,effect:(e,t)=>{var{handler:n,reactEvent:a}=e.payload;if(n!=null){a.persist();var l=a.type,o=_p.get(l);o!==void 0&&cancelAnimationFrame(o);var c=requestAnimationFrame(()=>{try{var f=t.getState(),d={activeCoordinate:BU(f),activeDataKey:HT(f),activeIndex:Dl(f),activeLabel:IT(f),activeTooltipIndex:Dl(f),isTooltipActive:IU(f)};n(d,a)}finally{_p.delete(l)}});_p.set(l,c)}}});var PY=V([Bl],e=>e.tooltipItemPayloads),zY=V([PY,Bo,(e,t)=>t,(e,t,n)=>n],(e,t,n,a)=>{var l=e.find(f=>f.settings.graphicalItemId===a);if(l!=null){var{positions:o}=l;if(o!=null){var c=t(o,n);return c}}}),FM=Vn("touchMove"),ZM=Eo();ZM.startListening({actionCreator:FM,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var a=t.getState(),l=cg(a,a.tooltip.settings.shared);if(l==="axis"){var o=n.touches[0];if(o==null)return;var c=Tg(a,Mg({clientX:o.clientX,clientY:o.clientY,currentTarget:n.currentTarget}));c?.activeIndex!=null&&t.dispatch(CT({activeIndex:c.activeIndex,activeDataKey:void 0,activeCoordinate:c.activeCoordinate}))}else if(l==="item"){var f,d=n.touches[0];if(document.elementFromPoint==null||d==null)return;var h=document.elementFromPoint(d.clientX,d.clientY);if(!h||!h.getAttribute)return;var v=h.getAttribute(SE),p=(f=h.getAttribute(wE))!==null&&f!==void 0?f:void 0,b=Il(a).find(j=>j.id===p);if(v==null||b==null||p==null)return;var{dataKey:x}=b,O=zY(a,v,p);t.dispatch(TT({activeDataKey:x,activeIndex:v,activeCoordinate:O,activeGraphicalItemId:p}))}}}});var RY=HA({brush:hH,cartesianAxis:aH,chartData:B7,errorBars:cK,graphicalItems:sI,layout:m5,legend:bR,options:R7,polarAxis:bB,polarOptions:kY,referenceElements:xH,rootProps:MY,tooltip:nU,zIndex:O7}),LY=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Uz({reducer:RY,preloadedState:t,middleware:a=>{var l;return a({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((l="es6")!==null&&l!==void 0?l:"")}).concat([IM.middleware,HM.middleware,Cg.middleware,XM.middleware,ZM.middleware])},enhancers:a=>{var l=a;return typeof a=="function"&&(l=a()),l.concat(aE({type:"raf"}))},devTools:{serialize:{replacer:TY},name:"recharts-".concat(n)}})};function QM(e){var{preloadedState:t,children:n,reduxStoreName:a}=e,l=mn(),o=S.useRef(null);if(l)return n;o.current==null&&(o.current=LY(t,a));var c=Q0;return S.createElement(BK,{context:c,store:o.current},n)}function $Y(e){var{layout:t,margin:n}=e,a=Qe(),l=mn();return S.useEffect(()=>{l||(a(f5(t)),a(c5(n)))},[a,l,t,n]),null}var WM=S.memo($Y,Eg);function JM(e){var t=Qe();return S.useEffect(()=>{t(CY(e))},[t,e]),null}function T_(e){var{zIndex:t,isPanorama:n}=e,a=S.useRef(null),l=Qe();return S.useLayoutEffect(()=>(a.current&&l(w7({zIndex:t,element:a.current,isPanorama:n})),()=>{l(j7({zIndex:t,isPanorama:n}))}),[l,t,n]),S.createElement("g",{tabIndex:-1,ref:a})}function M_(e){var{children:t,isPanorama:n}=e,a=de(d7);if(!a||a.length===0)return t;var l=a.filter(c=>c<0),o=a.filter(c=>c>0);return S.createElement(S.Fragment,null,l.map(c=>S.createElement(T_,{key:c,zIndex:c,isPanorama:n})),t,o.map(c=>S.createElement(T_,{key:c,zIndex:c,isPanorama:n})))}var UY=["children"];function qY(e,t){if(e==null)return{};var n,a,l=BY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var n=iy(),a=ly(),l=qE();if(!yr(n)||!yr(a))return null;var{children:o,otherAttributes:c,title:f,desc:d}=e,h,v;return c!=null&&(typeof c.tabIndex=="number"?h=c.tabIndex:h=l?0:void 0,typeof c.role=="string"?v=c.role:v=l?"application":void 0),S.createElement($0,Ef({},c,{title:f,desc:d,role:v,tabIndex:h,width:n,height:a,style:IY,ref:t}),o)}),KY=e=>{var{children:t}=e,n=de(Vf);if(!n)return null;var{width:a,height:l,y:o,x:c}=n;return S.createElement($0,{width:a,height:l,x:c,y:o},t)},C_=S.forwardRef((e,t)=>{var{children:n}=e,a=qY(e,UY),l=mn();return l?S.createElement(KY,null,S.createElement(M_,{isPanorama:!0},n)):S.createElement(HY,Ef({ref:t},a),S.createElement(M_,{isPanorama:!1},n))});function YY(){var e=Qe(),[t,n]=S.useState(null),a=de(T5);return S.useEffect(()=>{if(t!=null){var l=t.getBoundingClientRect(),o=l.width/t.offsetWidth;wt(o)&&o!==a&&e(h5(o))}},[t,e,a]),n}function D_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function GY(e){for(var t=1;t(Z7(),null);function Nf(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var QY=S.forwardRef((e,t)=>{var n,a,l=S.useRef(null),[o,c]=S.useState({containerWidth:Nf((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Nf((a=e.style)===null||a===void 0?void 0:a.height)}),f=S.useCallback((h,v)=>{c(p=>{var b=Math.round(h),x=Math.round(v);return p.containerWidth===b&&p.containerHeight===x?p:{containerWidth:b,containerHeight:x}})},[]),d=S.useCallback(h=>{if(typeof t=="function"&&t(h),h!=null&&typeof ResizeObserver<"u"){var{width:v,height:p}=h.getBoundingClientRect();f(v,p);var b=O=>{var{width:j,height:_}=O[0].contentRect;f(j,_)},x=new ResizeObserver(b);x.observe(h),l.current=x}},[t,f]);return S.useEffect(()=>()=>{var h=l.current;h?.disconnect()},[f]),S.createElement(S.Fragment,null,S.createElement(Ff,{width:o.containerWidth,height:o.containerHeight}),S.createElement("div",Ai({ref:d},e)))}),WY=S.forwardRef((e,t)=>{var{width:n,height:a}=e,[l,o]=S.useState({containerWidth:Nf(n),containerHeight:Nf(a)}),c=S.useCallback((d,h)=>{o(v=>{var p=Math.round(d),b=Math.round(h);return v.containerWidth===p&&v.containerHeight===b?v:{containerWidth:p,containerHeight:b}})},[]),f=S.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:h,height:v}=d.getBoundingClientRect();c(h,v)}},[t,c]);return S.createElement(S.Fragment,null,S.createElement(Ff,{width:l.containerWidth,height:l.containerHeight}),S.createElement("div",Ai({ref:f},e)))}),JY=S.forwardRef((e,t)=>{var{width:n,height:a}=e;return S.createElement(S.Fragment,null,S.createElement(Ff,{width:n,height:a}),S.createElement("div",Ai({ref:t},e)))}),eG=S.forwardRef((e,t)=>{var{width:n,height:a}=e;return Yr(n)||Yr(a)?S.createElement(WY,Ai({},e,{ref:t})):S.createElement(JY,Ai({},e,{ref:t}))});function tG(e){return e===!0?QY:eG}var nG=S.forwardRef((e,t)=>{var{children:n,className:a,height:l,onClick:o,onContextMenu:c,onDoubleClick:f,onMouseDown:d,onMouseEnter:h,onMouseLeave:v,onMouseMove:p,onMouseUp:b,onTouchEnd:x,onTouchMove:O,onTouchStart:j,style:_,width:E,responsive:N,dispatchTouchEvents:M=!0}=e,P=S.useRef(null),T=Qe(),[C,R]=S.useState(null),[F,ee]=S.useState(null),q=YY(),U=ay(),B=U?.width>0?U.width:E,ue=U?.height>0?U.height:l,oe=S.useCallback(W=>{q(W),typeof t=="function"&&t(W),R(W),ee(W),W!=null&&(P.current=W)},[q,t,R,ee]),ve=S.useCallback(W=>{T(BM(W)),T(Hn({handler:o,reactEvent:W}))},[T,o]),K=S.useCallback(W=>{T(_0(W)),T(Hn({handler:h,reactEvent:W}))},[T,h]),te=S.useCallback(W=>{T(MT()),T(Hn({handler:v,reactEvent:W}))},[T,v]),z=S.useCallback(W=>{T(_0(W)),T(Hn({handler:p,reactEvent:W}))},[T,p]),G=S.useCallback(()=>{T(VM())},[T]),re=S.useCallback(W=>{T(GM(W.key))},[T]),k=S.useCallback(W=>{T(Hn({handler:c,reactEvent:W}))},[T,c]),Z=S.useCallback(W=>{T(Hn({handler:f,reactEvent:W}))},[T,f]),ie=S.useCallback(W=>{T(Hn({handler:d,reactEvent:W}))},[T,d]),le=S.useCallback(W=>{T(Hn({handler:b,reactEvent:W}))},[T,b]),ye=S.useCallback(W=>{T(Hn({handler:j,reactEvent:W}))},[T,j]),be=S.useCallback(W=>{M&&T(FM(W)),T(Hn({handler:O,reactEvent:W}))},[T,M,O]),he=S.useCallback(W=>{T(Hn({handler:x,reactEvent:W}))},[T,x]),ut=tG(N);return S.createElement(ZT.Provider,{value:C},S.createElement(lA.Provider,{value:F},S.createElement(ut,{width:B??_?.width,height:ue??_?.height,className:Re("recharts-wrapper",a),style:GY({position:"relative",cursor:"default",width:B,height:ue},_),onClick:ve,onContextMenu:k,onDoubleClick:Z,onFocus:G,onKeyDown:re,onMouseDown:ie,onMouseEnter:K,onMouseLeave:te,onMouseMove:z,onMouseUp:le,onTouchEnd:he,onTouchMove:be,onTouchStart:ye,ref:oe},S.createElement(ZY,null),n)))}),rG=["width","height","responsive","children","className","style","compact","title","desc"];function aG(e,t){if(e==null)return{};var n,a,l=iG(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{width:n,height:a,responsive:l,children:o,className:c,style:f,compact:d,title:h,desc:v}=e,p=aG(e,rG),b=Gn(p);return d?S.createElement(S.Fragment,null,S.createElement(Ff,{width:n,height:a}),S.createElement(C_,{otherAttributes:b,title:h,desc:v},o)):S.createElement(nG,{className:c,style:f,width:n,height:a,responsive:l??!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},S.createElement(C_,{otherAttributes:b,title:h,desc:v,ref:t},S.createElement(wH,null,o)))});function A0(){return A0=Object.assign?Object.assign.bind():function(e){for(var t=1;tS.createElement(oG,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:sG,tooltipPayloadSearcher:QT,categoricalChartProps:e,ref:t}));function cG(e){var t=Qe();return S.useEffect(()=>{t(DY(e))},[t,e]),null}var fG=["layout"];function E0(){return E0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=At(e,xG);return S.createElement(vG,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:bG,tooltipPayloadSearcher:QT,categoricalChartProps:n,ref:t})});function wG(e){return e===0?"$0.00":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function jG(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function OG({earnings:e,loading:t,error:n}){const[a,l]=S.useState("earnings"),[o,c]=S.useState(null),f=(e?.models??[]).map(p=>({model:p.model,value:a==="earnings"?p.total_usd:p.tokens_in+p.tokens_out,usd:p.total_usd,tokens:p.tokens_in+p.tokens_out,priced:p.priced})).filter(p=>p.value>0).sort((p,b)=>b.value-p.value),d=nA(e?.models),h=f.reduce((p,b)=>p+b.value,0),v=(e?.models??[]).filter(p=>!p.priced).length;return t&&!e?g.jsx("div",{className:"h-64 animate-pulse rounded-xl bg-slate-800/50"}):g.jsxs("div",{className:"min-w-0 overflow-hidden rounded-xl border border-slate-800 bg-slate-900/60",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-slate-800 px-4 py-3",children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Share by model"}),g.jsx("div",{className:"flex gap-1",role:"group","aria-label":"Distribute by",children:["earnings","tokens"].map(p=>g.jsx("button",{type:"button",onClick:()=>l(p),"aria-pressed":a===p,className:`rounded-lg px-3 py-1.5 text-xs font-medium capitalize transition focus:outline-none focus:ring-2 focus:ring-blue-500 ${a===p?"bg-slate-700 text-white":"text-slate-400 hover:bg-slate-800 hover:text-slate-200"}`,children:p},p))})]}),n&&!e?g.jsxs("div",{className:"px-4 py-8",children:[g.jsx("p",{className:"text-sm font-medium text-amber-200",children:"Traffic mix is unavailable"}),g.jsx("p",{className:"mt-1 text-xs text-slate-300",children:n.message})]}):f.length===0?g.jsxs("p",{className:"px-4 py-8 text-sm text-slate-400",children:["No ",a==="earnings"?"priced earnings":"traffic"," recorded since the node started."]}):g.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4 sm:flex-row sm:items-center",children:[g.jsx("div",{className:"h-40 w-40 shrink-0 self-center",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsx(SG,{children:g.jsx(_M,{data:f,dataKey:"value",nameKey:"model",innerRadius:"55%",outerRadius:"100%",paddingAngle:1,stroke:"none",isAnimationActive:!1,onMouseEnter:(p,b)=>c(b),onMouseLeave:()=>c(null),children:f.map((p,b)=>g.jsx(yd,{fill:Pc(d,f[b]?.model??""),opacity:o===null||o===b?1:.35},b))})})})}),g.jsx("ul",{className:"min-w-0 flex-1 space-y-1",children:f.map((p,b)=>{const x=h>0?p.value/h*100:0;return g.jsxs("li",{onMouseEnter:()=>c(b),onMouseLeave:()=>c(null),className:`flex items-start gap-2 rounded px-1 py-0.5 text-xs transition ${o===b?"bg-slate-800":""}`,children:[g.jsx("span",{className:"mt-0.5 block h-2.5 w-2.5 shrink-0 rounded-sm",style:{background:Pc(d,p.model)}}),g.jsx("span",{className:"min-w-0 flex-1 break-all font-mono text-slate-300",children:p.model}),g.jsxs("span",{className:"shrink-0 tabular-nums text-slate-300",children:[x.toFixed(1),"%"]}),g.jsx("span",{className:"w-20 shrink-0 text-right tabular-nums text-slate-400",children:a==="earnings"?wG(p.usd):jG(p.tokens)})]},p.model)})})]}),g.jsxs("p",{className:"flex items-start gap-2 border-t border-slate-800 px-4 py-3 text-xs text-slate-300",children:[g.jsx(Tf,{"aria-hidden":"true",size:14,className:"mt-px shrink-0"}),g.jsxs("span",{children:["Share of traffic served since this node last started — its counters reset on restart, so this is the recent mix rather than an all-time split. Probes are excluded.",v>0&&a==="earnings"&&` ${v} model(s) had no rate available and are absent from the earnings split; switch to tokens to see them.`]})]})]})}const z_={green:"text-green-400",red:"text-red-400",yellow:"text-yellow-400",blue:"text-blue-400",gray:"text-gray-400"};function Xu({title:e,value:t,subtitle:n,icon:a,color:l="blue"}){return g.jsxs("div",{className:"min-w-0 rounded-xl border border-slate-700 bg-slate-900 p-3 sm:p-4",children:[g.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[g.jsx("span",{className:"truncate text-xs text-slate-300 sm:text-sm",children:e}),a&&g.jsx("span",{"aria-hidden":"true",className:z_[l],children:a})]}),g.jsx("div",{className:`truncate text-lg font-bold sm:text-2xl ${z_[l]}`,title:String(t),children:t}),n&&g.jsx("div",{className:"mt-1 truncate text-[11px] text-slate-400 sm:text-xs",title:n,children:n})]})}function _G(e){return e===0?"$0.00":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function AG(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toFixed(0)}function EG({metrics:e,loading:t,error:n,earnings:a,earningsError:l,earningsLoading:o}){if(t)return g.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 md:gap-4 xl:grid-cols-5",children:[...Array(5)].map((x,O)=>g.jsxs("div",{className:"animate-pulse rounded-xl border border-slate-700 bg-slate-900 p-3 sm:p-4",children:[g.jsx("div",{className:"h-4 bg-slate-700 rounded w-20 mb-2"}),g.jsx("div",{className:"h-8 bg-slate-700 rounded w-16"})]},O))});const c=!!(e&&e.total_requests>0),f=c&&e?(e.successful_requests/e.total_requests*100).toFixed(1):null,d=!!a?.platform?.unavailable,h=!!l||!a&&!o||d,v=h?null:a?.platform?.uptime_7d_percent,p=v==null?"gray":v>=99?"green":v>=95?"yellow":"red",b=f==null?"gray":parseFloat(f)>=99?"green":parseFloat(f)>=95?"yellow":"red";return g.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 md:gap-4 xl:grid-cols-5",children:[g.jsx(Xu,{title:"7-day uptime",value:v==null?"--":`${v.toFixed(2)}%`,subtitle:o&&!a?"Loading platform data":h?"Platform data unavailable":"reported by Swan Inference",icon:g.jsx(Q_,{"aria-hidden":"true",size:20}),color:p}),g.jsx(Xu,{title:"Session success",value:f==null?"--":`${f}%`,subtitle:e?c?`${e.failed_requests} failed of ${AG(e.total_requests)}`:"No requests served yet":n?"Metrics API unavailable":"No data",icon:g.jsx(X_,{"aria-hidden":"true",size:20}),color:b}),g.jsx(Xu,{title:"P95 latency",value:e&&c?`${e.p95_latency_ms.toFixed(0)}ms`:"--",subtitle:e?c?`Average ${e.avg_latency_ms.toFixed(0)}ms · no SLA applied`:"No requests served yet":n?"Metrics API unavailable":"No data",icon:g.jsx(T0,{"aria-hidden":"true",size:20}),color:"blue"}),g.jsx(Xu,{title:"Request rate",value:e?`${e.requests_per_minute.toFixed(1)}/min`:"--",subtitle:e?`${e.active_requests} active now`:n?"Metrics API unavailable":"No data",icon:g.jsx(M0,{"aria-hidden":"true",size:20}),color:"blue"}),g.jsx(Xu,{title:"Lifetime earned",value:h||!a?"--":_G(a.platform.total_usd),subtitle:o&&!a?"Loading platform data":h?"Platform data unavailable":"authoritative platform total",icon:g.jsx(fD,{"aria-hidden":"true",size:20}),color:h?"gray":"green"})]})}function R_({value:e,max:t,color:n,label:a}){const l=t>0?e/t*100:0;return g.jsx("div",{className:"h-2 w-full rounded-full bg-slate-700",role:"progressbar","aria-label":a,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(Math.min(l,100)),children:g.jsx("div",{className:`h-2 rounded-full ${n}`,style:{width:`${Math.min(l,100)}%`}})})}function NG({gpus:e,loading:t,error:n}){if(t)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"GPU Status"}),g.jsx("div",{className:"animate-pulse space-y-4",children:g.jsx("div",{className:"h-20 bg-slate-700 rounded"})})]});if(!e||e.length===0)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"GPU Status"}),g.jsx("p",{className:"text-slate-400",children:n?"API unreachable":"No GPUs detected"})]});const a=Math.max(...e.map(o=>o.temperature_c)),l=e.filter(o=>o.utilization_percent>5).length;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"flex items-center justify-between mb-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"GPU capacity"}),g.jsxs("p",{className:"mt-0.5 text-xs text-slate-400",children:[l," active · peak ",a,"°C"]})]}),g.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-300",children:[g.jsx(hD,{"aria-hidden":"true",size:16}),g.jsxs("span",{children:[e.length," GPU",e.length>1?"s":""]})]})]}),g.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:e.map(o=>g.jsxs("div",{className:"border border-slate-700 rounded-lg p-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-slate-200",title:o.name,children:o.name}),g.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[g.jsx(ID,{"aria-hidden":"true",size:14,className:o.temperature_c>=90?"text-red-300":o.temperature_c>=85?"text-amber-300":"text-slate-300"}),g.jsxs("span",{className:o.temperature_c>=90?"text-red-300":o.temperature_c>=85?"text-amber-300":"text-slate-300",children:[o.temperature_c,"°C"]})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 flex justify-between text-xs text-slate-300",children:[g.jsx("span",{children:"Utilization"}),g.jsxs("span",{children:[o.utilization_percent.toFixed(0),"%"]})]}),g.jsx(R_,{value:o.utilization_percent,max:100,color:"bg-blue-500",label:`${o.name} utilization`})]}),o.memory_total_mb>0&&g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 flex justify-between text-xs text-slate-300",children:[g.jsx("span",{children:"Memory"}),g.jsxs("span",{children:[(o.memory_used_mb/1024).toFixed(1)," / ",(o.memory_total_mb/1024).toFixed(1)," GB"]})]}),g.jsx(R_,{value:o.memory_used_mb,max:o.memory_total_mb,color:o.memory_used_mb/o.memory_total_mb>=.98?"bg-red-500":o.memory_used_mb/o.memory_total_mb>=.95?"bg-amber-400":"bg-blue-500",label:`${o.name} memory allocation`})]})]})]},o.index))})]})}const L_={healthy:"bg-emerald-400",degraded:"bg-amber-400",unhealthy:"bg-red-500",unknown:"bg-slate-600"};function TG({samples:e}){if(!e||e.length===0)return null;const t=e.slice(-40),n=t.reduce((l,o)=>(l[o]=(l[o]??0)+1,l),{}),a=Object.entries(n).map(([l,o])=>`${o} ${l}`).join(", ");return g.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[g.jsx("div",{className:"flex gap-px",role:"img","aria-label":`Recent health: ${a}`,children:t.map((l,o)=>g.jsx("span",{title:l,className:`block h-3 w-1 rounded-sm ${L_[l]??L_.unknown}`},o))}),g.jsx("span",{className:"text-[10px] text-slate-400",children:"recent"})]})}const $_=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4});function MG({models:e,healthLog:t,prices:n,loading:a,error:l,onRefresh:o,onModelClick:c,authenticated:f,onUnlock:d,summary:h,compact:v=!1}){const[p,b]=S.useState(null),[x,O]=S.useState(""),[j,_]=S.useState(!1),E=()=>f?!0:(d(),!1),N=async U=>{if(E()){b(U.id),O("");try{U.enabled?await Ze.disableModel(U.id):await Ze.enableModel(U.id),o()}catch(B){O(B instanceof Error?B.message:"Failed to update model")}finally{b(null)}}},M=async U=>{if(E()){b(`health-${U}`),O("");try{await Ze.forceHealthCheck(U),o()}catch(B){O(B instanceof Error?B.message:"Failed to run health check")}finally{b(null)}}},P=async()=>{if(E()){b("reload"),O("");try{await Ze.reloadModels(),o()}catch(U){O(U instanceof Error?U.message:"Failed to reload models")}finally{b(null)}}};if(a)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"Models"}),g.jsx("div",{className:"animate-pulse space-y-3",children:[...Array(2)].map((U,B)=>g.jsx("div",{className:"h-16 bg-slate-700 rounded"},B))})]});const T=U=>U.health_string==="healthy",C=e.filter(U=>!U.enabled||!T(U)),R=v&&!j?C:e,F=h?.ready??e.filter(U=>U.enabled&&T(U)).length,ee=h?.unhealthy??e.filter(U=>U.enabled&&!T(U)).length,q=h?.disabled??e.filter(U=>!U.enabled).length;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Models"}),g.jsxs("p",{className:"mt-0.5 text-xs text-slate-400",children:[F," ready",ee>0&&` · ${ee} unhealthy`,q>0&&` · ${q} disabled`]})]}),g.jsxs("button",{type:"button",onClick:P,disabled:p==="reload",className:"flex min-h-10 items-center gap-1.5 rounded-lg border border-slate-600 bg-slate-800 px-3 text-sm transition-colors hover:bg-slate-700 disabled:opacity-50",children:[f?g.jsx(D0,{"aria-hidden":"true",size:14,className:p==="reload"?"animate-spin":""}):g.jsx(C0,{"aria-hidden":"true",size:14}),"Reload Config"]})]}),x&&g.jsx("p",{role:"alert",className:"mb-3 rounded-lg border border-red-800/60 bg-red-950/30 px-3 py-2 text-sm text-red-300",children:x}),!e||e.length===0?g.jsx("p",{className:"text-slate-400",children:l?"API unreachable":"No models configured"}):v&&!j&&C.length===0?g.jsxs("div",{className:"rounded-lg border border-emerald-900/60 bg-emerald-950/20 px-4 py-5 text-center",children:[g.jsx(wl,{"aria-hidden":"true",size:24,className:"mx-auto text-emerald-300"}),g.jsx("p",{className:"mt-2 text-sm font-medium text-emerald-100",children:"All configured models are ready"}),g.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Healthy models are collapsed to keep operational exceptions visible."})]}):g.jsx("div",{className:"space-y-3",children:R.map(U=>{const B=n[U.id];return g.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border border-slate-600 bg-slate-700/50 p-3 transition-colors hover:border-slate-500 sm:items-center",children:[g.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-start gap-3 rounded text-left focus:outline-none focus:ring-2 focus:ring-blue-500 sm:items-center",onClick:()=>c?.(U.id),"aria-label":`View details for ${U.id}`,children:[g.jsx("div",{className:"flex-shrink-0",children:U.enabled?T(U)?g.jsx(wl,{size:20,className:"text-green-400"}):g.jsx(Pa,{size:20,className:"text-red-400"}):g.jsx(Tf,{size:20,className:"text-slate-400"})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"break-words font-medium text-slate-200",children:U.id}),g.jsxs("div",{className:"mt-0.5 break-all text-xs text-slate-400",children:[U.endpoint," • ",U.category,U.gpu_memory>0&&` • ${(U.gpu_memory/1024).toFixed(1)}GB VRAM`]}),g.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[U.state_string," • ",U.health_string]}),g.jsx(TG,{samples:t?.[U.id]??[]}),B&&g.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[g.jsx("span",{className:"font-medium text-emerald-300",children:"Provider payout / 1M"}),g.jsxs("span",{className:"text-blue-200",children:["In ",$_.format(B.provider_input_price)]}),g.jsxs("span",{className:"text-violet-200",children:["Out ",$_.format(B.provider_output_price)]})]})]})]}),g.jsxs("div",{className:"flex flex-shrink-0 items-center gap-1 sm:gap-2",children:[g.jsx("button",{type:"button",onClick:()=>M(U.id),disabled:p===`health-${U.id}`||!U.enabled,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-slate-600 rounded transition-colors disabled:opacity-50",title:"Force health check","aria-label":`Run health check for ${U.id}`,children:g.jsx(Pl,{size:16,className:p===`health-${U.id}`?"animate-spin":""})}),g.jsx("button",{type:"button",onClick:()=>N(U),disabled:p===U.id,className:`p-2 rounded transition-colors ${U.enabled?"text-green-400 hover:text-green-300 hover:bg-green-900/30":"text-slate-400 hover:text-slate-300 hover:bg-slate-600"} disabled:opacity-50`,title:U.enabled?"Disable model":"Enable model","aria-label":`${U.enabled?"Disable":"Enable"} ${U.id}`,children:g.jsx(AD,{size:16})})]})]},U.id)})}),v&&e.length>0&&g.jsxs("button",{type:"button",onClick:()=>_(U=>!U),className:"mt-4 inline-flex min-h-10 w-full items-center justify-center gap-2 rounded-lg border border-slate-700 bg-slate-950/40 px-3 text-sm text-slate-200 transition hover:border-slate-600 hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-expanded":j,children:[j?g.jsx(Ep,{"aria-hidden":"true",size:16}):g.jsx(kc,{"aria-hidden":"true",size:16}),j?"Hide healthy models":`Show all ${e.length} models`]})]})}function CG({data:e,loading:t,error:n,onOpenSettings:a}){if(t)return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsx("h3",{className:"mb-4 text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("div",{className:"h-28 animate-pulse rounded-lg bg-slate-800"})]});if(!e)return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsx("h3",{className:"mb-4 text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("p",{className:"text-sm text-slate-400",children:n?"API unreachable":"No control data available"})]});const{rate_limiter:l,concurrency_limiter:o,retry_policy:c}=e;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("p",{className:"mt-0.5 text-xs text-slate-400",children:"Current admission and retry state"})]}),g.jsx("button",{type:"button",onClick:a,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded-lg text-slate-400 transition hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Open request limit settings",children:g.jsx($D,{"aria-hidden":"true",size:18})})]}),g.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-3",children:[g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(M0,{"aria-hidden":"true",size:14,className:"text-blue-400"}),g.jsx("span",{children:"Rate limit"})]}),g.jsxs("div",{className:"mt-2 text-lg font-semibold text-white",children:[l.current_rate.toFixed(0)," ",g.jsx("span",{className:"text-xs font-normal text-slate-400",children:"req/s"})]}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[l.total_throttled," throttled · burst ",l.burst_size]})]}),g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(yD,{"aria-hidden":"true",size:14,className:"text-emerald-400"}),g.jsx("span",{children:"Concurrency"})]}),g.jsxs("div",{className:"mt-2 text-lg font-semibold text-white",children:[o.global_active,g.jsxs("span",{className:"text-slate-400",children:["/",o.global_max]})]}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:["active slots · ",o.total_rejected," rejected"]})]}),g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(D0,{"aria-hidden":"true",size:14,className:"text-amber-300"}),g.jsx("span",{children:"Retry recovery"})]}),g.jsx("div",{className:"mt-2 text-lg font-semibold text-white",children:c.total_retries>0?`${(c.retry_success_rate*100).toFixed(0)}%`:"—"}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[c.total_successes," recovered · ",c.total_failures," failed"]})]})]})]})}function DG(e){return e?`Updated ${e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"})}`:""}function kG({status:e,loading:t,error:n,lastUpdated:a}){return t?g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg bg-slate-700/50 px-3 py-2",children:[g.jsx("div",{className:"w-3 h-3 bg-slate-600 rounded-full animate-pulse"}),g.jsx("span",{className:"text-sm text-slate-300",children:"Connecting…"})]}):!e&&n?g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg border border-amber-800 bg-amber-900/20 px-3 py-2",children:[g.jsx(Np,{"aria-hidden":"true",size:16,className:"text-amber-300"}),g.jsx("span",{className:"text-sm text-amber-200",children:"API unavailable"})]}):e?g.jsxs("div",{title:n?.message,className:`flex min-h-10 items-center gap-2 rounded-lg border px-2.5 py-2 sm:gap-3 sm:px-3 ${n?"border-amber-800 bg-amber-900/20":e.connected?"border-green-800 bg-green-900/20":"border-red-800 bg-red-900/20"}`,children:[g.jsx("div",{className:"flex items-center gap-2",children:n?g.jsxs(g.Fragment,{children:[g.jsx(Np,{"aria-hidden":"true",size:16,className:"text-amber-300"}),g.jsx("span",{className:"text-sm font-medium text-amber-200",children:"Stale"})]}):e.connected?g.jsxs(g.Fragment,{children:[g.jsx(XD,{"aria-hidden":"true",size:16,className:"text-green-400"}),g.jsx("span",{className:"text-sm font-medium text-green-300",children:"Connected"})]}):g.jsxs(g.Fragment,{children:[g.jsx(HS,{"aria-hidden":"true",size:16,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-red-300",children:"Disconnected"})]})}),!n&&g.jsxs("div",{className:"ml-auto hidden text-xs text-slate-300 md:block",children:[DG(a),e.active_models?.length>0&&` · ${e.active_models.length} model${e.active_models.length>1?"s":""}`]})]}):g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg bg-slate-700/50 px-3 py-2",children:[g.jsx(HS,{"aria-hidden":"true",size:16,className:"text-slate-300"}),g.jsx("span",{className:"text-sm text-slate-300",children:"No data"})]})}function N0(e,t=!1){if(!e)return"—";const n=new Date(e);return t?n.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"}):n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"})}function U_(e){return e<1e3?`${e.toFixed(0)} ms`:`${(e/1e3).toFixed(2)} s`}function q_(e){return e>5e3?"text-red-300":e>2e3?"text-amber-300":"text-emerald-300"}const lo={hub:{label:"Hub",title:"Routed to this node by Swan Inference",className:"bg-blue-500/10 text-blue-300 ring-blue-500/30"},health:{label:"Health",title:"This node's own engine probe: a one-token completion checking the backend can serve",className:"bg-slate-500/10 text-slate-400 ring-slate-500/30"},selfcheck:{label:"Self-check",title:"This node's periodic audit probe",className:"bg-slate-500/10 text-slate-400 ring-slate-500/30"}},B_=[25,50,100];function I_({source:e}){const t=lo[e??"hub"]??lo.hub;return g.jsx("span",{title:t.title,className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset ${t.className}`,children:t.label})}function H_({success:e}){return e?g.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-emerald-800/70 bg-emerald-950/40 px-2 py-1 text-xs font-medium text-emerald-300",children:[g.jsx(wl,{"aria-hidden":"true",size:13})," Success"]}):g.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-red-800/70 bg-red-950/40 px-2 py-1 text-xs font-medium text-red-300",children:[g.jsx(Pa,{"aria-hidden":"true",size:13})," Failed"]})}function K_({request:e}){return g.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Request ID"}),g.jsx("span",{className:"mt-1 block break-all font-mono text-slate-300",children:e.request_id})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Completed"}),g.jsx("span",{className:"mt-1 block text-slate-300",children:N0(e.end_time,!0)})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Total tokens"}),g.jsx("span",{className:"mt-1 block font-mono text-slate-300",children:(e.tokens_in+e.tokens_out).toLocaleString()})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Delivery"}),g.jsx("span",{className:"mt-1 block text-slate-300",children:e.streaming?"Streaming":"Single response"})]}),e.error_reason&&g.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[g.jsx("span",{className:"block text-slate-400",children:"Error"}),g.jsx("span",{className:"mt-1 block break-words text-red-300",children:e.error_reason})]})]})}function PG({models:e}){const[t,n]=S.useState(""),[a,l]=S.useState(""),[o,c]=S.useState(B_[0]),[f,d]=S.useState(0),[h,v]=S.useState(null),p=q=>{q(),d(0),v(null)},{data:b,error:x,loading:O,refetch:j}=Da(S.useCallback(()=>Ze.getRequestHistory({limit:o,offset:f*o,model:t||void 0,source:a||void 0}),[o,f,t,a]),f===0?1e4:0),_=b?.requests??[],E=b?.total??0,N=_.reduce((q,U)=>q+U.tokens_in,0),M=_.reduce((q,U)=>q+U.tokens_out,0),P=q=>v(U=>U===q?null:q),T=Math.max(1,Math.ceil(E/o)),C=E===0?0:f*o+1,R=f*o+_.length,F=f>0,ee=Rp(()=>n(q.target.value)),className:"min-h-10 min-w-0 flex-1 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 sm:min-w-56",children:[g.jsx("option",{value:"",children:"All models"}),e.map(q=>g.jsx("option",{value:q.id,children:q.id},q.id))]}),g.jsx("label",{htmlFor:"transaction-source-filter",className:"sr-only",children:"Filter requests by source"}),g.jsxs("select",{id:"transaction-source-filter",value:a,onChange:q=>p(()=>l(q.target.value)),className:"min-h-10 min-w-0 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",children:[g.jsx("option",{value:"",children:"All sources"}),Object.entries(lo).map(([q,U])=>g.jsx("option",{value:q,children:U.label},q))]}),g.jsx("button",{type:"button",onClick:j,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Refresh requests",children:g.jsx(Pl,{"aria-hidden":"true",size:16,className:O?"animate-spin":""})})]})]}),g.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[g.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-900 p-3 sm:p-4",children:[g.jsx("p",{className:"text-xs text-slate-400",children:"Matching"}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:E.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:t||a?"requests match the filters":"requests in history"})]}),g.jsxs("div",{className:"rounded-xl border border-blue-900/70 bg-blue-950/20 p-3 sm:p-4",children:[g.jsxs("p",{className:"flex items-center gap-1 text-xs text-blue-300",children:[g.jsx(Hm,{"aria-hidden":"true",size:13})," Input tokens"]}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:N.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:"across rows shown"})]}),g.jsxs("div",{className:"rounded-xl border border-violet-900/70 bg-violet-950/20 p-3 sm:p-4",children:[g.jsxs("p",{className:"flex items-center gap-1 text-xs text-violet-300",children:[g.jsx(Km,{"aria-hidden":"true",size:13})," Output tokens"]}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:M.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:"across rows shown"})]})]}),g.jsx("div",{className:"overflow-hidden rounded-xl border border-slate-800 bg-slate-900",children:O&&_.length===0?g.jsx("div",{className:"animate-pulse space-y-3 p-4",role:"status","aria-label":"Loading transactions",children:[...Array(6)].map((q,U)=>g.jsx("div",{className:"h-14 rounded-lg bg-slate-800"},U))}):x&&_.length===0?g.jsxs("div",{className:"px-4 py-12 text-center",children:[g.jsx(Pa,{"aria-hidden":"true",size:32,className:"mx-auto mb-3 text-red-400"}),g.jsx("p",{className:"font-medium text-red-200",children:"Requests are unavailable"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:x.message}),g.jsx("button",{type:"button",onClick:j,className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white",children:"Try again"})]}):_.length===0?g.jsxs("div",{className:"px-4 py-12 text-center text-slate-400",children:[g.jsx(T0,{"aria-hidden":"true",size:32,className:"mx-auto mb-3 text-slate-600"}),t||a?g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"font-medium text-slate-300",children:"No requests match these filters"}),g.jsxs("p",{className:"mt-1 text-sm",children:["Nothing recorded for ",a?`${lo[a].label.toLowerCase()} traffic`:"this source",t?` on ${t}`:""," yet."]}),g.jsx("button",{type:"button",onClick:()=>p(()=>{n(""),l("")}),className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-500",children:"Clear filters"})]}):g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"font-medium text-slate-300",children:"No requests yet"}),g.jsx("p",{className:"mt-1 text-sm",children:"Requests will appear here after the provider serves inference."})]})]}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"hidden overflow-x-auto md:block",children:g.jsxs("table",{className:"w-full min-w-[840px] text-sm",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"border-b border-slate-800 bg-slate-950/40 text-xs uppercase tracking-wide text-slate-400",children:[g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Started"}),g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Model"}),g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Source"}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Latency"}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx(Hm,{"aria-hidden":"true",size:13})," Input tokens"]})}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx(Km,{"aria-hidden":"true",size:13})," Output tokens"]})}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Status"}),g.jsx("th",{className:"w-12 px-3 py-3",children:g.jsx("span",{className:"sr-only",children:"Details"})})]})}),g.jsx("tbody",{children:_.map(q=>{const U=h===q.request_id;return g.jsxs(S.Fragment,{children:[g.jsxs("tr",{className:`border-b border-slate-800/80 ${q.success?"hover:bg-slate-800/35":"bg-red-950/10 hover:bg-red-950/20"}`,children:[g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-slate-300",title:new Date(q.start_time).toLocaleString(),children:N0(q.start_time)}),g.jsxs("td",{className:"max-w-xs px-4 py-3",children:[g.jsx("span",{className:"block truncate font-mono text-xs text-slate-200",title:q.model,children:q.model}),q.streaming&&g.jsx("span",{className:"mt-0.5 block text-xs text-blue-300",children:"Streaming"})]}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3",children:g.jsx(I_,{source:q.source})}),g.jsx("td",{className:`whitespace-nowrap px-4 py-3 text-right font-mono text-xs ${q_(q.latency_ms)}`,children:U_(q.latency_ms)}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-right font-mono text-sm text-blue-200",children:q.tokens_in.toLocaleString()}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-right font-mono text-sm text-violet-200",children:q.tokens_out.toLocaleString()}),g.jsx("td",{className:"px-4 py-3 text-right",children:g.jsx(H_,{success:q.success})}),g.jsx("td",{className:"px-3 py-3 text-right",children:g.jsx("button",{type:"button",onClick:()=>P(q.request_id),"aria-expanded":U,"aria-controls":`receipt-${q.request_id}`,className:"rounded-lg p-2 text-slate-400 hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":`${U?"Hide":"Show"} details for request ${q.request_id}`,children:U?g.jsx(Ep,{"aria-hidden":"true",size:16}):g.jsx(kc,{"aria-hidden":"true",size:16})})})]}),U&&g.jsx("tr",{id:`receipt-${q.request_id}`,className:"border-b border-slate-800 bg-slate-950/60",children:g.jsx("td",{colSpan:8,className:"px-4 py-4",children:g.jsx(K_,{request:q})})})]},q.request_id)})})]})}),g.jsx("div",{className:"divide-y divide-slate-800 md:hidden",children:_.map(q=>{const U=h===q.request_id;return g.jsxs("article",{className:q.success?"":"bg-red-950/10",children:[g.jsxs("button",{type:"button",onClick:()=>P(q.request_id),"aria-expanded":U,"aria-controls":`mobile-receipt-${q.request_id}`,className:"w-full p-4 text-left focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:"truncate font-mono text-sm text-white",children:q.model}),g.jsxs("p",{className:"mt-1 text-xs text-slate-400",children:[N0(q.start_time,!0),q.streaming?" · Streaming":""]})]}),g.jsxs("span",{className:"mt-0.5 flex shrink-0 items-center gap-2 text-slate-400",children:[g.jsx(I_,{source:q.source}),U?g.jsx(Ep,{"aria-hidden":"true",size:18}):g.jsx(kc,{"aria-hidden":"true",size:18})]})]}),g.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-2",children:[g.jsxs("div",{children:[g.jsx("span",{className:"block text-[11px] text-slate-400",children:"Latency"}),g.jsx("span",{className:`mt-0.5 block font-mono text-xs ${q_(q.latency_ms)}`,children:U_(q.latency_ms)})]}),g.jsxs("div",{children:[g.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-blue-300",children:[g.jsx(Hm,{"aria-hidden":"true",size:11})," Input"]}),g.jsx("span",{className:"mt-0.5 block font-mono text-sm text-blue-100",children:q.tokens_in.toLocaleString()})]}),g.jsxs("div",{children:[g.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-violet-300",children:[g.jsx(Km,{"aria-hidden":"true",size:11})," Output"]}),g.jsx("span",{className:"mt-0.5 block font-mono text-sm text-violet-100",children:q.tokens_out.toLocaleString()})]})]}),g.jsx("div",{className:"mt-3",children:g.jsx(H_,{success:q.success})})]}),U&&g.jsx("div",{id:`mobile-receipt-${q.request_id}`,className:"border-t border-slate-800 bg-slate-950/60 p-4",children:g.jsx(K_,{request:q})})]},q.request_id)})})]})}),g.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[g.jsxs("p",{className:"text-xs text-slate-400","aria-live":"polite",children:[E===0?"No requests to show.":`Showing ${C.toLocaleString()}–${R.toLocaleString()} of ${E.toLocaleString()}`,t?` for ${t}`:"",a?` from ${lo[a].label.toLowerCase()}`:"",". ",f===0?"Auto-refreshes every 10 seconds.":"Auto-refresh is paused while viewing older pages."]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("label",{htmlFor:"transaction-page-size",className:"text-xs text-slate-400",children:"Per page"}),g.jsx("select",{id:"transaction-page-size",value:o,onChange:q=>p(()=>c(Number(q.target.value))),className:"min-h-9 rounded-lg border border-slate-700 bg-slate-900 px-2 text-xs text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",children:B_.map(q=>g.jsx("option",{value:q,children:q},q))}),g.jsxs("div",{className:"ml-1 flex items-center gap-1",children:[g.jsx("button",{type:"button",onClick:()=>{d(q=>Math.max(0,q-1)),v(null)},disabled:!F,className:"inline-flex min-h-9 min-w-9 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-40 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Previous page",children:g.jsx(W4,{"aria-hidden":"true",size:16})}),g.jsxs("span",{className:"px-2 text-xs tabular-nums text-slate-400",children:[f+1," / ",T]}),g.jsx("button",{type:"button",onClick:()=>{d(q=>q+1),v(null)},disabled:!ee,className:"inline-flex min-h-9 min-w-9 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-40 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Next page",children:g.jsx(eD,{"aria-hidden":"true",size:16})})]})]})]})]})}const Ap={"1h":{duration:"1h",resolution:"1m",label:"1 Hour"},"6h":{duration:"6h",resolution:"5m",label:"6 Hours"},"24h":{duration:"24h",resolution:"15m",label:"24 Hours"},"7d":{duration:"168h",resolution:"1h",label:"7 Days"}};function zG(){const[e,t]=S.useState("1h"),n=Ap[e],{data:a,error:l,loading:o,refetch:c}=Da(S.useCallback(()=>Ze.getMetricsHistory(n.duration,n.resolution),[n.duration,n.resolution]),6e4),f=a?.data??[],d=N=>{const M=new Date(N);return e==="7d"?M.toLocaleDateString(void 0,{weekday:"short",day:"numeric"}):e==="24h"?M.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):M.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})},h=f.map(N=>({time:d(N.timestamp),requests:N.total_requests,successRate:N.success_rate,avgLatency:N.avg_latency_ms,p99Latency:N.p99_latency_ms,tokensPerSec:N.tokens_per_second})),v=h[h.length-1],p=h.flatMap(N=>[N.avgLatency,N.p99Latency]),b=p.length>0?Math.min(...p):0,x=p.length>0?Math.max(...p):0,O=h.length>0?Math.min(...h.map(N=>N.successRate)):0,j=h.length>0?Math.max(...h.map(N=>N.successRate)):0,_=h.length>0?Math.min(...h.map(N=>N.tokensPerSec)):0,E=h.length>0?Math.max(...h.map(N=>N.tokensPerSec)):0;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(IS,{size:20,className:"text-purple-400"}),g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Performance trends"}),g.jsx("p",{className:"mt-0.5 text-xs text-slate-400",children:"Persisted service signals across one shared time range"})]})]}),g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("div",{className:"flex min-w-0 flex-1 overflow-x-auto rounded-lg bg-slate-800 p-0.5 sm:flex-none",children:Object.keys(Ap).map(N=>g.jsx("button",{onClick:()=>t(N),className:`min-h-10 flex-1 whitespace-nowrap rounded px-2 py-1 text-xs font-medium transition-colors sm:flex-none sm:px-3 ${e===N?"bg-blue-600 text-white":"text-slate-400 hover:text-slate-200"}`,children:Ap[N].label},N))}),g.jsx("button",{type:"button",onClick:c,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded text-slate-300 transition-colors hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500",title:"Refresh","aria-label":"Refresh performance trends",children:g.jsx(Pl,{size:16,className:o?"animate-spin":""})})]})]}),l&&g.jsxs("div",{role:"alert",className:"mb-4 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-800/70 bg-amber-950/30 px-3 py-2 text-sm text-amber-100",children:[g.jsx("span",{children:a?"Showing the last loaded trends; refresh failed.":`Performance trends are unavailable: ${l.message}`}),g.jsx("button",{type:"button",onClick:c,className:"min-h-10 rounded-lg border border-amber-700/70 px-3 text-sm hover:bg-amber-900/30",children:"Try again"})]}),o&&h.length===0?g.jsx("div",{className:"h-64 flex items-center justify-center",children:g.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full"})}):h.length<2?g.jsx("div",{className:"h-64 flex items-center justify-center text-slate-400",children:g.jsxs("div",{className:"text-center",children:[g.jsx(IS,{size:32,className:"mx-auto mb-2 opacity-50"}),g.jsx("p",{children:"Not enough historical data yet"}),g.jsx("p",{className:"text-xs mt-1",children:"Data is recorded every minute"})]})}):g.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[g.jsxs("div",{role:"img","aria-label":`Latency ranged from ${b.toFixed(0)} to ${x.toFixed(0)} milliseconds. Latest average ${v?.avgLatency.toFixed(0)} milliseconds and P99 ${v?.p99Latency.toFixed(0)} milliseconds.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Latency (ms)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:N=>[(typeof N=="number"?N.toFixed(1):N)+"ms",""]}),g.jsx(UE,{wrapperStyle:{fontSize:"10px"},formatter:N=>g.jsx("span",{className:"text-slate-400",children:N})}),g.jsx(Sl,{type:"monotone",dataKey:"avgLatency",stroke:"#3b82f6",strokeWidth:2,dot:!1,name:"Avg"}),g.jsx(Sl,{type:"monotone",dataKey:"p99Latency",stroke:"#ef4444",strokeWidth:1.5,dot:!1,name:"P99"})]})})})]}),g.jsxs("div",{role:"img","aria-label":`Success rate ranged from ${O.toFixed(1)} to ${j.toFixed(1)} percent. Latest ${v?.successRate.toFixed(1)} percent.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Success rate (%)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1,domain:[0,100]}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:N=>[(typeof N=="number"?N.toFixed(1):N)+"%","Success Rate"]}),g.jsx(Sl,{type:"monotone",dataKey:"successRate",stroke:"#22c55e",strokeWidth:2,dot:!1,name:"Success Rate"})]})})})]}),g.jsxs("div",{role:"img","aria-label":`Throughput ranged from ${_.toFixed(1)} to ${E.toFixed(1)} tokens per second. Latest ${v?.tokensPerSec.toFixed(1)} tokens per second.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Throughput (tokens/sec)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:N=>[typeof N=="number"?N.toFixed(1):N,"Tokens/sec"]}),g.jsx(Sl,{type:"monotone",dataKey:"tokensPerSec",stroke:"#a855f7",strokeWidth:2,dot:!1,name:"Tokens/sec"})]})})})]})]}),g.jsxs("div",{className:"mt-4 text-center text-xs text-slate-400",children:["Showing ",n.label," of data (",n.resolution," resolution)"]})]})}function RG({modelId:e,onClose:t}){const[n,a]=S.useState(null),[l,o]=S.useState(!0),[c,f]=S.useState(null),d=S.useRef(null),h=S.useRef(null),v=S.useRef(null);S.useEffect(()=>{v.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const N=document.body.style.overflow;document.body.style.overflow="hidden",window.setTimeout(()=>h.current?.focus(),0);const M=P=>{if(P.key==="Escape"){P.preventDefault(),t();return}if(P.key!=="Tab"||!d.current)return;const T=Array.from(d.current.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')),C=T[0],R=T[T.length-1];!C||!R||(P.shiftKey&&document.activeElement===C?(P.preventDefault(),R.focus()):!P.shiftKey&&document.activeElement===R&&(P.preventDefault(),C.focus()))};return window.addEventListener("keydown",M),()=>{window.removeEventListener("keydown",M),document.body.style.overflow=N,v.current?.focus()}},[t]),S.useEffect(()=>{const N=async()=>{o(!0),f(null);try{const P=await Ze.getModelMetrics(e);a(P)}catch(P){f(P instanceof Error?P.message:"Failed to load model metrics")}finally{o(!1)}};N();const M=setInterval(N,5e3);return()=>clearInterval(M)},[e]);const p=N=>N?new Date(N).toLocaleTimeString():"-",b=N=>N<1e3?`${N.toFixed(0)}ms`:`${(N/1e3).toFixed(2)}s`,x=N=>N<1e3?N.toLocaleString():N<1e6?`${(N/1e3).toFixed(1)}K`:`${(N/1e6).toFixed(1)}M`,O=N=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(N),j=n?.price?((n.metrics?.total_tokens_in??0)*n.price.provider_input_price+(n.metrics?.total_tokens_out??0)*n.price.provider_output_price)/1e6:null,_=n?.health?.health_string==="healthy"||n?.model?.health_string==="healthy",E=(n?.recent_requests??[]).slice().reverse().map(N=>({time:p(N.start_time),latency:N.latency_ms}));return g.jsx("div",{ref:d,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-2 sm:p-4",onClick:t,role:"dialog","aria-modal":"true","aria-labelledby":"model-detail-title","aria-describedby":"model-detail-description",children:g.jsxs("div",{className:"max-h-[94vh] w-full max-w-4xl overflow-y-auto rounded-xl border border-slate-700 bg-slate-900",onClick:N=>N.stopPropagation(),children:[g.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{children:[g.jsx("h2",{id:"model-detail-title",className:"break-words text-xl font-semibold text-slate-100",children:e}),g.jsx("p",{id:"model-detail-description",className:"text-sm text-slate-300",children:"Health, usage, pricing, and recent requests"})]}),g.jsx("button",{ref:h,type:"button",onClick:t,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded text-slate-300 transition-colors hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Close model details",children:g.jsx(W_,{"aria-hidden":"true",size:20})})]}),l&&!n?g.jsxs("div",{className:"p-8 text-center",children:[g.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full mx-auto"}),g.jsx("p",{className:"mt-4 text-slate-400",children:"Loading model metrics..."})]}):c?g.jsxs("div",{className:"p-8 text-center",children:[g.jsx(Pa,{size:32,className:"mx-auto text-red-400 mb-2"}),g.jsx("p",{className:"text-red-400",children:c})]}):g.jsxs("div",{className:"p-4 space-y-6",children:[g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[_?g.jsx(wl,{size:20,className:"text-green-400"}):g.jsx(Pa,{size:20,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Health Status"})]}),g.jsx("p",{className:`text-lg font-semibold ${_?"text-green-400":"text-red-400"}`,children:_?"Healthy":"Unhealthy"}),n?.health?.consecutive_fails?g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n.health.consecutive_fails," consecutive failures"]}):null]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(X_,{size:20,className:"text-blue-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Total Requests"})]}),g.jsx("p",{className:"text-lg font-semibold text-slate-100",children:n?.metrics?.total_requests?.toLocaleString()??0}),g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n?.metrics?.successful_requests??0," successful, ",n?.metrics?.failed_requests??0," failed"]})]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(T0,{size:20,className:"text-yellow-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Avg Latency"})]}),g.jsx("p",{className:"text-lg font-semibold text-slate-100",children:b(n?.metrics?.avg_latency_ms??0)}),g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n?.metrics?.active_requests??0," active requests"]})]})]}),g.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[g.jsxs("div",{className:"rounded-lg bg-slate-700/50 p-4",children:[g.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[g.jsx(QD,{size:20,className:"text-purple-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Token usage"})]}),g.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center sm:gap-4",children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:x(n?.metrics?.total_tokens_in??0)}),g.jsx("p",{className:"text-xs text-blue-200",children:"Input tokens"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:x(n?.metrics?.total_tokens_out??0)}),g.jsx("p",{className:"text-xs text-violet-200",children:"Output tokens"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:(n?.metrics?.tokens_per_second??0).toFixed(1)}),g.jsx("p",{className:"text-xs text-slate-400",children:"Tokens/sec"})]})]})]}),g.jsxs("div",{className:"rounded-lg border border-emerald-800/50 bg-emerald-950/20 p-4",children:[g.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[g.jsx(uD,{size:20,className:"text-emerald-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Provider payout / 1M tokens"}),n?.price?.tier&&g.jsx("span",{className:"ml-auto rounded-full border border-slate-600 px-2 py-0.5 text-[10px] uppercase tracking-wide text-slate-400",children:n.price.tier})]}),n?.price?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-xl font-semibold text-blue-100",children:O(n.price.provider_input_price)}),g.jsx("p",{className:"text-xs text-blue-300",children:"Input"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-xl font-semibold text-violet-100",children:O(n.price.provider_output_price)}),g.jsx("p",{className:"text-xs text-violet-300",children:"Output"})]})]}),j!==null&&g.jsxs("p",{className:"mt-3 border-t border-emerald-900/60 pt-2 text-xs text-slate-400",children:["Estimated payout for recorded tokens: ",g.jsx("span",{className:"font-medium text-emerald-300",children:O(j)})]})]}):g.jsx("p",{className:"text-sm text-slate-400",children:"Current catalog price is unavailable."})]})]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsx("h4",{className:"text-sm font-medium text-slate-200",children:"Transactions for this model"}),g.jsx("p",{className:"mb-3 mt-1 text-xs text-slate-400",children:"Latest 20 local requests, with input and output tokens shown separately."}),(n?.recent_requests??[]).length===0?g.jsx("p",{className:"text-slate-400 text-center py-4",children:"No transactions recorded for this model"}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"space-y-2 sm:hidden",children:(n?.recent_requests??[]).map(N=>g.jsxs("div",{className:"rounded-lg border border-slate-600 bg-slate-800/60 p-3",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:"truncate font-mono text-xs text-slate-300",title:N.request_id,children:N.request_id}),g.jsxs("p",{className:"mt-1 text-xs text-slate-400",children:[p(N.start_time)," · ",b(N.latency_ms)]})]}),N.success?g.jsx(wl,{size:16,className:"shrink-0 text-green-400"}):g.jsx(Pa,{size:16,className:"shrink-0 text-red-400"})]}),g.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[g.jsxs("div",{className:"rounded bg-blue-950/30 px-2 py-1.5 text-blue-200",children:["Input ",g.jsx("span",{className:"float-right font-mono",children:N.tokens_in.toLocaleString()})]}),g.jsxs("div",{className:"rounded bg-violet-950/30 px-2 py-1.5 text-violet-200",children:["Output ",g.jsx("span",{className:"float-right font-mono",children:N.tokens_out.toLocaleString()})]})]})]},N.request_id))}),g.jsx("div",{className:"hidden overflow-x-auto sm:block",children:g.jsxs("table",{className:"w-full text-sm",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"text-slate-400 border-b border-slate-600",children:[g.jsx("th",{className:"text-left py-2 px-2 font-medium",children:"Transaction"}),g.jsx("th",{className:"text-left py-2 px-2 font-medium",children:"Time"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Latency"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Input"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Output"}),g.jsx("th",{className:"text-center py-2 px-2 font-medium",children:"Status"})]})}),g.jsx("tbody",{children:(n?.recent_requests??[]).map(N=>g.jsxs("tr",{className:"border-b border-slate-600/50",children:[g.jsx("td",{className:"max-w-36 truncate px-2 py-2 font-mono text-xs text-slate-400",title:N.request_id,children:N.request_id}),g.jsx("td",{className:"py-2 px-2 text-slate-300 text-xs",children:p(N.start_time)}),g.jsx("td",{className:"py-2 px-2 text-right font-mono text-xs",children:g.jsx("span",{className:N.latency_ms>5e3?"text-red-400":N.latency_ms>2e3?"text-yellow-400":"text-green-400",children:b(N.latency_ms)})}),g.jsx("td",{className:"py-2 px-2 text-right text-blue-200 font-mono text-xs",children:N.tokens_in.toLocaleString()}),g.jsx("td",{className:"py-2 px-2 text-right text-violet-200 font-mono text-xs",children:N.tokens_out.toLocaleString()}),g.jsx("td",{className:"py-2 px-2 text-center",children:N.success?g.jsx(wl,{size:14,className:"inline text-green-400"}):g.jsx(Pa,{size:14,className:"inline text-red-400"})})]},N.request_id))})]})})]})]}),E.length>1&&g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-3",children:"Recent transaction latency"}),g.jsx("div",{className:"h-40",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:E,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1,unit:"ms"}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"}}),g.jsx(Sl,{type:"monotone",dataKey:"latency",stroke:"#3b82f6",strokeWidth:2,dot:{fill:"#3b82f6",strokeWidth:0,r:3},name:"Latency"})]})})})]}),n?.health?.last_error&&g.jsxs("div",{className:"bg-red-900/20 border border-red-800/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(Tf,{size:20,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-red-300",children:"Last Error"})]}),g.jsx("p",{className:"text-sm text-red-400 font-mono",children:n.health.last_error})]})]})]})})}function LG({open:e,onClose:t,onAuthenticated:n}){const[a,l]=S.useState(""),[o,c]=S.useState(""),[f,d]=S.useState(!1),h=S.useRef(null),v=S.useRef(null),p=S.useRef(null);if(S.useEffect(()=>{if(!e)return;c(""),p.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const x=document.body.style.overflow;document.body.style.overflow="hidden",window.setTimeout(()=>h.current?.focus(),0);const O=j=>{if(j.key==="Escape"){j.preventDefault(),t();return}if(j.key!=="Tab"||!v.current)return;const _=Array.from(v.current.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')),E=_[0],N=_[_.length-1];!E||!N||(j.shiftKey&&document.activeElement===E?(j.preventDefault(),N.focus()):!j.shiftKey&&document.activeElement===N&&(j.preventDefault(),E.focus()))};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O),document.body.style.overflow=x,p.current?.focus()}},[e,t]),!e)return null;const b=async x=>{if(x.preventDefault(),!!a.trim()){d(!0),c(""),Ze.setAccessToken(a);try{await Ze.getSettings(),l(""),n()}catch(O){Ze.clearAccessToken(),c(O instanceof Error?O.message:"The access token was rejected")}finally{d(!1)}}};return g.jsx("div",{ref:v,className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/80 p-4 backdrop-blur-sm",role:"dialog","aria-modal":"true","aria-labelledby":"unlock-title","aria-describedby":"unlock-description",onMouseDown:x=>{x.target===x.currentTarget&&t()},children:g.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-slate-700 bg-slate-900 shadow-2xl shadow-black/40",children:[g.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-slate-800 p-5",children:[g.jsxs("div",{className:"flex gap-3",children:[g.jsx("div",{className:"rounded-xl bg-blue-500/10 p-2 text-blue-400",children:g.jsx(F_,{"aria-hidden":"true",size:22})}),g.jsxs("div",{children:[g.jsx("h2",{id:"unlock-title",className:"text-lg font-semibold text-white",children:"Unlock operator controls"}),g.jsx("p",{id:"unlock-description",className:"mt-1 text-sm text-slate-300",children:"Monitoring stays read-only until this browser tab is unlocked."})]})]}),g.jsx("button",{type:"button",onClick:t,className:"rounded-lg p-2 text-slate-400 hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Close unlock dialog",children:g.jsx(W_,{"aria-hidden":"true",size:20})})]}),g.jsxs("form",{onSubmit:b,className:"space-y-4 p-5",children:[g.jsxs("div",{children:[g.jsx("label",{htmlFor:"control-token",className:"mb-2 block text-sm font-medium text-slate-200",children:"Control token"}),g.jsx("input",{ref:h,id:"control-token",type:"password",autoComplete:"off",value:a,onChange:x=>l(x.target.value),className:"min-h-11 w-full rounded-lg border border-slate-600 bg-slate-950 px-3 font-mono text-sm text-white outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30",placeholder:"Paste dashboard.token","aria-describedby":"token-help"}),g.jsxs("p",{id:"token-help",className:"mt-2 text-xs leading-5 text-slate-300",children:["On the provider host, read ",g.jsx("code",{className:"rounded bg-slate-800 px-1.5 py-0.5 text-slate-300",children:"$CP_PATH/dashboard.token"}),". The token is kept only for this browser tab."]})]}),o&&g.jsx("p",{role:"alert",className:"rounded-lg border border-red-800/70 bg-red-950/40 px-3 py-2 text-sm text-red-300",children:o}),g.jsxs("div",{className:"flex justify-end gap-3",children:[g.jsx("button",{type:"button",onClick:t,className:"min-h-10 rounded-lg px-4 text-sm text-slate-300 hover:bg-slate-800",children:"Cancel"}),g.jsx("button",{type:"submit",disabled:f||!a.trim(),className:"min-h-10 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white transition hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50",children:f?"Checking…":"Unlock"})]})]})]})})}const $G=[{id:"limits",label:"Limits"},{id:"models",label:"Models"},{id:"alerts",label:"Alerts"},{id:"self-check",label:"Self-check"},{id:"logging",label:"Logging"}],Le="min-h-11 w-full rounded-lg border border-slate-600 bg-slate-950 px-3 text-sm text-slate-100 outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",$e="mb-1.5 block text-sm font-medium text-slate-200";function UG({restartRequired:e}){return g.jsx("span",{className:`inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-medium ${e?"border-amber-800/70 bg-amber-950/40 text-amber-300":"border-emerald-800/70 bg-emerald-950/40 text-emerald-300"}`,children:e?"Restart required":"Applies now"})}function Fu({id:e,title:t,description:n,icon:a,restartRequired:l,dirty:o,children:c}){return g.jsxs("section",{"aria-labelledby":`${e}-title`,className:"scroll-mt-14 overflow-hidden rounded-xl border border-slate-800 bg-slate-900",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 border-b border-slate-800 px-4 py-4 sm:px-5",children:[g.jsxs("div",{className:"flex min-w-0 gap-3",children:[g.jsx("div",{className:"mt-0.5 rounded-lg bg-slate-800 p-2 text-blue-400",children:a}),g.jsxs("div",{children:[g.jsx("h2",{id:`${e}-title`,className:"font-semibold text-white",children:t}),g.jsx("p",{className:"mt-1 max-w-2xl text-sm leading-5 text-slate-400",children:n})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o&&g.jsx("span",{className:"inline-flex items-center rounded-full border border-blue-800/70 bg-blue-950/40 px-2.5 py-1 text-xs font-medium text-blue-200",children:"Unsaved"}),g.jsx(UG,{restartRequired:l})]})]}),g.jsx("div",{className:"p-4 sm:p-5",children:c})]})}function Zu({state:e,section:t}){return!e||e.key!==t?null:g.jsx("p",{role:e.type==="error"?"alert":"status",className:`rounded-lg border px-3 py-2 text-sm ${e.type==="error"?"border-red-800/70 bg-red-950/30 text-red-300":"border-emerald-800/70 bg-emerald-950/30 text-emerald-300"}`,children:e.message})}function Qu({checked:e,onChange:t,label:n,description:a}){return g.jsxs("label",{className:"flex min-h-11 cursor-pointer items-start justify-between gap-4 rounded-lg border border-slate-700 bg-slate-950/60 px-3 py-2.5",children:[g.jsxs("span",{children:[g.jsx("span",{className:"block text-sm font-medium text-slate-200",children:n}),a&&g.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-slate-400",children:a})]}),g.jsx("input",{type:"checkbox",checked:e,onChange:l=>t(l.target.checked),className:"mt-0.5 h-5 w-5 rounded border-slate-600 bg-slate-900 text-blue-600 focus:ring-2 focus:ring-blue-500"})]})}function Wu({saving:e,label:t="Save settings"}){return g.jsxs("button",{type:"submit",disabled:e,className:"inline-flex min-h-10 items-center justify-center gap-2 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white transition hover:bg-blue-500 disabled:cursor-wait disabled:opacity-60",children:[e?g.jsx(Pl,{"aria-hidden":"true",className:"animate-spin",size:16}):g.jsx(DD,{"aria-hidden":"true",size:16}),e?"Saving…":t]})}function qG({authenticated:e,onUnlock:t,onModelsSaved:n,onDirtyChange:a}){const[l,o]=S.useState(null),[c,f]=S.useState(!1),[d,h]=S.useState(""),[v,p]=S.useState(null),[b,x]=S.useState(null),[O,j]=S.useState([]),[_,E]=S.useState(()=>new Set),[N,M]=S.useState(()=>sessionStorage.getItem("computing-provider-restart-pending")==="true"),P=z=>{E(G=>{const re=new Set(G);return re.add(z),re}),x(G=>G?.key===z?null:G)},T=S.useCallback(async()=>{if(e){f(!0),h("");try{const z=await Ze.getSettings();o({...z,models:z.models.map(G=>({...G}))}),j(z.models.map(G=>G.id)),E(new Set)}catch(z){h(z instanceof Error?z.message:"Unable to load settings")}finally{f(!1)}}},[e]);S.useEffect(()=>{e?T():(o(null),E(new Set))},[e,T]),S.useEffect(()=>{const z=_.size>0;a(z);const G=re=>{z&&(re.preventDefault(),re.returnValue="")};return window.addEventListener("beforeunload",G),()=>{window.removeEventListener("beforeunload",G),a(!1)}},[_,a]);const C=async(z,G)=>{p(z),x(null);try{const re=await G();return x({key:z,type:"success",message:re.restart_required?"Saved. Restart computing-provider when convenient to apply this section.":"Saved and applied to the running provider."}),E(k=>{const Z=new Set(k);return Z.delete(z),Z}),re.restart_required&&(sessionStorage.setItem("computing-provider-restart-pending","true"),M(!0)),!0}catch(re){return x({key:z,type:"error",message:re instanceof Error?re.message:"Save failed"}),!1}finally{p(null)}},R=S.useMemo(()=>{if(!l)return 0;const z=new Set(l.models.map(G=>G.id));return O.filter(G=>!z.has(G)).length},[O,l]);if(!e)return g.jsx("div",{className:"mx-auto max-w-2xl py-8 sm:py-16",children:g.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900 p-6 text-center sm:p-10",children:[g.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-blue-500/10 text-blue-400",children:g.jsx(C0,{"aria-hidden":"true",size:24})}),g.jsx("h2",{className:"text-xl font-semibold text-white",children:"Settings are locked"}),g.jsx("p",{className:"mx-auto mt-2 max-w-lg text-sm leading-6 text-slate-400",children:"Unlock this browser tab with the local control token before reading or changing provider configuration. Monitoring remains available without it."}),g.jsxs("button",{type:"button",onClick:t,className:"mt-5 inline-flex min-h-11 items-center gap-2 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white hover:bg-blue-500",children:[g.jsx(F_,{"aria-hidden":"true",size:17})," Unlock settings"]})]})});if(c&&!l)return g.jsxs("div",{className:"flex min-h-64 items-center justify-center text-slate-400",role:"status",children:[g.jsx(Pl,{"aria-hidden":"true",className:"mr-2 animate-spin",size:18})," Loading settings…"]});if(!l)return g.jsxs("div",{className:"rounded-xl border border-red-800/60 bg-red-950/20 p-5",children:[g.jsx("h2",{className:"font-semibold text-red-200",children:"Settings could not be loaded"}),g.jsx("p",{className:"mt-1 text-sm text-red-300",children:d}),g.jsx("button",{type:"button",onClick:T,className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white",children:"Try again"})]});const F=z=>{P("alerts"),o(G=>G&&{...G,alerts:{...G.alerts,...z}})},ee=z=>{P("self-check"),o(G=>G&&{...G,self_check:{...G.self_check,...z}})},q=z=>{P("logging"),o(G=>G&&{...G,log:{...G.log,...z}})},U=z=>{P("limits"),o(G=>G&&{...G,limits:{...G.limits,...z}})},B=z=>F({email:{...l.alerts.email,...z}}),ue=(z,G)=>{P("models"),o(re=>{if(!re)return re;const k=re.models.map((Z,ie)=>ie===z?{...Z,...G}:Z);return{...re,models:k}})},oe=async z=>{z.preventDefault();const G=l.alerts.email.to.flatMap(k=>k.split(/[\n,]/)).map(k=>k.trim()).filter(Boolean),re={...l.alerts,email:{...l.alerts.email,to:G}};await C("alerts",()=>Ze.updateAlerts(re))&&o(k=>k&&{...k,alerts:{...k.alerts,email:{...k.alerts.email,password:"",clear_password:!1,to:G,password_set:re.email.clear_password?!1:re.email.password_set||!!re.email.password}}})},ve=async z=>{z.preventDefault(),!(R>0&&!window.confirm(`Save and remove ${R} model${R===1?"":"s"} from routing?`))&&await C("models",()=>Ze.updateModels(l.models))&&(n(),await T())},K=()=>{_.size>0&&!window.confirm("Reload settings from disk and discard unsaved changes?")||T()},te=()=>{sessionStorage.removeItem("computing-provider-restart-pending"),M(!1)};return g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Provider settings"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"Validated edits to config.toml and models.json. Secrets are write-only."})]}),g.jsxs("button",{type:"button",onClick:K,disabled:c,className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 hover:bg-slate-800 disabled:opacity-50",children:[g.jsx(D0,{"aria-hidden":"true",className:c?"animate-spin":"",size:16})," Reload from disk"]})]}),g.jsx("nav",{"aria-label":"Settings sections",className:"sticky top-0 z-20 -mx-1 overflow-x-auto rounded-xl border border-slate-800 bg-slate-950/95 p-1 shadow-lg shadow-slate-950/30 backdrop-blur",children:g.jsx("div",{className:"flex min-w-max gap-1",children:$G.map(z=>g.jsxs("button",{type:"button",onClick:()=>document.getElementById(`${z.id}-title`)?.scrollIntoView({behavior:"smooth",block:"start"}),className:"inline-flex min-h-10 items-center rounded-lg px-3 text-sm text-slate-300 hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500",children:[z.label,_.has(z.id)&&g.jsx("span",{className:"ml-2 h-2 w-2 rounded-full bg-blue-400","aria-label":"Unsaved changes"})]},z.id))})}),_.size>0&&g.jsxs("p",{role:"status",className:"rounded-lg border border-blue-800/70 bg-blue-950/30 px-4 py-3 text-sm text-blue-100",children:["Unsaved changes in ",_.size," section",_.size===1?"":"s",". Save each marked section before leaving Settings."]}),N&&g.jsxs("div",{role:"status",className:"flex flex-col gap-3 rounded-lg border border-amber-800/70 bg-amber-950/30 px-4 py-3 text-sm text-amber-100 sm:flex-row sm:items-center sm:justify-between",children:[g.jsx("span",{children:"Saved configuration is waiting for a provider-daemon restart before it takes effect."}),g.jsx("button",{type:"button",onClick:te,className:"min-h-10 self-start rounded-lg border border-amber-700/70 px-3 text-amber-100 hover:bg-amber-900/30 sm:self-auto",children:"Dismiss"})]}),d&&g.jsx("p",{role:"alert",className:"rounded-lg border border-red-800/60 bg-red-950/20 px-4 py-3 text-sm text-red-300",children:d}),g.jsx(Fu,{id:"limits",title:"Request limits",description:"Protect the provider from more work than it can serve. Both values are persisted and applied immediately.",icon:g.jsx(M0,{"aria-hidden":"true",size:19}),restartRequired:!1,dirty:_.has("limits"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),C("limits",()=>Ze.updateLimits(l.limits))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"requests-per-second",children:"Requests per second"}),g.jsx("input",{id:"requests-per-second",type:"number",min:"0.1",max:"100000",step:"0.1",required:!0,value:l.limits.requests_per_second,onChange:z=>U({requests_per_second:Number(z.target.value)}),className:Le}),g.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Base global rate; GPU-aware adaptation may lower or raise the live rate."})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"max-concurrent",children:"Maximum concurrent requests"}),g.jsx("input",{id:"max-concurrent",type:"number",min:"1",max:"100000",required:!0,value:l.limits.max_concurrent,onChange:z=>U({max_concurrent:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"limits"}),g.jsx(Wu,{saving:v==="limits"})]})]})}),g.jsx(Fu,{id:"models",title:"Model endpoint map",description:"Add, repoint, or remove local inference endpoints. Saving hot-reloads models.json and updates the advertised model list.",icon:g.jsx(PD,{"aria-hidden":"true",size:19}),restartRequired:!1,dirty:_.has("models"),children:g.jsxs("form",{onSubmit:ve,className:"space-y-4",children:[l.models.length===0?g.jsx("div",{className:"rounded-lg border border-dashed border-slate-700 px-4 py-8 text-center text-sm text-slate-400",children:"No models configured. Add one to begin serving inference."}):g.jsx("div",{className:"space-y-3",children:l.models.map((z,G)=>g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-950/50 p-4",children:[g.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(180px,0.8fr)_minmax(240px,1.2fr)_auto]",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`model-id-${G}`,children:"Model ID"}),g.jsx("input",{id:`model-id-${G}`,required:!0,readOnly:!z.isNew,value:z.id,onChange:re=>ue(G,{id:re.target.value}),className:`${Le} font-mono ${z.isNew?"":"cursor-not-allowed bg-slate-900 text-slate-400"}`})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`model-endpoint-${G}`,children:"Endpoint"}),g.jsx("input",{id:`model-endpoint-${G}`,type:"url",required:!0,value:z.endpoint,onChange:re=>ue(G,{endpoint:re.target.value}),placeholder:"http://127.0.0.1:8000",className:`${Le} font-mono`})]}),g.jsxs("button",{type:"button",onClick:()=>{window.confirm(`Remove ${z.id||"this model"} from the configuration? The change takes effect when you save.`)&&(P("models"),o(re=>re&&{...re,models:re.models.filter((k,Z)=>Z!==G)}))},className:"mt-auto inline-flex min-h-11 items-center justify-center gap-2 rounded-lg border border-red-900/70 px-3 text-sm text-red-300 hover:bg-red-950/40","aria-label":`Remove ${z.id||"new model"}`,children:[g.jsx(KD,{"aria-hidden":"true",size:16})," ",g.jsx("span",{className:"lg:hidden",children:"Remove"})]})]}),g.jsxs("div",{className:"mt-4 grid gap-4 sm:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`model-category-${G}`,children:"Category"}),g.jsx("input",{id:`model-category-${G}`,required:!0,value:z.category,onChange:re=>ue(G,{category:re.target.value}),placeholder:"text-generation",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`local-model-${G}`,children:"Local model name"}),g.jsx("input",{id:`local-model-${G}`,value:z.local_model??"",onChange:re=>ue(G,{local_model:re.target.value}),placeholder:"Optional Ollama name",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`context-length-${G}`,children:"Context length"}),g.jsx("input",{id:`context-length-${G}`,type:"number",min:"0",value:z.context_length??0,onChange:re=>ue(G,{context_length:Number(re.target.value)}),className:Le})]})]}),g.jsxs("details",{className:"mt-4 rounded-lg border border-slate-800 bg-slate-950/60",children:[g.jsx("summary",{className:"cursor-pointer px-3 py-2 text-sm font-medium text-slate-300",children:"Advanced endpoint details"}),g.jsxs("div",{className:"grid gap-4 border-t border-slate-800 p-3 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`gpu-memory-${G}`,children:"GPU memory (MB)"}),g.jsx("input",{id:`gpu-memory-${G}`,type:"number",min:"0",value:z.gpu_memory,onChange:re=>ue(G,{gpu_memory:Number(re.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`container-${G}`,children:"Container"}),g.jsx("input",{id:`container-${G}`,value:z.container??"",onChange:re=>ue(G,{container:re.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`format-${G}`,children:"Format"}),g.jsx("input",{id:`format-${G}`,value:z.format??"",onChange:re=>ue(G,{format:re.target.value}),placeholder:"awq, gguf…",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`quantization-${G}`,children:"Quantization"}),g.jsx("input",{id:`quantization-${G}`,value:z.quantization??"",onChange:re=>ue(G,{quantization:re.target.value}),className:Le})]}),g.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[g.jsx("label",{className:$e,htmlFor:`endpoint-key-${G}`,children:"Endpoint API key"}),g.jsx("input",{id:`endpoint-key-${G}`,type:"password",autoComplete:"new-password",value:z.api_key??"",onChange:re=>ue(G,{api_key:re.target.value,clear_api_key:!1}),placeholder:z.api_key_set?"Configured •••• — leave blank to keep":"Optional write-only replacement",className:Le}),z.api_key_set&&g.jsxs("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-slate-400",children:[g.jsx("input",{type:"checkbox",checked:!!z.clear_api_key,onChange:re=>ue(G,{clear_api_key:re.target.checked,api_key:""})})," Clear stored endpoint key"]})]})]})]})]},`${z.id}-${G}`))}),g.jsxs("button",{type:"button",onClick:()=>{P("models"),o(z=>z&&{...z,models:[...z.models,{id:"",endpoint:"",gpu_memory:0,category:"text-generation",api_key_set:!1,context_length:0,isNew:!0}]})},className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-dashed border-slate-600 px-3 text-sm text-slate-200 hover:border-blue-500 hover:text-white",children:[g.jsx(OD,{"aria-hidden":"true",size:16})," Add model"]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"models"}),g.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[R>0&&g.jsxs("span",{className:"text-xs text-amber-300",children:[R," removal pending"]}),g.jsx(Wu,{saving:v==="models",label:"Save and hot-reload"})]})]})]})}),g.jsx(Fu,{id:"alerts",title:"Alert delivery",description:"Configure webhook and SMTP delivery. Stored passwords are never returned to the browser.",icon:g.jsx(G4,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("alerts"),children:g.jsxs("form",{onSubmit:oe,className:"space-y-5",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"webhook-url",children:"Webhook URL"}),g.jsx("input",{id:"webhook-url",type:"url",value:l.alerts.webhook_url,onChange:z=>F({webhook_url:z.target.value}),placeholder:"https://alerts.example.com/provider",className:Le})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"cooldown",children:"Repeat cooldown (minutes)"}),g.jsx("input",{id:"cooldown",type:"number",min:"1",max:"10080",required:!0,value:l.alerts.cooldown_minutes,onChange:z=>F({cooldown_minutes:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"disconnect-delay",children:"Disconnect alert after (minutes)"}),g.jsx("input",{id:"disconnect-delay",type:"number",min:"1",max:"10080",required:!0,value:l.alerts.disconnect_after_min,onChange:z=>F({disconnect_after_min:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"failure-threshold",children:"Failure threshold (%)"}),g.jsx("input",{id:"failure-threshold",type:"number",min:"1",max:"100",step:"1",required:!0,value:Math.round(l.alerts.error_rate_threshold*100),onChange:z=>F({error_rate_threshold:Number(z.target.value)/100}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"minimum-requests",children:"Minimum requests"}),g.jsx("input",{id:"minimum-requests",type:"number",min:"1",required:!0,value:l.alerts.error_rate_min_requests,onChange:z=>F({error_rate_min_requests:Number(z.target.value)}),className:Le})]})]}),g.jsxs("fieldset",{className:"rounded-xl border border-slate-700 p-4",children:[g.jsx("legend",{className:"px-2 text-sm font-semibold text-slate-200",children:"Email (SMTP)"}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[g.jsxs("div",{className:"sm:col-span-2",children:[g.jsx("label",{className:$e,htmlFor:"smtp-host",children:"SMTP host"}),g.jsx("input",{id:"smtp-host",value:l.alerts.email.host,onChange:z=>B({host:z.target.value}),placeholder:"smtp.example.com",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"smtp-port",children:"Port"}),g.jsx("input",{id:"smtp-port",type:"number",min:"1",max:"65535",value:l.alerts.email.port,onChange:z=>B({port:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"smtp-username",children:"Username"}),g.jsx("input",{id:"smtp-username",value:l.alerts.email.username,onChange:z=>B({username:z.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"smtp-from",children:"From address"}),g.jsx("input",{id:"smtp-from",type:"email",value:l.alerts.email.from,onChange:z=>B({from:z.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"smtp-recipients",children:"Recipients"}),g.jsx("textarea",{id:"smtp-recipients",rows:2,value:l.alerts.email.to.join(` `),onChange:z=>B({to:z.target.value.split(` -`)}),placeholder:"One address per line",className:`${Le} py-2`})]}),g.jsxs("div",{className:"sm:col-span-2 lg:col-span-3",children:[g.jsx("label",{className:$e,htmlFor:"smtp-password",children:"SMTP password"}),g.jsx("input",{id:"smtp-password",type:"password",autoComplete:"new-password",value:l.alerts.email.password??"",onChange:z=>B({password:z.target.value,clear_password:!1}),placeholder:l.alerts.email.password_set?"Configured •••• — leave blank to keep":"Write-only password",className:Le}),l.alerts.email.password_set&&g.jsxs("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-slate-400",children:[g.jsx("input",{type:"checkbox",checked:!!l.alerts.email.clear_password,onChange:z=>B({clear_password:z.target.checked,password:""})})," Clear password stored in config.toml"]})]})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"alerts"}),g.jsx(Wu,{saving:v==="alerts"})]})]})}),g.jsx(Fu,{id:"self-check",title:"Self-check behavior",description:"Control periodic inference audits and automatic routing recovery.",icon:g.jsx(Q_,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("self-check"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),C("self-check",()=>Ze.updateSelfCheck(l.self_check))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Qu,{checked:l.self_check.enable,onChange:z=>ne({enable:z}),label:"Periodic self-check",description:"Audit configured models on a schedule."}),g.jsx(Qu,{checked:l.self_check.auto_disable,onChange:z=>ne({auto_disable:z}),label:"Auto-disable failing models",description:"Remove repeatedly failing backends from routing."}),g.jsx(Qu,{checked:l.self_check.auto_recover,onChange:z=>ne({auto_recover:z}),label:"Auto-recover healthy models",description:"Return recovered backends to routing."})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"self-check-interval",children:"Interval (minutes)"}),g.jsx("input",{id:"self-check-interval",type:"number",min:"1",max:"10080",required:!0,value:l.self_check.interval_minutes,onChange:z=>ne({interval_minutes:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"failures-before-disable",children:"Failures before disable"}),g.jsx("input",{id:"failures-before-disable",type:"number",min:"1",max:"100",required:!0,value:l.self_check.failures_before_disable,onChange:z=>ne({failures_before_disable:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"self-check"}),g.jsx(Wu,{saving:v==="self-check"})]})]})}),g.jsx(Fu,{id:"logging",title:"Logging and retention",description:"Choose log verbosity, destination, rotation, and retention.",icon:g.jsx(Z_,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("logging"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),C("logging",()=>Ze.updateLogging(l.log))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{className:"sm:col-span-2 lg:col-span-3",children:[g.jsx("label",{className:$e,htmlFor:"log-dir",children:"Log directory"}),g.jsx("input",{id:"log-dir",required:!0,value:l.log.dir,onChange:z=>q({dir:z.target.value}),className:`${Le} font-mono`})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"log-level",children:"Level"}),g.jsx("select",{id:"log-level",value:l.log.level,onChange:z=>q({level:z.target.value}),className:Le,children:["trace","debug","info","warn","error"].map(z=>g.jsx("option",{value:z,children:z},z))})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"log-max-size",children:"Rotate at (MB)"}),g.jsx("input",{id:"log-max-size",type:"number",min:"1",max:"102400",required:!0,value:l.log.max_size_mb,onChange:z=>q({max_size_mb:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"log-backups",children:"Backups to keep"}),g.jsx("input",{id:"log-backups",type:"number",min:"1",max:"1000",required:!0,value:l.log.max_backups,onChange:z=>q({max_backups:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"log-age",children:"Retention days (-1 = forever)"}),g.jsx("input",{id:"log-age",type:"number",min:"-1",max:"36500",required:!0,value:l.log.max_age_days,onChange:z=>q({max_age_days:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Qu,{checked:l.log.compress,onChange:z=>q({compress:z}),label:"Compress rotated logs"}),g.jsx(Qu,{checked:l.log.stdout,onChange:z=>q({stdout:z}),label:"Also write to stdout"})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"logging"}),g.jsx(Wu,{saving:v==="logging"})]})]})}),g.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-slate-800 bg-slate-900/60 px-4 py-3 text-xs text-slate-400",children:[g.jsx(F4,{"aria-hidden":"true",size:15,className:"text-emerald-400"})," All saves are validated server-side and use atomic file replacement."]})]})}function BG({status:e,metrics:t,models:n,dataIssues:a,loading:l}){if(l&&!e&&!t&&!n)return g.jsxs("div",{role:"status",className:"mb-4 flex items-center gap-3 rounded-xl border border-slate-800 bg-slate-900 px-4 py-3",children:[g.jsx("span",{"aria-hidden":"true",className:"h-5 w-5 animate-pulse rounded-full bg-slate-700"}),g.jsxs("div",{children:[g.jsx("p",{className:"font-medium text-slate-200",children:"Checking operational status…"}),g.jsx("p",{className:"mt-0.5 text-sm text-slate-400",children:"Loading connection, model, and capacity signals."})]})]});const o=[];let c="healthy";const f=a.filter(b=>b.error).map(b=>b.label);f.length>0&&(c="warning",o.push(`Stale or unavailable: ${f.join(", ")}`)),e&&!e.connected&&(c="critical",o.push("Disconnected from Swan Inference")),n?.summary.unhealthy&&(c="critical",o.push(`${n.summary.unhealthy} unhealthy model${n.summary.unhealthy===1?"":"s"}`)),n&&n.summary.total===0&&(c="critical",o.push("No models configured"));const d=t?.gpu_metrics.filter(b=>b.temperature_c>=85).length??0;if(d>0&&(c==="healthy"&&(c="warning"),o.push(`${d} GPU${d===1?"":"s"} at or above 85°C`)),t&&t.total_requests>=10){const b=t.failed_requests/t.total_requests;b>=.05&&(c==="healthy"&&(c="warning"),o.push(`${(b*100).toFixed(1)}% session failure rate`))}const h={healthy:{Icon:iD,title:"All operational signals look healthy",copy:n?`${n.summary.ready} of ${n.summary.total} models ready`:"Waiting for model status",className:"border-emerald-800/70 bg-emerald-950/30",iconClass:"text-emerald-300",titleClass:"text-emerald-100"},warning:{Icon:Np,title:"Provider status needs a closer look",copy:o.join(" · "),className:"border-amber-800/70 bg-amber-950/30",iconClass:"text-amber-300",titleClass:"text-amber-100"},critical:{Icon:Pa,title:"Provider needs attention",copy:o.join(" · "),className:"border-red-800/70 bg-red-950/30",iconClass:"text-red-300",titleClass:"text-red-100"}}[c],v=h.Icon,p=`${h.title}. ${h.copy}`;return g.jsxs("div",{role:c==="critical"?"alert":"status",title:p,className:`flex min-w-0 max-w-full items-center gap-2 rounded-lg border px-3 py-1.5 ${h.className}`,children:[g.jsx(v,{"aria-hidden":"true",size:16,className:`shrink-0 ${h.iconClass}`}),g.jsxs("p",{className:`min-w-0 truncate text-sm font-medium ${h.titleClass}`,children:[h.title,h.copy&&g.jsx("span",{className:"ml-2 font-normal text-slate-300",children:h.copy})]}),c!=="healthy"&&g.jsxs("button",{type:"button",onClick:()=>document.getElementById("operations-heading")?.scrollIntoView({behavior:"smooth"}),className:"ml-1 inline-flex shrink-0 items-center gap-1 rounded-md border border-current/30 px-2 py-1 text-xs font-medium text-slate-200 hover:bg-white/5 focus:outline-none focus:ring-2 focus:ring-blue-400",children:["Review ",g.jsx(kc,{"aria-hidden":"true",size:13})]})]})}const yl=5e3,n3=[{id:"overview",label:"Overview",icon:bD},{id:"transactions",label:"Requests",icon:ND},{id:"settings",label:"Settings",icon:Z_}];function Y_(){const e=window.location.hash.replace("#","");return n3.some(t=>t.id===e)?e:"overview"}function IG(){const[e,t]=S.useState(null),[n,a]=S.useState(Y_),[l,o]=S.useState(!1),[c,f]=S.useState(!1),[d,h]=S.useState(!1),{data:v,error:p,loading:b,refreshing:x,refetch:O}=Da(S.useCallback(()=>Ze.getMetrics(),[]),yl),{data:j,error:_,loading:E,refreshing:N,lastUpdated:M,refetch:P}=Da(S.useCallback(()=>Ze.getStatus(),[]),yl),{data:T,error:C,loading:L,refreshing:Z,refetch:ne}=Da(S.useCallback(()=>Ze.getEarnings(),[]),yl),{data:q,error:U,loading:B,refreshing:ue,refetch:oe}=Da(S.useCallback(()=>Ze.getModels(),[]),yl),{data:ve,error:K,loading:ee,refreshing:z,refetch:G}=Da(S.useCallback(()=>Ze.getRequestManagement(),[]),yl);S.useEffect(()=>{Ze.hasAccessToken()&&Ze.getSettings().then(()=>o(!0)).catch(()=>{Ze.clearAccessToken(),o(!1)})},[]),S.useEffect(()=>{const he=()=>{a(Y_()),window.scrollTo({top:0})};return window.addEventListener("hashchange",he),()=>window.removeEventListener("hashchange",he)},[]);const re=()=>{O(),P(),oe(),G(),ne()},k=()=>{Ze.clearAccessToken(),o(!1)},F=S.useCallback(()=>f(!1),[]),ie=S.useCallback(()=>t(null),[]),le=S.useCallback(()=>{o(!0),f(!1)},[]),ye=he=>{n==="settings"&&he!=="settings"&&d&&!window.confirm("Leave settings and discard unsaved changes?")||(a(he),window.history.replaceState(null,"",`#${he}`),window.scrollTo({top:0}),he==="settings"&&!l&&f(!0))},be=x||N||Z||ue||z;return g.jsxs("div",{className:"min-h-screen bg-slate-950 text-slate-100",children:[g.jsxs("header",{className:"border-b border-slate-800 bg-slate-900/95",children:[g.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col items-stretch gap-3 px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[g.jsx("div",{className:"rounded-xl bg-blue-500/10 p-2 text-blue-400",children:g.jsx(RD,{"aria-hidden":"true",size:24})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("h1",{className:"truncate text-lg font-semibold tracking-tight text-white sm:text-xl",children:"Provider Console"}),g.jsxs("p",{className:"text-xs text-slate-400",children:["Inference operations",j?.version&&g.jsxs(g.Fragment,{children:[" · ",g.jsxs("span",{title:j.build??void 0,className:"font-mono text-slate-400",children:["v",j.version]})]})]})]})]}),g.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2 sm:justify-end sm:gap-3",children:[g.jsx(kG,{status:j,loading:E,error:_,lastUpdated:M}),g.jsxs("button",{type:"button",onClick:re,disabled:be,className:"inline-flex min-h-10 min-w-10 items-center justify-center gap-2 rounded-lg border border-slate-700 bg-slate-800 px-3 text-sm text-slate-200 transition hover:border-slate-600 hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Refresh dashboard data",children:[g.jsx(Pl,{"aria-hidden":"true",size:16,className:be?"animate-spin":""}),g.jsx("span",{className:"hidden sm:inline",children:be?"Refreshing…":"Refresh"})]}),l?g.jsxs("button",{type:"button",onClick:k,className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-slate-700 px-3 text-sm text-slate-300 transition hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[g.jsx(wD,{"aria-hidden":"true",size:16}),g.jsx("span",{className:"hidden sm:inline",children:"Lock"})]}):g.jsxs("button",{type:"button",onClick:()=>f(!0),className:"inline-flex min-h-10 items-center gap-2 rounded-lg bg-blue-600 px-3 text-sm font-medium text-white transition hover:bg-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-400",children:[g.jsx(C0,{"aria-hidden":"true",size:16}),g.jsx("span",{className:"hidden sm:inline",children:"Unlock controls"}),g.jsx("span",{className:"sm:hidden",children:"Unlock"})]})]})]}),g.jsx("nav",{"aria-label":"Dashboard sections",className:"mx-auto max-w-7xl px-4 sm:px-6",children:g.jsx("div",{className:"flex gap-1 overflow-hidden",children:n3.map(he=>{const ut=he.icon,W=n===he.id;return g.jsxs("button",{type:"button",onClick:()=>ye(he.id),"aria-current":W?"page":void 0,className:`inline-flex min-h-11 min-w-0 flex-1 items-center justify-center gap-1.5 whitespace-nowrap border-b-2 px-2 text-xs font-medium transition focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500 sm:flex-none sm:gap-2 sm:px-5 sm:text-sm ${W?"border-blue-500 text-white":"border-transparent text-slate-400 hover:border-slate-700 hover:text-slate-200"}`,children:[g.jsx(ut,{"aria-hidden":"true",size:16}),he.label]},he.id)})})})]}),g.jsxs("main",{className:"mx-auto max-w-7xl px-4 py-5 sm:px-6 sm:py-6",children:[n==="overview"&&g.jsxs("div",{className:"space-y-6",children:[g.jsxs("section",{"aria-labelledby":"provider-health-heading",children:[g.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("h2",{id:"provider-health-heading",className:"text-xl font-semibold text-white",children:"Provider overview"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Current service health, traffic, and earnings."})]}),g.jsx(BG,{status:j,metrics:v,models:q,loading:E||b||B,dataIssues:[{label:"connection",error:_},{label:"metrics",error:p},{label:"models",error:U},{label:"request controls",error:K},{label:"earnings",error:C}]})]}),g.jsx(EG,{metrics:v,loading:b,error:p,earnings:T,earningsError:C,earningsLoading:L})]}),g.jsxs("section",{"aria-labelledby":"operations-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"operations-heading",className:"text-xl font-semibold text-white",children:"Operations"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"Model readiness and local resource pressure."})]}),g.jsxs("div",{className:"grid items-start gap-6 lg:grid-cols-2",children:[g.jsxs("div",{className:"min-w-0 space-y-6",children:[g.jsx(MG,{models:q?.models??[],healthLog:q?.health_log,prices:q?.prices??{},summary:q?.summary,loading:B,error:U,onRefresh:oe,onModelClick:t,authenticated:l,onUnlock:()=>f(!0)}),g.jsx(CG,{data:ve,loading:ee,error:K,onOpenSettings:()=>ye("settings")})]}),g.jsxs("div",{className:"min-w-0 space-y-6",children:[g.jsxs("section",{"aria-labelledby":"earnings-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"earnings-heading",className:"text-xl font-semibold text-white",children:"Earnings and traffic mix"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Estimated local history and the models contributing to it."})]}),g.jsxs("div",{className:"min-w-0 space-y-4",children:[g.jsx(JD,{models:T?.models}),g.jsx(OG,{earnings:T,loading:L&&!T,error:C})]})]}),g.jsx(NG,{gpus:v?.gpu_metrics??[],loading:b,error:p})]})]})]}),g.jsxs("section",{"aria-labelledby":"performance-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"performance-heading",className:"text-xl font-semibold text-white",children:"Performance"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Persistent trends that remain available after navigation or restart."})]}),g.jsx(zG,{})]})]}),n==="transactions"&&g.jsx(PG,{models:q?.models??[]}),n==="settings"&&g.jsx(qG,{authenticated:l,onUnlock:()=>f(!0),onModelsSaved:oe,onDirtyChange:h})]}),g.jsx("footer",{className:"mt-8 border-t border-slate-800 bg-slate-900 px-4 py-4 sm:px-6",children:g.jsxs("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-2 text-xs text-slate-400",children:[g.jsx("span",{children:"Swan Chain Computing Provider"}),g.jsxs("span",{children:["Core monitoring refreshes every ",yl/1e3,"s"]})]})}),e&&g.jsx(RG,{modelId:e,onClose:ie}),g.jsx(LG,{open:c,onClose:F,onAuthenticated:le})]})}R4.createRoot(document.getElementById("root")).render(g.jsx(S.StrictMode,{children:g.jsx(IG,{})})); +`)}),placeholder:"One address per line",className:`${Le} py-2`})]}),g.jsxs("div",{className:"sm:col-span-2 lg:col-span-3",children:[g.jsx("label",{className:$e,htmlFor:"smtp-password",children:"SMTP password"}),g.jsx("input",{id:"smtp-password",type:"password",autoComplete:"new-password",value:l.alerts.email.password??"",onChange:z=>B({password:z.target.value,clear_password:!1}),placeholder:l.alerts.email.password_set?"Configured •••• — leave blank to keep":"Write-only password",className:Le}),l.alerts.email.password_set&&g.jsxs("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-slate-400",children:[g.jsx("input",{type:"checkbox",checked:!!l.alerts.email.clear_password,onChange:z=>B({clear_password:z.target.checked,password:""})})," Clear password stored in config.toml"]})]})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"alerts"}),g.jsx(Wu,{saving:v==="alerts"})]})]})}),g.jsx(Fu,{id:"self-check",title:"Self-check behavior",description:"Control periodic inference audits and automatic routing recovery.",icon:g.jsx(Q_,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("self-check"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),C("self-check",()=>Ze.updateSelfCheck(l.self_check))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Qu,{checked:l.self_check.enable,onChange:z=>ee({enable:z}),label:"Periodic self-check",description:"Audit configured models on a schedule."}),g.jsx(Qu,{checked:l.self_check.auto_disable,onChange:z=>ee({auto_disable:z}),label:"Auto-disable failing models",description:"Remove repeatedly failing backends from routing."}),g.jsx(Qu,{checked:l.self_check.auto_recover,onChange:z=>ee({auto_recover:z}),label:"Auto-recover healthy models",description:"Return recovered backends to routing."})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"self-check-interval",children:"Interval (minutes)"}),g.jsx("input",{id:"self-check-interval",type:"number",min:"1",max:"10080",required:!0,value:l.self_check.interval_minutes,onChange:z=>ee({interval_minutes:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"failures-before-disable",children:"Failures before disable"}),g.jsx("input",{id:"failures-before-disable",type:"number",min:"1",max:"100",required:!0,value:l.self_check.failures_before_disable,onChange:z=>ee({failures_before_disable:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"self-check"}),g.jsx(Wu,{saving:v==="self-check"})]})]})}),g.jsx(Fu,{id:"logging",title:"Logging and retention",description:"Choose log verbosity, destination, rotation, and retention.",icon:g.jsx(Z_,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("logging"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),C("logging",()=>Ze.updateLogging(l.log))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{className:"sm:col-span-2 lg:col-span-3",children:[g.jsx("label",{className:$e,htmlFor:"log-dir",children:"Log directory"}),g.jsx("input",{id:"log-dir",required:!0,value:l.log.dir,onChange:z=>q({dir:z.target.value}),className:`${Le} font-mono`})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"log-level",children:"Level"}),g.jsx("select",{id:"log-level",value:l.log.level,onChange:z=>q({level:z.target.value}),className:Le,children:["trace","debug","info","warn","error"].map(z=>g.jsx("option",{value:z,children:z},z))})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"log-max-size",children:"Rotate at (MB)"}),g.jsx("input",{id:"log-max-size",type:"number",min:"1",max:"102400",required:!0,value:l.log.max_size_mb,onChange:z=>q({max_size_mb:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"log-backups",children:"Backups to keep"}),g.jsx("input",{id:"log-backups",type:"number",min:"1",max:"1000",required:!0,value:l.log.max_backups,onChange:z=>q({max_backups:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"log-age",children:"Retention days (-1 = forever)"}),g.jsx("input",{id:"log-age",type:"number",min:"-1",max:"36500",required:!0,value:l.log.max_age_days,onChange:z=>q({max_age_days:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Qu,{checked:l.log.compress,onChange:z=>q({compress:z}),label:"Compress rotated logs"}),g.jsx(Qu,{checked:l.log.stdout,onChange:z=>q({stdout:z}),label:"Also write to stdout"})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"logging"}),g.jsx(Wu,{saving:v==="logging"})]})]})}),g.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-slate-800 bg-slate-900/60 px-4 py-3 text-xs text-slate-400",children:[g.jsx(F4,{"aria-hidden":"true",size:15,className:"text-emerald-400"})," All saves are validated server-side and use atomic file replacement."]})]})}function BG({status:e,metrics:t,models:n,dataIssues:a,loading:l}){if(l&&!e&&!t&&!n)return g.jsxs("div",{role:"status",className:"mb-4 flex items-center gap-3 rounded-xl border border-slate-800 bg-slate-900 px-4 py-3",children:[g.jsx("span",{"aria-hidden":"true",className:"h-5 w-5 animate-pulse rounded-full bg-slate-700"}),g.jsxs("div",{children:[g.jsx("p",{className:"font-medium text-slate-200",children:"Checking operational status…"}),g.jsx("p",{className:"mt-0.5 text-sm text-slate-400",children:"Loading connection, model, and capacity signals."})]})]});const o=[];let c="healthy";const f=a.filter(b=>b.error).map(b=>b.label);f.length>0&&(c="warning",o.push(`Stale or unavailable: ${f.join(", ")}`)),e&&!e.connected&&(c="critical",o.push("Disconnected from Swan Inference")),n?.summary.unhealthy&&(c="critical",o.push(`${n.summary.unhealthy} unhealthy model${n.summary.unhealthy===1?"":"s"}`)),n&&n.summary.total===0&&(c="critical",o.push("No models configured"));const d=t?.gpu_metrics.filter(b=>b.temperature_c>=85).length??0;if(d>0&&(c==="healthy"&&(c="warning"),o.push(`${d} GPU${d===1?"":"s"} at or above 85°C`)),t&&t.total_requests>=10){const b=t.failed_requests/t.total_requests;b>=.05&&(c==="healthy"&&(c="warning"),o.push(`${(b*100).toFixed(1)}% session failure rate`))}const h={healthy:{Icon:iD,title:"All operational signals look healthy",copy:n?`${n.summary.ready} of ${n.summary.total} models ready`:"Waiting for model status",className:"border-emerald-800/70 bg-emerald-950/30",iconClass:"text-emerald-300",titleClass:"text-emerald-100"},warning:{Icon:Np,title:"Provider status needs a closer look",copy:o.join(" · "),className:"border-amber-800/70 bg-amber-950/30",iconClass:"text-amber-300",titleClass:"text-amber-100"},critical:{Icon:Pa,title:"Provider needs attention",copy:o.join(" · "),className:"border-red-800/70 bg-red-950/30",iconClass:"text-red-300",titleClass:"text-red-100"}}[c],v=h.Icon,p=`${h.title}. ${h.copy}`;return g.jsxs("div",{role:c==="critical"?"alert":"status",title:p,className:`flex min-w-0 max-w-full items-center gap-2 rounded-lg border px-3 py-1.5 ${h.className}`,children:[g.jsx(v,{"aria-hidden":"true",size:16,className:`shrink-0 ${h.iconClass}`}),g.jsxs("p",{className:`min-w-0 truncate text-sm font-medium ${h.titleClass}`,children:[h.title,h.copy&&g.jsx("span",{className:"ml-2 font-normal text-slate-300",children:h.copy})]}),c!=="healthy"&&g.jsxs("button",{type:"button",onClick:()=>document.getElementById("operations-heading")?.scrollIntoView({behavior:"smooth"}),className:"ml-1 inline-flex shrink-0 items-center gap-1 rounded-md border border-current/30 px-2 py-1 text-xs font-medium text-slate-200 hover:bg-white/5 focus:outline-none focus:ring-2 focus:ring-blue-400",children:["Review ",g.jsx(kc,{"aria-hidden":"true",size:13})]})]})}const yl=5e3,n3=[{id:"overview",label:"Overview",icon:bD},{id:"transactions",label:"Requests",icon:ND},{id:"settings",label:"Settings",icon:Z_}];function Y_(){const e=window.location.hash.replace("#","");return n3.some(t=>t.id===e)?e:"overview"}function IG(){const[e,t]=S.useState(null),[n,a]=S.useState(Y_),[l,o]=S.useState(!1),[c,f]=S.useState(!1),[d,h]=S.useState(!1),{data:v,error:p,loading:b,refreshing:x,refetch:O}=Da(S.useCallback(()=>Ze.getMetrics(),[]),yl),{data:j,error:_,loading:E,refreshing:N,lastUpdated:M,refetch:P}=Da(S.useCallback(()=>Ze.getStatus(),[]),yl),{data:T,error:C,loading:R,refreshing:F,refetch:ee}=Da(S.useCallback(()=>Ze.getEarnings(),[]),yl),{data:q,error:U,loading:B,refreshing:ue,refetch:oe}=Da(S.useCallback(()=>Ze.getModels(),[]),yl),{data:ve,error:K,loading:te,refreshing:z,refetch:G}=Da(S.useCallback(()=>Ze.getRequestManagement(),[]),yl);S.useEffect(()=>{Ze.hasAccessToken()&&Ze.getSettings().then(()=>o(!0)).catch(()=>{Ze.clearAccessToken(),o(!1)})},[]),S.useEffect(()=>{const he=()=>{a(Y_()),window.scrollTo({top:0})};return window.addEventListener("hashchange",he),()=>window.removeEventListener("hashchange",he)},[]);const re=()=>{O(),P(),oe(),G(),ee()},k=()=>{Ze.clearAccessToken(),o(!1)},Z=S.useCallback(()=>f(!1),[]),ie=S.useCallback(()=>t(null),[]),le=S.useCallback(()=>{o(!0),f(!1)},[]),ye=he=>{n==="settings"&&he!=="settings"&&d&&!window.confirm("Leave settings and discard unsaved changes?")||(a(he),window.history.replaceState(null,"",`#${he}`),window.scrollTo({top:0}),he==="settings"&&!l&&f(!0))},be=x||N||F||ue||z;return g.jsxs("div",{className:"min-h-screen bg-slate-950 text-slate-100",children:[g.jsxs("header",{className:"border-b border-slate-800 bg-slate-900/95",children:[g.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col items-stretch gap-3 px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[g.jsx("div",{className:"rounded-xl bg-blue-500/10 p-2 text-blue-400",children:g.jsx(RD,{"aria-hidden":"true",size:24})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("h1",{className:"truncate text-lg font-semibold tracking-tight text-white sm:text-xl",children:"Provider Console"}),g.jsxs("p",{className:"text-xs text-slate-400",children:["Inference operations",j?.version&&g.jsxs(g.Fragment,{children:[" · ",g.jsxs("span",{title:j.build??void 0,className:"font-mono text-slate-400",children:["v",j.version]})]})]})]})]}),g.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2 sm:justify-end sm:gap-3",children:[g.jsx(kG,{status:j,loading:E,error:_,lastUpdated:M}),g.jsxs("button",{type:"button",onClick:re,disabled:be,className:"inline-flex min-h-10 min-w-10 items-center justify-center gap-2 rounded-lg border border-slate-700 bg-slate-800 px-3 text-sm text-slate-200 transition hover:border-slate-600 hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Refresh dashboard data",children:[g.jsx(Pl,{"aria-hidden":"true",size:16,className:be?"animate-spin":""}),g.jsx("span",{className:"hidden sm:inline",children:be?"Refreshing…":"Refresh"})]}),l?g.jsxs("button",{type:"button",onClick:k,className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-slate-700 px-3 text-sm text-slate-300 transition hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[g.jsx(wD,{"aria-hidden":"true",size:16}),g.jsx("span",{className:"hidden sm:inline",children:"Lock"})]}):g.jsxs("button",{type:"button",onClick:()=>f(!0),className:"inline-flex min-h-10 items-center gap-2 rounded-lg bg-blue-600 px-3 text-sm font-medium text-white transition hover:bg-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-400",children:[g.jsx(C0,{"aria-hidden":"true",size:16}),g.jsx("span",{className:"hidden sm:inline",children:"Unlock controls"}),g.jsx("span",{className:"sm:hidden",children:"Unlock"})]})]})]}),g.jsx("nav",{"aria-label":"Dashboard sections",className:"mx-auto max-w-7xl px-4 sm:px-6",children:g.jsx("div",{className:"flex gap-1 overflow-hidden",children:n3.map(he=>{const ut=he.icon,W=n===he.id;return g.jsxs("button",{type:"button",onClick:()=>ye(he.id),"aria-current":W?"page":void 0,className:`inline-flex min-h-11 min-w-0 flex-1 items-center justify-center gap-1.5 whitespace-nowrap border-b-2 px-2 text-xs font-medium transition focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500 sm:flex-none sm:gap-2 sm:px-5 sm:text-sm ${W?"border-blue-500 text-white":"border-transparent text-slate-400 hover:border-slate-700 hover:text-slate-200"}`,children:[g.jsx(ut,{"aria-hidden":"true",size:16}),he.label]},he.id)})})})]}),g.jsxs("main",{className:"mx-auto max-w-7xl px-4 py-5 sm:px-6 sm:py-6",children:[n==="overview"&&g.jsxs("div",{className:"space-y-6",children:[g.jsxs("section",{"aria-labelledby":"provider-health-heading",children:[g.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("h2",{id:"provider-health-heading",className:"text-xl font-semibold text-white",children:"Provider overview"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Current service health, traffic, and earnings."})]}),g.jsx(BG,{status:j,metrics:v,models:q,loading:E||b||B,dataIssues:[{label:"connection",error:_},{label:"metrics",error:p},{label:"models",error:U},{label:"request controls",error:K},{label:"earnings",error:C}]})]}),g.jsx(EG,{metrics:v,loading:b,error:p,earnings:T,earningsError:C,earningsLoading:R})]}),g.jsxs("section",{"aria-labelledby":"operations-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"operations-heading",className:"text-xl font-semibold text-white",children:"Operations"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"Model readiness and local resource pressure."})]}),g.jsxs("div",{className:"grid items-start gap-6 lg:grid-cols-2",children:[g.jsxs("div",{className:"min-w-0 space-y-6",children:[g.jsx(MG,{models:q?.models??[],healthLog:q?.health_log,prices:q?.prices??{},summary:q?.summary,loading:B,error:U,onRefresh:oe,onModelClick:t,authenticated:l,onUnlock:()=>f(!0)}),g.jsx(CG,{data:ve,loading:te,error:K,onOpenSettings:()=>ye("settings")})]}),g.jsxs("div",{className:"min-w-0 space-y-6",children:[g.jsxs("section",{"aria-labelledby":"earnings-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"earnings-heading",className:"text-xl font-semibold text-white",children:"Earnings and traffic mix"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Estimated local history and the models contributing to it."})]}),g.jsxs("div",{className:"min-w-0 space-y-4",children:[g.jsx(JD,{models:T?.models}),g.jsx(OG,{earnings:T,loading:R&&!T,error:C})]})]}),g.jsx(NG,{gpus:v?.gpu_metrics??[],loading:b,error:p})]})]})]}),g.jsxs("section",{"aria-labelledby":"performance-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"performance-heading",className:"text-xl font-semibold text-white",children:"Performance"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Persistent trends that remain available after navigation or restart."})]}),g.jsx(zG,{})]})]}),n==="transactions"&&g.jsx(PG,{models:q?.models??[]}),n==="settings"&&g.jsx(qG,{authenticated:l,onUnlock:()=>f(!0),onModelsSaved:oe,onDirtyChange:h})]}),g.jsx("footer",{className:"mt-8 border-t border-slate-800 bg-slate-900 px-4 py-4 sm:px-6",children:g.jsxs("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-2 text-xs text-slate-400",children:[g.jsx("span",{children:"Swan Chain Computing Provider"}),g.jsxs("span",{children:["Core monitoring refreshes every ",yl/1e3,"s"]})]})}),e&&g.jsx(RG,{modelId:e,onClose:ie}),g.jsx(LG,{open:c,onClose:Z,onAuthenticated:le})]})}R4.createRoot(document.getElementById("root")).render(g.jsx(S.StrictMode,{children:g.jsx(IG,{})})); diff --git a/internal/dashboard/ui/dist/index.html b/internal/dashboard/ui/dist/index.html index d36cbca..e8b7498 100644 --- a/internal/dashboard/ui/dist/index.html +++ b/internal/dashboard/ui/dist/index.html @@ -6,7 +6,7 @@ Swan Provider Console - + diff --git a/internal/dashboard/ui/src/components/EarningsChart.tsx b/internal/dashboard/ui/src/components/EarningsChart.tsx index d995dfa..30f822c 100644 --- a/internal/dashboard/ui/src/components/EarningsChart.tsx +++ b/internal/dashboard/ui/src/components/EarningsChart.tsx @@ -135,7 +135,46 @@ export function EarningsChart({ models }: EarningsChartProps) { 60_000, ); - const colours = useMemo(() => buildModelColours(models), [models]); + /** + * Colour assignment has to survive a restart. + * + * `models` is the provider's lifetime per-model earnings, read from + * in-memory counters that reset when the process bounces. Straight after a + * restart it lists only the models that have served since — so every other + * model in the window lost its colour and folded into "Other", even though + * the history holds full per-model figures for all of them. + * + * The stored history is the durable source, so it is merged in: a model is + * ranked on whichever total is larger. Lifetime still dominates once the + * counters have rebuilt, which keeps colours stable across window changes in + * the ordinary case. + */ + const colours = useMemo(() => { + const totals = new Map(); + for (const m of models ?? []) totals.set(m.model, m.total_usd); + // Sum each model across the window, then rank it on whichever figure is + // larger — the lifetime counter or what the stored history shows. + const windowTotals = new Map(); + for (const p of data?.points ?? []) { + for (const [id, m] of Object.entries(p.models ?? {})) { + windowTotals.set(id, (windowTotals.get(id) ?? 0) + m.usd); + } + } + for (const [id, usd] of windowTotals) { + totals.set(id, Math.max(totals.get(id) ?? 0, usd)); + } + return buildModelColours( + [...totals].map(([model, total_usd]) => ({ + model, + total_usd, + tokens_in: 0, + tokens_out: 0, + input_usd: 0, + output_usd: 0, + priced: true, + })), + ); + }, [models, data?.points]); const points = useMemo(() => data?.points ?? [], [data?.points]); const bucketSeconds = data?.bucket_seconds; // How much of this window came from the platform's ledger. The provenance